1- // https://root.cern/js/ v6.99.99
1+ // https://root.cern/js/ v7.0.0
22(function (global, factory) {
33typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
44typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -7,11 +7,11 @@ typeof define === 'function' && define.amd ? define(['exports'], factory) :
77
88/** @summary version id
99 * @desc For the JSROOT release the string in format "major.minor.patch" like "6.3.0" */
10- let version_id = "modules ";
10+ let version_id = "7.0.x ";
1111
1212/** @summary version date
1313 * @desc Release date in format day/month/year like "19/11/2021" */
14- let version_date = "12 /04/2022";
14+ let version_date = "19 /04/2022";
1515
1616/** @summary version id and date
1717 * @desc Produced by concatenation of {@link version_id} and {@link version_date}
@@ -89,13 +89,11 @@ function isArrayProto(proto) {
8989 return proto.length == 14 ? 1 : 2;
9090}
9191
92- /** @summary Specialized JSROOT constants, used in {@link settings}
93- * @namespace
94- * @private */
92+ /** @desc Specialized JSROOT constants, used in {@link settings}
93+ * @namespace */
9594let constants$1 = {
9695 /** @summary Kind of 3D rendering, used for {@link settings.Render3D}
97- * @namespace
98- * @private */
96+ * @namespace */
9997 Render3D: {
10098 /** @summary Default 3D rendering, normally WebGL, if not supported - SVG */
10199 Default: 0,
@@ -113,29 +111,27 @@ let constants$1 = {
113111 }
114112 },
115113 /** @summary Way to embed 3D into SVG, used for {@link settings.Embed3D}
116- * @namespace
117- * @private */
114+ * @namespace */
118115 Embed3D: {
119116 /** @summary Do not embed 3D drawing, use complete space */
120117 NoEmbed: -1,
121- /** @summary Default embeding mode, on Firefox is really ```Embed```, on all other ```Overlay``` */
118+ /** @summary Default embeding mode - on Firefox and latest Chrome is real ```Embed```, on all other ```Overlay``` */
122119 Default: 0,
123- /** @summary WebGL canvas not inserted into SVG, but just overlayed The only way how Chrome browser can be used */
120+ /** @summary WebGL canvas not inserted into SVG, but just overlayed The only way how earlier Chrome browser can be used */
124121 Overlay: 1,
125- /** @summary Really embed WebGL Canvas into SVG, only works with Firefox */
122+ /** @summary Really embed WebGL Canvas into SVG */
126123 Embed: 2,
127- /** @summary Embeding, but when SVG rendering or SVG image converion is used
128- * @private */
124+ /** @summary Embeding, but when SVG rendering or SVG image converion is used */
129125 EmbedSVG: 3,
126+ /** @summary Convert string values into number */
130127 fromString: function(s) {
131128 if (s === "embed") return this.Embed;
132129 if (s === "overlay") return this.Overlay;
133130 return this.Default;
134131 }
135132 },
136133 /** @summary How to use latex in text drawing, used for {@link settings.Latex}
137- * @namespace
138- * @private */
134+ * @namespace */
139135 Latex: {
140136 /** @summary do not use Latex at all for text drawing */
141137 Off: 0,
@@ -147,6 +143,7 @@ let constants$1 = {
147143 MathJax: 3,
148144 /** @summary always use MathJax for text rendering */
149145 AlwaysMathJax: 4,
146+ /** @summary Convert string values into number */
150147 fromString: function(s) {
151148 if (!s || (typeof s !== 'string'))
152149 return this.Normal;
@@ -170,12 +167,12 @@ let constants$1 = {
170167 }
171168};
172169
173- /** @summary Central JSROOT settings, independent from {@link gStyle}
170+ /** @desc Global JSROOT settings
174171 * @namespace */
175172let settings = {
176173 /** @summary Render of 3D drawing methods, see {@link constants.Render3D} for possible values */
177174 Render3D: constants$1.Render3D.Default,
178- /** @summary Render of 3D drawing methods in batch mode, see {@link constants.Render3D} for possible values */
175+ /** @summary 3D drawing methods in batch mode, see {@link constants.Render3D} for possible values */
179176 Render3DBatch: constants$1.Render3D.Default,
180177 /** @summary Way to embed 3D drawing in SVG, see {@link constants.Embed3D} for possible values */
181178 Embed3D: constants$1.Embed3D.Default,
@@ -246,11 +243,6 @@ let settings = {
246243 * @desc Can be disabled to prevent keys heandling in complex HTML layouts
247244 * @default true */
248245 HandleKeys: true,
249- /** @summary Let tweak browser caching
250- * @desc When specified, extra URL parameter like ```?stamp=unique_value``` append to each JSROOT script loaded
251- * In such case browser will be forced to load JSROOT functionality disregards of server cache settings
252- * @default false */
253- NoCache: false,
254246 /** @summary Skip streamer infos from the GUI */
255247 SkipStreamerInfos: false,
256248 /** @summary Interactive dragging of TGraph points */
@@ -1629,19 +1621,6 @@ function _ensureJSROOT() {
16291621 }).then(() => globalThis.JSROOT);
16301622}
16311623
1632- /** @summary Initialize JSROOT
1633- * @desc Called when main JSRoot.core.js script is loaded.
1634- * @private */
1635- if (source_fullpath) {
1636-
1637- let d = decodeUrl(source_fullpath);
1638-
1639- if (d.has('nocache')) settings.NoCache = (new Date).getTime(); // use timestamp to overcome cache limitation
1640- if (d.has('wrong_http_response') || decodeUrl().has('wrong_http_response'))
1641- settings.HandleWrongHttpResponse = true; // server may send wrong content length by partial requests, use other method to control this
1642- if (d.has('nosap')) internals.sap = undefined; // let ignore sap loader even with openui5 loaded
1643- }
1644-
16451624var core = /*#__PURE__*/Object.freeze({
16461625__proto__: null,
16471626version_id: version_id,
@@ -10545,8 +10524,8 @@ class ObjectPainter extends BasePainter {
1054510524 * @param {object} obj - new version of object, values will be updated in original object
1054610525 * @param {string} [opt] - when specified, new draw options
1054710526 * @returns {boolean|Promise} for object redraw
10548- * @desc Two actions typically done by redraw - update object content via {@link ObjectPainter. updateObject} and
10549- * then redraw correspondent pad via {@link ObjectPainter. redrawPad}. If possible one should redefine
10527+ * @desc Two actions typically done by redraw - update object content via {@link ObjectPainter# updateObject} and
10528+ * then redraw correspondent pad via {@link ObjectPainter# redrawPad}. If possible one should redefine
1055010529 * only updateObject function and keep this function unchanged. But for some special painters this function is the
1055110530 * only way to control how object can be update while requested from the server
1055210531 * @protected */
@@ -10632,7 +10611,7 @@ class ObjectPainter extends BasePainter {
1063210611 }
1063310612
1063410613 /** @summary Checks if draw elements were resized and drawing should be updated.
10635- * @desc Redirects to {@link TPadPainter. checkCanvasResize}
10614+ * @desc Redirects to {@link TPadPainter# checkCanvasResize}
1063610615 * @private */
1063710616 checkResize(arg) {
1063810617 let p = this.getCanvPainter();
@@ -10654,7 +10633,7 @@ class ObjectPainter extends BasePainter {
1065410633 }
1065510634
1065610635 /** @summary Returns created <g> element used for object drawing
10657- * @desc Element should be created by {@link ObjectPainter. createG}
10636+ * @desc Element should be created by {@link ObjectPainter# createG}
1065810637 * @protected */
1065910638 getG() { return this.draw_g; }
1066010639
@@ -10847,7 +10826,7 @@ class ObjectPainter extends BasePainter {
1084710826 }
1084810827
1084910828 /** @summary Converts pad SVG x or y coordinates into axis values.
10850- * @desc Reverse transformation for {@link ObjectPainter. axisToSvg}
10829+ * @desc Reverse transformation for {@link ObjectPainter# axisToSvg}
1085110830 * @param {string} axis - name like "x" or "y"
1085210831 * @param {number} coord - graphics coordiante.
1085310832 * @param {boolean} ndc - kind of return value
@@ -11972,7 +11951,7 @@ function resize(dom, arg) {
1197211951
1197311952/** @summary Safely remove all drawings from specified element
1197411953 * @param {string|object} dom - id or DOM element
11975- * @requires painter
11954+ * @public
1197611955 * @example
1197711956 * cleanup("drawing");
1197811957 * cleanup(document.querySelector("#drawing")); */
@@ -55919,7 +55898,7 @@ class MDIDisplay extends BasePainter {
5591955898/**
5592055899 * @summary Custom MDI display
5592155900 *
55922- * @desc All HTML frames should be created before and add via {@link CustomDisplay. addFrame} calls
55901+ * @desc All HTML frames should be created before and add via {@link CustomDisplay# addFrame} calls
5592355902 * @private
5592455903 */
5592555904
@@ -68945,7 +68924,7 @@ function setDefaultDrawOpt(classname, opt) {
6894568924 * @param {object} obj - object to draw, object type should be registered before with {@link addDrawFunc}
6894668925 * @param {string} opt - draw options separated by space, comma or semicolon
6894768926 * @returns {Promise} with painter object
68948- * @requires painter
68927+ * @public
6894968928 * @desc An extensive list of support draw options can be found on [examples page]{@link https://root.cern/js/latest/examples.htm}
6895068929 * @example
6895168930 * let file = await openFile("https://root.cern/js/files/hsimple.root");
@@ -69064,9 +69043,9 @@ function draw(dom, obj, opt) {
6906469043 * @param {object} obj - object to draw, object type should be registered before with {@link addDrawFunc}
6906569044 * @param {string} opt - draw options
6906669045 * @returns {Promise} with painter object
69067- * @requires painter
6906869046 * @desc If drawing was not done before, it will be performed with {@link draw}.
69069- * Otherwise drawing content will be updated */
69047+ * Otherwise drawing content will be updated
69048+ * @public */
6907069049function redraw(dom, obj, opt) {
6907169050
6907269051 if (!obj || (typeof obj !== 'object'))
@@ -71943,12 +71922,11 @@ class TDirectory {
7194371922 });
7194471923 }
7194571924
71946- } // TDirectory
71925+ } // class TDirectory
7194771926
7194871927/**
7194971928 * @summary Interface to read objects from ROOT files
7195071929 *
71951- * @hideconstructor
7195271930 * @desc Use {@link openFile} to create instance of the class
7195371931 */
7195471932
@@ -72002,7 +71980,7 @@ class TFile {
7200271980 }
7200371981
7200471982 /** @summary Assign BufferArray with file contentOpen file
72005- * @private */
71983+ * @private */
7200671984 assignFileContent(bufArray) {
7200771985 this.fFileContent = new TBuffer(new DataView(bufArray));
7200871986 this.fAcceptRanges = false;
@@ -72011,8 +71989,8 @@ class TFile {
7201171989 }
7201271990
7201371991 /** @summary Open file
72014- * @returns {Promise} after file keys are read
72015- * @private */
71992+ * @returns {Promise} after file keys are read
71993+ * @private */
7201671994 _open() {
7201771995 if (!this.fAcceptRanges || this.fSkipHeadRequest)
7201871996 return this.readKeys();
@@ -72563,7 +72541,7 @@ class TFile {
7256372541
7256472542 /** @summary Read the directory content from a root file
7256572543 * @desc If directory was already read - return previously read object
72566- * Same functionality as {@link TFile. readObject}
72544+ * Same functionality as {@link TFile# readObject}
7256772545 * @param {string} dir_name - directory name
7256872546 * @param {number} [cycle] - directory cycle
7256972547 * @returns {Promise} - promise with read directory */
@@ -76701,6 +76679,9 @@ function readStyleFromURL(url) {
7670176679 }
7670276680 }
7670376681
76682+ if (d.has('wrong_http_response'))
76683+ settings.HandleWrongHttpResponse = true;
76684+
7670476685 let inter = d.get("interactive");
7670576686 if (inter === "nomenu")
7670676687 settings.ContextMenu = false;
@@ -76785,8 +76766,14 @@ function readStyleFromURL(url) {
7678576766
7678676767
7678776768/** @summary Build main GUI
76788- * @returns {Promise} when completed */
76789- function buildGUI(gui_element, gui_kind) {
76769+ * @desc Used in many HTML files to create JSROOT GUI elements
76770+ * @param {String} gui_element - id of the `<div>` element
76771+ * @param {String} gui_kind - either "online", "nobrowser", "draw"
76772+ * @returns {Promise} with {@link HierarchyPainter} instance
76773+ * @example
76774+ * import { buildGUI } from '/path_to_jsroot/modules/gui.mjs';
76775+ * buildGUI("guiDiv"); */
76776+ function buildGUI(gui_element, gui_kind = "") {
7679076777 let myDiv = (typeof gui_element == 'string') ? select('#' + gui_element) : select(gui_element);
7679176778 if (myDiv.empty())
7679276779 return Promise.reject(Error('no div for gui found'));
@@ -94581,7 +94568,7 @@ function treeProcess(tree, selector, args) {
9458194568
9458294569}
9458394570
94584- /** @summary implementation of TTree::Draw
94571+ /** @summary implementation of TTree::Draw
9458594572 * @param {object|string} args - different setting or simply draw expression
9458694573 * @param {string} args.expr - draw expression
9458794574 * @param {string} [args.cut=undefined] - cut expression (also can be part of 'expr' after '::')
0 commit comments