Closed lpatiny closed 7 years ago
The advantage would be to have methods related to a serie. Tic is actually a kind of reduce of a 2D serie. This could be a method of serie therefore.
If we want to be fast it would not use the array.reduce however.
I think we could add like that more and more methods at the level of the serie.
At the debugging point of view it would also allow to see that it is a 'Serie' which makes it more clear. It also force you to create a serie with the right variables. Currently I had no clue how to create a Serie.
I would see a code to create from scratch a chromatogram:
var chromatogram = new Chromatogram();
chromatogram.setTimes([1,2,3]);
var tic = new Serie(1);
tic.setData([10,20,30]);
chromatogram.putSerie('tic',tic);
function putSerie(name, serie) {
series[name]=serie;
}
So you could have:
What could be the advantage of this?