API reference

High-signal summary of published exports. The source of truth for exact callback signatures is the published .d.ts on npm—especially GraphRendererProps / GraphCanvasProps.

This page is a typed overview. For edge cases and exhaustive props, read the generated declarations in your install of @restormel/graph-core and @restormel/ui-graph-svelte, or browse graph-core and ui-graph-svelte on GitHub. What is frozen as Contract v0 (vs out of scope) is summarized in Contract v0 scope.

Core types (@restormel/graph-core/viewModel)

  • GraphDatanodes, edges, ghostNodes, ghostEdges
  • GraphNode, GraphEdge — vertices and directed typed edges
  • GraphGhostNode, GraphGhostEdge — optional rejected / overlay layer
  • GraphViewportCommand, GraphViewportCommandTypefit / reset-layout
  • GraphNodeSemanticStyle, GraphEdgeSemanticStyle — semantic styling maps
  • GraphRendererProps — full canvas prop contract (nodes, edges, ghosts, viewport, selection callbacks, path/focus/dim modes, dimensions, fullscreen toggle, semantic style records, …)

UI exports (@restormel/ui-graph-svelte)

  • GraphCanvas — Svelte component; props align with GraphRendererProps (see published typings for any Omit / extras).
  • GraphCanvasProps — alias of GraphRendererProps for ergonomic imports.
  • NodeDetail — inline detail panel; NodeDetailProps includes node, edges, nodes, position, onClose, optional onJumpToReferences.
  • graphCanvasEdgeKey — stable edge key helper (from:type:to)

GraphCanvas — high-traffic props

One-screen cheat sheet for first integration; exhaustive shapes and optional props live in GraphRendererProps / published index.d.ts.

PropRole
nodes, edgesRequired graph data (arrays; shape from viewModel).
ghostNodes, ghostEdges, showGhostLayerOptional rejected / overlay layer and visibility toggle.
selectedNodeId, onSelectedNodeChange, onNodeSelectControlled selection and selection change callbacks.
viewportCommandImperative fit / reset-layout via GraphViewportCommand + nonce.
nodeSemanticStyles, edgeSemanticStylesMaps keyed by node id and by edge key (graphCanvasEdgeKey).
showInlineDetail, showStatusChip, showViewportControlsUI chrome toggles.
width, height, isFullscreen, onToggleFullscreenLayout and fullscreen affordances.
pinnedNodeIds, pathNodeIds, pathEdgesHighlight / path overlays.
focusNodeIds, focusEdgeIds, dimOutOfScopeFocus mode and dimming outside focus set.
onJumpToReferencesCallback when the user jumps references from detail UI; signature is explicit in published .d.ts.

Why .d.ts matters

Ambiguous or inferred callback types in consuming apps can cause svelte-check friction. The UI package publishes explicit component typings (including callback shapes). If docs and .d.ts disagree, trust published types and file an issue.

← SvelteKit integration · Accessibility & input · Reasoning extensions