Actions and action dispatchers.
- Source:
Methods
-
<static> dispatchAddRegionEntry(drawLayerId, regionChanges, plotId, layerTitle, selectMode, dispatcher)
Add regions to drawing layer
-
Parameters:
Name Type Description drawLayerId
string id of the drawing layer where the region(s) are added to if the layer doesn't exist, a new drawing layer is created by either using the specified drawLayerId or creating a new id based on the setting of 'layerTitle' in case drawLayerId is undefined
regionChanges
Array.<string> | string array or string of region description
plotId
Array.<string> | string array or string of plot id. If plotId is empty, all plots of the active group are applied
layerTitle
string will replace the original title if the drawing layer exists and layerTitle is non-empty
selectMode
RegionSelectMode rendering features for the selected region
dispatcher
function - Source:
-
<static> dispatchAddTableTypeWatcherDef(p)
Add a table type watcher definition. Test every table (existing or new) and if the test is passed then create a table type watcher for that table.
-
A table type watcher, by using the payload definition will start a single watch for ever table that is newly loaded or previously loaded that passes the 'testTable' function test. These watchers will have the same life time of the table they are watching. A TableType watcher is like a normal watcher with following exceptions:
- tbl_id is first parameter.
- The params object with always include a options and a sharedData property. They may be undefined.
- The options object should be thought of as read only. It should not be modified.
- It is call the first time with the action undefined. This can be for initialization. The table will beloaded
Parameters:
Name Type Description p
object Properties
Name Type Argument Description id
String a unique identifier for this watcher
testTable
TestWatchFunc function: testTable(table,action,options), return true, if we should watch this table type
watcher
TableWatchFunc function watcher(tbl_id,action,cancelSelf,params), note- TableWatchFunc is called when the first time for initialization for the first call action is null
sharedData
Object <optional>
options
Object <optional>
actions
Array.<String> array of string action id's
excludes-
Array.<String> excluded id list. if testTable return true then this list will force any watcher def with an id in the list to not watch
stopPropagation
boolean like excludes but if true not only watcher will be added
enabled
boolean if true this TableTypeWatcher will test and add, if false it will be skipped
allowMultiples
boolean multiple defs of this type are allowed.
- Source:
- See:
-
<static> dispatchApiToolsView(apiToolsView, useFloatToolbar)
Tweek how the API image view works
. -
Tweek how the API image view works
Parameters:
Name Type Description apiToolsView
boolean useFloatToolbar
boolean - Source:
-
<static> dispatchAttachLayerToPlot(id, plotId, attachAllPlot, visible, plotTypeMustMatch)
attach drawing layer to plot
-
Parameters:
Name Type Description id
string | Array.<string> make the drawLayerId or drawLayerTypeId, this may be an array
plotId
string | Array.<string> to attach this may by a string or an array of strings
attachAllPlot
boolean visible
boolean | string Can have three values: true: layer is attach visible, false: attach not-visible, value (string) 'inherit' layer is visible
plotTypeMustMatch
boolean - Source:
-
<static> dispatchChangeDrawingDef(id, drawingDef, plotId [, matchTitle])
change the drawing definition of the drawing layer
-
Parameters:
Name Type Argument Description id
string | Array.<string> make the drawLayerId or drawLayerTypeId, this may be an array
drawingDef
plotId
matchTitle
boolean <optional>
matches any draw layers that have the same title as the one specified by the id
- Source:
-
<static> dispatchChangeVisibility(p)
change the visibility of one more drawing layers on a set of WebPlots. This function can match the drawing layers using drawLayerId, drawLayerTypeId and further match using the title of the draw layer. it can match hhe plots by plotId, then all the plots in the group, and then can limit the plots in the group using subgroupId
-
Parameters:
Name Type Description p
Object Properties
Name Type Argument Description id
string | Array.<string> make the drawLayerId or drawLayerTypeId, this may be an array
visible
boolean plotId
string the plotId to change the visibility on, if used group is defined then visibility will be change for all the plotIds in the PlotGroup
useGroup
boolean <optional>
If true, get all the plotViews in the group of the plotId, if false use only the one
subGroupId
string <optional>
if defined the list of PlotViews affected will be filtered by the subGroupId. In other words it will only change the visibility on PlotView that have a matching subGroupId.
matchTitle
boolean <optional>
matches any draw layers that have the same title as the one specified by the id
- Source:
-
<static> dispatchChartUpdate(p)
Update chart data.
-
Update chart data. The parameter should have a partial object it wants to update. The keys of the partial object should be in path-string format, ie. 'a.b.c'.
Parameters:
Name Type Description p
Object dispatch parameetrs
Properties
Name Type Argument Default Description chartId
string chart id
changes
Object object with the path-string keys and values of the changed props
dispatcher
function <optional>
flux.process only for special dispatching uses such as remote
- Source:
-
<static> dispatchColorChange(obj)
Show image with new color table loaded Note - function parameter is a single object
. -
Show image with new color table loaded Note - function parameter is a single object
Parameters:
Name Type Description obj
Object Properties
Name Type Argument Description plotId
string cbarId
number must be in the range, 0 - 21, each number represents different colorbar
actionScope
string | ActionScope <optional>
default to group
dispatcher
function <optional>
only for special dispatching uses such as remote
- Source:
-
<static> dispatchCreateDrawLayer(drawLayerTypeId, params)
create drawing layer
-
Parameters:
Name Type Description drawLayerTypeId
string id of drawing layer
params
Object - Source:
-
<static> dispatchCreateFootprintLayer(footprintId, layerTitle, footprintData, plotId, attachPlotGroup, dispatcher)
create drawing layer with footprint
-
Parameters:
Name Type Description footprintId
string id of the drawing layer
layerTitle
string title of the drawing layer
footprintData
footprintInfo footprint information for footprint layer, relocateBy: 'origin' means relocating footprint origin to the target location 'center' means relocating footprint center to the target location
plotId
Array.<string> | string array or string of plot id. If plotId is empty, all plots of the active group are applied
attachPlotGroup
bool attach all plots of the same plot group
dispatcher
- Source:
-
<static> dispatchCreateMarkerLayer(markerId, layerTitle, plotId, attachPlotGroup, dispatcher)
create drawing layer with marker
-
Parameters:
Name Type Description markerId
string id of the drawing layer
layerTitle
string title of the drawing layer
plotId
Array.<string> | string array or string of plot id. If plotId is empty, all plots of the active group are applied
attachPlotGroup
bool attach all plots of the same plot group
dispatcher
- Source:
-
<static> dispatchCreateRegionLayer(drawLayerId, layerTitle, fileOnServer, regionAry, plotId, selectMode, dispatcher)
Create drawing layer based on region file or region description
-
Parameters:
Name Type Description drawLayerId
string id of the drawing layer to be created, required
layerTitle
string if it is empty, it will be created internally
fileOnServer
string region file name on server
regionAry
Array.<string> | string array or string of region description
plotId
Array.<string> | string array or string of plot id. If plotId is empty, all plots of the active group are applied
selectMode
RegionSelectMode rendering features for the selected region
dispatcher
function - Source:
-
<static> dispatchCrop(p)
Crop Note - function parameter is a single object
-
Parameters:
Name Type Description p
Object Properties
Name Type Argument Description plotId
string imagePt1
Object image point of corner 1
imagePt2
Object image point of corner 2
cropMultiAll
boolean dispatcher
function <optional>
only for special dispatching uses such as remote
- Source:
-
<static> dispatchDeletePlotView(p)
Delete a PlotView Note - function parameter is a single object
-
Parameters:
Name Type Description p
Object this function takes a single parameter
Properties
Name Type Argument Default Description plotId
string holdWcsMatch
boolean <optional>
true if wcs match is on, then modify the request to hold the wcs match
dispatcher
function <optional>
only for special dispatching uses such as remote
- Source:
-
<static> dispatchDeleteRegionLayer(drawLayerId, plotId, dispatcher)
Delete the region drawing layer
-
Parameters:
Name Type Description drawLayerId
string id of the drawing layer to be deleted, required
plotId
Array.<string> | string array or string of plot id. If plotId is empty, all plots of the active group are applied
dispatcher
function - Source:
-
<static> dispatchDestroyDrawLayer(id)
destroy the drawing layer
-
Parameters:
Name Type Description id
string make the drawLayerId or drawLayerTypeId
- Source:
-
<static> dispatchDetachLayerFromPlot(id, plotId, detachAllPlot, destroyWhenAllDetached)
Detach drawing layer from the plot
-
Parameters:
Name Type Description id
string | Array.<string> make the drawLayerId or drawLayerTypeId, this may be an array
plotId
string | Array.<string> to attach this may by a string or an array of string
detachAllPlot
destroyWhenAllDetached
if all plots are detached then destroy this plot
- Source:
-
<static> dispatchFlip(p)
Flip Note - function parameter is a single object
-
Parameters:
Name Type Description p
Object Properties
Name Type Argument Description plotId
string isY
boolean actionScope
string | ActionScope enum ActionScope
dispatcher
function <optional>
only for special dispatching uses such as remote
- Source:
-
<static> dispatchForceDrawLayerUpdate(id, plotId)
force to update the drawing layer
-
Parameters:
Name Type Description id
plotId
- Source:
-
<static> dispatchModifyCustomField(id, changes [, plotId])
create custom changes to the drawing layer
-
Parameters:
Name Type Argument Description id
string | Array.<string> make the drawLayerId or drawLayerTypeId, this may be an array
changes
Object any object of changes
plotId
string <optional>
a plotId
- Source:
-
<static> dispatchPlotHiPS(p)
Plot a HiPS display
-
Note - function parameter is a single object
Parameters:
Name Type Description p
Object this function takes a single parameter
Properties
Name Type Argument Default Description plotId
string wpRequest
WebPlotParams | WebPlotRequest hipsImageConversion
HipsImageConversionSettings <optional>
if defined, use these parameter to
viewerId
string pvOptions
PVCreateOptions PlotView init Options
attributes
Object <optional>
meta data that is added the plot
setNewPlotAsActive
boolean <optional>
the last completed plot will be active
enableRestore
boolean <optional>
true if true the original request is saved for restore
renderTreeId
string <optional>
used only with multiple rendered tree, like slate in jupyter lab
dispatcher
function <optional>
only for special dispatching uses such as remote
- Source:
-
<static> dispatchPlotImage(p)
Plot an image.
-
Note - function parameter is a single object
Parameters:
Name Type Description p
Object Properties
Name Type Argument Default Description plotId
string <optional>
is required unless defined in the WebPlotRequest
wpRequest
WebPlotParams | WebPlotRequest | Array plotting parameters, required or for 3 color pass an array of WebPlotParams or WebPlotRequest
threeColor
boolean <optional>
is a three color request, if true the wpRequest should be an array
useContextModifications
boolean <optional>
true it true the request will be modified to use preferences, rotation, etc should only be false when it is doing a 'restore to defaults' type plot
attributes
Object <optional>
meta data that is added the plot
hipsImageConversion
HipsImageConversionSettings <optional>
if defined, use these parameter to convert between image and HiPS
pvOptions
Object <optional>
parameter specific to the plotView, only read the first time per plot id
setNewPlotAsActive
boolean <optional>
true the new plot will be active
holdWcsMatch
boolean <optional>
false if wcs match is on, then modify the request to hold the wcs match
enableRestore
boolean <optional>
true if true the original request is saved for restore
viewerId
string <optional>
viewer that this plot should be put into, only optional if you have added the plot id manually to a viewer. otherwise, you need to specify the viewer.
renderTreeId
string <optional>
used only with multiple rendered tree, like slate in jupyter lab
dispatcher
function <optional>
only for special dispatching uses such as remote
- Source:
-
<static> dispatchPlotImageOrHiPS(p)
Plot a HiPS or a image depending on the FOV size
-
Note - function parameter is a single object
Parameters:
Name Type Description p
Object this function takes a single parameter
Properties
Name Type Argument Default Description plotId
string hipsRequest
WebPlotParams | WebPlotRequest imageRequest
WebPlotParams | WebPlotRequest must be a ServiceType request.
allSkyRequest
WebPlotParams | WebPlotRequest must be a allsky type request
plotAllSkyFirst
boolean <optional>
false if there is an all sky set up then plot that first
fovDegFallOver
number <optional>
the size in degrees that the image will switch between hips and a image cutout
fovMaxFitsSize
number <optional>
the max size the fits image service can support
autoConvertOnZoom
boolean <optional>
convert between images and FITS on zoom
viewerId
string <optional>
renderTreeId
string <optional>
used only with multiple rendered tree, like slate in jupyter lab
pvOptions
PVCreateOptions <optional>
PlotView init Options
attributes
Object <optional>
meta data that is added the plot
setNewPlotAsActive
boolean <optional>
the last completed plot will be active
dispatcher
function <optional>
only for special dispatching uses such as remote
- Source:
-
<static> dispatchPlotMask(p)
Add a mask
-
Parameters:
Name Type Description p
Object this function takes a single parameter
Properties
Name Type Argument Description plotId
string maskValue
number power of 2, e.g 4, 8, 32, 128, etc
maskNumber
number 2, e.g 4, 8, 32, 128, etc
imageOverlayId
string imageNumber
number hdu number of fits
fileKey
string file on the server
color
string color is optional, if not specified, one is chosen
title
string relatedDataId
string <optional>
pass a related data id if one exist
dispatcher
function <optional>
only for special dispatching uses such as remote
- Source:
-
<static> dispatchRecenter(p)
recenter the images on the plot center or the ACTIVE_TARGET
Note - function parameter is a single object
-
Parameters:
Name Type Description p
Object Properties
Name Type Argument Description plotId
string centerPt
Point <optional>
Point to center on
centerOnImage
boolean only used if centerPt is not defined. If true then the centering will be the center of the image. If false, then the center point will be the FIXED_TARGET attribute, if defined. Otherwise it will be the center of the image.
dispatcher
function <optional>
only for special dispatching uses such as remote
- Source:
-
<static> dispatchRemoveRegionEntry(drawLayerId, regionChanges, dispatcher)
remove region(s) from the drawing layer
-
Parameters:
Name Type Description drawLayerId
string id of the drawing layer where the region(s) are removed from, required
regionChanges
Array.<string> | string array or string of region description
dispatcher
function - Source:
-
<static> dispatchRotate(p)
Rotate image, do it client side
Note - function parameter is a single object
. -
Rotate image, do it client side
Note - function parameter is a single object
Parameters:
Name Type Description p
Object Properties
Name Type Description plotId
string rotateType
Enum enum RotateType
angle
number actionScope
string | ActionScope enum ActionScope
dispatcher
function only for special dispatching uses such as remote
- Source:
-
<static> dispatchSelectRegion(drawLayerId, selectedRegion, dispatcher)
select region from a drawing layer containing regions
-
Parameters:
Name Type Description drawLayerId
string id of drawing layer where the region is selected from, required
selectedRegion
Array.<string> | string | Object array or string of region description or region object (drawObj) currently only single region is allowed to be selected if the array contains the description of multiple regions. If 'null' or empty array is passed, the function works as de-select the region.
dispatcher
function - Source:
- See:
-
- firefly.util.image.getSelectedRegion to get the string describing the selected region
-
<static> dispatchStretchChange(obj)
Change the image stretch Note - function parameter is a single object
. -
Change the image stretch Note - function parameter is a single object
Parameters:
Name Type Description obj
Object object literal with dispatcher parameters
Properties
Name Type Argument Description plotId
string stretchData
Array.<Object.<band:Band, rv:RangeValues, bandVisible:boolean>> actionScope
ActionScope <optional>
default to group
dispatcher
function <optional>
only for special dispatching uses such as remote
- Source:
Examples
// Example of stretch 2 - 98 percent, log stretch var rv= RangeValues.makeSimple(‘percent’, 2, 98, ‘log’); const stretchData= [{ band : 'NO_BAND', rv : rv, bandVisible: true }]; action.dispatchStretchChange({plotId:’myplot’, strechData:stretchData });
// Example of stretch -2 - 5 sigma, linear stretch var rv= RangeValues.makeSimple(’sigma’, -2, 5, 'linear’); const stretchData= [{ band : 'NO_BAND', rv : rv, bandVisible: true }]; action.dispatchStretchChange({plotId:’myplot’, strechData:stretchData });
-
<static> dispatchZoom(p)
Zoom a image Note - function parameter is a single object
-
Parameters:
Name Type Description p
Object this function takes a single parameter
Properties
Name Type Argument Description plotId
string userZoomType
string | UserZoomTypes (one of ['UP','DOWN', 'FIT', 'FILL', 'ONE', 'LEVEL', 'WCS_MATCH_PREV')
maxCheck
boolean <optional>
zoomLockingEnabled
boolean <optional>
forceDelay
boolean <optional>
level
number <optional>
the level to zoom to, used only userZoomType 'LEVEL'
actionScope
string | ActionScope <optional>
default to group
dispatcher
function <optional>
only for special dispatching uses such as remote
- Source:
Examples
// Example of zoom to level action.dispatchZoom({plotId:’myplot’, userZoomType:’LEVEL’, level: .75 });
// Example of zoom up action.dispatchZoom({plotId:’myplot’, userZoomType:’UP’ }};
// Example of zoom to fit action.dispatchZoom({plotId:’myplot’, userZoomType:’FIT’ }};
// Example of zoom to level, if you are connected to a widget that is changing the level fast, zlevel is the varible with the zoom level action.dispatchZoom({plotId:’myplot’, userZoomType:’LEVEL’, level: zlevel, forceDelay: true }};
-
<static> visRoot()
-
- Source:
Returns:
- Type
- VisRoot