参考组件

<NodeResizeControl />

GitHub 上的源代码

要创建您自己的调整大小 UI,您可以使用 NodeResizeControl 组件,您可以在其中传递子元素(例如图标)。

Props

对于 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