vizcraft 1.15.0 → 1.16.0
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/CHANGELOG.md +44 -0
- package/README.md +34 -0
- package/dist/animation.d.mts +1 -1
- package/dist/animation.d.ts +1 -1
- package/dist/{hitTest-Gr_c7MkQ.d.ts → hitTest-5nKDL0YT.d.ts} +1 -1
- package/dist/{hitTest-DiZvu6f9.d.mts → hitTest-DtkjchpB.d.mts} +1 -1
- package/dist/{index-Ck9uAbwD.d.mts → index-n9JLZMa1.d.mts} +2 -0
- package/dist/{index-Ck9uAbwD.d.ts → index-n9JLZMa1.d.ts} +2 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/dist/interaction.d.mts +2 -2
- package/dist/interaction.d.ts +2 -2
- package/dist/layout.d.mts +1 -1
- package/dist/layout.d.ts +1 -1
- package/dist/ports.d.mts +1 -1
- package/dist/ports.d.ts +1 -1
- package/dist/serialization.d.mts +1 -1
- package/dist/serialization.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# vizcraft
|
|
2
2
|
|
|
3
|
+
## 1.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#142](https://github.com/ChipiKaf/vizcraft/pull/142) [`63cd51a`](https://github.com/ChipiKaf/vizcraft/commit/63cd51a67991c48bc93512d2d4ef22d82c167595) Thanks [@ChipiKaf](https://github.com/ChipiKaf)! - Add `initialPan` mount option and `getState()` method to `PanZoomController` for persisting viewport state across scene rebuilds.
|
|
8
|
+
|
|
9
|
+
**New API:**
|
|
10
|
+
- `initialPan: Vec2` — set starting pan offset when `initialZoom` is a number
|
|
11
|
+
- `controller.getState()` — returns a `{ zoom, pan }` snapshot of the current viewport
|
|
12
|
+
|
|
13
|
+
This enables seamless viewport persistence by capturing `getState()` before destroy and passing the values as `initialZoom` / `initialPan` when remounting.
|
|
14
|
+
|
|
15
|
+
- [`24e7158`](https://github.com/ChipiKaf/vizcraft/commit/24e715809152bf7a405fe70be444d239c26610ce) Thanks [@ChipiKaf](https://github.com/ChipiKaf)! - Add `color` and `glowColor` options to `SignalOverlayParams` for per-signal ball color overrides.
|
|
16
|
+
|
|
17
|
+
**New fields in `SignalOverlayBaseParams`:**
|
|
18
|
+
- `color?: string` — CSS color applied as an inline fill on the signal ball, overriding the CSS class default (`#3b82f6`). Works on both single-hop and chain signals.
|
|
19
|
+
- `glowColor?: string` — CSS color applied as a `drop-shadow` filter on the signal shape for a halo effect. Defaults to `color` when omitted.
|
|
20
|
+
|
|
21
|
+
When neither field is set, rendering is identical to before (full back-compat).
|
|
22
|
+
|
|
23
|
+
**Example:**
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
// Green ball — majority committed
|
|
27
|
+
overlays.add('signal', {
|
|
28
|
+
from: 'primary',
|
|
29
|
+
to: 'reader',
|
|
30
|
+
edgeId: 'primary-reader',
|
|
31
|
+
progress: 0.6,
|
|
32
|
+
magnitude: 0.85,
|
|
33
|
+
color: '#22c55e',
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Amber ball — stale snapshot
|
|
37
|
+
overlays.add('signal', {
|
|
38
|
+
from: 'primary',
|
|
39
|
+
to: 'reader',
|
|
40
|
+
edgeId: 'primary-reader',
|
|
41
|
+
progress: 0.6,
|
|
42
|
+
magnitude: 0.85,
|
|
43
|
+
color: '#f59e0b',
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
3
47
|
## 1.15.0
|
|
4
48
|
|
|
5
49
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -793,6 +793,40 @@ builder.overlay(
|
|
|
793
793
|
);
|
|
794
794
|
```
|
|
795
795
|
|
|
796
|
+
## Per-signal color override
|
|
797
|
+
|
|
798
|
+
Set `color` to override the default blue fill on individual signals. An optional `glowColor` adds a drop-shadow halo (defaults to `color`).
|
|
799
|
+
|
|
800
|
+
```ts
|
|
801
|
+
// Green ball — majority committed
|
|
802
|
+
builder.overlay(
|
|
803
|
+
'signal',
|
|
804
|
+
{
|
|
805
|
+
from: 'primary',
|
|
806
|
+
to: 'reader',
|
|
807
|
+
edgeId: 'primary-reader',
|
|
808
|
+
progress: 0.6,
|
|
809
|
+
magnitude: 0.85,
|
|
810
|
+
color: '#22c55e',
|
|
811
|
+
},
|
|
812
|
+
'committed'
|
|
813
|
+
);
|
|
814
|
+
|
|
815
|
+
// Amber ball — stale snapshot
|
|
816
|
+
builder.overlay(
|
|
817
|
+
'signal',
|
|
818
|
+
{
|
|
819
|
+
from: 'primary',
|
|
820
|
+
to: 'reader',
|
|
821
|
+
edgeId: 'primary-reader',
|
|
822
|
+
progress: 0.6,
|
|
823
|
+
magnitude: 0.85,
|
|
824
|
+
color: '#f59e0b',
|
|
825
|
+
},
|
|
826
|
+
'stale'
|
|
827
|
+
);
|
|
828
|
+
```
|
|
829
|
+
|
|
796
830
|
## 🤝 Contributing
|
|
797
831
|
|
|
798
832
|
Contributions are welcome! This is a monorepo managed with Turbo.
|
package/dist/animation.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { az as AnimProperty, aF as AnimatableProps, aG as AnimationBuilder, aQ as AnimationHostAdapter, aC as AnimationSpec, ax as AnimationTarget, ay as CoreAnimProperty, aE as CoreAnimatableProps, aA as Ease, aI as ExtendAdapter, aJ as PlaybackController, aP as PropHandlers, aN as PropReader, aO as PropWriter, aR as RegistrableAdapter, aD as TweenOptions, aB as TweenSpec, aH as buildAnimationSpec, aL as createBuilderPlayback, aK as createScenePlayback, aM as playAnimationSpec } from './index-
|
|
1
|
+
export { az as AnimProperty, aF as AnimatableProps, aG as AnimationBuilder, aQ as AnimationHostAdapter, aC as AnimationSpec, ax as AnimationTarget, ay as CoreAnimProperty, aE as CoreAnimatableProps, aA as Ease, aI as ExtendAdapter, aJ as PlaybackController, aP as PropHandlers, aN as PropReader, aO as PropWriter, aR as RegistrableAdapter, aD as TweenOptions, aB as TweenSpec, aH as buildAnimationSpec, aL as createBuilderPlayback, aK as createScenePlayback, aM as playAnimationSpec } from './index-n9JLZMa1.mjs';
|
package/dist/animation.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { az as AnimProperty, aF as AnimatableProps, aG as AnimationBuilder, aQ as AnimationHostAdapter, aC as AnimationSpec, ax as AnimationTarget, ay as CoreAnimProperty, aE as CoreAnimatableProps, aA as Ease, aI as ExtendAdapter, aJ as PlaybackController, aP as PropHandlers, aN as PropReader, aO as PropWriter, aR as RegistrableAdapter, aD as TweenOptions, aB as TweenSpec, aH as buildAnimationSpec, aL as createBuilderPlayback, aK as createScenePlayback, aM as playAnimationSpec } from './index-
|
|
1
|
+
export { az as AnimProperty, aF as AnimatableProps, aG as AnimationBuilder, aQ as AnimationHostAdapter, aC as AnimationSpec, ax as AnimationTarget, ay as CoreAnimProperty, aE as CoreAnimatableProps, aA as Ease, aI as ExtendAdapter, aJ as PlaybackController, aP as PropHandlers, aN as PropReader, aO as PropWriter, aR as RegistrableAdapter, aD as TweenOptions, aB as TweenSpec, aH as buildAnimationSpec, aL as createBuilderPlayback, aK as createScenePlayback, aM as playAnimationSpec } from './index-n9JLZMa1.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as VizScene, P as PanZoomOptions, c as PanZoomController, d as Vec2, V as VizNode } from './index-
|
|
1
|
+
import { b as VizScene, P as PanZoomOptions, c as PanZoomController, d as Vec2, V as VizNode } from './index-n9JLZMa1.js';
|
|
2
2
|
|
|
3
3
|
declare function setupPanZoom(svg: SVGSVGElement, viewport: SVGGElement, scene: VizScene, options?: PanZoomOptions): PanZoomController;
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as VizScene, P as PanZoomOptions, c as PanZoomController, d as Vec2, V as VizNode } from './index-
|
|
1
|
+
import { b as VizScene, P as PanZoomOptions, c as PanZoomController, d as Vec2, V as VizNode } from './index-n9JLZMa1.mjs';
|
|
2
2
|
|
|
3
3
|
declare function setupPanZoom(svg: SVGSVGElement, viewport: SVGGElement, scene: VizScene, options?: PanZoomOptions): PanZoomController;
|
|
4
4
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { e as VizAnimSpec, V as VizNode, a as VizEdge, d as Vec2, E as EdgeRouting, f as EdgeLabel, b as VizScene, N as NodeShape, g as NodePort } from './index-
|
|
2
|
-
export { az as AnimProperty, aF as AnimatableProps, aG as AnimationBuilder, p as AnimationConfig, A as AnimationDuration, aQ as AnimationHostAdapter, aC as AnimationSpec, ax as AnimationTarget, B as BadgePosition, ag as CircleOverlayParams, t as CollapseAnchor, u as CollapseIndicatorOptions, a5 as CompartmentBuilder, v as CompartmentClickContext, w as CompartmentEntry, C as ContainerConfig, ay as CoreAnimProperty, aE as CoreAnimatableProps, al as CoreOverlayRegistry, aj as CoreOverlayRenderContext, ak as CoreOverlayRenderer, ad as DataPoint, ae as DataPointsOverlayParams, aA as Ease, a7 as EdgeBuilder, F as EdgeMarkerType, H as EdgeOptions, I as EdgePathResolver, y as EntryOptions, x as EntryStyle, aI as ExtendAdapter, ac as GridLabelsOverlayParams, ai as GroupOverlayParams, K as KnownOverlayId, a2 as LayoutAlgorithm, $ as LayoutGraph, a0 as LayoutResult, a6 as NodeBuilder, o as NodeLabel, j as NodeMediaPosition, G as NodeOptions, J as OVERLAY_RUNTIME_DIRTY, au as OverlayAddOptions, av as OverlayBuilder, L as OverlayId, O as OverlayKindRegistry, M as OverlayParams, c as PanZoomController, P as PanZoomOptions, aJ as PlaybackController, aP as PropHandlers, aN as PropReader, aO as PropWriter, af as RectOverlayParams, aR as RegistrableAdapter, a4 as RichLabelBuilder, a8 as RichLabelBuilderImpl, n as RichText, R as RichTextToken, z as SceneChanges, aa as SignalOverlayHop, ab as SignalOverlayParams, S as SvgExportOptions, a1 as SyncLayoutAlgorithm, ah as TextOverlayParams, h as TooltipContent, T as TooltipSection, aD as TweenOptions, aB as TweenSpec, Q as TypedVizOverlaySpec, Y as VizBuildEvent, a3 as VizBuilder, _ as VizEventMap, W as VizGridConfig, Z as VizMountEvent, i as VizNodeBadge, s as VizNodeCompartment, l as VizNodeIcon, k as VizNodeImage, m as VizNodeSvgContent, U as VizOverlaySpec, X as VizPlugin, r as VizRuntimeEdgeProps, q as VizRuntimeNodeProps, D as VizSceneMutator, aH as buildAnimationSpec, aw as buildOverlaySpecs, aq as coreCircleOverlay, ao as coreDataPointOverlay, an as coreGridLabelsOverlay, as as coreGroupOverlay, ap as coreRectOverlay, am as coreSignalOverlay, ar as coreTextOverlay, aL as createBuilderPlayback, aK as createScenePlayback, at as defaultCoreOverlayRegistry, aM as playAnimationSpec, a9 as viz } from './index-
|
|
3
|
-
export { H as HitResult, a as HitTestOptions, d as distanceSquare, e as edgeDistance, g as getEffectiveNodeBounds, h as hitTest, b as hitTestRect, n as nearestPort, p as pointInRect, s as setupPanZoom } from './hitTest-
|
|
1
|
+
import { e as VizAnimSpec, V as VizNode, a as VizEdge, d as Vec2, E as EdgeRouting, f as EdgeLabel, b as VizScene, N as NodeShape, g as NodePort } from './index-n9JLZMa1.mjs';
|
|
2
|
+
export { az as AnimProperty, aF as AnimatableProps, aG as AnimationBuilder, p as AnimationConfig, A as AnimationDuration, aQ as AnimationHostAdapter, aC as AnimationSpec, ax as AnimationTarget, B as BadgePosition, ag as CircleOverlayParams, t as CollapseAnchor, u as CollapseIndicatorOptions, a5 as CompartmentBuilder, v as CompartmentClickContext, w as CompartmentEntry, C as ContainerConfig, ay as CoreAnimProperty, aE as CoreAnimatableProps, al as CoreOverlayRegistry, aj as CoreOverlayRenderContext, ak as CoreOverlayRenderer, ad as DataPoint, ae as DataPointsOverlayParams, aA as Ease, a7 as EdgeBuilder, F as EdgeMarkerType, H as EdgeOptions, I as EdgePathResolver, y as EntryOptions, x as EntryStyle, aI as ExtendAdapter, ac as GridLabelsOverlayParams, ai as GroupOverlayParams, K as KnownOverlayId, a2 as LayoutAlgorithm, $ as LayoutGraph, a0 as LayoutResult, a6 as NodeBuilder, o as NodeLabel, j as NodeMediaPosition, G as NodeOptions, J as OVERLAY_RUNTIME_DIRTY, au as OverlayAddOptions, av as OverlayBuilder, L as OverlayId, O as OverlayKindRegistry, M as OverlayParams, c as PanZoomController, P as PanZoomOptions, aJ as PlaybackController, aP as PropHandlers, aN as PropReader, aO as PropWriter, af as RectOverlayParams, aR as RegistrableAdapter, a4 as RichLabelBuilder, a8 as RichLabelBuilderImpl, n as RichText, R as RichTextToken, z as SceneChanges, aa as SignalOverlayHop, ab as SignalOverlayParams, S as SvgExportOptions, a1 as SyncLayoutAlgorithm, ah as TextOverlayParams, h as TooltipContent, T as TooltipSection, aD as TweenOptions, aB as TweenSpec, Q as TypedVizOverlaySpec, Y as VizBuildEvent, a3 as VizBuilder, _ as VizEventMap, W as VizGridConfig, Z as VizMountEvent, i as VizNodeBadge, s as VizNodeCompartment, l as VizNodeIcon, k as VizNodeImage, m as VizNodeSvgContent, U as VizOverlaySpec, X as VizPlugin, r as VizRuntimeEdgeProps, q as VizRuntimeNodeProps, D as VizSceneMutator, aH as buildAnimationSpec, aw as buildOverlaySpecs, aq as coreCircleOverlay, ao as coreDataPointOverlay, an as coreGridLabelsOverlay, as as coreGroupOverlay, ap as coreRectOverlay, am as coreSignalOverlay, ar as coreTextOverlay, aL as createBuilderPlayback, aK as createScenePlayback, at as defaultCoreOverlayRegistry, aM as playAnimationSpec, a9 as viz } from './index-n9JLZMa1.mjs';
|
|
3
|
+
export { H as HitResult, a as HitTestOptions, d as distanceSquare, e as edgeDistance, g as getEffectiveNodeBounds, h as hitTest, b as hitTestRect, n as nearestPort, p as pointInRect, s as setupPanZoom } from './hitTest-DtkjchpB.mjs';
|
|
4
4
|
export { SerializedScene, deserializeScene, serializeScene } from './serialization.mjs';
|
|
5
5
|
export { CircularLayoutOptions, GridLayoutOptions, circularLayout, gridLayout } from './layout.mjs';
|
|
6
6
|
export { EquidistantPort, PerimeterStrategy, findPortNearest, getEquidistantPorts, registerPerimeterStrategy, toNodePorts } from './ports.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { e as VizAnimSpec, V as VizNode, a as VizEdge, d as Vec2, E as EdgeRouting, f as EdgeLabel, b as VizScene, N as NodeShape, g as NodePort } from './index-
|
|
2
|
-
export { az as AnimProperty, aF as AnimatableProps, aG as AnimationBuilder, p as AnimationConfig, A as AnimationDuration, aQ as AnimationHostAdapter, aC as AnimationSpec, ax as AnimationTarget, B as BadgePosition, ag as CircleOverlayParams, t as CollapseAnchor, u as CollapseIndicatorOptions, a5 as CompartmentBuilder, v as CompartmentClickContext, w as CompartmentEntry, C as ContainerConfig, ay as CoreAnimProperty, aE as CoreAnimatableProps, al as CoreOverlayRegistry, aj as CoreOverlayRenderContext, ak as CoreOverlayRenderer, ad as DataPoint, ae as DataPointsOverlayParams, aA as Ease, a7 as EdgeBuilder, F as EdgeMarkerType, H as EdgeOptions, I as EdgePathResolver, y as EntryOptions, x as EntryStyle, aI as ExtendAdapter, ac as GridLabelsOverlayParams, ai as GroupOverlayParams, K as KnownOverlayId, a2 as LayoutAlgorithm, $ as LayoutGraph, a0 as LayoutResult, a6 as NodeBuilder, o as NodeLabel, j as NodeMediaPosition, G as NodeOptions, J as OVERLAY_RUNTIME_DIRTY, au as OverlayAddOptions, av as OverlayBuilder, L as OverlayId, O as OverlayKindRegistry, M as OverlayParams, c as PanZoomController, P as PanZoomOptions, aJ as PlaybackController, aP as PropHandlers, aN as PropReader, aO as PropWriter, af as RectOverlayParams, aR as RegistrableAdapter, a4 as RichLabelBuilder, a8 as RichLabelBuilderImpl, n as RichText, R as RichTextToken, z as SceneChanges, aa as SignalOverlayHop, ab as SignalOverlayParams, S as SvgExportOptions, a1 as SyncLayoutAlgorithm, ah as TextOverlayParams, h as TooltipContent, T as TooltipSection, aD as TweenOptions, aB as TweenSpec, Q as TypedVizOverlaySpec, Y as VizBuildEvent, a3 as VizBuilder, _ as VizEventMap, W as VizGridConfig, Z as VizMountEvent, i as VizNodeBadge, s as VizNodeCompartment, l as VizNodeIcon, k as VizNodeImage, m as VizNodeSvgContent, U as VizOverlaySpec, X as VizPlugin, r as VizRuntimeEdgeProps, q as VizRuntimeNodeProps, D as VizSceneMutator, aH as buildAnimationSpec, aw as buildOverlaySpecs, aq as coreCircleOverlay, ao as coreDataPointOverlay, an as coreGridLabelsOverlay, as as coreGroupOverlay, ap as coreRectOverlay, am as coreSignalOverlay, ar as coreTextOverlay, aL as createBuilderPlayback, aK as createScenePlayback, at as defaultCoreOverlayRegistry, aM as playAnimationSpec, a9 as viz } from './index-
|
|
3
|
-
export { H as HitResult, a as HitTestOptions, d as distanceSquare, e as edgeDistance, g as getEffectiveNodeBounds, h as hitTest, b as hitTestRect, n as nearestPort, p as pointInRect, s as setupPanZoom } from './hitTest-
|
|
1
|
+
import { e as VizAnimSpec, V as VizNode, a as VizEdge, d as Vec2, E as EdgeRouting, f as EdgeLabel, b as VizScene, N as NodeShape, g as NodePort } from './index-n9JLZMa1.js';
|
|
2
|
+
export { az as AnimProperty, aF as AnimatableProps, aG as AnimationBuilder, p as AnimationConfig, A as AnimationDuration, aQ as AnimationHostAdapter, aC as AnimationSpec, ax as AnimationTarget, B as BadgePosition, ag as CircleOverlayParams, t as CollapseAnchor, u as CollapseIndicatorOptions, a5 as CompartmentBuilder, v as CompartmentClickContext, w as CompartmentEntry, C as ContainerConfig, ay as CoreAnimProperty, aE as CoreAnimatableProps, al as CoreOverlayRegistry, aj as CoreOverlayRenderContext, ak as CoreOverlayRenderer, ad as DataPoint, ae as DataPointsOverlayParams, aA as Ease, a7 as EdgeBuilder, F as EdgeMarkerType, H as EdgeOptions, I as EdgePathResolver, y as EntryOptions, x as EntryStyle, aI as ExtendAdapter, ac as GridLabelsOverlayParams, ai as GroupOverlayParams, K as KnownOverlayId, a2 as LayoutAlgorithm, $ as LayoutGraph, a0 as LayoutResult, a6 as NodeBuilder, o as NodeLabel, j as NodeMediaPosition, G as NodeOptions, J as OVERLAY_RUNTIME_DIRTY, au as OverlayAddOptions, av as OverlayBuilder, L as OverlayId, O as OverlayKindRegistry, M as OverlayParams, c as PanZoomController, P as PanZoomOptions, aJ as PlaybackController, aP as PropHandlers, aN as PropReader, aO as PropWriter, af as RectOverlayParams, aR as RegistrableAdapter, a4 as RichLabelBuilder, a8 as RichLabelBuilderImpl, n as RichText, R as RichTextToken, z as SceneChanges, aa as SignalOverlayHop, ab as SignalOverlayParams, S as SvgExportOptions, a1 as SyncLayoutAlgorithm, ah as TextOverlayParams, h as TooltipContent, T as TooltipSection, aD as TweenOptions, aB as TweenSpec, Q as TypedVizOverlaySpec, Y as VizBuildEvent, a3 as VizBuilder, _ as VizEventMap, W as VizGridConfig, Z as VizMountEvent, i as VizNodeBadge, s as VizNodeCompartment, l as VizNodeIcon, k as VizNodeImage, m as VizNodeSvgContent, U as VizOverlaySpec, X as VizPlugin, r as VizRuntimeEdgeProps, q as VizRuntimeNodeProps, D as VizSceneMutator, aH as buildAnimationSpec, aw as buildOverlaySpecs, aq as coreCircleOverlay, ao as coreDataPointOverlay, an as coreGridLabelsOverlay, as as coreGroupOverlay, ap as coreRectOverlay, am as coreSignalOverlay, ar as coreTextOverlay, aL as createBuilderPlayback, aK as createScenePlayback, at as defaultCoreOverlayRegistry, aM as playAnimationSpec, a9 as viz } from './index-n9JLZMa1.js';
|
|
3
|
+
export { H as HitResult, a as HitTestOptions, d as distanceSquare, e as edgeDistance, g as getEffectiveNodeBounds, h as hitTest, b as hitTestRect, n as nearestPort, p as pointInRect, s as setupPanZoom } from './hitTest-5nKDL0YT.js';
|
|
4
4
|
export { SerializedScene, deserializeScene, serializeScene } from './serialization.js';
|
|
5
5
|
export { CircularLayoutOptions, GridLayoutOptions, circularLayout, gridLayout } from './layout.js';
|
|
6
6
|
export { EquidistantPort, PerimeterStrategy, findPortNearest, getEquidistantPorts, registerPerimeterStrategy, toNodePorts } from './ports.js';
|
package/dist/index.js
CHANGED
|
@@ -103,11 +103,11 @@
|
|
|
103
103
|
stroke-linejoin: round;
|
|
104
104
|
stroke-width: 2;
|
|
105
105
|
}
|
|
106
|
-
`;var dt=class{nodeAnims=new Map;edgeAnims=new Map;constructor(){}registerNode(e,t){return this.nodeAnims.set(e,t),this}registerEdge(e,t){return this.edgeAnims.set(e,t),this}getNodeRenderer(e){return this.nodeAnims.get(e)}getEdgeRenderer(e){return this.edgeAnims.get(e)}},nr={getClass:()=>"viz-anim-flow",getStyle:({spec:r})=>({"--viz-anim-duration":r.params?.duration??"2s"})},Te=new dt().registerEdge("flow",nr);function xi(r,e){let t=r.edges.find(n=>n.id===e);if(!t)return null;let i=new Map(r.nodes.map(n=>[n.id,n]));return ct(t,i)}function ct(r,e){let t=r.from?e.get(r.from)??null:null,i=r.to?e.get(r.to)??null:null;if(r.from&&!t||r.to&&!i||!t&&!r.fromAt&&!i&&!r.toAt)return null;let n=!!(t&&i&&t===i),a,d,c;if(n){let o=chunkM3ZDZ24B_js.g(t,r);a=o,d=o.exitPoint,c=o.entryPoint;}else {let o=chunkM3ZDZ24B_js.e(t,i,r);a=chunkM3ZDZ24B_js.f(o.start,o.end,r.routing,r.waypoints),d=o.start,c=o.end;}return {...a,startAnchor:d,endAnchor:c,startLabel:a.start,endLabel:a.end,waypoints:r.waypoints??[],isSelfLoop:n}}var or=/[MLQC]|-?(?:\d*\.\d+|\d+)(?:e[-+]?\d+)?/gi,_t=24;function Dt(r,e,t){let i=ct(r,e);return i?sr(i.d,t):null}function sr(r,e){let t=ar(r);if(t.length===0)return null;let i=t.filter(o=>o.type!=="M").map(o=>dr(o));if(i.length===0)return t.find(u=>u.type==="M")?.to??null;let n=i.reduce((o,u)=>o+u.length,0);if(n===0)return i[0]?.samples[0]?.point??null;let a=lr(e),d=n*a,c=0;for(let o of i){if(c+o.length>=d)return cr(o,d-c);c+=o.length;}return i[i.length-1]?.samples.at(-1)?.point??null}function lr(r){return !Number.isFinite(r)||r<=0?0:r>=1?1:r}function ar(r){let e=r.match(or);if(!e||e.length===0)return [];let t=[],i=null,n=0;for(;n<e.length;){let a=e[n++];if(!a)return [];switch(a){case "M":{let d=Ne(e,n);if(!d)return [];n+=2,i=d,t.push({type:"M",to:d});break}case "L":{if(!i)return [];let d=Ne(e,n);if(!d)return [];n+=2,t.push({type:"L",from:i,to:d}),i=d;break}case "Q":{if(!i)return [];let d=Ne(e,n),c=Ne(e,n+2);if(!d||!c)return [];n+=4,t.push({type:"Q",from:i,control:d,to:c}),i=c;break}case "C":{if(!i)return [];let d=Ne(e,n),c=Ne(e,n+2),o=Ne(e,n+4);if(!d||!c||!o)return [];n+=6,t.push({type:"C",from:i,control1:d,control2:c,to:o}),i=o;break}default:return []}}return t}function Ne(r,e){let t=Number(r[e]),i=Number(r[e+1]);return !Number.isFinite(t)||!Number.isFinite(i)?null:{x:t,y:i}}function dr(r){switch(r.type){case "L":return Mt([r.from,r.to]);case "Q":return Gt(_t,e=>ur(r.from,r.control,r.to,e));case "C":return Gt(_t,e=>gr(r.from,r.control1,r.control2,r.to,e))}}function Gt(r,e){let t=[];for(let i=0;i<=r;i++)t.push(e(i/r));return Mt(t)}function Mt(r){if(r.length===0)return {length:0,samples:[]};let e=[{distance:0,point:r[0]}],t=0;for(let i=1;i<r.length;i++)t+=mr(r[i-1],r[i]),e.push({distance:t,point:r[i]});return {length:t,samples:e}}function cr(r,e){let t=r.samples[0],i=r.samples.at(-1);if(!t)return {x:0,y:0};if(!i||e<=0)return t.point;if(e>=r.length)return i.point;for(let n=1;n<r.samples.length;n++){let a=r.samples[n-1],d=r.samples[n];if(d.distance>=e){let c=d.distance-a.distance,o=c===0?0:(e-a.distance)/c;return fr(a.point,d.point,o)}}return i.point}function ur(r,e,t,i){let n=1-i;return {x:n*n*r.x+2*n*i*e.x+i*i*t.x,y:n*n*r.y+2*n*i*e.y+i*i*t.y}}function gr(r,e,t,i,n){let a=1-n;return {x:a*a*a*r.x+3*a*a*n*e.x+3*a*n*n*t.x+n*n*n*i.x,y:a*a*a*r.y+3*a*a*n*e.y+3*a*n*n*t.y+n*n*n*i.y}}function mr(r,e){let t=e.x-r.x,i=e.y-r.y;return Math.sqrt(t*t+i*i)}function fr(r,e,t){return {x:r.x+(e.x-r.x)*t,y:r.y+(e.y-r.y)*t}}var ut=class{overlays=new Map;register(e,t){return this.overlays.set(e,t),this}get(e){return this.overlays.get(e)}};function hr(r,e,t){if(r.edgeId)return e.get(r.edgeId)??null;if(!r.followEdge)return null;let i=t.edges.filter(n=>n.from===r.from&&n.to===r.to);return i.length===1?i[0]:null}function pr(r){return Array.isArray(r.chain)}function yr(r){if(pr(r)){let e=r.chain.at(-1);if(!e)return null;let t=Number.isNaN(r.progress)?0:r.progress;if(t>=r.chain.length)return {hop:e,progress:1,parkedNodeId:r.parkAt??e.to,fallbackParkedNodeId:e.to,shouldPark:true};let i=!Number.isFinite(t)||t<=0?0:t,n=Math.min(Math.floor(i),r.chain.length-1),a=r.chain[n];return a?{hop:a,progress:i-n,parkedNodeId:r.parkAt??e.to,fallbackParkedNodeId:e.to,shouldPark:false}:null}return {hop:{from:r.from,to:r.to,followEdge:r.followEdge,edgeId:r.edgeId},progress:r.progress,parkedNodeId:r.parkAt??r.to,fallbackParkedNodeId:r.to,shouldPark:Number.isFinite(r.progress)&&r.progress>=1&&(r.resting===true||r.parkAt!==void 0)}}function br(r,e,t,i){let n=i.get(r)??i.get(e);if(!n)return null;let a=chunkOZAFCKI7_js.d(n);return {x:a.x+(t.parkOffsetX??0),y:a.y+(t.parkOffsetY??0)}}function vr(r,e,t,i){let n=yr(r);if(!n)return null;if(n.shouldPark)return br(n.parkedNodeId,n.fallbackParkedNodeId,r,e);let a=e.get(n.hop.from),d=e.get(n.hop.to);if(!a||!d)return null;let c=hr(n.hop,t,i);if(c){let g=Dt(c,e,n.progress);if(g)return g}let o=chunkOZAFCKI7_js.d(a),u=chunkOZAFCKI7_js.d(d);return {x:o.x+(u.x-o.x)*n.progress,y:o.y+(u.y-o.y)*n.progress}}var xr={render:({spec:r,nodesById:e,edgesById:t,scene:i})=>{let n=vr(r.params,e,t,i);if(!n)return "";let a=Math.abs(r.params.magnitude??1);a>1&&(a=1);let d=2+a*4,c=r.className??"viz-signal";return `
|
|
106
|
+
`;var dt=class{nodeAnims=new Map;edgeAnims=new Map;constructor(){}registerNode(e,t){return this.nodeAnims.set(e,t),this}registerEdge(e,t){return this.edgeAnims.set(e,t),this}getNodeRenderer(e){return this.nodeAnims.get(e)}getEdgeRenderer(e){return this.edgeAnims.get(e)}},nr={getClass:()=>"viz-anim-flow",getStyle:({spec:r})=>({"--viz-anim-duration":r.params?.duration??"2s"})},Te=new dt().registerEdge("flow",nr);function xi(r,e){let t=r.edges.find(n=>n.id===e);if(!t)return null;let i=new Map(r.nodes.map(n=>[n.id,n]));return ct(t,i)}function ct(r,e){let t=r.from?e.get(r.from)??null:null,i=r.to?e.get(r.to)??null:null;if(r.from&&!t||r.to&&!i||!t&&!r.fromAt&&!i&&!r.toAt)return null;let n=!!(t&&i&&t===i),a,d,c;if(n){let o=chunkM3ZDZ24B_js.g(t,r);a=o,d=o.exitPoint,c=o.entryPoint;}else {let o=chunkM3ZDZ24B_js.e(t,i,r);a=chunkM3ZDZ24B_js.f(o.start,o.end,r.routing,r.waypoints),d=o.start,c=o.end;}return {...a,startAnchor:d,endAnchor:c,startLabel:a.start,endLabel:a.end,waypoints:r.waypoints??[],isSelfLoop:n}}var or=/[MLQC]|-?(?:\d*\.\d+|\d+)(?:e[-+]?\d+)?/gi,_t=24;function Dt(r,e,t){let i=ct(r,e);return i?sr(i.d,t):null}function sr(r,e){let t=ar(r);if(t.length===0)return null;let i=t.filter(o=>o.type!=="M").map(o=>dr(o));if(i.length===0)return t.find(u=>u.type==="M")?.to??null;let n=i.reduce((o,u)=>o+u.length,0);if(n===0)return i[0]?.samples[0]?.point??null;let a=lr(e),d=n*a,c=0;for(let o of i){if(c+o.length>=d)return cr(o,d-c);c+=o.length;}return i[i.length-1]?.samples.at(-1)?.point??null}function lr(r){return !Number.isFinite(r)||r<=0?0:r>=1?1:r}function ar(r){let e=r.match(or);if(!e||e.length===0)return [];let t=[],i=null,n=0;for(;n<e.length;){let a=e[n++];if(!a)return [];switch(a){case "M":{let d=Ne(e,n);if(!d)return [];n+=2,i=d,t.push({type:"M",to:d});break}case "L":{if(!i)return [];let d=Ne(e,n);if(!d)return [];n+=2,t.push({type:"L",from:i,to:d}),i=d;break}case "Q":{if(!i)return [];let d=Ne(e,n),c=Ne(e,n+2);if(!d||!c)return [];n+=4,t.push({type:"Q",from:i,control:d,to:c}),i=c;break}case "C":{if(!i)return [];let d=Ne(e,n),c=Ne(e,n+2),o=Ne(e,n+4);if(!d||!c||!o)return [];n+=6,t.push({type:"C",from:i,control1:d,control2:c,to:o}),i=o;break}default:return []}}return t}function Ne(r,e){let t=Number(r[e]),i=Number(r[e+1]);return !Number.isFinite(t)||!Number.isFinite(i)?null:{x:t,y:i}}function dr(r){switch(r.type){case "L":return Mt([r.from,r.to]);case "Q":return Gt(_t,e=>ur(r.from,r.control,r.to,e));case "C":return Gt(_t,e=>gr(r.from,r.control1,r.control2,r.to,e))}}function Gt(r,e){let t=[];for(let i=0;i<=r;i++)t.push(e(i/r));return Mt(t)}function Mt(r){if(r.length===0)return {length:0,samples:[]};let e=[{distance:0,point:r[0]}],t=0;for(let i=1;i<r.length;i++)t+=mr(r[i-1],r[i]),e.push({distance:t,point:r[i]});return {length:t,samples:e}}function cr(r,e){let t=r.samples[0],i=r.samples.at(-1);if(!t)return {x:0,y:0};if(!i||e<=0)return t.point;if(e>=r.length)return i.point;for(let n=1;n<r.samples.length;n++){let a=r.samples[n-1],d=r.samples[n];if(d.distance>=e){let c=d.distance-a.distance,o=c===0?0:(e-a.distance)/c;return fr(a.point,d.point,o)}}return i.point}function ur(r,e,t,i){let n=1-i;return {x:n*n*r.x+2*n*i*e.x+i*i*t.x,y:n*n*r.y+2*n*i*e.y+i*i*t.y}}function gr(r,e,t,i,n){let a=1-n;return {x:a*a*a*r.x+3*a*a*n*e.x+3*a*n*n*t.x+n*n*n*i.x,y:a*a*a*r.y+3*a*a*n*e.y+3*a*n*n*t.y+n*n*n*i.y}}function mr(r,e){let t=e.x-r.x,i=e.y-r.y;return Math.sqrt(t*t+i*i)}function fr(r,e,t){return {x:r.x+(e.x-r.x)*t,y:r.y+(e.y-r.y)*t}}var ut=class{overlays=new Map;register(e,t){return this.overlays.set(e,t),this}get(e){return this.overlays.get(e)}};function hr(r,e,t){if(r.edgeId)return e.get(r.edgeId)??null;if(!r.followEdge)return null;let i=t.edges.filter(n=>n.from===r.from&&n.to===r.to);return i.length===1?i[0]:null}function pr(r){return Array.isArray(r.chain)}function yr(r){if(pr(r)){let e=r.chain.at(-1);if(!e)return null;let t=Number.isNaN(r.progress)?0:r.progress;if(t>=r.chain.length)return {hop:e,progress:1,parkedNodeId:r.parkAt??e.to,fallbackParkedNodeId:e.to,shouldPark:true};let i=!Number.isFinite(t)||t<=0?0:t,n=Math.min(Math.floor(i),r.chain.length-1),a=r.chain[n];return a?{hop:a,progress:i-n,parkedNodeId:r.parkAt??e.to,fallbackParkedNodeId:e.to,shouldPark:false}:null}return {hop:{from:r.from,to:r.to,followEdge:r.followEdge,edgeId:r.edgeId},progress:r.progress,parkedNodeId:r.parkAt??r.to,fallbackParkedNodeId:r.to,shouldPark:Number.isFinite(r.progress)&&r.progress>=1&&(r.resting===true||r.parkAt!==void 0)}}function br(r,e,t,i){let n=i.get(r)??i.get(e);if(!n)return null;let a=chunkOZAFCKI7_js.d(n);return {x:a.x+(t.parkOffsetX??0),y:a.y+(t.parkOffsetY??0)}}function vr(r,e,t,i){let n=yr(r);if(!n)return null;if(n.shouldPark)return br(n.parkedNodeId,n.fallbackParkedNodeId,r,e);let a=e.get(n.hop.from),d=e.get(n.hop.to);if(!a||!d)return null;let c=hr(n.hop,t,i);if(c){let g=Dt(c,e,n.progress);if(g)return g}let o=chunkOZAFCKI7_js.d(a),u=chunkOZAFCKI7_js.d(d);return {x:o.x+(u.x-o.x)*n.progress,y:o.y+(u.y-o.y)*n.progress}}var xr={render:({spec:r,nodesById:e,edgesById:t,scene:i})=>{let n=vr(r.params,e,t,i);if(!n)return "";let a=Math.abs(r.params.magnitude??1);a>1&&(a=1);let d=2+a*4,c=r.className??"viz-signal",o=r.params.color,u=r.params.glowColor??o,g=o?` style="fill: ${o}"`:"",m=u?` filter="drop-shadow(0 0 3px ${u})"`:"";return `
|
|
107
107
|
<g transform="translate(${n.x}, ${n.y})">
|
|
108
|
-
<g class="${c}">
|
|
108
|
+
<g class="${c}"${g}>
|
|
109
109
|
<circle r="10" fill="transparent" stroke="none" />
|
|
110
|
-
<circle r="${d}" class="viz-signal-shape" />
|
|
110
|
+
<circle r="${d}" class="viz-signal-shape"${m} />
|
|
111
111
|
</g>
|
|
112
112
|
</g>
|
|
113
113
|
`}},Sr={render:({spec:r,scene:e})=>{let t=e.grid;if(!t)return "";let{w:i,h:n}=e.viewBox,{colLabels:a,rowLabels:d,yOffset:c=20,xOffset:o=20}=r.params,u=(i-t.padding.x*2)/t.cols,g=(n-t.padding.y*2)/t.rows,m="";return a&&Object.entries(a).forEach(([y,h])=>{let f=parseInt(y,10),E=t.padding.x+f*u+u/2,B=r.className||"viz-grid-label";m+=`<text x="${E}" y="${c}" class="${B}" text-anchor="middle">${h}</text>`;}),d&&Object.entries(d).forEach(([y,h])=>{let f=parseInt(y,10),E=t.padding.y+f*g+g/2,B=r.className||"viz-grid-label";m+=`<text x="${o}" y="${E}" dy=".35em" class="${B}" text-anchor="middle">${h}</text>`;}),m}},Ar={render:({spec:r,nodesById:e})=>{let{points:t}=r.params,i="";return t.forEach(n=>{let a=e.get(n.currentNodeId);if(!a)return;let d=parseInt(n.id.split("-")[1]||"0",10),c=(d%5-2)*10,o=(d%3-1)*10,u=a.pos.x+c,g=a.pos.y+o,m=r.className??"viz-data-point";i+=`<circle data-id="${n.id}" cx="${u}" cy="${g}" r="6" class="${m}" />`;}),i},update:({spec:r,nodesById:e},t)=>{let{points:i}=r.params,n="http://www.w3.org/2000/svg",a=new Map;Array.from(t.children).forEach(c=>{if(c.tagName==="circle"){let o=c.getAttribute("data-id");o&&a.set(o,c);}});let d=new Set;i.forEach(c=>{let o=e.get(c.currentNodeId);if(!o)return;d.add(c.id);let u=parseInt(c.id.split("-")[1]||"0",10),g=(u%5-2)*10,m=(u%3-1)*10,y=o.pos.x+g,h=o.pos.y+m,f=a.get(c.id);f||(f=document.createElementNS(n,"circle"),f.setAttribute("data-id",c.id),f.setAttribute("r","6"),t.appendChild(f)),f.setAttribute("cx",String(y)),f.setAttribute("cy",String(h));let E=r.className??"viz-data-point";f.getAttribute("class")!==E&&f.setAttribute("class",E);}),a.forEach((c,o)=>{d.has(o)||c.remove();});}},kr={render:({spec:r,nodesById:e})=>{let t=Wt(r.params,e);if(!t)return "";let{w:i,h:n,rx:a,ry:d,opacity:c,fill:o,stroke:u,strokeWidth:g}=r.params,m=r.className??"viz-overlay-rect",y=a!==void 0?` rx="${a}"`:"",h=d!==void 0?` ry="${d}"`:"",f=c!==void 0?` opacity="${c}"`:"",E=o===void 0,B=u===void 0,b=o??"#3b82f6",z=u??"#3b82f6",R=g??3,w=E?' fill-opacity="0.12"':"",s=B?' stroke-opacity="0.9"':"";return `<rect x="${t.x}" y="${t.y}" width="${i}" height="${n}" fill="${b}"${w} stroke="${z}"${s} stroke-width="${R}"${y}${h}${f} class="${m}" />`},update:({spec:r,nodesById:e},t)=>{let i="http://www.w3.org/2000/svg",n=Wt(r.params,e),{w:a,h:d,rx:c,ry:o,opacity:u,fill:g,stroke:m,strokeWidth:y}=r.params,h=r.className??"viz-overlay-rect",f=t.querySelector("rect");if(!n){f?.remove();return}f||(f=document.createElementNS(i,"rect"),t.appendChild(f)),f.setAttribute("x",String(n.x)),f.setAttribute("y",String(n.y)),f.setAttribute("width",String(a)),f.setAttribute("height",String(d)),g===void 0?(f.setAttribute("fill","#3b82f6"),f.setAttribute("fill-opacity","0.12")):(f.setAttribute("fill",g),f.removeAttribute("fill-opacity")),m===void 0?(f.setAttribute("stroke","#3b82f6"),f.setAttribute("stroke-opacity","0.9")):(f.setAttribute("stroke",m),f.removeAttribute("stroke-opacity")),f.setAttribute("stroke-width",String(y??3)),c!==void 0?f.setAttribute("rx",String(c)):f.removeAttribute("rx"),o!==void 0?f.setAttribute("ry",String(o)):f.removeAttribute("ry"),u!==void 0?f.setAttribute("opacity",String(u)):f.removeAttribute("opacity"),f.setAttribute("class",h);}},Er={render:({spec:r,nodesById:e})=>{let t=Xe(r.params,e);if(!t)return "";let{r:i,opacity:n,fill:a,stroke:d,strokeWidth:c}=r.params,o=r.className??"viz-overlay-circle",u=n!==void 0?` opacity="${n}"`:"",g=a===void 0,m=d===void 0,y=a??"#3b82f6",h=d??"#3b82f6",f=c??3,E=g?' fill-opacity="0.12"':"",B=m?' stroke-opacity="0.9"':"";return `<circle cx="${t.x}" cy="${t.y}" r="${i}" fill="${y}"${E} stroke="${h}"${B} stroke-width="${f}"${u} class="${o}" />`},update:({spec:r,nodesById:e},t)=>{let i="http://www.w3.org/2000/svg",n=Xe(r.params,e),{r:a,opacity:d,fill:c,stroke:o,strokeWidth:u}=r.params,g=r.className??"viz-overlay-circle",m=t.querySelector("circle");if(!n){m?.remove();return}m||(m=document.createElementNS(i,"circle"),t.appendChild(m)),m.setAttribute("cx",String(n.x)),m.setAttribute("cy",String(n.y)),m.setAttribute("r",String(a)),c===void 0?(m.setAttribute("fill","#3b82f6"),m.setAttribute("fill-opacity","0.12")):(m.setAttribute("fill",c),m.removeAttribute("fill-opacity")),o===void 0?(m.setAttribute("stroke","#3b82f6"),m.setAttribute("stroke-opacity","0.9")):(m.setAttribute("stroke",o),m.removeAttribute("stroke-opacity")),m.setAttribute("stroke-width",String(u??3)),d!==void 0?m.setAttribute("opacity",String(d)):m.removeAttribute("opacity"),m.setAttribute("class",g);}},zr={render:({spec:r,nodesById:e})=>{let t=Xe(r.params,e);if(!t)return "";let{text:i,opacity:n,fill:a,fontSize:d,fontWeight:c,textAnchor:o,dominantBaseline:u}=r.params,g=r.className??"viz-overlay-text",m=n!==void 0?` opacity="${n}"`:"",y=d!==void 0?` font-size="${d}"`:"",h=c!==void 0?` font-weight="${c}"`:"",f=o!==void 0?` text-anchor="${o}"`:"",E=u!==void 0?` dominant-baseline="${u}"`:"",B=a??"#111";return `<text x="${t.x}" y="${t.y}" fill="${B}"${m}${y}${h}${f}${E} class="${g}">${i}</text>`},update:({spec:r,nodesById:e},t)=>{let i="http://www.w3.org/2000/svg",n=Xe(r.params,e),{text:a,opacity:d,fill:c,fontSize:o,fontWeight:u,textAnchor:g,dominantBaseline:m}=r.params,y=r.className??"viz-overlay-text",h=t.querySelector("text");if(!n){h?.remove();return}h||(h=document.createElementNS(i,"text"),t.appendChild(h)),h.setAttribute("x",String(n.x)),h.setAttribute("y",String(n.y)),h.setAttribute("fill",c??"#111"),d!==void 0?h.setAttribute("opacity",String(d)):h.removeAttribute("opacity"),o!==void 0?h.setAttribute("font-size",String(o)):h.removeAttribute("font-size"),u!==void 0?h.setAttribute("font-weight",String(u)):h.removeAttribute("font-weight"),g!==void 0?h.setAttribute("text-anchor",g):h.removeAttribute("text-anchor"),m!==void 0?h.setAttribute("dominant-baseline",m):h.removeAttribute("dominant-baseline"),h.setAttribute("class",y),h.textContent=a;}};function It(r){let e=r.x??0,t=r.y??0,i=r.scale??1,n=r.rotation??0,a=[`translate(${e}, ${t})`];return n&&a.push(`rotate(${n})`),i!==1&&a.push(`scale(${i})`),a.join(" ")}function Ht(r){return r<0?0:r>1?1:r}function gt(r){return typeof r.nodeId=="string"&&r.nodeId.length>0}function mt(r,e){let t=e.get(r.nodeId);if(!t)return null;let i=chunkOZAFCKI7_js.d(t);return {x:i.x+(r.offsetX??0),y:i.y+(r.offsetY??0)}}function Xe(r,e){return gt(r)?mt(r,e):{x:r.x,y:r.y}}function Wt(r,e){if(gt(r)){let t=mt(r,e);return t?{x:t.x-r.w/2,y:t.y-r.h/2}:null}return {x:r.x,y:r.y}}function qt(r,e){let t=r.x??0,i=r.y??0,n=t,a=i;if(r.from&&r.to){let g=e.get(r.from),m=e.get(r.to);if(g&&m){let y=Ht(r.progress??0),h=chunkOZAFCKI7_js.d(g),f=chunkOZAFCKI7_js.d(m);n=h.x+(f.x-h.x)*y+t,a=h.y+(f.y-h.y)*y+i;}}else if(gt(r)){let g=mt(r,e);if(!g)return null;n=g.x+t,a=g.y+i;}let d=r.scale??1,c=r.magnitude,o=c===void 0?1:.85+.3*Ht(Math.abs(c)),u=d*o;return {x:n,y:a,scale:u,rotation:r.rotation??0}}var wr={render:({spec:r,nodesById:e,edgesById:t,scene:i,registry:n})=>{let{children:a,opacity:d}=r.params,c=qt(r.params,e);if(!c)return "";let o=It(c),u=d!==void 0?` opacity="${d}"`:"",g=n;if(!g)return `<g transform="${o}"${u}></g>`;let m=`<g transform="${o}"${u}>`;return a.forEach((y,h)=>{let f=g.get(y.id);if(!f)return;let E={spec:y,nodesById:e,edgesById:t,scene:i,registry:g},B=y.key?`key:${y.key}`:`idx:${h}:${y.id}`;m+=`<g data-viz-role="overlay-child" data-overlay-child-id="${B}">`,m+=f.render(E),m+="</g>";}),m+="</g>",m},update:({spec:r,nodesById:e,edgesById:t,scene:i,registry:n},a)=>{let d=n;if(!d)return;let{children:c,opacity:o}=r.params,u=qt(r.params,e);if(!u){a.removeAttribute("transform"),a.removeAttribute("opacity"),a.innerHTML="";return}a.setAttribute("transform",It(u)),o!==void 0?a.setAttribute("opacity",String(o)):a.removeAttribute("opacity");let g="http://www.w3.org/2000/svg",m=new Map;Array.from(a.children).forEach(h=>{if(h instanceof SVGGElement){let f=h.getAttribute("data-overlay-child-id");f&&m.set(f,h);}});let y=new Set;c.forEach((h,f)=>{let E=d.get(h.id);if(!E)return;let B=h.key?`key:${h.key}`:`idx:${f}:${h.id}`;y.add(B);let b=m.get(B);b||(b=document.createElementNS(g,"g"),b.setAttribute("data-viz-role","overlay-child"),b.setAttribute("data-overlay-child-id",B),a.appendChild(b));let z={spec:h,nodesById:e,edgesById:t,scene:i,registry:d};E.update?E.update(z,b):b.innerHTML=E.render(z);}),m.forEach((h,f)=>{y.has(f)||h.remove();});}},Ve=new ut().register("signal",xr).register("grid-labels",Sr).register("data-points",Ar).register("rect",kr).register("circle",Er).register("text",zr).register("group",wr);var _e=class r{specs=[];keyCounters=new Map;add(e,t,i){let n=i?.className,a=i?.key;if(!a&&this.specs.some(c=>c.id===e&&(c.key===void 0||c.key===""))){let c=(this.keyCounters.get(e)??0)+1;this.keyCounters.set(e,c),a=`${e}#${c}`;}return this.specs.push({id:e,params:t,key:a,className:n}),this}remove(e){for(let t=this.specs.length-1;t>=0;t--){let i=this.specs[t];if(!i)continue;let n=i.key===e,a=!i.key&&i.id===e;(n||a)&&this.specs.splice(t,1);}return this}clear(){return this.specs.length=0,this.keyCounters.clear(),this}build(){return [...this.specs]}rect(e,t){return this.add("rect",e,t)}circle(e,t){return this.add("circle",e,t)}text(e,t){return this.add("text",e,t)}group(e,t,i){let n=new r;t(n);let a=n.build();return this.add("group",{...e,children:a},i)}};function Bi(r){let e=new _e;return r(e),e.build()}var Br={solid:"",dashed:"8, 4",dotted:"2, 4","dash-dot":"8, 4, 2, 4"};function $e(r){return !r||r==="solid"?"":Br[r]??r}function Ge(r,e){let t=r.position==="start"?e.start:r.position==="end"?e.end:e.mid;return {x:t.x+(r.dx||0),y:t.y+(r.dy||0)}}function De(r){return r.labels&&r.labels.length>0?r.labels:r.label?[r.label]:[]}var Q="http://www.w3.org/2000/svg",Qe={dx:2,dy:2,blur:4,color:"rgba(0,0,0,0.2)"};function Cr(r){return {dx:r.dx??Qe.dx,dy:r.dy??Qe.dy,blur:r.blur??Qe.blur,color:r.color??Qe.color}}function Nr(r){let e=r.color.replace(/[^a-zA-Z0-9]/g,"_");return `viz-shadow-${r.dx}-${r.dy}-${r.blur}-${e}`}function Vr(r,e){let t=Cr(e),i=Nr(t);if(!r.querySelector(`#${CSS.escape(i)}`)){let n=r.querySelector("defs");if(n){let a=document.createElementNS(Q,"filter");a.setAttribute("id",i),a.setAttribute("x","-50%"),a.setAttribute("y","-50%"),a.setAttribute("width","200%"),a.setAttribute("height","200%");let d=document.createElementNS(Q,"feDropShadow");d.setAttribute("dx",String(t.dx)),d.setAttribute("dy",String(t.dy)),d.setAttribute("stdDeviation",String(t.blur)),d.setAttribute("flood-color",t.color),d.setAttribute("flood-opacity","1"),a.appendChild(d),n.appendChild(a);}}return i}function $r(r){return `viz-sketch-${r}`}function Pr(r,e){let t=(r^e*2654435761)>>>0|1;return t^=t<<13,t^=t>>>17,t^=t<<5,(t>>>0)/4294967296}function Me(r,e,t,i){return t+Pr(r,e)*(i-t)}function Ft(r,e){let t=$r(e);if(!r.querySelector(`#${CSS.escape(t)}`)){let i=r.querySelector("defs");if(i){let n=document.createElementNS(Q,"filter");n.setAttribute("id",t),n.setAttribute("filterUnits","userSpaceOnUse"),n.setAttribute("x","-10000"),n.setAttribute("y","-10000"),n.setAttribute("width","20000"),n.setAttribute("height","20000");let a=e+37,d=Me(e,1,.009,.015).toFixed(4),c=Me(e,2,2.5,4).toFixed(1),o=Me(e,3,3,5).toFixed(1),u=Me(e,4,.3,1.6).toFixed(2),g=Me(e,5,.2,1.3).toFixed(2),m=document.createElementNS(Q,"feTurbulence");m.setAttribute("type","fractalNoise"),m.setAttribute("baseFrequency","0.008"),m.setAttribute("numOctaves","2"),m.setAttribute("seed",String(e)),m.setAttribute("result","n1"),n.appendChild(m);let y=document.createElementNS(Q,"feTurbulence");y.setAttribute("type","fractalNoise"),y.setAttribute("baseFrequency",d),y.setAttribute("numOctaves","2"),y.setAttribute("seed",String(a)),y.setAttribute("result","n2"),n.appendChild(y);let h=document.createElementNS(Q,"feDisplacementMap");h.setAttribute("in","SourceGraphic"),h.setAttribute("in2","n1"),h.setAttribute("scale",c),h.setAttribute("xChannelSelector","R"),h.setAttribute("yChannelSelector","G"),h.setAttribute("result","s1"),n.appendChild(h);let f=document.createElementNS(Q,"feDisplacementMap");f.setAttribute("in","SourceGraphic"),f.setAttribute("in2","n2"),f.setAttribute("scale",o),f.setAttribute("xChannelSelector","G"),f.setAttribute("yChannelSelector","R"),f.setAttribute("result","s2"),n.appendChild(f);let E=document.createElementNS(Q,"feOffset");E.setAttribute("in","s2"),E.setAttribute("dx",u),E.setAttribute("dy",g),E.setAttribute("result","s2off"),n.appendChild(E);let B=document.createElementNS(Q,"feComposite");B.setAttribute("in","s1"),B.setAttribute("in2","s2off"),B.setAttribute("operator","over"),n.appendChild(B),i.appendChild(n);}}return t}function Or(r,e){if(r?.sketchSeed!==void 0)return r.sketchSeed;let t=0;for(let i=0;i<e.length;i++)t=Math.imul(31,t)+e.charCodeAt(i)|0;return Math.abs(t)}function Lr(r){return r.replace(/[^a-zA-Z0-9]/g,"_")}function ht(r,e,t="end"){if(r==="none")return "";let i=`viz-${r}`,n=t==="start"?"-start":"";return e?`${i}${n}-${Lr(e)}`:`${i}${n}`}function Rr(r,e){switch(r){case "arrow":{let t=document.createElementNS(Q,"polygon");return t.setAttribute("points","0,2 10,5 0,8"),t.setAttribute("fill",e),t}case "arrowOpen":{let t=document.createElementNS(Q,"polyline");return t.setAttribute("points","0,2 10,5 0,8"),t.setAttribute("fill","white"),t.setAttribute("stroke",e),t.setAttribute("stroke-width","1.5"),t.setAttribute("stroke-linejoin","miter"),t}case "diamond":{let t=document.createElementNS(Q,"polygon");return t.setAttribute("points","0,5 5,2 10,5 5,8"),t.setAttribute("fill",e),t}case "diamondOpen":{let t=document.createElementNS(Q,"polygon");return t.setAttribute("points","0,5 5,2 10,5 5,8"),t.setAttribute("fill","white"),t.setAttribute("stroke",e),t.setAttribute("stroke-width","1.5"),t}case "circle":{let t=document.createElementNS(Q,"circle");return t.setAttribute("cx","5"),t.setAttribute("cy","5"),t.setAttribute("r","3"),t.setAttribute("fill",e),t}case "circleOpen":{let t=document.createElementNS(Q,"circle");return t.setAttribute("cx","5"),t.setAttribute("cy","5"),t.setAttribute("r","3"),t.setAttribute("fill","white"),t.setAttribute("stroke",e),t.setAttribute("stroke-width","1.5"),t}case "square":{let t=document.createElementNS(Q,"rect");return t.setAttribute("x","2"),t.setAttribute("y","2"),t.setAttribute("width","6"),t.setAttribute("height","6"),t.setAttribute("fill",e),t}case "bar":{let t=document.createElementNS(Q,"line");return t.setAttribute("x1","5"),t.setAttribute("y1","1"),t.setAttribute("x2","5"),t.setAttribute("y2","9"),t.setAttribute("stroke",e),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t}case "halfArrow":{let t=document.createElementNS(Q,"polygon");return t.setAttribute("points","0,2 10,5 0,5"),t.setAttribute("fill",e),t}default:return null}}function jt(r,e,t="arrow",i="end"){let n=ht(t,e,i);if(!n)return "";if(!r.querySelector(`#${CSS.escape(n)}`)){let a=r.querySelector("defs");if(a){let d=document.createElementNS(Q,"marker");d.setAttribute("id",n),d.setAttribute("viewBox","0 0 10 10"),d.setAttribute("markerWidth","10"),d.setAttribute("markerHeight","10"),d.setAttribute("refX","9"),d.setAttribute("refY","5"),d.setAttribute("orient",i==="start"?"auto-start-reverse":"auto");let c=Rr(t,e);c&&d.appendChild(c),a.appendChild(d);}}return n}function Ie(r,e){let t=new Map,i=new Map,n=new Map,a=new Map,d=new Map,c=new Map,o=new Map,u=new Map,g=new Map,m=new Map,y=r.querySelector('[data-viz-layer="nodes"]')||r.querySelector(".viz-layer-nodes");if(y){let f=Array.from(y.querySelectorAll("g[data-id]"));for(let E of f){let B=E.getAttribute("data-id");if(!B)continue;t.set(B,E);let b=E.querySelector('[data-viz-role="node-shape"]')||E.querySelector(".viz-node-shape");b&&i.set(B,b);let z=E.querySelector('[data-viz-role="node-label"]')||E.querySelector(".viz-node-label");z&&n.set(B,z);let R=E.querySelector('[data-viz-role="node-image"]')||E.querySelector(".viz-node-image");R&&a.set(B,R);let w=E.querySelector('[data-viz-role="node-icon"]')||E.querySelector(".viz-node-icon");w&&d.set(B,w);let s=E.querySelector('[data-viz-role="node-svg"]')||E.querySelector(".viz-node-svg");s&&c.set(B,s);}}let h=r.querySelector('[data-viz-layer="edges"]')||r.querySelector(".viz-layer-edges");if(h){let f=Array.from(h.querySelectorAll("g[data-id]"));for(let E of f){let B=E.getAttribute("data-id");if(!B)continue;o.set(B,E);let b=E.querySelector('[data-viz-role="edge-line"]')||E.querySelector(".viz-edge");b&&u.set(B,b);let z=E.querySelector('[data-viz-role="edge-hit"]')||E.querySelector(".viz-edge-hit");z&&g.set(B,z);let R=Array.from(E.querySelectorAll('[data-viz-role="edge-label"],.viz-edge-label'));R.length>0&&m.set(B,R);}}return {svg:r,edgePathResolver:e?.edgePathResolver??null,nodeGroupsById:t,nodeShapesById:i,nodeLabelsById:n,nodeImagesById:a,nodeIconsById:d,nodeSvgsById:c,edgeGroupsById:o,edgeLinesById:u,edgeHitsById:g,edgeLabelsById:m}}function Tr(r){let e=0,t=0;if(r&&typeof r=="object"){let i=r;typeof i.w=="number"?e=i.w:typeof i.r=="number"?e=i.r*2:typeof i.rx=="number"&&typeof i.ry=="number"?(e=i.rx*2,t=i.ry*2):typeof i.size=="number"?e=i.size:typeof i.outerR=="number"&&(e=i.outerR*2),typeof i.h=="number"?t=i.h:t===0&&(t=e);}return {w:e,h:t}}function ft(r,e,t,i,n,a,d){let c=d?.position??"center",o=d?.dx??0,u=d?.dy??0,g=0,m=0;switch(c){case "above":m=-i/2-a/2;break;case "below":m=i/2+a/2;break;case "left":g=-t/2-n/2;break;case "right":g=t/2+n/2;break;}return {x:r+g-n/2+o,y:e+m-a/2+u}}function pt(r,e){let t=new Map(r.nodes.map(o=>[o.id,o])),i=new Map;for(let o of r.nodes)if(o.container){let u=(o.runtime?.x??o.pos.x)-o.pos.x,g=(o.runtime?.y??o.pos.y)-o.pos.y;(u!==0||g!==0)&&i.set(o.id,{dx:u,dy:g});}for(let o of r.nodes){let u=e.nodeGroupsById.get(o.id),g=e.nodeShapesById.get(o.id);if(!u||!g)continue;let{x:m,y}=chunkOZAFCKI7_js.d(o);if(o.parentId){let w=i.get(o.parentId);w&&(m+=w.dx,y+=w.dy);}let h=chunkOZAFCKI7_js.e(o);chunkOZAFCKI7_js.g(g,h,{x:m,y});let{w:f,h:E}=Tr(h);if(f>0&&E>0){let w=e.nodeImagesById.get(o.id);if(w&&o.image){let A=ft(m,y,f,E,o.image.width,o.image.height,{position:o.image.position,dx:o.image.dx,dy:o.image.dy});w.setAttribute("x",String(A.x)),w.setAttribute("y",String(A.y));}let s=e.nodeIconsById.get(o.id);if(s&&o.icon){let A=ft(m,y,f,E,o.icon.size,o.icon.size,{position:o.icon.position,dx:o.icon.dx,dy:o.icon.dy});s.setAttribute("transform",`translate(${A.x} ${A.y})`);}let v=e.nodeSvgsById.get(o.id);if(v&&o.svgContent){let A=ft(m,y,f,E,o.svgContent.width,o.svgContent.height,{position:o.svgContent.position,dx:o.svgContent.dx,dy:o.svgContent.dy});v.setAttribute("transform",`translate(${A.x} ${A.y})`);}}if(o.container?.headerHeight&&"w"in h&&"h"in h){let w=u.querySelector('[data-viz-role="container-header"]');if(w){let s=h.w,v=h.h,A=y-v/2+o.container.headerHeight;w.setAttribute("x1",String(m-s/2)),w.setAttribute("y1",String(A)),w.setAttribute("x2",String(m+s/2)),w.setAttribute("y2",String(A));}}let B=e.nodeLabelsById.get(o.id);if(B&&o.label){let w=m+(o.label.dx||0),s=y+(o.label.dy||0);if(o.container?.headerHeight&&"h"in h&&!o.label.dy){let A=h.h;s=y-A/2+o.container.headerHeight/2,w=m+(o.label.dx||0);}B.setAttribute("x",String(w)),B.setAttribute("y",String(s));let v=B.querySelectorAll('tspan[data-viz-role="text-line"]');for(let A=0;A<v.length;A++)v[A]?.setAttribute("x",String(w));}if(o.runtime?.opacity!==void 0?(u.style.opacity=String(o.runtime.opacity),g.removeAttribute("opacity")):(u.style.removeProperty("opacity"),o.style?.opacity!==void 0?g.setAttribute("opacity",String(o.style.opacity)):g.removeAttribute("opacity")),o.style?.shadow){let w=Vr(e.svg,o.style.shadow);g.setAttribute("filter",`url(#${w})`);}else g.removeAttribute("filter");if(o.style?.sketch||r.sketch?.enabled){let w=Or(o.style,o.id),s=Ft(e.svg,w);u.setAttribute("filter",`url(#${s})`),u.classList.contains("viz-sketch")||u.classList.add("viz-sketch");}else {u.classList.contains("viz-sketch")&&u.classList.remove("viz-sketch");let w=u.getAttribute("filter");w&&w.startsWith("url(#viz-sketch-")&&u.removeAttribute("filter");}let z=o.runtime?.scale,R=o.runtime?.rotation;if(z!==void 0||R!==void 0){let w=z??1,s=R??0;u.setAttribute("transform",`translate(${m} ${y}) rotate(${s}) scale(${w}) translate(${-m} ${-y})`);}else u.removeAttribute("transform");o.ports&&u.querySelectorAll('[data-viz-role="port"]').forEach(s=>{let v=s.getAttribute("data-port"),A=o.ports.find(_=>_.id===v);A&&(s.setAttribute("cx",String(m+A.offset.x)),s.setAttribute("cy",String(y+A.offset.y)));});}let n=e.edgePathResolver;for(let o of r.edges){let u=e.edgeGroupsById.get(o.id),g=e.edgeLinesById.get(o.id);if(!u||!g)continue;let m=o.from?t.get(o.from)??null:null,y=o.to?t.get(o.to)??null:null;if(o.from&&!m||o.to&&!y||!m&&!o.fromAt&&!y&&!o.toAt)continue;let h;if(m&&y&&m===y)h=chunkM3ZDZ24B_js.g(m,o);else {let b=chunkM3ZDZ24B_js.e(m,y,o);h=chunkM3ZDZ24B_js.f(b.start,b.end,o.routing,o.waypoints);}if(n){let b=z=>{let R=z.from?t.get(z.from)??null:null,w=z.to?t.get(z.to)??null:null;if(z.from&&!R||z.to&&!w||!R&&!z.fromAt&&!w&&!z.toAt)return "";if(R&&w&&R===w)return chunkM3ZDZ24B_js.g(R,z).d;let s=chunkM3ZDZ24B_js.e(R,w,z);return chunkM3ZDZ24B_js.f(s.start,s.end,z.routing,z.waypoints).d};try{let z=n(o,r,b);typeof z=="string"&&z&&(h.d=z);}catch(z){console.warn(`RuntimePatcher: edge path resolver threw for edge ${o.id}`,z);}}if(g.setAttribute("d",h.d),o.style?.stroke!==void 0&&(g.style.stroke=o.style.stroke),o.style?.strokeWidth!==void 0&&(g.style.strokeWidth=String(o.style.strokeWidth)),o.style?.fill!==void 0&&(g.style.fill=o.style.fill),o.style?.opacity!==void 0&&(g.style.opacity=String(o.style.opacity)),o.style?.strokeDasharray!==void 0&&(g.style.strokeDasharray=$e(o.style.strokeDasharray)),o.markerEnd&&o.markerEnd!=="none"){let b=o.style?.stroke?jt(e.svg,o.style.stroke,o.markerEnd,"end"):ht(o.markerEnd,void 0,"end");g.setAttribute("marker-end",`url(#${b})`);}else g.removeAttribute("marker-end");if(o.markerStart&&o.markerStart!=="none"){let b=o.style?.stroke?jt(e.svg,o.style.stroke,o.markerStart,"start"):ht(o.markerStart,void 0,"start");g.setAttribute("marker-start",`url(#${b})`);}else g.removeAttribute("marker-start");let f=e.edgeHitsById.get(o.id);f&&f.setAttribute("d",h.d);let E=e.edgeLabelsById.get(o.id);if(E){let b=De(o);E.forEach((z,R)=>{let w=b[R];if(!w)return;let s=Ge(w,h);z.setAttribute("x",String(s.x)),z.setAttribute("y",String(s.y));let v=z.querySelectorAll('tspan[data-viz-role="text-line"]');for(let A=0;A<v.length;A++)v[A]?.setAttribute("x",String(s.x));});}if(o.runtime?.opacity!==void 0?u.style.opacity=String(o.runtime.opacity):u.style.removeProperty("opacity"),o.runtime?.strokeDashoffset!==void 0?(g.style.strokeDashoffset=String(o.runtime.strokeDashoffset),g.setAttribute("stroke-dashoffset",String(o.runtime.strokeDashoffset))):(g.style.removeProperty("stroke-dashoffset"),g.removeAttribute("stroke-dashoffset")),o.style?.sketch||r.sketch?.enabled){let b=0;for(let w=0;w<o.id.length;w++)b=Math.imul(31,b)+o.id.charCodeAt(w)|0;let z=Math.abs(b),R=Ft(e.svg,z);g.setAttribute("filter",`url(#${R})`),u.classList.contains("viz-sketch")||u.classList.add("viz-sketch");}else {let b=g.getAttribute("filter");b&&b.startsWith("url(#viz-sketch-")&&g.removeAttribute("filter"),u.classList.contains("viz-sketch")&&u.classList.remove("viz-sketch");}}let a=[],d=new Map;for(let o of r.nodes)if(o.parentId){let u=d.get(o.parentId);u||(u=[],d.set(o.parentId,u)),u.push(o);}else a.push(o);a.sort((o,u)=>(o.zIndex||0)-(u.zIndex||0));let c=e.svg.querySelector('[data-viz-layer="nodes"]')||e.svg.querySelector(".viz-layer-nodes");if(c){let o=c.firstElementChild;for(let u of a){let g=e.nodeGroupsById.get(u.id);g&&(o!==g?c.insertBefore(g,o):o=o.nextElementSibling);}}for(let[o,u]of d.entries()){u.sort((y,h)=>(y.zIndex||0)-(h.zIndex||0));let g=e.nodeGroupsById.get(o);if(!g)continue;let m=g.querySelector(':scope > [data-viz-role="container-children"]');if(m){let y=m.firstElementChild;for(let h of u){let f=e.nodeGroupsById.get(h.id);f&&(y!==f?m.insertBefore(f,y):y=y.nextElementSibling);}}}}function yt(r,e,t=12){let i=r.split(`
|
package/dist/index.mjs
CHANGED
|
@@ -103,11 +103,11 @@ import {d as d$1,b,f as f$1,a as a$1}from'./chunk-LQJHDSRP.mjs';export{c as Anim
|
|
|
103
103
|
stroke-linejoin: round;
|
|
104
104
|
stroke-width: 2;
|
|
105
105
|
}
|
|
106
|
-
`;var dt=class{nodeAnims=new Map;edgeAnims=new Map;constructor(){}registerNode(e,t){return this.nodeAnims.set(e,t),this}registerEdge(e,t){return this.edgeAnims.set(e,t),this}getNodeRenderer(e){return this.nodeAnims.get(e)}getEdgeRenderer(e){return this.edgeAnims.get(e)}},nr={getClass:()=>"viz-anim-flow",getStyle:({spec:r})=>({"--viz-anim-duration":r.params?.duration??"2s"})},Te=new dt().registerEdge("flow",nr);function xi(r,e){let t=r.edges.find(n=>n.id===e);if(!t)return null;let i=new Map(r.nodes.map(n=>[n.id,n]));return ct(t,i)}function ct(r,e$1){let t=r.from?e$1.get(r.from)??null:null,i=r.to?e$1.get(r.to)??null:null;if(r.from&&!t||r.to&&!i||!t&&!r.fromAt&&!i&&!r.toAt)return null;let n=!!(t&&i&&t===i),a,d,c;if(n){let o=g(t,r);a=o,d=o.exitPoint,c=o.entryPoint;}else {let o=e(t,i,r);a=f(o.start,o.end,r.routing,r.waypoints),d=o.start,c=o.end;}return {...a,startAnchor:d,endAnchor:c,startLabel:a.start,endLabel:a.end,waypoints:r.waypoints??[],isSelfLoop:n}}var or=/[MLQC]|-?(?:\d*\.\d+|\d+)(?:e[-+]?\d+)?/gi,_t=24;function Dt(r,e,t){let i=ct(r,e);return i?sr(i.d,t):null}function sr(r,e){let t=ar(r);if(t.length===0)return null;let i=t.filter(o=>o.type!=="M").map(o=>dr(o));if(i.length===0)return t.find(u=>u.type==="M")?.to??null;let n=i.reduce((o,u)=>o+u.length,0);if(n===0)return i[0]?.samples[0]?.point??null;let a=lr(e),d=n*a,c=0;for(let o of i){if(c+o.length>=d)return cr(o,d-c);c+=o.length;}return i[i.length-1]?.samples.at(-1)?.point??null}function lr(r){return !Number.isFinite(r)||r<=0?0:r>=1?1:r}function ar(r){let e=r.match(or);if(!e||e.length===0)return [];let t=[],i=null,n=0;for(;n<e.length;){let a=e[n++];if(!a)return [];switch(a){case "M":{let d=Ne(e,n);if(!d)return [];n+=2,i=d,t.push({type:"M",to:d});break}case "L":{if(!i)return [];let d=Ne(e,n);if(!d)return [];n+=2,t.push({type:"L",from:i,to:d}),i=d;break}case "Q":{if(!i)return [];let d=Ne(e,n),c=Ne(e,n+2);if(!d||!c)return [];n+=4,t.push({type:"Q",from:i,control:d,to:c}),i=c;break}case "C":{if(!i)return [];let d=Ne(e,n),c=Ne(e,n+2),o=Ne(e,n+4);if(!d||!c||!o)return [];n+=6,t.push({type:"C",from:i,control1:d,control2:c,to:o}),i=o;break}default:return []}}return t}function Ne(r,e){let t=Number(r[e]),i=Number(r[e+1]);return !Number.isFinite(t)||!Number.isFinite(i)?null:{x:t,y:i}}function dr(r){switch(r.type){case "L":return Mt([r.from,r.to]);case "Q":return Gt(_t,e=>ur(r.from,r.control,r.to,e));case "C":return Gt(_t,e=>gr(r.from,r.control1,r.control2,r.to,e))}}function Gt(r,e){let t=[];for(let i=0;i<=r;i++)t.push(e(i/r));return Mt(t)}function Mt(r){if(r.length===0)return {length:0,samples:[]};let e=[{distance:0,point:r[0]}],t=0;for(let i=1;i<r.length;i++)t+=mr(r[i-1],r[i]),e.push({distance:t,point:r[i]});return {length:t,samples:e}}function cr(r,e){let t=r.samples[0],i=r.samples.at(-1);if(!t)return {x:0,y:0};if(!i||e<=0)return t.point;if(e>=r.length)return i.point;for(let n=1;n<r.samples.length;n++){let a=r.samples[n-1],d=r.samples[n];if(d.distance>=e){let c=d.distance-a.distance,o=c===0?0:(e-a.distance)/c;return fr(a.point,d.point,o)}}return i.point}function ur(r,e,t,i){let n=1-i;return {x:n*n*r.x+2*n*i*e.x+i*i*t.x,y:n*n*r.y+2*n*i*e.y+i*i*t.y}}function gr(r,e,t,i,n){let a=1-n;return {x:a*a*a*r.x+3*a*a*n*e.x+3*a*n*n*t.x+n*n*n*i.x,y:a*a*a*r.y+3*a*a*n*e.y+3*a*n*n*t.y+n*n*n*i.y}}function mr(r,e){let t=e.x-r.x,i=e.y-r.y;return Math.sqrt(t*t+i*i)}function fr(r,e,t){return {x:r.x+(e.x-r.x)*t,y:r.y+(e.y-r.y)*t}}var ut=class{overlays=new Map;register(e,t){return this.overlays.set(e,t),this}get(e){return this.overlays.get(e)}};function hr(r,e,t){if(r.edgeId)return e.get(r.edgeId)??null;if(!r.followEdge)return null;let i=t.edges.filter(n=>n.from===r.from&&n.to===r.to);return i.length===1?i[0]:null}function pr(r){return Array.isArray(r.chain)}function yr(r){if(pr(r)){let e=r.chain.at(-1);if(!e)return null;let t=Number.isNaN(r.progress)?0:r.progress;if(t>=r.chain.length)return {hop:e,progress:1,parkedNodeId:r.parkAt??e.to,fallbackParkedNodeId:e.to,shouldPark:true};let i=!Number.isFinite(t)||t<=0?0:t,n=Math.min(Math.floor(i),r.chain.length-1),a=r.chain[n];return a?{hop:a,progress:i-n,parkedNodeId:r.parkAt??e.to,fallbackParkedNodeId:e.to,shouldPark:false}:null}return {hop:{from:r.from,to:r.to,followEdge:r.followEdge,edgeId:r.edgeId},progress:r.progress,parkedNodeId:r.parkAt??r.to,fallbackParkedNodeId:r.to,shouldPark:Number.isFinite(r.progress)&&r.progress>=1&&(r.resting===true||r.parkAt!==void 0)}}function br(r,e,t,i){let n=i.get(r)??i.get(e);if(!n)return null;let a=d(n);return {x:a.x+(t.parkOffsetX??0),y:a.y+(t.parkOffsetY??0)}}function vr(r,e,t,i){let n=yr(r);if(!n)return null;if(n.shouldPark)return br(n.parkedNodeId,n.fallbackParkedNodeId,r,e);let a=e.get(n.hop.from),d$1=e.get(n.hop.to);if(!a||!d$1)return null;let c=hr(n.hop,t,i);if(c){let g=Dt(c,e,n.progress);if(g)return g}let o=d(a),u=d(d$1);return {x:o.x+(u.x-o.x)*n.progress,y:o.y+(u.y-o.y)*n.progress}}var xr={render:({spec:r,nodesById:e,edgesById:t,scene:i})=>{let n=vr(r.params,e,t,i);if(!n)return "";let a=Math.abs(r.params.magnitude??1);a>1&&(a=1);let d=2+a*4,c=r.className??"viz-signal";return `
|
|
106
|
+
`;var dt=class{nodeAnims=new Map;edgeAnims=new Map;constructor(){}registerNode(e,t){return this.nodeAnims.set(e,t),this}registerEdge(e,t){return this.edgeAnims.set(e,t),this}getNodeRenderer(e){return this.nodeAnims.get(e)}getEdgeRenderer(e){return this.edgeAnims.get(e)}},nr={getClass:()=>"viz-anim-flow",getStyle:({spec:r})=>({"--viz-anim-duration":r.params?.duration??"2s"})},Te=new dt().registerEdge("flow",nr);function xi(r,e){let t=r.edges.find(n=>n.id===e);if(!t)return null;let i=new Map(r.nodes.map(n=>[n.id,n]));return ct(t,i)}function ct(r,e$1){let t=r.from?e$1.get(r.from)??null:null,i=r.to?e$1.get(r.to)??null:null;if(r.from&&!t||r.to&&!i||!t&&!r.fromAt&&!i&&!r.toAt)return null;let n=!!(t&&i&&t===i),a,d,c;if(n){let o=g(t,r);a=o,d=o.exitPoint,c=o.entryPoint;}else {let o=e(t,i,r);a=f(o.start,o.end,r.routing,r.waypoints),d=o.start,c=o.end;}return {...a,startAnchor:d,endAnchor:c,startLabel:a.start,endLabel:a.end,waypoints:r.waypoints??[],isSelfLoop:n}}var or=/[MLQC]|-?(?:\d*\.\d+|\d+)(?:e[-+]?\d+)?/gi,_t=24;function Dt(r,e,t){let i=ct(r,e);return i?sr(i.d,t):null}function sr(r,e){let t=ar(r);if(t.length===0)return null;let i=t.filter(o=>o.type!=="M").map(o=>dr(o));if(i.length===0)return t.find(u=>u.type==="M")?.to??null;let n=i.reduce((o,u)=>o+u.length,0);if(n===0)return i[0]?.samples[0]?.point??null;let a=lr(e),d=n*a,c=0;for(let o of i){if(c+o.length>=d)return cr(o,d-c);c+=o.length;}return i[i.length-1]?.samples.at(-1)?.point??null}function lr(r){return !Number.isFinite(r)||r<=0?0:r>=1?1:r}function ar(r){let e=r.match(or);if(!e||e.length===0)return [];let t=[],i=null,n=0;for(;n<e.length;){let a=e[n++];if(!a)return [];switch(a){case "M":{let d=Ne(e,n);if(!d)return [];n+=2,i=d,t.push({type:"M",to:d});break}case "L":{if(!i)return [];let d=Ne(e,n);if(!d)return [];n+=2,t.push({type:"L",from:i,to:d}),i=d;break}case "Q":{if(!i)return [];let d=Ne(e,n),c=Ne(e,n+2);if(!d||!c)return [];n+=4,t.push({type:"Q",from:i,control:d,to:c}),i=c;break}case "C":{if(!i)return [];let d=Ne(e,n),c=Ne(e,n+2),o=Ne(e,n+4);if(!d||!c||!o)return [];n+=6,t.push({type:"C",from:i,control1:d,control2:c,to:o}),i=o;break}default:return []}}return t}function Ne(r,e){let t=Number(r[e]),i=Number(r[e+1]);return !Number.isFinite(t)||!Number.isFinite(i)?null:{x:t,y:i}}function dr(r){switch(r.type){case "L":return Mt([r.from,r.to]);case "Q":return Gt(_t,e=>ur(r.from,r.control,r.to,e));case "C":return Gt(_t,e=>gr(r.from,r.control1,r.control2,r.to,e))}}function Gt(r,e){let t=[];for(let i=0;i<=r;i++)t.push(e(i/r));return Mt(t)}function Mt(r){if(r.length===0)return {length:0,samples:[]};let e=[{distance:0,point:r[0]}],t=0;for(let i=1;i<r.length;i++)t+=mr(r[i-1],r[i]),e.push({distance:t,point:r[i]});return {length:t,samples:e}}function cr(r,e){let t=r.samples[0],i=r.samples.at(-1);if(!t)return {x:0,y:0};if(!i||e<=0)return t.point;if(e>=r.length)return i.point;for(let n=1;n<r.samples.length;n++){let a=r.samples[n-1],d=r.samples[n];if(d.distance>=e){let c=d.distance-a.distance,o=c===0?0:(e-a.distance)/c;return fr(a.point,d.point,o)}}return i.point}function ur(r,e,t,i){let n=1-i;return {x:n*n*r.x+2*n*i*e.x+i*i*t.x,y:n*n*r.y+2*n*i*e.y+i*i*t.y}}function gr(r,e,t,i,n){let a=1-n;return {x:a*a*a*r.x+3*a*a*n*e.x+3*a*n*n*t.x+n*n*n*i.x,y:a*a*a*r.y+3*a*a*n*e.y+3*a*n*n*t.y+n*n*n*i.y}}function mr(r,e){let t=e.x-r.x,i=e.y-r.y;return Math.sqrt(t*t+i*i)}function fr(r,e,t){return {x:r.x+(e.x-r.x)*t,y:r.y+(e.y-r.y)*t}}var ut=class{overlays=new Map;register(e,t){return this.overlays.set(e,t),this}get(e){return this.overlays.get(e)}};function hr(r,e,t){if(r.edgeId)return e.get(r.edgeId)??null;if(!r.followEdge)return null;let i=t.edges.filter(n=>n.from===r.from&&n.to===r.to);return i.length===1?i[0]:null}function pr(r){return Array.isArray(r.chain)}function yr(r){if(pr(r)){let e=r.chain.at(-1);if(!e)return null;let t=Number.isNaN(r.progress)?0:r.progress;if(t>=r.chain.length)return {hop:e,progress:1,parkedNodeId:r.parkAt??e.to,fallbackParkedNodeId:e.to,shouldPark:true};let i=!Number.isFinite(t)||t<=0?0:t,n=Math.min(Math.floor(i),r.chain.length-1),a=r.chain[n];return a?{hop:a,progress:i-n,parkedNodeId:r.parkAt??e.to,fallbackParkedNodeId:e.to,shouldPark:false}:null}return {hop:{from:r.from,to:r.to,followEdge:r.followEdge,edgeId:r.edgeId},progress:r.progress,parkedNodeId:r.parkAt??r.to,fallbackParkedNodeId:r.to,shouldPark:Number.isFinite(r.progress)&&r.progress>=1&&(r.resting===true||r.parkAt!==void 0)}}function br(r,e,t,i){let n=i.get(r)??i.get(e);if(!n)return null;let a=d(n);return {x:a.x+(t.parkOffsetX??0),y:a.y+(t.parkOffsetY??0)}}function vr(r,e,t,i){let n=yr(r);if(!n)return null;if(n.shouldPark)return br(n.parkedNodeId,n.fallbackParkedNodeId,r,e);let a=e.get(n.hop.from),d$1=e.get(n.hop.to);if(!a||!d$1)return null;let c=hr(n.hop,t,i);if(c){let g=Dt(c,e,n.progress);if(g)return g}let o=d(a),u=d(d$1);return {x:o.x+(u.x-o.x)*n.progress,y:o.y+(u.y-o.y)*n.progress}}var xr={render:({spec:r,nodesById:e,edgesById:t,scene:i})=>{let n=vr(r.params,e,t,i);if(!n)return "";let a=Math.abs(r.params.magnitude??1);a>1&&(a=1);let d=2+a*4,c=r.className??"viz-signal",o=r.params.color,u=r.params.glowColor??o,g=o?` style="fill: ${o}"`:"",m=u?` filter="drop-shadow(0 0 3px ${u})"`:"";return `
|
|
107
107
|
<g transform="translate(${n.x}, ${n.y})">
|
|
108
|
-
<g class="${c}">
|
|
108
|
+
<g class="${c}"${g}>
|
|
109
109
|
<circle r="10" fill="transparent" stroke="none" />
|
|
110
|
-
<circle r="${d}" class="viz-signal-shape" />
|
|
110
|
+
<circle r="${d}" class="viz-signal-shape"${m} />
|
|
111
111
|
</g>
|
|
112
112
|
</g>
|
|
113
113
|
`}},Sr={render:({spec:r,scene:e})=>{let t=e.grid;if(!t)return "";let{w:i,h:n}=e.viewBox,{colLabels:a,rowLabels:d,yOffset:c=20,xOffset:o=20}=r.params,u=(i-t.padding.x*2)/t.cols,g=(n-t.padding.y*2)/t.rows,m="";return a&&Object.entries(a).forEach(([y,h])=>{let f=parseInt(y,10),E=t.padding.x+f*u+u/2,B=r.className||"viz-grid-label";m+=`<text x="${E}" y="${c}" class="${B}" text-anchor="middle">${h}</text>`;}),d&&Object.entries(d).forEach(([y,h])=>{let f=parseInt(y,10),E=t.padding.y+f*g+g/2,B=r.className||"viz-grid-label";m+=`<text x="${o}" y="${E}" dy=".35em" class="${B}" text-anchor="middle">${h}</text>`;}),m}},Ar={render:({spec:r,nodesById:e})=>{let{points:t}=r.params,i="";return t.forEach(n=>{let a=e.get(n.currentNodeId);if(!a)return;let d=parseInt(n.id.split("-")[1]||"0",10),c=(d%5-2)*10,o=(d%3-1)*10,u=a.pos.x+c,g=a.pos.y+o,m=r.className??"viz-data-point";i+=`<circle data-id="${n.id}" cx="${u}" cy="${g}" r="6" class="${m}" />`;}),i},update:({spec:r,nodesById:e},t)=>{let{points:i}=r.params,n="http://www.w3.org/2000/svg",a=new Map;Array.from(t.children).forEach(c=>{if(c.tagName==="circle"){let o=c.getAttribute("data-id");o&&a.set(o,c);}});let d=new Set;i.forEach(c=>{let o=e.get(c.currentNodeId);if(!o)return;d.add(c.id);let u=parseInt(c.id.split("-")[1]||"0",10),g=(u%5-2)*10,m=(u%3-1)*10,y=o.pos.x+g,h=o.pos.y+m,f=a.get(c.id);f||(f=document.createElementNS(n,"circle"),f.setAttribute("data-id",c.id),f.setAttribute("r","6"),t.appendChild(f)),f.setAttribute("cx",String(y)),f.setAttribute("cy",String(h));let E=r.className??"viz-data-point";f.getAttribute("class")!==E&&f.setAttribute("class",E);}),a.forEach((c,o)=>{d.has(o)||c.remove();});}},kr={render:({spec:r,nodesById:e})=>{let t=Wt(r.params,e);if(!t)return "";let{w:i,h:n,rx:a,ry:d,opacity:c,fill:o,stroke:u,strokeWidth:g}=r.params,m=r.className??"viz-overlay-rect",y=a!==void 0?` rx="${a}"`:"",h=d!==void 0?` ry="${d}"`:"",f=c!==void 0?` opacity="${c}"`:"",E=o===void 0,B=u===void 0,b=o??"#3b82f6",z=u??"#3b82f6",R=g??3,w=E?' fill-opacity="0.12"':"",s=B?' stroke-opacity="0.9"':"";return `<rect x="${t.x}" y="${t.y}" width="${i}" height="${n}" fill="${b}"${w} stroke="${z}"${s} stroke-width="${R}"${y}${h}${f} class="${m}" />`},update:({spec:r,nodesById:e},t)=>{let i="http://www.w3.org/2000/svg",n=Wt(r.params,e),{w:a,h:d,rx:c,ry:o,opacity:u,fill:g,stroke:m,strokeWidth:y}=r.params,h=r.className??"viz-overlay-rect",f=t.querySelector("rect");if(!n){f?.remove();return}f||(f=document.createElementNS(i,"rect"),t.appendChild(f)),f.setAttribute("x",String(n.x)),f.setAttribute("y",String(n.y)),f.setAttribute("width",String(a)),f.setAttribute("height",String(d)),g===void 0?(f.setAttribute("fill","#3b82f6"),f.setAttribute("fill-opacity","0.12")):(f.setAttribute("fill",g),f.removeAttribute("fill-opacity")),m===void 0?(f.setAttribute("stroke","#3b82f6"),f.setAttribute("stroke-opacity","0.9")):(f.setAttribute("stroke",m),f.removeAttribute("stroke-opacity")),f.setAttribute("stroke-width",String(y??3)),c!==void 0?f.setAttribute("rx",String(c)):f.removeAttribute("rx"),o!==void 0?f.setAttribute("ry",String(o)):f.removeAttribute("ry"),u!==void 0?f.setAttribute("opacity",String(u)):f.removeAttribute("opacity"),f.setAttribute("class",h);}},Er={render:({spec:r,nodesById:e})=>{let t=Xe(r.params,e);if(!t)return "";let{r:i,opacity:n,fill:a,stroke:d,strokeWidth:c}=r.params,o=r.className??"viz-overlay-circle",u=n!==void 0?` opacity="${n}"`:"",g=a===void 0,m=d===void 0,y=a??"#3b82f6",h=d??"#3b82f6",f=c??3,E=g?' fill-opacity="0.12"':"",B=m?' stroke-opacity="0.9"':"";return `<circle cx="${t.x}" cy="${t.y}" r="${i}" fill="${y}"${E} stroke="${h}"${B} stroke-width="${f}"${u} class="${o}" />`},update:({spec:r,nodesById:e},t)=>{let i="http://www.w3.org/2000/svg",n=Xe(r.params,e),{r:a,opacity:d,fill:c,stroke:o,strokeWidth:u}=r.params,g=r.className??"viz-overlay-circle",m=t.querySelector("circle");if(!n){m?.remove();return}m||(m=document.createElementNS(i,"circle"),t.appendChild(m)),m.setAttribute("cx",String(n.x)),m.setAttribute("cy",String(n.y)),m.setAttribute("r",String(a)),c===void 0?(m.setAttribute("fill","#3b82f6"),m.setAttribute("fill-opacity","0.12")):(m.setAttribute("fill",c),m.removeAttribute("fill-opacity")),o===void 0?(m.setAttribute("stroke","#3b82f6"),m.setAttribute("stroke-opacity","0.9")):(m.setAttribute("stroke",o),m.removeAttribute("stroke-opacity")),m.setAttribute("stroke-width",String(u??3)),d!==void 0?m.setAttribute("opacity",String(d)):m.removeAttribute("opacity"),m.setAttribute("class",g);}},zr={render:({spec:r,nodesById:e})=>{let t=Xe(r.params,e);if(!t)return "";let{text:i,opacity:n,fill:a,fontSize:d,fontWeight:c,textAnchor:o,dominantBaseline:u}=r.params,g=r.className??"viz-overlay-text",m=n!==void 0?` opacity="${n}"`:"",y=d!==void 0?` font-size="${d}"`:"",h=c!==void 0?` font-weight="${c}"`:"",f=o!==void 0?` text-anchor="${o}"`:"",E=u!==void 0?` dominant-baseline="${u}"`:"",B=a??"#111";return `<text x="${t.x}" y="${t.y}" fill="${B}"${m}${y}${h}${f}${E} class="${g}">${i}</text>`},update:({spec:r,nodesById:e},t)=>{let i="http://www.w3.org/2000/svg",n=Xe(r.params,e),{text:a,opacity:d,fill:c,fontSize:o,fontWeight:u,textAnchor:g,dominantBaseline:m}=r.params,y=r.className??"viz-overlay-text",h=t.querySelector("text");if(!n){h?.remove();return}h||(h=document.createElementNS(i,"text"),t.appendChild(h)),h.setAttribute("x",String(n.x)),h.setAttribute("y",String(n.y)),h.setAttribute("fill",c??"#111"),d!==void 0?h.setAttribute("opacity",String(d)):h.removeAttribute("opacity"),o!==void 0?h.setAttribute("font-size",String(o)):h.removeAttribute("font-size"),u!==void 0?h.setAttribute("font-weight",String(u)):h.removeAttribute("font-weight"),g!==void 0?h.setAttribute("text-anchor",g):h.removeAttribute("text-anchor"),m!==void 0?h.setAttribute("dominant-baseline",m):h.removeAttribute("dominant-baseline"),h.setAttribute("class",y),h.textContent=a;}};function It(r){let e=r.x??0,t=r.y??0,i=r.scale??1,n=r.rotation??0,a=[`translate(${e}, ${t})`];return n&&a.push(`rotate(${n})`),i!==1&&a.push(`scale(${i})`),a.join(" ")}function Ht(r){return r<0?0:r>1?1:r}function gt(r){return typeof r.nodeId=="string"&&r.nodeId.length>0}function mt(r,e){let t=e.get(r.nodeId);if(!t)return null;let i=d(t);return {x:i.x+(r.offsetX??0),y:i.y+(r.offsetY??0)}}function Xe(r,e){return gt(r)?mt(r,e):{x:r.x,y:r.y}}function Wt(r,e){if(gt(r)){let t=mt(r,e);return t?{x:t.x-r.w/2,y:t.y-r.h/2}:null}return {x:r.x,y:r.y}}function qt(r,e){let t=r.x??0,i=r.y??0,n=t,a=i;if(r.from&&r.to){let g=e.get(r.from),m=e.get(r.to);if(g&&m){let y=Ht(r.progress??0),h=d(g),f=d(m);n=h.x+(f.x-h.x)*y+t,a=h.y+(f.y-h.y)*y+i;}}else if(gt(r)){let g=mt(r,e);if(!g)return null;n=g.x+t,a=g.y+i;}let d$1=r.scale??1,c=r.magnitude,o=c===void 0?1:.85+.3*Ht(Math.abs(c)),u=d$1*o;return {x:n,y:a,scale:u,rotation:r.rotation??0}}var wr={render:({spec:r,nodesById:e,edgesById:t,scene:i,registry:n})=>{let{children:a,opacity:d}=r.params,c=qt(r.params,e);if(!c)return "";let o=It(c),u=d!==void 0?` opacity="${d}"`:"",g=n;if(!g)return `<g transform="${o}"${u}></g>`;let m=`<g transform="${o}"${u}>`;return a.forEach((y,h)=>{let f=g.get(y.id);if(!f)return;let E={spec:y,nodesById:e,edgesById:t,scene:i,registry:g},B=y.key?`key:${y.key}`:`idx:${h}:${y.id}`;m+=`<g data-viz-role="overlay-child" data-overlay-child-id="${B}">`,m+=f.render(E),m+="</g>";}),m+="</g>",m},update:({spec:r,nodesById:e,edgesById:t,scene:i,registry:n},a)=>{let d=n;if(!d)return;let{children:c,opacity:o}=r.params,u=qt(r.params,e);if(!u){a.removeAttribute("transform"),a.removeAttribute("opacity"),a.innerHTML="";return}a.setAttribute("transform",It(u)),o!==void 0?a.setAttribute("opacity",String(o)):a.removeAttribute("opacity");let g="http://www.w3.org/2000/svg",m=new Map;Array.from(a.children).forEach(h=>{if(h instanceof SVGGElement){let f=h.getAttribute("data-overlay-child-id");f&&m.set(f,h);}});let y=new Set;c.forEach((h,f)=>{let E=d.get(h.id);if(!E)return;let B=h.key?`key:${h.key}`:`idx:${f}:${h.id}`;y.add(B);let b=m.get(B);b||(b=document.createElementNS(g,"g"),b.setAttribute("data-viz-role","overlay-child"),b.setAttribute("data-overlay-child-id",B),a.appendChild(b));let z={spec:h,nodesById:e,edgesById:t,scene:i,registry:d};E.update?E.update(z,b):b.innerHTML=E.render(z);}),m.forEach((h,f)=>{y.has(f)||h.remove();});}},Ve=new ut().register("signal",xr).register("grid-labels",Sr).register("data-points",Ar).register("rect",kr).register("circle",Er).register("text",zr).register("group",wr);var _e=class r{specs=[];keyCounters=new Map;add(e,t,i){let n=i?.className,a=i?.key;if(!a&&this.specs.some(c=>c.id===e&&(c.key===void 0||c.key===""))){let c=(this.keyCounters.get(e)??0)+1;this.keyCounters.set(e,c),a=`${e}#${c}`;}return this.specs.push({id:e,params:t,key:a,className:n}),this}remove(e){for(let t=this.specs.length-1;t>=0;t--){let i=this.specs[t];if(!i)continue;let n=i.key===e,a=!i.key&&i.id===e;(n||a)&&this.specs.splice(t,1);}return this}clear(){return this.specs.length=0,this.keyCounters.clear(),this}build(){return [...this.specs]}rect(e,t){return this.add("rect",e,t)}circle(e,t){return this.add("circle",e,t)}text(e,t){return this.add("text",e,t)}group(e,t,i){let n=new r;t(n);let a=n.build();return this.add("group",{...e,children:a},i)}};function Bi(r){let e=new _e;return r(e),e.build()}var Br={solid:"",dashed:"8, 4",dotted:"2, 4","dash-dot":"8, 4, 2, 4"};function $e(r){return !r||r==="solid"?"":Br[r]??r}function Ge(r,e){let t=r.position==="start"?e.start:r.position==="end"?e.end:e.mid;return {x:t.x+(r.dx||0),y:t.y+(r.dy||0)}}function De(r){return r.labels&&r.labels.length>0?r.labels:r.label?[r.label]:[]}var Q="http://www.w3.org/2000/svg",Qe={dx:2,dy:2,blur:4,color:"rgba(0,0,0,0.2)"};function Cr(r){return {dx:r.dx??Qe.dx,dy:r.dy??Qe.dy,blur:r.blur??Qe.blur,color:r.color??Qe.color}}function Nr(r){let e=r.color.replace(/[^a-zA-Z0-9]/g,"_");return `viz-shadow-${r.dx}-${r.dy}-${r.blur}-${e}`}function Vr(r,e){let t=Cr(e),i=Nr(t);if(!r.querySelector(`#${CSS.escape(i)}`)){let n=r.querySelector("defs");if(n){let a=document.createElementNS(Q,"filter");a.setAttribute("id",i),a.setAttribute("x","-50%"),a.setAttribute("y","-50%"),a.setAttribute("width","200%"),a.setAttribute("height","200%");let d=document.createElementNS(Q,"feDropShadow");d.setAttribute("dx",String(t.dx)),d.setAttribute("dy",String(t.dy)),d.setAttribute("stdDeviation",String(t.blur)),d.setAttribute("flood-color",t.color),d.setAttribute("flood-opacity","1"),a.appendChild(d),n.appendChild(a);}}return i}function $r(r){return `viz-sketch-${r}`}function Pr(r,e){let t=(r^e*2654435761)>>>0|1;return t^=t<<13,t^=t>>>17,t^=t<<5,(t>>>0)/4294967296}function Me(r,e,t,i){return t+Pr(r,e)*(i-t)}function Ft(r,e){let t=$r(e);if(!r.querySelector(`#${CSS.escape(t)}`)){let i=r.querySelector("defs");if(i){let n=document.createElementNS(Q,"filter");n.setAttribute("id",t),n.setAttribute("filterUnits","userSpaceOnUse"),n.setAttribute("x","-10000"),n.setAttribute("y","-10000"),n.setAttribute("width","20000"),n.setAttribute("height","20000");let a=e+37,d=Me(e,1,.009,.015).toFixed(4),c=Me(e,2,2.5,4).toFixed(1),o=Me(e,3,3,5).toFixed(1),u=Me(e,4,.3,1.6).toFixed(2),g=Me(e,5,.2,1.3).toFixed(2),m=document.createElementNS(Q,"feTurbulence");m.setAttribute("type","fractalNoise"),m.setAttribute("baseFrequency","0.008"),m.setAttribute("numOctaves","2"),m.setAttribute("seed",String(e)),m.setAttribute("result","n1"),n.appendChild(m);let y=document.createElementNS(Q,"feTurbulence");y.setAttribute("type","fractalNoise"),y.setAttribute("baseFrequency",d),y.setAttribute("numOctaves","2"),y.setAttribute("seed",String(a)),y.setAttribute("result","n2"),n.appendChild(y);let h=document.createElementNS(Q,"feDisplacementMap");h.setAttribute("in","SourceGraphic"),h.setAttribute("in2","n1"),h.setAttribute("scale",c),h.setAttribute("xChannelSelector","R"),h.setAttribute("yChannelSelector","G"),h.setAttribute("result","s1"),n.appendChild(h);let f=document.createElementNS(Q,"feDisplacementMap");f.setAttribute("in","SourceGraphic"),f.setAttribute("in2","n2"),f.setAttribute("scale",o),f.setAttribute("xChannelSelector","G"),f.setAttribute("yChannelSelector","R"),f.setAttribute("result","s2"),n.appendChild(f);let E=document.createElementNS(Q,"feOffset");E.setAttribute("in","s2"),E.setAttribute("dx",u),E.setAttribute("dy",g),E.setAttribute("result","s2off"),n.appendChild(E);let B=document.createElementNS(Q,"feComposite");B.setAttribute("in","s1"),B.setAttribute("in2","s2off"),B.setAttribute("operator","over"),n.appendChild(B),i.appendChild(n);}}return t}function Or(r,e){if(r?.sketchSeed!==void 0)return r.sketchSeed;let t=0;for(let i=0;i<e.length;i++)t=Math.imul(31,t)+e.charCodeAt(i)|0;return Math.abs(t)}function Lr(r){return r.replace(/[^a-zA-Z0-9]/g,"_")}function ht(r,e,t="end"){if(r==="none")return "";let i=`viz-${r}`,n=t==="start"?"-start":"";return e?`${i}${n}-${Lr(e)}`:`${i}${n}`}function Rr(r,e){switch(r){case "arrow":{let t=document.createElementNS(Q,"polygon");return t.setAttribute("points","0,2 10,5 0,8"),t.setAttribute("fill",e),t}case "arrowOpen":{let t=document.createElementNS(Q,"polyline");return t.setAttribute("points","0,2 10,5 0,8"),t.setAttribute("fill","white"),t.setAttribute("stroke",e),t.setAttribute("stroke-width","1.5"),t.setAttribute("stroke-linejoin","miter"),t}case "diamond":{let t=document.createElementNS(Q,"polygon");return t.setAttribute("points","0,5 5,2 10,5 5,8"),t.setAttribute("fill",e),t}case "diamondOpen":{let t=document.createElementNS(Q,"polygon");return t.setAttribute("points","0,5 5,2 10,5 5,8"),t.setAttribute("fill","white"),t.setAttribute("stroke",e),t.setAttribute("stroke-width","1.5"),t}case "circle":{let t=document.createElementNS(Q,"circle");return t.setAttribute("cx","5"),t.setAttribute("cy","5"),t.setAttribute("r","3"),t.setAttribute("fill",e),t}case "circleOpen":{let t=document.createElementNS(Q,"circle");return t.setAttribute("cx","5"),t.setAttribute("cy","5"),t.setAttribute("r","3"),t.setAttribute("fill","white"),t.setAttribute("stroke",e),t.setAttribute("stroke-width","1.5"),t}case "square":{let t=document.createElementNS(Q,"rect");return t.setAttribute("x","2"),t.setAttribute("y","2"),t.setAttribute("width","6"),t.setAttribute("height","6"),t.setAttribute("fill",e),t}case "bar":{let t=document.createElementNS(Q,"line");return t.setAttribute("x1","5"),t.setAttribute("y1","1"),t.setAttribute("x2","5"),t.setAttribute("y2","9"),t.setAttribute("stroke",e),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t}case "halfArrow":{let t=document.createElementNS(Q,"polygon");return t.setAttribute("points","0,2 10,5 0,5"),t.setAttribute("fill",e),t}default:return null}}function jt(r,e,t="arrow",i="end"){let n=ht(t,e,i);if(!n)return "";if(!r.querySelector(`#${CSS.escape(n)}`)){let a=r.querySelector("defs");if(a){let d=document.createElementNS(Q,"marker");d.setAttribute("id",n),d.setAttribute("viewBox","0 0 10 10"),d.setAttribute("markerWidth","10"),d.setAttribute("markerHeight","10"),d.setAttribute("refX","9"),d.setAttribute("refY","5"),d.setAttribute("orient",i==="start"?"auto-start-reverse":"auto");let c=Rr(t,e);c&&d.appendChild(c),a.appendChild(d);}}return n}function Ie(r,e){let t=new Map,i=new Map,n=new Map,a=new Map,d=new Map,c=new Map,o=new Map,u=new Map,g=new Map,m=new Map,y=r.querySelector('[data-viz-layer="nodes"]')||r.querySelector(".viz-layer-nodes");if(y){let f=Array.from(y.querySelectorAll("g[data-id]"));for(let E of f){let B=E.getAttribute("data-id");if(!B)continue;t.set(B,E);let b=E.querySelector('[data-viz-role="node-shape"]')||E.querySelector(".viz-node-shape");b&&i.set(B,b);let z=E.querySelector('[data-viz-role="node-label"]')||E.querySelector(".viz-node-label");z&&n.set(B,z);let R=E.querySelector('[data-viz-role="node-image"]')||E.querySelector(".viz-node-image");R&&a.set(B,R);let w=E.querySelector('[data-viz-role="node-icon"]')||E.querySelector(".viz-node-icon");w&&d.set(B,w);let s=E.querySelector('[data-viz-role="node-svg"]')||E.querySelector(".viz-node-svg");s&&c.set(B,s);}}let h=r.querySelector('[data-viz-layer="edges"]')||r.querySelector(".viz-layer-edges");if(h){let f=Array.from(h.querySelectorAll("g[data-id]"));for(let E of f){let B=E.getAttribute("data-id");if(!B)continue;o.set(B,E);let b=E.querySelector('[data-viz-role="edge-line"]')||E.querySelector(".viz-edge");b&&u.set(B,b);let z=E.querySelector('[data-viz-role="edge-hit"]')||E.querySelector(".viz-edge-hit");z&&g.set(B,z);let R=Array.from(E.querySelectorAll('[data-viz-role="edge-label"],.viz-edge-label'));R.length>0&&m.set(B,R);}}return {svg:r,edgePathResolver:e?.edgePathResolver??null,nodeGroupsById:t,nodeShapesById:i,nodeLabelsById:n,nodeImagesById:a,nodeIconsById:d,nodeSvgsById:c,edgeGroupsById:o,edgeLinesById:u,edgeHitsById:g,edgeLabelsById:m}}function Tr(r){let e=0,t=0;if(r&&typeof r=="object"){let i=r;typeof i.w=="number"?e=i.w:typeof i.r=="number"?e=i.r*2:typeof i.rx=="number"&&typeof i.ry=="number"?(e=i.rx*2,t=i.ry*2):typeof i.size=="number"?e=i.size:typeof i.outerR=="number"&&(e=i.outerR*2),typeof i.h=="number"?t=i.h:t===0&&(t=e);}return {w:e,h:t}}function ft(r,e,t,i,n,a,d){let c=d?.position??"center",o=d?.dx??0,u=d?.dy??0,g=0,m=0;switch(c){case "above":m=-i/2-a/2;break;case "below":m=i/2+a/2;break;case "left":g=-t/2-n/2;break;case "right":g=t/2+n/2;break;}return {x:r+g-n/2+o,y:e+m-a/2+u}}function pt(r,e$2){let t=new Map(r.nodes.map(o=>[o.id,o])),i=new Map;for(let o of r.nodes)if(o.container){let u=(o.runtime?.x??o.pos.x)-o.pos.x,g=(o.runtime?.y??o.pos.y)-o.pos.y;(u!==0||g!==0)&&i.set(o.id,{dx:u,dy:g});}for(let o of r.nodes){let u=e$2.nodeGroupsById.get(o.id),g=e$2.nodeShapesById.get(o.id);if(!u||!g)continue;let{x:m,y}=d(o);if(o.parentId){let w=i.get(o.parentId);w&&(m+=w.dx,y+=w.dy);}let h=e$1(o);g$1(g,h,{x:m,y});let{w:f,h:E}=Tr(h);if(f>0&&E>0){let w=e$2.nodeImagesById.get(o.id);if(w&&o.image){let A=ft(m,y,f,E,o.image.width,o.image.height,{position:o.image.position,dx:o.image.dx,dy:o.image.dy});w.setAttribute("x",String(A.x)),w.setAttribute("y",String(A.y));}let s=e$2.nodeIconsById.get(o.id);if(s&&o.icon){let A=ft(m,y,f,E,o.icon.size,o.icon.size,{position:o.icon.position,dx:o.icon.dx,dy:o.icon.dy});s.setAttribute("transform",`translate(${A.x} ${A.y})`);}let v=e$2.nodeSvgsById.get(o.id);if(v&&o.svgContent){let A=ft(m,y,f,E,o.svgContent.width,o.svgContent.height,{position:o.svgContent.position,dx:o.svgContent.dx,dy:o.svgContent.dy});v.setAttribute("transform",`translate(${A.x} ${A.y})`);}}if(o.container?.headerHeight&&"w"in h&&"h"in h){let w=u.querySelector('[data-viz-role="container-header"]');if(w){let s=h.w,v=h.h,A=y-v/2+o.container.headerHeight;w.setAttribute("x1",String(m-s/2)),w.setAttribute("y1",String(A)),w.setAttribute("x2",String(m+s/2)),w.setAttribute("y2",String(A));}}let B=e$2.nodeLabelsById.get(o.id);if(B&&o.label){let w=m+(o.label.dx||0),s=y+(o.label.dy||0);if(o.container?.headerHeight&&"h"in h&&!o.label.dy){let A=h.h;s=y-A/2+o.container.headerHeight/2,w=m+(o.label.dx||0);}B.setAttribute("x",String(w)),B.setAttribute("y",String(s));let v=B.querySelectorAll('tspan[data-viz-role="text-line"]');for(let A=0;A<v.length;A++)v[A]?.setAttribute("x",String(w));}if(o.runtime?.opacity!==void 0?(u.style.opacity=String(o.runtime.opacity),g.removeAttribute("opacity")):(u.style.removeProperty("opacity"),o.style?.opacity!==void 0?g.setAttribute("opacity",String(o.style.opacity)):g.removeAttribute("opacity")),o.style?.shadow){let w=Vr(e$2.svg,o.style.shadow);g.setAttribute("filter",`url(#${w})`);}else g.removeAttribute("filter");if(o.style?.sketch||r.sketch?.enabled){let w=Or(o.style,o.id),s=Ft(e$2.svg,w);u.setAttribute("filter",`url(#${s})`),u.classList.contains("viz-sketch")||u.classList.add("viz-sketch");}else {u.classList.contains("viz-sketch")&&u.classList.remove("viz-sketch");let w=u.getAttribute("filter");w&&w.startsWith("url(#viz-sketch-")&&u.removeAttribute("filter");}let z=o.runtime?.scale,R=o.runtime?.rotation;if(z!==void 0||R!==void 0){let w=z??1,s=R??0;u.setAttribute("transform",`translate(${m} ${y}) rotate(${s}) scale(${w}) translate(${-m} ${-y})`);}else u.removeAttribute("transform");o.ports&&u.querySelectorAll('[data-viz-role="port"]').forEach(s=>{let v=s.getAttribute("data-port"),A=o.ports.find(_=>_.id===v);A&&(s.setAttribute("cx",String(m+A.offset.x)),s.setAttribute("cy",String(y+A.offset.y)));});}let n=e$2.edgePathResolver;for(let o of r.edges){let u=e$2.edgeGroupsById.get(o.id),g$1=e$2.edgeLinesById.get(o.id);if(!u||!g$1)continue;let m=o.from?t.get(o.from)??null:null,y=o.to?t.get(o.to)??null:null;if(o.from&&!m||o.to&&!y||!m&&!o.fromAt&&!y&&!o.toAt)continue;let h;if(m&&y&&m===y)h=g(m,o);else {let b=e(m,y,o);h=f(b.start,b.end,o.routing,o.waypoints);}if(n){let b=z=>{let R=z.from?t.get(z.from)??null:null,w=z.to?t.get(z.to)??null:null;if(z.from&&!R||z.to&&!w||!R&&!z.fromAt&&!w&&!z.toAt)return "";if(R&&w&&R===w)return g(R,z).d;let s=e(R,w,z);return f(s.start,s.end,z.routing,z.waypoints).d};try{let z=n(o,r,b);typeof z=="string"&&z&&(h.d=z);}catch(z){console.warn(`RuntimePatcher: edge path resolver threw for edge ${o.id}`,z);}}if(g$1.setAttribute("d",h.d),o.style?.stroke!==void 0&&(g$1.style.stroke=o.style.stroke),o.style?.strokeWidth!==void 0&&(g$1.style.strokeWidth=String(o.style.strokeWidth)),o.style?.fill!==void 0&&(g$1.style.fill=o.style.fill),o.style?.opacity!==void 0&&(g$1.style.opacity=String(o.style.opacity)),o.style?.strokeDasharray!==void 0&&(g$1.style.strokeDasharray=$e(o.style.strokeDasharray)),o.markerEnd&&o.markerEnd!=="none"){let b=o.style?.stroke?jt(e$2.svg,o.style.stroke,o.markerEnd,"end"):ht(o.markerEnd,void 0,"end");g$1.setAttribute("marker-end",`url(#${b})`);}else g$1.removeAttribute("marker-end");if(o.markerStart&&o.markerStart!=="none"){let b=o.style?.stroke?jt(e$2.svg,o.style.stroke,o.markerStart,"start"):ht(o.markerStart,void 0,"start");g$1.setAttribute("marker-start",`url(#${b})`);}else g$1.removeAttribute("marker-start");let f$1=e$2.edgeHitsById.get(o.id);f$1&&f$1.setAttribute("d",h.d);let E=e$2.edgeLabelsById.get(o.id);if(E){let b=De(o);E.forEach((z,R)=>{let w=b[R];if(!w)return;let s=Ge(w,h);z.setAttribute("x",String(s.x)),z.setAttribute("y",String(s.y));let v=z.querySelectorAll('tspan[data-viz-role="text-line"]');for(let A=0;A<v.length;A++)v[A]?.setAttribute("x",String(s.x));});}if(o.runtime?.opacity!==void 0?u.style.opacity=String(o.runtime.opacity):u.style.removeProperty("opacity"),o.runtime?.strokeDashoffset!==void 0?(g$1.style.strokeDashoffset=String(o.runtime.strokeDashoffset),g$1.setAttribute("stroke-dashoffset",String(o.runtime.strokeDashoffset))):(g$1.style.removeProperty("stroke-dashoffset"),g$1.removeAttribute("stroke-dashoffset")),o.style?.sketch||r.sketch?.enabled){let b=0;for(let w=0;w<o.id.length;w++)b=Math.imul(31,b)+o.id.charCodeAt(w)|0;let z=Math.abs(b),R=Ft(e$2.svg,z);g$1.setAttribute("filter",`url(#${R})`),u.classList.contains("viz-sketch")||u.classList.add("viz-sketch");}else {let b=g$1.getAttribute("filter");b&&b.startsWith("url(#viz-sketch-")&&g$1.removeAttribute("filter"),u.classList.contains("viz-sketch")&&u.classList.remove("viz-sketch");}}let a=[],d$1=new Map;for(let o of r.nodes)if(o.parentId){let u=d$1.get(o.parentId);u||(u=[],d$1.set(o.parentId,u)),u.push(o);}else a.push(o);a.sort((o,u)=>(o.zIndex||0)-(u.zIndex||0));let c=e$2.svg.querySelector('[data-viz-layer="nodes"]')||e$2.svg.querySelector(".viz-layer-nodes");if(c){let o=c.firstElementChild;for(let u of a){let g=e$2.nodeGroupsById.get(u.id);g&&(o!==g?c.insertBefore(g,o):o=o.nextElementSibling);}}for(let[o,u]of d$1.entries()){u.sort((y,h)=>(y.zIndex||0)-(h.zIndex||0));let g=e$2.nodeGroupsById.get(o);if(!g)continue;let m=g.querySelector(':scope > [data-viz-role="container-children"]');if(m){let y=m.firstElementChild;for(let h of u){let f=e$2.nodeGroupsById.get(h.id);f&&(y!==f?m.insertBefore(f,y):y=y.nextElementSibling);}}}}function yt(r,e,t=12){let i=r.split(`
|
package/dist/interaction.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { H as HitResult, a as HitTestOptions, d as distanceSquare, e as edgeDistance, g as getEffectiveNodeBounds, h as hitTest, b as hitTestRect, n as nearestPort, p as pointInRect, s as setupPanZoom } from './hitTest-
|
|
2
|
-
import { V as VizNode, a as VizEdge } from './index-
|
|
1
|
+
export { H as HitResult, a as HitTestOptions, d as distanceSquare, e as edgeDistance, g as getEffectiveNodeBounds, h as hitTest, b as hitTestRect, n as nearestPort, p as pointInRect, s as setupPanZoom } from './hitTest-DtkjchpB.mjs';
|
|
2
|
+
import { V as VizNode, a as VizEdge } from './index-n9JLZMa1.mjs';
|
|
3
3
|
|
|
4
4
|
/** CSS injected into the container for tooltip styling. */
|
|
5
5
|
declare const TOOLTIP_CSS = "\n.viz-tooltip {\n position: absolute;\n pointer-events: none;\n z-index: 9999;\n max-width: 320px;\n padding: 8px 12px;\n border-radius: 6px;\n font-size: 13px;\n line-height: 1.4;\n background: var(--viz-tooltip-bg, #1a1a2e);\n color: var(--viz-tooltip-fg, #e2e8f0);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);\n opacity: 0;\n transition: opacity 0.15s ease-out;\n white-space: pre-wrap;\n word-break: break-word;\n box-sizing: border-box;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n}\n.viz-tooltip[data-visible=\"true\"] {\n opacity: 1;\n}\n.viz-tooltip-title {\n font-weight: 600;\n margin-bottom: 4px;\n font-size: 14px;\n}\n.viz-tooltip-section {\n display: flex;\n gap: 6px;\n padding: 2px 0;\n}\n.viz-tooltip-section-label {\n color: var(--viz-tooltip-label, #94a3b8);\n flex-shrink: 0;\n}\n.viz-tooltip-section-label::after {\n content: ':';\n}\n.viz-tooltip-section-value {\n color: var(--viz-tooltip-fg, #e2e8f0);\n}\n";
|
package/dist/interaction.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { H as HitResult, a as HitTestOptions, d as distanceSquare, e as edgeDistance, g as getEffectiveNodeBounds, h as hitTest, b as hitTestRect, n as nearestPort, p as pointInRect, s as setupPanZoom } from './hitTest-
|
|
2
|
-
import { V as VizNode, a as VizEdge } from './index-
|
|
1
|
+
export { H as HitResult, a as HitTestOptions, d as distanceSquare, e as edgeDistance, g as getEffectiveNodeBounds, h as hitTest, b as hitTestRect, n as nearestPort, p as pointInRect, s as setupPanZoom } from './hitTest-5nKDL0YT.js';
|
|
2
|
+
import { V as VizNode, a as VizEdge } from './index-n9JLZMa1.js';
|
|
3
3
|
|
|
4
4
|
/** CSS injected into the container for tooltip styling. */
|
|
5
5
|
declare const TOOLTIP_CSS = "\n.viz-tooltip {\n position: absolute;\n pointer-events: none;\n z-index: 9999;\n max-width: 320px;\n padding: 8px 12px;\n border-radius: 6px;\n font-size: 13px;\n line-height: 1.4;\n background: var(--viz-tooltip-bg, #1a1a2e);\n color: var(--viz-tooltip-fg, #e2e8f0);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);\n opacity: 0;\n transition: opacity 0.15s ease-out;\n white-space: pre-wrap;\n word-break: break-word;\n box-sizing: border-box;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n}\n.viz-tooltip[data-visible=\"true\"] {\n opacity: 1;\n}\n.viz-tooltip-title {\n font-weight: 600;\n margin-bottom: 4px;\n font-size: 14px;\n}\n.viz-tooltip-section {\n display: flex;\n gap: 6px;\n padding: 2px 0;\n}\n.viz-tooltip-section-label {\n color: var(--viz-tooltip-label, #94a3b8);\n flex-shrink: 0;\n}\n.viz-tooltip-section-label::after {\n content: ':';\n}\n.viz-tooltip-section-value {\n color: var(--viz-tooltip-fg, #e2e8f0);\n}\n";
|
package/dist/layout.d.mts
CHANGED
package/dist/layout.d.ts
CHANGED
package/dist/ports.d.mts
CHANGED
package/dist/ports.d.ts
CHANGED
package/dist/serialization.d.mts
CHANGED
package/dist/serialization.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vizcraft",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "A fluent, type-safe SVG scene builder for composing nodes, edges, animations, and overlays with incremental DOM updates and no framework dependency.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"visualization",
|