Figure margin edit makes scrollZoom glitch / lag

未關閉
#4,223 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
32/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
python

研究方向

使用 Plotly 5.14.1 執行提供的 Python 最小範例,並比較有無 update_layout margin 變更時的捲動縮放,尤其是在點數增加時。將所描述的行為和相關 issue #3729 作為調查的起點;當編輯 margin 不再造成明顯的捲動縮放延遲時,即表示完成。

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

描述

bug P3 performance

Updating layout to change margin size works well
Enabling scrollzoom works well
Doing both at the same time gives you an interactive plot that is very laggy to scroll zoom in
Seems worse with more points
Seems related to https://github.com/plotly/plotly.js/issues/3729

I encountered this issue on Dash first, but realised it exists in pure Plotly as well
Plotly v 5.14.1 on Python 3.9.13

Minimal example (remove update_layout line to see behavior improve)

import plotly.express as px
df = px.data.gapminder()
fig = px.scatter(df, x='pop', y='gdpPercap')
fig.update_layout(margin=dict(l=0, r=0, t=0, b=0))
fig.show(config=dict({'scrollZoom': True}))
主要語言
Python
星號
18.8k
分支
2.8k
平均合併
16 小時 26 分鐘
30 天內合併 PR
21

貢獻指南

開啟貢獻指南

從這裡開始

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

plotly/plotly.py 的其他 Issue

查看 plotly/plotly.py 的全部 Issue

相似的 Issue

更多 Python Issue

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

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