[BUG]: deserialization of xrange of box select in figure with multiple subplots broken
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
Description
When you do a box (or lasso) select in a figure with multiple subplots (not the first subplot) the selection x/yrange is not a list/dict but a plain python object.
The gif above was created with this example:
import plotly.graph_objects as go
import solara
from plotly.subplots import make_subplots
def build_figure() -> go.Figure:
fig = make_subplots(rows=1, cols=2, subplot_titles=("Scatter", "Bar"))
fig.add_trace(go.Scatter(x=[1, 2, 3, 4, 5, 6], y=[2, 1, 3, 5, 4, 6], name="Series A"), row=1, col=1)
fig.add_trace(go.Bar(x=["A", "B", "C"], y=[3, 1, 2], name="Series B"), row=1, col=2)
fig.update_layout(title="FigureWidget example with 2 subplots",)
return fig
@solara.component
def Page():
def on_selection(data):
print("on_select data:", data, flush=True)
solara.FigurePlotly(build_figure(), on_selection=on_selection)
Steps to reproduce
- Create a figure with more than one subplot.
- Do a box select in the second subplot.
- Observe the data send to on_select.
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
Comienza ejecutando el ejemplo de Python proporcionado con plotly.subplots y solara.FigurePlotly; después, inspecciona los datos del callback on_selection para una selección de tipo box en el segundo subplot. Rastrea cómo se deserializa selection x/yrange para los subplots que no son el primero. Se considera terminado cuando esos rangos llegan como una list o dictionary en lugar de como un objeto Python simple.
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
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 68/100