-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New defaults for colorbar.title.font and legend.title.font to depend on colorbar.tickfont and legend.font and increase their sizes #5611
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
@@ -144,7 +144,7 @@ | |||
"legend": { | |||
"orientation": "h", | |||
"title": { | |||
"text": "<b>bar, funnel & waterfall</b><br>textangle:-45" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of removing all the <b>
tags in titles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question.
To make it easier to see what the default look like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - we have other examples of styled text, so this is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃
Closes #5595.
Instead of using
legend.font
, thelayout.font
used to be applied as the default forlegend.title.font
.This PR fixes that.
Instead of using
colorbar.tickfont
, thelayout.font
used to be applied as the default forcolorbar.title.font
.This PR fixes that too.
The
legend.title.font.size
would be defaulted to be around 20% greater than thelegend.font
.The
colorbar.title.font.size
would be defaulted to be around 20% greater than thecolorbar.tickfont
.The gap between
legend.title
and items is increased whenlegend.title.side
is set toleft
.@plotly/plotly_js