From 1b7d88f9d572435c337f72b4cd91fe9a26df4c4a Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Thu, 31 Oct 2024 10:49:51 +0100 Subject: [PATCH] version 7.7.5 --- build/jsroot.js | 67 ++++++++++++++++++++++++++++++++++-------------- changes.md | 2 +- modules/core.mjs | 4 +-- 3 files changed, 51 insertions(+), 22 deletions(-) diff --git a/build/jsroot.js b/build/jsroot.js index cbff307da..975d6aea8 100644 --- a/build/jsroot.js +++ b/build/jsroot.js @@ -8,11 +8,11 @@ typeof define === 'function' && define.amd ? define(['exports'], factory) : var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; /** @summary version id * @desc For the JSROOT release the string in format 'major.minor.patch' like '7.0.0' */ -const version_id = '7.7.x', +const version_id = '7.7.5', /** @summary version date * @desc Release date in format day/month/year like '14/04/2022' */ -version_date = '30/10/2024', +version_date = '31/10/2024', /** @summary version id and date * @desc Produced by concatenation of {@link version_id} and {@link version_date} @@ -2603,7 +2603,7 @@ function compareValue(compare) { } function chord() { - return chord$1(false); + return chord$1(false, false); } function chord$1(directed, transpose) { @@ -2620,7 +2620,9 @@ function chord$1(directed, transpose) { groups = new Array(n), k = 0, dx; - matrix = Float64Array.from({length: n * n}, (_, i) => matrix[i / n | 0][i % n]); + matrix = Float64Array.from({length: n * n}, transpose + ? (_, i) => matrix[i % n][i / n | 0] + : (_, i) => matrix[i / n | 0][i % n]); // Compute the scaling factor from value to angle in [0, 2pi]. for (let i = 0; i < n; ++i) { @@ -2637,7 +2639,20 @@ function chord$1(directed, transpose) { if (sortGroups) groupIndex.sort((a, b) => sortGroups(groupSums[a], groupSums[b])); for (const i of groupIndex) { const x0 = x; - { + if (directed) { + const subgroupIndex = range$1(~n + 1, n).filter(j => j < 0 ? matrix[~j * n + i] : matrix[i * n + j]); + if (sortSubgroups) subgroupIndex.sort((a, b) => sortSubgroups(a < 0 ? -matrix[~a * n + i] : matrix[i * n + a], b < 0 ? -matrix[~b * n + i] : matrix[i * n + b])); + for (const j of subgroupIndex) { + if (j < 0) { + const chord = chords[~j * n + i] || (chords[~j * n + i] = {source: null, target: null}); + chord.target = {index: i, startAngle: x, endAngle: x += matrix[~j * n + i] * k, value: matrix[~j * n + i]}; + } else { + const chord = chords[i * n + j] || (chords[i * n + j] = {source: null, target: null}); + chord.source = {index: i, startAngle: x, endAngle: x += matrix[i * n + j] * k, value: matrix[i * n + j]}; + } + } + groups[i] = {index: i, startAngle: x0, endAngle: x, value: groupSums[i]}; + } else { const subgroupIndex = range$1(0, n).filter(j => matrix[i * n + j] || matrix[j * n + i]); if (sortSubgroups) subgroupIndex.sort((a, b) => sortSubgroups(matrix[i * n + a], matrix[i * n + b])); for (const j of subgroupIndex) { @@ -2907,7 +2922,12 @@ function ribbon(headRadius) { context.moveTo(sr * cos$1(sa0), sr * sin$1(sa0)); context.arc(0, 0, sr, sa0, sa1); if (sa0 !== ta0 || sa1 !== ta1) { - { + if (headRadius) { + var hr = +headRadius.apply(this, arguments), tr2 = tr - hr, ta2 = (ta0 + ta1) / 2; + context.quadraticCurveTo(0, 0, tr2 * cos$1(ta0), tr2 * sin$1(ta0)); + context.lineTo(tr * cos$1(ta2), tr * sin$1(ta2)); + context.lineTo(tr2 * cos$1(ta1), tr2 * sin$1(ta1)); + } else { context.quadraticCurveTo(0, 0, tr * cos$1(ta0), tr * sin$1(ta0)); context.arc(0, 0, tr, ta0, ta1); } @@ -2918,6 +2938,10 @@ function ribbon(headRadius) { if (buffer) return context = null, buffer + "" || null; } + if (headRadius) ribbon.headRadius = function(_) { + return arguments.length ? (headRadius = typeof _ === "function" ? _ : constant$4(+_), ribbon) : headRadius; + }; + ribbon.radius = function(_) { return arguments.length ? (sourceRadius = targetRadius = typeof _ === "function" ? _ : constant$4(+_), ribbon) : sourceRadius; }; @@ -9805,7 +9829,7 @@ function createDefaultPalette(grayscale) { if (t < 2 / 3) return p + (q - p) * (2/3 - t) * 6; return p; }, HLStoRGB = (h, l, s) => { - const q = l + s - l * s, + const q = (l < 0.5) ? l * (1 + s) : l + s - l * s, p = 2 * l - q, r = hue2rgb(p, q, h + 1/3), g = hue2rgb(p, q, h), @@ -56017,6 +56041,13 @@ function getMaterialArgs(color$1, args) { } function createSVGRenderer(as_is, precision, doc) { + if (as_is) { + if (doc !== undefined) + globalThis.docuemnt = doc; + const rndr = new SVGRenderer(); + rndr.setPrecision(precision); + return rndr; + } const excl_style1 = ';stroke-opacity:1;stroke-width:1;stroke-linecap:round', excl_style2 = ';fill-opacity:1', @@ -56420,7 +56451,7 @@ async function createRender3D(width, height, render3d, args) { if (render3d === rc.SVG) { // SVG rendering - const r = createSVGRenderer(false, 0); + const r = createSVGRenderer(false, 0, doc); r.jsroot_dom = doc.createElementNS('http://www.w3.org/2000/svg', 'svg'); promise = Promise.resolve(r); } else if (isNodeJs()) { @@ -61682,14 +61713,14 @@ class StandaloneMenu extends JSRootMenu { * menu.addchk(flag, 'Checked', arg => console.log(`Now flag is ${arg}`)); * menu.show(); */ function createMenu(evnt, handler, menuname) { - const menu = new StandaloneMenu(handler, 'root_ctx_menu', evnt); + const menu = new StandaloneMenu(handler, menuname || 'root_ctx_menu', evnt); return menu.load(); } /** @summary Close previousely created and shown JSROOT menu * @param {string} [menuname] - optional menu name */ function closeMenu(menuname) { - const element = getDocument().getElementById('root_ctx_menu'); + const element = getDocument().getElementById(menuname || 'root_ctx_menu'); element?.remove(); return !!element; } @@ -76187,7 +76218,7 @@ let TH2Painter$2 = class TH2Painter extends THistPainter { res.wmax = 0; res.integral = stat_sum0; - if (histo.fEntries > 1) + if (histo.fEntries > 0) res.entries = histo.fEntries; res.eff_entries = stat_sumw2 ? stat_sum0*stat_sum0/stat_sumw2 : Math.abs(stat_sum0); @@ -79010,7 +79041,7 @@ function render3D(tmout) { if (tmout === -1111) { // special handling for direct SVG renderer const doc = getDocument(), - rrr = createSVGRenderer(false, 0); + rrr = createSVGRenderer(false, 0, doc); rrr.setSize(this.scene_width, this.scene_height); rrr.render(this.scene, this.camera); if (rrr.makeOuterHTML) { @@ -80808,7 +80839,7 @@ let TH1Painter$2 = class TH1Painter extends THistPainter { else hsum += histo.getBinContent(0) + histo.getBinContent(this.nbinsx + 1); - this.stat_entries = (histo.fEntries > 1) ? histo.fEntries : hsum; + this.stat_entries = hsum; this.hmin = hmin; this.hmax = hmax; @@ -80919,7 +80950,8 @@ let TH1Painter$2 = class TH1Painter extends THistPainter { right = this.getSelectIndex('x', 'right'), fp = this.getFramePainter(), res = { name: histo.fName, meanx: 0, meany: 0, rmsx: 0, rmsy: 0, integral: 0, - entries: this.stat_entries, eff_entries: 0, xmax: 0, wmax: 0, skewx: 0, skewd: 0, kurtx: 0, kurtd: 0 }, + entries: (histo.fEntries > 0) ? histo.fEntries : this.stat_entries, + eff_entries: 0, xmax: 0, wmax: 0, skewx: 0, skewd: 0, kurtx: 0, kurtd: 0 }, has_counted_stat = !fp.isAxisZoomed('x') && (Math.abs(histo.fTsumw) > 1e-300); let stat_sumw = 0, stat_sumw2 = 0, stat_sumwx = 0, stat_sumwx2 = 0, stat_sumwy = 0, stat_sumwy2 = 0, i, xx = 0, w = 0, xmax = null, wmax = null; @@ -82458,7 +82490,7 @@ class TH3Painter extends THistPainter { res.integral = stat_sum0; - if (histo.fEntries > 1) + if (histo.fEntries > 0) res.entries = histo.fEntries; res.eff_entries = stat_sumw2 ? stat_sum0*stat_sum0/stat_sumw2 : Math.abs(stat_sum0); @@ -120909,7 +120941,7 @@ class Sha256 { function sha256(message, as_hex) { const m = new Sha256(false); m.update(message); - return m.digest(); + return as_hex ? m.hex() : m.digest(); } function sha256_2(message, arr, as_hex) { @@ -126772,9 +126804,6 @@ class RH3Painter extends RHistPainter { res.integral = stat_sum0; - if (histo.fEntries > 1) - res.entries = histo.fEntries; - return res; } diff --git a/changes.md b/changes.md index c363d6305..69bd09d6e 100644 --- a/changes.md +++ b/changes.md @@ -1,6 +1,6 @@ # JSROOT changelog -## Changes in 7.7.x +## Changes in 7.7.5 1. Fix - can enable exponent only for log10 axis scale 2. Fix - proper set custom font size in latex 3. Fix - do not force style 8 for hist markers diff --git a/modules/core.mjs b/modules/core.mjs index 1331ac971..5c0f0879d 100644 --- a/modules/core.mjs +++ b/modules/core.mjs @@ -1,10 +1,10 @@ /** @summary version id * @desc For the JSROOT release the string in format 'major.minor.patch' like '7.0.0' */ -const version_id = '7.7.x', +const version_id = '7.7.5', /** @summary version date * @desc Release date in format day/month/year like '14/04/2022' */ -version_date = '30/10/2024', +version_date = '31/10/2024', /** @summary version id and date * @desc Produced by concatenation of {@link version_id} and {@link version_date}