參考型別 (Types)

ConnectionLineComponentProps

GitHub 上的原始碼

如果您想為連接線渲染自訂元件,可以在 <ReactFlow /> 元件上設定 connectionLineComponent 屬性。ConnectionLineComponentProps 會傳遞到您的自訂元件。

export type ConnectionLineComponentProps = {
  connectionLineStyle?: React.CSSProperties;
  connectionLineType: ConnectionLineType;
  fromNode?: Node;
  fromHandle?: Handle;
  fromX: number;
  fromY: number;
  toX: number;
  toY: number;
  fromPosition: Position;
  toPosition: Position;
  connectionStatus: 'valid' | 'invalid' | null;
};

屬性

#connectionLineStyle?
#connectionLineType
ConnectionLineType
#fromNode?
Node
連線線的起點節點。
#fromHandle?
Handle
連線線起點節點上的把手。
#fromX
數字
#fromY
數字
#toX
數字
#toY
數字
#fromPosition
Position
#toPosition
Position
#connectionStatus
"有效" | "無效" | 空值
如果存在 isValidConnection 回呼函式,此屬性將根據該回呼函式的傳回值設定為 "valid" 或 "invalid"。 否則,它將為空值。