@vue-flow/monorepo β’ Docs
Interface: Actions β
Extends β
Omit
<ViewportHelper
,"viewportInitialized"
>
Properties β
$destroy() β
$destroy: () =>
void
remove store instance from global storage and destroy it (will invalidate effect scopes)
Returns β
void
$reset() β
$reset: () =>
void
reset state to defaults
Returns β
void
addEdges β
addEdges:
AddEdges
parses edges and adds to state
addNodes β
addNodes:
AddNodes
parses nodes and adds to state
addSelectedEdges() β
addSelectedEdges: (
edges
) =>void
manually select edges and add to state
Parameters β
β’ edges: GraphEdge
[]
Returns β
void
addSelectedElements() β
addSelectedElements: (
elements
) =>void
manually select elements and add to state
Parameters β
β’ elements: FlowElements
Returns β
void
Deprecated β
will be removed in the next major, use Actions.addSelectedNodes or Actions.addSelectedEdges instead
addSelectedNodes() β
addSelectedNodes: (
nodes
) =>void
manually select nodes and add to state
Parameters β
β’ nodes: GraphNode
<any
, any
, string
>[]
Returns β
void
applyEdgeChanges() β
applyEdgeChanges: (
changes
) =>GraphEdge
[]
applies default edge change handler
Parameters β
β’ changes: EdgeChange
[]
Returns β
applyNodeChanges() β
applyNodeChanges: (
changes
) =>GraphNode
<any
,any
,string
>[]
applies default node change handler
Parameters β
β’ changes: NodeChange
[]
Returns β
GraphNode
<any
, any
, string
>[]
endConnection() β
endConnection: (
event
?,isClick
?) =>void
end (or cancel) a connection
Parameters β
β’ event?: MouseEvent
| TouchEvent
β’ isClick?: boolean
Returns β
void
findEdge β
findEdge:
FindEdge
find an edge by id
findNode β
findNode:
FindNode
find a node by id
fitBounds β
fitBounds:
FitBounds
Inherited from β
Omit.fitBounds
fitView β
fitView:
FitView
Inherited from β
Omit.fitView
flowToScreenCoordinate β
flowToScreenCoordinate:
Project
Inherited from β
Omit.flowToScreenCoordinate
fromObject() β
fromObject: (
obj
) =>Promise
<boolean
>
load graph from export obj
Parameters β
β’ obj: FlowExportObject
Returns β
Promise
<boolean
>
getConnectedEdges() β
getConnectedEdges: (
nodesOrId
) =>GraphEdge
[]
get a node's connected edges
Parameters β
β’ nodesOrId: string
| Node
<any
, any
, string
>[]
Returns β
getHandleConnections() β
getHandleConnections: (
__namedParameters
) =>HandleConnection
[]
get all connections of a handle belonging to a node
Parameters β
β’ __namedParameters
β’ __namedParameters.id?: null
| string
β’ __namedParameters.nodeId: string
β’ __namedParameters.type: HandleType
Returns β
getIncomers() β
getIncomers: (
nodeOrId
) =>GraphNode
<any
,any
,string
>[]
get a node's incomers
Parameters β
β’ nodeOrId: string
| Node
<any
, any
, string
>
Returns β
GraphNode
<any
, any
, string
>[]
getIntersectingNodes β
getIntersectingNodes:
GetIntersectingNodes
returns all node intersections
getOutgoers() β
getOutgoers: (
nodeOrId
) =>GraphNode
<any
,any
,string
>[]
get a node's outgoers
Parameters β
β’ nodeOrId: string
| Node
<any
, any
, string
>
Returns β
GraphNode
<any
, any
, string
>[]
getTransform β
getTransform:
GetViewport
Deprecated β
use getViewport instead
Inherited from β
Omit.getTransform
getViewport β
getViewport:
GetViewport
Inherited from β
Omit.getViewport
isNodeIntersecting β
isNodeIntersecting:
IsNodeIntersecting
check if a node is intersecting with a defined area
panBy() β
panBy: (
delta
) =>boolean
pan the viewport; return indicates if a transform has happened or not
Parameters β
β’ delta: XYPosition
Returns β
boolean
project β
project:
Project
Inherited from β
Omit.project
removeEdges β
removeEdges:
RemoveEdges
remove edges from state
removeNodes β
removeNodes:
RemoveNodes
remove nodes (and possibly connected edges and children) from state
removeSelectedEdges() β
removeSelectedEdges: (
edges
) =>void
manually unselect edges and remove from state
Parameters β
β’ edges: GraphEdge
[]
Returns β
void
removeSelectedElements() β
removeSelectedElements: (
elements
?) =>void
unselect selected elements (if none are passed, all elements are unselected)
Parameters β
β’ elements?: Elements
Returns β
void
removeSelectedNodes() β
removeSelectedNodes: (
nodes
) =>void
manually unselect nodes and remove from state
Parameters β
β’ nodes: GraphNode
<any
, any
, string
>[]
Returns β
void
screenToFlowCoordinate β
screenToFlowCoordinate:
Project
Inherited from β
Omit.screenToFlowCoordinate
setCenter β
setCenter:
SetCenter
Inherited from β
Omit.setCenter
setEdges β
setEdges:
SetEdges
parses edges and re-sets the state
setElements β
setElements:
SetElements
parses elements (nodes + edges) and re-sets the state
setInteractive() β
setInteractive: (
isInteractive
) =>void
enable/disable node interaction (dragging, selecting etc)
Parameters β
β’ isInteractive: boolean
Returns β
void
setMaxZoom() β
setMaxZoom: (
zoom
) =>void
apply max zoom value to d3
Parameters β
β’ zoom: number
Returns β
void
setMinZoom() β
setMinZoom: (
zoom
) =>void
apply min zoom value to d3
Parameters β
β’ zoom: number
Returns β
void
setNodeExtent() β
setNodeExtent: (
nodeExtent
) =>void
apply extent to nodes
Parameters β
β’ nodeExtent: CoordinateExtent
| CoordinateExtentRange
Returns β
void
setNodes β
setNodes:
SetNodes
parses nodes and re-sets the state
setPaneClickDistance() β
setPaneClickDistance: (
distance
) =>void
Parameters β
β’ distance: number
Returns β
void
setState β
setState:
SetState
set new state
setTransform β
setTransform:
SetViewport
Deprecated β
use setViewport instead
Inherited from β
Omit.setTransform
setTranslateExtent() β
setTranslateExtent: (
translateExtent
) =>void
apply translate extent to d3
Parameters β
β’ translateExtent: CoordinateExtent
Returns β
void
setViewport β
setViewport:
SetViewport
Inherited from β
Omit.setViewport
startConnection() β
startConnection: (
startHandle
,position
?,isClick
?) =>void
start a connection
Parameters β
β’ startHandle: ConnectingHandle
β’ position?: XYPosition
β’ isClick?: boolean
Returns β
void
toObject() β
toObject: () =>
FlowExportObject
return an object of graph values (elements, viewport transform) for storage and re-loading a graph
Returns β
updateConnection() β
updateConnection: (
position
,result
?,status
?) =>void
update connection position
Parameters β
β’ position: XYPosition
β’ result?: null
| ConnectingHandle
β’ status?: null
| ConnectionStatus
Returns β
void
updateEdge β
updateEdge:
UpdateEdge
updates an edge
updateEdgeData β
updateEdgeData:
UpdateEdgeData
updates the data of an edge
updateNode β
updateNode:
UpdateNode
updates a node
updateNodeData β
updateNodeData:
UpdateNodeData
updates the data of a node
updateNodeDimensions β
updateNodeDimensions:
UpdateNodeDimensions
internal dimensions' updater, you probably don't want to use this
updateNodeInternals β
updateNodeInternals:
UpdateNodeInternals
force update node internal data, if handle bounds are incorrect, you might want to use this
updateNodePositions β
updateNodePositions:
UpdateNodePosition
internal position updater, you probably don't want to use this
viewportHelper β
viewportHelper:
ComputedRef
<ViewportHelper
>
viewport helper instance
zoomIn β
zoomIn:
ZoomInOut
Inherited from β
Omit.zoomIn
zoomOut β
zoomOut:
ZoomInOut
Inherited from β
Omit.zoomOut
zoomTo β
zoomTo:
ZoomTo
Inherited from β
Omit.zoomTo