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:

Canvas->HighlightConnect("HighlightHisto(TVirtualPad*,TObject*,Int_t,Int_t)");.

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!
Berkin

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.

Regards,
Sergey

Dear @linev ,

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

Cheers,
Berkin

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