Expose private attribute _config in Figure/FigureWidget class as public property
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 18.8k
- Fork
- 2.8k
- Merge medio
- 16h 26m
- PR unite (30g)
- 21
Descrizione
Hello Dev!
I have been using Plotly's Python library and encountered an issue when trying to set the figure config while preserving on_change callbacks on the same figure object.
The root cause is that _config is currently a private attribute in the BaseFigure class, and the only api way to modify it is through the fig.show(config=config) method call. However, show() rerenders the figure and won't carry existing on_change listeners.
Therefore, in theory, using __setattr__ to modify the _config attribute directly instead of using .show(config=config) would make both setting on_change() and setting config (e.g. scrollZoom = True) work well at the same fig, and this has been proven to be the case in testing.
So I suggest to make _config a public attribute that users can directly set it without calling show() or using setattr.
Many thanks for your supper awesome work on Plotly!
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Leggi packages/python/plotly/plotly/basedatatypes.py e segui BaseFigure._config, fig.show(config=...) e le callback on_change. Determina come dovrebbe funzionare un setter di configurazione pubblico senza perdere le callback esistenti; il lavoro è completato quando la configurazione di Figure e FigureWidget può essere modificata mentre le callback rimangono associate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- data-visualization
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100