Skip to content

NodeGraphHandle

Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:300

Methods

centerOn()

centerOn(point, zoom?): void

Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:308

Center on a world point, optionally setting zoom.

Parameters

point

Point2D

zoom?

number

Returns

void


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

padding?

number

Returns

void


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

padding?

number

Returns

void


focusNode()

focusNode(id): void

Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:306

Center the viewport on a specific node.

Parameters

id

string

Returns

void


getSize()

getSize(): ViewportSize

Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:314

Read the current viewport size in CSS pixels.

Returns

ViewportSize


getTransform()

getTransform(): ViewportTransform

Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:312

Read the current transform.

Returns

ViewportTransform


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

layerName?

NodeGraphLayerName

Returns

void


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

point

Point2D

Returns

Point2D


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

point

Point2D

Returns

Point2D


zoomToRect()

zoomToRect(rect, padding?): void

Defined in: src/components/editor/NodeGraph/NodeGraph.types.ts:310

Pan/zoom to fit a world rectangle.

Parameters

rect

WorldRect

padding?

number

Returns

void