diff --git a/docs/src/guide/edge.md b/docs/src/guide/edge.md
index 45dad5d9..7c12cdf9 100644
--- a/docs/src/guide/edge.md
+++ b/docs/src/guide/edge.md
@@ -164,9 +164,7 @@ through [useVueFlow](/typedocs/functions/useVueFlow), allowing you to add edges
What's more, this action isn't limited to the component rendering the graph; it can be utilized elsewhere, like in a
Sidebar or Toolbar.
-::: code-group
-
-```vue []
+```vue
-
+
```
-:::
+When working with complex graphs with extensive state access, you should use the useVueFlow composable.
+The [`removeEdges`](/typedocs/interfaces/Actions#removeEdges) action is available through [useVueFlow](/typedocs/functions/useVueFlow),
+allowing you to remove edges straight from the state.
+
+What's more, this action isn't limited to the component rendering the graph; it can be utilized elsewhere, like in a
+Sidebar, Toolbar or the Edge itself.
+
+```vue
+
+
+
+
+
+```
+
+## Updating Edge Data
+
+Since edges are reactive object, you can update their data at any point by simply mutating it.
+This allows you to change the label, or even add new properties to the data object at any point in time.
+
+There are multiple ways of achieving this, here are some examples:
+
+::: code-group
+
+```vue [useEdge]
+
+
+```
+
+```ts [useVueFlow]
+import { useVueFlow } from '@vue-flow/core'
+
+const instance = useVueFlow()
+
+// find the node in the state by its id
+const edge = instance.findEdge(edgeId)
+
+edge.data = {
+ ...edge.data,
+ hello: 'world',
+}
+
+// you can also mutate properties like `selectable` or `animated`
+edge.selectable = !edge.selectable
+edge.animated = !edge.animated
+```
+
+```vue [v-model]
+
+
+
+
+
+```
+
+:::
## [Predefined Edge-Types](/typedocs/interfaces/DefaultEdgeTypes)
@@ -388,7 +520,7 @@ export const edges = ref([
id: 'e1-2',
source: '1',
target: '2',
- type: 'not-defined',
+ type: 'not-defined', // should be 'custom' | 'special'
}
])
```
@@ -517,33 +649,29 @@ const elements = ref([
Your custom edges are enclosed so that fundamental functions like selecting operate.
But you may wish to expand on these features or implement your business logic inside edges, thus your edges receive the following properties:
-| Name | Definition | Type | Optional |
-|---------------------|-------------------------------|------------------------------------------------|--------------------------------------------|
-| id | Edge id | string | |
-| source | The source node id | string | |
-| target | The target node id | string | |
-| sourceNode | The source node | GraphNode | |
-| targetNode | The target node | GraphNode | |
-| sourceX | X position of source handle | number | |
-| sourceY | Y position of source handle | number | |
-| targetX | X position of target handle | number | |
-| targetY | Y position of target handle | number | |
-| type | Edge type | string | |
-| sourceHandleId | Source handle id | string | |
-| targetHandleId | Target handle id | string | |
-| data | Custom data object | Any object | |
-| events | Edge events and custom events | [EdgeEventsOn](/typedocs/types/EdgeEventsOn) | |
-| label | Edge label | string, Component | |
-| labelStyle | Additional label styles | CSSProperties | |
-| labelShowBg | Enable/Disable label bg | boolean | |
-| labelBgPadding | Edge label bg padding | number | |
-| labelBgBorderRadius | Edge label bg border radius | number | |
-| selected | Is edge selected | boolean | |
-| animated | Is edge animated | boolean | |
-| updatable | Is edge updatable | [EdgeUpdatable](/typedocs/types/EdgeUpdatable) | |
-| markerEnd | Edge marker id | string | |
-| markerStart | Edge marker id | string | |
-| curvature | Edge path curvature | number | |
+| Prop Name | Description | Type | Optional |
+|------------------|--------------------------------------------|----------------------------------------------|--------------------------------------------|
+| id | Unique edge id | string | |
+| sourceNode | The originating node | [GraphNode](/typedocs/interfaces/GraphNode) | |
+| targetNode | The destination node | [GraphNode](/typedocs/interfaces/GraphNode) | |
+| source | ID of the source node | string | |
+| target | ID of the target node | string | |
+| type | Edge Type | string | |
+| label | Edge label, can be a string or a VNode | string \| VNode \| Component \| Object | |
+| style | CSS properties | CSSProperties | |
+| selected | Is edge selected | boolean | |
+| sourcePosition | Source position | [Position](/typedocs/enums/Position) | |
+| targetPosition | Target position | [Position](/typedocs/enums/Position) | |
+| sourceHandleId | ID of the source handle | string | |
+| targetHandleId | ID of the target handle | string | |
+| animated | Is edge animated | boolean | |
+| updatable | Is edge updatable | boolean | |
+| markerStart | Start marker | string | |
+| markerEnd | End marker | string | |
+| curvature | The curvature of the edge | number | |
+| interactionWidth | Width of the interaction area for the edge | number | |
+| data | Additional data of edge | any object | |
+| events | Contextual and custom events of edge | [EdgeEventsOn](/typedocs/types/EdgeEventsOn) | |
## Edge Events
@@ -678,84 +806,3 @@ const elements = ref([
::: tip
To override the styles of the default theme, visit the [Theming section](/guide/theming).
:::
-
-## Updating Edge Data
-
-Since edges are reactive object, you can update their data at any point by simply mutating it.
-This allows you to change the label, or even add new properties to the data object at any point in time.
-
-There are multiple ways of achieving this, here are some examples:
-
-::: code-group
-
-```vue [useEdge]
-
-
-```
-
-```ts [useVueFlow]
-import { useVueFlow } from '@vue-flow/core'
-
-const instance = useVueFlow()
-
-// find the node in the state by its id
-const edge = instance.findEdge(edgeId)
-
-edge.data = {
- ...edge.data,
- hello: 'world',
-}
-```
-
-```vue [v-model]
-
-
-
-
-
-```
-
-:::
diff --git a/docs/src/guide/node.md b/docs/src/guide/node.md
index 8dce6864..2c8f3726 100644
--- a/docs/src/guide/node.md
+++ b/docs/src/guide/node.md
@@ -218,6 +218,172 @@ function onAddNodes() {
:::
+## Removing Nodes from the Graph
+
+Similar to adding nodes, nodes can be removed from the graph by removing them from the `mode-value` (using `v-model`) or from the `nodes` prop of the Vue Flow component.
+
+```vue
+
+
+
+
+
+
+
+
+```
+
+When working with complex graphs with extensive state access, you should use the useVueFlow composable.
+The [`removeNodes`](/typedocs/interfaces/Actions#removeNodes) action is available through [useVueFlow](/typedocs/functions/useVueFlow),
+allowing you to remove nodes straight from the state.
+
+What's more, this action isn't limited to the component rendering the graph; it can be utilized elsewhere, like in a
+Sidebar, Toolbar or the Edge itself.
+
+```vue
+
+
+
+
+
+
+
+
+
+```
+
+## Updating Node Data
+
+Since nodes are reactive object, you can update their data at any point by simply mutating it.
+This allows you to disable or enable handles, change the label, or even add new properties to the data object at any point in time.
+
+There are multiple ways of achieving this, here are some examples:
+
+::: code-group
+
+```vue [useNode]
+
+
+```
+
+```ts [useVueFlow]
+import { useVueFlow } from '@vue-flow/core'
+
+const instance = useVueFlow()
+
+// find the node in the state by its id
+const node = instance.findNode(nodeId)
+
+node.data = {
+ ...node.data,
+ hello: 'world',
+}
+
+// you can also mutate properties like `selectable` or `draggable`
+node.selectable = false
+node.draggable = false
+```
+
+```vue [v-model]
+
+
+
+
+
+```
+
+:::
+
## [Predefined Node-Types](/typedocs/types/DefaultNodeTypes)
Vue Flow provides several built-in node types that you can leverage immediately.
@@ -501,25 +667,26 @@ const elements = ref([
Your custom nodes are enclosed so that fundamental functions like dragging or selecting operate.
But you may wish to expand on these features or implement your business logic inside nodes, thus your nodes receive the following properties:
-| Name | Definition | Type | Optional |
-|------------------|--------------------------------------------------|------------------------------------------------------------|--------------------------------------------|
-| id | Node id | string | |
-| type | Node type | string | |
-| selected | Is node selected | boolean | |
-| dragging | Is node dragging | boolean | |
-| connectable | Is node connectable | boolean | |
-| position | Relative position of a node | [XYPosition](/typedocs/interfaces/XYPosition) | |
-| zIndex | Node z-index | number | |
-| dimensions | Node size | [Dimensions](/typedocs/interfaces/Dimensions) | |
-| data | Custom data object | Any object | |
-| events | Node events and custom events | [NodeEventsOn](/typedocs/types/NodeEventsOn) | |
-| label | Node label | string, Component | |
-| isValidTargetPos | Called when target handle is used for connection | [ValidConnectionFunc](/typedocs/types/ValidConnectionFunc) | |
-| isValidSourcePos | Called when source handle is used for connection | [ValidConnectionFunc](/typedocs/types/ValidConnectionFunc) | |
-| parentNode | Parent node id | string | |
-| targetPosition | Target handle position | [Position](/typedocs/enums/Position) | |
-| sourcePosition | Source handle position | [Position](/typedocs/enums/Position) | |
-| dragHandle | Node drag handle class | string | |
+| Prop Name | Description | Type | Optional |
+|-------------------------------------------------------------|---------------------------------------------------------------------|------------------------------------------------------------|--------------------------------------------|
+| id | Unique node id | string | |
+| type | Node Type | string | |
+| selected | Is node selected | boolean | |
+| connectable | Can node handles be connected | [HandleConnectable](/typedocs/types/HandleConnectable) | |
+| position | Node's x, y (relative) position on the graph | [XYPosition](/typedocs/interfaces/XYPosition) | |
+| dimensions | Dom element dimensions (width, height) | [Dimensions](/typedocs/interfaces/Dimensions) | |
+| label | Node label, either a string or a VNode. `h('div', props, children)` | string \| VNode \| Component \| Object | |
+| isValidTargetPos | Called when used as target for new connection | [ValidConnectionFunc](/typedocs/types/ValidConnectionFunc) | |
+| isValidSourcePos | Called when used as the source for a new connection | [ValidConnectionFunc](/typedocs/types/ValidConnectionFunc) | |
+| parent | Parent node id | string | |
+| dragging | Is node currently dragging | boolean | |
+| resizing | Is node currently resizing | boolean | |
+| zIndex | Node z-index | number | |
+| targetPosition | Handle position | [Position](/typedocs/enums/Position) | |
+| sourcePosition | Handle position | [Position](/typedocs/enums/Position) | |
+| dragHandle | Drag handle query selector | string | |
+| data | Additional data of node | any object | |
+| events | Contextual and custom events of node | [NodeEventsOn](/typedocs/types/NodeEventsOn) | |
## [Node Events](/typedocs/types/NodeEventsHandler)
@@ -649,77 +816,6 @@ User-created nodes don't have any default styles associated and thus need custom
}
```
-## Updating Node Data
-
-Since nodes are reactive object, you can update their data at any point by simply mutating it.
-This allows you to disable or enable handles, change the label, or even add new properties to the data object at any point in time.
-
-There are multiple ways of achieving this, here are some examples:
-
-::: code-group
-
-```vue [useNode]
-
-
-```
-
-```ts [useVueFlow]
-import { useVueFlow } from '@vue-flow/core'
-
-const instance = useVueFlow()
-
-// find the node in the state by its id
-const node = instance.findNode(nodeId)
-
-node.data = {
- ...node.data,
- hello: 'world',
-}
-```
-
-```vue [v-model]
-
-
-
-
-
-```
-
-:::
-
## Implementing Scrolling within Nodes
Sometimes, a node might contain a large amount of content, making it difficult for users to view everything without the aid of a scroll function.