make the `._has_subplots` method from `go.Figure` accessible
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
In some cases, when writings callbacks that only update a subplot of a Figure, it is useful to know if the figure will accept an append_trace to a specific location, or if add_trace should be used instead.
I use this workaround (using a try/except isn't great):
if fig._has_subplots():
fig.append_trace(trace, 1, 1)
else:
_ = fig.add_trace(trace)
If I only use fig.append_trace(trace, 1, 1), I get Exception: In order to reference traces by row and column, you must first use plotly.tools.make_subplots to create the figure with a subplot grid.
If I only use fig.add_trace(trace), the layout gets messed up.
Could it be possible to make this method public?
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
Untersuche die Implementierung von _has_subplots in go.Figure sowie die öffentliche Figure API rund um append_trace, add_trace und make_subplots. Die Arbeit ist abgeschlossen, wenn Aufrufer eine öffentliche Prüfung verwenden können, um festzustellen, ob Trace-Referenzen für Zeile und Spalte gültig sind, ohne auf eine try/except-Umgehung angewiesen zu sein, und dabei das bestehende Subplot-Verhalten erhalten bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- data-visualization
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100