Skip to content

Commit 8615af6

Browse files
committed
Adjust hpainter.js demo
1 parent efa6602 commit 8615af6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

demo/node/hpainter.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
import { version, HierarchyPainter } from 'jsroot';
1+
import { version, HierarchyPainter, draw } from 'jsroot';
22

33

44
console.log(`JSROOT version ${version}`);
55

66

7-
const hp = new HierarchyPainter('batch', null);
7+
const hp = new HierarchyPainter('hpainter');
88

9+
// configure batch display to properly handle DOM in the node.js
10+
hp.setDisplay('batch');
11+
12+
// catch draw function calls
913
hp.setDrawFunc((dom, obj, opt) => {
1014
console.log(`trying to draw ${obj._typename}`);
11-
return null;
15+
return draw(dom, obj, opt);
1216
});
1317

1418
await hp.openRootFile('https://root.cern/js/files/hsimple.root');

0 commit comments

Comments
 (0)