Skip to content

pivotick v3.0.0


pivotick / PluginContext

Interface: PluginContext ​

Defined in: interfaces/Plugin.ts:43

The capabilities handed to a plugin's PivotickPlugin.install. Anything registered here is driven by the same lifecycle as the built-in UI and torn down with it.

Methods ​

addDockTab() ​

addDockTab(tab): () => void

Defined in: interfaces/Plugin.ts:88

Register a pane in the bottom dock — the same door as UIManager.addDockTab, and the one the built-in table comes through. Returns a disposer.

The first tab builds the region, so a plugin does not have to ask the consumer to turn the dock on: full mode is the only requirement.

Parameters ​

tab ​

DockTab

Returns ​

(): void

Returns ​

void


addElement() ​

addElement(element, slot?): void

Defined in: interfaces/Plugin.ts:70

Add a UI element into the lifecycle. When slot is given the element is mounted into it immediately; it then participates in every subsequent phase (afterMount / graphReady / destroy). Safe to call after the graph is already live — the element is caught up to the current phase.

Parameters ​

element ​

UIComponent

slot? ​

HTMLElement

Returns ​

void


addKeybinding() ​

addKeybinding(binding): void

Defined in: interfaces/Plugin.ts:132

Register a keybinding that is automatically removed when the UI is torn down.

Parameters ​

binding ​

Keybinding

Returns ​

void


addPanel() ​

addPanel(panel): () => void

Defined in: interfaces/Plugin.ts:76

Register a sidebar panel — the same door as UI.extraPanels and UIManager.addPanel. Returns a disposer; the panel is re-rendered on every selection change and torn down with the UI.

Parameters ​

panel ​

ExtraPanel

Returns ​

(): void

Returns ​

void


addPivot() ​

addPivot(definition): () => void

Defined in: interfaces/Plugin.ts:128

Register a pivot — the same door as graph.pivots.register and the pivots option, and the way a plugin ships an enrichment. Returns a disposer.

The Pivot rail mode appears as soon as the first pivot is registered and goes when the last one leaves, so a plugin does not have to ask the consumer to turn anything on.

Parameters ​

definition ​

PivotDefinition

Returns ​

(): void

Returns ​

void


addRailMode() ​

addRailMode(mode): () => void

Defined in: interfaces/Plugin.ts:110

Register a mode on the mode rail — the same door as UIManager.addRailMode, and the way a plugin ships its own Explore or Enrich mode. Returns a disposer.

Registered modes render below a divider, after the four built-in modes. Registration succeeds in every mode; the button is only drawn where there is a rail (full and light).

Parameters ​

mode ​

RailModeDefinition

Returns ​

(): void

Returns ​

void


addTopBarAction() ​

addTopBarAction(action): () => void

Defined in: interfaces/Plugin.ts:117

Add a pill to the top bar — the same door as UIManager.addTopBarAction and UI.topBar.actions. Returns a disposer. ui.refreshTopBar() re-reads its fields.

Parameters ​

action ​

TopBarAction

Returns ​

(): void

Returns ​

void


onPhase() ​

onPhase(phase, callback): () => void

Defined in: interfaces/Plugin.ts:130

Hook a lifecycle phase. Returns an unsubscribe function.

Parameters ​

phase ​

UIPhase

callback ​

() => void

Returns ​

(): void

Returns ​

void


refreshDockTab() ​

refreshDockTab(id): void

Defined in: interfaces/Plugin.ts:96

Rebuild a dock tab from its render and toolbar — for when the pane's own data or chosen view changed. The same thing a DockTabHandle's refresh() does, for code that holds the id rather than the handle.

Parameters ​

id ​

string

Returns ​

void


refreshPanel() ​

refreshPanel(id?): void

Defined in: interfaces/Plugin.ts:80

Re-render one sidebar panel, or all of them when id is omitted.

Parameters ​

id? ​

string

Returns ​

void


removeDockTab() ​

removeDockTab(id): void

Defined in: interfaces/Plugin.ts:90

Remove a dock tab by id (equivalent to calling its disposer).

Parameters ​

id ​

string

Returns ​

void


removePanel() ​

removePanel(id): void

Defined in: interfaces/Plugin.ts:78

Remove a sidebar panel by id (equivalent to calling its disposer).

Parameters ​

id ​

string

Returns ​

void


removeRailMode() ​

removeRailMode(id): void

Defined in: interfaces/Plugin.ts:112

Remove a rail mode by id (equivalent to calling its disposer).

Parameters ​

id ​

string

Returns ​

void


removeTopBarAction() ​

removeTopBarAction(id): void

Defined in: interfaces/Plugin.ts:119

Remove a top-bar action by id (equivalent to calling its disposer).

Parameters ​

id ​

string

Returns ​

void


setDockTabLabel() ​

setDockTabLabel(id, label): void

Defined in: interfaces/Plugin.ts:101

Rename a dock tab in the strip, leaving its body and its scroll position alone — a live count, without re-registering the tab.

Parameters ​

id ​

string

label ​

string

Returns ​

void

Properties ​

graph ​

graph: Pivotick

Defined in: interfaces/Plugin.ts:44


i18n ​

i18n: I18n

Defined in: interfaces/Plugin.ts:63

The graph's language: its locale, the number, list and sort formats, and t over the library's own messages. Text the plugin writes itself is the plugin's to translate, keyed on i18n.locale.


keyManager ​

keyManager: KeybindingManager

Defined in: interfaces/Plugin.ts:57


layout ​

layout: Layout | undefined

Defined in: interfaces/Plugin.ts:56

The root DOM scaffold, read live from the UI (never a stale snapshot). It exists in every mode while the UI is alive and is undefined only after the UI is destroyed. Its slots are what vary by mode: canvas and notification always; graphnavigation in every mode except static; mainheader / modal / slidePanel / moderail / toolpanel / flyout / legend in full and light; sidebar in full only.

canvas is the slot a canvas-docked element wants — see the minimap plugin.


ui ​

ui: UIManager

Defined in: interfaces/Plugin.ts:45