question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jsroot and JupyterLab

See original GitHub issue

I have no problems using jsroot in jupyter. I have no problems making plots in general in jupyter or jupyterlab. But when I use jsroot in python within JupyterLab; e.g.

import ROOT
%jsroot on
canvas = ROOT.TCanvas()
test = ROOT.TH1D("example","example",100,-5.,5.)
test.FillRandom("gaus",100000)
test.Draw()
canvas.Draw()

or in the ROOT C++ kernel, e.g.,

%jsroot on
TCanvas my_canvas("canvas","canvas title",800,600);
TH1D example("example","example histogram",100,-3,3);
example.FillRandom("gaus",10000);
example.Draw();
my_canvas.Draw();

I just see a blank area in the output that’s the same size of the plot I expect. If I turn %jsroot off in both the above examples, the plot is produced. If I use the same notebooks in “plain old jupyter”, the plots appear with %jsroot on.

I’ve tried this on two different machines/OSes with the same results: OS - CentOS 7 Python version - 3.6.5 ROOT version - 6.14.02

OS - Mac OS 10.11.6 Python version - 3.6.6 ROOT version - 6.14.00

Any ideas?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:53 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
linevcommented, Feb 1, 2021

https://jupyter-server.readthedocs.io/en/stable/operators/migrate-from-nbserver.html

I guess, it is important information for @etejedor, who is maintaining Jupyter implementation for ROOT.

2reactions
linevcommented, Aug 13, 2020

Some news.

After https://github.com/root-project/root/pull/6155 and https://github.com/root-project/root/pull/6169 PRs (both are merged into the master) jupyter notebook and jupyter lab works properly, including JSROOT graphics.

With small adjustment in https://github.com/root-project/root/pull/6180 require.js will be excluded from jupyter lab - JSROOT can be loaded directly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JsRoot in Jupyterlab - ROOT Forum - CERN
I am trying to make jsroot running within a Jupyter notebook (through JupyterLab). I know this is working from SWAN @CERN, but I...
Read more >
JupyterLab at the Saint Petersburg State University - IOPscience
This paper describes our experience using and extending JupyterLab. ... JupyterLab JSROOT project, “jupyterlab jsroot” [software], version 0.0.2.
Read more >
JupyterLab at the Saint Petersburg State University
A JavaScript library JSROOT [11] makes it possible to show the content of ROOT files in a web browser. We decided to integrate...
Read more >
https://www.nevis.columbia.edu/~seligman/root-clas...
... you can use the <tt>%jsroot on</tt> magic to make plots interactive. ... "\n", " // We are in jupyterlab without require.js, directly...
Read more >
(PDF) JupyterLab at the Saint Petersburg State University
JupyterLab [3] project reuses Jupyter Notebook file format and kernel ... We decided to integrate JSROOT into JupyterLab to provide users ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found