Skip to content

Commit 9a82dfb

Browse files
authored
Merge pull request #1109 from plotly/animate_add_frame_config
add info about frame.duration to animation example
2 parents b4c52a5 + ca83e1c commit 9a82dfb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

_posts/plotly_js/animations/animations/2016-09-15-animations-animating-the-data.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
sitemap: false
88
arrangement: horizontal
99
markdown_content: |
10-
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*.
10+
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*.
1111

12-
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.
12+
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.
1313
---
14-
Plotly.plot('graph', [{
14+
Plotly.newPlot('graph', [{
1515
x: [1, 2, 3],
1616
y: [0, 0.5, 1],
1717
line: {simplify: false},
@@ -26,6 +26,9 @@
2626
transition: {
2727
duration: 500,
2828
easing: 'cubic-in-out'
29+
},
30+
frame: {
31+
duration: 500
2932
}
3033
})
3134
}

0 commit comments

Comments
 (0)