update: pass store state as props to edge-renderer and edge

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-22 13:40:25 +01:00
parent ebd0f9e738
commit 2b065b4e56
14 changed files with 152 additions and 143 deletions
+3 -3
View File
@@ -58,12 +58,12 @@ export interface MiniMapNodeProps {
}
export interface EdgeTextProps {
x: number
y: number
x?: number
y?: number
label?:
| string
| {
component: Component | DefineComponent
component: any
props?: Record<string, any>
}
labelStyle?: CSSProperties
+3 -3
View File
@@ -1,6 +1,6 @@
import { Component, CSSProperties, DefineComponent } from 'vue'
import { ArrowHeadType, ElementId, Position } from './flow'
import { EdgeTextProps } from '~/types/components'
import { EdgeTextProps } from './components'
export interface Edge<T = any> {
id: ElementId
@@ -15,8 +15,8 @@ export interface Edge<T = any> {
label?:
| string
| {
component: DefineComponent<EdgeTextProps>
props?: EdgeTextProps
component: DefineComponent<EdgeTextProps> | any
props?: EdgeTextProps | any
}
labelStyle?: any
labelShowBg?: boolean
+5
View File
@@ -33,6 +33,11 @@ export interface GraphNode<T = any> extends Node<T> {
__vf: VFInternals
}
export type SourceTargetNode = {
sourceNode: GraphNode
targetNode: GraphNode
}
export type NodePosUpdate = {
id: ElementId
pos: XYPosition