plotly / plotly/plotly.py

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

Aperta
#5,373 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature P2
Lingua principale
Python
Stelle
18.8k
Fork
2.8k
Merge medio
16h 26m
PR unite (30g)
21

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con le implementazioni di fig.add_vline(), fig.add_hline(), fig.add_hrect() e fig.add_vrect(), quindi confronta la loro gestione delle annotazioni con il supporto di Plotly.js per shape.label. Verifica che i quattro helper utilizzino shape labels invece di annotation objects separati, preservando i relativi label arguments e placement behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, python
Ambito
data-visualization
Tipo di issue
Refactoring
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.