MSDFFont
MSDF Font data structure (kept for backward compatibility)
interface MSDFFont {
charsMap: Record<string, MSDFGlyph>;
common: object;
distanceField?: object;
info: object;
kerningsMap: Record<string, number>;
}
Fields
| | |
|---|
charsMap | Record<string, MSDFGlyph> | |
common | object | |
distanceField | object | |
info | object | |
kerningsMap | Record<string, number> | |
MSDFGlyph
MSDF Glyph data (kept for backward compatibility)
interface MSDFGlyph {
_y?: number;
chnl: number;
height: number;
id: number;
page: number;
width: number;
x: number;
xadvance: number;
xoffset: number;
y: number;
yoffset: number;
}
Fields
| | |
|---|
_y | number | |
chnl | number | |
height | number | |
id | number | |
page | number | |
width | number | |
x | number | |
xadvance | number | |
xoffset | number | |
y | number | |
yoffset | number | |
MapConfig
Configuration for the unified map prop on <GraphCanvas>.
When set, GraphCanvas auto-mounts FlatLayer (is3D=false) or GlobeLayer
(is3D=true) as an internal child layer; no manual <FlatLayer> /
<GlobeLayer> child mount is required. geoLayout defaults to enabled
(auto-detects lat/lng via case-insensitive property name matching).
See SPEC docs/superpowers/specs/2026-05-24-graphcanvas-map-prop-design.md.
interface MapConfig {
autoFit?: boolean;
geoLayout?: boolean | object;
globeRadius?: number;
mapSize?: number;
maxLevel?: number;
maxNodeGrowth?: number;
mercatorProjection?: boolean;
minLevel?: number;
tileProvider?: FreeProviderName | string & object;
tileUrl?: TileUrlFn;
visible?: boolean;
}
Fields
| | |
|---|
autoFit | boolean true | Auto-fit initial camera to nodes. |
geoLayout | boolean | object | Auto-apply map.applyGeoLayout on nodes:added / graph:dataReset.
- undefined / true: default config with geoMapping: "auto" and
nonGeoStrategy: "autoPlace". Auto-detects lat/lng property names
case-insensitively (lat/latitude/lng/longitude etc.).
- false: disable auto geoLayout; map is only background.
- object: override individual fields.
NOTE: requires forceLayout to be enabled on , otherwise
positionProvider is null and applyGeoLayout silently no-ops. A
console.error will be logged if forceLayout is missing. |
globeRadius | number 5 | Globe radius in scene units. Used when is3D=true. |
mapSize | number 10 | Planar map size in scene units. Used when is3D=false. |
maxLevel | number 17 (planar) / 18 (spherical) | Maximum tile zoom level. / 18 (spherical). |
maxNodeGrowth | number 4 (matches historical behavior) | Maximum growth multiplier for node screen size in map mode. Each node's projected screen size asymptotically approaches refSize × maxNodeGrowth (refSize = nodeSize × 5). Smaller values clamp zoom-in node growth more tightly. Set Infinity to disable the soft-cap entirely. Applied to nodes, badges, tags, and node picking — NOT to edges or arrows. Per-node size field is unchanged; size-by-property relative ratios are preserved at every zoom level. |
mercatorProjection | boolean true | Spherical-only: use Mercator projection. |
minLevel | number 0 | Minimum tile zoom level. |
tileProvider | FreeProviderName | string & object derived from theme (dark→cartoDark, light→cartoLight) | Predefined tile provider key. |
tileUrl | TileUrlFn | Custom tile URL function (x, y, level) => url. Overridden by tileProvider if both set. |
visible | boolean true | Show/hide the map without unmounting. |
MapMode
The two geographic projection modes, or null when map is disabled.
type MapMode = "planar" | "spherical"
MapTileProvider
interface MapTileProvider {
attribution: string;
description: string;
maxZoom: number;
name: string;
requiresKey: boolean;
tileUrl: TileUrlFn;
}
Fields
| | |
|---|
attribution | string | Attribution text (for compliance) |
description | string | Short description |
maxZoom | number | Maximum supported zoom level |
name | string | Display name for UI |
requiresKey | boolean | Whether this provider requires an API key |
tileUrl | TileUrlFn | The tile URL function |
MapTileProviderDescriptor
Full descriptor for a registered tile provider.
tileUrl may be:
- A static
TileUrlFn (for providers with no dynamic configuration)
- A factory
(config) => TileUrlFn (for providers that need API keys,
style IDs, or other per-instance configuration)
interface MapTileProviderDescriptor {
attribution?: string;
description: string;
key: string;
maxZoom?: number;
minZoom?: number;
name: string;
requiresConfig?: boolean;
thumbnail?: string;
tileUrl: TileUrlFn | (config: Record<string, string>) => TileUrlFn;
}
Fields
| | |
|---|
attribution | string | Attribution text (for compliance). |
description | string | Short description. |
key | string | Unique string key used to select this provider. |
maxZoom | number 18 | Maximum supported zoom level. |
minZoom | number 0 | Minimum supported zoom level. |
name | string | Human-readable name for UI display. |
requiresConfig | boolean | Whether this provider requires an API key or config. |
thumbnail | string | Optional preview thumbnail URL for UI selector. |
tileUrl | TileUrlFn | (config: Record<string, string>) => TileUrlFn | The tile URL function or a factory that produces one. |
MapTransitionConfig
interface MapTransitionConfig {
crossfadeDuration?: number;
}
Fields
MapTransitionMode
type MapTransitionMode = "planar" | "spherical"
MarkerLayerProps
interface MarkerLayerProps {
markers: MarkerSpec[];
}
Fields
| | |
|---|
markers | MarkerSpec[] | The markers to animate. Each rides one edge from source → target. |
MarkerRendererConfig
interface MarkerRendererConfig {
markers: MarkerSpec[];
}
Fields
MarkerSpec
Per-marker configuration. Domain-agnostic — no business params.
interface MarkerSpec {
color?: [number, number, number];
durationMs?: number;
edgeId: string;
icon?: string;
iconAngleOffset?: number;
key?: string;
orientToPath?: boolean;
phaseOffset?: number;
shape?: "dart" | "comet";
size?: number;
trailLength?: number;
}
Fields
| | |
|---|
color | [number, number, number] | 0..1 rgb tint; default [0.5, 0.8, 1.0]. |
durationMs | number | Time to traverse the edge once, ms; default 4000. |
edgeId | string | Edge whose endpoints the marker travels between. |
icon | string | Icon name resolved via iconAtlasManager.ensureIcon; omitted → soft dot/triangle. |
iconAngleOffset | number | Radians added to the tangent angle (align the glyph); default 0. |
key | string | Stable identity used to preserve animation phase when the markers array is
re-passed (adding/removing/restyling markers over time). Defaults to
edgeId. Give distinct keys if multiple markers share one edge. |
orientToPath | boolean | Rotate icon to the path tangent; default false. |
phaseOffset | number | Initial phase 0..1 applied the FIRST time this marker (by key) appears —
lets planes start mid-route so a fleet doesn't all leave the origin at
once. Ignored on later updates (the live phase is preserved instead). |
shape | "dart" | "comet" | No-icon head shape. "dart" (default) is the directional triangle;
"comet" is a radially symmetric glow head (white-hot core + tinted halo)
for meteor/threat-map styling — pair it with trailLength. Ignored when
icon is set. |
size | number | Device-px diameter; default 24. |
trailLength | number | Comet-trail length as a fraction of the full path (0..1); default 0
(no trail). The trail is a tapered, fading ribbon sampled along the actual
path behind the head — on the globe it bends with the great-circle arc.
Trail width derives from size. At most 256 markers render trails per
layer (slots beyond that draw the head only). |
MatchSpec
interface MatchSpec {
id?: string;
includeNull?: boolean;
invert?: boolean;
on?: Scope;
oneOf?: string[] | Set<string>;
property: string;
regex?: RegExp;
}
Fields
| | |
|---|
id | string | |
includeNull | boolean | |
invert | boolean | |
on | Scope | |
oneOf | string[] | Set<string> | |
property | string | |
regex | RegExp | |
interface MediaAtlasOptions {
aspect?: number;
capacity?: number;
cellHeight?: number;
crossOrigin?: string;
fit?: "cover" | "contain";
}
Fields
| | |
|---|
aspect | number | Cell width / height. Default 1. |
capacity | number | Cells to reserve. Rounded up to a grid. Default 16. |
cellHeight | number | Cell height in pixels. Default 256. |
crossOrigin | string | crossOrigin for every image. "anonymous" (the default) is REQUIRED for
remote images: set after src — or not at all — a cross-origin image
taints the canvas and the first texture upload throws SecurityError
nowhere near the cause. |
fit | "cover" | "contain" | How a source is framed inside its cell. Default "cover". |
Which part of a video frame a node shows. Image space: (0,0) is top-left.
interface MediaCrop {
x?: number;
y?: number;
zoom?: number;
}
Fields
| | |
|---|
x | number | Horizontal centre of the shown region, 0..1. Default 0.5. |
y | number | Vertical centre, 0..1. Default 0.5. |
zoom | number | Fraction of the frame height shown. 1 = whole frame. Default 1. |
Every effect is off at 0 and emits no code at that value.
interface MediaEffects {
bezel?: number;
bloom?: number;
dropout?: number;
fringe?: number;
glitch?: number;
grayscale?: number;
grille?: number;
hologram?: number;
scanlines?: number;
sweep?: number;
vignette?: number;
}
Fields
| | |
|---|
bezel | number | Inner dark frame, in panel heights (0.03 ≈ a monitor bezel). |
bloom | number | Highlight lift, 0..1. |
dropout | number | Occasional full-panel signal dropout, 0..1. Needs animate. |
fringe | number | Chromatic aberration, in panel widths (0.004 is a strong fringe). |
glitch | number | Rolling horizontal tear, 0..1. Needs animate. |
grayscale | number | Desaturation, 0..1. |
grille | number | Vertical aperture grille, 0..1. Pairs with scanlines. |
hologram | number | Scanning hologram bands, 0..1. Needs animate. |
scanlines | number | Horizontal CRT scanlines, 0..1. |
sweep | number | Travelling brightness sweep, 0..1. Needs animate. |
vignette | number | Corner darkening, 0..1. |
type MediaFit = "cover" | "contain"
Runtime-tunable parameters. Everything else is fixed at mount.
interface MediaLayerConfig {
borderColor?: ColorRepresentation;
opacity?: number;
revision?: number;
tint?: ColorRepresentation;
}
Fields
| | |
|---|
borderColor | ColorRepresentation | |
opacity | number | |
revision | number | Bump to re-read image / crop for every targeted node. Changed URLs are
reloaded into their existing atlas cell — no remount, no flicker. |
tint | ColorRepresentation | |
Runtime-tunable parameters. Everything else is fixed at mount.
interface MediaLayerProps {
aspect?: number;
band?: "top" | "underlay" | "overlay";
bandOffset?: number;
border?: number;
borderColor?: ColorRepresentation;
clickable?: boolean;
crossOrigin?: string;
customSdf?: string;
effects?: MediaEffects;
filter?: (node: NodeData, index: number) => boolean;
fit?: MediaFit;
hideBuiltinNode?: boolean;
image?: (node: NodeData, index: number) => string;
imageCapacity?: number;
imageResolution?: number;
maxNodes?: number;
name?: string;
onVideoSource?: (source: MediaVideoSource) => void;
opacity?: number;
radius?: number;
revision?: number;
shape?: MediaShape | (node: NodeData, index: number) => number | "circle" | "rect" | "roundRect" | "diamond" | "triangle" | "hexagon" | "star" | "ring";
size?: (node: NodeData, index: number) => number;
sizeFactor?: number;
tint?: ColorRepresentation;
video?: MediaVideoSpec;
}
Fields
| | |
|---|
aspect | number | Panel width / height. Default 1. shape: "circle" assumes 1. |
band | "top" | "underlay" | "overlay" | |
bandOffset | number | |
border | number | Outline thickness in panel heights. Default 0. |
borderColor | ColorRepresentation | |
clickable | boolean | Make the panel clickable over its whole area. Default true.
Without this the engine's hitbox stays the size of the BUILT-IN node dot,
so a sizeFactor: 10 panel only responds near its centre. |
crossOrigin | string | crossOrigin for images. Default "anonymous"; null disables it. |
customSdf | string | Outline from a GLSL signed-distance expression in vec2 q — panel space,
y up, height 1, width aspect, origin at the centre, negative inside.
Overrides shape. The hitbox follows it.
ts customSdf: "max(length(q) - 0.5, 0.18 - length(q))" // a thick ring |
effects | MediaEffects | |
filter | (node: NodeData, index: number) => boolean all of them | Nodes this layer may touch at all. |
fit | MediaFit | |
hideBuiltinNode | boolean | Hide the built-in node dot under the panel. Default true. |
image | (node: NodeData, index: number) => string | Still-image URL per node; null/undefined leaves the node alone. Images
share one atlas texture, so any number of them is a single draw call.
The host must send Access-Control-Allow-Origin — see crossOrigin. |
imageCapacity | number | Atlas cells to reserve. Default 36. Raise for more distinct images. |
imageResolution | number | Atlas cell height in px. Default 256. |
maxNodes | number | Max nodes the layer draws. Default 256. |
name | string | Distinct name per mounted MediaLayer. Default "media-layer". |
onVideoSource | (source: MediaVideoSource) => void | Hands back the shared video element right after mount, for a play/pause,
mute or seek control — or to feed the same audio to an
AudioSpectrumLayer instead of decoding the stream a second time. |
opacity | number | |
radius | number | Corner radius in panel heights, 0..0.5. Default 0.06 for rect. |
revision | number | Bump to re-read image / crop for every targeted node. Changed URLs are
reloaded into their existing atlas cell — no remount, no flicker. |
shape | MediaShape | (node: NodeData, index: number) => number | "circle" | "rect" | "roundRect" | "diamond" | "triangle" | "hexagon" | "star" | "ring" | Panel outline — any built-in node shape (circle rect roundRect
diamond triangle hexagon star ring) or squircle. Default
"rect".
Pass a FUNCTION to shape each node differently (a per-node attribute, still
one draw call). Returning null falls back to "rect"; "squircle" is
constant-only, as it is not one of the engine's shape ids. |
size | (node: NodeData, index: number) => number | Override the node size the panel is scaled from. |
sizeFactor | number | Panel size multiplier over the node's own size. Default 3. |
tint | ColorRepresentation | |
video | MediaVideoSpec | One shared video feed. Decoded once however many nodes show it. |
interface MediaLayerSpec {
aspect?: number;
band?: "top" | "underlay" | "overlay";
bandOffset?: number;
border?: number;
borderColor?: ColorRepresentation;
clickable?: boolean;
crossOrigin?: string;
customSdf?: string;
effects?: MediaEffects;
filter?: (node: NodeData, index: number) => boolean;
fit?: MediaFit;
hideBuiltinNode?: boolean;
image?: (node: NodeData, index: number) => string;
imageCapacity?: number;
imageResolution?: number;
maxNodes?: number;
onVideoSource?: (source: MediaVideoSource) => void;
opacity?: number;
radius?: number;
shape?: MediaShape | (node: NodeData, index: number) => number | "circle" | "rect" | "roundRect" | "diamond" | "triangle" | "hexagon" | "star" | "ring";
size?: (node: NodeData, index: number) => number;
sizeFactor?: number;
tint?: ColorRepresentation;
video?: MediaVideoSpec;
}
Fields
| | |
|---|
aspect | number | Panel width / height. Default 1. shape: "circle" assumes 1. |
band | "top" | "underlay" | "overlay" | |
bandOffset | number | |
border | number | Outline thickness in panel heights. Default 0. |
borderColor | ColorRepresentation | |
clickable | boolean | Make the panel clickable over its whole area. Default true.
Without this the engine's hitbox stays the size of the BUILT-IN node dot,
so a sizeFactor: 10 panel only responds near its centre. |
crossOrigin | string | crossOrigin for images. Default "anonymous"; null disables it. |
customSdf | string | Outline from a GLSL signed-distance expression in vec2 q — panel space,
y up, height 1, width aspect, origin at the centre, negative inside.
Overrides shape. The hitbox follows it.
ts customSdf: "max(length(q) - 0.5, 0.18 - length(q))" // a thick ring |
effects | MediaEffects | |
filter | (node: NodeData, index: number) => boolean all of them | Nodes this layer may touch at all. |
fit | MediaFit | |
hideBuiltinNode | boolean | Hide the built-in node dot under the panel. Default true. |
image | (node: NodeData, index: number) => string | Still-image URL per node; null/undefined leaves the node alone. Images
share one atlas texture, so any number of them is a single draw call.
The host must send Access-Control-Allow-Origin — see crossOrigin. |
imageCapacity | number | Atlas cells to reserve. Default 36. Raise for more distinct images. |
imageResolution | number | Atlas cell height in px. Default 256. |
maxNodes | number | Max nodes the layer draws. Default 256. |
onVideoSource | (source: MediaVideoSource) => void | Hands back the shared video element right after mount, for a play/pause,
mute or seek control — or to feed the same audio to an
AudioSpectrumLayer instead of decoding the stream a second time. |
opacity | number | |
radius | number | Corner radius in panel heights, 0..0.5. Default 0.06 for rect. |
shape | MediaShape | (node: NodeData, index: number) => number | "circle" | "rect" | "roundRect" | "diamond" | "triangle" | "hexagon" | "star" | "ring" | Panel outline — any built-in node shape (circle rect roundRect
diamond triangle hexagon star ring) or squircle. Default
"rect".
Pass a FUNCTION to shape each node differently (a per-node attribute, still
one draw call). Returning null falls back to "rect"; "squircle" is
constant-only, as it is not one of the engine's shape ids. |
size | (node: NodeData, index: number) => number | Override the node size the panel is scaled from. |
sizeFactor | number | Panel size multiplier over the node's own size. Default 3. |
tint | ColorRepresentation | |
video | MediaVideoSpec | One shared video feed. Decoded once however many nodes show it. |
Panel outline. Every built-in node shape is available
(circle rect roundRect diamond triangle hexagon star ring),
plus squircle — a superellipse that reads as a rounded square at any size.
Need something else? pass customSdf instead.
type MediaShape = ShapeName | "squircle"
[u0, v0, u1, v1] in texture space (v up), half-texel inset.
type MediaTile = [number, number, number, number]
interface MediaVideoOptions {
autoplay?: boolean;
crossOrigin?: string;
loop?: boolean;
muted?: boolean;
playbackRate?: number;
preload?: "auto" | "none" | "metadata";
url: string;
}
Fields
| | |
|---|
autoplay | boolean | Default true. |
crossOrigin | string | Default "anonymous". Without it a cross-origin frame cannot be uploaded
and the failure surfaces as a blank panel with no error. |
loop | boolean | Default true. |
muted | boolean | Default true. Autoplay is blocked for audible video in every browser. |
playbackRate | number | |
preload | "auto" | "none" | "metadata" | preload attribute. Default "auto". |
url | string | |
interface MediaVideoSpec {
autoplay?: boolean;
crop?: (node: NodeData, index: number) => MediaCrop;
crossOrigin?: string;
loop?: boolean;
muted?: boolean;
playbackRate?: number;
url: string;
}
Fields
| | |
|---|
autoplay | boolean | |
crop | (node: NodeData, index: number) => MediaCrop | Which nodes show the feed, and what each one shows. Return null to leave
a node without video. Omit it and every node the layer targets shows the
whole frame. |
crossOrigin | string | |
loop | boolean | |
muted | boolean | |
playbackRate | number | |
url | string | |
Context passed to menu item callbacks when the menu opens
interface MenuContext {
edgeId?: string;
engine?: RenderEngineApi;
interaction?: InteractionManager;
intl?: object;
mode?: SceneMode;
nodeId?: string;
screenPosition: object;
selectedEdgeIds: string[];
selectedNodeIds: string[];
store: GraphStore;
type: "node" | "edge" | "background";
worldPos?: object;
}
Fields
| | |
|---|
edgeId | string | Right-clicked edge ID (if type === "edge") |
engine | RenderEngineApi | Full engine API for items needing camera/history/style/selection. engine.store === store. |
interaction | InteractionManager | Interaction manager for programmatic edge/node creation (Add Edge / Add Node menu actions). |
intl | object | Optional intl shape so item label functions can resolve translations. |
mode | SceneMode | Current scene mode for mode-aware predicates. |
nodeId | string | Right-clicked node ID (if type === "node") |
screenPosition | object | Screen position where the menu should appear |
selectedEdgeIds | string[] | All currently selected edge IDs |
selectedNodeIds | string[] | All currently selected node IDs |
store | GraphStore | The GraphStore for querying data |
type | "node" | "edge" | "background" | What was right-clicked |
worldPos | object | 3D world-space coordinate at the click point. Used by createNodeHere flow. |
A menu group defines a visual section separated by dividers
interface MenuGroup {
id: string;
order: number;
}
Fields
| | |
|---|
id | string | Unique group ID, e.g. "info", "expand", "layout" |
order | number | Sort order (lower = higher in menu) |
Definition of a single menu item
interface MenuItem {
action?: (ctx: MenuContext) => void;
children?: MenuItem[] | (ctx: MenuContext) => Promise<MenuItem[]>;
danger?: boolean;
enabled?: (ctx: MenuContext) => boolean;
group: string;
icon?: string | IconSpec;
id: string;
label: string | (ctx: MenuContext) => string;
order: number;
shortcut?: string;
visible?: (ctx: MenuContext) => boolean;
}
Fields
| | |
|---|
action | (ctx: MenuContext) => void | Action when clicked |
children | MenuItem[] | (ctx: MenuContext) => Promise<MenuItem[]> | Static or async children for submenus |
danger | boolean | Mark as danger item (red text styling) |
enabled | (ctx: MenuContext) => boolean true | Whether this item is enabled/clickable |
group | string | Group this item belongs to |
icon | string | IconSpec | Optional icon: legacy name string OR structured IconSpec for gxr/component/svg icons |
id | string | Unique ID with namespace, e.g. "core.expand", "custom.exportCSV" |
label | string | (ctx: MenuContext) => string | Display label — string or dynamic function |
order | number | Sort order within the group |
shortcut | string | Display-only shortcut hint shown next to the label. Host owns the actual keybinding. |
visible | (ctx: MenuContext) => boolean true | Whether this item is visible |
MergeConfig
type MergeConfig = object | object
MergeOptions
interface MergeOptions {
clearUnselectedProperties?: boolean;
directional?: boolean;
}
Fields
| | |
|---|
clearUnselectedProperties | boolean | |
directional | boolean | |
MetricPulseConfig
interface MetricPulseConfig {
duration?: number;
loop?: boolean;
maxAmplitude?: number;
maxValue?: number;
minValue?: number;
property?: string;
speed?: number;
values?: Map<string, number>;
}
Fields
| | |
|---|
duration | number 5000 | Duration in ms. 0 = forever. - loop:true → 0 = forever; >0 = upper-bounded loop (self-terminates at N ms). - loop:false → must be > 0; one-shot. |
loop | boolean true (loop until stop()) | Lifecycle mode. ). See NodeRippleConfig.loop for full semantics. Note: unlike other persistent effects, this effect's duration default is 5000 (not 0), so the default { loop: true } is effectively an upper-bounded loop that self-terminates at 5 seconds. This preserves pre-rescope behavior. |
maxAmplitude | number 0.3 (30% size change) | Pulse amplitude at max value. |
maxValue | number auto from data | Max metric value (maps to max pulse). |
minValue | number auto from data | Min metric value (maps to no pulse). |
property | string none (use values map) | Property key to read from node properties. |
speed | number 2 | Pulse speed (cycles per second). |
values | Map<string, number> | Direct values map: nodeId -> metric value. Overrides property. |
MinimapConfig
Minimap configuration for GraphRenderer
interface MinimapConfig {
defaultVisible?: boolean;
height?: number;
margin?: number;
position?: "bottom-right" | "bottom-left" | "top-right";
width?: number;
}
Fields
| | |
|---|
defaultVisible | boolean | |
height | number | |
margin | number | |
position | "bottom-right" | "bottom-left" | "top-right" | |
width | number | |
MinimapLayerProps
interface MinimapLayerProps {
defaultVisible?: boolean;
height?: number;
margin?: number;
position?: "bottom-right" | "bottom-left" | "top-right";
positionProvider?: PositionProvider;
width?: number;
}
Fields
| | |
|---|
defaultVisible | boolean | |
height | number | |
margin | number | |
position | "bottom-right" | "bottom-left" | "top-right" | |
positionProvider | PositionProvider | External position provider (if not set, uses context.layoutPositionProvider or store.positionProvider) |
width | number | |
NeighborInfo
GraphQueries - Computed properties for graph data
Provides on-demand computation of derived values like degree, neighbors, etc.
Avoids storing redundant data by computing when needed.
interface NeighborInfo {
direction: "in" | "out";
edgeId: string;
nodeId: string;
}
Fields
| | |
|---|
direction | "in" | "out" | |
edgeId | string | |
nodeId | string | |
NodeBreatheConfig
interface NodeBreatheConfig {
amplitude?: number;
duration?: number;
loop?: boolean;
}
Fields
| | |
|---|
amplitude | number 1.0 | Breathe amplitude. |
duration | number | Duration in milliseconds.
- loop:true → 0 = forever (default); >0 = upper-bounded loop.
- loop:false → must be > 0; one-shot. |
loop | boolean true (loop until stop()) | Lifecycle mode. ). See NodeRippleConfig.loop for full semantics. |
NodeCaptionConfig
Node caption configuration
interface NodeCaptionConfig {
captions: CaptionDef[];
lineSpacing?: number;
verticalPosition?: "below" | "above" | "center";
}
Fields
| | |
|---|
captions | CaptionDef[] | Multi-line caption definitions, rendered in order |
lineSpacing | number 1.2 | Line spacing in world units. |
verticalPosition | "below" | "above" | "center" | Vertical position: 'below'=below node (default), 'above'=above, 'center'=overlay |
NodeCardCacheOptions
interface NodeCardCacheOptions {
atlas: MediaAtlas;
context?: CanvasRenderingContext2D;
crossOrigin?: string;
loadPhoto?: (url: string) => Promise<NodeCardPhoto>;
onRepaint?: () => void;
theme?: NodeCardTheme;
}
Fields
| | |
|---|
atlas | MediaAtlas | Destination. Its cell size is the card size. |
context | CanvasRenderingContext2D | Scratch 2D context. Defaults to a fresh canvas; tests inject a recorder. |
crossOrigin | string | crossOrigin for photos. Default "anonymous"; null disables it. |
loadPhoto | (url: string) => Promise<NodeCardPhoto> | Photo loader. Defaults to an <img> decode; tests inject a resolver. |
onRepaint | () => void | Called after a repaint caused by an arriving photo. |
theme | NodeCardTheme | |
NodeCardField
One label: value row.
interface NodeCardField {
accent?: boolean;
label: string;
value: string;
}
Fields
| | |
|---|
accent | boolean | Draw the value in the accent colour — a flag, a risk level, a match. |
label | string | |
value | string | |
NodeCardLayerConfig
Runtime-tunable parameters. Everything else is fixed at mount.
interface NodeCardLayerConfig {
borderColor?: ColorRepresentation;
opacity?: number;
revision?: number;
tint?: ColorRepresentation;
}
Fields
| | |
|---|
borderColor | ColorRepresentation | |
opacity | number | |
revision | number | Bump to re-read card for every targeted node. Cards whose spec did not
change are not repainted, so this is cheap to bump on every data edit. |
tint | ColorRepresentation | |
NodeCardLayerProps
Runtime-tunable parameters. Everything else is fixed at mount.
interface NodeCardLayerProps {
aspect?: number;
band?: "top" | "underlay" | "overlay";
bandOffset?: number;
border?: number;
borderColor?: ColorRepresentation;
capacity?: number;
card?: (node: NodeData, index: number) => NodeCardSpec;
clickable?: boolean;
crossOrigin?: string;
customSdf?: string;
effects?: MediaEffects;
filter?: (node: NodeData, index: number) => boolean;
hideBuiltinNode?: boolean;
maxNodes?: number;
name?: string;
opacity?: number;
paint?: (g: CanvasRenderingContext2D, node: NodeData, size: NodeCardSize, index: number) => void;
radius?: number;
resolution?: number;
revision?: number;
shape?: MediaShape | (node: NodeData, index: number) => number | "circle" | "rect" | "roundRect" | "diamond" | "triangle" | "hexagon" | "star" | "ring";
size?: (node: NodeData, index: number) => number;
sizeFactor?: number;
theme?: NodeCardTheme;
tint?: ColorRepresentation;
}
Fields
| | |
|---|
aspect | number | Card width / height. Default 1.5. |
band | "top" | "underlay" | "overlay" | |
bandOffset | number | |
border | number | Outline thickness in card heights. Default 0. |
borderColor | ColorRepresentation | |
capacity | number | Cells to reserve. Default 36. Nodes past it draw no card. |
card | (node: NodeData, index: number) => NodeCardSpec | The card for a node. Return null to leave a node without one.
This is the ONLY place business meaning enters: the engine sees a title,
rows and a photo URL, never what they mean. |
clickable | boolean | Clickable over the whole card. Default true. |
crossOrigin | string | crossOrigin for photos. Default "anonymous"; null disables it. |
customSdf | string | Outline from a GLSL signed-distance expression in vec2 q. See MediaLayer. |
effects | MediaEffects | Panel effects (vignette, scanlines, hologram…). Default none. |
filter | (node: NodeData, index: number) => boolean all of them | Nodes this layer may touch at all. |
hideBuiltinNode | boolean | Hide the built-in node dot under the card. Default true. |
maxNodes | number | Max nodes the layer draws. Default 64. |
name | string | Distinct name per mounted NodeCardLayer. Default "node-card-layer". |
opacity | number | |
paint | (g: CanvasRenderingContext2D, node: NodeData, size: NodeCardSize, index: number) => void | Draw the cell by hand instead of describing a card. Overrides card, and
repaints on every revision bump (the layer cannot tell what you drew).
The door for anything the card spec cannot express — including real HTML,
by rasterising an SVG foreignObject into an Image and drawImage-ing
it here. Mind the caveats: external fonts and remote images inside such an
SVG do not load, so inline them. |
radius | number | Corner radius in card heights, 0..0.5. Default 0.03. |
resolution | number | Card height in texture pixels. Default 320 — a 1.5 card is then 480×320.
Raise it for crisper text, at capacity × resolution² worth of VRAM. |
revision | number | Bump to re-read card for every targeted node. Cards whose spec did not
change are not repainted, so this is cheap to bump on every data edit. |
shape | MediaShape | (node: NodeData, index: number) => number | "circle" | "rect" | "roundRect" | "diamond" | "triangle" | "hexagon" | "star" | "ring" | Panel outline — any built-in node shape or squircle, or a function for
per-node outlines. Default "rect". |
size | (node: NodeData, index: number) => number | Override the node size the card is scaled from. |
sizeFactor | number | Card size multiplier over the node's own size. Default 9. |
theme | NodeCardTheme | Colours, photo placement, row pitch. See NodeCardTheme. |
tint | ColorRepresentation | |
NodeCardLayerRenderer
What createNodeCardLayer returns: a layer renderer that also exposes
its rasteriser, for a host that wants to repaint a single card itself
(cache.invalidate(slot)) rather than bump revision for all of them.
interface NodeCardLayerRenderer {
cardCache: NodeCardCache;
dispose: unknown;
frame?: unknown;
mount: unknown;
onMapMode?: unknown;
update?: unknown;
}
Fields
| | |
|---|
cardCache | NodeCardCache | The rasteriser. null before mount and after dispose. |
NodeCardLayerSpec
interface NodeCardLayerSpec {
aspect?: number;
band?: "top" | "underlay" | "overlay";
bandOffset?: number;
border?: number;
borderColor?: ColorRepresentation;
capacity?: number;
card?: (node: NodeData, index: number) => NodeCardSpec;
clickable?: boolean;
crossOrigin?: string;
customSdf?: string;
effects?: MediaEffects;
filter?: (node: NodeData, index: number) => boolean;
hideBuiltinNode?: boolean;
maxNodes?: number;
opacity?: number;
paint?: (g: CanvasRenderingContext2D, node: NodeData, size: NodeCardSize, index: number) => void;
radius?: number;
resolution?: number;
shape?: MediaShape | (node: NodeData, index: number) => number | "circle" | "rect" | "roundRect" | "diamond" | "triangle" | "hexagon" | "star" | "ring";
size?: (node: NodeData, index: number) => number;
sizeFactor?: number;
theme?: NodeCardTheme;
tint?: ColorRepresentation;
}
Fields
| | |
|---|
aspect | number | Card width / height. Default 1.5. |
band | "top" | "underlay" | "overlay" | |
bandOffset | number | |
border | number | Outline thickness in card heights. Default 0. |
borderColor | ColorRepresentation | |
capacity | number | Cells to reserve. Default 36. Nodes past it draw no card. |
card | (node: NodeData, index: number) => NodeCardSpec | The card for a node. Return null to leave a node without one.
This is the ONLY place business meaning enters: the engine sees a title,
rows and a photo URL, never what they mean. |
clickable | boolean | Clickable over the whole card. Default true. |
crossOrigin | string | crossOrigin for photos. Default "anonymous"; null disables it. |
customSdf | string | Outline from a GLSL signed-distance expression in vec2 q. See MediaLayer. |
effects | MediaEffects | Panel effects (vignette, scanlines, hologram…). Default none. |
filter | (node: NodeData, index: number) => boolean all of them | Nodes this layer may touch at all. |
hideBuiltinNode | boolean | Hide the built-in node dot under the card. Default true. |
maxNodes | number | Max nodes the layer draws. Default 64. |
opacity | number | |
paint | (g: CanvasRenderingContext2D, node: NodeData, size: NodeCardSize, index: number) => void | Draw the cell by hand instead of describing a card. Overrides card, and
repaints on every revision bump (the layer cannot tell what you drew).
The door for anything the card spec cannot express — including real HTML,
by rasterising an SVG foreignObject into an Image and drawImage-ing
it here. Mind the caveats: external fonts and remote images inside such an
SVG do not load, so inline them. |
radius | number | Corner radius in card heights, 0..0.5. Default 0.03. |
resolution | number | Card height in texture pixels. Default 320 — a 1.5 card is then 480×320.
Raise it for crisper text, at capacity × resolution² worth of VRAM. |
shape | MediaShape | (node: NodeData, index: number) => number | "circle" | "rect" | "roundRect" | "diamond" | "triangle" | "hexagon" | "star" | "ring" | Panel outline — any built-in node shape or squircle, or a function for
per-node outlines. Default "rect". |
size | (node: NodeData, index: number) => number | Override the node size the card is scaled from. |
sizeFactor | number | Card size multiplier over the node's own size. Default 9. |
theme | NodeCardTheme | Colours, photo placement, row pitch. See NodeCardTheme. |
tint | ColorRepresentation | |
NodeCardPhoto
A decoded photo plus its natural size, ready to composite.
interface NodeCardPhoto {
height: number;
source: CanvasImageSource;
width: number;
}
Fields
| | |
|---|
height | number | |
source | CanvasImageSource | |
width | number | |
NodeCardSize
interface NodeCardSize {
height: number;
width: number;
}
Fields
NodeCardSpec
interface NodeCardSpec {
accent?: string;
badges?: string[];
fields?: NodeCardField[];
footer?: string;
image?: string;
stamp?: string;
subtitle?: string;
title?: string;
}
Fields
| | |
|---|
accent | string | Per-card accent, overriding the theme's. |
badges | string[] | Short tags under the header band. |
fields | NodeCardField[] | Rows, in order. Pass every property for a full dossier. |
footer | string | Bottom strip, in the muted colour. |
image | string | Photo URL. Loaded and composited into the card's frame. |
stamp | string | Big rotated overprint, e.g. "CLASSIFIED". |
subtitle | string | Right of the headline, smaller — a category, a case id. |
title | string | Headline, in the accent band. |
NodeCardTheme
How a card is drawn. Everything is a fraction of the card HEIGHT, so one
theme looks the same at any resolution.
interface NodeCardTheme {
accent?: string;
accentText?: string;
background?: string;
border?: number;
borderColor?: string;
font?: string;
foreground?: string;
header?: number;
labelFont?: string;
muted?: string;
padding?: number;
photo?: "left" | "top" | "none";
photoSize?: number;
rowHeight?: number;
rules?: boolean;
}
Fields
| | |
|---|
accent | string | Header band, accented values, stamp. |
accentText | string | Header text colour, on the accent band. |
background | string | |
border | number | Hairline round the card. 0 = none. Fraction of height. Default 0.006. |
borderColor | string | |
font | string | |
foreground | string | |
header | number | Header band height, as a fraction of height. 0 = no band. Default 0.15. |
labelFont | string | Labels, badges and the stamp. Defaults to font. |
muted | string | Labels, footer, rules. |
padding | number | Inset, as a fraction of height. Default 0.055. |
photo | "left" | "top" | "none" | Where the photo sits. Default "left". |
photoSize | number | Photo box size: a fraction of the card WIDTH when photo: "left", of its
HEIGHT when photo: "top". Default 0.34. |
rowHeight | number | Row pitch, as a fraction of height. Default 0.082. |
rules | boolean | Hairline under each row. Default true. |
NodeCloudConfig
Node cloud configuration for GraphRenderer
interface NodeCloudConfig {
avatarTexture?: Texture;
defaultNodeSize?: number;
fixedSize?: number;
hidePin?: boolean;
hideRing?: boolean;
iconAtlas?: Texture;
iconColumns?: number;
iconDisplayMode?: number;
iconMode?: number;
lightMode?: boolean;
maxNodes?: number;
nodeSizeScale?: number;
pinTexture?: Texture;
positionProvider?: PositionProvider;
useCircle?: boolean;
}
Fields
| | |
|---|
avatarTexture | Texture | Avatar array texture (WebGL2) |
defaultNodeSize | number | Default node size for nodes without explicit size. Applied to store.defaultNodeSize. |
fixedSize | number | Fixed size mode: 0 = perspective scaling (default), >0 = fixed size multiplier (no distance scaling) |
hidePin | boolean | Hide pin indicators |
hideRing | boolean | Hide ring effects |
iconAtlas | Texture | Icon atlas texture |
iconColumns | number | Icon atlas columns |
iconDisplayMode | number | Icon display mode: 0=filled (white icon on color), 1=ring-only, 2=plain (no ring/fill) |
iconMode | number | Icon mode: 1=transparent bg, 2=icon transparent, 3=additive |
lightMode | boolean | Light mode affects ring brightness |
maxNodes | number | Maximum number of nodes (for buffer pre-allocation) |
nodeSizeScale | number 1.0 | Global node size scale multiplier Scales all nodes uniformly via shader uniform. |
pinTexture | Texture | Pin indicator texture |
positionProvider | PositionProvider | Position provider (for GPU/CPU position sources) |
useCircle | boolean | Use circular nodes |
NodeCloudProps
interface NodeCloudProps {
avatarTexture?: Texture;
defaultNodeSize?: number;
fixedSize?: number;
hidePin?: boolean;
hideRing?: boolean;
iconAtlas?: Texture;
iconColumns?: number;
iconDisplayMode?: number;
iconMode?: number;
lightMode?: boolean;
maxNodes?: number;
nodeSizeScale?: number;
onReady?: (renderer: NodeRendererBackend) => void;
pinTexture?: Texture;
positionProvider?: PositionProvider;
theme?: "dark" | "light";
useCircle?: boolean;
}
Fields
| | |
|---|
avatarTexture | Texture | Avatar array texture (WebGL2) |
defaultNodeSize | number | Default node size for nodes without explicit size. Applied to store.defaultNodeSize. |
fixedSize | number | Fixed size mode: 0 = perspective scaling (default), >0 = fixed size multiplier (no distance scaling) |
hidePin | boolean | Hide pin indicators |
hideRing | boolean | Hide ring effects |
iconAtlas | Texture | Icon atlas texture |
iconColumns | number | Icon atlas columns |
iconDisplayMode | number | Icon display mode: 0=filled (white icon on color), 1=ring-only, 2=plain (no ring/fill) |
iconMode | number | Icon mode: 1=transparent bg, 2=icon transparent, 3=additive |
lightMode | boolean | Light mode affects ring brightness |
maxNodes | number | Maximum number of nodes (for buffer pre-allocation) |
nodeSizeScale | number 1.0 | Global node size scale multiplier Scales all nodes uniformly via shader uniform. |
onReady | (renderer: NodeRendererBackend) => void | Callback when renderer is ready |
pinTexture | Texture | Pin indicator texture |
positionProvider | PositionProvider | Position provider (for GPU/CPU position sources) |
theme | "dark" | "light" | Override theme for nodes: 'dark' = dark ring style, 'light' = light ring style |
useCircle | boolean | Use circular nodes |
NodeData
interface NodeData {
category: string;
id: string;
labels?: string[];
properties: Record<string, PropertyValue>;
tags?: string[];
}
Fields
| | |
|---|
category | string | |
id | string | |
labels | string[] | |
properties | Record<string, PropertyValue> | |
tags | string[] | |
NodeDefinition
interface NodeDefinition {
data: NodeData;
group: "nodes";
position?: object;
selected?: boolean;
}
Fields
| | |
|---|
data | NodeData | |
group | "nodes" | |
position | object | |
selected | boolean | |
NodeDragEvent
Drag-cycle payload (start / move / end). Carries the node IDs being dragged,
the drag-start world position, and the delta from start to current.
interface NodeDragEvent {
canvasPos: [number, number];
deltaWorld: [number, number, number];
draggedNodeIds: string[];
modifiers: PointerModifiers;
nodeId: string;
originalEvent: MouseEvent;
startWorld: [number, number, number];
worldPos: [number, number, number];
}
Fields
| | |
|---|
canvasPos | [number, number] | Canvas-relative position in CSS pixels, origin top-left. |
deltaWorld | [number, number, number] | World-space delta from drag start to the current frame. |
draggedNodeIds | string[] | All node IDs being dragged (multi-select drag includes the full set; single drag has one). |
modifiers | PointerModifiers | Modifier-key state at event time. |
nodeId | string | |
originalEvent | MouseEvent | Native pointer or mouse event the engine handled. Preserved so hosts can call preventDefault() / stopPropagation(). |
startWorld | [number, number, number] | World-space [x, y, z] captured at drag start. |
worldPos | [number, number, number] | Three.js world-space position [x, y, z] at the pointer's intersection with the cloudScene plane. |
NodeEntranceConfig
interface NodeEntranceConfig {
duration?: number;
easing?: "linear" | "easeIn" | "easeOut" | "easeInOut";
stagger?: number;
}
Fields
| | |
|---|
duration | number 600 | Animation duration in ms. |
easing | "linear" | "easeIn" | "easeOut" | "easeInOut" "easeOut" | Easing type. |
stagger | number 50 | Stagger delay between nodes in ms. |
NodeEvent
interface NodeEvent {
originalEvent?: MouseEvent | TouchEvent;
position?: object;
target: NodeData;
type: "node:click" | "node:dblclick" | "node:hover" | "node:hoverout" | "node:dragstart" | "node:drag" | "node:dragend";
}
Fields
| | |
|---|
originalEvent | MouseEvent | TouchEvent | |
position | object | |
target | NodeData | |
type | "node:click" | "node:dblclick" | "node:hover" | "node:hoverout" | "node:dragstart" | "node:drag" | "node:dragend" | |
NodeFilter
type NodeFilter = string | string[] | object | object | (node: NodeData) => boolean
NodeFilterCommonSpec
interface NodeFilterCommonSpec {
id?: string;
includeNull?: boolean;
invert?: boolean;
on?: Scope;
}
Fields
| | |
|---|
id | string | |
includeNull | boolean | |
invert | boolean | |
on | Scope | |
NodeInfoPanelProps
interface NodeInfoPanelProps {
container?: HTMLElement;
isDark?: boolean;
locale?: string;
manager: NodeInfoManager;
messages?: Record<string, string>;
onExpandNeighbors?: (nodeId: string) => void;
showExpandNeighbors?: boolean;
store: GraphStore;
}
Fields
| | |
|---|
container | HTMLElement | |
isDark | boolean | Accepted for backward-compat; theme is driven by data-gxr-theme tokens. |
locale | string | UI language. Selects the built-in en / zh / es bundle. Default en. |
manager | NodeInfoManager | |
messages | Record<string, string> | Optional per-key overrides for hosts that need strings the built-in
bundles don't cover. Keys: nodeInfo.properties, nodeInfo.relations,
nodeInfo.expandNeighbors. Takes precedence over the locale bundle. |
onExpandNeighbors | (nodeId: string) => void | Host callback invoked when the "Expand neighbors" button is clicked. |
showExpandNeighbors | boolean | Show the footer "Expand neighbors" button. Default false (hidden). |
store | GraphStore | |
NodeInfoState
NodeInfoManager — Observable state for the NodeInfo panel.
Follows the same observer pattern as ContextMenuManager:
show()/hide() mutate state, onChange() subscribes to updates.
interface NodeInfoState {
nodeId: string;
position: object;
visible: boolean;
}
Fields
| | |
|---|
nodeId | string | |
position | object | |
visible | boolean | |
interface NodeInput {
category: string;
id?: string;
labels?: string[];
position?: object;
properties?: Record<string, PropertyValue>;
}
Fields
| | |
|---|
category | string | |
id | string | |
labels | string[] | |
position | object | |
properties | Record<string, PropertyValue> | |
NodeLike
Node-like interface for size calculation
interface NodeLike {
hasImage?: boolean;
size: number;
}
Fields
| | |
|---|
hasImage | boolean | |
size | number | |
NodePickResult
interface NodePickResult {
index: number;
ndcPosition: object;
node: NodeData;
nodeId: string;
picked: boolean;
screenPosition: object;
type: "node";
}
Fields
| | |
|---|
index | number | Index in the GPU buffer (-1 for background) |
ndcPosition | object | Normalized device coordinates (-1 to 1) |
node | NodeData | |
nodeId | string | |
picked | boolean | Whether something was picked (not background) |
screenPosition | object | Screen position of pick |
type | "node" | What was picked |
NodePinPatch
interface NodePinPatch {
id: string;
pinned: boolean;
position?: Position3D;
}
Fields
NodePointerEvent
Click / hover / context-menu on a node.
interface NodePointerEvent {
canvasPos: [number, number];
modifiers: PointerModifiers;
nodeId: string;
originalEvent: MouseEvent;
worldPos: [number, number, number];
}
Fields
| | |
|---|
canvasPos | [number, number] | Canvas-relative position in CSS pixels, origin top-left. |
modifiers | PointerModifiers | Modifier-key state at event time. |
nodeId | string | |
originalEvent | MouseEvent | Native pointer or mouse event the engine handled. Preserved so hosts can call preventDefault() / stopPropagation(). |
worldPos | [number, number, number] | Three.js world-space position [x, y, z] at the pointer's intersection with the cloudScene plane. |
NodePositionPatch
interface NodePositionPatch {
id: string;
position: Position3D;
}
Fields
NodePredicateFn
type NodePredicateFn = (node: NodeData) => boolean
NodeProps
Simplified node configuration for GraphCanvas
interface NodeProps {
defaultColor?: string;
defaultSize?: number;
fixedSize?: number;
iconMode?: 1 | 2 | 3;
maxNodes?: number;
nodeScale?: number;
shape?: "circle" | "square";
showPin?: boolean;
showRing?: boolean;
}
Fields
| | |
|---|
defaultColor | string theme-dependent | Default node color (hex string). |
defaultSize | number 10 | Default node size for nodes without explicit size. |
fixedSize | number 0 | Fixed size mode (0 = perspective scaling, >0 = constant pixel size). |
iconMode | 1 | 2 | 3 1 | Icon rendering mode (1=transparent bg, 2=icon transparent, 3=additive). |
maxNodes | number | Maximum node buffer size (pre-allocate for dynamic graphs) |
nodeScale | number 1.0 | Global node size scale multiplier. Scales all nodes uniformly (like lineWidth for edges). |
shape | "circle" | "square" "circle" | Node shape. |
showPin | boolean true | Show pin indicators on pinned nodes. |
showRing | boolean true | Show selection/highlight ring around nodes. |
NodeRenderState
interface NodeRenderState {
aspects: Float32Array;
breathe: Float32Array;
collection: Float32Array;
colors: Float32Array;
effectiveSizes: Float32Array;
halo: Float32Array;
hidden: Float32Array;
highlighted: Float32Array;
hovered: Float32Array;
icons: Float32Array;
iconUVs: Float32Array;
imageIndices: Float32Array;
imageUVs: Float32Array;
opacities: Float32Array;
overrides: Float32Array;
pinned: Float32Array;
ringColors?: Float32Array;
ripple: Float32Array;
selected: Float32Array;
shapeIds: Float32Array;
sizes: Float32Array;
suppressFill: Float32Array;
}
Fields
| | |
|---|
aspects | Float32Array | Width / height ratio per node (1 = square box; height = size / aspect). |
breathe | Float32Array | Breathe amplitude [0=off, >0=amplitude], per-node |
collection | Float32Array | Collection mode [0/1, ...] — 1.0 if node is a collection |
colors | Float32Array | Colors [r,g,b, r,g,b, ...] × nodeCount |
effectiveSizes | Float32Array | GPU-facing scaled sizes (= sizes[i] * globalNodeSizeScale). All shaders read this. |
halo | Float32Array | Halo intensity [0=off, >0=intensity], per-node |
hidden | Float32Array | Hidden state [0/1, ...] |
highlighted | Float32Array | Highlight state [0/1, ...] |
hovered | Float32Array | Hover state [0/1, ...] |
icons | Float32Array | Icon atlas indices, -1 = none |
iconUVs | Float32Array | SDF icon UV coordinates [u0,v0,u1,v1, ...] × nodeCount, -1 = no icon |
imageIndices | Float32Array | Avatar/image indices, -1 = none |
imageUVs | Float32Array | Image UV coordinates [u0,v0,u1,v1, ...] × nodeCount, -1 = no image |
opacities | Float32Array | Opacities [a1, a2, ...] × nodeCount |
overrides | Float32Array | Bit set of imperatively-set attributes per node (NODE_OVERRIDE bits); the mapper leaves those alone. |
pinned | Float32Array | Pin state [0/1, ...] — see GraphStore.pinNodes / unpinNodes. |
ringColors | Float32Array | Ring border colors [r,g,b, r,g,b, ...] × nodeCount, defaults to node color |
ripple | Float32Array | Ripple intensity [0=off, >0=intensity], per-node |
selected | Float32Array | Selection state [0/1, ...] |
shapeIds | Float32Array | Built-in shape id per node (0 = circle; see core/shapes/reference.ts SHAPE_IDS). |
sizes | Float32Array | User-facing logical sizes [s1, s2, ...] × nodeCount |
suppressFill | Float32Array | Built-in node fill suppression [0/1, ...], per-node. Set by createNodeShaderLayer({ hideBuiltinNode: true }). |
NodeRendererBackend
type NodeRendererBackend = PublicSurface<GPUNodeRenderer>
NodeRippleConfig
interface NodeRippleConfig {
color?: [number, number, number];
duration?: number;
intensity?: number;
loop?: boolean;
rings?: number;
speed?: number;
}
Fields
| | |
|---|
color | [number, number, number] [0.0, 0.9, 1.0] (cyan) | Ripple color as [r,g,b] in 0-1 range. |
duration | number | Duration in milliseconds.
- loop:true → 0 = forever (default); >0 = upper-bounded loop (self-terminates at N ms).
- loop:false → must be > 0; one-shot. |
intensity | number 1.0 | Ripple intensity. |
loop | boolean true (loop until stop()) | Lifecycle mode. ). - true: effect runs until explicitly stopped. Combined with duration > 0, the effect becomes upper-bounded — it loops until duration elapses and then self-terminates (see spec §5.4). - false: effect self-terminates after duration ms. duration must be > 0 (throws at construction otherwise). |
rings | number 3 | Number of concentric rings. |
speed | number 0.5 | Expansion speed. |
NodeSelector
Anything that identifies a set of nodes.
Every mutation method on NodesApi that operates on a subset of nodes
accepts a NodeSelector. The following shapes are all equivalent:
- Single id — a plain string:
api.nodes.hide("n1");
- Array of ids — a
string[] or readonly string[]:api.nodes.hide(["n1", "n2"]);
- Single NodeData object — the object's
.id property is extracted:const node = api.nodes.get("n1")!;
api.nodes.hide(node);
- Array of NodeData objects —
.id is extracted from each element:const nodes = api.nodes.where({ category: "Person" }).toArray();
api.nodes.hide(nodes);
- Object with
ids array — useful when building selectors programmatically:api.nodes.hide({ ids: ["n1", "n2"] });
Accepting all four shapes is deliberate: the caller should never have to
unwrap a record back into an id just to hand it to the next method.
type NodeSelector = string | ReadonlyArray<string> | NodeData | ReadonlyArray<NodeData> | object
NodeShaderAttribute
interface NodeShaderAttribute {
dynamic?: boolean;
name: string;
size: 1 | 2 | 3 | 4;
value: (node: NodeData, index: number) => number | number[];
}
Fields
| | |
|---|
dynamic | boolean | Re-evaluate every frame; default false = refill only on membership change. |
name | string | GLSL attribute name; exposed to the fragment shader as varying v<Name>. |
size | 1 | 2 | 3 | 4 | |
value | (node: NodeData, index: number) => number | number[] | Per-targeted-node value(s). node is the engine NodeData; index is its GPU instance index. |
NodeShaderLayerSpec
interface NodeShaderLayerSpec {
animate?: boolean;
attributes?: NodeShaderAttribute[];
band?: "top" | "underlay" | "overlay";
bandOffset?: number;
blending?: "additive" | "normal";
filter?: (node: NodeData, index: number) => boolean;
followDim?: boolean;
fragmentShader: string;
hideBuiltinNode?: boolean;
hitArea?: "shape" | "circle" | "none" | "quad";
hitMask?: object;
maxNodes?: number;
size?: (node: NodeData, index: number) => number;
sizeFactor?: number;
sizing?: "screen" | "world";
uniforms?: Record<string, UniformValue>;
}
Fields
| | |
|---|
animate | boolean | |
attributes | NodeShaderAttribute[] | |
band | "top" | "underlay" | "overlay" | |
bandOffset | number | |
blending | "additive" | "normal" | |
filter | (node: NodeData, index: number) => boolean | |
followDim | boolean | |
fragmentShader | string | Full void main(){…} (+ helpers). Engine declares the provided varyings/uniforms — do NOT redeclare them. |
hideBuiltinNode | boolean | |
hitArea | "shape" | "circle" | "none" | "quad" | Make the layer's own quads clickable.
The engine's picking pass only rasterises the BUILT-IN node quad, sized
from nodeSize * nodeSizeScale — it knows nothing about sizeFactor. A
layer drawing at sizeFactor: 10 is therefore clickable only on a small
patch at the node centre, which is the single most reported surprise about
custom layers. Set hitArea and the layer registers a second mesh in the
engine's node picking scene, sharing this layer's geometry, so the hitbox
is exactly the quad it draws.
- "none" (default) — legacy behaviour, built-in hitbox only.
- "quad" — the whole billboard, corners included.
- "circle" — the inscribed circle (matches a round panel).
- "shape" — exactly where NodeShaderLayerSpec.hitMask says the
layer drew something. Required for any other outline.
Clicks resolve to the SAME NodePickResult a built-in node click gives, so
selection, hover, context menu and drag all follow with no extra wiring. |
hitMask | object | The clickable region, for hitArea: "shape". sdf is a GLSL expression in
vec2 q (= vUv - 0.5, y up) that is negative where the layer drew
something; prelude is emitted above main for any helper it calls.
A layer is expected to GENERATE this from the same code that drew the
pixels rather than hand-write a second outline — see buildMediaHitMask.
Any varying the expression names (vFoo for attribute foo) is forwarded
into the pick program automatically; nothing else is, so the pick pass
stays as small as the mask needs. |
maxNodes | number | |
size | (node: NodeData, index: number) => number | |
sizeFactor | number | |
sizing | "screen" | "world" | |
uniforms | Record<string, UniformValue> | |
NodeSizeConfig
NodeSizeService - Unified Node Size Calculation
Provides a single source of truth for node size calculations,
replacing hardcoded values scattered across the codebase.
Three-layer size model:
- Logic Size: User-defined size (0.1 - 10.0), stored in node.size
- World Radius: 3D world coordinate radius, used for edge distance calculation
- Screen Size: Final pixel size, computed by shader (perspective projection)
Based on: ai/render-engine-plan/07-nodecloud-optimization.md
interface NodeSizeConfig {
baseWorldRadius: number;
captionFactor: number;
defaultLogicSize: number;
globalScale: number;
imageRadiusExtension: boolean;
imageRadiusMultiplier: number;
referenceScreenHeight: number;
}
Fields
| | |
|---|
baseWorldRadius | number | Base world radius (world coordinate units). Replaces hardcoded 0.03 |
captionFactor | number | Caption factor for screen size calculation |
defaultLogicSize | number | Default logic size (historical value: Math.pow(10, 0.2) ≈ 1.585) |
globalScale | number | Global scale factor from user settings |
imageRadiusExtension | boolean | Whether to extend radius for nodes with images |
imageRadiusMultiplier | number | Image radius extension multiplier |
referenceScreenHeight | number | Reference screen height for screen size scaling |
OrbitShotOptions
interface OrbitShotOptions {
distance?: number;
period?: number;
radius?: number;
reverse?: boolean;
startAngle?: number;
tilt?: number;
turns?: number;
}
Fields
| | |
|---|
distance | number | Distance from the centre. Required unless radius is given. |
period | number | Ms per full revolution. Default 9000. |
radius | number | Bounding radius of the thing being orbited; sets distance if that is absent. |
reverse | boolean | Reverse the sweep. Default false. |
startAngle | number | Where on the circle to start, in radians. Default 0. |
tilt | number | Camera elevation in radians. Default 0.34 (≈20°), looking slightly down. |
turns | number | Revolutions. Infinity (the default) runs until stopped. |