Choropleth map not working with my geojson data

Any idea why my choropleth plot is not working out? It just shows one of the 11 areas and colors the rest of the map in one solid color. You can see it on chart studio here:

I’m not doing anything out of the ordinary. Here is the code I’m using to create the plot:

fig = px.choropleth(
fig.update_geos(fitbounds="locations", visible=False)

Plotting the geojson file in shows that is a valid format:

So it appear this is NOT plotly related, rather it had to do with the json compressor I’m using, I normally never had a problem with this tool so I never thought to test it out!
When I tried plotting with the uncompressed geojson the map came out fine, despite taking ages to load… :grimacing:

Any geojson nerds in the house? Would love to figure out how I can properly compress this data. This is also an issue with the other UK geojson data sets that I got from the same source, I just decided to debug w/Northern Ireland since it was the smalled. Is there an issue with that dataset? The geojson I used for Northern Ireland can be found here:

1 Like

So I found out that the problem was related to an incompatibility between d3 and the current revision of the GeoJSON standard.

I know it has just been me talking to myself here, but for future readers who also run into this issue, the solution, and this is assuming you are using mapshaper, is to add the gj2008 flag to the -o command so that mapshaper will output clockwise rings. Reference:

1 Like

Yay, thanks so much, you solved my problem too! Kudos!

1 Like

@mbkupfer You are a lifesaver. Thanks for posting the solution even though no one answered at the time.