Optimize data & code when X-Axis is incremental

I’m a newbie in javascript working on https://observablehq.com/@d3/focus-context

I have several sets of data which I’d like to graph.
Each set contains:

  • a start EpochTime in second
  • an interval between each value of the set in second (1 s for ex)
  • An array of values for Y-axis, taken every interval

There might be an unknown time between the end of a set and the beginning of the next one, so the graph won’t be continuous.

So all X-axis are at the moment resumed by a { start / an interval / a number of values } in my DB.

I thought sending all the JSON without X-axis incremental values from DB to Observable code and then reconstruct my data array in javascript with objects { date: date_object, value: value_object}

My question concerns about reconstructing the x-axis data, which probably take lot of time and memory.

Maybe d3/observable doesn’t need all x-axis incremental values and there’s a way to graph just by having start / incremental / number of values ?

-> Also remember that there are several sets, and the space between the end of a set and beginning is not continuous.

Or should I simply reconstruct all x-values incrementally without bothering about cpu/memory ?