diff --git a/js/build/jsroot.js b/js/build/jsroot.js index 5ada866d30408..dbdd6c86deffe 100644 --- a/js/build/jsroot.js +++ b/js/build/jsroot.js @@ -1,4 +1,4 @@ -// https://root.cern/js/ v7.11.3 +// https://root.cern/js/ v7.11.4 (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -10,11 +10,11 @@ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentS /** @summary version id * @desc For the JSROOT release the string in format 'major.minor.patch' like '7.0.0' */ -const version_id = '7.11.3', +const version_id = '7.11.4', /** @summary version date * @desc Release date in format day/month/year like '14/04/2022' */ -version_date = '20/10/2026', +version_date = '27/10/2026', /** @summary version id and date * @desc Produced by concatenation of {@link version_id} and {@link version_date} @@ -11520,7 +11520,7 @@ function repairMathJaxSvgSize(painter, mj_node, svg, arg) { if (valign && (valign.length > 18) && valign.indexOf('vertical-align:') === 0) { const p = valign.indexOf('ex;'); - valign = ((p > 0) && (p === valign.length - 3)) ? transform(valign.slice(16, valign.length - 1)) : null; + valign = ((p > 0) && (p === valign.length - 3)) ? transform(valign.slice(15, valign.length - 1)) : null; } else valign = null; @@ -12586,7 +12586,7 @@ class TAttLineHandler { if (Math.abs(this.width) > 99) { // exclusion graph this.excl_side = (this.width < 0) ? -1 : 1; - this.excl_width = Math.floor(this.width / 100) * 5; + this.excl_width = Math.floor(Math.abs(this.width) / 100) * 5; this.width = Math.abs(this.width % 100); // line width } } @@ -12602,7 +12602,7 @@ class TAttLineHandler { this.excl_width = width; if (side !== undefined) { this.excl_side = side; - if ((this.excl_width === 0) && this.excl_side) + if (side && !this.excl_width) this.excl_width = 20; } this.changed = true; @@ -81802,7 +81802,7 @@ class JSRootMenu { this.addchk(settings.DragAndDrop, 'Drag and drop', flag => { settings.DragAndDrop = flag; }); this.addchk(settings.DragGraphs, 'Drag graph points', flag => { settings.DragGraphs = flag; }); this.addSelectMenu('Progress box', ['off', 'on', 'modal'], isStr(settings.ProgressBox) ? settings.ProgressBox : (settings.ProgressBox ? 'on' : 'off'), value => { - settings.ProgressBox = (value === 'off') ? false : (value === ' on' ? true : value); + settings.ProgressBox = (value === 'off') ? false : (value === 'on' ? true : value); }); this.endsub(); @@ -84902,7 +84902,7 @@ class TooltipHandler extends ObjectPainter { if ((gapminx === -1111) && (gapmaxx === -1111)) gapminx = gapmaxx = hint.x; gapminx = Math.min(gapminx, hint.x); - gapmaxx = Math.min(gapmaxx, hint.x); + gapmaxx = Math.max(gapmaxx, hint.x); } group.attr('x', posx) @@ -93663,7 +93663,7 @@ class TPavePainter extends ObjectPainter { if (pt.fY1NDC > pt.fY2NDC) pt.fY2NDC = Math.min(0.995, pt.fY1NDC + stath + extrah); if (pt.fX1NDC > pt.fX2NDC) - pt.fY2NDC = Math.min(0.995, pt.fX1NDC + statw); + pt.fX2NDC = Math.min(0.995, pt.fX1NDC + statw); } } } @@ -97931,11 +97931,11 @@ class THistPainter extends ObjectPainter { need_redraw = true; fp.fY2NDC = pal.fY1NDC - 0.01; if (fp.fY1NDC > fp.fY2NDC - 0.1) - fp.fY1NDC = Math.max(0, fp.fXYNDC - 0.1); + fp.fY1NDC = Math.max(0, fp.fY2NDC - 0.1); } else if ((pal.fY2NDC < 0.5) && (fp.fY1NDC < pal.fY2NDC)) { need_redraw = true; fp.fY1NDC = pal.fY2NDC + 0.05; - if (fp.fXYNDC < fp.fY1NDC + 0.1) + if (fp.fY2NDC < fp.fY1NDC + 0.1) fp.fY2NDC = Math.min(1, fp.fY1NDC + 0.1); } if (need_redraw && pad) { @@ -98225,7 +98225,7 @@ class THistPainter extends ObjectPainter { res = { low: err, up: err }, kind = this.getOptions().Poisson || histo.fBinStatErrOpt; - if (!kind || (histo.fSumw2.fN && histo.fTsumw !== histo.fTsumw2) || (content < 0)) + if (!kind || (histo.fSumw2?.length && histo.fTsumw !== histo.fTsumw2) || (content < 0)) return res; const alpha = (kind === kPoisson2) ? 0.05 : 1 - 0.682689492, @@ -98277,7 +98277,7 @@ class THistPainter extends ObjectPainter { }).then(() => { return painter.drawHistTitle(); }).then(() => { - if (!painter.Mode3D && painter.options.AutoZoom) + if (!painter.options.Mode3D && painter.options.AutoZoom) return painter.autoZoom(); }).then(() => { if (painter.options.Project && !painter.mode3d && isFunc(painter.toggleProjection)) @@ -99615,7 +99615,7 @@ let TH2Painter$2 = class TH2Painter extends THistPainter { if ((print_under > 0) || (print_over > 0)) { const get = i => data.matrix[i].toFixed(0); - stat.addText(`${get(6)} | ${get(7)} | ${get(7)}`); + stat.addText(`${get(6)} | ${get(7)} | ${get(8)}`); stat.addText(`${get(3)} | ${get(4)} | ${get(5)}`); stat.addText(`${get(0)} | ${get(1)} | ${get(2)}`); } @@ -104729,11 +104729,11 @@ let TH1Painter$2 = class TH1Painter extends THistPainter { } } - // account overflow/underflow bins - if (is_profile) - hsum += histo.fBinEntries[0] + histo.fBinEntries[this.nbinsx + 1]; - else - hsum += histo.getBinContent(0) + histo.getBinContent(this.nbinsx + 1); + // account underflow and overflow bin, check if already was included + if (imin >= 0) + hsum += is_profile ? histo.fBinEntries[0] : histo.getBinContent(0); + if (imax <= this.nbinsx) + hsum += is_profile ? histo.fBinEntries[this.nbinsx + 1] : histo.getBinContent(this.nbinsx + 1); this.stat_entries = hsum; @@ -105399,7 +105399,7 @@ let TH1Painter$2 = class TH1Painter extends THistPainter { for (i = left; i <= right; ++i) { x = xaxis.GetBinLowEdge(i + 1); - if (this.logx && (x <= 0)) + if (funcs.logx && (x <= 0)) continue; grx = Math.round(funcs.grx(x)); @@ -106329,7 +106329,7 @@ function drawTH2PolyLego(painter) { z1: this.draw_z0, z2: this.draw_z1, bin: this.bins_index, - value: bin.fContent, + value: tbin.fContent, color: this.tip_color, lines: p.getPolyBinTooltips(this.bins_index) }; @@ -106615,10 +106615,10 @@ class TH3Painter extends THistPainter { np += w; sumx3 += w * Math.pow(xx - res.meanx, 3); sumy3 += w * Math.pow(yy - res.meany, 3); - sumz3 += w * Math.pow(zz - res.meany, 3); + sumz3 += w * Math.pow(zz - res.meanz, 3); sumx4 += w * Math.pow(xx - res.meanx, 4); sumy4 += w * Math.pow(yy - res.meany, 4); - sumz4 += w * Math.pow(yy - res.meany, 4); + sumz4 += w * Math.pow(zz - res.meanz, 4); } } } @@ -107958,7 +107958,7 @@ let TGraphPainter$1 = class TGraphPainter extends ObjectPainter { const line_events_handling = !this.isBatchMode() && (options.Line || options.Errors) ? 'none' : null; if (main_block && lineatt.excl_side) { - excl_width = lineatt.excl_width; + excl_width = lineatt.excl_width * lineatt.excl_side; if ((lineatt.width > 0) && !options.Line && !options.Curve) options.Line = 1; } @@ -112682,9 +112682,9 @@ function provideObjectInfo(obj) { info.push(`Alpha=${shape.fAlpha} Phi=${shape.fPhi} Theta=${shape.fTheta}`); break; case clTGeoTrd2: - info.push(`Dy1=${conv(shape.fDy1)} Dy2=${conv(shape.fDy1)}`); // no break + info.push(`Dy1=${conv(shape.fDy1)} Dy2=${conv(shape.fDy2)}`); // no break case clTGeoTrd1: - info.push(`Dx1=${conv(shape.fDx1)} Dx2=${conv(shape.fDx1)}`); + info.push(`Dx1=${conv(shape.fDx1)} Dx2=${conv(shape.fDx2)}`); break; case clTGeoSphere: info.push(`Rmin=${conv(shape.fRmin)} Rmax=${conv(shape.fRmax)}`, @@ -112839,7 +112839,7 @@ function createMaterial(cfg, args0) { args.color = 'red'; args.side = THREE.FrontSide; args.transparent = args.opacity < 1; - args.depthWrite = args.opactity === 1; + args.depthWrite = args.opacity === 1; let material; @@ -113325,7 +113325,7 @@ class ClonedNodes { /** @summary Assign only visibility flags, extracted with getVisibleFlags */ setVisibleFlags(flags) { - if (!this.nodes || !flags || !flags.length !== this.nodes.length) + if (!this.nodes || !flags || (flags.length !== this.nodes.length)) return 0; let res = 0; @@ -114206,7 +114206,7 @@ class ClonedNodes { else camVol = 0; - camFact = maxVol / ((camVol > 0) ? (camVol > 0) : minVol); + camFact = maxVol / (camVol > 0 ? camVol : minVol); } } @@ -121169,9 +121169,9 @@ class TGeoPainter extends ObjectPainter { /** @summary Search for created shape for nodeid * @desc Used in ROOT geometry painter */ findNodeShape(nodeid) { - if ((nodeid !== undefined) && !this.#draw_nodes) { + if ((nodeid !== undefined) && this.#draw_nodes) { for (let k = 0; k < this.#draw_nodes.length; ++k) { - const item = this.geo_painter._draw_nodes[k]; + const item = this.#draw_nodes[k]; if ((item.nodeid === nodeid) && item.server_shape) return item.server_shape; } @@ -129778,6 +129778,15 @@ async function treeProcess(tree, selector, args) { if (!streamer) { elem = null; console.warn('not found streamer!'); + } else if (branch.fType === -1) { + // object written by custom streamer of the class, it has version and bytecount + member = { + name: target_name, + typename: branch.fClassName, + func(buf, obj) { + obj[this.name] = buf.classStreamer({}, this.typename); + } + }; } else { member = { name: target_name, @@ -177851,7 +177860,7 @@ class TSplinePainter extends ObjectPainter { knot = spline.fPoly[indx]; yy = this.eval(knot, xx); - if ((indx < spline.fN - 1) && (Math.abs(spline.fPoly[indx + 1].fX - xx) < Math.abs(xx - knot.fX))) + if ((indx < spline.fNp - 1) && (Math.abs(spline.fPoly[indx + 1].fX - xx) < Math.abs(xx - knot.fX))) knot = spline.fPoly[++indx]; if (Math.abs(funcs.grx(knot.fX) - pnt.x) < 0.5 * this.#knot_size) { @@ -178274,6 +178283,7 @@ class TPiePainter extends ObjectPainter { af -= entry.value / total * 2 * Math.PI; entry.a1 = af; + entry.large_arc = entry.value > total * 0.5 ? 1 : 0; entry.x1 = Math.round(rx * Math.cos(entry.a1)); entry.y1 = Math.round(ry * Math.sin(entry.a1)); entry.x2 = Math.round(rx * Math.cos(entry.a2)); @@ -178336,7 +178346,7 @@ class TPiePainter extends ObjectPainter { entry.pie_path += `a${rx},${ry},0,0,1,${xx2 - xx1},${yy2 - yy1}`; }); } else - entry.pie_path = `a${rx},${ry},0,0,1,${entry.x2 - entry.x1},${entry.y2 - entry.y1}`; + entry.pie_path = `a${rx},${ry},0,${entry.large_arc},1,${entry.x2 - entry.x1},${entry.y2 - entry.y1}`; } // code to create 3d effect @@ -179859,12 +179869,11 @@ function decodeZigzag32(view) { * @private */ function decodeZigzag64(view) { for (let o = 0; o < view.byteLength; o += 8) { - const x = view.getBigUint64(o, LITTLE_ENDIAN); - view.setBigInt64(o, (x >> 1n) ^ (-(x & 1n)), LITTLE_ENDIAN); - } + const x = view.getBigUint64(o, LITTLE_ENDIAN); + view.setBigInt64(o, (x >> 1n) ^ (-(x & 1n)), LITTLE_ENDIAN); + } } - // Envelope Types // TODO: Define usage logic for envelope types in future // const kEnvelopeTypeHeader = 0x01, diff --git a/js/changes.md b/js/changes.md index a19ec40a06087..48ac66e4251b0 100644 --- a/js/changes.md +++ b/js/changes.md @@ -1,5 +1,13 @@ # JSROOT changelog +## Changes in 7.11.4 +1. Fix - bug in `TH2` overflow counts display in stat box +2. Fix - reading of objects with custom streamer stored in `TTree` branch #432 (@Prafyl) +3. Fix - `TH3` stats calculation +4. Fix - large angle display in `TPieSlice` +5. Fix - interactive change of `TGraph` exclusion side and width +6. Fix - multiple typos in tooltips and stats (AI assisted) + ## Changes in 7.11.3 1. Fix - reading of negative 64-bit integers #422 (thanks to @Prafyl) diff --git a/js/modules/base/TAttLineHandler.mjs b/js/modules/base/TAttLineHandler.mjs index 160bcf545f460..9ef44dbbe9013 100644 --- a/js/modules/base/TAttLineHandler.mjs +++ b/js/modules/base/TAttLineHandler.mjs @@ -59,7 +59,7 @@ class TAttLineHandler { if (Math.abs(this.width) > 99) { // exclusion graph this.excl_side = (this.width < 0) ? -1 : 1; - this.excl_width = Math.floor(this.width / 100) * 5; + this.excl_width = Math.floor(Math.abs(this.width) / 100) * 5; this.width = Math.abs(this.width % 100); // line width } } @@ -75,7 +75,7 @@ class TAttLineHandler { this.excl_width = width; if (side !== undefined) { this.excl_side = side; - if ((this.excl_width === 0) && this.excl_side) + if (side && !this.excl_width) this.excl_width = 20; } this.changed = true; diff --git a/js/modules/base/base3d.mjs b/js/modules/base/base3d.mjs index 0616f41cce24c..17937664a2b60 100644 --- a/js/modules/base/base3d.mjs +++ b/js/modules/base/base3d.mjs @@ -99,7 +99,7 @@ function getMaterialArgs(color, args) { function createSVGRenderer(as_is, precision, doc) { if (as_is) { if (doc !== undefined) - globalThis.docuemnt = doc; + globalThis.document = doc; const rndr = new THREE.SVGRenderer(); rndr.setPrecision(precision); return rndr; diff --git a/js/modules/base/latex.mjs b/js/modules/base/latex.mjs index 114e48cd661d2..30aaf079e9752 100644 --- a/js/modules/base/latex.mjs +++ b/js/modules/base/latex.mjs @@ -1476,7 +1476,7 @@ function repairMathJaxSvgSize(painter, mj_node, svg, arg) { if (valign && (valign.length > 18) && valign.indexOf('vertical-align:') === 0) { const p = valign.indexOf('ex;'); - valign = ((p > 0) && (p === valign.length - 3)) ? transform(valign.slice(16, valign.length - 1)) : null; + valign = ((p > 0) && (p === valign.length - 3)) ? transform(valign.slice(15, valign.length - 1)) : null; } else valign = null; diff --git a/js/modules/core.mjs b/js/modules/core.mjs index ac26168d08110..e508cb37e0ca8 100644 --- a/js/modules/core.mjs +++ b/js/modules/core.mjs @@ -2,11 +2,11 @@ /** @summary version id * @desc For the JSROOT release the string in format 'major.minor.patch' like '7.0.0' */ -const version_id = '7.11.3', +const version_id = '7.11.4', /** @summary version date * @desc Release date in format day/month/year like '14/04/2022' */ -version_date = '20/10/2026', +version_date = '27/10/2026', /** @summary version id and date * @desc Produced by concatenation of {@link version_id} and {@link version_date} diff --git a/js/modules/draw/TPiePainter.mjs b/js/modules/draw/TPiePainter.mjs index be52f2c11b3bd..e31e4b25d95c4 100644 --- a/js/modules/draw/TPiePainter.mjs +++ b/js/modules/draw/TPiePainter.mjs @@ -222,6 +222,7 @@ class TPiePainter extends ObjectPainter { af -= entry.value / total * 2 * Math.PI; entry.a1 = af; + entry.large_arc = entry.value > total * 0.5 ? 1 : 0; entry.x1 = Math.round(rx * Math.cos(entry.a1)); entry.y1 = Math.round(ry * Math.sin(entry.a1)); entry.x2 = Math.round(rx * Math.cos(entry.a2)); @@ -284,7 +285,7 @@ class TPiePainter extends ObjectPainter { entry.pie_path += `a${rx},${ry},0,0,1,${xx2 - xx1},${yy2 - yy1}`; }); } else - entry.pie_path = `a${rx},${ry},0,0,1,${entry.x2 - entry.x1},${entry.y2 - entry.y1}`; + entry.pie_path = `a${rx},${ry},0,${entry.large_arc},1,${entry.x2 - entry.x1},${entry.y2 - entry.y1}`; } // code to create 3d effect diff --git a/js/modules/draw/TSplinePainter.mjs b/js/modules/draw/TSplinePainter.mjs index 48ac3353eca0f..552d8cc0084f6 100644 --- a/js/modules/draw/TSplinePainter.mjs +++ b/js/modules/draw/TSplinePainter.mjs @@ -132,7 +132,7 @@ class TSplinePainter extends ObjectPainter { knot = spline.fPoly[indx]; yy = this.eval(knot, xx); - if ((indx < spline.fN - 1) && (Math.abs(spline.fPoly[indx + 1].fX - xx) < Math.abs(xx - knot.fX))) + if ((indx < spline.fNp - 1) && (Math.abs(spline.fPoly[indx + 1].fX - xx) < Math.abs(xx - knot.fX))) knot = spline.fPoly[++indx]; if (Math.abs(funcs.grx(knot.fX) - pnt.x) < 0.5 * this.#knot_size) { diff --git a/js/modules/geom/TGeoPainter.mjs b/js/modules/geom/TGeoPainter.mjs index 61bd8cb11f19a..1b32d96fc78d3 100644 --- a/js/modules/geom/TGeoPainter.mjs +++ b/js/modules/geom/TGeoPainter.mjs @@ -4077,9 +4077,9 @@ class TGeoPainter extends ObjectPainter { /** @summary Search for created shape for nodeid * @desc Used in ROOT geometry painter */ findNodeShape(nodeid) { - if ((nodeid !== undefined) && !this.#draw_nodes) { + if ((nodeid !== undefined) && this.#draw_nodes) { for (let k = 0; k < this.#draw_nodes.length; ++k) { - const item = this.geo_painter._draw_nodes[k]; + const item = this.#draw_nodes[k]; if ((item.nodeid === nodeid) && item.server_shape) return item.server_shape; } diff --git a/js/modules/geom/geobase.mjs b/js/modules/geom/geobase.mjs index 414feadb6a3de..2a2fd57d5b2c6 100644 --- a/js/modules/geom/geobase.mjs +++ b/js/modules/geom/geobase.mjs @@ -2208,9 +2208,9 @@ function provideObjectInfo(obj) { info.push(`Alpha=${shape.fAlpha} Phi=${shape.fPhi} Theta=${shape.fTheta}`); break; case clTGeoTrd2: - info.push(`Dy1=${conv(shape.fDy1)} Dy2=${conv(shape.fDy1)}`); // no break + info.push(`Dy1=${conv(shape.fDy1)} Dy2=${conv(shape.fDy2)}`); // no break case clTGeoTrd1: - info.push(`Dx1=${conv(shape.fDx1)} Dx2=${conv(shape.fDx1)}`); + info.push(`Dx1=${conv(shape.fDx1)} Dx2=${conv(shape.fDx2)}`); break; case clTGeoSphere: info.push(`Rmin=${conv(shape.fRmin)} Rmax=${conv(shape.fRmax)}`, @@ -2367,7 +2367,7 @@ function createMaterial(cfg, args0) { args.color = 'red'; args.side = THREE.FrontSide; args.transparent = args.opacity < 1; - args.depthWrite = args.opactity === 1; + args.depthWrite = args.opacity === 1; let material; @@ -2853,7 +2853,7 @@ class ClonedNodes { /** @summary Assign only visibility flags, extracted with getVisibleFlags */ setVisibleFlags(flags) { - if (!this.nodes || !flags || !flags.length !== this.nodes.length) + if (!this.nodes || !flags || (flags.length !== this.nodes.length)) return 0; let res = 0; @@ -3735,7 +3735,7 @@ class ClonedNodes { else camVol = 0; - camFact = maxVol / ((camVol > 0) ? (camVol > 0) : minVol); + camFact = maxVol / (camVol > 0 ? camVol : minVol); } } diff --git a/js/modules/gpad/TFramePainter.mjs b/js/modules/gpad/TFramePainter.mjs index d9b5a2eba7606..22af532eaa1ed 100644 --- a/js/modules/gpad/TFramePainter.mjs +++ b/js/modules/gpad/TFramePainter.mjs @@ -642,7 +642,7 @@ class TooltipHandler extends ObjectPainter { if ((gapminx === -1111) && (gapmaxx === -1111)) gapminx = gapmaxx = hint.x; gapminx = Math.min(gapminx, hint.x); - gapmaxx = Math.min(gapmaxx, hint.x); + gapmaxx = Math.max(gapmaxx, hint.x); } group.attr('x', posx) diff --git a/js/modules/gui/menu.mjs b/js/modules/gui/menu.mjs index e1cd8b923642e..deb4026ea63cb 100644 --- a/js/modules/gui/menu.mjs +++ b/js/modules/gui/menu.mjs @@ -894,7 +894,7 @@ class JSRootMenu { this.addchk(settings.DragAndDrop, 'Drag and drop', flag => { settings.DragAndDrop = flag; }); this.addchk(settings.DragGraphs, 'Drag graph points', flag => { settings.DragGraphs = flag; }); this.addSelectMenu('Progress box', ['off', 'on', 'modal'], isStr(settings.ProgressBox) ? settings.ProgressBox : (settings.ProgressBox ? 'on' : 'off'), value => { - settings.ProgressBox = (value === 'off') ? false : (value === ' on' ? true : value); + settings.ProgressBox = (value === 'off') ? false : (value === 'on' ? true : value); }); this.endsub(); diff --git a/js/modules/hist/TH2Painter.mjs b/js/modules/hist/TH2Painter.mjs index 4f2643611bf7b..468ec72d0fa4c 100644 --- a/js/modules/hist/TH2Painter.mjs +++ b/js/modules/hist/TH2Painter.mjs @@ -196,7 +196,7 @@ function drawTH2PolyLego(painter) { z1: this.draw_z0, z2: this.draw_z1, bin: this.bins_index, - value: bin.fContent, + value: tbin.fContent, color: this.tip_color, lines: p.getPolyBinTooltips(this.bins_index) }; diff --git a/js/modules/hist/TH3Painter.mjs b/js/modules/hist/TH3Painter.mjs index 02578777e0bf2..e564874c2fb4b 100644 --- a/js/modules/hist/TH3Painter.mjs +++ b/js/modules/hist/TH3Painter.mjs @@ -155,10 +155,10 @@ class TH3Painter extends THistPainter { np += w; sumx3 += w * Math.pow(xx - res.meanx, 3); sumy3 += w * Math.pow(yy - res.meany, 3); - sumz3 += w * Math.pow(zz - res.meany, 3); + sumz3 += w * Math.pow(zz - res.meanz, 3); sumx4 += w * Math.pow(xx - res.meanx, 4); sumy4 += w * Math.pow(yy - res.meany, 4); - sumz4 += w * Math.pow(yy - res.meany, 4); + sumz4 += w * Math.pow(zz - res.meanz, 4); } } } diff --git a/js/modules/hist/TPavePainter.mjs b/js/modules/hist/TPavePainter.mjs index d5353171ad34b..7b7f759c20918 100644 --- a/js/modules/hist/TPavePainter.mjs +++ b/js/modules/hist/TPavePainter.mjs @@ -292,7 +292,7 @@ class TPavePainter extends ObjectPainter { if (pt.fY1NDC > pt.fY2NDC) pt.fY2NDC = Math.min(0.995, pt.fY1NDC + stath + extrah); if (pt.fX1NDC > pt.fX2NDC) - pt.fY2NDC = Math.min(0.995, pt.fX1NDC + statw); + pt.fX2NDC = Math.min(0.995, pt.fX1NDC + statw); } } } diff --git a/js/modules/hist2d/TGraphPainter.mjs b/js/modules/hist2d/TGraphPainter.mjs index 8ac7937abdd3e..e92c0a8d26905 100644 --- a/js/modules/hist2d/TGraphPainter.mjs +++ b/js/modules/hist2d/TGraphPainter.mjs @@ -670,7 +670,7 @@ class TGraphPainter extends ObjectPainter { const line_events_handling = !this.isBatchMode() && (options.Line || options.Errors) ? 'none' : null; if (main_block && lineatt.excl_side) { - excl_width = lineatt.excl_width; + excl_width = lineatt.excl_width * lineatt.excl_side; if ((lineatt.width > 0) && !options.Line && !options.Curve) options.Line = 1; } diff --git a/js/modules/hist2d/TH1Painter.mjs b/js/modules/hist2d/TH1Painter.mjs index 1f89fd899a13f..4765ebc2be07f 100644 --- a/js/modules/hist2d/TH1Painter.mjs +++ b/js/modules/hist2d/TH1Painter.mjs @@ -106,11 +106,11 @@ class TH1Painter extends THistPainter { } } - // account overflow/underflow bins - if (is_profile) - hsum += histo.fBinEntries[0] + histo.fBinEntries[this.nbinsx + 1]; - else - hsum += histo.getBinContent(0) + histo.getBinContent(this.nbinsx + 1); + // account underflow and overflow bin, check if already was included + if (imin >= 0) + hsum += is_profile ? histo.fBinEntries[0] : histo.getBinContent(0); + if (imax <= this.nbinsx) + hsum += is_profile ? histo.fBinEntries[this.nbinsx + 1] : histo.getBinContent(this.nbinsx + 1); this.stat_entries = hsum; @@ -776,7 +776,7 @@ class TH1Painter extends THistPainter { for (i = left; i <= right; ++i) { x = xaxis.GetBinLowEdge(i + 1); - if (this.logx && (x <= 0)) + if (funcs.logx && (x <= 0)) continue; grx = Math.round(funcs.grx(x)); diff --git a/js/modules/hist2d/TH2Painter.mjs b/js/modules/hist2d/TH2Painter.mjs index aa0d056913093..b708342a156fb 100644 --- a/js/modules/hist2d/TH2Painter.mjs +++ b/js/modules/hist2d/TH2Painter.mjs @@ -1335,7 +1335,7 @@ class TH2Painter extends THistPainter { if ((print_under > 0) || (print_over > 0)) { const get = i => data.matrix[i].toFixed(0); - stat.addText(`${get(6)} | ${get(7)} | ${get(7)}`); + stat.addText(`${get(6)} | ${get(7)} | ${get(8)}`); stat.addText(`${get(3)} | ${get(4)} | ${get(5)}`); stat.addText(`${get(0)} | ${get(1)} | ${get(2)}`); } diff --git a/js/modules/hist2d/THistPainter.mjs b/js/modules/hist2d/THistPainter.mjs index 8d9d69a79710f..042ecb6775ce9 100644 --- a/js/modules/hist2d/THistPainter.mjs +++ b/js/modules/hist2d/THistPainter.mjs @@ -2613,11 +2613,11 @@ class THistPainter extends ObjectPainter { need_redraw = true; fp.fY2NDC = pal.fY1NDC - 0.01; if (fp.fY1NDC > fp.fY2NDC - 0.1) - fp.fY1NDC = Math.max(0, fp.fXYNDC - 0.1); + fp.fY1NDC = Math.max(0, fp.fY2NDC - 0.1); } else if ((pal.fY2NDC < 0.5) && (fp.fY1NDC < pal.fY2NDC)) { need_redraw = true; fp.fY1NDC = pal.fY2NDC + 0.05; - if (fp.fXYNDC < fp.fY1NDC + 0.1) + if (fp.fY2NDC < fp.fY1NDC + 0.1) fp.fY2NDC = Math.min(1, fp.fY1NDC + 0.1); } if (need_redraw && pad) { @@ -2907,7 +2907,7 @@ class THistPainter extends ObjectPainter { res = { low: err, up: err }, kind = this.getOptions().Poisson || histo.fBinStatErrOpt; - if (!kind || (histo.fSumw2.fN && histo.fTsumw !== histo.fTsumw2) || (content < 0)) + if (!kind || (histo.fSumw2?.length && histo.fTsumw !== histo.fTsumw2) || (content < 0)) return res; const alpha = (kind === kPoisson2) ? 0.05 : 1 - 0.682689492, @@ -2959,7 +2959,7 @@ class THistPainter extends ObjectPainter { }).then(() => { return painter.drawHistTitle(); }).then(() => { - if (!painter.Mode3D && painter.options.AutoZoom) + if (!painter.options.Mode3D && painter.options.AutoZoom) return painter.autoZoom(); }).then(() => { if (painter.options.Project && !painter.mode3d && isFunc(painter.toggleProjection)) diff --git a/js/modules/rntuple.mjs b/js/modules/rntuple.mjs index a35c5d0f10c5d..3e64ceb6ec01d 100644 --- a/js/modules/rntuple.mjs +++ b/js/modules/rntuple.mjs @@ -234,12 +234,11 @@ function decodeZigzag32(view) { * @private */ function decodeZigzag64(view) { for (let o = 0; o < view.byteLength; o += 8) { - const x = view.getBigUint64(o, LITTLE_ENDIAN); - view.setBigInt64(o, (x >> 1n) ^ (-(x & 1n)), LITTLE_ENDIAN); - } + const x = view.getBigUint64(o, LITTLE_ENDIAN); + view.setBigInt64(o, (x >> 1n) ^ (-(x & 1n)), LITTLE_ENDIAN); + } } - // Envelope Types // TODO: Define usage logic for envelope types in future // const kEnvelopeTypeHeader = 0x01, diff --git a/js/modules/tree.mjs b/js/modules/tree.mjs index 888671a0176c3..a4eb7c725c2fa 100644 --- a/js/modules/tree.mjs +++ b/js/modules/tree.mjs @@ -2144,6 +2144,15 @@ async function treeProcess(tree, selector, args) { if (!streamer) { elem = null; console.warn('not found streamer!'); + } else if (branch.fType === -1) { + // object written by custom streamer of the class, it has version and bytecount + member = { + name: target_name, + typename: branch.fClassName, + func(buf, obj) { + obj[this.name] = buf.classStreamer({}, this.typename); + } + }; } else { member = { name: target_name,