JSROOT in interactive school board


Hello everyone,

i use JSROOT to create some graphs to show in an interactive school board.

Is there anything i can do to to keep mouse events and override touch events from JSROOT?

I cant move graphical elements like i do in my laptop with mouse.

Thanks in advance.

Hi,

JSROOT has very little support of touch-capable devices.
Only zooming on TH1 and TH2 partially works with one-finger and two-fingers touch events:

https://root.cern/js/latest/?nobrowser&file=../files/hsimple.root&item=hpxpy;1&opt=COLZ

Does it work for you on the interactive board?
You can try same link on your smartphone to see how it works.

Also one can activate and select context menu - if press on touch device for few seconds on one place.

Probably one can implement several more features - like moving around text or title or stats box.
But it should be done inside JSROOT code.

Regards,
Sergey

Thanks for the answer,

yes it works for me in an interactive board,

actually i can move TEllipses, boxes, etc , TLatex text, Titles …

I only have problems when stretching (not moving) TArrow, when i show something in class, or when i am trying to change some points (markers) position in a TGraph.

Problem is that cursor is not transforming to a cross on hover. I tried in the classroom but no use, i added some javascript code to my graphs but didnt work.

Anyway thanks again.

Hi,

I never had experience with interactive boards.
Probably they mimic some mouse events - but not completely.
Some of my colleges have such interactive board - so I will try to check how JSROOT works there.
If I can reproduce problem - then maybe I will find solution too.

Regards,
Sergey

Hi,

I can reproduce and fix problem with TArrow moving and dragging.
There was bug in position calculations for touch events - which should work better now.
Also I try to improve touch handling in general case - without need for extra configs of JSROOT.

You can try latest development code here:

https://jsroot.gsi.de/dev/examples.htm#misc_arrow

The only tricky part is TGraph - it is more difficult to adjust for touch events.
I will try to improve it later.

Regards,
Sergey

Hi,

yes i just checked the url you sended me at the school interactive board. and TArrow works fine.

Looking forword for news about TGraph. Changing live points in TGraph is really usefull in the classroom you know :slight_smile:.

But it is not something that cannot wait !

Best regards,

Georgios

Hi Georgios,

I adjust interactive TGraph functionality, can be tested with the link:

https://jsroot.gsi.de/dev/examples.htm#tgraph

But only for basic draw options - line “L”, marker “P” and curve “C”.
Bar plot or error markers drawing will not work on touch devices.

Regards,
Sergey

Dear Sergey,

just tested and didn’t work.(14:52 UTC)

First check on smartphone or tablet.
Also sometime one need to clear browser cache

Hi,

sorry for the delayed answer, points on TGraph still dont move, TArrows can move but dont resize.

I saw sometime TArrows resizing (maybe you were working on something relative) but now not.

Hi Georgios,

I cannot reproduce your problems on my smartphone - I can resize TArrow and can move separate points of TGraph. It can be some specialty of smartboard - which I cannot debug.
It can be old browser installed on smartboard - in our organization new smartboard has browser from 2014.

Therefore my question - do you see problems when using smartphone or tablet?

Regards,
Sergey

Hi,

yes it is fixed!

I was using the latest directory not dev.

So now to make my graphs work at school’s smartboard i just have to use import * as JSROOT from “https://root.cern/js/dev/modules/main.mjs”; instead of import * as JSROOT from “https://root.cern/js/latest/modules/main.mjs”; right?

Thanks for your efforts!

Hi,

dev version is experimental and updated very often from master branch.
New changes will be published in several months as new release - around April 2027.

Regards,
Sergey