ViewportApi<T> extension
Viewport operations for NodeFlowController.
This extension provides methods for:
- Viewport state management (get/set viewport, zoom, pan)
- Coordinate transformations (screen ↔ graph) using typed coordinates
- Navigation (center, fit to view, focus on nodes)
- Visibility queries (is point/rect visible)
- Screen and mouse position tracking
All coordinate methods use typed extension types (GraphPosition, ScreenPosition, GraphRect) to prevent accidentally mixing coordinate spaces.
- on
Properties
- currentPan → ScreenOffset
-
Available on NodeFlowController<
Gets the current pan position of the viewport.T> , provided by the ViewportApi extensionno setter - currentZoom → double
-
Available on NodeFlowController<
Gets the current zoom level of the viewport.T> , provided by the ViewportApi extensionno setter - mousePositionWorld → GraphPosition?
-
Available on NodeFlowController<
Gets the current mouse position in graph coordinates.T> , provided by the ViewportApi extensionno setter - selectedNodesBounds → GraphRect?
-
Available on NodeFlowController<
Gets the bounding rectangle that encompasses all selected nodes in graph coordinates.T> , provided by the ViewportApi extensionno setter - viewportExtent → GraphRect
-
Available on NodeFlowController<
Gets the viewport extent as a GraphRect in graph coordinates.T> , provided by the ViewportApi extensionno setter - viewportScreenBounds → ScreenRect
-
Available on NodeFlowController<
Gets the viewport extent as a ScreenRect in screen coordinates.T> , provided by the ViewportApi extensionno setter
Methods
-
centerOn(
GraphOffset point) → void -
Available on NodeFlowController<
Centers the viewport on a specific point in graph coordinates without changing zoom.T> , provided by the ViewportApi extension -
centerOnNode(
String nodeId) → void -
Available on NodeFlowController<
Centers the viewport on a specific node without changing the zoom level.T> , provided by the ViewportApi extension -
centerOnSelection(
) → void -
Available on NodeFlowController<
Centers the viewport on the center point of all selected nodes without changing zoom.T> , provided by the ViewportApi extension -
centerViewport(
) → void -
Available on NodeFlowController<
Centers the viewport on the geometric center of all nodes without changing zoom.T> , provided by the ViewportApi extension -
fitSelectedNodes(
) → void -
Available on NodeFlowController<
Adjusts the viewport to fit all selected nodes in the view with padding.T> , provided by the ViewportApi extension -
fitToView(
) → void -
Available on NodeFlowController<
Adjusts the viewport to fit all nodes in the view with padding.T> , provided by the ViewportApi extension -
getViewportCenter(
) → GraphPosition -
Available on NodeFlowController<
Gets the center point of the current viewport in graph coordinates.T> , provided by the ViewportApi extension -
globalToGraph(
ScreenPosition globalPosition) → GraphPosition -
Available on NodeFlowController<
Converts a global screen position to graph coordinates.T> , provided by the ViewportApi extension -
graphToScreen(
GraphPosition graphPoint) → ScreenPosition -
Available on NodeFlowController<
Converts a graph coordinate point to screen coordinates.T> , provided by the ViewportApi extension -
isPointVisible(
GraphPosition graphPoint) → bool -
Available on NodeFlowController<
Checks if a graph coordinate point is visible in the current viewport.T> , provided by the ViewportApi extension -
isRectVisible(
GraphRect graphRect) → bool -
Available on NodeFlowController<
Checks if a graph coordinate rectangle intersects with the viewport.T> , provided by the ViewportApi extension -
panBy(
ScreenOffset delta) → void -
Available on NodeFlowController<
Pans the viewport by a delta offset.T> , provided by the ViewportApi extension -
resetViewport(
) → void -
Available on NodeFlowController<
Resets the viewport to zoom 1.0 and centers on all nodes in the graph.T> , provided by the ViewportApi extension -
screenToGraph(
ScreenPosition screenPoint) → GraphPosition -
Available on NodeFlowController<
Converts a screen coordinate point to graph coordinates.T> , provided by the ViewportApi extension -
setMousePositionWorld(
GraphPosition? position) → void -
Available on NodeFlowController<
Updates the mouse position in graph coordinates.T> , provided by the ViewportApi extension -
setScreenSize(
Size size) → void -
Available on NodeFlowController<
Sets the screen size used for viewport calculations.T> , provided by the ViewportApi extension -
setViewport(
GraphViewport viewport) → void -
Available on NodeFlowController<
Sets the viewport to a specific position and zoom level.T> , provided by the ViewportApi extension -
zoomBy(
double delta) → void -
Available on NodeFlowController<
Zoom the viewport by a delta value while maintaining the viewport center as the focal point.T> , provided by the ViewportApi extension -
zoomTo(
double zoom) → void -
Available on NodeFlowController<
Sets the viewport zoom to a specific value.T> , provided by the ViewportApi extension