pivotick / PivotickPlugin
Interface: PivotickPlugin
Defined in: interfaces/Plugin.ts:31
A Pivotick plugin: a self-contained bundle of UI elements, keybindings and lifecycle hooks that installs itself into a graph without the core needing to know it exists.
Register one either declaratively via GraphOptions.plugins, or imperatively via Graph.use:
ts
const minimap: PivotickPlugin = {
name: 'minimap',
install(ctx) {
ctx.addElement(new MinimapPanel(ctx.ui), ctx.layout?.canvas)
ctx.addKeybinding({ key: 'm', callback: () => ... })
},
}
new Graph(el, data, { plugins: [minimap] })
// or
graph.use(minimap)Methods
install()
install(
ctx):void
Defined in: interfaces/Plugin.ts:35
Called once when the plugin is installed.
Parameters
ctx
Returns
void
Properties
name
name:
string
Defined in: interfaces/Plugin.ts:33
Stable identifier, used for logging and de-duplication.