Callback failed: the server did not respond

Hi everyone,

This is my first time using Dash. I am still running my codes on my PC yet I am unable to see any result.

I am trying to create time series plot using chained callbacks whereby the first callback selects a data frame from a dictionary of data frames while the second callback will choose a variable in the selected data frame which will be plotted. Please, I will be grateful if someone can help me debug my code. Thanks in advance.

dataFrames = combineFiles (path) # function to create dictionary of data frames

external_stylesheets = [‘’]
app = dash.Dash(name, external_stylesheets=external_stylesheets)

app.layout = html.Div(
options=[{‘label’: k, ‘value’: k} for k in dataFrames.keys()],



Output(‘Variable-radio’, ‘options’),
[Input(‘Dataset-radio’, ‘value’)])
def set_variable_options(selected_data):
return [{‘label’: i, ‘value’: i} for i in dataFrames[selected_data]]

Output(‘Variable-radio’, ‘value’),
[Input(‘Variable-radio’, ‘options’)])
def set_variable_value(available_options):
return available_options[1][‘value’]

Output(‘display-selected-values’, ‘children’),
[Input(‘Dataset-radio’, ‘value’),
Input(‘Variable-radio’, ‘value’)])
def set_display_children(selected_data, selected_factor):
return u’{} is a variable in {} dataset’.format(selected_factor, selected_data,)

Output(‘indicator-graphic’, ‘figure’),
[Input(‘Dataset-radio’, ‘value’),
Input(‘Variable-radio’, ‘value’)])
def update_graph(dataset, variable):
df = dataFrames[dataset]
fig = px.line(df,x=df.index,y=df[variable])
return fig

if name == ‘main’: