Hi everyone,
I don’t understand range selection. I believe it should be empty but it’s not. Is this a feature or a bug? It returns date ‘2017-01-02’ and may be ‘2017-01-06’ if close enough. I think it’s correct but not for my case. Thanks.
myPlot.on('plotly_relayout', function () {
var xRange = myPlot.layout.xaxis.range;
var ptsInside = [];
var N = trace1.x.length;
var count = 0;
for (var i = 0; i < N; i++) {
var xi = trace1.x[i];
d1 = (new Date(xRange[0]));
d2 = (new Date(xRange[1]));
var ds1 = d1.getUTCFullYear() + "-" + pad(d1.getUTCMonth() + 1) + "-" + pad(d1.getUTCDate());
var ds2 = d2.getUTCFullYear() + "-" + pad(d2.getUTCMonth() + 1) + "-" + pad(d2.getUTCDate());
if (xi >= ds1 && xi <= ds2) {
console.log('pushed: ' + xi);
count++;
ptsInside.push(i);
}
}
});