@genome-spy/app 1.1.1 → 1.3.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/dist/{SharedReadCache-Ey5QIiPM.js → SharedReadCache-9sT2aIxW.js} +6 -12
- package/dist/__vite-browser-external-Dgu_Ldik.js +7 -0
- package/dist/{agentApi-sPuuT0KS.js → agentApi-BclFF9zB.js} +9981 -8914
- package/dist/agentApi.es.js +6783 -5135
- package/dist/agentShared.es.js +433 -460
- package/dist/arrayUtils-Bm7QnzhN.js +1306 -0
- package/dist/{blosc-JROzDOnd.js → blosc-C-W97QwH.js} +3 -3
- package/dist/{canvas2d-iDK4BC5j.js → canvas2d-8MSf70d4.js} +141 -134
- package/dist/{canvas2d-MXaFeZnP.js → canvas2d-BwGNI_Rx.js} +147 -141
- package/dist/clipOptions-SrrxeAEU.js +4316 -0
- package/dist/clipOptions-clBEbkjv.js +4326 -0
- package/dist/{layoutResult-D50MSHXR.js → color-jETn8xK_.js} +29 -10
- package/dist/color-uTRRsy8i.js +116 -0
- package/dist/{componentStyles-DGtQXvwc.js → componentStyles-C7FbjS-a.js} +1 -1
- package/dist/{viewIdentityRegistry-BIYd4TE0.js → containerView-BItRtKqu.js} +28 -31
- package/dist/{viewIdentityRegistry-BDKkEjXl.js → containerView-CWa6ZIJW.js} +28 -31
- package/dist/{debug-DbigmdrK.js → debug-23s-jja_.js} +10 -9
- package/dist/{debug-BlqDxTw3.js → debug-CWRxvAss.js} +9 -10
- package/dist/dialog.es.js +1 -1
- package/dist/dist-CmY6iewb.js +1501 -0
- package/dist/dist-D6xbz5Ks.js +1501 -0
- package/dist/{esm-CjkeZi__.js → esm-BFwBAnbO.js} +25 -25
- package/dist/esm-BUkWqSr2.js +299 -0
- package/dist/{esm-C-6g-SkZ.js → esm-C0xXMLsR.js} +37 -41
- package/dist/{esm-CJeszW-t.js → esm-C2xhhXs0.js} +7 -7
- package/dist/esm-C6erfjPM.js +252 -0
- package/dist/{esm-DFHFX1sH.js → esm-CVjC7qA4.js} +34 -38
- package/dist/esm-CqY5ezGz.js +1249 -0
- package/dist/esm-DfMIJ_N2.js +1522 -0
- package/dist/esm-Dls41IbZ.js +787 -0
- package/dist/{esm-Bv7Frz7C.js → esm-DzQDfrsZ.js} +7 -10
- package/dist/esm-aGLCvYRP.js +238 -0
- package/dist/{esm-VFJeyk9i.js → esm-nzwgJFGz.js} +40 -36
- package/dist/figWigMetadataSourceAdapter-8Kf_vZRf.js +36 -0
- package/dist/figWigMetadataSourceAdapter-DdDMZpYO.js +36 -0
- package/dist/flowNode-BSjy0Wz3.js +1306 -0
- package/dist/flowOutput-D5qpxWe0.js +183 -0
- package/dist/index.es.js +4766 -5522
- package/dist/index.js +1089 -685
- package/dist/inflate-BdC5KvHn.js +886 -0
- package/dist/{lz4-CUYSbVey.js → lz4-BLPgBOlE.js} +1 -1
- package/dist/markUtils-RaatLEa-.js +78 -0
- package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
- package/dist/metadataUtils-DxEPe0vj.js +879 -0
- package/dist/order-BnKzKjt4.js +1151 -0
- package/dist/order-BpJnq_nV.js +1150 -0
- package/dist/{parquetRead-0hFIa3Cc.js → parquetRead-D-yY8njE.js} +3 -11
- package/dist/{rasterExport-B62RmAK1.js → rasterExport-B-WrX1pa.js} +5 -5
- package/dist/{rasterExport-DQH3hVg_.js → rasterExport-C_vx4Jwd.js} +4 -4
- package/dist/{rasterization-B05bDo5e.js → rasterization-QktH8Sn2.js} +26 -19
- package/dist/rectangle-BAdoDPXu.js +194 -0
- package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
- package/dist/renderCanvas2D-CsRO78Pq.js +291 -0
- package/dist/{renderCanvas2D-Bdv-B4wj.js → renderCanvas2D-Y7pkRzbC.js} +98 -92
- package/dist/{rolldown-runtime-DF993M8W.js → rolldown-runtime-DeIk2rA4.js} +1 -1
- package/dist/{indexer-DbFTKGlm.js → scaleNull-CVzag4z8.js} +2 -12
- package/dist/{indexer-En7gpvLN.js → scaleNull-Pbz7QGnl.js} +2 -12
- package/dist/{scalePosition-ByvlXaML.js → scalePosition-CRXa0rCC.js} +8 -1
- package/dist/schema.json +33403 -16929
- package/dist/style.css +1 -1
- package/dist/{svg-N3tj05-e.js → svg-BBMtLgtM.js} +445 -362
- package/dist/{svg-DHsq1RpV.js → svg-JjWL6U-T.js} +464 -381
- package/dist/{svgRasterizer-CYVDlt5z.js → svgRasterizer-6OcftuoI.js} +3 -3
- package/dist/{svgRasterizer-CvCBlxLj.js → svgRasterizer-DkNRaCPs.js} +4 -4
- package/dist/tableMetadataSourceAdapter-CUNwLsdi.js +291 -0
- package/dist/tableMetadataSourceAdapter-DQrEXCo6.js +1283 -0
- package/dist/url-DeOdSRrv.js +183 -0
- package/dist/viewError-B0TMfOpB.js +33 -0
- package/dist/viewError-D9aO90cI.js +33 -0
- package/dist/{viewSelectors-DDLW-byr.js → viewSelectors-DkFvo33d.js} +914 -752
- package/dist/{viewSelectors-j-F9XwsE.js → viewSelectors-lM93fHAq.js} +942 -780
- package/dist/viewUtils-0SJOewM6.js +6195 -0
- package/dist/webgl-CXIO3OQz.js +5782 -0
- package/dist/webgl-Pdvfhio5.js +5783 -0
- package/package.json +7 -5
- package/src/agentApi/index.d.ts +3 -2
- package/src/agentShared/index.d.ts +2 -0
- package/src/appTypes.d.ts +1 -6
- package/src/embedTypes.d.ts +36 -1
- package/src/index.d.ts +6 -0
- package/src/spec/sampleView.d.ts +68 -13
- package/src/spec/view.d.ts +44 -5
- package/src/state/paramProvenanceTypes.d.ts +25 -2
- package/src/state.d.ts +14 -52
- package/dist/clipOptions-B5PibDq3.js +0 -2923
- package/dist/clipOptions-Cba4I0AO.js +0 -2903
- package/dist/esm-Dndm-NaA.js +0 -1193
- package/dist/order-B4uR9Q04.js +0 -1062
- package/dist/order-BSPy5DI8.js +0 -1062
- package/dist/renderCanvas2D-ChdoHGrU.js +0 -285
- package/dist/vega-scale-Byaw1K8O.js +0 -2446
- package/dist/vega-scale-Ctz_wa3z.js +0 -2443
- package/dist/viewError-BiR9VCgL.js +0 -29
- package/dist/viewUtils-JX6CMEYH.js +0 -6664
- package/dist/webgl-DdmOwEH0.js +0 -5544
- package/dist/webgl-Dw8xqZpX.js +0 -5544
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { o as e, s as t,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { o as e, s as t, un as n } from "./clipOptions-SrrxeAEU.js";
|
|
2
|
+
import { x as r } from "./viewSelectors-DkFvo33d.js";
|
|
3
|
+
import { r as i } from "./arrayUtils-Bm7QnzhN.js";
|
|
4
4
|
import { t as a } from "./rasterization-CFogVB3B.js";
|
|
5
|
-
import { t as o } from "./rectangle-
|
|
6
|
-
import { n as s,
|
|
7
|
-
import { A as l,
|
|
8
|
-
import { n as
|
|
5
|
+
import { t as o } from "./rectangle-DZTR6NFQ.js";
|
|
6
|
+
import { n as s, r as c } from "./color-jETn8xK_.js";
|
|
7
|
+
import { A as l, C as u, D as d, F as f, I as p, L as m, M as h, N as g, P as _, R as v, S as y, T as b, _ as x, a as S, b as C, c as w, d as T, g as E, h as D, i as O, j as k, k as A, l as j, m as M, n as ee, o as te, p as ne, r as re, s as ie, t as ae, u as oe, v as se, x as ce, y as le } from "./order-BnKzKjt4.js";
|
|
8
|
+
import { n as N, t as P } from "./svgNumber-DNxESJQB.js";
|
|
9
9
|
//#region ../core/src/rendering/svg/svgElement.js
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let n = document.createElementNS(
|
|
10
|
+
var F = "http://www.w3.org/2000/svg";
|
|
11
|
+
function I(e, t) {
|
|
12
|
+
let n = document.createElementNS(F, e);
|
|
13
13
|
if (t) for (let [e, r] of Object.entries(t)) n.setAttribute(e, "" + r);
|
|
14
14
|
return n;
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region ../core/src/rendering/svg/svgAttributes.js
|
|
18
|
-
function I(e, t) {
|
|
19
|
-
let n = Object.entries(t).filter(([t, n]) => !n.encoder.constant || (e.setAttribute(t, "" + L(n, {})), !1));
|
|
20
|
-
return (e) => Object.fromEntries(n.map(([t, n]) => [t, L(n, e)]));
|
|
21
|
-
}
|
|
22
18
|
function L(e, t) {
|
|
19
|
+
let n = Object.entries(t).filter(([t, n]) => !n.encoder.constant || (e.setAttribute(t, "" + R(n, {})), !1));
|
|
20
|
+
return (e) => Object.fromEntries(n.map(([t, n]) => [t, R(n, e)]));
|
|
21
|
+
}
|
|
22
|
+
function R(e, t) {
|
|
23
23
|
let n = e.encoder(t);
|
|
24
24
|
return e.transform ? e.transform(n) : "" + n;
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region ../core/src/rendering/svg/renderers/arrow.js
|
|
28
|
-
function
|
|
29
|
-
let n = e, { coords: r, data: i, group: a, viewOpacity: o, visibleBounds: s } = t, c = n.encoders,
|
|
28
|
+
function ue(e, t) {
|
|
29
|
+
let n = e, { coords: r, data: i, group: a, viewOpacity: o, visibleBounds: s } = t, c = n.encoders, l = L(a, {
|
|
30
30
|
fill: {
|
|
31
31
|
encoder: c.fill,
|
|
32
|
-
transform:
|
|
32
|
+
transform: h
|
|
33
33
|
},
|
|
34
34
|
"fill-opacity": {
|
|
35
35
|
encoder: c.fillOpacity,
|
|
@@ -37,7 +37,7 @@ function de(e, t) {
|
|
|
37
37
|
},
|
|
38
38
|
stroke: {
|
|
39
39
|
encoder: c.stroke,
|
|
40
|
-
transform:
|
|
40
|
+
transform: h
|
|
41
41
|
},
|
|
42
42
|
"stroke-opacity": {
|
|
43
43
|
encoder: c.strokeOpacity,
|
|
@@ -45,79 +45,78 @@ function de(e, t) {
|
|
|
45
45
|
},
|
|
46
46
|
"stroke-width": {
|
|
47
47
|
encoder: c.strokeWidth,
|
|
48
|
-
transform: (e) =>
|
|
48
|
+
transform: (e) => P(+e)
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
a.setAttribute("stroke-linejoin", "miter");
|
|
52
|
-
let d =
|
|
53
|
-
return
|
|
52
|
+
let d = u(n);
|
|
53
|
+
return b(n, d, {
|
|
54
54
|
coords: r,
|
|
55
55
|
data: i,
|
|
56
56
|
visibleBounds: s,
|
|
57
57
|
viewOpacity: o,
|
|
58
58
|
countOnly: t.countOnly
|
|
59
59
|
}, (e) => {
|
|
60
|
-
t.countOnly || (e.headShapeFallback && t.warn(`SVG export rendered unsupported arrow headShape "${d.headShape}" as a triangle.`), a.appendChild(
|
|
61
|
-
d: e.boundaryLoops.map(
|
|
62
|
-
...
|
|
60
|
+
t.countOnly || (e.headShapeFallback && t.warn(`SVG export rendered unsupported arrow headShape "${d.headShape}" as a triangle.`), a.appendChild(I("path", {
|
|
61
|
+
d: e.boundaryLoops.map(de).join(" "),
|
|
62
|
+
...l(e.datum)
|
|
63
63
|
})));
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return `M ${e.map(
|
|
66
|
+
function de(e) {
|
|
67
|
+
return `M ${e.map(fe).join(" L ")} Z`;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return `${
|
|
69
|
+
function fe(e) {
|
|
70
|
+
return `${P(e.x)} ${P(e.y)}`;
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region ../core/src/rendering/svg/renderers/link.js
|
|
74
|
-
function
|
|
75
|
-
let n = e, r =
|
|
76
|
-
|
|
77
|
-
let g =
|
|
74
|
+
function pe(e, t) {
|
|
75
|
+
let n = e, r = se(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, l = n.encoders, u = y(n, r.shape, t.secondOrderPass), f = .5, p = l.opacity.constant && l.size.constant, m = (e) => d(l.opacity, e) * s * Math.max(0, Math.min(d(l.size, e) / f, 1));
|
|
76
|
+
p && o.setAttribute("stroke-opacity", "" + m({}));
|
|
77
|
+
let g = L(o, {
|
|
78
78
|
stroke: {
|
|
79
|
-
encoder:
|
|
80
|
-
transform:
|
|
79
|
+
encoder: l.color,
|
|
80
|
+
transform: h
|
|
81
81
|
},
|
|
82
82
|
"stroke-width": {
|
|
83
|
-
encoder:
|
|
84
|
-
transform: (e) =>
|
|
83
|
+
encoder: l.size,
|
|
84
|
+
transform: (e) => P(Math.max(+e, f))
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
|
-
o.setAttribute("fill", "none"), o.setAttribute("stroke-linecap", "butt");
|
|
87
|
+
o.setAttribute("fill", "none"), o.setAttribute("stroke-linecap", "butt"), o.setAttribute("stroke-linejoin", "miter"), o.setAttribute("stroke-miterlimit", "2");
|
|
88
88
|
let _ = o, v;
|
|
89
|
-
return
|
|
89
|
+
return le(n, r, {
|
|
90
90
|
coords: i,
|
|
91
91
|
data: a,
|
|
92
92
|
visibleBounds: c
|
|
93
|
-
}, ({ datum: e,
|
|
94
|
-
let [r, i, a, s] = n;
|
|
93
|
+
}, ({ datum: e, geometry: n }) => {
|
|
95
94
|
if (t.countOnly) return;
|
|
96
|
-
let
|
|
97
|
-
|
|
98
|
-
let
|
|
99
|
-
p1:
|
|
100
|
-
p4:
|
|
101
|
-
distances:
|
|
95
|
+
let r = g(e);
|
|
96
|
+
p || (r["stroke-opacity"] = m(e));
|
|
97
|
+
let i = u && n.type == "cubic" ? t.getLinkArcFadeMaskUrl({
|
|
98
|
+
p1: n.points[0],
|
|
99
|
+
p4: n.points[3],
|
|
100
|
+
distances: u
|
|
102
101
|
}) : void 0;
|
|
103
|
-
|
|
104
|
-
d: `M ${
|
|
105
|
-
...
|
|
102
|
+
i !== v && (v = i, _ = i ? I("g", { mask: i }) : o, i && o.appendChild(_)), _.appendChild(I("path", {
|
|
103
|
+
d: n.type == "orthogonal" ? `M ${z(n.points[0])} L ${z(n.points[1])} L ${z(n.points[2])}` : `M ${z(n.points[0])} C ${n.points.slice(1).map(z).join(" ")}`,
|
|
104
|
+
...r
|
|
106
105
|
}));
|
|
107
106
|
});
|
|
108
107
|
}
|
|
109
|
-
function
|
|
110
|
-
return e.map(
|
|
108
|
+
function z(e) {
|
|
109
|
+
return e.map(P).join(" ");
|
|
111
110
|
}
|
|
112
111
|
//#endregion
|
|
113
112
|
//#region ../core/src/rendering/svg/renderers/point.js
|
|
114
|
-
function
|
|
113
|
+
function me(e, t) {
|
|
115
114
|
let n = e;
|
|
116
115
|
k(n, n.properties.fillGradientStrength) && t.warn("SVG export ignored unsupported point property fillGradientStrength."), n.properties.geometricZoomBound && t.warn("SVG export ignored unsupported point property geometricZoomBound.");
|
|
117
|
-
let r = E(n), { inwardStroke: i } = r, { group: a, viewOpacity: o } = t, s = n.encoders, c =
|
|
116
|
+
let r = E(n), { inwardStroke: i } = r, { group: a, viewOpacity: o } = t, s = n.encoders, c = A(s.fill), l = A(s.stroke), u = L(a, {
|
|
118
117
|
fill: {
|
|
119
118
|
encoder: s.fill,
|
|
120
|
-
transform:
|
|
119
|
+
transform: h
|
|
121
120
|
},
|
|
122
121
|
"fill-opacity": {
|
|
123
122
|
encoder: s.fillOpacity,
|
|
@@ -125,7 +124,7 @@ function z(e, t) {
|
|
|
125
124
|
},
|
|
126
125
|
stroke: {
|
|
127
126
|
encoder: s.stroke,
|
|
128
|
-
transform:
|
|
127
|
+
transform: h
|
|
129
128
|
},
|
|
130
129
|
"stroke-opacity": {
|
|
131
130
|
encoder: s.strokeOpacity,
|
|
@@ -133,47 +132,53 @@ function z(e, t) {
|
|
|
133
132
|
},
|
|
134
133
|
"stroke-width": {
|
|
135
134
|
encoder: s.strokeWidth,
|
|
136
|
-
transform: (e) =>
|
|
135
|
+
transform: (e) => P(+e)
|
|
137
136
|
}
|
|
138
|
-
}),
|
|
139
|
-
return
|
|
137
|
+
}), d = a.getAttribute("fill"), f = a.getAttribute("fill-opacity"), p = a.getAttribute("stroke"), m = a.getAttribute("stroke-opacity"), g = he();
|
|
138
|
+
return x(n, r, t, (e) => {
|
|
140
139
|
if (t.countOnly) return;
|
|
141
|
-
let { datum: n,
|
|
142
|
-
...
|
|
143
|
-
...i && !
|
|
144
|
-
...
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
...g
|
|
151
|
-
})));
|
|
140
|
+
let { datum: n, radius: r, geometryRadius: h, strokeWidth: _, lineShape: v } = e, y = {
|
|
141
|
+
...u(n),
|
|
142
|
+
...i && !v ? { "stroke-width": P(_) } : {},
|
|
143
|
+
...v ? ge(s, n, o, l) : {}
|
|
144
|
+
}, b = r == h ? 0 : +(y["stroke-opacity"] ?? m) * l(String(y.stroke ?? p)), x = b > 0, S = !v && r != h && (!x || b < 1) && +(y["fill-opacity"] ?? f) * c(String(y.fill ?? d)) > 0;
|
|
145
|
+
S && (a.appendChild(B(e, r, {
|
|
146
|
+
...y,
|
|
147
|
+
stroke: "none"
|
|
148
|
+
}, g, t.warn)), y.fill = "none"), (!S || x) && a.appendChild(B(e, h, y, g, t.warn));
|
|
152
149
|
});
|
|
153
150
|
}
|
|
154
|
-
function
|
|
155
|
-
let o =
|
|
156
|
-
if (
|
|
157
|
-
cx:
|
|
158
|
-
cy:
|
|
159
|
-
r:
|
|
160
|
-
...
|
|
151
|
+
function B(e, t, n, r, i) {
|
|
152
|
+
let { shape: a, x: o, y: s, angle: c } = e, l = P(o), u = P(s), d = P(t), f;
|
|
153
|
+
if (a == "circle") f = I("circle", {
|
|
154
|
+
cx: l,
|
|
155
|
+
cy: u,
|
|
156
|
+
r: d,
|
|
157
|
+
...n
|
|
161
158
|
});
|
|
162
|
-
if (
|
|
163
|
-
x:
|
|
164
|
-
y:
|
|
165
|
-
width:
|
|
166
|
-
height:
|
|
167
|
-
...
|
|
159
|
+
else if (a == "square") f = I("rect", {
|
|
160
|
+
x: P(o - t),
|
|
161
|
+
y: P(s - t),
|
|
162
|
+
width: P(t * 2),
|
|
163
|
+
height: P(t * 2),
|
|
164
|
+
...n
|
|
168
165
|
});
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
166
|
+
else {
|
|
167
|
+
let e = r.build(a, o, s, t);
|
|
168
|
+
e ? f = I("path", {
|
|
169
|
+
d: e,
|
|
170
|
+
...n
|
|
171
|
+
}) : (i(`SVG export rendered unsupported point shape "${a}" as a circle.`), f = I("circle", {
|
|
172
|
+
cx: l,
|
|
173
|
+
cy: u,
|
|
174
|
+
r: d,
|
|
175
|
+
...n
|
|
176
|
+
}));
|
|
177
|
+
}
|
|
178
|
+
return c && f.setAttribute("transform", `rotate(${P(c)} ${l} ${u})`), f;
|
|
174
179
|
}
|
|
175
|
-
function
|
|
176
|
-
let e = "", t = (e, t) => `${
|
|
180
|
+
function he() {
|
|
181
|
+
let e = "", t = (e, t) => `${P(e)} ${P(t)}`, n = {
|
|
177
182
|
moveTo(n, r) {
|
|
178
183
|
e += `${e ? " M" : "M"} ${t(n, r)}`;
|
|
179
184
|
},
|
|
@@ -185,26 +190,26 @@ function ge() {
|
|
|
185
190
|
}
|
|
186
191
|
};
|
|
187
192
|
return { build(t, r, i, a) {
|
|
188
|
-
return e = "",
|
|
193
|
+
return e = "", D(t, r, i, a, n) ? e : void 0;
|
|
189
194
|
} };
|
|
190
195
|
}
|
|
191
|
-
function
|
|
192
|
-
let
|
|
196
|
+
function ge(e, t, n, r) {
|
|
197
|
+
let i = h(e.stroke(t)), a = d(e.strokeOpacity, t), o = a * r(i) <= 0;
|
|
193
198
|
return {
|
|
194
199
|
fill: "none",
|
|
195
|
-
stroke:
|
|
196
|
-
"stroke-opacity": (
|
|
197
|
-
"stroke-width":
|
|
200
|
+
stroke: h(o ? e.fill(t) : i),
|
|
201
|
+
"stroke-opacity": (o ? d(e.fillOpacity, t) : a) * n,
|
|
202
|
+
"stroke-width": P(d(e.strokeWidth, t)),
|
|
198
203
|
"stroke-linecap": "butt"
|
|
199
204
|
};
|
|
200
205
|
}
|
|
201
206
|
//#endregion
|
|
202
207
|
//#region ../core/src/rendering/svg/renderers/rect.js
|
|
203
|
-
function
|
|
204
|
-
let n = e, r =
|
|
208
|
+
function _e(e, t) {
|
|
209
|
+
let n = e, r = ne(n), { shadow: i, hatch: a } = r, { group: o, viewOpacity: s } = t, c = n.encoders, l = A(c.fill), u = L(o, {
|
|
205
210
|
fill: {
|
|
206
211
|
encoder: c.fill,
|
|
207
|
-
transform:
|
|
212
|
+
transform: h
|
|
208
213
|
},
|
|
209
214
|
"fill-opacity": {
|
|
210
215
|
encoder: c.fillOpacity,
|
|
@@ -212,7 +217,7 @@ function ve(e, t) {
|
|
|
212
217
|
},
|
|
213
218
|
stroke: {
|
|
214
219
|
encoder: c.stroke,
|
|
215
|
-
transform:
|
|
220
|
+
transform: h
|
|
216
221
|
},
|
|
217
222
|
"stroke-opacity": {
|
|
218
223
|
encoder: c.strokeOpacity,
|
|
@@ -220,136 +225,191 @@ function ve(e, t) {
|
|
|
220
225
|
},
|
|
221
226
|
"stroke-width": {
|
|
222
227
|
encoder: c.strokeWidth,
|
|
223
|
-
transform: (e) =>
|
|
228
|
+
transform: (e) => P(+e)
|
|
224
229
|
}
|
|
225
230
|
}), f = i.opacity > 0 ? {
|
|
226
231
|
fill: i.color,
|
|
227
232
|
"fill-opacity": 1,
|
|
228
233
|
stroke: i.color,
|
|
229
234
|
"stroke-opacity": 1,
|
|
230
|
-
opacity:
|
|
235
|
+
opacity: N(i.opacity * s),
|
|
231
236
|
filter: t.getShadowFilterUrl(i)
|
|
232
237
|
} : null;
|
|
233
|
-
return
|
|
238
|
+
return M(n, r, t, (e) => {
|
|
234
239
|
if (t.countOnly) return;
|
|
235
|
-
let { datum: n, x: r, y: i, width: p, height: m, radii:
|
|
240
|
+
let { datum: n, x: r, y: i, width: p, height: m, radii: g, opacityFactor: _, strokeWidth: v, fill: y, fillOpacity: b } = e, x = {
|
|
236
241
|
...u(n),
|
|
237
|
-
...
|
|
242
|
+
..._ == 1 ? {} : { opacity: N(_) }
|
|
238
243
|
};
|
|
239
|
-
if (a != "none" &&
|
|
244
|
+
if (a != "none" && v > 0 && (x.fill = t.getRectHatchPatternUrl({
|
|
240
245
|
type: a,
|
|
241
|
-
fill:
|
|
246
|
+
fill: h(c.fill(n)),
|
|
242
247
|
fillOpacity: d(c.fillOpacity, n) * s,
|
|
243
|
-
stroke:
|
|
248
|
+
stroke: h(c.stroke(n)),
|
|
244
249
|
strokeOpacity: d(c.strokeOpacity, n) * s,
|
|
245
|
-
strokeWidth:
|
|
246
|
-
}),
|
|
247
|
-
let e =
|
|
250
|
+
strokeWidth: v
|
|
251
|
+
}), x["fill-opacity"] = 1), f) {
|
|
252
|
+
let e = V(r, i, p, m, g, {
|
|
248
253
|
...f,
|
|
249
|
-
"stroke-width":
|
|
254
|
+
"stroke-width": P(v)
|
|
250
255
|
});
|
|
251
|
-
if (a == "none" &&
|
|
256
|
+
if (a == "none" && y != "none" && b * l(y) == 1 && _ == 1) o.appendChild(e);
|
|
252
257
|
else {
|
|
253
|
-
let n =
|
|
258
|
+
let n = v / 2, a = Object.fromEntries(Object.entries(g).map(([e, t]) => [e, t + n])), s = H(r - n, i - n, p + n * 2, m + n * 2, a), c = I("g", { "clip-path": t.getShadowClipPathUrl(s) });
|
|
254
259
|
c.appendChild(e), o.appendChild(c);
|
|
255
260
|
}
|
|
256
261
|
}
|
|
257
|
-
o.appendChild(
|
|
262
|
+
o.appendChild(V(r, i, p, m, g, x));
|
|
258
263
|
});
|
|
259
264
|
}
|
|
260
|
-
function
|
|
261
|
-
if (
|
|
262
|
-
let o = i.topLeft, s =
|
|
263
|
-
return
|
|
265
|
+
function V(e, t, n, r, i, a) {
|
|
266
|
+
if (ve(i)) {
|
|
267
|
+
let o = i.topLeft, s = P(e), c = P(t), l = P(e + n), u = P(t + r);
|
|
268
|
+
return I("rect", {
|
|
264
269
|
x: s,
|
|
265
270
|
y: c,
|
|
266
|
-
width:
|
|
267
|
-
height:
|
|
271
|
+
width: P(l - s),
|
|
272
|
+
height: P(u - c),
|
|
268
273
|
...o ? {
|
|
269
|
-
rx:
|
|
270
|
-
ry:
|
|
274
|
+
rx: P(o),
|
|
275
|
+
ry: P(o)
|
|
271
276
|
} : {},
|
|
272
277
|
...a
|
|
273
278
|
});
|
|
274
279
|
}
|
|
275
|
-
return
|
|
276
|
-
d:
|
|
280
|
+
return I("path", {
|
|
281
|
+
d: H(e, t, n, r, i),
|
|
277
282
|
...a
|
|
278
283
|
});
|
|
279
284
|
}
|
|
280
|
-
function
|
|
285
|
+
function ve(e) {
|
|
281
286
|
return Object.values(e).every((t) => t == e.topLeft);
|
|
282
287
|
}
|
|
283
|
-
function
|
|
288
|
+
function H(e, t, n, r, i) {
|
|
284
289
|
let a = e + n, o = t + r, { topLeft: s, topRight: c, bottomRight: l, bottomLeft: u } = i;
|
|
285
290
|
return [
|
|
286
|
-
`M ${
|
|
287
|
-
`H ${
|
|
288
|
-
|
|
289
|
-
`V ${
|
|
290
|
-
|
|
291
|
-
`H ${
|
|
292
|
-
|
|
293
|
-
`V ${
|
|
294
|
-
|
|
291
|
+
`M ${W(e + s, t)}`,
|
|
292
|
+
`H ${P(a - c)}`,
|
|
293
|
+
U(c, a, t + c, a, t),
|
|
294
|
+
`V ${P(o - l)}`,
|
|
295
|
+
U(l, a - l, o, a, o),
|
|
296
|
+
`H ${P(e + u)}`,
|
|
297
|
+
U(u, e, o - u, e, o),
|
|
298
|
+
`V ${P(t + s)}`,
|
|
299
|
+
U(s, e + s, t, e, t),
|
|
295
300
|
"Z"
|
|
296
301
|
].join(" ");
|
|
297
302
|
}
|
|
298
|
-
function
|
|
299
|
-
return e ? `A ${
|
|
303
|
+
function U(e, t, n, r, i) {
|
|
304
|
+
return e ? `A ${P(e)} ${P(e)} 0 0 1 ${W(t, n)}` : `L ${W(r, i)}`;
|
|
300
305
|
}
|
|
301
|
-
function
|
|
302
|
-
return `${
|
|
306
|
+
function W(e, t) {
|
|
307
|
+
return `${P(e)} ${P(t)}`;
|
|
308
|
+
}
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region ../core/src/rendering/svg/rulePath.js
|
|
311
|
+
function ye(e, t, n, r, i) {
|
|
312
|
+
if (r?.some((e) => e < 0 || !Number.isFinite(e))) throw Error("Invalid stroke dash pattern: " + JSON.stringify(r));
|
|
313
|
+
let a = t / 2, o = [], s = (e, t) => {
|
|
314
|
+
if (e === t && n === "butt") return;
|
|
315
|
+
n === "square" && (e -= a, t += a);
|
|
316
|
+
let r = o.at(-1);
|
|
317
|
+
r && e <= r[1] ? r[1] = Math.max(r[1], t) : o.push([e, t]);
|
|
318
|
+
}, c = r?.length ?? 0, l = (r?.reduce((e, t) => e + t, 0) ?? 0) * (c % 2 ? 2 : 1);
|
|
319
|
+
if (l === 0) s(0, e);
|
|
320
|
+
else {
|
|
321
|
+
let t = -((i % l + l) % l);
|
|
322
|
+
for (let n = 0; t <= e; n++) {
|
|
323
|
+
let i = t + r[n % c];
|
|
324
|
+
n % 2 == 0 && i >= 0 && s(Math.max(0, t), Math.min(e, i)), t = i;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
let u = "", d = (e, t) => `A${a} ${a} 0 0 1 ${e} ${t}`;
|
|
328
|
+
for (let e = 0; e < o.length;) {
|
|
329
|
+
let r = e;
|
|
330
|
+
if (n === "round") for (; r + 1 < o.length && o[r + 1][0] - o[r][1] < t;) r++;
|
|
331
|
+
u += `M${o[e][0]} ${-a}H${o[e][1]}`;
|
|
332
|
+
for (let t = e; t < r; t++) {
|
|
333
|
+
let e = o[t][1], n = o[t + 1][0], r = (e + n) / 2, i = Math.sqrt(Math.max(0, a * a - ((n - e) / 2) ** 2));
|
|
334
|
+
u += d(r, -i) + d(n, -a) + `H${o[t + 1][1]}`;
|
|
335
|
+
}
|
|
336
|
+
u += n === "round" ? d(o[r][1], a) : `V${a}`, u += `H${o[r][0]}`;
|
|
337
|
+
for (let t = r; t > e; t--) {
|
|
338
|
+
let e = o[t - 1][1], n = o[t][0], r = (e + n) / 2, i = Math.sqrt(Math.max(0, a * a - ((n - e) / 2) ** 2));
|
|
339
|
+
u += d(r, i) + d(e, a) + `H${o[t - 1][0]}`;
|
|
340
|
+
}
|
|
341
|
+
n === "round" && (u += d(o[e][0], -a)), u += "Z", e = r + 1;
|
|
342
|
+
}
|
|
343
|
+
return u;
|
|
303
344
|
}
|
|
304
345
|
//#endregion
|
|
305
346
|
//#region ../core/src/rendering/svg/renderers/rule.js
|
|
306
|
-
function
|
|
307
|
-
let n = e, r = oe(n), { coords:
|
|
347
|
+
function G(e, t) {
|
|
348
|
+
let n = e, r = oe(n), i = r.strokeAlign, { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: l } = t, u = n.encoders, f = n.getType() === "rule", p = k(n, n.properties.strokeDash), m = k(n, n.properties.strokeDashOffset), g = L(s, {
|
|
308
349
|
stroke: {
|
|
309
|
-
encoder: u.
|
|
310
|
-
transform:
|
|
311
|
-
},
|
|
312
|
-
"stroke-opacity": {
|
|
313
|
-
encoder: u.opacity,
|
|
314
|
-
transform: (e) => +e * s
|
|
350
|
+
encoder: u.fill,
|
|
351
|
+
transform: h
|
|
315
352
|
},
|
|
316
353
|
"stroke-width": {
|
|
317
354
|
encoder: u.size,
|
|
318
|
-
transform: (e) =>
|
|
355
|
+
transform: (e) => P(+e)
|
|
319
356
|
}
|
|
320
357
|
});
|
|
321
|
-
return
|
|
322
|
-
coords:
|
|
323
|
-
data:
|
|
324
|
-
visibleBounds:
|
|
358
|
+
return s.setAttribute("stroke-linecap", r.strokeCap), p && (s.setAttribute("stroke-dasharray", p.map(P).join(" ")), s.setAttribute("stroke-dashoffset", "" + P(m))), T(n, r, {
|
|
359
|
+
coords: a,
|
|
360
|
+
data: o,
|
|
361
|
+
visibleBounds: l
|
|
325
362
|
}, (e) => {
|
|
326
|
-
t.countOnly
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
x2
|
|
330
|
-
|
|
331
|
-
|
|
363
|
+
if (t.countOnly) return;
|
|
364
|
+
let n = d(u.opacity, e.datum) * c, a = f ? d(u.fillOpacity, e.datum) : 1;
|
|
365
|
+
if (e.strokeWidth > 0) {
|
|
366
|
+
let o = e.x2 - e.x1, c = e.y2 - e.y1, l = Math.hypot(o, c), d = Math.atan2(c, o) * 180 / Math.PI, f = ye(l, P(e.size), r.strokeCap, p, m), g = I("g", {
|
|
367
|
+
transform: `translate(${P(e.x1)} ${P(e.y1)}) rotate(${d})`,
|
|
368
|
+
opacity: n,
|
|
369
|
+
"stroke-dasharray": "none"
|
|
370
|
+
});
|
|
371
|
+
g.append(I("path", {
|
|
372
|
+
d: f,
|
|
373
|
+
fill: "none",
|
|
374
|
+
stroke: e.stroke,
|
|
375
|
+
"stroke-width": (i === "center" ? 1 : 2) * e.strokeWidth,
|
|
376
|
+
...i === "center" ? {} : { mask: t.getRuleStrokeMaskUrl(f, l, e.size / 2, e.strokeWidth + 1, i === "inside") },
|
|
377
|
+
"stroke-opacity": e.strokeOpacity,
|
|
378
|
+
"stroke-linejoin": "round"
|
|
379
|
+
}), I("path", {
|
|
380
|
+
d: f,
|
|
381
|
+
fill: h(u.fill(e.datum)),
|
|
382
|
+
"fill-opacity": a,
|
|
383
|
+
stroke: "none"
|
|
384
|
+
})), i !== "outside" && g.insertBefore(g.lastChild, g.firstChild), s.appendChild(g);
|
|
385
|
+
} else s.appendChild(I("line", {
|
|
386
|
+
x1: P(e.x1),
|
|
387
|
+
y1: P(e.y1),
|
|
388
|
+
x2: P(e.x2),
|
|
389
|
+
y2: P(e.y2),
|
|
390
|
+
...g(e.datum),
|
|
391
|
+
"stroke-opacity": n * a
|
|
332
392
|
}));
|
|
333
393
|
});
|
|
334
394
|
}
|
|
335
395
|
//#endregion
|
|
336
396
|
//#region ../core/src/rendering/svg/renderers/text.js
|
|
337
397
|
function be(e, t) {
|
|
338
|
-
let n = e, r = n.properties, i = t.textMetrics ?? n.unitView.context.textMetrics, a = i.requestFont(r), o =
|
|
398
|
+
let n = e, r = n.properties, i = t.textMetrics ?? n.unitView.context.textMetrics, a = i.requestFont(r), o = O(i, r), s = w(n), { coords: c, data: l, group: u, viewOpacity: d, visibleBounds: f, anchorCullBounds: p } = t, m = n.encoders, g = L(u, {
|
|
339
399
|
fill: {
|
|
340
|
-
encoder:
|
|
341
|
-
transform:
|
|
400
|
+
encoder: m.color,
|
|
401
|
+
transform: h
|
|
342
402
|
},
|
|
343
403
|
"fill-opacity": {
|
|
344
|
-
encoder:
|
|
345
|
-
transform: (e) => +e *
|
|
404
|
+
encoder: m.opacity,
|
|
405
|
+
transform: (e) => +e * d
|
|
346
406
|
},
|
|
347
407
|
"font-size": {
|
|
348
|
-
encoder:
|
|
349
|
-
transform: (e) =>
|
|
408
|
+
encoder: m.size,
|
|
409
|
+
transform: (e) => P(+e)
|
|
350
410
|
}
|
|
351
411
|
});
|
|
352
|
-
|
|
412
|
+
u.setAttribute("font-family", S(r.font)), u.setAttribute("font-style", r.fontStyle ?? "normal"), u.setAttribute("font-weight", "" + ie(r.fontWeight ?? "normal")), u.setAttribute("text-anchor", xe[s.align]);
|
|
353
413
|
let _ = {
|
|
354
414
|
top: {
|
|
355
415
|
width: k(n, r.viewportEdgeFadeWidthTop),
|
|
@@ -367,20 +427,20 @@ function be(e, t) {
|
|
|
367
427
|
width: k(n, r.viewportEdgeFadeWidthLeft),
|
|
368
428
|
distance: k(n, r.viewportEdgeFadeDistanceLeft)
|
|
369
429
|
}
|
|
370
|
-
}, v =
|
|
430
|
+
}, v = j(n, s, {
|
|
371
431
|
coords: c,
|
|
372
|
-
data:
|
|
373
|
-
visibleBounds:
|
|
374
|
-
anchorCullBounds:
|
|
432
|
+
data: l,
|
|
433
|
+
visibleBounds: f,
|
|
434
|
+
anchorCullBounds: p,
|
|
375
435
|
fontMeasurement: a,
|
|
376
436
|
measureLogoInkBounds: o
|
|
377
437
|
}, (e) => {
|
|
378
438
|
if (t.countOnly) return;
|
|
379
439
|
if (e.logoTransform) {
|
|
380
440
|
e.multiCharacterLogo && t.warn("SVG export stretches multi-character logo text as a single glyph cell.");
|
|
381
|
-
let n = [`translate(${
|
|
382
|
-
e.angle && n.push(`rotate(${
|
|
383
|
-
let r =
|
|
441
|
+
let n = [`translate(${P(e.x)} ${P(e.y)})`];
|
|
442
|
+
e.angle && n.push(`rotate(${P(e.angle)})`), (e.dx || e.dy) && n.push(`translate(${P(e.dx)} ${P(e.dy)})`), n.push(`scale(${P(e.logoTransform.scaleX)} ${P(e.logoTransform.scaleY)})`), n.push(`translate(${P(-e.logoTransform.originX)} ${P(-e.logoTransform.originY)})`);
|
|
443
|
+
let r = I("text", {
|
|
384
444
|
x: 0,
|
|
385
445
|
y: 0,
|
|
386
446
|
"text-anchor": "start",
|
|
@@ -388,24 +448,24 @@ function be(e, t) {
|
|
|
388
448
|
...g(e.datum),
|
|
389
449
|
"font-size": e.size
|
|
390
450
|
});
|
|
391
|
-
r.textContent = e.text,
|
|
451
|
+
r.textContent = e.text, u.appendChild(r);
|
|
392
452
|
return;
|
|
393
453
|
}
|
|
394
|
-
let n = [`translate(${
|
|
395
|
-
e.angle && n.push(`rotate(${
|
|
396
|
-
let r =
|
|
454
|
+
let n = [`translate(${P(e.x)} ${P(e.y)})`];
|
|
455
|
+
e.angle && n.push(`rotate(${P(e.angle)})`), (e.dx || e.dy) && n.push(`translate(${P(e.dx)} ${P(e.dy)})`), e.scale != 1 && n.push(`scale(${P(e.scale)})`);
|
|
456
|
+
let r = I("text", {
|
|
397
457
|
x: 0,
|
|
398
458
|
y: 0,
|
|
399
|
-
dy:
|
|
459
|
+
dy: P(te(s.baseline, e.size)),
|
|
400
460
|
...g(e.datum),
|
|
401
|
-
...e.fadeOpacity == 1 ? {} : { opacity:
|
|
461
|
+
...e.fadeOpacity == 1 ? {} : { opacity: N(e.fadeOpacity) },
|
|
402
462
|
transform: n.join(" ")
|
|
403
463
|
});
|
|
404
|
-
r.textContent = e.text,
|
|
464
|
+
r.textContent = e.text, u.appendChild(r);
|
|
405
465
|
});
|
|
406
|
-
if (!t.countOnly &&
|
|
466
|
+
if (!t.countOnly && u.childElementCount > 0) {
|
|
407
467
|
let e = t.getViewportEdgeFadeMaskUrl(_);
|
|
408
|
-
e &&
|
|
468
|
+
e && u.setAttribute("mask", e);
|
|
409
469
|
}
|
|
410
470
|
return v;
|
|
411
471
|
}
|
|
@@ -413,52 +473,52 @@ var xe = {
|
|
|
413
473
|
left: "start",
|
|
414
474
|
center: "middle",
|
|
415
475
|
right: "end"
|
|
416
|
-
},
|
|
476
|
+
}, K = 64;
|
|
417
477
|
function Se(e, t) {
|
|
418
|
-
let
|
|
419
|
-
if (!
|
|
420
|
-
let
|
|
421
|
-
if (!
|
|
422
|
-
let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds:
|
|
478
|
+
let r = we(e.unitView);
|
|
479
|
+
if (!r) return;
|
|
480
|
+
let i = e.unitView.getScaleResolution(r.channel)?.getScale();
|
|
481
|
+
if (!i || !n(i.type)) return;
|
|
482
|
+
let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: u } = t;
|
|
423
483
|
if (!o.length) return 0;
|
|
424
|
-
let
|
|
425
|
-
let [t, n] =
|
|
426
|
-
return
|
|
484
|
+
let d = e.encoders, f = r.channel == "stroke" ? d.stroke : d.fill, m = Te(e.unitView.spec.encoding.x), g = Infinity, _ = Infinity, v = -Infinity, y = -Infinity, b = l(a, d, "x", o[0]), x = l(a, d, "y", o[0]), S = [0, 0], C = [0, 0], w = o.map((e) => {
|
|
485
|
+
let [t, n] = b(e, S), [r, i] = x(e, C);
|
|
486
|
+
return g = Math.min(g, t, n), _ = Math.min(_, r, i), v = Math.max(v, t, n), y = Math.max(y, r, i), {
|
|
427
487
|
offset: Number(e.position),
|
|
428
|
-
color:
|
|
488
|
+
color: h(f(e))
|
|
429
489
|
};
|
|
430
490
|
}).sort((e, t) => e.offset - t.offset);
|
|
431
|
-
if (!
|
|
491
|
+
if (!p(u, g, _, v, y)) return 0;
|
|
432
492
|
if (t.countOnly) return o.length;
|
|
433
|
-
let
|
|
493
|
+
let T = Ce(w), E = [
|
|
434
494
|
{
|
|
435
495
|
offset: 0,
|
|
436
|
-
color:
|
|
496
|
+
color: T[0].color
|
|
437
497
|
},
|
|
438
|
-
...
|
|
498
|
+
...T,
|
|
439
499
|
{
|
|
440
500
|
offset: 1,
|
|
441
|
-
color:
|
|
501
|
+
color: T.at(-1).color
|
|
442
502
|
}
|
|
443
|
-
],
|
|
444
|
-
x1:
|
|
445
|
-
y1: m ?
|
|
446
|
-
x2: m ?
|
|
447
|
-
y2:
|
|
448
|
-
stops:
|
|
449
|
-
}),
|
|
450
|
-
return s.appendChild(
|
|
451
|
-
x:
|
|
452
|
-
y:
|
|
453
|
-
width:
|
|
454
|
-
height:
|
|
455
|
-
fill:
|
|
456
|
-
"fill-opacity": M
|
|
503
|
+
], D = t.getLegendGradientUrl({
|
|
504
|
+
x1: g,
|
|
505
|
+
y1: m ? _ : y,
|
|
506
|
+
x2: m ? v : g,
|
|
507
|
+
y2: _,
|
|
508
|
+
stops: E
|
|
509
|
+
}), O = P(g), k = P(_), A = P(v), j = P(y), M = Number(d.fillOpacity(o[0])) * c;
|
|
510
|
+
return s.appendChild(I("rect", {
|
|
511
|
+
x: O,
|
|
512
|
+
y: k,
|
|
513
|
+
width: P(A - O),
|
|
514
|
+
height: P(j - k),
|
|
515
|
+
fill: D,
|
|
516
|
+
"fill-opacity": N(M),
|
|
457
517
|
stroke: "none"
|
|
458
518
|
})), o.length;
|
|
459
519
|
}
|
|
460
520
|
function Ce(e) {
|
|
461
|
-
return e.length <=
|
|
521
|
+
return e.length <= K ? e : Array.from({ length: K }, (t, n) => e[Math.round(n * (e.length - 1) / 63)]);
|
|
462
522
|
}
|
|
463
523
|
function we(e) {
|
|
464
524
|
let t = e;
|
|
@@ -474,13 +534,13 @@ function Te(e) {
|
|
|
474
534
|
//#endregion
|
|
475
535
|
//#region ../core/src/rendering/svg/renderers/index.js
|
|
476
536
|
var Ee = /* @__PURE__ */ new Map([
|
|
477
|
-
["arrow",
|
|
478
|
-
["link",
|
|
479
|
-
["point",
|
|
480
|
-
["rect",
|
|
481
|
-
["rule",
|
|
537
|
+
["arrow", ue],
|
|
538
|
+
["link", pe],
|
|
539
|
+
["point", me],
|
|
540
|
+
["rect", _e],
|
|
541
|
+
["rule", G],
|
|
482
542
|
["text", be],
|
|
483
|
-
["tick",
|
|
543
|
+
["tick", G]
|
|
484
544
|
]);
|
|
485
545
|
function De(e, t) {
|
|
486
546
|
if (e.getType() == "rect") {
|
|
@@ -506,31 +566,31 @@ function Oe(e, t) {
|
|
|
506
566
|
"vertical",
|
|
507
567
|
"horizontal",
|
|
508
568
|
"grid"
|
|
509
|
-
].includes(t.type), o = r ? n * 7 : n * (i ? 6 : 4), s = a ? n * 2 : n, c = o, l = r ? o * 2 : o, u =
|
|
569
|
+
].includes(t.type), o = r ? n * 7 : n * (i ? 6 : 4), s = a ? n * 2 : n, c = o, l = r ? o * 2 : o, u = I("pattern", {
|
|
510
570
|
id: e,
|
|
511
571
|
x: 0,
|
|
512
572
|
y: 0,
|
|
513
|
-
width:
|
|
514
|
-
height:
|
|
573
|
+
width: P(c),
|
|
574
|
+
height: P(l),
|
|
515
575
|
patternUnits: "userSpaceOnUse"
|
|
516
576
|
});
|
|
517
|
-
u.appendChild(
|
|
518
|
-
width:
|
|
519
|
-
height:
|
|
577
|
+
u.appendChild(I("rect", {
|
|
578
|
+
width: P(c),
|
|
579
|
+
height: P(l),
|
|
520
580
|
fill: t.fill,
|
|
521
|
-
"fill-opacity":
|
|
581
|
+
"fill-opacity": N(t.fillOpacity)
|
|
522
582
|
}));
|
|
523
|
-
let d =
|
|
583
|
+
let d = I("g", {
|
|
524
584
|
fill: "none",
|
|
525
585
|
stroke: t.stroke,
|
|
526
|
-
"stroke-opacity":
|
|
527
|
-
"stroke-width":
|
|
586
|
+
"stroke-opacity": N(t.strokeOpacity),
|
|
587
|
+
"stroke-width": P(s),
|
|
528
588
|
"stroke-linecap": "square"
|
|
529
589
|
});
|
|
530
590
|
return ke(d, t.type, o, s), u.appendChild(d), u;
|
|
531
591
|
}
|
|
532
592
|
function ke(e, t, n, r) {
|
|
533
|
-
let i = (t) => e.appendChild(
|
|
593
|
+
let i = (t) => e.appendChild(I("path", { d: t })), a = (e) => P(e), o = (e) => {
|
|
534
594
|
for (let t of [
|
|
535
595
|
-n,
|
|
536
596
|
0,
|
|
@@ -559,10 +619,10 @@ function ke(e, t, n, r) {
|
|
|
559
619
|
case "dots":
|
|
560
620
|
case "rings":
|
|
561
621
|
case "ringsLarge": {
|
|
562
|
-
let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(
|
|
563
|
-
cx:
|
|
564
|
-
cy:
|
|
565
|
-
r:
|
|
622
|
+
let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(I("circle", {
|
|
623
|
+
cx: P(t),
|
|
624
|
+
cy: P(n),
|
|
625
|
+
r: P(r)
|
|
566
626
|
}));
|
|
567
627
|
i(n / 2, 0), i(n / 2, n * 2), i(0, n), i(n, n);
|
|
568
628
|
break;
|
|
@@ -573,46 +633,46 @@ function ke(e, t, n, r) {
|
|
|
573
633
|
//#endregion
|
|
574
634
|
//#region ../core/src/rendering/svg/linkArcFadeMask.js
|
|
575
635
|
function Ae(e, t, n, r) {
|
|
576
|
-
let { normalX: i, normalY: a, offset: o, start: s, end: c } = r, l = i * o, u = a * o, d = e + "-gradient", f =
|
|
636
|
+
let { normalX: i, normalY: a, offset: o, start: s, end: c } = r, l = i * o, u = a * o, d = e + "-gradient", f = I("linearGradient", {
|
|
577
637
|
id: d,
|
|
578
638
|
gradientUnits: "userSpaceOnUse",
|
|
579
|
-
x1:
|
|
580
|
-
y1:
|
|
581
|
-
x2:
|
|
582
|
-
y2:
|
|
639
|
+
x1: P(l - i * c),
|
|
640
|
+
y1: P(u - a * c),
|
|
641
|
+
x2: P(l + i * c),
|
|
642
|
+
y2: P(u + a * c),
|
|
583
643
|
spreadMethod: "pad"
|
|
584
644
|
});
|
|
585
|
-
for (let { offset: e, opacity: t } of
|
|
586
|
-
offset:
|
|
645
|
+
for (let { offset: e, opacity: t } of C(s, c)) f.appendChild(I("stop", {
|
|
646
|
+
offset: q(e, 3),
|
|
587
647
|
"stop-color": "white",
|
|
588
|
-
"stop-opacity":
|
|
648
|
+
"stop-opacity": q(t, 3)
|
|
589
649
|
}));
|
|
590
|
-
let p =
|
|
650
|
+
let p = I("mask", {
|
|
591
651
|
id: e,
|
|
592
652
|
x: 0,
|
|
593
653
|
y: 0,
|
|
594
|
-
width:
|
|
595
|
-
height:
|
|
654
|
+
width: P(t),
|
|
655
|
+
height: P(n),
|
|
596
656
|
maskUnits: "userSpaceOnUse",
|
|
597
657
|
maskContentUnits: "userSpaceOnUse",
|
|
598
658
|
"mask-type": "luminance"
|
|
599
659
|
});
|
|
600
|
-
return p.appendChild(
|
|
601
|
-
width:
|
|
602
|
-
height:
|
|
660
|
+
return p.appendChild(I("rect", {
|
|
661
|
+
width: P(t),
|
|
662
|
+
height: P(n),
|
|
603
663
|
fill: `url(#${d})`
|
|
604
664
|
})), {
|
|
605
665
|
gradient: f,
|
|
606
666
|
mask: p
|
|
607
667
|
};
|
|
608
668
|
}
|
|
609
|
-
function
|
|
669
|
+
function q(e, t) {
|
|
610
670
|
let n = 10 ** t;
|
|
611
671
|
return Math.round(e * n) / n;
|
|
612
672
|
}
|
|
613
673
|
//#endregion
|
|
614
674
|
//#region ../core/src/rendering/svg/svgViewRenderingContext.js
|
|
615
|
-
var
|
|
675
|
+
var J = class extends c {
|
|
616
676
|
#e;
|
|
617
677
|
#t;
|
|
618
678
|
#n = [];
|
|
@@ -625,8 +685,8 @@ var q = class extends s {
|
|
|
625
685
|
#l = /* @__PURE__ */ new Set();
|
|
626
686
|
#u = !1;
|
|
627
687
|
#d = /* @__PURE__ */ new Map();
|
|
628
|
-
#f = new
|
|
629
|
-
#p =
|
|
688
|
+
#f = new m();
|
|
689
|
+
#p = I("g");
|
|
630
690
|
#m;
|
|
631
691
|
#h;
|
|
632
692
|
#g = [];
|
|
@@ -640,13 +700,13 @@ var q = class extends s {
|
|
|
640
700
|
#w = 0;
|
|
641
701
|
constructor(e, t) {
|
|
642
702
|
super(e), this.width = t.width, this.height = t.height, this.textMetrics = t.textMetrics, this.#h = t.maxVectorInstances;
|
|
643
|
-
let n =
|
|
644
|
-
this.#e =
|
|
645
|
-
xmlns:
|
|
703
|
+
let n = P(t.width), r = P(t.height);
|
|
704
|
+
this.#e = I("svg", {
|
|
705
|
+
xmlns: F,
|
|
646
706
|
width: n,
|
|
647
707
|
height: r,
|
|
648
708
|
viewBox: `0 0 ${n} ${r}`
|
|
649
|
-
}), this.#t =
|
|
709
|
+
}), this.#t = I("defs"), this.#e.appendChild(this.#t), t.background != null && this.#e.appendChild(I("rect", {
|
|
650
710
|
width: n,
|
|
651
711
|
height: r,
|
|
652
712
|
fill: t.background,
|
|
@@ -688,8 +748,8 @@ var q = class extends s {
|
|
|
688
748
|
this.#m = void 0;
|
|
689
749
|
}
|
|
690
750
|
pushView(e, t) {
|
|
691
|
-
let
|
|
692
|
-
if (
|
|
751
|
+
let n = e.getPathString();
|
|
752
|
+
if (i(this.#n)?.exportExcluded || r(e) && e.name.startsWith("scrollbar-")) {
|
|
693
753
|
this.#n.push({
|
|
694
754
|
view: e,
|
|
695
755
|
node: this.currentNode,
|
|
@@ -709,15 +769,15 @@ var q = class extends s {
|
|
|
709
769
|
}
|
|
710
770
|
let a = this.#m, o = a?.viewGroups.get(e);
|
|
711
771
|
if (o) {
|
|
712
|
-
if (o.parentNode !== this.currentNode) throw Error(`Sample-faceted view was rendered under multiple parents: ${
|
|
772
|
+
if (o.parentNode !== this.currentNode) throw Error(`Sample-faceted view was rendered under multiple parents: ${n}`);
|
|
713
773
|
} else {
|
|
714
|
-
o =
|
|
774
|
+
o = I("g", {
|
|
715
775
|
id: je(e.name, this.#v++),
|
|
716
776
|
"data-name": e.name,
|
|
717
|
-
"data-view-path":
|
|
777
|
+
"data-view-path": n
|
|
718
778
|
});
|
|
719
|
-
let t =
|
|
720
|
-
t.textContent =
|
|
779
|
+
let t = I("title");
|
|
780
|
+
t.textContent = n, o.appendChild(t), this.currentNode.appendChild(o), a?.viewGroups.set(e, o);
|
|
721
781
|
}
|
|
722
782
|
this.#n.push({
|
|
723
783
|
view: e,
|
|
@@ -729,62 +789,63 @@ var q = class extends s {
|
|
|
729
789
|
popView(e) {
|
|
730
790
|
if (this.#n.pop()?.view !== e) throw Error("Unbalanced SVG view rendering context stack.");
|
|
731
791
|
}
|
|
732
|
-
renderMark(
|
|
733
|
-
if (
|
|
734
|
-
let a = e(
|
|
735
|
-
if (!
|
|
736
|
-
let c = this.getVisibleInstanceCount(
|
|
792
|
+
renderMark(n, r) {
|
|
793
|
+
if (i(this.#n)?.exportExcluded || n.unitView.getEffectiveOpacity() <= 0) return;
|
|
794
|
+
let a = e(r), o = t(a, n.properties.clip, this.currentCoords), s = _(this.width, this.height, o);
|
|
795
|
+
if (!f(s)) return;
|
|
796
|
+
let c = this.getVisibleInstanceCount(n);
|
|
737
797
|
if (!this.#u && this.#h != null && c == 0) return;
|
|
738
798
|
if (!this.#u && this.#h != null && c > this.#h) {
|
|
739
|
-
this.#T(
|
|
799
|
+
this.#T(n, s);
|
|
740
800
|
return;
|
|
741
801
|
}
|
|
742
|
-
let l = !this.#u && this.#m != null, u = l ? this.getClipPathUrl(o) : void 0, d = l ? this.#m.markGroups.get(
|
|
802
|
+
let l = !this.#u && this.#m != null, u = l ? this.getClipPathUrl(o) : void 0, d = l ? this.#m.markGroups.get(n)?.get(u ?? "") : void 0;
|
|
743
803
|
!this.#u && !d && this.#E();
|
|
744
|
-
let
|
|
745
|
-
if (
|
|
746
|
-
let
|
|
747
|
-
let i = De(
|
|
804
|
+
let p = this.#u ? this.#p : this.#O(n, u), m = g(this.currentCoords, a, n.properties.cullByVisibleRange), h = n.getOrder?.(), y = !this.#u && h && h.isActive();
|
|
805
|
+
if (v(n, r, this.currentCoords, this.#f, (e, t) => {
|
|
806
|
+
let r = (t, r = !1) => {
|
|
807
|
+
let i = De(n, {
|
|
748
808
|
coords: e,
|
|
749
809
|
data: t,
|
|
750
|
-
group:
|
|
810
|
+
group: p,
|
|
751
811
|
visibleBounds: s,
|
|
752
|
-
anchorCullBounds:
|
|
753
|
-
viewOpacity:
|
|
812
|
+
anchorCullBounds: m,
|
|
813
|
+
viewOpacity: n.unitView.getEffectiveOpacity(),
|
|
754
814
|
textMetrics: this.textMetrics,
|
|
755
|
-
secondOrderPass:
|
|
815
|
+
secondOrderPass: r,
|
|
756
816
|
countOnly: this.#u,
|
|
757
817
|
getViewportEdgeFadeMaskUrl: (e) => this.#u ? void 0 : this.getViewportEdgeFadeMaskUrl(e),
|
|
758
818
|
getShadowFilterUrl: (e) => this.#u ? "" : this.getShadowFilterUrl(e),
|
|
819
|
+
getRuleStrokeMaskUrl: (e, t, n, r, i) => this.getRuleStrokeMaskUrl(e, t, n, r, i),
|
|
759
820
|
getShadowClipPathUrl: (e) => this.#u ? "" : this.getShadowClipPathUrl(e),
|
|
760
821
|
getRectHatchPatternUrl: (e) => this.#u ? "" : this.getRectHatchPatternUrl(e),
|
|
761
822
|
getLinkArcFadeMaskUrl: (e) => this.#u ? void 0 : this.getLinkArcFadeMaskUrl(e),
|
|
762
823
|
getLegendGradientUrl: (e) => this.#u ? "" : this.getLegendGradientUrl(e),
|
|
763
824
|
warn: (e) => {
|
|
764
|
-
this.#u || this.#l.add(`${e} View: ${
|
|
825
|
+
this.#u || this.#l.add(`${e} View: ${n.unitView.getPathString()}`);
|
|
765
826
|
}
|
|
766
827
|
});
|
|
767
|
-
this.#u && this.#d.set(
|
|
828
|
+
this.#u && this.#d.set(n, this.getVisibleInstanceCount(n) + i);
|
|
768
829
|
};
|
|
769
|
-
if (!
|
|
770
|
-
|
|
830
|
+
if (!y) {
|
|
831
|
+
r(t);
|
|
771
832
|
return;
|
|
772
833
|
}
|
|
773
|
-
let i = ae(t, 0, t.length,
|
|
774
|
-
for (let [e, t] of i.entries()) t.length !== 0 &&
|
|
775
|
-
}, (e) => this.#l.add(`SVG export could not resolve sample facet index ${e}. View: ${
|
|
834
|
+
let i = ae(t, 0, t.length, h.predicate, h.passes);
|
|
835
|
+
for (let [e, t] of i.entries()) t.length !== 0 && r(t, e === 1);
|
|
836
|
+
}, (e) => this.#l.add(`SVG export could not resolve sample facet index ${e}. View: ${n.unitView.getPathString()}`)), !this.#u && !l && p.childElementCount > 0) {
|
|
776
837
|
let e = this.getClipPathUrl(o);
|
|
777
|
-
e &&
|
|
838
|
+
e && p.setAttribute("clip-path", e), this.currentNode.appendChild(p);
|
|
778
839
|
}
|
|
779
840
|
}
|
|
780
841
|
#T(e, t) {
|
|
781
842
|
let n = this.#m?.rasterRuns.get(e);
|
|
782
843
|
if (n) {
|
|
783
|
-
|
|
844
|
+
Y(n.bounds, t), n.viewNodes.add(this.currentNode);
|
|
784
845
|
return;
|
|
785
846
|
}
|
|
786
847
|
let r = this.#_;
|
|
787
|
-
if (r)
|
|
848
|
+
if (r) Y(r.bounds, t);
|
|
788
849
|
else {
|
|
789
850
|
let e = document.createComment("raster-run");
|
|
790
851
|
this.currentNode.appendChild(e), r = {
|
|
@@ -806,11 +867,11 @@ var q = class extends s {
|
|
|
806
867
|
e && (this.#g.push(e), this.#_ = void 0);
|
|
807
868
|
}
|
|
808
869
|
#D(e) {
|
|
809
|
-
let t = Me(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r =
|
|
870
|
+
let t = Me(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = I("g", {
|
|
810
871
|
id: `rasterized-${n.join("-")}-${this.#w++}`,
|
|
811
872
|
"data-name": `Rasterized ${n.join(", ")}`,
|
|
812
873
|
"data-rasterized": ""
|
|
813
|
-
}), i =
|
|
874
|
+
}), i = I("image", { preserveAspectRatio: "none" });
|
|
814
875
|
r.appendChild(i);
|
|
815
876
|
let a = e.anchor.parentNode;
|
|
816
877
|
t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r, Ne(a, t)), e.anchor.remove();
|
|
@@ -819,13 +880,13 @@ var q = class extends s {
|
|
|
819
880
|
}
|
|
820
881
|
#O(e, t) {
|
|
821
882
|
let n = this.#m;
|
|
822
|
-
if (!n) return
|
|
883
|
+
if (!n) return I("g", { "data-mark-type": e.getType() });
|
|
823
884
|
let r = n.markGroups.get(e);
|
|
824
885
|
r || (r = /* @__PURE__ */ new Map(), n.markGroups.set(e, r));
|
|
825
886
|
let i = t ?? "", a = r.get(i);
|
|
826
887
|
if (a) {
|
|
827
888
|
if (a.parentNode !== this.currentNode) throw Error(`Sample-faceted mark was rendered under multiple parents: ${e.unitView.getPathString()}`);
|
|
828
|
-
} else a =
|
|
889
|
+
} else a = I("g", { "data-mark-type": e.getType() }), t && a.setAttribute("clip-path", t), this.currentNode.appendChild(a), r.set(i, a), n.markGroupElements.add(a);
|
|
829
890
|
return a;
|
|
830
891
|
}
|
|
831
892
|
getClipPathUrl(e) {
|
|
@@ -835,14 +896,14 @@ var q = class extends s {
|
|
|
835
896
|
e.clipY ? t.y : 0,
|
|
836
897
|
e.clipX ? t.width : this.width,
|
|
837
898
|
e.clipY ? t.height : this.height
|
|
838
|
-
].map(
|
|
899
|
+
].map(P), r = n.join(","), i = this.#r.get(r);
|
|
839
900
|
if (!i) {
|
|
840
901
|
i = "clip-" + this.#y++;
|
|
841
|
-
let e =
|
|
902
|
+
let e = I("clipPath", {
|
|
842
903
|
id: i,
|
|
843
904
|
clipPathUnits: "userSpaceOnUse"
|
|
844
905
|
});
|
|
845
|
-
e.appendChild(
|
|
906
|
+
e.appendChild(I("rect", {
|
|
846
907
|
x: n[0],
|
|
847
908
|
y: n[1],
|
|
848
909
|
width: n[2],
|
|
@@ -852,28 +913,28 @@ var q = class extends s {
|
|
|
852
913
|
return `url(#${i})`;
|
|
853
914
|
}
|
|
854
915
|
getShadowFilterUrl(e) {
|
|
855
|
-
let t =
|
|
916
|
+
let t = P(Math.max(e.blur / 2.5, .25)), n = P(e.offsetX), r = P(e.offsetY), i = [
|
|
856
917
|
t,
|
|
857
918
|
n,
|
|
858
919
|
r
|
|
859
920
|
].join(","), a = this.#a.get(i);
|
|
860
921
|
if (!a) {
|
|
861
922
|
a = "shadow-" + this.#x++;
|
|
862
|
-
let e =
|
|
923
|
+
let e = I("filter", {
|
|
863
924
|
id: a,
|
|
864
925
|
x: 0,
|
|
865
926
|
y: 0,
|
|
866
|
-
width:
|
|
867
|
-
height:
|
|
927
|
+
width: P(this.width),
|
|
928
|
+
height: P(this.height),
|
|
868
929
|
filterUnits: "userSpaceOnUse",
|
|
869
930
|
primitiveUnits: "userSpaceOnUse",
|
|
870
931
|
"color-interpolation-filters": "sRGB"
|
|
871
932
|
});
|
|
872
|
-
e.appendChild(
|
|
933
|
+
e.appendChild(I("feGaussianBlur", {
|
|
873
934
|
in: "SourceGraphic",
|
|
874
935
|
stdDeviation: t,
|
|
875
936
|
result: "blur"
|
|
876
|
-
})), e.appendChild(
|
|
937
|
+
})), e.appendChild(I("feOffset", {
|
|
877
938
|
in: "blur",
|
|
878
939
|
dx: n,
|
|
879
940
|
dy: r,
|
|
@@ -882,16 +943,38 @@ var q = class extends s {
|
|
|
882
943
|
}
|
|
883
944
|
return `url(#${a})`;
|
|
884
945
|
}
|
|
946
|
+
getRuleStrokeMaskUrl(e, t, n, r, i = !1) {
|
|
947
|
+
let a = "rule-stroke-" + this.#y++, o = {
|
|
948
|
+
x: -n - r,
|
|
949
|
+
y: -n - r,
|
|
950
|
+
width: t + 2 * (n + r),
|
|
951
|
+
height: 2 * (n + r)
|
|
952
|
+
}, s = I("mask", {
|
|
953
|
+
id: a,
|
|
954
|
+
...o,
|
|
955
|
+
maskUnits: "userSpaceOnUse",
|
|
956
|
+
maskContentUnits: "userSpaceOnUse",
|
|
957
|
+
"mask-type": "luminance"
|
|
958
|
+
});
|
|
959
|
+
return s.append(I("rect", {
|
|
960
|
+
...o,
|
|
961
|
+
fill: i ? "black" : "white"
|
|
962
|
+
}), I("path", {
|
|
963
|
+
d: e,
|
|
964
|
+
fill: i ? "white" : "black",
|
|
965
|
+
stroke: "none"
|
|
966
|
+
})), this.#t.appendChild(s), `url(#${a})`;
|
|
967
|
+
}
|
|
885
968
|
getShadowClipPathUrl(e) {
|
|
886
969
|
let t = this.#o.get(e);
|
|
887
970
|
if (!t) {
|
|
888
971
|
t = "shadow-clip-" + this.#y++;
|
|
889
|
-
let n =
|
|
972
|
+
let n = I("clipPath", {
|
|
890
973
|
id: t,
|
|
891
974
|
clipPathUnits: "userSpaceOnUse"
|
|
892
975
|
});
|
|
893
|
-
n.appendChild(
|
|
894
|
-
d: `M 0 0 V ${
|
|
976
|
+
n.appendChild(I("path", {
|
|
977
|
+
d: `M 0 0 V ${P(this.height)} H ${P(this.width)} V 0 Z ${e}`,
|
|
895
978
|
"clip-rule": "evenodd",
|
|
896
979
|
"fill-rule": "evenodd"
|
|
897
980
|
})), this.#t.appendChild(n), this.#o.set(e, t);
|
|
@@ -902,30 +985,30 @@ var q = class extends s {
|
|
|
902
985
|
let t = JSON.stringify([
|
|
903
986
|
e.type,
|
|
904
987
|
e.fill,
|
|
905
|
-
|
|
988
|
+
N(e.fillOpacity),
|
|
906
989
|
e.stroke,
|
|
907
|
-
|
|
908
|
-
|
|
990
|
+
N(e.strokeOpacity),
|
|
991
|
+
N(e.strokeWidth)
|
|
909
992
|
]), n = this.#s.get(t);
|
|
910
993
|
return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(Oe(n, e)), this.#s.set(t, n)), `url(#${n})`;
|
|
911
994
|
}
|
|
912
995
|
getLegendGradientUrl(e) {
|
|
913
|
-
let t = "legend-gradient-" + this.#C++, n =
|
|
996
|
+
let t = "legend-gradient-" + this.#C++, n = I("linearGradient", {
|
|
914
997
|
id: t,
|
|
915
998
|
gradientUnits: "userSpaceOnUse",
|
|
916
|
-
x1:
|
|
917
|
-
y1:
|
|
918
|
-
x2:
|
|
919
|
-
y2:
|
|
999
|
+
x1: P(e.x1),
|
|
1000
|
+
y1: P(e.y1),
|
|
1001
|
+
x2: P(e.x2),
|
|
1002
|
+
y2: P(e.y2)
|
|
920
1003
|
});
|
|
921
|
-
for (let t of e.stops) n.appendChild(
|
|
922
|
-
offset:
|
|
1004
|
+
for (let t of e.stops) n.appendChild(I("stop", {
|
|
1005
|
+
offset: N(t.offset),
|
|
923
1006
|
"stop-color": t.color
|
|
924
1007
|
}));
|
|
925
1008
|
return this.#t.appendChild(n), `url(#${t})`;
|
|
926
1009
|
}
|
|
927
1010
|
getLinkArcFadeMaskUrl(e) {
|
|
928
|
-
let t =
|
|
1011
|
+
let t = ce(e.p1, e.p4, e.distances);
|
|
929
1012
|
if (!t) return;
|
|
930
1013
|
let n = this.#c.get(t.key);
|
|
931
1014
|
if (!n) {
|
|
@@ -938,37 +1021,37 @@ var q = class extends s {
|
|
|
938
1021
|
getViewportEdgeFadeMaskUrl(e) {
|
|
939
1022
|
let t = Object.entries(e).filter(([, e]) => e.width > 0 && Number.isFinite(e.distance));
|
|
940
1023
|
if (!t.length) return;
|
|
941
|
-
let
|
|
942
|
-
if (!
|
|
943
|
-
let
|
|
944
|
-
if (!
|
|
945
|
-
|
|
946
|
-
let e =
|
|
947
|
-
id:
|
|
1024
|
+
let n = i(this.#n);
|
|
1025
|
+
if (!n) throw Error("No current view in SVG rendering context.");
|
|
1026
|
+
let r = this.#i.get(n.view);
|
|
1027
|
+
if (!r) {
|
|
1028
|
+
r = "edge-fade-" + this.#b++;
|
|
1029
|
+
let e = P(this.width), i = P(this.height), a = I("mask", {
|
|
1030
|
+
id: r,
|
|
948
1031
|
x: 0,
|
|
949
1032
|
y: 0,
|
|
950
1033
|
width: e,
|
|
951
|
-
height:
|
|
1034
|
+
height: i,
|
|
952
1035
|
maskUnits: "userSpaceOnUse",
|
|
953
1036
|
maskContentUnits: "userSpaceOnUse",
|
|
954
1037
|
"mask-type": "luminance"
|
|
955
1038
|
});
|
|
956
|
-
a.appendChild(
|
|
1039
|
+
a.appendChild(I("rect", {
|
|
957
1040
|
width: e,
|
|
958
|
-
height:
|
|
1041
|
+
height: i,
|
|
959
1042
|
fill: "white"
|
|
960
1043
|
}));
|
|
961
1044
|
for (let [o, s] of t) {
|
|
962
|
-
let t =
|
|
963
|
-
this.#t.appendChild(c), a.appendChild(
|
|
1045
|
+
let t = r + "-" + o, c = Fe(t, o, s, n.coords);
|
|
1046
|
+
this.#t.appendChild(c), a.appendChild(I("rect", {
|
|
964
1047
|
width: e,
|
|
965
|
-
height:
|
|
1048
|
+
height: i,
|
|
966
1049
|
fill: `url(#${t})`
|
|
967
1050
|
}));
|
|
968
1051
|
}
|
|
969
|
-
this.#t.appendChild(a), this.#i.set(
|
|
1052
|
+
this.#t.appendChild(a), this.#i.set(n.view, r);
|
|
970
1053
|
}
|
|
971
|
-
return `url(#${
|
|
1054
|
+
return `url(#${r})`;
|
|
972
1055
|
}
|
|
973
1056
|
getSvg() {
|
|
974
1057
|
return this.#e;
|
|
@@ -977,10 +1060,10 @@ var q = class extends s {
|
|
|
977
1060
|
return Array.from(this.#l);
|
|
978
1061
|
}
|
|
979
1062
|
get currentNode() {
|
|
980
|
-
return
|
|
1063
|
+
return i(this.#n)?.node ?? this.#e;
|
|
981
1064
|
}
|
|
982
1065
|
get currentCoords() {
|
|
983
|
-
let e =
|
|
1066
|
+
let e = i(this.#n);
|
|
984
1067
|
if (!e) throw Error("No current view in SVG rendering context.");
|
|
985
1068
|
return e.coords;
|
|
986
1069
|
}
|
|
@@ -989,7 +1072,7 @@ function je(e, t) {
|
|
|
989
1072
|
let n = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
990
1073
|
return `${/^[A-Za-z_]/.test(n) ? n : n ? "view-" + n : "view"}-${t}`;
|
|
991
1074
|
}
|
|
992
|
-
function
|
|
1075
|
+
function Y(e, t) {
|
|
993
1076
|
e.x1 = Math.min(e.x1, t.x1), e.y1 = Math.min(e.y1, t.y1), e.x2 = Math.max(e.x2, t.x2), e.y2 = Math.max(e.y2, t.y2);
|
|
994
1077
|
}
|
|
995
1078
|
function Me(e) {
|
|
@@ -1010,19 +1093,19 @@ function Pe(e, t) {
|
|
|
1010
1093
|
}
|
|
1011
1094
|
}
|
|
1012
1095
|
function Fe(e, t, n, r) {
|
|
1013
|
-
let i = t == "top" ? r.y + n.distance : t == "right" ? r.x2 - n.distance : t == "bottom" ? r.y2 - n.distance : r.x + n.distance, a = t == "left" || t == "right", o = i + (t == "top" || t == "left" ? 1 : -1) * n.width, s =
|
|
1096
|
+
let i = t == "top" ? r.y + n.distance : t == "right" ? r.x2 - n.distance : t == "bottom" ? r.y2 - n.distance : r.x + n.distance, a = t == "left" || t == "right", o = i + (t == "top" || t == "left" ? 1 : -1) * n.width, s = I("linearGradient", {
|
|
1014
1097
|
id: e,
|
|
1015
1098
|
gradientUnits: "userSpaceOnUse",
|
|
1016
|
-
x1:
|
|
1017
|
-
y1:
|
|
1018
|
-
x2:
|
|
1019
|
-
y2:
|
|
1099
|
+
x1: P(a ? i : 0),
|
|
1100
|
+
y1: P(a ? 0 : i),
|
|
1101
|
+
x2: P(a ? o : 0),
|
|
1102
|
+
y2: P(a ? 0 : o)
|
|
1020
1103
|
});
|
|
1021
|
-
return s.appendChild(
|
|
1104
|
+
return s.appendChild(I("stop", {
|
|
1022
1105
|
offset: 0,
|
|
1023
1106
|
"stop-color": "black",
|
|
1024
1107
|
"stop-opacity": 1
|
|
1025
|
-
})), s.appendChild(
|
|
1108
|
+
})), s.appendChild(I("stop", {
|
|
1026
1109
|
offset: 1,
|
|
1027
1110
|
"stop-color": "black",
|
|
1028
1111
|
"stop-opacity": 0
|
|
@@ -1030,26 +1113,26 @@ function Fe(e, t, n, r) {
|
|
|
1030
1113
|
}
|
|
1031
1114
|
//#endregion
|
|
1032
1115
|
//#region ../core/src/rendering/svg/index.js
|
|
1033
|
-
function
|
|
1034
|
-
let a = new
|
|
1116
|
+
function X({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "white", textMetrics: i = e.context.textMetrics }) {
|
|
1117
|
+
let a = new J({ picking: !1 }, {
|
|
1035
1118
|
width: t,
|
|
1036
1119
|
height: n,
|
|
1037
1120
|
background: r,
|
|
1038
1121
|
textMetrics: i
|
|
1039
1122
|
});
|
|
1040
|
-
return
|
|
1123
|
+
return s(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(a), {
|
|
1041
1124
|
svg: a.getSvg(),
|
|
1042
1125
|
warnings: a.getWarnings()
|
|
1043
1126
|
};
|
|
1044
1127
|
}
|
|
1045
1128
|
async function Ie({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
|
|
1046
|
-
let r = new
|
|
1129
|
+
let r = new J({ picking: !1 }, {
|
|
1047
1130
|
width: t,
|
|
1048
1131
|
height: n,
|
|
1049
1132
|
background: null,
|
|
1050
|
-
textMetrics: await
|
|
1133
|
+
textMetrics: await Q(e)
|
|
1051
1134
|
});
|
|
1052
|
-
return r.beginInstanceCounting(),
|
|
1135
|
+
return r.beginInstanceCounting(), s(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(r), r.endInstanceCounting(), { layers: Array.from(r.getVisibleInstanceCounts(), ([e, t]) => ({
|
|
1053
1136
|
viewName: e.unitView.name,
|
|
1054
1137
|
viewTitle: e.unitView.getTitleText(),
|
|
1055
1138
|
viewPath: e.unitView.getPathString(),
|
|
@@ -1058,32 +1141,32 @@ async function Ie({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
|
|
|
1058
1141
|
})).filter((e) => e.instanceCount > 0) };
|
|
1059
1142
|
}
|
|
1060
1143
|
async function Le(e) {
|
|
1061
|
-
let t = await
|
|
1144
|
+
let t = await Q(e.viewRoot), n = {
|
|
1062
1145
|
...e,
|
|
1063
1146
|
textMetrics: t
|
|
1064
1147
|
}, r = e.rasterization;
|
|
1065
|
-
return r ? ($(r), e.rasterizeSvgRuns ?
|
|
1148
|
+
return r ? ($(r), e.rasterizeSvgRuns ? Z({
|
|
1066
1149
|
...n,
|
|
1067
1150
|
rasterizeSvgRuns: e.rasterizeSvgRuns,
|
|
1068
1151
|
maxVectorInstances: r.maxVectorInstances,
|
|
1069
1152
|
pixelRatio: r.pixelRatio
|
|
1070
|
-
}) :
|
|
1071
|
-
...
|
|
1153
|
+
}) : Re(n)) : {
|
|
1154
|
+
...X(n),
|
|
1072
1155
|
rasterized: []
|
|
1073
1156
|
};
|
|
1074
1157
|
}
|
|
1075
|
-
async function
|
|
1076
|
-
u ??= await
|
|
1077
|
-
maxVectorInstances:
|
|
1158
|
+
async function Z({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHeight: r, background: i = "white", maxVectorInstances: c, pixelRatio: l = 2, textMetrics: u }) {
|
|
1159
|
+
u ??= await Q(e), $({
|
|
1160
|
+
maxVectorInstances: c,
|
|
1078
1161
|
pixelRatio: l
|
|
1079
1162
|
});
|
|
1080
|
-
let d = new
|
|
1163
|
+
let d = new J({ picking: !1 }, {
|
|
1081
1164
|
width: n,
|
|
1082
1165
|
height: r,
|
|
1083
1166
|
background: i,
|
|
1084
|
-
maxVectorInstances:
|
|
1167
|
+
maxVectorInstances: c,
|
|
1085
1168
|
textMetrics: u
|
|
1086
|
-
}), f = o.create(0, 0, n, r), p =
|
|
1169
|
+
}), f = o.create(0, 0, n, r), p = s(e, f, { renderingOptions: { firstFacet: !0 } });
|
|
1087
1170
|
d.beginInstanceCounting(), p.collectRenderCommands(d), d.endInstanceCounting(), p.collectRenderCommands(d);
|
|
1088
1171
|
let m = d.getRasterRuns();
|
|
1089
1172
|
if (m.length) try {
|
|
@@ -1097,7 +1180,7 @@ async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
|
|
|
1097
1180
|
pixelRatio: l
|
|
1098
1181
|
});
|
|
1099
1182
|
} catch (t) {
|
|
1100
|
-
if (t instanceof a) return
|
|
1183
|
+
if (t instanceof a) return Re({
|
|
1101
1184
|
viewRoot: e,
|
|
1102
1185
|
logicalWidth: n,
|
|
1103
1186
|
logicalHeight: r,
|
|
@@ -1115,18 +1198,18 @@ async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
|
|
|
1115
1198
|
instanceCount: e.instanceCount
|
|
1116
1199
|
})),
|
|
1117
1200
|
reason: "instance-threshold",
|
|
1118
|
-
maxVectorInstances:
|
|
1201
|
+
maxVectorInstances: c,
|
|
1119
1202
|
pixelRatio: l
|
|
1120
1203
|
}))
|
|
1121
1204
|
};
|
|
1122
1205
|
}
|
|
1123
|
-
async function
|
|
1206
|
+
async function Q(e) {
|
|
1124
1207
|
if (!document.fonts) return e.context.textMetrics;
|
|
1125
|
-
let t =
|
|
1208
|
+
let t = ee(document);
|
|
1126
1209
|
return await re(t, e), t;
|
|
1127
1210
|
}
|
|
1128
|
-
function
|
|
1129
|
-
let t =
|
|
1211
|
+
function Re(e) {
|
|
1212
|
+
let t = X(e);
|
|
1130
1213
|
return {
|
|
1131
1214
|
...t,
|
|
1132
1215
|
warnings: [...t.warnings, "SVG rasterization was requested but no raster rendering backend is available; exported all marks as vectors."],
|
|
@@ -1138,4 +1221,4 @@ function $(e) {
|
|
|
1138
1221
|
if (e.pixelRatio != null && (!Number.isFinite(e.pixelRatio) || e.pixelRatio <= 0)) throw RangeError("SVG raster pixelRatio must be positive.");
|
|
1139
1222
|
}
|
|
1140
1223
|
//#endregion
|
|
1141
|
-
export { Ie as analyzeSvgExport,
|
|
1224
|
+
export { Ie as analyzeSvgExport, Z as createRasterizedSvg, X as createSvg, Le as createSvgExport };
|