Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dict union operator in legend updates #4046

Open
janosh opened this issue Jan 30, 2023 · 1 comment · May be fixed by #4047
Open

Support dict union operator in legend updates #4046

janosh opened this issue Jan 30, 2023 · 1 comment · May be fixed by #4047
Labels
feature something new P3 backlog

Comments

@janosh
Copy link
Contributor

janosh commented Jan 30, 2023

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.

@nicolaskruchten
Copy link
Contributor

That's a cool idea! We'd surely accept a pull-request for that :)

@AaronStiff AaronStiff added the feature something new label Feb 11, 2023
@gvwilson gvwilson self-assigned this Jul 5, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added the P3 backlog label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P3 backlog
Projects
None yet
4 participants