Skip to content

[v1.15.0] Plots.Line Performance Improvements

Compare
Choose a tag to compare
@bluong bluong released this 09 Oct 23:24
· 448 commits to master since this release

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.

screen shot 2015-07-24 at 3 52 55 pm: 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.Bar would not choose good default domains when only one bar was rendered, so that the bar was rendered off-center. Now, Extents are recomputed for Scales attached to Plots.Bar when the default bar width changes, and Plots with one bar will render correctly. (#2857).
  • Axes.Time now supports setting tickLabelPosition("center") while the axis is in the top orientation (#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 the Legend's Scales.Color.(#2843)
  • Plottable was doing unnecessary caching. We have deprecated _computedWidth and _computedHeight on Axes due to premature optimization. There should be no behavior changes. (#2852)