Multi-select & bulk actions
Select several nodes and Pivotick surfaces a bulk-action row at the top of the sidebar — Pin, Unpin, Hide and Delete act on the whole selection at once (Isolate, Group, Ungroup and Bulk-edit are coming soon). A clear ✕ resets the selection.
Build a selection:
Shift+Click— add a node to the selectionAlt+Click— start a fresh selectionCtrl+Click— remove a node from the selection- or drag a box across empty canvas
With two or more nodes selected the bulk row appears. To react to the selection in code, use the onNodesSelect callback — the notification below is driven by it.
js
// Multi-selection is built in — pick several nodes and the sidebar shows a bulk-action
// row (Pin / Unpin / Hide / Delete) that acts on the whole selection. `mode: 'full'`
// is what renders the sidebar (and therefore the bulk row).
//
// To react programmatically, use the `onNodesSelect` callback. Its argument only
// carries the nodes involved in *this* change, so read the authoritative current
// selection from the interaction layer instead:
const options = {
UI: {
mode: 'full',
// Keep the sidebar open so the bulk-action row is visible (the embed is
// short enough that 'auto' would otherwise collapse it).
sidebar: { collapsed: false }
},
callbacks: {
onNodesSelect: () => {
const selected = graph.renderer.getGraphInteraction().getSelectedNodes()
if (selected.length < 2) return
const labels = selected.map((s) => s.node.getData().label).join(', ')
graph.notifier.info(`${selected.length} nodes selected`, labels)
}
}
}js
const data = {
nodes: [
{ id: 'alice', data: { label: 'Alice', role: 'Maintainer', team: 'Core', commits: 342 } },
{ id: 'bob', data: { label: 'Bob', role: 'Contributor', team: 'Core', commits: 87 } },
{ id: 'carol', data: { label: 'Carol', role: 'Reviewer', team: 'Docs', commits: 45 } },
{ id: 'dave', data: { label: 'Dave', role: 'Contributor', team: 'Docs', commits: 63 } },
{ id: 'erin', data: { label: 'Erin', role: 'Maintainer', team: 'Infra', commits: 210 } }
],
edges: [
{ from: 'alice', to: 'bob', data: { label: 'mentors' } },
{ from: 'alice', to: 'carol', data: { label: 'reviews' } },
{ from: 'carol', to: 'dave', data: { label: 'pairs' } },
{ from: 'erin', to: 'alice', data: { label: 'syncs' } }
]
}