Skip to content
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

Fixed the line seperator bug between colorLegend and SizeLegend in scatterplot charts #2830

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

Anubhav-2003
Copy link
Contributor

Issue it fixes: #2735

What kind of change does this PR introduce:
It fixes the line seperator bug between ColorLegend and SizeLegend in the scatterplot charts.

@Anubhav-2003
Copy link
Contributor Author

@sophiamersmann Kindly review my PR and approve it. Thank you.

@sophiamersmann sophiamersmann self-requested a review October 23, 2023 16:44
Copy link
Member

@sophiamersmann sophiamersmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Anubhav-2003

Thank you for your contribution!

The check that you added almost gets us there. In a few instances, the separator line is also removed for charts that have both a colour and a size legend. Check out this chart, for example. It would be better to rely on legendItems or even legendDimensions itself to determine whether the colour legend is present or not.

Additionally, it would be nice to remove the extra padding that is only needed when the colour legend is present. The y-position of the size legend is defined here:

const sizeLegendY = bounds.top + legendDimensions.height + 16

It would be great if you could update sizeLegendY such that the size legend is rendered at the very top if the colour legend is not displayed.

…ndItems.length, also solved the padding issue for sizeLegend
@Anubhav-2003
Copy link
Contributor Author

@sophiamersmann I have tried to implement the changes according to your instructions. Please review my changes. Thank You.

@sophiamersmann sophiamersmann self-requested a review October 24, 2023 06:58
Copy link
Member

@sophiamersmann sophiamersmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I'll merge this code into master now. Thanks again for your contribution!

@sophiamersmann sophiamersmann merged commit 09cd35a into owid:master Oct 25, 2023
8 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ScatterPlot: Extra line in legend if no colour legend is displayed
2 participants