Global

Methods

addPlugin(id, PluginClass)

Register plugin. Plugin can be instantiated and embedded into the viewer.
Parameters:
Name Type Description
id plugin id, should be unique in the system and match the id value in includes.json
PluginClass class/class-like-function to register (not an instance!)
Source:

attachScript(pluginId, properties, onload)

Load a script at runtime. Plugin is REMOVED from the viewer if the script is faulty Enhancement: use Premise API instead
Parameters:
Name Type Description
pluginId plugin that uses particular script
properties script attributes to set
onload function to call on success
Source:

get(key, defaultValue) → {any}

Parameters:
Name Type Description
key any
defaultValue any returned only in case undefined would be returned
Source:
Returns:
value to store, or undefined in the default value is missing
Type
any

get(key, defaultValue) → {any}

Parameters:
Name Type Description
key any
defaultValue any returned only in case undefined would be returned
Source:
Returns:
value to store, or undefined in the default value is missing
Type
any

initXOpatLoader(PLUGINS, MODULES, PLUGINS_FOLDER, MODULES_FOLDER, POST_DATA, version, awaitPluginReady) → {function}

Init loading system in xOpat. Do not use in the viewer, use only if you manually want to reuse plugins/modules elsewhere. IMPORTANT Use: const initPlugins = initXOpatLoader(PLUGINS, MODULES, PLUGINS_FOLDER, MODULES_FOLDER, VERSION); call when all ready: initPlugins();
Parameters:
Name Type Default Description
PLUGINS
MODULES
PLUGINS_FOLDER
MODULES_FOLDER
POST_DATA can be empty object if no data is supposed to be loaded
version
awaitPluginReady false if true, returned handler awaits plugins
Source:
Returns:
initializer function to call once ready
Type
function

plugin(id)

Get plugin.
Parameters:
Name Type Description
id plugin id, should be unique in the system and match the id value in includes.json
Source:

set(key, value)

Parameters:
Name Type Description
key string
value string
Source:

set(key, value)

Parameters:
Name Type Description
key string
value string
Source:

with(options)

Provide cookie setter with setting options
Parameters:
Name Type Description
options object
Source:
Returns:
XOpatStorage.Cookies

xOpatParseConfiguration(postData, i18n, supportsPost) → {*|Object}

Client-side parsing of the viewer session configuration
Parameters:
Name Type Description
postData object post data available to the viewer if any
i18n i18next translation context
supportsPost whether the server implementation supports post data
Source:
Returns:
Type
* | Object

Type Definitions

BackgroundItem

Type:
object
Properties:
Name Type Attributes Description
dataReference number index to the `data` array, can be only one unlike in `shaders`
lossless boolean <nullable>
default `false` if the data should be sent from the server as 'png' or 'jpg'
protocol string <nullable>
see protocol construction below in advanced details
protocolPreview string <nullable>
as above, must be able to generate file preview (fetch top-level tile)
microns number <nullable>
size of pixel in micrometers, default `undefined`,
micronsX number <nullable>
horizontal size of pixel in micrometers, default `undefined`, if general value not specified must have both X,Y
micronsY number <nullable>
vertical size of pixel in micrometers, default `undefined`, if general value not specified must have both X,Y
name string <nullable>
custom tissue name, default the tissue path
goalIndex number <nullable>
preferred visualization index for this background, ignored if `stackedBackground=true`, overrides `activeVisualizationIndex` otherwise
Source:
Type:
Object
Source:

ScaleBarConfig

Type:
object
Properties:
Name Type Description
viewer OpenSeadragon.Viewer The viewer to attach this Scalebar to.
type OpenSeadragon.ScalebarType The scale bar type. Default: microscopy
pixelsPerMeter Number | undefined The pixels per meter of the zoomable image at the original image size. If null, the scale bar is not displayed. default: null
pixelsPerMeterX Number | undefined The measurement in vertical units, need to specify both X, Y if general not given
pixelsPerMeterY Number | undefined The measurement in horizontal units, need to specify both X, Y if general not given
magnification Number | undefined The maximum magnification availeble in the image (e.g. 20 for 20x or 40 for 40x magnification)
(String} minWidth The minimal width of the scale bar as a CSS string (ex: 100px, 1em, 1% etc...) default: 150px
location OpenSeadragon.ScalebarLocation The location of the scale bar inside the viewer. default: bottom left
xOffset Integer Offset location of the scale bar along x. default: 5
yOffset Integer Offset location of the scale bar along y. default: 5
stayInsideImage Boolean When set to true, keep the scale bar inside the image when zooming out. default: true
color String The color of the scale bar using a color name or the hexadecimal format (ex: black or #000000) default: black
fontColor String The font color. default: black
backgroundColor String The background color. default: none
fontSize String The font size. default: not set
fontFamily String The font-family. default: not set
barThickness String The thickness of the scale bar in px. default: 2
sizeAndTextRenderer function A function which will be
destroy boolean
Author:
Source:

TileSourceMetadata

Type:
object
Properties:
Name Type Attributes Description
error string <optional>
error message, if the source should be treated as faulty one
microns number <optional>
pixel size in micrometers (used instead of X+Y variant, chose one)
micronsX number <optional>
pixel size in micrometers in X dimension (used together with micronsY instead of microns)
micronsY number <optional>
pixel size in micrometers in Y dimension
Source:

VisualizationItem

Type:
object
Properties:
Name Type Attributes Description
dataReference number index to the `data` array, can be only one unlike in `shaders`
lossless boolean <nullable>
default `false` if the data should be sent from the server as 'png' or 'jpg'
protocol string <nullable>
see protocol construction below in advanced details
protocolPreview string <nullable>
as above, must be able to generate file preview (fetch top-level tile)
microns number <nullable>
size of pixel in micrometers, default `undefined`,
micronsX number <nullable>
horizontal size of pixel in micrometers, default `undefined`, if general value not specified must have both X,Y
micronsY number <nullable>
vertical size of pixel in micrometers, default `undefined`, if general value not specified must have both X,Y
name string <nullable>
custom tissue name, default the tissue path
goalIndex number <nullable>
preferred visualization index for this background, ignored if `stackedBackground=true`, overrides `activeVisualizationIndex` otherwise
Source:

xoEnv

xOpat Static configuration: 'ENV'
Source:

xoServerState

The Server status. This object is here just for the reference and to provide default values; the server shall set up these properties accordingly. DO NOT modify these
Type:
Object
Source: