Plexora

PluginContext

The context every plugin hook receives (createInstance, createSidebarController, bindEvents).

Generated from Plexora 0.0.55View source

Properties

datasetObjectrequired

What the plugin is given about the project: image data always, plus segmentation and the feature table when the project has them. Live, so layers adopted mid-session appear.

configObjectrequired

The project's configuration as the viewer loaded it.

columnsstring[]required

Columns of the cell table.

dataLayerObjectrequired

Client for the server's data routes.

eventHandlerObjectrequired

The page's event bus.

channelListObjectrequired

The Image Channels controller.

viewerObjectrequired

The OpenSeadragon-based image viewer.

datasourcestringrequired

The project's name.

coreEventsObjectrequired

Names of core events a plugin may subscribe to on eventHandler.

url(path: string) => stringrequired

Build a URL on this server (it adds the base path when Plexora runs behind a proxy). Use it for every request to the plugin's own routes.

requirements{require: (keys: string[]) => Promise<boolean>}required

Ask the user for something the plugin's Requires declared but the project lacks. Resolves true once it is recorded. Never build your own "type a column name" input.

layersPluginLayerApirequired

The rendering API.

sample{name: string, bundles: Object[], reference: ?Object, modalities: string[], blank: boolean}required

What this sample is: its name, the run folders it came from, its reference image layer, the modalities present, and whether it has no image of its own.

viewObjectrequired

The view on screen and the room over it. On a z-stack: planes(), frame(), tableFrame(), labelsAre3d(), setPlane(z, t), label(), onChange(fn), and addSectionOverlay(id, provider) to draw in the XZ / YZ panes. On every image: dock(element, {corner, order, collapse}) floats a control over the image in core's canvas layout -- corners "top-left", "top-right", "bottom-left", "bottom-right", "top-center", "bottom-center"; lower order nearer the corner, core's own at 0 -- stacked with core's controls and never under the depth strip or a section pane (the same as appending it to #openseadragon_wrapper with data-canvas-dock); movable(element, {id, handle}) lets the user drag a control anywhere over the image and put it back, remembered for the tab; reserve(id, {edge, size}) takes a band along an edge for a panel of the plugin's own, and docked controls step clear of it; insets() says what the bands take; controls declares a depth control of the plugin's own and asks which are offered (services/viewControls.js). All undone with the plugin.

onCleanup(fn: Function) => voidrequired

Register a function to run when the plugin is torn down.

instance?Objectrequired

What createInstance returned.