plotly / plotly/plotly.py

[BUG]: Odd polygon in land layer, extending into Canada on US choropleth

オープン
#5,685 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug P3 size: 3
主要言語
Python
スター
18.8k
フォーク
2.8k
平均マージ
16時間 26分
マージ済み PR(30日)
21

説明

Description

There is an odd band extending from the northwest US into Canada when making a US choropleth. You can see this in the official documentation. I think this stems from the GeoJSON file included in Plotly. The file is very out of date, by the way, with changes to Oglala Lakota County in South Dakota and the Kusilvak Census Area in Alaska not being represented.

I can hide this band in the Python version using visible=False when calling update_geos().

Screenshots/Video
Image
Steps to reproduce
Notes

The unemployment example is here for completeness' sake:

from urllib.request import urlopen
import json
with urlopen('https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json') as response:
    counties = json.load(response)

import pandas as pd
df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/fips-unemp-16.csv",
                   dtype={"fips": str})

import plotly.express as px

fig = px.choropleth(df, geojson=counties, locations='fips', color='unemp',
                           color_continuous_scale="Viridis",
                           range_color=(0, 12),
                           scope="usa",
                           labels={'unemp':'unemployment rate'}
                          )
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

失業率のコロプレスの例から始め、plotly/datasets リポジトリで参照されている geojson-counties-fips.json を調べます。北西部のジオメトリと Oglala Lakota County および Kusilvak Census Area のエントリを比較します。完了の条件は、例でその帯が表示されなくなり、これらの郡の変更が反映されていることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
data-visualization
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。