JSROOT problem displaying a TCanvas with 3D objects in it

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


Hi Dario,

Somehow WebGL is not working for you.
And SoftwareRenderer, which is fallback solution, fails.
I will investigate problem once I am back to work begin of next week.

Regards,
Sergey

Hi,

Actually, problem is in following line:

Element with id="drawing" is not exists, therefore drawing cannot be performed.
Also “colz” option is not supported for TCanvas object - it simply ignored.

Regards,
Sergey

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.