plotly / plotly/plotly.js

[BUG]: Getting strange choropleth map output when locationmode is set to geojson-id

Open
#7,724 2 comments 0 reactions 1 assignee View on GitHub

@camdecoster is already working on this.

Since Mar 11, 2026.

bug
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

Description

I'm working on a choropleth map that features data at the US Metropolitan Statistical Area (MSA) level. This process involves (1) loading in simplified MSA-level GeoJSON data; (2) loading data into a Danfo.js DataFrame; and (3) rendering my map within Plotly.js. Because I'm using custom shapefiles here, I need to use geojson-id as my locationmode argument and a custom featureidkey ("properties.MSA") in order to link my shapefiles and data.

My map renders well when using choroplethmap, but I'd really like to get the map working using choropleth, as I'll then be able to display Alaska and Hawaii within the same window as the contiguous US. However, as shown in the screenshots, something is clearly not working right.

Screenshots/Video

Output when using choropleth to render the map:

Image

Output when creating a tiled map via choroplethmap instead:

Image

I also tried creating a state-level map via a separate set of GeoJSON outlines and JSON data, but this failed to work correctly as well:

Image
Steps to reproduce

Here is a link to my script: https://codepen.io/kburchfielifs/pen/OPRNOMo

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.