plotly / plotly/plotly.py

Refactor `add_vline()`, `add_hline()`, `add_hrect()`, `add_vrect()` to use Plotly.js `shape.label` attribute

Offen
#5,373 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature P2
Vorherrschende Sprache
Python
Sterne
18.8k
Forks
2.8k
Ø Merge
16 Std. 26 Min.
Gemergte PRs (30 T.)
21

Beschreibung

The Plotly.py functions fig.add_vline(), fig.add_hline(), fig.add_hrect(), fig.add_vrect() accept arguments such as annotation_text which are used to create a label for the shape. This is done by creating and adding two separate objects to the Plotly.js layout: a shape, and an annotation.

However, now that Plotly.js has added support for shape labels, this is no longer necessary -- the text can be added directly as a label to the shape rather than creating two separate objects.

This would solve issues such as https://github.com/plotly/plotly.py/issues/3065 where we are doing some hacky stuff to get the label in the right place.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit den Implementierungen von fig.add_vline(), fig.add_hline(), fig.add_hrect() und fig.add_vrect(), und vergleichen Sie anschließend deren Umgang mit Annotationen mit der Unterstützung von Plotly.js für shape.label. Überprüfen Sie, dass die vier Hilfsfunktionen shape labels anstelle separater annotation objects verwenden und dabei ihre label arguments und ihr placement behavior beibehalten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, python
Bereich
data-visualization
Issue-Typ
Refactoring
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.