@silurus/ooxml 0.80.1 → 0.80.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/assets/render-worker-CRaEOHkw.js +9 -0
- package/dist/assets/render-worker-DQGLj5Zv.js +22 -0
- package/dist/assets/render-worker-rnrSLmqL.js +8 -0
- package/dist/{canvas-viewer-mechanics-BdMdqj1R.js → canvas-viewer-mechanics-D-r6wHY_.js} +1 -1
- package/dist/{chart-number-format-tjYUR9eS.js → chart-number-format-qLhnk6hj.js} +57 -17
- package/dist/{document-pull-client-Dk2EnTL7.js → document-pull-client-vxk-Aomu.js} +38 -20
- package/dist/{docx-Dw1kxR2M.js → docx-DN0PRx2f.js} +5 -5
- package/dist/docx.mjs +3 -3
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/index.mjs +3 -3
- package/dist/{line-distribute-vYf5DWek.js → line-distribute-Bvtp0Gt6.js} +1 -1
- package/dist/{line-metrics-BY-aNaLO.js → line-metrics-DdEJYxjx.js} +3789 -2998
- package/dist/math.mjs +27 -22
- package/dist/node.mjs +7 -7
- package/dist/{pptx-CE7xARJ_.js → pptx-B-Laftl1.js} +6 -6
- package/dist/pptx.mjs +4 -4
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/region-map.mjs +29 -29
- package/dist/{render-C4IiRZiF.js → render-CoqMHcbF.js} +1 -1
- package/dist/{render-worker-host-D9mO9qMj.js → render-worker-host-CYPhmBtX.js} +1 -1
- package/dist/{render-worker-host-1VHH_HQk.js → render-worker-host-GlLR1rtF.js} +1 -1
- package/dist/{render-worker-host-BVOjz-oV.js → render-worker-host-IuQFpoJM.js} +1 -1
- package/dist/{resource-measurement-DOQetcWm.js → resource-measurement-CgMubiAI.js} +1 -1
- package/dist/{session-BYh13Iu2.js → session-DkPblDiq.js} +2 -2
- package/dist/{slide-pull-client-v6Feibq1.js → slide-pull-client-m2blvngt.js} +4 -4
- package/dist/{dash-CMzZIDz_.js → three-d-C28kqDym.js} +352 -90
- package/dist/three-d.mjs +509 -715
- package/dist/types/docx.d.ts +58 -7
- package/dist/types/index.d.ts +62 -11
- package/dist/types/node.d.ts +54 -3
- package/dist/types/pptx.d.ts +58 -7
- package/dist/types/region-map.d.ts +54 -3
- package/dist/types/three-d.d.ts +54 -3
- package/dist/types/xlsx.d.ts +58 -7
- package/dist/{worksheet-pull-client-Nk7nbD3-.js → worksheet-pull-client-BntP6RiO.js} +2 -2
- package/dist/{xlsx-zy51yoRg.js → xlsx-DqMe7J2C.js} +982 -958
- package/dist/xlsx.mjs +4 -4
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-BC6Wez97.js +0 -7
- package/dist/assets/render-worker-DidI5svV.js +0 -21
- package/dist/assets/render-worker-n3fNJ5XR.js +0 -8
package/dist/three-d.mjs
CHANGED
|
@@ -1,203 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
|
|
5
|
-
function E(e, t, n, r, i) {
|
|
6
|
-
let a = Number.isFinite(e) && e > 0 ? e : 0, o = Number.isFinite(t) ? A(t, 0, 500) : 150, s = Math.max(1, Math.trunc(r)), c = A(Math.trunc(n), 0, s - 1), l = i ? 1 : s, u = a / (l + o / 100);
|
|
7
|
-
return {
|
|
8
|
-
offset: (a - u * l) / 2 + (i ? 0 : c * u),
|
|
9
|
-
size: u
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
function D(e, t, n) {
|
|
13
|
-
if (![
|
|
14
|
-
e,
|
|
15
|
-
t,
|
|
16
|
-
n
|
|
17
|
-
].every(Number.isFinite)) return 1;
|
|
18
|
-
let r = e >= 0 ? n : t;
|
|
19
|
-
return 1 - Math.min(1, Math.abs(e) / Math.max(Number.MIN_VALUE, Math.abs(r)));
|
|
20
|
-
}
|
|
21
|
-
function O(e, t, n, r = .06) {
|
|
22
|
-
if (!t.length || t.length > 1e5 || ![
|
|
23
|
-
n.x,
|
|
24
|
-
n.y,
|
|
25
|
-
n.w,
|
|
26
|
-
n.h
|
|
27
|
-
].every(Number.isFinite) || n.w <= 0 || n.h <= 0) return e;
|
|
28
|
-
let i = t.map((t) => e.project(t.x, t.y, t.depth));
|
|
29
|
-
if (!i.every((e) => Number.isFinite(e.x) && Number.isFinite(e.y))) return e;
|
|
30
|
-
let a = Infinity, o = -Infinity, s = Infinity, c = -Infinity;
|
|
31
|
-
for (let e of i) a = Math.min(a, e.x), o = Math.max(o, e.x), s = Math.min(s, e.y), c = Math.max(c, e.y);
|
|
32
|
-
let l = o - a, u = c - s;
|
|
33
|
-
if (!(l > 2 ** -52) || !(u > 2 ** -52)) return e;
|
|
34
|
-
let d = A(k(r, .06), 0, .45), f = n.w * (1 - 2 * d), p = n.h * (1 - 2 * d), m = Math.min(f / l, p / u);
|
|
35
|
-
if (!(m > 0) || !Number.isFinite(m)) return e;
|
|
36
|
-
let h = {
|
|
37
|
-
x: (a + o) / 2,
|
|
38
|
-
y: (s + c) / 2
|
|
39
|
-
}, g = {
|
|
40
|
-
x: n.x + n.w / 2,
|
|
41
|
-
y: n.y + n.h / 2
|
|
42
|
-
}, _ = e.project, v = (e, t, n) => {
|
|
43
|
-
let r = _(e, t, n);
|
|
44
|
-
return {
|
|
45
|
-
x: g.x + (r.x - h.x) * m,
|
|
46
|
-
y: g.y + (r.y - h.y) * m
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
return {
|
|
50
|
-
...e,
|
|
51
|
-
project: v,
|
|
52
|
-
depthX: e.depthX * m,
|
|
53
|
-
depthY: e.depthY * m
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
var k = (e, t) => typeof e == "number" && Number.isFinite(e) ? e : t, A = (e, t, n) => Math.min(n, Math.max(t, e));
|
|
57
|
-
function j(e, t, n = {}) {
|
|
58
|
-
if (![
|
|
59
|
-
t.x,
|
|
60
|
-
t.y,
|
|
61
|
-
t.w,
|
|
62
|
-
t.h
|
|
63
|
-
].every(Number.isFinite) || t.w <= 0 || t.h <= 0) return null;
|
|
64
|
-
let r = A(k(e.rotationX, 15), -90, 90), i = (A(k(e.rotationY, 20), 0, 360) + 180) % 360 - 180, a = A(k(e.depthPercent, 100), 20, 2e3), o = A(k(e.perspective, 30), 0, 240), s = A(k(e.gapDepthPercent, 150), 0, 500), c = e.heightPercent != null && Number.isFinite(e.heightPercent) ? A(e.heightPercent, 5, 500) : null, l = n.sceneHeightScale != null && Number.isFinite(n.sceneHeightScale) ? A(n.sceneHeightScale * 100, 5, 500) : null, u = c ?? l, d = t;
|
|
65
|
-
if (u != null) {
|
|
66
|
-
let e = u / 100, n = Math.min(t.w, t.h / e), r = n * e;
|
|
67
|
-
d = {
|
|
68
|
-
x: t.x + (t.w - n) / 2,
|
|
69
|
-
y: t.y + (t.h - r) / 2,
|
|
70
|
-
w: n,
|
|
71
|
-
h: r
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
let f = Math.PI / 180, p = A(k(n.sceneDepthScale, .1), .01, 2), m = d.w * p * (a / 100), h = d.x + d.w / 2, g = d.y + d.h / 2, _ = -i * f, v = r * f, y = Math.cos(_), b = Math.sin(_), x = Math.cos(v), S = Math.sin(v), C = e.rightAngleAxes !== !0 && o > 0, w = A(o * .25, .25, 60) * f, T = A(k(n.perspectiveTangentGain, 2), .25, 4), E = Math.atan(T * Math.tan(w)), D = Math.hypot(d.w, d.h, m), O = C ? D * .5 / Math.tan(E) : Infinity, j = (e, t, n) => {
|
|
75
|
-
let r = e - h, i = g - t, a = (.5 - A(Number.isFinite(n) ? n : 0, 0, 1)) * m, o = y * r + b * a, s = -b * r + y * a;
|
|
76
|
-
return {
|
|
77
|
-
x: o,
|
|
78
|
-
y: x * i - S * s,
|
|
79
|
-
z: S * i + x * s
|
|
80
|
-
};
|
|
81
|
-
}, M = (e) => {
|
|
82
|
-
if (e.length < 3) return null;
|
|
83
|
-
let t = e.map((e) => j(e.x, e.y, e.depth)), n = t[0], r = null;
|
|
84
|
-
for (let e = 1; e + 1 < t.length && !r; e++) for (let i = e + 1; i < t.length; i++) {
|
|
85
|
-
let a = t[e], o = t[i], s = {
|
|
86
|
-
x: a.x - n.x,
|
|
87
|
-
y: a.y - n.y,
|
|
88
|
-
z: a.z - n.z
|
|
89
|
-
}, c = {
|
|
90
|
-
x: o.x - n.x,
|
|
91
|
-
y: o.y - n.y,
|
|
92
|
-
z: o.z - n.z
|
|
93
|
-
}, l = {
|
|
94
|
-
x: s.y * c.z - s.z * c.y,
|
|
95
|
-
y: s.z * c.x - s.x * c.z,
|
|
96
|
-
z: s.x * c.y - s.y * c.x
|
|
97
|
-
}, u = Math.hypot(l.x, l.y, l.z);
|
|
98
|
-
if (u > 2 ** -52) {
|
|
99
|
-
r = {
|
|
100
|
-
x: l.x / u,
|
|
101
|
-
y: l.y / u,
|
|
102
|
-
z: l.z / u
|
|
103
|
-
};
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return r ? {
|
|
108
|
-
normal: r,
|
|
109
|
-
centroid: t.reduce((e, n) => ({
|
|
110
|
-
x: e.x + n.x / t.length,
|
|
111
|
-
y: e.y + n.y / t.length,
|
|
112
|
-
z: e.z + n.z / t.length
|
|
113
|
-
}), {
|
|
114
|
-
x: 0,
|
|
115
|
-
y: 0,
|
|
116
|
-
z: 0
|
|
117
|
-
})
|
|
118
|
-
} : null;
|
|
119
|
-
}, N = -Infinity;
|
|
120
|
-
for (let e of [d.x, d.x + d.w]) for (let t of [d.y, d.y + d.h]) for (let n of [0, 1]) N = Math.max(N, j(e, t, n).z);
|
|
121
|
-
let P = C ? Math.max(O, N + D * .01) : Infinity, F = (e, t, n) => {
|
|
122
|
-
let r = j(e, t, n);
|
|
123
|
-
if (!C) return {
|
|
124
|
-
x: r.x,
|
|
125
|
-
y: -r.y
|
|
126
|
-
};
|
|
127
|
-
let i = P / Math.max(P * 1e-9, P - r.z);
|
|
128
|
-
return {
|
|
129
|
-
x: r.x * i,
|
|
130
|
-
y: -r.y * i
|
|
131
|
-
};
|
|
132
|
-
}, I = [];
|
|
133
|
-
for (let e of [d.x, d.x + d.w]) for (let t of [d.y, d.y + d.h]) for (let n of [0, 1]) I.push(F(e, t, n));
|
|
134
|
-
let L = Math.min(...I.map((e) => e.x)), R = Math.max(...I.map((e) => e.x)), z = Math.min(...I.map((e) => e.y)), B = Math.max(...I.map((e) => e.y)), V = Math.max(Number.MIN_VALUE, R - L), H = Math.max(Number.MIN_VALUE, B - z), U = Math.min(t.w / V, t.h / H) * .94, W = t.x + (t.w - V * U) / 2 - L * U, G = t.y + (t.h - H * U) / 2 - z * U, K = (e, t, n) => {
|
|
135
|
-
let r = F(e, t, n);
|
|
136
|
-
return {
|
|
137
|
-
x: W + r.x * U,
|
|
138
|
-
y: G + r.y * U
|
|
139
|
-
};
|
|
140
|
-
}, q = { ...d }, J = K(h, g, 0), ee = K(h, g, 1), te = ee.x - J.x, Y = ee.y - J.y, ne = (e, t) => j(e === "x" ? t === "min" ? d.x : d.x + d.w : h, e === "y" ? t === "min" ? d.y : d.y + d.h : g, e === "depth" ? t === "min" ? 0 : 1 : .5).z, re = ne("x", "min") <= ne("x", "max") ? "min" : "max", ie = ne("y", "min") <= ne("y", "max") ? "min" : "max", ae = ne("depth", "min") >= ne("depth", "max") ? 0 : 1, oe = +(ae === 0), se = (e) => {
|
|
141
|
-
let t = e === "min" ? d.x : d.x + d.w, n = K(t, d.y, ae), r = K(t, d.y + d.h, ae);
|
|
142
|
-
return (n.x + r.x) / 2;
|
|
143
|
-
}, ce = (e) => {
|
|
144
|
-
let t = e === "min" ? d.y : d.y + d.h, n = K(d.x, t, ae), r = K(d.x + d.w, t, ae);
|
|
145
|
-
return (n.y + r.y) / 2;
|
|
146
|
-
}, le = se("min") <= se("max") ? "min" : "max", ue = ce("min") >= ce("max") ? "min" : "max", de = (e) => 1 / Math.max(1, Math.trunc(e)) / (1 + s / 100), fe = (e, t, n = !1) => n || t <= 1 ? .5 : (A(Math.trunc(e), 0, Math.max(0, t - 1)) + .5) / t;
|
|
147
|
-
return {
|
|
148
|
-
scene: d,
|
|
149
|
-
front: q,
|
|
150
|
-
depthX: te,
|
|
151
|
-
depthY: Y,
|
|
152
|
-
modelDepth: m,
|
|
153
|
-
pieScaleY: A(Math.sin(Math.max(1, Math.abs(r)) * f) ** 1.15, .2, 1),
|
|
154
|
-
pieThicknessFraction: .3 * Math.max(0, Math.cos(Math.abs(r) * f)),
|
|
155
|
-
project: K,
|
|
156
|
-
cameraDepth(e, t, n) {
|
|
157
|
-
return j(e, t, n).z;
|
|
158
|
-
},
|
|
159
|
-
cameraProjectionWeight(e, t, n) {
|
|
160
|
-
if (!C) return 1;
|
|
161
|
-
let r = j(e, t, n).z;
|
|
162
|
-
return 1 / Math.max(P * 1e-9, P - r);
|
|
163
|
-
},
|
|
164
|
-
cameraFacing(e) {
|
|
165
|
-
let t = M(e);
|
|
166
|
-
if (!t) return !1;
|
|
167
|
-
let { normal: n, centroid: r } = t, i = C ? {
|
|
168
|
-
x: -r.x,
|
|
169
|
-
y: -r.y,
|
|
170
|
-
z: P - r.z
|
|
171
|
-
} : {
|
|
172
|
-
x: 0,
|
|
173
|
-
y: 0,
|
|
174
|
-
z: 1
|
|
175
|
-
}, a = n.x * i.x + n.y * i.y + n.z * i.z, o = Math.hypot(i.x, i.y, i.z);
|
|
176
|
-
return o > 0 && a > o * 1e-10;
|
|
177
|
-
},
|
|
178
|
-
cameraNormal(e) {
|
|
179
|
-
return M(e)?.normal ?? null;
|
|
180
|
-
},
|
|
181
|
-
topology: {
|
|
182
|
-
farX: re,
|
|
183
|
-
farY: ie,
|
|
184
|
-
axisX: le,
|
|
185
|
-
axisY: ue,
|
|
186
|
-
nearDepth: ae,
|
|
187
|
-
farDepth: oe
|
|
188
|
-
},
|
|
189
|
-
seriesDepth: fe,
|
|
190
|
-
prismDepth: de,
|
|
191
|
-
prismInterval(e, t, n = !1) {
|
|
192
|
-
let r = fe(e, t, n), i = de(n ? 1 : t) / 2;
|
|
193
|
-
return {
|
|
194
|
-
near: A(r - i, 0, 1),
|
|
195
|
-
far: A(r + i, 0, 1)
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
function M(e) {
|
|
1
|
+
import { C as e, S as t, _ as n, d as r, f as i, g as a, h as o, l as s, r as c, t as l, u, x as d, y as f } from "./chart-number-format-qLhnk6hj.js";
|
|
2
|
+
import { H as p, L as m, N as h, S as g, _, b as v, d as y, g as b, i as x, j as S, n as C, r as w, s as T, t as E, v as D, w as O, x as k, y as ee } from "./three-d-C28kqDym.js";
|
|
3
|
+
import { t as A } from "./renderer-module-contract-BNGz8HvO.js";
|
|
4
|
+
function j(e) {
|
|
201
5
|
switch (e) {
|
|
202
6
|
case "cylinder":
|
|
203
7
|
case "cone":
|
|
@@ -207,8 +11,8 @@ function M(e) {
|
|
|
207
11
|
default: return "box";
|
|
208
12
|
}
|
|
209
13
|
}
|
|
210
|
-
var
|
|
211
|
-
function
|
|
14
|
+
var M = (e) => Math.max(0, Math.min(1, e));
|
|
15
|
+
function N(e, t) {
|
|
212
16
|
if (t.length < 3) return null;
|
|
213
17
|
let n = e[t[0]];
|
|
214
18
|
for (let r = 1; r + 1 < t.length; r++) for (let i = r + 1; i < t.length; i++) {
|
|
@@ -233,7 +37,7 @@ function P(e, t) {
|
|
|
233
37
|
}
|
|
234
38
|
return null;
|
|
235
39
|
}
|
|
236
|
-
function
|
|
40
|
+
function P(e, t) {
|
|
237
41
|
let n = e.reduce((t, n) => ({
|
|
238
42
|
x: t.x + n.x / e.length,
|
|
239
43
|
y: t.y + n.y / e.length,
|
|
@@ -244,7 +48,7 @@ function F(e, t) {
|
|
|
244
48
|
depth: 0
|
|
245
49
|
});
|
|
246
50
|
return t.map((t) => {
|
|
247
|
-
let r =
|
|
51
|
+
let r = N(e, t.indices);
|
|
248
52
|
if (!r) return t;
|
|
249
53
|
let i = t.indices.reduce((n, r) => ({
|
|
250
54
|
x: n.x + e[r].x / t.indices.length,
|
|
@@ -265,7 +69,7 @@ function F(e, t) {
|
|
|
265
69
|
};
|
|
266
70
|
});
|
|
267
71
|
}
|
|
268
|
-
function
|
|
72
|
+
function F(e) {
|
|
269
73
|
let { horizontal: t, crossStart: n, crossSize: r, baseCoord: i, endCoord: a, nearDepth: o, farDepth: s } = e;
|
|
270
74
|
if (![
|
|
271
75
|
n,
|
|
@@ -275,7 +79,7 @@ function I(e) {
|
|
|
275
79
|
o,
|
|
276
80
|
s
|
|
277
81
|
].every(Number.isFinite) || r <= 0 || i === a || o === s) return null;
|
|
278
|
-
let c =
|
|
82
|
+
let c = j(e.shape), l = c === "cylinder" || c === "cone" || c === "coneToMax", u = c !== "box" && c !== "cylinder", d = c === "coneToMax" || c === "pyramidToMax", f = l ? Math.max(8, Math.min(64, Math.trunc(e.roundSegments ?? 32))) : 4, p = M(e.baseScale ?? (d ? e.toMaxBaseScale ?? 1 : 1)), m = M(e.endScale ?? (u ? d ? e.toMaxEndScale ?? 0 : 0 : 1));
|
|
279
83
|
if (p === 0 && m === 0) return null;
|
|
280
84
|
let h = n + r / 2, g = r / 2, _ = (o + s) / 2, v = Math.abs(s - o) / 2, y = [], b = (e, n) => {
|
|
281
85
|
if (n === 0) {
|
|
@@ -342,11 +146,11 @@ function I(e) {
|
|
|
342
146
|
return {
|
|
343
147
|
shape: c,
|
|
344
148
|
vertices: y,
|
|
345
|
-
faces:
|
|
149
|
+
faces: P(y, w),
|
|
346
150
|
silhouetteEdges: T
|
|
347
151
|
};
|
|
348
152
|
}
|
|
349
|
-
function
|
|
153
|
+
function I(e) {
|
|
350
154
|
let { x0: t, x1: n, lower0: r, lower1: i, upper0: a, upper1: o, nearDepth: s, farDepth: c, capStart: l, capEnd: u } = e;
|
|
351
155
|
if (![
|
|
352
156
|
t,
|
|
@@ -406,7 +210,7 @@ function L(e) {
|
|
|
406
210
|
return {
|
|
407
211
|
shape: "areaStrip",
|
|
408
212
|
vertices: _,
|
|
409
|
-
faces:
|
|
213
|
+
faces: P(_, [
|
|
410
214
|
{
|
|
411
215
|
indices: [
|
|
412
216
|
0,
|
|
@@ -471,17 +275,17 @@ function L(e) {
|
|
|
471
275
|
silhouetteEdges: []
|
|
472
276
|
};
|
|
473
277
|
}
|
|
474
|
-
function
|
|
278
|
+
function L(e) {
|
|
475
279
|
let t = e.upper0 - e.lower0, n = e.upper1 - e.lower1;
|
|
476
280
|
if (Number.isFinite(t) && Number.isFinite(n) && t * n < 0) {
|
|
477
281
|
let r = t / (t - n), i = e.x0 + (e.x1 - e.x0) * r, a = e.lower0 + (e.lower1 - e.lower0) * r;
|
|
478
|
-
return [
|
|
282
|
+
return [I({
|
|
479
283
|
...e,
|
|
480
284
|
x1: i,
|
|
481
285
|
lower1: a,
|
|
482
286
|
upper1: a,
|
|
483
287
|
capEnd: !1
|
|
484
|
-
}),
|
|
288
|
+
}), I({
|
|
485
289
|
...e,
|
|
486
290
|
x0: i,
|
|
487
291
|
lower0: a,
|
|
@@ -489,10 +293,10 @@ function R(e) {
|
|
|
489
293
|
capStart: !1
|
|
490
294
|
})].filter((e) => e != null);
|
|
491
295
|
}
|
|
492
|
-
let r =
|
|
296
|
+
let r = I(e);
|
|
493
297
|
return r ? [r] : [];
|
|
494
298
|
}
|
|
495
|
-
function
|
|
299
|
+
function R(e) {
|
|
496
300
|
let { centerX: t, centerY: n, centerDepth: r, radius: i, modelDepth: a, thickness: o, startAngle: s, endAngle: c } = e;
|
|
497
301
|
if (![
|
|
498
302
|
t,
|
|
@@ -584,13 +388,13 @@ function z(e) {
|
|
|
584
388
|
return {
|
|
585
389
|
shape: "pieSector",
|
|
586
390
|
vertices: m,
|
|
587
|
-
faces:
|
|
391
|
+
faces: P(m, v),
|
|
588
392
|
silhouetteEdges: h.slice(0, u ? void 0 : -1).map((e, t) => [e, g[t]])
|
|
589
393
|
};
|
|
590
394
|
}
|
|
591
395
|
//#endregion
|
|
592
396
|
//#region packages/core/src/chart/three-d-scene.ts
|
|
593
|
-
function
|
|
397
|
+
function z(e, t) {
|
|
594
398
|
if (![e, t].every(Number.isFinite)) return null;
|
|
595
399
|
let n = t - e;
|
|
596
400
|
if (n === 0) return e >= 0 && e <= 1 ? {
|
|
@@ -603,7 +407,7 @@ function B(e, t) {
|
|
|
603
407
|
endT: o
|
|
604
408
|
} : null;
|
|
605
409
|
}
|
|
606
|
-
function
|
|
410
|
+
function B(e, t, n, r) {
|
|
607
411
|
if (![
|
|
608
412
|
e,
|
|
609
413
|
t,
|
|
@@ -632,12 +436,12 @@ function V(e, t, n, r) {
|
|
|
632
436
|
}
|
|
633
437
|
return l;
|
|
634
438
|
}
|
|
635
|
-
var
|
|
439
|
+
var V = (e) => ({
|
|
636
440
|
minX: Math.min(...e.map((e) => e.x)),
|
|
637
441
|
maxX: Math.max(...e.map((e) => e.x)),
|
|
638
442
|
minY: Math.min(...e.map((e) => e.y)),
|
|
639
443
|
maxY: Math.max(...e.map((e) => e.y))
|
|
640
|
-
}),
|
|
444
|
+
}), H = (e, t) => {
|
|
641
445
|
let n = !1;
|
|
642
446
|
for (let r = 0, i = e.length - 1; r < e.length; i = r++) {
|
|
643
447
|
let a = e[r], o = e[i], s = (a.x - t.x) * (o.y - t.y) - (a.y - t.y) * (o.x - t.x), c = Math.max(1, Math.abs(a.x), Math.abs(a.y), Math.abs(o.x), Math.abs(o.y));
|
|
@@ -645,7 +449,7 @@ var H = (e) => ({
|
|
|
645
449
|
a.y > t.y != o.y > t.y && t.x < (o.x - a.x) * (t.y - a.y) / (o.y - a.y) + a.x && (n = !n);
|
|
646
450
|
}
|
|
647
451
|
return n;
|
|
648
|
-
},
|
|
452
|
+
}, U = (e, t, n, r) => {
|
|
649
453
|
let i = {
|
|
650
454
|
x: t.x - e.x,
|
|
651
455
|
y: t.y - e.y
|
|
@@ -663,23 +467,23 @@ var H = (e) => ({
|
|
|
663
467
|
y: e.y + i.y * c
|
|
664
468
|
};
|
|
665
469
|
};
|
|
666
|
-
function
|
|
470
|
+
function W(e, t, n, r) {
|
|
667
471
|
let i = [], a = (e) => {
|
|
668
472
|
i.length >= 12 || i.some((t) => Math.hypot(t.x - e.x, t.y - e.y) < 1e-7) || i.push(e);
|
|
669
473
|
}, o = {
|
|
670
474
|
x: (Math.max(n.minX, r.minX) + Math.min(n.maxX, r.maxX)) / 2,
|
|
671
475
|
y: (Math.max(n.minY, r.minY) + Math.min(n.maxY, r.maxY)) / 2
|
|
672
476
|
};
|
|
673
|
-
|
|
674
|
-
for (let n of e)
|
|
675
|
-
for (let n of t)
|
|
477
|
+
H(e, o) && H(t, o) && a(o);
|
|
478
|
+
for (let n of e) H(t, n) && a(n);
|
|
479
|
+
for (let n of t) H(e, n) && a(n);
|
|
676
480
|
for (let n = 0; n < e.length && i.length < 12; n++) for (let r = 0; r < t.length && i.length < 12; r++) {
|
|
677
|
-
let i =
|
|
481
|
+
let i = U(e[n], e[(n + 1) % e.length], t[r], t[(r + 1) % t.length]);
|
|
678
482
|
i && a(i);
|
|
679
483
|
}
|
|
680
484
|
return i;
|
|
681
485
|
}
|
|
682
|
-
function
|
|
486
|
+
function G(e, t) {
|
|
683
487
|
let n = e.cameraDepths;
|
|
684
488
|
if (!n || n.length !== e.points.length || e.points.length < 3) return e.cameraDepth;
|
|
685
489
|
let r = e.cameraWeights?.length === e.points.length ? e.cameraWeights : e.points.map(() => 1), i = e.points[0];
|
|
@@ -693,17 +497,17 @@ function K(e, t) {
|
|
|
693
497
|
}
|
|
694
498
|
return e.cameraDepth;
|
|
695
499
|
}
|
|
696
|
-
function
|
|
500
|
+
function K(e) {
|
|
697
501
|
if (e.length < 2) return [...e];
|
|
698
|
-
let t = [...e.keys()].sort((t, n) => e[t].cameraDepth - e[n].cameraDepth || t - n), n = e.map((e) =>
|
|
502
|
+
let t = [...e.keys()].sort((t, n) => e[t].cameraDepth - e[n].cameraDepth || t - n), n = e.map((e) => V(e.points)), r = [...e.keys()].sort((e, t) => n[e].minX - n[t].minX || e - t), i = e.map(() => /* @__PURE__ */ new Set()), a = e.map(() => 0), o = [], s = 0;
|
|
699
503
|
for (let c of r) {
|
|
700
504
|
for (let e = o.length - 1; e >= 0; e--) n[o[e]].maxX < n[c].minX - 1e-9 && o.splice(e, 1);
|
|
701
505
|
for (let r of o) {
|
|
702
506
|
if (++s > 2e5) return t.map((t) => e[t]);
|
|
703
507
|
if (n[r].maxY < n[c].minY - 1e-9 || n[c].maxY < n[r].minY - 1e-9) continue;
|
|
704
|
-
let o =
|
|
508
|
+
let o = W(e[r].points, e[c].points, n[r], n[c]), l = 0;
|
|
705
509
|
for (let t of o) {
|
|
706
|
-
let n =
|
|
510
|
+
let n = G(e[r], t) - G(e[c], t), i = 1e-8 * Math.max(1, Math.abs(e[r].cameraDepth), Math.abs(e[c].cameraDepth));
|
|
707
511
|
if (Math.abs(n) <= i) continue;
|
|
708
512
|
let a = n < 0 ? -1 : 1;
|
|
709
513
|
if (l !== 0 && l !== a) {
|
|
@@ -729,29 +533,29 @@ function q(e) {
|
|
|
729
533
|
}
|
|
730
534
|
//#endregion
|
|
731
535
|
//#region packages/core/src/chart/three-d-stroke.ts
|
|
732
|
-
var
|
|
536
|
+
var q = 1e-9, te = 1e4, ne = (e, t, n) => ({
|
|
733
537
|
x: e.x + (t.x - e.x) * n,
|
|
734
538
|
y: e.y + (t.y - e.y) * n,
|
|
735
539
|
cameraDepth: e.cameraDepth + (t.cameraDepth - e.cameraDepth) * n,
|
|
736
540
|
cameraWeight: (e.cameraWeight ?? 1) + ((t.cameraWeight ?? 1) - (e.cameraWeight ?? 1)) * n
|
|
737
|
-
}),
|
|
738
|
-
function
|
|
739
|
-
let r = t.filter((e) => Number.isFinite(e) && e >
|
|
541
|
+
}), J = (e, t) => Math.hypot(e.x - t.x, e.y - t.y) <= q;
|
|
542
|
+
function re(e, t, n = 0) {
|
|
543
|
+
let r = t.filter((e) => Number.isFinite(e) && e > q);
|
|
740
544
|
if (r.length === 0) return e.length >= 2 ? [[...e]] : [];
|
|
741
545
|
r.length % 2 == 1 && r.push(...r);
|
|
742
|
-
let i = [], a = 0, o = r[0], s = !0, c = r.reduce((e, t) => e + t, 0), l = c >
|
|
743
|
-
for (; l >
|
|
546
|
+
let i = [], a = 0, o = r[0], s = !0, c = r.reduce((e, t) => e + t, 0), l = c > q && Number.isFinite(n) ? (n % c + c) % c : 0;
|
|
547
|
+
for (; l > q;) {
|
|
744
548
|
let e = Math.min(l, o);
|
|
745
|
-
l -= e, o -= e, o <=
|
|
549
|
+
l -= e, o -= e, o <= q && (a = (a + 1) % r.length, o = r[a], s = a % 2 == 0);
|
|
746
550
|
}
|
|
747
551
|
let u = null;
|
|
748
552
|
for (let t = 0; t + 1 < e.length; t++) {
|
|
749
553
|
let n = e[t], c = e[t + 1], l = Math.hypot(c.x - n.x, c.y - n.y);
|
|
750
|
-
if (!(l >
|
|
554
|
+
if (!(l > q)) continue;
|
|
751
555
|
let d = 0;
|
|
752
|
-
for (; d < l -
|
|
753
|
-
let e = Math.min(o, l - d), t =
|
|
754
|
-
if (s && (u ??= [], (u.length === 0 || !
|
|
556
|
+
for (; d < l - q;) {
|
|
557
|
+
let e = Math.min(o, l - d), t = ne(n, c, d / l), f = ne(n, c, (d + e) / l);
|
|
558
|
+
if (s && (u ??= [], (u.length === 0 || !J(u.at(-1), t)) && u.push(t), u.push(f)), d += e, o -= e, o <= q) {
|
|
755
559
|
if (s && u && u.length >= 2) {
|
|
756
560
|
if (i.length >= 1e4) return null;
|
|
757
561
|
i.push(u);
|
|
@@ -764,13 +568,13 @@ function ne(e, t, n = 0) {
|
|
|
764
568
|
if (i.length >= 1e4) return null;
|
|
765
569
|
i.push(u);
|
|
766
570
|
}
|
|
767
|
-
if (i.length > 1 &&
|
|
571
|
+
if (i.length > 1 && J(e[0], e.at(-1)) && J(i[0][0], e[0]) && J(i.at(-1).at(-1), e.at(-1))) {
|
|
768
572
|
let e = i.shift(), t = i.pop();
|
|
769
573
|
i.unshift([...t, ...e.slice(1)]);
|
|
770
574
|
}
|
|
771
575
|
return i;
|
|
772
576
|
}
|
|
773
|
-
var
|
|
577
|
+
var Y = (e, t) => ({
|
|
774
578
|
kind: e,
|
|
775
579
|
points: t.map(({ x: e, y: t }) => ({
|
|
776
580
|
x: e,
|
|
@@ -789,17 +593,17 @@ var re = (e, t) => ({
|
|
|
789
593
|
y: e.y + Math.sin(i) * t
|
|
790
594
|
});
|
|
791
595
|
}
|
|
792
|
-
return
|
|
596
|
+
return Y(n, r);
|
|
793
597
|
};
|
|
794
598
|
function ae(e, t, n) {
|
|
795
599
|
let r = Number.isFinite(n.width) ? Math.max(0, n.width) : 0;
|
|
796
|
-
if (!(r >
|
|
600
|
+
if (!(r > q) || t.length < 3) return null;
|
|
797
601
|
let i = r / 2;
|
|
798
602
|
if ((n.lineJoin ?? "miter") === "round") return ie(e, i, "join");
|
|
799
603
|
let a = [];
|
|
800
604
|
for (let n of t) {
|
|
801
605
|
let t = n.x - e.x, r = n.y - e.y, o = Math.hypot(t, r);
|
|
802
|
-
if (!(o >
|
|
606
|
+
if (!(o > q)) continue;
|
|
803
607
|
let s = -r / o * i, c = t / o * i;
|
|
804
608
|
a.push({
|
|
805
609
|
...e,
|
|
@@ -815,20 +619,20 @@ function ae(e, t, n) {
|
|
|
815
619
|
a.sort((e, t) => e.x - t.x || e.y - t.y);
|
|
816
620
|
let o = (e, t, n) => (t.x - e.x) * (n.y - e.y) - (t.y - e.y) * (n.x - e.x), s = [];
|
|
817
621
|
for (let e of a) {
|
|
818
|
-
for (; s.length >= 2 && o(s.at(-2), s.at(-1), e) <=
|
|
622
|
+
for (; s.length >= 2 && o(s.at(-2), s.at(-1), e) <= q;) s.pop();
|
|
819
623
|
s.push(e);
|
|
820
624
|
}
|
|
821
625
|
let c = [];
|
|
822
626
|
for (let e of [...a].reverse()) {
|
|
823
|
-
for (; c.length >= 2 && o(c.at(-2), c.at(-1), e) <=
|
|
627
|
+
for (; c.length >= 2 && o(c.at(-2), c.at(-1), e) <= q;) c.pop();
|
|
824
628
|
c.push(e);
|
|
825
629
|
}
|
|
826
630
|
let l = [...s.slice(0, -1), ...c.slice(0, -1)];
|
|
827
|
-
return l.length >= 3 ?
|
|
631
|
+
return l.length >= 3 ? Y("join", l) : null;
|
|
828
632
|
}
|
|
829
633
|
var oe = (e, t, n, r) => {
|
|
830
634
|
let i = t.x * r.y - t.y * r.x;
|
|
831
|
-
if (Math.abs(i) <=
|
|
635
|
+
if (Math.abs(i) <= q) return null;
|
|
832
636
|
let a = {
|
|
833
637
|
x: n.x - e.x,
|
|
834
638
|
y: n.y - e.y
|
|
@@ -840,15 +644,15 @@ var oe = (e, t, n, r) => {
|
|
|
840
644
|
};
|
|
841
645
|
function se(e, t) {
|
|
842
646
|
let n = Number.isFinite(t.width) ? Math.max(0, t.width) : 0;
|
|
843
|
-
if (!(n >
|
|
844
|
-
let r = n / 2, i = t.lineCap ?? "butt", a = t.lineJoin ?? "miter", o = Math.max(1, t.miterLimit ?? 10), s = [], c =
|
|
647
|
+
if (!(n > q) || e.length < 2) return [];
|
|
648
|
+
let r = n / 2, i = t.lineCap ?? "butt", a = t.lineJoin ?? "miter", o = Math.max(1, t.miterLimit ?? 10), s = [], c = re(e, t.dash ?? [], t.dashOffset);
|
|
845
649
|
if (c == null) return null;
|
|
846
650
|
let l = (e) => s.length >= 1e4 ? !1 : (s.push(e), !0);
|
|
847
651
|
for (let n = 0; n < c.length; n++) {
|
|
848
|
-
let s = c[n], u = s.length > 2 &&
|
|
652
|
+
let s = c[n], u = s.length > 2 && J(s[0], s.at(-1)), d = n === 0 && J(s[0], e[0]) ? t.startCap ?? i : i, f = n + 1 === c.length && J(s.at(-1), e.at(-1)) ? t.endCap ?? i : i, p = [];
|
|
849
653
|
for (let e = 0; e + 1 < s.length; e++) {
|
|
850
654
|
let t = s[e], n = s[e + 1], r = Math.hypot(n.x - t.x, n.y - t.y);
|
|
851
|
-
p.push(r >
|
|
655
|
+
p.push(r > q ? {
|
|
852
656
|
x: (n.x - t.x) / r,
|
|
853
657
|
y: (n.y - t.y) / r
|
|
854
658
|
} : null);
|
|
@@ -868,7 +672,7 @@ function se(e, t) {
|
|
|
868
672
|
x: s[e + 1].x + n.x * _,
|
|
869
673
|
y: s[e + 1].y + n.y * _
|
|
870
674
|
};
|
|
871
|
-
if (!l(
|
|
675
|
+
if (!l(Y("segment", [
|
|
872
676
|
{
|
|
873
677
|
...v,
|
|
874
678
|
x: v.x + i.x,
|
|
@@ -895,7 +699,7 @@ function se(e, t) {
|
|
|
895
699
|
let m = (e, t, n) => {
|
|
896
700
|
if (!t || !n) return !0;
|
|
897
701
|
let i = t.x * n.y - t.y * n.x;
|
|
898
|
-
if (Math.abs(i) <=
|
|
702
|
+
if (Math.abs(i) <= q) return !0;
|
|
899
703
|
if (a === "round") return l(ie(e, r, "join"));
|
|
900
704
|
let s = i > 0 ? -1 : 1, c = {
|
|
901
705
|
...e,
|
|
@@ -908,7 +712,7 @@ function se(e, t) {
|
|
|
908
712
|
};
|
|
909
713
|
if (a === "miter") {
|
|
910
714
|
let i = oe(c, t, u, n);
|
|
911
|
-
if (i && Math.hypot(i.x - e.x, i.y - e.y) <= r * o) return !!l(
|
|
715
|
+
if (i && Math.hypot(i.x - e.x, i.y - e.y) <= r * o) return !!l(Y("join", [
|
|
912
716
|
c,
|
|
913
717
|
{
|
|
914
718
|
...e,
|
|
@@ -917,7 +721,7 @@ function se(e, t) {
|
|
|
917
721
|
u
|
|
918
722
|
]));
|
|
919
723
|
}
|
|
920
|
-
return l(
|
|
724
|
+
return l(Y("join", [
|
|
921
725
|
c,
|
|
922
726
|
e,
|
|
923
727
|
u
|
|
@@ -1014,14 +818,14 @@ function me(e) {
|
|
|
1014
818
|
}
|
|
1015
819
|
//#endregion
|
|
1016
820
|
//#region packages/core/src/chart/three-d-renderer.ts
|
|
1017
|
-
var
|
|
821
|
+
var X = [
|
|
1018
822
|
"4472C4",
|
|
1019
823
|
"ED7D31",
|
|
1020
824
|
"70AD47",
|
|
1021
825
|
"A5A5A5",
|
|
1022
826
|
"FFC000",
|
|
1023
827
|
"5B9BD5"
|
|
1024
|
-
],
|
|
828
|
+
], he = new Set([
|
|
1025
829
|
"line",
|
|
1026
830
|
"stackedLine",
|
|
1027
831
|
"stackedLinePct",
|
|
@@ -1035,11 +839,11 @@ var he = [
|
|
|
1035
839
|
"stackedBarPct",
|
|
1036
840
|
"stackedBarHPct"
|
|
1037
841
|
]);
|
|
1038
|
-
function
|
|
1039
|
-
let n = Number.isFinite(t) && t > 0 ? t /
|
|
842
|
+
function ge(e, t) {
|
|
843
|
+
let n = Number.isFinite(t) && t > 0 ? t / h : 1, r = Number.isFinite(e) && e >= 0 ? e / S : 0;
|
|
1040
844
|
return Math.max(.25, r) * n;
|
|
1041
845
|
}
|
|
1042
|
-
function
|
|
846
|
+
function _e(e, t) {
|
|
1043
847
|
let n = Number.isSafeInteger(t) && t > 0 ? t : 0, r = Array.from({ length: n }, () => []);
|
|
1044
848
|
for (let t of e) {
|
|
1045
849
|
let e = t.categoryIndex;
|
|
@@ -1047,19 +851,13 @@ function ve(e, t) {
|
|
|
1047
851
|
}
|
|
1048
852
|
return r;
|
|
1049
853
|
}
|
|
1050
|
-
var
|
|
1051
|
-
function
|
|
854
|
+
var ve = (e, t) => `#${t?.color ?? X[e % X.length]}`;
|
|
855
|
+
function ye(e, t) {
|
|
1052
856
|
if (t?.lineHidden != null || t?.lineColor != null || t?.lineWidthEmu != null || t?.lineDash != null) return t.lineHidden !== !0;
|
|
1053
857
|
let n = e.chartexStyle;
|
|
1054
858
|
return (e.lineHidden != null || e.lineColor != null || e.lineWidthEmu != null || n?.lineHidden != null || n?.lineNoStyle != null || n?.lineColors != null || n?.lineWidthEmu != null || n?.lineDash != null || n?.lineCap != null || n?.lineJoin != null) && e.lineHidden !== !0 && n?.lineHidden !== !0;
|
|
1055
859
|
}
|
|
1056
|
-
function
|
|
1057
|
-
let n = e.replace(/^#/, "");
|
|
1058
|
-
if (!/^[0-9a-f]{6}$/i.test(n)) return e;
|
|
1059
|
-
let r = (e) => Math.max(0, Math.min(255, Math.round(parseInt(n.slice(e, e + 2), 16) * t))).toString(16).padStart(2, "0");
|
|
1060
|
-
return `#${r(0)}${r(2)}${r(4)}`;
|
|
1061
|
-
}
|
|
1062
|
-
function Se(e, t) {
|
|
860
|
+
function be(e, t) {
|
|
1063
861
|
let n = e.cameraNormal(t);
|
|
1064
862
|
if (!n) return 1;
|
|
1065
863
|
let r = {
|
|
@@ -1069,20 +867,20 @@ function Se(e, t) {
|
|
|
1069
867
|
}, i = Math.hypot(r.x, r.y, r.z), a = Math.max(0, (n.x * r.x + n.y * r.y + n.z * r.z) / i);
|
|
1070
868
|
return Math.max(.78, Math.min(1, .78 + .24 * a));
|
|
1071
869
|
}
|
|
1072
|
-
var
|
|
1073
|
-
function
|
|
870
|
+
var xe = (e) => `"${e && !e.startsWith("+") ? e.replace(/["\\]/g, "") : "Arial"}"`, Z = (e, t, n = "minor") => xe((t?.startsWith("+mj-") ? e.themeMajorFontLatin : t?.startsWith("+mn-") ? e.themeMinorFontLatin : t) ?? (n === "major" ? e.themeMajorFontLatin : e.themeMinorFontLatin));
|
|
871
|
+
function Se(e, t) {
|
|
1074
872
|
if (t.length) {
|
|
1075
873
|
e.beginPath(), e.moveTo(t[0].x, t[0].y);
|
|
1076
874
|
for (let n = 1; n < t.length; n++) e.lineTo(t[n].x, t[n].y);
|
|
1077
875
|
e.closePath();
|
|
1078
876
|
}
|
|
1079
877
|
}
|
|
1080
|
-
var
|
|
1081
|
-
function
|
|
1082
|
-
|
|
878
|
+
var Ce = (e) => e === "transparent" || e === "#00000000" || e === "rgba(0,0,0,0)";
|
|
879
|
+
function we(e, t, n, r) {
|
|
880
|
+
Ce(n) || (Se(e, t), e.fillStyle = n, e.fill(), r > 0 && (Se(e, t), e.fillStyle = `rgba(0,0,0,${r})`, e.fill()));
|
|
1083
881
|
}
|
|
1084
|
-
function
|
|
1085
|
-
return
|
|
882
|
+
function Te(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
883
|
+
return L({
|
|
1086
884
|
x0: t,
|
|
1087
885
|
x1: n,
|
|
1088
886
|
lower0: r,
|
|
@@ -1093,13 +891,13 @@ function De(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
|
1093
891
|
farDepth: c,
|
|
1094
892
|
capStart: u,
|
|
1095
893
|
capEnd: d
|
|
1096
|
-
}).flatMap((t) =>
|
|
894
|
+
}).flatMap((t) => De(e, t, l).map((e) => ({
|
|
1097
895
|
...e,
|
|
1098
896
|
outline: !1,
|
|
1099
897
|
outlineSegments: void 0
|
|
1100
898
|
})));
|
|
1101
899
|
}
|
|
1102
|
-
function
|
|
900
|
+
function Ee(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m = !1, h = !1, g, _) {
|
|
1103
901
|
if (![
|
|
1104
902
|
r,
|
|
1105
903
|
i,
|
|
@@ -1110,7 +908,7 @@ function Oe(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m = !1, h = !1, g, _) {
|
|
|
1110
908
|
l,
|
|
1111
909
|
u
|
|
1112
910
|
].every(Number.isFinite) || a <= 0 || o <= 0 || s === c) return [];
|
|
1113
|
-
let v =
|
|
911
|
+
let v = F({
|
|
1114
912
|
shape: t,
|
|
1115
913
|
horizontal: n,
|
|
1116
914
|
crossStart: n ? i : r,
|
|
@@ -1124,9 +922,9 @@ function Oe(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m = !1, h = !1, g, _) {
|
|
|
1124
922
|
omitBaseCap: m,
|
|
1125
923
|
omitEndCap: h
|
|
1126
924
|
});
|
|
1127
|
-
return v ?
|
|
925
|
+
return v ? De(e, v, d, g, _) : [];
|
|
1128
926
|
}
|
|
1129
|
-
function
|
|
927
|
+
function De(e, t, n, r, i, a = !1) {
|
|
1130
928
|
if (i?.exceeded) return [];
|
|
1131
929
|
let o = t.faces.map((r) => {
|
|
1132
930
|
let i = r.indices.map((e) => t.vertices[e]), a = e.cameraFacing(i);
|
|
@@ -1148,7 +946,7 @@ function ke(e, t, n, r, i, a = !1) {
|
|
|
1148
946
|
facing: a,
|
|
1149
947
|
face: {
|
|
1150
948
|
points: o,
|
|
1151
|
-
color:
|
|
949
|
+
color: T(n, be(e, i)),
|
|
1152
950
|
shade: 0,
|
|
1153
951
|
cameraDepth: i.reduce((t, n) => t + e.cameraDepth(n.x, n.y, n.depth), 0) / i.length,
|
|
1154
952
|
cameraDepths: i.map((t) => e.cameraDepth(t.x, t.y, t.depth)),
|
|
@@ -1245,7 +1043,7 @@ function ke(e, t, n, r, i, a = !1) {
|
|
|
1245
1043
|
}
|
|
1246
1044
|
return s;
|
|
1247
1045
|
}
|
|
1248
|
-
function
|
|
1046
|
+
function Oe(e, t, n, r, i, a, o) {
|
|
1249
1047
|
if (!t.length || o.exceeded) return [];
|
|
1250
1048
|
let s = [...t].sort((e, t) => e.start - t.start), c = n - i / 2, l = n + i / 2, u = s[0], d = e.cameraDepth(u.centerX, c, u.centerDepth) >= e.cameraDepth(u.centerX, l, u.centerDepth) ? c : l, f = d === c ? l : c, p = (t, n, i) => ({
|
|
1251
1049
|
x: t.centerX + Math.cos(n) * r,
|
|
@@ -1336,31 +1134,27 @@ function Ae(e, t, n, r, i, a, o) {
|
|
|
1336
1134
|
for (let { slice: e, angle: t } of C.values()) g([p(e, t, d), p(e, t, f)]);
|
|
1337
1135
|
return h;
|
|
1338
1136
|
}
|
|
1339
|
-
function
|
|
1340
|
-
|
|
1137
|
+
function ke(e, t) {
|
|
1138
|
+
we(e, t.points, t.color, t.shade), t.outline && (e.strokeStyle = t.outlineColor ?? "rgba(0,0,0,0.42)", e.lineWidth = t.outlineWidth ?? .75, e.setLineDash(y(t.outlineDash ?? "solid", e.lineWidth)), e.lineCap = t.outlineCap ?? "butt", e.lineJoin = t.outlineJoin ?? "miter", t.outline && (Se(e, t.points), e.stroke()), e.setLineDash([]));
|
|
1341
1139
|
}
|
|
1342
|
-
function
|
|
1343
|
-
t.points.length < 3 ||
|
|
1140
|
+
function Ae(e, t, n) {
|
|
1141
|
+
t.points.length < 3 || Ce(n) || (Se(e, t.points), e.fillStyle = n, e.fill());
|
|
1344
1142
|
}
|
|
1345
|
-
function
|
|
1143
|
+
function je(e, t) {
|
|
1346
1144
|
e.fillStyle = "#888", e.font = "12px sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText("(too many data points)", t.x + t.w / 2, t.y + t.h / 2);
|
|
1347
1145
|
}
|
|
1348
|
-
function
|
|
1349
|
-
let i = Math.max(0, t - 1), a = Number.isFinite(e) ? Math.max(0, Math.min(i, e)) : 0, o = n ? (a + .5) / Math.max(1, t) : t === 1 ? .5 : a / i;
|
|
1350
|
-
return r ? 1 - o : o;
|
|
1351
|
-
}
|
|
1352
|
-
function Pe(e) {
|
|
1146
|
+
function Me(e) {
|
|
1353
1147
|
let t = e.catAxisLabelRotation;
|
|
1354
1148
|
return t == null ? null : !Number.isFinite(t) || Math.abs(t) > 54e5 ? 0 : t / 6e4 * Math.PI / 180;
|
|
1355
1149
|
}
|
|
1356
|
-
function
|
|
1150
|
+
function Ne(e, t, n, r, i, a = 1, o = 6) {
|
|
1357
1151
|
if (i || r === 0) {
|
|
1358
1152
|
e.textAlign = i ? "right" : "center", e.textBaseline = i ? "middle" : a < 0 ? "bottom" : "top", e.fillText(t, n.x + (i ? -o : 0), n.y + (i ? 0 : a * o));
|
|
1359
1153
|
return;
|
|
1360
1154
|
}
|
|
1361
1155
|
e.save(), e.translate(n.x, n.y + a * o), e.rotate(r), e.textAlign = a < 0 ? "left" : "right", e.textBaseline = "middle", e.fillText(t, 0, 0), e.restore();
|
|
1362
1156
|
}
|
|
1363
|
-
function
|
|
1157
|
+
function Pe(e, t, n, r, i, a, o) {
|
|
1364
1158
|
if (!(r > 0) || !Number.isFinite(t.x) || !Number.isFinite(t.y)) return;
|
|
1365
1159
|
let s = r / 2;
|
|
1366
1160
|
switch (e.beginPath(), n) {
|
|
@@ -1401,97 +1195,97 @@ function Ie(e, t, n, r, i, a, o) {
|
|
|
1401
1195
|
}
|
|
1402
1196
|
i !== "transparent" && (e.fillStyle = i, e.fill()), e.strokeStyle = a, e.lineWidth = o, e.stroke();
|
|
1403
1197
|
}
|
|
1404
|
-
function
|
|
1405
|
-
let
|
|
1406
|
-
if (
|
|
1407
|
-
let
|
|
1408
|
-
customText:
|
|
1409
|
-
showCategory:
|
|
1410
|
-
showSeries:
|
|
1411
|
-
showValue:
|
|
1412
|
-
showPercent:
|
|
1198
|
+
function Fe(e, t, n, r, i, a, o, s, c, l = 0, u, d, p = "t", m = o, h = !0, g) {
|
|
1199
|
+
let y = d;
|
|
1200
|
+
if (y?.deleted) return;
|
|
1201
|
+
let x = n.seriesDataLabels, C = y?.showVal ?? x?.showVal ?? t.showDataLabels, w = y?.showCatName ?? x?.showCatName ?? !1, T = y?.showSerName ?? x?.showSerName ?? !1, E = y?.showPercent ?? x?.showPercent ?? !1, D = y?.text, O = ee({
|
|
1202
|
+
customText: D,
|
|
1203
|
+
showCategory: w,
|
|
1204
|
+
showSeries: T,
|
|
1205
|
+
showValue: C,
|
|
1206
|
+
showPercent: E,
|
|
1413
1207
|
category: n.categories?.[i] ?? t.categories[i] ?? `${i + 1}`,
|
|
1414
1208
|
seriesName: n.name || `Series ${r + 1}`,
|
|
1415
1209
|
sourceValue: a,
|
|
1416
|
-
valueDivisor:
|
|
1210
|
+
valueDivisor: g?.divisor,
|
|
1417
1211
|
percentRatio: u != null && Number.isFinite(u) ? u : void 0,
|
|
1418
|
-
formatCode:
|
|
1419
|
-
percentFormatCode:
|
|
1212
|
+
formatCode: y?.formatCode ?? x?.formatCode ?? t.dataLabelFormatCode ?? n.valFormatCode,
|
|
1213
|
+
percentFormatCode: y?.formatCode ?? x?.formatCode ?? t.dataLabelFormatCode ?? "0%",
|
|
1420
1214
|
date1904: t.date1904,
|
|
1421
|
-
separator:
|
|
1215
|
+
separator: y?.separator ?? x?.separator
|
|
1422
1216
|
});
|
|
1423
|
-
if (!
|
|
1424
|
-
let
|
|
1425
|
-
e.font = `${
|
|
1426
|
-
let
|
|
1427
|
-
runs:
|
|
1217
|
+
if (!O) return;
|
|
1218
|
+
let A = f(y?.fontSizeHpt ?? x?.fontSizeHpt ?? t.dataLabelFontSizeHpt, c) ?? 9 * c, j = y?.fontBold ?? x?.fontBold ?? t.dataLabelFontBold ?? !1, M = Z(t, y?.fontFace ?? x?.fontFace ?? t.dataLabelFontFace);
|
|
1219
|
+
e.font = `${j ? "bold " : ""}${A}px ${M}`;
|
|
1220
|
+
let N = `#${y?.fontColor ?? x?.fontColor ?? n.labelColor ?? t.dataLabelFontColor ?? "111111"}`, P = D && y?.richRuns?.length ? k(e, {
|
|
1221
|
+
runs: y.richRuns,
|
|
1428
1222
|
ptToPx: c,
|
|
1429
|
-
fontFamily:
|
|
1430
|
-
fallbackBold:
|
|
1431
|
-
fontFamilyForFace: (e) =>
|
|
1432
|
-
},
|
|
1433
|
-
if (!
|
|
1434
|
-
let
|
|
1223
|
+
fontFamily: M,
|
|
1224
|
+
fallbackBold: j,
|
|
1225
|
+
fontFamilyForFace: (e) => Z(t, e)
|
|
1226
|
+
}, A, N) : null, F = P ? [] : b(O, Math.max(A, s.w * .45), Math.max(A * 1.2, s.h * .35), A * 1.2, (t) => e.measureText(t).width);
|
|
1227
|
+
if (!P && !F.length) return;
|
|
1228
|
+
let I = P?.width ?? Math.max(...F.map((t) => e.measureText(t).width)), L = P?.height ?? F.length * A * 1.2, R = _({
|
|
1435
1229
|
kind: "point",
|
|
1436
1230
|
x: o.x,
|
|
1437
1231
|
y: o.y,
|
|
1438
|
-
position:
|
|
1232
|
+
position: y?.position ?? x?.position ?? t.dataLabelPosition ?? p,
|
|
1439
1233
|
markerGap: l
|
|
1440
1234
|
}, s, {
|
|
1441
|
-
w:
|
|
1442
|
-
h:
|
|
1443
|
-
},
|
|
1444
|
-
if (!
|
|
1445
|
-
let
|
|
1446
|
-
if (
|
|
1447
|
-
v(e,
|
|
1235
|
+
w: I,
|
|
1236
|
+
h: L
|
|
1237
|
+
}, A, y?.manualLayout, s);
|
|
1238
|
+
if (!R) return;
|
|
1239
|
+
let z = y?.labelBox ?? x?.labelBox;
|
|
1240
|
+
if (x?.showLeaderLines && h && (e.beginPath(), e.moveTo(m.x, m.y), e.lineTo(Math.max(R.rect.x, Math.min(m.x, R.rect.x + R.rect.w)), Math.max(R.rect.y, Math.min(m.y, R.rect.y + R.rect.h))), e.strokeStyle = `#${x.leaderLineColor ?? "808080"}`, e.lineWidth = x.leaderLineWidthEmu == null ? .75 * c : Math.max(.25, x.leaderLineWidthEmu / S * c), e.stroke()), z && (z.fill && (e.fillStyle = `#${z.fill}`, e.fillRect(R.rect.x, R.rect.y, R.rect.w, R.rect.h)), z.borderColor && (e.strokeStyle = `#${z.borderColor}`, e.lineWidth = z.borderWidthEmu == null ? .75 * c : Math.max(.25, z.borderWidthEmu / S * c), e.strokeRect(R.rect.x, R.rect.y, R.rect.w, R.rect.h))), e.save(), e.beginPath(), e.rect(R.clip.x, R.clip.y, R.clip.w, R.clip.h), e.clip(), P) {
|
|
1241
|
+
v(e, P, R.x, R.y, R.textAlign, R.textBaseline), e.restore();
|
|
1448
1242
|
return;
|
|
1449
1243
|
}
|
|
1450
|
-
e.fillStyle =
|
|
1451
|
-
let
|
|
1452
|
-
|
|
1244
|
+
e.fillStyle = N, e.textAlign = R.textAlign, e.textBaseline = "middle";
|
|
1245
|
+
let B = A * 1.2, V = R.y - (F.length - 1) * B / 2;
|
|
1246
|
+
F.forEach((t, n) => e.fillText(t, R.x, V + n * B)), e.restore();
|
|
1453
1247
|
}
|
|
1454
|
-
function
|
|
1248
|
+
function Ie(e, t, n) {
|
|
1455
1249
|
if (n?.deleted) return !1;
|
|
1456
1250
|
if (n?.text) return !0;
|
|
1457
1251
|
let r = t.seriesDataLabels;
|
|
1458
1252
|
return (n?.showVal ?? r?.showVal ?? e.showDataLabels) || (n?.showCatName ?? r?.showCatName ?? !1) || (n?.showSerName ?? r?.showSerName ?? !1) || (n?.showPercent ?? r?.showPercent ?? !1);
|
|
1459
1253
|
}
|
|
1460
|
-
function
|
|
1461
|
-
let p = r
|
|
1462
|
-
if (
|
|
1463
|
-
|
|
1464
|
-
let
|
|
1465
|
-
x:
|
|
1466
|
-
y:
|
|
1467
|
-
w:
|
|
1254
|
+
function Le(t, r, s, c, l) {
|
|
1255
|
+
let p = i(r, s.h, c);
|
|
1256
|
+
if (r.title) {
|
|
1257
|
+
t.font = `${r.titleFontBold === !1 ? "" : "bold "}${p.fontPx}px ${xe(r.titleFontFace)}`, t.fillStyle = r.titleFontColor ? `#${r.titleFontColor}` : "#111111", t.textAlign = "center", t.textBaseline = "top";
|
|
1258
|
+
let n = t.measureText(r.title).width, i = {
|
|
1259
|
+
x: s.x + (s.w - n) / 2,
|
|
1260
|
+
y: s.y + p.topPad,
|
|
1261
|
+
w: n,
|
|
1468
1262
|
h: Math.max(1, p.fontPx)
|
|
1469
|
-
},
|
|
1470
|
-
...
|
|
1263
|
+
}, a = r.titleManualLayout ? e({
|
|
1264
|
+
...r.titleManualLayout,
|
|
1471
1265
|
w: void 0,
|
|
1472
1266
|
h: void 0
|
|
1473
|
-
},
|
|
1474
|
-
|
|
1267
|
+
}, s, i) : null;
|
|
1268
|
+
t.fillText(r.title, a ? a.x + a.w / 2 : s.x + s.w / 2, a?.y ?? i.y);
|
|
1475
1269
|
}
|
|
1476
|
-
let m =
|
|
1477
|
-
|
|
1478
|
-
let h =
|
|
1479
|
-
itemWidths: h.map((e) => 7 *
|
|
1270
|
+
let m = f(r.legendFontSizeHpt, c) ?? 9 * c;
|
|
1271
|
+
t.save(), t.font = `${r.legendFontBold ? "bold " : ""}${m}px ${xe(r.legendFontFace)}`;
|
|
1272
|
+
let h = r.chartType === "pie" ? r.series[0]?.categories?.length ? r.series[0].categories : r.categories : r.series.map((e, t) => e.name || `Series ${t + 1}`), g = n(r, s.w, s.h, .23, {
|
|
1273
|
+
itemWidths: h.map((e) => 7 * c + 4 + t.measureText(e).width),
|
|
1480
1274
|
rowHeight: Math.max(m * 1.45, 12),
|
|
1481
1275
|
itemGap: 12,
|
|
1482
1276
|
horizontalPadding: 8,
|
|
1483
1277
|
verticalPadding: 4
|
|
1484
1278
|
});
|
|
1485
|
-
|
|
1486
|
-
let _ = a(g), v =
|
|
1279
|
+
t.restore();
|
|
1280
|
+
let _ = a(g), v = o(r, s.w, s.h, c), y = l === "horizontal" ? r.catAxisTitle ? v.catFontPx + u(s.w) + 4 : 0 : l === "vertical" ? v.valBandW : 0, b = l === "horizontal" ? r.valAxisTitle ? v.valFontPx + u(s.h) + 4 : 0 : l === "vertical" ? v.catBandH : 0, x = d(r, s.x, s.y, s.w, s.h, c, {
|
|
1487
1281
|
titleBand: p,
|
|
1488
1282
|
legendSideReserveFrac: .23,
|
|
1489
1283
|
legendReserve: g,
|
|
1490
1284
|
pad: {
|
|
1491
|
-
t: p.bandH + _.legTopH +
|
|
1492
|
-
r: _.legRightW +
|
|
1493
|
-
b: _.legBottomH +
|
|
1494
|
-
l: _.legLeftW +
|
|
1285
|
+
t: p.bandH + _.legTopH + s.h * .04,
|
|
1286
|
+
r: _.legRightW + s.w * .05,
|
|
1287
|
+
b: _.legBottomH + s.h * .19 + b,
|
|
1288
|
+
l: _.legLeftW + s.w * .13 + y
|
|
1495
1289
|
},
|
|
1496
1290
|
honorPlotAreaManualLayout: !0,
|
|
1497
1291
|
manualOuterInsets: {
|
|
@@ -1506,45 +1300,45 @@ function ze(n, c, l, u, f) {
|
|
|
1506
1300
|
w: Math.max(1, x.plotRect.pw),
|
|
1507
1301
|
h: Math.max(1, x.plotRect.ph)
|
|
1508
1302
|
}, C = g ? g.side === "r" ? {
|
|
1509
|
-
x:
|
|
1303
|
+
x: s.x + s.w - g.reserveW,
|
|
1510
1304
|
y: S.y,
|
|
1511
1305
|
w: g.reserveW,
|
|
1512
1306
|
h: S.h
|
|
1513
1307
|
} : g.side === "l" ? {
|
|
1514
|
-
x:
|
|
1308
|
+
x: s.x,
|
|
1515
1309
|
y: S.y,
|
|
1516
1310
|
w: g.reserveW,
|
|
1517
1311
|
h: S.h
|
|
1518
1312
|
} : g.side === "t" ? {
|
|
1519
|
-
x:
|
|
1520
|
-
y:
|
|
1521
|
-
w: Math.max(1,
|
|
1313
|
+
x: s.x + 4,
|
|
1314
|
+
y: s.y + p.bandH,
|
|
1315
|
+
w: Math.max(1, s.w - 8),
|
|
1522
1316
|
h: g.reserveH
|
|
1523
1317
|
} : {
|
|
1524
|
-
x:
|
|
1525
|
-
y:
|
|
1526
|
-
w: Math.max(1,
|
|
1318
|
+
x: s.x + 4,
|
|
1319
|
+
y: s.y + s.h - g.reserveH,
|
|
1320
|
+
w: Math.max(1, s.w - 8),
|
|
1527
1321
|
h: g.reserveH
|
|
1528
1322
|
} : null;
|
|
1529
1323
|
return {
|
|
1530
1324
|
plot: S,
|
|
1531
|
-
legend: (C &&
|
|
1325
|
+
legend: (C && r.legendManualLayout ? e(r.legendManualLayout, s, C) : null) ?? C
|
|
1532
1326
|
};
|
|
1533
1327
|
}
|
|
1534
|
-
function
|
|
1535
|
-
t.save(), t.font = `${d ? "italic " : ""}${
|
|
1536
|
-
let g = m ? n :
|
|
1328
|
+
function Re(t, n, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
1329
|
+
t.save(), t.font = `${d ? "italic " : ""}${u ? "bold " : ""}${s}px ${c}`, t.fillStyle = l ? `#${l}` : "#555";
|
|
1330
|
+
let g = m ? n : O(t, n, h), _ = r(o, f, p), v = a;
|
|
1537
1331
|
if (m) {
|
|
1538
|
-
let n = t.measureText(g).width,
|
|
1539
|
-
x:
|
|
1540
|
-
y:
|
|
1541
|
-
w: n *
|
|
1542
|
-
h: n *
|
|
1332
|
+
let n = t.measureText(g).width, r = Math.abs(Math.cos(_)), o = Math.abs(Math.sin(_)), c = {
|
|
1333
|
+
x: a.x - (n * r + s * o) / 2,
|
|
1334
|
+
y: a.y - (n * o + s * r) / 2,
|
|
1335
|
+
w: n * r + s * o,
|
|
1336
|
+
h: n * o + s * r
|
|
1543
1337
|
}, l = e({
|
|
1544
1338
|
...m,
|
|
1545
1339
|
w: void 0,
|
|
1546
1340
|
h: void 0
|
|
1547
|
-
},
|
|
1341
|
+
}, i, c);
|
|
1548
1342
|
l && (v = {
|
|
1549
1343
|
x: l.x + l.w / 2,
|
|
1550
1344
|
y: l.y + l.h / 2
|
|
@@ -1552,32 +1346,32 @@ function Be(t, n, r, i, a, o, s, c, l, d, f, p, m, h) {
|
|
|
1552
1346
|
}
|
|
1553
1347
|
t.translate(v.x, v.y), _ && t.rotate(_), t.textAlign = "center", t.textBaseline = "middle", t.fillText(g, 0, 0), t.restore();
|
|
1554
1348
|
}
|
|
1555
|
-
function
|
|
1349
|
+
function ze(e, t, n, r, i, a) {
|
|
1556
1350
|
if (t.valAxisTitle) {
|
|
1557
|
-
let
|
|
1558
|
-
|
|
1559
|
-
x:
|
|
1560
|
-
y:
|
|
1351
|
+
let o = s(t.valAxisTitleFontSizeHpt, a), c = i ? "horizontal" : "left";
|
|
1352
|
+
Re(e, t.valAxisTitle, n, i ? {
|
|
1353
|
+
x: r.x + r.w / 2,
|
|
1354
|
+
y: r.y + r.h + u(n.h) + o / 2
|
|
1561
1355
|
} : {
|
|
1562
|
-
x:
|
|
1563
|
-
y:
|
|
1564
|
-
},
|
|
1356
|
+
x: r.x - u(n.w) - o / 2,
|
|
1357
|
+
y: r.y + r.h / 2
|
|
1358
|
+
}, c, o, Z(t, t.valAxisTitleFontFace, "major"), t.valAxisTitleFontColor, t.valAxisTitleFontBold ?? !0, t.valAxisTitleFontItalic ?? !1, t.valAxisTitleRotation, t.valAxisTitleVerticalMode, t.valAxisTitleManualLayout, i ? r.w : r.h);
|
|
1565
1359
|
}
|
|
1566
1360
|
if (t.catAxisTitle) {
|
|
1567
|
-
let
|
|
1568
|
-
|
|
1569
|
-
x:
|
|
1570
|
-
y:
|
|
1361
|
+
let o = s(t.catAxisTitleFontSizeHpt, a), c = i ? "left" : "horizontal";
|
|
1362
|
+
Re(e, t.catAxisTitle, n, i ? {
|
|
1363
|
+
x: r.x - u(n.w) - o / 2,
|
|
1364
|
+
y: r.y + r.h / 2
|
|
1571
1365
|
} : {
|
|
1572
|
-
x:
|
|
1573
|
-
y:
|
|
1574
|
-
},
|
|
1366
|
+
x: r.x + r.w / 2,
|
|
1367
|
+
y: r.y + r.h + u(n.h) + o / 2
|
|
1368
|
+
}, c, o, Z(t, t.catAxisTitleFontFace, "major"), t.catAxisTitleFontColor, t.catAxisTitleFontBold ?? !0, t.catAxisTitleFontItalic ?? !1, t.catAxisTitleRotation, t.catAxisTitleVerticalMode, t.catAxisTitleManualLayout, i ? r.h : r.w);
|
|
1575
1369
|
}
|
|
1576
1370
|
}
|
|
1577
|
-
function
|
|
1578
|
-
let
|
|
1579
|
-
if (!
|
|
1580
|
-
let p =
|
|
1371
|
+
function Be(e, t, n, r, i, a, o, c, l, u) {
|
|
1372
|
+
let d = t.threeD?.seriesAxis;
|
|
1373
|
+
if (!d || d.hidden || t.threeD?.barGrouping !== "standard" || t.series.length === 0) return;
|
|
1374
|
+
let p = Qe(t, r, i, a, o, c, l), m = We(r), h = l === "vertical" ? m.seriesAxisX : p.axisX, g = l === "horizontal" ? m.floorY === r.front.y ? r.front.y + r.front.h : r.front.y : m.floorY, _ = r.project(h, g, r.topology.nearDepth), v = r.project(h, g, r.topology.farDepth), y = Math.hypot(v.x - _.x, v.y - _.y);
|
|
1581
1375
|
if (!(y > 1e-6)) return;
|
|
1582
1376
|
let b = {
|
|
1583
1377
|
x: (v.x - _.x) / y,
|
|
@@ -1585,96 +1379,96 @@ function He(e, t, r, i, a, o, s, c, l, u) {
|
|
|
1585
1379
|
}, x = {
|
|
1586
1380
|
x: -b.y,
|
|
1587
1381
|
y: b.x
|
|
1588
|
-
}, S =
|
|
1382
|
+
}, S = r.project(r.front.x + r.front.w / 2, r.front.y + r.front.h / 2, .5), C = {
|
|
1589
1383
|
x: (_.x + v.x) / 2,
|
|
1590
1384
|
y: (_.y + v.y) / 2
|
|
1591
1385
|
};
|
|
1592
1386
|
(C.x - S.x) * x.x + (C.y - S.y) * x.y < 0 && (x = {
|
|
1593
1387
|
x: -x.x,
|
|
1594
1388
|
y: -x.y
|
|
1595
|
-
}), (
|
|
1389
|
+
}), (d.tickLabelPos === "low" && x.y < 0 || d.tickLabelPos === "high" && x.y > 0) && (x = {
|
|
1596
1390
|
x: -x.x,
|
|
1597
1391
|
y: -x.y
|
|
1598
|
-
}),
|
|
1599
|
-
let w = Math.max(1, Math.floor(
|
|
1600
|
-
e.font = `${
|
|
1392
|
+
}), d.lineHidden || ($(e, Q(d.lineColor, d.lineWidthEmu, null, u, "898989", 1)), e.beginPath(), e.moveTo(_.x, _.y), e.lineTo(v.x, v.y), e.stroke());
|
|
1393
|
+
let w = Math.max(1, Math.floor(d.tickMarkSkip ?? 1)), T = Math.max(1, Math.floor(d.tickLabelSkip ?? 1)), E = d.majorTickMark ?? "out", D = f(d.fontSizeHpt, u) ?? 9 * u;
|
|
1394
|
+
e.font = `${d.fontItalic ? "italic " : ""}${d.fontBold ? "bold " : ""}${D}px ${Z(t, d.fontFace)}`, e.fillStyle = d.fontColor ? `#${d.fontColor}` : "#595959", e.textAlign = Math.abs(x.x) < .2 ? "center" : x.x < 0 ? "right" : "left", e.textBaseline = Math.abs(x.y) < .2 ? "middle" : x.y < 0 ? "bottom" : "top";
|
|
1601
1395
|
for (let n = 0; n < t.series.length; n++) {
|
|
1602
|
-
let
|
|
1603
|
-
if (!
|
|
1396
|
+
let i = r.seriesDepth(n, t.series.length, !1), a = d.orientation === "maxMin" ? 1 - i : i, o = r.project(h, g, a);
|
|
1397
|
+
if (!d.lineHidden && n % w === 0 && E !== "none") {
|
|
1604
1398
|
let t = 6 * u, n = E === "cross" ? t / 2 : E === "out" ? t : 0, r = E === "cross" ? t / 2 : E === "in" ? t : 0;
|
|
1605
1399
|
e.beginPath(), e.moveTo(o.x + x.x * n, o.y + x.y * n), e.lineTo(o.x - x.x * r, o.y - x.y * r), e.stroke();
|
|
1606
1400
|
}
|
|
1607
|
-
|
|
1401
|
+
d.tickLabelPos !== "none" && n % T === 0 && e.fillText(t.series[n].name || `Series ${n + 1}`, o.x + x.x * (6 * u + 3), o.y + x.y * (6 * u + 3));
|
|
1608
1402
|
}
|
|
1609
|
-
if (e.setLineDash([]),
|
|
1610
|
-
let
|
|
1611
|
-
|
|
1612
|
-
x: C.x + x.x * (D +
|
|
1613
|
-
y: C.y + x.y * (D +
|
|
1614
|
-
}, "horizontal",
|
|
1403
|
+
if (e.setLineDash([]), d.title) {
|
|
1404
|
+
let i = s(d.titleFontSizeHpt, u);
|
|
1405
|
+
Re(e, d.title, n, {
|
|
1406
|
+
x: C.x + x.x * (D + i + 12),
|
|
1407
|
+
y: C.y + x.y * (D + i + 12)
|
|
1408
|
+
}, "horizontal", i, Z(t, d.titleFontFace, "major"), d.titleFontColor, d.titleFontBold ?? !0, d.titleFontItalic ?? !1, d.titleRotation, d.titleVerticalMode, d.titleManualLayout, Math.max(r.front.w, r.front.h));
|
|
1615
1409
|
}
|
|
1616
1410
|
}
|
|
1617
|
-
function
|
|
1618
|
-
if (!
|
|
1619
|
-
|
|
1620
|
-
let
|
|
1621
|
-
let r =
|
|
1411
|
+
function Ve(e, n, r, i, a = !1) {
|
|
1412
|
+
if (!r) return;
|
|
1413
|
+
D(e, n, r, i);
|
|
1414
|
+
let o = new Map(n.series[0]?.dataPointOverrides?.map((e) => [e.idx, e]) ?? []), s = a ? (n.series[0]?.categories?.length ? n.series[0].categories : n.categories).map((e, t) => {
|
|
1415
|
+
let r = n.series[0]?.dataPointColors?.[t];
|
|
1622
1416
|
return {
|
|
1623
1417
|
label: e,
|
|
1624
|
-
color: r === "00000000" ? "transparent" : r ? `#${r}` :
|
|
1625
|
-
series:
|
|
1626
|
-
point:
|
|
1418
|
+
color: r === "00000000" ? "transparent" : r ? `#${r}` : ve(t),
|
|
1419
|
+
series: n.series[0],
|
|
1420
|
+
point: o.get(t)
|
|
1627
1421
|
};
|
|
1628
|
-
}) :
|
|
1422
|
+
}) : n.series.map((e, t) => ({
|
|
1629
1423
|
label: e.name || `Series ${t + 1}`,
|
|
1630
|
-
color:
|
|
1424
|
+
color: ve(t, e),
|
|
1631
1425
|
series: e,
|
|
1632
1426
|
point: void 0
|
|
1633
|
-
})),
|
|
1634
|
-
e.font = `${
|
|
1635
|
-
let
|
|
1636
|
-
if (
|
|
1637
|
-
let
|
|
1638
|
-
for (let
|
|
1639
|
-
let
|
|
1640
|
-
for (let
|
|
1641
|
-
let
|
|
1642
|
-
if (!
|
|
1643
|
-
let t =
|
|
1644
|
-
e.beginPath(), e.moveTo(p,
|
|
1427
|
+
})), c = f(n.legendFontSizeHpt, i) ?? 9 * i;
|
|
1428
|
+
e.font = `${n.legendFontBold ? "bold " : ""}${c}px ${xe(n.legendFontFace)}`, e.textAlign = "left", e.textBaseline = "middle";
|
|
1429
|
+
let l = Math.max(c * 1.45, 12), u = Math.min(7 * i, l * .7);
|
|
1430
|
+
if (n.legendPos === "t" || n.legendPos === "b" || n.legendManualLayout != null && r.w >= r.h) {
|
|
1431
|
+
let o = s.map((t) => u + 4 + e.measureText(t.label).width), c = t(o, Math.max(1, r.w - 8), 12).slice(0, Math.max(0, Math.floor((r.h - 4 + 1e-6) / l))), d = r.y + 2 + l / 2;
|
|
1432
|
+
for (let t of c) {
|
|
1433
|
+
let c = t.map((e) => Math.min(r.w, o[e])), f = c.reduce((e, t) => e + t, 0) + Math.max(0, t.length - 1) * 12, p = r.x + Math.max(4, (r.w - f) / 2);
|
|
1434
|
+
for (let r = 0; r < t.length; r++) {
|
|
1435
|
+
let o = s[t[r]], l = Math.max(0, c[r] - u - 4);
|
|
1436
|
+
if (!a && n.chartType.toLowerCase().includes("line") && o.series?.lineHidden !== !0) {
|
|
1437
|
+
let t = o.series?.lineWidthEmu == null ? Math.max(1, 2 * i) : Math.max(.5, o.series.lineWidthEmu / S * i);
|
|
1438
|
+
e.beginPath(), e.moveTo(p, d), e.lineTo(p + u, d), e.strokeStyle = o.series?.lineColor ? `#${o.series.lineColor}` : T(o.color, .7), e.lineWidth = t, e.setLineDash(y(o.series?.chartexStyle?.lineDash ?? "solid", t)), e.stroke(), e.setLineDash([]);
|
|
1645
1439
|
} else {
|
|
1646
|
-
|
|
1647
|
-
let t =
|
|
1648
|
-
t !== !0 && n && (e.strokeStyle = `#${n}`, e.lineWidth = (
|
|
1440
|
+
o.color !== "transparent" && (e.fillStyle = o.color, e.fillRect(p, d - u / 2, u, u));
|
|
1441
|
+
let t = o.point?.lineHidden ?? o.series?.lineHidden, n = o.point?.lineColor ?? o.series?.lineColor;
|
|
1442
|
+
t !== !0 && n && (e.strokeStyle = `#${n}`, e.lineWidth = (o.point?.lineWidthEmu ?? o.series?.lineWidthEmu) == null ? .75 * i : Math.max(.25, (o.point?.lineWidthEmu ?? o.series?.lineWidthEmu ?? 0) / S * i), e.setLineDash(y(o.point?.lineDash ?? o.series?.chartexStyle?.lineDash ?? "solid", e.lineWidth)), e.strokeRect(p, d - u / 2, u, u), e.setLineDash([]));
|
|
1649
1443
|
}
|
|
1650
|
-
e.fillStyle =
|
|
1444
|
+
e.fillStyle = n.legendFontColor ? `#${n.legendFontColor}` : "#595959", e.fillText(O(e, o.label, l), p + u + 4, d), p += c[r] + 12;
|
|
1651
1445
|
}
|
|
1652
|
-
|
|
1446
|
+
d += l;
|
|
1653
1447
|
}
|
|
1654
1448
|
return;
|
|
1655
1449
|
}
|
|
1656
|
-
let
|
|
1657
|
-
for (let
|
|
1658
|
-
let
|
|
1450
|
+
let d = r.y;
|
|
1451
|
+
for (let t = 0; t < s.length; t++) {
|
|
1452
|
+
let o = s[t], f = r.x + 8 + u, p = Math.max(0, r.x + r.w - 4 - f), m = Math.max(c * 1.2, 10), h = b(o.label, p, m * (a ? 1 : 2), m, (t) => e.measureText(t).width);
|
|
1659
1453
|
if (h.length === 0) continue;
|
|
1660
|
-
let
|
|
1661
|
-
if (
|
|
1662
|
-
let
|
|
1663
|
-
if (!
|
|
1664
|
-
let t =
|
|
1665
|
-
|
|
1454
|
+
let g = Math.max(l, h.length * m + 2);
|
|
1455
|
+
if (d + g > r.y + r.h + 1e-6) break;
|
|
1456
|
+
let _ = d + g / 2;
|
|
1457
|
+
if (!a && n.chartType.toLowerCase().includes("line")) {
|
|
1458
|
+
let t = o.series?.lineWidthEmu == null ? Math.max(1, 2 * i) : Math.max(.5, o.series.lineWidthEmu / S * i);
|
|
1459
|
+
o.series?.lineHidden !== !0 && (e.beginPath(), e.moveTo(r.x + 4, _), e.lineTo(r.x + 4 + u, _), e.strokeStyle = o.series?.lineColor ? `#${o.series.lineColor}` : T(o.color, .7), e.lineWidth = t, e.setLineDash(y(o.series?.chartexStyle?.lineDash ?? "solid", t)), e.stroke(), e.setLineDash([]));
|
|
1666
1460
|
} else {
|
|
1667
|
-
|
|
1668
|
-
let t =
|
|
1669
|
-
t !== !0 &&
|
|
1461
|
+
o.color !== "transparent" && (e.fillStyle = o.color, e.fillRect(r.x + 4, _ - u / 2, u, u));
|
|
1462
|
+
let t = o.point?.lineHidden ?? o.series?.lineHidden, n = o.point?.lineColor ?? o.series?.lineColor;
|
|
1463
|
+
t !== !0 && n && (e.strokeStyle = `#${n}`, e.lineWidth = (o.point?.lineWidthEmu ?? o.series?.lineWidthEmu) == null ? .75 * i : Math.max(.25, (o.point?.lineWidthEmu ?? o.series?.lineWidthEmu ?? 0) / S * i), e.setLineDash(y(o.point?.lineDash ?? o.series?.chartexStyle?.lineDash ?? "solid", e.lineWidth)), e.strokeRect(r.x + 4, _ - u / 2, u, u), e.setLineDash([]));
|
|
1670
1464
|
}
|
|
1671
|
-
e.fillStyle =
|
|
1672
|
-
let
|
|
1673
|
-
h.forEach((t, n) => e.fillText(t, f,
|
|
1465
|
+
e.fillStyle = n.legendFontColor ? `#${n.legendFontColor}` : "#595959";
|
|
1466
|
+
let v = _ - (h.length - 1) * m / 2;
|
|
1467
|
+
h.forEach((t, n) => e.fillText(t, f, v + n * m)), d += g;
|
|
1674
1468
|
}
|
|
1675
1469
|
}
|
|
1676
|
-
function
|
|
1677
|
-
let o = i ? 100 : 1, s = e.valAxisMinorTickMark ?? "
|
|
1470
|
+
function He(e, t, n, r, i, a) {
|
|
1471
|
+
let o = i ? 100 : 1, s = e.valAxisMinorTickMark ?? "none";
|
|
1678
1472
|
return p({
|
|
1679
1473
|
dataMin: t,
|
|
1680
1474
|
dataMax: n,
|
|
@@ -1689,7 +1483,7 @@ function We(e, t, n, r, i, a) {
|
|
|
1689
1483
|
needMinor: e.valAxisMinorGridlines === !0 || s !== "none"
|
|
1690
1484
|
});
|
|
1691
1485
|
}
|
|
1692
|
-
function
|
|
1486
|
+
function Ue(e, t, n) {
|
|
1693
1487
|
let r = e != null && Number.isFinite(e) ? (e % 360 + 360) % 360 : 0, i = Number.isFinite(t) ? Math.max(0, Math.min(1, t)) : 0, a = Number.isFinite(n) ? Math.max(0, Math.min(1 - i, n)) : 0, o = Math.PI / 2 - (r * Math.PI / 180 + i * Math.PI * 2), s = o - a * Math.PI * 2;
|
|
1694
1488
|
return {
|
|
1695
1489
|
start: Math.min(o, s),
|
|
@@ -1698,7 +1492,7 @@ function Ge(e, t, n) {
|
|
|
1698
1492
|
leading: o
|
|
1699
1493
|
};
|
|
1700
1494
|
}
|
|
1701
|
-
function
|
|
1495
|
+
function We(e) {
|
|
1702
1496
|
let { front: t } = e, n = t.x, r = t.x + t.w, i = e.topology.farX === "min" ? n : r, a = i === n ? r : n, o = e.topology.axisY === "min" ? t.y : t.y + t.h, s = o === t.y ? t.y + t.h : t.y, { nearDepth: c, farDepth: l } = e.topology, u = e.project(n, o, c), d = e.project(r, o, c), f = e.project(r, o, l), p = e.project(n, o, l), m = e.project(n, s, l), h = e.project(r, s, l), g = e.project(i, o, c), _ = e.project(i, o, l), v = e.project(i, s, l), y = e.project(i, s, c);
|
|
1703
1497
|
return {
|
|
1704
1498
|
floor: [
|
|
@@ -1728,53 +1522,53 @@ function Ke(e) {
|
|
|
1728
1522
|
};
|
|
1729
1523
|
}
|
|
1730
1524
|
function Q(e, t, n, r, i = "A6A6A6", a = .75) {
|
|
1731
|
-
let o = t != null && Number.isFinite(t) && t >= 0 ? Math.max(.25, t /
|
|
1525
|
+
let o = t != null && Number.isFinite(t) && t >= 0 ? Math.max(.25, t / S * r) : a * r;
|
|
1732
1526
|
return {
|
|
1733
1527
|
color: `#${e ?? i}`,
|
|
1734
1528
|
width: o,
|
|
1735
|
-
dash:
|
|
1529
|
+
dash: y(n ?? "solid", o)
|
|
1736
1530
|
};
|
|
1737
1531
|
}
|
|
1738
1532
|
function $(e, t) {
|
|
1739
1533
|
e.strokeStyle = t.color, e.lineWidth = t.width, e.setLineDash(t.dash);
|
|
1740
1534
|
}
|
|
1741
|
-
function
|
|
1742
|
-
let { front: l } = n, u = l.x, d = l.x + l.w, f =
|
|
1743
|
-
n?.fillHidden === !0 || !n?.fillColor ||
|
|
1535
|
+
function Ge(e, t, n, r, i, a, o, s, c) {
|
|
1536
|
+
let { front: l } = n, u = l.x, d = l.x + l.w, f = We(n), { sideX: p, floorY: m, oppositeFloorY: h, nearDepth: _, farDepth: v } = f, y = (t, n) => {
|
|
1537
|
+
n?.fillHidden === !0 || !n?.fillColor || we(e, t, `#${n.fillColor}`, 0);
|
|
1744
1538
|
};
|
|
1745
|
-
|
|
1746
|
-
let
|
|
1539
|
+
y(f.floor, t.threeD?.floor), y(f.sideWall, t.threeD?.sideWall), y(f.backWall, t.threeD?.backWall);
|
|
1540
|
+
let b = (t, a) => {
|
|
1747
1541
|
$(e, a);
|
|
1748
1542
|
for (let a of t) if (i === "horizontal") {
|
|
1749
|
-
let t = l.x + r.fraction(a) * l.w, i = n.project(t, m,
|
|
1543
|
+
let t = l.x + r.fraction(a) * l.w, i = n.project(t, m, v), o = n.project(t, h, v);
|
|
1750
1544
|
e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(o.x, o.y), e.stroke();
|
|
1751
1545
|
} else {
|
|
1752
|
-
let t = l.y + l.h - r.fraction(a) * l.h, i = n.project(p, t,
|
|
1546
|
+
let t = l.y + l.h - r.fraction(a) * l.h, i = n.project(p, t, _), o = n.project(p, t, v), s = n.project(p === u ? d : u, t, v);
|
|
1753
1547
|
e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(o.x, o.y), e.stroke(), e.beginPath(), e.moveTo(o.x, o.y), e.lineTo(s.x, s.y), e.stroke();
|
|
1754
1548
|
}
|
|
1755
1549
|
};
|
|
1756
|
-
t.valAxisMinorGridlines === !0 &&
|
|
1550
|
+
t.valAxisMinorGridlines === !0 && b(r.minorTicks, Q(t.valAxisMinorGridlineColor, t.valAxisMinorGridlineWidthEmu, t.valAxisMinorGridlineDash, c, "D9D9D9", .5)), t.valAxisMajorGridlines !== !1 && b(r.majorTicks, Q(t.valAxisGridlineColor, t.valAxisGridlineWidthEmu, t.valAxisGridlineDash, c, "898989", 1)), $(e, Q(null, null, null, c, "898989", 1));
|
|
1757
1551
|
for (let t = 0; t < a; t++) if (i === "vertical") {
|
|
1758
|
-
let r = l.x +
|
|
1552
|
+
let r = l.x + g(t, a, o, s) * l.w, i = n.project(r, m, _), c = n.project(r, m, v);
|
|
1759
1553
|
e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(c.x, c.y), e.stroke();
|
|
1760
1554
|
} else {
|
|
1761
|
-
let r = l.y +
|
|
1555
|
+
let r = l.y + g(t, a, o, s) * l.h, i = n.project(p, r, _), c = n.project(p, r, v);
|
|
1762
1556
|
e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(c.x, c.y), e.stroke();
|
|
1763
1557
|
}
|
|
1764
|
-
let
|
|
1558
|
+
let x = (t, n) => {
|
|
1765
1559
|
if (!(n?.lineHidden === !0 || t.length < 2)) {
|
|
1766
1560
|
$(e, Q(n?.lineColor, n?.lineWidthEmu, n?.lineDash, c, "898989", 1)), e.beginPath(), e.moveTo(t[0].x, t[0].y);
|
|
1767
1561
|
for (let n = 1; n < t.length; n++) e.lineTo(t[n].x, t[n].y);
|
|
1768
1562
|
e.lineTo(t[0].x, t[0].y), e.closePath(), e.stroke();
|
|
1769
1563
|
}
|
|
1770
1564
|
};
|
|
1771
|
-
|
|
1565
|
+
x(f.floor, t.threeD?.floor), x(f.sideWall, t.threeD?.sideWall), x(f.backWall, t.threeD?.backWall), e.setLineDash([]);
|
|
1772
1566
|
}
|
|
1773
|
-
function
|
|
1774
|
-
let l =
|
|
1567
|
+
function Ke(e, t, n, r, i, a, o, s, c) {
|
|
1568
|
+
let l = Qe(t, n, r, i, a, o, c), u = c === "vertical" ? !t.catAxisHidden && !t.catAxisLineHidden : !t.valAxisHidden && !t.valAxisLineHidden, d = c === "vertical" ? !t.valAxisHidden && !t.valAxisLineHidden : !t.catAxisHidden && !t.catAxisLineHidden;
|
|
1775
1569
|
u && ($(e, Q(c === "vertical" ? t.catAxisLineColor : t.valAxisLineColor, c === "vertical" ? t.catAxisLineWidthEmu : t.valAxisLineWidthEmu, null, s, "898989", 1)), e.beginPath(), e.moveTo(l.horizontalStart.x, l.horizontalStart.y), e.lineTo(l.horizontalEnd.x, l.horizontalEnd.y), e.stroke()), d && ($(e, Q(c === "vertical" ? t.valAxisLineColor : t.catAxisLineColor, c === "vertical" ? t.valAxisLineWidthEmu : t.catAxisLineWidthEmu, null, s, "898989", 1)), e.beginPath(), e.moveTo(l.verticalStart.x, l.verticalStart.y), e.lineTo(l.verticalEnd.x, l.verticalEnd.y), e.stroke()), e.setLineDash([]);
|
|
1776
1570
|
}
|
|
1777
|
-
function
|
|
1571
|
+
function qe(e, t, n, r) {
|
|
1778
1572
|
let i = {
|
|
1779
1573
|
x: (e.x + t.x) / 2,
|
|
1780
1574
|
y: (e.y + t.y) / 2
|
|
@@ -1787,25 +1581,25 @@ function Ye(e, t, n, r) {
|
|
|
1787
1581
|
y: i.y <= n.y ? -1 : 1
|
|
1788
1582
|
};
|
|
1789
1583
|
}
|
|
1790
|
-
function
|
|
1584
|
+
function Je(e, t, n, r, i, a, o, s, c) {
|
|
1791
1585
|
if (!t || t === "none") return;
|
|
1792
|
-
let l =
|
|
1586
|
+
let l = qe(r, i, a, o), u = Ye(s, c), d = t === "cross" ? u / 2 : u, f = t === "out" || t === "cross" ? d : 0, p = t === "in" || t === "cross" ? d : 0;
|
|
1793
1587
|
e.beginPath(), e.moveTo(n.x + l.x * f, n.y + l.y * f), e.lineTo(n.x - l.x * p, n.y - l.y * p), e.stroke();
|
|
1794
1588
|
}
|
|
1795
|
-
function
|
|
1589
|
+
function Ye(e, t) {
|
|
1796
1590
|
return (e === "minor" ? 4 : 6) * t;
|
|
1797
1591
|
}
|
|
1798
|
-
function
|
|
1592
|
+
function Xe(e, t, n) {
|
|
1799
1593
|
if (e !== "out" && e !== "cross") return 0;
|
|
1800
|
-
let r =
|
|
1594
|
+
let r = Ye(t, n);
|
|
1801
1595
|
return e === "cross" ? r / 2 : r;
|
|
1802
1596
|
}
|
|
1803
|
-
function
|
|
1597
|
+
function Ze(e, t, n, r) {
|
|
1804
1598
|
if (t) return r;
|
|
1805
|
-
let i =
|
|
1599
|
+
let i = Xe(e, "major", n);
|
|
1806
1600
|
return Math.max(r, i + 3 * n);
|
|
1807
1601
|
}
|
|
1808
|
-
function
|
|
1602
|
+
function Qe(e, t, n, r, i, a, o) {
|
|
1809
1603
|
let { front: s } = t, c = (e) => Math.max(0, Math.min(1, e)), l = t.topology.axisX === "min" ? s.x : s.x + s.w, u = t.topology.axisY === "min" ? s.y : s.y + s.h, d = () => {
|
|
1810
1604
|
if (e.catAxisCrossesAt != null && Number.isFinite(e.catAxisCrossesAt)) {
|
|
1811
1605
|
let t = e.chartType.endsWith("Pct") ? e.catAxisCrossesAt * 100 : e.catAxisCrossesAt;
|
|
@@ -1815,62 +1609,62 @@ function et(e, t, n, r, i, a, o) {
|
|
|
1815
1609
|
return c(t === "min" ? n.fraction(n.min) : t === "max" ? n.fraction(n.max) : n.fraction(0));
|
|
1816
1610
|
}, f = () => {
|
|
1817
1611
|
let t = e.valAxisCrossesAt;
|
|
1818
|
-
if (t != null && Number.isFinite(t)) return
|
|
1612
|
+
if (t != null && Number.isFinite(t)) return g(t - 1, r, i, a);
|
|
1819
1613
|
let n = e.valAxisCrosses;
|
|
1820
1614
|
if (n !== "min" && n !== "max") return null;
|
|
1821
1615
|
let o = +(n === "max");
|
|
1822
1616
|
return a ? 1 - o : o;
|
|
1823
|
-
}, p = d(), m = f(), h = o === "horizontal" ? s.x + p * s.w : m == null ? l : s.x + m * s.w,
|
|
1617
|
+
}, p = d(), m = f(), h = o === "horizontal" ? s.x + p * s.w : m == null ? l : s.x + m * s.w, _ = o === "vertical" ? s.y + s.h - p * s.h : m == null ? u : s.y + m * s.h, v = t.topology.nearDepth;
|
|
1824
1618
|
return {
|
|
1825
1619
|
axisX: h,
|
|
1826
|
-
axisY:
|
|
1827
|
-
depth:
|
|
1828
|
-
horizontalStart: t.project(s.x,
|
|
1829
|
-
horizontalEnd: t.project(s.x + s.w,
|
|
1830
|
-
verticalStart: t.project(h, s.y + s.h,
|
|
1831
|
-
verticalEnd: t.project(h, s.y,
|
|
1620
|
+
axisY: _,
|
|
1621
|
+
depth: v,
|
|
1622
|
+
horizontalStart: t.project(s.x, _, v),
|
|
1623
|
+
horizontalEnd: t.project(s.x + s.w, _, v),
|
|
1624
|
+
verticalStart: t.project(h, s.y + s.h, v),
|
|
1625
|
+
verticalEnd: t.project(h, s.y, v)
|
|
1832
1626
|
};
|
|
1833
1627
|
}
|
|
1834
|
-
function
|
|
1835
|
-
let { front: l } = n, u =
|
|
1628
|
+
function $e(e, t, n, r, i, a, o, s, c) {
|
|
1629
|
+
let { front: l } = n, u = Qe(t, n, r, i, a, o, s), { axisX: d, axisY: f, depth: p } = u, m = n.project(l.x + l.w / 2, l.y + l.h / 2, p), h = t.valAxisMinorTickMark ?? "none";
|
|
1836
1630
|
if (!t.valAxisHidden && !t.valAxisLineHidden) {
|
|
1837
1631
|
$(e, Q(t.valAxisLineColor, t.valAxisLineWidthEmu, null, c, "898989", 1));
|
|
1838
1632
|
let i = (e) => s === "horizontal" ? n.project(l.x + r.fraction(e) * l.w, f, p) : n.project(d, l.y + l.h - r.fraction(e) * l.h, p), a = s === "horizontal" ? u.horizontalStart : u.verticalStart, o = s === "horizontal" ? u.horizontalEnd : u.verticalEnd;
|
|
1839
|
-
for (let n of r.majorTicks)
|
|
1840
|
-
for (let t of r.minorTicks)
|
|
1633
|
+
for (let n of r.majorTicks) Je(e, t.valAxisMajorTickMark, i(n), a, o, m, s === "vertical" ? "horizontal" : "vertical", "major", c);
|
|
1634
|
+
for (let t of r.minorTicks) Je(e, h, i(t), a, o, m, s === "vertical" ? "horizontal" : "vertical", "minor", c);
|
|
1841
1635
|
}
|
|
1842
1636
|
if (!t.catAxisHidden && !t.catAxisLineHidden) {
|
|
1843
1637
|
$(e, Q(t.catAxisLineColor, t.catAxisLineWidthEmu, null, c, "898989", 1));
|
|
1844
|
-
let r = s === "vertical" ? u.horizontalStart : u.verticalStart, h = s === "vertical" ? u.horizontalEnd : u.verticalEnd,
|
|
1845
|
-
for (let u = 0; u < i; u +=
|
|
1846
|
-
let
|
|
1847
|
-
|
|
1638
|
+
let r = s === "vertical" ? u.horizontalStart : u.verticalStart, h = s === "vertical" ? u.horizontalEnd : u.verticalEnd, _ = Math.max(1, Math.floor(t.catAxisTickMarkSkip ?? 1));
|
|
1639
|
+
for (let u = 0; u < i; u += _) {
|
|
1640
|
+
let _ = g(u, i, a, o), v = s === "vertical" ? n.project(l.x + _ * l.w, f, p) : n.project(d, l.y + _ * l.h, p);
|
|
1641
|
+
Je(e, t.catAxisMajorTickMark, v, r, h, m, s === "vertical" ? "vertical" : "horizontal", "major", c);
|
|
1848
1642
|
}
|
|
1849
|
-
let
|
|
1850
|
-
if (t.catAxisMinorTickMark && t.catAxisMinorTickMark !== "none" &&
|
|
1851
|
-
let u = t.catAxisMajorUnit != null && Number.isFinite(t.catAxisMajorUnit) && t.catAxisMajorUnit > 0 ? t.catAxisMajorUnit :
|
|
1852
|
-
for (let
|
|
1853
|
-
let
|
|
1854
|
-
if (!(
|
|
1855
|
-
if (Math.abs(
|
|
1856
|
-
let
|
|
1857
|
-
|
|
1643
|
+
let v = t.catAxisMinorUnit;
|
|
1644
|
+
if (t.catAxisMinorTickMark && t.catAxisMinorTickMark !== "none" && v != null && Number.isFinite(v) && v > 0) {
|
|
1645
|
+
let u = t.catAxisMajorUnit != null && Number.isFinite(t.catAxisMajorUnit) && t.catAxisMajorUnit > 0 ? t.catAxisMajorUnit : _, y = Math.min(512, Math.ceil(i / v));
|
|
1646
|
+
for (let _ = 1; _ < y; _++) {
|
|
1647
|
+
let y = _ * v;
|
|
1648
|
+
if (!(y < i)) break;
|
|
1649
|
+
if (Math.abs(y / u - Math.round(y / u)) < 1e-9) continue;
|
|
1650
|
+
let b = g(y, i, a, o), x = s === "vertical" ? n.project(l.x + b * l.w, f, p) : n.project(d, l.y + b * l.h, p);
|
|
1651
|
+
Je(e, t.catAxisMinorTickMark, x, r, h, m, s === "vertical" ? "vertical" : "horizontal", "minor", c);
|
|
1858
1652
|
}
|
|
1859
1653
|
}
|
|
1860
1654
|
}
|
|
1861
1655
|
e.setLineDash([]);
|
|
1862
1656
|
}
|
|
1863
|
-
function
|
|
1657
|
+
function et(e, t, n, r) {
|
|
1864
1658
|
if (!t.threeD) return !1;
|
|
1865
|
-
let i = t.chartType === "clusteredBar" || t.chartType === "clusteredBarH" || t.chartType.startsWith("stackedBar"), a = t.chartType.endsWith("H") || t.chartType.includes("BarH"), o = t.chartType.startsWith("stacked"), s = i && !o && t.threeD.barGrouping === "standard", { plot: u, legend:
|
|
1659
|
+
let i = t.chartType === "clusteredBar" || t.chartType === "clusteredBarH" || t.chartType.startsWith("stackedBar"), a = t.chartType.endsWith("H") || t.chartType.includes("BarH"), o = t.chartType.startsWith("stacked"), s = i && !o && t.threeD.barGrouping === "standard", { plot: u, legend: d } = Le(e, t, n, r, a ? "horizontal" : "vertical"), p = C(t.threeD, u, {
|
|
1866
1660
|
sceneDepthScale: i ? s ? .65 : .1 : .4,
|
|
1867
1661
|
perspectiveTangentGain: s ? 1 : 2
|
|
1868
1662
|
});
|
|
1869
1663
|
if (!p) return !0;
|
|
1870
|
-
let _ = t.chartType.endsWith("Pct"), v = t.series.find((e) => (e.categories?.length ?? 0) > 0)?.categories ?? t.categories,
|
|
1664
|
+
let _ = t.chartType.endsWith("Pct"), v = t.series.find((e) => (e.categories?.length ?? 0) > 0)?.categories ?? t.categories, b = Math.max(1, v.length, ...t.series.map((e) => e.values.length)), E = t.catAxisOrientation === "maxMin", D = t.catAxisCrossBetween === "between", O = t.dispBlanksAs ?? "gap", k = t.valAxisLogBase != null && Number.isFinite(t.valAxisLogBase) && t.valAxisLogBase >= 2, ee = (e, n) => {
|
|
1871
1665
|
let r = t.series[e]?.values[n];
|
|
1872
|
-
return r != null && Number.isFinite(r) && (!
|
|
1873
|
-
},
|
|
1666
|
+
return r != null && Number.isFinite(r) && (!k || r > 0) || r == null && (o || O === "zero");
|
|
1667
|
+
}, A = (e, n) => {
|
|
1874
1668
|
let r = t.series[e]?.values[n] ?? 0;
|
|
1875
1669
|
if (!Number.isFinite(r)) return 0;
|
|
1876
1670
|
if (!_) return r;
|
|
@@ -1886,182 +1680,182 @@ function nt(e, t, n, r) {
|
|
|
1886
1680
|
t != null && Number.isFinite(t) && (a += Math.abs(t) / i);
|
|
1887
1681
|
}
|
|
1888
1682
|
return a > 0 ? r / i / a * 100 : 0;
|
|
1889
|
-
},
|
|
1683
|
+
}, j = (e, t) => {
|
|
1890
1684
|
let n = e + t;
|
|
1891
1685
|
return Number.isFinite(n) ? n : t < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
|
|
1892
|
-
},
|
|
1686
|
+
}, M = 0, N = 0;
|
|
1893
1687
|
if (o) {
|
|
1894
|
-
for (let e = 0; e <
|
|
1688
|
+
for (let e = 0; e < b; e++) {
|
|
1895
1689
|
let n = 0, r = 0;
|
|
1896
1690
|
for (let i = 0; i < t.series.length; i++) {
|
|
1897
|
-
let t =
|
|
1898
|
-
t >= 0 ? n =
|
|
1691
|
+
let t = A(i, e);
|
|
1692
|
+
t >= 0 ? n = j(n, t) : r = j(r, t);
|
|
1899
1693
|
}
|
|
1900
|
-
|
|
1694
|
+
M = Math.min(M, r), N = Math.max(N, n);
|
|
1901
1695
|
}
|
|
1902
|
-
_ && (
|
|
1696
|
+
_ && (M = M < 0 ? -100 : 0, N = N > 0 ? 100 : 0, M === 0 && N === 0 && (N = 1));
|
|
1903
1697
|
} else {
|
|
1904
|
-
let e =
|
|
1698
|
+
let e = m(t.series.flatMap((e) => e.values).filter((e) => e != null && Number.isFinite(e) && (!k || e > 0)), k ? {
|
|
1905
1699
|
min: 1,
|
|
1906
1700
|
max: 10
|
|
1907
1701
|
} : {
|
|
1908
1702
|
min: 0,
|
|
1909
1703
|
max: 1
|
|
1910
1704
|
});
|
|
1911
|
-
|
|
1705
|
+
M = k ? e.min : Math.min(0, e.min), N = k ? e.max : Math.max(0, e.max);
|
|
1912
1706
|
}
|
|
1913
|
-
let
|
|
1914
|
-
|
|
1915
|
-
let { front:
|
|
1707
|
+
let P = He(t, M, N, (a ? p.front.w : p.front.h) / r, _, a ? "horizontal" : "vertical"), F = (e) => Number.isFinite(e) ? Math.max(P.min, Math.min(P.max, e)) : P.min;
|
|
1708
|
+
Ge(e, t, p, P, a ? "horizontal" : "vertical", b, D, E, r);
|
|
1709
|
+
let { front: I } = p, L = Math.max(1, t.series.length), R = [], V = t.series.map((e) => new Map(e.dataPointOverrides?.map((e) => [e.idx, e]) ?? [])), H = t.series.map((e) => new Map(e.dataLabelOverrides?.map((e) => [e.idx, e]) ?? []));
|
|
1916
1710
|
if (i) {
|
|
1917
|
-
let i = p.prismInterval(0, 1, !0), c = [], l = Array(
|
|
1711
|
+
let i = p.prismInterval(0, 1, !0), c = [], l = Array(b).fill(0), u = Array(b).fill(0), d = (a ? I.h : I.w) / b, f = t.barGapWidth != null && Number.isFinite(t.barGapWidth) && t.barGapWidth >= 0 ? t.barGapWidth : 150;
|
|
1918
1712
|
for (let e = 0; e < t.series.length; e++) {
|
|
1919
|
-
let n = t.series[e],
|
|
1920
|
-
for (let i = 0; i <
|
|
1921
|
-
if (!
|
|
1922
|
-
let s =
|
|
1923
|
-
o && (s >= 0 ? l[i] =
|
|
1924
|
-
let
|
|
1925
|
-
if (!
|
|
1926
|
-
let t =
|
|
1713
|
+
let n = t.series[e], m = s ? p.prismInterval(e, L, !1) : i, g = w(d, f, s ? 0 : e, s ? 1 : L, o || s);
|
|
1714
|
+
for (let i = 0; i < b; i++) {
|
|
1715
|
+
if (!ee(e, i)) continue;
|
|
1716
|
+
let s = A(e, i), f = V[e].get(i), p = f?.fillHidden === !0 ? "transparent" : f?.color ?? n.dataPointColors?.[i], v = p === "00000000" ? "transparent" : p ? `#${p}` : n.color === "00000000" ? "transparent" : ve(e, n), y = ye(n, f), S = f?.lineColor ?? n.lineColor, C = f?.lineWidthEmu ?? n.lineWidthEmu, w = f?.lineDash ?? n.chartexStyle?.lineDash ?? "solid", T = n.chartexStyle?.lineCap === "rnd" ? "round" : n.chartexStyle?.lineCap === "sq" ? "square" : "butt", D = n.chartexStyle?.lineJoin === "round" || n.chartexStyle?.lineJoin === "bevel" ? n.chartexStyle.lineJoin : "miter", O = o ? s >= 0 ? l[i] : u[i] : 0, M = j(O, s);
|
|
1717
|
+
o && (s >= 0 ? l[i] = M : u[i] = M);
|
|
1718
|
+
let N = F(O), L = F(M), R = n.threeDShape ?? t.threeD.shape ?? "box", z = R === "cone" || R === "pyramid", B = R === "coneToMax" || R === "pyramidToMax", H = (e) => {
|
|
1719
|
+
if (!z) return 1;
|
|
1720
|
+
let t = k && !(O > 0) ? P.min : O, n = P.fraction(t), r = P.fraction(M), i = P.fraction(e), a = r - n;
|
|
1927
1721
|
return a === 0 || !Number.isFinite(a) || !Number.isFinite(i - n) ? +(e === t) : Math.max(0, Math.min(1, 1 - (i - n) / a));
|
|
1928
|
-
},
|
|
1929
|
-
if (!
|
|
1930
|
-
let t =
|
|
1722
|
+
}, U = (e) => {
|
|
1723
|
+
if (!B) return 1;
|
|
1724
|
+
let t = M >= O ? P.max : P.min, n = k ? P.min : 0, r = P.fraction(t), i = P.fraction(n), a = P.fraction(e), o = Math.abs(r - i);
|
|
1931
1725
|
return !(o > 0) || ![
|
|
1932
1726
|
r,
|
|
1933
1727
|
i,
|
|
1934
1728
|
a
|
|
1935
|
-
].every(Number.isFinite) ?
|
|
1936
|
-
},
|
|
1729
|
+
].every(Number.isFinite) ? x(e, P.min, P.max) : Math.max(0, Math.min(1, Math.abs(r - a) / o));
|
|
1730
|
+
}, W = B ? U(N) : H(N), G = B ? U(L) : H(L);
|
|
1937
1731
|
if (a) {
|
|
1938
|
-
let t =
|
|
1732
|
+
let t = I.x + P.fraction(N) * I.w, n = I.x + P.fraction(L) * I.w, a = E ? b - 1 - i : i, o = I.y + a * d + g.offset;
|
|
1939
1733
|
c.push({
|
|
1940
1734
|
x: Math.min(t, n),
|
|
1941
1735
|
y: o,
|
|
1942
1736
|
width: Math.abs(n - t),
|
|
1943
1737
|
height: g.size,
|
|
1944
|
-
nearDepth:
|
|
1945
|
-
farDepth:
|
|
1738
|
+
nearDepth: m.near,
|
|
1739
|
+
farDepth: m.far,
|
|
1946
1740
|
categoryIndex: i,
|
|
1947
1741
|
seriesIndex: e,
|
|
1948
1742
|
color: v,
|
|
1949
|
-
shape:
|
|
1743
|
+
shape: R,
|
|
1950
1744
|
baseCoord: t,
|
|
1951
1745
|
endCoord: n,
|
|
1952
|
-
baseScale:
|
|
1953
|
-
endScale:
|
|
1746
|
+
baseScale: W,
|
|
1747
|
+
endScale: G,
|
|
1954
1748
|
omitBaseCap: !1,
|
|
1955
1749
|
omitEndCap: !1,
|
|
1956
|
-
outline:
|
|
1750
|
+
outline: y,
|
|
1957
1751
|
outlineColor: S ? `#${S}` : "rgba(0,0,0,0.42)",
|
|
1958
|
-
outlineWidth: C == null ? .75 * r /
|
|
1959
|
-
outlineDash:
|
|
1960
|
-
outlineCap:
|
|
1961
|
-
outlineJoin:
|
|
1752
|
+
outlineWidth: C == null ? .75 * r / h : ge(C, r),
|
|
1753
|
+
outlineDash: w,
|
|
1754
|
+
outlineCap: T,
|
|
1755
|
+
outlineJoin: D,
|
|
1962
1756
|
labelValue: _ ? s / 100 : s
|
|
1963
1757
|
});
|
|
1964
1758
|
} else {
|
|
1965
|
-
let t =
|
|
1759
|
+
let t = I.y + I.h - P.fraction(N) * I.h, n = I.y + I.h - P.fraction(L) * I.h, a = E ? b - 1 - i : i, o = I.x + a * d + g.offset;
|
|
1966
1760
|
c.push({
|
|
1967
1761
|
x: o,
|
|
1968
1762
|
y: Math.min(t, n),
|
|
1969
1763
|
width: g.size,
|
|
1970
1764
|
height: Math.abs(n - t),
|
|
1971
|
-
nearDepth:
|
|
1972
|
-
farDepth:
|
|
1765
|
+
nearDepth: m.near,
|
|
1766
|
+
farDepth: m.far,
|
|
1973
1767
|
categoryIndex: i,
|
|
1974
1768
|
seriesIndex: e,
|
|
1975
1769
|
color: v,
|
|
1976
|
-
shape:
|
|
1770
|
+
shape: R,
|
|
1977
1771
|
baseCoord: t,
|
|
1978
1772
|
endCoord: n,
|
|
1979
|
-
baseScale:
|
|
1980
|
-
endScale:
|
|
1773
|
+
baseScale: W,
|
|
1774
|
+
endScale: G,
|
|
1981
1775
|
omitBaseCap: !1,
|
|
1982
1776
|
omitEndCap: !1,
|
|
1983
|
-
outline:
|
|
1777
|
+
outline: y,
|
|
1984
1778
|
outlineColor: S ? `#${S}` : "rgba(0,0,0,0.42)",
|
|
1985
|
-
outlineWidth: C == null ? .75 * r /
|
|
1986
|
-
outlineDash:
|
|
1987
|
-
outlineCap:
|
|
1988
|
-
outlineJoin:
|
|
1779
|
+
outlineWidth: C == null ? .75 * r / h : ge(C, r),
|
|
1780
|
+
outlineDash: w,
|
|
1781
|
+
outlineCap: T,
|
|
1782
|
+
outlineJoin: D,
|
|
1989
1783
|
labelValue: _ ? s / 100 : s
|
|
1990
1784
|
});
|
|
1991
1785
|
}
|
|
1992
1786
|
}
|
|
1993
1787
|
}
|
|
1994
1788
|
if (o) {
|
|
1995
|
-
let e =
|
|
1996
|
-
for (let t = 0; t <
|
|
1789
|
+
let e = _e(c, b);
|
|
1790
|
+
for (let t = 0; t < b; t++) {
|
|
1997
1791
|
let n = e[t];
|
|
1998
1792
|
for (let e of [-1, 1]) {
|
|
1999
|
-
let t = n.filter((t) => Math.sign(t.labelValue) === e && !
|
|
1793
|
+
let t = n.filter((t) => Math.sign(t.labelValue) === e && !Ce(t.color) && Math.abs(t.endCoord - t.baseCoord) > 1e-9).sort((e, t) => e.seriesIndex - t.seriesIndex);
|
|
2000
1794
|
for (let e = 0; e + 1 < t.length; e++) {
|
|
2001
1795
|
let n = t[e], r = t[e + 1], i = 1e-8 * Math.max(1, Math.abs(n.endCoord), Math.abs(r.baseCoord));
|
|
2002
1796
|
n.shape !== r.shape || Math.abs(n.endCoord - r.baseCoord) > i || Math.abs(n.endScale - r.baseScale) > 1e-9 || n.nearDepth !== r.nearDepth || n.farDepth !== r.farDepth || (n.omitEndCap = !0, r.omitBaseCap = !0);
|
|
2003
1797
|
}
|
|
2004
1798
|
}
|
|
2005
|
-
let r = n.find((e) => e.labelValue > 0 && !
|
|
1799
|
+
let r = n.find((e) => e.labelValue > 0 && !Ce(e.color)), i = n.find((e) => e.labelValue < 0 && !Ce(e.color));
|
|
2006
1800
|
if (r && i) {
|
|
2007
1801
|
let e = 1e-8 * Math.max(1, Math.abs(r.baseCoord), Math.abs(i.baseCoord));
|
|
2008
1802
|
r.shape === i.shape && Math.abs(r.baseCoord - i.baseCoord) <= e && Math.abs(r.baseScale - i.baseScale) <= 1e-9 && r.nearDepth === i.nearDepth && r.farDepth === i.farDepth && (r.omitBaseCap = !0, i.omitBaseCap = !0);
|
|
2009
1803
|
}
|
|
2010
1804
|
}
|
|
2011
1805
|
}
|
|
2012
|
-
let
|
|
2013
|
-
remaining:
|
|
1806
|
+
let m = {
|
|
1807
|
+
remaining: te,
|
|
2014
1808
|
exceeded: !1
|
|
2015
|
-
}, g = c.flatMap((e) =>
|
|
1809
|
+
}, g = c.flatMap((e) => Ee(p, e.shape, a, e.x, e.y, e.width, e.height, e.baseCoord, e.endCoord, e.nearDepth, e.farDepth, e.color, e.baseScale, e.endScale, e.omitBaseCap, e.omitEndCap, e.outline && e.outlineColor ? {
|
|
2016
1810
|
color: e.outlineColor,
|
|
2017
1811
|
width: e.outlineWidth,
|
|
2018
|
-
dash:
|
|
1812
|
+
dash: y(e.outlineDash, e.outlineWidth),
|
|
2019
1813
|
cap: e.outlineCap,
|
|
2020
1814
|
join: e.outlineJoin
|
|
2021
|
-
} : void 0,
|
|
2022
|
-
if (
|
|
2023
|
-
for (let t of
|
|
1815
|
+
} : void 0, m));
|
|
1816
|
+
if (m.exceeded) return je(e, n), !0;
|
|
1817
|
+
for (let t of K(g)) ke(e, t);
|
|
2024
1818
|
for (let i of c) {
|
|
2025
|
-
let o = t.series[i.seriesIndex], s = a ? p.project(i.endCoord, i.y + i.height / 2, (i.nearDepth + i.farDepth) / 2) : p.project(i.x + i.width / 2, i.endCoord, (i.nearDepth + i.farDepth) / 2), c =
|
|
2026
|
-
|
|
1819
|
+
let o = t.series[i.seriesIndex], s = a ? p.project(i.endCoord, i.y + i.height / 2, (i.nearDepth + i.farDepth) / 2) : p.project(i.x + i.width / 2, i.endCoord, (i.nearDepth + i.farDepth) / 2), c = H[i.seriesIndex].get(i.categoryIndex);
|
|
1820
|
+
Ie(t, o, c) && R.push(() => Fe(e, t, o, i.seriesIndex, i.categoryIndex, i.labelValue, s, n, r, 0, void 0, c, "t", s, !0, t.valAxisDisplayUnits));
|
|
2027
1821
|
}
|
|
2028
1822
|
} else {
|
|
2029
|
-
let i = t.series.map(() => Array(
|
|
1823
|
+
let i = t.series.map(() => Array(b).fill(0)), a = t.series.map(() => Array(b).fill(0));
|
|
2030
1824
|
if (o) {
|
|
2031
|
-
let e = Array(
|
|
2032
|
-
for (let r = 0; r < t.series.length; r++) for (let t = 0; t <
|
|
2033
|
-
let o =
|
|
2034
|
-
i[r][t] = s, a[r][t] =
|
|
1825
|
+
let e = Array(b).fill(0), n = Array(b).fill(0);
|
|
1826
|
+
for (let r = 0; r < t.series.length; r++) for (let t = 0; t < b; t++) {
|
|
1827
|
+
let o = A(r, t), s = o >= 0 ? e[t] : n[t];
|
|
1828
|
+
i[r][t] = s, a[r][t] = j(s, o), o >= 0 ? e[t] = j(e[t], o) : n[t] = j(n[t], o);
|
|
2035
1829
|
}
|
|
2036
1830
|
}
|
|
2037
1831
|
let s = (e) => {
|
|
2038
|
-
let t = p.seriesDepth(e,
|
|
2039
|
-
for (let i = 0; i <
|
|
2040
|
-
if (!
|
|
2041
|
-
let s = o ? a[e][i] :
|
|
1832
|
+
let t = p.seriesDepth(e, L, o), n = 0, r = 0;
|
|
1833
|
+
for (let i = 0; i < b; i++) {
|
|
1834
|
+
if (!ee(e, i)) continue;
|
|
1835
|
+
let s = o ? a[e][i] : A(e, i), c = I.x + g(i, b, D, E) * I.w, l = I.y + I.h - P.fraction(F(s)) * I.h;
|
|
2042
1836
|
n += p.cameraDepth(c, l, t), r++;
|
|
2043
1837
|
}
|
|
2044
1838
|
return r > 0 ? n / r : -Infinity;
|
|
2045
1839
|
}, c = t.series.map((e, t) => t).sort((e, t) => s(e) - s(t) || t - e), l = [], u = [], d = !1;
|
|
2046
1840
|
for (let s of c) {
|
|
2047
1841
|
if (d) break;
|
|
2048
|
-
let c = t.series[s], f =
|
|
2049
|
-
for (let e = 0; e <
|
|
2050
|
-
if (!
|
|
2051
|
-
|
|
1842
|
+
let c = t.series[s], f = ve(s, c), m = o ? p.prismInterval(0, 1, !0) : p.prismInterval(s, L, !1), h = I.x + I.w / 2, v = I.y + I.h / 2, x = p.cameraDepth(h, v, m.near) >= p.cameraDepth(h, v, m.far) ? m.near : m.far, C = [], w = [], k = [], j = [], M = [], N = [], F = [], U = [], W = [], G = [];
|
|
1843
|
+
for (let e = 0; e < b; e++) {
|
|
1844
|
+
if (!ee(s, e)) {
|
|
1845
|
+
C.push(null), w.push(null), k.push(null), j.push(null), M.push(null), N.push(null), F.push(null), U.push(null), W.push(null), G.push(null);
|
|
2052
1846
|
continue;
|
|
2053
1847
|
}
|
|
2054
|
-
let n = o ? a[s][e] :
|
|
2055
|
-
|
|
1848
|
+
let n = o ? a[s][e] : A(s, e), r = o ? i[s][e] : 0, c = I.x + g(e, b, D, E) * I.w, l = P.fraction(n), u = P.fraction(r), d = Number.isFinite(u) ? u : r <= P.min ? 0 : 1, f = Number.isFinite(l) && l >= 0 && l <= 1, m = Number.isFinite(l) ? Math.max(0, Math.min(1, l)) : n <= P.min ? 0 : 1, h = I.y + I.h - m * I.h, _ = I.y + I.h - Math.max(0, Math.min(1, d)) * I.h;
|
|
1849
|
+
C.push(t.chartType.toLowerCase().includes("area") || f ? p.project(c, h, x) : null), w.push(p.project(c, _, x)), k.push(f ? p.cameraDepth(c, h, x) : null), j.push(p.cameraDepth(c, _, x)), M.push(n), N.push(c), F.push(h), U.push(_), W.push(l), G.push(d);
|
|
2056
1850
|
}
|
|
2057
|
-
let
|
|
2058
|
-
for (let e = 0; e <
|
|
2059
|
-
let t =
|
|
1851
|
+
let K = [], q = null;
|
|
1852
|
+
for (let e = 0; e < C.length; e++) {
|
|
1853
|
+
let t = C[e], n = w[e];
|
|
2060
1854
|
if (!t || !n) {
|
|
2061
|
-
|
|
1855
|
+
O === "gap" && (q && K.push(q), q = null);
|
|
2062
1856
|
continue;
|
|
2063
1857
|
}
|
|
2064
|
-
|
|
1858
|
+
q ??= {
|
|
2065
1859
|
upper: [],
|
|
2066
1860
|
lower: [],
|
|
2067
1861
|
upperDepths: [],
|
|
@@ -2072,26 +1866,26 @@ function nt(e, t, n, r) {
|
|
|
2072
1866
|
lowerYs: [],
|
|
2073
1867
|
upperFractions: [],
|
|
2074
1868
|
lowerFractions: []
|
|
2075
|
-
},
|
|
1869
|
+
}, q.upper.push(t), q.lower.push(n), q.upperDepths.push(k[e] ?? 0), q.lowerDepths.push(j[e] ?? 0), q.indices.push(e), q.sceneXs.push(N[e] ?? 0), q.upperYs.push(F[e] ?? 0), q.lowerYs.push(U[e] ?? 0), q.upperFractions.push(W[e] ?? 0), q.lowerFractions.push(G[e] ?? 0);
|
|
2076
1870
|
}
|
|
2077
|
-
|
|
2078
|
-
let
|
|
2079
|
-
if (t.chartType.toLowerCase().includes("area")) for (let t of
|
|
1871
|
+
q && K.push(q);
|
|
1872
|
+
let te = [];
|
|
1873
|
+
if (t.chartType.toLowerCase().includes("area")) for (let t of K) {
|
|
2080
1874
|
let n = null;
|
|
2081
1875
|
for (let r = 0; r + 1 < t.upper.length; r++) {
|
|
2082
|
-
let i =
|
|
1876
|
+
let i = B(t.lowerFractions[r], t.lowerFractions[r + 1], t.upperFractions[r], t.upperFractions[r + 1]);
|
|
2083
1877
|
for (let a = 0; a < i.length; a++) {
|
|
2084
|
-
let o = i[a], s = t.sceneXs[r] + (t.sceneXs[r + 1] - t.sceneXs[r]) * o.startT, c = t.sceneXs[r] + (t.sceneXs[r + 1] - t.sceneXs[r]) * o.endT, u =
|
|
2085
|
-
...p.project(s, g,
|
|
2086
|
-
cameraDepth: p.cameraDepth(s, g,
|
|
2087
|
-
cameraWeight: p.cameraProjectionWeight(s, g,
|
|
1878
|
+
let o = i[a], s = t.sceneXs[r] + (t.sceneXs[r + 1] - t.sceneXs[r]) * o.startT, c = t.sceneXs[r] + (t.sceneXs[r + 1] - t.sceneXs[r]) * o.endT, u = I.y + I.h - o.lowerStart * I.h, h = I.y + I.h - o.lowerEnd * I.h, g = I.y + I.h - o.upperStart * I.h, _ = I.y + I.h - o.upperEnd * I.h, v = {
|
|
1879
|
+
...p.project(s, g, x),
|
|
1880
|
+
cameraDepth: p.cameraDepth(s, g, x),
|
|
1881
|
+
cameraWeight: p.cameraProjectionWeight(s, g, x)
|
|
2088
1882
|
}, y = {
|
|
2089
|
-
...p.project(c, _,
|
|
2090
|
-
cameraDepth: p.cameraDepth(c, _,
|
|
2091
|
-
cameraWeight: p.cameraProjectionWeight(c, _,
|
|
1883
|
+
...p.project(c, _, x),
|
|
1884
|
+
cameraDepth: p.cameraDepth(c, _, x),
|
|
1885
|
+
cameraWeight: p.cameraProjectionWeight(c, _, x)
|
|
2092
1886
|
};
|
|
2093
|
-
n != null && Math.hypot(n.at(-1).x - v.x, n.at(-1).y - v.y) <= 1e-8 ? n.push(y) : (n && n.length >= 2 &&
|
|
2094
|
-
let b =
|
|
1887
|
+
n != null && Math.hypot(n.at(-1).x - v.x, n.at(-1).y - v.y) <= 1e-8 ? n.push(y) : (n && n.length >= 2 && te.push(n), n = [v, y]);
|
|
1888
|
+
let b = Te(p, s, c, u, h, g, _, m.near, m.far, f, r === 0 && a === 0 && o.startT === 0, r + 2 === t.upper.length && a + 1 === i.length && o.endT === 1);
|
|
2095
1889
|
for (let t of b) {
|
|
2096
1890
|
if (l.length >= 1e4) {
|
|
2097
1891
|
d = !0;
|
|
@@ -2103,39 +1897,39 @@ function nt(e, t, n, r) {
|
|
|
2103
1897
|
cameraDepths: t.cameraDepths,
|
|
2104
1898
|
cameraWeights: t.cameraWeights,
|
|
2105
1899
|
layer: 0,
|
|
2106
|
-
paint: () =>
|
|
1900
|
+
paint: () => ke(e, t)
|
|
2107
1901
|
});
|
|
2108
1902
|
}
|
|
2109
1903
|
if (d) break;
|
|
2110
1904
|
}
|
|
2111
1905
|
if (d) break;
|
|
2112
1906
|
}
|
|
2113
|
-
if (n && n.length >= 2 &&
|
|
1907
|
+
if (n && n.length >= 2 && te.push(n), d) break;
|
|
2114
1908
|
}
|
|
2115
|
-
let
|
|
1909
|
+
let ne = [];
|
|
2116
1910
|
if (!t.chartType.toLowerCase().includes("area")) {
|
|
2117
1911
|
let e = [], t = null;
|
|
2118
|
-
for (let n = 0; n <
|
|
2119
|
-
let r =
|
|
1912
|
+
for (let n = 0; n < b; n++) {
|
|
1913
|
+
let r = M[n], i = r == null ? NaN : P.fraction(r);
|
|
2120
1914
|
if (r == null || !Number.isFinite(i)) {
|
|
2121
|
-
|
|
1915
|
+
O === "gap" && t && (e.push(t), t = null);
|
|
2122
1916
|
continue;
|
|
2123
1917
|
}
|
|
2124
1918
|
t ??= [], t.push({
|
|
2125
|
-
x:
|
|
1919
|
+
x: I.x + g(n, b, D, E) * I.w,
|
|
2126
1920
|
fraction: i
|
|
2127
1921
|
});
|
|
2128
1922
|
}
|
|
2129
1923
|
t && e.push(t);
|
|
2130
1924
|
let n = (e) => {
|
|
2131
|
-
let t = Math.max(0, Math.min(1, e.fraction)), n =
|
|
1925
|
+
let t = Math.max(0, Math.min(1, e.fraction)), n = I.y + I.h - t * I.h;
|
|
2132
1926
|
return {
|
|
2133
|
-
...p.project(e.x, n,
|
|
2134
|
-
cameraDepth: p.cameraDepth(e.x, n,
|
|
2135
|
-
cameraWeight: p.cameraProjectionWeight(e.x, n,
|
|
1927
|
+
...p.project(e.x, n, x),
|
|
1928
|
+
cameraDepth: p.cameraDepth(e.x, n, x),
|
|
1929
|
+
cameraWeight: p.cameraProjectionWeight(e.x, n, x)
|
|
2136
1930
|
};
|
|
2137
1931
|
}, r = (e) => {
|
|
2138
|
-
e && e.path.length >= 2 &&
|
|
1932
|
+
e && e.path.length >= 2 && ne.push(e);
|
|
2139
1933
|
};
|
|
2140
1934
|
for (let t of e) {
|
|
2141
1935
|
if (t.length < 2) continue;
|
|
@@ -2163,7 +1957,7 @@ function nt(e, t, n, r) {
|
|
|
2163
1957
|
}
|
|
2164
1958
|
let i = null, a = 0;
|
|
2165
1959
|
for (let t = 0; t + 1 < e.length; t++) {
|
|
2166
|
-
let o = e[t], s = e[t + 1], c = (e) => p.project(e.x,
|
|
1960
|
+
let o = e[t], s = e[t + 1], c = (e) => p.project(e.x, I.y + I.h - e.fraction * I.h, x), l = c(o), u = c(s), d = Math.hypot(u.x - l.x, u.y - l.y), f = Number.isFinite(d) ? d : Math.hypot(s.x - o.x, (s.fraction - o.fraction) * I.h), m = z(o.fraction, s.fraction);
|
|
2167
1961
|
if (!m || m.endT - m.startT <= 1e-12) {
|
|
2168
1962
|
r(i), i = null, a += f;
|
|
2169
1963
|
continue;
|
|
@@ -2182,9 +1976,9 @@ function nt(e, t, n, r) {
|
|
|
2182
1976
|
r(i);
|
|
2183
1977
|
}
|
|
2184
1978
|
}
|
|
2185
|
-
let
|
|
2186
|
-
if (c.lineHidden !== !0 && (!
|
|
2187
|
-
let t = c.lineColor ? `#${c.lineColor}` :
|
|
1979
|
+
let J = t.chartType.toLowerCase().includes("area"), re = c.lineHidden != null || c.lineColor != null || c.lineWidthEmu != null || c.chartexStyle?.lineHidden != null || c.chartexStyle?.lineColors?.some(Boolean) || c.chartexStyle?.lineWidthEmu != null || c.chartexStyle?.lineDash != null || c.chartexStyle?.lineCap != null || c.chartexStyle?.lineJoin != null;
|
|
1980
|
+
if (c.lineHidden !== !0 && (!J || re)) {
|
|
1981
|
+
let t = c.lineColor ? `#${c.lineColor}` : T(f, .7), n = c.lineWidthEmu ? Math.max(.5, c.lineWidthEmu / S) * r : J ? .75 * r : Math.max(1, 2 * r), i = y(c.chartexStyle?.lineDash ?? "solid", n), a = c.chartexStyle?.lineCap === "rnd" ? "round" : c.chartexStyle?.lineCap === "sq" ? "square" : "butt", o = c.chartexStyle?.lineJoin === "round" || c.chartexStyle?.lineJoin === "bevel" ? c.chartexStyle.lineJoin : "miter", s = (r, s, c = s, u = 0) => {
|
|
2188
1982
|
let f = se(r, {
|
|
2189
1983
|
width: n,
|
|
2190
1984
|
dash: i,
|
|
@@ -2208,90 +2002,90 @@ function nt(e, t, n, r) {
|
|
|
2208
2002
|
cameraDepths: n.cameraDepths,
|
|
2209
2003
|
cameraWeights: n.cameraWeights,
|
|
2210
2004
|
layer: 1,
|
|
2211
|
-
paint: () =>
|
|
2005
|
+
paint: () => Ae(e, n, t)
|
|
2212
2006
|
});
|
|
2213
2007
|
};
|
|
2214
|
-
if (
|
|
2215
|
-
else for (let e of
|
|
2008
|
+
if (J) for (let e of te) s(e, a);
|
|
2009
|
+
else for (let e of ne) s(e.path, e.startClipped ? "butt" : a, e.endClipped ? "butt" : a, e.dashOffset);
|
|
2216
2010
|
}
|
|
2217
2011
|
let Y = c.dataPointOverrides?.some((e) => e.markerSymbol != null && e.markerSymbol !== "none") === !0;
|
|
2218
|
-
if (t.chartType.toLowerCase().includes("line") && (c.showMarker === !0 || Y)) for (let t = 0; t <
|
|
2219
|
-
let n =
|
|
2012
|
+
if (t.chartType.toLowerCase().includes("line") && (c.showMarker === !0 || Y)) for (let t = 0; t < C.length; t++) {
|
|
2013
|
+
let n = C[t];
|
|
2220
2014
|
if (!n) continue;
|
|
2221
|
-
let i =
|
|
2015
|
+
let i = V[s].get(t), a = i?.markerSymbol ?? (c.showMarker === !0 ? c.markerSymbol ?? "circle" : "none");
|
|
2222
2016
|
if (a === "none") continue;
|
|
2223
|
-
let o = i?.markerSize ?? c.markerSize ?? 5, l = i?.markerFill ?? c.markerFill ?? c.color ??
|
|
2224
|
-
u.push(() =>
|
|
2017
|
+
let o = i?.markerSize ?? c.markerSize ?? 5, l = i?.markerFill ?? c.markerFill ?? c.color ?? X[s % X.length], d = i?.markerLine ?? c.markerLine ?? c.lineColor ?? c.color ?? X[s % X.length], f = (i?.markerLineWidthEmu ?? c.markerLineWidthEmu) == null ? Math.max(.75, c.lineWidthEmu == null ? r : c.lineWidthEmu / S * r) : Math.max(.25, (i?.markerLineWidthEmu ?? c.markerLineWidthEmu ?? 0) / S * r);
|
|
2018
|
+
u.push(() => Pe(e, n, a, Math.max(2, o) * r, l === "00000000" ? "transparent" : `#${l}`, `#${d}`, f));
|
|
2225
2019
|
}
|
|
2226
|
-
for (let i = 0; i <
|
|
2227
|
-
let a =
|
|
2020
|
+
for (let i = 0; i < C.length; i++) {
|
|
2021
|
+
let a = C[i];
|
|
2228
2022
|
if (!a) continue;
|
|
2229
|
-
let o =
|
|
2230
|
-
|
|
2023
|
+
let o = A(s, i), l = V[s].get(i), u = l?.markerSize ?? c.markerSize ?? 5, d = H[s].get(i);
|
|
2024
|
+
Ie(t, c, d) && R.push(() => Fe(e, t, c, s, i, _ ? o / 100 : o, a, n, r, c.showMarker === !0 || l?.markerSymbol != null ? u * r / 2 : 0, void 0, d, "t", a, !0, t.valAxisDisplayUnits));
|
|
2231
2025
|
}
|
|
2232
2026
|
}
|
|
2233
|
-
if (d) return
|
|
2234
|
-
for (let e of
|
|
2027
|
+
if (d) return je(e, n), !0;
|
|
2028
|
+
for (let e of K(l)) e.paint();
|
|
2235
2029
|
for (let e of u) e();
|
|
2236
2030
|
}
|
|
2237
|
-
|
|
2238
|
-
let
|
|
2239
|
-
if (t !== "low" && t !== "high") return
|
|
2240
|
-
let n = p.topology.nearDepth, r =
|
|
2031
|
+
Ke(e, t, p, P, b, D, E, r, a ? "horizontal" : "vertical"), $e(e, t, p, P, b, D, E, a ? "horizontal" : "vertical", r), Be(e, t, n, p, P, b, D, E, a ? "horizontal" : "vertical", r);
|
|
2032
|
+
let U = Qe(t, p, P, b, D, E, a ? "horizontal" : "vertical"), W = (e, t) => {
|
|
2033
|
+
if (t !== "low" && t !== "high") return U;
|
|
2034
|
+
let n = p.topology.nearDepth, r = U.axisX, i = U.axisY;
|
|
2241
2035
|
if (e === "value" === a) {
|
|
2242
|
-
let e =
|
|
2036
|
+
let e = I.y, r = I.y + I.h, a = p.project(I.x + I.w / 2, e, n), o = p.project(I.x + I.w / 2, r, n), s = a.y >= o.y ? e : r;
|
|
2243
2037
|
i = t === "low" ? s : s === e ? r : e;
|
|
2244
2038
|
} else {
|
|
2245
|
-
let e =
|
|
2039
|
+
let e = I.x, i = I.x + I.w, a = p.project(e, I.y + I.h / 2, n), o = p.project(i, I.y + I.h / 2, n), s = a.x <= o.x ? e : i;
|
|
2246
2040
|
r = t === "low" ? s : s === e ? i : e;
|
|
2247
2041
|
}
|
|
2248
2042
|
return {
|
|
2249
2043
|
axisX: r,
|
|
2250
2044
|
axisY: i,
|
|
2251
2045
|
depth: n,
|
|
2252
|
-
horizontalStart: p.project(
|
|
2253
|
-
horizontalEnd: p.project(
|
|
2254
|
-
verticalStart: p.project(r,
|
|
2255
|
-
verticalEnd: p.project(r,
|
|
2046
|
+
horizontalStart: p.project(I.x, i, n),
|
|
2047
|
+
horizontalEnd: p.project(I.x + I.w, i, n),
|
|
2048
|
+
verticalStart: p.project(r, I.y + I.h, n),
|
|
2049
|
+
verticalEnd: p.project(r, I.y, n)
|
|
2256
2050
|
};
|
|
2257
|
-
},
|
|
2258
|
-
if (e.font = `${t.valAxisFontItalic ? "italic " : ""}${t.valAxisFontBold ? "bold " : ""}${
|
|
2259
|
-
let { axisX: n, axisY: i, depth: o } =
|
|
2051
|
+
}, G = W("value", t.valAxisTickLabelPos), q = W("category", t.catAxisTickLabelPos), ne = f(t.valAxisFontSizeHpt, r) ?? 9 * r;
|
|
2052
|
+
if (e.font = `${t.valAxisFontItalic ? "italic " : ""}${t.valAxisFontBold ? "bold " : ""}${ne}px ${xe(t.valAxisFontFace)}`, e.fillStyle = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#595959", e.textAlign = a ? "center" : "right", e.textBaseline = a ? "top" : "middle", !t.valAxisHidden && t.valAxisTickLabelPos !== "none") {
|
|
2053
|
+
let { axisX: n, axisY: i, depth: o } = G, s = p.project(I.x + I.w / 2, I.y + I.h / 2, o), l = qe(a ? G.horizontalStart : G.verticalStart, a ? G.horizontalEnd : G.verticalEnd, s, a ? "vertical" : "horizontal");
|
|
2260
2054
|
e.textAlign = Math.abs(l.x) < .2 ? "center" : l.x < 0 ? "right" : "left", e.textBaseline = Math.abs(l.y) < .2 ? "middle" : l.y < 0 ? "bottom" : "top";
|
|
2261
|
-
let u =
|
|
2262
|
-
for (let r of
|
|
2263
|
-
let s = a ? p.project(
|
|
2055
|
+
let u = Ze(t.valAxisMajorTickMark, t.valAxisLineHidden, r, 5), d = t.valAxisDisplayUnits?.divisor;
|
|
2056
|
+
for (let r of P.majorTicks) {
|
|
2057
|
+
let s = a ? p.project(I.x + P.fraction(r) * I.w, i, o) : p.project(n, I.y + I.h - P.fraction(r) * I.h, o);
|
|
2264
2058
|
e.fillText(c(_ ? r / 100 : d != null && Number.isFinite(d) && d > 0 ? r / d : r, _ ? t.valAxisFormatCode ?? "0%" : t.valAxisFormatCode, t.date1904), s.x + l.x * u, s.y + l.y * u);
|
|
2265
2059
|
}
|
|
2266
2060
|
}
|
|
2267
|
-
let J =
|
|
2268
|
-
if (e.font = `${t.catAxisFontItalic ? "italic " : ""}${t.catAxisFontBold ? "bold " : ""}${J}px ${
|
|
2269
|
-
let n =
|
|
2270
|
-
if (o == null && (o = 0, !a &&
|
|
2271
|
-
let t = Infinity, n = null, r =
|
|
2272
|
-
for (let e = 0; e <
|
|
2273
|
-
let i =
|
|
2061
|
+
let J = f(t.catAxisFontSizeHpt, r) ?? 9 * r;
|
|
2062
|
+
if (e.font = `${t.catAxisFontItalic ? "italic " : ""}${t.catAxisFontBold ? "bold " : ""}${J}px ${xe(t.catAxisFontFace)}`, e.fillStyle = t.catAxisFontColor ? `#${t.catAxisFontColor}` : "#595959", !t.catAxisHidden && t.catAxisTickLabelPos !== "none") {
|
|
2063
|
+
let n = Ze(t.catAxisMajorTickMark, t.catAxisLineHidden, r, 6), i = Array.from({ length: b }, (e, n) => l(String(v[n] ?? n + 1), t.catAxisFormatCode, t.date1904)), o = Me(t);
|
|
2064
|
+
if (o == null && (o = 0, !a && b > 1)) {
|
|
2065
|
+
let t = Infinity, n = null, r = q.axisY;
|
|
2066
|
+
for (let e = 0; e < b; e++) {
|
|
2067
|
+
let i = g(e, b, D, E), a = p.project(I.x + i * I.w, r, p.topology.nearDepth);
|
|
2274
2068
|
n && (t = Math.min(t, Math.hypot(a.x - n.x, a.y - n.y))), n = a;
|
|
2275
2069
|
}
|
|
2276
2070
|
Math.max(0, ...i.map((t) => e.measureText(t).width)) > t * .9 && (o = -Math.PI / 4);
|
|
2277
2071
|
}
|
|
2278
2072
|
let s = Math.max(1, Math.floor(t.catAxisTickLabelSkip ?? 1));
|
|
2279
|
-
for (let t = 0; t <
|
|
2280
|
-
let r =
|
|
2073
|
+
for (let t = 0; t < b; t += s) {
|
|
2074
|
+
let r = g(t, b, D, E), { axisX: s, axisY: c, depth: l } = q, u = a ? p.project(s, I.y + g(t, b, D, E) * I.h, l) : p.project(I.x + r * I.w, c, l);
|
|
2281
2075
|
if (a) {
|
|
2282
|
-
let r = p.project(s,
|
|
2076
|
+
let r = p.project(s, I.y + I.h / 2, l), a = p.project(I.x + I.w / 2, I.y + I.h / 2, l), o = r.x <= a.x;
|
|
2283
2077
|
e.textAlign = o ? "right" : "left", e.textBaseline = "middle", e.fillText(i[t], u.x + (o ? -n : n), u.y);
|
|
2284
2078
|
} else {
|
|
2285
|
-
let r = p.project(
|
|
2286
|
-
|
|
2079
|
+
let r = p.project(I.x + I.w / 2, I.y + I.h / 2, l), s = qe(q.horizontalStart, q.horizontalEnd, r, "vertical");
|
|
2080
|
+
Ne(e, i[t], u, o, a, s.y < 0 ? -1 : 1, n);
|
|
2287
2081
|
}
|
|
2288
2082
|
}
|
|
2289
2083
|
}
|
|
2290
|
-
|
|
2291
|
-
for (let e of
|
|
2292
|
-
return
|
|
2084
|
+
ze(e, t, n, u, a, r);
|
|
2085
|
+
for (let e of R) e();
|
|
2086
|
+
return Ve(e, t, d, r), !0;
|
|
2293
2087
|
}
|
|
2294
|
-
function
|
|
2088
|
+
function tt(e, t, n, r) {
|
|
2295
2089
|
if (!t.threeD || t.chartType !== "pie") return !1;
|
|
2296
2090
|
let i = t.series[0];
|
|
2297
2091
|
if (!i) return !0;
|
|
@@ -2303,7 +2097,7 @@ function rt(e, t, n, r) {
|
|
|
2303
2097
|
if (!(o > 0)) return !0;
|
|
2304
2098
|
let s = a.reduce((e, t) => e + t.value / o, 0);
|
|
2305
2099
|
if (!(s > 0) || !Number.isFinite(s)) return !0;
|
|
2306
|
-
let { plot: c, legend: l } =
|
|
2100
|
+
let { plot: c, legend: l } = Le(e, t, n, r, "radial"), u = C({
|
|
2307
2101
|
...t.threeD,
|
|
2308
2102
|
rotationY: t.threeD.rotationY ?? 0,
|
|
2309
2103
|
depthPercent: 100
|
|
@@ -2312,82 +2106,82 @@ function rt(e, t, n, r) {
|
|
|
2312
2106
|
sceneHeightScale: .15
|
|
2313
2107
|
});
|
|
2314
2108
|
if (!u) return !0;
|
|
2315
|
-
let
|
|
2316
|
-
for (let e of
|
|
2109
|
+
let d = new Map(i.dataPointOverrides?.map((e) => [e.idx, e]) ?? []), p = 0;
|
|
2110
|
+
for (let e of d.values()) e.explosion != null && Number.isFinite(e.explosion) && (p = Math.max(p, Math.max(0, Math.min(100, e.explosion)) / 100));
|
|
2317
2111
|
let { scene: m } = u, h = Math.min(m.w * .45 / (1 + p), u.modelDepth * .45 / (1 + p), m.h / .45);
|
|
2318
2112
|
if (!(h > 0)) return !0;
|
|
2319
|
-
let
|
|
2113
|
+
let g = m.x + m.w / 2, _ = m.y + m.h / 2, v = .5, b = h * .3, x = 0, w = [], D = new Map(i.dataLabelOverrides?.map((e) => [e.idx, e]) ?? []), O = Math.max(48, Math.min(128, Math.ceil(Math.PI * 2 * h / 4)));
|
|
2320
2114
|
for (let e of a) {
|
|
2321
|
-
let n = e.value / o / s, r =
|
|
2115
|
+
let n = e.value / o / s, r = Ue(t.firstSliceAngle, x, n), a = d.get(e.index), c = a?.fillHidden === !0 ? "00000000" : a?.color ?? i.dataPointColors?.[e.index] ?? i.color, l = r.middle, f = a?.explosion != null && Number.isFinite(a.explosion) ? Math.max(0, Math.min(100, a.explosion)) / 100 : 0, p = g + Math.cos(l) * h * f, m = v + Math.sin(l) * h * f / u.modelDepth, y = Math.max(2, Math.ceil(O * n)), S = R({
|
|
2322
2116
|
centerX: p,
|
|
2323
|
-
centerY:
|
|
2117
|
+
centerY: _,
|
|
2324
2118
|
centerDepth: m,
|
|
2325
2119
|
radius: h,
|
|
2326
2120
|
modelDepth: u.modelDepth,
|
|
2327
|
-
thickness:
|
|
2121
|
+
thickness: b,
|
|
2328
2122
|
startAngle: r.start,
|
|
2329
2123
|
endAngle: r.end,
|
|
2330
|
-
segments:
|
|
2124
|
+
segments: y
|
|
2331
2125
|
});
|
|
2332
|
-
if (!
|
|
2333
|
-
|
|
2126
|
+
if (!S) {
|
|
2127
|
+
x += n;
|
|
2334
2128
|
continue;
|
|
2335
2129
|
}
|
|
2336
|
-
|
|
2130
|
+
w.push({
|
|
2337
2131
|
index: e.index,
|
|
2338
2132
|
start: r.start,
|
|
2339
2133
|
end: r.end,
|
|
2340
|
-
color: c === "00000000" ? "transparent" : c ? `#${c}` :
|
|
2134
|
+
color: c === "00000000" ? "transparent" : c ? `#${c}` : ve(e.index),
|
|
2341
2135
|
value: e.value,
|
|
2342
2136
|
percentValue: n,
|
|
2343
2137
|
centerX: p,
|
|
2344
2138
|
centerDepth: m,
|
|
2345
|
-
segments:
|
|
2346
|
-
mesh:
|
|
2139
|
+
segments: y,
|
|
2140
|
+
mesh: S,
|
|
2347
2141
|
lineHidden: a?.lineHidden ?? i.lineHidden ?? !1,
|
|
2348
2142
|
lineColor: a?.lineColor ?? i.lineColor ?? null,
|
|
2349
2143
|
lineWidthEmu: a?.lineWidthEmu ?? i.lineWidthEmu ?? null,
|
|
2350
2144
|
lineDash: a?.lineDash ?? i.chartexStyle?.lineDash ?? "solid",
|
|
2351
2145
|
lineCap: i.chartexStyle?.lineCap === "rnd" ? "round" : i.chartexStyle?.lineCap === "sq" ? "square" : "butt",
|
|
2352
2146
|
lineJoin: i.chartexStyle?.lineJoin === "round" || i.chartexStyle?.lineJoin === "bevel" ? i.chartexStyle.lineJoin : "miter"
|
|
2353
|
-
}),
|
|
2147
|
+
}), x += n;
|
|
2354
2148
|
}
|
|
2355
|
-
u =
|
|
2356
|
-
let
|
|
2357
|
-
remaining:
|
|
2149
|
+
u = E(u, w.flatMap((e) => e.mesh.vertices), c, .08);
|
|
2150
|
+
let A = [], j = {
|
|
2151
|
+
remaining: te,
|
|
2358
2152
|
exceeded: !1
|
|
2359
2153
|
}, M = (e) => {
|
|
2360
|
-
let t = e.lineWidthEmu == null ? .75 * r : Math.max(.25, e.lineWidthEmu /
|
|
2154
|
+
let t = e.lineWidthEmu == null ? .75 * r : Math.max(.25, e.lineWidthEmu / S * r);
|
|
2361
2155
|
return !e.lineHidden && e.lineColor ? {
|
|
2362
2156
|
color: `#${e.lineColor}`,
|
|
2363
2157
|
width: t,
|
|
2364
|
-
dash:
|
|
2158
|
+
dash: y(e.lineDash, t),
|
|
2365
2159
|
cap: e.lineCap,
|
|
2366
2160
|
join: e.lineJoin
|
|
2367
2161
|
} : void 0;
|
|
2368
|
-
}, N =
|
|
2162
|
+
}, N = w.flatMap((e) => De(u, e.mesh, e.color, void 0, j)), P = [], F = w.map(M), I = F[0], L = (e) => e == null ? null : [
|
|
2369
2163
|
e.color,
|
|
2370
2164
|
e.width,
|
|
2371
2165
|
e.dash.join(","),
|
|
2372
2166
|
e.cap,
|
|
2373
2167
|
e.join
|
|
2374
|
-
].join("|"),
|
|
2375
|
-
if (
|
|
2376
|
-
else for (let e = 0; e <
|
|
2168
|
+
].join("|"), z = I != null && F.every((e) => L(e) === L(I)) && w.every((e) => Math.abs(e.centerX - g) < 1e-9 && Math.abs(e.centerDepth - v) < 1e-9);
|
|
2169
|
+
if (z) P.push(...Oe(u, w, _, h, b, I, j));
|
|
2170
|
+
else for (let e = 0; e < w.length; e++) {
|
|
2377
2171
|
let t = F[e];
|
|
2378
|
-
t && P.push(...
|
|
2172
|
+
t && P.push(...De(u, w[e].mesh, "transparent", t, j, !0));
|
|
2379
2173
|
}
|
|
2380
|
-
if (
|
|
2381
|
-
if (
|
|
2382
|
-
for (let t of
|
|
2383
|
-
for (let t of
|
|
2384
|
-
} else for (let t of
|
|
2385
|
-
for (let n of
|
|
2386
|
-
let a = (n.start + n.end) / 2, o =
|
|
2387
|
-
if (
|
|
2388
|
-
let s = i.seriesDataLabels, l =
|
|
2389
|
-
e.font = `${o?.fontBold ?? s?.fontBold ?? t.dataLabelFontBold ? "bold " : ""}${l}px ${
|
|
2390
|
-
let
|
|
2174
|
+
if (j.exceeded) return je(e, n), !0;
|
|
2175
|
+
if (z) {
|
|
2176
|
+
for (let t of K(N)) ke(e, t);
|
|
2177
|
+
for (let t of K(P)) ke(e, t);
|
|
2178
|
+
} else for (let t of K([...N, ...P])) ke(e, t);
|
|
2179
|
+
for (let n of w) {
|
|
2180
|
+
let a = (n.start + n.end) / 2, o = D.get(n.index);
|
|
2181
|
+
if (Ie(t, i, o)) {
|
|
2182
|
+
let s = i.seriesDataLabels, l = f(o?.fontSizeHpt ?? s?.fontSizeHpt ?? t.dataLabelFontSizeHpt, r) ?? 9 * r;
|
|
2183
|
+
e.font = `${o?.fontBold ?? s?.fontBold ?? t.dataLabelFontBold ? "bold " : ""}${l}px ${Z(t, o?.fontFace ?? s?.fontFace ?? t.dataLabelFontFace)}`;
|
|
2184
|
+
let d = ee({
|
|
2391
2185
|
customText: o?.text,
|
|
2392
2186
|
showCategory: o?.showCatName ?? s?.showCatName ?? !1,
|
|
2393
2187
|
showSeries: o?.showSerName ?? s?.showSerName ?? !1,
|
|
@@ -2400,27 +2194,27 @@ function rt(e, t, n, r) {
|
|
|
2400
2194
|
formatCode: o?.formatCode ?? s?.formatCode ?? t.dataLabelFormatCode ?? i.valFormatCode,
|
|
2401
2195
|
separator: o?.separator ?? s?.separator,
|
|
2402
2196
|
date1904: t.date1904
|
|
2403
|
-
}), p =
|
|
2197
|
+
}), p = Z(t, o?.fontFace ?? s?.fontFace ?? t.dataLabelFontFace), m = o?.text && o.richRuns?.length ? k(e, {
|
|
2404
2198
|
runs: o.richRuns,
|
|
2405
2199
|
ptToPx: r,
|
|
2406
2200
|
fontFamily: p,
|
|
2407
2201
|
fallbackBold: o.fontBold ?? s?.fontBold ?? t.dataLabelFontBold ?? !1,
|
|
2408
|
-
fontFamilyForFace: (e) =>
|
|
2409
|
-
}, l, `#${o.fontColor ?? s?.fontColor ?? i.labelColor ?? t.dataLabelFontColor ?? "111111"}`) : null, g = o?.position ?? s?.position ?? t.dataLabelPosition,
|
|
2202
|
+
fontFamilyForFace: (e) => Z(t, e)
|
|
2203
|
+
}, l, `#${o.fontColor ?? s?.fontColor ?? i.labelColor ?? t.dataLabelFontColor ?? "111111"}`) : null, g = o?.position ?? s?.position ?? t.dataLabelPosition, v = _ - b / 2, y = _ + b / 2, x = u.cameraDepth(n.centerX, v, n.centerDepth) >= u.cameraDepth(n.centerX, y, n.centerDepth) ? v : y, S = 0, C = null;
|
|
2410
2204
|
for (let e = 0; e <= 12; e++) {
|
|
2411
2205
|
let t = n.start + (n.end - n.start) * e / 12, r = u.project(n.centerX + Math.cos(t) * h * .64, x, n.centerDepth + Math.sin(t) * h * .64 / u.modelDepth);
|
|
2412
|
-
|
|
2206
|
+
C && (S += Math.hypot(r.x - C.x, r.y - C.y)), C = r;
|
|
2413
2207
|
}
|
|
2414
|
-
let
|
|
2415
|
-
|
|
2208
|
+
let w = (g == null || g === "bestFit") && (n.percentValue === 0 || S < (m?.width ?? e.measureText(d).width)) || g === "outEnd", T = h * (w ? 1.12 : .64), E = u.project(n.centerX + Math.cos(a) * T, x, n.centerDepth + Math.sin(a) * T / u.modelDepth), D = u.project(n.centerX + Math.cos(a) * h, x, n.centerDepth + Math.sin(a) * h / u.modelDepth);
|
|
2209
|
+
A.push(() => Fe(e, t, i, 0, n.index, n.value, E, c, r, 0, n.percentValue, o, "ctr", D, w));
|
|
2416
2210
|
}
|
|
2417
2211
|
}
|
|
2418
|
-
for (let e of
|
|
2212
|
+
for (let e of A) e();
|
|
2419
2213
|
let B = i.categories?.length ? i.categories : t.categories, V = Array.from({ length: B.length }, (e, t) => {
|
|
2420
|
-
let n =
|
|
2421
|
-
return r === "00000000" ? "00000000" :
|
|
2214
|
+
let n = d.get(t), r = n?.fillHidden === !0 ? "00000000" : n?.color ?? i.dataPointColors?.[t] ?? i.color;
|
|
2215
|
+
return r === "00000000" ? "00000000" : T(r ? `#${r}` : ve(t), .8).replace(/^#/, "");
|
|
2422
2216
|
});
|
|
2423
|
-
return
|
|
2217
|
+
return Ve(e, {
|
|
2424
2218
|
...t,
|
|
2425
2219
|
categories: B,
|
|
2426
2220
|
series: [{
|
|
@@ -2430,11 +2224,11 @@ function rt(e, t, n, r) {
|
|
|
2430
2224
|
}]
|
|
2431
2225
|
}, l, r, !0), !0;
|
|
2432
2226
|
}
|
|
2433
|
-
function
|
|
2434
|
-
return t.threeD ?
|
|
2227
|
+
function nt(e, t, n, r) {
|
|
2228
|
+
return t.threeD ? tt(e, t, n, r) ? !0 : he.has(t.chartType) ? et(e, t, n, r) : !1 : !1;
|
|
2435
2229
|
}
|
|
2436
2230
|
//#endregion
|
|
2437
2231
|
//#region src/three-d.ts
|
|
2438
|
-
var
|
|
2232
|
+
var rt = A({ render: nt }, "threeD");
|
|
2439
2233
|
//#endregion
|
|
2440
|
-
export {
|
|
2234
|
+
export { rt as threeD };
|