Skip to content

Commit b28f2e8

Browse files
committed
Update docu, start preparation for 6.0.0 release
1 parent c1b03ec commit b28f2e8

File tree

5 files changed

+41
-34
lines changed

5 files changed

+41
-34
lines changed

demo/th2.htm

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88

99
<script src="../scripts/JSRoot.core.js" type="text/javascript"></script>
1010

11+
</head>
12+
13+
<body>
14+
<h3>Text Before </h3>
15+
16+
<div id="object_draw" style="width: 800px; height:600px"></div>
17+
18+
<h3>Text After</h3>
19+
1120
<script type='text/javascript'>
1221

1322
var cnt = 0;
@@ -17,10 +26,10 @@
1726
// var histo = JSROOT.parse(your_json_string);
1827

1928
// this is just generation of histogram
20-
var histo = JSROOT.createHistogram("TH2I", 20, 20);
21-
for (var iy=0;iy<20;iy++)
22-
for (var ix=0;ix<20;ix++) {
23-
var bin = histo.getBin(ix+1, iy+1), val = 0;
29+
let histo = JSROOT.createHistogram("TH2I", 20, 20);
30+
for (let iy = 0; iy < 20; iy++)
31+
for (let ix = 0; ix < 20; ix++) {
32+
let bin = histo.getBin(ix+1, iy+1), val = 0;
2433
switch (cnt % 4) {
2534
case 1: val = ix + 19 - iy; break;
2635
case 2: val = 38 - ix - iy; break;
@@ -41,16 +50,6 @@
4150

4251
</script>
4352

44-
45-
</head>
46-
47-
<body>
48-
<h3>Text Before </h3>
49-
50-
<div id="object_draw" style="width: 800px; height:600px"></div>
51-
52-
<h3>Text After</h3>
53-
5453
</body>
5554
</html>
5655

demo/thstack.htm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ <h3>Text Before </h3>
1717

1818
<h3>Text After</h3>
1919

20-
<script type='text/javascript'>
20+
<script type='text/javascript'>
2121

2222
function CreateStack(loop) {
2323

24-
let histos = [];
24+
let histos = [];
2525

2626
for (var n=0;n<5;n++) {
2727
// time to time exclude one histogram to see how THStack update is working
2828
if ((loop % 5 == 3) && (n == 1)) continue;
29-
var hist = JSROOT.createHistogram("TH1I", 11);
29+
let hist = JSROOT.createHistogram("TH1I", 11);
3030
hist.fName ="hist"+n;
3131
hist.Fill(n*2+1,10);
3232
if (loop%5 === n) hist.Fill(n*2+1,2);
3333
hist.fLineColor = n+2;
3434
histos.push(hist);
3535
}
3636

37-
var stack = JSROOT.createTHStack(...histos);
37+
let stack = JSROOT.createTHStack(...histos);
3838
stack.fTitle = "Testing THStack update " + loop;
3939
return stack;
4040
}
@@ -44,7 +44,7 @@ <h3>Text After</h3>
4444
var cnt = 0;
4545
setInterval(() => JSROOT.redraw("object_draw", CreateStack(++cnt), "nostack"), 2000);
4646

47-
</script>
47+
</script>
4848

4949
</body>
5050
</html>

scripts/JSRoot.core.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@
101101
/** @summary JSROOT version id
102102
* @desc For the JSROOT release the string in format "major.minor.patch" like "6.0.0"
103103
* For the ROOT release string is "ROOT major.minor.patch" like "ROOT 6.24.00" */
104-
JSROOT.version_id = "pre6";
104+
JSROOT.version_id = "6.0.0";
105105

106106
/** @summary JSROOT version date
107107
* @desc Release date in format day/month/year like "6/01/2021"*/
108-
JSROOT.version_date = "13/01/2021";
108+
JSROOT.version_date = "14/01/2021";
109109

110110
/** @summary JSROOT version id and date
111111
* @desc Produced by concatenation of {@link JSROOT.version_id} and {@link JSROOT.version_date}
@@ -1680,7 +1680,14 @@
16801680
* @param {number} nbinsx - number of bins on X-axis
16811681
* @param {number} [nbinsy] - number of bins on Y-axis (for 2D/3D histograms)
16821682
* @param {number} [nbinsz] - number of bins on Z-axis (for 3D histograms)
1683-
* @returns {Object} created histogram object */
1683+
* @returns {Object} created histogram object
1684+
* @example
1685+
* let h1 = JSROOT.createHistogram("TH1I", 20);
1686+
* h1.fName = "Hist1";
1687+
* h1.fTitle = "Histogram title";
1688+
* h1.fXaxis.fTitle = "xaxis";
1689+
* h1.fYaxis.fTitle = "yaxis";
1690+
* h1.fXaxis.fLabelSize = 0.02; */
16841691
JSROOT.createHistogram = (typename, nbinsx, nbinsy, nbinsz) => {
16851692
let histo = create(typename);
16861693
if (!histo.fXaxis || !histo.fYaxis || !histo.fZaxis) return null;

scripts/JSRoot.io.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,16 +1645,18 @@ JSROOT.define(['rawinflate'], () => {
16451645
* @param {binary} sinfo_rawdata - data of streamer info root.bin request
16461646
* @returns {object} - created JavaScript object
16471647
* @example
1648-
* JSROOT.httpRequest("http://localhost:8080/Files/job1.root/hpx/root.bin", "buf")
1649-
* .then(obj_data => JSROOT.httpRequest("http://localhost:8080/StreamerInfo/root.bin", "buf")
1650-
* .then(si_data => JSROOT.reconstructObject("TH1F", obj_data, si_data)))
1651-
* .then(histo => console.log(`Get histogram with title = ${histo.fTitle}`))
1652-
* .catch(err => console.error(err));
1648+
* async function read_binary_and_draw() {
1649+
* await JSROOT.require("io");
1650+
* let obj_data = await JSROOT.httpRequest("http://localhost:8080/Files/job1.root/hpx/root.bin", "buf");
1651+
* let si_data = await JSROOT.httpRequest("http://localhost:8080/StreamerInfo/root.bin", "buf");
1652+
* let histo = await JSROOT.reconstructObject("TH1F", obj_data, si_data);
1653+
* console.log(`Get histogram with title = ${histo.fTitle}`);
1654+
* }
1655+
* read_binary_and_draw();
16531656
*
1654-
* // same data via root.json request
1657+
* // request same data via root.json request
16551658
* JSROOT.httpRequest("http://localhost:8080/Files/job1.root/hpx/root.json", "object")
1656-
* .then(histo => console.log(`Get histogram with title = ${histo.fTitle}`))
1657-
* .catch(err => console.error(err.message)); */
1659+
* .then(histo => console.log(`Get histogram with title = ${histo.fTitle}`)); */
16581660
JSROOT.reconstructObject = function(class_name, obj_rawdata, sinfo_rawdata) {
16591661

16601662
let file = new TFile;
@@ -3083,11 +3085,10 @@ JSROOT.define(['rawinflate'], () => {
30833085
* - [File]{@link https://developer.mozilla.org/en-US/docs/Web/API/File} instance which let read local files from browser
30843086
* - [ArrayBuffer]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer} instance with complete file content
30853087
* @param {string|object} arg - argument for file open like url, see details
3086-
* @returns {object} - Promise with TFile instance when file is opened
3088+
* @returns {object} - Promise with {@link JSROOT.TFile} instance when file is opened
30873089
* @example
30883090
* JSROOT.openFile("https://root.cern/js/files/hsimple.root")
30893091
* .then(f => console.log(`Open file ${f.getFileName()}`)); */
3090-
30913092
JSROOT.openFile = function(arg) {
30923093

30933094
let file;

scripts/JSRoot.painter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3668,7 +3668,7 @@ JSROOT.define(['d3'], (d3) => {
36683668
* @param {string|object} dom - id of div element to draw or directly DOMElement
36693669
* @param {object} obj - object to draw, object type should be registered before in JSROOT
36703670
* @param {string} opt - draw options separated by space, comma or semicolon
3671-
* @param {function} [callback] - deprecated, function called when drawing is completed, first argument is object painter instance
3671+
* @param {function} [callback] - deprecated, will be removed in 6.2.0, called with painter object
36723672
* @returns {Promise} with painter object only if callback parameter is not specified
36733673
* @requires painter
36743674
* @desc An extensive list of support draw options can be found on [JSROOT examples page]{@link https://root.cern/js/latest/examples.htm}
@@ -3687,7 +3687,7 @@ JSROOT.define(['d3'], (d3) => {
36873687
* @param {string|object} dom - id of div element to draw or directly DOMElement
36883688
* @param {object} obj - object to draw, object type should be registered before in JSROOT
36893689
* @param {string} opt - draw options
3690-
* @param {function} [callback] - function called when redrawing is completed, first argument will be object painter instance
3690+
* @param {function} [callback] - deprecated, will be removed in 6.2.0, called with painter object
36913691
* @returns {Promise} with painter used only when callback parameter is not specified
36923692
* @requires painter
36933693
* @desc If drawing was not done before, it will be performed with {@link JSROOT.draw}.

0 commit comments

Comments
 (0)