I am currently using Jupyter on a server:
$ python3 --version
Python 3.8.10
$ pip3 list | grep 'jupyter \|nbextensions\|plotly'
jupyter 1.0.0
jupyter-contrib-nbextensions 0.5.1
jupyter-nbextensions-configurator 0.4.1
plotly 5.2.2
My problem is this: I have an .ipynb
notebook, with multiple Plotly plots inside, generated by multiple Python code cells.
Then, I have both:
- enabled "Initialization cells" on all Python code cells, as per https://stackoverflow.com/a/39666438/6197439 , and saved the notebook
- Made a first
%%html
cell, with JavaScript to re-run all cells on page load, as per https://stackoverflow.com/a/38856870/6197439 , and saved the notebook
Now, the results are like this:
- If the kernel corresponding to the
.ipynb
notebook, has been shut down, and then I open the.ipynb
notebook in a new browser tab, then indeed all cells run, and after a some seconds wait, I get the graphs/plots rendered in the page, as I want it - But if now I close that browser tab, and the kernel corresponding to this
.ipynb
notebook still runs, and I click the.ipynb
notebook again so it opens in a new tab, this time the graphs/plots are NOT visible in the page (instead, the corresponding Python code cells are expanded, even if the original saved state is collapsed - where I use the Codefolding nbextension, see collapse cell in jupyter notebook)- Although, at this time, I can call Cell/Run All, and the Plotly plots are generated - but the corresponding code cells remain expanded
So, my question is: is there anything I can do, so that whenever the .ipynb
page is opened for the first time, all the Plotly plots are generated - regardless if this is the first page load since the kernel started, or later page loads?