Hi,
I was in a place with no internet connection. There I found that if I use
ROOT.enableJSVis()
in a jupyter notebook I can not see the histograms. The problem and a solution is described in:
I thought it may be interested to get some feed back as the discussion was not completed. The concept suggested by Bertrand worked very nice.
The jupyter notebook provides the web server. As I want to have the possibility to run all my notebooks offline, here is what I ended with:
-
cloned the jsroot repository
-
add the path to the directory with jsroot in: .jupyter/jupyter_notebook_config.py
c.NotebookApp.extra_static_paths = ['path_to_jsroot '] -
In JupyROOT/helpers/utils.py added a function:
def setJSRootSourceDir(jsROOTSourceDir = "https://root.cern.ch/js/notebook/"):
global _jsROOTSourceDir
_jsROOTSourceDir = jsROOTSourceDir
and in enhanceROOTModule() added:
ROOT.setJSRootSourceDir = setJSRootSourceDir
Now in a notebook I can enable JSVis offline or using a diffferent servers than root.cern.ch/js/notebook:
ROOT.enableJSVis()
ROOT.setJSRootSourceDir('http://localhost:8888/static')
Alternately one can put the jsroot in the directory with the notebook and skip step 2, calling:
ROOT.setJSRootSourceDir('http://localhost:8888/notebooks/jsroot')
In general it may be useful to have the ability to control form where the java scripts are pulled.
Best regards,
Plamen
_ROOT Version: 6.16/00
_Platform: Linux/Arch-Manjaro
_Compiler:gcc 8.3.0