(First: the app seems to work anyway - despite the error.)
When I add slider input I get IndexError: list out of range, otherwise works fine. The error is still the same if I change slider to state.
My code looks like:
app = dash.Dash()
app.layout = html.Div(children=[
dcc.Interval(id='interval-component', interval=100000, n_intervals=0),
dcc.Slider(
id='slider',
min=5,
max=60,
step=5,
value=10
),
dcc.Graph(id='live-update-graph')
])
@app.callback(Output('live-update-graph', 'figure'),
[Input('interval-component', 'n_intervals'), Input('slider', 'value')])
def update_graph(n, slider):
# read data and draw the graph
It works without the slider input.
Complete error:
Traceback (most recent call last): File ".../python3.7/site-packages/flask/app.py", line 2309, in __call__ return self.wsgi_app(environ, start_response) File ".../python3.7/site-packages/flask/app.py", line 2295, in wsgi_app response = self.handle_exception(e) File ".../python3.7/site-packages/flask/app.py", line 1741, in handle_exception reraise(exc_type, exc_value, tb) File "/.../python3.7/site-packages/flask/_compat.py", line 35, in reraise raise value File ".../python3.7/site-packages/flask/app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File ".../python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File ".../python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File ".../python3.7/site-packages/flask/_compat.py", line 35, in reraise raise value File ".../python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File ".../python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File ".../python3.7/site-packages/dash/dash.py", line 858, in dispatch ][0]) IndexError: list index out of range