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)
GraphData—nodes,edges,ghostNodes,ghostEdgesGraphNode,GraphEdge— vertices and directed typed edgesGraphGhostNode,GraphGhostEdge— optional rejected / overlay layerGraphViewportCommand,GraphViewportCommandType—fit/reset-layoutGraphNodeSemanticStyle,GraphEdgeSemanticStyle— semantic styling mapsGraphRendererProps— 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 withGraphRendererProps(see published typings for anyOmit/ extras).GraphCanvasProps— alias ofGraphRendererPropsfor ergonomic imports.NodeDetail— inline detail panel;NodeDetailPropsincludesnode,edges,nodes,position,onClose, optionalonJumpToReferences.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.
| Prop | Role |
|---|---|
nodes, edges | Required graph data (arrays; shape from viewModel). |
ghostNodes, ghostEdges, showGhostLayer | Optional rejected / overlay layer and visibility toggle. |
selectedNodeId, onSelectedNodeChange, onNodeSelect | Controlled selection and selection change callbacks. |
viewportCommand | Imperative fit / reset-layout via GraphViewportCommand + nonce. |
nodeSemanticStyles, edgeSemanticStyles | Maps keyed by node id and by edge key (graphCanvasEdgeKey). |
showInlineDetail, showStatusChip, showViewportControls | UI chrome toggles. |
width, height, isFullscreen, onToggleFullscreen | Layout and fullscreen affordances. |
pinnedNodeIds, pathNodeIds, pathEdges | Highlight / path overlays. |
focusNodeIds, focusEdgeIds, dimOutOfScope | Focus mode and dimming outside focus set. |
onJumpToReferences | Callback 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