Skip to content
  1. API
  2. Ogma
  3. tools

Ogma.tools.resize

Resize API: functions to resize nodes.

ogma.tools.resize.disable()

Disable the "resize" mode.

ogma.tools.resize.enable([options])

Enable the "resize" mode, allowing the user to manually change the size of the selected nodes.

Arguments

  • options(optional) object
    • color(optional) Color[="#00C3FF"] Color used to display the nodes bounding box
    • cursor(optional) CursorStyle[="nesw-resize"] CSS cursor to use when the mouse is over a resizing handle
    • detectionMargin(optional) number[=5] Maximum distance (in pixels) the mouse can be to the resize handler and still be detected
    • handleSize(optional) number[=6] Width (in pixels) of the square indicator to drag in order to resize the node
    • lineWidth(optional) number[=1] Width (in pixels) of the stroke of the square representing the nodes bounding box
    • nbNodesToSnapTo(optional) number[=5] Number of close nodes to use for snapping.
    • previewColor(optional) Color[='rgba(0, 0, 0, 0.2)'] Color of the preview of the node being resized
    • sizeIndicatorColor(optional) Color[="black"] Color of the size indicator (shown when the node snaps to the size of another node)
    • sizeIndicatorOffset(optional) number[=5] Offset (in pixels) to the left on which the size indicator must be displayed
    • sizeIndicatorThickness(optional) number[=1] Thickness (in pixels) of the line used to draw the size indicator
    • sizeIndicatorWidth(optional) number[=3] Total width (in pixels) of the indicator size
    • snappingRatio(optional) number[=1.25] Ratio used to determine the size to snap to, when the node does not snap to another node size. Must be strictly greater than 1.

ogma.tools.resize.enabled()

Indicates if the "resize" mode is enabled.

Returns

  • boolean