@kineviz/gl 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1142 -1
- package/LICENSE +21 -201
- package/NOTICE +9 -1
- package/README.md +1 -1
- package/dist/WebGLForceLayoutController-P6NPZ7WK.mjs +1538 -0
- package/dist/builtins.css +2 -0
- package/dist/builtins.d.mts +61 -0
- package/dist/builtins.d.ts +61 -0
- package/dist/builtins.js +3815 -0
- package/dist/builtins.mjs +2 -0
- package/dist/chunk-4PNV55G2.mjs +394 -0
- package/dist/chunk-67FBXXN6.mjs +2875 -0
- package/dist/chunk-EHGKWZTS.mjs +2 -0
- package/dist/chunk-L6OXJ7GJ.mjs +1245 -0
- package/dist/{chunk-EDTCHJCZ.mjs → chunk-Y34RQAIU.mjs} +2 -2
- package/dist/core-X3TWUvT9.d.ts +934 -0
- package/dist/core-ueqhAojr.d.mts +934 -0
- package/dist/core.css +2 -0
- package/dist/core.d.mts +11 -0
- package/dist/core.d.ts +11 -0
- package/dist/core.js +6187 -0
- package/dist/core.mjs +2 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +1217 -19490
- package/dist/index.d.ts +1217 -19490
- package/dist/index.js +5496 -3173
- package/dist/index.mjs +662 -4383
- package/dist/kineviz-gl.css +1 -1
- package/dist/kineviz-gl.umd.js +5180 -3504
- package/dist/layout-gpu.js +42 -42
- package/dist/layout-gpu.mjs +12 -12
- package/dist/registry-BIPi31x_.d.mts +19930 -0
- package/dist/registry-BIPi31x_.d.ts +19930 -0
- package/dist/schemas.js +1 -1
- package/dist/schemas.mjs +1 -1
- package/dist/{webgpu-YXDFF4ZT.mjs → webgpu-SY2OB4QP.mjs} +2 -2
- package/dist/world-rings-6GQ4OWZC.mjs +2 -0
- package/package.json +22 -3
- package/dist/chunk-VTIPA7FV.mjs +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,1148 @@ All notable changes to `@kineviz/gl` are documented here.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 0.8.0 — 2026-11-29
|
|
8
|
+
|
|
9
|
+
The licence is now MIT. Icons that travel along paths on a timetable
|
|
10
|
+
(`TripLayer`), millions of edges from typed arrays (`EdgeArrayLayer`),
|
|
11
|
+
point nodes for millions of points, a GPU force layout, family trees and
|
|
12
|
+
routed edges, and a lighter `@kineviz/gl/core` entry. Breaking:
|
|
13
|
+
`MarkerLayer` and `api.markers` are removed (use `TripLayer`), the default
|
|
14
|
+
basemap is ESRI Dark Gray, and a `TileUrlFn` may now return a promise.
|
|
15
|
+
|
|
16
|
+
### Changed — licence: MIT
|
|
17
|
+
|
|
18
|
+
- `@kineviz/gl` is released under the MIT License from this version on
|
|
19
|
+
(`LICENSE`, `package.json` `"license": "MIT"`). `NOTICE` keeps the
|
|
20
|
+
third-party attributions the bundles carry. Earlier versions stay under
|
|
21
|
+
the licence they were published with (Apache-2.0).
|
|
22
|
+
|
|
23
|
+
### Added — TripLayer: icons that travel along paths on a timetable
|
|
24
|
+
|
|
25
|
+
- `TripLayer` / `createTripLayer(spec)` move an icon per trip along a path
|
|
26
|
+
through (time, distance) waypoints, so each vehicle runs at the speed its
|
|
27
|
+
timetable gives it and stops where it waits. Trips sharing a path and
|
|
28
|
+
relative timing share a pattern. Only trips under way are computed, with
|
|
29
|
+
forward-moving cursors; all icons are one instanced draw.
|
|
30
|
+
- Paths are polylines (`paths`) or graph edges (`edges`). A trip on an edge
|
|
31
|
+
follows the layout, flies the great-circle arc on the globe (lifted 1%,
|
|
32
|
+
hidden on the far side) and fades with its edge's opacity.
|
|
33
|
+
- Per trip: `every` (repeat period), `icon`, `color`, `size`, `angle`,
|
|
34
|
+
`orient`, `trail` (comet trail sampled along the path). Icons are images
|
|
35
|
+
(atlas), icon-font glyph names, or the `dart` and `comet` heads.
|
|
36
|
+
- Config: `time` (a new value seeks), `speed` (clock seconds per real
|
|
37
|
+
second), `playing`, `size`, `opacity`, `onTime(time, active)` about four
|
|
38
|
+
times a second. A rebuilt layer keeps its clock (`TripLayerResume`).
|
|
39
|
+
- `tripsOnEdges(list)` builds the spec from `{ edge, begin, duration, every,
|
|
40
|
+
icon, color, size, orient, angle, trail }` per trip.
|
|
41
|
+
Tests: `src/react/layers/__tests__/TripLayer.test.tsx`.
|
|
42
|
+
|
|
43
|
+
### Removed — MarkerLayer, MarkerRenderer, api.markers (use TripLayer)
|
|
44
|
+
|
|
45
|
+
- Breaking. `MarkerLayer`, `MarkerLayerProps`, `MarkerRenderer`,
|
|
46
|
+
`MarkerRendererConfig`, `MarkerSpec`, `computeAirborne`, `FlightSpec`,
|
|
47
|
+
`MarkersApi` and the `api.markers` namespace (`set`, `flights`, `stop`,
|
|
48
|
+
`clear`, and the `markers.*` method schemas) are gone, with the marker
|
|
49
|
+
shaders and the always-mounted markers bridge. `TripLayer` with `edges`
|
|
50
|
+
(or `tripsOnEdges`) does everything they did.
|
|
51
|
+
- Migrating: a marker that looped on its edge is a trip with `every` equal to
|
|
52
|
+
its duration and `begin: -phaseOffset * duration`. A flight of
|
|
53
|
+
`api.markers.flights(list, { loopMs })` is a trip with
|
|
54
|
+
`begin: (departT - 1) * loop`, `duration: durFrac * loop`, `every: loop`.
|
|
55
|
+
Sizes are CSS pixels, not device pixels.
|
|
56
|
+
Tests: `src/react/layers/__tests__/TripLayer.test.tsx` (edge trips, repeats,
|
|
57
|
+
glyphs, trails, resume, `tripsOnEdges`).
|
|
58
|
+
|
|
59
|
+
### Added — EdgeArrayLayer: millions of edges from typed arrays
|
|
60
|
+
|
|
61
|
+
- `EdgeArrayLayer` / `createEdgeArrayLayer(spec)` draw edges given as two
|
|
62
|
+
index arrays (`source`, `target`) over the nodes of
|
|
63
|
+
`store.setDataFromArrays()`, in one instanced draw call: node positions
|
|
64
|
+
are read from a float texture on the GPU, so no edge objects are built.
|
|
65
|
+
Per-edge `colors` (bytes or floats) and `widths` in pixels; lines under a
|
|
66
|
+
pixel fade instead of widening. A per-node `flowField` drives pulses that
|
|
67
|
+
run toward lower values (`flowSpeed`, `flowSpacing`, `flowLength`,
|
|
68
|
+
`flowStrength`). An `emphasis` byte per edge (1 or 2, re-read when
|
|
69
|
+
`emphasisVersion` changes) lights edges and dims the rest
|
|
70
|
+
(`dimOpacity`, `emphasisColors`, `emphasisWidth`), revealed outward from
|
|
71
|
+
`revealOrigin`. `pickable` registers a hit mesh that reports each edge's
|
|
72
|
+
source node through `onNodeClick`. 1,636,474 edges draw at 60 fps on an
|
|
73
|
+
Apple-silicon Mac (example `scenario-south-america-rivers`).
|
|
74
|
+
`flowFieldVersion` re-reads a `flowField` written in place, and a new
|
|
75
|
+
`emphasisVersion` restarts the reveal, so a cascade recomputed per click
|
|
76
|
+
replays from the same origin (example `scenario-fly-connectome`, 305,000
|
|
77
|
+
3D edges at 60 fps). Lines under a pixel draw one pixel wide, not two.
|
|
78
|
+
Tests: `src/react/layers/__tests__/EdgeArrayLayer.test.tsx`.
|
|
79
|
+
- `drawCount` (live setting, React prop too): draw and pick only the first
|
|
80
|
+
`drawCount` edges, at no cost to change. Order the edges with the ones to
|
|
81
|
+
keep first and lower it for a zoomed-out view: with 5.4 million skeleton
|
|
82
|
+
segments of the FlyWire brain on screen at once, an M1 Max drew 17 fps;
|
|
83
|
+
the first quarter at 57 fps.
|
|
84
|
+
Tests: `src/react/layers/__tests__/EdgeArrayLayer.test.tsx` (`drawnEdges`,
|
|
85
|
+
`edgeArrayConfig`, the drawn and pick meshes).
|
|
86
|
+
|
|
87
|
+
### Fixed — a layer hit mesh is clickable without the node cloud
|
|
88
|
+
|
|
89
|
+
- With `nodeCloud={false}` there is no built-in node pick quad, and
|
|
90
|
+
`Picker` answered every click as the background, ignoring meshes added
|
|
91
|
+
with `addNodeHitMesh`. Node picking now runs when either is present.
|
|
92
|
+
Tests: `src/interaction/__tests__/Picker.layerHitMesh.test.tsx`.
|
|
93
|
+
|
|
94
|
+
### Changed — default basemap is ESRI Dark Gray (Carto raster tiles need an API key)
|
|
95
|
+
|
|
96
|
+
- Carto's raster tiles now answer every request without an API key with the
|
|
97
|
+
same "API KEY REQUIRED" image, so the old default `cartoDark` drew a
|
|
98
|
+
placeholder. The default is now `esriDarkGray` (ESRI Dark Gray Canvas, no
|
|
99
|
+
labels, no key; new `DEFAULT_TILE_PROVIDER`) for `MapApi.enableMap`, the
|
|
100
|
+
`enableMap` verb, `FlatLayer`, `GlobeLayer` and `map={true}`.
|
|
101
|
+
`DEFAULT_THEME_TO_PROVIDER`: dark, midnight, forest → `esriDarkGray`;
|
|
102
|
+
light → new `esriLightGray`; warm → `esriWorldTopo` (midnight was Stadia,
|
|
103
|
+
which now answers 401). The Carto and Stadia keys stay, marked
|
|
104
|
+
`requiresKey: true` in `FREE_PROVIDER_META`.
|
|
105
|
+
- `FREE_PROVIDER_META` entries (`FreeProviderMeta`) carry `maxLevel`, the
|
|
106
|
+
deepest level the provider has tiles for. The ESRI gray basemaps stop at
|
|
107
|
+
16 (deeper they answer "Map data not yet available"); the map layers stop
|
|
108
|
+
there and stretch level 16 beyond, unless `maxLevel` is given.
|
|
109
|
+
Tests: `src/react/layers/__tests__/resolveLayerTiles.test.ts`,
|
|
110
|
+
`tests/api/modules/MapApi.test.ts`, `tests/react/themeToProvider.test.ts`,
|
|
111
|
+
`gl-verbs/src/__tests__/enableMap.test.ts`.
|
|
112
|
+
|
|
113
|
+
### Added — @2x (512 px) tiles on dense screens
|
|
114
|
+
|
|
115
|
+
- At a pixel ratio of 1.5 or more the map layers draw a provider's @2x tiles
|
|
116
|
+
when it has them (`FreeProviderMeta.tileUrl2x`; the Google providers), or
|
|
117
|
+
the host's `map.tileUrl2x` / `tileUrl2x` prop for a custom `tileUrl`.
|
|
118
|
+
A @2x tile holds four times the pixels of the same x/y/level, so the map
|
|
119
|
+
needs one level fewer for the same sharpness and labels keep their size.
|
|
120
|
+
New `resolveProviderTiles(name, pixelRatio)`.
|
|
121
|
+
Tests: `src/react/layers/__tests__/resolveLayerTiles.test.ts`.
|
|
122
|
+
|
|
123
|
+
### Fixed — map tiles and view moves stayed off screen until the next input
|
|
124
|
+
|
|
125
|
+
- `map.flyTo`, `map.fitToNodes` and `map.setZoomLevel` (flat and globe) now
|
|
126
|
+
ask for a frame on every step. Before, they only wrote the scene position
|
|
127
|
+
while the loop was idle, so a `flyTo` stayed on the old view and its
|
|
128
|
+
tiles were never requested until the mouse moved. New
|
|
129
|
+
`InteractionManager.requestRender()`.
|
|
130
|
+
Tests: `src/api/modules/__tests__/MapApi.viewRender.test.ts`.
|
|
131
|
+
- A host frame callback (`registerFrameCallback`, `useRenderLoop`) may
|
|
132
|
+
return `true` to get another frame. An `invalidate()` made from inside a
|
|
133
|
+
frame callback was overwritten by the frame-end settle and lost (the globe
|
|
134
|
+
called it every frame to drive its tile fades).
|
|
135
|
+
Tests: `src/__tests__/RenderRuntime.loop.test.ts` ("a host frame callback
|
|
136
|
+
that returns true gets another frame").
|
|
137
|
+
|
|
138
|
+
### Fixed — framing on a globe (the capitals example was a blue screen)
|
|
139
|
+
|
|
140
|
+
- `camera.flyToAll` and `camera.flyToNodes` on a globe now fit by latitude
|
|
141
|
+
and longitude, as `map.fitToNodes` does. They framed the nodes'
|
|
142
|
+
scene-space bounding box, which is centred inside the sphere, so the
|
|
143
|
+
camera flew into the globe and saw only the inside of the atmosphere.
|
|
144
|
+
Nodes the geo layout has not placed on the sphere yet are skipped.
|
|
145
|
+
New `@internal` `map.fitNodesOnGlobe()` and `camera.setGlobeFit()`.
|
|
146
|
+
Tests: `src/api/modules/__tests__/CameraApi.globeFit.test.ts`.
|
|
147
|
+
- `map.flyToBounds` on a globe goes no further out than the whole globe
|
|
148
|
+
filling about 80 % of the view's height. Data spread over the world asked
|
|
149
|
+
for zoom 0, which left the globe a small disc. The declarative geo
|
|
150
|
+
layout's first fit on a globe now goes through `flyToBounds` too, instead
|
|
151
|
+
of its own zoom clamped at 0.
|
|
152
|
+
Tests: `src/api/modules/__tests__/CameraApi.globeFit.test.ts`,
|
|
153
|
+
`src/react/__tests__/geoLayoutAutoFit.test.tsx` ("on a globe fits through
|
|
154
|
+
flyToBounds too").
|
|
155
|
+
- A camera fly still running when the map is enabled stops where it is. A
|
|
156
|
+
`flyToAll` the host started before the declarative map came on kept moving
|
|
157
|
+
the scene and overwrote the map's own fit. A fly replaced by a newer one
|
|
158
|
+
now settles its promise instead of leaving the caller waiting forever.
|
|
159
|
+
New `@internal` `camera.cancelFly()`.
|
|
160
|
+
Tests: `src/api/modules/__tests__/CameraApi.cancelFly.test.ts`.
|
|
161
|
+
|
|
162
|
+
### Changed — map tiles (`SlippyMapFlat`, `SlippyMapGlobe`) rewritten for speed and sharpness
|
|
163
|
+
|
|
164
|
+
Both now extend one internal base class, `TilePyramid` (`map/geo-map/TilePyramid.ts`).
|
|
165
|
+
|
|
166
|
+
- Tile choice is a quadtree walk in device pixels: a tile in view splits
|
|
167
|
+
once it would show more than `SPLIT_MAGNIFICATION` (1.3) times magnified,
|
|
168
|
+
measured at the tile's point nearest the camera, so pitched views use
|
|
169
|
+
finer tiles near the camera and coarser ones towards the horizon.
|
|
170
|
+
Flat: frustum test on the tile's square. Globe: the tile's nearest point
|
|
171
|
+
must face the camera (horizon) and its bounding sphere meet the frustum;
|
|
172
|
+
its size is its edge on the ground (2πR·cos(lat) / 2^z).
|
|
173
|
+
Before, the flat map assumed an 800 px viewport, ignored the pixel ratio,
|
|
174
|
+
kept a level up to 1.6x magnified and capped the view at 8 tiles around
|
|
175
|
+
the centre; the globe chose one level from the camera's altitude alone,
|
|
176
|
+
for the whole view, and after a rotation at street level left the new
|
|
177
|
+
side as a stretched coarse tile.
|
|
178
|
+
- A missing tile is covered by a loaded ancestor or by loaded children, and
|
|
179
|
+
a tile fading in keeps that stand-in underneath until its fade ends
|
|
180
|
+
(before, a fading tile blended over the background or the globe's black
|
|
181
|
+
inner sphere). Every wanted tile's level-2 ancestor (`BACKSTOP_LEVEL`) is
|
|
182
|
+
requested first, so a jump to a new place has something to show.
|
|
183
|
+
An arriving tile asks for a frame and fades in over `TILE_FADE_MS`.
|
|
184
|
+
- Tiles live in an LRU cache (`cacheSize`, default 400); the globe used to
|
|
185
|
+
keep every tile it had loaded at the current and coarser levels. Requests
|
|
186
|
+
go through a queue (`maxConcurrent`, default 8), nearest first, and are
|
|
187
|
+
aborted when the tile leaves the view. Images decode off the main thread
|
|
188
|
+
(`fetch` + `createImageBitmap`). Anisotropy 8 (flat), 16 (globe).
|
|
189
|
+
- No per-frame allocation; a frame whose view did not move does no tile work.
|
|
190
|
+
- Globe tiles no longer write depth (the inner sphere does), so a coarse
|
|
191
|
+
ancestor and its finer children draw on the same surface without
|
|
192
|
+
z-fighting.
|
|
193
|
+
- API: config `tileSize`, `maxConcurrent`, `cacheSize`, `loadImage`
|
|
194
|
+
(`TileImageLoader`), `anisotropy`, `maxLevel` up to 22; `setInvalidate()`,
|
|
195
|
+
`setSource()`, `stats()`, `dispose()`, `tileKey()`;
|
|
196
|
+
`updatePov(camera, { bufferHeight })` returns `true` while tiles fade.
|
|
197
|
+
**Removed:** the `level` setters (the getters report the finest level in
|
|
198
|
+
view), the flat level-change `console.log`, and the globe's `thresholds`,
|
|
199
|
+
`lodBias` and `tileMargin`. The `d3-octree` dependency is removed, and so
|
|
200
|
+
is the internal `utils/loadTile` helper: a tile URL promise that rejects
|
|
201
|
+
is now handled by the tile loader ("a tile URL promise that rejects frees
|
|
202
|
+
its slot and marks the tile failed").
|
|
203
|
+
Tests: `src/map/geo-map/__tests__/SlippyMapFlat.tiles.test.ts`,
|
|
204
|
+
`src/map/geo-map/__tests__/SlippyMapGlobe.tiles.test.ts`.
|
|
205
|
+
- Map wheel zoom: 200 px of wheel is one zoom level (`wheelZoomLevels`,
|
|
206
|
+
lines ×40, pages ×800, at most one level per event), smoothed over frames.
|
|
207
|
+
Before, a wheel notch moved about 0.04 levels. `FlatLayer` no longer snaps
|
|
208
|
+
to an integer level after the wheel stops, so zoom glides.
|
|
209
|
+
Tests: `src/interaction/__tests__/GraphControl.mapWheel.test.tsx`.
|
|
210
|
+
|
|
211
|
+
### Added — GPU force layout (`engine: "webgl"`)
|
|
212
|
+
|
|
213
|
+
- `forceLayout={{ engine: "webgl" }}`: a force layout run as WebGL2 render
|
|
214
|
+
passes on a context of its own, ported from cosmos.gl's simulation (MIT;
|
|
215
|
+
attribution in `NOTICE` and in the bundled code). Repulsion is a
|
|
216
|
+
data-fitted grid pyramid for the far field plus randomly sampled
|
|
217
|
+
near-field pairs, so large clustered graphs keep their communities apart.
|
|
218
|
+
60 fps at 10 000 and 100 000 nodes on an Apple M1 Max. It runs on the main
|
|
219
|
+
thread, as cosmos.gl does, but never waits on the GPU: positions are read
|
|
220
|
+
back through a pixel-pack buffer and a fence and collected once the fence
|
|
221
|
+
has signalled. (A worker host exists but is not the default: starting a
|
|
222
|
+
worker took 0.3–3.6 s in Chrome 158, and the layout could not move until it
|
|
223
|
+
was up.) 2D only: a canvas that starts in 3D gets `"d3"`, with a warning.
|
|
224
|
+
Without WebGL2, float render targets or float blending it falls back to
|
|
225
|
+
`"d3"`, with a warning. Loaded on demand; not in the default bundle. The
|
|
226
|
+
default engine is still `"d3"`.
|
|
227
|
+
`ForceLayoutConfig.engine` and `ForceEngineKind` gain `"webgl"`.
|
|
228
|
+
Like cosmos.gl it steps once per rendered frame, decays over 5000 steps,
|
|
229
|
+
and spreads nodes that have no position yet over a disc before starting.
|
|
230
|
+
GraphCanvas starts it on the store's nodes before publishing it, so the
|
|
231
|
+
first frames already show the spread instead of every node at the origin.
|
|
232
|
+
Tests: `src/layout/webglForce/__tests__/webglForceSizing.test.ts`,
|
|
233
|
+
`src/layout/webglForce/__tests__/WebGLForceLayoutController.test.ts`,
|
|
234
|
+
`src/layout/webglForce/__tests__/mainThreadHost.test.ts`,
|
|
235
|
+
`src/react/__tests__/forceLayoutEngine.test.ts`.
|
|
236
|
+
- `EdgeClassifier.readCurve(edgeId, is3D)` and `lastPlaneRotation`: the
|
|
237
|
+
values of `getCurveParams` without allocating, used when packing edges.
|
|
238
|
+
`classify` keeps an edge's pair key in its info entry instead of a second
|
|
239
|
+
map; about a third faster at 200 000 edges.
|
|
240
|
+
Test: `src/edge/__tests__/EdgeClassifier.classify.test.ts`.
|
|
241
|
+
- `autoFit` prop on `GraphCanvas`: the camera frames the graph from the first
|
|
242
|
+
frame and follows it while the layout spreads, easing toward the fit; it
|
|
243
|
+
stops when the layout settles or at the first wheel, pointer-down or touch
|
|
244
|
+
on the canvas. On by default with `forceLayout={{ engine: "webgl" }}` when
|
|
245
|
+
the host gives no `defaultViewState`, `initialPosition` or
|
|
246
|
+
`layoutController`; off otherwise. Tests:
|
|
247
|
+
`src/react/__tests__/graphCanvasStartup.test.tsx`,
|
|
248
|
+
`src/api/modules/__tests__/CameraApi.fitStep.test.ts`.
|
|
249
|
+
- `EdgeClassifier.classifySlots(edges, sources, targets, nodeIds)`,
|
|
250
|
+
`readCurveAt(slot, edgeId, is3D)` and the `SlotEdge` type: edge curves
|
|
251
|
+
computed over slot-indexed number arrays, with the per-id map built only
|
|
252
|
+
when something asks for it. Edge geometry setup at 100 000 nodes and
|
|
253
|
+
150 000 edges: classify and curve read 343 → 56 ms on an M1 Max.
|
|
254
|
+
Test: `src/edge/__tests__/EdgeClassifier.classifySlots.test.ts`.
|
|
255
|
+
- The render loop calls the layout controller's `tick()` once per frame, as
|
|
256
|
+
`LayoutControllerInterface` always documented. The built-in d3 and WebGPU
|
|
257
|
+
controllers ignore it; a host-supplied `layoutController` whose `tick()`
|
|
258
|
+
does work now has it called every frame.
|
|
259
|
+
Test: `src/react/graph-context/__tests__/renderLoopIdle.test.tsx`.
|
|
260
|
+
|
|
261
|
+
### Added — family trees and routed edges
|
|
262
|
+
|
|
263
|
+
- Edge shape `"family"` (shader id 5): an orthogonal edge that starts halfway
|
|
264
|
+
between its source and an **anchor** node, so both parents' edges to a child
|
|
265
|
+
leave the couple's midpoint and share one bar. Set the anchor with
|
|
266
|
+
`style.setEdgeAnchor(edgeId, nodeId | null)` (undoable; kept by id, so a
|
|
267
|
+
removed anchor falls back to the source). The bar height uses
|
|
268
|
+
`setEdgeBends` as on orthogonal edges. Evaluated in the edge and arrow
|
|
269
|
+
vertex shaders from three node positions, so it follows drags and tweens.
|
|
270
|
+
Covered by `src/backends/gpu/__tests__/GPUEdgeRenderer.routes.test.tsx`,
|
|
271
|
+
`src/api/modules/__tests__/StyleApi.edgeRouting.test.ts`.
|
|
272
|
+
- Edge shape `"routed"` (shader id 4): a polyline through up to 16 bend
|
|
273
|
+
points, set with `style.setEdgeRoute(edgeId, points | null)` (undoable).
|
|
274
|
+
Points are given in world coordinates and stored relative to the edge's two
|
|
275
|
+
nodes, so the route moves, turns and stretches with them. A routed edge
|
|
276
|
+
with no route draws straight. Covered by
|
|
277
|
+
`src/backends/gpu/__tests__/GPUEdgeRenderer.routes.test.tsx`,
|
|
278
|
+
`src/edge/__tests__/edgePath.test.ts`, `StyleApi.edgeRouting.test.ts`.
|
|
279
|
+
- `api.layout.genealogy(nodeIds?, options?)`: family-tree layout with couples
|
|
280
|
+
side by side, each couple's children under it, remarriages ordered by a
|
|
281
|
+
spouse-edge property, and modes `descendants`, `ancestors` and `hourglass`
|
|
282
|
+
around a `root`. It also sets the edges as part of the same undo step:
|
|
283
|
+
parent edges become anchored `family` edges, spouse edges `orthogonal`,
|
|
284
|
+
and the routing axis follows `direction`. `edgeShapes: false` places the
|
|
285
|
+
nodes only. Registered for `applyByName`; the pure function
|
|
286
|
+
`genealogyLayout` is exported by `@kineviz/gpu-compute`. Covered by
|
|
287
|
+
`gpu-compute/tests/genealogyLayout.test.ts`,
|
|
288
|
+
`src/api/__tests__/LayoutApi.genealogy.test.ts`.
|
|
289
|
+
- `layout.layered` option `edgeShape: "routed"`: edges that skip levels bend
|
|
290
|
+
through the lanes their virtual nodes kept free instead of cutting across.
|
|
291
|
+
Covered by `gpu-compute/tests/hierarchyLayouts.test.ts`,
|
|
292
|
+
`LayoutApi.genealogy.test.ts`.
|
|
293
|
+
- `LayoutResult.edgeParams` and `LayoutResult.edgeRoutingAxis` (gpu-compute):
|
|
294
|
+
a layout, built-in or registered, can return per-edge shape, bend, anchor
|
|
295
|
+
and route. `LayoutApi` applies them with the positions in one transaction,
|
|
296
|
+
with routes encoded against the target positions. Covered by
|
|
297
|
+
`LayoutApi.genealogy.test.ts`.
|
|
298
|
+
- `PathHighlightLayer` and `EdgeTextLayer` follow `family` and `routed`
|
|
299
|
+
edges as drawn. Covered by `src/react/layers/__tests__/effectLayers.test.ts`,
|
|
300
|
+
`src/react/layers/__tests__/EdgeTextLayer.placement.test.tsx`.
|
|
301
|
+
- WebGPU render path: `family` and `routed` edges draw straight for now (not
|
|
302
|
+
ported).
|
|
303
|
+
- New example `scenario-family-tree`.
|
|
304
|
+
|
|
305
|
+
### Added — `@kineviz/gl/core` and `@kineviz/gl/builtins`
|
|
306
|
+
|
|
307
|
+
- **`@kineviz/gl/core`**: the canvas, store, api, core layers and hooks,
|
|
308
|
+
with none of the optional parts installed. **`@kineviz/gl/builtins`**: those
|
|
309
|
+
parts as installable descriptors (`maps`, `geoEgoRing`, `minimap`,
|
|
310
|
+
`toolbar`, `legend`, `nodeCards`, `nodeInfo`, `quickCreate`, `contextMenu`,
|
|
311
|
+
`coverage`, `polygons`, `algorithms`, `io`, `skills`, `allBuiltins`),
|
|
312
|
+
installed with **`installBuiltins(...)`** (also exported from the root,
|
|
313
|
+
with `installedBuiltins()` and the `Builtin` types). `@kineviz/gl` and the
|
|
314
|
+
UMD build install all of them when they load, so nothing changes for hosts
|
|
315
|
+
that import the root. A prop asking for a part that is not installed warns
|
|
316
|
+
once; an api namespace that is not installed throws a message naming what
|
|
317
|
+
to install. Measured (`yarn workspace @kineviz/gl measure`, gzip):
|
|
318
|
+
`GraphCanvas` 362 → 240 KiB, the `core` entry 247 KiB, the root 429 →
|
|
319
|
+
379 KiB. Covered by `src/builtins/__tests__/registry.test.tsx` and
|
|
320
|
+
`src/__tests__/importClosure.test.ts` (neither `GraphContext` nor `core`
|
|
321
|
+
statically reaches a built-in).
|
|
322
|
+
- `package.json` now declares `sideEffects`: the entries that install
|
|
323
|
+
built-ins or set three's colour management (`index`, `core`, the UMD
|
|
324
|
+
build), the shared chunks and CSS have side effects; `schemas`,
|
|
325
|
+
`layout-gpu` and `builtins` do not. Every entry still imports
|
|
326
|
+
`threeColorManagement` first (`registry.test.tsx`).
|
|
327
|
+
|
|
328
|
+
### Changed
|
|
329
|
+
|
|
330
|
+
- **`TileUrlFn` may return `Promise<string>`.** The vector basemap
|
|
331
|
+
(`vectorDark`, `createVectorTileProvider`) now loads its world outline
|
|
332
|
+
(48 KiB gzip) on its first tile instead of with the engine, and returns a
|
|
333
|
+
promise of those first tiles. Both map layers accept either. Code that
|
|
334
|
+
*calls* a tile function itself must now handle a promise. Covered by
|
|
335
|
+
`src/map/geo-map/__tests__/VectorTileProvider.lazy.test.tsx` and
|
|
336
|
+
`importClosure.test.ts`.
|
|
337
|
+
- `api.coverage`, `api.polygon`, `api.algorithms`, `api.io` and `api.skills`
|
|
338
|
+
are built on first access instead of with the api. With `@kineviz/gl` they
|
|
339
|
+
behave as before; they are accessor properties now, still enumerable.
|
|
340
|
+
Covered by `registry.test.tsx`.
|
|
341
|
+
|
|
342
|
+
### Fixed — large graphs: renderers rebuilt or re-uploaded for nothing
|
|
343
|
+
|
|
344
|
+
- An inline `nodeCloud`, `edgeCloud`, `node` or `edge` config
|
|
345
|
+
(`edgeCloud={{ segments: 1 }}`) is a new object on every render of the
|
|
346
|
+
host, and each one rebuilt the renderer it configures. The canvas now keeps
|
|
347
|
+
the previous config while the contents match (same keys, identical values,
|
|
348
|
+
arrays by element). At a million edges a rebuild took about 2.5 s, so a
|
|
349
|
+
host showing a frame-rate readout kept the canvas rebuilding for good.
|
|
350
|
+
Tests: `src/react/__tests__/graphCanvasStartup.test.tsx`,
|
|
351
|
+
`src/react/graph-context/__tests__/useShallowStable.test.ts`.
|
|
352
|
+
- The node renderer re-copied and re-uploaded the whole position texture on
|
|
353
|
+
every frame, even when no position had changed: the render loop binds the
|
|
354
|
+
store's provider each frame, and binding counted as a new provider. Binding
|
|
355
|
+
the same provider again is now a no-op, and moved positions still upload
|
|
356
|
+
through the provider's dirty flag. At 1 000 000 nodes and 1.5 million edges
|
|
357
|
+
with positions in the data, on an M1 Max: 5 → 22 fps (60 fps without the
|
|
358
|
+
edges).
|
|
359
|
+
Test: `src/backends/gpu/__tests__/GPUNodeRenderer.positionUpload.test.tsx`.
|
|
360
|
+
- `GraphCanvas` without a `container` prop built its engine twice: its host
|
|
361
|
+
div moved under the context providers once they existed, and React
|
|
362
|
+
replaced it. Test: `src/react/__tests__/graphCanvasStartup.test.tsx`.
|
|
363
|
+
- `IndexManager.edgeIdToIndex` (graph-core) is built on first use, and
|
|
364
|
+
`StyleApi` category operations use a per-category node index
|
|
365
|
+
(`GraphStore.nodesOfCategory`, internal). Load at 100 000 nodes:
|
|
366
|
+
`setData` 299 → 87 ms; 105 `setCategoryColor` calls 807 → 135 ms.
|
|
367
|
+
Tests: `graph-core/tests/IndexManager.lazyEdgeMap.test.ts`,
|
|
368
|
+
`src/core/__tests__/GraphStore.nodesOfCategory.test.ts`.
|
|
369
|
+
|
|
370
|
+
### Fixed — WebGPU render path (`enableWebGPURenderPath`) held at 33–39 fps
|
|
371
|
+
|
|
372
|
+
At 100 000 nodes and 214 000 edges on an M1 Max, both force layouts drawn
|
|
373
|
+
through the WebGPU path now run at 60 fps. Before, they ran at 39 fps with the
|
|
374
|
+
WebGPU layout and 33–36 fps with the WebGL layout.
|
|
375
|
+
|
|
376
|
+
- The edge and arrow instance buffers were marked `DynamicDrawUsage`, which
|
|
377
|
+
three's WebGPU backend reads as "upload on every render", whatever the
|
|
378
|
+
version. That came to 46 MB of `writeBuffer` per frame. Test:
|
|
379
|
+
`src/backends/webgpu/__tests__/WebGPUEdgePrimitive.test.tsx`.
|
|
380
|
+
- Transparent double-sided edges and arrows were drawn twice, back faces then
|
|
381
|
+
front faces (`forceSinglePass` was not set). While no edge is curved, edges
|
|
382
|
+
draw one quad each (6 indices instead of the 20-segment strip's 120). The
|
|
383
|
+
strip comes back as soon as an edge or the default shape is curved. Test:
|
|
384
|
+
`src/backends/webgpu/__tests__/WebGPUEdgePrimitive.test.tsx`.
|
|
385
|
+
- Positions and the per-node arrays upload only when they changed
|
|
386
|
+
(`RenderRuntime.positionsVersion`, and the store's change versions), not on
|
|
387
|
+
every frame. Tests: `src/__tests__/RenderRuntime.positionsVersion.test.ts`,
|
|
388
|
+
`src/backends/webgpu/__tests__/WebGPUNodePrimitive.test.ts`,
|
|
389
|
+
`src/backends/webgpu/__tests__/WebGPUEdgePrimitive.test.tsx`.
|
|
390
|
+
- With the WebGPU layout, the WebGPU path copies positions from the layout's
|
|
391
|
+
own GPU buffer, on the GPU, on every tick. The layout then reads positions
|
|
392
|
+
back to the CPU only every 10th tick, for picking and the API; before, it
|
|
393
|
+
waited on a `mapAsync` of every tick (18–23 ms). The canvas repaints on each
|
|
394
|
+
write of the buffer, not only on a readback. Tests:
|
|
395
|
+
`src/backends/webgpu/__tests__/WebGPUPaintTarget.test.tsx`,
|
|
396
|
+
`src/backends/__tests__/SharedGpuResources.test.ts`.
|
|
397
|
+
- gpu-compute: `WebGPUForceLayoutController.setReadbackInterval(k | null)`,
|
|
398
|
+
and `onTick` reports `dimensions`. Test:
|
|
399
|
+
`gpu-compute/tests/WebGPUForceLayoutController.options.test.ts`.
|
|
400
|
+
|
|
401
|
+
### Fixed — WebGL force layout (`engine: "webgl"`) never came to rest
|
|
402
|
+
|
|
403
|
+
With no `decay` or `alphaDecay` given, the WebGL layout kept moving for minutes.
|
|
404
|
+
Moving nodes are hard to click. It now cools like d3 and stops on its own.
|
|
405
|
+
|
|
406
|
+
- The default `decay` is 687 ticks. That is the cooling of an `alphaDecay` of
|
|
407
|
+
0.01, the default the WebGPU layout already uses (d3's own default, about
|
|
408
|
+
0.0228, stops after 300 ticks). Before, it was 5000 ticks. Test:
|
|
409
|
+
`src/layout/webglForce/__tests__/webglForceSizing.test.ts`.
|
|
410
|
+
- The main-thread host steps once more while a position read is still on the
|
|
411
|
+
GPU (`MAX_STEPS_AHEAD = 1`). Before, it stepped only when a read had come
|
|
412
|
+
back, about 15 times a second at 100 000 nodes. After it settles, it still
|
|
413
|
+
delivers the final positions. Test:
|
|
414
|
+
`src/layout/webglForce/__tests__/mainThreadHost.test.ts`.
|
|
415
|
+
- Measured in the galaxy example at 1920×1080, DPR 2, on an M1 Max: 100 000
|
|
416
|
+
nodes run at 60 fps and stop after about 12–18 s; 250 000 nodes run at about
|
|
417
|
+
32 fps and stop after about 44 s.
|
|
418
|
+
|
|
419
|
+
### Added — point nodes, a configurable pixel floor, and a flat data entry
|
|
420
|
+
|
|
421
|
+
For point sets of millions of nodes with no layout. Measured on an M1 Max,
|
|
422
|
+
Chrome 158, 1920×1080, DPR 1, against cosmos.gl's "ten-million" example on the
|
|
423
|
+
same machine. Ours uses the flat entry, `primitive: "point"` and `minPixelSize: 0`:
|
|
424
|
+
|
|
425
|
+
| nodes | cosmos.gl fps | ours fps | cosmos.gl first frame | ours first frame | cosmos.gl heap | ours heap |
|
|
426
|
+
|---|---|---|---|---|---|---|
|
|
427
|
+
| 1M | 60 | 60 | 1.4 s | 0.4 s | 108 MB | 338 MB |
|
|
428
|
+
| 2M | 46 | 60 | 0.8 s | 0.6 s | 324 MB | 704 MB |
|
|
429
|
+
| 5M | 30 | 59 | 1.4 s | 1.5 s | 900 MB | 1.9 GB |
|
|
430
|
+
| 10M | 20.4 | 27 | 3.7 s | 2.6 s | 1.0 GB | 3.3 GB |
|
|
431
|
+
|
|
432
|
+
Before these changes, the same scene took 5.3 s to its first frame at 5M nodes,
|
|
433
|
+
and 12.5 s at 10M (instanced quads, `setData` plus `setCategoryColor`).
|
|
434
|
+
|
|
435
|
+
- `GPUNodeRendererConfig.minPixelSize` (`nodeCloud={{ minPixelSize }}`,
|
|
436
|
+
`<NodeCloud minPixelSize>`), and `GPUNodeRenderer.setMinPixelSize()`: the
|
|
437
|
+
smallest on-screen node diameter in CSS px. The default is 1.5, the floor
|
|
438
|
+
that was hard-coded before. Lower values let far nodes shrink to single
|
|
439
|
+
pixels. A node never draws under one device pixel: one that would be
|
|
440
|
+
smaller draws one device pixel, with its opacity scaled by its area (the
|
|
441
|
+
cosmos.gl rule), so dense regions read as density. The click target never
|
|
442
|
+
goes under 1.5 px. Tests:
|
|
443
|
+
`src/backends/gpu/__tests__/GPUNodeRenderer.pointPrimitive.test.tsx`,
|
|
444
|
+
`src/interaction/__tests__/Picker.pointPrimitive.test.tsx`,
|
|
445
|
+
`src/shaders/__tests__/screenCap.shader.test.ts`.
|
|
446
|
+
- `GPUNodeRendererConfig.primitive: "quad" | "point"` (type `NodePrimitive`).
|
|
447
|
+
`"point"` draws one `GL_POINTS` vertex per node instead of a 4-vertex
|
|
448
|
+
instanced quad, from the same per-node arrays.
|
|
449
|
+
- Point nodes are pickable like quads (hover, click, `onNodeClick`). The
|
|
450
|
+
picker draws them as a `THREE.Points` over the same arrays, with a 3-byte
|
|
451
|
+
id per node (a quad's is 12). Drawing does not slow down: 1M nodes, 60
|
|
452
|
+
fps and 0.37 s to the first frame with or without picking.
|
|
453
|
+
- A point sprite stops growing at the GPU's largest point size
|
|
454
|
+
(`ALIASED_POINT_SIZE_RANGE`), and ignores a shape's aspect. That is why it
|
|
455
|
+
is opt-in (see the ADR `node-quad-billboard-migration.md`).
|
|
456
|
+
- The default stays `"quad"`. The WebGPU render path ignores both options.
|
|
457
|
+
- Tests: `src/backends/gpu/__tests__/GPUNodeRenderer.pointPrimitive.test.tsx`,
|
|
458
|
+
`src/interaction/__tests__/Picker.pointPrimitive.test.tsx`.
|
|
459
|
+
- `GraphStore.setDataFromArrays(input: FlatNodeData)` (type `FlatNodeData`):
|
|
460
|
+
nodes as flat arrays.
|
|
461
|
+
- Inputs: `positions` (2D or 3D), optional `ids`, `category` (one, or one
|
|
462
|
+
per node), `colors` (float 0..1 or 8-bit), `sizes`, and `shape` (one
|
|
463
|
+
built-in shape for every node, such as `"star"`).
|
|
464
|
+
- The caller builds no node objects. Colours, sizes and shape go straight into
|
|
465
|
+
render state as caller-set (the category mapping does not repaint them),
|
|
466
|
+
and positions become a `StaticPositionProvider`.
|
|
467
|
+
- Node buffers are sized to the count, without the 1.5× headroom `setData`
|
|
468
|
+
leaves. Ids default to the slot number as a string.
|
|
469
|
+
- The graph has no edges.
|
|
470
|
+
- Test: `src/core/__tests__/GraphStore.setDataFromArrays.test.ts`.
|
|
471
|
+
|
|
472
|
+
### Changed — faster large loads
|
|
473
|
+
|
|
474
|
+
- `style.setCategoryColor` records one `SetCategoryColor` command instead of
|
|
475
|
+
one `SetNodeColor` command per node. It is still one undo step, and undo
|
|
476
|
+
still restores each node's colour and override bits. It parses the colour
|
|
477
|
+
once and works on slots: 5 000 000 nodes take 0.2 s instead of 2.0 s, and
|
|
478
|
+
grow the heap by 210 MB instead of 570 MB. History entries for a category colour now have the type
|
|
479
|
+
`"SetCategoryColor"`. Tests:
|
|
480
|
+
`src/api/commands/__tests__/SetCategoryColorCommand.test.ts`,
|
|
481
|
+
`tests/api/modules/StyleApi.undoGrouping.test.ts`.
|
|
482
|
+
- `IndexManager` (`@kineviz/graph-core`) builds its node id → slot map on
|
|
483
|
+
first lookup, as the edge map already did. A graph with edges still builds
|
|
484
|
+
it during `setData`. A 5 000 000-node `setData` without edges drops from
|
|
485
|
+
1.8 s to 0.14 s. Test: `graph-core/tests/IndexManager.lazyNodeMap.test.ts`.
|
|
486
|
+
- Node icon UVs skip the per-node id lookup when no node has an icon. With
|
|
487
|
+
5 000 000 numeric ids ("0", "1", …), that lookup took about 3.4 s before the
|
|
488
|
+
first frame. Test: `src/icons/__tests__/resolveIconUVs.test.ts`.
|
|
489
|
+
|
|
490
|
+
### Fixed — clicks on node 1 048 576 and later picked another node
|
|
491
|
+
|
|
492
|
+
A pick id held the node index in 20 bits: from node 1 048 576 on, a click or
|
|
493
|
+
hover reported node `index − 1 048 576`. Pick ids are now additive
|
|
494
|
+
(`TYPE_NODE + index`), the same value as before for every index under 2^20,
|
|
495
|
+
so up to 15 728 639 nodes (and 14 680 063 edges) pick themselves. Past that
|
|
496
|
+
an index is not pickable instead of picking another one.
|
|
497
|
+
`PickerUtils.encodeId` follows; `PickerUtils.decodeId` still reads the type
|
|
498
|
+
from the tag bits, which is exact under 2^20 only. Tests:
|
|
499
|
+
`src/backends/picking/__tests__/PickId.test.ts`,
|
|
500
|
+
`src/interaction/__tests__/Picker.pointPrimitive.test.tsx`.
|
|
501
|
+
|
|
502
|
+
### Changed — hover picking slows down when picks are slow
|
|
503
|
+
|
|
504
|
+
A hover pick draws every node into the picking buffer and waits for the
|
|
505
|
+
readback. The hover throttle was a fixed 40 ms (25 picks a second); it now
|
|
506
|
+
waits at least four times the last pick's duration (`HOVER_PICK_COST_FACTOR`),
|
|
507
|
+
so hover picking takes at most about a fifth of the time. A small graph,
|
|
508
|
+
whose pick takes about a millisecond, keeps 25 picks a second. With ten
|
|
509
|
+
million point nodes and the mouse moving, the fixed rate dropped the frame
|
|
510
|
+
rate from 24 to 9 fps on an M1 Max. Clicks are not throttled. Test:
|
|
511
|
+
`src/interaction/__tests__/hoverThrottle.test.ts`.
|
|
512
|
+
|
|
513
|
+
## 0.7.1 — 2026-11-26
|
|
514
|
+
|
|
515
|
+
Maps down to street level, new layers (buildings, 3D models, effect layers,
|
|
516
|
+
video), orthogonal edges and hierarchy layouts, and fixes, most of them for
|
|
517
|
+
maps with `forceLayout`. Nothing exported by 0.7.0 was removed. Three
|
|
518
|
+
entries marked Changed alter what you see: collected nodes, badge and tag
|
|
519
|
+
placement, and the draw order of photos, videos and cards.
|
|
520
|
+
|
|
521
|
+
### Added — street level on the globe: `map.minAltitude`, the follow camera, see-through buildings
|
|
522
|
+
|
|
523
|
+
These let a view go down among the buildings and travel between them.
|
|
524
|
+
|
|
525
|
+
- **`map.minAltitude`** (and `<GlobeLayer minAltitude>`): how close the wheel
|
|
526
|
+
can bring the camera to the ground, in metres. Default 2. While the camera
|
|
527
|
+
is low, below about 6 km on the default globe, its near and far planes follow
|
|
528
|
+
the altitude, so a building a few metres away is not clipped and depth
|
|
529
|
+
stays precise. `controlConfig.zoomMax` still overrides it.
|
|
530
|
+
Tests: `src/map/geo-map/__tests__/streetCamera.test.ts`.
|
|
531
|
+
- **`followShot(points, options)`** (cinematics): a shot that rides behind a
|
|
532
|
+
route at constant speed: `distance` back, `pitch` degrees down, level
|
|
533
|
+
heading, corners eased over `smoothing`. `marks` gives a cue (with `at` and
|
|
534
|
+
`until`) at each listed point. Cue it and drive it with `director.scrub` to
|
|
535
|
+
follow a route clock. The options type is exported as `FollowShotOptions`.
|
|
536
|
+
Tests: `src/cinematics/__tests__/followShot.test.ts`.
|
|
537
|
+
- **`<BuildingsLayer cutaway>`**: `{ path, radius?, opacity? }`. Buildings
|
|
538
|
+
within `radius` metres (default 12) of the `[lat, lng]` polyline are drawn
|
|
539
|
+
as see-through ghosts (`opacity`, default 0.12) instead of solid blocks. Pass
|
|
540
|
+
the line from the camera to what it looks at, and nothing stands in the way.
|
|
541
|
+
The pure `buildingsAlong(geometry, path, radius)` returns the indices of
|
|
542
|
+
those buildings. `BuildingFootprint` is exported too.
|
|
543
|
+
- **`<BuildingsLayer floorOpacity floorColor levelsProperty>`**: a line round
|
|
544
|
+
each building at every storey, from the `levels` property (default name
|
|
545
|
+
`"levels"`, the count of OSM `building:levels`). Default `floorOpacity` 0, so
|
|
546
|
+
no lines.
|
|
547
|
+
Tests for both: `src/react/layers/__tests__/BuildingsLayer.test.ts`.
|
|
548
|
+
|
|
549
|
+
### Fixed — wheel zoom stuck near the ground, and not symmetric
|
|
550
|
+
|
|
551
|
+
Zoomed all the way in, the wheel then did nothing in either direction below
|
|
552
|
+
about 70 m. A step smaller than a fixed world-unit threshold was dropped, and
|
|
553
|
+
at that height every step was smaller. The threshold is now relative to the
|
|
554
|
+
height. A notch in and a notch out also now cancel exactly, so the same notches
|
|
555
|
+
out bring the camera back to where it was.
|
|
556
|
+
Tests: `src/interaction/__tests__/GlobeControl.wheel.test.tsx`.
|
|
557
|
+
|
|
558
|
+
### Fixed — precision and drawing at street scale
|
|
559
|
+
|
|
560
|
+
- Globe tiles are stored around a local origin, and a tile with very few
|
|
561
|
+
segments no longer draws a grey streak across the globe.
|
|
562
|
+
Tests: `src/map/geo-map/__tests__/streetCamera.test.ts`.
|
|
563
|
+
- `<PathHighlightLayer>` ribbons are stored around a local origin on the
|
|
564
|
+
route, so they no longer jitter close up.
|
|
565
|
+
Tests: `src/react/layers/__tests__/effectLayers.test.ts`.
|
|
566
|
+
- A `<PathHighlightLayer>` segment that runs behind the camera is clipped at
|
|
567
|
+
the near plane instead of vanishing, so a route the camera stands on stays
|
|
568
|
+
drawn. This is shader code, which vitest cannot run; it was checked in the
|
|
569
|
+
browser.
|
|
570
|
+
- `api.map.flyTo` on the globe now also undoes a sideways offset of the globe,
|
|
571
|
+
such as a `cinematics` shot leaves, so the target ends at the screen centre.
|
|
572
|
+
Tests: `src/api/modules/__tests__/MapApi.flyToRecentre.test.ts`.
|
|
573
|
+
- `api.map.elevation` was lost after the geo layout was applied again. The
|
|
574
|
+
render loop does that once the layout's buffer is ready, which put elevated
|
|
575
|
+
nodes back on the ground for good. Nodes rewritten by `applyGeoLayout` are
|
|
576
|
+
now lifted again.
|
|
577
|
+
Tests: `src/api/modules/__tests__/MapApi.geoLayoutElevation.test.ts`.
|
|
578
|
+
|
|
579
|
+
### Added — `<BuildingsLayer>`: extruded building footprints on the map
|
|
580
|
+
|
|
581
|
+
Takes building footprints as a GeoJSON FeatureCollection (Polygon and
|
|
582
|
+
MultiPolygon, holes kept, as OpenStreetMap exports them) and draws each as a
|
|
583
|
+
prism from `minHeight` to `height` metres (`heightProperty`, `baseProperty`,
|
|
584
|
+
`defaultHeight`, `heightScale`), walls shaded by the way they face, with a roof
|
|
585
|
+
outline. Footprints are placed with `api.map.latLngToWorld` and heights with
|
|
586
|
+
`api.map.groundKmToWorld`, around a local origin at the data's centre, rising
|
|
587
|
+
along the map's own surface normal, so it works on the flat map and the globe
|
|
588
|
+
and keeps its precision at street scale. It re-projects when the map is
|
|
589
|
+
enabled or changes projection and draws nothing while no map is shown.
|
|
590
|
+
`opacity` below 1 makes the blocks see-through. Tilt the view with
|
|
591
|
+
`api.map.setPitch` to see them stand. `buildBuildingGeometry` (the pure
|
|
592
|
+
builder) and `createBuildingsLayer` are exported too.
|
|
593
|
+
|
|
594
|
+
Tests: `src/react/layers/__tests__/BuildingsLayer.test.ts`,
|
|
595
|
+
`src/react/layers/__tests__/BuildingsLayer.react.test.tsx`.
|
|
596
|
+
|
|
597
|
+
### Added — `<PathHighlightLayer hopPaths head aheadOpacity>`: routes along roads, driven by time
|
|
598
|
+
|
|
599
|
+
- **`hopPaths`:** `hopPaths[i]` is the route from `path[i]` to `path[i + 1]`, as
|
|
600
|
+
`[lat, lng]` points, for example a road route between two places. While a map
|
|
601
|
+
is shown, the ribbon runs from the first node through those points to the
|
|
602
|
+
next node instead of straight across. The points are projected with
|
|
603
|
+
`api.map.latLngToWorld`, and projected again when the map is enabled,
|
|
604
|
+
disabled or changes projection. On a flat map the route keeps its nodes'
|
|
605
|
+
height, so it follows `map.elevation` too.
|
|
606
|
+
- **Heights:** a point can carry a third value, its height in metres above the
|
|
607
|
+
map: `[lat, lng, 7]`. The route then climbs onto a footbridge or into a
|
|
608
|
+
building instead of staying on the ground. The point is raised along the
|
|
609
|
+
map's own up direction, which is the globe's normal on a globe, and scaled
|
|
610
|
+
with `api.map.groundKmToWorld`. The point type is exported as `HopPathPoint`.
|
|
611
|
+
- **`hopPoints`:** the same per-hop route in world coordinates. It is the
|
|
612
|
+
layer config field that `hopPaths` fills. On a flat map a point's `z` is
|
|
613
|
+
its height above the map, added to the height of its nodes.
|
|
614
|
+
- **`head`:** how far along the path you are, in hops (2.5 is halfway along
|
|
615
|
+
the third hop). When set, the route is drawn up to that point instead of
|
|
616
|
+
animating in, a single particle sits on it, and node halos light up as it
|
|
617
|
+
reaches them. Drive it from a clock or a timeline to move something along
|
|
618
|
+
the route. Within a hop the position goes by distance.
|
|
619
|
+
- **`aheadOpacity`:** keeps the route beyond `head` faintly visible. Default 0.
|
|
620
|
+
- Once the layer has received a config, clearing one of these props clears it.
|
|
621
|
+
Before, the value from mount would have stayed.
|
|
622
|
+
|
|
623
|
+
Tests: `src/react/layers/__tests__/effectLayers.test.ts`,
|
|
624
|
+
`src/react/layers/__tests__/pathHighlightHopPaths.test.tsx`,
|
|
625
|
+
`src/react/layers/__tests__/pathHighlightAltitude.test.ts`.
|
|
626
|
+
|
|
627
|
+
### Added — `<Timeline controls playOptions>`
|
|
628
|
+
|
|
629
|
+
`controls={false}` hides the source, time-field and bucket selectors. Use it
|
|
630
|
+
when the host sets the source with `api.timeline.setSource` and readers should
|
|
631
|
+
not change it. Clear and Play stay. `playOptions` is passed to
|
|
632
|
+
`api.timeline.play` when Play is pressed. Without it, Play still slides a
|
|
633
|
+
one-bucket window and loops.
|
|
634
|
+
|
|
635
|
+
`api.timeline.isPlaying()` and `api.timeline.onPlayingChange(cb)` report when
|
|
636
|
+
playback starts and stops, including a pass that ends by itself and a `pause`
|
|
637
|
+
from the host. The Play button follows them, so it no longer stays on
|
|
638
|
+
"Pause" after playback has stopped.
|
|
639
|
+
|
|
640
|
+
Tests: `src/react/timeline/__tests__/Timeline.props.test.tsx`,
|
|
641
|
+
`src/api/modules/__tests__/TimelineApi.test.ts`.
|
|
642
|
+
|
|
643
|
+
### Fixed — `api.timeline.play({ mode })` ignored `expand` and `shrink`
|
|
644
|
+
|
|
645
|
+
`TimelinePlayOptions.mode` documented `slide | expand | shrink`, but `play`
|
|
646
|
+
always slid. `expand` now keeps the window's start and sweeps its end to the
|
|
647
|
+
end of the domain, resuming from the brushed end, so the graph accumulates.
|
|
648
|
+
`shrink` keeps the end and sweeps the start toward it. With `loop`, `expand`
|
|
649
|
+
shows the full window for one tick and then restarts from an empty one.
|
|
650
|
+
|
|
651
|
+
Tests: `src/api/modules/__tests__/TimelineApi.test.ts`.
|
|
652
|
+
|
|
653
|
+
### Fixed — `api.map.flyTo` before the map was shown was dropped
|
|
654
|
+
|
|
655
|
+
A host that adds its data and frames the view in the same effect races the
|
|
656
|
+
`map` prop, whose `enableMap` runs in a later effect. When `flyTo` (or
|
|
657
|
+
`flyToBounds`, which calls it) won the race it returned without doing
|
|
658
|
+
anything, and the map intermittently stayed at the world view.
|
|
659
|
+
Now the latest such request is kept and applied when the map is enabled and
|
|
660
|
+
its scene is wired, before `map:enabled` fires, so a `flyTo` from a
|
|
661
|
+
`map:enabled` listener still wins. The call still resolves at once.
|
|
662
|
+
|
|
663
|
+
Tests: `src/api/modules/__tests__/MapApi.pendingView.test.ts`.
|
|
664
|
+
|
|
665
|
+
### Fixed — a map with `forceLayout` could lose every node position
|
|
666
|
+
|
|
667
|
+
`forceLayout` builds its controller from the store as it is at that moment and
|
|
668
|
+
installs it on a later render. Nodes a host added in between, for example from
|
|
669
|
+
an init effect writing through `apiRef`, raised their structure change while no
|
|
670
|
+
controller was wired to receive it. The new controller then never learned about
|
|
671
|
+
them: `getPositions()` returned null, and on a map the geo positions written by
|
|
672
|
+
`geoLayout` were lost, so no node was drawn. Installing a controller over a
|
|
673
|
+
store that already has nodes now replays one structure change, so the
|
|
674
|
+
controller is seeded and the geo positions are written again.
|
|
675
|
+
|
|
676
|
+
Tests: `src/react/__tests__/lateLayoutController.test.tsx`.
|
|
677
|
+
|
|
678
|
+
### Fixed — with `forceLayout`, geo nodes under a custom `geoMapping` stayed pinned off the map
|
|
679
|
+
|
|
680
|
+
The first geo projection often lands in a provider that the force-layout
|
|
681
|
+
controller replaces a moment later. The controller then rebuilt its simulation
|
|
682
|
+
from seed positions with the nodes still pinned, and the render loop's
|
|
683
|
+
re-projection, which should have moved them back, ran `applyGeoLayout` with
|
|
684
|
+
only `{ mode }`. That dropped the host's `map.geoLayout.geoMapping` (and
|
|
685
|
+
`pinAutoPlaced` and the other options), so nodes whose lat/lng sit under other
|
|
686
|
+
keys were never re-projected and stayed pinned near the globe's centre, out of
|
|
687
|
+
sight. The re-projection now repeats the last `applyGeoLayout` options;
|
|
688
|
+
`releaseGeoLayout` forgets them.
|
|
689
|
+
|
|
690
|
+
Tests: `src/api/modules/__tests__/MapApi.reassertGeoLayout.test.ts`.
|
|
691
|
+
|
|
692
|
+
### Fixed — map labels ignored `map.maxNodeGrowth` and grew far past their nodes
|
|
693
|
+
|
|
694
|
+
In map mode the text shader capped label growth at a hard-coded 3×. Lowering
|
|
695
|
+
`map.maxNodeGrowth` shrank the nodes but not the labels, so at street zoom a
|
|
696
|
+
map with `maxNodeGrowth: 1.5` drew labels about twice the size they should be,
|
|
697
|
+
piled on top of each other. `TextLayer` and `EdgeTextLayer` labels now cap at
|
|
698
|
+
0.75 × `maxNodeGrowth` and follow later `map.setMaxNodeGrowth` calls. At the
|
|
699
|
+
default of 4 the cap is still 3, so nothing changes unless the host sets it.
|
|
700
|
+
|
|
701
|
+
- `TextCloud.setMapMaxGrowth()`, `EdgeTextCloud.setMapMaxGrowth()` and
|
|
702
|
+
`BatchTextRenderer.setMapMaxGrowth()` take the node cap. `Infinity` removes
|
|
703
|
+
the label cap too.
|
|
704
|
+
|
|
705
|
+
Tests: `src/text/__tests__/textMapMaxGrowth.test.tsx`.
|
|
706
|
+
|
|
707
|
+
### Fixed — ego-ring nodes no longer follow hidden geo anchors
|
|
708
|
+
|
|
709
|
+
With `map.geoLayout.nonGeoStrategy: "egoRing"`, a non-geo node linked to
|
|
710
|
+
several places is drawn at their barycenter. Hidden places still counted, so
|
|
711
|
+
under a filter or a timeline brush a visible node sat between places that were
|
|
712
|
+
not shown, often off-screen, with its edges running across the map. Hidden
|
|
713
|
+
anchors are now left out of the barycenter. A node whose ring root is hidden is
|
|
714
|
+
ringed around a visible geo neighbour instead. The ring is re-placed and
|
|
715
|
+
re-pinned as soon as an anchor is hidden or shown, without waiting for a zoom
|
|
716
|
+
change.
|
|
717
|
+
|
|
718
|
+
Tests: `src/map/geo-local/__tests__/GeoEgoRingRenderer.hiddenAnchors.test.ts`.
|
|
719
|
+
|
|
720
|
+
### Fixed — `map.autoFit: false` now also stops the geoLayout's initial fit
|
|
721
|
+
|
|
722
|
+
With the declarative `map.geoLayout`, the camera flew to the geo bounding box
|
|
723
|
+
about 400 ms after mount even when `autoFit` was `false`. That replaced any
|
|
724
|
+
opening view the host set with `map.flyTo`. `autoFit: false` now leaves the
|
|
725
|
+
camera to the host. The default (`autoFit` unset) still fits.
|
|
726
|
+
|
|
727
|
+
Tests: `src/react/__tests__/geoLayoutAutoFit.test.tsx`.
|
|
728
|
+
|
|
729
|
+
### Fixed — node layers kept their size on a map instead of filling the screen
|
|
730
|
+
|
|
731
|
+
In map mode the built-in node shader damps inverse-zoom growth and soft-caps it
|
|
732
|
+
at `map.maxNodeGrowth`. Layers built on `createNodeShaderLayer` (`MediaLayer`,
|
|
733
|
+
`AudioSpectrumLayer`, `NodeEffectLayer`, `NodeCardLayer` and the others) still
|
|
734
|
+
grew with plain perspective. Zoomed to street level, a `MediaLayer` video panel
|
|
735
|
+
with `sizeFactor: 11` covered the whole map while its node stayed small. Their
|
|
736
|
+
screen-sized quads, and the matching hitboxes, now follow the node's curve, so a
|
|
737
|
+
layer keeps its size relative to its node at every zoom. Off the map nothing
|
|
738
|
+
changes, and `sizing: "world"` layers are untouched.
|
|
739
|
+
|
|
740
|
+
- `LayerContext.getMapNodeSizing?()` (new, optional) returns the live
|
|
741
|
+
`{ damping, maxGrowth }`. Hand-built contexts can leave it out and get the
|
|
742
|
+
engine defaults, 0.3 and 4. `EngineLayerHost.mapNodeSizing` feeds it.
|
|
743
|
+
|
|
744
|
+
Tests: `src/react/layers/__tests__/NodeShaderLayer.mapSizing.test.ts`.
|
|
745
|
+
|
|
746
|
+
### Fixed — switching to the WebGPU render path could hide host overlays
|
|
747
|
+
|
|
748
|
+
The WebGPU canvas was appended to the container last, with `z-index: 1`, once
|
|
749
|
+
it finished initialising. Host panels, the minimap and controls placed in or
|
|
750
|
+
beside the container ended up underneath it, so a panel could vanish when
|
|
751
|
+
`enableWebGPURenderPath` turned on. The canvas now goes directly after the WebGL
|
|
752
|
+
canvas with no z-index, so it covers only the WebGL canvas. Covered by
|
|
753
|
+
`src/backends/webgpu/__tests__/WebGPUPaintTarget.test.tsx` ("stacking").
|
|
754
|
+
|
|
755
|
+
With arrows off, the WebGPU edge path also no longer logs `Vertex attribute "iA"
|
|
756
|
+
not found` on every compile: the empty arrow mesh is hidden. Covered by
|
|
757
|
+
`src/backends/webgpu/__tests__/WebGPUEdgePrimitive.test.tsx`.
|
|
758
|
+
|
|
759
|
+
### Fixed — edges with no text no longer pay for curve classification on mount
|
|
760
|
+
|
|
761
|
+
`EdgeTextLayer` (mounted automatically by a `GraphCanvas` without children)
|
|
762
|
+
classified every edge's curve twice on mount even when no edge had text: about
|
|
763
|
+
12 s at 1.5M edges. It now builds the classifier only when the first edge with
|
|
764
|
+
text needs its curvature, and looks up each relationship's style once. Output is
|
|
765
|
+
unchanged. Covered by `src/react/layers/__tests__/EdgeTextLayer.noLabels.test.tsx`.
|
|
766
|
+
|
|
767
|
+
### Changed — collecting nodes now shows, moves and opens
|
|
768
|
+
|
|
769
|
+
- `api.nodes.collect(parentId, childIds, options?)` and
|
|
770
|
+
`api.nodes.explode(parentId, options?)` now really collect: the children
|
|
771
|
+
are hidden into the parent through a collapsed group (`kind: "collect"`),
|
|
772
|
+
their links to the outside become aggregated edges from the parent, and
|
|
773
|
+
the parent's own edges stay real edges in their own colour. Both are
|
|
774
|
+
undoable commands (`CollectNodes`, `ExplodeCollection`); collecting into an
|
|
775
|
+
existing collection adds to it, and its undo gives back the smaller one.
|
|
776
|
+
Previously they only set a flag. Both now return a `Promise` that resolves
|
|
777
|
+
when the motion ends. Covered by
|
|
778
|
+
`src/api/modules/__tests__/collect.test.ts`.
|
|
779
|
+
- **Behaviour change:** `collect` now throws on an unknown parent, on a
|
|
780
|
+
parent that is itself collected, and on a child that is already a
|
|
781
|
+
collection or collected; the parent itself and unknown child ids are
|
|
782
|
+
ignored. Covered by `collect.test.ts`.
|
|
783
|
+
- Motion: on collect the children fly into the parent before they hide, and
|
|
784
|
+
go back to their places while hidden; on explode they fly out of it.
|
|
785
|
+
Children with no place of their own open onto a ring around the parent.
|
|
786
|
+
Runs on the engine's `AnimationManager`, no timers. `{ animate: false }`
|
|
787
|
+
skips it. Covered by `collect.test.ts`.
|
|
788
|
+
- New `api.nodes.isCollection(id)`, `getCollected(id)`,
|
|
789
|
+
`setExpandOnDoubleClick(enabled)` and `getExpandOnDoubleClick()`.
|
|
790
|
+
Double-clicking a collection explodes it, and double-clicking a collapsed
|
|
791
|
+
group's anchor expands the group (on by default). Covered by
|
|
792
|
+
`collect.test.ts`.
|
|
793
|
+
- Every collapsed group, collections included, shows a "+N" count badge on
|
|
794
|
+
its anchor (`1k+` and up past 999); a badge the anchor had comes back on
|
|
795
|
+
expand, and one the host sets while collapsed wins over the count. A
|
|
796
|
+
collection keeps the parent's own label instead of the group name. Covered
|
|
797
|
+
by `collect.test.ts`.
|
|
798
|
+
- `AnimationManager.add` asks the canvas for a frame, so a tween started on
|
|
799
|
+
an idle canvas runs. Covered by `collect.test.ts`.
|
|
800
|
+
|
|
801
|
+
### Fixed — badges and tags were not drawn under `forceLayout`
|
|
802
|
+
|
|
803
|
+
- `BadgeCloud` and `TagCloud` wired a position texture only for GPU position
|
|
804
|
+
providers. Both built-in force layouts (d3 and WebGPU) and every static
|
|
805
|
+
provider are CPU providers, so every badge and tag sat unpositioned and
|
|
806
|
+
never showed. They now read the new `GraphContextValue.getNodePositionTexture()`
|
|
807
|
+
every frame, which hands out the node renderer's CPU mirror when the
|
|
808
|
+
provider has no texture. Covered by
|
|
809
|
+
`src/react/layers/__tests__/decorationPositionTexture.test.tsx`.
|
|
810
|
+
|
|
811
|
+
### Changed — badges and tags sit on their node's rim and hide with it
|
|
812
|
+
|
|
813
|
+
- Badge and tag offsets came from fixed 14 px `ANCHOR_OFFSETS`, tuned for one
|
|
814
|
+
node size: on a default node (radius ≈ 4 px) every badge floated three radii
|
|
815
|
+
away and read as a separate node. They are now computed from the node's own
|
|
816
|
+
radius with the new `anchorOffsetAround(anchor, nodeRadiusPx, halfSizePx,
|
|
817
|
+
overlap, gapPx?)` and `NODE_RADIUS_PX_PER_SIZE` (both exported from
|
|
818
|
+
`decorations/DecorationTypes`). Badges overlap the rim slightly, tags sit
|
|
819
|
+
just outside it, and both move when the node is resized. `ANCHOR_OFFSETS`
|
|
820
|
+
stays as the fallback when no radius is known.
|
|
821
|
+
- A hidden node's badge and tag are no longer drawn; showing the node brings
|
|
822
|
+
them back.
|
|
823
|
+
- The new `DECORATION_GEOMETRY_DOMAINS` (Style | Visibility) drives that
|
|
824
|
+
rebuild; it re-syncs only when a decorated node's size or visibility really
|
|
825
|
+
changed, so colour writes still do not rebuild instances.
|
|
826
|
+
- New `TagSpec.fontSizePx`: the tag's text cap height in CSS px (default 9,
|
|
827
|
+
clamped to 6–32); padding scales with it.
|
|
828
|
+
- Tags are drawn over nodes and node labels (no depth test, renderOrder 3).
|
|
829
|
+
Before, a nearer neighbour in a dense cluster cut through the pill and its
|
|
830
|
+
text. Badges keep the depth test, since they sit on their node.
|
|
831
|
+
- Covered by `src/react/layers/__tests__/decorationPlacement.test.tsx`.
|
|
832
|
+
|
|
833
|
+
### Fixed — `forceLayout={{ … }}` restarted the layout on every render
|
|
834
|
+
|
|
835
|
+
- The internal force layout was keyed on the prop's object identity, so an
|
|
836
|
+
inline config object destroyed and rebuilt the layout on each host render.
|
|
837
|
+
In between, `store.positionProvider` was the disposed adapter and returned
|
|
838
|
+
null positions; layers reading positions then drew nothing. It is now keyed
|
|
839
|
+
on the config's value. Covered by
|
|
840
|
+
`src/react/__tests__/forceLayoutPropIdentity.test.tsx`.
|
|
841
|
+
- `FocusCalloutLayer` retries targets whose position is not known yet on a
|
|
842
|
+
later frame instead of dropping them. Covered by
|
|
843
|
+
`src/react/layers/__tests__/effectLayers.test.ts`.
|
|
844
|
+
|
|
845
|
+
### Added — orthogonal edges and hierarchy layouts (tree, radialTree, layered, columns)
|
|
846
|
+
|
|
847
|
+
- Edge shape `"orthogonal"` (shader id 3) for `style.setEdgeShape`,
|
|
848
|
+
`setEdgeShapes`, `setRelationshipShape` and the `edgeShape` prop: leave the
|
|
849
|
+
source along the routing axis, run across, drop into the target, with
|
|
850
|
+
quarter-circle corners. Evaluated per vertex in `edge.vert.glsl` /
|
|
851
|
+
`arrow.vert.glsl` from the two endpoints (`shaders/kv_orthoEdge.glsl`), so it
|
|
852
|
+
follows drags, force layout and tweens with no CPU work and no extra upload
|
|
853
|
+
per frame. Parallel multi-edges get parallel tracks. Covered by
|
|
854
|
+
`src/api/modules/__tests__/StyleApi.edgeRouting.test.ts`,
|
|
855
|
+
`src/registry/__tests__/EngineRegistry.test.ts`.
|
|
856
|
+
- `style.setEdgeBends(edgeIds, bend | null)` — where the cross leg sits:
|
|
857
|
+
`0..1` fraction of the span, `< 0` absolute distance from the source (one
|
|
858
|
+
shared bar per parent), `null` automatic. Undoable, one step. Stored in the
|
|
859
|
+
new `EdgeRenderState.bends` column (NaN = automatic) and in snapshots.
|
|
860
|
+
Covered by `StyleApi.edgeRouting.test.ts`.
|
|
861
|
+
- `style.setEdgeRouting({ axis, cornerRadius })` — routing axis
|
|
862
|
+
(`"auto" | "vertical" | "horizontal"`, shared with `radial`) and corner
|
|
863
|
+
rounding `0..1`. Type `EdgeRoutingOptions`. Covered by
|
|
864
|
+
`StyleApi.edgeRouting.test.ts`.
|
|
865
|
+
- `edge/orthoPath.ts` — CPU mirror of the shader route (`orthoFrame`,
|
|
866
|
+
`orthoPoint`, `orthoPolyline`). `PathHighlightLayer` uses it, so a
|
|
867
|
+
highlighted path follows orthogonal edges instead of cutting straight.
|
|
868
|
+
Covered by `src/edge/__tests__/orthoPath.test.ts`.
|
|
869
|
+
- Layouts `api.layout.tree`, `radialTree`, `layered` (Sugiyama: cycle
|
|
870
|
+
breaking, longest-path levels or `rankBy` a property, virtual nodes for long
|
|
871
|
+
edges, barycenter crossing reduction, least-squares placement) and `columns`
|
|
872
|
+
(one column per property value, crossings reduced inside columns). Options
|
|
873
|
+
`direction` (`TB | BT | LR | RL`), `nodeGap`, `levelGap`, `relationships`,
|
|
874
|
+
plus `roots`, `rankBy` / `rankOrder`, `by` / `order` / `sortBy`. Also
|
|
875
|
+
registered by name for `applyByName`, and exported as pure functions
|
|
876
|
+
(`treeLayout`, `radialTreeLayout`, `layeredLayout`, `columnsLayout`).
|
|
877
|
+
Covered by `gpu-compute/tests/hierarchyLayouts.test.ts` and
|
|
878
|
+
`src/api/__tests__/LayoutApi.hierarchy.test.ts`.
|
|
879
|
+
- WebGPU render path: `orthogonal` edges draw straight for now (not ported).
|
|
880
|
+
- New example `scenario-org-chart`; `scenario-data-lineage` and
|
|
881
|
+
`scenario-incident-blast-radius` now place nodes with `layout.columns`.
|
|
882
|
+
|
|
883
|
+
### Added — edge and node effect layers: comet flow, path highlight, focus callouts, node halos
|
|
884
|
+
|
|
885
|
+
Four layers, each a React component and a `create*Layer` factory. Everything
|
|
886
|
+
visual is a prop; per-edge / per-node props take a function of the datum.
|
|
887
|
+
Covered by `src/react/layers/__tests__/effectLayers.test.ts`.
|
|
888
|
+
|
|
889
|
+
`PathHighlightLayer` lights the whole route as one continuous line with
|
|
890
|
+
water-like flowing bands (`flow`, `flowSpeed`, `flowBands`, `flowStrength`,
|
|
891
|
+
`baseLevel`) plus a single comet per path (`particle`, `particleCount`,
|
|
892
|
+
`particleSpeed`, `particleSize`, `particleTail`) and path-node halos (`nodeHalo`).
|
|
893
|
+
|
|
894
|
+
- `EdgeFlowLayer` — comet particles along edges: a white-hot head with a halo
|
|
895
|
+
and a tapered, fading tail, drawn as screen-space instanced quads (constant
|
|
896
|
+
pixel width at any zoom, one draw call). Props: `style`
|
|
897
|
+
(`"comet" | "dots" | "streak"`), `count`, `speed`, `color`, `width`, `weight`
|
|
898
|
+
(all per edge), `direction` (`"forward" | "reverse" | "both"`), `size`,
|
|
899
|
+
`tail`, `glow`, `intensity`, `headColor`, `speedScale`, `fadeEnds`, `filter`,
|
|
900
|
+
`maxParticles`. Follows node positions and the edge dim state
|
|
901
|
+
(`emphasis.focusContext`), and arcs along the great circle on a globe.
|
|
902
|
+
Replaces the look of `animations.edgeFlow`, which is unchanged.
|
|
903
|
+
- `PathHighlightLayer` — a glowing ribbon through an ordered list of node ids
|
|
904
|
+
that draws itself start to end (`drawDuration`), runs ONE comet particle along
|
|
905
|
+
the whole route from the first node to the last (`particleCount` for more),
|
|
906
|
+
puts a halo on the path nodes and can dim everything else
|
|
907
|
+
(`dimOthers`). Props: `path`, `color`, `width`, `glow`,
|
|
908
|
+
`particle`, `particleCount`, `particleSpeed`, `particleSize`, `particleTail`,
|
|
909
|
+
`opacity`, `nodeHalo`, `lift`. Changing `path`
|
|
910
|
+
replays the draw-in.
|
|
911
|
+
- `FocusCalloutLayer` — a leader polyline (ring, diagonal leg, horizontal run)
|
|
912
|
+
with text sitting on it, for focused nodes and/or edges. Laid out in screen
|
|
913
|
+
pixels around the target, so it keeps its size at any zoom and follows the
|
|
914
|
+
target. Controlled with `nodes` / `edges`, or `focusOnClick` (+ `focusEdges`,
|
|
915
|
+
`onFocusChange`). Props: `text` (string, lines, or `{ title, lines }`),
|
|
916
|
+
`placement`, `angle`, `elbow`, `run`, `ring`, `color`, `lineWidth`,
|
|
917
|
+
`textColor`, `background`, `fontSize`, `duration`, `max`, `dimOthers`.
|
|
918
|
+
- `NodeEffectLayer` — animated halos (`"glow" | "pulse" | "ripple" | "orbit"`)
|
|
919
|
+
for any subset of nodes, one draw call. Props: `effect`, `filter`, `color`
|
|
920
|
+
and `weight` (per node), `radius`, `speed`, `intensity`, `count`,
|
|
921
|
+
`thickness`.
|
|
922
|
+
- New example `scenario-edge-node-effects`.
|
|
923
|
+
|
|
924
|
+
### Added — `ModelLayer`: nodes drawn as 3D models
|
|
925
|
+
|
|
926
|
+
- `ModelLayer` / `createModelLayer` draw each node as a glTF model or as one
|
|
927
|
+
part of a model: `model(node)` returns a URL, `{ url, part, children }` (a
|
|
928
|
+
named node of the file, its own meshes recentred, its sub-parts optional),
|
|
929
|
+
an `Object3D`, or `null` for the plain dot. Files load once and are shared;
|
|
930
|
+
meshopt-compressed files decode out of the box. Replaceable via `loader`.
|
|
931
|
+
- The model follows the node's position, visibility and focus+context dim,
|
|
932
|
+
and hides the built-in dot (`hideBuiltinNode`, default on). It is pickable
|
|
933
|
+
through an invisible hit twin (`hitArea`, default on), so clicks and hover
|
|
934
|
+
land on the visible shape, and labels clear its extent.
|
|
935
|
+
- `scale` or `size` (fits the bounding radius), `rotation`, `anchor`, `spin`
|
|
936
|
+
(rad/s, eases back to front when stopped), `tint` with `tintPulse`; changes
|
|
937
|
+
ease over `transition` seconds. `lights` and `environment` (a room
|
|
938
|
+
environment map for PBR materials) default on.
|
|
939
|
+
- `depthRange: "fit"` (default) gives the models a depth range fitted to them
|
|
940
|
+
each frame, so close-up parts do not z-fight under the camera's tiny near
|
|
941
|
+
plane; `"camera"` keeps the camera's own range.
|
|
942
|
+
- `loadModel(url)` and `loadModelParts(url, { rotation })` are exported:
|
|
943
|
+
the latter lists every named part with parent, children, centre, radius,
|
|
944
|
+
triangle count and materials — enough to build a graph from a model.
|
|
945
|
+
- Covered by `src/react/layers/__tests__/ModelLayer.test.tsx`.
|
|
946
|
+
|
|
947
|
+
### Added — `MediaLayer` video playback: click to play or pause, thumbnails, a clip per node
|
|
948
|
+
|
|
949
|
+
- `video.url` may be a function, so each node plays its own clip. Nodes that
|
|
950
|
+
return the same URL share one decode; every distinct URL costs one `<video>`
|
|
951
|
+
and one draw call.
|
|
952
|
+
- `video.playOnClick` is the whole player: the panel is the hitbox, a click on
|
|
953
|
+
it plays a paused video and pauses a playing one. The videos start paused.
|
|
954
|
+
No DOM element is involved.
|
|
955
|
+
- `video.posterTime` (seconds, or a function per node) is the frame a video
|
|
956
|
+
nobody has started shows, so a paused panel is a thumbnail and not a black
|
|
957
|
+
first frame. `video.playBadge` (default: `playOnClick`) draws a play glyph on
|
|
958
|
+
paused panels; the code is not compiled in unless asked for.
|
|
959
|
+
- `video.onPlayingChange` reports every start and stop, whatever caused it.
|
|
960
|
+
- `controlRef` hands back a `MediaLayerHandle` (`togglePlayback`, `play`,
|
|
961
|
+
`pause`, `pauseAll`, `isPlaying`, `sourceOf`), also returned by
|
|
962
|
+
`createMediaLayer`, for hosts that mount the layer without React.
|
|
963
|
+
- `onVideoSource` now receives `(source, { url })`; existing one-argument
|
|
964
|
+
callbacks keep working. A single string `url` behaves exactly as before.
|
|
965
|
+
|
|
966
|
+
### Fixed — the minimap now draws what the scene shows
|
|
967
|
+
|
|
968
|
+
- Nodes are drawn at the same size relative to the graph as in the main view.
|
|
969
|
+
The minimap used a fixed `nodeSize × 50 / 80` px whatever the graph's
|
|
970
|
+
extent, so large nodes (size 150+, as icon nodes need) covered most of the
|
|
971
|
+
panel.
|
|
972
|
+
- The minimap no longer stops one image behind once the scene goes idle. A
|
|
973
|
+
change made after the layout settled (a `setNodeColors` call, a toggle back
|
|
974
|
+
to a previous state) never reached it: the readback's request for a delivery
|
|
975
|
+
frame was issued from inside a frame callback, where the frame-end settle
|
|
976
|
+
overwrites it, and a change that arrived during a readback was never
|
|
977
|
+
rendered.
|
|
978
|
+
- Covered by `src/react/layers/minimap/__tests__/MinimapSceneSync.test.tsx`.
|
|
979
|
+
|
|
980
|
+
### Fixed — node labels clear the panel or ring a layer draws, not the hidden dot
|
|
981
|
+
|
|
982
|
+
- `<TextLayer>` used to place a label just outside the BUILT-IN node, which a
|
|
983
|
+
`MediaLayer` panel or a shader-layer billboard hides. The caption landed in
|
|
984
|
+
the middle of the picture. Layers now report their footprint to the store
|
|
985
|
+
and labels sit outside it, on every side, while the node is dragged.
|
|
986
|
+
Applications set nothing: `MediaLayer` reports its panel (a 16:9 panel is
|
|
987
|
+
9/16 of its quad tall), `AudioSpectrumLayer` the middle of its band (fixed, so
|
|
988
|
+
labels do not jump with the music), and `createNodeShaderLayer` the whole quad
|
|
989
|
+
when it hides the built-in node or has a `hitArea`.
|
|
990
|
+
- New `NodeShaderLayerSpec.labelExtent`: `"auto"` (default, as above),
|
|
991
|
+
`"none"`, or `[x, y]` as fractions of the quad, for a drawing smaller than its
|
|
992
|
+
billboard.
|
|
993
|
+
- New `GraphStore.setNodeLabelExtents(owner, extents | null)` and
|
|
994
|
+
`getNodeLabelExtent(id)`, with exported types `NodeLabelExtent` and
|
|
995
|
+
`ResolvedLabelExtent`. Layer-facing: several layers on one node merge by the
|
|
996
|
+
largest extent, and an unchanged claim does not bump `labelVersion`.
|
|
997
|
+
- New optional `TextItem` fields `extentX` / `extentY` (built-in node radii)
|
|
998
|
+
and `worldExtentX` / `worldExtentY` (world units), and
|
|
999
|
+
`BufferTextSource.extentResolver`, for hosts that build their own items.
|
|
1000
|
+
Without them, label placement is unchanged.
|
|
1001
|
+
- Covered by `src/react/layers/__tests__/labelExtent.test.tsx`.
|
|
1002
|
+
|
|
1003
|
+
### Added — radial labels for radial trees and ego rings
|
|
1004
|
+
|
|
1005
|
+
- New `LabelPosition` value `"radial"`: each label turns along the ray from a
|
|
1006
|
+
centre and reads outward, and on the left half it is turned half a turn and
|
|
1007
|
+
right-aligned so no label is upside down. The gap to the node follows the
|
|
1008
|
+
node's label footprint along the ray.
|
|
1009
|
+
- New `TextLayer` prop `radialCenter`: a node id (the centre follows that
|
|
1010
|
+
node, so labels keep turning while it is dragged or tweened) or a fixed
|
|
1011
|
+
`[x, y]`. Default: the middle of the labelled nodes. The same field is
|
|
1012
|
+
accepted by the `GraphCanvas` `caption` prop.
|
|
1013
|
+
- New `TextCloud.setRadialCenter([x, y] | null)` and exported helper
|
|
1014
|
+
`radialLabelPlacement(dx, dy, gapX, gapY)`, for hosts that drive a
|
|
1015
|
+
`TextCloud` directly. A per-item `angle` still wins.
|
|
1016
|
+
- Covered by `src/text/__tests__/radialLabels.test.ts`.
|
|
1017
|
+
|
|
1018
|
+
### Fixed — a canvas with non-round node sizes never went idle
|
|
1019
|
+
|
|
1020
|
+
- `GraphStore.refreshEffectiveSizes()` compared a float32-rounded
|
|
1021
|
+
`effectiveSizes` entry with the double it was computed from, so any size
|
|
1022
|
+
whose product with 1.5 is not exact in float32 (0.7, √x / 130 …) counted as
|
|
1023
|
+
changed on every call. The render loop then marked node sizes dirty from
|
|
1024
|
+
inside its own paint and bumped `store.version` every frame: the canvas
|
|
1025
|
+
never went idle, `TextLayer` rebuilt every label every frame, and node
|
|
1026
|
+
clicks mostly picked nothing. Round sizes (140, 200) hid it. The comparison
|
|
1027
|
+
is now made in float32.
|
|
1028
|
+
- Covered by `src/react/graph-context/__tests__/renderLoopIdle.test.tsx`
|
|
1029
|
+
("goes quiet with sizes that are not exact in float32").
|
|
1030
|
+
|
|
1031
|
+
### Added — clicking empty canvas restores the un-emphasised graph
|
|
1032
|
+
|
|
1033
|
+
- New `api.emphasis.restore()`: stops every emphasis effect (focus+context
|
|
1034
|
+
dims, path and cascade highlights), clears click-dim and programmatic dims
|
|
1035
|
+
(`dimExcept`, `dimNeighborhood`, `setTraceDim`), and notifies
|
|
1036
|
+
`api.emphasis.onRestore(cb)` listeners.
|
|
1037
|
+
- A click on empty canvas calls it by default. A click that ends a camera pan
|
|
1038
|
+
does not count (`InteractionManager.lastClickWasDrag`, new). Turn it off with
|
|
1039
|
+
the GraphCanvas prop `restoreOnBackgroundClick={false}` or
|
|
1040
|
+
`api.emphasis.setRestoreOnBackgroundClick(false)`.
|
|
1041
|
+
- `PathHighlightLayer` and `FocusCalloutLayer` hide their highlight and
|
|
1042
|
+
`dimOthers` dim on restore even though the host still holds the focus that
|
|
1043
|
+
fed them. They come back when `path` / `nodes` change or a node or edge is
|
|
1044
|
+
clicked. Before this, a path drawn from host state (e.g. "focus the clicked
|
|
1045
|
+
node") dimmed the graph with no way back short of a host-side reset button.
|
|
1046
|
+
- Covered by `src/api/modules/__tests__/EmphasisApi.restore.test.ts` and
|
|
1047
|
+
`src/react/layers/effects/__tests__/useEmphasisRestore.test.tsx`.
|
|
1048
|
+
|
|
1049
|
+
### Fixed — a 2D canvas went 3D as soon as nodes were added
|
|
1050
|
+
|
|
1051
|
+
- `D3LayoutControllerAdapter` started at 3 dimensions whatever snapshot it
|
|
1052
|
+
was built from. A canvas mounted with `is3D={false}` never calls
|
|
1053
|
+
`transitionDimensions` (nothing changed), so the first structure change
|
|
1054
|
+
(`nodes.add` after mount) re-initialised the force sim in 3D. Nodes drifted
|
|
1055
|
+
off the z = 0 plane, rendered at the wrong depth (some huge, some tiny) and
|
|
1056
|
+
`camera.flyToNodes` aimed at the wrong place. The adapter now starts in the
|
|
1057
|
+
snapshot's dimension.
|
|
1058
|
+
- Covered by `src/layout/__tests__/D3LayoutControllerAdapter.test.ts`
|
|
1059
|
+
("a 2D snapshot stays 2D after nodes are added (no z drift)").
|
|
1060
|
+
|
|
1061
|
+
### Fixed — overlapping focus+context dims left the graph dark
|
|
1062
|
+
|
|
1063
|
+
- Each `FocusContextEffect` snapshotted its own "before" state. When two
|
|
1064
|
+
overlapped (host `emphasis.focusContext` plus a layer's `dimOthers`, or a
|
|
1065
|
+
new focus started before the old one stopped), the second snapshot was the
|
|
1066
|
+
already-dimmed, already-enlarged graph, and stopping it put that back: the
|
|
1067
|
+
graph stayed dim with no way out. Effects on one store now share a single
|
|
1068
|
+
baseline. Only the last one to stop restores it; while others remain, the
|
|
1069
|
+
newest re-applies its own dim.
|
|
1070
|
+
- Covered by `src/animation/effects/__tests__/FocusContextEffect.overlap.test.ts`.
|
|
1071
|
+
|
|
1072
|
+
### Fixed — click-dim no longer takes over or wipes other focus dims
|
|
1073
|
+
|
|
1074
|
+
- Click-dim retargeted the first running focusContext of any owner, and
|
|
1075
|
+
clearing it stopped every focusContext, including one a layer or the host
|
|
1076
|
+
had started. It now drives only its own effect.
|
|
1077
|
+
- Stopping an effect (`emphasis.stop`, `stopAll`) now schedules a repaint, so
|
|
1078
|
+
an idle canvas no longer keeps showing the dimmed frame.
|
|
1079
|
+
- Covered by `src/api/modules/__tests__/EmphasisApi.restore.test.ts`
|
|
1080
|
+
("click-dim leaves a focusContext it did not start alone", "EffectManager
|
|
1081
|
+
repaint on removal"); `EmphasisApi.clickDim.test.ts` updated to count
|
|
1082
|
+
click-dim's listener on its own.
|
|
1083
|
+
|
|
1084
|
+
### Fixed — edge labels sit on the line the edge is drawn as
|
|
1085
|
+
|
|
1086
|
+
- `EdgeTextLayer` looked up curvature on a `store.edgeClassifier` that never
|
|
1087
|
+
existed, so every label sat on the straight chord. The two labels of a
|
|
1088
|
+
reciprocal pair (A→B and B→A, e.g. a cross-holding) were printed on top of
|
|
1089
|
+
each other, and the label of an `orthogonal` edge floated off its elbow.
|
|
1090
|
+
- Labels now follow the shape the edge renderer resolves: parallel and
|
|
1091
|
+
reciprocal edges get the same multi-edge curvature (none in map mode, where
|
|
1092
|
+
multi-edges are drawn straight), and an orthogonal edge's label goes at half
|
|
1093
|
+
the length of its route (`orthoPolyline`), turned along that leg.
|
|
1094
|
+
- `EdgeTextItem` gains an optional `path` (the drawn route); `getTextItems`
|
|
1095
|
+
callers can set it too.
|
|
1096
|
+
- Covered by `src/react/layers/__tests__/EdgeTextLayer.placement.test.tsx`.
|
|
1097
|
+
|
|
1098
|
+
### Fixed — a highlighted path rides the edge that runs its way
|
|
1099
|
+
|
|
1100
|
+
- `PathHighlightLayer` took the first edge joining two path nodes in either
|
|
1101
|
+
direction. With a reciprocal pair (A→B and B→A) the hop A→B could follow
|
|
1102
|
+
B→A, and when that one was drawn differently (an orthogonal elbow) the
|
|
1103
|
+
highlight left the line it was meant to light. A forward edge now wins over
|
|
1104
|
+
a reverse one.
|
|
1105
|
+
- Covered by `src/react/layers/__tests__/effectLayers.test.ts` ("a hop takes
|
|
1106
|
+
the edge that runs its way, not the reverse one of a reciprocal pair").
|
|
1107
|
+
|
|
1108
|
+
### Added — `NodeEffectLayer` can play a fixed number of cycles
|
|
1109
|
+
|
|
1110
|
+
- New `cycles` and `onComplete` props (also on `createNodeEffectLayer`). With
|
|
1111
|
+
`cycles: n` each node plays n cycles, counted from when that node joins the
|
|
1112
|
+
layer, then goes quiet, and the layer stops asking for frames. A `ripple`
|
|
1113
|
+
emits its rings for n cycles and lets the last one reach the rim; the other
|
|
1114
|
+
presets fade out over the last fifth of a cycle. A node that joins later (a
|
|
1115
|
+
new filter match, a newly added node) gets its own full run, so
|
|
1116
|
+
`cycles={1}` marks exactly what arrived. `onComplete` fires each time every
|
|
1117
|
+
current node has finished.
|
|
1118
|
+
- Before, an effect looped for as long as it was mounted, and hosts had to
|
|
1119
|
+
unmount it on a timer. That is still the default when `cycles` is omitted.
|
|
1120
|
+
- `nodeEffectRunLength(kind, cycles)` gives the run length in cycles.
|
|
1121
|
+
- Covered by `src/react/layers/__tests__/effectLayers.test.ts` ("NodeEffectLayer
|
|
1122
|
+
lifetime").
|
|
1123
|
+
|
|
1124
|
+
### Changed — photos, videos and cards draw above edge and halo effects
|
|
1125
|
+
|
|
1126
|
+
- `MediaLayer` and `NodeCardLayer` now default to overlay `bandOffset` 20
|
|
1127
|
+
(`PANEL_BAND_OFFSET`), above `NodeEffectLayer` (4), `EdgeFlowLayer` (6),
|
|
1128
|
+
markers (5–6) and `PathHighlightLayer` (11). At the old default of 0, a
|
|
1129
|
+
highlighted path or a ripple was drawn across the photo or card at its end.
|
|
1130
|
+
Now they run under the panel, the way built-in edges run under node dots.
|
|
1131
|
+
- Pass `bandOffset` to get the old order back.
|
|
1132
|
+
- Covered by `src/react/layers/__tests__/panelBand.test.tsx`.
|
|
1133
|
+
|
|
1134
|
+
### Fixed — a layout run while `forceLayout` is on stays where it put the nodes
|
|
1135
|
+
|
|
1136
|
+
- With the CPU force layout (`forceLayout` without WebGPU), `api.layout.*`,
|
|
1137
|
+
`layout.setPositions` and `store.setPositions` moved the nodes for a moment,
|
|
1138
|
+
and within a second the nodes snapped back. The write landed in a copy of
|
|
1139
|
+
the positions that the next tick replaced, and the layout's pins never
|
|
1140
|
+
reached the simulation. So nodes pinned earlier went back to their old pin
|
|
1141
|
+
positions, and the rest drifted.
|
|
1142
|
+
- The d3 controller now takes position writes and pins. A layout moves each
|
|
1143
|
+
node in the simulation: a pinned node is re-anchored at its new spot, a free
|
|
1144
|
+
node starts from there. `store.pinNodes` and `unpinNodes` set and clear
|
|
1145
|
+
the simulation's pins. `unpinNodes` reheats a running simulation the way the
|
|
1146
|
+
WebGPU controller does.
|
|
1147
|
+
- Covered by `src/layout/__tests__/D3LayoutControllerAdapter.test.ts`
|
|
1148
|
+
("writePositions / pinNodes / unpinNodes").
|
|
8
1149
|
|
|
9
1150
|
## 0.7.0 — 2026-11-25
|
|
10
1151
|
|