plotly / plotly/plotly.js

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

Ouverte
#7,508 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

feature P3
Langage dominant
JavaScript
Étoiles
18.3k
Forks
2k
Merge moyen
2 j 12 h
PR mergées (30 j)
28

Description

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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par les deux reproductions CodePen liées et examinez le chemin de rendu existant du titre de la colorbar dans plotly.js. La modification est terminée lorsque colorbar.title.text prend en charge un alignement configurable, y compris le cas d’utilisation avec alignement à droite montré pour le graphique ternary, sans modifier le comportement actuel.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript
Domaine
data-visualization
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.