<NodeResizeControl />
若要建立您自己的調整大小 UI,您可以使用 NodeResizeControl
元件,您可以在其中傳遞子元素(例如圖示)。
Props
對於 TypeScript 使用者,<NodeResizeControl />
元件的 props 類型會匯出為 ResizeControlProps
。
名稱 | 類型 | 預設值 |
---|---|---|
# nodeId | string |
|
# position? | "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right" |
|
# variant? | "handle" | "line" |
|
# keepAspectRatio? | boolean |
|
# minWidth? | number |
|
# maxWidth? | number |
|
# minHeight? | number |
|
# maxHeight? | number |
|
# color? | string |
|
# style? | string |
|
# class? | 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 |
|