@kineviz/gl 0.6.1 → 0.7.1
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 +1892 -2
- package/LICENSE +201 -0
- package/NOTICE +33 -0
- package/README.md +201 -143
- package/dist/chunk-3CR3GHJ2.mjs +2 -0
- package/dist/chunk-EDTCHJCZ.mjs +1504 -0
- package/dist/chunk-VTIPA7FV.mjs +2 -0
- package/dist/dist-BRW6S3SC.mjs +4 -0
- package/dist/index.d.mts +5011 -445
- package/dist/index.d.ts +5011 -445
- package/dist/index.js +1604 -1425
- package/dist/index.mjs +1418 -2743
- package/dist/kineviz-gl.umd.js +4243 -1976
- package/dist/layout-gpu.d.mts +1 -0
- package/dist/layout-gpu.d.ts +1 -0
- package/dist/layout-gpu.js +2328 -0
- package/dist/layout-gpu.mjs +903 -0
- package/dist/schemas.js +1 -1
- package/dist/schemas.mjs +1 -1
- package/dist/webgpu-YXDFF4ZT.mjs +2 -0
- package/package.json +32 -19
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,1892 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@kineviz/gl` are documented here.
|
|
4
4
|
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
## 0.7.1 — 2026-11-26
|
|
8
|
+
|
|
9
|
+
Maps down to street level, new layers (buildings, 3D models, effect layers,
|
|
10
|
+
video), orthogonal edges and hierarchy layouts, and fixes, most of them for
|
|
11
|
+
maps with `forceLayout`. Nothing exported by 0.7.0 was removed. Three
|
|
12
|
+
entries marked Changed alter what you see: collected nodes, badge and tag
|
|
13
|
+
placement, and the draw order of photos, videos and cards.
|
|
14
|
+
|
|
15
|
+
### Added — street level on the globe: `map.minAltitude`, the follow camera, see-through buildings
|
|
16
|
+
|
|
17
|
+
These let a view go down among the buildings and travel between them.
|
|
18
|
+
|
|
19
|
+
- **`map.minAltitude`** (and `<GlobeLayer minAltitude>`): how close the wheel
|
|
20
|
+
can bring the camera to the ground, in metres. Default 2. While the camera
|
|
21
|
+
is low, below about 6 km on the default globe, its near and far planes follow
|
|
22
|
+
the altitude, so a building a few metres away is not clipped and depth
|
|
23
|
+
stays precise. `controlConfig.zoomMax` still overrides it.
|
|
24
|
+
Tests: `src/map/geo-map/__tests__/streetCamera.test.ts`.
|
|
25
|
+
- **`followShot(points, options)`** (cinematics): a shot that rides behind a
|
|
26
|
+
route at constant speed: `distance` back, `pitch` degrees down, level
|
|
27
|
+
heading, corners eased over `smoothing`. `marks` gives a cue (with `at` and
|
|
28
|
+
`until`) at each listed point. Cue it and drive it with `director.scrub` to
|
|
29
|
+
follow a route clock. The options type is exported as `FollowShotOptions`.
|
|
30
|
+
Tests: `src/cinematics/__tests__/followShot.test.ts`.
|
|
31
|
+
- **`<BuildingsLayer cutaway>`**: `{ path, radius?, opacity? }`. Buildings
|
|
32
|
+
within `radius` metres (default 12) of the `[lat, lng]` polyline are drawn
|
|
33
|
+
as see-through ghosts (`opacity`, default 0.12) instead of solid blocks. Pass
|
|
34
|
+
the line from the camera to what it looks at, and nothing stands in the way.
|
|
35
|
+
The pure `buildingsAlong(geometry, path, radius)` returns the indices of
|
|
36
|
+
those buildings. `BuildingFootprint` is exported too.
|
|
37
|
+
- **`<BuildingsLayer floorOpacity floorColor levelsProperty>`**: a line round
|
|
38
|
+
each building at every storey, from the `levels` property (default name
|
|
39
|
+
`"levels"`, the count of OSM `building:levels`). Default `floorOpacity` 0, so
|
|
40
|
+
no lines.
|
|
41
|
+
Tests for both: `src/react/layers/__tests__/BuildingsLayer.test.ts`.
|
|
42
|
+
|
|
43
|
+
### Fixed — wheel zoom stuck near the ground, and not symmetric
|
|
44
|
+
|
|
45
|
+
Zoomed all the way in, the wheel then did nothing in either direction below
|
|
46
|
+
about 70 m. A step smaller than a fixed world-unit threshold was dropped, and
|
|
47
|
+
at that height every step was smaller. The threshold is now relative to the
|
|
48
|
+
height. A notch in and a notch out also now cancel exactly, so the same notches
|
|
49
|
+
out bring the camera back to where it was.
|
|
50
|
+
Tests: `src/interaction/__tests__/GlobeControl.wheel.test.tsx`.
|
|
51
|
+
|
|
52
|
+
### Fixed — precision and drawing at street scale
|
|
53
|
+
|
|
54
|
+
- Globe tiles are stored around a local origin, and a tile with very few
|
|
55
|
+
segments no longer draws a grey streak across the globe.
|
|
56
|
+
Tests: `src/map/geo-map/__tests__/streetCamera.test.ts`.
|
|
57
|
+
- `<PathHighlightLayer>` ribbons are stored around a local origin on the
|
|
58
|
+
route, so they no longer jitter close up.
|
|
59
|
+
Tests: `src/react/layers/__tests__/effectLayers.test.ts`.
|
|
60
|
+
- A `<PathHighlightLayer>` segment that runs behind the camera is clipped at
|
|
61
|
+
the near plane instead of vanishing, so a route the camera stands on stays
|
|
62
|
+
drawn. This is shader code, which vitest cannot run; it was checked in the
|
|
63
|
+
browser.
|
|
64
|
+
- `api.map.flyTo` on the globe now also undoes a sideways offset of the globe,
|
|
65
|
+
such as a `cinematics` shot leaves, so the target ends at the screen centre.
|
|
66
|
+
Tests: `src/api/modules/__tests__/MapApi.flyToRecentre.test.ts`.
|
|
67
|
+
- `api.map.elevation` was lost after the geo layout was applied again. The
|
|
68
|
+
render loop does that once the layout's buffer is ready, which put elevated
|
|
69
|
+
nodes back on the ground for good. Nodes rewritten by `applyGeoLayout` are
|
|
70
|
+
now lifted again.
|
|
71
|
+
Tests: `src/api/modules/__tests__/MapApi.geoLayoutElevation.test.ts`.
|
|
72
|
+
|
|
73
|
+
### Added — `<BuildingsLayer>`: extruded building footprints on the map
|
|
74
|
+
|
|
75
|
+
Takes building footprints as a GeoJSON FeatureCollection (Polygon and
|
|
76
|
+
MultiPolygon, holes kept, as OpenStreetMap exports them) and draws each as a
|
|
77
|
+
prism from `minHeight` to `height` metres (`heightProperty`, `baseProperty`,
|
|
78
|
+
`defaultHeight`, `heightScale`), walls shaded by the way they face, with a roof
|
|
79
|
+
outline. Footprints are placed with `api.map.latLngToWorld` and heights with
|
|
80
|
+
`api.map.groundKmToWorld`, around a local origin at the data's centre, rising
|
|
81
|
+
along the map's own surface normal, so it works on the flat map and the globe
|
|
82
|
+
and keeps its precision at street scale. It re-projects when the map is
|
|
83
|
+
enabled or changes projection and draws nothing while no map is shown.
|
|
84
|
+
`opacity` below 1 makes the blocks see-through. Tilt the view with
|
|
85
|
+
`api.map.setPitch` to see them stand. `buildBuildingGeometry` (the pure
|
|
86
|
+
builder) and `createBuildingsLayer` are exported too.
|
|
87
|
+
|
|
88
|
+
Tests: `src/react/layers/__tests__/BuildingsLayer.test.ts`,
|
|
89
|
+
`src/react/layers/__tests__/BuildingsLayer.react.test.tsx`.
|
|
90
|
+
|
|
91
|
+
### Added — `<PathHighlightLayer hopPaths head aheadOpacity>`: routes along roads, driven by time
|
|
92
|
+
|
|
93
|
+
- **`hopPaths`:** `hopPaths[i]` is the route from `path[i]` to `path[i + 1]`, as
|
|
94
|
+
`[lat, lng]` points, for example a road route between two places. While a map
|
|
95
|
+
is shown, the ribbon runs from the first node through those points to the
|
|
96
|
+
next node instead of straight across. The points are projected with
|
|
97
|
+
`api.map.latLngToWorld`, and projected again when the map is enabled,
|
|
98
|
+
disabled or changes projection. On a flat map the route keeps its nodes'
|
|
99
|
+
height, so it follows `map.elevation` too.
|
|
100
|
+
- **Heights:** a point can carry a third value, its height in metres above the
|
|
101
|
+
map: `[lat, lng, 7]`. The route then climbs onto a footbridge or into a
|
|
102
|
+
building instead of staying on the ground. The point is raised along the
|
|
103
|
+
map's own up direction, which is the globe's normal on a globe, and scaled
|
|
104
|
+
with `api.map.groundKmToWorld`. The point type is exported as `HopPathPoint`.
|
|
105
|
+
- **`hopPoints`:** the same per-hop route in world coordinates. It is the
|
|
106
|
+
layer config field that `hopPaths` fills. On a flat map a point's `z` is
|
|
107
|
+
its height above the map, added to the height of its nodes.
|
|
108
|
+
- **`head`:** how far along the path you are, in hops (2.5 is halfway along
|
|
109
|
+
the third hop). When set, the route is drawn up to that point instead of
|
|
110
|
+
animating in, a single particle sits on it, and node halos light up as it
|
|
111
|
+
reaches them. Drive it from a clock or a timeline to move something along
|
|
112
|
+
the route. Within a hop the position goes by distance.
|
|
113
|
+
- **`aheadOpacity`:** keeps the route beyond `head` faintly visible. Default 0.
|
|
114
|
+
- Once the layer has received a config, clearing one of these props clears it.
|
|
115
|
+
Before, the value from mount would have stayed.
|
|
116
|
+
|
|
117
|
+
Tests: `src/react/layers/__tests__/effectLayers.test.ts`,
|
|
118
|
+
`src/react/layers/__tests__/pathHighlightHopPaths.test.tsx`,
|
|
119
|
+
`src/react/layers/__tests__/pathHighlightAltitude.test.ts`.
|
|
120
|
+
|
|
121
|
+
### Added — `<Timeline controls playOptions>`
|
|
122
|
+
|
|
123
|
+
`controls={false}` hides the source, time-field and bucket selectors. Use it
|
|
124
|
+
when the host sets the source with `api.timeline.setSource` and readers should
|
|
125
|
+
not change it. Clear and Play stay. `playOptions` is passed to
|
|
126
|
+
`api.timeline.play` when Play is pressed. Without it, Play still slides a
|
|
127
|
+
one-bucket window and loops.
|
|
128
|
+
|
|
129
|
+
`api.timeline.isPlaying()` and `api.timeline.onPlayingChange(cb)` report when
|
|
130
|
+
playback starts and stops, including a pass that ends by itself and a `pause`
|
|
131
|
+
from the host. The Play button follows them, so it no longer stays on
|
|
132
|
+
"Pause" after playback has stopped.
|
|
133
|
+
|
|
134
|
+
Tests: `src/react/timeline/__tests__/Timeline.props.test.tsx`,
|
|
135
|
+
`src/api/modules/__tests__/TimelineApi.test.ts`.
|
|
136
|
+
|
|
137
|
+
### Fixed — `api.timeline.play({ mode })` ignored `expand` and `shrink`
|
|
138
|
+
|
|
139
|
+
`TimelinePlayOptions.mode` documented `slide | expand | shrink`, but `play`
|
|
140
|
+
always slid. `expand` now keeps the window's start and sweeps its end to the
|
|
141
|
+
end of the domain, resuming from the brushed end, so the graph accumulates.
|
|
142
|
+
`shrink` keeps the end and sweeps the start toward it. With `loop`, `expand`
|
|
143
|
+
shows the full window for one tick and then restarts from an empty one.
|
|
144
|
+
|
|
145
|
+
Tests: `src/api/modules/__tests__/TimelineApi.test.ts`.
|
|
146
|
+
|
|
147
|
+
### Fixed — `api.map.flyTo` before the map was shown was dropped
|
|
148
|
+
|
|
149
|
+
A host that adds its data and frames the view in the same effect races the
|
|
150
|
+
`map` prop, whose `enableMap` runs in a later effect. When `flyTo` (or
|
|
151
|
+
`flyToBounds`, which calls it) won the race it returned without doing
|
|
152
|
+
anything, and the map intermittently stayed at the world view.
|
|
153
|
+
Now the latest such request is kept and applied when the map is enabled and
|
|
154
|
+
its scene is wired, before `map:enabled` fires, so a `flyTo` from a
|
|
155
|
+
`map:enabled` listener still wins. The call still resolves at once.
|
|
156
|
+
|
|
157
|
+
Tests: `src/api/modules/__tests__/MapApi.pendingView.test.ts`.
|
|
158
|
+
|
|
159
|
+
### Fixed — a map with `forceLayout` could lose every node position
|
|
160
|
+
|
|
161
|
+
`forceLayout` builds its controller from the store as it is at that moment and
|
|
162
|
+
installs it on a later render. Nodes a host added in between, for example from
|
|
163
|
+
an init effect writing through `apiRef`, raised their structure change while no
|
|
164
|
+
controller was wired to receive it. The new controller then never learned about
|
|
165
|
+
them: `getPositions()` returned null, and on a map the geo positions written by
|
|
166
|
+
`geoLayout` were lost, so no node was drawn. Installing a controller over a
|
|
167
|
+
store that already has nodes now replays one structure change, so the
|
|
168
|
+
controller is seeded and the geo positions are written again.
|
|
169
|
+
|
|
170
|
+
Tests: `src/react/__tests__/lateLayoutController.test.tsx`.
|
|
171
|
+
|
|
172
|
+
### Fixed — with `forceLayout`, geo nodes under a custom `geoMapping` stayed pinned off the map
|
|
173
|
+
|
|
174
|
+
The first geo projection often lands in a provider that the force-layout
|
|
175
|
+
controller replaces a moment later. The controller then rebuilt its simulation
|
|
176
|
+
from seed positions with the nodes still pinned, and the render loop's
|
|
177
|
+
re-projection, which should have moved them back, ran `applyGeoLayout` with
|
|
178
|
+
only `{ mode }`. That dropped the host's `map.geoLayout.geoMapping` (and
|
|
179
|
+
`pinAutoPlaced` and the other options), so nodes whose lat/lng sit under other
|
|
180
|
+
keys were never re-projected and stayed pinned near the globe's centre, out of
|
|
181
|
+
sight. The re-projection now repeats the last `applyGeoLayout` options;
|
|
182
|
+
`releaseGeoLayout` forgets them.
|
|
183
|
+
|
|
184
|
+
Tests: `src/api/modules/__tests__/MapApi.reassertGeoLayout.test.ts`.
|
|
185
|
+
|
|
186
|
+
### Fixed — map labels ignored `map.maxNodeGrowth` and grew far past their nodes
|
|
187
|
+
|
|
188
|
+
In map mode the text shader capped label growth at a hard-coded 3×. Lowering
|
|
189
|
+
`map.maxNodeGrowth` shrank the nodes but not the labels, so at street zoom a
|
|
190
|
+
map with `maxNodeGrowth: 1.5` drew labels about twice the size they should be,
|
|
191
|
+
piled on top of each other. `TextLayer` and `EdgeTextLayer` labels now cap at
|
|
192
|
+
0.75 × `maxNodeGrowth` and follow later `map.setMaxNodeGrowth` calls. At the
|
|
193
|
+
default of 4 the cap is still 3, so nothing changes unless the host sets it.
|
|
194
|
+
|
|
195
|
+
- `TextCloud.setMapMaxGrowth()`, `EdgeTextCloud.setMapMaxGrowth()` and
|
|
196
|
+
`BatchTextRenderer.setMapMaxGrowth()` take the node cap. `Infinity` removes
|
|
197
|
+
the label cap too.
|
|
198
|
+
|
|
199
|
+
Tests: `src/text/__tests__/textMapMaxGrowth.test.tsx`.
|
|
200
|
+
|
|
201
|
+
### Fixed — ego-ring nodes no longer follow hidden geo anchors
|
|
202
|
+
|
|
203
|
+
With `map.geoLayout.nonGeoStrategy: "egoRing"`, a non-geo node linked to
|
|
204
|
+
several places is drawn at their barycenter. Hidden places still counted, so
|
|
205
|
+
under a filter or a timeline brush a visible node sat between places that were
|
|
206
|
+
not shown, often off-screen, with its edges running across the map. Hidden
|
|
207
|
+
anchors are now left out of the barycenter. A node whose ring root is hidden is
|
|
208
|
+
ringed around a visible geo neighbour instead. The ring is re-placed and
|
|
209
|
+
re-pinned as soon as an anchor is hidden or shown, without waiting for a zoom
|
|
210
|
+
change.
|
|
211
|
+
|
|
212
|
+
Tests: `src/map/geo-local/__tests__/GeoEgoRingRenderer.hiddenAnchors.test.ts`.
|
|
213
|
+
|
|
214
|
+
### Fixed — `map.autoFit: false` now also stops the geoLayout's initial fit
|
|
215
|
+
|
|
216
|
+
With the declarative `map.geoLayout`, the camera flew to the geo bounding box
|
|
217
|
+
about 400 ms after mount even when `autoFit` was `false`. That replaced any
|
|
218
|
+
opening view the host set with `map.flyTo`. `autoFit: false` now leaves the
|
|
219
|
+
camera to the host. The default (`autoFit` unset) still fits.
|
|
220
|
+
|
|
221
|
+
Tests: `src/react/__tests__/geoLayoutAutoFit.test.tsx`.
|
|
222
|
+
|
|
223
|
+
### Fixed — node layers kept their size on a map instead of filling the screen
|
|
224
|
+
|
|
225
|
+
In map mode the built-in node shader damps inverse-zoom growth and soft-caps it
|
|
226
|
+
at `map.maxNodeGrowth`. Layers built on `createNodeShaderLayer` (`MediaLayer`,
|
|
227
|
+
`AudioSpectrumLayer`, `NodeEffectLayer`, `NodeCardLayer` and the others) still
|
|
228
|
+
grew with plain perspective. Zoomed to street level, a `MediaLayer` video panel
|
|
229
|
+
with `sizeFactor: 11` covered the whole map while its node stayed small. Their
|
|
230
|
+
screen-sized quads, and the matching hitboxes, now follow the node's curve, so a
|
|
231
|
+
layer keeps its size relative to its node at every zoom. Off the map nothing
|
|
232
|
+
changes, and `sizing: "world"` layers are untouched.
|
|
233
|
+
|
|
234
|
+
- `LayerContext.getMapNodeSizing?()` (new, optional) returns the live
|
|
235
|
+
`{ damping, maxGrowth }`. Hand-built contexts can leave it out and get the
|
|
236
|
+
engine defaults, 0.3 and 4. `EngineLayerHost.mapNodeSizing` feeds it.
|
|
237
|
+
|
|
238
|
+
Tests: `src/react/layers/__tests__/NodeShaderLayer.mapSizing.test.ts`.
|
|
239
|
+
|
|
240
|
+
### Fixed — switching to the WebGPU render path could hide host overlays
|
|
241
|
+
|
|
242
|
+
The WebGPU canvas was appended to the container last, with `z-index: 1`, once
|
|
243
|
+
it finished initialising. Host panels, the minimap and controls placed in or
|
|
244
|
+
beside the container ended up underneath it, so a panel could vanish when
|
|
245
|
+
`enableWebGPURenderPath` turned on. The canvas now goes directly after the WebGL
|
|
246
|
+
canvas with no z-index, so it covers only the WebGL canvas. Covered by
|
|
247
|
+
`src/backends/webgpu/__tests__/WebGPUPaintTarget.test.tsx` ("stacking").
|
|
248
|
+
|
|
249
|
+
With arrows off, the WebGPU edge path also no longer logs `Vertex attribute "iA"
|
|
250
|
+
not found` on every compile: the empty arrow mesh is hidden. Covered by
|
|
251
|
+
`src/backends/webgpu/__tests__/WebGPUEdgePrimitive.test.tsx`.
|
|
252
|
+
|
|
253
|
+
### Fixed — edges with no text no longer pay for curve classification on mount
|
|
254
|
+
|
|
255
|
+
`EdgeTextLayer` (mounted automatically by a `GraphCanvas` without children)
|
|
256
|
+
classified every edge's curve twice on mount even when no edge had text: about
|
|
257
|
+
12 s at 1.5M edges. It now builds the classifier only when the first edge with
|
|
258
|
+
text needs its curvature, and looks up each relationship's style once. Output is
|
|
259
|
+
unchanged. Covered by `src/react/layers/__tests__/EdgeTextLayer.noLabels.test.tsx`.
|
|
260
|
+
|
|
261
|
+
### Changed — collecting nodes now shows, moves and opens
|
|
262
|
+
|
|
263
|
+
- `api.nodes.collect(parentId, childIds, options?)` and
|
|
264
|
+
`api.nodes.explode(parentId, options?)` now really collect: the children
|
|
265
|
+
are hidden into the parent through a collapsed group (`kind: "collect"`),
|
|
266
|
+
their links to the outside become aggregated edges from the parent, and
|
|
267
|
+
the parent's own edges stay real edges in their own colour. Both are
|
|
268
|
+
undoable commands (`CollectNodes`, `ExplodeCollection`); collecting into an
|
|
269
|
+
existing collection adds to it, and its undo gives back the smaller one.
|
|
270
|
+
Previously they only set a flag. Both now return a `Promise` that resolves
|
|
271
|
+
when the motion ends. Covered by
|
|
272
|
+
`src/api/modules/__tests__/collect.test.ts`.
|
|
273
|
+
- **Behaviour change:** `collect` now throws on an unknown parent, on a
|
|
274
|
+
parent that is itself collected, and on a child that is already a
|
|
275
|
+
collection or collected; the parent itself and unknown child ids are
|
|
276
|
+
ignored. Covered by `collect.test.ts`.
|
|
277
|
+
- Motion: on collect the children fly into the parent before they hide, and
|
|
278
|
+
go back to their places while hidden; on explode they fly out of it.
|
|
279
|
+
Children with no place of their own open onto a ring around the parent.
|
|
280
|
+
Runs on the engine's `AnimationManager`, no timers. `{ animate: false }`
|
|
281
|
+
skips it. Covered by `collect.test.ts`.
|
|
282
|
+
- New `api.nodes.isCollection(id)`, `getCollected(id)`,
|
|
283
|
+
`setExpandOnDoubleClick(enabled)` and `getExpandOnDoubleClick()`.
|
|
284
|
+
Double-clicking a collection explodes it, and double-clicking a collapsed
|
|
285
|
+
group's anchor expands the group (on by default). Covered by
|
|
286
|
+
`collect.test.ts`.
|
|
287
|
+
- Every collapsed group, collections included, shows a "+N" count badge on
|
|
288
|
+
its anchor (`1k+` and up past 999); a badge the anchor had comes back on
|
|
289
|
+
expand, and one the host sets while collapsed wins over the count. A
|
|
290
|
+
collection keeps the parent's own label instead of the group name. Covered
|
|
291
|
+
by `collect.test.ts`.
|
|
292
|
+
- `AnimationManager.add` asks the canvas for a frame, so a tween started on
|
|
293
|
+
an idle canvas runs. Covered by `collect.test.ts`.
|
|
294
|
+
|
|
295
|
+
### Fixed — badges and tags were not drawn under `forceLayout`
|
|
296
|
+
|
|
297
|
+
- `BadgeCloud` and `TagCloud` wired a position texture only for GPU position
|
|
298
|
+
providers. Both built-in force layouts (d3 and WebGPU) and every static
|
|
299
|
+
provider are CPU providers, so every badge and tag sat unpositioned and
|
|
300
|
+
never showed. They now read the new `GraphContextValue.getNodePositionTexture()`
|
|
301
|
+
every frame, which hands out the node renderer's CPU mirror when the
|
|
302
|
+
provider has no texture. Covered by
|
|
303
|
+
`src/react/layers/__tests__/decorationPositionTexture.test.tsx`.
|
|
304
|
+
|
|
305
|
+
### Changed — badges and tags sit on their node's rim and hide with it
|
|
306
|
+
|
|
307
|
+
- Badge and tag offsets came from fixed 14 px `ANCHOR_OFFSETS`, tuned for one
|
|
308
|
+
node size: on a default node (radius ≈ 4 px) every badge floated three radii
|
|
309
|
+
away and read as a separate node. They are now computed from the node's own
|
|
310
|
+
radius with the new `anchorOffsetAround(anchor, nodeRadiusPx, halfSizePx,
|
|
311
|
+
overlap, gapPx?)` and `NODE_RADIUS_PX_PER_SIZE` (both exported from
|
|
312
|
+
`decorations/DecorationTypes`). Badges overlap the rim slightly, tags sit
|
|
313
|
+
just outside it, and both move when the node is resized. `ANCHOR_OFFSETS`
|
|
314
|
+
stays as the fallback when no radius is known.
|
|
315
|
+
- A hidden node's badge and tag are no longer drawn; showing the node brings
|
|
316
|
+
them back.
|
|
317
|
+
- The new `DECORATION_GEOMETRY_DOMAINS` (Style | Visibility) drives that
|
|
318
|
+
rebuild; it re-syncs only when a decorated node's size or visibility really
|
|
319
|
+
changed, so colour writes still do not rebuild instances.
|
|
320
|
+
- New `TagSpec.fontSizePx`: the tag's text cap height in CSS px (default 9,
|
|
321
|
+
clamped to 6–32); padding scales with it.
|
|
322
|
+
- Tags are drawn over nodes and node labels (no depth test, renderOrder 3).
|
|
323
|
+
Before, a nearer neighbour in a dense cluster cut through the pill and its
|
|
324
|
+
text. Badges keep the depth test, since they sit on their node.
|
|
325
|
+
- Covered by `src/react/layers/__tests__/decorationPlacement.test.tsx`.
|
|
326
|
+
|
|
327
|
+
### Fixed — `forceLayout={{ … }}` restarted the layout on every render
|
|
328
|
+
|
|
329
|
+
- The internal force layout was keyed on the prop's object identity, so an
|
|
330
|
+
inline config object destroyed and rebuilt the layout on each host render.
|
|
331
|
+
In between, `store.positionProvider` was the disposed adapter and returned
|
|
332
|
+
null positions; layers reading positions then drew nothing. It is now keyed
|
|
333
|
+
on the config's value. Covered by
|
|
334
|
+
`src/react/__tests__/forceLayoutPropIdentity.test.tsx`.
|
|
335
|
+
- `FocusCalloutLayer` retries targets whose position is not known yet on a
|
|
336
|
+
later frame instead of dropping them. Covered by
|
|
337
|
+
`src/react/layers/__tests__/effectLayers.test.ts`.
|
|
338
|
+
|
|
339
|
+
### Added — orthogonal edges and hierarchy layouts (tree, radialTree, layered, columns)
|
|
340
|
+
|
|
341
|
+
- Edge shape `"orthogonal"` (shader id 3) for `style.setEdgeShape`,
|
|
342
|
+
`setEdgeShapes`, `setRelationshipShape` and the `edgeShape` prop: leave the
|
|
343
|
+
source along the routing axis, run across, drop into the target, with
|
|
344
|
+
quarter-circle corners. Evaluated per vertex in `edge.vert.glsl` /
|
|
345
|
+
`arrow.vert.glsl` from the two endpoints (`shaders/kv_orthoEdge.glsl`), so it
|
|
346
|
+
follows drags, force layout and tweens with no CPU work and no extra upload
|
|
347
|
+
per frame. Parallel multi-edges get parallel tracks. Covered by
|
|
348
|
+
`src/api/modules/__tests__/StyleApi.edgeRouting.test.ts`,
|
|
349
|
+
`src/registry/__tests__/EngineRegistry.test.ts`.
|
|
350
|
+
- `style.setEdgeBends(edgeIds, bend | null)` — where the cross leg sits:
|
|
351
|
+
`0..1` fraction of the span, `< 0` absolute distance from the source (one
|
|
352
|
+
shared bar per parent), `null` automatic. Undoable, one step. Stored in the
|
|
353
|
+
new `EdgeRenderState.bends` column (NaN = automatic) and in snapshots.
|
|
354
|
+
Covered by `StyleApi.edgeRouting.test.ts`.
|
|
355
|
+
- `style.setEdgeRouting({ axis, cornerRadius })` — routing axis
|
|
356
|
+
(`"auto" | "vertical" | "horizontal"`, shared with `radial`) and corner
|
|
357
|
+
rounding `0..1`. Type `EdgeRoutingOptions`. Covered by
|
|
358
|
+
`StyleApi.edgeRouting.test.ts`.
|
|
359
|
+
- `edge/orthoPath.ts` — CPU mirror of the shader route (`orthoFrame`,
|
|
360
|
+
`orthoPoint`, `orthoPolyline`). `PathHighlightLayer` uses it, so a
|
|
361
|
+
highlighted path follows orthogonal edges instead of cutting straight.
|
|
362
|
+
Covered by `src/edge/__tests__/orthoPath.test.ts`.
|
|
363
|
+
- Layouts `api.layout.tree`, `radialTree`, `layered` (Sugiyama: cycle
|
|
364
|
+
breaking, longest-path levels or `rankBy` a property, virtual nodes for long
|
|
365
|
+
edges, barycenter crossing reduction, least-squares placement) and `columns`
|
|
366
|
+
(one column per property value, crossings reduced inside columns). Options
|
|
367
|
+
`direction` (`TB | BT | LR | RL`), `nodeGap`, `levelGap`, `relationships`,
|
|
368
|
+
plus `roots`, `rankBy` / `rankOrder`, `by` / `order` / `sortBy`. Also
|
|
369
|
+
registered by name for `applyByName`, and exported as pure functions
|
|
370
|
+
(`treeLayout`, `radialTreeLayout`, `layeredLayout`, `columnsLayout`).
|
|
371
|
+
Covered by `gpu-compute/tests/hierarchyLayouts.test.ts` and
|
|
372
|
+
`src/api/__tests__/LayoutApi.hierarchy.test.ts`.
|
|
373
|
+
- WebGPU render path: `orthogonal` edges draw straight for now (not ported).
|
|
374
|
+
- New example `scenario-org-chart`; `scenario-data-lineage` and
|
|
375
|
+
`scenario-incident-blast-radius` now place nodes with `layout.columns`.
|
|
376
|
+
|
|
377
|
+
### Added — edge and node effect layers: comet flow, path highlight, focus callouts, node halos
|
|
378
|
+
|
|
379
|
+
Four layers, each a React component and a `create*Layer` factory. Everything
|
|
380
|
+
visual is a prop; per-edge / per-node props take a function of the datum.
|
|
381
|
+
Covered by `src/react/layers/__tests__/effectLayers.test.ts`.
|
|
382
|
+
|
|
383
|
+
`PathHighlightLayer` lights the whole route as one continuous line with
|
|
384
|
+
water-like flowing bands (`flow`, `flowSpeed`, `flowBands`, `flowStrength`,
|
|
385
|
+
`baseLevel`) plus a single comet per path (`particle`, `particleCount`,
|
|
386
|
+
`particleSpeed`, `particleSize`, `particleTail`) and path-node halos (`nodeHalo`).
|
|
387
|
+
|
|
388
|
+
- `EdgeFlowLayer` — comet particles along edges: a white-hot head with a halo
|
|
389
|
+
and a tapered, fading tail, drawn as screen-space instanced quads (constant
|
|
390
|
+
pixel width at any zoom, one draw call). Props: `style`
|
|
391
|
+
(`"comet" | "dots" | "streak"`), `count`, `speed`, `color`, `width`, `weight`
|
|
392
|
+
(all per edge), `direction` (`"forward" | "reverse" | "both"`), `size`,
|
|
393
|
+
`tail`, `glow`, `intensity`, `headColor`, `speedScale`, `fadeEnds`, `filter`,
|
|
394
|
+
`maxParticles`. Follows node positions and the edge dim state
|
|
395
|
+
(`emphasis.focusContext`), and arcs along the great circle on a globe.
|
|
396
|
+
Replaces the look of `animations.edgeFlow`, which is unchanged.
|
|
397
|
+
- `PathHighlightLayer` — a glowing ribbon through an ordered list of node ids
|
|
398
|
+
that draws itself start to end (`drawDuration`), runs ONE comet particle along
|
|
399
|
+
the whole route from the first node to the last (`particleCount` for more),
|
|
400
|
+
puts a halo on the path nodes and can dim everything else
|
|
401
|
+
(`dimOthers`). Props: `path`, `color`, `width`, `glow`,
|
|
402
|
+
`particle`, `particleCount`, `particleSpeed`, `particleSize`, `particleTail`,
|
|
403
|
+
`opacity`, `nodeHalo`, `lift`. Changing `path`
|
|
404
|
+
replays the draw-in.
|
|
405
|
+
- `FocusCalloutLayer` — a leader polyline (ring, diagonal leg, horizontal run)
|
|
406
|
+
with text sitting on it, for focused nodes and/or edges. Laid out in screen
|
|
407
|
+
pixels around the target, so it keeps its size at any zoom and follows the
|
|
408
|
+
target. Controlled with `nodes` / `edges`, or `focusOnClick` (+ `focusEdges`,
|
|
409
|
+
`onFocusChange`). Props: `text` (string, lines, or `{ title, lines }`),
|
|
410
|
+
`placement`, `angle`, `elbow`, `run`, `ring`, `color`, `lineWidth`,
|
|
411
|
+
`textColor`, `background`, `fontSize`, `duration`, `max`, `dimOthers`.
|
|
412
|
+
- `NodeEffectLayer` — animated halos (`"glow" | "pulse" | "ripple" | "orbit"`)
|
|
413
|
+
for any subset of nodes, one draw call. Props: `effect`, `filter`, `color`
|
|
414
|
+
and `weight` (per node), `radius`, `speed`, `intensity`, `count`,
|
|
415
|
+
`thickness`.
|
|
416
|
+
- New example `scenario-edge-node-effects`.
|
|
417
|
+
|
|
418
|
+
### Added — `ModelLayer`: nodes drawn as 3D models
|
|
419
|
+
|
|
420
|
+
- `ModelLayer` / `createModelLayer` draw each node as a glTF model or as one
|
|
421
|
+
part of a model: `model(node)` returns a URL, `{ url, part, children }` (a
|
|
422
|
+
named node of the file, its own meshes recentred, its sub-parts optional),
|
|
423
|
+
an `Object3D`, or `null` for the plain dot. Files load once and are shared;
|
|
424
|
+
meshopt-compressed files decode out of the box. Replaceable via `loader`.
|
|
425
|
+
- The model follows the node's position, visibility and focus+context dim,
|
|
426
|
+
and hides the built-in dot (`hideBuiltinNode`, default on). It is pickable
|
|
427
|
+
through an invisible hit twin (`hitArea`, default on), so clicks and hover
|
|
428
|
+
land on the visible shape, and labels clear its extent.
|
|
429
|
+
- `scale` or `size` (fits the bounding radius), `rotation`, `anchor`, `spin`
|
|
430
|
+
(rad/s, eases back to front when stopped), `tint` with `tintPulse`; changes
|
|
431
|
+
ease over `transition` seconds. `lights` and `environment` (a room
|
|
432
|
+
environment map for PBR materials) default on.
|
|
433
|
+
- `depthRange: "fit"` (default) gives the models a depth range fitted to them
|
|
434
|
+
each frame, so close-up parts do not z-fight under the camera's tiny near
|
|
435
|
+
plane; `"camera"` keeps the camera's own range.
|
|
436
|
+
- `loadModel(url)` and `loadModelParts(url, { rotation })` are exported:
|
|
437
|
+
the latter lists every named part with parent, children, centre, radius,
|
|
438
|
+
triangle count and materials — enough to build a graph from a model.
|
|
439
|
+
- Covered by `src/react/layers/__tests__/ModelLayer.test.tsx`.
|
|
440
|
+
|
|
441
|
+
### Added — `MediaLayer` video playback: click to play or pause, thumbnails, a clip per node
|
|
442
|
+
|
|
443
|
+
- `video.url` may be a function, so each node plays its own clip. Nodes that
|
|
444
|
+
return the same URL share one decode; every distinct URL costs one `<video>`
|
|
445
|
+
and one draw call.
|
|
446
|
+
- `video.playOnClick` is the whole player: the panel is the hitbox, a click on
|
|
447
|
+
it plays a paused video and pauses a playing one. The videos start paused.
|
|
448
|
+
No DOM element is involved.
|
|
449
|
+
- `video.posterTime` (seconds, or a function per node) is the frame a video
|
|
450
|
+
nobody has started shows, so a paused panel is a thumbnail and not a black
|
|
451
|
+
first frame. `video.playBadge` (default: `playOnClick`) draws a play glyph on
|
|
452
|
+
paused panels; the code is not compiled in unless asked for.
|
|
453
|
+
- `video.onPlayingChange` reports every start and stop, whatever caused it.
|
|
454
|
+
- `controlRef` hands back a `MediaLayerHandle` (`togglePlayback`, `play`,
|
|
455
|
+
`pause`, `pauseAll`, `isPlaying`, `sourceOf`), also returned by
|
|
456
|
+
`createMediaLayer`, for hosts that mount the layer without React.
|
|
457
|
+
- `onVideoSource` now receives `(source, { url })`; existing one-argument
|
|
458
|
+
callbacks keep working. A single string `url` behaves exactly as before.
|
|
459
|
+
|
|
460
|
+
### Fixed — the minimap now draws what the scene shows
|
|
461
|
+
|
|
462
|
+
- Nodes are drawn at the same size relative to the graph as in the main view.
|
|
463
|
+
The minimap used a fixed `nodeSize × 50 / 80` px whatever the graph's
|
|
464
|
+
extent, so large nodes (size 150+, as icon nodes need) covered most of the
|
|
465
|
+
panel.
|
|
466
|
+
- The minimap no longer stops one image behind once the scene goes idle. A
|
|
467
|
+
change made after the layout settled (a `setNodeColors` call, a toggle back
|
|
468
|
+
to a previous state) never reached it: the readback's request for a delivery
|
|
469
|
+
frame was issued from inside a frame callback, where the frame-end settle
|
|
470
|
+
overwrites it, and a change that arrived during a readback was never
|
|
471
|
+
rendered.
|
|
472
|
+
- Covered by `src/react/layers/minimap/__tests__/MinimapSceneSync.test.tsx`.
|
|
473
|
+
|
|
474
|
+
### Fixed — node labels clear the panel or ring a layer draws, not the hidden dot
|
|
475
|
+
|
|
476
|
+
- `<TextLayer>` used to place a label just outside the BUILT-IN node, which a
|
|
477
|
+
`MediaLayer` panel or a shader-layer billboard hides. The caption landed in
|
|
478
|
+
the middle of the picture. Layers now report their footprint to the store
|
|
479
|
+
and labels sit outside it, on every side, while the node is dragged.
|
|
480
|
+
Applications set nothing: `MediaLayer` reports its panel (a 16:9 panel is
|
|
481
|
+
9/16 of its quad tall), `AudioSpectrumLayer` the middle of its band (fixed, so
|
|
482
|
+
labels do not jump with the music), and `createNodeShaderLayer` the whole quad
|
|
483
|
+
when it hides the built-in node or has a `hitArea`.
|
|
484
|
+
- New `NodeShaderLayerSpec.labelExtent`: `"auto"` (default, as above),
|
|
485
|
+
`"none"`, or `[x, y]` as fractions of the quad, for a drawing smaller than its
|
|
486
|
+
billboard.
|
|
487
|
+
- New `GraphStore.setNodeLabelExtents(owner, extents | null)` and
|
|
488
|
+
`getNodeLabelExtent(id)`, with exported types `NodeLabelExtent` and
|
|
489
|
+
`ResolvedLabelExtent`. Layer-facing: several layers on one node merge by the
|
|
490
|
+
largest extent, and an unchanged claim does not bump `labelVersion`.
|
|
491
|
+
- New optional `TextItem` fields `extentX` / `extentY` (built-in node radii)
|
|
492
|
+
and `worldExtentX` / `worldExtentY` (world units), and
|
|
493
|
+
`BufferTextSource.extentResolver`, for hosts that build their own items.
|
|
494
|
+
Without them, label placement is unchanged.
|
|
495
|
+
- Covered by `src/react/layers/__tests__/labelExtent.test.tsx`.
|
|
496
|
+
|
|
497
|
+
### Added — radial labels for radial trees and ego rings
|
|
498
|
+
|
|
499
|
+
- New `LabelPosition` value `"radial"`: each label turns along the ray from a
|
|
500
|
+
centre and reads outward, and on the left half it is turned half a turn and
|
|
501
|
+
right-aligned so no label is upside down. The gap to the node follows the
|
|
502
|
+
node's label footprint along the ray.
|
|
503
|
+
- New `TextLayer` prop `radialCenter`: a node id (the centre follows that
|
|
504
|
+
node, so labels keep turning while it is dragged or tweened) or a fixed
|
|
505
|
+
`[x, y]`. Default: the middle of the labelled nodes. The same field is
|
|
506
|
+
accepted by the `GraphCanvas` `caption` prop.
|
|
507
|
+
- New `TextCloud.setRadialCenter([x, y] | null)` and exported helper
|
|
508
|
+
`radialLabelPlacement(dx, dy, gapX, gapY)`, for hosts that drive a
|
|
509
|
+
`TextCloud` directly. A per-item `angle` still wins.
|
|
510
|
+
- Covered by `src/text/__tests__/radialLabels.test.ts`.
|
|
511
|
+
|
|
512
|
+
### Fixed — a canvas with non-round node sizes never went idle
|
|
513
|
+
|
|
514
|
+
- `GraphStore.refreshEffectiveSizes()` compared a float32-rounded
|
|
515
|
+
`effectiveSizes` entry with the double it was computed from, so any size
|
|
516
|
+
whose product with 1.5 is not exact in float32 (0.7, √x / 130 …) counted as
|
|
517
|
+
changed on every call. The render loop then marked node sizes dirty from
|
|
518
|
+
inside its own paint and bumped `store.version` every frame: the canvas
|
|
519
|
+
never went idle, `TextLayer` rebuilt every label every frame, and node
|
|
520
|
+
clicks mostly picked nothing. Round sizes (140, 200) hid it. The comparison
|
|
521
|
+
is now made in float32.
|
|
522
|
+
- Covered by `src/react/graph-context/__tests__/renderLoopIdle.test.tsx`
|
|
523
|
+
("goes quiet with sizes that are not exact in float32").
|
|
524
|
+
|
|
525
|
+
### Added — clicking empty canvas restores the un-emphasised graph
|
|
526
|
+
|
|
527
|
+
- New `api.emphasis.restore()`: stops every emphasis effect (focus+context
|
|
528
|
+
dims, path and cascade highlights), clears click-dim and programmatic dims
|
|
529
|
+
(`dimExcept`, `dimNeighborhood`, `setTraceDim`), and notifies
|
|
530
|
+
`api.emphasis.onRestore(cb)` listeners.
|
|
531
|
+
- A click on empty canvas calls it by default. A click that ends a camera pan
|
|
532
|
+
does not count (`InteractionManager.lastClickWasDrag`, new). Turn it off with
|
|
533
|
+
the GraphCanvas prop `restoreOnBackgroundClick={false}` or
|
|
534
|
+
`api.emphasis.setRestoreOnBackgroundClick(false)`.
|
|
535
|
+
- `PathHighlightLayer` and `FocusCalloutLayer` hide their highlight and
|
|
536
|
+
`dimOthers` dim on restore even though the host still holds the focus that
|
|
537
|
+
fed them. They come back when `path` / `nodes` change or a node or edge is
|
|
538
|
+
clicked. Before this, a path drawn from host state (e.g. "focus the clicked
|
|
539
|
+
node") dimmed the graph with no way back short of a host-side reset button.
|
|
540
|
+
- Covered by `src/api/modules/__tests__/EmphasisApi.restore.test.ts` and
|
|
541
|
+
`src/react/layers/effects/__tests__/useEmphasisRestore.test.tsx`.
|
|
542
|
+
|
|
543
|
+
### Fixed — a 2D canvas went 3D as soon as nodes were added
|
|
544
|
+
|
|
545
|
+
- `D3LayoutControllerAdapter` started at 3 dimensions whatever snapshot it
|
|
546
|
+
was built from. A canvas mounted with `is3D={false}` never calls
|
|
547
|
+
`transitionDimensions` (nothing changed), so the first structure change
|
|
548
|
+
(`nodes.add` after mount) re-initialised the force sim in 3D. Nodes drifted
|
|
549
|
+
off the z = 0 plane, rendered at the wrong depth (some huge, some tiny) and
|
|
550
|
+
`camera.flyToNodes` aimed at the wrong place. The adapter now starts in the
|
|
551
|
+
snapshot's dimension.
|
|
552
|
+
- Covered by `src/layout/__tests__/D3LayoutControllerAdapter.test.ts`
|
|
553
|
+
("a 2D snapshot stays 2D after nodes are added (no z drift)").
|
|
554
|
+
|
|
555
|
+
### Fixed — overlapping focus+context dims left the graph dark
|
|
556
|
+
|
|
557
|
+
- Each `FocusContextEffect` snapshotted its own "before" state. When two
|
|
558
|
+
overlapped (host `emphasis.focusContext` plus a layer's `dimOthers`, or a
|
|
559
|
+
new focus started before the old one stopped), the second snapshot was the
|
|
560
|
+
already-dimmed, already-enlarged graph, and stopping it put that back: the
|
|
561
|
+
graph stayed dim with no way out. Effects on one store now share a single
|
|
562
|
+
baseline. Only the last one to stop restores it; while others remain, the
|
|
563
|
+
newest re-applies its own dim.
|
|
564
|
+
- Covered by `src/animation/effects/__tests__/FocusContextEffect.overlap.test.ts`.
|
|
565
|
+
|
|
566
|
+
### Fixed — click-dim no longer takes over or wipes other focus dims
|
|
567
|
+
|
|
568
|
+
- Click-dim retargeted the first running focusContext of any owner, and
|
|
569
|
+
clearing it stopped every focusContext, including one a layer or the host
|
|
570
|
+
had started. It now drives only its own effect.
|
|
571
|
+
- Stopping an effect (`emphasis.stop`, `stopAll`) now schedules a repaint, so
|
|
572
|
+
an idle canvas no longer keeps showing the dimmed frame.
|
|
573
|
+
- Covered by `src/api/modules/__tests__/EmphasisApi.restore.test.ts`
|
|
574
|
+
("click-dim leaves a focusContext it did not start alone", "EffectManager
|
|
575
|
+
repaint on removal"); `EmphasisApi.clickDim.test.ts` updated to count
|
|
576
|
+
click-dim's listener on its own.
|
|
577
|
+
|
|
578
|
+
### Fixed — edge labels sit on the line the edge is drawn as
|
|
579
|
+
|
|
580
|
+
- `EdgeTextLayer` looked up curvature on a `store.edgeClassifier` that never
|
|
581
|
+
existed, so every label sat on the straight chord. The two labels of a
|
|
582
|
+
reciprocal pair (A→B and B→A, e.g. a cross-holding) were printed on top of
|
|
583
|
+
each other, and the label of an `orthogonal` edge floated off its elbow.
|
|
584
|
+
- Labels now follow the shape the edge renderer resolves: parallel and
|
|
585
|
+
reciprocal edges get the same multi-edge curvature (none in map mode, where
|
|
586
|
+
multi-edges are drawn straight), and an orthogonal edge's label goes at half
|
|
587
|
+
the length of its route (`orthoPolyline`), turned along that leg.
|
|
588
|
+
- `EdgeTextItem` gains an optional `path` (the drawn route); `getTextItems`
|
|
589
|
+
callers can set it too.
|
|
590
|
+
- Covered by `src/react/layers/__tests__/EdgeTextLayer.placement.test.tsx`.
|
|
591
|
+
|
|
592
|
+
### Fixed — a highlighted path rides the edge that runs its way
|
|
593
|
+
|
|
594
|
+
- `PathHighlightLayer` took the first edge joining two path nodes in either
|
|
595
|
+
direction. With a reciprocal pair (A→B and B→A) the hop A→B could follow
|
|
596
|
+
B→A, and when that one was drawn differently (an orthogonal elbow) the
|
|
597
|
+
highlight left the line it was meant to light. A forward edge now wins over
|
|
598
|
+
a reverse one.
|
|
599
|
+
- Covered by `src/react/layers/__tests__/effectLayers.test.ts` ("a hop takes
|
|
600
|
+
the edge that runs its way, not the reverse one of a reciprocal pair").
|
|
601
|
+
|
|
602
|
+
### Added — `NodeEffectLayer` can play a fixed number of cycles
|
|
603
|
+
|
|
604
|
+
- New `cycles` and `onComplete` props (also on `createNodeEffectLayer`). With
|
|
605
|
+
`cycles: n` each node plays n cycles, counted from when that node joins the
|
|
606
|
+
layer, then goes quiet, and the layer stops asking for frames. A `ripple`
|
|
607
|
+
emits its rings for n cycles and lets the last one reach the rim; the other
|
|
608
|
+
presets fade out over the last fifth of a cycle. A node that joins later (a
|
|
609
|
+
new filter match, a newly added node) gets its own full run, so
|
|
610
|
+
`cycles={1}` marks exactly what arrived. `onComplete` fires each time every
|
|
611
|
+
current node has finished.
|
|
612
|
+
- Before, an effect looped for as long as it was mounted, and hosts had to
|
|
613
|
+
unmount it on a timer. That is still the default when `cycles` is omitted.
|
|
614
|
+
- `nodeEffectRunLength(kind, cycles)` gives the run length in cycles.
|
|
615
|
+
- Covered by `src/react/layers/__tests__/effectLayers.test.ts` ("NodeEffectLayer
|
|
616
|
+
lifetime").
|
|
617
|
+
|
|
618
|
+
### Changed — photos, videos and cards draw above edge and halo effects
|
|
619
|
+
|
|
620
|
+
- `MediaLayer` and `NodeCardLayer` now default to overlay `bandOffset` 20
|
|
621
|
+
(`PANEL_BAND_OFFSET`), above `NodeEffectLayer` (4), `EdgeFlowLayer` (6),
|
|
622
|
+
markers (5–6) and `PathHighlightLayer` (11). At the old default of 0, a
|
|
623
|
+
highlighted path or a ripple was drawn across the photo or card at its end.
|
|
624
|
+
Now they run under the panel, the way built-in edges run under node dots.
|
|
625
|
+
- Pass `bandOffset` to get the old order back.
|
|
626
|
+
- Covered by `src/react/layers/__tests__/panelBand.test.tsx`.
|
|
627
|
+
|
|
628
|
+
### Fixed — a layout run while `forceLayout` is on stays where it put the nodes
|
|
629
|
+
|
|
630
|
+
- With the CPU force layout (`forceLayout` without WebGPU), `api.layout.*`,
|
|
631
|
+
`layout.setPositions` and `store.setPositions` moved the nodes for a moment,
|
|
632
|
+
and within a second the nodes snapped back. The write landed in a copy of
|
|
633
|
+
the positions that the next tick replaced, and the layout's pins never
|
|
634
|
+
reached the simulation. So nodes pinned earlier went back to their old pin
|
|
635
|
+
positions, and the rest drifted.
|
|
636
|
+
- The d3 controller now takes position writes and pins. A layout moves each
|
|
637
|
+
node in the simulation: a pinned node is re-anchored at its new spot, a free
|
|
638
|
+
node starts from there. `store.pinNodes` and `unpinNodes` set and clear
|
|
639
|
+
the simulation's pins. `unpinNodes` reheats a running simulation the way the
|
|
640
|
+
WebGPU controller does.
|
|
641
|
+
- Covered by `src/layout/__tests__/D3LayoutControllerAdapter.test.ts`
|
|
642
|
+
("writePositions / pinNodes / unpinNodes").
|
|
643
|
+
|
|
644
|
+
## 0.7.0 — 2026-11-25
|
|
645
|
+
|
|
646
|
+
The first release of `@kineviz/gl` on the public npm registry, under
|
|
647
|
+
Apache-2.0. Everything below is relative to 0.6.1, which was only ever
|
|
648
|
+
distributed inside the Kineviz workspace — so although this release contains
|
|
649
|
+
breaking changes, no npm consumer can be broken by them. Read the breaking
|
|
650
|
+
sections anyway if you are upgrading an in-house host from a workspace build.
|
|
651
|
+
|
|
652
|
+
The minor bump rather than a patch is because of those breaking changes: the
|
|
653
|
+
`three` peer range moves to `~0.184.0`, and the GPU layout controllers move to
|
|
654
|
+
the `@kineviz/gl/layout-gpu` subpath.
|
|
655
|
+
|
|
656
|
+
three.js moves from r121 (2020) to r184. Goal: get the existing WebGL path onto
|
|
657
|
+
a version that has WebGPU at all, without changing how anything looks or
|
|
658
|
+
behaves. This is the prerequisite step of the WebGPU renderer migration — no
|
|
659
|
+
WebGPU rendering code lands here, and the engine still has exactly one render
|
|
660
|
+
path.
|
|
661
|
+
|
|
662
|
+
### Added — license and attribution files
|
|
663
|
+
|
|
664
|
+
- **`LICENSE` (Apache-2.0) and `NOTICE` now ship in the package**, and
|
|
665
|
+
`package.json` declares `"license": "Apache-2.0"` instead of the placeholder
|
|
666
|
+
commercial-license pointer, which is removed. `NOTICE` lists every
|
|
667
|
+
third-party package the bundles carry with the license identifier read from
|
|
668
|
+
that package's own `package.json`. Source maps remain excluded from the
|
|
669
|
+
tarball (`!dist/**/*.map` in `files`), so no original TypeScript ships.
|
|
670
|
+
|
|
671
|
+
### Added — the remaining facade namespaces are exported, so they get API reference pages
|
|
672
|
+
|
|
673
|
+
- **`RendererApi`, `TypesApi`, `AlgorithmApi`, `HoverApi`, `OverlaysApi`,
|
|
674
|
+
`PlaybackApi`, `IoApi`, `QueryApi`, `SchemaApi` and `UiApi` are now exported
|
|
675
|
+
from the package entry** (`AlgorithmApi`, `HoverApi` and `SchemaApi` also from
|
|
676
|
+
the `api/` barrel). They were always reachable as `api.renderer`, `api.types`
|
|
677
|
+
and so on; what was missing was the exported class. The docs generator builds
|
|
678
|
+
the published reference by looking each facade property's class up in typedoc's
|
|
679
|
+
output, and typedoc only sees what the entry exports — so those ten namespaces,
|
|
680
|
+
a third of the API, had **no reference page at all**, which is how
|
|
681
|
+
`api.renderer.setNodeSizeScale` and `setMaxScreenFraction` could ship with
|
|
682
|
+
nowhere to document them. No behaviour change; nothing was renamed.
|
|
683
|
+
- `DebugApi` stays unexported on purpose: `api.debug` is a diagnostics surface,
|
|
684
|
+
not part of the documented API.
|
|
685
|
+
- Covered by `src/api/__tests__/namespaceExports.test.ts` (3 tests: the facade
|
|
686
|
+
still exposes its namespaces, every documented namespace's class is exported,
|
|
687
|
+
and the deliberate exception stays off the surface; dropping one export from
|
|
688
|
+
the entry file fails it).
|
|
689
|
+
|
|
690
|
+
### Changed — the published reference now matches the documented surface
|
|
691
|
+
|
|
692
|
+
- **Eight interaction-wiring methods are marked `@internal` and no longer appear
|
|
693
|
+
in the API reference**: `CameraApi.wireLayoutRuntime`, `EmphasisApi.wireInteraction`,
|
|
694
|
+
`HoverApi.wireHoverHandler`, `MapApi.wireIs3D` / `wireMapDamping` /
|
|
695
|
+
`wireMapMaxGrowth`, `RendererApi.wireMaxScreenFraction` / `wireNodeSizeScale`.
|
|
696
|
+
They are called by the React shell once the engine is mounted and were never
|
|
697
|
+
meant for hosts; they are still present at runtime, so nothing breaks. The
|
|
698
|
+
reference generator additionally skips `_`-prefixed members, which is what
|
|
699
|
+
removed the page for `api.layout._writePositionsNoUndo`.
|
|
700
|
+
- `api.renderer.setNodeSizeScale`'s documentation no longer describes how the
|
|
701
|
+
scale is applied internally; the observable guarantee (everything derived from
|
|
702
|
+
node size, including the clickable area, moves together) is unchanged.
|
|
703
|
+
- No test covers these, because nothing in the public surface changed — the
|
|
704
|
+
evidence is the generated output: `docs/content/api/*/wire*.mdx` and
|
|
705
|
+
`docs/content/api/layout/_writePositionsNoUndo.mdx` are gone, and the site
|
|
706
|
+
builds with zero broken links.
|
|
707
|
+
|
|
708
|
+
### Removed — BREAKING for hosts
|
|
709
|
+
|
|
710
|
+
- **`setLicenseKey` is gone**, along with `api/modules/LicenseApi.ts`. It stored
|
|
711
|
+
a string in module state and validated nothing — its own header said so — so
|
|
712
|
+
it gated no capability and stopped nobody. What it did do was tell host
|
|
713
|
+
developers they might owe a licence for code that never checked one. The
|
|
714
|
+
engine is heading for an open-source release; if licence enforcement ever
|
|
715
|
+
happens it belongs in a proprietary package that has something to enforce,
|
|
716
|
+
not in the renderer. Hosts calling it should delete the call: there is no
|
|
717
|
+
replacement and nothing to migrate to.
|
|
718
|
+
- Covered by `src/api/__tests__/namespaceExports.test.ts` (2 added tests: no
|
|
719
|
+
export from the package entry matches `/licen[cs]e/i`, and neither entry file
|
|
720
|
+
references a licence module; re-adding the export fails both).
|
|
721
|
+
|
|
722
|
+
### Changed — BREAKING for hosts
|
|
723
|
+
|
|
724
|
+
- **`forceLayout`'s default backend is now `"d3"` (CPU d3-force-3d), was
|
|
725
|
+
`"auto"`.** `"auto"` picked WebGPU whenever `navigator.gpu` existed, so the
|
|
726
|
+
same graph settled into a different shape depending on the viewer's browser:
|
|
727
|
+
a screenshot taken on one machine did not match another, and a layout tuned on
|
|
728
|
+
a GPU machine came out wrong for the half of the audience without one. The two
|
|
729
|
+
backends do not converge to the same layout, and d3-force-3d's reads better,
|
|
730
|
+
so the default is now the one that is also deterministic across machines.
|
|
731
|
+
WebGPU remains a per-canvas opt-in for **scale**: `forceLayout={{ engine:
|
|
732
|
+
"webgpu" }}`, or `{ engine: "auto" }` to restore exactly the old behaviour.
|
|
733
|
+
Requesting `"webgpu"` where it is unavailable still falls back to `"d3"` with
|
|
734
|
+
a dev-mode warning, so it is safe to request unconditionally.
|
|
735
|
+
- Covered by `src/react/__tests__/forceLayoutEngine.test.ts` (3 added/changed
|
|
736
|
+
tests: an unset engine resolves to `"d3"` **on the WebGPU-capable branch too**
|
|
737
|
+
— that branch is the whole regression — the default warns about nothing, and
|
|
738
|
+
`"auto"` still resolves to `"webgpu"`. Restoring the old
|
|
739
|
+
`hasWebGPU ? "webgpu" : "d3"` fallthrough fails two of them.)
|
|
740
|
+
|
|
741
|
+
- **The GPU force-layout classes moved off the package root to
|
|
742
|
+
`@kineviz/gl/layout-gpu`.** `GPUForceLayoutController`,
|
|
743
|
+
`GPULayoutControllerAdapter`, `WebGPUForceLayoutController`,
|
|
744
|
+
`WebGPULayoutControllerAdapter`, `GPUForceLayoutEngine`, `createForceLayout`
|
|
745
|
+
and `isWebGPUAvailable` are no longer exported from `@kineviz/gl`; the
|
|
746
|
+
classes themselves are unchanged, and the migration is one import path:
|
|
747
|
+
|
|
748
|
+
```diff
|
|
749
|
+
- import { WebGPUForceLayoutController } from "@kineviz/gl";
|
|
750
|
+
+ import { WebGPUForceLayoutController } from "@kineviz/gl/layout-gpu";
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
They were re-exported "for consumer convenience", and that convenience was
|
|
754
|
+
not free: a static re-export is an **eager** edge in the module graph, so
|
|
755
|
+
every host downloaded both GPU layout backends whether or not it ran one, and
|
|
756
|
+
the dynamic import below had nothing left to defer. **Using the WebGPU
|
|
757
|
+
backend needs none of these imports** — `forceLayout={{ engine: "webgpu" }}`
|
|
758
|
+
loads the controller on demand, unchanged.
|
|
759
|
+
- **The WebGPU force-layout backend is loaded on demand.** `GraphCanvas` now
|
|
760
|
+
reaches it through `await import("@kineviz/gpu-compute/webgpu")`, and
|
|
761
|
+
`@kineviz/gpu-compute` gained `./cpu` and `./webgpu` entries so that the
|
|
762
|
+
split is possible at all: it shipped as one bundled module holding all three
|
|
763
|
+
backends, and a dynamic import of one export from a single module cannot be
|
|
764
|
+
split by any bundler — there is no second module to put in the lazy chunk.
|
|
765
|
+
Measured on the real tsup build, the ESM entry went **428 → 385 KiB gzip**
|
|
766
|
+
(CJS 433 → 415; CJS has no code splitting, so it keeps the WebGPU code inline
|
|
767
|
+
and gains only from the re-exports leaving), with 28 KiB deferred to a chunk
|
|
768
|
+
fetched the first time a canvas asks for `engine: "webgpu"`. If that fetch
|
|
769
|
+
fails — offline, blocked, a bad deploy — the canvas falls back to `"d3"` with
|
|
770
|
+
a `console.warn` rather than rendering with no layout.
|
|
771
|
+
- Covered by `src/__tests__/gpuComputeSplit.test.ts` (10 tests: neither
|
|
772
|
+
`src/index.ts` nor `src/react/GraphContext.tsx` statically reaches
|
|
773
|
+
`@kineviz/gpu-compute` or `@kineviz/gpu-compute/webgpu`, both WebGPU call
|
|
774
|
+
sites still load the backend dynamically, the default engine still comes from
|
|
775
|
+
the `/cpu` entry, `src/layout-gpu.ts` exports all seven moved symbols, and the
|
|
776
|
+
`./layout-gpu` subpath is declared in `package.json` and built by tsup.
|
|
777
|
+
Verified by mutation: restoring the static import in `GraphContext.tsx`,
|
|
778
|
+
re-adding the root re-export, and swapping `D3LayoutControllerAdapter` back to
|
|
779
|
+
the barrel each fail it) and
|
|
780
|
+
`src/react/graph-context/__tests__/controllerSlot.test.ts` (5 tests for the
|
|
781
|
+
unmount race the async branch creates: a controller that arrives after
|
|
782
|
+
cleanup is destroyed and not published, one that arrives in time is handed
|
|
783
|
+
back to the caller exactly once, and a throwing `destroy` does not escape).
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
- **`three` peer dependency moves from `~0.121.0` to `~0.184.0`.** Hosts must
|
|
787
|
+
upgrade their own `three` to a 0.184.x before taking this release; the range
|
|
788
|
+
is now bounded on both sides in `@kineviz/gl` **and** in `@kineviz/gpu-compute`
|
|
789
|
+
(which previously declared an unbounded `>=0.121.0`, so the two packages could
|
|
790
|
+
drift). `@types/three` is pinned to the exact matching `0.184.0` in both
|
|
791
|
+
packages — it used to be `"*"`, which resolved to r184 types while the runtime
|
|
792
|
+
was r121, so type-checking had been validating 2020 code against 2026
|
|
793
|
+
declarations for the whole life of the package.
|
|
794
|
+
- **UMD consumers get a different bundled three.** `dist/kineviz-gl.umd.js`
|
|
795
|
+
bundles three (it always has). The frozen copy inside it is now r184 rather
|
|
796
|
+
than r121. Hosts on the ESM/CJS entry supply their own three and are
|
|
797
|
+
unaffected by what the UMD file contains.
|
|
798
|
+
- **three's automatic colour management is switched off at import time.**
|
|
799
|
+
three enables `ColorManagement` by default from r152; leaving it on would
|
|
800
|
+
silently re-interpret every colour this engine constructs as sRGB and convert
|
|
801
|
+
it, shifting the whole picture. `@kineviz/gl` sets
|
|
802
|
+
`THREE.ColorManagement.enabled = false` so rendering matches r121 exactly.
|
|
803
|
+
This is a **process-global** flag, so a host that wants three's colour
|
|
804
|
+
management for its own scenes in the same page cannot have it while
|
|
805
|
+
`@kineviz/gl` is loaded. Revisit is scheduled for the shader-equivalence step
|
|
806
|
+
of the migration.
|
|
807
|
+
- **Renderer classes are no longer exported.** `GPUNodeRenderer`, `GPUEdgeRenderer`,
|
|
808
|
+
`GPUGroupRingRenderer` and `GroupSphereRenderer` leave the public surface. Hosts that
|
|
809
|
+
constructed them directly use `createRenderBackend("webgl")` and its
|
|
810
|
+
`createNodeRenderer` / `createEdgeRenderer` / `createGroupRingRenderer` /
|
|
811
|
+
`createGroupSphereRenderer` factories; the returned objects keep today's method
|
|
812
|
+
surface (`NodeRendererBackend` etc.). No deprecated aliases. `createRenderBackend("webgpu")`
|
|
813
|
+
exists too, but its factories throw `WebGPUBackendNotReadyError` in this release. Covered by
|
|
814
|
+
`src/backends/__tests__/publicSurface.test.ts`, `createRenderBackend.test.tsx`.
|
|
815
|
+
- **`EventMap` gains `renderFault`.** Code that switches exhaustively over
|
|
816
|
+
`keyof EventMap` needs a new arm (same shape of change as `DirtyFlag.nodeLabels`).
|
|
817
|
+
|
|
818
|
+
### Fixed — API removals in three that this engine was using
|
|
819
|
+
|
|
820
|
+
Each of these was an engine-internal use of a three API that no longer exists;
|
|
821
|
+
none of them change `@kineviz/gl`'s own public surface.
|
|
822
|
+
|
|
823
|
+
- **Glyph atlas texture format.** `LuminanceFormat` went away with WebGL1
|
|
824
|
+
support (r163); the SDF glyph atlas now uses `RedFormat`, matching what
|
|
825
|
+
`IconAtlasManager` already used. Shader sampling was already `.r`, so no
|
|
826
|
+
shader change was needed.
|
|
827
|
+
- **Partial buffer uploads.** `BufferAttribute.updateRange` (a single
|
|
828
|
+
`{offset, count}` span) became the `updateRanges` array in r159 — 36 call
|
|
829
|
+
sites across `GPUNodeRenderer`, `GPUEdgeRenderer` and `BatchTextRenderer`.
|
|
830
|
+
The existing merge-into-one-contiguous-span behaviour is preserved exactly;
|
|
831
|
+
the merge logic is now one shared helper (`utils/bufferUpdateRange`) instead
|
|
832
|
+
of five hand-copied blocks. Covered by
|
|
833
|
+
`src/utils/__tests__/bufferUpdateRange.test.ts` and the existing
|
|
834
|
+
`src/backends/gpu/__tests__/GPUNodeRenderer.sparseSelection.test.tsx`.
|
|
835
|
+
- **Legacy instance-count mirror writes.** `InstancedBufferGeometry.maxInstancedCount`
|
|
836
|
+
(the deprecated alias) was removed in r125; the 21 mirror writes that existed
|
|
837
|
+
only to satisfy r121's `WebGLBufferRenderer` are gone, and `instanceCount` is
|
|
838
|
+
now the single source of truth. Covered by six new `instanceCount` assertion
|
|
839
|
+
files. **Note for layer authors:** the separate, underscore-prefixed
|
|
840
|
+
`geometry._maxInstanceCount` is a *different* property, it still exists in
|
|
841
|
+
r184, and the `delete` calls around it are still required — see the revised
|
|
842
|
+
note in `src/react/layers/LAYER_STANDARD.md`.
|
|
843
|
+
- **`Material.extensions.derivatives`** was removed with WebGL1 support; `fwidth()`
|
|
844
|
+
is core in WebGL2's GLSL ES 3.0. Removed from four materials.
|
|
845
|
+
- **`THREE.Quaternion.slerp(qa, qb, target, t)`** (static) → `target.slerpQuaternions(qa, qb, t)`
|
|
846
|
+
in the map fly-to animation.
|
|
847
|
+
- **`WebGLRenderer.getClearColor()`** now requires a target `Color`; the minimap's
|
|
848
|
+
save/restore passes one.
|
|
849
|
+
- **`Matrix4.getInverse()`** removal made `utils/threeCompat.ts` pointless — the
|
|
850
|
+
shim and its four call sites are replaced by direct `Matrix4.invert()`.
|
|
851
|
+
- **`ConeBufferGeometry`** (removed in r125) → `ConeGeometry` in the arrow
|
|
852
|
+
geometry. This one was invisible to the type checker because it sat behind an
|
|
853
|
+
`as any`; only the UMD bundler warned about it.
|
|
854
|
+
- **`three/examples/jsm/...` subpath imports now need the `.js` extension**,
|
|
855
|
+
because r184 ships an `exports` map that maps the path literally.
|
|
856
|
+
|
|
857
|
+
### Fixed — the published ESM bundle no longer imports a node builtin
|
|
858
|
+
|
|
859
|
+
A host bundling `@kineviz/gl` with webpack or Vite failed its whole build with
|
|
860
|
+
|
|
861
|
+
```
|
|
862
|
+
Module not found: Error: Can't resolve 'module' in '.../render-engine/dist'
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
`io.importGraphXR` lazily imports `@kineviz/parsers`, which the package bundles
|
|
866
|
+
in, and that reaches `fflate` for the `.graphxr` archive. `fflate`'s export map
|
|
867
|
+
puts a `node` condition first, and under esbuild's default platform that is the
|
|
868
|
+
condition tsup applied — so the emitted chunk opened with
|
|
869
|
+
`import { createRequire } from "module"` for a `worker_threads` path the parser
|
|
870
|
+
never calls. The build now sets `platform: "browser"`, which is what this
|
|
871
|
+
package is, and `fflate` resolves to its browser build instead. `unzipSync` and
|
|
872
|
+
`strFromU8` — the only two functions the parser uses — are identical in both.
|
|
873
|
+
Verified by the docs site's own webpack dev server, which went from "compiled
|
|
874
|
+
with 1 error" to clean, and by grepping the whole of `dist/` for node builtins:
|
|
875
|
+
there are now none.
|
|
876
|
+
|
|
877
|
+
### Changed — repository tooling
|
|
878
|
+
|
|
879
|
+
- **TypeScript moves from 4.8.4 to ^5.4.0 at the workspace root.** `three@0.121.0`
|
|
880
|
+
shipped its own `.d.ts` files, so `@types/three` was inert for this package;
|
|
881
|
+
r184 ships none, which puts `@types/three@0.184.0` into the compile for the
|
|
882
|
+
first time — and it uses `const` type parameters, which TypeScript 4.8 cannot
|
|
883
|
+
parse. Nine of the sixteen workspace packages were already on 5.9.3, and 5.9.3
|
|
884
|
+
was already in `yarn.lock`, so this resolves no new package.
|
|
885
|
+
|
|
886
|
+
### Known issues
|
|
887
|
+
|
|
888
|
+
- **The draw-call instrument's accuracy marker does not flip.** The performance
|
|
889
|
+
instrument marks its draw-call reading `approximate` on a renderer whose
|
|
890
|
+
`info.render` has no whole-frame `drawCalls` field, and expected r184 to add
|
|
891
|
+
one. It does not: `WebGLInfo.render` in r184 exposes the same five fields as
|
|
892
|
+
r121 (`calls / frame / lines / points / triangles`). `drawCalls` belongs to
|
|
893
|
+
the *common* renderer's `Info`, which only the WebGPU path uses. The marker
|
|
894
|
+
will stay `approximate` until the engine renders through that renderer.
|
|
895
|
+
|
|
896
|
+
### Fixed — `createNodeShaderLayer` custom layers were silently half-broken
|
|
897
|
+
|
|
898
|
+
Both bugs were invisible to the existing unit tests, which asserted CPU-side
|
|
899
|
+
state (the `Float32Array` contents, the dirty flag) and never the one thing that
|
|
900
|
+
decides what reaches the GPU. Found while building the multimedia docs examples
|
|
901
|
+
(`docs/content/examples/scenario-media-*`); see
|
|
902
|
+
the multimedia plan §8.
|
|
903
|
+
|
|
904
|
+
- **Non-dynamic per-node attributes never reached the GPU.** A `{ name, size,
|
|
905
|
+
value }` attribute declared without `dynamic: true` is refilled on membership
|
|
906
|
+
change only — and the refill wrote the CPU array without bumping the
|
|
907
|
+
attribute's `version`. `mount()` leaves `drawRange` at 0 and the layer's first
|
|
908
|
+
`frame()` lands after the engine's first render, so the buffer three had
|
|
909
|
+
already uploaded was the all-zero initial one, and it stayed that way for the
|
|
910
|
+
life of the layer. A per-node atlas-UV attribute therefore read `(0, 0)` on
|
|
911
|
+
every node and the layer drew fully transparent, with no error anywhere.
|
|
912
|
+
Layers whose attribute only *offsets* an animation (a per-node phase) looked
|
|
913
|
+
correct, which is why this survived. Covered by
|
|
914
|
+
`src/react/layers/__tests__/NodeShaderLayer.test.ts`
|
|
915
|
+
("flags a non-dynamic attribute for upload after it is refilled", plus a
|
|
916
|
+
version assertion in the structural-swap test).
|
|
917
|
+
- **`hideBuiltinNode: true` did nothing.** `GraphStore.setNodeFillSuppressed()`
|
|
918
|
+
marked `nodeSuppressFill` dirty but did not bump the store version, and
|
|
919
|
+
`GPUNodeRenderer.update()` opens with `if (!versionChanged &&
|
|
920
|
+
!positionNeedsUpdate && !sharedDirtyFlags) return;` — so the flag sat unconsumed
|
|
921
|
+
until some unrelated write happened to bump the version. The built-in dot kept
|
|
922
|
+
drawing under the custom layer; with an opaque custom layer it is invisible,
|
|
923
|
+
with a ring or a hologram it is not. Covered by
|
|
924
|
+
`src/core/__tests__/suppressFill.test.ts`
|
|
925
|
+
("bumps the store version so GPUNodeRenderer.update() does not early-return").
|
|
926
|
+
|
|
927
|
+
### Added — media system components (images, video, audio on nodes)
|
|
928
|
+
|
|
929
|
+
- **`MediaLayer` / `createMediaLayer`.** Put pictures and live video on nodes
|
|
930
|
+
without writing a shader: describe the panel (`shape`, `fit`, `aspect`,
|
|
931
|
+
`radius`, `border`, `tint`, `effects`) and where the pixels come from
|
|
932
|
+
(`image(node)` per node, `video: { url, crop }` shared), and the layer
|
|
933
|
+
compiles the fragment program, packs the stills into one atlas texture
|
|
934
|
+
(single draw call), decodes the video **once** for however many nodes show
|
|
935
|
+
it, and registers a hitbox the size of the panel it drew. Covered by
|
|
936
|
+
`src/react/layers/__tests__/MediaLayer.test.tsx` and
|
|
937
|
+
`src/react/layers/__tests__/mediaShader.test.ts`.
|
|
938
|
+
- **`AudioSpectrumLayer` / `createAudioSpectrumLayer`.** Audio as a node
|
|
939
|
+
decoration: point it at an `<audio>`/`<video>` element, pick
|
|
940
|
+
`style: "ring" | "bars" | "pulse" | "wave"`, and every targeted node carries
|
|
941
|
+
a live spectrum. The analyser is pumped from the layer's `frame()` — no
|
|
942
|
+
timers, per `docs/no-timers-policy.md`. Covered by
|
|
943
|
+
`src/react/layers/__tests__/AudioSpectrumLayer.test.tsx`.
|
|
944
|
+
- **`MediaAtlas`, `MediaVideoSource`, `AudioSpectrum` / `createAudioSpectrum`.**
|
|
945
|
+
The pieces the two layers are built from, exported for callers who want the
|
|
946
|
+
texture but not the layer. `AudioSpectrum` exposes a `bins × 1` RGBA texture
|
|
947
|
+
plus `level` and `beat`, reuses one `MediaElementAudioSourceNode` per element
|
|
948
|
+
(a second `createMediaElementSource` throws), and degrades to an inert zeroed
|
|
949
|
+
texture where WebAudio does not exist. Covered by the two test files above.
|
|
950
|
+
- **`buildMediaFragment`, `mediaNeedsTime`, `buildSpectrumFragment`,
|
|
951
|
+
`videoTileFor`.** The pure code generators and crop math behind the two
|
|
952
|
+
layers, exported so a caller can inspect or extend the generated GLSL.
|
|
953
|
+
Covered by `mediaShader.test.ts` and `MediaLayer.test.tsx`.
|
|
954
|
+
|
|
955
|
+
### Added — custom panel shapes
|
|
956
|
+
|
|
957
|
+
- **`MediaLayerSpec.shape` accepts every built-in node shape, and a function.**
|
|
958
|
+
Was `"rect" | "circle" | "squircle"`; now also `roundRect` `diamond`
|
|
959
|
+
`triangle` `hexagon` `star` `ring`, drawn through the engine's own
|
|
960
|
+
`kv_shapes.glsl` (`kvShapeSdf`) so a hexagon photo and a hexagon node dot are
|
|
961
|
+
the same outline, cross-checked against `core/shapes/reference.ts` by
|
|
962
|
+
`scripts/glsl-conformance.mjs`. Passing a **function** `(node, index) =>
|
|
963
|
+
ShapeName | number` shapes each node from a one-float attribute — still one
|
|
964
|
+
draw call. `rect`, `circle` and `squircle` stay inline, so a plain panel pulls
|
|
965
|
+
no shape code in at all. Covered by
|
|
966
|
+
`src/react/layers/__tests__/mediaShader.shapes.test.ts` and
|
|
967
|
+
`MediaLayer.test.tsx`.
|
|
968
|
+
- **`MediaLayerSpec.customSdf`.** A GLSL signed-distance expression in `vec2 q`
|
|
969
|
+
(panel space, y up, height 1, negative inside) for an outline the built-ins
|
|
970
|
+
do not cover. The one place a caller may hand-write GLSL, and deliberately one
|
|
971
|
+
expression rather than a program. Covered by `mediaShader.shapes.test.ts`.
|
|
972
|
+
- **`buildMediaHitMask`.** Generates the panel's picking mask from the same
|
|
973
|
+
outline code that drew it, so the two cannot drift. `MediaLayer` now always
|
|
974
|
+
uses it (`hitArea: "shape"`) instead of the old quad/circle approximation: a
|
|
975
|
+
click in a hexagon panel's corner, or in the empty band above a 16:9 panel on
|
|
976
|
+
its square billboard, falls through to whatever is behind. Covered by
|
|
977
|
+
`mediaShader.shapes.test.ts` and `MediaLayer.test.tsx`.
|
|
978
|
+
|
|
979
|
+
### Added — node cards (a whole record drawn as the node)
|
|
980
|
+
|
|
981
|
+
- **`NodeCardLayer` / `createNodeCardLayer` / `NodeCardLayerRenderer`.** Draws a
|
|
982
|
+
card per node — accent header, photo, every property as a `label: value` row,
|
|
983
|
+
badges, footer, a rotated stamp — by rasterising it into a shared atlas and
|
|
984
|
+
drawing it as a clickable panel. One texture, one draw call, hundreds of
|
|
985
|
+
cards; it composites in the scene (edges run behind it, it dims with
|
|
986
|
+
focus/context, it is pickable over its outline). Takes the same panel
|
|
987
|
+
vocabulary as `MediaLayer` (`shape`, `customSdf`, `aspect`, `border`, `tint`,
|
|
988
|
+
`effects`, `sizeFactor`, `clickable`, `hideBuiltinNode`). Covered by
|
|
989
|
+
`src/react/layers/__tests__/NodeCardLayer.test.tsx`.
|
|
990
|
+
- **`NodeCardSpec` / `NodeCardField` / `NodeCardTheme` / `resolveNodeCardTheme`.**
|
|
991
|
+
The interface through which business meaning enters: the engine sees a title,
|
|
992
|
+
rows and a photo URL, never what they mean. The host's `card(node, index)`
|
|
993
|
+
callback is the whole mapping. Covered by
|
|
994
|
+
`src/react/layers/__tests__/paintNodeCard.test.ts`.
|
|
995
|
+
- **`NodeCardLayerSpec.paint`.** Escape hatch: draw the cell by hand on its 2D
|
|
996
|
+
context. The door for anything the card spec cannot express, including
|
|
997
|
+
rasterising real HTML via an SVG `foreignObject` image (inline the fonts and
|
|
998
|
+
images — remote ones do not load inside such an SVG). Covered by
|
|
999
|
+
`NodeCardLayer.test.tsx`.
|
|
1000
|
+
- **`paintNodeCard` / `fitText`.** The pure painter and its text-truncation
|
|
1001
|
+
helper, exported so a host can draw the same card somewhere else (a legend, a
|
|
1002
|
+
tooltip, an export). Every measurement is a fraction of the card height, so
|
|
1003
|
+
raising `resolution` makes the same card sharper rather than different.
|
|
1004
|
+
Covered by `paintNodeCard.test.ts`.
|
|
1005
|
+
- **`NodeCardCache` / `loadPhoto`.** The rasteriser: one cell per node, one
|
|
1006
|
+
decode per photo URL however many cards show it, and no repaint when a card's
|
|
1007
|
+
spec has not changed — which is what makes bumping `revision` on every data
|
|
1008
|
+
edit cheap. Covered by
|
|
1009
|
+
`src/react/layers/__tests__/NodeCardCache.test.ts`.
|
|
1010
|
+
|
|
1011
|
+
### Added — HTML nodes (the DOM tier of the same idea)
|
|
1012
|
+
|
|
1013
|
+
- **`CardPlacement` gains `"center"`.** Puts a card ON its anchor instead of
|
|
1014
|
+
beside it, and — unlike the side placements — is deliberately NOT clamped into
|
|
1015
|
+
the viewport, so a card that *is* the node stays on the node when half of it
|
|
1016
|
+
is off screen. `placement: "auto"` never resolves to it. Covered by
|
|
1017
|
+
`src/react/layers/cards/__tests__/placement.test.ts`.
|
|
1018
|
+
- **`CardItem.hideNode` / `cards.set({ hideNode })`.** Suppresses the built-in
|
|
1019
|
+
dot under the card, so `{ placement: "center", hideNode: true }` makes the
|
|
1020
|
+
card the node — an HTML node, with real links, inputs, scrolling and
|
|
1021
|
+
selectable text. `CardLayer` owns exactly the ids it suppressed and releases
|
|
1022
|
+
only those, so two features suppressing the same node do not clear each
|
|
1023
|
+
other. Covered by `src/react/layers/cards/__tests__/CardLayer.test.tsx` and
|
|
1024
|
+
`src/api/modules/__tests__/CardsApi.test.ts`.
|
|
1025
|
+
- **`CardItem.scale` / `cards.set({ scale })`.** Card width in WORLD units, so
|
|
1026
|
+
it zooms with the graph like a node does — the same `50 / viewDepth`
|
|
1027
|
+
pixels-per-unit factor the node shader uses, clamped to `[0.08, 12]`. `0` (the
|
|
1028
|
+
default) keeps today's fixed pixel size. Covered by `CardLayer.test.tsx`.
|
|
1029
|
+
- **`cards.set({ template: "dossier" })` and the `DossierCard` preset.** The DOM
|
|
1030
|
+
counterpart of `NodeCardLayer`: every property of a node with its photo,
|
|
1031
|
+
header band, badges, stamp and footer, as styleable DOM. `imageKey`, `omit`,
|
|
1032
|
+
`fields`, `title`, `badges`, `stamp` and `footer` say what to show and what to
|
|
1033
|
+
call it; nothing in the preset knows what a dossier is about. Covered by
|
|
1034
|
+
`src/react/layers/cards/__tests__/presets.test.tsx`.
|
|
1035
|
+
|
|
1036
|
+
### Changed — click-dim is off by default, and never resizes a node
|
|
1037
|
+
|
|
1038
|
+
- **`clickDim` on `<GraphCanvas>` and `EmphasisApi`'s click-dim now default to
|
|
1039
|
+
`false`.** They defaulted to `true`, so every host that only wanted clicks to
|
|
1040
|
+
SELECT also got the whole graph fading out around the clicked node's 1-hop
|
|
1041
|
+
neighborhood. A plain click now selects and nothing else in the scene moves.
|
|
1042
|
+
Hosts that want the old behaviour pass `clickDim` (or call
|
|
1043
|
+
`api.emphasis.setClickDimEnabled(true)`) — the feature itself is unchanged.
|
|
1044
|
+
The `setClickDimEnabled` JSDoc already documented `false`; the code was what
|
|
1045
|
+
disagreed. Covered by
|
|
1046
|
+
`src/api/modules/__tests__/EmphasisApi.clickDim.test.ts`.
|
|
1047
|
+
- **Click-dim passes `focusScale: 1`, so the kept set no longer grows.** It
|
|
1048
|
+
inherited `FocusContextEffect`'s `1.3` default, which made every click pop
|
|
1049
|
+
the clicked node and its neighbors 30% larger — the graph appeared to jump
|
|
1050
|
+
under the cursor. The dim is now opacity only. `focusContext()` called
|
|
1051
|
+
directly keeps the `1.3` default for callers who want the pop. Covered by
|
|
1052
|
+
`EmphasisApi.clickDim.test.ts`.
|
|
1053
|
+
|
|
1054
|
+
### Fixed — geometry that comes close to the camera no longer takes the frame
|
|
1055
|
+
|
|
1056
|
+
Animations in this engine move the SCENE, so a flight goes *through* the graph
|
|
1057
|
+
rather than past it, and every pass brings nodes and edges within a fraction of
|
|
1058
|
+
a unit of the camera. Two separate things went wrong there, and both of them
|
|
1059
|
+
ended the same way: one shape covering the whole frame.
|
|
1060
|
+
|
|
1061
|
+
- **An edge with one end behind the camera drew a sheet across the screen.**
|
|
1062
|
+
The edge strip is built in screen space — the shader divides by `clip.w` and
|
|
1063
|
+
adds the widening offset in clip space — so a vertex behind the camera
|
|
1064
|
+
(`clip.w < 0`) is mirrored through the origin by that divide, and the quad
|
|
1065
|
+
joining it to its still-visible neighbour stretches over the entire viewport
|
|
1066
|
+
as a flat field of the edge's colour. No width setting could affect it: the
|
|
1067
|
+
width was right, the position was wrong. `edge.vert.glsl` now trims the
|
|
1068
|
+
segment to the camera plane before anything is derived from its endpoints —
|
|
1069
|
+
once per edge instance, so every vertex of the strip reaches the same
|
|
1070
|
+
decision and the strip cannot tear, and before the control point and the
|
|
1071
|
+
polyline are built, so a curved edge is rebuilt from the trimmed end. An edge
|
|
1072
|
+
with *both* ends behind is left alone; the hardware clips those triangles.
|
|
1073
|
+
Measured on the AML route-replay example flown at `distance: 26`, worst frame
|
|
1074
|
+
of a 21-point scrub, share of the canvas covered by one colour: **40.5% → 2.5%**,
|
|
1075
|
+
and total ink **57.2% → 5.7%**. Covered by
|
|
1076
|
+
`src/shaders/__tests__/screenCap.shader.test.ts`.
|
|
1077
|
+
- **A node or edge that stayed in front but came very close grew without
|
|
1078
|
+
bound.** Outside map mode apparent size goes as `size × 50 / depth`: the node
|
|
1079
|
+
quad was clamped at 4096 px (a screen-spanning disc) and the edge strip had
|
|
1080
|
+
no upper bound at all. `kvScreenCap` in `kv_mapGrowth.glsl` now caps on-screen
|
|
1081
|
+
size against a share of the smaller viewport dimension, reusing map mode's
|
|
1082
|
+
soft knee — below half the cap it is the identity, so anything that was not
|
|
1083
|
+
already blowing up renders exactly as before. Evaluated on the shipped GLSL,
|
|
1084
|
+
1200×800 viewport, a styled size-6 node: at depth 2 unchanged at 150 px; at
|
|
1085
|
+
depth 0.2 **1500 px → 373 px**; at depth 0.05 **6000 px → 393 px**. Applied in
|
|
1086
|
+
`node.vert.glsl` (the finished quad, selection and ripple/halo expansion
|
|
1087
|
+
included), `picking.vert.glsl` (so the hitbox cannot outgrow the quad and
|
|
1088
|
+
swallow every click in the frame), and `edge.vert.glsl` / `arrow.vert.glsl`
|
|
1089
|
+
(endpoint pullback and cone, so they stay on the capped bubble). The strip
|
|
1090
|
+
width gets an eighth of a node's share, because a capped bubble is a disc of
|
|
1091
|
+
the cap while a capped strip is a band of it running the length of the frame:
|
|
1092
|
+
at an equal share the bubble was tamed and the band still took a third of the
|
|
1093
|
+
canvas.
|
|
1094
|
+
|
|
1095
|
+
- **What the cap costs: nothing measurable.** Frame time during playback of the
|
|
1096
|
+
same flight, with the cap toggled at runtime inside one build and ordered
|
|
1097
|
+
A/B/A so drift shows up as the two A windows disagreeing (1360×900 viewport,
|
|
1098
|
+
SwiftShader, one 600-sample frame-time ring per window): cap on
|
|
1099
|
+
**1.52 ms** mean / 4.20 ms p95, cap off **1.36 ms** / 4.20 ms, cap on again
|
|
1100
|
+
**1.14 ms** / 3.30 ms. The spread between two identical configurations is
|
|
1101
|
+
wider than the gap between on and off, which is what two compares and a
|
|
1102
|
+
divide per vertex ought to look like. What it buys across those same windows:
|
|
1103
|
+
worst-frame largest single colour **3.0% → 1.4%** of the canvas and total ink
|
|
1104
|
+
**8.4% → 2.9%**, with both cap-on windows landing on the same figure. Raw
|
|
1105
|
+
the recorded near-camera A/B/A flight readings.
|
|
1106
|
+
Two traps for whoever measures this next, both of which produced a false
|
|
1107
|
+
reading first: the engine only redraws on dirty since U9, so a static scene
|
|
1108
|
+
stops producing frames and the ring goes stale (the numbers must be taken
|
|
1109
|
+
during an animation), and `totalObserved` is cumulative across windows, so it
|
|
1110
|
+
is not a per-window frame count and must not be read as a frame rate. The
|
|
1111
|
+
near-plane trim has no runtime toggle, so it is present in all three windows;
|
|
1112
|
+
its own effect is the scrub measurement above.
|
|
1113
|
+
|
|
1114
|
+
### Added — `api.renderer.setMaxScreenFraction` / `getMaxScreenFraction`
|
|
1115
|
+
|
|
1116
|
+
- **The near-camera size cap is a knob.** `setMaxScreenFraction(0.5)` is the
|
|
1117
|
+
default and means one node's diameter never covers more than half the smaller
|
|
1118
|
+
viewport dimension; `Infinity` switches the cap off and restores the pre-cap
|
|
1119
|
+
behaviour exactly (the shader sentinel is `-1.0`, the convention
|
|
1120
|
+
`mapMaxGrowth` already uses). Values `<= 0` warn and fall back. The value
|
|
1121
|
+
fans out to the node renderer, the edge + arrow materials and the node
|
|
1122
|
+
picking material, and `wireMaxScreenFraction` replays the current value on
|
|
1123
|
+
wire so the uniforms agree with the api on the first frame. Badge and tag are
|
|
1124
|
+
deliberately not capped — their pixel offsets scale with depth but not with
|
|
1125
|
+
node size, so there is no fraction they could apply that would match, and at
|
|
1126
|
+
the range the cap engages a badge's offset has already left the screen.
|
|
1127
|
+
Covered by `src/api/__tests__/RendererApi.maxScreenFraction.test.ts`,
|
|
1128
|
+
`src/backends/gpu/__tests__/screenCapUniform.test.tsx` and
|
|
1129
|
+
`src/shaders/__tests__/screenCap.shader.test.ts`.
|
|
1130
|
+
|
|
1131
|
+
### Added — `api.renderer.setNodeSizeScale` / `getNodeSizeScale`
|
|
1132
|
+
|
|
1133
|
+
- **The global node size multiplier is a knob.** Reported as "节点现在很小" of
|
|
1134
|
+
the cinematics examples. Outside map mode a node's apparent size is
|
|
1135
|
+
`size × scale × 50 / depth` (`node.vert.glsl`), so **depth 50 is the reference**
|
|
1136
|
+
where a node draws at exactly its configured size in CSS px. The shots fly at
|
|
1137
|
+
a `distance` of 280–420 — 5.6× to 8.4× that reference — so a 15 px node
|
|
1138
|
+
arrives 2–3 px wide and a route that reads in the overview reads as dust in
|
|
1139
|
+
flight. `setNodeSizeScale(distance / 50)` buys it back; `1` is the default.
|
|
1140
|
+
Values `<= 0` or non-finite warn and fall back to `1`, and `Infinity` is
|
|
1141
|
+
rejected here rather than passed through (it is the "no cap" sentinel on
|
|
1142
|
+
`setMaxScreenFraction`, but NaN-sized geometry on this one).
|
|
1143
|
+
|
|
1144
|
+
Measured on the AML example at a fixed camera pose, by horizontal runs of
|
|
1145
|
+
non-background pixels at full canvas resolution (a node blob makes a run about
|
|
1146
|
+
its diameter wide), with `effectiveSizes[0]` read off the store:
|
|
1147
|
+
|
|
1148
|
+
| scale | `effectiveSizes[0]` | node run p90 | p99 | max |
|
|
1149
|
+
|---|---|---|---|---|
|
|
1150
|
+
| 1 (before) | 22.5 | 7 px | 9 px | 9 px |
|
|
1151
|
+
| 6 (`300 / 50`) | 135 | 27 px | 29 px | 33 px |
|
|
1152
|
+
| 12 | 270 | 57 px | 59 px | 64 px |
|
|
1153
|
+
|
|
1154
|
+
- **It lives on `RendererApi`, not `StyleApi`, because it must not be undoable.**
|
|
1155
|
+
`StyleApi.setDefaultNodeSize` goes through `SetDefaultNodeSizeCommand` and is
|
|
1156
|
+
recorded in history; a flight that raised the scale on take-off and restored
|
|
1157
|
+
it on landing would leave two entries on the undo stack per flight, and an
|
|
1158
|
+
undo of a graph edit made before the flight would have to walk back through
|
|
1159
|
+
them first. `RendererApi` already documents its knobs as non-undoable UI
|
|
1160
|
+
state, and `maxScreenFraction` — the other global render parameter the
|
|
1161
|
+
flights need — is the same shape, down to the late-bound sink.
|
|
1162
|
+
|
|
1163
|
+
- **One store write, five consumers.** The value is folded into
|
|
1164
|
+
`GraphStore.effectiveSizes` (`sizes[i] × scale × NODE_CAPTION_FACTOR`); the
|
|
1165
|
+
shader-side `nodeSizeScale` uniform stays pinned at 1.0 as before. The node
|
|
1166
|
+
geometry aliases that array zero-copy, the picker shares the node attribute,
|
|
1167
|
+
and the edge renderer packs from it, so the quad, the hitbox, the edge
|
|
1168
|
+
endpoint, the arrow back-off, self-loop radii and label sizing all move
|
|
1169
|
+
together. `setMaxScreenFraction` still applies on top, so a large scale cannot
|
|
1170
|
+
let one node take the frame during a close pass. `wireNodeSizeScale` replays
|
|
1171
|
+
the current value on wire (same contract as `wireMaxScreenFraction`), and
|
|
1172
|
+
GraphContext pushes the `node={{ nodeScale }}` prop into the api *before*
|
|
1173
|
+
wiring so one mount yields exactly one downstream push — the prop's value, not
|
|
1174
|
+
the default on top of it.
|
|
1175
|
+
|
|
1176
|
+
- **`DEFAULT_NODE_SIZE_SCALE`** (new, `src/core/nodeSizeScale.ts`, not exported
|
|
1177
|
+
from the package) is now the single source of the `1.0` that
|
|
1178
|
+
`GraphStore._globalNodeSizeScale` and the api both start at; they used to
|
|
1179
|
+
repeat the literal, and a drift would make `getNodeSizeScale()` misreport the
|
|
1180
|
+
picture until the first write.
|
|
1181
|
+
|
|
1182
|
+
Covered by `src/api/__tests__/RendererApi.nodeSizeScale.test.ts` (the api
|
|
1183
|
+
edge, the validation, the replay, and what the scale does to the sizes every
|
|
1184
|
+
renderer reads) and
|
|
1185
|
+
`src/backends/gpu/__tests__/nodeSizeScaleLockstep.test.tsx` (the quad, the
|
|
1186
|
+
edge endpoints and the pick hitbox, each through its own mechanism). Four
|
|
1187
|
+
mutations were applied to each file to confirm the assertions bite: removing
|
|
1188
|
+
the validation guard (7 failures), dropping the replay (3), not calling the
|
|
1189
|
+
sink (3), drifting the default (4), no-oping the edge setter (2), skipping the
|
|
1190
|
+
edge repack (1), and dropping the scale from `effectiveSizes` (3).
|
|
1191
|
+
|
|
1192
|
+
- **What the bigger nodes cost.** Six times the diameter is up to 36 times the
|
|
1193
|
+
fragments, so the scale is not free. Measured on `scenario-subject-expansion`
|
|
1194
|
+
during the same walk, flipping only the scale, from the engine's own
|
|
1195
|
+
`frame-time` channel (`__kinevizPerf`, the channel `gl-perf-bench` reads) plus
|
|
1196
|
+
raw `requestAnimationFrame` deltas:
|
|
1197
|
+
|
|
1198
|
+
| scale | engine frame-time mean | p95 | rAF p50 | rAF p95 |
|
|
1199
|
+
|---|---|---|---|---|
|
|
1200
|
+
| 1 | 3.24 ms | 4.7 ms | 16.7 ms | 16.8 ms |
|
|
1201
|
+
| 6 | 5.0–5.3 ms | 6.4–9.2 ms | 16.7 ms | 50–67 ms |
|
|
1202
|
+
|
|
1203
|
+
Read that with the caveat that the harness is headless SwiftShader — a CPU
|
|
1204
|
+
rasteriser pays full price for fill rate, where a GPU mostly does not — so
|
|
1205
|
+
treat it as an upper bound and as a reason the scale is a knob per example
|
|
1206
|
+
(`FLY_DISTANCE / 50`, one constant) rather than something the engine applies
|
|
1207
|
+
on its own. The write itself is one `O(nodes)` pass over `effectiveSizes` per
|
|
1208
|
+
gesture, outside the render loop.
|
|
1209
|
+
|
|
1210
|
+
- **The four cinematics examples use it.** `scenario-cinematic-flythrough`
|
|
1211
|
+
(420 → 8.4), `scenario-aml-route-replay` (300 → 6),
|
|
1212
|
+
`scenario-subject-expansion` (300 → 6) and
|
|
1213
|
+
`scenario-network-topology-sweep` (280 → 5.6) each derive the scale from the
|
|
1214
|
+
shot's own `distance`, as `FLY_DISTANCE / 50`. A flight raises the scale and
|
|
1215
|
+
**leaves it raised** — a shot ends where it stops, so restoring on landing
|
|
1216
|
+
would shrink the final frame back to dust — while a frame puts it back to `1`,
|
|
1217
|
+
because a frame pulls in only as far as its nodes need and a raised scale
|
|
1218
|
+
there would hit the near-camera cap with one node across half the screen. The
|
|
1219
|
+
AML example never lands (the timeline owns the camera for the rest of the
|
|
1220
|
+
session), so it sets the scale once at cue. Verified in the browser on all
|
|
1221
|
+
four: the store reports the expected scale, node runs in flight are p99
|
|
1222
|
+
13–35 px against 2–9 px before, and no console or page errors.
|
|
1223
|
+
|
|
1224
|
+
### Fixed — a path flight no longer lurches between waypoints
|
|
1225
|
+
|
|
1226
|
+
Reported as "跳跃感很强" — the flights jumped. Two causes, both measured on a
|
|
1227
|
+
9-waypoint route with the uneven spacing a graph layout always produces.
|
|
1228
|
+
|
|
1229
|
+
- **The curve swung wide of the short hops.** `pathShot` built its Catmull-Rom
|
|
1230
|
+
with uniform parameterisation, which overshoots when the waypoints are not
|
|
1231
|
+
evenly spaced: a hop whose endpoints were 30 units apart had an arc length of
|
|
1232
|
+
**70** — the camera travelled 2.3× the hop, out and back, which is exactly
|
|
1233
|
+
what a lurch is. Worse, it inverted the speeds: that 30-unit hop given 500 ms
|
|
1234
|
+
moved at 2.3 units/frame while a 254-unit hop given 3400 ms moved at 1.2, so
|
|
1235
|
+
the short hops outran the long ones. The default is now `"centripetal"`
|
|
1236
|
+
(Lee 1989), the standard cure, which keeps cusps and self-intersections out
|
|
1237
|
+
of the path: every segment's arc length drops to **1.0×** its hop, and the
|
|
1238
|
+
worst speed step between consecutive frames falls from **0.9 to 0.3 units**.
|
|
1239
|
+
`PathShotOptions.curveType` is new and takes `"centripetal" | "chordal" |
|
|
1240
|
+
"catmullrom"`, so the old uniform curve is still one option away.
|
|
1241
|
+
- **Within a leg, the easing was applied to the curve parameter rather than to
|
|
1242
|
+
distance.** `easeInOut` shaped how fast `u` advanced, and how much ground a
|
|
1243
|
+
given `u` covers is up to the curve, so the intended ease-in/ease-out came
|
|
1244
|
+
out as a speed spread of **3.67×** and **4.16×** on the two long legs of that
|
|
1245
|
+
route. The leg now interpolates along an arc-length table and maps back to a
|
|
1246
|
+
parameter, so the camera spends `easeInOut(q)` of the segment's LENGTH at
|
|
1247
|
+
fraction `q` of the leg's time, and the spread is **1.92×** — the easing
|
|
1248
|
+
itself, nothing more. The table is 600 samples built once per shot.
|
|
1249
|
+
|
|
1250
|
+
Covered by `src/cinematics/__tests__/shots.test.ts`. Both changes alter the
|
|
1251
|
+
path a flight takes, so a host that pinned a screenshot of a flight will see it
|
|
1252
|
+
move; the schedule (`duration`, `marks`, when each waypoint is reached) is
|
|
1253
|
+
unchanged.
|
|
1254
|
+
|
|
1255
|
+
### Fixed — a flight no longer rolls the graph over, so it reads as a camera move
|
|
1256
|
+
|
|
1257
|
+
Reported as "画布旋转感觉在跳跃,看着会头晕" — the canvas felt like it was
|
|
1258
|
+
spinning rather than the camera moving, and watching it was nauseating. The
|
|
1259
|
+
engine's camera genuinely never moves (`cloudScene` is what pans, zooms and
|
|
1260
|
+
turns), but that is an implementation detail: the transform `CameraDirector`
|
|
1261
|
+
applies is already the exact inverse of a camera orbit about the focus, so a
|
|
1262
|
+
flight *should* be indistinguishable from one. Three defects in the orientation
|
|
1263
|
+
were what gave it away. Measured on the AML route example with
|
|
1264
|
+
`heading: "chase"`:
|
|
1265
|
+
|
|
1266
|
+
| | before | after |
|
|
1267
|
+
| --- | --- | --- |
|
|
1268
|
+
| worst roll off level | **161.5°** | 13.3° (the bank it asked for) |
|
|
1269
|
+
| worst roll change in one frame | 5.76° (346°/s) | 0.57° |
|
|
1270
|
+
| worst total turn in one frame | 5.80° | 2.54° |
|
|
1271
|
+
| roll with `bank: 0` | 161.4° | **exactly 0** |
|
|
1272
|
+
|
|
1273
|
+
- **`headingQuaternion` had no up vector.** It built the orientation with
|
|
1274
|
+
`setFromUnitVectors(dir, viewAxis)`, which is the MINIMAL rotation carrying
|
|
1275
|
+
`dir` onto the view axis: it turns about `dir × viewAxis`, and nothing
|
|
1276
|
+
anywhere constrained the roll. The camera ended up rolled by however the path
|
|
1277
|
+
happened to lie in space — the graph went very nearly upside down partway
|
|
1278
|
+
through the flight — and near `dir ≈ +Z` the function falls back to an
|
|
1279
|
+
arbitrary perpendicular axis, so the roll did not merely drift, it snapped.
|
|
1280
|
+
Rolling the view is the single most reliable way to make a viewer
|
|
1281
|
+
motion-sick, which is exactly what was reported. The orientation is now built
|
|
1282
|
+
as a camera basis (forward, up, right), levelled against `baseOrientation`'s
|
|
1283
|
+
up rather than the world's so a shot that starts from a tilted view stays in
|
|
1284
|
+
that frame. Yaw and pitch do as they are told; roll belongs to `bank` alone.
|
|
1285
|
+
- **`bank` took its direction from a step function.** The lean was
|
|
1286
|
+
`bank × magnitude × Math.sign(_b.x - _a.x)` — the sign of a world-axis
|
|
1287
|
+
difference — so it inverted the full lean in a single frame whenever that
|
|
1288
|
+
difference crossed zero, a `2 × bank` snap. It now rotates the bend vector
|
|
1289
|
+
into the camera's own frame and reads the lean off its screen-x directly, so
|
|
1290
|
+
the camera leans into whichever side of the frame the bend is on, by however
|
|
1291
|
+
far off to that side it is, continuously through zero.
|
|
1292
|
+
- **The curvature window was clamped instead of shrunk.** `max(0, u - 0.02)`
|
|
1293
|
+
and `min(1, u + 0.02)` collapse one chord while the other keeps its length
|
|
1294
|
+
near the ends of the curve, so both the size and the direction of the lean
|
|
1295
|
+
came out of that asymmetry rather than out of the path — the worst roll of
|
|
1296
|
+
the entire flight sat in the opening half-second. The window is now
|
|
1297
|
+
symmetric (`h = min(0.02, u, 1 - u)`), which takes the lean smoothly to zero
|
|
1298
|
+
at both ends: 3.42° in one frame down to 0.65°.
|
|
1299
|
+
|
|
1300
|
+
`heading: "lead"` improves by the same mechanism: worst turn per frame 4.88° to
|
|
1301
|
+
1.03°, and 0.4% of frames now exceed 60°/s against 4.3% for `chase`. What
|
|
1302
|
+
remains on `chase` is a real camera move at a real corner — the route's last hop
|
|
1303
|
+
doubles back on itself — and the yaw rate over the whole flight is a median of
|
|
1304
|
+
9°/s with a 90th percentile of 43°/s.
|
|
1305
|
+
|
|
1306
|
+
`headingQuaternion` is exported, so a host calling it directly gets the levelled
|
|
1307
|
+
result. Covered by `src/cinematics/__tests__/shots.test.ts` (the
|
|
1308
|
+
`headingQuaternion` block and `pathShot — the horizon, over a whole flight`);
|
|
1309
|
+
each of the three fixes is independently killed by those tests.
|
|
1310
|
+
|
|
1311
|
+
### Changed — a path flight glides through its waypoints instead of stopping on each one
|
|
1312
|
+
|
|
1313
|
+
Reported as "没有科技感" alongside the lurch above, and measured first: on the
|
|
1314
|
+
AML route example (8 waypoints, legs 500–3400 ms), a flight was **fully
|
|
1315
|
+
stationary for 34% of its frames** — 427 of 1243 at 60 fps, across 8 separate
|
|
1316
|
+
stalls — and `warp` was exactly 0 for the same share. `WarpTunnelLayer` reads
|
|
1317
|
+
`warp`, so the speed streaks switched off at every node rather than sustaining.
|
|
1318
|
+
Both numbers came straight from the design: `dwell` held the camera exactly on
|
|
1319
|
+
the waypoint, and `warp` published `sin(π × legProgress)`, which is 0 at both
|
|
1320
|
+
ends of every leg by construction.
|
|
1321
|
+
|
|
1322
|
+
This reverses a decision that was deliberate and is recorded in its own test —
|
|
1323
|
+
"the hold is what makes a path readable: it lands on the node, not near it". It
|
|
1324
|
+
was a product call, and it was made: glide is now the default, and the old hold
|
|
1325
|
+
is `glide: 0`.
|
|
1326
|
+
|
|
1327
|
+
- **`PathShotOptions.glide`** (`0..1`, default `1`). At `1` the camera slows to
|
|
1328
|
+
about a fifth of the cruise on each side of the node — the incoming leg sets
|
|
1329
|
+
how it arrives and the outgoing one how it leaves — passes exactly through
|
|
1330
|
+
the node at the middle of its `marks` window, and accelerates away. At `0` it comes to
|
|
1331
|
+
a dead stop and holds, as before.
|
|
1332
|
+
- **The schedule does not move.** `duration` and `marks` are byte-identical at
|
|
1333
|
+
either setting, and the node still sits at the centre of its window, so
|
|
1334
|
+
anything hung off a mark — a card, a ripple, a scrub cursor, the AML
|
|
1335
|
+
example's case-time mapping — needs no adjusting. Only where the camera is
|
|
1336
|
+
*during* a window changes.
|
|
1337
|
+
- **How.** The legs no longer ease one at a time; easing a leg inside its own
|
|
1338
|
+
window is what forces the speed to zero at both of its ends. The whole
|
|
1339
|
+
flight's "time → arc length" is fitted as one monotone cubic Hermite
|
|
1340
|
+
(Fritsch–Carlson 1980) through the leg boundaries, so speed is continuous
|
|
1341
|
+
everywhere by construction and the monotone limiter rules out an overshoot in
|
|
1342
|
+
the distance axis — which would mean flying backwards.
|
|
1343
|
+
- **`warp` now reports speed**, normalised against the fastest the flight ever
|
|
1344
|
+
goes, with a square-root shaping because a data-paced route spreads its
|
|
1345
|
+
per-leg cruise over 6.4× (that route: 0.096 to 0.618 units/ms) and a linear
|
|
1346
|
+
map leaves every slow leg looking like a standstill.
|
|
1347
|
+
|
|
1348
|
+
Measured on the same route, `glide: 0` against the default:
|
|
1349
|
+
|
|
1350
|
+
| | hold | glide |
|
|
1351
|
+
| --- | --- | --- |
|
|
1352
|
+
| static frames | 427 / 1243 (34%), 8 stalls | 53 / 1243 (4%), 2 |
|
|
1353
|
+
| frames with `warp == 0` | 434 (35%) | 55 (4%) |
|
|
1354
|
+
| worst frame-to-frame speed step | 1.93 units | 0.55 units |
|
|
1355
|
+
| lowest `warp` in flight (peak 0.5) | 0.000 | 0.080 |
|
|
1356
|
+
|
|
1357
|
+
Confirmed in the browser rather than only against the sampler, by hashing the
|
|
1358
|
+
rendered canvas every frame through the example's own 22-second flight: the
|
|
1359
|
+
picture stopped changing for **104 of 478 frames across 7 separate stalls**
|
|
1360
|
+
with the hold, against **55 of 492 in 2** — and those 2 are the opening and
|
|
1361
|
+
closing rest. (The share is lower than the sampler's because the warp tunnel
|
|
1362
|
+
and the money-as-traffic parcels keep some pixels moving even while the camera
|
|
1363
|
+
is parked, which is exactly why the stall count is the number that matters.)
|
|
1364
|
+
|
|
1365
|
+
The 4% that remains is the half-dwell of rest the flight deliberately opens and
|
|
1366
|
+
closes on, which is also the only reason `warp` reaches 0 at all: between
|
|
1367
|
+
leaving the first node and landing on the last it never drops below 0.080 of
|
|
1368
|
+
its 0.5 peak, and at the interior waypoints it sits between 0.107 and 0.194.
|
|
1369
|
+
|
|
1370
|
+
One case does not improve: give every leg the same time regardless of its
|
|
1371
|
+
length and the change of speed gets squeezed into the dwell rather than spread
|
|
1372
|
+
over the leg, so glide buys nothing there — measured at 1.03× the old worst
|
|
1373
|
+
speed step on a fixture whose hops are 400 and 30 units with 2000 ms each. It
|
|
1374
|
+
is pinned at "must not cost anything" rather than claimed as a win.
|
|
1375
|
+
|
|
1376
|
+
Cost: 2.7 µs per sampled frame (0.02% of a 16.7 ms budget) and 0.37 ms to build
|
|
1377
|
+
a flight, both measured on that route. Covered by
|
|
1378
|
+
`src/cinematics/__tests__/shots.test.ts`; the three tests that asserted the
|
|
1379
|
+
hold now sit in a `glide: 0` block, with the reversal recorded where they were.
|
|
1380
|
+
|
|
1381
|
+
### Added — cinematics (camera choreography, sci-fi layers, flyable layouts)
|
|
1382
|
+
|
|
1383
|
+
Animation aimed at reading data in 3-D, not at decoration: the engine's camera
|
|
1384
|
+
never moves, so all of this is layers and pure functions over the public
|
|
1385
|
+
extension points. Nothing in engine core changed.
|
|
1386
|
+
|
|
1387
|
+
- **`createCinematics(api)`** returns `flyPath` / `cuePath` / `orbit` /
|
|
1388
|
+
`warpTo` / `establish` / `frame` / `stop`, each a promise that resolves
|
|
1389
|
+
when the move lands, plus `warp` (0..1) and `playing`. It is the only piece
|
|
1390
|
+
that knows node ids exist: it resolves ids to points and hands the shots
|
|
1391
|
+
nothing but geometry, so every shot stays business-free. Unknown ids are
|
|
1392
|
+
dropped and an empty target resolves immediately instead of hanging. Covered
|
|
1393
|
+
by `src/cinematics/__tests__/createCinematics.test.ts`.
|
|
1394
|
+
- **`FlyPathOptions.onWaypoint(hit)`** fires when a flight arrives at a node,
|
|
1395
|
+
with `{ index, nodeId, point, at, leaves }` — and with `null` when it is
|
|
1396
|
+
scrubbed back before the first arrival. It is what makes a flight an analysis
|
|
1397
|
+
tool rather than a fly-over: the card, the highlight and the ripple for a node
|
|
1398
|
+
hang off the flight's own clock instead of a second timer that has to be kept
|
|
1399
|
+
in step with the leg lengths by hand. Covered by
|
|
1400
|
+
`src/cinematics/__tests__/createCinematics.test.ts`,
|
|
1401
|
+
`src/cinematics/__tests__/CameraDirector.test.ts`.
|
|
1402
|
+
- **`cuePath(target, opts)` → `CuedFlight`** installs a flight the host drives:
|
|
1403
|
+
`scrub(ms)` / `scrubFraction(t)` / `release()` / `cancel()`, plus `duration`.
|
|
1404
|
+
An analyst has one clock and it is the clock in the data, so this is the piece
|
|
1405
|
+
that makes a timeline cursor and a camera the same gesture —
|
|
1406
|
+
`timeline.onCursorChange(t => flight.scrubFraction(t))`. Nothing is written
|
|
1407
|
+
until the first scrub, scrubbing is idempotent and runs backwards, and
|
|
1408
|
+
`onWaypoint` fires on a change of which waypoint is current rather than on a
|
|
1409
|
+
crossing, so dragging back and forth never double-reports an arrival.
|
|
1410
|
+
Returns `null` when the target resolves to nothing. Covered by
|
|
1411
|
+
`src/cinematics/__tests__/createCinematics.test.ts`.
|
|
1412
|
+
- **`CameraDirector` / `createCameraDirector()`** — a `LayerRenderer` that
|
|
1413
|
+
draws nothing and owns the view instead. It sets
|
|
1414
|
+
`cloudScene.position = −(R·S·focus) + (0, 0, cameraZ − distance)` each frame,
|
|
1415
|
+
which is the fixed point of the engine's own `computeFlyToTarget`, so
|
|
1416
|
+
applying it repeatedly is idempotent and a shot can be scrubbed, re-sampled
|
|
1417
|
+
or interrupted without drift. `captureStart()` round-trips the live view back
|
|
1418
|
+
into a `ShotStart`. **It moves the scene and nothing else**: the camera is
|
|
1419
|
+
the host's — map mode captures and restores it, `setViewState` writes its z —
|
|
1420
|
+
so the director never touches it. `CameraDirectorConfig.allowLens` (default
|
|
1421
|
+
`false`) exists only for `dollyZoomShot`, the one shot that provably cannot
|
|
1422
|
+
be done with the scene transform. `cue` / `scrub` / `scrubFraction` /
|
|
1423
|
+
`release` hand the clock to the host, `cued` and `duration` report that
|
|
1424
|
+
state, and `CameraDirectorConfig.onMark` publishes arrivals. Covered by
|
|
1425
|
+
`src/cinematics/__tests__/CameraDirector.test.ts`.
|
|
1426
|
+
- **Shots are pure sampled functions of elapsed ms**: `pathShot` (Catmull-Rom
|
|
1427
|
+
through the hops, with a dwell at each one, optional bank roll and
|
|
1428
|
+
`heading: "keep" | "lead" | "chase"`), `orbitShot`, `warpShot` (recoil / run
|
|
1429
|
+
/ land, publishing `warp` for the streaks), `establishShot` and `frameShot`,
|
|
1430
|
+
plus `dollyZoomShot` — which is **not** on the `createCinematics` surface,
|
|
1431
|
+
because it is the one shot that needs the lens — plus `boundingSphere`,
|
|
1432
|
+
`fitDistance`, `headingQuaternion`, `markAt` and the easings. `duration` and
|
|
1433
|
+
`sample(ms, out)` are the whole contract, so a host can write its own shot
|
|
1434
|
+
and hand it to `director.play()`. A shot may also publish
|
|
1435
|
+
`marks: ShotMark[]` — the points it stops at and when — which is how
|
|
1436
|
+
"arrived at waypoint" reaches a caller without a shot ever calling a
|
|
1437
|
+
callback, and therefore without giving up purity.
|
|
1438
|
+
`PathShotOptions.baseOrientation` is the view a lean is measured from, and is
|
|
1439
|
+
required for that purity: slerping from the frame's own previous orientation
|
|
1440
|
+
made `heading: "lead"` creep all the way round to a full chase over a few
|
|
1441
|
+
frames, and made the same millisecond answer differently depending on how it
|
|
1442
|
+
was reached. Covered by `src/cinematics/__tests__/shots.test.ts`.
|
|
1443
|
+
- **`PathShotOptions.dwell` and `.travel` accept a per-leg function**, not just
|
|
1444
|
+
a number: `travel: (i) => gapMs[i]` is asked for each segment with the index
|
|
1445
|
+
of the waypoint it leaves, and `dwell: (i) => …` for each waypoint. This is
|
|
1446
|
+
what lets a flight's time axis BE the data's — give each segment the gap
|
|
1447
|
+
between the two events it joins and the camera paces itself the way the data
|
|
1448
|
+
did, so a burst of transfers reads as a burst and an overnight wait reads as
|
|
1449
|
+
a wait. A single number still spaces the hops evenly, which looks smoother
|
|
1450
|
+
and says nothing. The floors are unchanged (dwell ≥ 0, travel ≥ 1) and are
|
|
1451
|
+
applied to the function's result too, so a per-leg gap of 0 cannot produce a
|
|
1452
|
+
zero-length segment and divide by it. Covered by
|
|
1453
|
+
`src/cinematics/__tests__/shots.test.ts`.
|
|
1454
|
+
- **`<ScanPlaneLayer>` / `createScanPlaneLayer`** — a lit sheet sweeps one axis
|
|
1455
|
+
and the nodes it crosses glow (Gaussian slab, so they brighten and fade
|
|
1456
|
+
rather than pop). The reason it is an analysis tool and not an effect: a 3-D
|
|
1457
|
+
graph projected to a screen hides its own depth, and lighting one slab at a
|
|
1458
|
+
time is the cheapest way to read it. `mode: "hold"` parks the sheet so a
|
|
1459
|
+
slider can drive it, and `onSlice(nodeIds, position)` reports what is in the
|
|
1460
|
+
slab (throttled, change-detected) for a side panel to list. The glow is a
|
|
1461
|
+
`createNodeShaderLayer` sublayer — one draw call for any number of nodes.
|
|
1462
|
+
Covered by `src/react/layers/__tests__/ScanPlaneLayer.test.ts`.
|
|
1463
|
+
- **`<RadarSweepLayer>` / `createRadarSweepLayer`** — a beam sweeps out from a
|
|
1464
|
+
node, a point, or the middle of the graph; each node flashes on contact and
|
|
1465
|
+
decays with how long ago the beam passed, so one revolution orders a whole
|
|
1466
|
+
neighbourhood by bearing and the range rings put a scale on distance.
|
|
1467
|
+
`onSweep(nodeIds)` fires once per revolution in bearing order. Covered by
|
|
1468
|
+
`src/react/layers/__tests__/RadarSweepLayer.test.ts`.
|
|
1469
|
+
- **`<WarpTunnelLayer>` / `createWarpTunnelLayer`** — the streak overlay that
|
|
1470
|
+
makes a long jump read as travel instead of a cut, so the viewer keeps their
|
|
1471
|
+
bearings. It is a clip-space quad (the vertex shader writes `gl_Position`
|
|
1472
|
+
straight from the vertex, ignoring the model and view matrices), which is why
|
|
1473
|
+
it stays nailed to the screen while the director moves `cloudScene`
|
|
1474
|
+
underneath. `intensity` is a callback read every frame — point it at
|
|
1475
|
+
`cine.warp` and the streaks cannot drift out of step with the flight — and at
|
|
1476
|
+
zero the layer goes dormant and stops asking for frames. Covered by
|
|
1477
|
+
`src/react/layers/__tests__/WarpTunnelLayer.test.ts`.
|
|
1478
|
+
- **`helixLayout` / `shellLayout` / `registerCinematicLayouts(api)`** — two
|
|
1479
|
+
pure layouts registered as `"gl:helix"` and `"gl:shells"`. The helix puts an
|
|
1480
|
+
ordered sequence on a tube along the view axis, which is compact on screen,
|
|
1481
|
+
strictly ordered, and can be flown down the middle of; `strands: 2` is the
|
|
1482
|
+
DNA look. Shells make radius equal hop distance from a root (Fibonacci
|
|
1483
|
+
sphere per shell, so no pole bunching), which turns "how far is this from
|
|
1484
|
+
that" into something read at a glance for the whole graph at once. The one
|
|
1485
|
+
business decision — what order the nodes go in — is a caller callback.
|
|
1486
|
+
Covered by `src/layout/__tests__/cinematic.test.ts`.
|
|
1487
|
+
|
|
1488
|
+
### Added — clickable custom layers
|
|
1489
|
+
|
|
1490
|
+
- **`NodeShaderLayerSpec.hitArea`** (`"none" | "quad" | "circle" | "shape"`,
|
|
1491
|
+
default `"none"`) and **`NodeShaderLayerSpec.hitMask`**. The engine's picking pass only rasterises the built-in node quad,
|
|
1492
|
+
sized from `nodeSize * nodeSizeScale`; a custom layer drawing at
|
|
1493
|
+
`sizeFactor: 10` was therefore clickable only on a small patch at the node
|
|
1494
|
+
centre. With `hitArea` set, the layer registers a second mesh in the engine's
|
|
1495
|
+
node picking scene **sharing its own geometry**, so the hitbox is exactly the
|
|
1496
|
+
quad it drew and clicks resolve to the same `NodePickResult` a built-in node
|
|
1497
|
+
click produces (selection, hover, context menu and drag follow with no extra
|
|
1498
|
+
wiring). The node display geometry and the picking shaders are untouched.
|
|
1499
|
+
`hitArea: "shape"` takes a generated `hitMask` (`{ prelude?, sdf }`, a GLSL
|
|
1500
|
+
signed-distance expression in `vec2 q`) so the hitbox is the OUTLINE the layer
|
|
1501
|
+
drew rather than its bounding quad; only the varyings the mask names are
|
|
1502
|
+
forwarded into the pick program, matched on word boundaries so a helper called
|
|
1503
|
+
`kvPanelSd` cannot drag attribute `panel` in with it. Covered by
|
|
1504
|
+
`src/react/layers/__tests__/NodeShaderLayer.hitArea.test.ts`.
|
|
1505
|
+
- **`LayerContext.getHitTest` and the `LayerHitTest` type.** The picking
|
|
1506
|
+
surface a layer needs: `encodeNodeId`, `addNodeHitMesh`, `removeNodeHitMesh`.
|
|
1507
|
+
Read it lazily — it is a thunk because the picker is created by the
|
|
1508
|
+
renderer-init effect and a layer can mount in the same commit. Optional on
|
|
1509
|
+
`LayerContext` and on `EngineLayerHost`, so an embedder can host layers with
|
|
1510
|
+
no interaction at all. Covered by
|
|
1511
|
+
`src/react/layers/__tests__/EngineLayerHost.test.ts`.
|
|
1512
|
+
- **`Picker.addNodeHitMesh` / `removeNodeHitMesh` / `encodeNodeId`.** The engine
|
|
1513
|
+
side of the above. Registered meshes are transform-synced with `cloudScene`
|
|
1514
|
+
on every pick (they are not children of it) and are detached — never
|
|
1515
|
+
disposed — when the picker is disposed. Covered by
|
|
1516
|
+
`src/interaction/__tests__/Picker.layerHitMesh.test.tsx`.
|
|
1517
|
+
|
|
1518
|
+
### Added — WebGPU render path switch (U3 dual-path-foundation)
|
|
1519
|
+
|
|
1520
|
+
- **`GraphRendererProps.enableWebGPURenderPath?: boolean`** (default `false`).
|
|
1521
|
+
Setting it to `true` (or flipping the imperative switch below) already requests
|
|
1522
|
+
a WebGPU adapter (`powerPreference: "high-performance"`) and device and holds
|
|
1523
|
+
it, even though nothing renders on it yet in this release; `true` only means
|
|
1524
|
+
"host allows it" — the path also needs a capable/available device and no prior
|
|
1525
|
+
fault before anything can use it. Setting it back to `false` is a switch, not a
|
|
1526
|
+
fallback, and never triggers `renderFault`. The underlying wiring (`initDualPath`)
|
|
1527
|
+
is covered by `src/react/graph-context/__tests__/initDualPath.test.ts`; the
|
|
1528
|
+
prop reaching `RendererApi` through `GraphContext`, and the foundation
|
|
1529
|
+
surviving an ordinary renderer-rebuilding prop change (SEC-16), are covered
|
|
1530
|
+
by `src/react/graph-context/__tests__/GraphCanvas.renderPath.test.tsx`.
|
|
1531
|
+
- **`forceLayout`'s WebGPU engine now gets its `GPUDevice` from the same shared
|
|
1532
|
+
device owner as the render path.** `GraphContext.tsx` passes
|
|
1533
|
+
`device: foundation.shared.ensureDevice("layout")` to
|
|
1534
|
+
`WebGPUForceLayoutController`, instead of the controller acquiring its own.
|
|
1535
|
+
Consequence for hosts: a GPU device loss during layout now emits `renderFault`
|
|
1536
|
+
(`faultKind: "device-lost"`, `causedFallback: false` when the render path was
|
|
1537
|
+
already WebGL) and permanently disables the WebGPU render path for that engine
|
|
1538
|
+
instance — even for hosts that never set `enableWebGPURenderPath`. Previously
|
|
1539
|
+
that loss was silent. Covered by
|
|
1540
|
+
`src/react/graph-context/__tests__/initDualPath.test.ts`.
|
|
1541
|
+
- **`RendererApi.setWebGPURenderPathEnabled(enabled: boolean): void`** and
|
|
1542
|
+
**`RendererApi.isWebGPURenderPathEnabled(): boolean`** — the imperative
|
|
1543
|
+
equivalent of `enableWebGPURenderPath` (same switch, last writer wins).
|
|
1544
|
+
Inert (no-op / `false`) until the engine wires the renderer post-mount.
|
|
1545
|
+
Covered by `src/api/__tests__/RendererApi.renderPath.test.ts` (unit) and
|
|
1546
|
+
`src/react/graph-context/__tests__/GraphCanvas.renderPath.test.tsx` (wired
|
|
1547
|
+
through a real mount).
|
|
1548
|
+
- **`renderFault` event.** Payload `HostFaultReport` has exactly six keys:
|
|
1549
|
+
`reportId`, `faultKind`, `sanitizedReason`, `occurredAt`, `resultingPathId`,
|
|
1550
|
+
`causedFallback`. `faultKind` ∈ `"device-lost" | "shader-compile-failed"` and is the
|
|
1551
|
+
stable de-duplication key. One event per adjudicated fault; the fallback to WebGL has
|
|
1552
|
+
already happened when the event fires, and it is permanent for the lifetime of the
|
|
1553
|
+
engine instance. The payload never contains browser-provided text. Covered by
|
|
1554
|
+
`src/api/__tests__/HostFaultChannel.test.ts`, `src/backends/__tests__/RenderPathSelector.test.ts`.
|
|
1555
|
+
- **WebGPU capability probe is `navigator.gpu` presence (pending confirmation, D-26).**
|
|
1556
|
+
three's `WebGPU.isAvailable()` helper is not used because it has a top-level `await`
|
|
1557
|
+
that breaks the CJS/UMD builds and requests an adapter at import time.
|
|
1558
|
+
|
|
1559
|
+
In U3 these additions only wired the switch through to a foundation that did
|
|
1560
|
+
not yet select anything; the section below (U4) makes the selection live.
|
|
1561
|
+
|
|
1562
|
+
### Changed — the render loop is now driven by `RenderRuntime`, and the WebGPU path paints (U4 render-orchestrator)
|
|
1563
|
+
|
|
1564
|
+
- **`enableWebGPURenderPath` now hands painting to three's `WebGPURenderer`.**
|
|
1565
|
+
Once the host allows the path (prop, imperative switch, or the internal debug
|
|
1566
|
+
flag), the engine lazily loads `three/webgpu`, builds a `WebGPURenderer` on the
|
|
1567
|
+
*shared* `GPUDevice` (the same one the WebGPU force layout uses), waits for
|
|
1568
|
+
`init()`, and — only if three really ended up on its WebGPU backend — switches
|
|
1569
|
+
painting to it at the next frame boundary. That renderer draws into a second
|
|
1570
|
+
canvas stacked over the WebGL one (`pointer-events: none`, so mouse handling
|
|
1571
|
+
stays on the WebGL canvas). **In this release the WebGPU canvas shows only the
|
|
1572
|
+
clear colour**: no node/edge/label primitive has a WebGPU implementation yet
|
|
1573
|
+
(they arrive with the shader and layer equivalence units). Picking, hover,
|
|
1574
|
+
drag and the minimap keep working against the WebGL scene underneath. Setting
|
|
1575
|
+
the switch back to `false` returns to WebGL at the next frame; the WebGPU
|
|
1576
|
+
renderer is kept for an instant re-enable. Covered by
|
|
1577
|
+
`src/__tests__/RenderRuntime.loop.test.ts` (path decision, visibility, perf
|
|
1578
|
+
hand-over), `src/backends/webgpu/__tests__/WebGPUPaintTarget.test.tsx`
|
|
1579
|
+
(renderer lifecycle) and `src/react/graph-context/__tests__/GraphCanvas.renderPath.test.tsx`
|
|
1580
|
+
(mounted).
|
|
1581
|
+
- **`init()` failures are silent by design.** If `three/webgpu` cannot load, the
|
|
1582
|
+
device cannot be obtained, `WebGPURenderer.init()` rejects, or three falls back
|
|
1583
|
+
to its WebGL2 backend, the engine stays on WebGL without emitting
|
|
1584
|
+
`renderFault` — those are environment conditions, not runtime faults; only
|
|
1585
|
+
`device-lost` and `shader-compile-failed` are faults. After a fault the WebGPU
|
|
1586
|
+
renderer is disposed and never rebuilt for that engine instance. Covered by
|
|
1587
|
+
`src/backends/webgpu/__tests__/WebGPUPaintTarget.test.tsx` (every arm: module
|
|
1588
|
+
load rejection, device rejection, `init()` rejection, three's WebGL2-backend
|
|
1589
|
+
fallback, and `retire()` from each of those states).
|
|
1590
|
+
- **`GraphContextValue.renderBackend` is now a live getter** (it was a snapshot
|
|
1591
|
+
taken at mount). Read it at use time; do not cache it. It follows the active
|
|
1592
|
+
path only once that path's backend reports `supportsPrimitives` (WebGPU: not
|
|
1593
|
+
yet), so it is still the WebGL factory in this release. New
|
|
1594
|
+
**`GraphContextValue.activeRenderPathId: "webgl" | "webgpu"`** (live getter)
|
|
1595
|
+
reports the path that actually PAINTED the last frame — `RenderRuntime`'s
|
|
1596
|
+
frame-stable answer, the same value `__kinevizPerf.read().activePathId`
|
|
1597
|
+
publishes, not the selector's opinion (which can flip a microtask ahead of
|
|
1598
|
+
the frame boundary that acts on it). New
|
|
1599
|
+
**`RenderBackend.supportsPrimitives: boolean`**. Covered by
|
|
1600
|
+
`src/backends/__tests__/createRenderBackend.test.tsx`,
|
|
1601
|
+
`src/react/graph-context/__tests__/initDualPath.test.ts`,
|
|
1602
|
+
`src/react/graph-context/__tests__/GraphCanvas.renderPath.test.tsx`.
|
|
1603
|
+
- **`__kinevizPerf.read()`**: `activePathId` reports `"webgpu"` while the WebGPU
|
|
1604
|
+
path paints, and `drawCallAccuracy` becomes `"accurate"` there (three's common
|
|
1605
|
+
`Info.render.drawCalls` is a whole-frame figure). The instrument is a page
|
|
1606
|
+
global, so tearing the engine down publishes `"webgl"` again rather than
|
|
1607
|
+
leaving a later reading pinned to the unmounted graph's path. Covered by
|
|
1608
|
+
`src/__tests__/RenderRuntime.loop.test.ts`.
|
|
1609
|
+
- **Internal, behaviour-preserving:** the host render loop (`useRenderLoop.ts`)
|
|
1610
|
+
no longer duplicates the frame pipeline; `RenderRuntime` owns the RAF rhythm,
|
|
1611
|
+
dirty-flag consumption, the two frame-callback registries (host map first,
|
|
1612
|
+
runtime map second) and the "needsRender is cleared after the callbacks"
|
|
1613
|
+
rule. The seven wake sources, the ability to go quiet, and the picking-debug
|
|
1614
|
+
sustain are re-asserted against the new loop by
|
|
1615
|
+
`src/react/graph-context/__tests__/renderLoopIdle.test.tsx`. `RenderRuntime`'s
|
|
1616
|
+
props-mode per-frame `forceUpdateAllAttributes()` was removed — the host had
|
|
1617
|
+
already dropped its copy (U9 / FR6.1.a) and reviving it would have restored
|
|
1618
|
+
that cost.
|
|
1619
|
+
- **Bundle notes.** ESM/CJS entries reference `three/webgpu` through a dynamic
|
|
1620
|
+
`import()`, so WebGL-only hosts never download it and bundlers may split it.
|
|
1621
|
+
The UMD file inlines it: `dist/kineviz-gl.umd.js` grows from 2,050,584 to
|
|
1622
|
+
2,882,978 bytes (+832,394 bytes, about +40%). CJS consumers that `require()`
|
|
1623
|
+
the package get a dynamic `import()` of an ESM-only three subpath, which
|
|
1624
|
+
needs Node ≥ 22.12 (or any bundler) to resolve; the WebGL path is unaffected
|
|
1625
|
+
because the import runs only when the WebGPU render path is enabled. Each
|
|
1626
|
+
live `WebGPURenderer` also runs three's own internal `requestAnimationFrame`
|
|
1627
|
+
loop (`renderers/common/Animation`), independent of this engine's loop; it
|
|
1628
|
+
stops when the renderer is disposed — which now happens BEFORE the shared
|
|
1629
|
+
`GPUDevice` is destroyed on unmount (effect cleanups run in declaration
|
|
1630
|
+
order, so the mount-scoped dual-path effect retires the WebGPU paint target
|
|
1631
|
+
first). The `three/webgpu` single-import rule behind the split is enforced by
|
|
1632
|
+
`src/backends/__tests__/hygiene.test.ts`; the byte figures above are not a
|
|
1633
|
+
test assertion — they come from `yarn workspace @kineviz/gl build`, re-run
|
|
1634
|
+
them there if you need to confirm.
|
|
1635
|
+
|
|
1636
|
+
### Changed — `deleteEdges` and `deleteNodes` are in-place swap-removes (M1)
|
|
1637
|
+
|
|
1638
|
+
- `GraphStore.deleteEdges` (and `applyDelta` edge removals) no longer rebuild
|
|
1639
|
+
the edge arrays: each removed edge is replaced by the last edge. 100k nodes /
|
|
1640
|
+
200k edges: `applyDelta` remove 1 edge 5.9 → 0.07 ms; the one-time adjacency
|
|
1641
|
+
build is ~40 ms on the first delete.
|
|
1642
|
+
- **Behaviour change:** the surviving edges are no longer kept in their original
|
|
1643
|
+
order, `store.data.edges` is mutated in place (as `addEdges` always did), and
|
|
1644
|
+
the render-state arrays keep their identity unless the count falls below a
|
|
1645
|
+
quarter of capacity. Code that held an edge index across a deletion must
|
|
1646
|
+
re-resolve it by id. Covered by `src/core/__tests__/deleteEdgesInPlace.test.ts`.
|
|
1647
|
+
- `GraphStore.deleteNodes` (and `applyDelta` node removals) work the same way:
|
|
1648
|
+
incident edges are found through an adjacency index and removed, then each node
|
|
1649
|
+
is replaced by the last node. 100k nodes / 200k edges: `applyDelta` remove 1
|
|
1650
|
+
node 513 → 0.08 ms, `deleteNodes` x1 640 → 0.03 ms. Only the nodes that change
|
|
1651
|
+
slot get their position re-written (by id, through `writePositions`); every
|
|
1652
|
+
other survivor keeps its slot and position. `structureEpoch` still bumps once
|
|
1653
|
+
per call, and a call that matches no id is now a no-op (previously it rebuilt
|
|
1654
|
+
and bumped the version). `applyDelta` reports cascaded edges in slot order.
|
|
1655
|
+
Covered by `src/core/__tests__/deleteNodesInPlace.test.ts`.
|
|
1656
|
+
- `GraphStore.batch(fn)`: groups mutations into one change-log commit (one
|
|
1657
|
+
notification per subscriber). `store.version` still bumps per mutation.
|
|
1658
|
+
Covered by `src/core/__tests__/storeChanges.test.ts`.
|
|
1659
|
+
- Fewer re-renders: `BadgeCloud`, `TagCloud`, `GroupCloud` and `MinimapLayer` now
|
|
1660
|
+
subscribe to the change domains they read instead of every store mutation, and
|
|
1661
|
+
the `Picker` cache signature no longer changes on hover, selection, pin or
|
|
1662
|
+
highlight. Behaviour is otherwise identical. Covered by
|
|
1663
|
+
`src/react/graph-context/__tests__/useStoreVersion.test.tsx` and
|
|
1664
|
+
`src/interaction/__tests__/Picker.pickCacheInvalidation.test.tsx`.
|
|
1665
|
+
- New (internal, not exported): `store.changes` (a `ChangeLog`) receives every
|
|
1666
|
+
`markDirty` write and now also ordered `remove` ops.
|
|
1667
|
+
|
|
1668
|
+
### Changed — node GPU upload is slot-precise for add / delete (M2.1a)
|
|
1669
|
+
|
|
1670
|
+
- Adding or deleting a node no longer re-uploads every node attribute. `GPUNodeRenderer` reads its own `store.changes` cursor and uploads only the touched slots (several update ranges per attribute instead of one envelope). Geometry, material and attribute objects keep their identity. Covered by `src/backends/gpu/__tests__/GPUNodeRenderer.incremental.test.tsx`.
|
|
1671
|
+
- Fixed: after a node delete, the hover-dim state of the node that was moved into the hole belonged to the wrong node (the renderer's shadow arrays did not follow the swap). Same test file.
|
|
1672
|
+
- `UpdateStrategy.markDirty(flag, slot?)`: an optional slot lets single-entity setters (`setNodeColor`, `setNodeSize`, `setNodeIcon`) report one slot instead of the whole column. Covered by `src/core/__tests__/flagBridge.test.ts`.
|
|
1673
|
+
- Edge and arrow geometry (M2.1b): adding or deleting edges, or deleting a node, repacks only the touched edge slots instead of rebuilding both geometries. The per-instance arrays are now capacity-sized; a capacity change still rebuilds. Parallel-edge curvature stays identical to a full reclassification (`EdgeClassifier.applyChanges`, groups ordered by slot). Covered by `src/backends/gpu/__tests__/GPUEdgeRenderer.incremental.test.tsx` and `src/edge/__tests__/EdgeClassifier.incremental.test.ts`. Measured on this VM (jsdom, 100k nodes / 200k edges): rebuild 723 ms → delete one edge or node about 1 ms, add one edge about 4 ms.
|
|
1674
|
+
- `GPUEdgeRenderer.getArrowGeometry()` (diagnostic accessor).
|
|
1675
|
+
|
|
1676
|
+
### Changed — BREAKING behaviour: imperative style is now sticky (M2.6, D4)
|
|
1677
|
+
|
|
1678
|
+
- Setting a node's colour, size, shape or icon imperatively (`setNodeColor`, `updateNodeColors`, `setNodeSize`, `updateNodeSizes`, `setNodeShape`, `setNodeIcon`, and everything built on them: `api.style.*`, the style commands, `IoApi` overrides) now *claims* that attribute of that node. `VisualMapper.apply()` — on add, on `setCategoryConfig` + `apply()`, or called explicitly — no longer overwrites a claimed attribute. Before, the next re-map silently reset it (the "first delete recolors everything else" trap). To hand an attribute back to the mapping: `store.clearNodeOverrides(ids, attrs?)` (re-maps those nodes immediately). The claim set is `store.getNodeOverrides(id)` (`NODE_OVERRIDE` bits). It lives in a new render-state column `overrides`, so it moves with its node on swap-remove.
|
|
1679
|
+
- Undo restores ownership as well as the value: `SetNodeColor/Size/IconCommand.undo()` and `RemoveNodesCommand.undo()` put back the previous claim set; full snapshots (`captureFullSnapshot` / `applyFullSnapshot`) now also carry `shapeIds`, `aspects` and `overrides`.
|
|
1680
|
+
- Behaviour you may hit: code that set a colour and relied on a later `apply()` to replace it must call `clearNodeOverrides`. A config with `defaultColor` no longer recolours nodes that were coloured by hand.
|
|
1681
|
+
- Covered by `src/core/__tests__/styleOverrides.test.ts` (9 tests, 3 mutations killed) and `src/style/__tests__/VisualMapper.shape.test.ts`. No `api.style.*` wrapper for `clearNodeOverrides` yet — it needs a schema, signature-contract and naming decision (§13).
|
|
1682
|
+
- Internal: `TypeBatches` (`src/core/batches/`) keeps per-custom-shape-type slot lists from the ChangeLog (swap-remove and reclassification in O(changes)); nothing draws from it until M5.
|
|
1683
|
+
|
|
1684
|
+
### Added — built-in node shapes (M2.4a)
|
|
1685
|
+
|
|
1686
|
+
- `GraphStore.setNodeShape(ids, shape, aspect?)`: eight built-in outlines — `circle`, `rect`, `roundRect`, `diamond`, `triangle`, `hexagon`, `star`, `ring` — plus a width / height `aspect` (`sizes` stays a scalar: width = size, height = size / aspect). The outline drives the fill, the selection / highlight ring, icon clipping and the picking hitbox. Circle nodes render exactly as before. Covered by `src/core/__tests__/nodeShape.test.ts`, `src/core/shapes/__tests__/reference.test.ts`, `src/backends/gpu/__tests__/GPUNodeRenderer.incremental.test.tsx`; GLSL ↔ JS reference and a real-renderer picking check run in `scripts/glsl-conformance.mjs` and `scripts/shape-smoke.mjs` (SwiftShader).
|
|
1687
|
+
- `DirtyFlag` gains `"nodeShapes"` (a downstream exhaustive `switch` over the union stops compiling). Render state gains `shapeIds` and `aspects`.
|
|
1688
|
+
- Edges and arrowheads stop at the node outline along the edge direction instead of the bounding circle (M2.4b; `shapeRadiusAlong` in `core/shapes/reference.ts`, `kvShapeRadiusAlong` in GLSL). The arrowhead keeps the nominal node radius for its size. Circle graphs render byte-identical to before (SwiftShader A/B). Edge attributes `nodeSizes` (now vec4) and the arrow's `sourceSize` / `targetSize` (now vec2) carry a packed shape code (`shapeCode`, aspect quantised to 1/1024, clamped to 8); no new attribute was added.
|
|
1689
|
+
- `CategoryConfig` gains `defaultShape`, `defaultAspect` and `shapeMapping` (`ShapeMapping`: property value → shape, with a default); `VisualMapper` applies them like the other mappings (scoped on add, whole category on `apply()`). `setCategoryConfig` throws on an unknown shape name or a non-positive aspect. A config without shape fields leaves shapes set with `setNodeShape` alone. Covered by `src/style/__tests__/VisualMapper.shape.test.ts`. `@kineviz/graph-core` exports the new types.
|
|
1690
|
+
- Not yet: shapes are not saved in snapshots; WebGPU draws circles only (M2.5). Icons and images inside a non-circle shape are still clipped by the outline but laid out for a circle.
|
|
1691
|
+
- Internal: the node shader keeps its 13 attributes by packing `suppressFill + 2 * shapeId` into `nodeSuppressFill` and `aspect` into `nodeEffects.w` (`nodeEffects` is now a vec4). ANGLE/SwiftShader counts three's `position`/`normal`/`uv` against the 16-attribute limit, so a 14th attribute fails to link.
|
|
1692
|
+
|
|
1693
|
+
### Added — extension registries (M0)
|
|
1694
|
+
|
|
1695
|
+
The first piece of the extension contract: per-engine registries instead of
|
|
1696
|
+
closed `switch` statements. Built-ins register through the same path as
|
|
1697
|
+
extensions; extension names must be `<pack>:<name>` and built-ins must not be.
|
|
1698
|
+
|
|
1699
|
+
- **Layouts.** `LayoutRegistry`, `defaultLayoutRegistry`, `createLayoutRegistry()`
|
|
1700
|
+
(from `@kineviz/gpu-compute`, re-exported here). `executeLayout` now reads the
|
|
1701
|
+
registry; its result for every built-in `type` is unchanged, and an unknown
|
|
1702
|
+
`type` still returns an empty result. Covered by `gpu-compute/tests/LayoutRegistry.test.ts`.
|
|
1703
|
+
- **`api.layout.register(name, fn, opts?)` / `has(name)` / `list()`**, and
|
|
1704
|
+
`applyByName(name, nodeIds?, options?)` runs any registered layout — recorded
|
|
1705
|
+
in undo history, tweened, and bracketed by `layout:start` / `layout:end`
|
|
1706
|
+
exactly like a built-in. Registrations are per engine. Covered by
|
|
1707
|
+
`src/api/__tests__/LayoutApi.registry.test.ts`.
|
|
1708
|
+
- **`store.registry: EngineRegistry`** with `nodes`, `edges`, `arrows` and
|
|
1709
|
+
`layouts`. Today only `layouts` and the edge-shape table are consumed.
|
|
1710
|
+
An extension edge type is accepted but is drawn as its mandatory built-in
|
|
1711
|
+
`fallback` until path functions exist (M3); `nodes` and `arrows` store and
|
|
1712
|
+
validate descriptors but nothing draws them yet (M2/M3). Covered by
|
|
1713
|
+
`src/registry/__tests__/EngineRegistry.test.ts`.
|
|
1714
|
+
|
|
1715
|
+
### Changed — layout names and edge-shape ids
|
|
1716
|
+
|
|
1717
|
+
- **BREAKING (behaviour): `api.layout.applyByName` throws on an unregistered
|
|
1718
|
+
name.** It used to return silently, which hid typos. The error lists the
|
|
1719
|
+
registered names. `gl-verbs`'s `arrangeNodes` is unaffected (it constrains the
|
|
1720
|
+
name to the built-ins with a schema enum).
|
|
1721
|
+
- The edge shape name → shader id mapping (`straight` 0, `curve` 1, `radial` 2)
|
|
1722
|
+
lived in five inline ternaries (`GraphStore.setEdgeShape`,
|
|
1723
|
+
`StyleApi.setEdgeShape`, `GPUEdgeRenderer` ×3). It now lives in one table,
|
|
1724
|
+
`BUILTIN_EDGE_SHAPE_IDS`, read through `store.registry.resolveEdgeShapeId`.
|
|
1725
|
+
Same ids, same fallback to straight for an unrecognised string. The public
|
|
1726
|
+
`EdgeShape` type is still the closed three-name union; it widens when
|
|
1727
|
+
extension edges can render.
|
|
1728
|
+
|
|
1729
|
+
### Changed — mutation path no longer does O(N+E) bookkeeping for adds and updates (M0)
|
|
1730
|
+
|
|
1731
|
+
Measured on 100k nodes / 200k edges, data layer only (`scripts/bench-mutation.ts`):
|
|
1732
|
+
`applyDelta` add one node 29.3 → 0.02 ms, update one node 37.9 → 0.01 ms,
|
|
1733
|
+
update 100 nodes 279.7 → 0.09 ms, `addEdges` one edge 37.9 → 0.04 ms.
|
|
1734
|
+
Removals are unchanged (still O(N+E)); they need the swap-remove work in M1.
|
|
1735
|
+
|
|
1736
|
+
- **`VisualMapper.apply(scope?)`** takes an optional `{ nodes, edges, fullCategories, fullRelationships }`.
|
|
1737
|
+
`addNodes`, `addEdges` and `applyDelta` now pass the items they touched, so an
|
|
1738
|
+
add or update re-maps only those items. **Behaviour change:** an add used to
|
|
1739
|
+
re-map every node of every configured category, which silently overwrote
|
|
1740
|
+
imperative `setNodeColor` / `setNodeSize` calls on *unrelated, existing* nodes.
|
|
1741
|
+
It no longer does. Categories whose mapping depends on the whole category
|
|
1742
|
+
(a `sizeMapping` / `widthMapping` or a sequential / diverging colour mapping
|
|
1743
|
+
with no explicit `domain`) and categories configured for the first time by
|
|
1744
|
+
that very change still re-map in full. `apply()` with no argument is unchanged.
|
|
1745
|
+
Covered by `src/core/__tests__/incrementalMutation.test.ts`.
|
|
1746
|
+
- **`GraphStore.applyDelta`** resolves updated nodes/edges through the id→index
|
|
1747
|
+
map instead of a linear `find`, and computes the "actually removed" lists
|
|
1748
|
+
without snapshotting every id. Results are identical, including cascaded edge
|
|
1749
|
+
order. `replaceNodeProperties` likewise. Covered by `incrementalMutation.test.ts`.
|
|
1750
|
+
- **`IndexManager.addEdge`** (`@kineviz/graph-core`) grows `edgeSourceIndices` /
|
|
1751
|
+
`edgeTargetIndices` with capacity doubling instead of reallocating on every
|
|
1752
|
+
call. **The arrays may now be longer than `edgeCount`**; readers must bound by
|
|
1753
|
+
`edgeCount` / `data.edges.length` (all in-repo readers already do), and
|
|
1754
|
+
`getEdgeEndpoints` now checks against `edgeCount`. Covered by
|
|
1755
|
+
`graph-core/tests/IndexManager.test.ts`.
|
|
1756
|
+
- `GraphStore.setData` no longer logs a `console.warn` with a stack trace on
|
|
1757
|
+
every call.
|
|
1758
|
+
|
|
1759
|
+
### Changed — picking and minimap readback go through a dual-path backend (U5 async-readback)
|
|
1760
|
+
|
|
1761
|
+
- GPU readbacks now sit behind `PickingBackend` (`src/backends/picking/`). The
|
|
1762
|
+
WebGL implementation keeps the synchronous `readRenderTargetPixels` it always
|
|
1763
|
+
used; the WebGPU implementation reads asynchronously through three's
|
|
1764
|
+
`readRenderTargetPixelsAsync`, which is `copyTextureToBuffer` plus a raw
|
|
1765
|
+
device `mapAsync` underneath. Every result is normalised to top-left row
|
|
1766
|
+
order and tight rows before it leaves the backend, so callers no longer
|
|
1767
|
+
branch on the render path. Covered by
|
|
1768
|
+
`src/backends/picking/__tests__/PickingBackend.test.ts`,
|
|
1769
|
+
`src/backends/picking/__tests__/WebGPUPickingBackend.test.ts` and
|
|
1770
|
+
`src/backends/readback/__tests__/ReadbackOrientation.test.ts`.
|
|
1771
|
+
- **Picking's y mapping was corrected by one device pixel.** The pre-U5 WebGL
|
|
1772
|
+
picking code (the now-deleted `renderAndReadPixel`/`pickEdges`) computed the
|
|
1773
|
+
bottom-left framebuffer row as `H - round(v)`; U5's `WebGLPickingBackend`
|
|
1774
|
+
computes the exact geometric inverse, `H - 1 - cy`. This is a deliberate fix
|
|
1775
|
+
of a latent off-by-one — the old formula was out of bounds at `screenRow = 0`
|
|
1776
|
+
(clamped, so it never crashed) and one device pixel high everywhere else —
|
|
1777
|
+
not a regression. A user could perceive it as a hairline change in hit
|
|
1778
|
+
accuracy near node edges. Pinned by
|
|
1779
|
+
`src/backends/picking/__tests__/PickingBackend.test.ts`.
|
|
1780
|
+
- `Picker.pick()` stays **synchronous** and its result shape is unchanged, so
|
|
1781
|
+
`onClick`, `onDblClick` and `onContextMenu` still fire inside the DOM event
|
|
1782
|
+
that triggered them. A new `Picker.pickAsync()` is the asynchronous face; the
|
|
1783
|
+
hover pipeline uses it, and on the WebGPU path it also fills the single-entry
|
|
1784
|
+
cache that answers the synchronous face. Covered by
|
|
1785
|
+
`src/interaction/__tests__/pickAsync.test.ts`,
|
|
1786
|
+
`src/backends/picking/__tests__/PickCache.test.ts` and
|
|
1787
|
+
`src/interaction/__tests__/hoverThrottle.test.ts`.
|
|
1788
|
+
**Final fix wave, cache-invalidation signature:** the change signature that
|
|
1789
|
+
decides whether a cached synchronous answer is still valid
|
|
1790
|
+
(`Picker.cacheSignature()`) originally folded only the camera world matrix,
|
|
1791
|
+
zoom, target size, `cloudScene.position.z` and `cloudScene.scale.x`. That
|
|
1792
|
+
missed a pan (`cloudScene.position.x`/`.y`, e.g. `GraphControl.pan()`), a
|
|
1793
|
+
non-uniform rescale (`scale.y`/`.z`), a globe rotation (the full
|
|
1794
|
+
quaternion), and — separately — an active-path flip on the orchestrator's
|
|
1795
|
+
per-frame `webgl`↔`webgpu` decision (`setActivePathId()`'s own cache
|
|
1796
|
+
invalidation only fires once, at the moment the getter is *registered*, not
|
|
1797
|
+
each time its return value changes, so a real per-frame flip invalidated
|
|
1798
|
+
nothing). Each of the four missing terms could leave a stale synchronous
|
|
1799
|
+
pick answer served after the picture had already moved — on the WebGPU path
|
|
1800
|
+
this reads as "the click selected the wrong node." All four terms are now
|
|
1801
|
+
folded into `cacheSignature()`. There is also a now-fixed bug where the
|
|
1802
|
+
in-flight-read map's key was released *after* `cacheSignature()` was called
|
|
1803
|
+
to populate the cache, so a `cacheSignature()` exception permanently wedged
|
|
1804
|
+
that screen coordinate on the same rejected promise. Covered by
|
|
1805
|
+
`src/interaction/__tests__/Picker.pickCacheInvalidation.test.tsx`.
|
|
1806
|
+
- **`Picker.setCamera()` is live again.** The WebGL picking backend used to
|
|
1807
|
+
capture the camera *by value* at construction time; `setCamera()` swaps
|
|
1808
|
+
`Picker.camera` to a new object, but the backend kept rendering the picking
|
|
1809
|
+
scene with the object it was built with, so a host that calls
|
|
1810
|
+
`InteractionManager.setCamera()` after construction — the seam exists
|
|
1811
|
+
exactly for that — got picks against a stale projection with no error.
|
|
1812
|
+
`WebGLPickingBackendDeps.camera` is now `getCamera(): THREE.Camera`,
|
|
1813
|
+
resolved at each read. `@kineviz/gl`'s own `GraphContext` was never affected
|
|
1814
|
+
(it constructs exactly one camera for the engine's life), so this had no
|
|
1815
|
+
user-visible effect before this fix — it is a latent-bug fix, not a
|
|
1816
|
+
behaviour change any current host will notice. Covered by
|
|
1817
|
+
`src/backends/picking/__tests__/PickingBackend.test.ts` and
|
|
1818
|
+
`src/interaction/__tests__/Picker.setCameraLiveness.test.tsx`.
|
|
1819
|
+
- The minimap now issues a real in-flight asynchronous readback instead of
|
|
1820
|
+
assuming "the GPU is done next frame". `MinimapRenderer.hasPendingReadback()`
|
|
1821
|
+
means "a read is in flight or an image is waiting to be delivered"; a render
|
|
1822
|
+
is skipped while a read is outstanding. The `position-readback` perf channel's
|
|
1823
|
+
`site=minimap` samples now measure end-to-end asynchronous latency (submit →
|
|
1824
|
+
fence), not a synchronous stall, so expect the numbers to rise from about 1 ms
|
|
1825
|
+
to roughly 5–15 ms — the stall left the frame, it did not get slower. The
|
|
1826
|
+
minimap keeps rendering offscreen through a plain `THREE.WebGLRenderer` on
|
|
1827
|
+
**both** render paths — U5 gives it no WebGPU implementation of its own.
|
|
1828
|
+
**Final fix wave:** a read that resolves `undefined` (three's signal for "no
|
|
1829
|
+
framebuffer to read from," which is the whole jsdom test path, and can also
|
|
1830
|
+
happen in a real browser) used to fall back to the *previous* frame's bytes
|
|
1831
|
+
and publish them as if they were this frame's new content —
|
|
1832
|
+
`hasPendingReadback()` callers had no way to tell a genuinely fresh read
|
|
1833
|
+
from a re-delivered stale one. It now returns without touching
|
|
1834
|
+
`_readyImage`, i.e. "no new content," matching the comment that was already
|
|
1835
|
+
there. Covered by
|
|
1836
|
+
`src/react/layers/minimap/__tests__/MinimapReadback.test.tsx`.
|
|
1837
|
+
- **Skeleton only, replaced in U6:** with `enableWebGPURenderPath` on, the
|
|
1838
|
+
WebGPU canvas now draws nodes as flat instanced discs with position, diameter
|
|
1839
|
+
and colour, and those discs are pickable. Nothing else is on that path yet —
|
|
1840
|
+
no icons, labels, halos, hover dimming, selection rings, ripple/breathe
|
|
1841
|
+
effects, LOD, map mode, child nodes, edges or groups — and **edge picking
|
|
1842
|
+
returns nothing (background) while the WebGPU path is active**. The WebGL
|
|
1843
|
+
path is unchanged. Covered by
|
|
1844
|
+
`src/backends/webgpu/__tests__/WebGPUNodePrimitive.test.ts`.
|
|
1845
|
+
**Wiring follow-up:** the skeleton primitive shipped unbuilt in the first
|
|
1846
|
+
pass. `WebGPUPaintTarget.prepare()` only constructs it when its data source
|
|
1847
|
+
is present, and `GraphContext` was not passing one — so the WebGPU `scene`
|
|
1848
|
+
and `pickScene` were both empty, the canvas painted nothing but the clear
|
|
1849
|
+
colour, and the pick readback returned background forever. `GraphContext`
|
|
1850
|
+
now passes it. The dependency is a **getter** on both hops
|
|
1851
|
+
(`WebGPUPaintTargetDeps.getStore` / `WebGPUNodePrimitiveDeps.getStore`,
|
|
1852
|
+
replacing the `store` value): the paint-target effect's dependency array
|
|
1853
|
+
does not include the `store` prop, so a host that swaps `store` mid-mount
|
|
1854
|
+
would otherwise leave the primitive bound to the old one. No extra
|
|
1855
|
+
invalidation is needed for that swap — the primitive's existing
|
|
1856
|
+
colour/size array-identity check already treats a different store's arrays
|
|
1857
|
+
as stale and rebuilds. `getNodeSizeScale` is deliberately left at its
|
|
1858
|
+
default `() => 1`: the global scale is pre-multiplied into
|
|
1859
|
+
`GraphStore.effectiveSizes` and the WebGL node shader pins its own
|
|
1860
|
+
`nodeSizeScale` uniform at 1.0, so passing it here would double-apply it.
|
|
1861
|
+
Covered by
|
|
1862
|
+
`src/react/graph-context/__tests__/GraphCanvas.renderPath.test.tsx` and
|
|
1863
|
+
`src/backends/webgpu/__tests__/WebGPUPaintTarget.test.tsx`.
|
|
1864
|
+
**Two parity fixes found in browser acceptance** (neither is reachable from
|
|
1865
|
+
a test — jsdom has no WebGPU, so only a human at a real canvas sees them):
|
|
1866
|
+
the display material now sets `depthWrite = false` / `depthTest = true`,
|
|
1867
|
+
matching the WebGL node material. With depth writing on, the fully
|
|
1868
|
+
transparent corners of a nearer quad still wrote depth and occluded the
|
|
1869
|
+
discs behind them, which on screen read as rectangular bites taken out of
|
|
1870
|
+
the circles. And the primitive now copies `cloudScene`'s position,
|
|
1871
|
+
quaternion and scale onto both its display and its pick object every sync
|
|
1872
|
+
(new required dep `WebGPUNodePrimitiveDeps.getCloudTransform`, optional on
|
|
1873
|
+
`WebGPUPaintTargetDeps`). WebGL's node mesh is a *child* of `cloudScene` and
|
|
1874
|
+
inherits that transform; the skeleton primitive lives under the paint
|
|
1875
|
+
target's own scene root and does not — exactly the case
|
|
1876
|
+
`Picker.syncTransforms()` already handles for the picking meshes. Without
|
|
1877
|
+
it the discs ignored pan and zoom entirely, and `viewDepth` lost
|
|
1878
|
+
`cloudScene`'s z so every disc rendered too large. Covered by
|
|
1879
|
+
`src/backends/webgpu/__tests__/WebGPUNodePrimitive.test.ts`.
|
|
1880
|
+
- Bundle note: `three/tsl` joins `three/webgpu` behind the same dynamic import
|
|
1881
|
+
in `src/backends/webgpu/loadThreeWebGPU.ts`, so ESM and CJS consumers still
|
|
1882
|
+
defer both. Both already share `three.core.js`, so the UMD bundle grows only
|
|
1883
|
+
by the TSL node library. Re-measure `dist/kineviz-gl.umd.js` with
|
|
1884
|
+
`yarn workspace @kineviz/gl build` and record the byte figure here — this line
|
|
1885
|
+
is verified against build output, not by a test assertion; the single-import
|
|
1886
|
+
rule itself is covered by `src/backends/__tests__/hygiene.test.ts`.
|
|
1887
|
+
|
|
1888
|
+
Measured: `dist/kineviz-gl.umd.js` is 2,920,427 bytes
|
|
1889
|
+
(was 2,882,978 bytes before U5, +37,449 bytes).
|
|
1890
|
+
|
|
5
1891
|
## 0.6.1 — 2026-08-05
|
|
6
1892
|
|
|
7
1893
|
Icons survive a slow font. Goal: an icon assigned before its font finishes
|
|
@@ -15,6 +1901,10 @@ loading should still be drawn, instead of silently falling back.
|
|
|
15
1901
|
|
|
16
1902
|
- **`animals/horse` ontology glyph** (`0xe154`) in `@kineviz/icons`, with the ontology and UI fonts rebuilt. Note that `@kineviz/gl` does not ship font assets — consumers load the woff2 themselves, so picking up the new glyph means taking the rebuilt font from `@kineviz/icons`, not from this package.
|
|
17
1903
|
|
|
1904
|
+
### Known issues
|
|
1905
|
+
|
|
1906
|
+
- **This fix is not sufficient to drop a `setCategoryIcon` re-apply timer** ([GXR-4478](https://kineviz.atlassian.net/browse/GXR-4478)). A geometry rebuild still erases icons that were already applied and drawn, which is a separate defect from the late-font resolution failure fixed above. A downstream app that removed its timer on the strength of this release regressed: 1 run in 5 lost 10 of 17 glyphs with the font confirmed loaded. If you hold such a workaround, keep it until GXR-4478 is fixed.
|
|
1907
|
+
|
|
18
1908
|
## 0.6.0 — 2026-06-29
|
|
19
1909
|
|
|
20
1910
|
Node-anchored info cards. Goal: attach rich, interactive HTML cards to graph
|
|
@@ -65,7 +1955,7 @@ nearest geo neighbour as a readable, zoom-stable ego ring.
|
|
|
65
1955
|
|
|
66
1956
|
New subpath entry exporting `METHOD_SCHEMAS`: an engine-owned registry of zod
|
|
67
1957
|
schemas for 193 blockable API methods across the 13 flow-allowlisted
|
|
68
|
-
namespaces
|
|
1958
|
+
namespaces.
|
|
69
1959
|
Each entry records the method's positional argument layout (plain params +
|
|
70
1960
|
trailing options object) so tooling (flow blocks, agents, MCP) can render
|
|
71
1961
|
parameter forms and reconstruct calls. Schemas live next to the API code in
|
|
@@ -75,7 +1965,7 @@ is kept under `scripts/` for reference only. A package `exports` map was
|
|
|
75
1965
|
added — `"."`, `"./schemas"`, `"./dist/*"` (CSS deep imports preserved),
|
|
76
1966
|
`"./assets/*"`.
|
|
77
1967
|
|
|
78
|
-
contextValue identity redesign
|
|
1968
|
+
contextValue identity redesign. The `GraphContext` provider value is now an **identity-stable handle**: it is created once per engine lifecycle, its 13 reactive fields (`isMapMode`, `mapDamping`, `mapSphereRadius`, `is3D`, `effectiveMapProjection`, `theme`, `textScale`, `edgeTextScale`, the three atlas managers, `layoutController`, `layoutPositionProvider`) are live getters into an internal subscribable view-state store, and consumers subscribe per field.
|
|
79
1969
|
|
|
80
1970
|
### Added
|
|
81
1971
|
|