plotly / plotly/plotly.js

Feature request: support `colorbar.title.text` alignment

Aperta
#7,508 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature P3
Lingua principale
JavaScript
Stelle
18.3k
Fork
2k
Merge medio
2g 12h
PR unite (30g)
28

Descrizione

Reproducible example

Demo 1 : https://codepen.io/Lexachoc/pen/gbaWEPG
Demo 2 with ternary plot: https://codepen.io/Lexachoc/pen/myemoOB

The problem

There is currently no option to configure the colorbar.title.text alignment. It is always left-aligned.

Image

I've seen posts in the forum and on Stackoverflow asking how to do this, but it is not possible:
https://community.plotly.com/t/fine-grained-position-of-a-colorbar-title/43430
https://stackoverflow.com/questions/69581222/how-do-you-center-the-color-scale-as-per-title-on-plotly

Why this is important

Sometimes we have longer title text. Alignment can help us create a better look with nice alignment.
Even if we break the text with <br>, it is still left-aligned.

Imaging to have a ternary plot like below:

Image

Since the colorbar.title.text is left-aligned, we wasted a lot of space on the right side!

If we could adjust the alignment of the colorbar.title.text to that it is right-aligned, illustrated as below:

Image

We can save a lot of space and enlarge the ternary diagram!

Othrewise, the entire colorbar takes up space and makes the main ternary diagram smaller!

It looks crazy, but you should see that it is obviously affected by the colorbar.title.text in the color bar:

Image

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 due riproduzioni CodePen collegate e analizza il percorso di rendering esistente del titolo della colorbar in plotly.js. La modifica è completa quando colorbar.title.text supporta un allineamento configurabile, incluso il caso d’uso con allineamento a destra mostrato per il grafico ternary, senza interrompere il comportamento attuale.

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

Valutazione

Stack tecnologico
javascript
Ambito
data-visualization
Tipo di issue
Funzionalità
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.