Dear all,
I have the following problem with JSROOT. I’m try to display a TCanvas object on a browser using the following html code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Reading object from the ROOT file</title>
<script src="../../../JsRoot/scripts/JSRootCore.js" type="text/javascript"></script>
<script type='text/javascript'>
var filename = "../../rootFiles/draw2dopt.root";
var nLoops = 0 ;
JSROOT.OpenFile(
filename,
function(file)
{
file.ReadObject("lego",
function(obj)
{
JSROOT.draw("drawingDiv", obj, "colz");
}
);
var time = setTimeout(function()
{
nLoops++ ;
console.log("Loop "+nLoops) ;
if( nLoops > 4 ) clearInterval(time) ;
file.ReadObject(
"lego",
function(obj)
{
JSROOT.draw("drawing", obj, "colz");
}
);
},2000
)
}
);
</script>
</head>
<body>
<div id="drawingDiv" style="width:800px; height:600px"></div>
</body>
</html>
Attached below is the file with the corresponding TCanvas object (name: lego).
What I get, is a first correct drawing on the browser canvas, but then the timer loop is broken with the following traceback (a snapshot of the Firefox javascript debugger):
As a result, the second update, in the setTimer function, is never executed.
I’m using Firefox on a Linux platform: version is “Firefox Quantum” 60.9.0esr (64bit) while JSROOT is version 5.7.1
Any suggestion?
Thanks for your advice.
Dario Menasce
draw2dopt.root (46.6 KB)
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided