JsROOT CreateHistogram

Dear experts,

this is probably a stupid question but I simply don’t get it. I’m using JSROOT to draw a TH1 on a webpage that is hosted on EOS and thus run by the standard CERN WebServers. In the past (last year), we embedded the script [1] and used the function JSROOT.CreateHistogram to draw the TH1 in a div. Now the TH1 is not drawn because the JSROOT.CreateHistogram function cannot be found (it says in the Firefox console). I found on [2] that the core script now that should be embedded is [3], I also can find the function definition in [3]. And [2] also says on the site that the embedding of [3] should be enough to draw histograms, still, in the Firefox console I read that the function cannot be found nor the TH1 is drawn.

Do I need to source something else or execute some function in order to be able to use JSROOT.CreateHistogram?

Thank you very much!
heico

[1] https://root.cern/js/dev/scripts/JSRootCore.js
[2] JavaScript ROOT section 1.11.1
[3] https://root.cern/js/dev/scripts/JSRoot.core.js

Hi,

In JSROOT v6 release many incompatible changes were made.
You still can use older API just by loading last v5.9.1 version from https://root.cern/js/5.9.1/scripts/JSRootCore.js

Or adjust your code to new API. Here is migration instruction.

Up-to-date JSROOT documentation you always will find on https://github.com/root-project/jsroot/tree/master/docs. Version on root.cern site updated not so often.

There is also minimal API reference - for instance for JSROOT.createHistogram.

Regards,
Sergey

Dear Sergey,

thank you very much! For simplicity I loaded the v5.9.1 and it works perfectly as before.

Thank you!
heico

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