參考元件

<NodeResizeControl />

GitHub 上的原始碼

要建立您自己的調整大小 UI,您可以使用 NodeResizeControl 元件,您可以在其中傳遞子元件(例如圖示)。

屬性

對於 TypeScript 使用者,<NodeResizeControl /> 元件的 props 類型會匯出為 ResizeControlProps

#nodeId
string
#position?
"top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right"
"bottom-right"
#variant?
"handle" | "line"
"handle"
#keepAspectRatio?
boolean
false
#minWidth?
number
10
#maxWidth?
number
Number.MAX_SAFE_INTEGER
#minHeight?
number
10
#maxHeight?
number
Number.MAX_SAFE_INTEGER
#color?
string
#style?
#className?
string
#children?
React.ReactNode
#shouldResize?
(event: D3.DragEvent,params: ResizeParams & { direction: number[] }) => boolean
#onResizeStart?
(event: D3.DragEvent,params: ResizeParams) => void
#shouldResize?
(event: D3.DragEvent,params: ResizeParams & { direction: number[] }) => boolean
#onResizeEnd?
(event: D3.DragEvent,params: ResizeParams) => void