Using highlight mode in JupyROOT with RootJS

Hello all,

I would like to get create a JupyterNotebook using PyROOT where the TGraph highlight mode. The goal would be to have a TGraph showing the mean values of a list of histograms, where hovering over a point in the graph would display on an adjacent pad the underlying histograms. Very similar to the demo shown in TGraphPainter Class Reference (sorry apparently I can’t put links as a new user).

I have found some examples showcasing the implementation of the highlight mode such as hlGraph1.C or hlGraph2.C but both are done in C++ and I couldn’t figure out how to convert these to PyROOT properly. Especially it is not clear to me how to define a custom HighlightHisto() function in python which would in turn be used by the TCanvas::HighlightConnect with:


Just to see if it would work I tried putting the full first hlGraph1.C example inside a ROOT.gInterpreter.Declare(...) and call it in another notebook cell and although it was able to draw the canvas the highlight functionality didn’t work even with %jsroot on.

I was wondering if there are any example JupyterNotebooks that you could point me to where the highlight mode works, or please let me know if that functionality is not supported in JupyROOT.

Thank you very much!

Hi Berkin,

Such functionality is not (yet) provided in jupyter ROOT.

Main limitation now - JSROOT drawing does not have any access to running ROOT session in jupyter.
Therefore such handler can not be implemented.

I have idea how it can be done, but this will take time to implement.


Dear @linev ,

thank you for the quick response.
I am looking forward to this functionality being possible in the future.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.