pivotick - v2.0.1
    Preparing search index...

    Interface PluginContext

    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.

    interface PluginContext {
        graph: Pivotick;
        keyManager: KeybindingManager;
        layout: Layout | undefined;
        ui: UIManager;
        addDockTab(tab: DockTab): () => void;
        addElement(element: UIComponent, slot?: HTMLElement): void;
        addKeybinding(binding: Keybinding): void;
        addPanel(panel: ExtraPanel): () => void;
        addPivot(definition: PivotDefinition): () => void;
        addRailMode(mode: RailModeDefinition): () => void;
        onPhase(phase: UIPhase, callback: () => void): () => void;
        refreshDockTab(id: string): void;
        refreshPanel(id?: string): void;
        removeDockTab(id: string): void;
        removePanel(id: string): void;
        removeRailMode(id: string): void;
        setDockTabLabel(id: string, label: string): void;
    }
    Index

    Methods

    • 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

      Returns () => void

    • 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

      Returns void

    • 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

      Returns () => void

    • 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

      Returns () => void

    • 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

      Returns () => void

    • Hook a lifecycle phase. Returns an unsubscribe function.

      Parameters

      Returns () => void

    • 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

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

      Parameters

      • Optionalid: string

      Returns void

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

      Parameters

      • id: string

      Returns void

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

      Parameters

      • id: string

      Returns void

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

      Parameters

      • id: string

      Returns void

    • 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: Pivotick
    keyManager: KeybindingManager
    layout: Layout | undefined

    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: UIManager