You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(graph): host-legend API + nodeLabelPriority encoding channel
Expose setActiveCategories/getActiveCategories on GraphInstance so
custom host legends can drive the persistent multi-select category
filter without spec recompilation. Add nodeLabelPriority encoding
channel to map a data field to label visibility priority instead of
the default degree-based heuristic.
Claude-Session: https://claude.ai/code/session_016rS7hi2g4bSzRBfnD1p2ji
| Graph seeded layout (deterministic initial positions) |`packages/vanilla/src/graph/seed.ts` → `seedNodePositions()`. Start position is a pure function of `(id, seed, community)`, so the settled layout is reproducible across data reshapes (not d3's order-dependent phyllotaxis). |
127
127
| Graph animation scheduler (rAF loop, first-frame arming) |`packages/vanilla/src/graph/scheduler.ts` → `AnimationScheduler`. Owns running `GraphAnimation`s; the mount's render loop ticks it once/frame and re-arms rAF only while animations are active (zero cost when idle). |
128
128
| Graph motion primitives (easings, reduced-motion, generic tween) |`packages/vanilla/src/graph/motion.ts` → `createTween()`, `resolveEase()`, `prefersReducedMotion()`. Canvas rAF, NOT CSS keyframes; only the easing vocabulary is shared with charts. |
129
129
| Graph entrance choreography (reveal alpha, staggered start) |`packages/vanilla/src/graph/entrance.ts`. Turns the mount's 0→1 `entranceProgress` into a per-node reveal alpha, quantized so the canvas renderer still batches fills. The camera pull-back + flight lives in `graph-mount.ts``startEntrance()`. |
130
-
| Graph camera flights (animated zoom/pan) |`packages/vanilla/src/graph/camera.ts` → `createCameraFlight()`, `CameraFlightOptions`, `clampK`, `K_MIN`/`K_MAX`. Interpolates two `ZoomTransform`s along d3 `interpolateZoom`; supports a moving-target provider so a flight tracks a still-settling node. |
130
+
| Graph camera flights (animated zoom/pan) |`packages/vanilla/src/graph/camera.ts` → `createCameraFlight()`, `createCameraFollow()`, `CameraFlightOptions`, `clampK`, `K_MIN`/`K_MAX`. Interpolates two `ZoomTransform`s along d3 `interpolateZoom`; supports a moving-target provider so a flight tracks a still-settling node. `createCameraFollow()` continuously tracks a moving target (e.g. entrance pull-back). |
131
131
| Graph focus model (highlight ∩ search + hover-neighborhood, eased crossfade) |`packages/vanilla/src/graph/focus-transition.ts` → `FocusTransition`. Composes the three emphasis sources into a snapshot pair the renderer crossfades between (composition, not strict precedence). |
132
132
| Graph update diff (unified `update()` path classification) |`packages/vanilla/src/graph/update-diff.ts` → `diffGraphUpdate()`. Classifies a change as `visualOnly` (same node+edge id sets AND equal simulationConfig → position-preserving) vs structural (reheat). Config equality: `graph/update-diff-config.ts` (compares the full resolved simulationConfig, not just `clustering.field` like the old React heuristic). |
133
133
| Graph interactive legend (accessible built-in legend) |`packages/vanilla/src/graph/legend.ts` → `GraphLegendController`. Node-category rows are `aria-pressed` buttons that toggle emphasis via the focus model; edge-category rows are non-interactive swatches. Turn off with `legend: false` (do this if you render your own). |
Copy file name to clipboardExpand all lines: packages/core/schema/vizspec.schema.json
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16938,6 +16938,10 @@
16938
16938
"nodeLabel": {
16939
16939
"$ref": "#/definitions/GraphEncodingChannel",
16940
16940
"description": "Label field for nodes."
16941
+
},
16942
+
"nodeLabelPriority": {
16943
+
"$ref": "#/definitions/GraphEncodingChannel",
16944
+
"description": "Label priority mapping for nodes. Maps a quantitative field to a 0-1 priority range; higher values are shown first as the user zooms in. Omit to use the default degree-based priority. `nodeOverrides[id].alwaysShowLabel` still wins as the hard override."
0 commit comments