Skip to content

Commit 1cd5a12

Browse files
committed
Merge branch 'dev', preparing for 5.5 release
2 parents 64e1a7f + 39d53f3 commit 1cd5a12

28 files changed

+2883
-1280
lines changed

changes.md

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
11
# JSROOT changelog
22

3-
## Changes in 5.4.3
4-
1. Fix - draw functions also when histogram "same" option used (#159)
5-
2. Fix - when draw histogram as markers improve optimization algorithm
6-
3. Fix - correct histogram Y-axis range selection in logarithmic scale
7-
4. Fix - for TH2 draw options allow combination "colztext" (#162)
8-
5. Fix - PNG file generation with 3D drawings inside
9-
10-
11-
## Changes in 5.4.2
12-
1. Fix - take into account extra quotes in multipart http reply (#157)
13-
2. Fix - display of labels on X axis with TProfile
14-
3. Fix - support time display in TMultiGraph
15-
4. Fix - correctly parse "optstat" and "optfit" in URL
16-
5. Fix - correctly update TGraph drawing when X range is changing
17-
6. Fix - return only TF1/TF2 object when searching function (#158)
18-
19-
20-
## Changes in 5.4.1
21-
1. Fix - monitoring mode in draw.htm page
22-
2. Fix - zooming in colz palette
23-
3. Fix - support both 9.x and 10.x jsdom version in Node.js (#149)
24-
4. Fix - draw axis main line with appropriate attributes (#150)
25-
5. Fix - use axis color when drawing grids lines (#150)
26-
6. Fix - when set pad logx/logy, reset existing user ranges in pad
27-
7. Fix - avoid too deep calling stack when drawing many graphs or histos (#154)
28-
8. Fix - correctly (re)draw tooltips on canvas with many subpads
3+
## Changes in dev
4+
1. Introduce JSROOT.StoreJSON() function. It creates JSON code for the
5+
TCanvas with all drawn objects inside. Allows to store current canvas state
6+
2. Support "item=img:file.png" parameter to insert images in existing layout (#151)
7+
3. Support TTree drawing into TGraph (#153), thanks @cozzyd
8+
4. Let configure "&toolbar=right" in URL to change position of tool buttons
9+
5. Let configure "&divsize=500x400" in URL of size of main div element (default - full browser)
10+
6. Implement "optstat1001" and "optfit101" draw options for histograms
11+
7. Remove "autocol" options - standard "plc" should be used instead
12+
8. Provide drawing of artificial "$legend" item - it creates TLegend for all primitives in pad
13+
Can be used when several histograms or several graphs superimposed.
14+
9. Let configure "&toolbar=vert" in URL to change orientation of tool buttons
15+
10. Improve markers and error bars drawing for TH1/TProfile
2916

3017

3118
## Changes in 5.4.0

demo/gulp/example.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<script type='text/javascript'>
1414

15-
var filename = "http://jsroot.gsi.de/files/hsimple.root";
15+
var filename = "https://root.cern/js/files/hsimple.root";
1616
JSROOT.OpenFile(filename, function(file) {
1717
file.ReadObject("hpxpy;1", function(obj) {
1818
JSROOT.draw("drawing", obj, "colz");

demo/gulp/legend.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
JSROOT.gStyle.Latex = "MathJax";
1616

17-
var filename = "http://jsroot.gsi.de/files/legends.root";
17+
var filename = "https://root.cern/js/files/legends.root";
1818
JSROOT.OpenFile(filename, function(file) {
1919
file.ReadObject("legends;1", function(obj) {
2020
JSROOT.draw("drawing", obj, "");

demo/read_geometry_tracks.htm

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
8+
<title>Reading geometry and tracks from the ROOT file</title>
9+
10+
<script src="../scripts/JSRootCore.js" type="text/javascript"></script>
11+
12+
<script type='text/javascript'>
13+
// absolute file path can be used as well
14+
var geom_file = "../../files/geom/evegeoshape.json.gz",
15+
tracks_file = "../../files/geom/eve_tracks.root";
16+
17+
JSROOT.NewHttpRequest(geom_file, 'object', function(obj) {
18+
JSROOT.draw("drawing", obj, "", function(geo_painter) {
19+
JSROOT.OpenFile(tracks_file, function(file) {
20+
file.ReadObject("tracks;1", function(tracks) {
21+
// one could simply draw list of tracks
22+
// JSROOT.draw("drawing", tracks, "same");
23+
24+
// or use method of TGeoPainter to draw extras
25+
geo_painter.drawExtras(tracks, "tracks");
26+
27+
// use this method if one want to remove all extra objects
28+
// geo_painter.clearExtras();
29+
});
30+
});
31+
});
32+
}).send();
33+
34+
</script>
35+
36+
</head>
37+
38+
<body>
39+
<div id="drawing" style="width:800px; height:600px"></div>
40+
</body>
41+
42+
</html>
43+

demo/store_json.htm

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
8+
<title>Store canvas in JSON to replicate it</title>
9+
10+
<script src="../scripts/JSRootCore.min.js" type="text/javascript"></script>
11+
12+
<script type='text/javascript'>
13+
14+
// absolute file path can be used as well
15+
var filename = "../../files/hsimple.root";
16+
17+
JSROOT.OpenFile(filename, function(file) {
18+
file.ReadObject("hpxpy;1", function(obj) {
19+
JSROOT.draw("drawing", obj, "colz");
20+
});
21+
});
22+
23+
function StoreJson() {
24+
// produce JSON code
25+
var json = JSROOT.StoreJSON("drawing");
26+
27+
// parse JSON and get new TCanvas
28+
var obj2 = JSROOT.parse(json);
29+
30+
// cleanup previous drawing
31+
JSROOT.cleanup("replica");
32+
33+
// draw canvas again
34+
JSROOT.draw("replica", obj2);
35+
36+
}
37+
</script>
38+
39+
</head>
40+
41+
<body>
42+
<div id="drawing" style="width:600px; height:400px"></div>
43+
<p>Example show replication of TCanvas with all primitives, using JSROOT.StoreJSON() function</p>
44+
<button onclick="StoreJson()" type="button">Replicate</button>
45+
<div id="replica" style="width:600px; height:400px"></div>
46+
47+
</body>
48+
49+
</html>
50+

docs/JSROOT.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ To automate files loading and objects drawing, one can provide number of URL par
4646
- mathjax - use MathJax for latex output
4747
- latex - 'off', 'symbols', 'normal', 'mathjax', 'alwaysmath' control of TLatex processor
4848
- style - name of TStyle object to define global JSROOT style
49-
- toolbar - show canvas tool buttons 'off', 'on' and 'popup'
49+
- toolbar - show canvas tool buttons 'off', 'on' and 'popup', 'left' or 'right' for position, 'vert' for vertical
50+
- divsize - fixed size in pixels for main div element like &dvisize=700x400
5051

5152
For instance:
5253

@@ -69,6 +70,8 @@ Following layouts are supported:
6970

7071
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]`.
7172

73+
As item name, URL to existing image can be provided like `item=img:http://server/image.png`. Such image will be just inserted in the existing layout. One could specify option `"scale"` to automatically scale image to available space.
74+
7275
Many examples of URL string usage can be found on [JSROOT examples](https://root.cern/js/latest/api.htm) page.
7376

7477
One can very easy integrate JSROOT graphic into arbitrary HTML pages using a __iframe__ tag:
@@ -211,6 +214,10 @@ Like in ROOT, one could configure histogram binning and range directly:
211214

212215
- [opt=px:py>>h(50,-5,5,50,-5,5)](https://root.cern/js/latest/?file=../files/hsimple.root&item=ntuple&opt=px:py>>h%2850,-5,5,50,-5,5%29)
213216

217+
One and two dimensional draw expressions can be resulted into TGraph object, using ">>Graph" as output:
218+
219+
- [opt=px:py>>Graph](https://root.cern/js/latest/?file=../files/hsimple.root&item=ntuple&opt=px:py>>Graph)
220+
214221
For any integer value one can accumulate histogram with value bits distribution, specifying as output ">>bits(16)" or ">>bits":
215222

216223
- [opt=event.fTracks.fBits>>bits](https://root.cern/js/latest/?file=https://root.cern/files/Event100000.root&item=T;2&opt=event.fTracks.fBits>>bits)
@@ -267,6 +274,7 @@ Following parameters are supported:
267274
- "htype" - last letter in histogram type like "I", "F", "D", "S", "L", "C"
268275
- "hbins" - number of bins on each histogram axis
269276
- "drawopt" - drawing option for produced histogram
277+
- "graph" - draw into TGraph object
270278

271279
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)
272280

docs/api.htm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ <h1 id="version"><a href=".." style="color:green">JSROOT</a></h1>
126126

127127
if ((window.location.host.indexOf('jsroot.gsi.de') < 0) &&
128128
(window.location.host.indexOf('root.cern') < 0)) {
129-
filepath = "http://jsroot.gsi.de/files/";
129+
filepath = "https://root.cern/js/files/";
130130
}
131131

132132
if (window.location.protocol == "file:") {
133-
jsroot_path = "http://jsroot.gsi.de/dev/";
134-
filepath = "http://jsroot.gsi.de/files/";
133+
jsroot_path = "https://root.cern/js/dev/";
134+
filepath = "https://root.cern/js/files/";
135135
}
136136

137137
var examples = {
@@ -149,11 +149,12 @@ <h1 id="version"><a href=".." style="color:green">JSROOT</a></h1>
149149
{ 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" },
150150
{ name: "Inspector", url: "?file=" + filepath + "hsimple.root&item=hpx;1&opt=inspect", title: "Show objects data memebers" },
151151
{ name: "Projection", url: "?nobrowser&file=" + filepath + "hsimple.root&item=hpxpy;1&opt=col,projx3", title: "Enable X projection with 3 bins" },
152+
{ name: "Images", url: "?path=" + filepath + "&layout=grid2x2&file=hsimple.root&items=[hpx;1,hpxpy;1,img:../files/img/ALICE.png,img:../files/img/ATLAS.png]&opts=[hist,colz,scale,center]", title: "Example of adding images from the web server" },
152153
{ name: "Use JSON", url: "?nobrowser&json=" + filepath + "danilo6.json", title: "Read and display data from JSON file, produced with TBufferJSON class" },
153154
{ name: "Superimpose", url: "?file=" + filepath + "fillrandom.root&item=h1f;1+sqroot;1", title: "Superimpose histogram and function" },
154155
{ name: "Several files", url: "?layout=grid2x2&path=" + filepath + "&files=[hsimple.root,graph.root,ct.root]&items=[hsimple.root/[1],graph.root/[11],graph.root/[3],ct.root/[0]]&opts=[lego]", title: "Open several files simultaneusely" },
155156
{ name: "Superimpose 2 files", url: "?files=[" + filepath + "hsimple.root," + filepath + "graph.root]&item=graph.root/Graph;1+hsimple.root/hprof;1", title: "Superimpose items from two different files" },
156-
{ name: "Superimpose 3 files", url: "?path=" + filepath + "&files=[temp44.root,temp35.root,temp28.root]&item=temp44.root/Histograms/TDC_C100/Ch1/TDC_C100_Ch1_RisingCalibr;1+temp35.root/_same_+temp28.root/_same_&opt=autocol,nostat&tooltip=2", title: "Superimpose same item from three different files" },
157+
{ name: "Superimpose 3 files", url: "?path=" + filepath + "&files=[temp44.root,temp35.root,temp28.root]&item=temp44.root/Histograms/TDC_C100/Ch1/TDC_C100_Ch1_RisingCalibr;1+temp35.root/_same_+temp28.root/_same_&opt=plc,nostat+plc+plc&tooltip=2", title: "Superimpose same item from three different files" },
157158
{ name: "Use autozoom", url: "?layout=grid1x3&path=" + filepath + "&files=[temp44.root,temp35.root,temp28.root]&items=[temp44.root/Histograms/TDC_C100/Ch3/TDC_C100_Ch3_RisingRef;1,temp35.root/_same_,temp28.root/_same_]&opts=[autozoom,autozoom,autozoom]", title: "Let display only non-empty bins of the histogram(s)" }
158159
],
159160
'Custom HTML' : [
@@ -168,13 +169,15 @@ <h1 id="version"><a href=".." style="color:green">JSROOT</a></h1>
168169
{ name: "THStack", url: "demo/thstack.htm", title: "Produce and draw THStack", src: true },
169170
{ name: "TMultiGraph", url: "demo/multigraph.htm", title: "Produce and update TMultiGraph in JavaScript", src: true },
170171
{ name: "TLegend", url: "demo/multigraph_legend.htm", title: "Show and update TLegend with multi-graph", src: true },
172+
{ name: "TGeo", url: "demo/read_geometry_tracks.htm", title : "Example how to draw geometry with tracks", src: true },
171173
{ name: "Tooltip hanlder", url: "demo/tooltip.htm", title: "User handler function called when tooltip is shown, let build custom UI", src: true },
172174
{ name: "Update drawing", url: "demo/update_draw.htm", title: "Update drawing, reading 20 histograms in loop", src: true },
173175
{ name: "Update in grid", url: "demo/update_draw.htm?layout=grid3x2", title: "Update drawing on the grid layout", src: "demo/update_draw.htm" },
174176
{ name: "Adopt colors", url: "demo/adopt_colors.htm", title: "Read set of ROOT colors before display of the object", src: true },
175177
{ name: "File hierarchy", url: "demo/file_hierarchy.htm", title: "Use HierarchyPainter to display file objects hierarchy", src: true },
176178
{ name: "Zooming", url: "demo/zoom_handler.htm", title: "Redefine Zoom function to make synchronous zooming in other histogram", src: true },
177179
{ name: "User IO", url: "index.htm?file=" + filepath + "amore.root&item=moH1F_0;1&load=demo/amore.js", title : "Example of custom streamer and custom draw function (AMORE)", src: "demo/amore.js" },
180+
{ name: "Store JSON", url: "demo/store_json.htm", title: "Store drawn objects into JSON, can be reused to display once again", src: true },
178181
{ name: "Geometry", url: "demo/tgeo_build.htm", title : "Example how one can create three.js model for TGeo object, using JSROOT.GEO.build function", src: "demo/tgeo_build.htm" },
179182
{ name: "OpenUI5", url: "demo/openui5/", title : "Use of JSROOT graphics inside OpenUI5", src: "demo/openui5/Readme.md" }
180183
],

docs/examples.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ <h1 id="version"><a href=".." style="color:green">JSROOT</a></h1>
123123

124124
if ((window.location.host.indexOf('jsroot.gsi.de') < 0) &&
125125
(window.location.host.indexOf('root.cern') < 0)) {
126-
filepath = "http://jsroot.gsi.de/files/";
126+
filepath = "https://root.cern/js/files/";
127127
}
128128

129129
if ((window.location.protocol == "file:") || (window.location.host.indexOf('rawgit.com') >= 0)) {
130130
scripts = "../scripts/";
131131
jsroot_path = "../index.htm";
132132
demo_path = "../demo/",
133-
filepath = "http://jsroot.gsi.de/files/";
133+
filepath = "https://root.cern/js/files/";
134134
use_requirejs = false;
135135
icon.setAttribute('src', "../img/RootIcon.ico");
136136
}

docs/jsdoc.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"plugins": [
3+
"plugins/markdown",
4+
"plugins/summarize"
5+
],
6+
"recurseDepth": 10,
7+
"source": {
8+
"include": [ "scripts/JSRootCore.js",
9+
"scripts/JSRootIOEvolution.js",
10+
"scripts/JSRootTree.js",
11+
"scripts/JSRootPainter.js",
12+
"scripts/JSRootPainter.v6.js",
13+
"scripts/JSRootPainter.hist.js",
14+
"scripts/JSRootPainter.hist3d.js",
15+
"scripts/JSRootPainter.more.js" ],
16+
"includePattern": ".+\\.js(doc|x)?$",
17+
"excludePattern": "(^|\\/|\\\\)_"
18+
},
19+
"sourceType": "module",
20+
"opts": {
21+
"destination": "./jsdoc"
22+
},
23+
"tags": {
24+
"allowUnknownTags": true,
25+
"dictionaries": ["jsdoc","closure"]
26+
},
27+
"templates": {
28+
"cleverLinks": true,
29+
"monospaceLinks": true,
30+
"name": "JSROOT",
31+
"default": {
32+
"outputSourceFiles" : true
33+
},
34+
"applicationName": "JavaScript ROOT",
35+
"disqus": "",
36+
"googleAnalytics": "",
37+
"openGraph": {
38+
"title": "",
39+
"type": "website",
40+
"image": "",
41+
"site_name": "",
42+
"url": ""
43+
},
44+
"meta": {
45+
"title": "",
46+
"description": "",
47+
"keyword": ""
48+
},
49+
"linenums": false
50+
}
51+
}

index.htm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
mathjax - use MathJax for Latex output (automatically loaded for TMathText objects)
3333
palette - id of default color palette, 51..123 - new ROOT6 palette (default 57)
3434
style - TStyle object itemname or JSON file name
35+
toolbar - configure position and orientation of pad toolbar, combine 'right','vert','off'
3536
3637
Example:
3738
https://root.cern/js/latest/?file=../files/hsimple.root&layout=grid2x2&item=[hpx;1,hpxpy;1]&opts=[,colz]

0 commit comments

Comments
 (0)