Skip to content

Commit ffdfc0c

Browse files
committed
Add iotest example to api.htm
Use text() in the code
1 parent d6e19f3 commit ffdfc0c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

api.htm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ <h1><div><a href="https://root.cern/js/">JSROOT</a></div><a id="version" href="h
401401
{ 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; `&layout=vert121`' },
402402
{ 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; `&layout=horiz32_12`' },
403403
{ name: 'Inspector', url: '?file=' + filepath + 'hsimple.root&item=hpx;1&opt=inspect', title: 'Show objects data memebers; `&opt=inspect`' },
404+
{ name: 'IO test', url: '?file=' + filepath + 'hsimple.root&item=hpx&opt=iotest', title: 'Check reading speed of specified object; `&opt=iotest`' },
404405
{ name: 'Projection', url: '?nobrowser&file=' + filepath + 'hsimple.root&item=hpxpy;1&opt=col,projx3', title: 'Enable X projection with 3 bins, `&opt=projx3`' },
405406
{ 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, `item=img:path/to/image.png`' },
406407
{ name: 'Use JSON', url: '?nobrowser&json=https://jsroot.gsi.de/files/danilo6.json', title: 'Read and display data from JSON file, produced with TBufferJSON class; `&json=<filename>`' },

modules/gui/HierarchyPainter.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,12 +2515,12 @@ class HierarchyPainter extends BasePainter {
25152515

25162516
if ((options.length === 1) && (options[0] === 'iotest')) {
25172517
this.clearHierarchy();
2518-
d3_select('#' + this.disp_frameid).html('<h2>Start I/O test</h2>');
2518+
d3_select('#' + this.disp_frameid).html('').append('h2').text('Start I/O test');
25192519

25202520
const tm0 = new Date();
2521-
return this.getObject(items[0]).then(() => {
2521+
return this.getObject(items[0]).then(res => {
25222522
const tm1 = new Date();
2523-
d3_select('#' + this.disp_frameid).append('h2').html('Item ' + items[0] + ' reading time = ' + (tm1.getTime() - tm0.getTime()) + 'ms');
2523+
d3_select('#' + this.disp_frameid).append('h2').text(`Item ${items[0]} reading ` + (res?.obj ? `type ${res?.obj._typename} time = ${tm1.getTime() - tm0.getTime()}ms` : 'fail'));
25242524
return true;
25252525
});
25262526
}

0 commit comments

Comments
 (0)