Conversation
|
Will you do the vertical-centering in another PR or in this one? I notice that none of the mocks have just the normal default behaviour of "a short three word legend title on a single line with no styling" so it's hard to see in the baseline diffs what the final outcome is |
We could add that feature if this |
Good call. I should add/adjust mocks to show the default. |
|
We should at least add the ability to do Perhaps it's not a great default when the horizontal legend is multiple lines? we can set it to default to |
|
Or maybe the right heuristic is to redefine "left" to mean "the centerline of the title bounding box is colinear with the centerline of the top-most legend item" ? |
|
OK so right now just changing the font size gives much better vertical alignment, mostly by accident: the baselines of the text are aligned. Some additional things to do here:
|
|
|
||
| var tickFont = colorbarOut.tickfont; | ||
| var dfltTitleFont = Lib.extendFlat({}, tickFont, { | ||
| color: font.color, |
There was a problem hiding this comment.
Here the colorbar.title.font.color depends on layout.font not tickfont so that with inside ticklabels getting white, it renders outside using #444.
Co-authored-by: Alex Johnson <johnson.alex.c@gmail.com>
| "legend": { | ||
| "orientation": "h", | ||
| "title": { | ||
| "text": "<b>bar, funnel & waterfall</b><br>textangle:-45" |
There was a problem hiding this comment.
What's the purpose of removing all the <b> tags in titles?
There was a problem hiding this comment.
Good question.
To make it easier to see what the default look like.
There was a problem hiding this comment.
OK - we have other examples of styled text, so this is fine.
Closes #5595.
Instead of using
legend.font, thelayout.fontused to be applied as the default forlegend.title.font.This PR fixes that.
Instead of using
colorbar.tickfont, thelayout.fontused to be applied as the default forcolorbar.title.font.This PR fixes that too.
The
legend.title.font.sizewould be defaulted to be around 20% greater than thelegend.font.The
colorbar.title.font.sizewould be defaulted to be around 20% greater than thecolorbar.tickfont.The gap between
legend.titleand items is increased whenlegend.title.sideis set toleft.@plotly/plotly_js