Skip to main content
BrowserUIEdgeOptions
Common options for edges in the Browser UI package.
NameTypeDescription
activeEdit?booleanDefaults to true, meaning if edges are editable then any new edge is automatically marked edited and its geometry is stored.
allowUnattached?booleanWhether or not to allow edges whose source and/or target is not connected to a vertex but is anchored to some point on the canvas. If you need more fine-grained control (such as some edge types should support this and others should not), use the allowUnattached flag of an edge type. Defaults to false.
anchor?AnchorSpecDefault anchor to use for both source and target of edges.
anchors?[AnchorSpec, AnchorSpec]Anchors to use as source, target of edges. This will take precedence over anchor.
astarGridCellSize?numberSize of each cell in the grid that the AStar routine uses to calculate paths that avoid vertices. This defaults to 10 pixels and is not something you'll really need to change. If you do change it, keep in mind that a) a smaller grid size increases the runtime of the routine, and b) a large grid size will render the UI unusable.
astarVertexBorder?numberNumber of cells to pad each vertex with that act as its border: edges will be routed around the border wherever possible. Defaults to 2
astarVertexBuffer?numberNumber of cells to pad each vertex with that act as its buffer: edges will be routed around the buffer wherever possible. Defaults to 2 - but note this value is added the vertex border, whose default is 2, so the computed default is 4 grid cells.
avoidVertices?booleanIf true, edges will attempt to avoid vertices.
connector?ConnectorSpecDefault connector to use for edges. This will be used in the event that VisuallyJs does not find a connector spec for a given edge in its type definition.
detachable?booleanWhether or not edges should be detachable via pointer/touch events by default. The default value for this is true. This behaviour can be overridden by individual edge type definitions.
discardEditsOnDrag?booleanDefaults to false. When true, dragging either the source or target of some edge that has edits will cause those edits to be discarded. When false - the default value - Visually JS attempts to retain as many of the edits as possible while still catering for the fact that the source or target has moved.
editable?booleanIf true, an EdgePathEditor will be registered on the Surface, with which you can interact via the startEditingPath(..) and stopEditingPath() methods on the Surface.
editOnTap?booleanDefaults to true, meaning that when a user taps an edge it goes into edit mode.
inputMethod?EdgeInputMethodInput method for edges. Defaults to drag.
layerIndex?numberThis setting is only relevant when you are using an SVG container. By default, edges are drawn in a layer that appears in the DOM after the vertex layer, meaning edges will show above vertices. If you set this to 0, you can force the edge layer to the back.
outlineColor?stringThe default color to paint a connector's outline path. Defaults to "transparent". Can be overridden on a per-edge basis via the outlineColor setting.
outlineWidth?numberDefault width to paint the outline path behind edge paths. Defaults to 20 pixels. Can be overridden on a per-edge basis via the outlineWidth setting.
overlays?Array<OverlaySpec>Default overlays to draw on each edge.
paintOutline?booleanDefaults to true. Paints an outline path behind the path drawn for an edge, which makes it easier for users to interact with the element on the canvas. The default width of the outline is specified by the outlineWidth setting.
propertyMappings?EdgePropertyMappingsOptional set of mappings from property values to edge definitions.
reattach?booleanWhether or not edges that have been detached from their source or target via pointer/touch events should be reattached if they are dropped into whitespace. The default value for this is false: edges dropped in whitespace are discarded. This behaviour can be overridden in individual edge type definitions.
simpleEdgeStyles?booleanDefaults to true. Instructs the Surface to automatically extract color, lineWidth, outlineWidth, outlineColor, and dashArray values from the backing data for edges, and to use these to set the appearance of a connection for that edge.
sourceMarker?OverlaySpecShorthand for adding an overlay at location 0, with direction set to -1.
targetMarker?OverlaySpecShorthand for adding an overlay at location 1