palantir / plottable

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

Invalidate bar label text measurer caches #3546

Closed themadcreator closed 4 years ago

themadcreator commented 4 years ago

A bug exists where bar chart labels render incorrectly when the chart is first rendered into a invalid element, such as one with zero size or display: none style.

Since text measurement is cached, these incorrect measurements would perist and the labels would remain broken even if the element becomes valid for rendering.

This change correctly invalidates all the bar chart label measurer caches, and bar labels will then render correctly when the element becomes valid.

blueprint-bot commented 4 years ago

Invalidate bar label text measurer caches

Demo: quicktests | fiddle