diff --git a/package.json b/package.json index fdf1412..48e2673 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "egraph-visualizer", - "version": "0.1.9", + "version": "0.1.10", "repository": { "type": "git", "url": "https://github.com/saulshanabrook/egraph-visualizer.git" diff --git a/src/Visualizer.tsx b/src/Visualizer.tsx index 75bac3a..d7f5c1b 100644 --- a/src/Visualizer.tsx +++ b/src/Visualizer.tsx @@ -8,7 +8,7 @@ import { ErrorBoundary } from "react-error-boundary"; import type { EdgeChange, EdgeProps, EdgeTypes, NodeChange, NodeProps } from "@xyflow/react"; import ELK, { ElkExtendedEdge, ElkNode } from "elkjs/lib/elk-api"; -import ELKWorkerURL from "elkjs/lib/elk-worker?url"; +import ELKWorker from "elkjs/lib/elk-worker?worker"; import { createContext, memo, startTransition, Suspense, use, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react"; import { @@ -29,7 +29,6 @@ import { } from "@xyflow/react"; import "@xyflow/react/dist/style.css"; - // Elk has a *huge* amount of options to configure. To see everything you can // tweak check out: // @@ -77,7 +76,8 @@ const nodeLayoutOptions = { }; const elk = new ELK({ - workerUrl: ELKWorkerURL, + workerFactory: () => new ELKWorker(), + workerUrl: "", }); type EGraphNodeID = string; type EGraphClassID = string; diff --git a/vite.config.ts b/vite.config.ts index 72fe40c..9be4911 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,6 +7,7 @@ export default defineConfig({ base: "/egraph-visualizer/", plugins: [react()], build: { + assetsInlineLimit: (path) => !path.includes("elk-worker"), lib: { entry: [resolve(__dirname, "src/anywidget.tsx"), resolve(__dirname, "src/dom.tsx")], formats: ["es"],