Appearance
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]Whentrue, rewirable edges are hidden and redrawn on the canvas layer so their endpoints always connect to the correct anchor position. - drawHandle(optional)
FunctionCustom canvas draw function. The context is pre-translated to the anchor position; draw relative to (0, 0). - edges(optional)
Edge|EdgeListEdges to rewire. Falls back to the selected edges if not provided. - hoverRadius(optional)
numberHit-detection radius in pixels around each handle. Defaults toradiuswhen not provided. - radius(optional)
number[=4]Radius, in pixels, of the handle in the center of the nodes
- anchor(optional)
ogma.tools.rewire.enabled()
Returns
-
booleanIndicates 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