@multiplatform.one/node-graph 7.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +80 -0
- package/css/graph.css +171 -0
- package/demo.ts +14 -0
- package/dist/cjs/NodeGraph.cjs +34 -0
- package/dist/cjs/NodeGraph.native.js +37 -0
- package/dist/cjs/NodeGraph.native.js.map +1 -0
- package/dist/cjs/bench/frameSampler.cjs +290 -0
- package/dist/cjs/bench/frameSampler.native.js +409 -0
- package/dist/cjs/bench/frameSampler.native.js.map +1 -0
- package/dist/cjs/bench/generateGraph.cjs +125 -0
- package/dist/cjs/bench/generateGraph.native.js +128 -0
- package/dist/cjs/bench/generateGraph.native.js.map +1 -0
- package/dist/cjs/diagnostics/GraphDiagnostics.cjs +154 -0
- package/dist/cjs/diagnostics/GraphDiagnostics.native.js +166 -0
- package/dist/cjs/diagnostics/GraphDiagnostics.native.js.map +1 -0
- package/dist/cjs/diagnostics/LiveGraphDiagnostics.cjs +101 -0
- package/dist/cjs/diagnostics/LiveGraphDiagnostics.native.js +106 -0
- package/dist/cjs/diagnostics/LiveGraphDiagnostics.native.js.map +1 -0
- package/dist/cjs/diagnostics/fromWire.cjs +48 -0
- package/dist/cjs/diagnostics/fromWire.native.js +51 -0
- package/dist/cjs/diagnostics/fromWire.native.js.map +1 -0
- package/dist/cjs/diagnostics/lastError.cjs +67 -0
- package/dist/cjs/diagnostics/lastError.native.js +75 -0
- package/dist/cjs/diagnostics/lastError.native.js.map +1 -0
- package/dist/cjs/diagnostics/types.cjs +18 -0
- package/dist/cjs/diagnostics/types.native.js +21 -0
- package/dist/cjs/diagnostics/types.native.js.map +1 -0
- package/dist/cjs/diagnostics/useGraphDiagnostics.cjs +69 -0
- package/dist/cjs/diagnostics/useGraphDiagnostics.native.js +75 -0
- package/dist/cjs/diagnostics/useGraphDiagnostics.native.js.map +1 -0
- package/dist/cjs/dom/GraphDomLayout.cjs +37 -0
- package/dist/cjs/dom/GraphDomLayout.native.js +40 -0
- package/dist/cjs/dom/GraphDomLayout.native.js.map +1 -0
- package/dist/cjs/dom/boot.cjs +100 -0
- package/dist/cjs/dom/boot.native.js +111 -0
- package/dist/cjs/dom/boot.native.js.map +1 -0
- package/dist/cjs/dom/wire.cjs +215 -0
- package/dist/cjs/dom/wire.native.js +274 -0
- package/dist/cjs/dom/wire.native.js.map +1 -0
- package/dist/cjs/edges/GraphEdge.cjs +169 -0
- package/dist/cjs/edges/GraphEdge.native.js +178 -0
- package/dist/cjs/edges/GraphEdge.native.js.map +1 -0
- package/dist/cjs/edges/edgeKinds.cjs +51 -0
- package/dist/cjs/edges/edgeKinds.native.js +54 -0
- package/dist/cjs/edges/edgeKinds.native.js.map +1 -0
- package/dist/cjs/edges/edgeStyle.cjs +94 -0
- package/dist/cjs/edges/edgeStyle.native.js +99 -0
- package/dist/cjs/edges/edgeStyle.native.js.map +1 -0
- package/dist/cjs/index.cjs +197 -0
- package/dist/cjs/index.native.js +200 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/cjs/interaction/lassoIntercept.cjs +54 -0
- package/dist/cjs/interaction/lassoIntercept.native.js +57 -0
- package/dist/cjs/interaction/lassoIntercept.native.js.map +1 -0
- package/dist/cjs/interaction/legalTargets.cjs +75 -0
- package/dist/cjs/interaction/legalTargets.native.js +118 -0
- package/dist/cjs/interaction/legalTargets.native.js.map +1 -0
- package/dist/cjs/interaction/snapAlignment.cjs +165 -0
- package/dist/cjs/interaction/snapAlignment.native.js +245 -0
- package/dist/cjs/interaction/snapAlignment.native.js.map +1 -0
- package/dist/cjs/interaction/snapChanges.cjs +214 -0
- package/dist/cjs/interaction/snapChanges.native.js +269 -0
- package/dist/cjs/interaction/snapChanges.native.js.map +1 -0
- package/dist/cjs/interaction/spatialHash.cjs +97 -0
- package/dist/cjs/interaction/spatialHash.native.js +165 -0
- package/dist/cjs/interaction/spatialHash.native.js.map +1 -0
- package/dist/cjs/interaction/useLassoSelect.cjs +259 -0
- package/dist/cjs/interaction/useLassoSelect.native.js +287 -0
- package/dist/cjs/interaction/useLassoSelect.native.js.map +1 -0
- package/dist/cjs/knobs/KnobEnvelopeProvider.cjs +77 -0
- package/dist/cjs/knobs/KnobEnvelopeProvider.native.js +85 -0
- package/dist/cjs/knobs/KnobEnvelopeProvider.native.js.map +1 -0
- package/dist/cjs/knobs/envelope.cjs +59 -0
- package/dist/cjs/knobs/envelope.native.js +78 -0
- package/dist/cjs/knobs/envelope.native.js.map +1 -0
- package/dist/cjs/knobs/graphKnobs.cjs +39 -0
- package/dist/cjs/knobs/graphKnobs.native.js +43 -0
- package/dist/cjs/knobs/graphKnobs.native.js.map +1 -0
- package/dist/cjs/knobs/useKnobEnvelope.cjs +108 -0
- package/dist/cjs/knobs/useKnobEnvelope.native.js +140 -0
- package/dist/cjs/knobs/useKnobEnvelope.native.js.map +1 -0
- package/dist/cjs/layout/dagre.cjs +125 -0
- package/dist/cjs/layout/dagre.native.js +259 -0
- package/dist/cjs/layout/dagre.native.js.map +1 -0
- package/dist/cjs/layout/layout.cjs +84 -0
- package/dist/cjs/layout/layout.native.js +112 -0
- package/dist/cjs/layout/layout.native.js.map +1 -0
- package/dist/cjs/layout/runner.cjs +194 -0
- package/dist/cjs/layout/runner.native.js +247 -0
- package/dist/cjs/layout/runner.native.js.map +1 -0
- package/dist/cjs/layout/structuredCloneShim.cjs +80 -0
- package/dist/cjs/layout/structuredCloneShim.native.js +160 -0
- package/dist/cjs/layout/structuredCloneShim.native.js.map +1 -0
- package/dist/cjs/layout/types.cjs +18 -0
- package/dist/cjs/layout/types.native.js +21 -0
- package/dist/cjs/layout/types.native.js.map +1 -0
- package/dist/cjs/layout/worker.entry.cjs +58 -0
- package/dist/cjs/layout/worker.entry.native.js +75 -0
- package/dist/cjs/layout/worker.entry.native.js.map +1 -0
- package/dist/cjs/layout/worker.generated.cjs +32 -0
- package/dist/cjs/layout/worker.generated.native.js +35 -0
- package/dist/cjs/layout/worker.generated.native.js.map +1 -0
- package/dist/cjs/model/commands.cjs +235 -0
- package/dist/cjs/model/commands.native.js +317 -0
- package/dist/cjs/model/commands.native.js.map +1 -0
- package/dist/cjs/model/connect.cjs +159 -0
- package/dist/cjs/model/connect.native.js +239 -0
- package/dist/cjs/model/connect.native.js.map +1 -0
- package/dist/cjs/model/document.cjs +18 -0
- package/dist/cjs/model/document.native.js +21 -0
- package/dist/cjs/model/document.native.js.map +1 -0
- package/dist/cjs/model/history.cjs +121 -0
- package/dist/cjs/model/history.native.js +178 -0
- package/dist/cjs/model/history.native.js.map +1 -0
- package/dist/cjs/model/index.cjs +60 -0
- package/dist/cjs/model/index.native.js +63 -0
- package/dist/cjs/model/index.native.js.map +1 -0
- package/dist/cjs/model/schema.cjs +63 -0
- package/dist/cjs/model/schema.native.js +68 -0
- package/dist/cjs/model/schema.native.js.map +1 -0
- package/dist/cjs/model/select.cjs +78 -0
- package/dist/cjs/model/select.native.js +107 -0
- package/dist/cjs/model/select.native.js.map +1 -0
- package/dist/cjs/model/serialize.cjs +332 -0
- package/dist/cjs/model/serialize.native.js +374 -0
- package/dist/cjs/model/serialize.native.js.map +1 -0
- package/dist/cjs/native/DomOnlyStory.cjs +60 -0
- package/dist/cjs/native/DomOnlyStory.native.js +66 -0
- package/dist/cjs/native/DomOnlyStory.native.js.map +1 -0
- package/dist/cjs/native/GraphToolbar.cjs +101 -0
- package/dist/cjs/native/GraphToolbar.native.js +107 -0
- package/dist/cjs/native/GraphToolbar.native.js.map +1 -0
- package/dist/cjs/native/domEntryRegistry.cjs +39 -0
- package/dist/cjs/native/domEntryRegistry.native.js +42 -0
- package/dist/cjs/native/domEntryRegistry.native.js.map +1 -0
- package/dist/cjs/native/graphChildren.cjs +45 -0
- package/dist/cjs/native/graphChildren.native.js +50 -0
- package/dist/cjs/native/graphChildren.native.js.map +1 -0
- package/dist/cjs/nodes/GraphNode.cjs +161 -0
- package/dist/cjs/nodes/GraphNode.native.js +206 -0
- package/dist/cjs/nodes/GraphNode.native.js.map +1 -0
- package/dist/cjs/nodes/GraphPort.cjs +104 -0
- package/dist/cjs/nodes/GraphPort.native.js +108 -0
- package/dist/cjs/nodes/GraphPort.native.js.map +1 -0
- package/dist/cjs/nodes/handleGeometry.cjs +98 -0
- package/dist/cjs/nodes/handleGeometry.native.js +104 -0
- package/dist/cjs/nodes/handleGeometry.native.js.map +1 -0
- package/dist/cjs/nodes/lod.cjs +41 -0
- package/dist/cjs/nodes/lod.native.js +45 -0
- package/dist/cjs/nodes/lod.native.js.map +1 -0
- package/dist/cjs/nodes/nodeMeasure.cjs +108 -0
- package/dist/cjs/nodes/nodeMeasure.native.js +134 -0
- package/dist/cjs/nodes/nodeMeasure.native.js.map +1 -0
- package/dist/cjs/nodes/overviewNode.cjs +74 -0
- package/dist/cjs/nodes/overviewNode.native.js +81 -0
- package/dist/cjs/nodes/overviewNode.native.js.map +1 -0
- package/dist/cjs/react-flow/ConnectionPuck.cjs +122 -0
- package/dist/cjs/react-flow/ConnectionPuck.native.js +143 -0
- package/dist/cjs/react-flow/ConnectionPuck.native.js.map +1 -0
- package/dist/cjs/react-flow/GraphActions.cjs +47 -0
- package/dist/cjs/react-flow/GraphActions.native.js +51 -0
- package/dist/cjs/react-flow/GraphActions.native.js.map +1 -0
- package/dist/cjs/react-flow/GraphCommandBridge.cjs +238 -0
- package/dist/cjs/react-flow/GraphCommandBridge.native.js +272 -0
- package/dist/cjs/react-flow/GraphCommandBridge.native.js.map +1 -0
- package/dist/cjs/react-flow/GraphNodeHost.cjs +77 -0
- package/dist/cjs/react-flow/GraphNodeHost.native.js +89 -0
- package/dist/cjs/react-flow/GraphNodeHost.native.js.map +1 -0
- package/dist/cjs/react-flow/GraphPaintProbe.cjs +60 -0
- package/dist/cjs/react-flow/GraphPaintProbe.native.js +65 -0
- package/dist/cjs/react-flow/GraphPaintProbe.native.js.map +1 -0
- package/dist/cjs/react-flow/GraphZoomVar.cjs +42 -0
- package/dist/cjs/react-flow/GraphZoomVar.native.js +48 -0
- package/dist/cjs/react-flow/GraphZoomVar.native.js.map +1 -0
- package/dist/cjs/react-flow/LassoOverlay.cjs +47 -0
- package/dist/cjs/react-flow/LassoOverlay.native.js +51 -0
- package/dist/cjs/react-flow/LassoOverlay.native.js.map +1 -0
- package/dist/cjs/react-flow/NodeGraphWeb.cjs +386 -0
- package/dist/cjs/react-flow/NodeGraphWeb.native.js +515 -0
- package/dist/cjs/react-flow/NodeGraphWeb.native.js.map +1 -0
- package/dist/cjs/react-flow/SnapGuides.cjs +89 -0
- package/dist/cjs/react-flow/SnapGuides.native.js +114 -0
- package/dist/cjs/react-flow/SnapGuides.native.js.map +1 -0
- package/dist/cjs/react-flow/demoControlBody.cjs +93 -0
- package/dist/cjs/react-flow/demoControlBody.native.js +104 -0
- package/dist/cjs/react-flow/demoControlBody.native.js.map +1 -0
- package/dist/cjs/react-flow/demoNodeBody.cjs +121 -0
- package/dist/cjs/react-flow/demoNodeBody.native.js +131 -0
- package/dist/cjs/react-flow/demoNodeBody.native.js.map +1 -0
- package/dist/cjs/react-flow/fixtures.cjs +215 -0
- package/dist/cjs/react-flow/fixtures.native.js +225 -0
- package/dist/cjs/react-flow/fixtures.native.js.map +1 -0
- package/dist/cjs/react-flow/flowAdapter.cjs +121 -0
- package/dist/cjs/react-flow/flowAdapter.native.js +133 -0
- package/dist/cjs/react-flow/flowAdapter.native.js.map +1 -0
- package/dist/cjs/react-flow/graphHandle.cjs +28 -0
- package/dist/cjs/react-flow/graphHandle.native.js +31 -0
- package/dist/cjs/react-flow/graphHandle.native.js.map +1 -0
- package/dist/cjs/react-flow/nodeCensus.cjs +56 -0
- package/dist/cjs/react-flow/nodeCensus.native.js +80 -0
- package/dist/cjs/react-flow/nodeCensus.native.js.map +1 -0
- package/dist/cjs/react-flow/useGraphController.cjs +297 -0
- package/dist/cjs/react-flow/useGraphController.native.js +393 -0
- package/dist/cjs/react-flow/useGraphController.native.js.map +1 -0
- package/dist/cjs/react-flow/xy.cjs +60 -0
- package/dist/cjs/react-flow/xy.native.js +63 -0
- package/dist/cjs/react-flow/xy.native.js.map +1 -0
- package/dist/cjs/theme/GraphFaces.cjs +114 -0
- package/dist/cjs/theme/GraphFaces.native.js +181 -0
- package/dist/cjs/theme/GraphFaces.native.js.map +1 -0
- package/dist/cjs/theme/GraphVarsStyle.cjs +88 -0
- package/dist/cjs/theme/GraphVarsStyle.native.js +100 -0
- package/dist/cjs/theme/GraphVarsStyle.native.js.map +1 -0
- package/dist/cjs/theme/faces.cjs +121 -0
- package/dist/cjs/theme/faces.generated.cjs +48 -0
- package/dist/cjs/theme/faces.generated.native.js +51 -0
- package/dist/cjs/theme/faces.generated.native.js.map +1 -0
- package/dist/cjs/theme/faces.native.js +133 -0
- package/dist/cjs/theme/faces.native.js.map +1 -0
- package/dist/cjs/theme/graphVars.cjs +318 -0
- package/dist/cjs/theme/graphVars.native.js +351 -0
- package/dist/cjs/theme/graphVars.native.js.map +1 -0
- package/dist/esm/NodeGraph.mjs +9 -0
- package/dist/esm/NodeGraph.mjs.map +1 -0
- package/dist/esm/NodeGraph.native.js +9 -0
- package/dist/esm/NodeGraph.native.js.map +1 -0
- package/dist/esm/bench/frameSampler.mjs +255 -0
- package/dist/esm/bench/frameSampler.mjs.map +1 -0
- package/dist/esm/bench/frameSampler.native.js +371 -0
- package/dist/esm/bench/frameSampler.native.js.map +1 -0
- package/dist/esm/bench/generateGraph.mjs +99 -0
- package/dist/esm/bench/generateGraph.mjs.map +1 -0
- package/dist/esm/bench/generateGraph.native.js +99 -0
- package/dist/esm/bench/generateGraph.native.js.map +1 -0
- package/dist/esm/diagnostics/GraphDiagnostics.mjs +128 -0
- package/dist/esm/diagnostics/GraphDiagnostics.mjs.map +1 -0
- package/dist/esm/diagnostics/GraphDiagnostics.native.js +137 -0
- package/dist/esm/diagnostics/GraphDiagnostics.native.js.map +1 -0
- package/dist/esm/diagnostics/LiveGraphDiagnostics.mjs +76 -0
- package/dist/esm/diagnostics/LiveGraphDiagnostics.mjs.map +1 -0
- package/dist/esm/diagnostics/LiveGraphDiagnostics.native.js +78 -0
- package/dist/esm/diagnostics/LiveGraphDiagnostics.native.js.map +1 -0
- package/dist/esm/diagnostics/fromWire.mjs +23 -0
- package/dist/esm/diagnostics/fromWire.mjs.map +1 -0
- package/dist/esm/diagnostics/fromWire.native.js +23 -0
- package/dist/esm/diagnostics/fromWire.native.js.map +1 -0
- package/dist/esm/diagnostics/lastError.mjs +39 -0
- package/dist/esm/diagnostics/lastError.mjs.map +1 -0
- package/dist/esm/diagnostics/lastError.native.js +44 -0
- package/dist/esm/diagnostics/lastError.native.js.map +1 -0
- package/dist/esm/diagnostics/types.mjs +2 -0
- package/dist/esm/diagnostics/types.mjs.map +1 -0
- package/dist/esm/diagnostics/types.native.js +2 -0
- package/dist/esm/diagnostics/types.native.js.map +1 -0
- package/dist/esm/diagnostics/useGraphDiagnostics.mjs +44 -0
- package/dist/esm/diagnostics/useGraphDiagnostics.mjs.map +1 -0
- package/dist/esm/diagnostics/useGraphDiagnostics.native.js +47 -0
- package/dist/esm/diagnostics/useGraphDiagnostics.native.js.map +1 -0
- package/dist/esm/dom/GraphDomLayout.mjs +11 -0
- package/dist/esm/dom/GraphDomLayout.mjs.map +1 -0
- package/dist/esm/dom/GraphDomLayout.native.js +11 -0
- package/dist/esm/dom/GraphDomLayout.native.js.map +1 -0
- package/dist/esm/dom/boot.mjs +67 -0
- package/dist/esm/dom/boot.mjs.map +1 -0
- package/dist/esm/dom/boot.native.js +75 -0
- package/dist/esm/dom/boot.native.js.map +1 -0
- package/dist/esm/dom/wire.mjs +183 -0
- package/dist/esm/dom/wire.mjs.map +1 -0
- package/dist/esm/dom/wire.native.js +239 -0
- package/dist/esm/dom/wire.native.js.map +1 -0
- package/dist/esm/edges/GraphEdge.mjs +139 -0
- package/dist/esm/edges/GraphEdge.mjs.map +1 -0
- package/dist/esm/edges/GraphEdge.native.js +145 -0
- package/dist/esm/edges/GraphEdge.native.js.map +1 -0
- package/dist/esm/edges/edgeKinds.mjs +25 -0
- package/dist/esm/edges/edgeKinds.mjs.map +1 -0
- package/dist/esm/edges/edgeKinds.native.js +25 -0
- package/dist/esm/edges/edgeKinds.native.js.map +1 -0
- package/dist/esm/edges/edgeStyle.mjs +63 -0
- package/dist/esm/edges/edgeStyle.mjs.map +1 -0
- package/dist/esm/edges/edgeStyle.native.js +65 -0
- package/dist/esm/edges/edgeStyle.native.js.map +1 -0
- package/dist/esm/index.mjs +50 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +50 -0
- package/dist/esm/index.native.js.map +1 -0
- package/dist/esm/interaction/lassoIntercept.mjs +29 -0
- package/dist/esm/interaction/lassoIntercept.mjs.map +1 -0
- package/dist/esm/interaction/lassoIntercept.native.js +29 -0
- package/dist/esm/interaction/lassoIntercept.native.js.map +1 -0
- package/dist/esm/interaction/legalTargets.mjs +48 -0
- package/dist/esm/interaction/legalTargets.mjs.map +1 -0
- package/dist/esm/interaction/legalTargets.native.js +88 -0
- package/dist/esm/interaction/legalTargets.native.js.map +1 -0
- package/dist/esm/interaction/snapAlignment.mjs +137 -0
- package/dist/esm/interaction/snapAlignment.mjs.map +1 -0
- package/dist/esm/interaction/snapAlignment.native.js +214 -0
- package/dist/esm/interaction/snapAlignment.native.js.map +1 -0
- package/dist/esm/interaction/snapChanges.mjs +184 -0
- package/dist/esm/interaction/snapChanges.mjs.map +1 -0
- package/dist/esm/interaction/snapChanges.native.js +236 -0
- package/dist/esm/interaction/snapChanges.native.js.map +1 -0
- package/dist/esm/interaction/spatialHash.mjs +71 -0
- package/dist/esm/interaction/spatialHash.mjs.map +1 -0
- package/dist/esm/interaction/spatialHash.native.js +136 -0
- package/dist/esm/interaction/spatialHash.native.js.map +1 -0
- package/dist/esm/interaction/useLassoSelect.mjs +231 -0
- package/dist/esm/interaction/useLassoSelect.mjs.map +1 -0
- package/dist/esm/interaction/useLassoSelect.native.js +256 -0
- package/dist/esm/interaction/useLassoSelect.native.js.map +1 -0
- package/dist/esm/knobs/KnobEnvelopeProvider.mjs +51 -0
- package/dist/esm/knobs/KnobEnvelopeProvider.mjs.map +1 -0
- package/dist/esm/knobs/KnobEnvelopeProvider.native.js +56 -0
- package/dist/esm/knobs/KnobEnvelopeProvider.native.js.map +1 -0
- package/dist/esm/knobs/envelope.mjs +29 -0
- package/dist/esm/knobs/envelope.mjs.map +1 -0
- package/dist/esm/knobs/envelope.native.js +45 -0
- package/dist/esm/knobs/envelope.native.js.map +1 -0
- package/dist/esm/knobs/graphKnobs.mjs +14 -0
- package/dist/esm/knobs/graphKnobs.mjs.map +1 -0
- package/dist/esm/knobs/graphKnobs.native.js +15 -0
- package/dist/esm/knobs/graphKnobs.native.js.map +1 -0
- package/dist/esm/knobs/useKnobEnvelope.mjs +83 -0
- package/dist/esm/knobs/useKnobEnvelope.mjs.map +1 -0
- package/dist/esm/knobs/useKnobEnvelope.native.js +112 -0
- package/dist/esm/knobs/useKnobEnvelope.native.js.map +1 -0
- package/dist/esm/layout/dagre.mjs +99 -0
- package/dist/esm/layout/dagre.mjs.map +1 -0
- package/dist/esm/layout/dagre.native.js +230 -0
- package/dist/esm/layout/dagre.native.js.map +1 -0
- package/dist/esm/layout/layout.mjs +57 -0
- package/dist/esm/layout/layout.mjs.map +1 -0
- package/dist/esm/layout/layout.native.js +82 -0
- package/dist/esm/layout/layout.native.js.map +1 -0
- package/dist/esm/layout/runner.mjs +164 -0
- package/dist/esm/layout/runner.mjs.map +1 -0
- package/dist/esm/layout/runner.native.js +214 -0
- package/dist/esm/layout/runner.native.js.map +1 -0
- package/dist/esm/layout/structuredCloneShim.mjs +54 -0
- package/dist/esm/layout/structuredCloneShim.mjs.map +1 -0
- package/dist/esm/layout/structuredCloneShim.native.js +131 -0
- package/dist/esm/layout/structuredCloneShim.native.js.map +1 -0
- package/dist/esm/layout/types.mjs +2 -0
- package/dist/esm/layout/types.mjs.map +1 -0
- package/dist/esm/layout/types.native.js +2 -0
- package/dist/esm/layout/types.native.js.map +1 -0
- package/dist/esm/layout/worker.entry.mjs +33 -0
- package/dist/esm/layout/worker.entry.mjs.map +1 -0
- package/dist/esm/layout/worker.entry.native.js +47 -0
- package/dist/esm/layout/worker.entry.native.js.map +1 -0
- package/dist/esm/layout/worker.generated.mjs +5 -0
- package/dist/esm/layout/worker.generated.mjs.map +1 -0
- package/dist/esm/layout/worker.generated.native.js +5 -0
- package/dist/esm/layout/worker.generated.native.js.map +1 -0
- package/dist/esm/model/commands.mjs +209 -0
- package/dist/esm/model/commands.mjs.map +1 -0
- package/dist/esm/model/commands.native.js +288 -0
- package/dist/esm/model/commands.native.js.map +1 -0
- package/dist/esm/model/connect.mjs +124 -0
- package/dist/esm/model/connect.mjs.map +1 -0
- package/dist/esm/model/connect.native.js +201 -0
- package/dist/esm/model/connect.native.js.map +1 -0
- package/dist/esm/model/document.mjs +2 -0
- package/dist/esm/model/document.mjs.map +1 -0
- package/dist/esm/model/document.native.js +2 -0
- package/dist/esm/model/document.native.js.map +1 -0
- package/dist/esm/model/history.mjs +96 -0
- package/dist/esm/model/history.mjs.map +1 -0
- package/dist/esm/model/history.native.js +150 -0
- package/dist/esm/model/history.native.js.map +1 -0
- package/dist/esm/model/index.mjs +8 -0
- package/dist/esm/model/index.mjs.map +1 -0
- package/dist/esm/model/index.native.js +8 -0
- package/dist/esm/model/index.native.js.map +1 -0
- package/dist/esm/model/schema.mjs +32 -0
- package/dist/esm/model/schema.mjs.map +1 -0
- package/dist/esm/model/schema.native.js +34 -0
- package/dist/esm/model/schema.native.js.map +1 -0
- package/dist/esm/model/select.mjs +49 -0
- package/dist/esm/model/select.mjs.map +1 -0
- package/dist/esm/model/select.native.js +75 -0
- package/dist/esm/model/select.native.js.map +1 -0
- package/dist/esm/model/serialize.mjs +306 -0
- package/dist/esm/model/serialize.mjs.map +1 -0
- package/dist/esm/model/serialize.native.js +345 -0
- package/dist/esm/model/serialize.native.js.map +1 -0
- package/dist/esm/native/DomOnlyStory.mjs +33 -0
- package/dist/esm/native/DomOnlyStory.mjs.map +1 -0
- package/dist/esm/native/DomOnlyStory.native.js +36 -0
- package/dist/esm/native/DomOnlyStory.native.js.map +1 -0
- package/dist/esm/native/GraphToolbar.mjs +76 -0
- package/dist/esm/native/GraphToolbar.mjs.map +1 -0
- package/dist/esm/native/GraphToolbar.native.js +79 -0
- package/dist/esm/native/GraphToolbar.native.js.map +1 -0
- package/dist/esm/native/domEntryRegistry.mjs +12 -0
- package/dist/esm/native/domEntryRegistry.mjs.map +1 -0
- package/dist/esm/native/domEntryRegistry.native.js +12 -0
- package/dist/esm/native/domEntryRegistry.native.js.map +1 -0
- package/dist/esm/native/graphChildren.mjs +18 -0
- package/dist/esm/native/graphChildren.mjs.map +1 -0
- package/dist/esm/native/graphChildren.native.js +20 -0
- package/dist/esm/native/graphChildren.native.js.map +1 -0
- package/dist/esm/nodes/GraphNode.mjs +136 -0
- package/dist/esm/nodes/GraphNode.mjs.map +1 -0
- package/dist/esm/nodes/GraphNode.native.js +178 -0
- package/dist/esm/nodes/GraphNode.native.js.map +1 -0
- package/dist/esm/nodes/GraphPort.mjs +79 -0
- package/dist/esm/nodes/GraphPort.mjs.map +1 -0
- package/dist/esm/nodes/GraphPort.native.js +80 -0
- package/dist/esm/nodes/GraphPort.native.js.map +1 -0
- package/dist/esm/nodes/handleGeometry.mjs +65 -0
- package/dist/esm/nodes/handleGeometry.mjs.map +1 -0
- package/dist/esm/nodes/handleGeometry.native.js +68 -0
- package/dist/esm/nodes/handleGeometry.native.js.map +1 -0
- package/dist/esm/nodes/lod.mjs +13 -0
- package/dist/esm/nodes/lod.mjs.map +1 -0
- package/dist/esm/nodes/lod.native.js +14 -0
- package/dist/esm/nodes/lod.native.js.map +1 -0
- package/dist/esm/nodes/nodeMeasure.mjs +72 -0
- package/dist/esm/nodes/nodeMeasure.mjs.map +1 -0
- package/dist/esm/nodes/nodeMeasure.native.js +95 -0
- package/dist/esm/nodes/nodeMeasure.native.js.map +1 -0
- package/dist/esm/nodes/overviewNode.mjs +49 -0
- package/dist/esm/nodes/overviewNode.mjs.map +1 -0
- package/dist/esm/nodes/overviewNode.native.js +53 -0
- package/dist/esm/nodes/overviewNode.native.js.map +1 -0
- package/dist/esm/react-flow/ConnectionPuck.mjs +96 -0
- package/dist/esm/react-flow/ConnectionPuck.mjs.map +1 -0
- package/dist/esm/react-flow/ConnectionPuck.native.js +114 -0
- package/dist/esm/react-flow/ConnectionPuck.native.js.map +1 -0
- package/dist/esm/react-flow/GraphActions.mjs +21 -0
- package/dist/esm/react-flow/GraphActions.mjs.map +1 -0
- package/dist/esm/react-flow/GraphActions.native.js +22 -0
- package/dist/esm/react-flow/GraphActions.native.js.map +1 -0
- package/dist/esm/react-flow/GraphCommandBridge.mjs +213 -0
- package/dist/esm/react-flow/GraphCommandBridge.mjs.map +1 -0
- package/dist/esm/react-flow/GraphCommandBridge.native.js +244 -0
- package/dist/esm/react-flow/GraphCommandBridge.native.js.map +1 -0
- package/dist/esm/react-flow/GraphNodeHost.mjs +50 -0
- package/dist/esm/react-flow/GraphNodeHost.mjs.map +1 -0
- package/dist/esm/react-flow/GraphNodeHost.native.js +59 -0
- package/dist/esm/react-flow/GraphNodeHost.native.js.map +1 -0
- package/dist/esm/react-flow/GraphPaintProbe.mjs +35 -0
- package/dist/esm/react-flow/GraphPaintProbe.mjs.map +1 -0
- package/dist/esm/react-flow/GraphPaintProbe.native.js +37 -0
- package/dist/esm/react-flow/GraphPaintProbe.native.js.map +1 -0
- package/dist/esm/react-flow/GraphZoomVar.mjs +16 -0
- package/dist/esm/react-flow/GraphZoomVar.mjs.map +1 -0
- package/dist/esm/react-flow/GraphZoomVar.native.js +19 -0
- package/dist/esm/react-flow/GraphZoomVar.native.js.map +1 -0
- package/dist/esm/react-flow/LassoOverlay.mjs +22 -0
- package/dist/esm/react-flow/LassoOverlay.mjs.map +1 -0
- package/dist/esm/react-flow/LassoOverlay.native.js +23 -0
- package/dist/esm/react-flow/LassoOverlay.native.js.map +1 -0
- package/dist/esm/react-flow/NodeGraphWeb.mjs +359 -0
- package/dist/esm/react-flow/NodeGraphWeb.mjs.map +1 -0
- package/dist/esm/react-flow/NodeGraphWeb.native.js +485 -0
- package/dist/esm/react-flow/NodeGraphWeb.native.js.map +1 -0
- package/dist/esm/react-flow/SnapGuides.mjs +60 -0
- package/dist/esm/react-flow/SnapGuides.mjs.map +1 -0
- package/dist/esm/react-flow/SnapGuides.native.js +82 -0
- package/dist/esm/react-flow/SnapGuides.native.js.map +1 -0
- package/dist/esm/react-flow/demoControlBody.mjs +67 -0
- package/dist/esm/react-flow/demoControlBody.mjs.map +1 -0
- package/dist/esm/react-flow/demoControlBody.native.js +75 -0
- package/dist/esm/react-flow/demoControlBody.native.js.map +1 -0
- package/dist/esm/react-flow/demoNodeBody.mjs +91 -0
- package/dist/esm/react-flow/demoNodeBody.mjs.map +1 -0
- package/dist/esm/react-flow/demoNodeBody.native.js +98 -0
- package/dist/esm/react-flow/demoNodeBody.native.js.map +1 -0
- package/dist/esm/react-flow/fixtures.mjs +185 -0
- package/dist/esm/react-flow/fixtures.mjs.map +1 -0
- package/dist/esm/react-flow/fixtures.native.js +192 -0
- package/dist/esm/react-flow/fixtures.native.js.map +1 -0
- package/dist/esm/react-flow/flowAdapter.mjs +94 -0
- package/dist/esm/react-flow/flowAdapter.mjs.map +1 -0
- package/dist/esm/react-flow/flowAdapter.native.js +103 -0
- package/dist/esm/react-flow/flowAdapter.native.js.map +1 -0
- package/dist/esm/react-flow/graphHandle.mjs +3 -0
- package/dist/esm/react-flow/graphHandle.mjs.map +1 -0
- package/dist/esm/react-flow/graphHandle.native.js +3 -0
- package/dist/esm/react-flow/graphHandle.native.js.map +1 -0
- package/dist/esm/react-flow/nodeCensus.mjs +28 -0
- package/dist/esm/react-flow/nodeCensus.mjs.map +1 -0
- package/dist/esm/react-flow/nodeCensus.native.js +49 -0
- package/dist/esm/react-flow/nodeCensus.native.js.map +1 -0
- package/dist/esm/react-flow/useGraphController.mjs +269 -0
- package/dist/esm/react-flow/useGraphController.mjs.map +1 -0
- package/dist/esm/react-flow/useGraphController.native.js +362 -0
- package/dist/esm/react-flow/useGraphController.native.js.map +1 -0
- package/dist/esm/react-flow/xy.mjs +8 -0
- package/dist/esm/react-flow/xy.mjs.map +1 -0
- package/dist/esm/react-flow/xy.native.js +8 -0
- package/dist/esm/react-flow/xy.native.js.map +1 -0
- package/dist/esm/theme/GraphFaces.mjs +88 -0
- package/dist/esm/theme/GraphFaces.mjs.map +1 -0
- package/dist/esm/theme/GraphFaces.native.js +152 -0
- package/dist/esm/theme/GraphFaces.native.js.map +1 -0
- package/dist/esm/theme/GraphVarsStyle.mjs +59 -0
- package/dist/esm/theme/GraphVarsStyle.mjs.map +1 -0
- package/dist/esm/theme/GraphVarsStyle.native.js +68 -0
- package/dist/esm/theme/GraphVarsStyle.native.js.map +1 -0
- package/dist/esm/theme/faces.generated.mjs +23 -0
- package/dist/esm/theme/faces.generated.mjs.map +1 -0
- package/dist/esm/theme/faces.generated.native.js +23 -0
- package/dist/esm/theme/faces.generated.native.js.map +1 -0
- package/dist/esm/theme/faces.mjs +89 -0
- package/dist/esm/theme/faces.mjs.map +1 -0
- package/dist/esm/theme/faces.native.js +98 -0
- package/dist/esm/theme/faces.native.js.map +1 -0
- package/dist/esm/theme/graphVars.mjs +284 -0
- package/dist/esm/theme/graphVars.mjs.map +1 -0
- package/dist/esm/theme/graphVars.native.js +314 -0
- package/dist/esm/theme/graphVars.native.js.map +1 -0
- package/dist/jsx/NodeGraph.mjs +9 -0
- package/dist/jsx/NodeGraph.mjs.map +1 -0
- package/dist/jsx/NodeGraph.native.js +37 -0
- package/dist/jsx/NodeGraph.native.js.map +1 -0
- package/dist/jsx/bench/frameSampler.mjs +255 -0
- package/dist/jsx/bench/frameSampler.mjs.map +1 -0
- package/dist/jsx/bench/frameSampler.native.js +409 -0
- package/dist/jsx/bench/frameSampler.native.js.map +1 -0
- package/dist/jsx/bench/generateGraph.mjs +99 -0
- package/dist/jsx/bench/generateGraph.mjs.map +1 -0
- package/dist/jsx/bench/generateGraph.native.js +128 -0
- package/dist/jsx/bench/generateGraph.native.js.map +1 -0
- package/dist/jsx/diagnostics/GraphDiagnostics.mjs +128 -0
- package/dist/jsx/diagnostics/GraphDiagnostics.mjs.map +1 -0
- package/dist/jsx/diagnostics/GraphDiagnostics.native.js +166 -0
- package/dist/jsx/diagnostics/GraphDiagnostics.native.js.map +1 -0
- package/dist/jsx/diagnostics/LiveGraphDiagnostics.mjs +76 -0
- package/dist/jsx/diagnostics/LiveGraphDiagnostics.mjs.map +1 -0
- package/dist/jsx/diagnostics/LiveGraphDiagnostics.native.js +106 -0
- package/dist/jsx/diagnostics/LiveGraphDiagnostics.native.js.map +1 -0
- package/dist/jsx/diagnostics/fromWire.mjs +23 -0
- package/dist/jsx/diagnostics/fromWire.mjs.map +1 -0
- package/dist/jsx/diagnostics/fromWire.native.js +51 -0
- package/dist/jsx/diagnostics/fromWire.native.js.map +1 -0
- package/dist/jsx/diagnostics/lastError.mjs +39 -0
- package/dist/jsx/diagnostics/lastError.mjs.map +1 -0
- package/dist/jsx/diagnostics/lastError.native.js +75 -0
- package/dist/jsx/diagnostics/lastError.native.js.map +1 -0
- package/dist/jsx/diagnostics/types.mjs +2 -0
- package/dist/jsx/diagnostics/types.mjs.map +1 -0
- package/dist/jsx/diagnostics/types.native.js +21 -0
- package/dist/jsx/diagnostics/types.native.js.map +1 -0
- package/dist/jsx/diagnostics/useGraphDiagnostics.mjs +44 -0
- package/dist/jsx/diagnostics/useGraphDiagnostics.mjs.map +1 -0
- package/dist/jsx/diagnostics/useGraphDiagnostics.native.js +75 -0
- package/dist/jsx/diagnostics/useGraphDiagnostics.native.js.map +1 -0
- package/dist/jsx/dom/GraphDomLayout.mjs +11 -0
- package/dist/jsx/dom/GraphDomLayout.mjs.map +1 -0
- package/dist/jsx/dom/GraphDomLayout.native.js +40 -0
- package/dist/jsx/dom/GraphDomLayout.native.js.map +1 -0
- package/dist/jsx/dom/boot.mjs +67 -0
- package/dist/jsx/dom/boot.mjs.map +1 -0
- package/dist/jsx/dom/boot.native.js +111 -0
- package/dist/jsx/dom/boot.native.js.map +1 -0
- package/dist/jsx/dom/wire.mjs +183 -0
- package/dist/jsx/dom/wire.mjs.map +1 -0
- package/dist/jsx/dom/wire.native.js +274 -0
- package/dist/jsx/dom/wire.native.js.map +1 -0
- package/dist/jsx/edges/GraphEdge.mjs +139 -0
- package/dist/jsx/edges/GraphEdge.mjs.map +1 -0
- package/dist/jsx/edges/GraphEdge.native.js +178 -0
- package/dist/jsx/edges/GraphEdge.native.js.map +1 -0
- package/dist/jsx/edges/edgeKinds.mjs +25 -0
- package/dist/jsx/edges/edgeKinds.mjs.map +1 -0
- package/dist/jsx/edges/edgeKinds.native.js +54 -0
- package/dist/jsx/edges/edgeKinds.native.js.map +1 -0
- package/dist/jsx/edges/edgeStyle.mjs +63 -0
- package/dist/jsx/edges/edgeStyle.mjs.map +1 -0
- package/dist/jsx/edges/edgeStyle.native.js +99 -0
- package/dist/jsx/edges/edgeStyle.native.js.map +1 -0
- package/dist/jsx/index.js +50 -0
- package/dist/jsx/index.js.map +1 -0
- package/dist/jsx/index.mjs +50 -0
- package/dist/jsx/index.mjs.map +1 -0
- package/dist/jsx/index.native.js +200 -0
- package/dist/jsx/index.native.js.map +1 -0
- package/dist/jsx/interaction/lassoIntercept.mjs +29 -0
- package/dist/jsx/interaction/lassoIntercept.mjs.map +1 -0
- package/dist/jsx/interaction/lassoIntercept.native.js +57 -0
- package/dist/jsx/interaction/lassoIntercept.native.js.map +1 -0
- package/dist/jsx/interaction/legalTargets.mjs +48 -0
- package/dist/jsx/interaction/legalTargets.mjs.map +1 -0
- package/dist/jsx/interaction/legalTargets.native.js +118 -0
- package/dist/jsx/interaction/legalTargets.native.js.map +1 -0
- package/dist/jsx/interaction/snapAlignment.mjs +137 -0
- package/dist/jsx/interaction/snapAlignment.mjs.map +1 -0
- package/dist/jsx/interaction/snapAlignment.native.js +245 -0
- package/dist/jsx/interaction/snapAlignment.native.js.map +1 -0
- package/dist/jsx/interaction/snapChanges.mjs +184 -0
- package/dist/jsx/interaction/snapChanges.mjs.map +1 -0
- package/dist/jsx/interaction/snapChanges.native.js +269 -0
- package/dist/jsx/interaction/snapChanges.native.js.map +1 -0
- package/dist/jsx/interaction/spatialHash.mjs +71 -0
- package/dist/jsx/interaction/spatialHash.mjs.map +1 -0
- package/dist/jsx/interaction/spatialHash.native.js +165 -0
- package/dist/jsx/interaction/spatialHash.native.js.map +1 -0
- package/dist/jsx/interaction/useLassoSelect.mjs +231 -0
- package/dist/jsx/interaction/useLassoSelect.mjs.map +1 -0
- package/dist/jsx/interaction/useLassoSelect.native.js +287 -0
- package/dist/jsx/interaction/useLassoSelect.native.js.map +1 -0
- package/dist/jsx/knobs/KnobEnvelopeProvider.mjs +51 -0
- package/dist/jsx/knobs/KnobEnvelopeProvider.mjs.map +1 -0
- package/dist/jsx/knobs/KnobEnvelopeProvider.native.js +85 -0
- package/dist/jsx/knobs/KnobEnvelopeProvider.native.js.map +1 -0
- package/dist/jsx/knobs/envelope.mjs +29 -0
- package/dist/jsx/knobs/envelope.mjs.map +1 -0
- package/dist/jsx/knobs/envelope.native.js +78 -0
- package/dist/jsx/knobs/envelope.native.js.map +1 -0
- package/dist/jsx/knobs/graphKnobs.mjs +14 -0
- package/dist/jsx/knobs/graphKnobs.mjs.map +1 -0
- package/dist/jsx/knobs/graphKnobs.native.js +43 -0
- package/dist/jsx/knobs/graphKnobs.native.js.map +1 -0
- package/dist/jsx/knobs/useKnobEnvelope.mjs +83 -0
- package/dist/jsx/knobs/useKnobEnvelope.mjs.map +1 -0
- package/dist/jsx/knobs/useKnobEnvelope.native.js +140 -0
- package/dist/jsx/knobs/useKnobEnvelope.native.js.map +1 -0
- package/dist/jsx/layout/dagre.mjs +99 -0
- package/dist/jsx/layout/dagre.mjs.map +1 -0
- package/dist/jsx/layout/dagre.native.js +259 -0
- package/dist/jsx/layout/dagre.native.js.map +1 -0
- package/dist/jsx/layout/layout.mjs +57 -0
- package/dist/jsx/layout/layout.mjs.map +1 -0
- package/dist/jsx/layout/layout.native.js +112 -0
- package/dist/jsx/layout/layout.native.js.map +1 -0
- package/dist/jsx/layout/runner.mjs +164 -0
- package/dist/jsx/layout/runner.mjs.map +1 -0
- package/dist/jsx/layout/runner.native.js +247 -0
- package/dist/jsx/layout/runner.native.js.map +1 -0
- package/dist/jsx/layout/structuredCloneShim.mjs +54 -0
- package/dist/jsx/layout/structuredCloneShim.mjs.map +1 -0
- package/dist/jsx/layout/structuredCloneShim.native.js +160 -0
- package/dist/jsx/layout/structuredCloneShim.native.js.map +1 -0
- package/dist/jsx/layout/types.mjs +2 -0
- package/dist/jsx/layout/types.mjs.map +1 -0
- package/dist/jsx/layout/types.native.js +21 -0
- package/dist/jsx/layout/types.native.js.map +1 -0
- package/dist/jsx/layout/worker.entry.mjs +33 -0
- package/dist/jsx/layout/worker.entry.mjs.map +1 -0
- package/dist/jsx/layout/worker.entry.native.js +75 -0
- package/dist/jsx/layout/worker.entry.native.js.map +1 -0
- package/dist/jsx/layout/worker.generated.mjs +5 -0
- package/dist/jsx/layout/worker.generated.mjs.map +1 -0
- package/dist/jsx/layout/worker.generated.native.js +35 -0
- package/dist/jsx/layout/worker.generated.native.js.map +1 -0
- package/dist/jsx/model/commands.mjs +209 -0
- package/dist/jsx/model/commands.mjs.map +1 -0
- package/dist/jsx/model/commands.native.js +317 -0
- package/dist/jsx/model/commands.native.js.map +1 -0
- package/dist/jsx/model/connect.mjs +124 -0
- package/dist/jsx/model/connect.mjs.map +1 -0
- package/dist/jsx/model/connect.native.js +239 -0
- package/dist/jsx/model/connect.native.js.map +1 -0
- package/dist/jsx/model/document.mjs +2 -0
- package/dist/jsx/model/document.mjs.map +1 -0
- package/dist/jsx/model/document.native.js +21 -0
- package/dist/jsx/model/document.native.js.map +1 -0
- package/dist/jsx/model/history.mjs +96 -0
- package/dist/jsx/model/history.mjs.map +1 -0
- package/dist/jsx/model/history.native.js +178 -0
- package/dist/jsx/model/history.native.js.map +1 -0
- package/dist/jsx/model/index.mjs +8 -0
- package/dist/jsx/model/index.mjs.map +1 -0
- package/dist/jsx/model/index.native.js +63 -0
- package/dist/jsx/model/index.native.js.map +1 -0
- package/dist/jsx/model/schema.mjs +32 -0
- package/dist/jsx/model/schema.mjs.map +1 -0
- package/dist/jsx/model/schema.native.js +68 -0
- package/dist/jsx/model/schema.native.js.map +1 -0
- package/dist/jsx/model/select.mjs +49 -0
- package/dist/jsx/model/select.mjs.map +1 -0
- package/dist/jsx/model/select.native.js +107 -0
- package/dist/jsx/model/select.native.js.map +1 -0
- package/dist/jsx/model/serialize.mjs +306 -0
- package/dist/jsx/model/serialize.mjs.map +1 -0
- package/dist/jsx/model/serialize.native.js +374 -0
- package/dist/jsx/model/serialize.native.js.map +1 -0
- package/dist/jsx/native/DomOnlyStory.mjs +33 -0
- package/dist/jsx/native/DomOnlyStory.mjs.map +1 -0
- package/dist/jsx/native/DomOnlyStory.native.js +66 -0
- package/dist/jsx/native/DomOnlyStory.native.js.map +1 -0
- package/dist/jsx/native/GraphToolbar.mjs +76 -0
- package/dist/jsx/native/GraphToolbar.mjs.map +1 -0
- package/dist/jsx/native/GraphToolbar.native.js +107 -0
- package/dist/jsx/native/GraphToolbar.native.js.map +1 -0
- package/dist/jsx/native/domEntryRegistry.mjs +12 -0
- package/dist/jsx/native/domEntryRegistry.mjs.map +1 -0
- package/dist/jsx/native/domEntryRegistry.native.js +42 -0
- package/dist/jsx/native/domEntryRegistry.native.js.map +1 -0
- package/dist/jsx/native/graphChildren.mjs +18 -0
- package/dist/jsx/native/graphChildren.mjs.map +1 -0
- package/dist/jsx/native/graphChildren.native.js +50 -0
- package/dist/jsx/native/graphChildren.native.js.map +1 -0
- package/dist/jsx/nodes/GraphNode.mjs +136 -0
- package/dist/jsx/nodes/GraphNode.mjs.map +1 -0
- package/dist/jsx/nodes/GraphNode.native.js +206 -0
- package/dist/jsx/nodes/GraphNode.native.js.map +1 -0
- package/dist/jsx/nodes/GraphPort.mjs +79 -0
- package/dist/jsx/nodes/GraphPort.mjs.map +1 -0
- package/dist/jsx/nodes/GraphPort.native.js +108 -0
- package/dist/jsx/nodes/GraphPort.native.js.map +1 -0
- package/dist/jsx/nodes/handleGeometry.mjs +65 -0
- package/dist/jsx/nodes/handleGeometry.mjs.map +1 -0
- package/dist/jsx/nodes/handleGeometry.native.js +104 -0
- package/dist/jsx/nodes/handleGeometry.native.js.map +1 -0
- package/dist/jsx/nodes/lod.mjs +13 -0
- package/dist/jsx/nodes/lod.mjs.map +1 -0
- package/dist/jsx/nodes/lod.native.js +45 -0
- package/dist/jsx/nodes/lod.native.js.map +1 -0
- package/dist/jsx/nodes/nodeMeasure.mjs +72 -0
- package/dist/jsx/nodes/nodeMeasure.mjs.map +1 -0
- package/dist/jsx/nodes/nodeMeasure.native.js +134 -0
- package/dist/jsx/nodes/nodeMeasure.native.js.map +1 -0
- package/dist/jsx/nodes/overviewNode.mjs +49 -0
- package/dist/jsx/nodes/overviewNode.mjs.map +1 -0
- package/dist/jsx/nodes/overviewNode.native.js +81 -0
- package/dist/jsx/nodes/overviewNode.native.js.map +1 -0
- package/dist/jsx/react-flow/ConnectionPuck.mjs +96 -0
- package/dist/jsx/react-flow/ConnectionPuck.mjs.map +1 -0
- package/dist/jsx/react-flow/ConnectionPuck.native.js +143 -0
- package/dist/jsx/react-flow/ConnectionPuck.native.js.map +1 -0
- package/dist/jsx/react-flow/GraphActions.mjs +21 -0
- package/dist/jsx/react-flow/GraphActions.mjs.map +1 -0
- package/dist/jsx/react-flow/GraphActions.native.js +51 -0
- package/dist/jsx/react-flow/GraphActions.native.js.map +1 -0
- package/dist/jsx/react-flow/GraphCommandBridge.mjs +213 -0
- package/dist/jsx/react-flow/GraphCommandBridge.mjs.map +1 -0
- package/dist/jsx/react-flow/GraphCommandBridge.native.js +272 -0
- package/dist/jsx/react-flow/GraphCommandBridge.native.js.map +1 -0
- package/dist/jsx/react-flow/GraphNodeHost.mjs +50 -0
- package/dist/jsx/react-flow/GraphNodeHost.mjs.map +1 -0
- package/dist/jsx/react-flow/GraphNodeHost.native.js +89 -0
- package/dist/jsx/react-flow/GraphNodeHost.native.js.map +1 -0
- package/dist/jsx/react-flow/GraphPaintProbe.mjs +35 -0
- package/dist/jsx/react-flow/GraphPaintProbe.mjs.map +1 -0
- package/dist/jsx/react-flow/GraphPaintProbe.native.js +65 -0
- package/dist/jsx/react-flow/GraphPaintProbe.native.js.map +1 -0
- package/dist/jsx/react-flow/GraphZoomVar.mjs +16 -0
- package/dist/jsx/react-flow/GraphZoomVar.mjs.map +1 -0
- package/dist/jsx/react-flow/GraphZoomVar.native.js +48 -0
- package/dist/jsx/react-flow/GraphZoomVar.native.js.map +1 -0
- package/dist/jsx/react-flow/LassoOverlay.mjs +22 -0
- package/dist/jsx/react-flow/LassoOverlay.mjs.map +1 -0
- package/dist/jsx/react-flow/LassoOverlay.native.js +51 -0
- package/dist/jsx/react-flow/LassoOverlay.native.js.map +1 -0
- package/dist/jsx/react-flow/NodeGraphWeb.mjs +359 -0
- package/dist/jsx/react-flow/NodeGraphWeb.mjs.map +1 -0
- package/dist/jsx/react-flow/NodeGraphWeb.native.js +515 -0
- package/dist/jsx/react-flow/NodeGraphWeb.native.js.map +1 -0
- package/dist/jsx/react-flow/SnapGuides.mjs +60 -0
- package/dist/jsx/react-flow/SnapGuides.mjs.map +1 -0
- package/dist/jsx/react-flow/SnapGuides.native.js +114 -0
- package/dist/jsx/react-flow/SnapGuides.native.js.map +1 -0
- package/dist/jsx/react-flow/demoControlBody.mjs +67 -0
- package/dist/jsx/react-flow/demoControlBody.mjs.map +1 -0
- package/dist/jsx/react-flow/demoControlBody.native.js +104 -0
- package/dist/jsx/react-flow/demoControlBody.native.js.map +1 -0
- package/dist/jsx/react-flow/demoNodeBody.mjs +91 -0
- package/dist/jsx/react-flow/demoNodeBody.mjs.map +1 -0
- package/dist/jsx/react-flow/demoNodeBody.native.js +131 -0
- package/dist/jsx/react-flow/demoNodeBody.native.js.map +1 -0
- package/dist/jsx/react-flow/fixtures.mjs +185 -0
- package/dist/jsx/react-flow/fixtures.mjs.map +1 -0
- package/dist/jsx/react-flow/fixtures.native.js +225 -0
- package/dist/jsx/react-flow/fixtures.native.js.map +1 -0
- package/dist/jsx/react-flow/flowAdapter.mjs +94 -0
- package/dist/jsx/react-flow/flowAdapter.mjs.map +1 -0
- package/dist/jsx/react-flow/flowAdapter.native.js +133 -0
- package/dist/jsx/react-flow/flowAdapter.native.js.map +1 -0
- package/dist/jsx/react-flow/graphHandle.mjs +3 -0
- package/dist/jsx/react-flow/graphHandle.mjs.map +1 -0
- package/dist/jsx/react-flow/graphHandle.native.js +31 -0
- package/dist/jsx/react-flow/graphHandle.native.js.map +1 -0
- package/dist/jsx/react-flow/nodeCensus.mjs +28 -0
- package/dist/jsx/react-flow/nodeCensus.mjs.map +1 -0
- package/dist/jsx/react-flow/nodeCensus.native.js +80 -0
- package/dist/jsx/react-flow/nodeCensus.native.js.map +1 -0
- package/dist/jsx/react-flow/useGraphController.mjs +269 -0
- package/dist/jsx/react-flow/useGraphController.mjs.map +1 -0
- package/dist/jsx/react-flow/useGraphController.native.js +393 -0
- package/dist/jsx/react-flow/useGraphController.native.js.map +1 -0
- package/dist/jsx/react-flow/xy.mjs +8 -0
- package/dist/jsx/react-flow/xy.mjs.map +1 -0
- package/dist/jsx/react-flow/xy.native.js +63 -0
- package/dist/jsx/react-flow/xy.native.js.map +1 -0
- package/dist/jsx/theme/GraphFaces.mjs +88 -0
- package/dist/jsx/theme/GraphFaces.mjs.map +1 -0
- package/dist/jsx/theme/GraphFaces.native.js +181 -0
- package/dist/jsx/theme/GraphFaces.native.js.map +1 -0
- package/dist/jsx/theme/GraphVarsStyle.mjs +59 -0
- package/dist/jsx/theme/GraphVarsStyle.mjs.map +1 -0
- package/dist/jsx/theme/GraphVarsStyle.native.js +100 -0
- package/dist/jsx/theme/GraphVarsStyle.native.js.map +1 -0
- package/dist/jsx/theme/faces.generated.mjs +23 -0
- package/dist/jsx/theme/faces.generated.mjs.map +1 -0
- package/dist/jsx/theme/faces.generated.native.js +51 -0
- package/dist/jsx/theme/faces.generated.native.js.map +1 -0
- package/dist/jsx/theme/faces.mjs +89 -0
- package/dist/jsx/theme/faces.mjs.map +1 -0
- package/dist/jsx/theme/faces.native.js +133 -0
- package/dist/jsx/theme/faces.native.js.map +1 -0
- package/dist/jsx/theme/graphVars.mjs +284 -0
- package/dist/jsx/theme/graphVars.mjs.map +1 -0
- package/dist/jsx/theme/graphVars.native.js +351 -0
- package/dist/jsx/theme/graphVars.native.js.map +1 -0
- package/dom-inner.ts +21 -0
- package/metro/index.js +174 -0
- package/metro/index.spec.mjs +235 -0
- package/model.ts +9 -0
- package/package.json +137 -0
- package/src/NodeGraph.native.spec.ts +164 -0
- package/src/NodeGraph.native.tsx +278 -0
- package/src/NodeGraph.tsx +27 -0
- package/src/bench/Perf200.stories.tsx +351 -0
- package/src/bench/frameSampler.spec.ts +467 -0
- package/src/bench/frameSampler.ts +516 -0
- package/src/bench/generateGraph.ts +138 -0
- package/src/diagnostics/GraphDiagnostics.spec.tsx +206 -0
- package/src/diagnostics/GraphDiagnostics.stories.tsx +194 -0
- package/src/diagnostics/GraphDiagnostics.tsx +140 -0
- package/src/diagnostics/LiveGraphDiagnostics.native.tsx +61 -0
- package/src/diagnostics/LiveGraphDiagnostics.tsx +121 -0
- package/src/diagnostics/deliberateBreak.ts +35 -0
- package/src/diagnostics/fromWire.spec.ts +74 -0
- package/src/diagnostics/fromWire.ts +48 -0
- package/src/diagnostics/lastError.ts +91 -0
- package/src/diagnostics/types.ts +103 -0
- package/src/diagnostics/useGraphDiagnostics.spec.tsx +199 -0
- package/src/diagnostics/useGraphDiagnostics.ts +85 -0
- package/src/dom/GraphDomLayout.spec.tsx +56 -0
- package/src/dom/GraphDomLayout.tsx +49 -0
- package/src/dom/NodeGraphDom.ts +43 -0
- package/src/dom/NodeGraphDomInner.tsx +524 -0
- package/src/dom/NodeGraphDomShell.ts +402 -0
- package/src/dom/boot.spec.ts +90 -0
- package/src/dom/boot.ts +153 -0
- package/src/dom/domEntry.spec.ts +481 -0
- package/src/dom/importGraph.spec.ts +287 -0
- package/src/dom/schemaRegistry.spec.tsx +182 -0
- package/src/dom/wire.spec.ts +486 -0
- package/src/dom/wire.ts +493 -0
- package/src/edges/Edges.stories.tsx +271 -0
- package/src/edges/GraphEdge.tsx +198 -0
- package/src/edges/edgeKinds.ts +51 -0
- package/src/edges/edgeStyle.spec.ts +295 -0
- package/src/edges/edgeStyle.ts +124 -0
- package/src/index.native.ts +147 -0
- package/src/index.ts +243 -0
- package/src/interaction/Lasso.stories.tsx +198 -0
- package/src/interaction/Snapping.stories.tsx +189 -0
- package/src/interaction/lassoIntercept.spec.ts +166 -0
- package/src/interaction/lassoIntercept.ts +81 -0
- package/src/interaction/legalTargets.spec.ts +304 -0
- package/src/interaction/legalTargets.ts +91 -0
- package/src/interaction/snapAlignment.spec.ts +412 -0
- package/src/interaction/snapAlignment.ts +209 -0
- package/src/interaction/snapChanges.spec.ts +273 -0
- package/src/interaction/snapChanges.ts +292 -0
- package/src/interaction/spatialHash.spec.ts +168 -0
- package/src/interaction/spatialHash.ts +128 -0
- package/src/interaction/useLassoSelect.spec.tsx +487 -0
- package/src/interaction/useLassoSelect.ts +489 -0
- package/src/knobs/KnobEnvelopeProvider.tsx +110 -0
- package/src/knobs/envelope.spec.tsx +371 -0
- package/src/knobs/envelope.ts +130 -0
- package/src/knobs/envelopeTheme.spec.ts +58 -0
- package/src/knobs/graphKnobs.ts +36 -0
- package/src/knobs/useKnobEnvelope.ts +152 -0
- package/src/layout/AutoLayout.stories.tsx +338 -0
- package/src/layout/dagre.ts +149 -0
- package/src/layout/layout.spec.ts +244 -0
- package/src/layout/layout.ts +121 -0
- package/src/layout/runner.spec.ts +365 -0
- package/src/layout/runner.ts +256 -0
- package/src/layout/structuredCloneShim.spec.ts +103 -0
- package/src/layout/structuredCloneShim.ts +106 -0
- package/src/layout/types.ts +112 -0
- package/src/layout/worker.entry.ts +74 -0
- package/src/layout/worker.generated.spec.ts +157 -0
- package/src/layout/worker.generated.ts +32 -0
- package/src/model/commands.spec.ts +214 -0
- package/src/model/commands.ts +209 -0
- package/src/model/connect.spec.ts +444 -0
- package/src/model/connect.ts +281 -0
- package/src/model/document.ts +121 -0
- package/src/model/history.spec.ts +278 -0
- package/src/model/history.ts +153 -0
- package/src/model/index.ts +74 -0
- package/src/model/schema.ts +177 -0
- package/src/model/select.spec.ts +220 -0
- package/src/model/select.ts +88 -0
- package/src/model/serialize.spec.ts +393 -0
- package/src/model/serialize.ts +395 -0
- package/src/native/DomOnlyStory.tsx +72 -0
- package/src/native/GraphFallback.native.tsx +123 -0
- package/src/native/GraphToolbar.tsx +171 -0
- package/src/native/NodeGraph.native.tsx +505 -0
- package/src/native/domEntryRegistry.spec.ts +66 -0
- package/src/native/domEntryRegistry.ts +45 -0
- package/src/native/graphChildren.spec.ts +67 -0
- package/src/native/graphChildren.ts +62 -0
- package/src/native/graphFallback.spec.ts +49 -0
- package/src/native/graphHandleRemount.spec.tsx +189 -0
- package/src/nodes/GraphNode.spec.tsx +270 -0
- package/src/nodes/GraphNode.stories.tsx +451 -0
- package/src/nodes/GraphNode.tsx +240 -0
- package/src/nodes/GraphPort.spec.tsx +442 -0
- package/src/nodes/GraphPort.stories.tsx +407 -0
- package/src/nodes/GraphPort.tsx +117 -0
- package/src/nodes/Overview.stories.tsx +237 -0
- package/src/nodes/handleGeometry.spec.ts +161 -0
- package/src/nodes/handleGeometry.ts +232 -0
- package/src/nodes/lod.spec.tsx +300 -0
- package/src/nodes/lod.ts +69 -0
- package/src/nodes/nodeMeasure.spec.ts +245 -0
- package/src/nodes/nodeMeasure.ts +216 -0
- package/src/nodes/overviewNode.tsx +71 -0
- package/src/packageShape.spec.ts +145 -0
- package/src/react-flow/ConnectionPuck.spec.tsx +242 -0
- package/src/react-flow/ConnectionPuck.tsx +175 -0
- package/src/react-flow/GraphActions.tsx +64 -0
- package/src/react-flow/GraphCommandBridge.spec.tsx +130 -0
- package/src/react-flow/GraphCommandBridge.tsx +288 -0
- package/src/react-flow/GraphNodeHost.tsx +101 -0
- package/src/react-flow/GraphPaintProbe.spec.tsx +116 -0
- package/src/react-flow/GraphPaintProbe.tsx +65 -0
- package/src/react-flow/GraphZoomVar.tsx +48 -0
- package/src/react-flow/LassoOverlay.tsx +59 -0
- package/src/react-flow/NodeGraphWeb.spec.tsx +441 -0
- package/src/react-flow/NodeGraphWeb.stories.tsx +260 -0
- package/src/react-flow/NodeGraphWeb.tsx +645 -0
- package/src/react-flow/SnapGuides.spec.tsx +161 -0
- package/src/react-flow/SnapGuides.tsx +113 -0
- package/src/react-flow/demoControlBody.tsx +96 -0
- package/src/react-flow/demoNodeBody.tsx +121 -0
- package/src/react-flow/fixtures.ts +185 -0
- package/src/react-flow/flowAdapter.ts +170 -0
- package/src/react-flow/graphHandle.ts +112 -0
- package/src/react-flow/nodeCensus.spec.ts +66 -0
- package/src/react-flow/nodeCensus.ts +69 -0
- package/src/react-flow/useGraphController.spec.tsx +849 -0
- package/src/react-flow/useGraphController.ts +473 -0
- package/src/react-flow/xy.spec.ts +182 -0
- package/src/react-flow/xy.ts +131 -0
- package/src/theme/GraphFaces.spec.tsx +101 -0
- package/src/theme/GraphFaces.tsx +218 -0
- package/src/theme/GraphVarsStyle.tsx +113 -0
- package/src/theme/faces.generated.ts +53 -0
- package/src/theme/faces.spec.ts +228 -0
- package/src/theme/faces.ts +275 -0
- package/src/theme/graphCss.spec.ts +111 -0
- package/src/theme/graphVars.spec.ts +322 -0
- package/src/theme/graphVars.ts +441 -0
- package/types/NodeGraph.d.ts +17 -0
- package/types/NodeGraph.d.ts.map +1 -0
- package/types/NodeGraph.native.d.ts +142 -0
- package/types/NodeGraph.native.d.ts.map +1 -0
- package/types/bench/frameSampler.d.ts +235 -0
- package/types/bench/frameSampler.d.ts.map +1 -0
- package/types/bench/generateGraph.d.ts +43 -0
- package/types/bench/generateGraph.d.ts.map +1 -0
- package/types/diagnostics/GraphDiagnostics.d.ts +30 -0
- package/types/diagnostics/GraphDiagnostics.d.ts.map +1 -0
- package/types/diagnostics/LiveGraphDiagnostics.d.ts +27 -0
- package/types/diagnostics/LiveGraphDiagnostics.d.ts.map +1 -0
- package/types/diagnostics/LiveGraphDiagnostics.native.d.ts +25 -0
- package/types/diagnostics/LiveGraphDiagnostics.native.d.ts.map +1 -0
- package/types/diagnostics/deliberateBreak.d.ts +28 -0
- package/types/diagnostics/deliberateBreak.d.ts.map +1 -0
- package/types/diagnostics/fromWire.d.ts +17 -0
- package/types/diagnostics/fromWire.d.ts.map +1 -0
- package/types/diagnostics/lastError.d.ts +50 -0
- package/types/diagnostics/lastError.d.ts.map +1 -0
- package/types/diagnostics/types.d.ts +101 -0
- package/types/diagnostics/types.d.ts.map +1 -0
- package/types/diagnostics/useGraphDiagnostics.d.ts +23 -0
- package/types/diagnostics/useGraphDiagnostics.d.ts.map +1 -0
- package/types/dom/GraphDomLayout.d.ts +40 -0
- package/types/dom/GraphDomLayout.d.ts.map +1 -0
- package/types/dom/NodeGraphDom.d.ts +4 -0
- package/types/dom/NodeGraphDom.d.ts.map +1 -0
- package/types/dom/NodeGraphDomInner.d.ts +26 -0
- package/types/dom/NodeGraphDomInner.d.ts.map +1 -0
- package/types/dom/NodeGraphDomShell.d.ts +221 -0
- package/types/dom/NodeGraphDomShell.d.ts.map +1 -0
- package/types/dom/boot.d.ts +90 -0
- package/types/dom/boot.d.ts.map +1 -0
- package/types/dom/wire.d.ts +355 -0
- package/types/dom/wire.d.ts.map +1 -0
- package/types/edges/GraphEdge.d.ts +59 -0
- package/types/edges/GraphEdge.d.ts.map +1 -0
- package/types/edges/edgeKinds.d.ts +43 -0
- package/types/edges/edgeKinds.d.ts.map +1 -0
- package/types/edges/edgeStyle.d.ts +79 -0
- package/types/edges/edgeStyle.d.ts.map +1 -0
- package/types/index.d.ts +123 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.native.d.ts +86 -0
- package/types/index.native.d.ts.map +1 -0
- package/types/interaction/lassoIntercept.d.ts +58 -0
- package/types/interaction/lassoIntercept.d.ts.map +1 -0
- package/types/interaction/legalTargets.d.ts +59 -0
- package/types/interaction/legalTargets.d.ts.map +1 -0
- package/types/interaction/snapAlignment.d.ts +85 -0
- package/types/interaction/snapAlignment.d.ts.map +1 -0
- package/types/interaction/snapChanges.d.ts +133 -0
- package/types/interaction/snapChanges.d.ts.map +1 -0
- package/types/interaction/spatialHash.d.ts +37 -0
- package/types/interaction/spatialHash.d.ts.map +1 -0
- package/types/interaction/useLassoSelect.d.ts +151 -0
- package/types/interaction/useLassoSelect.d.ts.map +1 -0
- package/types/knobs/KnobEnvelopeProvider.d.ts +45 -0
- package/types/knobs/KnobEnvelopeProvider.d.ts.map +1 -0
- package/types/knobs/envelope.d.ts +99 -0
- package/types/knobs/envelope.d.ts.map +1 -0
- package/types/knobs/graphKnobs.d.ts +26 -0
- package/types/knobs/graphKnobs.d.ts.map +1 -0
- package/types/knobs/useKnobEnvelope.d.ts +43 -0
- package/types/knobs/useKnobEnvelope.d.ts.map +1 -0
- package/types/layout/dagre.d.ts +39 -0
- package/types/layout/dagre.d.ts.map +1 -0
- package/types/layout/layout.d.ts +58 -0
- package/types/layout/layout.d.ts.map +1 -0
- package/types/layout/runner.d.ts +60 -0
- package/types/layout/runner.d.ts.map +1 -0
- package/types/layout/structuredCloneShim.d.ts +44 -0
- package/types/layout/structuredCloneShim.d.ts.map +1 -0
- package/types/layout/types.d.ts +113 -0
- package/types/layout/types.d.ts.map +1 -0
- package/types/layout/worker.entry.d.ts +34 -0
- package/types/layout/worker.entry.d.ts.map +1 -0
- package/types/layout/worker.generated.d.ts +26 -0
- package/types/layout/worker.generated.d.ts.map +1 -0
- package/types/model/commands.d.ts +49 -0
- package/types/model/commands.d.ts.map +1 -0
- package/types/model/connect.d.ts +83 -0
- package/types/model/connect.d.ts.map +1 -0
- package/types/model/document.d.ts +111 -0
- package/types/model/document.d.ts.map +1 -0
- package/types/model/history.d.ts +40 -0
- package/types/model/history.d.ts.map +1 -0
- package/types/model/index.d.ts +20 -0
- package/types/model/index.d.ts.map +1 -0
- package/types/model/schema.d.ts +136 -0
- package/types/model/schema.d.ts.map +1 -0
- package/types/model/select.d.ts +41 -0
- package/types/model/select.d.ts.map +1 -0
- package/types/model/serialize.d.ts +33 -0
- package/types/model/serialize.d.ts.map +1 -0
- package/types/native/DomOnlyStory.d.ts +49 -0
- package/types/native/DomOnlyStory.d.ts.map +1 -0
- package/types/native/GraphFallback.native.d.ts +41 -0
- package/types/native/GraphFallback.native.d.ts.map +1 -0
- package/types/native/GraphToolbar.d.ts +75 -0
- package/types/native/GraphToolbar.d.ts.map +1 -0
- package/types/native/NodeGraph.native.d.ts +128 -0
- package/types/native/NodeGraph.native.d.ts.map +1 -0
- package/types/native/domEntryRegistry.d.ts +33 -0
- package/types/native/domEntryRegistry.d.ts.map +1 -0
- package/types/native/graphChildren.d.ts +36 -0
- package/types/native/graphChildren.d.ts.map +1 -0
- package/types/nodes/GraphNode.d.ts +48 -0
- package/types/nodes/GraphNode.d.ts.map +1 -0
- package/types/nodes/GraphPort.d.ts +41 -0
- package/types/nodes/GraphPort.d.ts.map +1 -0
- package/types/nodes/handleGeometry.d.ts +183 -0
- package/types/nodes/handleGeometry.d.ts.map +1 -0
- package/types/nodes/lod.d.ts +55 -0
- package/types/nodes/lod.d.ts.map +1 -0
- package/types/nodes/nodeMeasure.d.ts +146 -0
- package/types/nodes/nodeMeasure.d.ts.map +1 -0
- package/types/nodes/overviewNode.d.ts +34 -0
- package/types/nodes/overviewNode.d.ts.map +1 -0
- package/types/react-flow/ConnectionPuck.d.ts +62 -0
- package/types/react-flow/ConnectionPuck.d.ts.map +1 -0
- package/types/react-flow/GraphActions.d.ts +45 -0
- package/types/react-flow/GraphActions.d.ts.map +1 -0
- package/types/react-flow/GraphCommandBridge.d.ts +45 -0
- package/types/react-flow/GraphCommandBridge.d.ts.map +1 -0
- package/types/react-flow/GraphNodeHost.d.ts +32 -0
- package/types/react-flow/GraphNodeHost.d.ts.map +1 -0
- package/types/react-flow/GraphPaintProbe.d.ts +26 -0
- package/types/react-flow/GraphPaintProbe.d.ts.map +1 -0
- package/types/react-flow/GraphZoomVar.d.ts +31 -0
- package/types/react-flow/GraphZoomVar.d.ts.map +1 -0
- package/types/react-flow/LassoOverlay.d.ts +39 -0
- package/types/react-flow/LassoOverlay.d.ts.map +1 -0
- package/types/react-flow/NodeGraphWeb.d.ts +195 -0
- package/types/react-flow/NodeGraphWeb.d.ts.map +1 -0
- package/types/react-flow/SnapGuides.d.ts +49 -0
- package/types/react-flow/SnapGuides.d.ts.map +1 -0
- package/types/react-flow/demoControlBody.d.ts +47 -0
- package/types/react-flow/demoControlBody.d.ts.map +1 -0
- package/types/react-flow/demoNodeBody.d.ts +37 -0
- package/types/react-flow/demoNodeBody.d.ts.map +1 -0
- package/types/react-flow/fixtures.d.ts +107 -0
- package/types/react-flow/fixtures.d.ts.map +1 -0
- package/types/react-flow/flowAdapter.d.ts +56 -0
- package/types/react-flow/flowAdapter.d.ts.map +1 -0
- package/types/react-flow/graphHandle.d.ts +90 -0
- package/types/react-flow/graphHandle.d.ts.map +1 -0
- package/types/react-flow/nodeCensus.d.ts +42 -0
- package/types/react-flow/nodeCensus.d.ts.map +1 -0
- package/types/react-flow/useGraphController.d.ts +93 -0
- package/types/react-flow/useGraphController.d.ts.map +1 -0
- package/types/react-flow/xy.d.ts +84 -0
- package/types/react-flow/xy.d.ts.map +1 -0
- package/types/theme/GraphFaces.d.ts +82 -0
- package/types/theme/GraphFaces.d.ts.map +1 -0
- package/types/theme/GraphVarsStyle.d.ts +56 -0
- package/types/theme/GraphVarsStyle.d.ts.map +1 -0
- package/types/theme/faces.d.ts +152 -0
- package/types/theme/faces.d.ts.map +1 -0
- package/types/theme/faces.generated.d.ts +27 -0
- package/types/theme/faces.generated.d.ts.map +1 -0
- package/types/theme/graphVars.d.ts +155 -0
- package/types/theme/graphVars.d.ts.map +1 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host side of the knob envelope: read the real knob stack, hand back the
|
|
3
|
+
* inputs that reproduce it. Design: docs/design/node-graph-editor.md 6.1.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { useEffect, useRef, useState } from "react";
|
|
7
|
+
import { useThemeName } from "tamagui";
|
|
8
|
+
import {
|
|
9
|
+
type Knobs,
|
|
10
|
+
SurfaceContext,
|
|
11
|
+
defaultKnobs,
|
|
12
|
+
useIntentContext,
|
|
13
|
+
usePresetContext,
|
|
14
|
+
useResolvedKnobs,
|
|
15
|
+
} from "@multiplatform.one/theme";
|
|
16
|
+
import type { GraphCssVarsOptions } from "../theme/graphVars";
|
|
17
|
+
import { useGraphCssVars } from "../theme/GraphVarsStyle";
|
|
18
|
+
import {
|
|
19
|
+
type GraphFontRef,
|
|
20
|
+
type KnobEnvelope,
|
|
21
|
+
type KnobEnvelopeBody,
|
|
22
|
+
knobEnvelopeIdentity,
|
|
23
|
+
knobEnvelopeSchemaVersion,
|
|
24
|
+
} from "./envelope";
|
|
25
|
+
|
|
26
|
+
export interface UseKnobEnvelopeOptions {
|
|
27
|
+
/** `props.knobs` — merged last, on top of the whole Preset chain. */
|
|
28
|
+
readonly knobs?: Partial<Knobs>;
|
|
29
|
+
/**
|
|
30
|
+
* The name the host mounted `<Preset preset=…>` with. Not readable from
|
|
31
|
+
* context (see `KnobEnvelope.presetName`), so a host under a named preset
|
|
32
|
+
* has to say so or the DOM side loses that preset's `intents` map.
|
|
33
|
+
*/
|
|
34
|
+
readonly presetName?: string;
|
|
35
|
+
/** Overrides the ambient `IntentContext` when the graph itself carries an intent. */
|
|
36
|
+
readonly intent?: string | null;
|
|
37
|
+
readonly fonts?: readonly GraphFontRef[];
|
|
38
|
+
/**
|
|
39
|
+
* Pointer class the graph is painted for, threaded into the var layer so the
|
|
40
|
+
* handle HIT region gets the 44 px floor on touch.
|
|
41
|
+
*/
|
|
42
|
+
readonly pointer?: GraphCssVarsOptions["pointer"];
|
|
43
|
+
/**
|
|
44
|
+
* The `--xy-*` / `--mpo-graph-*` layer. Built from `graphCssVars` against the
|
|
45
|
+
* live theme by default; pass your own only to override the whole layer.
|
|
46
|
+
*/
|
|
47
|
+
readonly vars?: Readonly<Record<string, string>>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* `prefers-reduced-motion: reduce`, read the way the theme package reads it.
|
|
52
|
+
*
|
|
53
|
+
* A copy rather than an import: `usePrefersReducedMotion` is module-private in
|
|
54
|
+
* `useResolvedKnobs.ts:22` and is not exported from `@multiplatform.one/theme`.
|
|
55
|
+
* The value has to be resolved HOST-side because a WKWebView's `matchMedia`
|
|
56
|
+
* does not see the iOS setting.
|
|
57
|
+
*/
|
|
58
|
+
function useHostPrefersReducedMotion(): boolean {
|
|
59
|
+
const [reduced, setReduced] = useState(() => {
|
|
60
|
+
if (typeof window === "undefined" || !window.matchMedia) return false;
|
|
61
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
62
|
+
});
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
65
|
+
const query = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
66
|
+
const handler = () => setReduced(query.matches);
|
|
67
|
+
handler();
|
|
68
|
+
if (typeof query.addEventListener === "function") {
|
|
69
|
+
query.addEventListener("change", handler);
|
|
70
|
+
return () => query.removeEventListener("change", handler);
|
|
71
|
+
}
|
|
72
|
+
if (typeof query.addListener === "function") {
|
|
73
|
+
query.addListener(handler);
|
|
74
|
+
return () => query.removeListener?.(handler);
|
|
75
|
+
}
|
|
76
|
+
}, []);
|
|
77
|
+
return reduced;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Drop keys whose value is `undefined` so a spread cannot erase a default. */
|
|
81
|
+
function definedOnly<T extends object>(value: T): Partial<T> {
|
|
82
|
+
const out: Record<string, unknown> = {};
|
|
83
|
+
for (const [key, item] of Object.entries(value)) {
|
|
84
|
+
if (item !== undefined) out[key] = item;
|
|
85
|
+
}
|
|
86
|
+
return out as Partial<T>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const emptyFonts: readonly GraphFontRef[] = [];
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Build the envelope from the live knob stack.
|
|
93
|
+
*
|
|
94
|
+
* The knob merge is deliberately the SAME expression `useResolvedKnobs` uses
|
|
95
|
+
* for its base (`{...presetCtx.preset.knobs, ...presetCtx.overrides}`,
|
|
96
|
+
* useResolvedKnobs.ts:131-133) — anything cleverer is a second resolver to keep
|
|
97
|
+
* in step. It is then completed against `defaultKnobs`, because `JSON.stringify`
|
|
98
|
+
* DROPS a key whose value is `undefined`: without the completion an optional
|
|
99
|
+
* knob (`cornerSmoothing`, `pageTitleScale`) would arrive absent on the far
|
|
100
|
+
* side and the rehydrating `<Preset>`'s own base would show through the gap.
|
|
101
|
+
*/
|
|
102
|
+
export function useKnobEnvelope(options?: UseKnobEnvelopeOptions): KnobEnvelope {
|
|
103
|
+
const presetCtx = usePresetContext();
|
|
104
|
+
const contextIntent = useIntentContext();
|
|
105
|
+
const surfaceCtx = SurfaceContext.useStyledContext();
|
|
106
|
+
const themeName = (useThemeName() as string | undefined) ?? "";
|
|
107
|
+
const prefersReducedMotion = useHostPrefersReducedMotion();
|
|
108
|
+
// The var layer is canvas CHROME, so it resolves with the ambient intent and
|
|
109
|
+
// no component: a node's own paint comes from `useGraphNodeKnobs`, not from
|
|
110
|
+
// a `--xy-*` variable (design 6.2 — the `--xy-node-*` family is allowlisted
|
|
111
|
+
// out precisely because it never binds to a Tamagui node).
|
|
112
|
+
const chromeKnobs = useResolvedKnobs();
|
|
113
|
+
const builtVars = useGraphCssVars(chromeKnobs, { pointer: options?.pointer });
|
|
114
|
+
|
|
115
|
+
const merged: Knobs = {
|
|
116
|
+
...defaultKnobs,
|
|
117
|
+
...definedOnly(
|
|
118
|
+
presetCtx ? { ...presetCtx.preset.knobs, ...presetCtx.overrides } : defaultKnobs,
|
|
119
|
+
),
|
|
120
|
+
...definedOnly(options?.knobs ?? {}),
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const body: KnobEnvelopeBody = {
|
|
124
|
+
schemaVersion: knobEnvelopeSchemaVersion,
|
|
125
|
+
knobs: merged,
|
|
126
|
+
presetName: options?.presetName,
|
|
127
|
+
intent: options?.intent !== undefined ? options.intent : contextIntent,
|
|
128
|
+
surface: { size: surfaceCtx?.size ?? "unset", density: surfaceCtx?.density ?? "unset" },
|
|
129
|
+
scheme: themeName.startsWith("dark") ? "dark" : "light",
|
|
130
|
+
themeName,
|
|
131
|
+
prefersReducedMotion,
|
|
132
|
+
vars: options?.vars ?? builtVars,
|
|
133
|
+
fonts: options?.fonts ?? emptyFonts,
|
|
134
|
+
pixelRatio:
|
|
135
|
+
typeof window !== "undefined" && typeof window.devicePixelRatio === "number"
|
|
136
|
+
? window.devicePixelRatio
|
|
137
|
+
: 1,
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const identity = knobEnvelopeIdentity(body);
|
|
141
|
+
const state = useRef<{ identity: string; envelope: KnobEnvelope } | null>(null);
|
|
142
|
+
if (!state.current || state.current.identity !== identity) {
|
|
143
|
+
// Derived from this render's own inputs, so the ref write is pure in the
|
|
144
|
+
// sense React cares about: a re-render with the same inputs produces the
|
|
145
|
+
// same envelope, identity included.
|
|
146
|
+
state.current = {
|
|
147
|
+
identity,
|
|
148
|
+
envelope: { ...body, revision: (state.current?.envelope.revision ?? 0) + 1 },
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
return state.current.envelope;
|
|
152
|
+
}
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `NodeGraph/AutoLayout` — design §8, and the place tasks 4.3 and 4.4 are
|
|
3
|
+
* carried out by hand.
|
|
4
|
+
*
|
|
5
|
+
* MILESTONE 6 REBUILT IT AS A SIBLING. Every control on this page used to be a
|
|
6
|
+
* `children` of `<NodeGraph>` — Tidy, Undo, Redo, the runner readout — and
|
|
7
|
+
* `NodeGraph.native.tsx` accepts children and IGNORES them by written contract.
|
|
8
|
+
* So on the iPhone 16e simulator and both emulators this story painted twelve
|
|
9
|
+
* scrambled nodes and offered no way to lay them out, `layoutRunner` read
|
|
10
|
+
* `none` on every host, and MPO-213's device criterion could not be attempted
|
|
11
|
+
* at all. Nothing threw; the canvas looked fine.
|
|
12
|
+
*
|
|
13
|
+
* The toolbar is now OUTSIDE the canvas and drives it through `graphRef`, which
|
|
14
|
+
* is design §9.1's imperative handle and the same eleven commands on both
|
|
15
|
+
* platforms. The runner and the engine milliseconds come back on the wire as
|
|
16
|
+
* `{ t: "layoutResult" }` rather than being read out of a context that only
|
|
17
|
+
* exists inside the canvas.
|
|
18
|
+
*
|
|
19
|
+
* - `Main` prints the RESOLVED RUNNER and the engine ms. On web that must read
|
|
20
|
+
* `worker-blob`, and inside the Kitchen Sink's WebView it must read
|
|
21
|
+
* `worker-blob` TOO — see the correction below. An `inline` reading on a
|
|
22
|
+
* platform that has `Worker` is a FAILURE, not a slower pass (design §13.2),
|
|
23
|
+
* and the readout paints it as one rather than showing a word nobody looks
|
|
24
|
+
* twice at. A relayout that REJECTS is painted as a failure as well, because
|
|
25
|
+
* before milestone 6's device pass it was painted as nothing at all.
|
|
26
|
+
* - `Undo` is task 4.4: tidy, undo, and the graph returns exactly. The
|
|
27
|
+
* positions are printed as a checksum so "exactly" is checkable instead of
|
|
28
|
+
* eyeballed. WEB ONLY, because the checksum reads every node's CSS transform
|
|
29
|
+
* and the nodes are inside the WebView; the device half of 4.4 is the Undo
|
|
30
|
+
* button working at all, which the toolbar now allows.
|
|
31
|
+
* - `Large200` is the 200-node graph the "a relayout never blocks a frame"
|
|
32
|
+
* measurement is taken on. It parks a `window.__mpoAutoLayout` handle for
|
|
33
|
+
* browser automation to drive.
|
|
34
|
+
*
|
|
35
|
+
* The handle is story-only. Nothing in the package reads it.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
39
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
40
|
+
import { Button, SizableText, XStack, YStack } from "tamagui";
|
|
41
|
+
import type { GraphEventWire } from "../dom/wire";
|
|
42
|
+
import type { BuiltinEdgeData } from "../edges/edgeKinds";
|
|
43
|
+
import type { GraphDocument } from "../model/index";
|
|
44
|
+
import { GraphToolbar } from "../native/GraphToolbar";
|
|
45
|
+
import { hasDomRealm } from "../native/DomOnlyStory";
|
|
46
|
+
import { NodeGraph } from "../NodeGraph";
|
|
47
|
+
import { demoGraphSchema } from "../react-flow/demoNodeBody";
|
|
48
|
+
import type { DemoNodeData } from "../react-flow/fixtures";
|
|
49
|
+
import type { NodeGraphHandle } from "../react-flow/graphHandle";
|
|
50
|
+
import { Background, Controls, reactFlowNodeSelector } from "../react-flow/xy";
|
|
51
|
+
|
|
52
|
+
type Doc = GraphDocument<DemoNodeData, BuiltinEdgeData>;
|
|
53
|
+
|
|
54
|
+
const schema = demoGraphSchema();
|
|
55
|
+
|
|
56
|
+
const meta: Meta<typeof NodeGraph> = {
|
|
57
|
+
title: "NodeGraph/AutoLayout",
|
|
58
|
+
component: NodeGraph,
|
|
59
|
+
parameters: {
|
|
60
|
+
status: { type: "beta" },
|
|
61
|
+
layout: "fullscreen",
|
|
62
|
+
docs: {
|
|
63
|
+
description: {
|
|
64
|
+
component:
|
|
65
|
+
"Off-thread auto-layout (design 8). dagre is bundled into a committed string and instantiated as a classic blob-URL Worker whose liveness is PROBED with a ping and a 500 ms timeout. The device answer is worker-blob, not hermes-inline: milestone 6 moved relayout onto the imperative handle, which is implemented inside the canvas, and on native the canvas paints in a WebView — which has a real Worker. hermes-inline stays a first-class runner for a caller on the Hermes side; nothing here is one. The arriving positions land as ONE setPositions command inside startTransition, so one undo restores the whole prior arrangement. The toolbar is a SIBLING of the canvas driving it through the imperative handle, because native drops children — which is why layoutRunner read `none` on every device until milestone 6. elkjs is not here: decision D2 is unruled.",
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
export default meta;
|
|
71
|
+
|
|
72
|
+
type Story = StoryObj<typeof NodeGraph>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A graph nobody would keep. Every node is on a diagonal with the edges
|
|
76
|
+
* crossing, so a tidy that did nothing would be obvious at a glance.
|
|
77
|
+
*/
|
|
78
|
+
function scrambled(count: number): Doc {
|
|
79
|
+
const kinds = ["source", "transform", "sink"] as const;
|
|
80
|
+
const nodes = Array.from({ length: count }, (_, index) => {
|
|
81
|
+
const kind = kinds[index % kinds.length];
|
|
82
|
+
const data =
|
|
83
|
+
kind === "source"
|
|
84
|
+
? { table: `orders_${index}` }
|
|
85
|
+
: kind === "transform"
|
|
86
|
+
? { expression: `row => row.${index}` }
|
|
87
|
+
: { target: `warehouse_${index}` };
|
|
88
|
+
return {
|
|
89
|
+
id: `n${index}`,
|
|
90
|
+
kind,
|
|
91
|
+
// A deterministic scatter: no Math.random, so two sessions compare.
|
|
92
|
+
position: { x: ((index * 137) % 900) - 200, y: ((index * 211) % 700) - 150 },
|
|
93
|
+
data,
|
|
94
|
+
};
|
|
95
|
+
}) as Doc["nodes"];
|
|
96
|
+
|
|
97
|
+
const edges: Doc["edges"][number][] = [];
|
|
98
|
+
for (let index = 0; index + 1 < count; index += 1) {
|
|
99
|
+
const from = nodes[index];
|
|
100
|
+
const to = nodes[index + 1];
|
|
101
|
+
const sourcePort = from.kind === "source" ? "rows" : from.kind === "transform" ? "ok" : null;
|
|
102
|
+
if (!sourcePort) continue;
|
|
103
|
+
edges.push({
|
|
104
|
+
id: `${from.id}->${to.id}`,
|
|
105
|
+
kind: (["flow", "data", "error", "conditional"] as const)[edges.length % 4],
|
|
106
|
+
source: { node: from.id, port: sourcePort },
|
|
107
|
+
target: { node: to.id, port: "in" },
|
|
108
|
+
data: {},
|
|
109
|
+
} as Doc["edges"][number]);
|
|
110
|
+
}
|
|
111
|
+
return { version: 1, nodes, edges };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** What the last `{ t: "layoutResult" }` said. */
|
|
115
|
+
interface LayoutReading {
|
|
116
|
+
readonly runner: string;
|
|
117
|
+
readonly ms: number;
|
|
118
|
+
readonly nodeCount: number;
|
|
119
|
+
/** Set when the engine REJECTED — see the `layoutResult` note in `wire.ts`. */
|
|
120
|
+
readonly error?: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The whole page: a sibling toolbar, a readout fed by the wire, and a canvas.
|
|
125
|
+
*
|
|
126
|
+
* `hasWorker` is read on the HOST side, which is the right side: the claim
|
|
127
|
+
* design §13.2 makes is about the platform the canvas runs on, and on native
|
|
128
|
+
* the host and the WebView disagree — Hermes has no `Worker` and the WebView
|
|
129
|
+
* does. So the failing case is stated per platform rather than as one boolean:
|
|
130
|
+
* `inline` is a failure when the realm that produced it had a `Worker` to use,
|
|
131
|
+
* and `hermes-inline` is a first-class pass.
|
|
132
|
+
*
|
|
133
|
+
* THE DEVICE ANSWER IS `worker-blob`, corrected after the m6 device pass. This
|
|
134
|
+
* story used to say `hermes-inline`, and that was a reading of design §8's
|
|
135
|
+
* "native runs inline on the Hermes JS thread" — true of the realm it names,
|
|
136
|
+
* and never tested, because until milestone 6 nothing on a phone could ask for
|
|
137
|
+
* a layout at all and `layoutRunner` read `none` everywhere. Milestone 6 put
|
|
138
|
+
* `relayout` on the imperative handle, which is implemented inside the canvas,
|
|
139
|
+
* and on native the canvas paints in a WebView: a WebView has a real `Worker`,
|
|
140
|
+
* so the probe resolves `worker-blob`. Measured on the iPhone 16e:
|
|
141
|
+
* `worker-blob · engine 6.0 ms` at 12 nodes, `31.8 ms` at 200. The probe did
|
|
142
|
+
* its job; the failing case §13.2 guards against is `inline` WITH a `Worker`,
|
|
143
|
+
* which did not occur.
|
|
144
|
+
*/
|
|
145
|
+
function AutoLayoutPage({
|
|
146
|
+
count,
|
|
147
|
+
showChecksum = false,
|
|
148
|
+
parkHandle = false,
|
|
149
|
+
fitView = false,
|
|
150
|
+
}: {
|
|
151
|
+
readonly count: number;
|
|
152
|
+
readonly showChecksum?: boolean;
|
|
153
|
+
readonly parkHandle?: boolean;
|
|
154
|
+
readonly fitView?: boolean;
|
|
155
|
+
}) {
|
|
156
|
+
const graph = useRef<NodeGraphHandle>(null);
|
|
157
|
+
const [reading, setReading] = useState<LayoutReading | null>(null);
|
|
158
|
+
const [pending, setPending] = useState(false);
|
|
159
|
+
const [checksum, setChecksum] = useState<string | null>(null);
|
|
160
|
+
const document = useMemo(() => scrambled(count), [count]);
|
|
161
|
+
|
|
162
|
+
const onGraphEvent = useCallback((event: GraphEventWire) => {
|
|
163
|
+
if (event.t !== "layoutResult") return;
|
|
164
|
+
setPending(false);
|
|
165
|
+
setReading({
|
|
166
|
+
runner: event.runner,
|
|
167
|
+
ms: event.ms,
|
|
168
|
+
nodeCount: event.nodeCount,
|
|
169
|
+
error: event.error,
|
|
170
|
+
});
|
|
171
|
+
// A rejected relayout laid nothing out, so there is nothing to fit and the
|
|
172
|
+
// fit would only hide the failure by moving the graph.
|
|
173
|
+
if (event.error) return;
|
|
174
|
+
/*
|
|
175
|
+
Re-fit once a tidy has settled — STORY behaviour, not package behaviour.
|
|
176
|
+
|
|
177
|
+
The engine deliberately anchors the tidied box where the old one was
|
|
178
|
+
(design §8: a tidy that teleports the graph reads as a crash), so a graph
|
|
179
|
+
that was scattered over 900 units comes back tidy and half off-screen. In
|
|
180
|
+
a real editor that is right, because the user is looking at a place they
|
|
181
|
+
chose. In a story nobody chose anything, so the demo fits the result — and
|
|
182
|
+
it does it through the same handle the buttons use, which is the only door
|
|
183
|
+
a native sibling has.
|
|
184
|
+
*/
|
|
185
|
+
graph.current?.fitView();
|
|
186
|
+
}, []);
|
|
187
|
+
|
|
188
|
+
const tidy = useCallback(() => {
|
|
189
|
+
setPending(true);
|
|
190
|
+
graph.current?.relayout();
|
|
191
|
+
}, []);
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* React Flow places a node with a CSS TRANSFORM, never with a layout offset.
|
|
195
|
+
* The first version of this read `offsetLeft` / `offsetTop`, which are 0 for
|
|
196
|
+
* every node at every arrangement — so the checksum was constant and the
|
|
197
|
+
* story "passed" without measuring anything. Caught in Chrome, not here.
|
|
198
|
+
*
|
|
199
|
+
* WEB ONLY, and honestly so: on device the nodes are inside the WebView and a
|
|
200
|
+
* Hermes-side `querySelectorAll` has nothing to walk.
|
|
201
|
+
*/
|
|
202
|
+
const stamp = useCallback(() => {
|
|
203
|
+
if (!hasDomRealm) {
|
|
204
|
+
setChecksum("no DOM on this side of the bridge");
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const nodes = globalThis.document.querySelectorAll<HTMLElement>(reactFlowNodeSelector);
|
|
208
|
+
let total = 0;
|
|
209
|
+
for (const node of nodes) {
|
|
210
|
+
const match = /translate\(([-\d.]+)px,\s*([-\d.]+)px\)/.exec(node.style.transform ?? "");
|
|
211
|
+
if (!match) continue;
|
|
212
|
+
total += Number(match[1]) + Number(match[2]) * 3;
|
|
213
|
+
}
|
|
214
|
+
setChecksum(`${nodes.length} nodes / ${Math.round(total)}`);
|
|
215
|
+
}, []);
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* The handle browser automation drives for the §13.2 measurement.
|
|
219
|
+
*
|
|
220
|
+
* A story-only escape hatch, and it is here rather than in the package
|
|
221
|
+
* because nothing in the package should be reachable from `window`. It now
|
|
222
|
+
* hangs off `graphRef`, so it reaches the canvas the same way the buttons do.
|
|
223
|
+
*/
|
|
224
|
+
useEffect(() => {
|
|
225
|
+
if (!parkHandle) return;
|
|
226
|
+
(globalThis as unknown as { __mpoAutoLayout?: unknown }).__mpoAutoLayout = {
|
|
227
|
+
relayout: () => graph.current?.relayout(),
|
|
228
|
+
fitView: () => graph.current?.fitView(),
|
|
229
|
+
reading: () => reading,
|
|
230
|
+
};
|
|
231
|
+
return () => {
|
|
232
|
+
delete (globalThis as unknown as { __mpoAutoLayout?: unknown }).__mpoAutoLayout;
|
|
233
|
+
};
|
|
234
|
+
}, [parkHandle, reading]);
|
|
235
|
+
|
|
236
|
+
// `inline` where a `Worker` exists is a failed measurement, not a slow one.
|
|
237
|
+
const wrongRunner = reading?.runner === "inline" && typeof globalThis.Worker === "function";
|
|
238
|
+
|
|
239
|
+
return (
|
|
240
|
+
<YStack width="100%" height={640} padding="$3" gap="$2">
|
|
241
|
+
<SizableText size="$2" opacity={0.7}>
|
|
242
|
+
Press Tidy. The readout is the assertion: `worker-blob` on web AND on device — the relayout
|
|
243
|
+
runs inside the canvas, and on native the canvas is a WebView, which has a real Worker.
|
|
244
|
+
`inline` on a platform that has Worker is a failed run, not a slow one.
|
|
245
|
+
</SizableText>
|
|
246
|
+
{/* OUTSIDE the canvas. On native a child of <NodeGraph> is dropped, which
|
|
247
|
+
is why this page had no Tidy button on any device until milestone 6. */}
|
|
248
|
+
<XStack gap="$3" alignItems="center" flexWrap="wrap">
|
|
249
|
+
<GraphToolbar
|
|
250
|
+
mode="pan"
|
|
251
|
+
onModeChange={() => undefined}
|
|
252
|
+
onFitView={() => graph.current?.fitView()}
|
|
253
|
+
onTidy={tidy}
|
|
254
|
+
onUndo={() => graph.current?.undo()}
|
|
255
|
+
onRedo={() => graph.current?.redo()}
|
|
256
|
+
busy={pending}
|
|
257
|
+
/>
|
|
258
|
+
{showChecksum ? (
|
|
259
|
+
<>
|
|
260
|
+
<Button size="$2" onPress={stamp}>
|
|
261
|
+
Stamp positions
|
|
262
|
+
</Button>
|
|
263
|
+
<SizableText size="$2" opacity={0.7}>
|
|
264
|
+
{checksum === null ? "no stamp yet" : `checksum ${checksum}`}
|
|
265
|
+
</SizableText>
|
|
266
|
+
</>
|
|
267
|
+
) : null}
|
|
268
|
+
</XStack>
|
|
269
|
+
<XStack gap="$3" alignItems="center" flexWrap="wrap">
|
|
270
|
+
<SizableText size="$2" theme={wrongRunner ? "red" : undefined} fontFamily="$mono">
|
|
271
|
+
{`runner ${reading?.runner ?? "not run yet"}`}
|
|
272
|
+
</SizableText>
|
|
273
|
+
{wrongRunner ? (
|
|
274
|
+
<SizableText size="$2" theme="red">
|
|
275
|
+
FAILED — this platform has Worker, so `inline` is not a valid measurement
|
|
276
|
+
</SizableText>
|
|
277
|
+
) : null}
|
|
278
|
+
{/*
|
|
279
|
+
A REJECTED relayout, which until the m6 device pass answered with
|
|
280
|
+
nothing at all: the readout sat on "laying out…" forever and that was
|
|
281
|
+
indistinguishable from a Tidy that never reached the canvas.
|
|
282
|
+
*/}
|
|
283
|
+
{reading?.error ? (
|
|
284
|
+
<SizableText size="$2" theme="red">
|
|
285
|
+
{`FAILED — the engine rejected: ${reading.error}`}
|
|
286
|
+
</SizableText>
|
|
287
|
+
) : null}
|
|
288
|
+
<SizableText size="$2" opacity={0.7} fontFamily="$mono">
|
|
289
|
+
{reading === null ? "engine —" : `engine ${reading.ms.toFixed(1)} ms`}
|
|
290
|
+
</SizableText>
|
|
291
|
+
<SizableText size="$2" opacity={0.7} fontFamily="$mono">
|
|
292
|
+
{`${reading?.nodeCount ?? count} nodes`}
|
|
293
|
+
</SizableText>
|
|
294
|
+
{pending ? (
|
|
295
|
+
<SizableText size="$2" opacity={0.7}>
|
|
296
|
+
laying out…
|
|
297
|
+
</SizableText>
|
|
298
|
+
) : null}
|
|
299
|
+
</XStack>
|
|
300
|
+
<YStack flex={1}>
|
|
301
|
+
<NodeGraph
|
|
302
|
+
schema={schema}
|
|
303
|
+
defaultDocument={document}
|
|
304
|
+
fitView={fitView}
|
|
305
|
+
graphRef={graph}
|
|
306
|
+
onGraphEvent={onGraphEvent}
|
|
307
|
+
>
|
|
308
|
+
{/*
|
|
309
|
+
React Flow's own chrome, and the ONE thing that is still legitimately
|
|
310
|
+
a child: `Background` and `Controls` are React Flow components, they
|
|
311
|
+
paint inside the pane, and on native the canvas mounts its own chrome
|
|
312
|
+
from options. Rendered as `null` there rather than passed and dropped,
|
|
313
|
+
so the milestone-6 warning stays meaningful — a warning that fired on
|
|
314
|
+
correct code is a warning people learn to ignore.
|
|
315
|
+
*/}
|
|
316
|
+
{hasDomRealm ? (
|
|
317
|
+
<>
|
|
318
|
+
<Background />
|
|
319
|
+
<Controls />
|
|
320
|
+
</>
|
|
321
|
+
) : null}
|
|
322
|
+
</NodeGraph>
|
|
323
|
+
</YStack>
|
|
324
|
+
</YStack>
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export const Main: Story = {
|
|
329
|
+
render: () => <AutoLayoutPage count={12} />,
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
export const Undo: Story = {
|
|
333
|
+
render: () => <AutoLayoutPage count={12} showChecksum />,
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
export const Large200: Story = {
|
|
337
|
+
render: () => <AutoLayoutPage count={200} parkHandle fitView />,
|
|
338
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dagre adapter: pure, headless, and the only engine in the package.
|
|
3
|
+
*
|
|
4
|
+
* Pure so it can run in three realms that share nothing — the main thread, a
|
|
5
|
+
* classic Worker built from `worker.generated.ts`, and the Hermes JS thread on
|
|
6
|
+
* native. Headless is not a claim, it is asserted: `layout.spec.ts` stubs
|
|
7
|
+
* `document` and `window` to `undefined` for every case, because a stray DOM
|
|
8
|
+
* reach here would surface as a runtime error inside a Worker, which is the
|
|
9
|
+
* least debuggable place in this package.
|
|
10
|
+
*
|
|
11
|
+
* Three things this file is responsible for that dagre is not:
|
|
12
|
+
*
|
|
13
|
+
* - **Centres to top-left.** dagre reports a node's CENTRE. Documents and
|
|
14
|
+
* React Flow both hold top-left. Converting at the boundary is why nothing
|
|
15
|
+
* downstream has to know dagre's convention.
|
|
16
|
+
* - **Determinism.** dagre's own result depends on insertion order, so nodes
|
|
17
|
+
* and edges are sorted by id before they go in. Without that, two
|
|
18
|
+
* structurally equal documents that were BUILT differently lay out
|
|
19
|
+
* differently, and the "same input twice" assertion would pass while the
|
|
20
|
+
* real property failed.
|
|
21
|
+
* - **The anchor.** A tidy that teleports the graph to the origin looks like
|
|
22
|
+
* a crash. The laid-out bounding box's top-left is translated back onto the
|
|
23
|
+
* top-left the moved set already occupied, so the arrangement changes and
|
|
24
|
+
* the location does not.
|
|
25
|
+
*
|
|
26
|
+
* Design §8. Licence: dagre is MIT, compatible with this repo's Apache-2.0 —
|
|
27
|
+
* unlike elkjs, whose `EPL-2.0 OR GPL-3.0-or-later` is decision D2 and is
|
|
28
|
+
* still unruled, which is why there is no second engine here.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import { Graph, layout as runDagre } from "@dagrejs/dagre";
|
|
32
|
+
import type { NodeId, XY } from "../model/document";
|
|
33
|
+
import { ensureStructuredClone } from "./structuredCloneShim";
|
|
34
|
+
import type { LayoutNodeInput, LayoutRequest, LayoutResult } from "./types";
|
|
35
|
+
|
|
36
|
+
/** dagre's own defaults are 50 / 50; these are tuned for the node measures. */
|
|
37
|
+
export const defaultLayoutSpacing = {
|
|
38
|
+
direction: "TB",
|
|
39
|
+
nodeSpacing: 60,
|
|
40
|
+
rankSpacing: 90,
|
|
41
|
+
edgeSpacing: 20,
|
|
42
|
+
} as const;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* `performance` where it exists, `Date` otherwise.
|
|
46
|
+
*
|
|
47
|
+
* Both are present in a Worker and on Hermes, but neither is guaranteed by the
|
|
48
|
+
* type system in a file that must not assume a realm, and a timing helper is
|
|
49
|
+
* the last place worth throwing from.
|
|
50
|
+
*/
|
|
51
|
+
function now(): number {
|
|
52
|
+
return typeof performance !== "undefined" && typeof performance.now === "function"
|
|
53
|
+
? performance.now()
|
|
54
|
+
: Date.now();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** 2 dp, matching `serializeDocument`, so a laid-out document diffs clean. */
|
|
58
|
+
function round2(value: number): number {
|
|
59
|
+
return Math.round(value * 100) / 100;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function byId<T extends { readonly id: string }>(a: T, b: T): number {
|
|
63
|
+
return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function minPoint(points: readonly XY[]): XY {
|
|
67
|
+
let x = Number.POSITIVE_INFINITY;
|
|
68
|
+
let y = Number.POSITIVE_INFINITY;
|
|
69
|
+
for (const point of points) {
|
|
70
|
+
if (point.x < x) x = point.x;
|
|
71
|
+
if (point.y < y) y = point.y;
|
|
72
|
+
}
|
|
73
|
+
return { x, y };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function layoutWithDagre(request: LayoutRequest): LayoutResult {
|
|
77
|
+
// dagre 3.1.1 calls `structuredClone` on the positioning hot path, and
|
|
78
|
+
// neither Hermes nor a pre-15.4 WKWebView has one. See the shim's header:
|
|
79
|
+
// this was found by running the bundled worker, not by reading a changelog.
|
|
80
|
+
ensureStructuredClone();
|
|
81
|
+
const started = now();
|
|
82
|
+
const options = request.options ?? {};
|
|
83
|
+
const nodes = [...request.nodes].sort(byId);
|
|
84
|
+
|
|
85
|
+
// A subset id that names no node is dropped rather than refused: the caller
|
|
86
|
+
// is usually a live selection, and a node deleted between the click and the
|
|
87
|
+
// request is not an error worth failing a tidy over.
|
|
88
|
+
const wanted = options.subset ? new Set(options.subset) : undefined;
|
|
89
|
+
const moving: LayoutNodeInput[] = wanted ? nodes.filter((node) => wanted.has(node.id)) : nodes;
|
|
90
|
+
const movingIds = new Set(moving.map((node) => node.id));
|
|
91
|
+
|
|
92
|
+
const positions: Record<NodeId, XY> = {};
|
|
93
|
+
for (const node of nodes) positions[node.id] = node.position;
|
|
94
|
+
|
|
95
|
+
if (moving.length === 0) {
|
|
96
|
+
return { positions, moved: [], engine: "dagre", ms: now() - started };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const graph = new Graph({ multigraph: true, compound: false, directed: true });
|
|
100
|
+
graph.setGraph({
|
|
101
|
+
rankdir: options.direction ?? defaultLayoutSpacing.direction,
|
|
102
|
+
nodesep: options.nodeSpacing ?? defaultLayoutSpacing.nodeSpacing,
|
|
103
|
+
ranksep: options.rankSpacing ?? defaultLayoutSpacing.rankSpacing,
|
|
104
|
+
edgesep: options.edgeSpacing ?? defaultLayoutSpacing.edgeSpacing,
|
|
105
|
+
marginx: 0,
|
|
106
|
+
marginy: 0,
|
|
107
|
+
});
|
|
108
|
+
graph.setDefaultEdgeLabel(() => ({}));
|
|
109
|
+
|
|
110
|
+
for (const node of moving) graph.setNode(node.id, { width: node.width, height: node.height });
|
|
111
|
+
// Only edges with BOTH ends in the moving set. An edge to a fixed node would
|
|
112
|
+
// otherwise reintroduce that node as a rank participant, which is the exact
|
|
113
|
+
// thing `subset` promises not to do.
|
|
114
|
+
for (const edge of [...request.edges].sort(byId)) {
|
|
115
|
+
if (!movingIds.has(edge.source) || !movingIds.has(edge.target)) continue;
|
|
116
|
+
graph.setEdge(edge.source, edge.target, {}, edge.id);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
runDagre(graph);
|
|
120
|
+
|
|
121
|
+
const laid: Record<NodeId, XY> = {};
|
|
122
|
+
for (const node of moving) {
|
|
123
|
+
const out = graph.node(node.id) as { x?: number; y?: number } | undefined;
|
|
124
|
+
laid[node.id] =
|
|
125
|
+
out && Number.isFinite(out.x) && Number.isFinite(out.y)
|
|
126
|
+
? // Centre → top-left.
|
|
127
|
+
{ x: (out.x as number) - node.width / 2, y: (out.y as number) - node.height / 2 }
|
|
128
|
+
: node.position;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const before = minPoint(moving.map((node) => node.position));
|
|
132
|
+
const after = minPoint(moving.map((node) => laid[node.id]));
|
|
133
|
+
const shiftX = before.x - after.x;
|
|
134
|
+
const shiftY = before.y - after.y;
|
|
135
|
+
|
|
136
|
+
for (const node of moving) {
|
|
137
|
+
positions[node.id] = {
|
|
138
|
+
x: round2(laid[node.id].x + shiftX),
|
|
139
|
+
y: round2(laid[node.id].y + shiftY),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return {
|
|
144
|
+
positions,
|
|
145
|
+
moved: moving.map((node) => node.id),
|
|
146
|
+
engine: "dagre",
|
|
147
|
+
ms: now() - started,
|
|
148
|
+
};
|
|
149
|
+
}
|