Animations: let 'Play' button support different durations for different frames
未关闭
还没有人认领这个 Issue。
community
feature
P3
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.8k
- 平均合并
- 16 小时 26 分钟
- 30 天内合并 PR
- 21
描述
So far the button Play only support a single frame duration and a single transition duration for all the steps of the animation. It would be very useful to support different duration values at different frame step. Note that I haven't any way to define specific duration per frame, I am open to suggestions.
Current:
fig.update_layout(
updatemenus=[{
'type': 'buttons',
'buttons': [
{
'label': 'Play',
'method': 'animate',
'args': [None, {
'fromcurrent': True,
'frame': {'duration': 100, 'redraw': False},
'transition': {'duration': 100}
}]
}
]
}]
)
Possible alternative way to pass information:
fig.update_layout(
updatemenus=[{
'type': 'buttons',
'buttons': [
{
'label': 'Play',
'method': 'animate',
'args': [None, {
'fromcurrent': True,
'frame': [(str(i), {'duration': 100 if i%2 == 0 else 1000, 'redraw': False}) for i in range(len(frames))],
'transition': [(str(i), {'duration': 100 if i%2 == 0 else 1000}) for i in range(len(frames))]
}]
}
]
}]
)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从通过 fig.update_layout 传入的动画配置开始,尤其关注使用 method animate 和 args 的 updatemenus 按钮。跟踪 frame 和 transition 时长是如何被解释的,然后定义并测试一种方式,使 Play 使用每帧的值,同时保留当前的单时长形式。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- data-visualization
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100