Feature request: support `colorbar.title.text` alignment
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 18.3k
- Forks
- 2k
- Ø Merge
- 2 T. 12 Std.
- Gemergte PRs (30 T.)
- 28
Beschreibung
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.
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:
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:
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:
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
Beginne mit den beiden verlinkten CodePen-Reproduktionen und untersuche den bestehenden Rendering-Pfad für den Titel der colorbar in plotly.js. Die Änderung ist abgeschlossen, wenn colorbar.title.text eine konfigurierbare Ausrichtung unterstützt, einschließlich des für den ternary-Plot gezeigten Anwendungsfalls mit Rechtsausrichtung, ohne das aktuelle Verhalten zu beeinträchtigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- data-visualization
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100