From 15f210b8fac147c2cfef3aaaea4c464ffa43bbe5 2018-05-31 17:36:04 From: Juan C. Espinoza Date: 2018-05-31 17:36:04 Subject: [PATCH] Fix noise plot not plotting gaps --- diff --git a/plotter/static/js/jroplots.js b/plotter/static/js/jroplots.js index e7f79d3..7dbfa33 100644 --- a/plotter/static/js/jroplots.js +++ b/plotter/static/js/jroplots.js @@ -155,11 +155,6 @@ class PcolorBuffer { var cnt = 0; last = x.slice(-1)[0]; while (Math.abs(parseFloat(xBuffer[i]) - last ) > 1.5 * parseFloat(interval)) { - //console.log(parseFloat(xBuffer[i])); - //console.log(last); - //console.log(Math.abs(parseFloat(xBuffer[i]) - last)); - //console.log(parseFloat(interval)); - //console.log("=========="); cnt += 1; last = last + interval; x.push(last); @@ -200,7 +195,7 @@ class PcolorBuffer { // fill data gaps var cnt = 0; - console.log('updating'); + while (Math.abs(parseFloat(obj.time[0]) - this.last) > 1.5 * parseFloat(obj.interval)) { cnt += 1; this.last += obj.interval; @@ -280,7 +275,6 @@ class Pcolor { } /* This function is used to plot all the data that have the DB and just is used when is loaded or reloaded*/ setup(data) { - console.log(data); for (var i = 0; i < data.spc.length; i++) { var layout = { height: 400, @@ -387,7 +381,7 @@ class Pcolor { } plot(obj) { - this.data = obj; + // this.data = obj; // add new data to plots and empty buffers console.log('Plotting...'); var t = new Date(obj.time[0] * 1000); @@ -421,15 +415,6 @@ class Pcolor { }); - /*Plotly.relayout(div, { - xaxis: { - range: [values.xmin, values.xmax] - }, - - - });*/ - - Plotly.restyle(div, { zmin: values.zmin, zmax: values.zmax, @@ -483,11 +468,11 @@ class Scatter { this.ybuffer.push([]); var trace = { x: t, - y: data[this.key][i], + y: values.data[i], mode: 'lines', type: 'scatter', name: 'Channel ' + i, - connectgaps:false, + connectgaps: false, }; traces.push(trace);