Feature request: support `colorbar.title.text` alignment
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 18.3k
- 派生
- 2k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 28
描述
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:
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从两个链接的 CodePen 复现开始,检查 plotly.js 中现有的 colorbar 标题渲染路径。当 colorbar.title.text 支持可配置的对齐方式,包括 ternary 图中所示的右对齐用例,同时不破坏当前行为时,此更改即完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- data-visualization
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100