/** EdgeRouter - Worker * We possibly run very expensive calculations in the edge router, so we cannot do it on the main thread. * However, this results in 2 separate compile stages: * - ARC library * - downstream consumer app * * There is an attempt at automating this by using relative paths so the production library builds the Worker like this: * `return new Worker("" + new URL("assets/edge-router.worker-DKuH-F9K.js", import.meta.url).href)` * You can see the configuration related to this in `vite.config.lib.ts`. */ import type { GraphNodeId, IGraphNode, IGraphEdge, IEdgeRouterMode } from '@adam-sv/arc'; import type { IEdgeDataGeometry } from './types'; export type GraphNodePositionMap = Map; export interface IEdgeRouterWorkerResponse { edges: Array>; instanceRequestCount: number; } export interface IEdgeRouterWorkerProps { edgeMode: IEdgeRouterMode; nodes: IGraphNode[]; edges: IGraphEdge[]; positions: GraphNodePositionMap; instanceRequestCount: number; edgeSpacing?: number; groupPadding?: number; /** debug prints for each request and response to and from the Web Worker */ debug?: boolean; }