plotly / plotly/plotly.js

Single-point or empty trace is not updated with slider

未關閉
#7,293 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

bug P3
主要語言
JavaScript
星號
18.3k
分支
2k
平均合併
2 天 12 小時
30 天內合併 PR
28

描述

I'm trying to create a plot with a slider that will change all the traces. I have started with the example on the plotly page here and I have created a code pen to show a few problems I have noticed:

  • If I don't have originally the same number of traces (that is, if line 10 is commented), then new traces are not added on the other steps/frames - even though I'm adding them to the "data" object, which I believe should be completely updated.
  • Even when I have now the same number of traces, if one of them has a single point (lines 90/91) or is empty, then the trace is not updated completely: in the code pen example, moving to green will add the second line trace, then going back to red will move the point but the green line is stuck there. For graphs with at least 2 points (for example, changing the lines 90/91 to at least 2 points (e.g. x:[2,3], y:[1,1],)) the issue is not present.

I believe the data object is not being updated completely, which is something I'd have expected it to do.

PS: I have noticed similar problems with sliders without the "animate", although the objects seem - strangely - to be different (for example, in this codepen I have to pass arguments as x: [[1, 2, 3]], y: [[2, 1, 3]], in args to update more than one trace, but the issue of having to have at least one trace and traces not updating are also there.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先重現連結的 Plotly 範例和 CodePens 中的 slider 與動畫案例,包括不同的 trace 數量,以及單點或空的 trace。追蹤 slider 更新和動畫影格如何套用資料物件;當所有 trace(包括新增的、單點的和空的 trace)都能正確反映每個選取的步驟時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
data-visualization
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。