Skip to content

pivotick v3.0.0


pivotick / GraphUI / DockTab

Interface: DockTab ​

Defined in: interfaces/GraphUI.ts:1365

A pane in the bottom dock — one entry in its tab strip.

The dock owns the region: the grid row, its height, the resize divider and the fold. A tab owns what is in it — a body, and optionally its own header controls, which the dock swaps in and out as the active tab changes. With only one tab registered no strip is drawn at all; there is nothing to switch.

Register one at any point in the graph's life with graph.UIManager.addDockTab(), or from a plugin's install via ctx.addDockTab(). Either returns a disposer.

One tab is one pane, not one view of one. A pane with several views of its own — the data table's Nodes and Edges — is a single dock tab that draws its own switch in its toolbar and calls DockTabHandle.refresh to change body. So the dock's strip lists panes (Table, Events) and never flattens one pane's views out alongside another pane; the two levels are drawn differently for the same reason.

The data table is itself just such a tab, so a registered tab is exactly as privileged as the built-in one.

Example ​

js
const dispose = graph.UIManager.addDockTab({
    label: 'Audit',
    render: () => myAuditPane(),
    toolbar: () => [clearButton],
})

Extended by ​

Properties ​

icon? ​

optional icon: string

Defined in: interfaces/GraphUI.ts:1382

A glyph drawn before the label in the strip, marking where the pane came from.

An SVG string, injected with innerHTML and not sanitised — it must be trusted, exactly like PivotDefinition.icon. Useful when several tabs are the same kind of pane: four candidate reviews and a data table read as one list of five otherwise.


id? ​

optional id: string

Defined in: interfaces/GraphUI.ts:1371

Stable identity: what removeDockTab / activateDockTab take, and the data-tab written onto the strip's button.

Default ​

an auto-generated pvt-dock-tab-N


label ​

label: string

Defined in: interfaces/GraphUI.ts:1373

The strip's label, used verbatim (so it can be translated).


onActivate()? ​

optional onActivate: (tab) => void

Defined in: interfaces/GraphUI.ts:1412

Called when this tab comes to the front, and when it leaves. A tab that watches live data should stop working in onDeactivate and catch up in onActivate: nothing else tells it that it is off screen.

Parameters ​

tab ​

DockTabHandle

Returns ​

void


onDeactivate()? ​

optional onDeactivate: (tab) => void

Defined in: interfaces/GraphUI.ts:1413

Parameters ​

tab ​

DockTabHandle

Returns ​

void


order? ​

optional order: number

Defined in: interfaces/GraphUI.ts:1406

Display order in the strip, ascending. Equal orders keep registration order — and since plugins install after the UI is built, a plugin's tabs land after the built-in ones without having to say so.

Default ​

ts
0

render() ​

render: (tab) => HTMLElement

Defined in: interfaces/GraphUI.ts:1388

Build the pane's body. Called once, lazily, the first time the tab comes to the front — a tab nobody opens costs nothing. The element is kept and re-attached on later activations, so it holds its own state (scroll position included).

Parameters ​

tab ​

DockTabHandle

Returns ​

HTMLElement


toolbar()? ​

optional toolbar: (tab) => HTMLElement | HTMLElement[]

Defined in: interfaces/GraphUI.ts:1399

Build this tab's header controls, laid out as part of the dock's header row. Re-invoked on every activation, so the controls can reflect the tab's current state.

A pane with several views of its own draws the switch here. Two public classes give it the same look the built-in table has — pvt-dock-views on the strip, pvt-dock-view on each button, active on the current one — so it stays a pill group beside the dock's own tabs and follows the theme.

Parameters ​

tab ​

DockTabHandle

Returns ​

HTMLElement | HTMLElement[]