Commit 8d709bd4 authored by Patrick Godwin's avatar Patrick Godwin

scald.js: fix update issues with heatmaps

parent 637e2bd5
Pipeline #50275 passed with stages
in 27 seconds
......@@ -265,6 +265,7 @@ class TimeHeatMap extends _TimePlot {
else {
this.base_url = new URL(`${script_name}api/${this.measurement}/${this.column}/by/${this.tag}/raw/`, window.location.href);
}
this.earliest_idx = null;
}
_new_data(respdata) {
......@@ -329,16 +330,21 @@ class TimeHeatMap extends _TimePlot {
var i;
var j;
var k;
var l;
for (i = 0; i < respdata.length; i++) {
var thisdata = this.data[i];
// remove part of heatmap with missing data if needed
if (this.earliest_idx != null) {
var maxslice = Math.max(this.earliest_idx+1, thisdata.x.length);
thisdata.x = thisdata.x.slice(0, maxslice);
thisdata.y = thisdata.y.slice(0, maxslice);
thisdata.z = thisdata.z.slice(0, maxslice);
var latest_idx = thisdata.x.indexOf(this.latest);
if (latest_idx != -1) {
var maxslice = Math.min(latest_idx, thisdata.x.length);
thisdata.x = thisdata.x.slice(0, maxslice);
for (l = 0; l < thisdata.y.length; l++) {
thisdata.z[l] = thisdata.z[l].slice(0, maxslice);
}
}
}
// add new data to current
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment