The HTMLElement that will serve as the main container for the graph.
Optionaldata: RelaxedGraphDataThe graph data, including nodes and edges, to render.
Optionaloptions: Partial<GraphOptions.GraphOptions>Optional configuration for the graph's behavior, UI, styling, simulation, etc.
Adds an edge to the graph.
Both the source (from) and target (to) nodes must already exist in the graph.
Throws an error if an edge with the same ID already exists.
Adds nodes to the current selection, leaving what is already selected in place. Already-selected nodes are ignored.
Nodes only: the interaction layer has no additive setter for edges, which can only be selected as a whole set via selectElements.
The Nodes to add.
End the emphasis emphasiseElements started: the canvas reads normally again.
Take the forecast down.
Remove any highligh class from any nodes or edges
Closes the data dock.
Deselect all
Destroy all UI components.
Repaint after an edge-layer change. Deliberately not onChange: layers
don't touch the link force (see Simulation.getActiveEdges), so restarting the
simulation would move the graph for no reason.
Pick a set of elements out of the graph: they keep the look they already have while everything else on the canvas dims, until clearEmphasis. This is how hovering a legend entry reads its category off the canvas.
Where highlightElement points at one element, this describes a group. Elements that aren't drawn right now are skipped, and an empty set dims nothing.
The ID of the app
Retrieves an edge from the graph by its ID.
Returns a deep clone of the edge to prevent external mutations.
The ID of the edge.
A cloned Edge if found, otherwise undefined.
Returns the number of edges currently in the graph.
The total edge count.
Retrieves all edges in the graph.
Returns clones of the edges to prevent external modifications.
An array of cloned Edge objects.
Retrieves an edge from the graph by its ID.
Returns the actual edge instance, allowing direct modifications.
Warning: Directly modifying edges using this method may lead to unexpected behavior.
It is generally safer to use getEdge which returns a cloned instance.
The ID of the edge.
The Edge if found, otherwise undefined.
Retrieves a node from the graph by its ID.
Returns the actual node instance, allowing direct modifications.
Warning: Directly modifying nodes using this method may lead to unexpected behavior.
It is generally safer to use getNode which returns a cloned instance.
The ID of the node or a Node object.
The Node if found, otherwise undefined.
Retrieves all nodes in the graph.
Returns the actual node instances, allowing direct modifications.
An array of Node objects.
Retrieves all visible nodes in the graph. Recursively adding visible children
Returns the actual node instances, allowing direct modifications.
An array of Node objects.
Returns the number of nodes currently in the graph.
The total node count.
Retrieves all nodes in the graph.
Returns clones of the nodes to prevent external modifications.
An array of cloned Node objects.
Returns the current configuration options of the graph.
Trigger the next render update of the graph.
Trigger the next render update of the graph for the passed subjects.
Opens the data dock — the graph's rows as a sortable, selectable grid split off
the bottom of the canvas. full mode only, and only when UI.table allows it;
a no-op otherwise.
The dock can hold panes other than the table now, so this also brings the table's
pane to the front: the call is named for the table and should show you one. Reach
for UIManager.dock or activateDockTab() to drive the region without that.
Remove everything a source vouches for. An element several sources vouch for survives, one claim lighter — the same uniform rule pivot undo follows, and the only way anything a pivot brought is removed.
A pivot id, or 'seed' for data that was never pivoted.
What was actually removed.
Removes an edge from the graph by its ID.
The ID of the edge to remove.
Triggers onChange after the edge is removed.
Removes nodes from the current selection, leaving the rest of it in place. Nodes only, on the same terms as addToSelection.
The Nodes to remove.
Removes a node from the graph by its ID.
Also removes any edges connected to the node.
The ID of the node to remove.
Triggers onChange after the node and its edges are removed.
Selects several nodes, or several edges, replacing the current selection — the plural selectElement, resolving each element's rendered handle for you.
Nodes and edges cannot be selected together (the interaction layer clears one kind when the other is set), so a mixed array selects the nodes and warns.
Replaces all current nodes and edges in the graph with the provided data.
Clears existing nodes and edges before setting the new ones.
Triggers the onChange callback after the update.
Replace the canvas legend at runtime — the imperative twin of UI.legend.
A graph that started without one gets it built on the spot; false empties
the legend and drops its filter, and true / undefined fall back to
deriving one from render.nodeTypeAccessor. Pass a
LegendGroupOptions to key the graph on several dimensions at once.
Optionalconfig: boolean | LegendOptions | LegendGroupOptionsThe legend to show, or false to remove it.
Returns whether anything moved, so an edge-only filter change can repaint itself.
notify is off for the query engine's first pass, which runs before anything is
drawn — the constructor's own simulation.update() / renderer.init() follow it.
Paint what an action would do, and change nothing else: the elements it would take away drain in place, the ones it would hide with them, and whatever it would bring back is outlined where it would land.
Where emphasiseElements reads a set out of the canvas by receding the
rest, a forecast answers "what happens if I click" — so the graph has to keep
reading normally around the few elements that would change.
graph.history.preview(...) returns one ready-made.
Opens the data dock if it is closed, closes it if it is open.
Updates the graph with new nodes and/or edges.
An id the graph already holds is updated in place: what the element is —
its data, style and weight — becomes what you handed over, while the object
itself keeps its identity. It has to work that way. Its edges, the simulation
and the DOM binding all hold that object, and so does everything it has learned
since it was built: which sources vouch for it, where it sits, whether it is
pinned. A position on the incoming element still wins, so updateData can move
something as well as refresh it. Unknown ids are added.
A container's children are not restructured here — pass the container through
removeNode and addNode to change what it holds.
Triggers the onChange callback if any updates were applied.
Install a PivotickPlugin. Can be called at any time — the plugin's
UI elements are caught up to the current lifecycle phase. Returns this
for chaining.
ReadonlyeditingReadonlyhistoryWhat the canvas holds and shows, and how it came to: every ingest, deletion, durable hide and hand-drawn element, contiguously reversible. Bounded and session-scoped — it does not survive a reload.
ReadonlypivotsThe pivot runtime: register enrichments, run them, triage what they return,
and undo a whole run. Lives on Graph rather than the UI because pivots
produce data — and because it has to exist before the UI is built.
Initializes a graph inside the specified container using the provided data and options.