-
Notifications
You must be signed in to change notification settings - Fork 3
feat(Legend): add left and right options to legend.position config
#280
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: main
Are you sure you want to change the base?
Conversation
|
Preview is ready. |
|
Visual Tests Report is ready. |
left and right options to legend.position config left and right options to legend.position config
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.
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 think an additional field such as verticalAlign is suitable for vertical positioning of the legend (similar to horizontal align?: 'left' | 'center' | 'right';)
But this can (should) be done in a separate pr. For the legend to be positioned on the left/right, the current top-only positioning is enough - this is ok in my opinion
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.
But this can (should) be done in a separate pr.
OK, I will try to implement this in the next pr.
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.
Does there seem to be enough space from below? I would have expected to see more series in legend to take up all the available space
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 would have expected to see more series in legend to take up all the available space
I'll take a look at it.
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.
fixed
| legend?.colorScale?.domain ?? getDomainForContinuousColorScale({series}); | ||
| } else { | ||
| height += lineHeight; | ||
| legendWidth = get(legend, 'width', DEFAULT_LEGEND_WIDTH); |
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'm not sure if it's a good idea to use the preset fixed value setting for the legend on the right/left. As a user, I would expect that the width will be calculated depending on the width of the legend elements - that is, the series name plus the symbol. But if the width is set explicitly, then OK, you can limit it.
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.
fixed
|
@kuzmadom |
src/constants/defaults/legend.ts
Outdated
| width: 200, | ||
| }; | ||
|
|
||
| export const DEFAULT_LEGEND_WIDTH = 80; |
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.
It looks like it's not in use
f507195 to
63f5644
Compare
|
@kuzmadom |

No description provided.