I am a beginner in javascript and with jsroot. Half a year ago I did some coding with jsroot v5.9. But now that new version is out I am having some troubles with the basics.
The problem:
In 5.9 version I used the following code to get a histogram from a plot: var obj = JSROOT.GetMainPainter(divid).draw_object.
But in the new version 6.0 this was changed and I can’t make it work.
I tried using this code var dummy = JSROOT.Painter.getElementMainPainter(divid) but it just returns null.
I also tried doing it as it is written in the source code like this:
let tmp = JSROOT.ObjectPainter(divid);
var dummy = tmp.getMainPainter(True);
Here I get a object for the tmp but then tmp.getMainPainter gives just null.
I need complete code to identify problem. getElementMainPainter function should be working - it is used in different places of JSROOT itself.
May be you do not wait for JSROOT.draw completion?
It now returns Promise and one should wait until it is resolved.