diff --git a/README.md b/README.md index 2a9ad55d79..63871b13bb 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ There are several branches the this repository. Here are the ones that you shou Javascript interpreter for command line environment, used for development tools #### Prepare before the build - - Make sure you have /bin, /bin, and /bin in your PATH. + - Make sure you have `/bin`, `/bin`, and `/bin` in your PATH. #### How to build Firefly: @@ -77,32 +77,34 @@ You may include this jar into your project to build advanced astronomy web appli In a terminal, cd into the `firefly` directory, then run: - $ gradle :fftools:war + $ gradle :firefly:war -This generates fftools.war located at ./build/lib/. +This generates firefly.war located at ./build/lib/. Simply drop this file into your $CATALINA_HOME/webapps/ directory to deploy it. $CATALINA_HOME is your Tomcat server installation directory. -Goto http://localhost:8080/fftools/ to launch Firefly Viewer. +Goto http://localhost:8080/firefly/ to launch Firefly Viewer. ## More Docs ####Firefly Tools JavaScript API overview -[see fftools-api-overview.md](docs/fftools-api-overview.md) +See [firefly-api-overview.md](docs/firefly-api-overview.md) + (Deprecated [docs/fftools-api-overview.md](docs/fftools-api-overview.md)) ####Firefly Tools Remote API using Python overview -[see firefly-python-wrapper.md](docs/firefly-python-wrapper.md) +See [firefly-python-wrapper.md](docs/firefly-python-wrapper.md) ####Code Examples Using Firefly Tools -[see fftools-api-code-examples.md](docs/fftools-api-code-examples.md) +See [firefly-api-code-examples.md](docs/firefly-api-code-examples.md) + (Deprecated [docs/fftools-api-code-examples.md](docs/fftools-api-code-examples.md)) ####Setting up the Server correctly for FITS files -[see server-settings-for-fits-files.md](docs/server-settings-for-fits-files.md) +See [server-settings-for-fits-files.md](docs/server-settings-for-fits-files.md) ####Changing the Firefly runtime environment -[see firefly-environment.md](docs/firefly-environment.md) +See [firefly-environment.md](docs/firefly-environment.md) ####Adding external task launcher or Python Launcher to Firefly -[see firefly-python-launcher.md](docs/firefly-external-task-launcher.md) +See [firefly-python-launcher.md](docs/firefly-external-task-launcher.md) diff --git a/docs/firefly-api-code-examples.md b/docs/firefly-api-code-examples.md new file mode 100644 index 0000000000..b422ab834b --- /dev/null +++ b/docs/firefly-api-code-examples.md @@ -0,0 +1,132 @@ +## Code Examples Using Firefly Tools + +- [Image FITS Viewer](#image-fits-viewer) +- [FITS Viewers in a group](#fits-viewers-in-a-group) +- [Tracking the mouse](#tracking-the-mouse) +- [Tracking the selection](#tracking-the-selection) + +###Starting Firefly Tools in JavaScript +Firefly Tools are loaded when you load`firefly_loader.js` from a server of your choice. For example, to load Firefly Tools from your local server, include the following declaration in your HTML file: + +```html + + + + + +``` + +###Remote Firefly Tools Interface + +The interface to remotely communicate to the firefly viewer: + + - `firefly.getViewer()` - gives a handle to launch the firefly tools in another browser window or tab + +| Parameter | type | Description | +| ---------- | ---- | ----------- | +| `channel` | string |the channel id string, if not specified then one will be generated | +| `file` | string | file the html of the viewer to launch. In time there will be several | +| *return* | object | viewer interface | + + +###Rendering UI components + +Firefly React components can be found in `firefly.ui` module. + +`firefly.util.renderDOM(div, Component, props)` - render React component into the DOM tree + +| Parameter | Type | Description | +| ---------- | ---- | ----------- | +| div | string or Object | a div element or a string id of the div element | +| Component | Object | a React component | +| props | Object | properties for the React component | + +`firefly.util.unrenderDOM(div)` - remove the rendered element + +| Parameter | Type | Description | +| ---------- | ---- | ----------- | +| div | string or Object | a div element or a string id of the div element | + + +###Dispatching and watching actions + +Firefly is built around [React](https://facebook.github.io/react/docs/why-react.html)/[Redux](http://redux.js.org) paradigm. The idea of React is that it will always render the state of your component. +Redux manages that state of your application. The data in the state is immutable. It cannot change directly. +When the program fires an action describing the change to the data, a new version of the state is created with the changes. +Then React re-renders the parts that are different. Therefore, application goes from one state change to the next. + +![diagram](https://cask.scotch.io/2014/10/V70cSEC.png) + +Being able to dispatch and listen to Firefly actions makes it possible to write new code, which could control or interact with Firefly widgets. + +#####**firefly.util.addActionListener(actionType,callBack)** + +`firefly.action.type` object is a handle to Firefly action types. Action types are its properties. +`firefly.actions` object contains action dispatchers. + +Each action has two properties: type and payload. Payload is different from action to action and is an object constructed from the parameters of the corresponding action dispatcher. +Hence, action payload is documented in action dispatcher function. Most of action dispatcher functions are camel-cased `dispatch[ActionType]`. +For example, action with type `READOUT_DATA` is dispatched with a function named `dispatchReadoutData`. + +`firefly.util.addActionListener(actionType,callBack)` - add a listener to any action type + +| Parameter | Type | Description | +| ---------- | ---- | ----------- | +| actionType | a string or and array of strings | Each string is an action constant from firefly.action.type | +| callback | function | The callback will be called with two parameters: action object and state object. If it returns true the listener will be removed. | +| *return* | function | a function that will remove the listener | + + +###Other Utility Methods + +The rest of Firefly utilities are split into the following modules by function: + +- `firefly.util.image` - image utilities +- `firefly.util.table` - table utilities +- `firefly.util.chart` - chart utilities + + + +###FITS Visualization + +A FITS image viewer is created by calling the following method: + + - `firefly.showImage()` - shows FITS image viewer in a div + + +| Parameter | type | Description | +| ---------- | ---- | ----------- | +| `targetDiv` | string |target div to put the image in | +| `request` | object | the request object literal with the plotting parameters | + + +- `setGlobalImageDef()` - set global fallback params for every image plotting call + + +| Parameter | Description | +| ---------- | ----------- | +| object | params a object literal such as any image plot or showImage uses | + + + +The FITS viewer can take many, many possible parameters. Some parameters control how to get an image, a image can be retrieved from a service, a url, of a file on the server. Others control the zoom, stretch, and color, title, and default overlays. There are also parameters to pre-process an image, such as crop, rotate or flip. You can also specify three color parameters and the associated files. + +For the details of FITS plotting parameters see: [see fits-plotting-parameters.md](fits-plotting-parameters.md) + +
+*Examples:* +```js +firefly.setGlobalImageDef({ + ZoomType : 'TO_WIDTH' +} ); +firefly.showImage('myDiv', { + URL : 'http://web.ipac.caltech.edu/staff/roby/demo/wise-m51-band2.fits', + Title : 'Some WISE image' +}); +``` +*or* +```js +firefly.showImage('myDiv', { + Type : 'SERVICE', + plotGroupId : 'myGroup', + Service : 'WISE', + Title : 'Wise', + GridOn : true, + SurveyKey : 'Atlas', + SurveyKeyBand : '2', + WorldPt : '10.68479;41.26906;EQ_J2000', + SizeInDeg : '.12', + RangeValues : firefly.util.image.RangeValues.serializeSimple('Sigma',-2,8,'Linear'), + AllowImageSelection : true +}) +``` + +###Deprecated ImageViewer interface + +The following `ImageViewer` interface is deprecated. Please use `firefly.showImagePlot()` instead + + - `firefly.makeImageViewer()` - makes an inline image viewer for a html document + - `firefly.getExpandedViewer()` - makes an image viewer to fill the screen in a browser tab or window, little used feature. + - `firefly.getExternalViewer()` - makes an image viewer which will run in a browser tab or window. It is used to plot an image. + +Deprecated `ImageViewer` methods: + +| Method | Description | +| ---------- | ----------- | +| `plot()` | plot a FITS image | +| `plotURL()` | convenience method to plot an image referenced by url | +| `plotFile()` | convenience method to plot an image file on the server | +| `plotFileOrURL()` | convenience method to plot an image referenced by file or url | +| `setDefaultParams()` | set parameters that will apply to `plot` calls | + + + +###Utility methods for FITS visualization + +#####**firefly.util.image.getPrimePlot** method + +`firefly.util.image.getPrimePlot(plotId)` - get the plot object by its plot id + +If `plotId` is omitted, active plot is returned. + +| Parameter | Type | Description | +| ---------- | ---- | ----------- | +| plotId | string | plot id | + +`plotState` property of the plot object gives access to the information about current state of the plot, such as zoom level, rotation information, working and original FITS file names, etc. + +*Example:* +```js +function getWorkingFitsFile(pt) { + const activePlot = firefly.util.image.getPrimePlot(); + const plotState = activePlot.plotState; + return plotState.getWorkingFitsFileStr(); +} +``` + +#####**firefly.util.image.CCUtil** + +`firefly.util.image.CCUtil` - coordinate conversion utilities + +- `firefly.util.image.CCUtil.getImageCoords(plot,pt` - get image coordinates of the point +- `firefly.util.image.CCUtil.getWorldCoords(plot,pt)` - get world coordinates of the point +- `firefly.util.image.CCUtil.getViewPortCoords(plot,pt)` - get viewport coordinates of the point +- `firefly.util.image.CCUtil.getScreenCoords(plot,pt)` - get screen coordinates of the point + +| Parameter | Type | Description | +| ---------- | ---- | ----------- | +| plot | Object | Firefly plot object | +| pt | Object | Firefly point object | + +*Example:* +```js +function getImagePt(pt) { + const activePlot = firefly.util.image.getPrimePlot(); + return pt ? firefly.util.image.CCUtil.getImageCoords(activePlot, pt) : undefined; +} +``` + +#####**firefly.util.image.serializeSimpleRangeValues** method + +`firefly.util.image.serializeSimpleRangeValues(stretchType,lowerValue,upperValue,algorithm)` - serialize a stretch request into a string, for use with the "RangeValues" parameter + +| Parameter | Type | Description | +| ---------- | ---- | ----------- | +| stretchType | string | the type of stretch may be 'Percent', 'Absolute', 'Sigma' | +| lowerValue |number | lower value of stretch, based on stretchType | +| upperValue |number | upper value of stretch, based on stretchType | +| algorithm | string | algorithm the stretch algorithm to use, may be 'Linear', 'Log', 'LogLog', 'Equal', 'Squared', 'Sqrt' | +| *return* | string | a serialized version of range values to be passed as a viewer parameter | + +*Example:* +```js +firefly.getViewer().showImage('imageDiv', { + plotId: 'p1', + Service: 'TWOMASS', + Title : '2MASS from service', + SurveyKey : 'k', + WorldPt : '10.68479;41.26906;EQ_J2000', + RangeValues : firefly.util.image.serializeSimpleRangeValues("Sigma",-1,2,"Linear"), + SizeInDeg : '.12' +}); +``` + +`firefly.util.image.initAutoReadout(readoutComponent, props)` - initialize the auto readout. + +To use minimal readout, do the following: + +*Example:* +```js + firefly.util.image.initAutoReadout(ui.DefaultApiReadout, + { + MouseReadoutComponent:firefly.ui.PopupMouseReadoutMinimal, + showThumb:false, + showMag:false + } + ); +``` + +###Region Support + +#####**firefly.action.dispatchCreateRegionLayer** method + +`firefly.action.dispatchCreateRegionLayer(regionId, layerTitle, fileOnServer ='', regionAry=[], plotId = [])` - overlay region data on an image plots with the given ids + +| Parameter | Type | Description | +| ---------- | ---- | ----------- | +| regionId | string | region layer id | +| layerTitle | string | title for the layer, displaying regions | +| fileOnServer | string | region file on the server | +| regionAry | array | an array of strings, each describing a ds9 region | +| plotId | string or array | a plot id or an array of plot ids | + +Note: if no plotId is given, the region layer is created on all plots. + + +#####**firefly.action.dispatchDeleteRegionLayer** method + +`firefly.action.dispatchDeleteRegionLayer(regionId, plotId)` - remove region layer from the given plot + +| Parameter | Type | Description | +| ---------- | ---- | ----------- | +| regionId | string | region layer id | +| plotId | string or array | a plot id or an array of plot ids | + +Note: if no plotId is given, the region layer is removed from all plots. + + +#####**firefly.action.dispatchAddRegionEntry** method + +`firefly.action.dispatchAddRegionEntry(regionId, regionChanges)` - add region data to the given region layer + +| Parameter | Type | Description | +| ---------- | ---- | ----------- | +| regionId | string | region layer id | +| regionChanges | array | an array of strings, each describing a ds9 region | + +#####**firefly.action.dispatchRemoveRegionEntry** method + +`firefly.action.dispatchRemoveRegionEntry(regionId, regionChanges)` - remove region data from the given region layer + +| Parameter | Type | Description | +| ---------- | ---- | ----------- | +| regionId | string | region layer id | +| regionChanges | array | an array of strings, each describing a ds9 region | + +*Example:* +```js +function onFireflyLoaded() { + const req = { + plotId: 'image1', + URL: 'http://web.ipac.caltech.edu/staff/roby/demo/wise-m51-band2.fits', + Title: 'WISE m51' + }; + firefly.showImage('image1_div', req); + setTimeout(function() { + // parameters to dispatchCreateRegionLayer: regionId, layerTitle, fileOnServer ='', regionAry=[], plotId = [] + const regionAry = [ + 'image; box 250 250 100 80 0 # color=red', + 'image; box 250 250 50 40 0 # color=red' + ]; + firefly.action.dispatchCreateRegionLayer('region1', 'Region Layer 1', null, regionAry, ['image1', 'image2']); + }, 3000); +} +``` + + +###Table Visualization + +Creating table request + +- `firefly.util.table.makeFileRequest(title, source, alt_source, options={})` - make a table request from a file +- `firefly.util.table.makeTblRequest(id, title, params={}, options={}` +- `firefly.util.table.makeIrsaCatalogRequest(title, project, catalog, params={}, options={})` + +options - table request options, object with the following properties: + + +| Property | Type | Description | +| ---------- | ---- | ----------- | +| startIdx | number | the starting index to fetch, defaults to zero | +| pageSize | number | the number of rows per page, defaults to 100 | +| filters | string | list of conditions separted by comma`(,)`. Format: `(col_name|index) operator value. Operator is one of '> < = ! >= <= IN'` | +| sortInfo | string | sort information. Format: `(ASC|DESC),col_name[,col_name]*` | +| inclCols | string | list of columns to select: column names separted by comma `(,)`| +| decimate | string | decimation information | +| META_INFO | object | meta information passed as key/value pair to server then returned as tableMeta | +| use | string | optional, one of 'catalog_overlay', 'catalog_primary', 'data_primary' | +| tbl_id | string | a unique id of a table, auto-created if not given | + +- `firefly.showTable(targetDiv, request, options)` + +Parameters ia an object literal. div is the div to load the table into. +Below is a list of all possible parameters. + + +| Parameter | Type | Description | +| ---------- | ---- | ----------- | +| targetDiv | string | target div to put the table in | +| request | object | request object the table is created from | +| options |number | table options | + +options - table options, object with the following properties: + + +| Property | Type | Description | +| ---------- | ---- | ----------- | +| tbl_group | string | the group this table belongs to, defaults to 'main' | +| removable | boolean | true if this table can be removed from view, defaults to true | +| showUnits | boolean | defaults to false | +| showFilters | boolean | defaults to false | +| selectable | boolean | defaults to true | +| expandable | boolean | defaults to true | +| showToolbar | boolean | defaults to true | +| border | boolean | defaults to true | + + +*Example:* +```js +tblReq = firefly.util.table.makeFileRequest(null, 'http://web.ipac.caltech.edu/staff/roby/demo/WiseDemoTable.tbl',null, + { + pageSize: 15, + META_INFO: {CENTER_COLUMN: 'crval1;crval2;EQJ2000'} + }); +firefly.showTable('table_div', tblReq); +``` +The Table tools currently supports the following file formats: + + - IPAC Table file format + - CSV - first row should be column headers + - TSV - first row should be column header + - FITS Tables + + + +###XY Plot Visualization + +- `firefly.showXYPlot(targetDiv, parameters)` + +| Parameter | Type | Description | +| ---------- | ---- | ----------- | +| targetDiv | string | target div to put the XY Plot in | +| parameters | object | XY plot parameters | + + +Parameters object literal can contain the following values + +| Parameter | Description | +| ------------ | ------------- | +| source | required; location of the ipac table. url or file path.| +| xCol | column or expression to use for x values, can contain multiple column names ex. log(col) or (col1-col2)/col3 | +| yCol | column or expression to use for y values, can contain multiple column names ex. log(col) or (col1-col2)/col3 | + + +*Example:* +```js +chartParams = { + source: 'http://web.ipac.caltech.edu/staff/roby/demo/WiseDemoTable.tbl', + xCol: 'ra1', + yCol: 'dec1' +}; +firefly.showXYPlot('chart_div', chartParams); +``` + +XY Plot supports the same table formats as Table does: + + - IPAC Table file format + - CSV - first row should be column headers + - TSV - first row should be column headers + - FITS Tables + + +###Connecting Coverage image to table + +`firefly.showCoverage= (div,options)` - add a coverage image to a div + +| Parameters | Type | +| ---------- | ----------- | +|div | string, the div to put the image viewer into | +|params | object literal, plotting parameters for FITS Viewer | + + +Coverage is a an image, which includes all points of a catalog. Coverage image size is computed by looking at columns in the tables. If you use the default column names you do not have to specify how to determine the center or the four corners. + + - **ALL_CORNERS**: Determines if the coverage will use the box style and what corners will be used. + Should be specified as a string with the values comma separated. For example- + "ra1,dec1,ra2,dec2,ra3,dec3,ra4,dec4". If this parameter is not specified then the example + is the default. + If you specify CORNER_COLUMNS then you must also specify CENTER_COLUMN. + - **CENTER_COLUMN**: Determines if the coverage will use the x style (if CORNER_COLUMNS is not specified) + and what is the center point. + Should be specified as a string with the values comma separated. For example- + "ra,dec". If this parameter is not specified then the example is the default. + + +```js +const tblReq = firefly.util.table.makeFileRequest(null, 'http://web.ipac.caltech.edu/staff/roby/demo/WiseDemoTable.tbl',null, + { + META_INFO: { + CENTER_COLUMN: 'crval1;crval2;EQJ2000' + } + }); +firefly.showTable('table_div', tblReq); +firefly.showCoverage('coverage_div', {gridOn:true}) +``` + +You can show point sources on your coverage image by telling Firefly that the table should be used as a catalog overlay and which columns define RA and Dec. When `CatalogCoordColumns` attribute is present, `CENTER_COLUMN` is optional. + +```js +const tblReq = firefly.util.table.makeFileRequest(null, 'http://web.ipac.caltech.edu/staff/roby/demo/WiseDemoTable.tbl',null, + { + META_INFO: { + CatalogOverlayType: 'WISE', + CatalogCoordColumns: 'crval1;crval2;EQJ2000' + } + }); +firefly.showTable('table_div', tblReq); +firefly.showCoverage('coverage_div', {gridOn:true}) +``` + + + +###Connecting XY Viewers to table + +`firefly.addXYPlot(targetDiv, parameters)` - add an XY Plot to a div + + +| parameters | type | +| ---------- | ----------- | +|targetDiv | string, the div to put the XY plot into | +|parameters | object literal | + + + +Most important parameters are: + + - **`xCol`**: The name of x column, can be an expression based on multiple columns. + If no column is specified, the first numeric column is used as an x column. + - **`yCol`**: The name of y column, can be an expression based on multiple columns. + If no column is specified, the first numeric non-x column is used as a y column. + - **`tbl_id`**: Table ID, the string that connects this XY Plot to the table data. + - **`tbl_group`**: Table group, the plot will reflect the data in the active table of the group. + +If both `tbl_id` and `tbl_group` are missing, the XY viewer will be connected to the active table in the main group. + +*Example:* +```js +tblReq = firefly.util.table.makeIrsaCatalogRequest('wise catalog', 'WISE', 'wise_allwise_p3as_psd', + { + position: '10.68479;41.26906;EQ_J2000', + SearchMethod: 'Cone', + radius: 300 + }); +firefly.addXYPlot('xyplot_div', {tbl_id: tblReq.tbl_id, xCol: 'w1mpro+w4mpro', yCol: 'w2mpro'}); +``` + +###More Code Examples + +[see firefly-api-code-examples.md](firefly-api-code-examples.md) diff --git a/src/firefly/html/demo/ffapi-2images.html b/src/firefly/html/demo/ffapi-2images.html new file mode 100644 index 0000000000..c9e34b88db --- /dev/null +++ b/src/firefly/html/demo/ffapi-2images.html @@ -0,0 +1,244 @@ + + + + + + + + + + + + Demo of Firefly Tools + + + + + +
+

Firefly - new API demo

+
+ +
+
+
+
+ +
+ +   + +   + +   + +
+ + + + + diff --git a/src/firefly/html/demo/ffapi-highlevel-charttest.html b/src/firefly/html/demo/ffapi-highlevel-charttest.html index d0f7699be4..cbbbbd4666 100644 --- a/src/firefly/html/demo/ffapi-highlevel-charttest.html +++ b/src/firefly/html/demo/ffapi-highlevel-charttest.html @@ -40,7 +40,7 @@

}; - firefly.showPlot('chartHere', chartParams); + firefly.showXYPlot('chartHere', chartParams); } } diff --git a/src/firefly/js/api/ApiHighlevelBuild.js b/src/firefly/js/api/ApiHighlevelBuild.js index 028ae67f0b..1ebf96801e 100644 --- a/src/firefly/js/api/ApiHighlevelBuild.js +++ b/src/firefly/js/api/ApiHighlevelBuild.js @@ -161,7 +161,7 @@ function buildChartPart(llApi) { * @param {XYPlotOptions} parameters the request object literal with the chart parameters * @namespace firefly */ - const showPlot= (targetDiv, parameters) => showXYPlot(llApi, targetDiv, parameters); + const showXYPlot= (targetDiv, parameters) => doShowXYPlot(llApi, targetDiv, parameters); /** * Add XY Plot view of an existing table. @@ -169,9 +169,9 @@ function buildChartPart(llApi) { * @param {XYPlotOptions} parameters the request object literal with the chart parameters * @namespace firefly */ - const addXYPlot= (targetDiv, parameters) => showXYPlot(llApi, targetDiv, parameters); + const addXYPlot= (targetDiv, parameters) => doShowXYPlot(llApi, targetDiv, parameters); - return {showPlot, addXYPlot}; + return {showXYPlot, addXYPlot}; } function buildCommon(llApi) { @@ -357,11 +357,11 @@ function makePlotId() { //---------- Private XYPlot or Histogram functions //================================================================ -function showXYPlot(llApi, targetDiv, params={}) { +function doShowXYPlot(llApi, targetDiv, params={}) { const {dispatchTableFetch}= llApi.action; const {TBL_RESULTS_ACTIVE} = llApi.action.type; const {renderDOM} = llApi.util; - const {makeFileRequest, getActiveTableId, uniqueTblId} = llApi.util.table; + const {makeFileRequest, getActiveTableId} = llApi.util.table; const {uniqueChartId, loadPlotDataForTbl} = llApi.util.chart; const {ChartsTableViewPanel}= llApi.ui; const {addActionListener} = llApi.util; @@ -404,7 +404,7 @@ function showXYPlot(llApi, targetDiv, params={}) { if (tblGroup) { tblId = getActiveTableId(tblGroup); - addActionListener(TBL_RESULTS_ACTIVE, (action, state) => { + addActionListener(TBL_RESULTS_ACTIVE, () => { const new_tblId = getActiveTableId(tblGroup); if (new_tblId !== tblId) { tblId = new_tblId; diff --git a/src/firefly/js/api/ApiUtilImage.jsx b/src/firefly/js/api/ApiUtilImage.jsx index 4eb9bef343..8ee8312dcd 100644 --- a/src/firefly/js/api/ApiUtilImage.jsx +++ b/src/firefly/js/api/ApiUtilImage.jsx @@ -6,6 +6,7 @@ import React from 'react'; import {take,race,call} from 'redux-saga/effects'; import {MouseState} from '../visualize/VisMouseSync.js'; import ImagePlotCntlr, {visRoot, ExpandType} from '../visualize/ImagePlotCntlr.js'; +import {primePlot} from '../visualize/PlotViewUtil.js'; import {dispatchAddSaga} from '../core/MasterSaga.js'; import {DefaultApiReadout} from '../visualize/ui/DefaultApiReadout.jsx'; //import {PopupMouseReadoutMinimal} from '../visualize/ui/PopupMouseReadoutMinimal.jsx'; @@ -33,12 +34,19 @@ export {RequestType} from '../visualize/RequestType'; export {ExpandType, dispatchApiToolsView} from '../visualize/ImagePlotCntlr.js'; export {CsysConverter} from '../visualize/CsysConverter.js'; export {CCUtil} from '../visualize/CsysConverter.js'; -export {primePlot} from '../visualize/PlotViewUtil.js'; -export {visRoot} from '../visualize/ImagePlotCntlr.js'; export {watchCoverage} from '../visualize/saga/CoverageWatcher.js'; -import {watchImageMetaData} from '../visualize/saga/ImageMetaDataWatcher.js'; +export {watchImageMetaData} from '../visualize/saga/ImageMetaDataWatcher.js'; +/** + * Get plot object with the given plot id. + * When plotId is not included, active plot is returned. + * @param {string} [plotId] the plotId, optional + */ +export function getPrimePlot(plotId) { + return primePlot(visRoot(), plotId); +} + /** * initialize the auto readout. Must be call once at the begging to get the popup readout running. * @param ReadoutComponent