You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/JSROOT.md
+43-17Lines changed: 43 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,15 @@ It is the successor of the JSRootIO project.
7
7
8
8
## Installing JSROOT
9
9
10
-
In most practical cases it is not necessary to install JSROOT on the local computer - it can be used directly from project web sites <https://root.cern/js/> and <http://jsroot.gsi.de/>. Developers repository for JSROOT code situated on <https://github.com/linev/jsroot/>.
10
+
In most practical cases it is not necessary to install JSROOT - it can be used directly from project web sites <https://root.cern/js/> and <http://jsroot.gsi.de/>.
11
11
12
-
In rare cases one need to install JSROOT on separate web server - for such case one could use provided packages from <https://github.com/linev/jsroot/releases>.
13
-
14
-
One could use JSROOT directly from local file system. If source code was unpacked in `/home/user/jsroot/` subfolder, one could just open it in browser with <file:///home/user/jsroot/index.htm> address.
12
+
When required, there are following alternatives to install JSROOT on other web servers:
15
13
14
+
- download and unpack [provided](https://github.com/linev/jsroot/releases) packages (recommended)
15
+
- use [bower](https://bower.io/) package manager and invoke `bower install jsroot`
16
+
- clone master branch from [repository](https://github.com/linev/jsroot/)
17
+
18
+
One could use JSROOT directly from local file system. If source code was unpacked/checked-out in `/home/user/jsroot/` subfolder, one could just open it in browser with <file:///home/user/jsroot/index.htm> address.
16
19
17
20
18
21
## Drawing objects in JSROOT
@@ -29,30 +32,47 @@ To automate files loading and objects drawing, one can provide number of URL par
29
32
- opt - drawing option for the item
30
33
- items - array of items name
31
34
- opts - array of drawing options for the items
32
-
- layout - can be 'simple', 'flex', 'collapsible', 'tabs' or 'gridNxM' where N and M integer values
33
-
- nobrowser - do not display file browser
35
+
- layout - can be 'simple', 'flex', 'collapsible', 'tabs', 'gridNxM', 'horizNMK', 'vertNMK'
36
+
- browser - layout of the browser 'float', 'fix', 'no', 'off'
37
+
- nobrowser - do not display file browser (same as browser=no)
38
+
- float - display floating browser (same as browser=float)
39
+
- status - configure status line 'no' (default), 'off' (completely disable), 'size'
- simple - available space used for single object (default)
58
+
-[collapsible](https://root.cern/js/latest/api.htm#url_syntax_collapsible_layout) - fix-sized canvas group behind each other and can be collapsed individually
59
+
-[flex](https://root.cern/js/latest/api.htm#url_syntax_flexible_layout) - creates as many frames as necessary, each can be individually moved/enlarged
-[gridNxM](https://root.cern/js/latest/api.htm#url_syntax_grid_layout) - fixed-size grid with NxM frames
62
+
- gridiNxM - grid with NxM frames with possibility to adjust frames sizes
63
+
- vertN - N frames sorted in vertical direction (like gridi1xN)
64
+
- horizN - N frames sorted in horizontal direction (like gridiNx1)
65
+
-[vert121](https://root.cern//js/latest/api.htm#url_syntax_veritcal_layout) - 3 frames sorted in vertical direction, second frame divided on two sub-frames
66
+
-[horiz32_12](https://root.cern//js/latest/api.htm#url_syntax_horizontal_layout) - 2 horizontal frames with 3 and 2 subframes, and 1/3 and 2/3 as relative size
67
+
48
68
When specifying `files`, `items` or `opts` parameters, array of strings could be provided like `files=['file1.root','file2.root']`. One could skip quotes when specifying elements names `items=[file1.root/hpx,file2.root/hpy]` or `opts=['',colz]`.
49
69
50
-
Many examples of URL string usage can be found on [JSROOT examples](https://root.cern/js/latest/api.htm) page.
70
+
Many examples of URL string usage can be found on [JSROOT examples](https://root.cern/js/latest/api.htm) page.
51
71
52
72
One can very easy integrate JSROOT graphic into arbitrary HTML pages using a __iframe__ tag:
@@ -238,6 +258,7 @@ Following parameters are supported:
238
258
- "maxrange" - maximal number of ranges in single HTTP request
239
259
- "accum" - number of accumulated values before creating histogram
240
260
- "htype" - last letter in histogram type like "I", "F", "D", "S", "L", "C"
261
+
- "hbins" - number of bins on each histogram axis
241
262
- "drawopt" - drawing option for produced histogram
242
263
243
264
Example - [opt=event.fTracks[].fTriggerBits;entries:1000;first:200;maxrange:25](https://root.cern/js/latest/?file=https://root.cern/files/event/event_0.root&item=EventTree&opt=event.fTracks[].fTriggerBits;entries:1000;first:200;maxrange:25)
@@ -352,25 +373,23 @@ To enable CORS on Apache web server, hosting ROOT files, one should add followin
352
373
353
374
More details about configuring of CORS headers can be found [here](https://developer.mozilla.org/en/http_access_control).
354
375
355
-
Other solution - copy all JSROOT files to the location where the data files are located.
356
-
In such case one could use the server with its default settings.
376
+
Alternative - enable CORS requests in the browser. It can be easily done with [CORS Everywhere plugin](https://addons.mozilla.org/de/firefox/addon/cors-everywhere/) for the Firefox browser or [Allow CORS plugin](https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en) for the Chrome browser.
377
+
357
378
358
-
A simple case is to copy only the top index.htm file on the server and specify the full path to JSRootCore.js script like:
379
+
Next solution - install JSROOT on the server hosting ROOT files. In such configuration JSROOT does not issue CORS requests, therefore server and browsers can be used with their default settings. A simplified variant of such solution - copy only the top index.htm file from JSROOT package and specify the full path to JSRootCore.js script like:
One could use minified version of all scripts (as shown in example) - this reduce page loading time significantly.
524
+
One could use minified version of all scripts (as shown in example) - this reduce page loading time significantly.
525
+
526
+
When JSROOT installed with bower package manager, one could re-use basic libraries like `d3.js` or `three.js` from bower itself. For that one should add `bower` into URL:
{name: "Open file",url: "?file="+filepath+"hsimple.root",title: "Open ROOT file with the JSROOT"},
140
-
{name: "Display item",url: "?file="+filepath+"hsimple.root&item=hpxpy;1&opt=colz",title: "Open ROOT file and display item"},
141
-
{name: "Hide browser",url: "?nobrowser&file="+filepath+"hsimple.root&item=hprof;1",title: "Do not show file hierarchy - only display item"},
140
+
{name: "Display item",url: "?file="+filepath+"hsimple.root&item=hpxpy;1&opt=colz",title: "Open ROOT file and display item"},
141
+
{name: "Enable status",url: "?status&file="+filepath+"hsimple.root&item=hpxpy;1&opt=colz",title: "Show tooltip information in special status line"},
142
+
{name: "Hide browser",url: "?nobrowser&file="+filepath+"hsimple.root&item=hprof;1",title: "Hide browser - only display items, browser can be activated later"},
{name: "Flexible layout",url: "?file="+filepath+"hsimple.root&layout=flex&items=[hpx;1,hpxpy;1,hprof;1]&opts=[hist,colz,e1]",title: "Display several items with flexible layout"},
143
-
{name: "Grid layout",url: "?path="+filepath+"&layout=grid2x2&files=[hsimple.root,glbox.root]&items=[hsimple.root/hpx;1,hsimple.root/hpxpy;1,hsimple.root/hprof;1,glbox.root/h31;1]&opt=[hist,lego,e1,box1]",title: "Example of grid layout with 2D and 3D drawings"},
145
+
{name: "Grid layout",url: "?path="+filepath+"&layout=grid2x2&files=[hsimple.root,glbox.root]&items=[hsimple.root/hpx;1,hsimple.root/hpxpy;1,hsimple.root/hprof;1,glbox.root/h31;1]&opts=[hist,lego20,e1,box2]",title: "Example of grid layout with 2D and 3D drawings"},
144
146
{name: "Tabs layout",url: "?file="+filepath+"hsimple.root&layout=tabs&items=[hpx;1,hpxpy;1,hprof;1]&opts=[hist,colz,e1]",title: "Example of tabs layout"},
145
147
{name: "Collapsible layout",url: "?file="+filepath+"hsimple.root&layout=collapsible&items=[hpx;1,hpxpy;1,hprof;1]&opts=[hist,colz,e1]",title: "Example of collapsible layout (JSROOT roots)"},
148
+
{name: "Veritcal layout",url: "?file="+filepath+"hsimple.root&layout=vert121&items=[hpx;1,hpxpy;1,ntuple;1,hprof;1]&opts=[hist,colz,px:pz,e1]",title: "Display several items in vertical layout"},
149
+
{name: "Horizontal layout",url: "?file="+filepath+"hsimple.root&layout=horiz32_12&items=[ntuple,ntuple,ntuple,hpx,hpxpy]&opts=[px:py,px:pz,py:pz,hist,lego2]",title: "Display several items in horizontal layout, adjust size ratio"},
146
150
{name: "Inspector",url: "?file="+filepath+"hsimple.root&item=hpx;1&opt=inspect",title: "Show objects data memebers"},
147
151
{name: "Use JSON",url: "?nobrowser&json="+filepath+"danilo6.json",title: "Read and display data from JSON file, produced with TBufferJSON class"},
148
152
{name: "Superimpose",url: "?file="+filepath+"fillrandom.root&item=h1f;1+sqroot;1",title: "Superimpose histogram and function"},
0 commit comments