From 25b10c3d3169ab9c1c1a0cf705b27e0cca1e24be Mon Sep 17 00:00:00 2001 From: Andrew McNutt Date: Tue, 29 Aug 2023 18:38:12 -0500 Subject: [PATCH] Finish fixing build (#162) * Fix a react markdown bug * require a high node version * picked too high an engine * nvm rc * fiddle * ??? * . * fix build errors? * stringify fix * fix lint * finish lint * . --- .nvmrc | 1 + LICENSE | 4 +- LICENSE.txt | 21 - package.json | 32 +- {assets => public/assets}/atom-logo.png | Bin .../assets}/chart-gallery-logo.png | Bin .../assets/collected-data}/Strikes-dirty.csv | 0 .../collected-data}/american-executions.json | 0 .../collected-data}/american-executions.tsv | 0 .../assets/collected-data}/deaths.json | 0 .../assets/collected-data}/drone-strikes.json | 0 .../assets/collected-data}/gapminder.csv | 0 .../assets/collected-data}/gapminder_tidy.csv | 0 .../assets/collected-data}/hlth_cd_anr_1.tsv | 0 {assets => public/assets}/example-chart.png | Bin {assets => public/assets}/ivy.0.0.1.json | 0 {assets => public/assets}/ivy.json | 0 {assets => public/assets}/logo.png | Bin {assets => public/assets}/polestar-logo.png | Bin favicon.ico => public/favicon.ico | Bin public/index.html | 66 + logo.png => public/logo.png | Bin src/components/encoding-column.tsx | 6 +- src/components/filter.tsx | 2 + src/components/modals/data-modal.tsx | 7 +- src/components/monaco-wrapper.tsx | 4 +- src/components/prong-wrapper.tsx | 1 + src/components/split-pane.tsx | 1 + src/components/template-card.tsx | 2 +- .../tooltips/publish-instance-tooltip.tsx | 7 +- src/components/view-controls.tsx | 1 + src/components/widgets/free-text-widget.tsx | 2 + src/components/widgets/general-widget.tsx | 1 + src/components/widgets/list-widget.tsx | 2 + src/components/widgets/section-widget.tsx | 4 +- src/components/widgets/switch-widget.tsx | 4 + src/components/widgets/widget-common.tsx | 2 + .../widgets/widget-configuration-controls.tsx | 1 + src/containers/chart-container.tsx | 2 +- src/containers/code-editor.tsx | 2 +- src/containers/docs.tsx | 26 +- src/containers/editor.tsx | 3 +- src/containers/hot-key-provider.tsx | 1 + src/languages/sample-language.tsx | 2 +- src/languages/unit-vis.tsx | 2 +- src/languages/vega-lite.tsx | 2 +- src/languages/vega.tsx | 7 +- src/reducers/template-actions.ts | 2 +- src/templates/atom-example.ts | 2 +- src/templates/atom.ts | 2 +- src/templates/bee-swarm.ts | 2 +- src/templates/parallel-coordinates.ts | 2 +- src/templates/pie-chart.ts | 2 +- src/templates/polestar-template.ts | 2 +- src/templates/radar-chart.ts | 2 +- src/templates/scatterplot.ts | 2 +- src/templates/simple-scatterplot.ts | 2 +- src/utils/index.tsx | 3 +- src/utils/local-storage.ts | 4 +- src/utils/monaco.ts | 4 +- src/utils/stringify.ts | 5 + style.css | 0 vite.config.ts | 25 +- yarn.lock | 4097 ++++++++--------- 64 files changed, 2153 insertions(+), 2223 deletions(-) create mode 100644 .nvmrc delete mode 100644 LICENSE.txt rename {assets => public/assets}/atom-logo.png (100%) rename {assets => public/assets}/chart-gallery-logo.png (100%) rename {collected-data => public/assets/collected-data}/Strikes-dirty.csv (100%) rename {collected-data => public/assets/collected-data}/american-executions.json (100%) rename {collected-data => public/assets/collected-data}/american-executions.tsv (100%) rename {collected-data => public/assets/collected-data}/deaths.json (100%) rename {collected-data => public/assets/collected-data}/drone-strikes.json (100%) rename {collected-data => public/assets/collected-data}/gapminder.csv (100%) rename {collected-data => public/assets/collected-data}/gapminder_tidy.csv (100%) rename {collected-data => public/assets/collected-data}/hlth_cd_anr_1.tsv (100%) rename {assets => public/assets}/example-chart.png (100%) rename {assets => public/assets}/ivy.0.0.1.json (100%) rename {assets => public/assets}/ivy.json (100%) rename {assets => public/assets}/logo.png (100%) rename {assets => public/assets}/polestar-logo.png (100%) rename favicon.ico => public/favicon.ico (100%) create mode 100644 public/index.html rename logo.png => public/logo.png (100%) create mode 100644 src/utils/stringify.ts delete mode 100644 style.css diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..5e0828ad --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v18.16.1 diff --git a/LICENSE b/LICENSE index 6b6402db..efcf8901 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 IVY AUTHORS +Copyright (c) 2021 - Andrew McNutt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index efcf8901..00000000 --- a/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 - Andrew McNutt - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/package.json b/package.json index 52b478b3..1c7c1af0 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,10 @@ "main": "index.js", "author": "", "license": "ISC", + "engines": { + "node": ">=16.20.1" + }, + "type": "module", "devDependencies": { "@babel/core": "^7.16.12", "@jest/globals": "^29.6.1", @@ -13,24 +17,17 @@ "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", "@types/d3": "^7.4.0", - "@types/friendly-words": "^1.2.0", "@types/jest": "^29.5.2", "@types/json-schema": "^7.0.12", - "@types/lodash.isequal": "^4.5.5", - "@types/lodash.merge": "^4.6.7", - "@types/mongodb": "^4.0.7", "@types/node": "^20.4.0", - "@types/react": "16", - "@types/react-dom": "16", - "@types/react-syntax-highlighter": "^15.5.7", - "@types/seedrandom": "^3.0.5", + "@types/react": "17", + "@types/react-dom": "17", + "@types/reactour": "^1.17.1", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "@vitejs/plugin-react": "^1.1.4", "@vitejs/plugin-react-swc": "^3.3.2", - "acorn-jsx": "^5.3.2", "ajv": "^6.12.0", - "babel-loader": "^8.2.3", "eslint": "^8.44.0", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-react": "^7.33.2", @@ -51,7 +48,7 @@ "@monaco-editor/react": "^4.5.2", "d3-dsv": "^1.1.1", "datalib": "^1.9.2", - "dom-to-image": "^2.6.0", + "dom-to-image-more": "^3.1.6", "github-markdown-css": "^4.0.0", "idb-keyval": "^3.2.0", "immer": "^5.3.2", @@ -71,17 +68,17 @@ "react-dropzone": "^11.0.1", "react-hotkeys": "^2.0.0", "react-icons": "^3.8.0", - "react-markdown": "^4.3.1", + "react-markdown": "^7.1.0", "react-monaco-editor": "^0.32.1", "react-redux": "^6.0.1", "react-router-dom": "^5.2.0", "react-split-pane": "^0.1.89", "react-switch": "^5.0.1", "react-vega": "^7.3", - "reactour": "^1.19.0", + "reactour": "^1.18.0", "redux": "^4.0.1", "redux-thunk": "^2.2.0", - "styled-components": "^4.0.0", + "styled-components": "^6.0.7", "type-analyzer": "^0.2.3", "unit-vis": "^0.0.4", "vega": "^5.13.0", @@ -93,14 +90,11 @@ "scripts": { "dev": "vite", "start": "netlify dev", - "build": "NODE_ENV=production vite build", + "build": "NODE_ENV=production tsc && vite build", "lint": "yarn lint:ts", "lint:ts": "eslint --ext .ts --ext .tsx src", - "lint:fix": "eslint './src/**/*.{ts,tsx}'", "test": "NODE_ENV=test && jest", "coverage": "yarn test --collect-coverage", - "prettify": "prettier --write 'src/**/*.{ts,tsx}'", - "analyze": "NODE_ENV=analysis webpack --profile > stats.json", "schema-mod": "ts-node scripts/generate-schema-mod.ts" }, "jest": { @@ -127,4 +121,4 @@ "^react-dnd-test-utils$": "react-dnd-test-utils/dist/cjs" } } -} +} \ No newline at end of file diff --git a/assets/atom-logo.png b/public/assets/atom-logo.png similarity index 100% rename from assets/atom-logo.png rename to public/assets/atom-logo.png diff --git a/assets/chart-gallery-logo.png b/public/assets/chart-gallery-logo.png similarity index 100% rename from assets/chart-gallery-logo.png rename to public/assets/chart-gallery-logo.png diff --git a/collected-data/Strikes-dirty.csv b/public/assets/collected-data/Strikes-dirty.csv similarity index 100% rename from collected-data/Strikes-dirty.csv rename to public/assets/collected-data/Strikes-dirty.csv diff --git a/collected-data/american-executions.json b/public/assets/collected-data/american-executions.json similarity index 100% rename from collected-data/american-executions.json rename to public/assets/collected-data/american-executions.json diff --git a/collected-data/american-executions.tsv b/public/assets/collected-data/american-executions.tsv similarity index 100% rename from collected-data/american-executions.tsv rename to public/assets/collected-data/american-executions.tsv diff --git a/collected-data/deaths.json b/public/assets/collected-data/deaths.json similarity index 100% rename from collected-data/deaths.json rename to public/assets/collected-data/deaths.json diff --git a/collected-data/drone-strikes.json b/public/assets/collected-data/drone-strikes.json similarity index 100% rename from collected-data/drone-strikes.json rename to public/assets/collected-data/drone-strikes.json diff --git a/collected-data/gapminder.csv b/public/assets/collected-data/gapminder.csv similarity index 100% rename from collected-data/gapminder.csv rename to public/assets/collected-data/gapminder.csv diff --git a/collected-data/gapminder_tidy.csv b/public/assets/collected-data/gapminder_tidy.csv similarity index 100% rename from collected-data/gapminder_tidy.csv rename to public/assets/collected-data/gapminder_tidy.csv diff --git a/collected-data/hlth_cd_anr_1.tsv b/public/assets/collected-data/hlth_cd_anr_1.tsv similarity index 100% rename from collected-data/hlth_cd_anr_1.tsv rename to public/assets/collected-data/hlth_cd_anr_1.tsv diff --git a/assets/example-chart.png b/public/assets/example-chart.png similarity index 100% rename from assets/example-chart.png rename to public/assets/example-chart.png diff --git a/assets/ivy.0.0.1.json b/public/assets/ivy.0.0.1.json similarity index 100% rename from assets/ivy.0.0.1.json rename to public/assets/ivy.0.0.1.json diff --git a/assets/ivy.json b/public/assets/ivy.json similarity index 100% rename from assets/ivy.json rename to public/assets/ivy.json diff --git a/assets/logo.png b/public/assets/logo.png similarity index 100% rename from assets/logo.png rename to public/assets/logo.png diff --git a/assets/polestar-logo.png b/public/assets/polestar-logo.png similarity index 100% rename from assets/polestar-logo.png rename to public/assets/polestar-logo.png diff --git a/favicon.ico b/public/favicon.ico similarity index 100% rename from favicon.ico rename to public/favicon.ico diff --git a/public/index.html b/public/index.html new file mode 100644 index 00000000..6f667058 --- /dev/null +++ b/public/index.html @@ -0,0 +1,66 @@ + + + + + Ivy - Integrated Visualization Editor + + + + + + + + + + + + + Ivy - Integrated Visualization Editor + + + +
+ + <% if (process.env.REACT_APP_DISABLE_LIVE_RELOAD === "true") { %> + + + <% } %> + + diff --git a/logo.png b/public/logo.png similarity index 100% rename from logo.png rename to public/logo.png diff --git a/src/components/encoding-column.tsx b/src/components/encoding-column.tsx index 6d0dcc22..385e1c7b 100644 --- a/src/components/encoding-column.tsx +++ b/src/components/encoding-column.tsx @@ -187,7 +187,7 @@ export default function EncodingColumn(props: EncodingColumnProps): JSX.Element setAllTemplateValues={setAllTemplateValues} setTemplateValue={setTemplateValue} setWidgetValue={setWidgetValue} - disallowFanout={template.disallowFanOut} + disallowFanout={!!template.disallowFanOut} customCards={template.customCards} setMaterialization={setMaterialization} widgetValue={templateMap.paramValues[widget.name]} @@ -219,6 +219,7 @@ export default function EncodingColumn(props: EncodingColumnProps): JSX.Element {editMode && template && (
+ {/* @ts-ignore */} modifyValueOnTemplate({ value, @@ -263,6 +264,7 @@ export default function EncodingColumn(props: EncodingColumnProps): JSX.Element + {/* @ts-ignore */} + {/* @ts-ignore */}
Start @@ -44,6 +45,7 @@ function MeasureFilter({filter, column, updateFilter}: Props): JSX.Element { const {domain} = column; return (
+ {/* @ts-ignore */}
min diff --git a/src/components/modals/data-modal.tsx b/src/components/modals/data-modal.tsx index 042a9112..8b124ff3 100644 --- a/src/components/modals/data-modal.tsx +++ b/src/components/modals/data-modal.tsx @@ -21,9 +21,9 @@ interface Props { export default function DataModal(props: Props): JSX.Element { const {changeSelectedFile, loadCustomDataset, setModalState} = props; - const [searchTerm, setSearchTerm] = useState(null); + const [searchTerm, setSearchTerm] = useState(null); const [sortMode, setSortMode] = useState('FAVORITES'); - const [favs, setFavs] = useState(new Set([])); + const [favs, setFavs] = useState>(new Set([])); useEffect(() => { getFavoriteDatasets().then((x) => { const entries = x && x.length ? x : ['cars.json', 'penguins.json']; @@ -35,7 +35,7 @@ export default function DataModal(props: Props): JSX.Element { const file = acceptedFiles[0]; const reader = new FileReader(); reader.onload = (event): void => { - loadCustomDataset({fileName: file.name, data: event.target.result as any}); + loadCustomDataset({fileName: file.name, data: event!.target?.result as any}); setModalState(null); }; @@ -53,6 +53,7 @@ export default function DataModal(props: Props): JSX.Element {

Predefined Datasets

+ {/* @ts-ignore */} { return oldMode !== newMode ? this.editor.getScrollTop() : null; } - componentDidUpdate(prevProps: Props, prevState: State, currentTop: number): void { + componentDidUpdate(prevProps: Props, _: State, currentTop: number): void { const oldMode = prevProps.codeMode; const newMode = this.props.codeMode; if (oldMode !== newMode) { @@ -75,7 +75,7 @@ export default class CodeEditor extends React.Component { setEditMode, } = this.props; return ( - /*eslint-disable react/no-string-refs*/ + // @ts-ignore - {symbol.split('-').map((key, idx, arr) => { + {symbol.split('-').map((key, _, arr) => { const circType = arr.length === 1 ? 'full' : arr.length === 2 ? 'half' : 'third'; return (
new URL(name, import.meta.url).href +// const DomToImage = require('dom-to-image'); import Tooltip from 'rc-tooltip'; import {TiUpload} from 'react-icons/ti'; import VegaDatasets from '../../constants/vega-datasets-counts.json'; @@ -18,7 +21,7 @@ interface Props { } export default function PublishInstanceTooltip(props: Props): JSX.Element { - const [error, setError] = useState(null); + const [error, setError] = useState(null); const [saved, setSaved] = useState(false); const {templateAuthor, templateName, templateMap, dataset, userName} = props; useEffect(() => { diff --git a/src/components/view-controls.tsx b/src/components/view-controls.tsx index 2e415f2c..456668c0 100644 --- a/src/components/view-controls.tsx +++ b/src/components/view-controls.tsx @@ -48,6 +48,7 @@ function viewOption(props: ViewOptionProps): JSX.Element { overlay={
View Controls
+ {/* @ts-ignore */} ): JSX. + {/* @ts-ignore */} ): JSX.Elem return (
{widgetName(widget, editMode)}
+ {/* @ts-ignore */} {!widget.config.useParagraph && } {widget.config.useParagraph &&