NodeGraphHandle
Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:300
Methods
Section titled “Methods”centerOn()
Section titled “centerOn()”centerOn(
point,zoom?):void
Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:308
Center on a world point, optionally setting zoom.
Parameters
Section titled “Parameters”Point2D
number
Returns
Section titled “Returns”void
fitToContent()
Section titled “fitToContent()”fitToContent(
padding?):void
Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:302
Pan/zoom so all nodes fit inside the viewport with optional padding.
Parameters
Section titled “Parameters”padding?
Section titled “padding?”number
Returns
Section titled “Returns”void
fitToSelection()
Section titled “fitToSelection()”fitToSelection(
padding?):void
Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:304
Pan/zoom so all selected nodes fit. No-op when selection is empty.
Parameters
Section titled “Parameters”padding?
Section titled “padding?”number
Returns
Section titled “Returns”void
focusNode()
Section titled “focusNode()”focusNode(
id):void
Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:306
Center the viewport on a specific node.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
getSize()
Section titled “getSize()”getSize():
ViewportSize
Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:314
Read the current viewport size in CSS pixels.
Returns
Section titled “Returns”getTransform()
Section titled “getTransform()”getTransform():
ViewportTransform
Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:312
Read the current transform.
Returns
Section titled “Returns”invalidate()
Section titled “invalidate()”invalidate(
layerName?):void
Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:324
Force a redraw. With no layerName, all canvas layers redraw on the
next frame; with a name ('edges' | 'groups' | 'preview'), only that
layer redraws.
Parameters
Section titled “Parameters”layerName?
Section titled “layerName?”Returns
Section titled “Returns”void
screenToWorld()
Section titled “screenToWorld()”screenToWorld(
point):Point2D
Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:318
Convert a screen (CSS-pixel) point to a world point.
Parameters
Section titled “Parameters”Point2D
Returns
Section titled “Returns”Point2D
worldToScreen()
Section titled “worldToScreen()”worldToScreen(
point):Point2D
Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:316
Convert a world point to a screen (CSS-pixel) point.
Parameters
Section titled “Parameters”Point2D
Returns
Section titled “Returns”Point2D
zoomToRect()
Section titled “zoomToRect()”zoomToRect(
rect,padding?):void
Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:310
Pan/zoom to fit a world rectangle.
Parameters
Section titled “Parameters”padding?
Section titled “padding?”number
Returns
Section titled “Returns”void