types

Types: M–O

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

charsMapRecord<string, MSDFGlyph>
commonobject
distanceField object
infoobject
kerningsMapRecord<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
chnlnumber
heightnumber
idnumber
pagenumber
widthnumber
xnumber
xadvancenumber
xoffsetnumber
ynumber
yoffsetnumber

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 | objectAuto-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 TileUrlFnCustom 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

attributionstringAttribution text (for compliance)
descriptionstringShort description
maxZoomnumberMaximum supported zoom level
namestringDisplay name for UI
requiresKeybooleanWhether this provider requires an API key
tileUrlTileUrlFnThe 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 stringAttribution text (for compliance).
descriptionstringShort description.
keystringUnique string key used to select this provider.
maxZoom number
18
Maximum supported zoom level.
minZoom number
0
Minimum supported zoom level.
namestringHuman-readable name for UI display.
requiresConfig booleanWhether this provider requires an API key or config.
thumbnail stringOptional preview thumbnail URL for UI selector.
tileUrlTileUrlFn | (config: Record<string, string>) => TileUrlFnThe tile URL function or a factory that produces one.

MapTransitionConfig

interface MapTransitionConfig {
  crossfadeDuration?: number;
}

Fields

crossfadeDuration number

MapTransitionMode

type MapTransitionMode = "planar" | "spherical"

MarkerLayerProps

interface MarkerLayerProps {
  markers: MarkerSpec[];
}

Fields

markersMarkerSpec[]The markers to animate. Each rides one edge from source → target.

MarkerRendererConfig

interface MarkerRendererConfig {
  markers: MarkerSpec[];
}

Fields

markersMarkerSpec[]

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 numberTime to traverse the edge once, ms; default 4000.
edgeIdstringEdge whose endpoints the marker travels between.
icon stringIcon name resolved via iconAtlasManager.ensureIcon; omitted → soft dot/triangle.
iconAngleOffset numberRadians added to the tangent angle (align the glyph); default 0.
key stringStable 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 booleanRotate icon to the path tangent; default false.
phaseOffset numberInitial 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 numberDevice-px diameter; default 24.
trailLength numberComet-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>
propertystring
regex RegExp

MediaAtlasOptions

interface MediaAtlasOptions {
  aspect?: number;
  capacity?: number;
  cellHeight?: number;
  crossOrigin?: string;
  fit?: "cover" | "contain";
}

Fields

aspect numberCell width / height. Default 1.
capacity numberCells to reserve. Rounded up to a grid. Default 16.
cellHeight numberCell height in pixels. Default 256.
crossOrigin stringcrossOrigin 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".

MediaCrop

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 numberHorizontal centre of the shown region, 0..1. Default 0.5.
y numberVertical centre, 0..1. Default 0.5.
zoom numberFraction of the frame height shown. 1 = whole frame. Default 1.

MediaEffects

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 numberInner dark frame, in panel heights (0.03 ≈ a monitor bezel).
bloom numberHighlight lift, 0..1.
dropout numberOccasional full-panel signal dropout, 0..1. Needs animate.
fringe numberChromatic aberration, in panel widths (0.004 is a strong fringe).
glitch numberRolling horizontal tear, 0..1. Needs animate.
grayscale numberDesaturation, 0..1.
grille numberVertical aperture grille, 0..1. Pairs with scanlines.
hologram numberScanning hologram bands, 0..1. Needs animate.
scanlines numberHorizontal CRT scanlines, 0..1.
sweep numberTravelling brightness sweep, 0..1. Needs animate.
vignette numberCorner darkening, 0..1.

MediaFit

type MediaFit = "cover" | "contain"

MediaLayerConfig

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 numberBump to re-read image / crop for every targeted node. Changed URLs are reloaded into their existing atlas cell — no remount, no flicker.
tint ColorRepresentation

MediaLayerProps

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 numberPanel width / height. Default 1. shape: "circle" assumes 1.
band "top" | "underlay" | "overlay"
bandOffset number
border numberOutline thickness in panel heights. Default 0.
borderColor ColorRepresentation
clickable booleanMake 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 stringcrossOrigin for images. Default "anonymous"; null disables it.
customSdf stringOutline 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 booleanHide the built-in node dot under the panel. Default true.
image (node: NodeData, index: number) => stringStill-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 numberAtlas cells to reserve. Default 36. Raise for more distinct images.
imageResolution numberAtlas cell height in px. Default 256.
maxNodes numberMax nodes the layer draws. Default 256.
name stringDistinct name per mounted MediaLayer. Default "media-layer".
onVideoSource (source: MediaVideoSource) => voidHands 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 numberCorner radius in panel heights, 0..0.5. Default 0.06 for rect.
revision numberBump 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) => numberOverride the node size the panel is scaled from.
sizeFactor numberPanel size multiplier over the node's own size. Default 3.
tint ColorRepresentation
video MediaVideoSpecOne shared video feed. Decoded once however many nodes show it.

MediaLayerSpec

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 numberPanel width / height. Default 1. shape: "circle" assumes 1.
band "top" | "underlay" | "overlay"
bandOffset number
border numberOutline thickness in panel heights. Default 0.
borderColor ColorRepresentation
clickable booleanMake 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 stringcrossOrigin for images. Default "anonymous"; null disables it.
customSdf stringOutline 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 booleanHide the built-in node dot under the panel. Default true.
image (node: NodeData, index: number) => stringStill-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 numberAtlas cells to reserve. Default 36. Raise for more distinct images.
imageResolution numberAtlas cell height in px. Default 256.
maxNodes numberMax nodes the layer draws. Default 256.
onVideoSource (source: MediaVideoSource) => voidHands 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 numberCorner 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) => numberOverride the node size the panel is scaled from.
sizeFactor numberPanel size multiplier over the node's own size. Default 3.
tint ColorRepresentation
video MediaVideoSpecOne shared video feed. Decoded once however many nodes show it.

MediaShape

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"

MediaTile

[u0, v0, u1, v1] in texture space (v up), half-texel inset.

type MediaTile = [number, number, number, number]

MediaVideoOptions

interface MediaVideoOptions {
  autoplay?: boolean;
  crossOrigin?: string;
  loop?: boolean;
  muted?: boolean;
  playbackRate?: number;
  preload?: "auto" | "none" | "metadata";
  url: string;
}

Fields

autoplay booleanDefault true.
crossOrigin stringDefault "anonymous". Without it a cross-origin frame cannot be uploaded and the failure surfaces as a blank panel with no error.
loop booleanDefault true.
muted booleanDefault true. Autoplay is blocked for audible video in every browser.
playbackRate number
preload "auto" | "none" | "metadata"preload attribute. Default "auto".
urlstring

MediaVideoSpec

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) => MediaCropWhich 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
urlstring

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 stringRight-clicked edge ID (if type === "edge")
engine RenderEngineApiFull engine API for items needing camera/history/style/selection. engine.store === store.
interaction InteractionManagerInteraction manager for programmatic edge/node creation (Add Edge / Add Node menu actions).
intl objectOptional intl shape so item label functions can resolve translations.
mode SceneModeCurrent scene mode for mode-aware predicates.
nodeId stringRight-clicked node ID (if type === "node")
screenPositionobjectScreen position where the menu should appear
selectedEdgeIdsstring[]All currently selected edge IDs
selectedNodeIdsstring[]All currently selected node IDs
storeGraphStoreThe GraphStore for querying data
type"node" | "edge" | "background"What was right-clicked
worldPos object3D 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

idstringUnique group ID, e.g. "info", "expand", "layout"
ordernumberSort 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) => voidAction when clicked
children MenuItem[] | (ctx: MenuContext) => Promise<MenuItem[]>Static or async children for submenus
danger booleanMark as danger item (red text styling)
enabled (ctx: MenuContext) => boolean
true
Whether this item is enabled/clickable
groupstringGroup this item belongs to
icon string | IconSpecOptional icon: legacy name string OR structured IconSpec for gxr/component/svg icons
idstringUnique ID with namespace, e.g. "core.expand", "custom.exportCSV"
labelstring | (ctx: MenuContext) => stringDisplay label — string or dynamic function
ordernumberSort order within the group
shortcut stringDisplay-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 PositionProviderExternal 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"
edgeIdstring
nodeIdstring

NodeBreatheConfig

interface NodeBreatheConfig {
  amplitude?: number;
  duration?: number;
  loop?: boolean;
}

Fields

amplitude number
1.0
Breathe amplitude.
duration numberDuration 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

captionsCaptionDef[]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

atlasMediaAtlasDestination. Its cell size is the card size.
context CanvasRenderingContext2DScratch 2D context. Defaults to a fresh canvas; tests inject a recorder.
crossOrigin stringcrossOrigin for photos. Default "anonymous"; null disables it.
loadPhoto (url: string) => Promise<NodeCardPhoto>Photo loader. Defaults to an <img> decode; tests inject a resolver.
onRepaint () => voidCalled 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 booleanDraw the value in the accent colour — a flag, a risk level, a match.
labelstring
valuestring

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 numberBump 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 numberCard width / height. Default 1.5.
band "top" | "underlay" | "overlay"
bandOffset number
border numberOutline thickness in card heights. Default 0.
borderColor ColorRepresentation
capacity numberCells to reserve. Default 36. Nodes past it draw no card.
card (node: NodeData, index: number) => NodeCardSpecThe 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 booleanClickable over the whole card. Default true.
crossOrigin stringcrossOrigin for photos. Default "anonymous"; null disables it.
customSdf stringOutline from a GLSL signed-distance expression in vec2 q. See MediaLayer.
effects MediaEffectsPanel effects (vignette, scanlines, hologram…). Default none.
filter (node: NodeData, index: number) => boolean
all of them
Nodes this layer may touch at all.
hideBuiltinNode booleanHide the built-in node dot under the card. Default true.
maxNodes numberMax nodes the layer draws. Default 64.
name stringDistinct name per mounted NodeCardLayer. Default "node-card-layer".
opacity number
paint (g: CanvasRenderingContext2D, node: NodeData, size: NodeCardSize, index: number) => voidDraw 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 numberCorner radius in card heights, 0..0.5. Default 0.03.
resolution numberCard 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 numberBump 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) => numberOverride the node size the card is scaled from.
sizeFactor numberCard size multiplier over the node's own size. Default 9.
theme NodeCardThemeColours, 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

cardCacheNodeCardCacheThe 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 numberCard width / height. Default 1.5.
band "top" | "underlay" | "overlay"
bandOffset number
border numberOutline thickness in card heights. Default 0.
borderColor ColorRepresentation
capacity numberCells to reserve. Default 36. Nodes past it draw no card.
card (node: NodeData, index: number) => NodeCardSpecThe 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 booleanClickable over the whole card. Default true.
crossOrigin stringcrossOrigin for photos. Default "anonymous"; null disables it.
customSdf stringOutline from a GLSL signed-distance expression in vec2 q. See MediaLayer.
effects MediaEffectsPanel effects (vignette, scanlines, hologram…). Default none.
filter (node: NodeData, index: number) => boolean
all of them
Nodes this layer may touch at all.
hideBuiltinNode booleanHide the built-in node dot under the card. Default true.
maxNodes numberMax nodes the layer draws. Default 64.
opacity number
paint (g: CanvasRenderingContext2D, node: NodeData, size: NodeCardSize, index: number) => voidDraw 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 numberCorner radius in card heights, 0..0.5. Default 0.03.
resolution numberCard 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) => numberOverride the node size the card is scaled from.
sizeFactor numberCard size multiplier over the node's own size. Default 9.
theme NodeCardThemeColours, 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

heightnumber
sourceCanvasImageSource
widthnumber

NodeCardSize

interface NodeCardSize {
  height: number;
  width: number;
}

Fields

heightnumber
widthnumber

NodeCardSpec

interface NodeCardSpec {
  accent?: string;
  badges?: string[];
  fields?: NodeCardField[];
  footer?: string;
  image?: string;
  stamp?: string;
  subtitle?: string;
  title?: string;
}

Fields

accent stringPer-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 stringBottom strip, in the muted colour.
image stringPhoto URL. Loaded and composited into the card's frame.
stamp stringBig rotated overprint, e.g. "CLASSIFIED".
subtitle stringRight of the headline, smaller — a category, a case id.
title stringHeadline, 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 stringHeader band, accented values, stamp.
accentText stringHeader text colour, on the accent band.
background string
border numberHairline round the card. 0 = none. Fraction of height. Default 0.006.
borderColor string
font string
foreground string
header numberHeader band height, as a fraction of height. 0 = no band. Default 0.15.
labelFont stringLabels, badges and the stamp. Defaults to font.
muted stringLabels, footer, rules.
padding numberInset, as a fraction of height. Default 0.055.
photo "left" | "top" | "none"Where the photo sits. Default "left".
photoSize numberPhoto box size: a fraction of the card WIDTH when photo: "left", of its HEIGHT when photo: "top". Default 0.34.
rowHeight numberRow pitch, as a fraction of height. Default 0.082.
rules booleanHairline 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 TextureAvatar array texture (WebGL2)
defaultNodeSize numberDefault node size for nodes without explicit size. Applied to store.defaultNodeSize.
fixedSize numberFixed size mode: 0 = perspective scaling (default), >0 = fixed size multiplier (no distance scaling)
hidePin booleanHide pin indicators
hideRing booleanHide ring effects
iconAtlas TextureIcon atlas texture
iconColumns numberIcon atlas columns
iconDisplayMode numberIcon display mode: 0=filled (white icon on color), 1=ring-only, 2=plain (no ring/fill)
iconMode numberIcon mode: 1=transparent bg, 2=icon transparent, 3=additive
lightMode booleanLight mode affects ring brightness
maxNodes numberMaximum number of nodes (for buffer pre-allocation)
nodeSizeScale number
1.0
Global node size scale multiplier Scales all nodes uniformly via shader uniform.
pinTexture TexturePin indicator texture
positionProvider PositionProviderPosition provider (for GPU/CPU position sources)
useCircle booleanUse 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 TextureAvatar array texture (WebGL2)
defaultNodeSize numberDefault node size for nodes without explicit size. Applied to store.defaultNodeSize.
fixedSize numberFixed size mode: 0 = perspective scaling (default), >0 = fixed size multiplier (no distance scaling)
hidePin booleanHide pin indicators
hideRing booleanHide ring effects
iconAtlas TextureIcon atlas texture
iconColumns numberIcon atlas columns
iconDisplayMode numberIcon display mode: 0=filled (white icon on color), 1=ring-only, 2=plain (no ring/fill)
iconMode numberIcon mode: 1=transparent bg, 2=icon transparent, 3=additive
lightMode booleanLight mode affects ring brightness
maxNodes numberMaximum 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) => voidCallback when renderer is ready
pinTexture TexturePin indicator texture
positionProvider PositionProviderPosition provider (for GPU/CPU position sources)
theme "dark" | "light"Override theme for nodes: 'dark' = dark ring style, 'light' = light ring style
useCircle booleanUse circular nodes

NodeData

interface NodeData {
  category: string;
  id: string;
  labels?: string[];
  properties: Record<string, PropertyValue>;
  tags?: string[];
}

Fields

categorystring
idstring
labels string[]
propertiesRecord<string, PropertyValue>
tags string[]

NodeDefinition

interface NodeDefinition {
  data: NodeData;
  group: "nodes";
  position?: object;
  selected?: boolean;
}

Fields

dataNodeData
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.
draggedNodeIdsstring[]All node IDs being dragged (multi-select drag includes the full set; single drag has one).
modifiersPointerModifiersModifier-key state at event time.
nodeIdstring
originalEventMouseEventNative 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
targetNodeData
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 booleanAccepted for backward-compat; theme is driven by data-gxr-theme tokens.
locale stringUI language. Selects the built-in en / zh / es bundle. Default en.
managerNodeInfoManager
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) => voidHost callback invoked when the "Expand neighbors" button is clicked.
showExpandNeighbors booleanShow the footer "Expand neighbors" button. Default false (hidden).
storeGraphStore

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

nodeIdstring
positionobject
visibleboolean

NodeInput

interface NodeInput {
  category: string;
  id?: string;
  labels?: string[];
  position?: object;
  properties?: Record<string, PropertyValue>;
}

Fields

categorystring
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
sizenumber

NodePickResult

interface NodePickResult {
  index: number;
  ndcPosition: object;
  node: NodeData;
  nodeId: string;
  picked: boolean;
  screenPosition: object;
  type: "node";
}

Fields

indexnumberIndex in the GPU buffer (-1 for background)
ndcPositionobjectNormalized device coordinates (-1 to 1)
nodeNodeData
nodeIdstring
pickedbooleanWhether something was picked (not background)
screenPositionobjectScreen position of pick
type"node"What was picked

NodePinPatch

interface NodePinPatch {
  id: string;
  pinned: boolean;
  position?: Position3D;
}

Fields

idstring
pinnedboolean
position Position3D

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.
modifiersPointerModifiersModifier-key state at event time.
nodeIdstring
originalEventMouseEventNative 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

idstring
positionPosition3D

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 numberMaximum 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

aspectsFloat32ArrayWidth / height ratio per node (1 = square box; height = size / aspect).
breatheFloat32ArrayBreathe amplitude [0=off, >0=amplitude], per-node
collectionFloat32ArrayCollection mode [0/1, ...] — 1.0 if node is a collection
colorsFloat32ArrayColors [r,g,b, r,g,b, ...] × nodeCount
effectiveSizesFloat32ArrayGPU-facing scaled sizes (= sizes[i] * globalNodeSizeScale). All shaders read this.
haloFloat32ArrayHalo intensity [0=off, >0=intensity], per-node
hiddenFloat32ArrayHidden state [0/1, ...]
highlightedFloat32ArrayHighlight state [0/1, ...]
hoveredFloat32ArrayHover state [0/1, ...]
iconsFloat32ArrayIcon atlas indices, -1 = none
iconUVsFloat32ArraySDF icon UV coordinates [u0,v0,u1,v1, ...] × nodeCount, -1 = no icon
imageIndicesFloat32ArrayAvatar/image indices, -1 = none
imageUVsFloat32ArrayImage UV coordinates [u0,v0,u1,v1, ...] × nodeCount, -1 = no image
opacitiesFloat32ArrayOpacities [a1, a2, ...] × nodeCount
overridesFloat32ArrayBit set of imperatively-set attributes per node (NODE_OVERRIDE bits); the mapper leaves those alone.
pinnedFloat32ArrayPin state [0/1, ...] — see GraphStore.pinNodes / unpinNodes.
ringColors Float32ArrayRing border colors [r,g,b, r,g,b, ...] × nodeCount, defaults to node color
rippleFloat32ArrayRipple intensity [0=off, >0=intensity], per-node
selectedFloat32ArraySelection state [0/1, ...]
shapeIdsFloat32ArrayBuilt-in shape id per node (0 = circle; see core/shapes/reference.ts SHAPE_IDS).
sizesFloat32ArrayUser-facing logical sizes [s1, s2, ...] × nodeCount
suppressFillFloat32ArrayBuilt-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 numberDuration 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 booleanRe-evaluate every frame; default false = refill only on membership change.
namestringGLSL attribute name; exposed to the fragment shader as varying v<Name>.
size1 | 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
fragmentShaderstringFull 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 objectThe 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:

  1. Logic Size: User-defined size (0.1 - 10.0), stored in node.size
  2. World Radius: 3D world coordinate radius, used for edge distance calculation
  3. 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

baseWorldRadiusnumberBase world radius (world coordinate units). Replaces hardcoded 0.03
captionFactornumberCaption factor for screen size calculation
defaultLogicSizenumberDefault logic size (historical value: Math.pow(10, 0.2) ≈ 1.585)
globalScalenumberGlobal scale factor from user settings
imageRadiusExtensionbooleanWhether to extend radius for nodes with images
imageRadiusMultipliernumberImage radius extension multiplier
referenceScreenHeightnumberReference 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 numberDistance from the centre. Required unless radius is given.
period numberMs per full revolution. Default 9000.
radius numberBounding radius of the thing being orbited; sets distance if that is absent.
reverse booleanReverse the sweep. Default false.
startAngle numberWhere on the circle to start, in radians. Default 0.
tilt numberCamera elevation in radians. Default 0.34 (≈20°), looking slightly down.
turns numberRevolutions. Infinity (the default) runs until stopped.