For the router: frees it and everything added to it. For other objects:
removes the object. Shapes, junctions and connectors are removed through
their router, like router.deleteShape(shape), with the same
restrictions; a pin is removed from its shape or junction immediately.
Everything the object owns goes with it. Using the object afterwards
throws.
Same as delete(), for using declarations.
True once the object was freed, whether by its own delete() or by deleting its owner (e.g. a pin's shape, or the router).
Applies all changes made since the last call and re-routes the affected
connectors, calling their callbacks (see ConnRef.setCallback).
False if there was nothing to do: no objects were added, moved or deleted and no settings were changed since the last call.
Prints statistics about the router's internal visibility graph (numbers of shapes, vertices and edges) to stdout, which is the console in a browser. For debugging.
Sets a numeric routing parameter. Parameters are either distances, such
as shapeBufferDistance (the space kept between connectors and shapes),
or penalties, such as segmentPenalty (a cost added for every bend, so
that routes with fewer bends are preferred). 0 turns a penalty off; a
negative value picks a sensible default. Takes effect at the next
processTransaction().
Turns a routing option on or off. Takes effect at the next processTransaction().
Adds a shape that connectors are routed around: a rectangle (top-left
corner + size) or a polygon of at least 3 points. Connectors attach to a
shape through its pins (shape.addPin). Takes effect at the next
processTransaction().
Optionaloptions: AddOptionsMoves or resizes the shape to a new rectangle or polygon. The number of points cannot change (a rectangle has 4): to change it, delete the shape and add a new one. Takes effect at the next processTransaction().
Moves the shape by dx, dy. Takes effect at the next processTransaction().
Removes the shape and its pins at the next processTransaction(). A shape cannot be removed in the transaction that added it: call processTransaction() first.
Adds a junction: a point where several connectors meet, e.g. to draw a
connection between more than two objects (a hyperedge) as a tree.
Connectors attach to it with {junction}. Takes effect at the next
processTransaction().
Optionaloptions: AddOptionsMoves the junction to position. Takes effect at the next processTransaction().
Moves the junction by dx, dy. Takes effect at the next processTransaction().
Removes the junction and its pins at the next processTransaction(). Like a shape, a junction cannot be removed in the transaction that added it.
Adds a connector between two ends, routed at the next
processTransaction(). An end is a free point {x, y}, a class of a
shape's pins {shape, pin} or a junction {junction}. The connector is
routed as a polyline if the router supports polyline routing, otherwise
orthogonally; see ConnRef.setRoutingType.
Optionaloptions: AddOptions
Routes connectors around obstacles (shapes and junctions). Owns everything added to it;
router.delete()frees all of it.Changes (adding, moving and deleting objects, changing settings) are collected and applied together by processTransaction(), which then re-routes the affected connectors.