Skip to Content
参考组件

<NodeResizeControl />

GitHub上的源代码 

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

🌐 To create your own resizing UI, you can use the NodeResizeControl component where you can pass children (such as icons).

属性

🌐 Props

对于 TypeScript 用户,<NodeResizeControl /> 组件的 props 类型被导出为 ResizeControlProps

🌐 For TypeScript users, the props type for the <NodeResizeControl /> component is exported as ResizeControlProps.

NameTypeDefault
nodeIdstring

Id of the node it is resizing.

colorstring

Color of the resize handle.

minWidthnumber

Minimum width of node.

10
minHeightnumber

Minimum height of node.

10
maxWidthnumber

Maximum width of node.

Number.MAX_VALUE
maxHeightnumber

Maximum height of node.

Number.MAX_VALUE
keepAspectRatioboolean

Keep aspect ratio when resizing.

false
shouldResize(event: ResizeDragEvent, params: ResizeParamsWithDirection) => boolean

Callback to determine if node should resize.

autoScaleboolean

Scale the controls with the zoom level.

true
onResizeStartOnResizeStart

Callback called when resizing starts.

onResizeOnResize

Callback called when resizing.

onResizeEndOnResizeEnd

Callback called when resizing ends.

positionControlLinePosition | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'

Position of the control.

variantResizeControlVariant

Variant of the control.

"handle"
resizeDirection'horizontal' | 'vertical'

The direction the user can resize the node. If not provided, the user can resize in any direction.

classNamestring
styleCSSProperties
childrenReactNode
Last updated on