I had an existing app with a callback include State, but now seems to throw an error regarding "not defined". Here is a simple example that demonstrates the error:
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from jupyter_plotly_dash import JupyterDash
app = JupyterDash('InteractivePyDEFDemotest')
app.layout = html.Div([
dcc.Input(id='input-1-state', type='text', value='Montréal'),
dcc.Input(id='input-2-state', type='text', value='Canada'),
html.Button(id='submit-button-state', n_clicks=0, children='Submit'),
html.Div(id='output-state')
])
@app.callback(Output('output-state', 'children'),
[Input('submit-button-state', 'n_clicks')],
[State('input-1-state', 'value'),
State('input-2-state', 'value')])
def update_output(n_clicks, input1, input2):
return u'''
The Button has been pressed {} times,
Input 1 is "{}",
and Input 2 is "{}"
'''.format(n_clicks, input1, input2)
Traceback (most recent call last):
File "/anaconda/anaconda3/lib/python3.7/site-packages/ipykernel/comm/manager.py", line 111, in comm_msg
comm.handle_msg(msg)
File "/anaconda/anaconda3/lib/python3.7/site-packages/ipykernel/comm/comm.py", line 159, in handle_msg
self._msg_callback(msg)
File "/anaconda/anaconda3/lib/python3.7/site-packages/jupyter_plotly_dash/nbkernel.py", line 47, in callback
response, mimetype = app.process_view(stem, args, app_path)
File "/anaconda/anaconda3/lib/python3.7/site-packages/jupyter_plotly_dash/dash_wrapper.py", line 152, in process_view
resp, rmt = func(args, app_path, view_name_parts)
File "/anaconda/anaconda3/lib/python3.7/site-packages/jupyter_plotly_dash/dash_wrapper.py", line 183, in rv__dash_update_component
resp = mFunc()
File "/anaconda/anaconda3/lib/python3.7/site-packages/django_plotly_dash/dash_wrapper.py", line 560, in dispatch
return self.dispatch_with_args(body, argMap=dict())
File "/anaconda/anaconda3/lib/python3.7/site-packages/django_plotly_dash/dash_wrapper.py", line 629, in dispatch_with_args
for c in state:
NameError: name 'state' is not defined
My dash version is 1.11
My jpyter-plotly-dash version is 0.4.0
If I can narrow down the issue even more, I will post back.
thanks!
I had an existing app with a callback include State, but now seems to throw an error regarding "not defined". Here is a simple example that demonstrates the error:
My dash version is 1.11 My jpyter-plotly-dash version is 0.4.0
If I can narrow down the issue even more, I will post back. thanks!