Skip to content

feat: Add US location name lookup choropleth, scattergeo traces#7731

Merged
camdecoster merged 10 commits into
masterfrom
cam/7437/add-us-location-name-lookup
Mar 26, 2026
Merged

feat: Add US location name lookup choropleth, scattergeo traces#7731
camdecoster merged 10 commits into
masterfrom
cam/7437/add-us-location-name-lookup

Conversation

@camdecoster

@camdecoster camdecoster commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Description

Add USA location name lookup for locationmode: "USA-states" in choropleth, scattergeo traces.

Closes #7437.

Changes

  • Add list of USA location names
  • Add USA location name lookup to geo location utilities
  • Update attribute description
  • Update test to use new lookup

Testing

  • Be on main
  • Open test/image/mocks/geo_choropleth-usa.json
  • Replace the 'TX' location with 'Texas'
  • Run plotly.js devtools with npm start
  • Open the geo_choropleth-usa mock
  • Note that Texas isn't showing in the choropleth
  • Discard changes
  • Switch to this branch
  • Reload the mock (which has been updated in this PR with the above change)
  • Note that Texas is showing in the choropleth

Notes

  • This is a simple string comparison with no regex. Regex could be used in the future.
  • Washington DC has a few entries to cover potential versions of the location name
@camdecoster camdecoster marked this pull request as ready for review March 23, 2026 18:00
@archmoj

archmoj commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Thanks @camdecoster for the PR.
Would you please add a test e.g. displaying all the states in an image test?

@emilykl

emilykl commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

@camdecoster Maybe you could modify the existing geo_choropleth-usa mock to include two subplots, one which uses state names and one of which uses abbreviations?

Comment thread draftlogs/7731_add.md Outdated

@emilykl emilykl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See my two minor comments but overall looks good 👍

camdecoster and others added 3 commits March 26, 2026 10:10
@camdecoster camdecoster merged commit 7aac171 into master Mar 26, 2026
5 of 6 checks passed
@camdecoster camdecoster deleted the cam/7437/add-us-location-name-lookup branch March 26, 2026 16:45
@archmoj

archmoj commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Thank you @camdecoster and @emilykl.
You could simply label this PR (as well #7707 and #7730) as features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants