@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,412 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The snapper, design §7.2. This file carries S2, S4, S7, S8 and S9; S1, S3,
|
|
3
|
+
* S5, S6, S10 and S11 are the wiring's, and live in `snapChanges.spec.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Four of the five are written as TABLES rather than prose tests, because each
|
|
6
|
+
* is a claim about a family of inputs and a single example proves the family
|
|
7
|
+
* only by accident. S4 in particular is nine pairs per axis, and nine hand-
|
|
8
|
+
* written `it` blocks is where one of them quietly goes missing.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { describe, expect, it } from "vitest";
|
|
12
|
+
import type { NodeId, Rect } from "../model/document";
|
|
13
|
+
import {
|
|
14
|
+
alignmentThreshold,
|
|
15
|
+
defaultCandidateRadius,
|
|
16
|
+
defaultSnapThresholdPx,
|
|
17
|
+
snapToAlignment,
|
|
18
|
+
} from "./snapAlignment";
|
|
19
|
+
import type { PositionedNode, SnapToAlignmentInput } from "./snapAlignment";
|
|
20
|
+
import { buildSpatialHash } from "./spatialHash";
|
|
21
|
+
|
|
22
|
+
function nodesOf(...nodes: PositionedNode[]): ReadonlyMap<NodeId, PositionedNode> {
|
|
23
|
+
return new Map(nodes.map((node) => [node.id, node]));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Everything a caller has to assemble, so a test states only what it varies. */
|
|
27
|
+
function snap(options: {
|
|
28
|
+
readonly rect: Rect;
|
|
29
|
+
readonly candidates: readonly PositionedNode[];
|
|
30
|
+
readonly ids?: readonly NodeId[];
|
|
31
|
+
readonly dragged?: readonly PositionedNode[];
|
|
32
|
+
readonly threshold?: number;
|
|
33
|
+
readonly radius?: number;
|
|
34
|
+
}) {
|
|
35
|
+
const dragged = options.dragged ?? [];
|
|
36
|
+
const nodes = nodesOf(...options.candidates, ...dragged);
|
|
37
|
+
const input: SnapToAlignmentInput = {
|
|
38
|
+
ids: options.ids ?? dragged.map((node) => node.id),
|
|
39
|
+
rect: options.rect,
|
|
40
|
+
nodes,
|
|
41
|
+
// Built over EVERY node, dragged ones included, so S7 is proven by the
|
|
42
|
+
// snapper's own exclusion and not by a caller that pre-filtered for it.
|
|
43
|
+
index: buildSpatialHash([...options.candidates, ...dragged]),
|
|
44
|
+
thresholdFlowUnits: options.threshold ?? 5,
|
|
45
|
+
radius: options.radius ?? defaultCandidateRadius,
|
|
46
|
+
};
|
|
47
|
+
return snapToAlignment(input);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const box = (id: string, x: number, y: number, width = 100, height = 50): PositionedNode => ({
|
|
51
|
+
id,
|
|
52
|
+
rect: { x, y, width, height },
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
describe("alignmentThreshold", () => {
|
|
56
|
+
it("divides the screen threshold by the zoom, so the pull is a screen distance", () => {
|
|
57
|
+
expect(alignmentThreshold({ thresholdScreenPx: 8, zoom: 1 })).toBe(8);
|
|
58
|
+
expect(alignmentThreshold({ thresholdScreenPx: 8, zoom: 0.5 })).toBe(16);
|
|
59
|
+
expect(alignmentThreshold({ thresholdScreenPx: 8, zoom: 2 })).toBe(4);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("refuses a zoom that would make the threshold infinite", () => {
|
|
63
|
+
expect(alignmentThreshold({ thresholdScreenPx: 8, zoom: 0 })).toBe(0);
|
|
64
|
+
expect(alignmentThreshold({ thresholdScreenPx: 8, zoom: -1 })).toBe(0);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("defaults 8 on fine pointers and 12 on coarse", () => {
|
|
68
|
+
expect(defaultSnapThresholdPx.fine).toBe(8);
|
|
69
|
+
expect(defaultSnapThresholdPx.coarse).toBe(12);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
describe("snapToAlignment: S2, the threshold is a SCREEN distance", () => {
|
|
74
|
+
// Same physical pull at every zoom. A fixed flow-unit threshold would be
|
|
75
|
+
// 4 screen px at 0.5x, which is what "the snap feels dead when pinched out"
|
|
76
|
+
// actually is.
|
|
77
|
+
const table = [0.5, 1, 2] as const;
|
|
78
|
+
|
|
79
|
+
for (const zoom of table) {
|
|
80
|
+
it(`pulls from 8 screen px and not from 9 at zoom ${zoom}`, () => {
|
|
81
|
+
const threshold = alignmentThreshold({ thresholdScreenPx: 8, zoom });
|
|
82
|
+
const candidate = box("c", 400, 400);
|
|
83
|
+
|
|
84
|
+
const inRange = snap({
|
|
85
|
+
rect: { x: 400 + 8 / zoom, y: 0, width: 100, height: 50 },
|
|
86
|
+
candidates: [candidate],
|
|
87
|
+
threshold,
|
|
88
|
+
});
|
|
89
|
+
expect(inRange.acquired).toBe(true);
|
|
90
|
+
expect(inRange.position.x).toBe(400);
|
|
91
|
+
|
|
92
|
+
const outOfRange = snap({
|
|
93
|
+
rect: { x: 400 + 9 / zoom, y: 0, width: 100, height: 50 },
|
|
94
|
+
candidates: [candidate],
|
|
95
|
+
threshold,
|
|
96
|
+
});
|
|
97
|
+
expect(outOfRange.acquired).toBe(false);
|
|
98
|
+
expect(outOfRange.position.x).toBe(400 + 9 / zoom);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
describe("snapToAlignment: S4, nine line pairs per axis, nearest per axis", () => {
|
|
104
|
+
// One candidate 100x50 at the origin, so its x lines are 0 / 50 / 100 and its
|
|
105
|
+
// y lines are 0 / 25 / 50. The moving rect is 60x40, whose line offsets
|
|
106
|
+
// (0 / 30 / 60 and 0 / 20 / 40) share no difference with the candidate's, so
|
|
107
|
+
// exactly one pair can be inside the threshold at a time. That is what makes
|
|
108
|
+
// the table a table and not nine coincidences.
|
|
109
|
+
const candidate = box("c", 0, 0, 100, 50);
|
|
110
|
+
const movingWidth = 60;
|
|
111
|
+
const movingHeight = 40;
|
|
112
|
+
const xOffsets = { start: 0, center: movingWidth / 2, end: movingWidth } as const;
|
|
113
|
+
const yOffsets = { start: 0, center: movingHeight / 2, end: movingHeight } as const;
|
|
114
|
+
const candidateX = { start: 0, center: 50, end: 100 } as const;
|
|
115
|
+
const candidateY = { start: 0, center: 25, end: 50 } as const;
|
|
116
|
+
const lines = ["start", "center", "end"] as const;
|
|
117
|
+
|
|
118
|
+
for (const movingLine of lines) {
|
|
119
|
+
for (const candidateLine of lines) {
|
|
120
|
+
it(`x: moving ${movingLine} snaps to candidate ${candidateLine}`, () => {
|
|
121
|
+
const target = candidateX[candidateLine];
|
|
122
|
+
const x = target - 2 - xOffsets[movingLine];
|
|
123
|
+
const result = snap({
|
|
124
|
+
rect: { x, y: 400, width: movingWidth, height: movingHeight },
|
|
125
|
+
candidates: [candidate],
|
|
126
|
+
// Far enough on y that the candidate is still a candidate, and no y
|
|
127
|
+
// pair is anywhere near firing.
|
|
128
|
+
radius: 600,
|
|
129
|
+
});
|
|
130
|
+
expect(result.acquired).toBe(true);
|
|
131
|
+
expect(result.position.x).toBe(x + 2);
|
|
132
|
+
expect(result.position.y).toBe(400);
|
|
133
|
+
expect(result.guides).toHaveLength(1);
|
|
134
|
+
expect(result.guides[0]).toMatchObject({
|
|
135
|
+
axis: "x",
|
|
136
|
+
position: target,
|
|
137
|
+
nodeId: "c",
|
|
138
|
+
movingLine,
|
|
139
|
+
candidateLine,
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it(`y: moving ${movingLine} snaps to candidate ${candidateLine}`, () => {
|
|
144
|
+
const target = candidateY[candidateLine];
|
|
145
|
+
const y = target - 2 - yOffsets[movingLine];
|
|
146
|
+
const result = snap({
|
|
147
|
+
rect: { x: 400, y, width: movingWidth, height: movingHeight },
|
|
148
|
+
candidates: [candidate],
|
|
149
|
+
radius: 600,
|
|
150
|
+
});
|
|
151
|
+
expect(result.acquired).toBe(true);
|
|
152
|
+
expect(result.position.y).toBe(y + 2);
|
|
153
|
+
expect(result.position.x).toBe(400);
|
|
154
|
+
expect(result.guides).toHaveLength(1);
|
|
155
|
+
expect(result.guides[0]).toMatchObject({
|
|
156
|
+
axis: "y",
|
|
157
|
+
position: target,
|
|
158
|
+
nodeId: "c",
|
|
159
|
+
movingLine,
|
|
160
|
+
candidateLine,
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
it("takes x from one neighbour and y from another", () => {
|
|
167
|
+
const result = snap({
|
|
168
|
+
rect: { x: 302, y: 199, width: 100, height: 50 },
|
|
169
|
+
candidates: [box("left", 300, 0), box("above", 0, 200)],
|
|
170
|
+
});
|
|
171
|
+
expect(result.position).toEqual({ x: 300, y: 200 });
|
|
172
|
+
expect(result.guides).toHaveLength(2);
|
|
173
|
+
expect(result.guides.find((guide) => guide.axis === "x")?.nodeId).toBe("left");
|
|
174
|
+
expect(result.guides.find((guide) => guide.axis === "y")?.nodeId).toBe("above");
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it("takes the NEAREST line, not the first one inside the threshold", () => {
|
|
178
|
+
// 502 is 2 from `near`'s left edge and 4 from `far`'s.
|
|
179
|
+
const result = snap({
|
|
180
|
+
rect: { x: 502, y: 0, width: 100, height: 50 },
|
|
181
|
+
candidates: [box("far", 506, 0), box("near", 500, 0)],
|
|
182
|
+
});
|
|
183
|
+
expect(result.position.x).toBe(500);
|
|
184
|
+
expect(result.guides[0]?.nodeId).toBe("near");
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
it("spans the guide across both rects, so it points at what it aligned to", () => {
|
|
188
|
+
const result = snap({
|
|
189
|
+
rect: { x: 302, y: 400, width: 100, height: 50 },
|
|
190
|
+
candidates: [box("c", 300, 0)],
|
|
191
|
+
radius: 600,
|
|
192
|
+
});
|
|
193
|
+
const guide = result.guides[0];
|
|
194
|
+
expect(guide).toMatchObject({ axis: "x", position: 300 });
|
|
195
|
+
expect(guide.start).toBe(0);
|
|
196
|
+
expect(guide.end).toBe(450);
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
describe("snapToAlignment: S7, the dragged set is never its own candidate", () => {
|
|
201
|
+
it("ignores the node being dragged even when the index holds it", () => {
|
|
202
|
+
const dragged = box("a", 100, 100);
|
|
203
|
+
const result = snap({
|
|
204
|
+
rect: dragged.rect,
|
|
205
|
+
candidates: [],
|
|
206
|
+
dragged: [dragged],
|
|
207
|
+
});
|
|
208
|
+
expect(result.acquired).toBe(false);
|
|
209
|
+
expect(result.guides).toEqual([]);
|
|
210
|
+
expect(result.position).toEqual({ x: 100, y: 100 });
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it("ignores EVERY member of a multi-selection, not just the first", () => {
|
|
214
|
+
const a = box("a", 100, 100);
|
|
215
|
+
const b = box("b", 260, 100);
|
|
216
|
+
// The union of a and b. Both members' own edges sit on its lines, so a
|
|
217
|
+
// partial exclusion snaps to zero and looks like success.
|
|
218
|
+
const result = snap({
|
|
219
|
+
rect: { x: 100, y: 100, width: 260, height: 50 },
|
|
220
|
+
candidates: [],
|
|
221
|
+
dragged: [a, b],
|
|
222
|
+
});
|
|
223
|
+
expect(result.acquired).toBe(false);
|
|
224
|
+
expect(result.position).toEqual({ x: 100, y: 100 });
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
it("still snaps the selection to a node OUTSIDE it", () => {
|
|
228
|
+
const a = box("a", 102, 100);
|
|
229
|
+
const b = box("b", 262, 100);
|
|
230
|
+
const result = snap({
|
|
231
|
+
rect: { x: 102, y: 100, width: 260, height: 50 },
|
|
232
|
+
candidates: [box("anchor", 100, 300)],
|
|
233
|
+
dragged: [a, b],
|
|
234
|
+
});
|
|
235
|
+
expect(result.acquired).toBe(true);
|
|
236
|
+
expect(result.position.x).toBe(100);
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
describe("snapToAlignment: S8, the bound is exclusive above", () => {
|
|
241
|
+
const threshold = 5;
|
|
242
|
+
const table = [
|
|
243
|
+
{ gap: 0, fires: true },
|
|
244
|
+
{ gap: 4, fires: true },
|
|
245
|
+
{ gap: threshold, fires: true },
|
|
246
|
+
{ gap: threshold + 1, fires: false },
|
|
247
|
+
{ gap: 40, fires: false },
|
|
248
|
+
];
|
|
249
|
+
|
|
250
|
+
// The candidate sits 300 below, so only the x axis is ever in play. Level
|
|
251
|
+
// with it, every y pair would be an exact hit and `acquired` would be true
|
|
252
|
+
// for a reason the table is not about.
|
|
253
|
+
const candidate = box("c", 300, 300);
|
|
254
|
+
|
|
255
|
+
for (const { gap, fires } of table) {
|
|
256
|
+
it(`${gap} flow units from the line ${fires ? "snaps" : "does not snap"}`, () => {
|
|
257
|
+
const result = snap({
|
|
258
|
+
rect: { x: 300 + gap, y: 0, width: 100, height: 50 },
|
|
259
|
+
candidates: [candidate],
|
|
260
|
+
threshold,
|
|
261
|
+
});
|
|
262
|
+
expect(result.acquired).toBe(fires);
|
|
263
|
+
expect(result.position.x).toBe(fires ? 300 : 300 + gap);
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
it("is symmetric: the same distance on the other side behaves the same", () => {
|
|
268
|
+
expect(
|
|
269
|
+
snap({
|
|
270
|
+
rect: { x: 300 - threshold, y: 0, width: 100, height: 50 },
|
|
271
|
+
candidates: [candidate],
|
|
272
|
+
threshold,
|
|
273
|
+
}).acquired,
|
|
274
|
+
).toBe(true);
|
|
275
|
+
expect(
|
|
276
|
+
snap({
|
|
277
|
+
rect: { x: 300 - threshold - 1, y: 0, width: 100, height: 50 },
|
|
278
|
+
candidates: [candidate],
|
|
279
|
+
threshold,
|
|
280
|
+
}).acquired,
|
|
281
|
+
).toBe(false);
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
describe("snapToAlignment: S9, an exact tie resolves to the lower node id", () => {
|
|
286
|
+
it("prefers the lower id when two candidates pull the same distance", () => {
|
|
287
|
+
const result = snap({
|
|
288
|
+
rect: { x: 500, y: 0, width: 100, height: 50 },
|
|
289
|
+
candidates: [box("zulu", 504, 300), box("alpha", 496, 300)],
|
|
290
|
+
});
|
|
291
|
+
expect(result.position.x).toBe(496);
|
|
292
|
+
expect(result.guides[0]?.nodeId).toBe("alpha");
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
it("prefers the lower id on the same side too", () => {
|
|
296
|
+
const result = snap({
|
|
297
|
+
rect: { x: 500, y: 0, width: 100, height: 50 },
|
|
298
|
+
candidates: [box("zulu", 504, 300), box("alpha", 504, 200)],
|
|
299
|
+
});
|
|
300
|
+
expect(result.guides[0]?.nodeId).toBe("alpha");
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
it("compares ids as strings, so n10 sorts under n2 and the order is stable", () => {
|
|
304
|
+
// Documented, not incidental: ids are opaque strings (design §4.1), and a
|
|
305
|
+
// numeric-looking one is not a number. Both orderings are deterministic;
|
|
306
|
+
// this pins WHICH.
|
|
307
|
+
const first = snap({
|
|
308
|
+
rect: { x: 500, y: 0, width: 100, height: 50 },
|
|
309
|
+
candidates: [box("n2", 504, 300), box("n10", 496, 300)],
|
|
310
|
+
});
|
|
311
|
+
const flipped = snap({
|
|
312
|
+
rect: { x: 500, y: 0, width: 100, height: 50 },
|
|
313
|
+
candidates: [box("n10", 496, 300), box("n2", 504, 300)],
|
|
314
|
+
});
|
|
315
|
+
expect(first.guides[0]?.nodeId).toBe("n10");
|
|
316
|
+
expect(flipped.guides[0]?.nodeId).toBe("n10");
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
describe("snapToAlignment: the rest of the contract", () => {
|
|
321
|
+
it("returns the rect untouched when nothing is near", () => {
|
|
322
|
+
const result = snap({
|
|
323
|
+
rect: { x: 1000, y: 1000, width: 100, height: 50 },
|
|
324
|
+
candidates: [box("c", 0, 0)],
|
|
325
|
+
});
|
|
326
|
+
expect(result).toEqual({
|
|
327
|
+
position: { x: 1000, y: 1000 },
|
|
328
|
+
guides: [],
|
|
329
|
+
acquired: false,
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
it("does not reach past the candidate radius, however aligned the node is", () => {
|
|
334
|
+
const aligned = { x: 300, y: 0, width: 100, height: 50 };
|
|
335
|
+
const near = snap({
|
|
336
|
+
rect: aligned,
|
|
337
|
+
candidates: [box("c", 302, 300)],
|
|
338
|
+
radius: 400,
|
|
339
|
+
});
|
|
340
|
+
const far = snap({
|
|
341
|
+
rect: aligned,
|
|
342
|
+
candidates: [box("c", 302, 5000)],
|
|
343
|
+
radius: 400,
|
|
344
|
+
});
|
|
345
|
+
expect(near.acquired).toBe(true);
|
|
346
|
+
expect(far.acquired).toBe(false);
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
it("reads the LIVE rect from the node map, not the one the index snapshotted", () => {
|
|
350
|
+
// The index is built at drag start (S3). If a node moved since, the map is
|
|
351
|
+
// the authority for the arithmetic; the index is only the broad phase.
|
|
352
|
+
const stale = box("c", 300, 0);
|
|
353
|
+
const live = box("c", 302, 0);
|
|
354
|
+
const result = snapToAlignment({
|
|
355
|
+
ids: [],
|
|
356
|
+
rect: { x: 304, y: 0, width: 100, height: 50 },
|
|
357
|
+
nodes: nodesOf(live),
|
|
358
|
+
index: buildSpatialHash([stale]),
|
|
359
|
+
thresholdFlowUnits: 5,
|
|
360
|
+
radius: defaultCandidateRadius,
|
|
361
|
+
});
|
|
362
|
+
expect(result.position.x).toBe(302);
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
it("skips a candidate that left the map mid-drag", () => {
|
|
366
|
+
const result = snapToAlignment({
|
|
367
|
+
ids: [],
|
|
368
|
+
rect: { x: 302, y: 0, width: 100, height: 50 },
|
|
369
|
+
nodes: new Map(),
|
|
370
|
+
index: buildSpatialHash([box("gone", 300, 0)]),
|
|
371
|
+
thresholdFlowUnits: 5,
|
|
372
|
+
radius: defaultCandidateRadius,
|
|
373
|
+
});
|
|
374
|
+
expect(result.acquired).toBe(false);
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
it("emits at most one guide per axis, so the layer stays two lines", () => {
|
|
378
|
+
const result = snap({
|
|
379
|
+
rect: { x: 302, y: 202, width: 100, height: 50 },
|
|
380
|
+
candidates: [box("a", 300, 200), box("b", 300, 200), box("c", 300, 200)],
|
|
381
|
+
});
|
|
382
|
+
expect(result.guides).toHaveLength(2);
|
|
383
|
+
expect(new Set(result.guides.map((guide) => guide.axis))).toEqual(new Set(["x", "y"]));
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
it("costs under 1 ms per call at 200 candidates", () => {
|
|
387
|
+
const candidates = Array.from({ length: 200 }, (_, index) =>
|
|
388
|
+
box(`n${index}`, (index % 20) * 180, Math.floor(index / 20) * 120),
|
|
389
|
+
);
|
|
390
|
+
const nodes = nodesOf(...candidates);
|
|
391
|
+
const index = buildSpatialHash(candidates);
|
|
392
|
+
const input: SnapToAlignmentInput = {
|
|
393
|
+
ids: [],
|
|
394
|
+
rect: { x: 902, y: 481, width: 100, height: 50 },
|
|
395
|
+
nodes,
|
|
396
|
+
index,
|
|
397
|
+
thresholdFlowUnits: 5,
|
|
398
|
+
radius: defaultCandidateRadius,
|
|
399
|
+
};
|
|
400
|
+
// Warm the shapes, then take the median of 21 so a GC pause cannot turn a
|
|
401
|
+
// real budget into a flaky test.
|
|
402
|
+
for (let run = 0; run < 50; run += 1) snapToAlignment(input);
|
|
403
|
+
const samples: number[] = [];
|
|
404
|
+
for (let run = 0; run < 21; run += 1) {
|
|
405
|
+
const started = performance.now();
|
|
406
|
+
snapToAlignment(input);
|
|
407
|
+
samples.push(performance.now() - started);
|
|
408
|
+
}
|
|
409
|
+
samples.sort((a, b) => a - b);
|
|
410
|
+
expect(samples[10]).toBeLessThan(1);
|
|
411
|
+
});
|
|
412
|
+
});
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alignment snapping, design §7.2. Pure: no DOM, no React, no `@xyflow`, so it
|
|
3
|
+
* runs in vitest under Node and could run in a worklet or a worker later.
|
|
4
|
+
*
|
|
5
|
+
* This is a PORT of the native-first spike's snapper, not a fresh design. Two
|
|
6
|
+
* things changed on the way in, and both are the whole reason the port was
|
|
7
|
+
* worth doing rather than copying:
|
|
8
|
+
*
|
|
9
|
+
* - the spike snapped ONE node by its index in a flat position array. This
|
|
10
|
+
* takes the dragged selection's **union rect** and its **id set**, so a
|
|
11
|
+
* multi-select drag snaps the box and one delta moves every member (S6);
|
|
12
|
+
* - the spike compared origins only. This compares the nine line pairs
|
|
13
|
+
* (S4), so a node aligns to a neighbour's centre or far edge, which is what
|
|
14
|
+
* makes the guides mean anything.
|
|
15
|
+
*
|
|
16
|
+
* The threshold arrives in FLOW units and is a screen distance divided by the
|
|
17
|
+
* zoom (S2). `alignmentThreshold` does that division; the caller owns the zoom.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import type { NodeId, Rect, XY } from "../model/document";
|
|
21
|
+
import type { SpatialHash } from "./spatialHash";
|
|
22
|
+
|
|
23
|
+
/** Design §7.2: 8 on a mouse, 12 under a finger, both in SCREEN px. */
|
|
24
|
+
export const defaultSnapThresholdPx = { fine: 8, coarse: 12 } as const;
|
|
25
|
+
|
|
26
|
+
/** Design §7.2 S3. How far from the dragged box a neighbour may be and count. */
|
|
27
|
+
export const defaultCandidateRadius = 400;
|
|
28
|
+
|
|
29
|
+
export interface PositionedNode {
|
|
30
|
+
readonly id: NodeId;
|
|
31
|
+
readonly rect: Rect;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type SnapAxis = "x" | "y";
|
|
35
|
+
|
|
36
|
+
/** The three lines a rect offers per axis: `{left, centerX, right}` in §7.2's words. */
|
|
37
|
+
export type SnapLine = "start" | "center" | "end";
|
|
38
|
+
|
|
39
|
+
export interface SnapGuide {
|
|
40
|
+
readonly axis: SnapAxis;
|
|
41
|
+
/** The flow coordinate of the line: an x for a vertical guide, a y for a horizontal one. */
|
|
42
|
+
readonly position: number;
|
|
43
|
+
/** Where the line starts on the OTHER axis. Spans the moved rect and the neighbour. */
|
|
44
|
+
readonly start: number;
|
|
45
|
+
readonly end: number;
|
|
46
|
+
/** The neighbour it aligned to, so a story can name it and a test can assert it. */
|
|
47
|
+
readonly nodeId: NodeId;
|
|
48
|
+
readonly movingLine: SnapLine;
|
|
49
|
+
readonly candidateLine: SnapLine;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface SnapResult {
|
|
53
|
+
/** The snapped top-left of the dragged selection's union rect. */
|
|
54
|
+
readonly position: XY;
|
|
55
|
+
/** At most two: one per axis. Design §7.2 S10. */
|
|
56
|
+
readonly guides: readonly SnapGuide[];
|
|
57
|
+
/** True the frame a guide appears — what haptics fire on, once. */
|
|
58
|
+
readonly acquired: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface SnapToAlignmentInput {
|
|
62
|
+
/** The WHOLE dragged selection. Every member is excluded from candidates (S7). */
|
|
63
|
+
readonly ids: readonly NodeId[];
|
|
64
|
+
/** Union bounds of that selection, unsnapped. */
|
|
65
|
+
readonly rect: Rect;
|
|
66
|
+
/**
|
|
67
|
+
* Live geometry. The index is the drag-start snapshot and only picks WHICH
|
|
68
|
+
* neighbours to consider; this map is what the arithmetic reads, so a node
|
|
69
|
+
* that moved under a programmatic change is aligned to where it is now.
|
|
70
|
+
*/
|
|
71
|
+
readonly nodes: ReadonlyMap<NodeId, PositionedNode>;
|
|
72
|
+
/** Built once at drag start, from every node (S3). */
|
|
73
|
+
readonly index: SpatialHash;
|
|
74
|
+
readonly thresholdFlowUnits: number;
|
|
75
|
+
readonly radius: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Screen px → flow units. A fixed flow-unit threshold is 4 screen px at 0.5×,
|
|
80
|
+
* which is the "snapping feels dead when I pinch out" bug, so this division is
|
|
81
|
+
* not a detail (S2).
|
|
82
|
+
*
|
|
83
|
+
* A zoom of zero or less returns 0 rather than Infinity: React Flow clamps zoom
|
|
84
|
+
* well above zero, but a threshold of Infinity would snap the node to the first
|
|
85
|
+
* neighbour in the index and there would be no way to see why.
|
|
86
|
+
*/
|
|
87
|
+
export function alignmentThreshold(options: {
|
|
88
|
+
readonly thresholdScreenPx: number;
|
|
89
|
+
readonly zoom: number;
|
|
90
|
+
}): number {
|
|
91
|
+
const { thresholdScreenPx, zoom } = options;
|
|
92
|
+
if (!Number.isFinite(zoom) || zoom <= 0) return 0;
|
|
93
|
+
return thresholdScreenPx / zoom;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const lineOrder: readonly SnapLine[] = ["start", "center", "end"];
|
|
97
|
+
|
|
98
|
+
type AxisLines = Record<SnapLine, number>;
|
|
99
|
+
|
|
100
|
+
function axisLines(rect: Rect, axis: SnapAxis): AxisLines {
|
|
101
|
+
const origin = axis === "x" ? rect.x : rect.y;
|
|
102
|
+
const extent = axis === "x" ? rect.width : rect.height;
|
|
103
|
+
return { start: origin, center: origin + extent / 2, end: origin + extent };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface AxisMatch {
|
|
107
|
+
readonly delta: number;
|
|
108
|
+
readonly distance: number;
|
|
109
|
+
readonly line: number;
|
|
110
|
+
readonly node: PositionedNode;
|
|
111
|
+
readonly movingLine: SnapLine;
|
|
112
|
+
readonly candidateLine: SnapLine;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Nearest wins, per axis, independently (S4). An exact tie goes to the lower
|
|
117
|
+
* node id (S9) — compared as a STRING, because ids are opaque strings (design
|
|
118
|
+
* §4.1) and `n10` therefore sorts under `n2`. Deterministic is the property
|
|
119
|
+
* that matters; which of the two orderings it is, is pinned by the spec.
|
|
120
|
+
*/
|
|
121
|
+
function bestMatch(
|
|
122
|
+
rect: Rect,
|
|
123
|
+
axis: SnapAxis,
|
|
124
|
+
candidates: readonly PositionedNode[],
|
|
125
|
+
threshold: number,
|
|
126
|
+
): AxisMatch | null {
|
|
127
|
+
const moving = axisLines(rect, axis);
|
|
128
|
+
let best: AxisMatch | null = null;
|
|
129
|
+
for (const node of candidates) {
|
|
130
|
+
const lines = axisLines(node.rect, axis);
|
|
131
|
+
for (const movingLine of lineOrder) {
|
|
132
|
+
for (const candidateLine of lineOrder) {
|
|
133
|
+
const line = lines[candidateLine];
|
|
134
|
+
const delta = line - moving[movingLine];
|
|
135
|
+
const distance = Math.abs(delta);
|
|
136
|
+
if (distance > threshold) continue;
|
|
137
|
+
if (best === null || distance < best.distance) {
|
|
138
|
+
best = { delta, distance, line, node, movingLine, candidateLine };
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (distance === best.distance && node.id < best.node.id) {
|
|
142
|
+
best = { delta, distance, line, node, movingLine, candidateLine };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return best;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function inflate(rect: Rect, radius: number): Rect {
|
|
151
|
+
return {
|
|
152
|
+
x: rect.x - radius,
|
|
153
|
+
y: rect.y - radius,
|
|
154
|
+
width: rect.width + radius * 2,
|
|
155
|
+
height: rect.height + radius * 2,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The guide spans both rects on the other axis, so it visibly connects the two
|
|
161
|
+
* things it claims are aligned instead of floating beside one of them.
|
|
162
|
+
*/
|
|
163
|
+
function guideFor(match: AxisMatch, axis: SnapAxis, moved: Rect): SnapGuide {
|
|
164
|
+
const movedStart = axis === "x" ? moved.y : moved.x;
|
|
165
|
+
const movedEnd = movedStart + (axis === "x" ? moved.height : moved.width);
|
|
166
|
+
const otherStart = axis === "x" ? match.node.rect.y : match.node.rect.x;
|
|
167
|
+
const otherEnd = otherStart + (axis === "x" ? match.node.rect.height : match.node.rect.width);
|
|
168
|
+
return {
|
|
169
|
+
axis,
|
|
170
|
+
position: match.line,
|
|
171
|
+
start: Math.min(movedStart, otherStart),
|
|
172
|
+
end: Math.max(movedEnd, otherEnd),
|
|
173
|
+
nodeId: match.node.id,
|
|
174
|
+
movingLine: match.movingLine,
|
|
175
|
+
candidateLine: match.candidateLine,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function snapToAlignment(input: SnapToAlignmentInput): SnapResult {
|
|
180
|
+
const { ids, rect, nodes, index, thresholdFlowUnits, radius } = input;
|
|
181
|
+
|
|
182
|
+
const excluded = new Set<NodeId>(ids);
|
|
183
|
+
const candidates: PositionedNode[] = [];
|
|
184
|
+
for (const hit of index.query(inflate(rect, radius))) {
|
|
185
|
+
if (excluded.has(hit.id)) continue;
|
|
186
|
+
// Not in the map means removed since drag start. Aligning to a node that
|
|
187
|
+
// no longer exists is worse than not aligning.
|
|
188
|
+
const live = nodes.get(hit.id);
|
|
189
|
+
if (!live) continue;
|
|
190
|
+
candidates.push(live);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (candidates.length === 0) {
|
|
194
|
+
return { position: { x: rect.x, y: rect.y }, guides: [], acquired: false };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const x = bestMatch(rect, "x", candidates, thresholdFlowUnits);
|
|
198
|
+
const y = bestMatch(rect, "y", candidates, thresholdFlowUnits);
|
|
199
|
+
const position = { x: rect.x + (x?.delta ?? 0), y: rect.y + (y?.delta ?? 0) };
|
|
200
|
+
if (!x && !y) return { position, guides: [], acquired: false };
|
|
201
|
+
|
|
202
|
+
const moved: Rect = { ...rect, x: position.x, y: position.y };
|
|
203
|
+
const guides: SnapGuide[] = [];
|
|
204
|
+
// x first, so the order a consumer renders and a spec reads is the axis
|
|
205
|
+
// order and not whichever matched.
|
|
206
|
+
if (x) guides.push(guideFor(x, "x", moved));
|
|
207
|
+
if (y) guides.push(guideFor(y, "y", moved));
|
|
208
|
+
return { position, guides, acquired: true };
|
|
209
|
+
}
|