I recently started working with Dash.
When i display a figure with figure.show() it works fine.
The moment I place the figure in a Graph component, it doesn’t show the data anymore, only a plain world map.

My code to create the figure:
import matplotlib.pyplot as plt
import plotly.express as px
import plotly.graph_objects as go
from dash.dependencies import Output, Input
fig = px.choropleth(data_frame=df, geojson=data,
locations="naam", featureidkey="properties.postcode",
projection="mercator"
)
fig.update_geos(fitbounds="locations", visible=False)
fig.update_layout(margin={"r": 0, "t": 0, "l": 0, "b": 0})
display_fig = go.Figure(fig)
# display_fig.show()
My layout:
app.layout = html.Div(children=[
html.Div([
dcc.Graph(
id='districten',
figure=display_fig
)
])
])
Does anyone know what I am doing wrong?