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

Ogma.tools.rewire

Rewiring API: functions to manually change the extremities of the selected edges.

ogma.tools.rewire.disable()

Disable the "rewire" tool'.

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

Enable the "rewire" tool, enabling the user to manually change the extremities of the selected edges.

Arguments

  • options(optional) object
    • anchor(optional) HandleAnchor|Function[='center'] Where to anchor the handle on each node. Fixed value or per-node callback.
    • color(optional) Color[="#00C3FF"] Color of the handle in the center of the nodes
    • cursorOnDrag(optional) CursorStyle[='grabbing'] CSS cursor style when dragging an edge
    • cursorOnHover(optional) CursorStyle[='grab'] CSS cursor style when hovering a node handle
    • drawEdges(optional) boolean[=false] When true, rewirable edges are hidden and redrawn on the canvas layer so their endpoints always connect to the correct anchor position.
    • drawHandle(optional) Function Custom canvas draw function. The context is pre-translated to the anchor position; draw relative to (0, 0).
    • edges(optional) Edge|EdgeList Edges to rewire. Falls back to the selected edges if not provided.
    • hoverRadius(optional) number Hit-detection radius in pixels around each handle. Defaults to radius when not provided.
    • radius(optional) number[=4] Radius, in pixels, of the handle in the center of the nodes

ogma.tools.rewire.enabled()

Returns

  • boolean Indicates if the "rewire" tool is enabled

ogma.tools.rewire.setEdgesToRewire(edges)

Set the edges eligible for rewiring at runtime. Pass undefined to fall back to the current selection.

Arguments