Context manager to animate trace / layout updates Parameters ---------- duration : number The duration of the transition, in milliseconds. If equal to zero, updates are synchronous. easing : string The easing function used
(self, duration=500, easing="cubic-in-out")
| 3124 | |
| 3125 | @contextmanager |
| 3126 | def batch_animate(self, duration=500, easing="cubic-in-out"): |
| 3127 | """ |
| 3128 | Context manager to animate trace / layout updates |
| 3129 | |
| 3130 | Parameters |
| 3131 | ---------- |
| 3132 | duration : number |
| 3133 | The duration of the transition, in milliseconds. |
| 3134 | If equal to zero, updates are synchronous. |
| 3135 | easing : string |
| 3136 | The easing function used for the transition. |
| 3137 | One of: |
| 3138 | - linear |
| 3139 | - quad |
| 3140 | - cubic |
| 3141 | - sin |
| 3142 | - exp |
| 3143 | - circle |
| 3144 | - elastic |
| 3145 | - back |
| 3146 | - bounce |
| 3147 | - linear-in |
| 3148 | - quad-in |
| 3149 | - cubic-in |
| 3150 | - sin-in |
| 3151 | - exp-in |
| 3152 | - circle-in |
| 3153 | - elastic-in |
| 3154 | - back-in |
| 3155 | - bounce-in |
| 3156 | - linear-out |
| 3157 | - quad-out |
| 3158 | - cubic-out |
| 3159 | - sin-out |
| 3160 | - exp-out |
| 3161 | - circle-out |
| 3162 | - elastic-out |
| 3163 | - back-out |
| 3164 | - bounce-out |
| 3165 | - linear-in-out |
| 3166 | - quad-in-out |
| 3167 | - cubic-in-out |
| 3168 | - sin-in-out |
| 3169 | - exp-in-out |
| 3170 | - circle-in-out |
| 3171 | - elastic-in-out |
| 3172 | - back-in-out |
| 3173 | - bounce-in-out |
| 3174 | |
| 3175 | Examples |
| 3176 | -------- |
| 3177 | Suppose we have a figure widget, `fig`, with a single trace. |
| 3178 | |
| 3179 | >>> import plotly.graph_objs as go |
| 3180 | >>> fig = go.FigureWidget(data=[{'y': [3, 4, 2]}]) |
| 3181 | |
| 3182 | 1) Animate a change in the xaxis and yaxis ranges using default |
| 3183 | duration and easing parameters. |