plotly / plotly/plotly.py

Animations: let 'Play' button support different durations for different frames

オープン
#5,362 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

community feature P3
主要言語
Python
スター
18.8k
フォーク
2.8k
平均マージ
16時間 26分
マージ済み PR(30日)
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))]
                }]
            }
        ]
    }]
)

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

fig.update_layout に渡されるアニメーション設定から始め、特に method animate と args を使用する updatemenus のボタンを確認します。frame と transition の duration がどのように解釈されるかを追跡し、そのうえで、現在の単一 duration 形式を維持しながら Play がフレームごとの値を使用できる方法を定義してテストします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
data-visualization
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。