pivotick / PivotManager
Interface: PivotManager
Defined in: PivotManager.ts:50
The pivot runtime: the registry, the two provider calls with their cancellation and cache, the narrowing gate, the candidate sets awaiting triage, and ingest with its provenance. Taking a run back is graph.history's job, alongside every other thing the analyst can reverse.
It holds no UI. Everything here is drivable from the console — a pivot with autoIngest: true is end to end without a single pane — and the triage pane and the Pivot rail mode are readers of this state, not owners of it.
Reached as Graph.pivots.
Implements
Accessors
rimBadge
Get Signature
get rimBadge():
PivotRimBadge
Defined in: PivotManager.ts:111
What the library draws on a node's rim for its pivots: one badge per pivot that declared a potential, one badge for all of them, or nothing. Set it through pivotRimBadge in the graph options, or here to change it later.
Assigning marks every node dirty, the way setPotential does for one — the rim redraws on the next render, so call graph.renderer.update() if nothing else is about to.
Returns
Set Signature
set rimBadge(
mode):void
Defined in: PivotManager.ts:115
What the library draws on a node's rim for its pivots.
Parameters
mode
Returns
void
Implementation of
PivotManagerLike.rimBadge
rimBadgeShown
Get Signature
get rimBadgeShown():
boolean
Defined in: PivotManager.ts:142
Whether the rim badges are drawn right now.
Returns
boolean
rimBadgeVisible
Get Signature
get rimBadgeVisible():
PivotRimBadgeVisibility
Defined in: PivotManager.ts:131
When the rim badges of rimBadge are drawn: only while Pivot mode is open, always, or never. Set it through pivotRimBadgeVisible in the graph options, or here to change it later.
Like rimBadge, assigning marks every node dirty.
Returns
Set Signature
set rimBadgeVisible(
visibility):void
Defined in: PivotManager.ts:135
When those rim badges are drawn.
Parameters
visibility
Returns
void
Implementation of
PivotManagerLike.rimBadgeVisible
saveControls
Get Signature
get saveControls():
boolean
Defined in: PivotManager.ts:90
Whether the Pivot panel and the triage pane offer their own N unsaved · Save. Off, a consumer writes back only through save, which, like the ledger and unsavedCount, works either way. Set it through pivotSaveControls in the graph options, or here to change it later.
Returns
boolean
Set Signature
set saveControls(
shown):void
Defined in: PivotManager.ts:94
Whether the Pivot panel and the triage pane offer their own Save.
Parameters
shown
boolean
Returns
void
Implementation of
PivotManagerLike.saveControls
size
Get Signature
get size():
number
Defined in: PivotManager.ts:272
How many pivots are registered — what the Pivot rail mode's gating reads.
Returns
number
Methods
all()
all():
PivotDefinition[]
Defined in: PivotManager.ts:267
Every registered pivot, in registration order.
Returns
Implementation of
PivotManagerLike.all
applicableCount()
applicableCount(
node):number
Defined in: PivotManager.ts:301
How many pivots apply to one node — what the 'summary' rim badge counts when nothing was declared for it.
Memoised, because the rim asks this for every node on every render and the answer is one appliesTo call per registered pivot: at a hundred providers and a thousand nodes, asking each time is a hundred thousand calls a frame. The memo is dropped whenever the registry or the graph's nodes change, so a predicate reading anything else can go stale — acceptable for a hint on the rim, and the panel is always the exact answer.
Parameters
node
Returns
number
Implementation of
PivotManagerLike.applicableCount
cachedSummary()
cachedSummary(
id,nodes,narrowing):PivotSummary|undefined
Defined in: PivotManager.ts:379
The cached summary for exactly this question, if there is one. Lets a surface paint a number it already knows without asking again.
Parameters
id
string
nodes
Node[] = []
narrowing
PivotNarrowing = {}
Returns
PivotSummary | undefined
cancel()
cancel(
pivotId?,kind?):void
Defined in: PivotManager.ts:409
Abort in-flight provider calls: one pivot's or every pivot's, and optionally only one kind.
The kind is what lets leaving a surface stop the questions it was asking without cancelling the work it commissioned — a fetch already has a candidate set of its own and a pane showing it, so abandoning that silently would throw away results nobody asked to lose.
Parameters
pivotId?
string
kind?
"summarize" | "fetch"
Returns
void
Implementation of
PivotManagerLike.cancel
cancelFetch()
cancelFetch(
pivotId):void
Defined in: PivotManager.ts:631
Cancel a fetch in flight. The candidate set goes with it; nothing is staged.
Parameters
pivotId
string
Returns
void
candidates()
candidates(
pivotId):PivotCandidateSet|undefined
Defined in: PivotManager.ts:701
The candidates staged for one pivot, if any.
Parameters
pivotId
string
Returns
PivotCandidateSet | undefined
canonicalId()
canonicalId(
element):string|undefined
Defined in: PivotManager.ts:1254
The id the source system assigned this element, when it assigned one.
Parameters
element
Returns
string | undefined
Implementation of
PivotManagerLike.canonicalId
discard()
discard(
pivotId):void
Defined in: PivotManager.ts:846
Drop a staged set without rejecting anything. Closing a pane is not a verdict: whatever was never rejected is offered again on the next run.
Parameters
pivotId
string
Returns
void
dismissPending()
dismissPending(
pivotId):void
Defined in: PivotManager.ts:833
Drop a waiting re-run and carry on with what is on show. Nothing is rejected: the next run offers those candidates again.
Parameters
pivotId
string
Returns
void
Implementation of
PivotManagerLike.dismissPending
for()
for(
nodes):PivotDefinition[]
Defined in: PivotManager.ts:285
What applies to this origin. An empty origin yields the origin-less pivots — search, import, staging — and nothing else, because a selection-driven pivot with no selection has nothing to run on.
A pivot that applies to only part of the origin is in: a selection mixing a domain and an IP offers the domain-only providers too, and each is run against the nodes it kept.
Parameters
nodes
Node[]
Returns
Implementation of
PivotManagerLike.for
get()
get(
id):PivotDefinition|undefined
Defined in: PivotManager.ts:262
Parameters
id
string
Returns
PivotDefinition | undefined
Implementation of
PivotManagerLike.get
ingest()
ingest(
pivotId,trigger,options):Promise<PivotRunOutcome>
Defined in: PivotManager.ts:864
Commit the marked candidates of one staged set.
Purely additive: an id already on canvas is skipped, never overwritten, and removal only ever happens through graph.history or graph.removeBySource. The whole batch goes through onBeforeIngest once, and lands as one dataBatchChanged.
group folds the landing into groups, one per type (graph.simplify.groupLanding), and defaults to ingestGrouped.
Parameters
pivotId
string
trigger
"auto" | "triage"
options
group?
boolean
Returns
Promise<PivotRunOutcome>
invalidate()
invalidate(
pivotId?,nodes?):void
Defined in: PivotManager.ts:389
Drop cached summaries: all of them, one pivot's, or only those asked about particular nodes. The library caches because a multi-selection summary is an aggregate nothing can decompose, but only the consumer knows when their backend changed.
Parameters
pivotId?
string
nodes?
Node[]
Returns
void
Implementation of
PivotManagerLike.invalidate
isSavable()
isSavable(
element):boolean
Defined in: PivotManager.ts:1247
Whether this element came from a run whose pivot declares a save.
Parameters
element
Returns
boolean
Implementation of
PivotManagerLike.isSavable
isSaved()
isSaved(
element):boolean
Defined in: PivotManager.ts:1242
Written to the source system. false both for an element still waiting and for one whose pivot can never write it anywhere — isSavable is the question that tells those two apart.
Parameters
element
Returns
boolean
Implementation of
PivotManagerLike.isSaved
mark()
mark(
pivotId,id,marked):void
Defined in: PivotManager.ts:715
Mark or unmark a candidate for ingest. Deliberately silent: with hundreds of rows, re-rendering the pane on every tick loses the analyst's place, so the caller updates the row it just changed.
Parameters
pivotId
string
id
string
marked
boolean = true
Returns
void
markAll()
markAll(
pivotId,marked):void
Defined in: PivotManager.ts:722
Mark every landable candidate — what "select all" resolves to.
Parameters
pivotId
string
marked
boolean = true
Returns
void
on()
on(
listener): () =>void
Defined in: PivotManager.ts:1581
Subscribe to pivot state changes — the registry, a summary, the staged candidates, the run stack. Returns a disposer.
Parameters
listener
(change) => void
Returns
():
void
Returns
void
originFor()
originFor(
id,nodes):Node[]
Defined in: PivotManager.ts:313
How much of nodes one pivot applies to. Empty when it does not apply, and empty for an origin-less pivot, which is asked about nothing by definition.
Parameters
id
string
nodes
Node[]
Returns
Node[]
Implementation of
PivotManagerLike.originFor
register()
register(
definition): () =>void
Defined in: PivotManager.ts:229
Register a pivot. Returns a disposer; calling it twice is a no-op. A duplicate id is skipped with a warning, as everywhere else in the library.
Parameters
definition
Returns
():
void
Returns
void
Implementation of
PivotManagerLike.register
reject()
reject(
pivotId,ids):void
Defined in: PivotManager.ts:741
Reject candidates explicitly. Remembered for the session, keyed per pivot: a candidate rejected under one pivot is still offered by another, which asks about it in a different analytic context.
Parameters
pivotId
string
ids
string[]
Returns
void
rejectedCount()
rejectedCount(
pivotId):number
Defined in: PivotManager.ts:791
How many candidates have been rejected for this pivot this session.
Parameters
pivotId
string
Returns
number
rejectedIds()
rejectedIds(
pivotId):string[]
Defined in: PivotManager.ts:796
The rejected candidate ids for this pivot — what the pane reveals on demand.
Parameters
pivotId
string
Returns
string[]
rejectedRows()
rejectedRows(
pivotId):PivotRejection[]
Defined in: PivotManager.ts:804
The rejections themselves, rows and all, newest last. What a surface listing them shows: an id names nothing once the run that carried it is gone.
Parameters
pivotId
string
Returns
rejectRemaining()
rejectRemaining(
pivotId):void
Defined in: PivotManager.ts:769
Reject everything still untriaged in this set — how triaging 1,800 down to 12 and dismissing the rest stays one gesture.
Parameters
pivotId
string
Returns
void
run()
run(
id,nodes,narrowing,options):Promise<PivotRunOutcome>
Defined in: PivotManager.ts:428
Run a pivot: gate the advertised count against its cap, fetch, then either land the results (autoIngest) or stage them for triage.
Resolves at the hand-off — a staged run does not wait on the analyst. The outcome's runId is the id the resulting ingest is recorded under, so it is the handle for graph.history.undo.
Parameters
id
string
nodes
Node[] = []
narrowing
PivotNarrowing = {}
options
PivotRunOptions = {}
Returns
Promise<PivotRunOutcome>
Implementation of
PivotManagerLike.run
save()
save(
target?,options?):Promise<PivotSaveReport>
Defined in: PivotManager.ts:1105
Write ingested runs back out to the systems their pivots speak to: one run, or every savable run with something still unsaved.
The library contributes the bookkeeping, not the transport — which elements a run created, which of them have been written, and what a retry should carry. The write itself is PivotDefinition.save's, and a pivot that declares none is skipped entirely rather than counted as failing.
Runs go one at a time: a backend being written to is not helped by six parallel batches, and a sequential pass makes the report exact.
Parameters
target?
A run id for one run, a pivot id for every unsaved run of that pivot, { elements } for just those, or nothing for all of them.
string | PivotSaveSelection
options?
PivotSaveOptions = {}
interactive: true when an analyst asked for it, so a save can prompt.
Returns
Promise<PivotSaveReport>
Implementation of
PivotManagerLike.save
showPending()
showPending(
pivotId):void
Defined in: PivotManager.ts:820
Promote a waiting re-run: its candidates become the set on show, and the marks on the one it replaces go with it. A no-op while the re-run is still fetching — swapping in a set with nothing in it yet would be the silent discard this whole mechanism exists to avoid.
Parameters
pivotId
string
Returns
void
Implementation of
PivotManagerLike.showPending
staged()
staged():
PivotCandidateSet[]
Defined in: PivotManager.ts:706
Every staged candidate set — one per pivot that has been run and not yet cleared.
Returns
summarize()
summarize(
id,nodes,narrowing):Promise<PivotSummary|undefined>
Defined in: PivotManager.ts:347
Ask a pivot what is out there. Serves a cached answer without touching the provider, and supersedes any summarize already in flight for the same pivot.
Resolves undefined when the call was superseded or cancelled — nothing to render, and never an error. A provider that throws rejects, so a surface can show the failure and offer a retry.
Parameters
id
string
nodes
Node[] = []
narrowing
PivotNarrowing = {}
Returns
Promise<PivotSummary | undefined>
unregister()
unregister(
id):void
Defined in: PivotManager.ts:254
Unregister a pivot, dropping its cached summaries and its staged candidates.
Parameters
id
string
Returns
void
Implementation of
PivotManagerLike.unregister
unreject()
unreject(
pivotId,id):void
Defined in: PivotManager.ts:758
Take a rejection back. Reaches the session memory whether or not the candidate is still staged — a rejection from an earlier run suppresses the row rather than showing it, and taking it back is the only way that row is ever offered again.
Parameters
pivotId
string
id
string
Returns
void
unrejectAll()
unrejectAll(
pivotId):void
Defined in: PivotManager.ts:779
Take every rejection this pivot holds back. The way out of a Reject all remaining that went too far, which one-by-one restoring is not.
Parameters
pivotId
string
Returns
void
unsaved()
unsaved():
PivotRun[]
Defined in: PivotManager.ts:1220
Savable runs with elements still on canvas and not yet written.
Returns
PivotRun[]
Implementation of
PivotManagerLike.unsaved
unsavedCount()
unsavedCount(
pivotId?):object
Defined in: PivotManager.ts:1225
What a Save would send — across every savable run, or one pivot's.
Parameters
pivotId?
string
Returns
object
edges
edges:
number
nodes
nodes:
number
Implementation of
PivotManagerLike.unsavedCount
Properties
candidateCeiling
candidateCeiling:
number=10_000
Defined in: PivotManager.ts:57
Absolute ceiling on what one fetch may stage. A provider that returns more is refused — nothing is staged, nothing is truncated, and the analyst is told the number. It is about memory for candidate objects, not the table, which virtualises. Override it through pivotCandidateCeiling in the graph options.
Implementation of
PivotManagerLike.candidateCeiling
ingestGrouped
ingestGrouped:
boolean=false
Defined in: PivotManager.ts:73
Whether an ingest lands folded into groups, one per type, when its caller does not say. Set it through pivotIngestGrouped in the graph options, or here to change it later. Does nothing while the graph does not simplify.
markUnsaved
markUnsaved:
boolean=false
Defined in: PivotManager.ts:80
Whether a node a run created and has not written back carries a pvt-node-unsaved class. Set it through pivotMarkUnsaved in the graph options, or here to change it later.
quickIngestLimit
quickIngestLimit:
number=50
Defined in: PivotManager.ts:66
How many new candidates a one-click pivot lands without triage. The number is about the canvas rather than the clicking: undo takes an ingest back but not the layout the simulation made around it, so the limit is roughly what a graph can absorb and still be the graph the analyst was reading. Override it through pivotQuickIngestLimit in the graph options.
Implementation of
PivotManagerLike.quickIngestLimit