feat(edges): add data and classname props, unify node/edge handling closes #357

This commit is contained in:
moklick
2020-07-27 12:40:39 +02:00
parent cbc41f244e
commit b3391860da
7 changed files with 127 additions and 90 deletions
+7 -1
View File
@@ -2,7 +2,9 @@ import { CSSProperties, MouseEvent } from 'react';
export type ElementId = string;
export type Elements = Array<Node | Edge>;
export type FlowElement = Node | Edge;
export type Elements = Array<FlowElement>;
export type Transform = [number, number, number];
@@ -64,6 +66,8 @@ export interface Edge {
animated?: boolean;
arrowHeadType?: ArrowHeadType;
isHidden?: boolean;
data?: any;
className?: string;
}
export enum BackgroundVariant {
@@ -95,6 +99,7 @@ export interface EdgeProps {
style?: CSSProperties;
arrowHeadType?: ArrowHeadType;
markerEndId?: string;
data?: any;
}
export interface EdgeBezierProps extends EdgeProps {
@@ -227,6 +232,7 @@ export interface EdgeCompProps {
onClick?: (edge: Edge) => void;
animated?: boolean;
selected?: boolean;
data?: any;
}
export interface EdgeTextProps {