plotly / plotly/plotly.py

Using a slider creates jitter on an animated scattermapbox

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

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

bug P3 performance
主要言語
Python
スター
18.8k
フォーク
2.8k
平均マージ
16時間 26分
マージ済み PR(30日)
21

説明

An animated scattermapbox figure with a legend sometimes shows jitter while using a slider.

import plotly.graph_objects as go


lats = [_*0.02 for _ in range(500)]
lons = [0]*500

fig = go.Figure()
fig.add_trace(go.Scattermapbox(lat=[0], lon=[0], visible="legendonly"))
fig.add_trace(go.Scattermapbox(lat=[0], lon=[0], showlegend=False))

frames = []

for lat, lon in zip(lats, lons):
    frame = go.Frame(data=go.Scattermapbox(lat=[lat], lon=[lon]),
                     traces=[1], name=str(lat))
    frames.append(frame)

fig.update(frames=frames)

fig.layout.mapbox.center = {"lat": 5, "lon": 0}
fig.layout.mapbox.style = "open-street-map"
fig.layout.mapbox.zoom = 4


def frame_args(duration):
    template = {"frame": {"duration": duration},
                "mode": "immediate",
                "fromcurrent": True,
                "transition": {"duration": 0}}
    return template


def step_dict(frame):
    template = {"args": [[frame.name], frame_args(0)],
                "label": frame.name,
                "method": "animate"}
    return template

steps = [step_dict(f) for f in fig.frames]

sliders = [{"steps": steps}]

fig.update_layout(sliders=sliders)

fig.show()

https://user-images.githubusercontent.com/9297904/148424735-cb11c162-ad21-437f-afc7-55447c06d659.mov

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

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

はじめの一歩

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

調査の方向性

まず、提供された Python の再現コードを実行し、スライダーを動かしながらアニメーションする scattermapbox を観察します。結果として得られた figure から、スライダーと frame-animation の処理を追跡します。同じ凡例付きの figure がスライダーの使用中に jitter を示さなくなれば完了です。issue ではソースファイルもテストも指定されていません。

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

評価

技術スタック
python
領域
data-visualization
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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