Upgrading

What a host application has to change when it takes the next release. Items are ordered by how likely they are to break a build.

1. three moves to 0.184

The peer dependency goes from ~0.121.0 to ~0.184.0. You must upgrade your own three to a 0.184.x before taking this release — the range is bounded on both sides, in @kineviz/gl and in @kineviz/gpu-compute alike, so the two cannot drift apart. @types/three is pinned to the exactly matching version.

If you consume the UMD bundle, it bundles three (it always has) and the frozen copy inside it is now 0.184 rather than 0.121. Hosts on the ESM/CJS entry supply their own three and are unaffected by the bundle's contents.

three's colour management is switched off, process-wide

three has enabled automatic colour management by default since 0.152. Leaving it on would silently re-interpret every colour this engine constructs as sRGB and convert it, shifting the whole picture — so @kineviz/gl sets THREE.ColorManagement.enabled = false at import time.

This is a process-global flag. A host that wants three's colour management for its own scenes in the same page cannot have it while @kineviz/gl is loaded. If that is a problem for you, say so — it is on the list to revisit.

2. Imperative style is now sticky

Setting a node's colour, size, shape or icon imperatively claims that attribute for that node, and a later data-driven re-map no longer overwrites it.

What breaks: code that set a colour and relied on the next apply() to replace it, and category configs whose defaultColor used to recolour hand-coloured nodes.

What to do: hand the attribute back explicitly.

api.store.clearNodeOverrides(ids);              // everything
api.store.clearNodeOverrides(ids, ['color']);   // just the colour

Full detail, including which setters claim what, is in Node appearance.

Related: an add used to re-map every node of every configured category, which silently overwrote imperative colours and sizes on unrelated, existing nodes. It no longer does. Categories whose mapping depends on the whole category (a size or width mapping, or a sequential / diverging colour mapping with no explicit domain) still re-map in full, as do categories configured for the first time by that very change.

3. api.layout.applyByName throws on an unknown name

It used to return silently, which hid typos. The error message lists the registered names.

await api.layout.applyByName('sphere');     // fine
await api.layout.applyByName('sphear');     // throws, and tells you the valid names

4. The renderer classes are no longer exported

GPUNodeRenderer, GPUEdgeRenderer, GPUGroupRingRenderer and GroupSphereRenderer have left the public surface, with no deprecated aliases. Construct them through the backend factory instead — see Rendering.

import { createRenderBackend } from '@kineviz/gl';

const backend = createRenderBackend('webgl');
const nodes = backend.createNodeRenderer(scene, store);

The returned objects keep today's method surface.

5. EventMap gains renderFault

Only an issue if your code switches exhaustively over keyof EventMap — such a switch needs a new arm. See Rendering for the payload.

DirtyFlag likewise gained members (nodeLabels, nodeShapes); the same note applies to an exhaustive switch over that union.

6. Click-dim is off by default

clickDim used to be on. A plain click now just selects; pass clickDim (or call api.emphasis.setClickDimEnabled(true)) to opt back in.

While we were there: the dim no longer resizes anything. Kept nodes stay their own size.

The hover ring is governed separately and is still on by default — clickDim only toggles the click-driven dimming of non-neighbours.

7. Edge and node order after a delete

Deletes are now in-place swap-removes: the removed element is replaced by the last one. Consequences for host code:

  • the survivors are no longer in their original order;
  • store.data.edges is mutated in place (as addEdges always did);
  • code that held an index across a deletion must re-resolve it by id.

A delete that matches no id is now a no-op, where it previously rebuilt and bumped the version.

If you read the endpoint index arrays directly, note they may now be longer than the edge count (they grow by doubling); bound your reads by the edge count.

8. Custom layers: read before you upgrade

Two things changed for layer authors.

  • createNodeShaderLayer layers are clickable now, but only if you ask. The engine's picking pass rasterises the built-in node quad, so a layer drawing at sizeFactor: 10 was clickable only near the node's centre. Set hitArea (and hitMask for anything but a quad or a circle) — see Node shader layers.
  • delete geometry._maxInstanceCount is still required in 0.184. The deprecated maxInstancedCount alias is gone, but the underscore-prefixed property is a different thing, it still exists, and removing those delete calls reopens a picking bug.

9. The published ESM bundle no longer imports a node builtin

If a webpack or Vite build of yours failed with

Module not found: Error: Can't resolve 'module' in '.../dist'

that is fixed: the bundle is now built for the browser platform, and the compression dependency used for importing compressed graph files resolves to its browser build. Nothing to change on your side.

New since the last release

Nothing here is breaking — it is what you gain.

Feature Page
Eight built-in node shapes, with aspect Node appearance
Global node size scale, screen-fraction cap Node appearance
Images, video and audio on nodes Node media
A whole record drawn as the node; HTML nodes Node cards
Clickable custom layers Node shader layers, Custom layers
Camera choreography, scene layers, flyable layouts Cinematics
Register your own layouts api.layout
The WebGPU render path switch and renderFault Rendering