Skip to content

[v1.2.0] PanZoom Interaction Improvements

Compare
Choose a tag to compare
@jtlan jtlan released this 02 Jul 19:22
· 1984 commits to master since this release

As we mentioned in the previous release, the Plottable team is continuing to focus on making significant performance improvements, as well as developing new features. This week's release includes some improvements to Interactions.PanZoom.

Performance Improvements

58x speedup: Improved Responsiveness by Deferred Rendering

A deferred rendering option has been added to all Plots except Plots.Pie. When enabled with plot.deferredRendering(true), the Plot will respond to X and Y Scale updates more quickly, improving the performance of Interactions.PanZoom, particularly at larger data scales.

This speedup is accomplished by applying an SVG transformation in response to X and Y Scale updates, then re-rendering the Plot when no updates have been received for 500ms. Due to the transformation, parts of the Plot may appear distorted when zooming until the Plot re-renders.

deferredRendering() defaults to false.

8000 points on Plots.Scatter:

Features

Zoom Limits on Interactions.PanZoom

It is now possible to set minimum and maximum limits on zooming on Interactions.PanZoom.

This feature works by setting minimum and maximum "extent" (the total size of the domain) for a given QuantitativeScale attached to the Interactions.PanZoom. When a minimum (or maximum) limit is reached on any Scale attached to the Interaction, the user will not be able to zoom in (or out) any further.

IMPORTANT: this feature only works with Scales.Linear and Scales.Time.

To get/set a minimum extent:

minDomainExtent<D>(qScale: QuantitativeScale): D;
minDomainExtent<D>(qScale: QuantitativeScale, minDomainExtent: D): Interactions.PanZoom;

To get/set a maximum extent:

maxDomainExtent<D>(qScale: QuantitativeScale): D;
maxDomainExtent<D>(qScale: QuantitativeScale, minDomainExtent: D): Interactions.PanZoom;

Try it out: http://jsfiddle.net/yu4aw4pe/

Bugfixes

  • Plot.StackedBar now stacks correctly when using Scales.ModifiedLog (#2304).
  • Click and Drag Interactions will no longer trigger through overlays on top of the <svg> containing Plottable (#2142).
    • Thanks to @raiju for the PR!