@@ -5,13 +5,14 @@ typeof define === 'function' && define.amd ? define(['exports'], factory) :
5
5
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.JSROOT = global.JSROOT || {}));
6
6
})(this, (function (exports) { 'use strict';
7
7
8
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
8
9
/** @summary version id
9
10
* @desc For the JSROOT release the string in format 'major.minor.patch' like '7.0.0' */
10
- const version_id = '7.7.x ',
11
+ const version_id = '7.7.4 ',
11
12
12
13
/** @summary version date
13
14
* @desc Release date in format day/month/year like '14/04/2022' */
14
- version_date = '24 /09/2024',
15
+ version_date = '30 /09/2024',
15
16
16
17
/** @summary version id and date
17
18
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
@@ -29,7 +30,8 @@ internals = {
29
30
id_counter: 1
30
31
},
31
32
32
- _src = (typeof document === 'undefined' && typeof location === 'undefined' ? undefined : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('jsroot.js', document.baseURI).href));
33
+ _src = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('jsroot.js', document.baseURI).href));
34
+
33
35
34
36
/** @summary Location of JSROOT modules
35
37
* @desc Automatically detected and used to dynamically load other modules
@@ -2601,7 +2603,7 @@ function compareValue(compare) {
2601
2603
}
2602
2604
2603
2605
function chord() {
2604
- return chord$1(false);
2606
+ return chord$1(false, false );
2605
2607
}
2606
2608
2607
2609
function chord$1(directed, transpose) {
@@ -2618,7 +2620,9 @@ function chord$1(directed, transpose) {
2618
2620
groups = new Array(n),
2619
2621
k = 0, dx;
2620
2622
2621
- matrix = Float64Array.from({length: n * n}, (_, i) => matrix[i / n | 0][i % n]);
2623
+ matrix = Float64Array.from({length: n * n}, transpose
2624
+ ? (_, i) => matrix[i % n][i / n | 0]
2625
+ : (_, i) => matrix[i / n | 0][i % n]);
2622
2626
2623
2627
// Compute the scaling factor from value to angle in [0, 2pi].
2624
2628
for (let i = 0; i < n; ++i) {
@@ -2635,7 +2639,20 @@ function chord$1(directed, transpose) {
2635
2639
if (sortGroups) groupIndex.sort((a, b) => sortGroups(groupSums[a], groupSums[b]));
2636
2640
for (const i of groupIndex) {
2637
2641
const x0 = x;
2638
- {
2642
+ if (directed) {
2643
+ const subgroupIndex = range$1(~n + 1, n).filter(j => j < 0 ? matrix[~j * n + i] : matrix[i * n + j]);
2644
+ 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]));
2645
+ for (const j of subgroupIndex) {
2646
+ if (j < 0) {
2647
+ const chord = chords[~j * n + i] || (chords[~j * n + i] = {source: null, target: null});
2648
+ chord.target = {index: i, startAngle: x, endAngle: x += matrix[~j * n + i] * k, value: matrix[~j * n + i]};
2649
+ } else {
2650
+ const chord = chords[i * n + j] || (chords[i * n + j] = {source: null, target: null});
2651
+ chord.source = {index: i, startAngle: x, endAngle: x += matrix[i * n + j] * k, value: matrix[i * n + j]};
2652
+ }
2653
+ }
2654
+ groups[i] = {index: i, startAngle: x0, endAngle: x, value: groupSums[i]};
2655
+ } else {
2639
2656
const subgroupIndex = range$1(0, n).filter(j => matrix[i * n + j] || matrix[j * n + i]);
2640
2657
if (sortSubgroups) subgroupIndex.sort((a, b) => sortSubgroups(matrix[i * n + a], matrix[i * n + b]));
2641
2658
for (const j of subgroupIndex) {
@@ -2905,7 +2922,12 @@ function ribbon(headRadius) {
2905
2922
context.moveTo(sr * cos$1(sa0), sr * sin$1(sa0));
2906
2923
context.arc(0, 0, sr, sa0, sa1);
2907
2924
if (sa0 !== ta0 || sa1 !== ta1) {
2908
- {
2925
+ if (headRadius) {
2926
+ var hr = +headRadius.apply(this, arguments), tr2 = tr - hr, ta2 = (ta0 + ta1) / 2;
2927
+ context.quadraticCurveTo(0, 0, tr2 * cos$1(ta0), tr2 * sin$1(ta0));
2928
+ context.lineTo(tr * cos$1(ta2), tr * sin$1(ta2));
2929
+ context.lineTo(tr2 * cos$1(ta1), tr2 * sin$1(ta1));
2930
+ } else {
2909
2931
context.quadraticCurveTo(0, 0, tr * cos$1(ta0), tr * sin$1(ta0));
2910
2932
context.arc(0, 0, tr, ta0, ta1);
2911
2933
}
@@ -2916,6 +2938,10 @@ function ribbon(headRadius) {
2916
2938
if (buffer) return context = null, buffer + "" || null;
2917
2939
}
2918
2940
2941
+ if (headRadius) ribbon.headRadius = function(_) {
2942
+ return arguments.length ? (headRadius = typeof _ === "function" ? _ : constant$4(+_), ribbon) : headRadius;
2943
+ };
2944
+
2919
2945
ribbon.radius = function(_) {
2920
2946
return arguments.length ? (sourceRadius = targetRadius = typeof _ === "function" ? _ : constant$4(+_), ribbon) : sourceRadius;
2921
2947
};
@@ -9803,7 +9829,7 @@ function createDefaultPalette(grayscale) {
9803
9829
if (t < 2 / 3) return p + (q - p) * (2/3 - t) * 6;
9804
9830
return p;
9805
9831
}, HLStoRGB = (h, l, s) => {
9806
- const q = l + s - l * s,
9832
+ const q = (l < 0.5) ? l * (1 + s) : l + s - l * s,
9807
9833
p = 2 * l - q,
9808
9834
r = hue2rgb(p, q, h + 1/3),
9809
9835
g = hue2rgb(p, q, h),
@@ -56015,6 +56041,13 @@ function getMaterialArgs(color$1, args) {
56015
56041
}
56016
56042
56017
56043
function createSVGRenderer(as_is, precision, doc) {
56044
+ if (as_is) {
56045
+ if (doc !== undefined)
56046
+ globalThis.docuemnt = doc;
56047
+ const rndr = new SVGRenderer();
56048
+ rndr.setPrecision(precision);
56049
+ return rndr;
56050
+ }
56018
56051
56019
56052
const excl_style1 = ';stroke-opacity:1;stroke-width:1;stroke-linecap:round',
56020
56053
excl_style2 = ';fill-opacity:1',
@@ -56418,7 +56451,7 @@ async function createRender3D(width, height, render3d, args) {
56418
56451
56419
56452
if (render3d === rc.SVG) {
56420
56453
// SVG rendering
56421
- const r = createSVGRenderer(false, 0);
56454
+ const r = createSVGRenderer(false, 0, doc );
56422
56455
r.jsroot_dom = doc.createElementNS('http://www.w3.org/2000/svg', 'svg');
56423
56456
promise = Promise.resolve(r);
56424
56457
} else if (isNodeJs()) {
@@ -61680,14 +61713,14 @@ class StandaloneMenu extends JSRootMenu {
61680
61713
* menu.addchk(flag, 'Checked', arg => console.log(`Now flag is ${arg}`));
61681
61714
* menu.show(); */
61682
61715
function createMenu(evnt, handler, menuname) {
61683
- const menu = new StandaloneMenu(handler, 'root_ctx_menu', evnt);
61716
+ const menu = new StandaloneMenu(handler, menuname || 'root_ctx_menu', evnt);
61684
61717
return menu.load();
61685
61718
}
61686
61719
61687
61720
/** @summary Close previousely created and shown JSROOT menu
61688
61721
* @param {string} [menuname] - optional menu name */
61689
61722
function closeMenu(menuname) {
61690
- const element = getDocument().getElementById('root_ctx_menu');
61723
+ const element = getDocument().getElementById(menuname || 'root_ctx_menu');
61691
61724
element?.remove();
61692
61725
return !!element;
61693
61726
}
@@ -79007,7 +79040,7 @@ function render3D(tmout) {
79007
79040
if (tmout === -1111) {
79008
79041
// special handling for direct SVG renderer
79009
79042
const doc = getDocument(),
79010
- rrr = createSVGRenderer(false, 0);
79043
+ rrr = createSVGRenderer(false, 0, doc );
79011
79044
rrr.setSize(this.scene_width, this.scene_height);
79012
79045
rrr.render(this.scene, this.camera);
79013
79046
if (rrr.makeOuterHTML) {
@@ -120886,7 +120919,7 @@ class Sha256 {
120886
120919
function sha256(message, as_hex) {
120887
120920
const m = new Sha256(false);
120888
120921
m.update(message);
120889
- return m.digest();
120922
+ return as_hex ? m.hex() : m.digest();
120890
120923
}
120891
120924
120892
120925
function sha256_2(message, arr, as_hex) {
0 commit comments