janjakubnanista / downsample

Collection of several downsampling methods for time series visualisation purposes.
MIT License
89 stars 9 forks source link

Feature request: support x array and y array input data #18

Open Benjamin-Lee opened 3 years ago

Benjamin-Lee commented 3 years ago

I'm using Plotly and have formatted my tooling to generate data formatted like this:

var trace1 = {
  x: [1, 2, 3, 4],
  y: [10, 15, 13, 17],
  mode: 'markers',
  type: 'scatter'
};

var trace2 = {
  x: [2, 3, 4, 5],
  y: [16, 5, 11, 9],
  mode: 'lines',
  type: 'scatter'
};

var trace3 = {
  x: [1, 2, 3, 4],
  y: [12, 9, 15, 12],
  mode: 'lines+markers',
  type: 'scatter'
};

var data = [trace1, trace2, trace3];

Plotly.newPlot('myDiv', data);

Since there's a lot of data (the reason I'm downsampling in the first place!) changing data shapes twice would be a big overhead unless there's an efficient way I'm missing.

janjakubnanista commented 3 years ago

Hi @Benjamin-Lee! Thank you for your feature request! I will keep you posted on progress on this, I think it's quite simple to implement. Talk soon!