Skip to content

Function: useNode

â–¸ useNode<T>(id?): Object

Access a node, it's parent (if one exists) and connected edges

If no node id is provided, the node id is injected from context

Meaning if you do not provide an id, this composable has to be called in a child of your custom node component, or it will throw

Type parameters

NameType
Textends GraphNode<any, any, string, T> = GraphNode<any, any, string>

Parameters

NameType
id?string

Returns

Object

NameType
connectedEdgesComputedRef<GraphEdge<any, any, string>[]>
idstring
nodeT
nodeElnull | Ref<HTMLDivElement>
parentNodeComputedRef<undefined | GraphNode<any, any, string>>

Released under the MIT License.