Classes
- Annotation
- AudioPlayer
- BoundingBox
- Cache
- Camera
- Canvas
- Color
- Colormap
- ColormapLegend
- Controller
- Controller2D
- ControllerFocusContext
- ControllerLens
- ControllerPanZoom
- CoordinateSystem
- Draggable
- EditorSvgAnnotation
- Erase
- FocusContext
- GeoreferenceManager
- Layer
- LayerAnnotation
- LayerAnnotationImage
- LayerBRDF
- LayerCombiner
- LayerDstretch
- LayerHDR
- LayerImage
- LayerLens
- LayerMaskedImage
- LayerMultispectral
- LayerNeuralRTI
- LayerRTI
- LayerSvgAnnotation
- Layout
- LayoutTileImages
- LayoutTiles
- LensDashboard
- LensDashboardNavigator
- LensDashboardNavigatorRadial
- LightSphereController
- MultispectralUI
- PointerManager
- Raster
- Raster16Bit
- Ruler
- ScaleBar
- Shader
- ShaderAnisotropicDiffusion
- ShaderBRDF
- ShaderCombiner
- ShaderDstretch
- ShaderEdgeDetection
- ShaderFilter
- ShaderFilterBrightness
- ShaderFilterColormap
- ShaderFilterGrayscale
- ShaderFilterOpacity
- ShaderFilterTest
- ShaderFilterVector
- ShaderFilterVectorGlyph
- ShaderGammaFilter
- ShaderHDR
- ShaderLens
- ShaderMultispectral
- ShaderNeural
- ShaderRTI
- Skin
- TextToSpeechPlayer
- Tile
- Transform
- UIBasic
- UIDialog
- Units
- Util
- Viewer
Members
-
<constant> RenderingMode :string
-
Defines rendering modes for lens and background areas.
Type:
- string
- Source:
Properties:
Name Type Default Description drawstring "fill:white;" Shows content in the specified area
hidestring "fill:black;" Hides content in the specified area
drawstring fill:white; hidestring fill:black;
Methods
-
addSignals(proto, signals)
-
Adds event handling capabilities to a prototype. Creates a simple event system that allows objects to emit and listen to events.
The function modifies the prototype by adding:
- Event registration methods
- Event emission methods
- Signal initialization
- Signal storage
Implementation Details
The signal system works by:
- Extending the prototype with signal tracking properties
- Maintaining arrays of callbacks for each signal type
- Providing methods to register and trigger callbacks
Signal Storage Structure:
{ signals: { 'eventName1': [callback1, callback2, ...], 'eventName2': [callback3, callback4, ...] }, allSignals: ['eventName1', 'eventName2', ...] }Performance Considerations:
- Callbacks are stored in arrays for fast iteration
- Signals are initialized lazily on first use
- Direct property access for quick event emission
Usage Notes:
- Events must be registered before they can be used
- Multiple callbacks can be registered for the same event
- Callbacks are executed synchronously
- Parameters are passed through to callbacks unchanged
Parameters:
Name Type Argument Description protoObject The prototype to enhance with signal capabilities
signalsstring <repeatable>
Names of signals to register
- Source:
Examples
```javascript // Add events to a class class MyClass {} addSignals(MyClass, 'update', 'change'); // Use events const obj = new MyClass(); obj.addEvent('update', () => console.log('Updated!')); obj.emit('update'); ``````javascript // Multiple signals class DataHandler {} addSignals(DataHandler, 'dataLoaded', 'dataProcessed', 'error' ); const handler = new DataHandler(); handler.addEvent('dataLoaded', (data) => { console.log('Data loaded:', data); }); ``` -
simplify(points, tolerance)
-
Simplifies a polyline via the Douglas-Peucker algorithm.
Parameters:
Name Type Description pointsArray.<Point> A polyline.
tolerance* The tolerance is the maximum distance between the original polyline and the simplified polyline. It has the same metric as the point coordinates.
- Source:
Returns:
The simplified polyline.
- Type
- Array.<Point>
-
smooth(points, cornerThres, match)
-
Uses Bezier Curve to smooth a polyline
Parameters:
Name Type Description pointsArray.<Point> A polyline.
cornerThresnumber The angular threshold (in degrees). Two segments are smoothed if their angle is less then the threshold.
matchbool Whether the smoothed curve should traverse the original points or approximate them.
- Source:
Returns:
The smoothed polyline.
- Type
- Array.<BezierPoint>
-
smoothToPath(smoothed)
-
Converts a smoothed polyline into an SVG path.
Parameters:
Name Type Description smoothedArray.<BezierPoint> The smoothed polyline.
- Source:
Returns:
The SVG path.
- Type
- Array.<String>
-
taskCallback(e)
-
Callback function fired by a 'click' event on a lens dashboard element.
Parameters:
Name Type Description eEvent The DOM event.
- Source:
Type Definitions
-
APoint
-
A tuple of [x, y] representing a 2D point.
Type:
- Array.<number>
- Source:
Properties:
Name Type Description 0number X coordinate
1number Y coordinate
Example
```javascript const point: APoint = [10, 20]; // [x, y] const x = point[0]; // x coordinate const y = point[1]; // y coordinate ```
-
AnnoClass
-
Type:
- Object
- Source:
Properties:
Name Type Description strokestring CSS color for SVG elements (lines, text, outlines)
labelstring Display name for the class
-
AnnoClasses
-
Map of class names to their visual properties
Type:
- Object.<string, AnnoClass>
- Source:
-
BezierPoint
-
A [x, y, xc, yc] point.
- Source:
Properties:
Name Type Description p.0number The x-coordinate.
p.1number The y-coordinate.
p.2number The x-coordinate of the control point.
p.3number The y-coordinate of the control point.
-
DataLoaderCallback(tile, gl, options)
-
Parameters:
Name Type Description tileObject The tile information object
glWebGL2RenderingContext The WebGL2 rendering context
optionsObject Additional options for the data loader
- Source:
Returns:
The loaded data object with properties:
- data: TypedArray or Image data
- width: Width of the image
- height: Height of the image
- channels: Number of channels in the data
- Type
- Promise.<Object>
-
EasingFunction
-
Animation easing function type
Type:
- 'linear' | 'ease-out' | 'ease-in-out'
- Source:
-
Focus
-
Type:
- Object
- Source:
Properties:
Name Type Description positionObject Lens center position in dataset coordinates
Properties
Name Type Description xnumber X coordinate
ynumber Y coordinate
radiusnumber Lens radius in dataset units
-
LayerAnnotationImageOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description urlstring <optional>
URL to the annotations JSON file
pathstring <optional>
Base path for annotation image files
formatstring <optional>
'vec4' Raster format for image data
-
LayerAnnotationOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description stylestring <optional>
CSS styles for annotation rendering
annotationsstring | Array.<Annotation> <optional>
[] URL of JSON annotation data or array of annotations
overlayboolean <optional>
true Whether annotations render as overlay
selectedSet.<string> <optional>
new Set() Set of selected annotation IDs
annotationsListEntryObject <optional>
null UI entry for annotations list
-
LayerBRDFOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description channelsObject Required channels for BRDF rendering
Properties
Name Type Description kdstring URL to diffuse color map (required)
ksstring URL to specular color map (optional)
normalsstring URL to normal map (required)
glossstring URL to glossiness/roughness map (optional)
colorspacesObject <optional>
Color space definitions for material properties
Properties
Name Type Argument Default Description kd'linear' | 'srgb' <optional>
'linear' Color space for diffuse map
ks'linear' | 'srgb' <optional>
'linear' Color space for specular map
brightnessnumber <optional>
1.0 Overall brightness adjustment
gammanumber <optional>
2.2 Gamma correction value
alphaLimitsArray.<number> <optional>
[0.01, 0.5] Range for glossiness/roughness
monochromeMaterialArray.<number> <optional>
[0.80, 0.79, 0.75] RGB color for monochrome rendering
kAmbientnumber <optional>
0.1 Ambient light coefficient
-
LayerCombinerOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description layersArray.<Layer> Array of layers to be combined (required)
shadersObject.<string, Shader> <optional>
Map of available shaders
typestring <optional>
'combiner' Must be 'combiner' when using Layer factory
visibleboolean <optional>
true Whether the combined output is visible
-
LayerDStretchOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description urlstring URL to the image to be processed (required)
eulerRotationArray.<number> <optional>
[0,0,0] Initial Euler rotation angles
worldRotationnumber <optional>
0 Global rotation offset for canvas/layer
-
LayerHDROptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description urlstring URL of the image to display (required)
layoutstring | Layout <optional>
'image' Layout format for image display
formatstring <optional>
'rgba16f' Image data format for WebGL processing
debugboolean <optional>
false Enable debug output
-
LayerImageOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description urlstring URL of the image to display (required)
layoutstring | Layout <optional>
'image' Layout format for image display
formatstring <optional>
'vec4' Image data format for WebGL processing
typestring <optional>
'image' Must be 'image' when using Layer factory
-
LayerLensOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description overlayboolean <optional>
true Whether the lens renders as an overlay
radiusnumber <optional>
100 Initial lens radius in pixels
borderColorArray.<number> <optional>
[0.078, 0.078, 0.078, 1] RGBA border color
borderWidthnumber <optional>
12 Border width in pixels
borderEnableboolean <optional>
false Whether to show lens border
dashboardObject <optional>
null Dashboard UI component for lens control
cameraCamera Camera instance (required)
-
LayerMaskedImageOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description urlstring URL of the masked image to display (required)
formatstring <optional>
'vec4' Image data format
typestring <optional>
'maskedimage' Must be 'maskedimage' when using Layer factory
-
LayerMultispectralOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description urlstring URL to multispectral info.json file (required)
layoutstring Layout type: 'image', 'deepzoom', 'google', 'iiif', 'zoomify', 'tarzoom', 'itarzoom'
defaultModestring <optional>
'single_band' Initial visualization mode ('rgb' or 'single_band')
serverstring <optional>
IIP server URL (for IIP layout)
linearRasterboolean <optional>
true Whether to use linear color space for rasters (recommended for scientific accuracy)
presetsstring | Object Path to presets JSON file or presets object containing CTW configurations
-
LayerNeuralRTIOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description urlstring URL to the Neural RTI configuration JSON
layoutLayout Layout system for image loading
convergenceSpeednumber <optional>
1.2 Speed of quality convergence
maxTilesnumber <optional>
40 Maximum number of tiles to process
colorspacestring <optional>
'rgb' Color space for processing
-
LayerOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description layoutstring | Layout <optional>
'image' Layout/format of input raster images
typestring <optional>
Identifier for specific derived layer class
idstring <optional>
Unique layer identifier
labelstring <optional>
Display label for UI (defaults to id)
transformTransform <optional>
Transform from layer to canvas coordinates
visibleboolean <optional>
true Whether layer should be rendered
zindexnumber <optional>
0 Stack order for rendering (higher = on top)
overlayboolean <optional>
false Whether layer renders in overlay mode
prefetchBordernumber <optional>
1 Tile prefetch threshold in tile units
mipmapBiasnumber <optional>
0.4 Texture resolution selection bias (0=highest, 1=lowest)
shadersObject.<string, Shader> <optional>
Map of available shaders
controllersArray.<Controller> <optional>
Array of active UI controllers
sourceLayerLayer <optional>
Layer to share tiles with
pixelSizenumber <optional>
0.0 Physical size of a pixel in mm
-
LayerRTIOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description urlstring URL to RTI info.json file (required)
layoutstring Layout type: 'image', 'deepzoom', 'google', 'iiif', 'zoomify', 'tarzoom', 'itarzoom'
normalsboolean <optional>
false Whether to load normal maps
serverstring <optional>
IIP server URL (for IIP layout)
worldRotationnumber <optional>
0 Global rotation offset
-
LayerSvgAnnotationOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description classesAnnoClasses Annotation class definitions with styles
onClickfunction <optional>
Callback for annotation click events (param: selected annotation)
shadowboolean <optional>
true Whether to use Shadow DOM for SVG elements
overlayElementHTMLElement <optional>
Container for SVG overlay
stylestring <optional>
Additional CSS styles for annotations
annotationUpdatefunction <optional>
Custom update function for annotations
-
LayoutOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description widthnumber <optional>
Image width (required for google layout)
heightnumber <optional>
Image height (required for google layout)
suffixstring <optional>
'jpg' Tile file extension
subdomainsstring <optional>
'abc' Available subdomains for URL templates
-
LayoutType
-
Supported image format types:
- image: Single-resolution web images (jpg, png, etc.)
- deepzoom: Microsoft Deep Zoom with root tile > 1px
- deepzoom1px: Microsoft Deep Zoom with 1px root tile
- google: Google Maps tiling scheme
- zoomify: Zoomify format
- iiif: International Image Interoperability Framework
- tarzoom: OpenLIME tar-based tiling
- itarzoom: OpenLIME indexed tar-based tiling
Type:
- 'image' | 'deepzoom' | 'deepzoom1px' | 'google' | 'zoomify' | 'iiif' | 'tarzoom' | 'itarzoom'
-
MenuEntry
-
Menu configuration item
Type:
- Object
- Source:
Properties:
Name Type Argument Description titlestring <optional>
Large title text
sectionstring <optional>
Section header text
htmlstring <optional>
Raw HTML content
buttonstring <optional>
Button text
groupstring <optional>
Button group identifier
layerstring <optional>
Associated layer ID
modestring <optional>
Layer visualization mode
onclickfunction <optional>
Click handler
oninputfunction <optional>
Input handler for sliders
listArray.<MenuEntry> <optional>
Nested menu entries
-
Point
-
Object representation of a 2D point
Type:
- Object
- Source:
Properties:
Name Type Description xnumber X coordinate
ynumber Y coordinate
-
ShaderMultispectralOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description modestring <optional>
'rgb' Initial rendering mode ('rgb' or 'single_band')
debugboolean <optional>
false Enable debug output in console
wavelengthArray.<number> <optional>
Array of wavelengths in nanometers
-
SignalHandler
-
Type:
- Object
- Source:
Properties:
Name Type Description signalsObject.<string, Array.<function()>> Map of event names to arrays of callback functions
allSignalsArray.<string> List of all registered signal names
-
SkinIcon
-
A UI icon element from the skin file
Type:
- Object
-
TextToSpeechOptions
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description languagestring <optional>
'it-IT' Language code for speech synthesis (e.g., 'en-US', 'it-IT')
ratenumber <optional>
1.0 Speech rate (0.1 to 10)
volumenumber <optional>
1.0 Speech volume (0 to 1)
cleanTextboolean <optional>
true Whether to remove HTML tags and format text
voiceSelectednumber <optional>
-1 Index of preferred voice (-1 for auto-selection)
-
TileObj
-
Type:
- Object
- Source:
Properties:
Name Type Argument Description levelnumber Zoom level in the image pyramid
xnumber Horizontal position in tile grid
ynumber Vertical position in tile grid
indexnumber Unique tile identifier
startnumber <optional>
Starting byte position in dataset (for tar formats)
endnumber <optional>
Ending byte position in dataset (for tar formats)
missingnumber Number of pending channel data requests
texArray.<WebGLTexture> Array of textures (one per channel)
timenumber Tile creation timestamp for cache management
prioritynumber Loading priority for cache management
sizenumber Total tile size in bytes
-
TileProperties
-
Type:
- Object
- Source:
Properties:
Name Type Description indexnumber Unique identifier for the tile
bboxArray.<number> Bounding box coordinates [minX, minY, maxX, maxY]
levelnumber Zoom level in the pyramid (for tiled layouts)
xnumber Horizontal grid position
ynumber Vertical grid position
wnumber Tile width (for image layouts)
hnumber Tile height (for image layouts)
startnumber Starting byte position in dataset (for tar-based formats)
endnumber Ending byte position in dataset (for tar-based formats)
texArray.<WebGLTexture> Array of WebGL textures (one per channel)
missingnumber Count of pending channel data requests
timenumber Creation timestamp for cache management
prioritynumber Loading priority for cache management
sizenumber Total size in bytes for cache management
-
TransformParameters
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description xnumber <optional>
0 X translation component
ynumber <optional>
0 Y translation component
anumber <optional>
0 Rotation angle in degrees
znumber <optional>
1 Scale factor
tnumber <optional>
0 Timestamp for animations
-
UIAction
-
Action configuration for toolbar buttons
Type:
- Object
- Source:
Properties:
Name Type Argument Description titlestring Display title for the action
displayboolean Whether to show in toolbar
keystring <optional>
Keyboard shortcut key
taskfunction Callback function for action
iconstring <optional>
Custom SVG icon path or content
htmlstring <optional>
HTML content for help dialog
-
ViewerOptions
-
Configuration options for Viewer initialization
Type:
- Object
-
Viewport
-
Defines a rectangular viewing region inside a canvas area.
Type:
- Object
-
Viewport
-
Type:
- Object
- Source:
Properties:
Name Type Description xnumber Viewport x position
ynumber Viewport y position
dxnumber Viewport horizontal offset
dynumber Viewport vertical offset
wnumber Viewport width
hnumber Viewport height
-
Viewport
-
Viewport configuration
Type:
- Object
-
updatePosition(x, y)
-
Callback for position updates.
Parameters:
Name Type Description xnumber X coordinate in the range [-1, 1]
ynumber Y coordinate in the range [-1, 1]
- Source: