add option to add "select" mode on any figure (specifically, Heatmap)
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
It doesn't seem possible to add a "select" dragmode to a figure with a go.Heatmap object. You can specify the starting dragmode as "select", in which case you can immediately drag and select. But if I wanted to pan, I can't choose to select afterwards. I cannot add it to the modebar. I would like to be able to do this so I can select a region of interest on my heatmap, and setup a callback to set this region of interest in my code. I don't care about actually selecting the points in the heatmap, just the bounds of the selection box.
My workaround to this is to add a go.Scatter to my figure:
layout = go.Layout(
showlegend=False,
autosize=False,
xaxis=dict(
showgrid=False,
zeroline=False,
visible=False,
range=[0, images.shape[2] - 1],
),
yaxis=dict(
showgrid=False,
zeroline=False,
visible=False,
range=[images.shape[1] - 1, 0],
scaleanchor="x",
scaleratio=1,
),
dragmode="zoom",
modebar=go.layout.Modebar(remove=["lasso"]),
)
heat = go.FigureWidget(
data=[
go.Scatter(
x=[0],
y=[0],
),
go.Heatmap(z=current_image, colorscale="Viridis"),
],
layout=layout,
)
This works, but is kind of silly...
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 mit dem go.FigureWidget-Beispiel und konzentriere dich auf layout.dragmode, die modebar-Optionen und die im Issue beschriebene Interaktion mit go.Heatmap. Prüfe, wie Auswahl-Callbacks und Auswahlgrenzen verfügbar gemacht werden, wenn die Abbildung nur eine Heatmap enthält. Als abgeschlossen gilt, wenn sich über die modebar zwischen pan oder zoom und select wechseln lässt, ohne einen Dummy-go.Scatter hinzuzufügen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- data-visualization
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100