feat(nodes, edges, store): Add updateNodeDimensions actions

* Returns new changes for updating node dimensions
* Add expandParent prop to nodes when parents should be expanded to fit the new child in them
*
This commit is contained in:
Braks
2022-04-04 21:42:48 +02:00
parent 5cc0da29c0
commit 0093df43a9
11 changed files with 244 additions and 96 deletions
+23
View File
@@ -76,6 +76,11 @@ export interface Edge<T = any> extends Element<T> {
selectable?: boolean
}
export type DefaultEdgeOptions = Omit<
Edge,
'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle' | 'sourceNode' | 'targetNode'
>
export interface EdgePositions {
sourceX: number
sourceY: number
@@ -125,6 +130,24 @@ export interface EdgeProps<Data = any> {
updatable?: boolean
markerStart?: string
markerEnd?: string
curvature?: number
}
export type BaseEdgeProps = Pick<
EdgeProps,
| 'label'
| 'labelStyle'
| 'labelShowBg'
| 'labelBgStyle'
| 'labelBgPadding'
| 'labelBgBorderRadius'
| 'style'
| 'markerStart'
| 'markerEnd'
> & {
centerX: number
centerY: number
path: string
}
export interface SmoothStepEdgeProps<Data = any> extends EdgeProps<Data> {