plotly / plotly/plotly.js

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

Đang mở
#7,508 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

feature P3
Ngôn ngữ chính
JavaScript
Star
18.3k
Fork
2k
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
28

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với hai bản tái hiện CodePen được liên kết và kiểm tra đường dẫn kết xuất tiêu đề colorbar hiện có trong plotly.js. Thay đổi được hoàn tất khi colorbar.title.text hỗ trợ căn chỉnh có thể cấu hình, bao gồm trường hợp căn phải được minh họa cho biểu đồ ternary, mà không làm thay đổi hành vi hiện tại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
data-visualization
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.