palantir / plottable

:bar_chart: A library of modular chart components built on D3
http://plottablejs.org/
MIT License
2.97k stars 224 forks source link

Fix stackOverflow in EntityStore with large XYPlots #3455

Closed zerovox closed 6 years ago

zerovox commented 6 years ago

When you have a lot of UI elements, this spread (compiled to .push.apply(this._entities, entities)) causes a Maximum Call Stack Exceeded error. Also, .concat is seemingly faster than the .push most of the time: https://jsperf.com/es6-add-element-to-create-new-array-concat-vs-spread-op

Also, when this exception gets throw, the lock is never released somewhere in StackedBar and at that point your chart is hosed.