Expose private attribute _config in Figure/FigureWidget class as public property
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 18.8k
- Forks
- 2.8k
- Merge medio
- 16 h 26 min
- PR fusionados (30 d)
- 21
Descripción
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!
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Lee packages/python/plotly/plotly/basedatatypes.py y sigue BaseFigure._config, fig.show(config=...) y las callbacks de on_change. Determina cómo debería funcionar un setter de configuración público sin perder las callbacks existentes; el trabajo estará terminado cuando se pueda cambiar la configuración de Figure y FigureWidget mientras las callbacks sigan adjuntas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- data-visualization
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100