@@ -32,7 +32,10 @@ export type HeightFunc = (node: GraphNode) => number | string | void
32
32
export interface Node < Data = ElementData , CustomEvents extends Record < string , CustomEvent > = any , Type extends string = string > {
33
33
/** Unique node id */
34
34
id : string
35
- /** A node label */
35
+ /**
36
+ * @deprecated - will be removed in next major release and replaced with `{ data: { label: string | VNode | Component } }`
37
+ * A node label
38
+ */
36
39
label ?: string | VNode | Component
37
40
/** initial node position x, y */
38
41
position : XYPosition
@@ -54,11 +57,15 @@ export interface Node<Data = ElementData, CustomEvents extends Record<string, Cu
54
57
deletable ?: boolean
55
58
/** element selector as drag handle for node (can only be dragged from the dragHandle el) */
56
59
dragHandle ?: string
57
- /** @deprecated will be removed in next major release */
58
- /** called when used as target for new connection */
60
+ /**
61
+ * @deprecated will be removed in next major release
62
+ * called when used as target for new connection
63
+ */
59
64
isValidTargetPos ?: ValidConnectionFunc
60
- /** @deprecated will be removed in next major release */
61
- /** called when used as source for new connection */
65
+ /**
66
+ * @deprecated will be removed in next major release
67
+ * called when used as source for new connection
68
+ */
62
69
isValidSourcePos ?: ValidConnectionFunc
63
70
/** define node extent, i.e. area in which node can be moved */
64
71
extent ?: CoordinateExtent | CoordinateExtentRange | 'parent'
@@ -86,13 +93,16 @@ export interface Node<Data = ElementData, CustomEvents extends Record<string, Cu
86
93
/** Is node hidden */
87
94
hidden ?: boolean
88
95
/**
89
- * @deprecated will be removed in the next major release
96
+ * @deprecated - will be removed in the next major release
90
97
* overwrites current node type
91
98
*/
92
99
template ?: NodeComponent
93
100
/** Additional data that is passed to your custom components */
94
101
data ?: Data
95
- /** contextual and custom events that are passed to your custom components */
102
+ /**
103
+ * @deprecated - will be removed in the next major release
104
+ * contextual and custom events that are passed to your custom components
105
+ */
96
106
events ?: Partial < NodeEventsHandler < CustomEvents > >
97
107
zIndex ?: number
98
108
ariaLabel ?: string
@@ -127,33 +137,39 @@ export interface NodeProps<Data = ElementData, CustomEvents = object, Type exten
127
137
type : Type
128
138
/** is node selected */
129
139
selected : boolean
130
- /** can node handles be connected */
140
+ /** can node handles be connected, you need to forward this to your handles for this prop to have any effect */
131
141
connectable : HandleConnectable
132
- /** node x, y (relative) position on graph */
142
+ /**
143
+ * @deprecated - will be removed in next major release and replaced with `computedPosition`
144
+ * node x, y (relative) position on graph
145
+ */
133
146
position : XYPosition
134
147
/** dom element dimensions (width, height) */
135
148
dimensions : Dimensions
136
149
/**
150
+ * @deprecated - will be removed in next major release and replaced with `{ data: { label: string | VNode | Component } }`
137
151
* node label, either pass a string or a VNode
138
152
* For example like this: `h('div', props, children)`)
139
153
* Object is just a type-hack for Vue, ignore that
140
154
*/
141
155
label ?: string | VNode | Component | object
142
156
/**
143
- * @deprecated will be removed in next major release and replaced by just `isValidConnection` prop
157
+ * @deprecated will be removed in next major release
144
158
* called when used as target for new connection
145
159
*/
146
160
isValidTargetPos ?: ValidConnectionFunc
147
161
/**
148
- * @deprecated will be removed in next major release and replaced by just `isValidConnection` prop
162
+ * @deprecated will be removed in next major release
149
163
* called when used as source for new connection
150
164
*/
151
165
isValidSourcePos ?: ValidConnectionFunc
152
166
/**
153
- * todo: rename to `parentNodeId`
167
+ * @deprecated - will be removed in next major release. Use `parentNodeId` instead
154
168
* parent node id
155
169
*/
156
170
parent ?: string
171
+ /** parent node id */
172
+ parentNodeId ?: string
157
173
/** is node currently dragging */
158
174
dragging : boolean
159
175
/** is node currently resizing */
@@ -169,7 +185,10 @@ export interface NodeProps<Data = ElementData, CustomEvents = object, Type exten
169
185
170
186
/** additional data of node */
171
187
data : Data
172
- /** contextual and custom events of node */
188
+ /**
189
+ * @deprecated - will be removed in next major release
190
+ * contextual and custom events of node
191
+ */
173
192
events : NodeEventsOn < CustomEvents >
174
193
}
175
194
0 commit comments