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

Prevent tile map from overlapping legend on small screens #472

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Conversation

contolini
Copy link
Member

Adds a small margin to prevent the tile map from overlapping the legend on small screens (~750px).

Fixes DATAP-30.

Screenshots

before after
before after

Checklist

  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows the standards laid out in the front end playbook
  • Passes all existing automated tests
  • New functions include new tests
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged
  • Visually tested in supported browsers and devices
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)

@@ -475,7 +475,7 @@ class TileMap {

options.chart.marginRight = 0;
options.chart.marginLeft = 0;
options.chart.marginTop = legendHeight;
options.chart.marginTop = legendHeight + 15;
Copy link
Member

Choose a reason for hiding this comment

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

Should this be set here instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

I assumed legendHeight was used to control the height of the legend but it looks like the value is only used to set a buffer between the map and the legend. So I think you're right, it probably makes more sense to alter the breakpoints array. 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

I ended up just increasing the margin at all the breakpoints because IMHO the map is too close to the legend at most sizes.

Increase tile map's top margin to prevent it from overlapping the legend.
@contolini contolini added this pull request to the merge queue Oct 10, 2023
Merged via the queue into main with commit 0f04731 Oct 10, 2023
2 checks passed
@contolini contolini deleted the tile-map branch October 10, 2023 15:43
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.

3 participants