Skip to content

Commit d46ffdc

Browse files
authored
DM-6282 merge external chart API, pull request #170
DM-6282 Chart API: external API and the API for histogram
2 parents 390e6df + b351044 commit d46ffdc

File tree

14 files changed

+530
-207
lines changed

14 files changed

+530
-207
lines changed

.eslintrc

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
"jsdoc"
55

66
],
7-
/* "settings": {
8-
"jsdoc": {
9-
"tagNamePreference": {
10-
"param": "param",
11-
"returns": ["returns", "return"],
12-
"description":"desc"
13-
}
14-
}
15-
},*/
7+
/* "settings": {
8+
"jsdoc": {
9+
"tagNamePreference": {
10+
"param": "param",
11+
"returns": ["returns", "return"],
12+
"description":"desc"
13+
}
14+
}
15+
},*/
1616

1717
"env": {
1818
"es6": true,
@@ -78,14 +78,15 @@
7878
"space-infix-ops": 0,
7979
"quotes": [2, "single", "avoid-escape"],
8080
"eqeqeq": 1,
81+
//"valid-jsdoc": [2, { "requireReturn" : false, "requireParamDescription": false, "requireReturnDescription": false}]
8182
//jsdoc rules
82-
"jsdoc/check-param-names": 0,
83+
"jsdoc/check-param-names": 2,
8384
"jsdoc/check-tag-names": 0,
84-
"jsdoc/check-types": 1,
85+
"jsdoc/check-types": 0,
8586
"jsdoc/newline-after-description": 0,
8687
"jsdoc/require-description-complete-sentence": 0,
8788
"jsdoc/require-hyphen-before-param-description": 0,
88-
"jsdoc/require-param": 0,
89+
"jsdoc/require-param": 2,
8990
"jsdoc/require-param-description": 0,
9091
"jsdoc/require-param-type": 0,
9192
"jsdoc/require-returns-description": 0,

src/firefly/html/demo/ffapi-highlevel-test.html

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,20 @@
4444
<div id="tables-2" style="display: inline-block; width: 550px; height: 300px; margin: 10px; background-color: white"></div>
4545
<div id="tables-1" style="display: inline-block; width: 550px; height: 300px; margin: 10px; background-color: white; position: absolute"></div>
4646
</div>
47-
<div id="xyPlot1" style="display: inline-block; width: 550px; height: 300px; margin: 10px; background-color: white"></div>
48-
<div id="xyPlot2" style="display: inline-block; width: 550px; height: 300px; margin: 10px; background-color: white; position: absolute"></div>
47+
<div>XYPlot from API calls:
48+
<a href='javascript:firefly.getViewer().showXYPlot(xyPlotOpsReq3)'>Show XY Plot</a>
49+
</div>
50+
<div>
51+
<div id="xyPlot1" style="display: inline-block; width: 550px; height: 300px; margin: 10px; background-color: white"></div>
52+
<div id="xyPlot2" style="display: inline-block; width: 550px; height: 300px; margin: 10px; background-color: white; position: absolute"></div>
53+
</div>
54+
<div>XYPlot from API calls:
55+
<a href='javascript:firefly.getViewer().showHistogram(histogramOpsReq3)'>Show Histogram</a>
56+
</div>
57+
<div>
58+
<div id="histogram1" style="display: inline-block; width: 550px; height: 300px; margin: 10px; background-color: white"></div>
59+
<div id="histogram2" style="display: inline-block; width: 550px; height: 300px; margin: 10px; background-color: white; position: absolute"></div>
60+
</div>
4961
<div>Tables from deprecated API calls:</div>
5062
<div>
5163
<div id="oldSelectable" style="display: inline-block; width: 550px; height: 300px; margin: 10px; background-color: white"></div>
@@ -200,13 +212,19 @@
200212
META_INFO: {CENTER_COLUMN: 'crval1;crval2;EQJ2000'}
201213
});
202214

215+
203216
firefly.showTable('tables-1', tblReq1);
204217
firefly.showTable('tables-1', tblReq3);
205218
firefly.showTable('tables-2', tblReq2, {removable: false, showUnits: true, showFilters: true});
206219
//----------------- CHART DEMO ------------------------//
207220
//--- using QUERY_ID: 'upload' does not work getActiveTableId('upload') returns undefined ---//
208-
firefly.addXYPlot('xyPlot1', {tbl_id: tblReq2.tbl_id, xCol: 'ra', yCol: 'dec', help_id: 'visualization.xyplotViewer'});
209-
firefly.addXYPlot('xyPlot2', {tbl_id: tblReq2.tbl_id, xCol: 'w1mpro+w4mpro', yCol: 'w2mpro'});
221+
xyPlotOpsReq3 = {source: 'http://web.ipac.caltech.edu/staff/roby/demo/WiseDemoTable.tbl', xCol: 'ra1', yCol: 'dec1'};
222+
firefly.showXYPlot('xyPlot1', {tbl_id: tblReq2.tbl_id, xCol: 'ra', yCol: 'dec', help_id: 'visualization.xyplotViewer'});
223+
firefly.showXYPlot('xyPlot2', {tbl_id: tblReq2.tbl_id, xCol: 'w1mpro+w4mpro', yCol: 'w2mpro'});
224+
histogramOpsReq3 = {source: 'http://web.ipac.caltech.edu/staff/roby/demo/WiseDemoTable.tbl', col: 'modeint', xOptions: 'log'};
225+
firefly.showHistogram('histogram1', {tbl_id: tblReq2.tbl_id, col: 'w1mpro'});
226+
firefly.showHistogram('histogram2', {tbl_id: tblReq2.tbl_id, col: 'w2mpro+w3mpro', falsePositiveRate: 0.05});
227+
210228

211229
//-----< old table api ------//
212230
var tblParams = {
@@ -427,6 +445,6 @@
427445
</script>
428446

429447

430-
<script type="text/javascript" src="../firefly_loader.js"></script>
448+
<script type="text/javascript" src="http://localhost:8080/firefly/firefly_loader.js"></script>
431449

432450

src/firefly/js/api/ApiBuild.js

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,51 @@ import {buildViewerApi} from './ApiViewer.js';
4949
import './ApiStyle.css';
5050

5151

52-
/**@namespace firefly*/
52+
/**
53+
* High-level API.
54+
* @public
55+
* @namespace firefly
56+
*/
5357

54-
/**@namespace firefly.action*/
58+
/**
59+
* Actions and action dispatchers.
60+
* @public
61+
* @namespace firefly.action
62+
*/
5563

56-
/**@namespace firefly.ui*/
64+
/**
65+
* React components.
66+
* @public
67+
* @namespace firefly.ui
68+
*/
5769

58-
/**@namespace firefly.util*/
70+
/**
71+
* Utilities.
72+
* @public
73+
* @namespace firefly.util
74+
*/
5975

60-
/** @namespace firefly.util.chart*/
76+
/**
77+
* Chart utilities.
78+
* @public
79+
* @namespace firefly.util.chart
80+
*/
6181

62-
/** @namespace firefly.util.data*/
82+
/**
83+
* @namespace firefly.util.data
84+
*/
6385

64-
/**@namespace firefly.util.image*/
86+
/**
87+
* Image utilities.
88+
* @public
89+
* @namespace firefly.util.image
90+
*/
6591

66-
/** @namespace firefly.util.table*/
92+
/**
93+
* Table utilities.
94+
* @public
95+
* @namespace firefly.util.table
96+
*/
6797

6898

6999
/**
@@ -168,7 +198,7 @@ export function buildLowlevelAPI() {
168198

169199
/**
170200
* pull all the dispatch functions out of the object
171-
* @param obj
201+
* @param {Object} obj
172202
* @return {*}
173203
* @ignore
174204
*/
@@ -182,8 +212,8 @@ function findDispatch(obj) {
182212

183213
/**
184214
* pull all the action type constants out of the object
185-
* @param obj
186-
* @param prefix
215+
* @param {Object} obj
216+
* @param {string} prefix
187217
* @return {*}
188218
* @ignore
189219
*/

0 commit comments

Comments
 (0)