Skip to content

Animating, Resizing, Rendering

Pre-release
Pre-release
Compare
Choose a tag to compare
@themadcreator themadcreator released this 12 Jun 00:01
· 7920 commits to master since this release

Animators

This release introduces a new method for customizing and overriding animations for plots.

Options on the Plottable.Animator namespace are:

  • Null: sets attributes on the selection immediately
  • Default: sets attributes using a transition that has configurable easing, duration, and delay.
  • IterativeDelay: sets attributes for each item in the selection, delaying the item by its index.

Animators are stored on the plot and are associated by a string key. For example, the VerticalBar plot has a "baseline" animator and a "bars" animator. You can override the entire animation for bars with a call like so: plot.animator("bars", new MyAnimatorImplementation()).

Animator capability is currently only available for VerticalBar plots.

Auto-Resizing

This release introduces a new method on Plottable.Component that will automatically enqueue an layout and render when the window is resized. To enable auto-resize, call component.autoResize(true)

Render Policies

The RenderController now defers to a RenderPolicy object for when to render components that have been queued for layout or rendering. Options on the Plottable.Core.RenderController.RenderPolicy namespace are:

  • Immediate: Renders immediately on the current stack.
  • AnimationFrame: Renders on the next available animation frame (if requestAnimationFrame is not available, it falls back to setTimeout).
  • Timeout: Renders using setTimeout

API Breaks

  • The Plottable.Singleton namespace was renamed to Plottable.Core
  • The .project() method on plots will only pass the result of the accessor through a scale if and only if it is supplied as the 3rd argument. This is contrary to previous behavior where projectors on "x" and "y" would always pass the result through the x-scale and y-scale, respectively.

Release Song

Sloan, Money City Maniacs