pivotick - v2.0.1
    Preparing search index...

    Interface RailModeDefinition

    A mode registered onto the mode rail — the door an integrator builds their own Explore or Enrich mode through.

    Registered modes render below a divider, after the four built-in modes, ordered by order. Register one at any point in the graph's life with graph.UIManager.addRailMode(), or from a plugin's install via ctx.addRailMode(). Either returns a disposer.

    A 'pointer' mode owns the contextual tool panel: it declares tools, and may add anything else through render. A 'flyout' mode instead supplies a flyout factory whose panel opens while the mode is active.

    const dispose = graph.UIManager.addRailMode({
    id: 'explore', label: 'Explore', icon: compassSvg, shortcut: 'E',
    tools: [{ id: 'expand', label: 'Expand', icon: plusSvg, kind: 'action', run: () => … }],
    })
    interface RailModeDefinition {
        defaultTool?: string | null;
        flyout?: (ui: UIManager) => Flyout;
        icon: string;
        id: string;
        keepPanelOpen?: boolean;
        kind?: "pointer" | "flyout";
        label: string;
        onEnter?: () => void;
        onExit?: () => void;
        order?: number;
        panelOpen?: boolean;
        panelResizable?: boolean;
        panelWidth?: number;
        render?: () => HTMLElement;
        shortcut?: string;
        tools?: RailTool[] | (() => RailTool[]);
    }
    Index

    Properties

    defaultTool?: string | null

    The tool this mode rests on when nothing is armed.

    null
    
    flyout?: (ui: UIManager) => Flyout

    Builds this mode's flyout panel. Required for kind: 'flyout' and ignored otherwise. The panel is mounted into the flyout slot and torn down with the mode; the subclass's own mode must equal this definition's id.

    icon: string

    An SVG string, injected with innerHTML and not sanitised — it must be trusted. CSS sizes it to 20px on the rail.

    id: string

    Stable identity: what the store holds, and the data-mode on the rail button.

    keepPanelOpen?: boolean

    Keep the panel open when one of this mode's tools is armed. Arming normally collapses the panel so the canvas is clear — right for Select's Lasso, wrong for a mode whose panel is the workspace and whose tools only say how to feed it.

    false
    
    kind?: "pointer" | "flyout"

    'pointer' modes own the tool panel; 'flyout' modes open a settings overlay and have no tools.

    'pointer'
    
    label: string

    The rail button's label, used verbatim.

    onEnter?: () => void

    Called when the mode becomes active.

    onExit?: () => void

    Called when the mode is left, and when it is unregistered while active. Disarm whatever the mode armed here. Not called on UI teardown — use the disposers your plugin already tracks for that.

    order?: number

    Display order among registered modes, ascending. Equal orders keep registration order. Does not affect the built-in modes, which always come first.

    0
    
    panelOpen?: boolean

    Whether the tool panel is expanded the first time the mode is entered. Defaults to open so the mode's tools are discoverable.

    true
    
    panelResizable?: boolean

    Let the analyst drag this mode's panel wider or narrower by its right edge.

    Off by default: a panel of icon rows has one right width, and a handle on it is a control with nothing to do. A mode whose panel is the workspace — a form, a list, a set of results — is where the choice is worth offering. The width is remembered per mode for the session and is not persisted, so a reload starts from panelWidth again.

    false
    
    panelWidth?: number

    How wide this mode's tool panel is, in pixels. The built-in width fits a row of icon + label; a mode whose render slot holds a form or a list needs more.

    216
    
    render?: () => HTMLElement

    Extra panel content, appended below the tool rows — a slider, a search box, anything the rows cannot express. Re-invoked whenever the panel is rebuilt.

    shortcut?: string

    A single key that activates the mode, or toggles its panel when it is already active. Registered through the normal keybinding manager, so a key already bound is shadowed (with a warning) until this mode is removed.

    tools?: RailTool[] | (() => RailTool[])

    The mode's tools, as rows in its panel. Pass a function when the set depends on the current selection or data; it is re-read on every render.