I am building a small app in Dash where I want to plot data on a map. I am loading a geojson file that holds my countries regions delimitation using geopandas. I made a test dataframe containing random values for some regions. I am ploting eveything using plotly choropleth_mapbox. It works but is very slow. When I decide to put data for all regions it can take up to 20 minutes. Would you have any idea how I can fasten it ? Or would you advise using other libraries than geopandas and plotly ?
code:
import geopandas
import plotly.express as px
geojson = geopandas.read_file('static/Mapping/Departements.geojson')
df['code'] = [59, 75, 24]
df['value'] = [150, 10, 256]
fig = px.choropleth_mapbox(df, geojson=geojson, locations='code', color='value',
color_continuous_scale="Viridis",
range_color=(0, 12),
mapbox_style="carto-positron",
zoom=4, center = {"lat": 48.856614, "lon": 2.3522219},
opacity=0.5,
labels={'Value':'Test values'}
)