Here goes the dash code:
app.layout = html.Div(children=[
html.Div(children=[components.description(),
components.dropdown_menu_day(dict_data),
*components.make_break(1),
components.dropdown_menu_sample(),
*components.make_break(1),
components.dropdown_type_plot()
],style={'width': '25%', 'display': 'inline-block','vertical-align':'top',
'background-color': 'rgb(250, 250, 250)','text-align': 'center', 'height': '100vh'}),
html.Div(children=[*components.make_break(1),
html.Div([dcc.Graph(id='plotter', style={'height': '95%'})],
style={'padding':'10px', 'height': '90%', 'width': '90%','margin':'auto','background-color':'white','text-align': 'center'}),
],style={'width': '75%', 'display': 'inline-block','background-color': 'rgb(240, 240, 240)', 'height': '100vh'})
])
@callback(Output(component_id='dropdown_sample', component_property='options'),
Input(component_id='dropdown_day', component_property='value'))
def dropdown_values(value):
return [{'label':i.split(' ')[1], 'value': i} for i in dict_data[value].keys()]
@callback(
Output(component_id='plotter', component_property='figure'),
Input(component_id='dropdown_day', component_property='value'),
Input(component_id='dropdown_sample', component_property='value'),
Input(component_id='dropdown_plot', component_property='value')
)
def figure(day, sample, plot_type):
df_temp = dict_data[day][sample]
if plot_type == 'Heatmap':
return heatmap(df_temp)
elif plot_type == 'Surface plot':
return surface_plot(df_temp)
As I mentioned, the heatmap works as intended. The surface plot is the one having the issue.