Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump csv-parse from 2.5.0 to 4.4.6 #53

Open
wants to merge 115 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
cc7865c
doc renderer supports sections
Jutanium Dec 14, 2020
0c7d6c6
delete docs config from repo
Jutanium Dec 14, 2020
2fb0831
broken parseInner function
Jutanium Dec 16, 2020
6e2b993
working parseInner function
Jutanium Dec 16, 2020
b9ad051
no docsconfig file warning
Jutanium Dec 19, 2020
8514589
Merge branch 'docs-integration'
Jutanium Dec 20, 2020
e555af0
added vis back
Dec 20, 2020
5337492
Merge pull request #69 from GeorgiaTechDHLab/playfair-covid-vis
jianingfu Dec 20, 2020
398b054
added uk covid data
Dec 21, 2020
d55374d
Merge pull request #70 from GeorgiaTechDHLab/playfair-covid-vis
jianingfu Dec 21, 2020
06c15e2
fix type function error
Jutanium Dec 21, 2020
3d6682d
footnote & inline slot support
Jutanium Dec 21, 2020
c8b9645
Merge branch 'master' of https://github.com/GeorgiaTechDHLab/DataByDe…
Jutanium Dec 21, 2020
f080a1e
basic inline slot inner text support
Jutanium Dec 21, 2020
b0d1482
deal with objects before first section
Jutanium Dec 21, 2020
9b3f19f
peabody is docs
Jutanium Dec 21, 2020
66935a9
complete covid data, bug fix, add router link to playfair chapter
Dec 22, 2020
6ebf1a2
Merge pull request #71 from GeorgiaTechDHLab/playfair-covid-vis
jianingfu Dec 22, 2020
8dbefe7
don't render empty paragraphs
Jutanium Dec 22, 2020
26cbe0b
proper subsection tracking
Jutanium Dec 22, 2020
057c8a9
Merge pull request #72 from GeorgiaTechDHLab/peabody-docs
Jutanium Dec 22, 2020
109626e
don't show title header for the introduction section
Jutanium Dec 22, 2020
582f6d5
fix and clealeanup playfair Vue options (was previously a copy of Pea…
Jutanium Dec 22, 2020
8ed5932
add prod script
Jutanium Dec 22, 2020
4b29c57
templates done
Jutanium Dec 22, 2020
f0f8394
add more datasets
Dec 22, 2020
e6d10f1
added vis
Dec 23, 2020
493bc45
Merge pull request #73 from GeorgiaTechDHLab/playfair-covid-vis
jianingfu Dec 23, 2020
8a66d73
add script and mode-specific .env file to run remote server
Jutanium Dec 23, 2020
19ef063
Merge branch 'master' of https://github.com/GeorgiaTechDHLab/DataByDe…
Jutanium Dec 23, 2020
8855127
add coxcomb, add dataSelection for covid, women, income
Dec 23, 2020
d9e476e
Merge pull request #74 from GeorgiaTechDHLab/playfair-covid-vis
jianingfu Dec 23, 2020
61cd893
adjust coxcomb
Dec 24, 2020
1ecd773
Merge pull request #75 from GeorgiaTechDHLab/playfair-covid-vis
jianingfu Dec 24, 2020
7ff77c4
second version
Dec 24, 2020
1520e2e
Merge pull request #76 from GeorgiaTechDHLab/playfair-covid-vis
jianingfu Dec 24, 2020
9de820c
footnotes load from doc
Jutanium Dec 25, 2020
68443bc
blockquote component
Jutanium Dec 25, 2020
51ed39f
captionedimage component
Jutanium Dec 25, 2020
bbfaf3e
captionedimage component
Jutanium Dec 25, 2020
e3a6d3f
Merge branch 'master' of https://github.com/GeorgiaTechDHLab/DataByDe…
Jutanium Dec 25, 2020
80be1e7
captioned image width fix
Jutanium Dec 25, 2020
3ec4ee5
Merge pull request #77 from GeorgiaTechDHLab/dxd-text
laurenfklein Dec 26, 2020
dbb1406
playfair navline integration. extract common functionality into navli…
Jutanium Dec 28, 2020
3c50fb6
remove notebooktypes console log
Jutanium Dec 28, 2020
c429d2f
fix homepage timeline hover layers
Dec 28, 2020
414f4ba
Merge pull request #78 from GeorgiaTechDHLab/timeline-fix
jianingfu Dec 28, 2020
6b01127
Update README.md
Jutanium Dec 29, 2020
52578a8
Merge branch 'master' into dxd-text
laurenfklein Dec 31, 2020
ad35025
Merge pull request #79 from GeorgiaTechDHLab/dxd-text
laurenfklein Dec 31, 2020
6d366d5
Updated Playfair vis with final (?) images and captions; removed unus…
laurenfklein Dec 31, 2020
dcad854
Changed some label text and tweaked the label layout
laurenfklein Dec 31, 2020
862ac90
Merge pull request #80 from GeorgiaTechDHLab/dxd-text
laurenfklein Dec 31, 2020
5b18dcd
fix img filename discrepancy
Jutanium Dec 31, 2020
901303e
DocRenderer in its own repo; CaptionedImage registers on the timeline…
Jutanium Dec 31, 2020
e70f9c0
Merge pull request #81 from GeorgiaTechDHLab/modularize-docs-integration
Jutanium Dec 31, 2020
8552936
playfair vis fix
Dec 31, 2020
99ca581
Merge pull request #82 from GeorgiaTechDHLab/playfair_fix
jianingfu Dec 31, 2020
5c177ce
A few more text/image/caption additions to the Peabody and Playfair c…
laurenfklein Jan 1, 2021
63933de
Merge branch 'master' into dxd-text
laurenfklein Jan 1, 2021
f9b9e4a
Merge pull request #83 from GeorgiaTechDHLab/dxd-text
laurenfklein Jan 1, 2021
26d84cc
Replaced thumbnails in timeilne; updated chapter titles throughout
laurenfklein Jan 3, 2021
1205057
Merge pull request #84 from GeorgiaTechDHLab/dxd-text
laurenfklein Jan 3, 2021
5688ea0
Updated peabody chapter router link
laurenfklein Jan 3, 2021
7d9b33f
picline fix
Jan 3, 2021
e461f24
Merge pull request #85 from GeorgiaTechDHLab/homepage-fix
jianingfu Jan 3, 2021
631ac87
fix reduntant "lines of exports"
Jutanium Jan 3, 2021
2272209
begin removing unused files
Jutanium Jan 3, 2021
757d828
fix priestly -> priestley
Jutanium Jan 3, 2021
41ce85e
minor fix
Jan 3, 2021
d949bab
Merge pull request #86 from GeorgiaTechDHLab/playfair-fix
jianingfu Jan 3, 2021
db37fb2
Tweak caption of covid/income/women vis
laurenfklein Jan 4, 2021
8904f0a
add hover over
Jan 4, 2021
270e45b
Merge branch 'master' into playfair-fix
jianingfu Jan 4, 2021
7b7c40a
Merge pull request #87 from GeorgiaTechDHLab/playfair-fix
jianingfu Jan 4, 2021
4c4d685
Added/tweaked vis captions
laurenfklein Jan 4, 2021
bec226f
Merge branch 'master' of https://github.com/GeorgiaTechDHLab/DataByDe…
laurenfklein Jan 4, 2021
65306c8
fix stacked bar
Jan 4, 2021
9874e23
Merge branch 'master' into playfair-fix
jianingfu Jan 4, 2021
a1b4108
Merge pull request #88 from GeorgiaTechDHLab/playfair-fix
jianingfu Jan 4, 2021
27e3339
make header less obtrusive
Jutanium Jan 5, 2021
31360e8
adjust home page margin
Jutanium Jan 5, 2021
4fe1644
align header with chapter when resizing
Jutanium Jan 5, 2021
c002ea6
fix offset accuracy; add pause feature
Jutanium Jan 6, 2021
f4abace
fix offset accuracy; add pause feature
Jutanium Jan 6, 2021
3559f85
Merge branch 'playfair-todos' of github.com:GeorgiaTechDHLab/DataByDe…
Jutanium Jan 6, 2021
83c7e48
playfair scrollytell
Jutanium Jan 6, 2021
1c2a6b9
Merge pull request #90 from GeorgiaTechDHLab/playfair-todos
Jutanium Jan 6, 2021
83dffdc
fix d3 size
Jan 6, 2021
4b71663
Merge pull request #91 from GeorgiaTechDHLab/playfair-fix
jianingfu Jan 6, 2021
10437d4
grid todos
Jutanium Jan 7, 2021
179b8c0
Merge branch 'master' of github.com:GeorgiaTechDHLab/DataByDesign
Jutanium Jan 7, 2021
d0f4e86
Added floorchart images
laurenfklein Jan 7, 2021
1e66548
Merge branch 'master' of https://github.com/GeorgiaTechDHLab/DataByDe…
laurenfklein Jan 7, 2021
3e2e8f8
finally much better collect
Jutanium Jan 7, 2021
86bc6f2
added dot domain
Jan 7, 2021
3e121c0
Merge pull request #92 from GeorgiaTechDHLab/playfair-fix
jianingfu Jan 7, 2021
0ae4adf
(hopefull) fix glitchy second scrollytell
Jutanium Jan 8, 2021
5c6fed0
finish todos
Jutanium Jan 8, 2021
bd52fc7
Updated Playfair process vis text
laurenfklein Jan 8, 2021
b7e9b28
Added missing caption
laurenfklein Jan 8, 2021
da0fafe
Tweaked image sizes
laurenfklein Jan 8, 2021
b6b0de9
adjust easing on playfair mapscroller
Jutanium Jan 8, 2021
283c2bf
update women's grid
Jutanium Jan 8, 2021
d629f4e
update women's grid
Jutanium Jan 8, 2021
5f94b0b
navline fixes
Jutanium Jan 8, 2021
337b589
merge
Jutanium Jan 8, 2021
bc76de8
change import export line colar
Jan 8, 2021
a7189da
Merge pull request #94 from GeorgiaTechDHLab/playfair-fix
jianingfu Jan 8, 2021
748bb91
Added Du Bois chapter and timeline images
laurenfklein Feb 16, 2021
5432570
Updated timeline on Home with thumbnails
laurenfklein Feb 16, 2021
4143cd9
Merge pull request #95 from GeorgiaTechDHLab/du-bois
laurenfklein Feb 16, 2021
f1f2580
add dubois chapter file
Jutanium Feb 24, 2021
e4214b6
fix dubois navline
Jutanium Feb 24, 2021
a043ce5
Bump csv-parse from 2.5.0 to 4.4.6
dependabot[bot] Feb 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*.xml
*.env
dist/
server-express/docsconfig.json
.DS_Store
.idea
.project
Expand Down
5 changes: 5 additions & 0 deletions client/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,10 @@ export default {
clearAuthorization()
throw err
})
},

//Google Docs stuff!
getDoc(docID) {
return axios.get(`${url}/doc/${docID}`)
}
}
6 changes: 3 additions & 3 deletions client/src/components/ChapterScaffold.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</section>
</div>
<aside class="chapter__notebook-col">
<Notebook class="chapter__notebook"/>
<Notebook class="chapter__notebook --stick"/>
</aside>
</section>
</main>
Expand Down Expand Up @@ -182,13 +182,13 @@ a.blue-hover:hover {
.chapter__notebook-col {
grid-column: 3 / span 1;
box-sizing: border-box;
position: relative;
}

.chapter__notebook {
position: sticky;
width: 100%;
height: 100vh;
top: 8vh;
position: sticky;
}

.centered {
Expand Down
151 changes: 151 additions & 0 deletions client/src/docs-integration/DocRenderer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
import api from "../api";
import registeredComponents from "./registered-components";
import {register} from "register-service-worker";

export default {
data () {
return {
docJson: null,
}
},
props: {
sectionRegex: {
type: RegExp,
default () {
return /<b>Section:(.+)<\/b>/g
}
},
sectionComponent: {
type: Object
},
sectionTitleProp: {
type: String,
default: "title"
},
footnoteRefComponent: {
type: Object
},
footnoteRefProp: {
type: String,
default: "number"
},
components: {
type: Object,
default () {
return registeredComponents;
}
},
docId: String
},
render (h) {
const title = (this.docJson && this.docJson.metadata) ? this.docJson.metadata.title : this.docId;

const parseInner = innerData => {
if (innerData) {
const dummy = document.createElement("template");
dummy.innerHTML = innerData;
const map = (arraylike, func) => Array.prototype.map.call(arraylike, func);
const nodeToVDOM = node => {
if (node.nodeType == Node.TEXT_NODE) {
//Footnotes and inline components checking goes here
return node.data;
}
const attrs = Object.fromEntries(
map(node.attributes,
(({name, value}) => ([name, value]))
)
);
if (node.hasChildNodes) {
return h(node.tagName, { attrs }, map(node.childNodes, nodeToVDOM));
}
return h(node.tagName, { attrs });
}
return map(dummy.content.childNodes, nodeToVDOM);
}
}

const createFromObj = (obj) => {
const tag = Object.keys(obj)[0].toLowerCase();
const data = obj[tag];
if (tag == "table") {
if (data.headers.length == 1 && data.rows.length == 0) {
const slotName = data.headers[0];
return h('div', this.$slots[slotName]);
}
if (data.headers.length >= 1 && data.headers[0] == "Component") {
const componentName = data.headers[1];
if (componentName in this.components) {
const component = registeredComponents[componentName];
console.dir(component.props);
let props = {};
data.rows.forEach( ([propName, value]) => {
if (propName in component.props) {
const coerced = component.props[propName](value);
props[propName] = coerced;
}
})
return h(component, {
props
});
}
}
}
if (tag == "ol" || tag == "ul") {
return h(tag, data.map(itemHTML => h("li", {domProps: {innerHTML: itemHTML}})));
}
if (tag == "img") {
const {source, title, alt} = data;
return h(tag, {attrs: {src: source, title, alt}});
}
if (typeof data == "string") {
return h(tag, parseInner(data));
}
}

if (this.docJson && this.docJson.content) {
const content = this.docJson.content;

if (this.sectionRegex && this.sectionComponent) {
const sections = [];
content.forEach( (el, index) => {
const [key, value] = Object.entries(el)[0];
if (typeof value == "string") {
const firstMatch = this.sectionRegex.exec(value);
if (firstMatch && firstMatch.length >= 1) {
let pushObj = { index };
if (firstMatch.length == 2) {
pushObj.title = firstMatch[1];
}
sections.push(pushObj);
}
}
});
if (sections.length > 0) {
return h('div',
sections.map( ({index, title}, arrIndex) =>
(
h(this.sectionComponent, {
props: {[this.sectionTitleProp]: title}
},
content
.slice(index + 1, sections[arrIndex + 1] ? sections[arrIndex + 1].index : content.length)
.map(createFromObj)
)
)
));
}
}

return h('div', content.map(createFromObj))
}
},
created() {
if (this.docId) {
api.getDoc(this.docId).then(resp => {
this.docJson = resp.data;
}).catch(err => {
console.error(err)
})
}
}
}
20 changes: 20 additions & 0 deletions client/src/docs-integration/TestComponent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<template>
<div>
<span v-for="i in count" v-html="word"></span>
</div>
</template>

<script>
export default {
props: {
count: Number,
word: String
}
}
</script>

<style scoped>
span {
margin-right: 2px;
}
</style>
4 changes: 4 additions & 0 deletions client/src/docs-integration/registered-components.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import TestComponent from "./TestComponent";
export default {
Test: TestComponent
}
7 changes: 3 additions & 4 deletions client/src/views/PeabodyChapter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Emerson and Nathaniel Hawthorne. (Hawthorne
was actually married to her sister, Sophia). But Peabody had impact in
her own right: the bookstore that she ran
out of her home, in Boston, functioned as the de facto salon for the
out of her home, in Boston, functioned as the defacto salon for the
transcendentalist movement. She edited and
published the first version of Henry David Thoreau’s essay on civil
disobedience. And she was an educational
Expand Down Expand Up @@ -217,7 +217,7 @@
<FootnoteRef :number="5"></FootnoteRef>
</p>
<Scrollytell :scroll-slots="2"
:top="210"
:top="310"
:margin="'70vh'"
@scroll="onOverlayScroll">
<template v-slot:fixed="{scrolled, progress}">
Expand Down Expand Up @@ -801,7 +801,7 @@
if (this.overlayScroll.scrolled == 1) {
const scale = d3.scaleLinear()
.domain([0.25, 0.7])
.range([0, -350]);
.range([0, -310]);
scale.clamp(true);
const top = scale(this.overlayScroll.progress);
if (top) styles.transform = `translateY(${top}px)`;
Expand Down Expand Up @@ -834,7 +834,6 @@
this.overlayPos = Number(`${year - this.century}.${type}`);
},
onOverlayScroll({scrolled, progress}) {
console.log("got to scroll handler");
this.overlayScroll.scrolled = scrolled;
this.overlayScroll.progress = progress;
},
Expand Down
19 changes: 13 additions & 6 deletions client/src/views/Sandbox.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
<template lang="html">
<div>
<PeabodyGrid :staticDataset="'1'" :mutableDataset="'1'">

</PeabodyGrid>
<PeabodyMutable :width="'400px'" :mutableDataset="'1'"></PeabodyMutable>
</div>
<DocRenderer docId="1wizLoDtZKwD8a39D6qv_mg8vhh4HtFiZ14q6rvH8LfY" :section-component="sectionComponent" :section-title-prop="'title'">
<template v-slot:TestSlot>
<b>Test slot!</b>
</template>
<template v-slot:AnotherSlot>
<p>Another slot goes here</p>
</template>
</DocRenderer>
</template>

<script>

import Section from '@/components/chapters/Section';
import Picline from '@/components/vis/Picline'
import PicCollage from '@/components/vis/PicCollage'
import EventSquare from '@/components/vis/peabody/newpeabodygrid/EventSquare'
import PeabodyGrid from '@/components/vis/peabody/newpeabodygrid/PeabodyGrid'
import PeabodyMutable from "../components/vis/peabody/PeabodyMutable";
import DocRenderer from "../docs-integration/DocRenderer"

export default {
components: {
DocRenderer,
PeabodyGrid,
PeabodyMutable,
Picline,
PicCollage,
EventSquare
},
data: () => ({
sectionComponent: Section,
newImgYear: 1858,
newImgPic: "bad/badder",
focusedImg: "0",
Expand Down
Loading