Plexora

PluginDefinition

What a plugin's browser script passes to Plexora.registerPlugin. Only name is required; every hook is optional.

Generated from Plexora 0.0.55View source

Properties

namestringrequired

The plugin's name. Must equal the name of the Python Plugin descriptor, which is how the page connects the script to the tool.

createInstance(ctx: PluginContext) => Object

Build the plugin's main object when the tool is activated. Whatever it returns is handed to the other hooks as ctx.instance. If it has an init(databaseDescription, viewer) method, core calls it once before tiles load.

createSidebarController(ctx: PluginContext) => (SidebarController|null)

Build the controller for the plugin's sidebar panel. ctx also carries sidebar (the panel element) and moduleInstance.

bindEvents(ctx: PluginContext) => void

Subscribe to core events. ctx also carries seaDragonViewer, moduleInstance, updateSeaDragonSelection, updateCentroidsForGate() and runSegmentationGate(showSpinner); the last two act on this plugin's own cell layer.

ownsCellLayerboolean

This plugin colours cells. It gets a cell layer of its own (colours, gate, mode, opacity) and a card in the sidebar. Several may be live at once; card order is compositing order.

preferredCellModestring

How the mask should be drawn when this plugin's layer is first turned on: "filled", "outlines" or "centroids". Defaults to "outlines". Never overrules a choice the user already made, and is ignored when the mask cannot be drawn that way.

supportedCellModesstring[]

The subset of ["centroids", "outlines", "filled"] this plugin can work with. The Cells control offers only these while the plugin's layer is active. Omit for whatever the project can draw. Include "none" to keep the None option on the row while the layer is active (it is otherwise left to the card's eye).

cellLayerOnDemandboolean

The layer is registered but not turned on when the plugin activates; the plugin turns it on with ctx.layers.showCells() when its cells are asked for.

helpPluginHelp

What the ? in the tool's card header explains. Without it there is no ?. Core draws the button and the dialog, and adds the open/close row for the descriptor's shortcut.

destroy() => void

Release anything global before the plugin is torn down. Prefer ctx.onCleanup(fn), which is called for you.

lazyboolean

The script is on every viewer page rather than fetched when the tool opens. It is activated only when its panel is staged (?tool=) or the tool is opened.

hasLayerboolean

false when the tool draws nothing, so its card has no visibility toggle. Defaults to true.