-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: Update legend maxheight calculation logic #7483
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
base: master
Are you sure you want to change the base?
Conversation
@@ -188,7 +188,7 @@ function groupDefaults(legendId, layoutIn, layoutOut, fullData) { | |||
|
|||
coerce('xanchor', defaultXAnchor); | |||
coerce('yanchor', defaultYAnchor); | |||
coerce('maxheight', isHorizontal ? 0.5 : 1); | |||
coerce('maxheight'); |
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.
According to the attribute description: "Default value is: 0.5 for horizontal legends; 1 for vertical legends."
So it looks like we should keep it as
coerce('maxheight', isHorizontal ? 0.5 : 1);
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.
The default value depends on some other values that aren't available outside of the actual calculation, so we can't specify it here. I'll update the attribute description to better describe the default behavior.
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.
Actually, I already updated it. So, the code should be good as is.
…end-maxheight-logic
Description
Update the legend maxheight calculation logic to account for the legend being located above/below the plot. Closes #7473.
Changes
maxheight
calculation logicDemo
Testing instructions