billboard.js 4.1.0: Live resizing, configurable subchart, React subpath & CSP-safe worker
Glad to announce billboard.js v4.1.0! ๐ This minor release is about giving back control over things that used to be fixed: how the chart behaves while its container is being dragged, what the subchart overview renders, and where the Web Worker source comes from. The React component also moved into the main package as a subpath export. For the detailed release info, please check out the releaseโฆ
Billboard.js version 4.1.0 has been released, bringing several improvements and new features. One of the most significant changes is the introduction of live resizing, which allows the chart to follow the container's size while being dragged. This is achieved through the new resize.live option. When resize.live is set to true, the chart redraws itself every frame as the container's size changes, ensuring that the chart's pixel size matches the container's size in real-time.
There are two strategies for live resizing: redraw and stretch. In the redraw strategy, the chart is redrawn every frame, allowing for an exact rendering of the chart at the new size. If the resizing redraw takes more than the animation frame budget of 16ms, the chart switches to the stretch strategy, where it stretches the rendering to the new size for the rest of the resize process. This ensures that the chart maintains a consistent rendering time and avoids frame drops during resizing.
Another notable change in this release is the configurable subchart rendering. The subchart, which was previously a small copy of the main chart, can now render as its own chart with its own type, axes, and chart options. This allows for greater flexibility in displaying data and can be useful for comparing different data series or visualizing data in different ways.
The subchart can be rendered with different chart types (such as bar or area) and can have its own axes and grid options. This feature is particularly useful when visualizing complex datasets that require multiple charts with varying visualizations.
Written by urgent.news from Dev.to's reporting โ not their text. Machine-written โ may contain errors; check the original before relying on it.