plotly / plotly/plotly.js

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

Đang mở
#7,724 2 bình luận 0 reaction 1 người được giao Xem trên GitHub

@camdecoster đang làm issue này rồi.

Từ ngày 11/3/2026.

bug
Ngôn ngữ chính
JavaScript
Star
18.3k
Fork
2k
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
28

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.