Support dict union operator in legend updates
Open
Nobody has claimed this yet.
feature
P3
- Dominant language
- Python
- Stars
- 18.8k
- Forks
- 2.8k
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 21
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the layout.Legend entry point and inspect how its existing update() behavior relates to dictionary operations. Determine which parts of the dict API are intended to be supported, then verify that the requested union operation and the agreed related operations behave consistently with update().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100