EdgeProps
當您實作自訂邊緣時,它會被包裝在一個啟用某些基本功能的元件中。您的自訂邊緣元件會接收以下 props
export type EdgeProps<EdgeType extends Edge = Edge> = {
id: string;
animated: boolean;
data: EdgeType['data'];
style: React.CSSProperties;
selected: boolean;
source: string;
target: string;
sourceHandleId?: string | null;
targetHandleId?: string | null;
interactionWidth: number;
sourceX: number;
sourceY: number;
targetX: number;
targetY: number;
sourcePosition: Position;
targetPosition: Position;
label?: string | React.ReactNode;
labelStyle?: React.CSSProperties;
labelShowBg?: boolean;
labelBgStyle?: CSSProperties;
labelBgPadding?: [number, number];
labelBgBorderRadius?: number;
markerStart?: string;
markerEnd?: string;
pathOptions?: any;
};
欄位
名稱 | 類型 |
---|---|
# id | 字串 |
# animated? | 布林值 |
# data | T |
# style | React.CSSProperties |
# selected | 布林值 |
# source | 字串 |
# target | 字串 |
# sourceHandleId? | 字串 | null |
# targetHandleId? | 字串 | null |
# interactionWidth | 數字 |
# sourceX | 數字 |
# sourceY | 數字 |
# targetX | 數字 |
# targetY | 數字 |
# sourcePosition | Position |
# targetPosition | Position |
# label? | 字串 | React.ReactNode |
# labelStyle? | React.CSSProperties |
# labelShowBg? | 布林值 |
# labelBgStyle? | React.CSSProperties |
# labelBgPadding? | [數字, 數字] |
# labelBgBorderRadius? | 數字 |
# markerStart? | 字串 |
# markerEnd? | 字串 |
# pathOptions? | 任何類型 |