Creates a new Graph.
The graph schema.
Optional
options: {The graph configuration. Optional.
Optional
adjustVertices?: objectIf true, multiple edges connected between two nodes will be spaced apart.
Optional
contextMenuItems?: object[]The context menu items to add to the graph.
Optional
defaultStyles?: objectUsed to override the graph's default styling. Check ./constants.js for a full list of style properties.
Optional
dom?: HTMLElementIf supplied, the graph will be attached to this element.
Optional
edgeHoverEffect?: booleanWhether the graph should show an edge highlight effect when the mouse is hovering over edges. Optional. Defaults to true.
Optional
incrementNodeNames?: booleanWhether the graph should increment the node name when a node with the same name already exists. Optional. Defaults to false.
Optional
initialData?: objectThe graph data to initialize the graph with.
Optional
passiveUIEvents?: booleanIf true, the graph will not update its data and view upon user interaction. Instead, these interactions can be handled explicitly by listening to fired events. Optional. Defaults to false.
Optional
readOnly?: booleanWhether the graph is read only. Optional. Defaults to false.
Optional
restrictTranslate?: booleanWhether the graph should restrict the translate graph operation to the graph area. Optional. Defaults to false.
The current graph data. Contains an object with any nodes and edges present in the graph. This can be passed into the graph constructor to reload the current graph.
Set the error state of a node attribute.
The node to update.
The name of the attribute to update.
Whether the attribute should be set in the error state.
Represents a new Graph.