plotly / plotly/plotly.py

Expose private attribute _config in Figure/FigureWidget class as public property

Abierto
#4,327 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

feature P3
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

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. 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

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.