-
Notifications
You must be signed in to change notification settings - Fork 48
Button which rerunns all cells in jupyter notebook does not work on dashboard server #300
Comments
Hi @romario076 . The custom require calls you're making in your notebook are not supported in the dashboard server which does not have the notebook JS modules. I'm not sure it ever will since it's building off of the new Jupyter Lab components rather than embedding all of the classic notebook JS files. We need to do a better job of scoping and documenting what can work in the dashboard server, what cannot but could with improvements, and what will probably never work. |
We used ipywidgets.interact to achieve the same behavior, that is, to allow user to update dashboards by providing inputs on dashboards server.
To display the dashboards, just do
Then you have to restructure your cells into functions like Controller.plot1(). This way you don't need to rerun all the cells, just one function Controller.show(). It breaks our usual coding pattern as in an interactive notebook, but this is as close as we can get if we want to achieve the desired behavior. |
@bowenli37 thanks for sharing that recipe. There's also been work (jupyter/jupyter_client#209) to support an |
Hi all, I have a dashboard with a single set of inputs, and I would like those inputs to update charts in several different cells. I can use a Javascript call in a notebook, but this does not work once the dashboard is deployed. Things I've tried:
# Chart Cell: set up chart
chart_container = ipywidgets.Output()
display(chart_container)
def update_chart(plotting_object):
chart_container.clear_output()
with chart_container:
plotting_object.plot()
# Later Cell: handler function
def button_handler(sender):
update_chart(plotting_object) This works fine in the notebook and dashboard preview, but the charts do not update once the dashboard is deployed.
I want to arrange the charts nicely in a grid format, so running everything from a single cell probably wont work. I could also have a separate submit button for each chart (which works) but would be obnoxious. Ultimately, I need to trigger a display update for one cell from another cell while the dashboard is running. Can anyone see flaws in my general approach, or suggest something that will give me equivalent results? Let me know if I can clarify, or if I should open another issue. |
@dwkenefick have you had any luck with this? I'm in exactly the same position and I've tried similar solutions to no avail. I've found some ipywidget discussion (issue 1410) about the fact that the Output widget is not supported in the context of embedded HTML (which I presume is what the dashboard is). There they claim that its been fixed but this is quite recent and I'm not sure the fix has made it into the current distribution. Can anyone who understands this better comment on whether this fix will likely resolve @dwkenefick's (and my) problem? |
Hi !
We have multi cell notebook wich requires one input - Date, and each time the input is changed i need to rerun all cells with code to generate new outputs. I use grid dashboard layout.
The button works in jupyter notebook dashboard however it does not work when i deploy my notebook to dashboard server.
Here is the code .
I get following error in browser after clicking on button on dashboard server.
If you know any solution for reruning all notebook cells on deployed app with one input parameter.
Please help to find any solution.
The text was updated successfully, but these errors were encountered: