GeezerVison is showing github.com — feat: Add US location name lookup choropleth, scattergeo traces by camdecoster · Pull Request #7731 · plotly/plotly.js
Conversation
camdecoster
commented
Mar 23, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @camdecoster for the PR.
Would you please add a test e.g. displaying all the states in an image test?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@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?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
See my two minor comments but overall looks good 👍
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
1 more reviewer
emilykl
emilykl approved these changes
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.