@kineviz/gl 0.7.1 → 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 +506 -0
- 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 +414 -20112
- package/dist/index.d.ts +414 -20112
- package/dist/index.js +5268 -3479
- package/dist/index.mjs +309 -4564
- package/dist/kineviz-gl.css +1 -1
- package/dist/kineviz-gl.umd.js +5268 -3761
- package/dist/layout-gpu.js +45 -45
- package/dist/layout-gpu.mjs +1 -1
- 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-3CR3GHJ2.mjs +0 -2
- package/dist/chunk-VTIPA7FV.mjs +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,512 @@ All notable changes to `@kineviz/gl` are documented here.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
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
|
+
|
|
7
513
|
## 0.7.1 — 2026-11-26
|
|
8
514
|
|
|
9
515
|
Maps down to street level, new layers (buildings, 3D models, effect layers,
|