Support dict union operator in legend updates
未關閉
還沒有人認領這個 Issue。
feature
P3
- 主要語言
- Python
- 星號
- 18.8k
- 分支
- 2.8k
- 平均合併
- 16 小時 26 分鐘
- 30 天內合併 PR
- 21
描述
Would be nice if layout.Legend instances supported the dict union operator:
import plotly.graph_objects as go
fig = go.Figure()
fig.layout.legend |= dict(title="")
TypeError: unsupported operand type(s) for |=: 'Legend' and 'dict'
Since legend.update() works in analogy to dict.update()
fig.layout.legend.update(dict(title=""))
>>> layout.Legend({
'title': {'text': ''}
})
I was expecting other parts of the dict API to work as well.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 layout.Legend 進入點開始,檢查現有的 update() 行為與字典操作之間的關係。確定 dict API 的哪些部分應受到支援,然後驗證所要求的聯集操作以及已議定的相關操作是否與 update() 一致地運作。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- api
- Issue 類型
- 功能
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100