Function: useNode ​
â–¸ useNode<Data
, CustomEvents
>(id?
): Object
Composable that provides access to a node object, parent node object, connected edges and it's dom element
If no node id is provided, the node id is injected from context
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 ​
Name | Type |
---|---|
Data | any |
CustomEvents | extends Record <string , CustomEvent <any [], any >> = any |
Parameters ​
Name | Type | Description |
---|---|---|
id? | string | The id of the node to access |
Returns ​
Object
the node id, the node, the node dom element, it's parent and connected edges
Name | Type |
---|---|
connectedEdges | ComputedRef <GraphEdge <any , any , string >[]> |
id | string |
node | GraphNode <Data , CustomEvents , string > |
nodeEl | Ref <null | HTMLDivElement > |
parentNode | ComputedRef <undefined | GraphNode <any , any , string >> |