i was able to create a choropleth map using plotly-express and a geojson file and a datasource (*.csv-file). The data from the *.csv file is plotted on the geojson-file. See below code i used.
But what if the data is allready in the geojson file? So the *.geojson file has the geomotrie and also the values i wan't to represent. How can i point plotly-express to that datasource (geojson-file)?
Thnx in advanced.
# import json
with urlopen('https://geodata.xxxxxxxxx') as response:
counties = json.load(response)
# import pandas as pd
df = pd.read_csv("test.csv",
dtype={"statnaam": str})
fig = px.choropleth_mapbox(df, geojson=counties, locations='statnaam', color='unempl',
color_continuous_scale="Viridis",
range_color=(0, 80),
mapbox_style="carto-positron")