I am trying to make a choropleth map of Colombia. I create an example dataframe to prove if the map works.
I am using a GeoJson of the colombian cities and I set the featureidkey properly (I guess), but the map doesn’t work.
Here is my code and the GeoJson is here: Hello.md · GitHub
df=pd.DataFrame({‘Ciudad’:[‘BOGOTÁ, D.C.’,‘MEDELLÍN’,‘QUIBDÓ’],‘Muertos’:[30,80,90]})
cities = json.load(open(’./data/MunicipiosVeredas1MB.json’, encoding=‘utf-8’))
dcc.Graph(
figure=px.choropleth(
df,
geojson=cities,
featureidkey='properties.MPIO_CNMBR',
locations='Ciudad',
color='Muertos',
color_continuous_scale="Viridis",
projection="mercator"
)
)