update(nodes): NodeProps comments
This commit is contained in:
@@ -67,10 +67,15 @@ export interface GraphNode<Data = ElementData> extends Node<Data> {
|
|||||||
|
|
||||||
/** these props are passed to node components */
|
/** these props are passed to node components */
|
||||||
export interface NodeProps<Data = ElementData> {
|
export interface NodeProps<Data = ElementData> {
|
||||||
|
/** unique node id */
|
||||||
id: string
|
id: string
|
||||||
type: string
|
/** node type */
|
||||||
|
type: keyof DefaultNodeTypes | string
|
||||||
|
/** additional data of node */
|
||||||
data?: Data
|
data?: Data
|
||||||
|
/** is node selected */
|
||||||
selected: boolean
|
selected: boolean
|
||||||
|
/** can node be connected */
|
||||||
connectable: boolean
|
connectable: boolean
|
||||||
/** absolute position in relation to parent elements + z-index */
|
/** absolute position in relation to parent elements + z-index */
|
||||||
computedPosition: XYZPosition
|
computedPosition: XYZPosition
|
||||||
@@ -88,12 +93,19 @@ export interface NodeProps<Data = ElementData> {
|
|||||||
isValidTargetPos?: ValidConnectionFunc
|
isValidTargetPos?: ValidConnectionFunc
|
||||||
/** called when used as source for new connection */
|
/** called when used as source for new connection */
|
||||||
isValidSourcePos?: ValidConnectionFunc
|
isValidSourcePos?: ValidConnectionFunc
|
||||||
|
/** parent node id */
|
||||||
parentNode?: string
|
parentNode?: string
|
||||||
|
/** is node currently dragging */
|
||||||
dragging: boolean
|
dragging: boolean
|
||||||
|
/** node z-index */
|
||||||
zIndex: number
|
zIndex: number
|
||||||
|
/** handle position */
|
||||||
targetPosition?: Position
|
targetPosition?: Position
|
||||||
|
/** handle position */
|
||||||
sourcePosition?: Position
|
sourcePosition?: Position
|
||||||
|
/** drag handle query selector */
|
||||||
dragHandle?: string
|
dragHandle?: string
|
||||||
|
|
||||||
|
/** node DOM-element */
|
||||||
nodeElement: HTMLDivElement
|
nodeElement: HTMLDivElement
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user