Geocene / trainset

A lightweight web application for brushing labels onto time series data; useful for building training sets.
https://trainset.geocene.com/
MIT License
163 stars 36 forks source link

"Maximum call stack size exceeded" in getMinMax #117

Closed Rafnuss closed 2 years ago

Rafnuss commented 2 years ago

With large files, I get the following error Uncaught RangeError: Maximum call stack size exceeded

for https://github.com/Geocene/trainset/blob/eac024707971316ff5481868658d04a2a4f2b2a0/src/assets/js/LabelerD3.js#L765

It seems to work if you replace this line with

    minMax = y_vals.reduce(([min, max], val) => [Math.min(min, val), Math.max(max, val)], [
      Number.POSITIVE_INFINITY,
      Number.NEGATIVE_INFINITY,
    ]);
Rafnuss commented 2 years ago

Actually, this might be a duplicate of #113