Browser API
What a plugin's JavaScript registers with the viewer, and the context every hook receives.
A plugin's browser script calls Plexora.registerPlugin(definition) when it loads. The viewer activates it when the tool opens and passes every hook a context object. The pages below are generated from the type definitions in the viewer's own source, so they describe exactly what the running version provides.
Plexora.registerPlugin({
name: "my_tool",
createInstance(ctx) {
return { markers: ctx.dataset.markers };
},
createSidebarController(ctx) {
return {
setup() {
ctx.sidebar.textContent = `${ctx.sample.name}: ${ctx.columns.length} columns`;
},
};
},
});PluginDefinition
What a plugin's browser script passes to Plexora.registerPlugin. Only name is required; every hook is optional.
PluginHelp
Help shown by the ? button in a tool's card header. All of it is plain text, never HTML.
SidebarController
The object createSidebarController returns. Every method is optional; toolLoader.js calls them as the panel's life goes on.
PluginContext
The context every plugin hook receives (createInstance, createSidebarController, bindEvents).
PluginLayerApi
ctx.layers: the viewer's rendering primitives, scoped to one plugin.
LayerRecord
One layer of the sample, as ctx.layers.list() and find() return it.