How to create a Ntuple/Ttrees structure directly in JSROOT

Is it possible to create a Ntuple/Ttrees structure directly in JSROOT and display it in the ROOT web browser?

I see how to create scater plots, and histograms in javascript, but not how to create ROOT objects hierarchy, is it possible to acheive this ?

Thanks in advance

JF

Hi,

JSROOT provides possibility to read data from existing TTree object from ROOT file.
One can read selected branches and perform complex TTree::Draw operations.

It is not possible to create new TTree object and write it into the file.
One should use ROOT C++ code for such purposes.
ROOT provides THttpServer class which allows to use TTree object directly - via so called “player”.
See snapshot of such functionality here:

Regards,
Sergey

Thanks for your clear answer,

I thought you will anser this…

I need JSROOT for some feature of ROOT in my web application, data is already in the DOM.

Can I use prototype of javascript JSROOT objects to manipulate/populate them myself ?

Can I use prototype of javascript JSROOT objects to manipulate/populate them myself

You can create histograms or graphs object directly in JavaScript. There are several such examples here:

Like: th2 or multigraph

And some information can be found in reference:

https://root.cern/js/latest/jsdoc/JSROOT.html#.createHistogram
https://root.cern/js/latest/jsdoc/JSROOT.html#.createTGraph

Hi again,
I already tested
root.cern/js/latest/jsdoc/JSROOT.html#.createHistogram
and
root.cern/js/latest/jsdoc/JSROOT.html#.createTGraph
but how to create 3D scatter plots or other 3D objects?

Cheers
JF

You want to use TH3 or TGraph2D objects?
Example of supported draw options you can find here:

Thanks, I am looking at this now!

But I cant find the code to populate those TH3 scatter from javascript,

it is exactly what I am after …

thanks to help me on this!

JF

I will add example with TH3.

that will be great if you can give me the code to populate a 3D scatter plots with 3 series of floats.

thanks in advance

JF

Here is demo:

And this is source code:

perfect.

thanks a LOT!

Cheers
JF