From 2e2ebbf75b12784ac664d864865f01729b3eb8c4 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Thu, 24 Aug 2023 00:06:37 +0200 Subject: refactor(web): clean up graphviz visualization --- .../frontend/config/graphvizUMDVitePlugin.ts | 6 + subprojects/frontend/index.html | 2 +- subprojects/frontend/package.json | 3 +- subprojects/frontend/src/TopBar.tsx | 11 +- subprojects/frontend/src/editor/EditorTheme.ts | 3 +- .../frontend/src/graph/DotGraphVisualizer.tsx | 142 ++++++++ subprojects/frontend/src/graph/GraphArea.tsx | 380 +-------------------- subprojects/frontend/src/graph/GraphPane.tsx | 2 +- subprojects/frontend/src/graph/GraphTheme.tsx | 64 ++++ subprojects/frontend/src/graph/ZoomButtons.tsx | 43 +++ subprojects/frontend/src/graph/ZoomCanvas.tsx | 177 ++++++++++ subprojects/frontend/src/graph/parseBBox.ts | 68 ++++ subprojects/frontend/src/graph/postProcessSVG.ts | 79 +++++ subprojects/frontend/src/theme/ThemeProvider.tsx | 10 +- subprojects/frontend/vite.config.ts | 2 +- 15 files changed, 607 insertions(+), 385 deletions(-) create mode 100644 subprojects/frontend/src/graph/DotGraphVisualizer.tsx create mode 100644 subprojects/frontend/src/graph/GraphTheme.tsx create mode 100644 subprojects/frontend/src/graph/ZoomButtons.tsx create mode 100644 subprojects/frontend/src/graph/ZoomCanvas.tsx create mode 100644 subprojects/frontend/src/graph/parseBBox.ts create mode 100644 subprojects/frontend/src/graph/postProcessSVG.ts (limited to 'subprojects/frontend') diff --git a/subprojects/frontend/config/graphvizUMDVitePlugin.ts b/subprojects/frontend/config/graphvizUMDVitePlugin.ts index 7a42560b..9c60a84e 100644 --- a/subprojects/frontend/config/graphvizUMDVitePlugin.ts +++ b/subprojects/frontend/config/graphvizUMDVitePlugin.ts @@ -1,3 +1,9 @@ +/* + * SPDX-FileCopyrightText: 2023 The Refinery Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + import { readFile } from 'node:fs/promises'; import path from 'node:path'; diff --git a/subprojects/frontend/index.html b/subprojects/frontend/index.html index 1bf3472e..f4b46da2 100644 --- a/subprojects/frontend/index.html +++ b/subprojects/frontend/index.html @@ -18,7 +18,7 @@ diff --git a/subprojects/frontend/package.json b/subprojects/frontend/package.json index 97f6baf6..3ebb1542 100644 --- a/subprojects/frontend/package.json +++ b/subprojects/frontend/package.json @@ -37,8 +37,8 @@ "@codemirror/view": "^6.16.0", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", - "@fontsource-variable/inter": "^5.0.8", "@fontsource-variable/jetbrains-mono": "^5.0.9", + "@fontsource-variable/open-sans": "^5.0.9", "@hpcc-js/wasm": "^2.13.1", "@lezer/common": "^1.0.3", "@lezer/highlight": "^1.1.6", @@ -53,7 +53,6 @@ "d3-selection": "^3.0.0", "d3-zoom": "patch:d3-zoom@npm%3A3.0.0#~/.yarn/patches/d3-zoom-npm-3.0.0-18f706a421.patch", "escape-string-regexp": "^5.0.0", - "json-stringify-pretty-compact": "^4.0.0", "lodash-es": "^4.17.21", "loglevel": "^1.8.1", "loglevel-plugin-prefix": "^0.8.4", diff --git a/subprojects/frontend/src/TopBar.tsx b/subprojects/frontend/src/TopBar.tsx index f2542b14..c722c203 100644 --- a/subprojects/frontend/src/TopBar.tsx +++ b/subprojects/frontend/src/TopBar.tsx @@ -124,7 +124,16 @@ export default observer(function TopBar(): JSX.Element { href="https://www.mcgill.ca/ece/daniel-varro" target="_blank" > - McGill ECE + McGill ECE + +