Hello All,
I am new to root and am trying to draw a histogram using JSROOT. I have a two questions:
- Everything works when calling the js files from cern servers, but not from local servers.
I cloned the repo from jsroot github, am on the main branch, and can individually access the js files (just to ensure that the local server settings works)
import { openFile } from 'https://root.cern/js/latest/modules/io.mjs';
import { redraw,draw } from 'https://root.cern/js/latest/modules/draw.mjs';
// import { openFile } from 'http://server/html/jsroot/modules/io.mjs';
// import { draw } from 'http://server/html/jsroot/modules/draw.mjs';
How do I use the js files from a local server? I understand this may be more a front-end web question, but just in case someone encountered the same issue. The exact error when calling js files from local server is (from firefox console) is:
Uncaught (in promise) SyntaxError: ambiguous indirect export: setHistTitle
- After drawing a histogram, how do you set the labels (title, xlabel, ylabel etc). I am drawing the histogram thusly:
let ntuples = await file.readObject("ntuples;1");
let hist = draw("drawing", ntuples, "px:py:pz");
// hist.fTitle="asfsd"; //This does not work.
Thank you,
ROOT Version: NA jsroot.git master
Platform: Browser
Compiler: NA