PluginContext
The context every plugin hook receives (createInstance, createSidebarController, bindEvents).
Properties
datasetObjectrequiredWhat 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.
configObjectrequiredThe project's configuration as the viewer loaded it.
columnsstring[]requiredColumns of the cell table.
dataLayerObjectrequiredClient for the server's data routes.
eventHandlerObjectrequiredThe page's event bus.
channelListObjectrequiredThe Image Channels controller.
viewerObjectrequiredThe OpenSeadragon-based image viewer.
datasourcestringrequiredThe project's name.
coreEventsObjectrequiredNames of core events a plugin may subscribe to on eventHandler.
url(path: string) => stringrequiredBuild 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>}requiredAsk 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.
layersPluginLayerApirequiredThe rendering API.
sample{name: string, bundles: Object[], reference: ?Object, modalities: string[], blank: boolean}requiredWhat 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.
viewObjectrequiredThe 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) => voidrequiredRegister a function to run when the plugin is torn down.
instance?ObjectrequiredWhat createInstance returned.