-
-
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
legend indentation #6874
legend indentation #6874
Conversation
…elative to the title
src/components/legend/attributes.js
Outdated
@@ -105,6 +105,13 @@ module.exports = { | |||
editType: 'legend', | |||
description: 'Determines what entrywidth means.', | |||
}, | |||
indentation: { | |||
valType: 'number', | |||
min: 0, |
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.
I could see us allowing negative indentation, to remove or reduce the padding to the left of many of the symbols. Many if not most legend symbols don't use the full itemwidth
. The risk here is allowing symbols to bleed off the edge of the legend if you go too far, but I think that's acceptable if you have explicitly set a negative indentation. Maybe min: -15
, ie half the minimum itemwidth
?
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.
Yes the bleeding off the left edge was my concern as well. I have adapted the test image to showcase how it looks to indent with -15 for a line and a bar legend entry.
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.
Oh cool, we clip at the edge of the legend, that's perfect.
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.
💃 Great job @my-tien!
legend indentation
This PR adds the property
indentation
tolayout.legend
so that legend entries can be indented relative to the title.I have set the min value of this to 0 for now to avoid having to deal with adjusting the legend width and title positioning when the legend extends towards the left.