allow aligning hovertext for annotations
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 18.8k
- Fork
- 2.8k
- Merge medio
- 16h 26m
- PR unite (30g)
- 21
Descrizione
It looks like there is no way to control the text justification for annotation hovertexts. For example:
# Make an background image
f = px.imshow( [[255]*6]*3, origin='lower')
# Add two annotations with hovertext
f.add_annotation( x=1, y=1, text='left', hovertext='Will be left justified<br>*', showarrow=False)
f.add_annotation( x=5, y=1, text='right', hovertext='Will be right justified<br>*', showarrow=False)
# Tighten the plot
f.update_layout( margin={'l':0, 'r':0, 't':0, 'b':0}, coloraxis_showscale=False)
# This will not apply on the annotation hovertext
f.update_layout( hoverlabel_align='left')
# This does not exist and annotation hovertexts default to auto
# f.update_annotations( hoverlabel_align='left')
f.show()
The image hovertexts will be all properly left-justified, but the annotation hovertexts will default to 'auto', with the left one being left-justified, and the right one being right-justified. Am I missing something, or this is an omission in the tunable options? Is there some other way to force left-justification on the annotation hovertexts? I produce a set of tables that way that look atrocious otherwise.
Thanks!
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dalle API delle annotazioni mostrate in f.add_annotation e dal comportamento di hoverlabel_align in f.update_layout, quindi segui il modo in cui vengono esposte le opzioni di hovertext delle annotazioni. Il lavoro è completato quando gli hovertext delle annotazioni possono ricevere un’impostazione di allineamento esplicita, inclusi gli esempi di allineamento a sinistra e a destra descritti nell’issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- plotly, python
- Ambito
- data-visualization
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100