new Graph(props)
Constructs a new Graph
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object | Object containing optional properties of the Graph
Properties
|
Methods
(private) _resolveEdgeIds(edge) → {undefined}
Replace string IDs representing Nodes in Edges with Node references
Parameters:
Name | Type | Description |
---|---|---|
edge |
Edge | Edge that has string IDs for its Node values |
Returns:
- Type
- undefined
addEdge()
Add an Edge to the Graph. Upon adding, if the Edge contains Node string ID's, they will be looked up in the Graph and replaced with Node instances.
addEdges(edges)
Add multiple edges at the same time.
Parameters:
Name | Type | Description |
---|---|---|
edges |
Array | array of Edge objects, or edge parameters. |
addNodes(nodes)
Add multiple nodes at the same time
Parameters:
Name | Type | Description |
---|---|---|
nodes |
Array | array of Node objects to add, as you would using the addNode function |
disableAutoRender()
Stops the chart from rendering newly added data (e.g. edges/nodes)
enableAutoRender()
Re-enables rendering newly added data (e.g. edges/nodes)
purgeEdges()
Removes all the edges from the graph.
purgeNodes()
Removes all nodes from the Graph. Implies removing all the edges, as well, since they'd no longer be connected to anything.
renderIn(elem) → {Graph}
Render the Graph in a DOM element
Parameters:
Name | Type | Description |
---|---|---|
elem |
Element | String | Element the Graph should be rendered in. Specify Element ID if string. |
Returns:
The Graph the method was called on
- Type
- Graph