@kineviz/gl 0.5.1 → 0.6.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 ADDED
@@ -0,0 +1,170 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@kineviz/gl` are documented here.
4
+
5
+ ## 0.6.0 — 2026-06-29
6
+
7
+ Node-anchored info cards. Goal: attach rich, interactive HTML cards to graph
8
+ nodes that track their anchor every frame, with zero cost until used.
9
+
10
+ ### Added
11
+
12
+ - **`gl.cards` overlay layer** (`CardsApi`, `api.cards`). A screen-space HTML card layer anchored to graph nodes that follows its anchor per frame. Generic presets — `property`, `media`, and `list` — plus `html` / `render` / `element` escape hatches for custom content. Cards can also be free-positioned in world space (`position: [x, y, z]`) and made `draggable`.
13
+ - `api.cards.set(specs)` / `api.cards.set(nodeId, spec)` to declare cards, `api.cards.update(id, patch)`, `api.cards.has(id)`, and `api.cards.clear(id?)`.
14
+ - Lazy-mounted (`CardLayerHost` gate) so there is no runtime cost until the first card is created.
15
+ - New public exports: `CardLayer`, `CardLayerHost`, `CardLayerProps`, `CardSpec`, `CardPlacement`.
16
+
17
+ ## 0.5.2 — 2026-06-27
18
+
19
+ Non-geo nodes on planar maps. Goal: nodes without lat/lng no longer drift to the
20
+ horizon or pile on the world origin when a map is shown — they hang off their
21
+ nearest geo neighbour as a readable, zoom-stable ego ring.
22
+
23
+ ### Added
24
+
25
+ - **Ego-ring layout for non-geo nodes** (`map.geoLayout.nonGeoStrategy: "egoRing"`, planar maps). Non-geo nodes are laid out as a deterministic concentric **ego ring** around their nearest geo neighbour — a radial tree by hop distance, rendered in real 3D world space by the core node cloud (no DOM overlay, VR-safe). The engine self-mounts the ego-ring layer from the `map` prop and derives the geo/non-geo split + edges from the store, so hosts do **not** pass a `<GeoEgoRingLayer>` child. `ringGapPx` (default `50`) sets screen-px spacing between rings. Outside planar mode this falls back to `autoPlace`.
26
+ - **Zoom level-of-detail collapse** (`map.geoLayout.collapse`). While an anchor is collapsed its non-geo neighbours are hidden (parked on the anchor); zooming past `expandZoom` — or via `expandOn: ("hover" | "click")[]` — reveals them as the ring. `neighbourCap` (default `0.45`, × nearest-anchor distance) and `maxViewportFraction` (default `0.25`, × viewport height) clamp the ring radius. Omit `collapse` for always-expanded rings.
27
+ - **Public layer exports** — `GeoEgoRingLayer` / `GeoEgoRingLayerProps` / `GeoEgoRingConfig` and `computeEgoRing` / `EgoRingNode` (the deterministic radial-tree layout), plus `GeoLocalLayer` / `GeoLocalLayerProps` / `GeoLocalConfig` (a screen-space spring/repulsion variant) for hosts that drive non-geo placement manually.
28
+
29
+ ### Changed
30
+
31
+ - **`latLngToScreen` / `screenToLatLng` now delegate to a shared projection kernel**, giving planar and spherical map modes a single source of truth for local↔screen projection.
32
+
33
+ ### Fixed
34
+
35
+ - **Edges and arrows with a hidden endpoint now render at opacity 0** instead of stretching to a stale or visible position.
36
+ - **3D globe auto-fit now zooms to the data bounding box** (matching 2D) instead of stopping at a fixed regional cap.
37
+ - **Node-count ring spacing + smoother map zoom.**
38
+ - **Badges now initialise their map-mode on lazy creation** — a badge no longer flies off its node the first time it's created while a map is active.
39
+
40
+ ## 0.5.1 — 2026-06-26
41
+
42
+ ### Added
43
+
44
+ - **Timeline ("Time Bar") panel** — a temporal activity histogram with range selection, a scrub cursor, and playback. Exports `Timeline` / `TimelineProps`, `TimelineCanvas` / `TimelineCanvasProps`, the `useTimelineData` hook + `TimelineData` type, `resolveTimelineMessages`, `DEFAULT_TIMELINE_MESSAGES`, and a `TimelineApi` namespace (`Bin`, `TimelineTarget`, `TimelineMeasure`, `TimelineAnnotation`, `TimelinePlayOptions`). Distinct from the existing `TimelineReplayEffect` event-replay mechanism.
45
+ - **Polygon / GeoJSON layer** — filled polygons with an outline, for overlap/intersection regions, zones, and GeoJSON features. Exports `PolygonLayer` / `PolygonLayerProps`, `PolygonItem` / `PolygonConfig`, and a `PolygonApi` namespace (`PolygonSpec`, `GeoJsonPolygonish`).
46
+ - **Non-geo auto-placement on planar maps** (`applyGeoLayout`, `nonGeoStrategy: "autoPlace"` — the default). A wavefront BFS out from the geo anchors seeds each non-geo node at the centroid of its already-placed neighbours (multi-hop), with scale-relative jitter so co-edged nodes don't stack, then pins them so the live force sim can't disperse them. New options: `nonGeoFallback` (`"preserve"` | `"geoCentroid"` for isolated non-geo components), `pinAutoPlaced` (default `true`), `alphaBump`, and `autoPlaceJitter`; `ApplyGeoLayoutResult` now reports `disconnectedNonGeoIds`. In planar mode non-geo nodes are also flattened to `z = 0`.
47
+ - **Coverage layer refinements** and two new example scenarios (`cell-sectors`, `comms-timeline`).
48
+
49
+ ## 0.5.0 — 2026-06-21
50
+
51
+ ### Added — API method schema registry (`@kineviz/gl/schemas`)
52
+
53
+ New subpath entry exporting `METHOD_SCHEMAS`: an engine-owned registry of zod
54
+ schemas for 193 blockable API methods across the 13 flow-allowlisted
55
+ namespaces (spec: `notes/specs/2026-06-12-api-method-schema-registry.md`).
56
+ Each entry records the method's positional argument layout (plain params +
57
+ trailing options object) so tooling (flow blocks, agents, MCP) can render
58
+ parameter forms and reconstruct calls. Schemas live next to the API code in
59
+ `src/api/schemas/` and are guarded against signature drift by type-level
60
+ assertions compiled in `tsc --noEmit`; the one-time typedoc bootstrap script
61
+ is kept under `scripts/` for reference only. A package `exports` map was
62
+ added — `"."`, `"./schemas"`, `"./dist/*"` (CSS deep imports preserved),
63
+ `"./assets/*"`.
64
+
65
+ contextValue identity redesign (spec: `notes/specs/2026-06-11-contextvalue-identity-redesign.md`). The `GraphContext` provider value is now an **identity-stable handle**: it is created once per engine lifecycle, its 13 reactive fields (`isMapMode`, `mapDamping`, `mapSphereRadius`, `is3D`, `effectiveMapProjection`, `theme`, `textScale`, `edgeTextScale`, the three atlas managers, `layoutController`, `layoutPositionProvider`) are live getters into an internal subscribable view-state store, and consumers subscribe per field.
66
+
67
+ ### Added
68
+
69
+ - **Per-field view-state hooks** — `useGraphHandle()` (stable handle, no reactive re-renders), `useViewStateField(key)`, `useIsMapMode()`, `useMapDamping()`, `useMapSphereRadius()`, `useTheme()`, `useTextScales()`, `useEffectiveMapProjection()`, `useAtlasManagers()`, `useLayoutController()`, `useLayoutPositionProvider()`, and the `GraphViewState` type. Components re-render only for the fields they read; all built-in layers migrated (GlobeLayer/EdgeCloud now re-render on zero reactive changes).
70
+
71
+ ### Changed
72
+
73
+ - **`useGraph()` semantics preserved** (re-renders on any reactive view-state change) but the returned object's identity is now stable; its reactive fields read live values. Prefer `useGraphHandle()` + per-field hooks in new code.
74
+ - **Raw `useContext(GraphContext)` consumers no longer re-render on reactive field changes** — subscribe via `useGraph()` or the per-field hooks instead.
75
+ - The 13 reactive fields on `GraphContextValue` are now `readonly` (they were never meant to be assigned; assignment now fails at compile time).
76
+ - `useGraphVersion()` / `useGraphIconVersion()` no longer carry a whole-view-state subscription.
77
+
78
+ ### Fixed
79
+
80
+ - **`setMapDamping` callback fan-out reported the init-time `isMapMode`** (typically `false`) instead of the current value — text/badge/tag layers could be told the map was off while it was on.
81
+ - **MinimapLayer now reacts to `layoutController` / `layoutPositionProvider` wiring** instead of only noticing it on the next incidental re-render.
82
+ - **Internal node renderer's `lightMode` now follows runtime theme changes** in the bare `<GraphCanvas>` (no `<NodeCloud>` child) path.
83
+ - `setMapMode` / `setMapDamping` keep `mapDamping` / `mapSphereRadius` live for same-mode calls (previously stale until the next mode flip).
84
+ - **Coverage discs no longer deform in globe (3D) map mode** — the rings now lie flat on the sphere's surface (parallel to the ground) instead of tilting off it. The vertex shader builds each disc in the surface tangent plane at its anchor when globe mode is active (`uSphereRadius > 0`, driven by `ctx.sphereRadius`); flat/planar map rendering is unchanged.
85
+ - **Hide Map now actually restores the force layout (shape + drag)** — after hiding the map, nodes stayed frozen in the geo projection (a ring/torus) and dragging had no effect. Two independent breakages, both rooted in Show Map's stop/snapshot:
86
+ - **Sim left disabled.** Show Map's `stopLayout()` set the controller `_enable=false`, and `MapApi._reheatLayout()` looked up the controller via `store.positionProvider.layoutController` — but Show Map also swaps the provider to a frozen `StaticPositionProvider` (snapshot for undo) which carries no `layoutController`, so the reheat silently found nothing. The controller is a cross-view singleton, so force layout stayed dead even in new views. Fix: `RenderEngineApi.wireLayoutController()` now forwards the controller to `MapApi.wireLayoutController()`, giving the reheat a STABLE handle (independent of provider swaps); `_reheatLayout()` prefers it (re-enable `c._enable`, then `restart()` in place), falling back to the provider path then the d3 `_layoutRuntime` handle.
87
+ - **Live provider never restored.** The auto-geoLayout effect in `GraphContext` swaps the store + every renderer to that frozen `StaticPositionProvider` on Show Map but had no symmetric restore, so render and drag kept reading the frozen snapshot after Hide Map. Fix: the effect now restores the live layout provider (`layoutAdapterRef.current`) to the store + renderers on map-off, guarded by identity so a 2D/3D re-projection or a newer provider isn't clobbered.
88
+ Verified live (engine=new, `layout=webgpu`): Show Map → Hide Map returns `store.positionProvider` to the live `CPULayoutProviderAdapter`, re-enables the sim, and nodes re-flow into a normal force layout.
89
+
90
+ ## 0.4.0 — 2026-05-31
91
+
92
+ Edge tube-glow and node halo emphasis layer. Goal: visually emphasise kept subgraphs during hover-dim with a steady light-tube glow on edges and a soft radial halo on nodes.
93
+
94
+ ### Added
95
+
96
+ - **`StyleApi.setEdgeTubeGlow(ids, strength)` / `clearEdgeTubeGlow()`** — applies a steady "light-tube" radial falloff glow to the listed edges. Glow color follows the edge's own resolved color; `strength` (0–1) scales intensity.
97
+ - **`StyleApi.setNodeHalo(ids, strength)` / `clearNodeHalo()`** — renders a soft radial halo ring around the listed nodes. Halo color follows the node's own resolved color; `strength` (0–1) scales intensity. Quad is expanded in the vertex shader to accommodate the halo without clipping.
98
+ - **`EmphasisApi.setEmphasisGlowEnabled(bool)`** — master toggle for the hover-dim glow/halo layer (default `true` when hover-dim is active).
99
+ - **`EmphasisApi.setEmphasisGlowStrength(n)`** — controls tube-glow intensity applied to the kept edge set during hover-dim.
100
+ - **`EmphasisApi.setEmphasisHaloStrength(n)`** — controls halo intensity applied to the kept node set during hover-dim.
101
+
102
+ ### Changed
103
+
104
+ - **`GraphCanvas` `hoverDim` prop now defaults to `true`** (was `false`). When hover-dim is active, kept edges receive tube glow and kept nodes receive a halo in addition to the rest being dimmed. **Hosts that relied on the old no-dim default should pass `hoverDim={false}` explicitly.**
105
+ - Note: the low-level `RenderEngineApi` / `HoverEmphasisController` default remains opt-in (`enabled: false`) — only the `GraphCanvas` product layer defaults on.
106
+
107
+ ## 0.3.0 — 2026-05-28
108
+
109
+ L2 UMD bundle release. Goal: drop into any HTML page without npm / React / Vite.
110
+
111
+ ### Added
112
+
113
+ - **UMD / IIFE build** at `dist/kineviz-gl.umd.js` (~3.6 MB unminified, ~1 MB gzipped). React, ReactDOM, Three.js r121, radix-ui, and every other dependency are bundled — customers only need a `<script>` tag.
114
+ - **`window.KinevizGL` global** exposing `{ mount(host, options), version }`. Multiple instances supported (each `mount()` returns an `{ update, patch, unmount }` handle).
115
+ - **`dist/kineviz-gl.css` stylesheet** for UMD consumers to load via `<link rel="stylesheet">`. Same content as the ESM/CJS `dist/index.css`.
116
+ - `build:umd` and `build:esm` package.json scripts (the generic `build` script now runs both).
117
+
118
+ ### Example
119
+
120
+ ```html
121
+ <link rel="stylesheet" href="./kineviz-gl.css" />
122
+ <script src="./kineviz-gl.umd.js"></script>
123
+ <script>
124
+ const instance = KinevizGL.mount(document.getElementById("root"), {
125
+ data: { nodes: [...], edges: [...] },
126
+ forceLayout: true,
127
+ theme: "dark",
128
+ });
129
+ // Later: instance.patch({ data: newData }) or instance.unmount();
130
+ </script>
131
+ ```
132
+
133
+ ### Notes
134
+
135
+ - UMD bundle hard-codes `process.env.NODE_ENV = "production"` for size + performance.
136
+ - Fonts (woff2) are inlined as base64 data URIs to keep UMD single-file. The ESM/CJS build still emits separate woff2 files for tree-shaking.
137
+ - The ESM/CJS public API (`@kineviz/gl` imports) is unchanged from 0.2.0.
138
+
139
+ ## 0.2.0 — 2026-05-28
140
+
141
+ L1 ergonomic defaults release. Goal: `<GraphCanvas data={...} />` actually renders.
142
+
143
+ ### Added
144
+
145
+ - **`<GraphCanvas data={...} />` mounts out of the box.** No `container` ref boilerplate required for the simplest case.
146
+ - **`style?: React.CSSProperties` prop** on `GraphCanvas`. Forwarded to the auto-created host div (merged over the default `{ width: "100%", height: "100%", position: "relative" }`).
147
+ - **`className?: string` prop** on `GraphCanvas`. Forwarded to the auto-created host div.
148
+
149
+ ### Changed
150
+
151
+ - **`container` prop is now optional.** When omitted, GraphCanvas creates and manages its own internal host div. When provided, behavior is unchanged.
152
+ - **`nodeCloud` and `edgeCloud` default to `true`** when no React children are passed. When children ARE present, defaults stay `undefined` so children-pattern stories keep their explicit cloud control.
153
+ - **Dev-mode warning** when `style` / `className` are combined with an external `container` prop — the host caller owns styling in that case.
154
+ - README Quick Start simplified to 5 lines.
155
+
156
+ ### Back-compat
157
+
158
+ - Existing call sites passing `container={...}`, `nodeCloud={true}`, `edgeCloud={true}` (or any explicit value) are unchanged.
159
+ - Children-pattern stories (custom `<TextLayer>` etc. as children) continue to render exactly as before — cloud defaults stay `undefined` when children are present.
160
+ - Audited internally: 77 explicit `nodeCloud=` / `edgeCloud=` usages all pass `={true}`, 0 pass `={false}`. No regressions found.
161
+
162
+ ## 0.1.0 — 2026-05-28
163
+
164
+ Initial commercial distribution release.
165
+
166
+ - React component embed with `GraphCanvas`, `GraphStore` injection-based ontology hook (`setOntologyRegistry`).
167
+ - `setLicenseKey` no-op stub reserved for future P3 license gating.
168
+ - Tarball delivery via `dist-release/kineviz-gl-0.1.0.tgz`.
169
+ - Bundle composition: `@kineviz/graph-core`, `@kineviz/gpu-compute`, `@kineviz/graph-algorithms`, `@kineviz/icons/ui` inlined; `@kineviz/ontology` opt-in peer; public-npm deps (radix, lodash, clsx, etc.) external.
170
+ - Peer deps: React `^18.0.0`, three `~0.121.0` (strict).
package/README.md CHANGED
@@ -195,6 +195,11 @@ function App() {
195
195
 
196
196
  Without ontology, `store.ontology` returns `null` and the engine renders raw category/relationship strings.
197
197
 
198
+ ## Changelog
199
+
200
+ Release notes for every version live in [`CHANGELOG.md`](./CHANGELOG.md) (shipped
201
+ in the package tarball, so it's also at `node_modules/@kineviz/gl/CHANGELOG.md`).
202
+
198
203
  ## License
199
204
 
200
205
  Commercial — see `LICENSE-COMMERCIAL.txt`.