[v1.15.0] Plots.Line Performance Improvements
Plottable has released another performance improvement for Plots.Line and Plots.Area which contain large numbers of data points. Downsampling removes unnecessary data points resulting in faster rendering.
Issues with rendering a single bar on Plots.Bar have been fixed. A top oriented Axes.Time will now show labels when tickLabelPosition is set to center. Legend's default comparator sorts formatted entries correctly.
Features
Downsampling on Plots.Line
Downsampling decreases the number of lines rendered by Plots, without removing interesting data points. This feature is helpful when a large number of lines are drawn on Plots.Line or Plots.Area. Downsampling is disabled by default. Downsampling will decrease initial render time, and result in faster rendering while using Interactions.PanZoom.
: Plots.StackedArea does not support downsampling in this release. We will be adding functionality for this in the future.
Try it out: http://jsfiddle.net/yxpq4uuv/43/
/**
* Gets if downsampling is enabled
*
* When downsampling is enabled, two consecutive lines with the same slope will be merged to one line.
*/
public downsamplingEnabled(): boolean;
/**
* Sets if downsampling is enabled
*
* @returns {Plots.Line} The calling Plots.Line
*/
public downsamplingEnabled(downsampling: boolean): Plots.Line<X>;Bug Fixes
- Since 1.7.0,
Plots.Barwould not choose good default domains when only one bar was rendered, so that the bar was rendered off-center. Now, Extents are recomputed forScalesattached toPlots.Barwhen the default bar width changes, andPlotswith one bar will render correctly. (#2857). Axes.Timenow supports settingtickLabelPosition("center")while the axis is in thetoporientation (#2831)- Previously, the default
Legend.comparator()did not sort entries correctly when a custom formatter was used. Now by default, entries are sorted to match the order of the domain values of theLegend'sScales.Color.(#2843) Plottablewas doing unnecessary caching. We have deprecated_computedWidthand_computedHeightonAxesdue to premature optimization. There should be no behavior changes. (#2852)