[BUG]: deserialization of xrange of box select in figure with multiple subplots broken
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 18.8k
- Forks
- 2.8k
- Ø Merge
- 16 Std. 26 Min.
- Gemergte PRs (30 T.)
- 21
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das bereitgestellte Python-Beispiel mit plotly.subplots und solara.FigurePlotly auszuführen, und untersuche anschließend die Daten des on_selection-Callbacks für eine Box-Auswahl im zweiten Subplot. Verfolge, wie der selection x/yrange für nicht erste Subplots deserialisiert wird. Als abgeschlossen gilt die Aufgabe, wenn diese Bereiche als list oder dictionary statt als einfaches Python object ankommen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- data-visualization
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 68/100