@tabler/charts 0.0.0-stage → 0.0.1-alpha.0
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/LICENSE +21 -0
- package/README.md +248 -2
- package/dist/annotations-Bp7HwtF5.d.ts +86 -0
- package/dist/annotations-BszTTjf9.js +202 -0
- package/dist/annotations-BszTTjf9.js.map +1 -0
- package/dist/annotations-DpETO8dE.cjs +213 -0
- package/dist/annotations-DpETO8dE.cjs.map +1 -0
- package/dist/annotations-lyt0I3HU.d.cts +86 -0
- package/dist/annotations.cjs +14 -0
- package/dist/annotations.cjs.map +1 -0
- package/dist/annotations.d.cts +2 -0
- package/dist/annotations.d.ts +2 -0
- package/dist/annotations.js +12 -0
- package/dist/annotations.js.map +1 -0
- package/dist/area-BFvkc-ZM.d.cts +20 -0
- package/dist/area-DQsLERhx.js +26 -0
- package/dist/area-DQsLERhx.js.map +1 -0
- package/dist/area-DaO4MQl4.d.ts +20 -0
- package/dist/area-sHCE3pg5.cjs +31 -0
- package/dist/area-sHCE3pg5.cjs.map +1 -0
- package/dist/area.cjs +3 -0
- package/dist/area.d.cts +2 -0
- package/dist/area.d.ts +2 -0
- package/dist/area.js +2 -0
- package/dist/band-DTcNDAFO.d.cts +50 -0
- package/dist/band-DTcNDAFO.d.ts +50 -0
- package/dist/bar-C-7zR2qp.cjs +243 -0
- package/dist/bar-C-7zR2qp.cjs.map +1 -0
- package/dist/bar-DGuUN3nc.cjs +67 -0
- package/dist/bar-DGuUN3nc.cjs.map +1 -0
- package/dist/bar-DM16NUvV.js +56 -0
- package/dist/bar-DM16NUvV.js.map +1 -0
- package/dist/bar-DdsDxk3W.d.ts +43 -0
- package/dist/bar-a0h9KC8A.d.cts +43 -0
- package/dist/bar-jZEoao74.js +238 -0
- package/dist/bar-jZEoao74.js.map +1 -0
- package/dist/bar.cjs +3 -0
- package/dist/bar.d.cts +2 -0
- package/dist/bar.d.ts +2 -0
- package/dist/bar.js +2 -0
- package/dist/candlestick-B5r1w3kc.cjs +150 -0
- package/dist/candlestick-B5r1w3kc.cjs.map +1 -0
- package/dist/candlestick-BKdPyorY.d.cts +44 -0
- package/dist/candlestick-BnUG1SGi.d.ts +44 -0
- package/dist/candlestick-DuXwAFID.js +145 -0
- package/dist/candlestick-DuXwAFID.js.map +1 -0
- package/dist/candlestick.cjs +11 -0
- package/dist/candlestick.cjs.map +1 -0
- package/dist/candlestick.d.cts +2 -0
- package/dist/candlestick.d.ts +2 -0
- package/dist/candlestick.js +10 -0
- package/dist/candlestick.js.map +1 -0
- package/dist/cartesian-BoDfgBCV.cjs +900 -0
- package/dist/cartesian-BoDfgBCV.cjs.map +1 -0
- package/dist/cartesian-Cr0AF0nG.js +709 -0
- package/dist/cartesian-Cr0AF0nG.js.map +1 -0
- package/dist/chart-BF2CK9I_.js +790 -0
- package/dist/chart-BF2CK9I_.js.map +1 -0
- package/dist/chart-CowF_lWY.cjs +903 -0
- package/dist/chart-CowF_lWY.cjs.map +1 -0
- package/dist/chart-Qa417fJo.d.cts +927 -0
- package/dist/chart-iJGxMz9z.d.ts +927 -0
- package/dist/circle-BQMuAfls.cjs +12 -0
- package/dist/circle-BQMuAfls.cjs.map +1 -0
- package/dist/circle-Z7YfCoCM.js +7 -0
- package/dist/circle-Z7YfCoCM.js.map +1 -0
- package/dist/clean-Byl6kzf0.cjs +115 -0
- package/dist/clean-Byl6kzf0.cjs.map +1 -0
- package/dist/clean-o1vDEhFV.js +56 -0
- package/dist/clean-o1vDEhFV.js.map +1 -0
- package/dist/core-C7fPm6t7.cjs +976 -0
- package/dist/core-C7fPm6t7.cjs.map +1 -0
- package/dist/core-CjgbhS_v.d.ts +219 -0
- package/dist/core-CnGFKojH.d.cts +219 -0
- package/dist/core-plobgBC7.js +875 -0
- package/dist/core-plobgBC7.js.map +1 -0
- package/dist/core.cjs +113 -0
- package/dist/core.d.cts +20 -0
- package/dist/core.d.ts +20 -0
- package/dist/core.js +24 -0
- package/dist/dates-Btm7Zm6W.cjs +32 -0
- package/dist/dates-Btm7Zm6W.cjs.map +1 -0
- package/dist/dates-CG-FvioW.js +27 -0
- package/dist/dates-CG-FvioW.js.map +1 -0
- package/dist/decimate-BGg9XgF0.d.ts +17 -0
- package/dist/decimate-C87cl_Sp.js +84 -0
- package/dist/decimate-C87cl_Sp.js.map +1 -0
- package/dist/decimate-CNSpgGa5.d.cts +17 -0
- package/dist/decimate-tLhDk1ys.cjs +95 -0
- package/dist/decimate-tLhDk1ys.cjs.map +1 -0
- package/dist/decimate.cjs +14 -0
- package/dist/decimate.cjs.map +1 -0
- package/dist/decimate.d.cts +2 -0
- package/dist/decimate.d.ts +2 -0
- package/dist/decimate.js +12 -0
- package/dist/decimate.js.map +1 -0
- package/dist/dom-CLF868Qs.cjs +222 -0
- package/dist/dom-CLF868Qs.cjs.map +1 -0
- package/dist/dom-vP3IcMak.js +175 -0
- package/dist/dom-vP3IcMak.js.map +1 -0
- package/dist/export-chart-9w8t3rjZ.js +232 -0
- package/dist/export-chart-9w8t3rjZ.js.map +1 -0
- package/dist/export-chart-BhhYgksr.cjs +249 -0
- package/dist/export-chart-BhhYgksr.cjs.map +1 -0
- package/dist/export.cjs +18 -0
- package/dist/export.cjs.map +1 -0
- package/dist/export.d.cts +2 -0
- package/dist/export.d.ts +2 -0
- package/dist/export.js +15 -0
- package/dist/export.js.map +1 -0
- package/dist/extent-BAMZo0Nq.js +19 -0
- package/dist/extent-BAMZo0Nq.js.map +1 -0
- package/dist/extent-DsFWvAHJ.cjs +24 -0
- package/dist/extent-DsFWvAHJ.cjs.map +1 -0
- package/dist/fade-Cs74puQS.cjs +217 -0
- package/dist/fade-Cs74puQS.cjs.map +1 -0
- package/dist/fade-D3NxH5Qg.js +200 -0
- package/dist/fade-D3NxH5Qg.js.map +1 -0
- package/dist/features-BclHgg2W.cjs +48 -0
- package/dist/features-BclHgg2W.cjs.map +1 -0
- package/dist/features-wASyHGic.js +25 -0
- package/dist/features-wASyHGic.js.map +1 -0
- package/dist/format-B0yKXBTH.cjs +183 -0
- package/dist/format-B0yKXBTH.cjs.map +1 -0
- package/dist/format-lStwuc1L.js +142 -0
- package/dist/format-lStwuc1L.js.map +1 -0
- package/dist/gauge-CEfkWXSu.cjs +235 -0
- package/dist/gauge-CEfkWXSu.cjs.map +1 -0
- package/dist/gauge-Cu9jttC0.d.ts +65 -0
- package/dist/gauge-Cu_OFxBd.d.cts +65 -0
- package/dist/gauge-_ljQHrMN.js +230 -0
- package/dist/gauge-_ljQHrMN.js.map +1 -0
- package/dist/gauge.cjs +3 -0
- package/dist/gauge.d.cts +2 -0
- package/dist/gauge.d.ts +2 -0
- package/dist/gauge.js +2 -0
- package/dist/heatmap-BK18EBgJ.cjs +247 -0
- package/dist/heatmap-BK18EBgJ.cjs.map +1 -0
- package/dist/heatmap-BwS-y0c6.d.cts +81 -0
- package/dist/heatmap-DSZ2bVIa.js +242 -0
- package/dist/heatmap-DSZ2bVIa.js.map +1 -0
- package/dist/heatmap-PhLPXIg1.d.ts +81 -0
- package/dist/heatmap.cjs +3 -0
- package/dist/heatmap.d.cts +2 -0
- package/dist/heatmap.d.ts +2 -0
- package/dist/heatmap.js +2 -0
- package/dist/hydrate-CTTmQy0x.d.cts +10 -0
- package/dist/hydrate-CxwTXDqO.cjs +60 -0
- package/dist/hydrate-CxwTXDqO.cjs.map +1 -0
- package/dist/hydrate-CzfxLfTv.d.ts +10 -0
- package/dist/hydrate-DDNIHYv_.js +55 -0
- package/dist/hydrate-DDNIHYv_.js.map +1 -0
- package/dist/hydrate.cjs +13 -0
- package/dist/hydrate.cjs.map +1 -0
- package/dist/hydrate.d.cts +2 -0
- package/dist/hydrate.d.ts +2 -0
- package/dist/hydrate.js +12 -0
- package/dist/hydrate.js.map +1 -0
- package/dist/index.cjs +211 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +45 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +113 -0
- package/dist/index.js.map +1 -0
- package/dist/layout-B3hiqVEw.js +69 -0
- package/dist/layout-B3hiqVEw.js.map +1 -0
- package/dist/layout-CtMBhNd9.cjs +98 -0
- package/dist/layout-CtMBhNd9.cjs.map +1 -0
- package/dist/line-B3Ed6u7j.js +120 -0
- package/dist/line-B3Ed6u7j.js.map +1 -0
- package/dist/line-CMDGH6q5.d.cts +47 -0
- package/dist/line-D5kb8e6w.d.ts +47 -0
- package/dist/line-fQbtP_jL.cjs +131 -0
- package/dist/line-fQbtP_jL.cjs.map +1 -0
- package/dist/line.cjs +14 -0
- package/dist/line.cjs.map +1 -0
- package/dist/line.d.cts +2 -0
- package/dist/line.d.ts +2 -0
- package/dist/line.js +13 -0
- package/dist/line.js.map +1 -0
- package/dist/log-CaofN3-n.d.cts +48 -0
- package/dist/log-CaofN3-n.d.ts +48 -0
- package/dist/log-axis-83rSpvL5.cjs +130 -0
- package/dist/log-axis-83rSpvL5.cjs.map +1 -0
- package/dist/log-axis-B_uvvOFc.js +113 -0
- package/dist/log-axis-B_uvvOFc.js.map +1 -0
- package/dist/log.cjs +17 -0
- package/dist/log.cjs.map +1 -0
- package/dist/log.d.cts +2 -0
- package/dist/log.d.ts +2 -0
- package/dist/log.js +16 -0
- package/dist/log.js.map +1 -0
- package/dist/morph-BMxz3X2b.d.cts +10 -0
- package/dist/morph-BMxz3X2b.d.ts +10 -0
- package/dist/morph-Bgg-24l8.js +36 -0
- package/dist/morph-Bgg-24l8.js.map +1 -0
- package/dist/morph-CqYDu1bY.cjs +41 -0
- package/dist/morph-CqYDu1bY.cjs.map +1 -0
- package/dist/morph.cjs +14 -0
- package/dist/morph.cjs.map +1 -0
- package/dist/morph.d.cts +2 -0
- package/dist/morph.d.ts +2 -0
- package/dist/morph.js +13 -0
- package/dist/morph.js.map +1 -0
- package/dist/named-BWWb5LQJ.cjs +50 -0
- package/dist/named-BWWb5LQJ.cjs.map +1 -0
- package/dist/named-DE15TOgh.js +33 -0
- package/dist/named-DE15TOgh.js.map +1 -0
- package/dist/path-CwB28da0.d.cts +29 -0
- package/dist/path-CwB28da0.d.ts +29 -0
- package/dist/patterns-DtgcnA8o.js +85 -0
- package/dist/patterns-DtgcnA8o.js.map +1 -0
- package/dist/patterns-LfcQAWCy.cjs +102 -0
- package/dist/patterns-LfcQAWCy.cjs.map +1 -0
- package/dist/patterns.cjs +15 -0
- package/dist/patterns.cjs.map +1 -0
- package/dist/patterns.d.cts +2 -0
- package/dist/patterns.d.ts +2 -0
- package/dist/patterns.js +12 -0
- package/dist/patterns.js.map +1 -0
- package/dist/pie-B8UlOZiq.d.ts +58 -0
- package/dist/pie-C1Pa6W_l.cjs +211 -0
- package/dist/pie-C1Pa6W_l.cjs.map +1 -0
- package/dist/pie-DnQQmxkk.d.cts +58 -0
- package/dist/pie-RnMTQWMS.js +200 -0
- package/dist/pie-RnMTQWMS.js.map +1 -0
- package/dist/pie.cjs +4 -0
- package/dist/pie.d.cts +2 -0
- package/dist/pie.d.ts +2 -0
- package/dist/pie.js +2 -0
- package/dist/point-shapes-CGl4dugc.cjs +166 -0
- package/dist/point-shapes-CGl4dugc.cjs.map +1 -0
- package/dist/point-shapes-DI84NNpI.js +155 -0
- package/dist/point-shapes-DI84NNpI.js.map +1 -0
- package/dist/point-shapes.cjs +15 -0
- package/dist/point-shapes.cjs.map +1 -0
- package/dist/point-shapes.d.cts +2 -0
- package/dist/point-shapes.d.ts +2 -0
- package/dist/point-shapes.js +13 -0
- package/dist/point-shapes.js.map +1 -0
- package/dist/radar-BB13CGmq.d.cts +60 -0
- package/dist/radar-CYPab_I4.js +285 -0
- package/dist/radar-CYPab_I4.js.map +1 -0
- package/dist/radar-CoGUNNSb.cjs +290 -0
- package/dist/radar-CoGUNNSb.cjs.map +1 -0
- package/dist/radar-pFI6fvOq.d.ts +60 -0
- package/dist/radar.cjs +3 -0
- package/dist/radar.d.cts +2 -0
- package/dist/radar.d.ts +2 -0
- package/dist/radar.js +2 -0
- package/dist/sankey-B4PNKusJ.js +420 -0
- package/dist/sankey-B4PNKusJ.js.map +1 -0
- package/dist/sankey-B9JYnx7e.d.cts +67 -0
- package/dist/sankey-Bacx4fVe.cjs +425 -0
- package/dist/sankey-Bacx4fVe.cjs.map +1 -0
- package/dist/sankey-Bm518bqL.d.ts +67 -0
- package/dist/sankey.cjs +3 -0
- package/dist/sankey.d.cts +2 -0
- package/dist/sankey.d.ts +2 -0
- package/dist/sankey.js +2 -0
- package/dist/scatter-Bl7nasE6.d.ts +61 -0
- package/dist/scatter-DgMN9zRy.cjs +250 -0
- package/dist/scatter-DgMN9zRy.cjs.map +1 -0
- package/dist/scatter-DrJ8xYz4.d.cts +61 -0
- package/dist/scatter-kgtgR318.js +245 -0
- package/dist/scatter-kgtgR318.js.map +1 -0
- package/dist/scatter.cjs +3 -0
- package/dist/scatter.d.cts +2 -0
- package/dist/scatter.d.ts +2 -0
- package/dist/scatter.js +2 -0
- package/dist/sparkline-BG13V4Pz.d.cts +43 -0
- package/dist/sparkline-BQzt27Fr.js +171 -0
- package/dist/sparkline-BQzt27Fr.js.map +1 -0
- package/dist/sparkline-BS9-hltA.cjs +176 -0
- package/dist/sparkline-BS9-hltA.cjs.map +1 -0
- package/dist/sparkline-iWuXbKpd.d.ts +43 -0
- package/dist/sparkline.cjs +3 -0
- package/dist/sparkline.d.cts +2 -0
- package/dist/sparkline.d.ts +2 -0
- package/dist/sparkline.js +2 -0
- package/dist/stack-CpR6RGKd.d.cts +6 -0
- package/dist/stack-CpR6RGKd.d.ts +6 -0
- package/dist/stack-DRbwTeF3.js +66 -0
- package/dist/stack-DRbwTeF3.js.map +1 -0
- package/dist/stack-DVhJWaki.cjs +77 -0
- package/dist/stack-DVhJWaki.cjs.map +1 -0
- package/dist/style.css +2 -0
- package/dist/sweep-Duowaput.cjs +369 -0
- package/dist/sweep-Duowaput.cjs.map +1 -0
- package/dist/sweep-WSgn2etB.js +334 -0
- package/dist/sweep-WSgn2etB.js.map +1 -0
- package/dist/time-CHjiY9Q4.d.ts +112 -0
- package/dist/time-CNVnt-B2.d.cts +112 -0
- package/dist/time-axis-Bc9eHX1r.js +365 -0
- package/dist/time-axis-Bc9eHX1r.js.map +1 -0
- package/dist/time-axis-VSX34_Tb.cjs +382 -0
- package/dist/time-axis-VSX34_Tb.cjs.map +1 -0
- package/dist/time.cjs +22 -0
- package/dist/time.cjs.map +1 -0
- package/dist/time.d.cts +2 -0
- package/dist/time.d.ts +2 -0
- package/dist/time.js +20 -0
- package/dist/time.js.map +1 -0
- package/dist/tween-BCYd0RTY.js +40 -0
- package/dist/tween-BCYd0RTY.js.map +1 -0
- package/dist/tween-CIGBlryn.cjs +51 -0
- package/dist/tween-CIGBlryn.cjs.map +1 -0
- package/dist/value-labels-B0WJoJ7x.cjs +134 -0
- package/dist/value-labels-B0WJoJ7x.cjs.map +1 -0
- package/dist/value-labels-IZIQPhfk.js +123 -0
- package/dist/value-labels-IZIQPhfk.js.map +1 -0
- package/dist/value-labels.cjs +14 -0
- package/dist/value-labels.cjs.map +1 -0
- package/dist/value-labels.d.cts +2 -0
- package/dist/value-labels.d.ts +2 -0
- package/dist/value-labels.js +12 -0
- package/dist/value-labels.js.map +1 -0
- package/dist/vnode-BUflsBsa.d.cts +66 -0
- package/dist/vnode-BUflsBsa.d.ts +66 -0
- package/dist/vnode-CkQ27Cxe.cjs +110 -0
- package/dist/vnode-CkQ27Cxe.cjs.map +1 -0
- package/dist/vnode-tCWItoUH.js +93 -0
- package/dist/vnode-tCWItoUH.js.map +1 -0
- package/package.json +310 -3
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const require_cartesian = require("./cartesian-BoDfgBCV.cjs");
|
|
2
|
+
//#region src/charts/stack.ts
|
|
3
|
+
/**
|
|
4
|
+
* Stack series per category: positive values grow up from zero and
|
|
5
|
+
* negative values down from zero, each on their own running total (like
|
|
6
|
+
* d3's diverging offset), so gains and losses never interleave. Returns one
|
|
7
|
+
* array per series with a segment per category, or `null` for no segment.
|
|
8
|
+
*/
|
|
9
|
+
function stackSeries(series, count, options = {}) {
|
|
10
|
+
const { percent = false, nullAsZero = false, hidden } = options;
|
|
11
|
+
const visible = series.map((s) => !hidden?.has(require_cartesian.seriesKey(s)));
|
|
12
|
+
const out = series.map(() => new Array(count).fill(null));
|
|
13
|
+
for (let i = 0; i < count; i++) {
|
|
14
|
+
let total = 0;
|
|
15
|
+
if (percent) series.forEach((s, j) => {
|
|
16
|
+
const v = s.values[i];
|
|
17
|
+
if (visible[j] && v != null) total += Math.abs(v);
|
|
18
|
+
});
|
|
19
|
+
let up = 0;
|
|
20
|
+
let down = 0;
|
|
21
|
+
let lastUp;
|
|
22
|
+
let lastDown;
|
|
23
|
+
for (let j = 0; j < series.length; j++) {
|
|
24
|
+
const s = series[j];
|
|
25
|
+
if (!visible[j]) continue;
|
|
26
|
+
const raw = s.values[i];
|
|
27
|
+
const valid = raw != null;
|
|
28
|
+
if (!valid && !nullAsZero) continue;
|
|
29
|
+
let v = valid ? raw : 0;
|
|
30
|
+
if (percent) v = total === 0 ? 0 : v / total;
|
|
31
|
+
const row = out[j];
|
|
32
|
+
if (v < 0) {
|
|
33
|
+
const segment = {
|
|
34
|
+
y0: down,
|
|
35
|
+
y1: down + v
|
|
36
|
+
};
|
|
37
|
+
row[i] = segment;
|
|
38
|
+
down += v;
|
|
39
|
+
lastDown = segment;
|
|
40
|
+
} else {
|
|
41
|
+
const segment = {
|
|
42
|
+
y0: up,
|
|
43
|
+
y1: up + v
|
|
44
|
+
};
|
|
45
|
+
row[i] = segment;
|
|
46
|
+
up += v;
|
|
47
|
+
lastUp = segment;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (percent) {
|
|
51
|
+
if (lastUp && Math.abs(up - 1) < 1e-9) lastUp.y1 = 1;
|
|
52
|
+
if (lastDown && Math.abs(down + 1) < 1e-9) lastDown.y1 = -1;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
/** Every segment boundary, for the value domain. */
|
|
58
|
+
function stackBounds(stacks) {
|
|
59
|
+
const values = [];
|
|
60
|
+
for (const row of stacks) for (const segment of row) if (segment) values.push(segment.y0, segment.y1);
|
|
61
|
+
return values;
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
Object.defineProperty(exports, "stackBounds", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function() {
|
|
67
|
+
return stackBounds;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(exports, "stackSeries", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function() {
|
|
73
|
+
return stackSeries;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=stack-DVhJWaki.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack-DVhJWaki.cjs","names":["seriesKey"],"sources":["../src/charts/stack.ts"],"sourcesContent":["import { type Series, seriesKey } from './cartesian.ts'\n\n/** Stack series on top of each other; `'percent'` normalizes every category to 100%. */\nexport type StackMode = boolean | 'percent'\n\n/** A stacked segment from `y0` to `y1` (in data units). */\nexport interface Segment {\n y0: number\n y1: number\n}\n\nexport interface StackOptions {\n /** Normalize each category by the sum of absolute values. */\n percent?: boolean\n /** Count missing values as zero (areas) instead of leaving no segment (bars). */\n nullAsZero?: boolean\n /** Keys of hidden series, which get no segment and do not stack. */\n hidden?: ReadonlySet<string>\n}\n\n/**\n * Stack series per category: positive values grow up from zero and\n * negative values down from zero, each on their own running total (like\n * d3's diverging offset), so gains and losses never interleave. Returns one\n * array per series with a segment per category, or `null` for no segment.\n */\nexport function stackSeries(\n series: readonly Series[],\n count: number,\n options: StackOptions = {},\n): (Segment | null)[][] {\n const { percent = false, nullAsZero = false, hidden } = options\n const visible = series.map((s) => !hidden?.has(seriesKey(s)))\n const out = series.map(() => new Array<Segment | null>(count).fill(null))\n\n for (let i = 0; i < count; i++) {\n let total = 0\n if (percent) {\n series.forEach((s, j) => {\n const v = s.values[i]\n if (visible[j] && v != null) total += Math.abs(v)\n })\n }\n let up = 0\n let down = 0\n let lastUp: Segment | undefined\n let lastDown: Segment | undefined\n for (let j = 0; j < series.length; j++) {\n const s = series[j] as Series\n if (!visible[j]) continue\n const raw = s.values[i]\n const valid = raw != null\n if (!valid && !nullAsZero) continue\n let v = valid ? (raw as number) : 0\n if (percent) v = total === 0 ? 0 : v / total\n const row = out[j] as (Segment | null)[]\n if (v < 0) {\n const segment: Segment = { y0: down, y1: down + v }\n row[i] = segment\n down += v\n lastDown = segment\n } else {\n const segment: Segment = { y0: up, y1: up + v }\n row[i] = segment\n up += v\n lastUp = segment\n }\n }\n // Shares must end exactly at ±100%: floating point drift (1.0000000000000002)\n // would otherwise make nice() stretch the axis to 120%, or leave a hairline gap.\n if (percent) {\n if (lastUp && Math.abs(up - 1) < 1e-9) lastUp.y1 = 1\n if (lastDown && Math.abs(down + 1) < 1e-9) lastDown.y1 = -1\n }\n }\n return out\n}\n\n/** Every segment boundary, for the value domain. */\nexport function stackBounds(stacks: readonly (Segment | null)[][]): number[] {\n const values: number[] = []\n for (const row of stacks) {\n for (const segment of row) if (segment) values.push(segment.y0, segment.y1)\n }\n return values\n}\n"],"mappings":";;;;;;;;AA0BA,SAAgB,YACd,QACA,OACA,UAAwB,CAAC,GACH;CACtB,MAAM,EAAE,UAAU,OAAO,aAAa,OAAO,WAAW;CACxD,MAAM,UAAU,OAAO,KAAK,MAAM,CAAC,QAAQ,IAAIA,kBAAAA,UAAU,CAAC,CAAC,CAAC;CAC5D,MAAM,MAAM,OAAO,UAAU,IAAI,MAAsB,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC;CAExE,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KAAK;EAC9B,IAAI,QAAQ;EACZ,IAAI,SACF,OAAO,SAAS,GAAG,MAAM;GACvB,MAAM,IAAI,EAAE,OAAO;GACnB,IAAI,QAAQ,MAAM,KAAK,MAAM,SAAS,KAAK,IAAI,CAAC;EAClD,CAAC;EAEH,IAAI,KAAK;EACT,IAAI,OAAO;EACX,IAAI;EACJ,IAAI;EACJ,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;GACtC,MAAM,IAAI,OAAO;GACjB,IAAI,CAAC,QAAQ,IAAI;GACjB,MAAM,MAAM,EAAE,OAAO;GACrB,MAAM,QAAQ,OAAO;GACrB,IAAI,CAAC,SAAS,CAAC,YAAY;GAC3B,IAAI,IAAI,QAAS,MAAiB;GAClC,IAAI,SAAS,IAAI,UAAU,IAAI,IAAI,IAAI;GACvC,MAAM,MAAM,IAAI;GAChB,IAAI,IAAI,GAAG;IACT,MAAM,UAAmB;KAAE,IAAI;KAAM,IAAI,OAAO;IAAE;IAClD,IAAI,KAAK;IACT,QAAQ;IACR,WAAW;GACb,OAAO;IACL,MAAM,UAAmB;KAAE,IAAI;KAAI,IAAI,KAAK;IAAE;IAC9C,IAAI,KAAK;IACT,MAAM;IACN,SAAS;GACX;EACF;EAGA,IAAI,SAAS;GACX,IAAI,UAAU,KAAK,IAAI,KAAK,CAAC,IAAI,MAAM,OAAO,KAAK;GACnD,IAAI,YAAY,KAAK,IAAI,OAAO,CAAC,IAAI,MAAM,SAAS,KAAK;EAC3D;CACF;CACA,OAAO;AACT;;AAGA,SAAgB,YAAY,QAAiD;CAC3E,MAAM,SAAmB,CAAC;CAC1B,KAAK,MAAM,OAAO,QAChB,KAAK,MAAM,WAAW,KAAK,IAAI,SAAS,OAAO,KAAK,QAAQ,IAAI,QAAQ,EAAE;CAE5E,OAAO;AACT"}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @tabler/charts | MIT */
|
|
2
|
+
:where(:root),:where([data-theme=light]){--tc-color-1:#2a78d6;--tc-color-2:#eb6834;--tc-color-3:#1baf7a;--tc-color-4:#eda100;--tc-color-5:#e87ba4;--tc-color-6:#008300;--tc-color-7:#4a3aa7;--tc-color-8:#e34948;--tc-color-other:#8a8983;--tc-surface:#fff;--tc-text-color:#0b0b0b;--tc-text-muted:#6f6e69;--tc-grid-color:#e1e0d9;--tc-baseline-color:#c3c2b7;--tc-hover-color:#0b0b0b0a;--tc-tooltip-bg:#fff;--tc-tooltip-color:var(--tc-text-color);--tc-tooltip-border:#0b0b0b1a;--tc-tooltip-shadow:0 4px 16px #0b0b0b1f;--tc-tooltip-radius:6px;--tc-focus-color:var(--tc-color-1);--tc-font-family:inherit;--tc-font-size:12px;--tc-stroke-width:2px;--tc-grid-width:1px;--tc-area-opacity:.1;--tc-area-gradient-start:.24;--tc-area-gradient-end:0;--tc-pie-value-size:1.75em;--tc-bubble-opacity:.7;--tc-point-ring:2px;--tc-duration:.4s;--tc-duration-fast:.12s;--tc-easing:cubic-bezier(.4, 0, .2, 1)}@media (prefers-color-scheme:dark){:where(:root:not([data-theme=light])){--tc-color-1:#3987e5;--tc-color-2:#d95926;--tc-color-3:#199e70;--tc-color-4:#c98500;--tc-color-5:#d55181;--tc-color-6:#008300;--tc-color-7:#9085e9;--tc-color-8:#e66767;--tc-color-other:#7c7b76;--tc-surface:#1a1a19;--tc-text-color:#fff;--tc-text-muted:#a3a29c;--tc-grid-color:#2c2c2a;--tc-baseline-color:#4a4a46;--tc-hover-color:#ffffff0f;--tc-tooltip-bg:#262625;--tc-tooltip-color:var(--tc-text-color);--tc-tooltip-border:#ffffff1a;--tc-tooltip-shadow:0 4px 16px #0006;--tc-focus-color:var(--tc-color-1)}}:where([data-theme=dark]){--tc-color-1:#3987e5;--tc-color-2:#d95926;--tc-color-3:#199e70;--tc-color-4:#c98500;--tc-color-5:#d55181;--tc-color-6:#008300;--tc-color-7:#9085e9;--tc-color-8:#e66767;--tc-color-other:#7c7b76;--tc-surface:#1a1a19;--tc-text-color:#fff;--tc-text-muted:#a3a29c;--tc-grid-color:#2c2c2a;--tc-baseline-color:#4a4a46;--tc-hover-color:#ffffff0f;--tc-tooltip-bg:#262625;--tc-tooltip-color:var(--tc-text-color);--tc-tooltip-border:#ffffff1a;--tc-tooltip-shadow:0 4px 16px #0006;--tc-focus-color:var(--tc-color-1)}.tc-chart{max-width:100%;height:auto;font-family:var(--tc-font-family);font-size:var(--tc-font-size);letter-spacing:normal;word-spacing:normal;text-transform:none;color:var(--tc-text-color);-webkit-tap-highlight-color:transparent;display:block;overflow:visible}.tc-chart :where(text){font:inherit}.tc-series{--tc-series-color:var(--tc-color-other);--tc-series-pattern:var(--tc-pattern-other);--tc-pattern-dash:1 3;--tc-pattern-ink:var(--tc-pattern-color,var(--tc-surface));--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1px, #0000 0 3px)}.tc-series-1{--tc-series-color:var(--tc-color-1);--tc-series-pattern:var(--tc-pattern-1);--tc-pattern-dash:none;--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-2{--tc-series-color:var(--tc-color-2);--tc-series-pattern:var(--tc-pattern-2);--tc-pattern-dash:6 3;--tc-swatch-pattern:radial-gradient(var(--tc-pattern-ink) .8px, #0000 1.2px) 0 0 / 4px 4px}.tc-series-3{--tc-series-color:var(--tc-color-3);--tc-series-pattern:var(--tc-pattern-3);--tc-pattern-dash:2 3;--tc-swatch-pattern:repeating-linear-gradient(-45deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-4{--tc-series-color:var(--tc-color-4);--tc-series-pattern:var(--tc-pattern-4);--tc-pattern-dash:10 3 2 3;--tc-swatch-pattern:repeating-linear-gradient(var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-5{--tc-series-color:var(--tc-color-5);--tc-series-pattern:var(--tc-pattern-5);--tc-pattern-dash:4 4;--tc-swatch-pattern:repeating-linear-gradient(45deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px), repeating-linear-gradient(-45deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px)}.tc-series-6{--tc-series-color:var(--tc-color-6);--tc-series-pattern:var(--tc-pattern-6);--tc-pattern-dash:12 4;--tc-swatch-pattern:repeating-linear-gradient(90deg, var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-series-7{--tc-series-color:var(--tc-color-7);--tc-series-pattern:var(--tc-pattern-7);--tc-pattern-dash:2 2 6 2;--tc-swatch-pattern:repeating-linear-gradient(var(--tc-pattern-ink) 0 1px, #0000 0 4px), repeating-linear-gradient(90deg, var(--tc-pattern-ink) 0 1px, #0000 0 4px)}.tc-series-8{--tc-series-color:var(--tc-color-8);--tc-series-pattern:var(--tc-pattern-8);--tc-pattern-dash:8 2 2 2;--tc-swatch-pattern:linear-gradient(90deg, #0000 50%, var(--tc-series-color) 0) 0 0 / 4px 4px, repeating-linear-gradient(var(--tc-pattern-ink) 0 1.5px, #0000 0 4px)}.tc-tick-label{fill:var(--tc-text-muted);font-variant-numeric:tabular-nums}.tc-grid-line,.tc-grid-line-zero,.tc-axis-line,.tc-tick-line,.tc-crosshair,.tc-sparkline-zero,.tc-radar-ring,.tc-radar-spoke{stroke:var(--tc-baseline-color);stroke-width:var(--tc-grid-width);shape-rendering:crispedges;vector-effect:non-scaling-stroke}.tc-grid-line,.tc-sparkline-zero,.tc-radar-ring,.tc-radar-spoke{stroke:var(--tc-grid-color)}.tc-grid-line-zero{stroke:var(--tc-baseline-color)}.tc-line{fill:none;stroke:var(--tc-series-color);stroke-width:var(--tc-series-width,var(--tc-stroke-width));stroke-dasharray:var(--tc-series-dash,none);stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}.tc-area{fill:var(--tc-series-color);fill-opacity:var(--tc-area-opacity);stroke:none}.tc-pie-slices{--tc-pie-gap:0px}.tc-slice{fill:var(--tc-series-color);stroke:var(--tc-surface);stroke-width:var(--tc-pie-gap);stroke-linejoin:round}.tc-pie-track,.tc-gauge-track{fill:var(--tc-grid-color)}.tc-gauge-arc{fill:var(--tc-series-color)}.tc-pie-value,.tc-gauge-value{font-size:var(--tc-pie-value-size);fill:var(--tc-text-color);font-variant-numeric:tabular-nums;font-weight:600}.tc-pie-label,.tc-gauge-label{fill:var(--tc-text-muted)}.tc-sankey-node{fill:var(--tc-series-color)}.tc-sankey-link{fill:var(--tc-series-color);fill-opacity:var(--tc-area-opacity);stroke:none}.tc-chart-sankey{--tc-area-opacity:.35}.tc-sankey-value{font-size:.92em}.tc-chart-sankey .tc-hover-mark{opacity:.5}.tc-radar-ring,.tc-radar-spoke,.tc-chart-radar .tc-crosshair{fill:none;shape-rendering:auto}.tc-area-gradient{fill-opacity:1}.tc-fade-start{stop-color:#fff;stop-opacity:var(--tc-area-gradient-start)}.tc-fade-end{stop-color:#fff;stop-opacity:var(--tc-area-gradient-end)}.tc-chart-sparkline{--tc-stroke-width:1.5px;--tc-area-gradient-start:.3}.tc-bubble{fill-opacity:var(--tc-bubble-opacity)}.tc-point{fill:var(--tc-series-color);stroke:var(--tc-surface);stroke-width:var(--tc-point-ring);paint-order:stroke;transition:cx var(--tc-duration) var(--tc-easing), cy var(--tc-duration) var(--tc-easing)}.tc-point-min,.tc-point-max{fill:var(--tc-text-muted)}.tc-annotation{--tc-annotation-color:var(--tc-text-muted)}.tc-annotation-line{stroke:var(--tc-annotation-color);stroke-width:1px;stroke-dasharray:4 3;shape-rendering:crispedges;vector-effect:non-scaling-stroke}.tc-annotation-band{fill:var(--tc-annotation-color);fill-opacity:.1}.tc-annotation-label{fill:var(--tc-annotation-color);font-weight:500}.tc-annotation-label,.tc-radar-value{paint-order:stroke;stroke:var(--tc-surface);stroke-width:3px;stroke-linejoin:round;font-size:.92em}.tc-annotations{pointer-events:none}.tc-value-label{fill:var(--tc-text-color);font-variant-numeric:tabular-nums;paint-order:stroke;stroke:var(--tc-surface);stroke-width:3px;stroke-linejoin:round;transition:transform var(--tc-duration) var(--tc-easing);animation:tc-fade-in var(--tc-duration) var(--tc-easing);font-weight:500}.tc-marker{transition:d var(--tc-duration) var(--tc-easing)}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){background:var(--tc-series-color);width:10px;height:10px}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-2 :is(.tc-legend-swatch,.tc-tooltip-swatch){border-radius:1px;scale:.8}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-3 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(50% 3.6%,92.9% 82.1%,7.1% 82.1%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-4 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(50% 3.6%,96.4% 50%,50% 96.4%,3.6% 50%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-5 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(7.1% 17.9%,92.9% 17.9%,50% 96.4%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-6 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(35.7% 7.1%,64.3% 7.1%,64.3% 35.7%,92.9% 35.7%,92.9% 64.3%,64.3% 64.3%,64.3% 92.9%,35.7% 92.9%,35.7% 64.3%,7.1% 64.3%,7.1% 35.7%,35.7% 35.7%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-7 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(25% 7.1%,50% 32.1%,75% 7.1%,92.9% 25%,67.9% 50%,92.9% 75%,75% 92.9%,50% 67.9%,25% 92.9%,7.1% 75%,32.1% 50%,7.1% 25%);border-radius:0}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) .tc-series-8 :is(.tc-legend-swatch,.tc-tooltip-swatch){clip-path:polygon(50% 0%,61.4% 34.3%,97.5% 34.6%,68.6% 56.1%,79.3% 90.4%,50% 69.6%,20.7% 90.4%,31.4% 56.1%,2.5% 34.6%,38.6% 34.3%);border-radius:0}.tc-pattern-bg{fill:var(--tc-series-color)}.tc-pattern-ink{fill:none;stroke:var(--tc-pattern-ink);stroke-width:1.5px;stroke-linecap:round}.tc-patterned :is(.tc-bar,.tc-area,.tc-slice,.tc-gauge-arc,.tc-bubble){fill:var(--tc-series-pattern,var(--tc-series-color))}.tc-patterned .tc-area{fill-opacity:max(var(--tc-area-opacity), .4)}.tc-patterned .tc-line{stroke-dasharray:var(--tc-series-dash,var(--tc-pattern-dash))}:has(>.tc-patterned)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){background:var(--tc-swatch-pattern), var(--tc-series-color)}@keyframes tc-reveal{0%{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}@keyframes tc-grow{0%{transform:scaleY(0)}}@keyframes tc-grow-x{0%{transform:scaleX(0)}}@keyframes tc-fade-in{0%{opacity:0}}.tc-line,.tc-area,.tc-bar,.tc-radar-ring,.tc-dots{transition:d var(--tc-duration) var(--tc-easing)}.tc-slice,.tc-gauge-arc,.tc-gauge-track{transition:none var(--tc-duration)}.tc-chart-line .tc-series-list,.tc-chart-area .tc-series-list{animation:tc-reveal calc(var(--tc-duration) * 2) var(--tc-easing)}.tc-series-list .tc-series,.tc-areas .tc-series,.tc-sankey-links .tc-sankey-link,.tc-sankey-nodes .tc-series,.tc-series-list .tc-point,.tc-heatmap-cells,.tc-candles,.tc-tick,.tc-grid-line{animation:tc-fade-in var(--tc-duration) var(--tc-easing)}.tc-bar{fill:var(--tc-series-color);transform-box:fill-box;transform-origin:50% 100%;animation:tc-grow var(--tc-duration) var(--tc-easing)}.tc-bar-negative{transform-origin:50% 0}.tc-cell{fill:var(--tc-cell-fill,var(--tc-heat-color,var(--tc-color-1)));transition:fill var(--tc-duration) var(--tc-easing)}@supports (color:color-mix(in oklab, red 50%, blue)){.tc-cell{fill:var(--tc-cell-fill,color-mix(in oklab, var(--tc-heat-color,var(--tc-color-1)) var(--tc-heat,100%), var(--tc-heat-empty,var(--tc-grid-color))))}}.tc-heatmap-row.tc-series{--tc-heat-color:var(--tc-series-color)}.tc-cell-empty{fill:var(--tc-heat-empty,var(--tc-grid-color));opacity:.5}.tc-candle{--tc-candle-color:var(--tc-up-color,var(--tc-color-6))}.tc-candle-down{--tc-candle-color:var(--tc-negative-color,var(--tc-color-8))}.tc-candle-body{fill:var(--tc-candle-color);transition:d var(--tc-duration) var(--tc-easing), fill var(--tc-duration) var(--tc-easing)}.tc-candle-wick{fill:none;stroke:var(--tc-candle-color);stroke-width:1px;vector-effect:non-scaling-stroke;transition:d var(--tc-duration) var(--tc-easing), stroke var(--tc-duration) var(--tc-easing)}.tc-tristate-loss{fill:var(--tc-negative-color,var(--tc-color-8))}.tc-tristate-draw{fill:var(--tc-baseline-color)}.tc-bar-horizontal{transform-origin:0;animation-name:tc-grow-x}.tc-bar-horizontal.tc-bar-negative{transform-origin:100%}.tc-tick,.tc-grid-line{transition:transform var(--tc-duration) var(--tc-easing)}@keyframes tc-pie-in{0%{opacity:0;transform:scale(.85)}}.tc-pie-slices,.tc-gauge-rings,.tc-radar-series{animation:tc-pie-in calc(var(--tc-duration) * 1.5) var(--tc-easing)}.tc-hover .tc-point{transition:none;animation:none}.tc-static,.tc-chart[data-resizing]{--tc-duration:0s}:where(.tc-container){position:relative}.tc-hover{pointer-events:none}.tc-hover-band{fill:var(--tc-hover-color)}.tc-hover-mark{fill:var(--tc-series-color);opacity:.35}.tc-chart-heatmap .tc-hover-mark{fill:none;stroke:var(--tc-text-color);stroke-width:2px;opacity:.6}.tc-tooltip{z-index:10;pointer-events:none;opacity:0;min-width:120px;max-width:min(280px,100%);font-family:var(--tc-font-family);font-size:var(--tc-font-size);overflow-wrap:anywhere;color:var(--tc-tooltip-color);background:var(--tc-tooltip-bg);border:1px solid var(--tc-tooltip-border);border-radius:var(--tc-tooltip-radius);box-shadow:var(--tc-tooltip-shadow);transition:opacity var(--tc-duration-fast) var(--tc-easing);padding:8px 10px;line-height:1.4;position:absolute;top:0;left:0}.tc-tooltip[data-visible]{opacity:1;transition:opacity var(--tc-duration-fast) var(--tc-easing), transform var(--tc-duration-fast) var(--tc-easing)}.tc-tooltip-title{margin-bottom:4px;font-weight:600}.tc-tooltip-item{align-items:center;gap:8px;display:flex}.tc-tooltip-swatch,.tc-legend-swatch{background:var(--tc-series-color);border-radius:50%;flex:none;width:8px;height:8px}.tc-tooltip-name{color:var(--tc-text-muted);flex:1}.tc-tooltip-value{white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:500}.tc-tooltip-footer{border-top:1px solid var(--tc-tooltip-border);margin-top:4px;padding-top:4px}.tc-tooltip-item-active .tc-tooltip-name{color:var(--tc-tooltip-color)}.tc-legend{font-family:var(--tc-font-family);font-size:var(--tc-font-size);margin-bottom:8px;line-height:1.4}.tc-legend[data-position=bottom]{margin:8px 0 0}.tc-legend-items{flex-wrap:wrap;gap:4px 12px;display:flex}.tc-legend-item{appearance:none;font:inherit;text-align:start;color:var(--tc-text-color);cursor:pointer;transition:color var(--tc-duration-fast) var(--tc-easing);background:0 0;border:0;border-radius:4px;align-items:center;gap:6px;margin:0;padding:2px 4px;display:inline-flex}.tc-legend-item:hover{background:var(--tc-hover-color)}.tc-legend-item:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:1px}.tc-legend-item-hidden{color:var(--tc-text-muted)}.tc-legend-item-hidden .tc-legend-swatch{box-shadow:inset 0 0 0 1.5px var(--tc-series-color);background:0 0}.tc-download{z-index:5;font-family:var(--tc-font-family);font-size:var(--tc-font-size);line-height:1.4;position:absolute;top:0;right:0}.tc-download-toggle,.tc-download-item{appearance:none;font:inherit;color:var(--tc-text-muted);cursor:pointer;background:0 0;border:0;border-radius:4px;align-items:center;margin:0;display:flex}.tc-download-toggle{justify-content:center;width:24px;height:24px;padding:0}.tc-download-toggle:hover,.tc-download-toggle[aria-expanded=true],.tc-download-item:hover{color:var(--tc-text-color);background:var(--tc-hover-color)}.tc-download-toggle:focus-visible,.tc-download-item:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:1px}.tc-download-menu{min-width:80px;color:var(--tc-tooltip-color);background:var(--tc-tooltip-bg);border:1px solid var(--tc-tooltip-border);border-radius:var(--tc-tooltip-radius);box-shadow:var(--tc-tooltip-shadow);margin-top:2px;padding:4px;position:absolute;top:100%;right:0}.tc-download-item{text-align:start;white-space:nowrap;width:100%;padding:4px 8px}.tc-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.tc-chart:focus{outline:none}.tc-chart:focus-visible{outline:2px solid var(--tc-focus-color);outline-offset:2px;border-radius:2px}.tc-table-wrap:not(.tc-sr-only){margin-top:12px;overflow-x:auto}.tc-table{border-collapse:collapse;width:100%;font-family:var(--tc-font-family);font-size:var(--tc-font-size);font-variant-numeric:tabular-nums;color:var(--tc-text-color)}.tc-table caption{text-align:start;margin-bottom:4px;font-weight:600}.tc-table th,.tc-table td{text-align:end;border-bottom:1px solid var(--tc-grid-color);padding:4px 8px}.tc-table th[scope=row],.tc-table thead th:first-child{text-align:start}.tc-table thead th{color:var(--tc-text-muted);border-bottom-color:var(--tc-baseline-color);font-weight:600}@media (prefers-reduced-motion:reduce){.tc-chart,.tc-tooltip{--tc-duration:0s;--tc-duration-fast:0s}}@media (forced-colors:active){.tc-value-label{fill:canvastext;stroke:canvas}.tc-tick-label{fill:canvastext}.tc-grid-line,.tc-radar-ring,.tc-radar-spoke{stroke:graytext}.tc-grid-line-zero,.tc-axis-line,.tc-tick-line,.tc-line{stroke:canvastext}.tc-area{fill:graytext}.tc-bar,.tc-point{fill:canvastext;stroke:canvas}.tc-crosshair{stroke:highlight}.tc-tooltip{border-color:canvastext}.tc-legend-swatch{background:canvastext}.tc-legend-item-hidden .tc-legend-swatch{background:0 0;box-shadow:inset 0 0 0 1.5px canvastext}.tc-pattern-bg{fill:canvas}.tc-pattern-ink{stroke:canvastext}:is(.tc-patterned,.tc-patterns-auto) :is(.tc-bar,.tc-area,.tc-slice,.tc-gauge-arc,.tc-bubble){fill:var(--tc-series-pattern,CanvasText);fill-opacity:1;stroke:canvastext;stroke-width:1px}.tc-patterns-auto .tc-line{stroke-dasharray:var(--tc-series-dash,var(--tc-pattern-dash))}:has(>:is(.tc-patterned,.tc-patterns-auto))>:is(.tc-legend,.tc-tooltip) .tc-series{--tc-pattern-color:CanvasText;--tc-series-color:Canvas}:has(>:is(.tc-patterned,.tc-patterns-auto))>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){forced-color-adjust:none;background:var(--tc-swatch-pattern), Canvas;box-shadow:inset 0 0 0 1px canvastext}:has(>svg .tc-marker)>:is(.tc-legend,.tc-tooltip) :is(.tc-legend-swatch,.tc-tooltip-swatch){box-shadow:none;background:canvastext}}
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
const require_vnode = require("./vnode-CkQ27Cxe.cjs");
|
|
2
|
+
const require_tween = require("./tween-CIGBlryn.cjs");
|
|
3
|
+
//#region src/shapes/arc.ts
|
|
4
|
+
/**
|
|
5
|
+
* Annular sector paths with padding and rounded corners, ported from
|
|
6
|
+
* d3-shape's `arc()` (ISC license, Mike Bostock) so geometry matches d3.
|
|
7
|
+
*
|
|
8
|
+
* Angles are in radians, clockwise from 12 o'clock; paths are centered on
|
|
9
|
+
* the origin (translate the group to place them).
|
|
10
|
+
*/
|
|
11
|
+
const EPSILON = 1e-12;
|
|
12
|
+
const PI = Math.PI;
|
|
13
|
+
const HALF_PI = PI / 2;
|
|
14
|
+
const TAU = 2 * PI;
|
|
15
|
+
/** Degrees to radians. */
|
|
16
|
+
const DEG = Math.PI / 180;
|
|
17
|
+
const asin = (x) => x >= 1 ? HALF_PI : x <= -1 ? -HALF_PI : Math.asin(x);
|
|
18
|
+
const acos = (x) => x > 1 ? 0 : x < -1 ? PI : Math.acos(x);
|
|
19
|
+
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
|
20
|
+
const x10 = x1 - x0;
|
|
21
|
+
const y10 = y1 - y0;
|
|
22
|
+
const x32 = x3 - x2;
|
|
23
|
+
const y32 = y3 - y2;
|
|
24
|
+
let t = y32 * x10 - x32 * y10;
|
|
25
|
+
if (t * t < EPSILON) return void 0;
|
|
26
|
+
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
|
|
27
|
+
return [x0 + t * x10, y0 + t * y10];
|
|
28
|
+
}
|
|
29
|
+
/** Center and tangent points of a rounded corner between a radial edge and an arc. */
|
|
30
|
+
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
31
|
+
const x01 = x0 - x1;
|
|
32
|
+
const y01 = y0 - y1;
|
|
33
|
+
const lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01);
|
|
34
|
+
const ox = lo * y01;
|
|
35
|
+
const oy = -lo * x01;
|
|
36
|
+
const x11 = x0 + ox;
|
|
37
|
+
const y11 = y0 + oy;
|
|
38
|
+
const x10 = x1 + ox;
|
|
39
|
+
const y10 = y1 + oy;
|
|
40
|
+
const x00 = (x11 + x10) / 2;
|
|
41
|
+
const y00 = (y11 + y10) / 2;
|
|
42
|
+
const dx = x10 - x11;
|
|
43
|
+
const dy = y10 - y11;
|
|
44
|
+
const d2 = dx * dx + dy * dy;
|
|
45
|
+
const r = r1 - rc;
|
|
46
|
+
const D = x11 * y10 - x10 * y11;
|
|
47
|
+
const d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D));
|
|
48
|
+
let cx0 = (D * dy - dx * d) / d2;
|
|
49
|
+
let cy0 = (-D * dx - dy * d) / d2;
|
|
50
|
+
const cx1 = (D * dy + dx * d) / d2;
|
|
51
|
+
const cy1 = (-D * dx + dy * d) / d2;
|
|
52
|
+
const dx0 = cx0 - x00;
|
|
53
|
+
const dy0 = cy0 - y00;
|
|
54
|
+
const dx1 = cx1 - x00;
|
|
55
|
+
const dy1 = cy1 - y00;
|
|
56
|
+
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {
|
|
57
|
+
cx0 = cx1;
|
|
58
|
+
cy0 = cy1;
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
cx: cx0,
|
|
62
|
+
cy: cy0,
|
|
63
|
+
x01: -ox,
|
|
64
|
+
y01: -oy,
|
|
65
|
+
x11: cx0 * (r1 / r - 1),
|
|
66
|
+
y11: cy0 * (r1 / r - 1)
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Padded angles, clamped corner radii and edge points of a partial sector,
|
|
71
|
+
* shared by both path generators so they agree exactly.
|
|
72
|
+
*/
|
|
73
|
+
function sector(options, r0, r1, a0, a1, da, cw) {
|
|
74
|
+
let a01 = a0;
|
|
75
|
+
let a11 = a1;
|
|
76
|
+
let a00 = a0;
|
|
77
|
+
let a10 = a1;
|
|
78
|
+
let da0 = da;
|
|
79
|
+
let da1 = da;
|
|
80
|
+
const ap = (options.padAngle ?? 0) / 2;
|
|
81
|
+
const rp = ap > EPSILON ? options.padRadius ?? Math.sqrt(r0 * r0 + r1 * r1) : 0;
|
|
82
|
+
const rc = Math.min(Math.abs(r1 - r0) / 2, options.cornerRadius ?? 0);
|
|
83
|
+
let rc0 = rc;
|
|
84
|
+
let rc1 = rc;
|
|
85
|
+
if (rp > EPSILON) {
|
|
86
|
+
let p0 = asin(rp / r0 * Math.sin(ap));
|
|
87
|
+
let p1 = asin(rp / r1 * Math.sin(ap));
|
|
88
|
+
da0 -= p0 * 2;
|
|
89
|
+
if (da0 > EPSILON) {
|
|
90
|
+
p0 *= cw ? 1 : -1;
|
|
91
|
+
a00 += p0;
|
|
92
|
+
a10 -= p0;
|
|
93
|
+
} else {
|
|
94
|
+
da0 = 0;
|
|
95
|
+
a00 = a10 = (a0 + a1) / 2;
|
|
96
|
+
}
|
|
97
|
+
da1 -= p1 * 2;
|
|
98
|
+
if (da1 > EPSILON) {
|
|
99
|
+
p1 *= cw ? 1 : -1;
|
|
100
|
+
a01 += p1;
|
|
101
|
+
a11 -= p1;
|
|
102
|
+
} else {
|
|
103
|
+
da1 = 0;
|
|
104
|
+
a01 = a11 = (a0 + a1) / 2;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const x01 = r1 * Math.cos(a01);
|
|
108
|
+
const y01 = r1 * Math.sin(a01);
|
|
109
|
+
const x10 = r0 * Math.cos(a10);
|
|
110
|
+
const y10 = r0 * Math.sin(a10);
|
|
111
|
+
const x11 = r1 * Math.cos(a11);
|
|
112
|
+
const y11 = r1 * Math.sin(a11);
|
|
113
|
+
const x00 = r0 * Math.cos(a00);
|
|
114
|
+
const y00 = r0 * Math.sin(a00);
|
|
115
|
+
if (rc > EPSILON && da < PI) {
|
|
116
|
+
const oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10);
|
|
117
|
+
if (oc) {
|
|
118
|
+
const ax = x01 - oc[0];
|
|
119
|
+
const ay = y01 - oc[1];
|
|
120
|
+
const bx = x11 - oc[0];
|
|
121
|
+
const by = y11 - oc[1];
|
|
122
|
+
const cos = (ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by));
|
|
123
|
+
const kc = 1 / Math.sin(acos(cos) / 2);
|
|
124
|
+
const lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
|
|
125
|
+
rc0 = Math.min(rc, (r0 - lc) / (kc - 1));
|
|
126
|
+
rc1 = Math.min(rc, (r1 - lc) / (kc + 1));
|
|
127
|
+
} else rc0 = rc1 = 0;
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
a00,
|
|
131
|
+
a01,
|
|
132
|
+
a10,
|
|
133
|
+
a11,
|
|
134
|
+
da0,
|
|
135
|
+
da1,
|
|
136
|
+
rc,
|
|
137
|
+
rc0,
|
|
138
|
+
rc1,
|
|
139
|
+
x01,
|
|
140
|
+
y01,
|
|
141
|
+
x10,
|
|
142
|
+
y10,
|
|
143
|
+
x11,
|
|
144
|
+
y11,
|
|
145
|
+
x00,
|
|
146
|
+
y00
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/** Midpoint of an arc, e.g. to anchor a tooltip or label (like d3's `arc.centroid`). */
|
|
150
|
+
function arcCentroid(options) {
|
|
151
|
+
const r = (options.innerRadius + options.outerRadius) / 2;
|
|
152
|
+
const a = (options.startAngle + options.endAngle) / 2 - HALF_PI;
|
|
153
|
+
return [Math.cos(a) * r, Math.sin(a) * r];
|
|
154
|
+
}
|
|
155
|
+
/** Pad angle giving a constant `gap` (in pixels) between arcs of a ring. */
|
|
156
|
+
function padAngleForGap(gap, innerRadius, outerRadius) {
|
|
157
|
+
const rp = Math.sqrt(innerRadius * innerRadius + outerRadius * outerRadius);
|
|
158
|
+
return rp > 0 ? 2 * Math.asin(Math.min(1, gap / 2 / rp)) : 0;
|
|
159
|
+
}
|
|
160
|
+
/** Angle of a point around the origin. */
|
|
161
|
+
const angleOf = (x, y) => Math.atan2(y, x);
|
|
162
|
+
/**
|
|
163
|
+
* The same sector as {@link arcPath}, drawn with a fixed command structure:
|
|
164
|
+
* every corner is always present (zero length when there is none) and each
|
|
165
|
+
* ring is split into two half arcs, so the large-arc flag never flips.
|
|
166
|
+
* Paths of different angles therefore keep their commands while an arc is
|
|
167
|
+
* redrawn frame by frame, turning to its new angles (see `sweep`).
|
|
168
|
+
*/
|
|
169
|
+
function arcPathStable(options) {
|
|
170
|
+
const k = 10 ** Math.max(0, Math.min(12, Math.floor(options.precision ?? 2)));
|
|
171
|
+
const n = (v) => {
|
|
172
|
+
const r = Math.round(v * k) / k;
|
|
173
|
+
return String(r === 0 ? 0 : r);
|
|
174
|
+
};
|
|
175
|
+
let d = "";
|
|
176
|
+
const move = (x, y) => {
|
|
177
|
+
d += `M${n(x)},${n(y)}`;
|
|
178
|
+
};
|
|
179
|
+
const line = (x, y) => {
|
|
180
|
+
d += `L${n(x)},${n(y)}`;
|
|
181
|
+
};
|
|
182
|
+
const arc = (r, sweep, x, y) => {
|
|
183
|
+
d += `A${n(r)},${n(r)},0,0,${sweep},${n(x)},${n(y)}`;
|
|
184
|
+
};
|
|
185
|
+
/** Two half arcs of radius `r` around the origin from angle `a0` to `a1`. */
|
|
186
|
+
const ring = (r, a0, a1, ccw) => {
|
|
187
|
+
let delta = ccw ? a0 - a1 : a1 - a0;
|
|
188
|
+
delta = (delta % TAU + TAU) % TAU;
|
|
189
|
+
if (delta < EPSILON && Math.abs(a1 - a0) > EPSILON) delta = TAU;
|
|
190
|
+
const mid = ccw ? a0 - delta / 2 : a0 + delta / 2;
|
|
191
|
+
const sweep = ccw ? 0 : 1;
|
|
192
|
+
arc(r, sweep, r * Math.cos(mid), r * Math.sin(mid));
|
|
193
|
+
arc(r, sweep, r * Math.cos(a1), r * Math.sin(a1));
|
|
194
|
+
};
|
|
195
|
+
let r0 = Math.max(0, options.innerRadius);
|
|
196
|
+
let r1 = Math.max(0, options.outerRadius);
|
|
197
|
+
if (r1 < r0) [r0, r1] = [r1, r0];
|
|
198
|
+
const a0 = options.startAngle - HALF_PI;
|
|
199
|
+
const a1 = options.endAngle - HALF_PI;
|
|
200
|
+
const da = Math.abs(a1 - a0);
|
|
201
|
+
const cw = a1 > a0;
|
|
202
|
+
const outerSweep = cw ? 1 : 0;
|
|
203
|
+
if (!(r1 > EPSILON)) {
|
|
204
|
+
move(0, 0);
|
|
205
|
+
for (let i = 0; i < 4; i++) arc(0, outerSweep, 0, 0);
|
|
206
|
+
line(0, 0);
|
|
207
|
+
for (let i = 0; i < 4; i++) arc(0, outerSweep, 0, 0);
|
|
208
|
+
return `${d}Z`;
|
|
209
|
+
}
|
|
210
|
+
if (da > TAU - EPSILON) {
|
|
211
|
+
const ox = r1 * Math.cos(a0);
|
|
212
|
+
const oy = r1 * Math.sin(a0);
|
|
213
|
+
move(ox, oy);
|
|
214
|
+
arc(r1, outerSweep, ox, oy);
|
|
215
|
+
ring(r1, a0, a0 + (cw ? TAU : -TAU) * (1 - 1e-9), !cw);
|
|
216
|
+
arc(r1, outerSweep, ox, oy);
|
|
217
|
+
const ix = r0 * Math.cos(a0);
|
|
218
|
+
const iy = r0 * Math.sin(a0);
|
|
219
|
+
line(ix, iy);
|
|
220
|
+
arc(r0, outerSweep, ix, iy);
|
|
221
|
+
if (r0 > EPSILON) ring(r0, a0, a0 + (cw ? -TAU : TAU) * (1 - 1e-9), cw);
|
|
222
|
+
else for (let i = 0; i < 2; i++) arc(0, outerSweep, 0, 0);
|
|
223
|
+
arc(r0, outerSweep, ix, iy);
|
|
224
|
+
return `${d}Z`;
|
|
225
|
+
}
|
|
226
|
+
const { a00, a01, a10, a11, da0, da1, rc, rc0, rc1, x01, y01, x10, y10, x11, y11, x00, y00 } = sector(options, r0, r1, a0, a1, da, cw);
|
|
227
|
+
if (da1 > EPSILON && rc1 > EPSILON) {
|
|
228
|
+
const t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
|
|
229
|
+
const t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
|
|
230
|
+
move(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
231
|
+
if (rc1 < rc) {
|
|
232
|
+
const ex = t1.cx + t1.x01;
|
|
233
|
+
const ey = t1.cy + t1.y01;
|
|
234
|
+
arc(rc1, outerSweep, ex, ey);
|
|
235
|
+
arc(r1, outerSweep, ex, ey);
|
|
236
|
+
arc(r1, outerSweep, ex, ey);
|
|
237
|
+
arc(rc1, outerSweep, ex, ey);
|
|
238
|
+
} else {
|
|
239
|
+
arc(rc1, outerSweep, t0.cx + t0.x11, t0.cy + t0.y11);
|
|
240
|
+
ring(r1, angleOf(t0.cx + t0.x11, t0.cy + t0.y11), angleOf(t1.cx + t1.x11, t1.cy + t1.y11), !cw);
|
|
241
|
+
arc(rc1, outerSweep, t1.cx + t1.x01, t1.cy + t1.y01);
|
|
242
|
+
}
|
|
243
|
+
} else {
|
|
244
|
+
move(x01, y01);
|
|
245
|
+
arc(r1, outerSweep, x01, y01);
|
|
246
|
+
if (da1 > EPSILON) ring(r1, a01, a11, !cw);
|
|
247
|
+
else for (let i = 0; i < 2; i++) arc(r1, outerSweep, x01, y01);
|
|
248
|
+
arc(r1, outerSweep, x11, y11);
|
|
249
|
+
}
|
|
250
|
+
if (!(r0 > EPSILON) || !(da0 > EPSILON)) {
|
|
251
|
+
line(x10, y10);
|
|
252
|
+
for (let i = 0; i < 4; i++) arc(r0, outerSweep, x10, y10);
|
|
253
|
+
} else if (rc0 > EPSILON) {
|
|
254
|
+
const t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
|
|
255
|
+
const t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
|
|
256
|
+
line(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
257
|
+
if (rc0 < rc) {
|
|
258
|
+
const ex = t1.cx + t1.x01;
|
|
259
|
+
const ey = t1.cy + t1.y01;
|
|
260
|
+
arc(rc0, outerSweep, ex, ey);
|
|
261
|
+
arc(r0, outerSweep, ex, ey);
|
|
262
|
+
arc(r0, outerSweep, ex, ey);
|
|
263
|
+
arc(rc0, outerSweep, ex, ey);
|
|
264
|
+
} else {
|
|
265
|
+
arc(rc0, outerSweep, t0.cx + t0.x11, t0.cy + t0.y11);
|
|
266
|
+
ring(r0, angleOf(t0.cx + t0.x11, t0.cy + t0.y11), angleOf(t1.cx + t1.x11, t1.cy + t1.y11), cw);
|
|
267
|
+
arc(rc0, outerSweep, t1.cx + t1.x01, t1.cy + t1.y01);
|
|
268
|
+
}
|
|
269
|
+
} else {
|
|
270
|
+
line(x10, y10);
|
|
271
|
+
arc(r0, outerSweep, x10, y10);
|
|
272
|
+
ring(r0, a10, a00, cw);
|
|
273
|
+
arc(r0, outerSweep, x00, y00);
|
|
274
|
+
}
|
|
275
|
+
return `${d}Z`;
|
|
276
|
+
}
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/render/sweep.ts
|
|
279
|
+
/**
|
|
280
|
+
* Arcs that turn to their new angles: a transition of `d` moves each point
|
|
281
|
+
* of a path along a straight line, which bends a slice out of its ring on
|
|
282
|
+
* the way. A path that knows which arc it draws (the `arc` of its node, see
|
|
283
|
+
* `arcNode`) is redrawn frame by frame instead, with the angles and radii
|
|
284
|
+
* in between, so slices grow and shrink around the center. Timed by the
|
|
285
|
+
* path's `transition-duration` (`--tc-duration`), with an ease-out curve.
|
|
286
|
+
*/
|
|
287
|
+
/**
|
|
288
|
+
* A path drawing this arc, which keeps the arc with it (radii, angles, pad
|
|
289
|
+
* angle, corner radius): out of the markup, for the next render to sweep from.
|
|
290
|
+
*/
|
|
291
|
+
function arcNode(name, arc) {
|
|
292
|
+
const node = require_vnode.h("path", {
|
|
293
|
+
class: name,
|
|
294
|
+
d: arcPathStable(arc)
|
|
295
|
+
});
|
|
296
|
+
node.arc = [
|
|
297
|
+
arc.innerRadius,
|
|
298
|
+
arc.outerRadius,
|
|
299
|
+
arc.startAngle,
|
|
300
|
+
arc.endAngle,
|
|
301
|
+
arc.padAngle ?? 0,
|
|
302
|
+
arc.cornerRadius ?? 0
|
|
303
|
+
];
|
|
304
|
+
return node;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Take `el` from the arc of its last render, `prev`, to the arc of `next`.
|
|
308
|
+
* Returns the attributes left for the caller to patch (all but `d`, set
|
|
309
|
+
* here frame by frame), or nothing when there is no sweep: not an arc, the
|
|
310
|
+
* same path, no arc to come from, or a chart without transitions.
|
|
311
|
+
*/
|
|
312
|
+
function sweep(el, prev, next) {
|
|
313
|
+
const { arc, attrs } = next;
|
|
314
|
+
if (!arc || prev.attrs.d === attrs.d) return;
|
|
315
|
+
const origin = require_tween.stop(el) ?? prev.arc;
|
|
316
|
+
const duration = Number.parseFloat(getComputedStyle(el).transitionDuration) * 1e3;
|
|
317
|
+
if (!origin || !(duration > 0)) return;
|
|
318
|
+
require_tween.tween(el, origin, arc, duration, ([innerRadius, outerRadius, startAngle, endAngle, padAngle, cornerRadius]) => arcPathStable({
|
|
319
|
+
innerRadius,
|
|
320
|
+
outerRadius,
|
|
321
|
+
startAngle,
|
|
322
|
+
endAngle,
|
|
323
|
+
padAngle,
|
|
324
|
+
cornerRadius
|
|
325
|
+
}), String(attrs.d));
|
|
326
|
+
return {
|
|
327
|
+
...attrs,
|
|
328
|
+
d: prev.attrs.d
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
//#endregion
|
|
332
|
+
Object.defineProperty(exports, "DEG", {
|
|
333
|
+
enumerable: true,
|
|
334
|
+
get: function() {
|
|
335
|
+
return DEG;
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
Object.defineProperty(exports, "arcCentroid", {
|
|
339
|
+
enumerable: true,
|
|
340
|
+
get: function() {
|
|
341
|
+
return arcCentroid;
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
Object.defineProperty(exports, "arcNode", {
|
|
345
|
+
enumerable: true,
|
|
346
|
+
get: function() {
|
|
347
|
+
return arcNode;
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
Object.defineProperty(exports, "arcPathStable", {
|
|
351
|
+
enumerable: true,
|
|
352
|
+
get: function() {
|
|
353
|
+
return arcPathStable;
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
Object.defineProperty(exports, "padAngleForGap", {
|
|
357
|
+
enumerable: true,
|
|
358
|
+
get: function() {
|
|
359
|
+
return padAngleForGap;
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
Object.defineProperty(exports, "sweep", {
|
|
363
|
+
enumerable: true,
|
|
364
|
+
get: function() {
|
|
365
|
+
return sweep;
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
//# sourceMappingURL=sweep-Duowaput.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sweep-Duowaput.cjs","names":["h","stop"],"sources":["../src/shapes/arc.ts","../src/render/sweep.ts"],"sourcesContent":["/**\n * Annular sector paths with padding and rounded corners, ported from\n * d3-shape's `arc()` (ISC license, Mike Bostock) so geometry matches d3.\n *\n * Angles are in radians, clockwise from 12 o'clock; paths are centered on\n * the origin (translate the group to place them).\n */\n\nconst EPSILON = 1e-12\nconst PI = Math.PI\nconst HALF_PI = PI / 2\nconst TAU = 2 * PI\n\n/** Degrees to radians. */\nexport const DEG: number = Math.PI / 180\n\n/** Room kept around pies and gauges for the halo of the hovered arc, in pixels. */\nexport const HALO = 8\n\n// Clamped like d3-shape's math helpers, so out-of-range inputs saturate instead of NaN.\nconst asin = (x: number): number => (x >= 1 ? HALF_PI : x <= -1 ? -HALF_PI : Math.asin(x))\nconst acos = (x: number): number => (x > 1 ? 0 : x < -1 ? PI : Math.acos(x))\n\nexport interface ArcOptions {\n innerRadius: number\n outerRadius: number\n startAngle: number\n endAngle: number\n /** Angle removed between adjacent arcs, split between both ends. Defaults to `0`. */\n padAngle?: number\n /** Radius the pad angle is measured at. Defaults to `sqrt(inner² + outer²)` like d3. */\n padRadius?: number\n /** Radius of the rounded corners, clamped to half the ring thickness. Defaults to `0`. */\n cornerRadius?: number\n /** Decimal places kept in the path data. Defaults to `2`. */\n precision?: number\n}\n\n/** Canvas-like path builder emitting SVG path data (after d3-path). */\nclass ArcPath {\n d = ''\n #x0: number | null = null\n #y0: number | null = null\n #x1: number | null = null\n #y1: number | null = null\n readonly #k: number\n\n constructor(precision: number) {\n this.#k = 10 ** Math.max(0, Math.min(12, Math.floor(precision)))\n }\n\n #n(value: number): string {\n const rounded = Math.round(value * this.#k) / this.#k\n return String(rounded === 0 ? 0 : rounded)\n }\n\n moveTo(x: number, y: number): void {\n this.#x0 = this.#x1 = x\n this.#y0 = this.#y1 = y\n this.d += `M${this.#n(x)},${this.#n(y)}`\n }\n\n lineTo(x: number, y: number): void {\n this.#x1 = x\n this.#y1 = y\n this.d += `L${this.#n(x)},${this.#n(y)}`\n }\n\n closePath(): void {\n if (this.#x1 !== null) {\n this.#x1 = this.#x0\n this.#y1 = this.#y0\n this.d += 'Z'\n }\n }\n\n arc(x: number, y: number, r: number, a0: number, a1: number, ccw: boolean): void {\n const dx = r * Math.cos(a0)\n const dy = r * Math.sin(a0)\n const x0 = x + dx\n const y0 = y + dy\n const cw = ccw ? 0 : 1\n let da = ccw ? a0 - a1 : a1 - a0\n\n if (this.#x1 === null || this.#y1 === null) {\n this.d += `M${this.#n(x0)},${this.#n(y0)}`\n this.#x0 = x0\n this.#y0 = y0\n } else if (Math.abs(this.#x1 - x0) > EPSILON || Math.abs(this.#y1 - y0) > EPSILON) {\n this.d += `L${this.#n(x0)},${this.#n(y0)}`\n }\n this.#x1 = x0\n this.#y1 = y0\n if (!r) return\n\n if (da < 0) da = (da % TAU) + TAU\n const rr = this.#n(r)\n if (da > TAU - EPSILON) {\n // A complete circle: two half arcs.\n this.d += `A${rr},${rr},0,1,${cw},${this.#n(x - dx)},${this.#n(y - dy)}`\n this.d += `A${rr},${rr},0,1,${cw},${this.#n(x0)},${this.#n(y0)}`\n } else if (da > EPSILON) {\n this.#x1 = x + r * Math.cos(a1)\n this.#y1 = y + r * Math.sin(a1)\n this.d += `A${rr},${rr},0,${da >= PI ? 1 : 0},${cw},${this.#n(this.#x1)},${this.#n(this.#y1)}`\n }\n }\n}\n\nfunction intersect(\n x0: number,\n y0: number,\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n x3: number,\n y3: number,\n): [number, number] | undefined {\n const x10 = x1 - x0\n const y10 = y1 - y0\n const x32 = x3 - x2\n const y32 = y3 - y2\n let t = y32 * x10 - x32 * y10\n if (t * t < EPSILON) return undefined\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t\n return [x0 + t * x10, y0 + t * y10]\n}\n\n/** Center and tangent points of a rounded corner between a radial edge and an arc. */\nfunction cornerTangents(\n x0: number,\n y0: number,\n x1: number,\n y1: number,\n r1: number,\n rc: number,\n cw: boolean,\n) {\n const x01 = x0 - x1\n const y01 = y0 - y1\n const lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01)\n const ox = lo * y01\n const oy = -lo * x01\n const x11 = x0 + ox\n const y11 = y0 + oy\n const x10 = x1 + ox\n const y10 = y1 + oy\n const x00 = (x11 + x10) / 2\n const y00 = (y11 + y10) / 2\n const dx = x10 - x11\n const dy = y10 - y11\n const d2 = dx * dx + dy * dy\n const r = r1 - rc\n const D = x11 * y10 - x10 * y11\n const d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D))\n let cx0 = (D * dy - dx * d) / d2\n let cy0 = (-D * dx - dy * d) / d2\n const cx1 = (D * dy + dx * d) / d2\n const cy1 = (-D * dx + dy * d) / d2\n const dx0 = cx0 - x00\n const dy0 = cy0 - y00\n const dx1 = cx1 - x00\n const dy1 = cy1 - y00\n // Pick the intersection closest to the edge midpoint.\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\n cx0 = cx1\n cy0 = cy1\n }\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1),\n }\n}\n\n/**\n * Padded angles, clamped corner radii and edge points of a partial sector,\n * shared by both path generators so they agree exactly.\n */\nfunction sector(\n options: ArcOptions,\n r0: number,\n r1: number,\n a0: number,\n a1: number,\n da: number,\n cw: boolean,\n) {\n let a01 = a0\n let a11 = a1\n let a00 = a0\n let a10 = a1\n let da0 = da\n let da1 = da\n const ap = (options.padAngle ?? 0) / 2\n const rp = ap > EPSILON ? (options.padRadius ?? Math.sqrt(r0 * r0 + r1 * r1)) : 0\n const rc = Math.min(Math.abs(r1 - r0) / 2, options.cornerRadius ?? 0)\n let rc0 = rc\n let rc1 = rc\n\n // Apply padding: equal linear offsets at both radii keep the gap parallel.\n if (rp > EPSILON) {\n let p0 = asin((rp / r0) * Math.sin(ap))\n let p1 = asin((rp / r1) * Math.sin(ap))\n da0 -= p0 * 2\n if (da0 > EPSILON) {\n p0 *= cw ? 1 : -1\n a00 += p0\n a10 -= p0\n } else {\n da0 = 0\n a00 = a10 = (a0 + a1) / 2\n }\n da1 -= p1 * 2\n if (da1 > EPSILON) {\n p1 *= cw ? 1 : -1\n a01 += p1\n a11 -= p1\n } else {\n da1 = 0\n a01 = a11 = (a0 + a1) / 2\n }\n }\n\n const x01 = r1 * Math.cos(a01)\n const y01 = r1 * Math.sin(a01)\n const x10 = r0 * Math.cos(a10)\n const y10 = r0 * Math.sin(a10)\n const x11 = r1 * Math.cos(a11)\n const y11 = r1 * Math.sin(a11)\n const x00 = r0 * Math.cos(a00)\n const y00 = r0 * Math.sin(a00)\n\n // Restrict the corner radius for narrow sectors, where corners would overlap.\n if (rc > EPSILON && da < PI) {\n const oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)\n if (oc) {\n const ax = x01 - oc[0]\n const ay = y01 - oc[1]\n const bx = x11 - oc[0]\n const by = y11 - oc[1]\n const cos =\n (ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by))\n const kc = 1 / Math.sin(acos(cos) / 2)\n const lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1])\n rc0 = Math.min(rc, (r0 - lc) / (kc - 1))\n rc1 = Math.min(rc, (r1 - lc) / (kc + 1))\n } else {\n rc0 = rc1 = 0\n }\n }\n return { a00, a01, a10, a11, da0, da1, rc, rc0, rc1, x01, y01, x10, y10, x11, y11, x00, y00 }\n}\n\n/** SVG path data of an annular sector (a pie slice when `innerRadius` is 0). */\nexport function arcPath(options: ArcOptions): string {\n const path = new ArcPath(options.precision ?? 2)\n let r0 = Math.max(0, options.innerRadius)\n let r1 = Math.max(0, options.outerRadius)\n if (r1 < r0) [r0, r1] = [r1, r0]\n const a0 = options.startAngle - HALF_PI\n const a1 = options.endAngle - HALF_PI\n const da = Math.abs(a1 - a0)\n const cw = a1 > a0\n\n if (!(r1 > EPSILON)) {\n path.moveTo(0, 0)\n } else if (da > TAU - EPSILON) {\n // A full ring (or disc).\n path.moveTo(r1 * Math.cos(a0), r1 * Math.sin(a0))\n path.arc(0, 0, r1, a0, a1, !cw)\n if (r0 > EPSILON) {\n path.moveTo(r0 * Math.cos(a1), r0 * Math.sin(a1))\n path.arc(0, 0, r0, a1, a0, cw)\n }\n } else {\n const g = sector(options, r0, r1, a0, a1, da, cw)\n const { a00, a01, a10, a11, da0, da1, rc, rc0, rc1, x01, y01, x10, y10 } = g\n\n // Outer ring.\n if (!(da1 > EPSILON)) {\n path.moveTo(x01, y01)\n } else if (rc1 > EPSILON) {\n const { x00, y00, x11, y11 } = g\n const t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw)\n const t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw)\n path.moveTo(t0.cx + t0.x01, t0.cy + t0.y01)\n if (rc1 < rc) {\n path.arc(t0.cx, t0.cy, rc1, Math.atan2(t0.y01, t0.x01), Math.atan2(t1.y01, t1.x01), !cw)\n } else {\n path.arc(t0.cx, t0.cy, rc1, Math.atan2(t0.y01, t0.x01), Math.atan2(t0.y11, t0.x11), !cw)\n path.arc(\n 0,\n 0,\n r1,\n Math.atan2(t0.cy + t0.y11, t0.cx + t0.x11),\n Math.atan2(t1.cy + t1.y11, t1.cx + t1.x11),\n !cw,\n )\n path.arc(t1.cx, t1.cy, rc1, Math.atan2(t1.y11, t1.x11), Math.atan2(t1.y01, t1.x01), !cw)\n }\n } else {\n path.moveTo(x01, y01)\n path.arc(0, 0, r1, a01, a11, !cw)\n }\n\n // Inner ring (or the center of a pie slice).\n if (!(r0 > EPSILON) || !(da0 > EPSILON)) {\n path.lineTo(x10, y10)\n } else if (rc0 > EPSILON) {\n const { x00, y00, x11, y11 } = g\n const t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw)\n const t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw)\n path.lineTo(t0.cx + t0.x01, t0.cy + t0.y01)\n if (rc0 < rc) {\n path.arc(t0.cx, t0.cy, rc0, Math.atan2(t0.y01, t0.x01), Math.atan2(t1.y01, t1.x01), !cw)\n } else {\n path.arc(t0.cx, t0.cy, rc0, Math.atan2(t0.y01, t0.x01), Math.atan2(t0.y11, t0.x11), !cw)\n path.arc(\n 0,\n 0,\n r0,\n Math.atan2(t0.cy + t0.y11, t0.cx + t0.x11),\n Math.atan2(t1.cy + t1.y11, t1.cx + t1.x11),\n cw,\n )\n path.arc(t1.cx, t1.cy, rc0, Math.atan2(t1.y11, t1.x11), Math.atan2(t1.y01, t1.x01), !cw)\n }\n } else {\n path.arc(0, 0, r0, a10, a00, cw)\n }\n }\n\n path.closePath()\n return path.d\n}\n\n/** Midpoint of an arc, e.g. to anchor a tooltip or label (like d3's `arc.centroid`). */\nexport function arcCentroid(options: ArcOptions): [number, number] {\n const r = (options.innerRadius + options.outerRadius) / 2\n const a = (options.startAngle + options.endAngle) / 2 - HALF_PI\n return [Math.cos(a) * r, Math.sin(a) * r]\n}\n\n/** Pad angle giving a constant `gap` (in pixels) between arcs of a ring. */\nexport function padAngleForGap(gap: number, innerRadius: number, outerRadius: number): number {\n const rp = Math.sqrt(innerRadius * innerRadius + outerRadius * outerRadius)\n return rp > 0 ? 2 * Math.asin(Math.min(1, gap / 2 / rp)) : 0\n}\n\n/** Angle of a point around the origin. */\nconst angleOf = (x: number, y: number): number => Math.atan2(y, x)\n\n/**\n * The same sector as {@link arcPath}, drawn with a fixed command structure:\n * every corner is always present (zero length when there is none) and each\n * ring is split into two half arcs, so the large-arc flag never flips.\n * Paths of different angles therefore keep their commands while an arc is\n * redrawn frame by frame, turning to its new angles (see `sweep`).\n */\nexport function arcPathStable(options: ArcOptions): string {\n const k = 10 ** Math.max(0, Math.min(12, Math.floor(options.precision ?? 2)))\n const n = (v: number): string => {\n const r = Math.round(v * k) / k\n return String(r === 0 ? 0 : r)\n }\n let d = ''\n const move = (x: number, y: number) => {\n d += `M${n(x)},${n(y)}`\n }\n const line = (x: number, y: number) => {\n d += `L${n(x)},${n(y)}`\n }\n const arc = (r: number, sweep: 0 | 1, x: number, y: number) => {\n d += `A${n(r)},${n(r)},0,0,${sweep},${n(x)},${n(y)}`\n }\n /** Two half arcs of radius `r` around the origin from angle `a0` to `a1`. */\n const ring = (r: number, a0: number, a1: number, ccw: boolean) => {\n let delta = ccw ? a0 - a1 : a1 - a0\n delta = ((delta % TAU) + TAU) % TAU\n if (delta < EPSILON && Math.abs(a1 - a0) > EPSILON) delta = TAU\n const mid = ccw ? a0 - delta / 2 : a0 + delta / 2\n const sweep: 0 | 1 = ccw ? 0 : 1\n arc(r, sweep, r * Math.cos(mid), r * Math.sin(mid))\n arc(r, sweep, r * Math.cos(a1), r * Math.sin(a1))\n }\n\n let r0 = Math.max(0, options.innerRadius)\n let r1 = Math.max(0, options.outerRadius)\n if (r1 < r0) [r0, r1] = [r1, r0]\n const a0 = options.startAngle - HALF_PI\n const a1 = options.endAngle - HALF_PI\n const da = Math.abs(a1 - a0)\n const cw = a1 > a0\n const outerSweep: 0 | 1 = cw ? 1 : 0\n\n if (!(r1 > EPSILON)) {\n // A point: eleven no-op commands at the origin.\n move(0, 0)\n for (let i = 0; i < 4; i++) arc(0, outerSweep, 0, 0)\n line(0, 0)\n for (let i = 0; i < 4; i++) arc(0, outerSweep, 0, 0)\n return `${d}Z`\n }\n\n if (da > TAU - EPSILON) {\n // A full ring (or disc): the seam between the two rings closes the path.\n const ox = r1 * Math.cos(a0)\n const oy = r1 * Math.sin(a0)\n move(ox, oy)\n arc(r1, outerSweep, ox, oy)\n ring(r1, a0, a0 + (cw ? TAU : -TAU) * (1 - 1e-9), !cw)\n arc(r1, outerSweep, ox, oy)\n const ix = r0 * Math.cos(a0)\n const iy = r0 * Math.sin(a0)\n line(ix, iy)\n arc(r0, outerSweep, ix, iy)\n if (r0 > EPSILON) ring(r0, a0, a0 + (cw ? -TAU : TAU) * (1 - 1e-9), cw)\n else for (let i = 0; i < 2; i++) arc(0, outerSweep, 0, 0)\n arc(r0, outerSweep, ix, iy)\n return `${d}Z`\n }\n\n const { a00, a01, a10, a11, da0, da1, rc, rc0, rc1, x01, y01, x10, y10, x11, y11, x00, y00 } =\n sector(options, r0, r1, a0, a1, da, cw)\n\n // Outer edge: corner, two ring halves, corner.\n if (da1 > EPSILON && rc1 > EPSILON) {\n const t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw)\n const t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw)\n move(t0.cx + t0.x01, t0.cy + t0.y01)\n if (rc1 < rc) {\n // Corners merged: one corner arc covers the edge, the rest is empty.\n const ex = t1.cx + t1.x01\n const ey = t1.cy + t1.y01\n arc(rc1, outerSweep, ex, ey)\n arc(r1, outerSweep, ex, ey)\n arc(r1, outerSweep, ex, ey)\n arc(rc1, outerSweep, ex, ey)\n } else {\n arc(rc1, outerSweep, t0.cx + t0.x11, t0.cy + t0.y11)\n ring(\n r1,\n angleOf(t0.cx + t0.x11, t0.cy + t0.y11),\n angleOf(t1.cx + t1.x11, t1.cy + t1.y11),\n !cw,\n )\n arc(rc1, outerSweep, t1.cx + t1.x01, t1.cy + t1.y01)\n }\n } else {\n move(x01, y01)\n arc(r1, outerSweep, x01, y01)\n if (da1 > EPSILON) ring(r1, a01, a11, !cw)\n else for (let i = 0; i < 2; i++) arc(r1, outerSweep, x01, y01)\n arc(r1, outerSweep, x11, y11)\n }\n\n // Inner edge (or the center of a pie slice): corner, two ring halves, corner.\n if (!(r0 > EPSILON) || !(da0 > EPSILON)) {\n line(x10, y10)\n for (let i = 0; i < 4; i++) arc(r0, outerSweep, x10, y10)\n } else if (rc0 > EPSILON) {\n const t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw)\n const t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw)\n line(t0.cx + t0.x01, t0.cy + t0.y01)\n if (rc0 < rc) {\n const ex = t1.cx + t1.x01\n const ey = t1.cy + t1.y01\n arc(rc0, outerSweep, ex, ey)\n arc(r0, outerSweep, ex, ey)\n arc(r0, outerSweep, ex, ey)\n arc(rc0, outerSweep, ex, ey)\n } else {\n arc(rc0, outerSweep, t0.cx + t0.x11, t0.cy + t0.y11)\n ring(r0, angleOf(t0.cx + t0.x11, t0.cy + t0.y11), angleOf(t1.cx + t1.x11, t1.cy + t1.y11), cw)\n arc(rc0, outerSweep, t1.cx + t1.x01, t1.cy + t1.y01)\n }\n } else {\n line(x10, y10)\n arc(r0, outerSweep, x10, y10)\n ring(r0, a10, a00, cw)\n arc(r0, outerSweep, x00, y00)\n }\n return `${d}Z`\n}\n","/**\n * Arcs that turn to their new angles: a transition of `d` moves each point\n * of a path along a straight line, which bends a slice out of its ring on\n * the way. A path that knows which arc it draws (the `arc` of its node, see\n * `arcNode`) is redrawn frame by frame instead, with the angles and radii\n * in between, so slices grow and shrink around the center. Timed by the\n * path's `transition-duration` (`--tc-duration`), with an ease-out curve.\n */\n\nimport { type ArcOptions, arcPathStable } from '../shapes/arc.ts'\nimport { type Attrs, h, type VNode } from '../vnode.ts'\nimport { stop, tween } from './tween.ts'\n\n/**\n * A path drawing this arc, which keeps the arc with it (radii, angles, pad\n * angle, corner radius): out of the markup, for the next render to sweep from.\n */\nexport function arcNode(name: string, arc: ArcOptions): VNode {\n const node = h('path', { class: name, d: arcPathStable(arc) })\n node.arc = [\n arc.innerRadius,\n arc.outerRadius,\n arc.startAngle,\n arc.endAngle,\n arc.padAngle ?? 0,\n arc.cornerRadius ?? 0,\n ]\n return node\n}\n\n/**\n * Take `el` from the arc of its last render, `prev`, to the arc of `next`.\n * Returns the attributes left for the caller to patch (all but `d`, set\n * here frame by frame), or nothing when there is no sweep: not an arc, the\n * same path, no arc to come from, or a chart without transitions.\n */\nexport function sweep(el: Element, prev: VNode, next: VNode): Attrs | undefined {\n const { arc, attrs } = next\n if (!arc || prev.attrs.d === attrs.d) return\n // An interrupted sweep continues from where the arc is now.\n const origin = stop(el) ?? prev.arc\n // Zero in a chart without transitions (static, resizing, reduced motion).\n const duration = Number.parseFloat(getComputedStyle(el).transitionDuration) * 1000\n if (!origin || !(duration > 0)) return\n tween(\n el,\n origin,\n arc,\n duration,\n ([innerRadius, outerRadius, startAngle, endAngle, padAngle, cornerRadius]) =>\n arcPathStable({\n innerRadius,\n outerRadius,\n startAngle,\n endAngle,\n padAngle,\n cornerRadius,\n } as ArcOptions),\n String(attrs.d),\n )\n return { ...attrs, d: prev.attrs.d as string }\n}\n"],"mappings":";;;;;;;;;;AAQA,MAAM,UAAU;AAChB,MAAM,KAAK,KAAK;AAChB,MAAM,UAAU,KAAK;AACrB,MAAM,MAAM,IAAI;;AAGhB,MAAa,MAAc,KAAK,KAAK;AAMrC,MAAM,QAAQ,MAAuB,KAAK,IAAI,UAAU,KAAK,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC;AACxF,MAAM,QAAQ,MAAuB,IAAI,IAAI,IAAI,IAAI,KAAK,KAAK,KAAK,KAAK,CAAC;AAwF1E,SAAS,UACP,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IAC8B;CAC9B,MAAM,MAAM,KAAK;CACjB,MAAM,MAAM,KAAK;CACjB,MAAM,MAAM,KAAK;CACjB,MAAM,MAAM,KAAK;CACjB,IAAI,IAAI,MAAM,MAAM,MAAM;CAC1B,IAAI,IAAI,IAAI,SAAS,OAAO,KAAA;CAC5B,KAAK,OAAO,KAAK,MAAM,OAAO,KAAK,OAAO;CAC1C,OAAO,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG;AACpC;;AAGA,SAAS,eACP,IACA,IACA,IACA,IACA,IACA,IACA,IACA;CACA,MAAM,MAAM,KAAK;CACjB,MAAM,MAAM,KAAK;CACjB,MAAM,MAAM,KAAK,KAAK,CAAC,MAAM,KAAK,KAAK,MAAM,MAAM,MAAM,GAAG;CAC5D,MAAM,KAAK,KAAK;CAChB,MAAM,KAAK,CAAC,KAAK;CACjB,MAAM,MAAM,KAAK;CACjB,MAAM,MAAM,KAAK;CACjB,MAAM,MAAM,KAAK;CACjB,MAAM,MAAM,KAAK;CACjB,MAAM,OAAO,MAAM,OAAO;CAC1B,MAAM,OAAO,MAAM,OAAO;CAC1B,MAAM,KAAK,MAAM;CACjB,MAAM,KAAK,MAAM;CACjB,MAAM,KAAK,KAAK,KAAK,KAAK;CAC1B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