From ca83e1c76602f43ce2f50416042c59e2fa2717ca Mon Sep 17 00:00:00 2001 From: michaelbabyn Date: Tue, 2 Oct 2018 11:49:58 -0400 Subject: [PATCH] add info about frame.duration to animation example --- .../2016-09-15-animations-animating-the-data.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/_posts/plotly_js/animations/animations/2016-09-15-animations-animating-the-data.html b/_posts/plotly_js/animations/animations/2016-09-15-animations-animating-the-data.html index 2745276efc26..74ae2d58a262 100644 --- a/_posts/plotly_js/animations/animations/2016-09-15-animations-animating-the-data.html +++ b/_posts/plotly_js/animations/animations/2016-09-15-animations-animating-the-data.html @@ -7,11 +7,11 @@ sitemap: false arrangement: horizontal markdown_content: | - The animate command lets you add dynamic behavior to Plotly graphs in a number of different ways. At its core, `Plotly.animate` transitions traces to a new state or sequence of states. When you tell Plotly to animate, it merges the properties you've supply into the current state of the plot. Therefore to animate a trace, *you must first plot the trace you wish to animate*. + The animate command lets you add dynamic behavior to Plotly graphs in a number of different ways. At its core, `Plotly.animate` transitions traces to a new state or sequence of states. When you tell Plotly to animate, it merges the properties you've supplied into the current state of the plot. Therefore to animate a trace, *you must first plot the trace you wish to animate*. - The example below transitions to new y-values each time the button is pressed. Note that to prevent artifacts while animating, the default line simplification algorithm is explicitly disabled. Currently, only scatter traces may be smoothly transitioned from one state to the next. Other traces are compatible with frames and animations but will be updated instantaneously. + The example below transitions to new y-values each time the button is pressed. Since the transition animation occurs within a frame, `frame.duration` must be set at least as long as `transition.duration`. Note that to prevent artifacts while animating, the default line simplification algorithm is explicitly disabled. Currently, only scatter traces may be smoothly transitioned from one state to the next. Other traces are compatible with frames and animations but will be updated instantaneously. --- -Plotly.plot('graph', [{ +Plotly.newPlot('graph', [{ x: [1, 2, 3], y: [0, 0.5, 1], line: {simplify: false}, @@ -26,6 +26,9 @@ transition: { duration: 500, easing: 'cubic-in-out' + }, + frame: { + duration: 500 } }) }