Animating, Resizing, Rendering
Pre-releaseAnimators
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 immediatelyDefault: 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.Singletonnamespace was renamed toPlottable.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.