##// END OF EJS Templates
Fix noise plot not plotting gaps
Juan C. Espinoza -
r12:15f210b8fac1
parent child
Show More
@@ -1,678 +1,663
1 1
2 2 var icon = {
3 3 'width': 20,
4 4 'path': 'M18.303,4.742l-1.454-1.455c-0.171-0.171-0.475-0.171-0.646,0l-3.061,3.064H2.019c-0.251,0-0.457,0.205-0.457,0.456v9.578c0,0.251,0.206,0.456,0.457,0.456h13.683c0.252,0,0.457-0.205,0.457-0.456V7.533l2.144-2.146C18.481,5.208,18.483,4.917,18.303,4.742 M15.258,15.929H2.476V7.263h9.754L9.695,9.792c-0.057,0.057-0.101,0.13-0.119,0.212L9.18,11.36h-3.98c-0.251,0-0.457,0.205-0.457,0.456c0,0.253,0.205,0.456,0.457,0.456h4.336c0.023,0,0.899,0.02,1.498-0.127c0.312-0.077,0.55-0.137,0.55-0.137c0.08-0.018,0.155-0.059,0.212-0.118l3.463-3.443V15.929z M11.241,11.156l-1.078,0.267l0.267-1.076l6.097-6.091l0.808,0.808L11.241,11.156z',
5 5 'ascent': 20,
6 6 'descent': 2,
7 7 };
8 8
9 9 function list2dict(values) {
10 10
11 11 var o = {};
12 12 $.each(values, function () {
13 13 o[this.name] = this.value;
14 14 });
15 15 return o;
16 16 };
17 17 /* In this class is defined all the function to RTI plot */
18 18 class PcolorBuffer {
19 19 constructor({ div, data, key, props }) {
20 20 this.div = document.getElementById(div);
21 21 this.n = 0;
22 22 this.divs = [];
23 23 this.wait = false;
24 24 this.key = key;
25 25 this.timer = (props.throttle || 30) * 1000;
26 26 this.lastRan = Date.now();
27 27 this.lastFunc = null;
28 28 this.zbuffer = [];
29 29 this.xbuffer = [];
30 30 this.empty = Array(data.yrange.length).fill(null);
31 31 this.props = props;
32 32 this.setup(data);
33 33 }
34 34 /* This function is used to plot all the data that have the DB and just is used when is loaded or reloaded*/
35 35 setup(data) {
36 36 this.last = data.time.slice(-1);
37 37 if (data.time.length == 1) {
38 38 var values = { 'time': data.time, 'data': data[this.key].map(function (x) { return [x] }) };
39 39 } else {
40 40 var values = this.fill_gaps(data.time, data[this.key], data.interval, data[this.key].length);
41 41 }
42 42 var t = values.time.map(function (x) {
43 43 var a = new Date(x * 1000);
44 44 // This condition is used to change from UTC to LT
45 45 if (data.localtime == true){
46 46 a.setTime( a.getTime() + a.getTimezoneOffset()*60*1000 );
47 47 }
48 48 return a;
49 49 });
50 50
51 51 var label;
52 52 if (data.localtime == true){
53 53 label = "LT";
54 54
55 55 }
56 56 else{
57 57 label = "UTC";
58 58 }
59 59
60 60 for (var i = 0; i < data[this.key].length; i++) {
61 61 var layout = {
62 62 xaxis: {
63 63 title: 'Time ' + label,
64 64 showgrid: false,
65 65 linecolor: 'rgb(40, 223, 247)',
66 66 color: 'rgb(40, 223, 247)',
67 67 size: 24,
68 68 titlefont: {
69 69 color: 'white',
70 70 size: 24
71 71 },
72 72 },
73 73 yaxis: {
74 74 title: 'km',
75 75 showgrid: false,
76 76 linecolor: 'rgb(40, 223, 247)',
77 77 color: 'rgb(40, 223, 247)',
78 78 size: 24,
79 79 titlefont: {
80 80 color: 'white',
81 81 size: 24
82 82 },
83 83 },
84 84 paper_bgcolor: 'black',
85 85 plot_bgcolor: 'white',
86 86 titlefont: {
87 87 color: 'white',
88 88 size: 24,
89 89 },
90 90 font: {
91 91 color: 'rgb(40, 223, 247)'
92 92 }
93 93
94 94 };
95 95 var iDiv = document.createElement('div');
96 96 iDiv.id = 'plot-' + i;
97 97 this.zbuffer.push([]);
98 98 this.n = this.n + 1;
99 99 this.div.appendChild(iDiv);
100 100 this.divs.push(iDiv.id);
101 101 var trace = {
102 102 z: values.data[i],
103 103 x: t,
104 104 y: data.yrange,
105 105 colorscale: this.props.colormap || 'Jet',
106 106 transpose: true,
107 107 type: 'heatmap'
108 108 };
109 109
110 110 if (this.props.zmin) { trace.zmin = this.props.zmin }
111 111 if (this.props.zmax) { trace.zmax = this.props.zmax }
112 112
113 113 layout.title = 'Channel ' + i + ' - ' + t.slice(-1).toLocaleString();
114 114 var conf = {
115 115 modeBarButtonsToRemove: ['sendDataToCloud', 'autoScale2d', 'hoverClosestCartesian', 'hoverCompareCartesian', 'lasso2d', 'select2d', 'zoomIn2d', 'zoomOut2d', 'toggleSpikelines'],
116 116 modeBarButtonsToAdd: [{
117 117 name: 'Edit plot',
118 118 icon: icon,
119 119 click: function (gd) {
120 120 var div = gd.id;
121 121 $('input[id=id_plotdiv]').val(div);
122 122 $('#setup').modal('show');
123 123 }
124 124 }],
125 125 displaylogo: false,
126 126 showTips: true
127 127 };
128 128 Plotly.newPlot('plot-' + i, [trace], layout, conf);
129 129 }
130 130 }
131 131
132 132 getSize() {
133 133 var div = document.getElementById(this.divs[0]);
134 134 var t = this.xbuffer.slice(-1)[0];
135 135 var n = 0;
136 136 var timespan = (this.props.timespan || 8) * 1000 * 60 * 60; //If i dont put timespan in rti.html, by default is 8hs
137 137
138 138 while ((t - div.data[0].x[n]) > timespan) {
139 139 n += 1;
140 140 }
141 141 return n;
142 142 }
143 143
144 144 fill_gaps(xBuffer, zBuffer, interval, N) {
145 145
146 146 var x = [xBuffer[0]];
147 147 var z = [];
148 148 var last;
149 149
150 150 for (var j = 0; j < N; j++) {
151 151 z.push([zBuffer[j][0]]);
152 152 }
153 153
154 154 for (var i = 1; i < xBuffer.length; i++) {
155 155 var cnt = 0;
156 156 last = x.slice(-1)[0];
157 157 while (Math.abs(parseFloat(xBuffer[i]) - last ) > 1.5 * parseFloat(interval)) {
158 //console.log(parseFloat(xBuffer[i]));
159 //console.log(last);
160 //console.log(Math.abs(parseFloat(xBuffer[i]) - last));
161 //console.log(parseFloat(interval));
162 //console.log("==========");
163 158 cnt += 1;
164 159 last = last + interval;
165 160 x.push(last);
166 161 for (var j = 0; j < N; j++) {
167 162 z[j].push(this.empty);
168 163 }
169 164 // Avoid infinite loop
170 165 if (cnt == 100) { break; }
171 166 }
172 167 x.push(xBuffer[i]);
173 168 for (var j = 0; j < N; j++) {
174 169 z[j].push(zBuffer[j][i]);
175 170 }
176 171 }
177 172 return { 'time': x, 'data': z };
178 173 }
179 174
180 175 plot() {
181 176 // add new data to plots and empty buffers
182 177 var N = this.getSize();
183 178 console.log('Plotting...');
184 179 for (var i = 0; i < this.n; i++) {
185 180 var div = document.getElementById(this.divs[i]);
186 181 if (N > 0) {
187 182 div.data[0].z = div.data[0].z.slice(N, )
188 183 div.data[0].x = div.data[0].x.slice(N, )
189 184 }
190 185 Plotly.extendTraces(div, {
191 186 z: [this.zbuffer[i]],
192 187 x: [this.xbuffer]
193 188 }, [0]);
194 189 this.zbuffer[i] = [];
195 190 }
196 191 this.xbuffer = [];
197 192 }
198 193 //This function just add the last data and is used if previously was used setup()
199 194 update(obj) {
200 195
201 196 // fill data gaps
202 197 var cnt = 0;
203 console.log('updating');
198
204 199 while (Math.abs(parseFloat(obj.time[0]) - this.last) > 1.5 * parseFloat(obj.interval)) {
205 200 cnt += 1;
206 201 this.last += obj.interval;
207 202 var newt = new Date((this.last) * 1000);
208 203 // This condition is used to change from UTC to LT
209 204 if (obj.localtime == true){
210 205 newt.setTime( newt.getTime() + newt.getTimezoneOffset()*60*1000 );
211 206 }
212 207 this.xbuffer.push(newt);
213 208 for (var i = 0; i < obj[this.key].length; i++) {
214 209 this.zbuffer[i].push(this.empty);
215 210 }
216 211 // Avoid infinite loop
217 212 if (cnt == 100) { break; }
218 213 }
219 214
220 215 // update buffers
221 216 this.last = parseFloat(obj.time[0]);
222 217 var t = new Date(obj.time[0] * 1000);
223 218 // This condition is used to change from UTC to LT
224 219 if (obj.localtime == true){
225 220 t.setTime( t.getTime() + t.getTimezoneOffset()*60*1000 );
226 221 }
227 222 this.xbuffer.push(t);
228 223 for (var i = 0; i < obj[this.key].length; i++) {
229 224 this.zbuffer[i].push(obj[this.key][i]);
230 225 // update title
231 226 var title = this.props.title || ''
232 227 var div = document.getElementById(this.divs[i]);
233 228 Plotly.relayout(div, {
234 229 title: title + ': Channel ' + i + ' - ' + t.toLocaleString(),
235 230 });
236 231 }
237 232
238 233 // plot when ready (every 10 secs)
239 234 if (!this.wait) {
240 235 this.plot();
241 236 this.wait = true;
242 237 } else {
243 238 clearTimeout(this.lastFunc)
244 239 this.lastFunc = setTimeout(function (scope) {
245 240 if ((Date.now() - scope.lastRan) >= scope.timer) {
246 241 scope.plot()
247 242 scope.lastRan = Date.now()
248 243 }
249 244 }, this.timer - (Date.now() - this.lastRan), this)
250 245 }
251 246 }
252 247 // With this function You can change parameters in your plot
253 248 restyle(values) {
254 249
255 250 var values = list2dict(values);
256 251 var div = document.getElementById(values.plotdiv);
257 252
258 253 Plotly.relayout(div, {
259 254 yaxis: {
260 255 range: [values.ymin, values.ymax]
261 256 }
262 257
263 258 });
264 259
265 260 Plotly.restyle(div, {
266 261 zmin: values.zmin,
267 262 zmax: values.zmax,
268 263 colorscale: values.colormap
269 264 });
270 265 }
271 266 }
272 267 /* In this class is defined all the function to SPC plot */
273 268 class Pcolor {
274 269 constructor({ div, data, props }) {
275 270 this.div = document.getElementById(div);
276 271 this.n = 0;
277 272 this.divs = [];
278 273 this.props = props;
279 274 this.setup(data);
280 275 }
281 276 /* This function is used to plot all the data that have the DB and just is used when is loaded or reloaded*/
282 277 setup(data) {
283 console.log(data);
284 278 for (var i = 0; i < data.spc.length; i++) {
285 279 var layout = {
286 280 height: 400,
287 281 xaxis: {
288 282 title: 'Velocity',
289 283 showgrid: false,
290 284 zeroline: false,
291 285 domain: [0, 0.7],
292 286 linecolor: 'rgb(40, 223, 247)',
293 287 color: 'rgb(40, 223, 247)',
294 288 size: 24,
295 289 titlefont: {
296 290 color: 'white',
297 291 size: 24
298 292 },
299 293 },
300 294 yaxis: {
301 295 title: 'km',
302 296 showgrid: false,
303 297 linecolor: 'rgb(40, 223, 247)',
304 298 color: 'rgb(40, 223, 247)',
305 299 size: 24,
306 300 titlefont: {
307 301 color: 'white',
308 302 size: 24
309 303 },
310 304 },
311 305 xaxis2: {
312 306 title: 'dB',
313 307 domain: [0.75, 1],
314 308 ticks: 'outside',
315 309 linecolor: 'rgb(40, 223, 247)',
316 310 color: 'rgb(40, 223, 247)',
317 311 size: 24,
318 312 titlefont: {
319 313 color: 'white',
320 314 size: 24
321 315 },
322 316 },
323 317 titlefont: {
324 318 color: 'white',
325 319 size: 18
326 320 },
327 321 font:{
328 322 color:'rgb(40, 223, 247)'
329 323 },
330 324 paper_bgcolor: 'black',
331 325 plot_bgcolor: 'white',
332 326 };
333 327 var iDiv = document.createElement('div');
334 328 iDiv.id = 'plot-' + i;
335 329 iDiv.className += iDiv.className ? ' col-md-6' : 'col-md-6';
336 330 this.n = this.n + 1;
337 331 this.div.appendChild(iDiv);
338 332 this.divs.push(iDiv.id);
339 333
340 334 var trace1 = {
341 335 z: data.spc[i],
342 336 x: data.xrange,
343 337 y: data.yrange,
344 338 colorscale: this.props.colormap || 'Jet',
345 339 transpose: true,
346 340 type: 'heatmap'
347 341 };
348 342
349 343 var trace2 = {
350 344 x: data.rti[i],
351 345 y: data.yrange,
352 346 xaxis: 'x2',
353 347 yaxis: 'y',
354 348 type: 'scatter',
355 349 };
356 350
357 351 if (this.props.zmin) {
358 352 trace1.zmin = this.props.zmin
359 353 }
360 354 if (this.props.zmax) {
361 355 trace1.zmax = this.props.zmax;
362 356 layout.xaxis2.range = [this.props.zmin, this.props.zmax]
363 357 }
364 358
365 359 var t = new Date(data.time * 1000);
366 360 // This condition is used to change from UTC to LT
367 361 if (data.localtime == true){
368 362 t.setTime( t.getTime() + t.getTimezoneOffset()*60*1000 );
369 363 }
370 364 layout.title = 'Channel ' + i + ': ' + data.noise[i] + 'dB - ' + t.toLocaleString();
371 365 var conf = {
372 366 modeBarButtonsToRemove: ['sendDataToCloud', 'autoScale2d', 'hoverClosestCartesian', 'hoverCompareCartesian', 'lasso2d', 'select2d', 'zoomIn2d', 'zoomOut2d', 'toggleSpikelines'],
373 367 modeBarButtonsToAdd: [{
374 368 name: 'Edit plot',
375 369 icon: icon,
376 370 click: function (gd) {
377 371 var div = gd.id;
378 372 $('input[id=id_plotdiv]').val(div);
379 373 $('#setup').modal('show');
380 374 }
381 375 }],
382 376 displaylogo: false,
383 377 showTips: true
384 378 };
385 379 Plotly.newPlot('plot-' + i, [trace1, trace2], layout, conf);
386 380 }
387 381 }
388 382
389 383 plot(obj) {
390 this.data = obj;
384 // this.data = obj;
391 385 // add new data to plots and empty buffers
392 386 console.log('Plotting...');
393 387 var t = new Date(obj.time[0] * 1000);
394 388 // This condition is used to change from UTC to LT
395 389 if (obj.localtime == true){
396 390 t.setTime( t.getTime() + t.getTimezoneOffset()*60*1000 );
397 391 }
398 392 for (var i = 0; i < this.n; i++) {
399 393 var div = document.getElementById(this.divs[i]);
400 394 Plotly.relayout(div, {
401 395 title: 'Channel ' + i + ': ' + obj.noise[i] + 'dB - ' + t.toLocaleString(),
402 396
403 397 });
404 398 Plotly.restyle(div, {
405 399 z: [obj.spc[i], null],
406 400 x: [obj.xrange, obj.rti[i]]
407 401 }, [0, 1]);
408 402 }
409 403 }
410 404 // With this function You can change parameters in your plot
411 405 restyle(values) {
412 406
413 407 var values = list2dict(values);
414 408 var div = document.getElementById(values.plotdiv);
415 409
416 410 Plotly.relayout(div, {
417 411 yaxis: {
418 412 range: [values.ymin, values.ymax]
419 413 },
420 414
421 415
422 416 });
423 417
424 /*Plotly.relayout(div, {
425 xaxis: {
426 range: [values.xmin, values.xmax]
427 },
428
429
430 });*/
431
432
433 418 Plotly.restyle(div, {
434 419 zmin: values.zmin,
435 420 zmax: values.zmax,
436 421 xmin: values.xmin,
437 422 xmax: values.xmax,
438 423
439 424
440 425 colorscale: values.colormap
441 426 });
442 427 }
443 428 }
444 429 /* In this class is defined all the function to Scatter(noise) plot */
445 430 class Scatter {
446 431 constructor({ div, data, key, props }) {
447 432 this.div = document.getElementById(div);
448 433 this.n = 0;
449 434 this.key = key;
450 435 this.wait = false;
451 436 this.timer = (props.throttle || 30) * 1000;
452 437 this.lastRan = Date.now();
453 438 this.lastFunc = null;
454 439 this.ybuffer = [];
455 440 this.xbuffer = [];
456 441 this.props = props;
457 442 this.setup(data);
458 443 }
459 444 /* This function is used to plot all the data that have the DB and just is used when is loaded or reloaded*/
460 445 setup(data) {
461 446
462 447 this.data = data; //le agrego juan carlos para ver la data en mi consola
463 448 var traces = [];
464 449 this.last = data.time.slice(-1);
465 450 if (data.time.length == 1) {
466 451 var values = { 'time': data.time, 'data': data[this.key] };
467 452 } else {
468 453 var values = this.fill_gaps(data.time, data[this.key], data.interval, data[this.key].length);
469 454 }
470 455
471 456 var t = values.time.map(function (x) {
472 457 var a = new Date(x * 1000);
473 458 // This condition is used to change from UTC to LT
474 459 if (data.localtime == true){
475 460 a.setTime( a.getTime() + a.getTimezoneOffset()*60*1000 );
476 461 }
477 462 return a;
478 463 });
479 464
480 465 for (var i = 0; i < data[this.key].length; i++) {
481 466
482 467 this.n = this.n + 1;
483 468 this.ybuffer.push([]);
484 469 var trace = {
485 470 x: t,
486 y: data[this.key][i],
471 y: values.data[i],
487 472 mode: 'lines',
488 473 type: 'scatter',
489 474 name: 'Channel ' + i,
490 475 connectgaps:false,
491 476 };
492 477
493 478 traces.push(trace);
494 479 }
495 480 var title = this.props.title || ''
496 481 var layout = {
497 482 // autosize: false,
498 483 // width: 800,
499 484 // height: 400,
500 485 title: title + ' - ' + t.slice(-1).toLocaleString(),
501 486 font: {
502 487 size: 18,
503 488 color: 'white'
504 489 },
505 490 plot_bgcolor: 'black',
506 491 paper_bgcolor: 'black',
507 492 xaxis: {
508 493 title: 'Time',
509 494 linecolor: 'rgb(40, 223, 247)',
510 495 color: 'rgb(40, 223, 247)',
511 496 size: 24,
512 497 titlefont: {
513 498 color: 'white',
514 499 size: 24
515 500 },
516 501 },
517 502 yaxis: {
518 503 title: this.props.ylabel || 'dB',
519 504 linecolor: 'rgb(40, 223, 247)',
520 505 color: 'rgb(40, 223, 247)',
521 506 size: 24,
522 507 titlefont: {
523 508 color: 'white',
524 509 size: 24
525 510 },
526 511 },
527 512 titlefont: {
528 513 size: 24,
529 514 }
530 515 };
531 516
532 517 if (this.props.ymin) { layout.yaxis.range = [this.props.ymin, this.props.ymax] }
533 518
534 519 var conf = {
535 520 modeBarButtonsToRemove: ['sendDataToCloud', 'autoScale2d', 'hoverClosestCartesian', 'hoverCompareCartesian', 'lasso2d', 'select2d', 'zoomIn2d', 'zoomOut2d', 'toggleSpikelines'],
536 521 modeBarButtonsToAdd: [{
537 522 name: 'Edit plot',
538 523 icon: icon,
539 524 click: function (gd) {
540 525 $('#setup').modal('show');
541 526 }
542 527 }],
543 528 displaylogo: false,
544 529 showTips: true
545 530 };
546 531 Plotly.newPlot('plot', traces, layout, conf);
547 532 }
548 533
549 534 getSize() {
550 535 var t = this.xbuffer.slice(-1)[0];
551 536 var n = 0;
552 537 var timespan = (this.props.timespan || 12) * 1000 * 60 * 60;
553 538
554 539 while ((t - this.div.data[0].x[n]) > timespan) {
555 540 n += 1;
556 541 }
557 542 return n;
558 543 }
559 544
560 545 fill_gaps(xBuffer, yBuffer, interval, N) {
561 546
562 547 var x = [xBuffer[0]];
563 548 var y = [];
564 549
565 550 for (var j = 0; j < N; j++) {
566 551 y.push([yBuffer[j][0]]);
567 552 }
568 553
569 554 var last;
570 555
571 556 for (var i = 1; i < xBuffer.length; i++) {
572 557 var cnt = 0;
573 558 last = x.slice(-1)[0];
574 559 while (Math.abs(parseFloat(xBuffer[i]) - last) > 1.5 * parseFloat(interval)) {
575 560 cnt += 1;
576 561 last = last + interval;
577 562 x.push(last);
578 563 for (var j = 0; j < N; j++) {
579 564 y[j].push(null);
580 565 }
581 566 // Avoid infinite loop
582 567 if (cnt == 50) { break; }
583 568 }
584 569 x.push(xBuffer[i]);
585 570
586 571 for (var j = 0; j < N; j++) {
587 572 y[j].push(yBuffer[j][i]);
588 573 }
589 574 }
590 575 return { 'time': x, 'data': y };
591 576 }
592 577
593 578 plot() {
594 579 // add new data to plots and empty buffers
595 580 var xvalues = [];
596 581 var yvalues = [];
597 582 var traces = [];
598 583 var N = this.getSize();
599 584 console.log('Plotting...');
600 585 for (var i = 0; i < this.n; i++) {
601 586 if (N > 0) {
602 587 this.div.data[i].y = this.div.data[i].y.slice(N, )
603 588 this.div.data[i].x = this.div.data[i].x.slice(N, )
604 589 }
605 590 yvalues.push(this.ybuffer[i]);
606 591 xvalues.push(this.xbuffer);
607 592 traces.push(i);
608 593 this.ybuffer[i] = [];
609 594 }
610 595 Plotly.extendTraces(this.div, {
611 596 y: yvalues,
612 597 x: xvalues
613 598 }, traces);
614 599 this.xbuffer = [];
615 600 }
616 601 //This function just add the last data and is used if previously was used setup()
617 602 update(obj) {
618 603
619 604 // fill data gaps
620 605 var cnt = 0;
621 606 while (Math.abs(parseFloat(obj.time[0]) - this.last ) > 1.5 * parseFloat(obj.interval)) {
622 607 cnt += 1;
623 608 this.last += obj.interval;
624 609 var newt = new Date((this.last) * 1000);
625 610 // This condition is used to change from UTC to LT
626 611 if (obj.localtime == true){
627 612 newt.setTime( newt.getTime() + newt.getTimezoneOffset()*60*1000 );
628 613 }
629 614 this.xbuffer.push(newt);
630 615 for (var i = 0; i < this.n; i++) {
631 616 this.ybuffer[i].push(null);
632 617 }
633 618 // Avoid infinite loop
634 619 if (cnt == 100) { break; }
635 620 }
636 621
637 622 // update buffers
638 623 this.last = parseFloat(obj.time[0]);
639 624 var t = new Date(obj.time[0] * 1000);
640 625 // This condition is used to change from UTC to LT
641 626 if (obj.localtime == true){
642 627 t.setTime( t.getTime() + t.getTimezoneOffset()*60*1000 );
643 628 }
644 629 this.xbuffer.push(t);
645 630 for (var i = 0; i < this.n; i++) {
646 631 this.ybuffer[i].push(obj[this.key][i][0]);
647 632 }
648 633 var title = this.props.title || ''
649 634 Plotly.relayout(this.div, {
650 635 title: title + ' - ' + t.toLocaleString(),
651 636 });
652 637
653 638 // plot when ready (every 10 secs)
654 639 if (!this.wait) {
655 640 this.plot();
656 641 this.wait = true;
657 642 } else {
658 643 clearTimeout(this.lastFunc)
659 644 this.lastFunc = setTimeout(function (scope) {
660 645 if ((Date.now() - scope.lastRan) >= scope.timer) {
661 646 scope.plot()
662 647 scope.lastRan = Date.now()
663 648 }
664 649 }, this.timer - (Date.now() - this.lastRan), this)
665 650 }
666 651 }
667 652 // With this function You can change parameters in your plot
668 653 restyle(values) {
669 654
670 655 var values = list2dict(values);
671 656 Plotly.relayout(this.div, {
672 657 yaxis: {
673 658 range: [values.ymin, values.ymax]
674 659 }
675 660
676 661 });
677 662 }
678 663 }
General Comments 0
You need to be logged in to leave comments. Login now