Skip to content

Commit c54f3a3

Browse files
author
Cindy Wang
committed
Merge branch 'DM-11603-PlotColumnExp' into dev
2 parents 369eeb4 + 8d85f20 commit c54f3a3

File tree

6 files changed

+461
-112
lines changed

6 files changed

+461
-112
lines changed

src/firefly/html/demo/ffapi-slate-test3.html

Lines changed: 94 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,22 @@
7676
<ul>
7777

7878
<li>
79-
<a href='javascript:loadHistogramCharts(0,0,2,2)'>Show Histogram</a> <span class='smallCoords'>at row: 0, col: 0, w:2 h: 2</span>
79+
<a href='javascript:load2DScatter(0,0,2,2)'>Show Plotly Scatter </a> <span class='smallCoords'>at row: 0, col: 0, w:2 h: 2</span>
8080
</li>
8181
<li>
82-
<a href="javascript:loadSurface(0,2,2,2)">Show Surface</a><span class='smallCoords'>at row: 0, col: 2, w: 2, h: 2</span>
82+
<a href="javascript:loadSurface(0,2,2,2)">Show Surface </a><span class='smallCoords'>at row: 0, col: 2, w: 2, h: 2</span>
8383
</li>
8484
<li>
85-
<a href="javascript:loadBar(2,0,3,3)">Show Bar chart</a><span class='smallCoords'>at row: 2, col: 0, w: 3, h: 3</span>
85+
<a href="javascript:loadBar(2,0,3,3)">Show Bar chart </a><span class='smallCoords'>at row: 2, col: 0, w: 3, h: 3</span>
8686
</li>
8787
<li>
88-
<a href="javascript:loadPie(2,3,3,3)">Show Pie Chart</a><span class='smallCoords'>at row: 2, col: 3, w: 3. h: 3</span>
88+
<a href="javascript:loadPie(2,3,3,3)">Show Pie Chart </a><span class='smallCoords'>at row: 2, col: 3, w: 3. h: 3</span>
8989
</li>
9090
<li>
91-
<a href="javascript:loadDensity(4,0,3,3)">Show Histogram2dContour</a><span class='smallCoords'>at row: 4, col: 0, w: 3, h: 3</span>
91+
<a href="javascript:loadDensity(4,0,3,3)">Show Histogram2dContour </a><span class='smallCoords'>at row: 4, col: 0, w: 3, h: 3</span>
9292
</li>
9393
<li>
94-
<a href="javascript:loadBox(4,3,3,3)">Show Box</a><span class='smallCoords'>at row: 4, col: 3, w: 3, h: 3</span>
94+
<a href="javascript:loadBox(4,3,3,3)">Show Box </a><span class='smallCoords'>at row: 4, col: 3, w: 3, h: 3</span>
9595
</li>
9696
</ul>
9797
</body>
@@ -111,6 +111,81 @@
111111
return document.getElementById('sTarget').value;
112112
}
113113

114+
function load2DScatter(r,c,w,h) {
115+
firefly.getViewer().addCell(r,c,w,h, 'xyPlots', 'newChartContainer');
116+
117+
var trace1 = {
118+
tbl_id: "wiseCatTbl",
119+
x: "tables::w1mpro-w2mpro",
120+
y: "tables::w2mpro-w3mpro",
121+
mode: 'markers',
122+
type: 'scatter',
123+
error_x : {array: "tables::w3sigmpro"},
124+
error_y : {array: "tables::w4sigmpro"},
125+
marker: {size: 4, opacity: 0.5}
126+
};
127+
128+
var layoutS = {
129+
title: 'Color-Color',
130+
xaxis: {title: 'w1mpro-w2mpro (mag)'},
131+
yaxis: {title: 'w2mpro-w3mpro (mag)'}
132+
};
133+
134+
135+
136+
firefly.getViewer().showPlot(
137+
{chartId: 'newChart1', layout: layoutS, data: [trace1]},
138+
'newChartContainer');
139+
140+
}
141+
142+
function load3DChart(r,c,w,h) {
143+
firefly.getViewer().addCell(r,c,w,h, 'xyPlots', '3dChartContainer');
144+
145+
146+
var data3d = [
147+
{
148+
tbl_id: "wiseCatTbl",
149+
type: 'scatter3d',
150+
name: 'color-color-color',
151+
x: "tables::w1mpro-w2mpro",
152+
y: "tables::w2mpro-w3mpro",
153+
z: "tables::w3mpro-w4mpro",
154+
mode : 'markers',
155+
marker : {
156+
size: 3,
157+
line: {
158+
color: 'rgb(127, 127, 127, 0.14)',
159+
width: 1
160+
}
161+
},
162+
hoverinfo: 'x+y+z'
163+
}
164+
];
165+
166+
var tfont = {size: 11};
167+
var layout3d = {
168+
title: 'color-color-color',
169+
scene:{
170+
xaxis: {
171+
title: 'w1-w2 (mag)',
172+
titlefont: tfont
173+
},
174+
yaxis: {
175+
title: 'w2-w3 (mag)',
176+
titlefont: tfont
177+
},
178+
zaxis: {
179+
title: 'w3-w4 (mag)',
180+
titlefont: tfont
181+
}
182+
}
183+
};
184+
185+
firefly.getViewer().showPlot(
186+
{chartId: 'newChart3', layout: layout3d, data: data3d },
187+
'3dChartContainer');
188+
}
114189

115190
function loadHistogramCharts(r,c,w,h) {
116191
firefly.getViewer().addCell(r,c,w,h, 'xyPlots', 'histContainer');
@@ -187,15 +262,15 @@
187262
var dataPie = [
188263
{
189264
tbl_id: "wiseCatTbl",
190-
name: 'Area',
265+
name: 'Stats for (w1+w2)',
191266
type: 'pie',
192-
values: "tables::w1mpro",
267+
values: "tables::w1mpro+w2mpro",
193268
labels: "tables::clon",
194269
textinfo: 'none'
195270
}];
196271

197272
var layoutPie = {
198-
title: 'pie: w1mpro vs. clon',
273+
title: 'pie: w1+w2 vs. clon',
199274
showlegend: true
200275
};
201276

@@ -233,25 +308,25 @@
233308
var dataSurface = [
234309
{
235310
type: 'surface',
236-
name: 'w1-ra-dec',
311+
name: 'w1-w2-w3',
237312
tbl_id: "wiseCatTbl",
238-
x: "tables::ra",
239-
y: "tables::dec",
313+
x: "tables::w1mpro-w2mpro",
314+
y: "tables::w2mpro-w3mpro",
240315
z: "tables::w1mpro",
241316
hoverinfo: 'x+y+z'
242317
}
243318
];
244319

245320
var tfont = {size: 11};
246321
var layoutSurface = {
247-
title: 'Surface on ra & dec',
322+
title: 'Surface on w1-w2 & w2-w3',
248323
scene:{
249324
xaxis: {
250-
title: 'ra (deg)',
325+
title: 'w1-w2 (deg)',
251326
titlefont: tfont
252327
},
253328
yaxis: {
254-
title: 'dec (deg)',
329+
title: 'w2-w3 (deg)',
255330
titlefont: tfont
256331
}
257332
}
@@ -269,15 +344,15 @@
269344
var dataBox = [
270345
{
271346
type: 'box',
272-
name: 'w1mpro',
347+
name: 'w1+w2',
273348
tbl_id: "wiseCatTbl",
274-
y: "tables::w1mpro"
349+
y: "tables::w1mpro+w2mpro"
275350
},
276351
{
277352
type: 'box',
278-
name: 'w2mpro',
353+
name: 'w2+w3',
279354
tbl_id: "wiseCatTbl",
280-
y: "tables::w2mpro"
355+
y: "tables::w2mpro+w3mpro"
281356
}
282357
];
283358

0 commit comments

Comments
 (0)