Skip to content

Commit

Permalink
Try importing worker differently so not a blob with chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
saulshanabrook committed Sep 20, 2024
1 parent eabb861 commit cfb09bd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
6 changes: 3 additions & 3 deletions src/Visualizer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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:
//
Expand Down Expand Up @@ -77,7 +76,8 @@ const nodeLayoutOptions = {
};

const elk = new ELK({
workerUrl: ELKWorkerURL,
workerFactory: () => new ELKWorker(),
workerUrl: "",
});
type EGraphNodeID = string;
type EGraphClassID = string;
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit cfb09bd

Please sign in to comment.