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

Upgrades for USMap #1522

Merged
merged 7 commits into from Jan 29, 2024
Merged

Upgrades for USMap #1522

merged 7 commits into from Jan 29, 2024

Conversation

hughess
Copy link
Member

@hughess hughess commented Jan 25, 2024

Description

This PR adds several upgrades to the USMap component:

  • Adds Hawaii and Alaska to the map
  • Expands the size of the map and fixes sizing issues on mobile
  • Removes NaNs from tooltips
  • Adds support for custom color palettes with the colorPalette prop (accepts an array of colors)
  • Legend support (use with legend=true)
  • Filtered legend support (use with filter=true)

This example uses CSS color names, but this prop accepts hex codes, RGB, HSL:

<USMap
    data={demoData}
    state=name
    value=population
    colorPalette={['maroon','white','navy']}
    legend=true
    filter=false
/>
CleanShot 2024-01-24 at 21 04 45@2x

Other Potential Changes

  • Legend position control
  • Support for projections
  • Modifications to support arbitrary geoJSONs for other map regions

Checklist

  • For UI or styling changes, I have added a screenshot or gif showing before & after
  • I have added a changeset

Copy link

changeset-bot bot commented Jan 25, 2024

🦋 Changeset detected

Latest commit: dedbc44

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@evidence-dev/component-utilities Minor
@evidence-dev/core-components Minor
@evidence-dev/components Minor
@evidence-dev/evidence Major
evidence-test-environment Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Jan 25, 2024

Deploy Preview for evidence-development-workspace ready!

Name Link
🔨 Latest commit dedbc44
🔍 Latest deploy log https://app.netlify.com/sites/evidence-development-workspace/deploys/65b83544fe916a000852b2bf
😎 Deploy Preview https://deploy-preview-1522--evidence-development-workspace.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

vercel bot commented Jan 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2024 11:33pm

@archiewood
Copy link
Member

Do we need to add to docs for the new props?

@hughess
Copy link
Member Author

hughess commented Jan 25, 2024

@archiewood we do - I've got it on my list!

@hughess hughess merged commit cc0796e into main Jan 29, 2024
15 checks passed
@hughess hughess deleted the maps-update branch January 29, 2024 23:49
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.

None yet

2 participants