I have a custom geojson outlining the five geographical regions of Brazil. Here’s what it looks like on an online visualizer:
And here’s what the geojson looks like:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"shape": "Polygon",
"id": "sudeste"
},
"geometry": {
"type": "Polygon",
"coordinates": [...]
}
},
{
"type": "Feature",
"properties": {
"shape": "Polygon",
"id": "sul"
},
"geometry": {
"type": "Polygon",
"coordinates": [...]
}
},
{
"type": "Feature",
"properties": {
"shape": "Polygon",
"id": "nordeste"
},
"geometry": {
"type": "Polygon",
"coordinates": [...]
}
},
{
"type": "Feature",
"properties": {
"shape": "Polygon",
"id": "centro-oeste"
},
"geometry": {
"type": "Polygon",
"coordinates": [...]
}
},
{
"type": "Feature",
"properties": {
"shape": "Polygon",
"id": "norte"
},
"geometry": {
"type": "Polygon",
"coordinates": [...]
}
}
]
}
This is my code creating the choropleth:
with open('Datasets/Destaques/regions.json') as f:
geojson = json.load(f)
data = {
"regions": ["sudeste", "sul", "nordeste", "centro-oeste", 'norte'],
"value": [0.1,0.3,0.5,0.7,0.9]
}
df = pd.DataFrame(
data,
columns = ["regions", "value"]
)
figure = px.choropleth(
data_frame = df,
geojson = geojson,
locations = "regions",
featureidkey="properties.id",
title = "Brazil",
scope = "south america"
)
figure.update_geos(fitbounds="locations", visible=False)
figure.show()
When I this is the result I get:
You can see that I the regions still exist, since when I mouseover where they should be, the hoverdata is correct. However, I want all the outlines to always be shown and filled, and the background to not be filled. How can I do that?