@genome-spy/app 0.86.0 → 0.87.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/{agentApi-DgopQbMV.js → agentApi-BZ1JCo1N.js} +6994 -6499
- package/dist/agentApi.es.js +3057 -3225
- package/dist/agentShared.es.js +7 -7
- package/dist/{canvas2d-8uxuN_vx.js → canvas2d-B_PnIof-.js} +108 -107
- package/dist/{canvas2d-BtQC7Xr8.js → canvas2d-Cafq5v-N.js} +128 -127
- package/dist/{clipOptions-taFzEljc.js → clipOptions-D6eh9T-_.js} +1508 -1166
- package/dist/{clipOptions-BQfNhxgP.js → clipOptions-H68pJyEZ.js} +1496 -1114
- package/dist/{debug-D_VtWQ6l.js → debug-BGzgZmyk.js} +2 -2
- package/dist/{debug-Bzc3SoRg.js → debug-UYKZLNh4.js} +2 -2
- package/dist/index.es.js +96 -106
- package/dist/index.js +399 -392
- package/dist/{indexer-qy_dq5l5.js → indexer-Di57GyxX.js} +1 -1
- package/dist/{indexer-qiFctgR3.js → indexer-o6Hpg4nN.js} +1 -1
- package/dist/nativeText-D9SoxpaD.js +934 -0
- package/dist/nativeText-DAjvkrzc.js +934 -0
- package/dist/{rasterExport-B8pVoOsj.js → rasterExport-DzldLv6E.js} +1 -1
- package/dist/{rasterExport-C4r4xjQT.js → rasterExport-IAbJwi8F.js} +1 -1
- package/dist/{renderCanvas2D-BQrRWp2Z.js → renderCanvas2D-BJ93Ptqj.js} +102 -96
- package/dist/{renderCanvas2D-CHVNfIUz.js → renderCanvas2D-yJ1IrDcX.js} +103 -97
- package/dist/schema.json +10169 -2852
- package/dist/{svg-C-Sw6E6G.js → svg-BRpl2Xub.js} +338 -384
- package/dist/{svg-CKHwwKRt.js → svg-DJuqHIyc.js} +353 -399
- package/dist/{svgRasterizer-BgD72AmG.js → svgRasterizer-CGZQ5njV.js} +1 -1
- package/dist/{svgRasterizer-BgSNqI3L.js → svgRasterizer-PAoqLn1j.js} +1 -1
- package/dist/{vega-scale-D46-iCaL.js → vega-scale-BGC53c22.js} +887 -1184
- package/dist/{vega-scale-CK0_al6O.js → vega-scale-DdW2NzQ3.js} +898 -1195
- package/dist/{viewIdentityRegistry-CDtVktJD.js → viewIdentityRegistry-D4p067HU.js} +1 -1
- package/dist/{viewIdentityRegistry-B-VGlez1.js → viewIdentityRegistry-Dc2hXYsO.js} +1 -1
- package/dist/{viewSelectors-CKfxF_LM.js → viewSelectors-DNXnGwEW.js} +519 -321
- package/dist/{viewSelectors-D_imtq5Z.js → viewSelectors-DYYlOt91.js} +584 -386
- package/dist/{viewUtils-nCJ7AoaI.js → viewUtils-EdhZTPrJ.js} +2930 -2264
- package/dist/{webgl-BaA3jSa2.js → webgl-C53DwzVT.js} +427 -428
- package/dist/{webgl-FP-4EsBL.js → webgl-CdgNFlJk.js} +639 -640
- package/package.json +5 -5
- package/dist/nativeText-DFV5XIx8.js +0 -860
- package/dist/nativeText-vT3AWE14.js +0 -860
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { n as
|
|
7
|
-
import { C as
|
|
8
|
-
import { n as
|
|
1
|
+
import { o as e, s as t, u as n } from "./clipOptions-D6eh9T-_.js";
|
|
2
|
+
import { b as r } from "./viewSelectors-DNXnGwEW.js";
|
|
3
|
+
import { v as i } from "./vega-scale-DdW2NzQ3.js";
|
|
4
|
+
import { t as a } from "./rasterization-CFogVB3B.js";
|
|
5
|
+
import { t as o } from "./rectangle-DKnrAmKs.js";
|
|
6
|
+
import { n as s, t as c } from "./layoutResult-D50MSHXR.js";
|
|
7
|
+
import { A as l, C as u, D as d, E as f, M as p, O as m, S as h, T as g, _, a as v, b as y, c as b, d as x, f as S, g as C, h as w, i as T, j as E, k as D, l as O, m as ee, n as k, o as A, p as te, r as ne, s as re, t as ie, u as ae, v as oe, w as se } from "./nativeText-D9SoxpaD.js";
|
|
8
|
+
import { n as j, t as M } from "./svgNumber-DNxESJQB.js";
|
|
9
9
|
//#region ../core/src/rendering/svg/svgElement.js
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let n = document.createElementNS(
|
|
10
|
+
var N = "http://www.w3.org/2000/svg";
|
|
11
|
+
function P(e, t) {
|
|
12
|
+
let n = document.createElementNS(N, 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 P(e, t) {
|
|
19
|
-
let n = Object.entries(t).filter(([t, n]) => n.encoder.constant ? (e.setAttribute(t, "" + F(n, {})), !1) : !0);
|
|
20
|
-
return (e) => Object.fromEntries(n.map(([t, n]) => [t, F(n, e)]));
|
|
21
|
-
}
|
|
22
18
|
function F(e, t) {
|
|
19
|
+
let n = Object.entries(t).filter(([t, n]) => n.encoder.constant ? (e.setAttribute(t, "" + I(n, {})), !1) : !0);
|
|
20
|
+
return (e) => Object.fromEntries(n.map(([t, n]) => [t, I(n, e)]));
|
|
21
|
+
}
|
|
22
|
+
function I(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, l =
|
|
28
|
+
function ce(e, t) {
|
|
29
|
+
let n = e, { coords: r, data: i, group: a, viewOpacity: o, visibleBounds: s } = t, c = n.encoders, l = F(a, {
|
|
30
30
|
fill: {
|
|
31
31
|
encoder: c.fill,
|
|
32
32
|
transform: f
|
|
@@ -45,86 +45,78 @@ function le(e, t) {
|
|
|
45
45
|
},
|
|
46
46
|
"stroke-width": {
|
|
47
47
|
encoder: c.strokeWidth,
|
|
48
|
-
transform: (e) =>
|
|
48
|
+
transform: (e) => M(+e)
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
a.setAttribute("stroke-linejoin", "miter");
|
|
52
|
-
let u =
|
|
53
|
-
return
|
|
52
|
+
let u = oe(n);
|
|
53
|
+
return y(n, u, {
|
|
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 "${u.headShape}" as a triangle.`), a.appendChild(
|
|
61
|
-
d: e.boundaryLoops.map(
|
|
60
|
+
t.countOnly || (e.headShapeFallback && t.warn(`SVG export rendered unsupported arrow headShape "${u.headShape}" as a triangle.`), a.appendChild(P("path", {
|
|
61
|
+
d: e.boundaryLoops.map(le).join(" "),
|
|
62
62
|
...l(e.datum)
|
|
63
63
|
})));
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return `M ${e.map(
|
|
66
|
+
function le(e) {
|
|
67
|
+
return `M ${e.map(ue).join(" L ")} Z`;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return `${
|
|
69
|
+
function ue(e) {
|
|
70
|
+
return `${M(e.x)} ${M(e.y)}`;
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region ../core/src/rendering/svg/renderers/link.js
|
|
74
|
-
function
|
|
75
|
-
let n = e, r =
|
|
74
|
+
function de(e, t) {
|
|
75
|
+
let n = e, r = te(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, l = n.encoders, u = C(n, r.shape), d = F(o, {
|
|
76
76
|
stroke: {
|
|
77
|
-
encoder:
|
|
77
|
+
encoder: l.color,
|
|
78
78
|
transform: f
|
|
79
79
|
},
|
|
80
80
|
"stroke-opacity": {
|
|
81
|
-
encoder:
|
|
82
|
-
transform: (e) => +e *
|
|
81
|
+
encoder: l.opacity,
|
|
82
|
+
transform: (e) => +e * s
|
|
83
83
|
},
|
|
84
84
|
"stroke-width": {
|
|
85
|
-
encoder:
|
|
86
|
-
transform: (e) =>
|
|
85
|
+
encoder: l.size,
|
|
86
|
+
transform: (e) => M(+e)
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
|
-
return
|
|
90
|
-
coords:
|
|
91
|
-
data:
|
|
92
|
-
visibleBounds:
|
|
89
|
+
return o.setAttribute("fill", "none"), o.setAttribute("stroke-linecap", "butt"), ee(n, r, {
|
|
90
|
+
coords: i,
|
|
91
|
+
data: a,
|
|
92
|
+
visibleBounds: c
|
|
93
93
|
}, ({ datum: e, points: n }) => {
|
|
94
|
-
let [r,
|
|
94
|
+
let [r, i, a, s] = n;
|
|
95
95
|
if (t.countOnly) return;
|
|
96
|
-
let
|
|
97
|
-
if (
|
|
96
|
+
let c = d(e), l = u(e);
|
|
97
|
+
if (l) {
|
|
98
98
|
let e = t.getLinkArcFadeMaskUrl({
|
|
99
99
|
p1: r,
|
|
100
|
-
p4:
|
|
101
|
-
distances:
|
|
100
|
+
p4: s,
|
|
101
|
+
distances: l
|
|
102
102
|
});
|
|
103
|
-
e && (
|
|
103
|
+
e && (c.mask = e);
|
|
104
104
|
}
|
|
105
|
-
|
|
106
|
-
d: `M ${
|
|
107
|
-
...
|
|
105
|
+
o.appendChild(P("path", {
|
|
106
|
+
d: `M ${L(r)} C ${L(i)} ${L(a)} ${L(s)}`,
|
|
107
|
+
...c
|
|
108
108
|
}));
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
|
|
113
|
-
return Array.from(i).map((e) => t.unitView.paramRuntime.findValue(e)).filter((t) => t && (n(t) || e(t)));
|
|
114
|
-
}
|
|
115
|
-
function me(e, t) {
|
|
116
|
-
let i = e[r];
|
|
117
|
-
return t.some((e) => n(e) ? e.uniqueId != null && e.uniqueId == i : e.data.has(i));
|
|
118
|
-
}
|
|
119
|
-
function I(e) {
|
|
120
|
-
return e.map(j).join(" ");
|
|
111
|
+
function L(e) {
|
|
112
|
+
return e.map(M).join(" ");
|
|
121
113
|
}
|
|
122
114
|
//#endregion
|
|
123
115
|
//#region ../core/src/rendering/svg/renderers/point.js
|
|
124
|
-
function
|
|
116
|
+
function fe(e, t) {
|
|
125
117
|
let n = e;
|
|
126
118
|
g(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.");
|
|
127
|
-
let r = x(n), { inwardStroke: i } = r, { group: a, viewOpacity: o } = t, s = n.encoders, c =
|
|
119
|
+
let r = x(n), { inwardStroke: i } = r, { group: a, viewOpacity: o } = t, s = n.encoders, c = F(a, {
|
|
128
120
|
fill: {
|
|
129
121
|
encoder: s.fill,
|
|
130
122
|
transform: f
|
|
@@ -143,47 +135,47 @@ function he(e, t) {
|
|
|
143
135
|
},
|
|
144
136
|
"stroke-width": {
|
|
145
137
|
encoder: s.strokeWidth,
|
|
146
|
-
transform: (e) =>
|
|
138
|
+
transform: (e) => M(+e)
|
|
147
139
|
}
|
|
148
140
|
}), l = R();
|
|
149
141
|
return S(n, r, t, (e) => {
|
|
150
142
|
if (t.countOnly) return;
|
|
151
143
|
let { datum: n, shape: r, x: u, y: d, geometryRadius: f, angle: p, strokeWidth: m, lineShape: h } = e, g = {
|
|
152
144
|
...c(n),
|
|
153
|
-
...i && !h ? { "stroke-width":
|
|
154
|
-
...h ?
|
|
155
|
-
}, _ =
|
|
156
|
-
_ ? (p && _.setAttribute("transform", `rotate(${
|
|
157
|
-
cx:
|
|
158
|
-
cy:
|
|
159
|
-
r:
|
|
145
|
+
...i && !h ? { "stroke-width": M(m) } : {},
|
|
146
|
+
...h ? z(s, n, o) : {}
|
|
147
|
+
}, _ = pe(r, u, d, f, g, l);
|
|
148
|
+
_ ? (p && _.setAttribute("transform", `rotate(${M(p)} ${M(u)} ${M(d)})`), a.appendChild(_)) : (t.warn(`SVG export rendered unsupported point shape "${r}" as a circle.`), a.appendChild(P("circle", {
|
|
149
|
+
cx: M(u),
|
|
150
|
+
cy: M(d),
|
|
151
|
+
r: M(f),
|
|
160
152
|
...g
|
|
161
153
|
})));
|
|
162
154
|
});
|
|
163
155
|
}
|
|
164
|
-
function
|
|
165
|
-
let o =
|
|
166
|
-
if (e == "circle") return
|
|
156
|
+
function pe(e, t, n, r, i, a) {
|
|
157
|
+
let o = M(t), s = M(n), c = M(r);
|
|
158
|
+
if (e == "circle") return P("circle", {
|
|
167
159
|
cx: o,
|
|
168
160
|
cy: s,
|
|
169
161
|
r: c,
|
|
170
162
|
...i
|
|
171
163
|
});
|
|
172
|
-
if (e == "square") return
|
|
173
|
-
x:
|
|
174
|
-
y:
|
|
175
|
-
width:
|
|
176
|
-
height:
|
|
164
|
+
if (e == "square") return P("rect", {
|
|
165
|
+
x: M(t - r),
|
|
166
|
+
y: M(n - r),
|
|
167
|
+
width: M(r * 2),
|
|
168
|
+
height: M(r * 2),
|
|
177
169
|
...i
|
|
178
170
|
});
|
|
179
171
|
let l = a.build(e, t, n, r);
|
|
180
|
-
return l ?
|
|
172
|
+
return l ? P("path", {
|
|
181
173
|
d: l,
|
|
182
174
|
...i
|
|
183
175
|
}) : void 0;
|
|
184
176
|
}
|
|
185
177
|
function R() {
|
|
186
|
-
let e = "", t = (e, t) => `${
|
|
178
|
+
let e = "", t = (e, t) => `${M(e)} ${M(t)}`, n = {
|
|
187
179
|
moveTo(n, r) {
|
|
188
180
|
e += `${e ? " M" : "M"} ${t(n, r)}`;
|
|
189
181
|
},
|
|
@@ -195,23 +187,23 @@ function R() {
|
|
|
195
187
|
}
|
|
196
188
|
};
|
|
197
189
|
return { build(t, r, i, a) {
|
|
198
|
-
return e = "",
|
|
190
|
+
return e = "", ae(t, r, i, a, n) ? e : void 0;
|
|
199
191
|
} };
|
|
200
192
|
}
|
|
201
|
-
function
|
|
202
|
-
let r = e.stroke(t), i =
|
|
193
|
+
function z(e, t, n) {
|
|
194
|
+
let r = e.stroke(t), i = h(e.strokeOpacity, t), a = r == null || i <= 0;
|
|
203
195
|
return {
|
|
204
196
|
fill: "none",
|
|
205
197
|
stroke: f(a ? e.fill(t) : r),
|
|
206
|
-
"stroke-opacity": (a ?
|
|
207
|
-
"stroke-width":
|
|
198
|
+
"stroke-opacity": (a ? h(e.fillOpacity, t) : i) * n,
|
|
199
|
+
"stroke-width": M(h(e.strokeWidth, t)),
|
|
208
200
|
"stroke-linecap": "butt"
|
|
209
201
|
};
|
|
210
202
|
}
|
|
211
203
|
//#endregion
|
|
212
204
|
//#region ../core/src/rendering/svg/renderers/rect.js
|
|
213
|
-
function
|
|
214
|
-
let n = e, r = b(n), { shadow: i, hatch: a } = r, { group: o, viewOpacity: s } = t, c = n.encoders, l =
|
|
205
|
+
function B(e, t) {
|
|
206
|
+
let n = e, r = b(n), { shadow: i, hatch: a } = r, { group: o, viewOpacity: s } = t, c = n.encoders, l = F(o, {
|
|
215
207
|
fill: {
|
|
216
208
|
encoder: c.fill,
|
|
217
209
|
transform: f
|
|
@@ -230,90 +222,90 @@ function _e(e, t) {
|
|
|
230
222
|
},
|
|
231
223
|
"stroke-width": {
|
|
232
224
|
encoder: c.strokeWidth,
|
|
233
|
-
transform: (e) =>
|
|
225
|
+
transform: (e) => M(+e)
|
|
234
226
|
}
|
|
235
227
|
}), u = i.opacity > 0 ? {
|
|
236
228
|
fill: i.color,
|
|
237
229
|
"fill-opacity": 1,
|
|
238
230
|
stroke: i.color,
|
|
239
231
|
"stroke-opacity": 1,
|
|
240
|
-
opacity:
|
|
232
|
+
opacity: j(i.opacity * s),
|
|
241
233
|
filter: t.getShadowFilterUrl(i)
|
|
242
234
|
} : null;
|
|
243
|
-
return
|
|
235
|
+
return O(n, r, t, (e) => {
|
|
244
236
|
if (t.countOnly) return;
|
|
245
|
-
let { datum: n, x: r, y: i, width: d, height: p, radii: m, opacityFactor:
|
|
237
|
+
let { datum: n, x: r, y: i, width: d, height: p, radii: m, opacityFactor: g, strokeWidth: _, fill: v, fillOpacity: y } = e, b = {
|
|
246
238
|
...l(n),
|
|
247
|
-
...
|
|
239
|
+
...g == 1 ? {} : { opacity: j(g) }
|
|
248
240
|
};
|
|
249
|
-
if (a != "none" &&
|
|
241
|
+
if (a != "none" && _ > 0 && (b.fill = t.getRectHatchPatternUrl({
|
|
250
242
|
type: a,
|
|
251
243
|
fill: f(c.fill(n)),
|
|
252
|
-
fillOpacity:
|
|
244
|
+
fillOpacity: h(c.fillOpacity, n) * s,
|
|
253
245
|
stroke: f(c.stroke(n)),
|
|
254
|
-
strokeOpacity:
|
|
255
|
-
strokeWidth:
|
|
256
|
-
}),
|
|
257
|
-
let e =
|
|
246
|
+
strokeOpacity: h(c.strokeOpacity, n) * s,
|
|
247
|
+
strokeWidth: _
|
|
248
|
+
}), b["fill-opacity"] = 1), u) {
|
|
249
|
+
let e = V(r, i, d, p, m, {
|
|
258
250
|
...u,
|
|
259
|
-
"stroke-width":
|
|
251
|
+
"stroke-width": M(_)
|
|
260
252
|
});
|
|
261
|
-
if (a == "none" &&
|
|
253
|
+
if (a == "none" && v != "none" && y == 1 && g == 1) o.appendChild(e);
|
|
262
254
|
else {
|
|
263
|
-
let n =
|
|
255
|
+
let n = _ / 2, a = Object.fromEntries(Object.entries(m).map(([e, t]) => [e, t + n])), s = H(r - n, i - n, d + n * 2, p + n * 2, a), c = P("g", { "clip-path": t.getShadowClipPathUrl(s) });
|
|
264
256
|
c.appendChild(e), o.appendChild(c);
|
|
265
257
|
}
|
|
266
258
|
}
|
|
267
|
-
o.appendChild(
|
|
259
|
+
o.appendChild(V(r, i, d, p, m, b));
|
|
268
260
|
});
|
|
269
261
|
}
|
|
270
|
-
function
|
|
271
|
-
if (
|
|
272
|
-
let o = i.topLeft, s =
|
|
273
|
-
return
|
|
262
|
+
function V(e, t, n, r, i, a) {
|
|
263
|
+
if (me(i)) {
|
|
264
|
+
let o = i.topLeft, s = M(e), c = M(t), l = M(e + n), u = M(t + r);
|
|
265
|
+
return P("rect", {
|
|
274
266
|
x: s,
|
|
275
267
|
y: c,
|
|
276
|
-
width:
|
|
277
|
-
height:
|
|
268
|
+
width: M(l - s),
|
|
269
|
+
height: M(u - c),
|
|
278
270
|
...o ? {
|
|
279
|
-
rx:
|
|
280
|
-
ry:
|
|
271
|
+
rx: M(o),
|
|
272
|
+
ry: M(o)
|
|
281
273
|
} : {},
|
|
282
274
|
...a
|
|
283
275
|
});
|
|
284
|
-
} else return
|
|
285
|
-
d:
|
|
276
|
+
} else return P("path", {
|
|
277
|
+
d: H(e, t, n, r, i),
|
|
286
278
|
...a
|
|
287
279
|
});
|
|
288
280
|
}
|
|
289
|
-
function
|
|
281
|
+
function me(e) {
|
|
290
282
|
return Object.values(e).every((t) => t == e.topLeft);
|
|
291
283
|
}
|
|
292
|
-
function
|
|
284
|
+
function H(e, t, n, r, i) {
|
|
293
285
|
let a = e + n, o = t + r, { topLeft: s, topRight: c, bottomRight: l, bottomLeft: u } = i;
|
|
294
286
|
return [
|
|
295
|
-
`M ${
|
|
296
|
-
`H ${
|
|
297
|
-
|
|
298
|
-
`V ${
|
|
299
|
-
|
|
300
|
-
`H ${
|
|
301
|
-
|
|
302
|
-
`V ${
|
|
303
|
-
|
|
287
|
+
`M ${W(e + s, t)}`,
|
|
288
|
+
`H ${M(a - c)}`,
|
|
289
|
+
U(c, a, t + c, a, t),
|
|
290
|
+
`V ${M(o - l)}`,
|
|
291
|
+
U(l, a - l, o, a, o),
|
|
292
|
+
`H ${M(e + u)}`,
|
|
293
|
+
U(u, e, o - u, e, o),
|
|
294
|
+
`V ${M(t + s)}`,
|
|
295
|
+
U(s, e + s, t, e, t),
|
|
304
296
|
"Z"
|
|
305
297
|
].join(" ");
|
|
306
298
|
}
|
|
307
|
-
function
|
|
308
|
-
return e ? `A ${
|
|
299
|
+
function U(e, t, n, r, i) {
|
|
300
|
+
return e ? `A ${M(e)} ${M(e)} 0 0 1 ${W(t, n)}` : `L ${W(r, i)}`;
|
|
309
301
|
}
|
|
310
|
-
function
|
|
311
|
-
return `${
|
|
302
|
+
function W(e, t) {
|
|
303
|
+
return `${M(e)} ${M(t)}`;
|
|
312
304
|
}
|
|
313
305
|
//#endregion
|
|
314
306
|
//#region ../core/src/rendering/svg/renderers/rule.js
|
|
315
|
-
function
|
|
316
|
-
let n = e, r =
|
|
307
|
+
function G(e, t) {
|
|
308
|
+
let n = e, r = A(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, l = n.encoders, u = n.properties.strokeDash, d = F(o, {
|
|
317
309
|
stroke: {
|
|
318
310
|
encoder: l.color,
|
|
319
311
|
transform: f
|
|
@@ -324,27 +316,27 @@ function U(e, t) {
|
|
|
324
316
|
},
|
|
325
317
|
"stroke-width": {
|
|
326
318
|
encoder: l.size,
|
|
327
|
-
transform: (e) =>
|
|
319
|
+
transform: (e) => M(+e)
|
|
328
320
|
}
|
|
329
321
|
});
|
|
330
|
-
return o.setAttribute("stroke-linecap", "" + n.properties.strokeCap), u && (o.setAttribute("stroke-dasharray", u.map(
|
|
322
|
+
return o.setAttribute("stroke-linecap", "" + n.properties.strokeCap), u && (o.setAttribute("stroke-dasharray", u.map(M).join(" ")), o.setAttribute("stroke-dashoffset", "" + M(n.properties.strokeDashOffset))), re(n, r, {
|
|
331
323
|
coords: i,
|
|
332
324
|
data: a,
|
|
333
325
|
visibleBounds: c
|
|
334
326
|
}, (e) => {
|
|
335
|
-
t.countOnly || o.appendChild(
|
|
336
|
-
x1:
|
|
337
|
-
y1:
|
|
338
|
-
x2:
|
|
339
|
-
y2:
|
|
327
|
+
t.countOnly || o.appendChild(P("line", {
|
|
328
|
+
x1: M(e.x1),
|
|
329
|
+
y1: M(e.y1),
|
|
330
|
+
x2: M(e.x2),
|
|
331
|
+
y2: M(e.y2),
|
|
340
332
|
...d(e.datum)
|
|
341
333
|
}));
|
|
342
334
|
});
|
|
343
335
|
}
|
|
344
336
|
//#endregion
|
|
345
337
|
//#region ../core/src/rendering/svg/renderers/text.js
|
|
346
|
-
function
|
|
347
|
-
let n = e, r = n.properties, i =
|
|
338
|
+
function he(e, t) {
|
|
339
|
+
let n = e, r = n.properties, i = T(n), { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: l, anchorCullBounds: u } = t, d = n.encoders, p = F(s, {
|
|
348
340
|
fill: {
|
|
349
341
|
encoder: d.color,
|
|
350
342
|
transform: f
|
|
@@ -355,10 +347,10 @@ function ye(e, t) {
|
|
|
355
347
|
},
|
|
356
348
|
"font-size": {
|
|
357
349
|
encoder: d.size,
|
|
358
|
-
transform: (e) =>
|
|
350
|
+
transform: (e) => M(+e)
|
|
359
351
|
}
|
|
360
352
|
});
|
|
361
|
-
s.setAttribute("font-family",
|
|
353
|
+
s.setAttribute("font-family", ie(r.font)), s.setAttribute("font-style", r.fontStyle ?? "normal"), s.setAttribute("font-weight", "" + ne(r.fontWeight ?? "normal")), s.setAttribute("text-anchor", ge[i.align]);
|
|
362
354
|
let m = {
|
|
363
355
|
top: {
|
|
364
356
|
width: g(n, r.viewportEdgeFadeWidthTop),
|
|
@@ -376,7 +368,7 @@ function ye(e, t) {
|
|
|
376
368
|
width: g(n, r.viewportEdgeFadeWidthLeft),
|
|
377
369
|
distance: g(n, r.viewportEdgeFadeDistanceLeft)
|
|
378
370
|
}
|
|
379
|
-
}, h =
|
|
371
|
+
}, h = v(n, i, {
|
|
380
372
|
coords: a,
|
|
381
373
|
data: o,
|
|
382
374
|
visibleBounds: l,
|
|
@@ -385,12 +377,12 @@ function ye(e, t) {
|
|
|
385
377
|
if (t.countOnly) return;
|
|
386
378
|
if (e.logoScale) {
|
|
387
379
|
e.multiCharacterLogo && t.warn("SVG export stretches multi-character logo text as a single glyph cell.");
|
|
388
|
-
let n = [`translate(${
|
|
389
|
-
e.angle && n.push(`rotate(${
|
|
390
|
-
let r =
|
|
380
|
+
let n = [`translate(${M(e.x)} ${M(e.y)})`];
|
|
381
|
+
e.angle && n.push(`rotate(${M(e.angle)})`), (e.dx || e.dy) && n.push(`translate(${M(e.dx)} ${M(e.dy)})`), n.push(`scale(${M(e.logoScale.width)} ${M(e.logoScale.heightScale)})`);
|
|
382
|
+
let r = P("text", {
|
|
391
383
|
x: 0,
|
|
392
384
|
y: 0,
|
|
393
|
-
dy:
|
|
385
|
+
dy: k("middle", 1),
|
|
394
386
|
"text-anchor": "middle",
|
|
395
387
|
lengthAdjust: "spacingAndGlyphs",
|
|
396
388
|
textLength: 1,
|
|
@@ -401,18 +393,18 @@ function ye(e, t) {
|
|
|
401
393
|
r.textContent = e.text, s.appendChild(r);
|
|
402
394
|
return;
|
|
403
395
|
}
|
|
404
|
-
let n =
|
|
396
|
+
let n = M(e.x), r = M(e.y), a = P("text", {
|
|
405
397
|
x: n,
|
|
406
398
|
y: r,
|
|
407
|
-
dx:
|
|
408
|
-
dy:
|
|
399
|
+
dx: M(e.dx),
|
|
400
|
+
dy: M(e.dy + k(i.baseline, e.size)),
|
|
409
401
|
lengthAdjust: "spacingAndGlyphs",
|
|
410
|
-
textLength:
|
|
402
|
+
textLength: M(e.width),
|
|
411
403
|
...p(e.datum),
|
|
412
|
-
...e.scale == 1 ? {} : { "font-size":
|
|
413
|
-
...e.fadeOpacity == 1 ? {} : { opacity:
|
|
404
|
+
...e.scale == 1 ? {} : { "font-size": M(e.size) },
|
|
405
|
+
...e.fadeOpacity == 1 ? {} : { opacity: j(e.fadeOpacity) }
|
|
414
406
|
});
|
|
415
|
-
a.textContent = e.text, e.angle && a.setAttribute("transform", `rotate(${
|
|
407
|
+
a.textContent = e.text, e.angle && a.setAttribute("transform", `rotate(${M(e.angle)} ${n} ${r})`), s.appendChild(a);
|
|
416
408
|
});
|
|
417
409
|
if (!t.countOnly && s.childElementCount > 0) {
|
|
418
410
|
let e = t.getViewportEdgeFadeMaskUrl(m);
|
|
@@ -420,58 +412,58 @@ function ye(e, t) {
|
|
|
420
412
|
}
|
|
421
413
|
return h;
|
|
422
414
|
}
|
|
423
|
-
var
|
|
415
|
+
var ge = {
|
|
424
416
|
left: "start",
|
|
425
417
|
center: "middle",
|
|
426
418
|
right: "end"
|
|
427
|
-
},
|
|
428
|
-
function
|
|
429
|
-
let n =
|
|
419
|
+
}, K = 64;
|
|
420
|
+
function _e(e, t) {
|
|
421
|
+
let n = ye(e.unitView);
|
|
430
422
|
if (!n) return;
|
|
431
423
|
let r = e.unitView.getScaleResolution(n.channel)?.getScale();
|
|
432
|
-
if (!r || !
|
|
433
|
-
let { coords:
|
|
434
|
-
if (!
|
|
435
|
-
let
|
|
436
|
-
let [t, n] =
|
|
437
|
-
return
|
|
424
|
+
if (!r || !i(r.type)) return;
|
|
425
|
+
let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: d } = t;
|
|
426
|
+
if (!o.length) return 0;
|
|
427
|
+
let p = e.encoders, m = n.channel == "stroke" ? p.stroke : p.fill, h = be(e.unitView.spec.encoding.x), g = Infinity, _ = Infinity, v = -Infinity, y = -Infinity, b = o.map((e) => {
|
|
428
|
+
let [t, n] = u(a, p, e), [r, i] = se(a, p, e);
|
|
429
|
+
return g = Math.min(g, t, n), _ = Math.min(_, r, i), v = Math.max(v, t, n), y = Math.max(y, r, i), {
|
|
438
430
|
offset: Number(e.position),
|
|
439
|
-
color: f(
|
|
431
|
+
color: f(m(e))
|
|
440
432
|
};
|
|
441
433
|
}).sort((e, t) => e.offset - t.offset);
|
|
442
|
-
if (!
|
|
443
|
-
if (t.countOnly) return
|
|
444
|
-
let
|
|
434
|
+
if (!l(d, g, _, v, y)) return 0;
|
|
435
|
+
if (t.countOnly) return o.length;
|
|
436
|
+
let x = ve(b), S = [
|
|
445
437
|
{
|
|
446
438
|
offset: 0,
|
|
447
|
-
color:
|
|
439
|
+
color: x[0].color
|
|
448
440
|
},
|
|
449
|
-
...
|
|
441
|
+
...x,
|
|
450
442
|
{
|
|
451
443
|
offset: 1,
|
|
452
|
-
color:
|
|
444
|
+
color: x.at(-1).color
|
|
453
445
|
}
|
|
454
|
-
],
|
|
455
|
-
x1:
|
|
456
|
-
y1:
|
|
457
|
-
x2:
|
|
458
|
-
y2:
|
|
459
|
-
stops:
|
|
460
|
-
}),
|
|
461
|
-
return s.appendChild(
|
|
462
|
-
x:
|
|
463
|
-
y:
|
|
464
|
-
width:
|
|
465
|
-
height:
|
|
466
|
-
fill:
|
|
467
|
-
"fill-opacity":
|
|
446
|
+
], C = t.getLegendGradientUrl({
|
|
447
|
+
x1: g,
|
|
448
|
+
y1: h ? _ : y,
|
|
449
|
+
x2: h ? v : g,
|
|
450
|
+
y2: _,
|
|
451
|
+
stops: S
|
|
452
|
+
}), w = M(g), T = M(_), E = M(v), D = M(y), O = Number(p.fillOpacity(o[0])) * c;
|
|
453
|
+
return s.appendChild(P("rect", {
|
|
454
|
+
x: w,
|
|
455
|
+
y: T,
|
|
456
|
+
width: M(E - w),
|
|
457
|
+
height: M(D - T),
|
|
458
|
+
fill: C,
|
|
459
|
+
"fill-opacity": j(O),
|
|
468
460
|
stroke: "none"
|
|
469
|
-
})),
|
|
461
|
+
})), o.length;
|
|
470
462
|
}
|
|
471
|
-
function
|
|
472
|
-
return e.length <=
|
|
463
|
+
function ve(e) {
|
|
464
|
+
return e.length <= K ? e : Array.from({ length: K }, (t, n) => e[Math.round(n * (e.length - 1) / (K - 1))]);
|
|
473
465
|
}
|
|
474
|
-
function
|
|
466
|
+
function ye(e) {
|
|
475
467
|
let t = e;
|
|
476
468
|
for (; t;) {
|
|
477
469
|
let e = t.spec.data;
|
|
@@ -479,32 +471,32 @@ function Se(e) {
|
|
|
479
471
|
t = t.dataParent;
|
|
480
472
|
}
|
|
481
473
|
}
|
|
482
|
-
function
|
|
474
|
+
function be(e) {
|
|
483
475
|
return e != null && "field" in e && (e.field == "position0" || e.field == "position1");
|
|
484
476
|
}
|
|
485
477
|
//#endregion
|
|
486
478
|
//#region ../core/src/rendering/svg/renderers/index.js
|
|
487
|
-
var
|
|
488
|
-
["arrow",
|
|
489
|
-
["link",
|
|
490
|
-
["point",
|
|
491
|
-
["rect",
|
|
492
|
-
["rule",
|
|
493
|
-
["text",
|
|
494
|
-
["tick",
|
|
479
|
+
var xe = /* @__PURE__ */ new Map([
|
|
480
|
+
["arrow", ce],
|
|
481
|
+
["link", de],
|
|
482
|
+
["point", fe],
|
|
483
|
+
["rect", B],
|
|
484
|
+
["rule", G],
|
|
485
|
+
["text", he],
|
|
486
|
+
["tick", G]
|
|
495
487
|
]);
|
|
496
|
-
function
|
|
488
|
+
function Se(e, t) {
|
|
497
489
|
if (e.getType() == "rect") {
|
|
498
|
-
let n =
|
|
490
|
+
let n = _e(e, t);
|
|
499
491
|
if (n !== void 0) return n;
|
|
500
492
|
}
|
|
501
|
-
let n =
|
|
493
|
+
let n = xe.get(e.getType());
|
|
502
494
|
if (!n) throw Error(`SVG rendering is not implemented for mark type "${e.getType()}". View: ${e.unitView.getPathString()}`);
|
|
503
495
|
return n(e, t);
|
|
504
496
|
}
|
|
505
497
|
//#endregion
|
|
506
498
|
//#region ../core/src/rendering/svg/rectHatchPattern.js
|
|
507
|
-
function
|
|
499
|
+
function Ce(e, t) {
|
|
508
500
|
let n = t.strokeWidth, r = [
|
|
509
501
|
"dots",
|
|
510
502
|
"rings",
|
|
@@ -517,31 +509,31 @@ function Ee(e, t) {
|
|
|
517
509
|
"vertical",
|
|
518
510
|
"horizontal",
|
|
519
511
|
"grid"
|
|
520
|
-
].includes(t.type), o = r ? n * 7 : n * (i ? 6 : 4), s = a ? n * 2 : n, c = o, l = r ? o * 2 : o, u =
|
|
512
|
+
].includes(t.type), o = r ? n * 7 : n * (i ? 6 : 4), s = a ? n * 2 : n, c = o, l = r ? o * 2 : o, u = P("pattern", {
|
|
521
513
|
id: e,
|
|
522
514
|
x: 0,
|
|
523
515
|
y: 0,
|
|
524
|
-
width:
|
|
525
|
-
height:
|
|
516
|
+
width: M(c),
|
|
517
|
+
height: M(l),
|
|
526
518
|
patternUnits: "userSpaceOnUse"
|
|
527
519
|
});
|
|
528
|
-
u.appendChild(
|
|
529
|
-
width:
|
|
530
|
-
height:
|
|
520
|
+
u.appendChild(P("rect", {
|
|
521
|
+
width: M(c),
|
|
522
|
+
height: M(l),
|
|
531
523
|
fill: t.fill,
|
|
532
|
-
"fill-opacity":
|
|
524
|
+
"fill-opacity": j(t.fillOpacity)
|
|
533
525
|
}));
|
|
534
|
-
let d =
|
|
526
|
+
let d = P("g", {
|
|
535
527
|
fill: "none",
|
|
536
528
|
stroke: t.stroke,
|
|
537
|
-
"stroke-opacity":
|
|
538
|
-
"stroke-width":
|
|
529
|
+
"stroke-opacity": j(t.strokeOpacity),
|
|
530
|
+
"stroke-width": M(s),
|
|
539
531
|
"stroke-linecap": "square"
|
|
540
532
|
});
|
|
541
|
-
return
|
|
533
|
+
return we(d, t.type, o, s), u.appendChild(d), u;
|
|
542
534
|
}
|
|
543
|
-
function
|
|
544
|
-
let i = (t) => e.appendChild(
|
|
535
|
+
function we(e, t, n, r) {
|
|
536
|
+
let i = (t) => e.appendChild(P("path", { d: t })), a = (e) => M(e), o = (e) => {
|
|
545
537
|
for (let t of [
|
|
546
538
|
-n,
|
|
547
539
|
0,
|
|
@@ -570,10 +562,10 @@ function De(e, t, n, r) {
|
|
|
570
562
|
case "dots":
|
|
571
563
|
case "rings":
|
|
572
564
|
case "ringsLarge": {
|
|
573
|
-
let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(
|
|
574
|
-
cx:
|
|
575
|
-
cy:
|
|
576
|
-
r:
|
|
565
|
+
let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(P("circle", {
|
|
566
|
+
cx: M(t),
|
|
567
|
+
cy: M(n),
|
|
568
|
+
r: M(r)
|
|
577
569
|
}));
|
|
578
570
|
i(n / 2, 0), i(n / 2, n * 2), i(0, n), i(n, n);
|
|
579
571
|
break;
|
|
@@ -583,85 +575,47 @@ function De(e, t, n, r) {
|
|
|
583
575
|
}
|
|
584
576
|
//#endregion
|
|
585
577
|
//#region ../core/src/rendering/svg/linkArcFadeMask.js
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
let r = t[0] - e[0], i = t[1] - e[1], a = Math.hypot(r, i);
|
|
589
|
-
if (a == 0) return;
|
|
590
|
-
let o = -i / a, s = r / a;
|
|
591
|
-
(o < 0 || o == 0 && s < 0) && (o = -o, s = -s);
|
|
592
|
-
let c = o * e[0] + s * e[1], [l, u] = n, d = JSON.stringify([
|
|
593
|
-
q(o, 6),
|
|
594
|
-
q(s, 6),
|
|
595
|
-
q(c, 1),
|
|
596
|
-
q(l, 1),
|
|
597
|
-
q(u, 1)
|
|
598
|
-
]);
|
|
599
|
-
return {
|
|
600
|
-
normalX: o,
|
|
601
|
-
normalY: s,
|
|
602
|
-
offset: c,
|
|
603
|
-
start: l,
|
|
604
|
-
end: u,
|
|
605
|
-
key: d
|
|
606
|
-
};
|
|
607
|
-
}
|
|
608
|
-
function ke(e, t, n, r) {
|
|
609
|
-
let { normalX: i, normalY: a, offset: o, start: s, end: c } = r, l = i * o, u = a * o, d = e + "-gradient", f = N("linearGradient", {
|
|
578
|
+
function Te(e, t, n, r) {
|
|
579
|
+
let { normalX: i, normalY: a, offset: o, start: s, end: c } = r, l = i * o, u = a * o, d = e + "-gradient", f = P("linearGradient", {
|
|
610
580
|
id: d,
|
|
611
581
|
gradientUnits: "userSpaceOnUse",
|
|
612
|
-
x1:
|
|
613
|
-
y1:
|
|
614
|
-
x2:
|
|
615
|
-
y2:
|
|
582
|
+
x1: M(l - i * c),
|
|
583
|
+
y1: M(u - a * c),
|
|
584
|
+
x2: M(l + i * c),
|
|
585
|
+
y2: M(u + a * c),
|
|
616
586
|
spreadMethod: "pad"
|
|
617
587
|
});
|
|
618
|
-
for (let { offset: e, opacity: t } of
|
|
588
|
+
for (let { offset: e, opacity: t } of w(s, c)) f.appendChild(P("stop", {
|
|
619
589
|
offset: q(e, 3),
|
|
620
590
|
"stop-color": "white",
|
|
621
591
|
"stop-opacity": q(t, 3)
|
|
622
592
|
}));
|
|
623
|
-
let p =
|
|
593
|
+
let p = P("mask", {
|
|
624
594
|
id: e,
|
|
625
595
|
x: 0,
|
|
626
596
|
y: 0,
|
|
627
|
-
width:
|
|
628
|
-
height:
|
|
597
|
+
width: M(t),
|
|
598
|
+
height: M(n),
|
|
629
599
|
maskUnits: "userSpaceOnUse",
|
|
630
600
|
maskContentUnits: "userSpaceOnUse",
|
|
631
601
|
"mask-type": "luminance"
|
|
632
602
|
});
|
|
633
|
-
return p.appendChild(
|
|
634
|
-
width:
|
|
635
|
-
height:
|
|
603
|
+
return p.appendChild(P("rect", {
|
|
604
|
+
width: M(t),
|
|
605
|
+
height: M(n),
|
|
636
606
|
fill: `url(#${d})`
|
|
637
607
|
})), {
|
|
638
608
|
gradient: f,
|
|
639
609
|
mask: p
|
|
640
610
|
};
|
|
641
611
|
}
|
|
642
|
-
function Ae(e, t) {
|
|
643
|
-
let n = [], r = (r) => {
|
|
644
|
-
for (let i = 0; i <= K; i++) {
|
|
645
|
-
let a = i / K, o = r ? t + (e - t) * a : e + (t - e) * a, s = r ? (t - o) / (2 * t) : (t + o) / (2 * t), c = (o - e) / (t - e);
|
|
646
|
-
n.push({
|
|
647
|
-
offset: s,
|
|
648
|
-
opacity: 1 - je(c)
|
|
649
|
-
});
|
|
650
|
-
}
|
|
651
|
-
};
|
|
652
|
-
return r(!0), r(!1), n;
|
|
653
|
-
}
|
|
654
|
-
function je(e) {
|
|
655
|
-
let t = Math.max(0, Math.min(1, e));
|
|
656
|
-
return t * t * (3 - 2 * t);
|
|
657
|
-
}
|
|
658
612
|
function q(e, t) {
|
|
659
613
|
let n = 10 ** t;
|
|
660
614
|
return Math.round(e * n) / n;
|
|
661
615
|
}
|
|
662
616
|
//#endregion
|
|
663
617
|
//#region ../core/src/rendering/svg/svgViewRenderingContext.js
|
|
664
|
-
var J = class extends
|
|
618
|
+
var J = class extends s {
|
|
665
619
|
#e;
|
|
666
620
|
#t;
|
|
667
621
|
#n = [];
|
|
@@ -674,8 +628,8 @@ var J = class extends u {
|
|
|
674
628
|
#l = /* @__PURE__ */ new Set();
|
|
675
629
|
#u = !1;
|
|
676
630
|
#d = /* @__PURE__ */ new Map();
|
|
677
|
-
#f = new
|
|
678
|
-
#p =
|
|
631
|
+
#f = new E();
|
|
632
|
+
#p = P("g");
|
|
679
633
|
#m;
|
|
680
634
|
#h;
|
|
681
635
|
#g = [];
|
|
@@ -689,13 +643,13 @@ var J = class extends u {
|
|
|
689
643
|
#w = 0;
|
|
690
644
|
constructor(e, t) {
|
|
691
645
|
super(e), this.width = t.width, this.height = t.height, this.#h = t.maxVectorInstances;
|
|
692
|
-
let n =
|
|
693
|
-
this.#e =
|
|
694
|
-
xmlns:
|
|
646
|
+
let n = M(t.width), r = M(t.height);
|
|
647
|
+
this.#e = P("svg", {
|
|
648
|
+
xmlns: N,
|
|
695
649
|
width: n,
|
|
696
650
|
height: r,
|
|
697
651
|
viewBox: `0 0 ${n} ${r}`
|
|
698
|
-
}), this.#t =
|
|
652
|
+
}), this.#t = P("defs"), this.#e.appendChild(this.#t), t.background != null && this.#e.appendChild(P("rect", {
|
|
699
653
|
width: n,
|
|
700
654
|
height: r,
|
|
701
655
|
fill: t.background,
|
|
@@ -736,13 +690,13 @@ var J = class extends u {
|
|
|
736
690
|
for (let t of e.markGroupElements) t.childElementCount || t.remove();
|
|
737
691
|
this.#m = void 0;
|
|
738
692
|
}
|
|
739
|
-
pushView(e,
|
|
740
|
-
let
|
|
741
|
-
if (
|
|
693
|
+
pushView(e, t) {
|
|
694
|
+
let i = e.getPathString();
|
|
695
|
+
if (n(this.#n)?.exportExcluded || r(e) && e.name.startsWith("scrollbar-")) {
|
|
742
696
|
this.#n.push({
|
|
743
697
|
view: e,
|
|
744
698
|
node: this.currentNode,
|
|
745
|
-
coords:
|
|
699
|
+
coords: t,
|
|
746
700
|
exportExcluded: !0
|
|
747
701
|
});
|
|
748
702
|
return;
|
|
@@ -751,54 +705,54 @@ var J = class extends u {
|
|
|
751
705
|
this.#n.push({
|
|
752
706
|
view: e,
|
|
753
707
|
node: this.currentNode,
|
|
754
|
-
coords:
|
|
708
|
+
coords: t,
|
|
755
709
|
exportExcluded: !1
|
|
756
710
|
});
|
|
757
711
|
return;
|
|
758
712
|
}
|
|
759
|
-
let
|
|
760
|
-
if (
|
|
761
|
-
if (
|
|
713
|
+
let a = this.#m, o = a?.viewGroups.get(e);
|
|
714
|
+
if (o) {
|
|
715
|
+
if (o.parentNode !== this.currentNode) throw Error(`Sample-faceted view was rendered under multiple parents: ${i}`);
|
|
762
716
|
} else {
|
|
763
|
-
|
|
764
|
-
id:
|
|
717
|
+
o = P("g", {
|
|
718
|
+
id: Ee(e.name, this.#v++),
|
|
765
719
|
"data-name": e.name,
|
|
766
|
-
"data-view-path":
|
|
720
|
+
"data-view-path": i
|
|
767
721
|
});
|
|
768
|
-
let t =
|
|
769
|
-
t.textContent =
|
|
722
|
+
let t = P("title");
|
|
723
|
+
t.textContent = i, o.appendChild(t), this.currentNode.appendChild(o), a?.viewGroups.set(e, o);
|
|
770
724
|
}
|
|
771
725
|
this.#n.push({
|
|
772
726
|
view: e,
|
|
773
|
-
node:
|
|
774
|
-
coords:
|
|
727
|
+
node: o,
|
|
728
|
+
coords: t,
|
|
775
729
|
exportExcluded: !1
|
|
776
730
|
});
|
|
777
731
|
}
|
|
778
732
|
popView(e) {
|
|
779
733
|
if (this.#n.pop()?.view !== e) throw Error("Unbalanced SVG view rendering context stack.");
|
|
780
734
|
}
|
|
781
|
-
renderMark(
|
|
782
|
-
if (
|
|
783
|
-
let
|
|
784
|
-
if (!
|
|
785
|
-
let c = this.getVisibleInstanceCount(
|
|
735
|
+
renderMark(r, i) {
|
|
736
|
+
if (n(this.#n)?.exportExcluded || r.unitView.getEffectiveOpacity() <= 0) return;
|
|
737
|
+
let a = e(i), o = t(a, r.properties.clip, this.currentCoords), s = m(this.width, this.height, o);
|
|
738
|
+
if (!D(s)) return;
|
|
739
|
+
let c = this.getVisibleInstanceCount(r);
|
|
786
740
|
if (!this.#u && this.#h != null && c == 0) return;
|
|
787
741
|
if (!this.#u && this.#h != null && c > this.#h) {
|
|
788
|
-
this.#T(
|
|
742
|
+
this.#T(r, s);
|
|
789
743
|
return;
|
|
790
744
|
}
|
|
791
|
-
let l = !this.#u && this.#m != null, u = l ? this.getClipPathUrl(o) : void 0,
|
|
792
|
-
!this.#u && !
|
|
793
|
-
let
|
|
794
|
-
if (
|
|
795
|
-
let
|
|
796
|
-
coords:
|
|
797
|
-
data:
|
|
798
|
-
group:
|
|
745
|
+
let l = !this.#u && this.#m != null, u = l ? this.getClipPathUrl(o) : void 0, f = l ? this.#m.markGroups.get(r)?.get(u ?? "") : void 0;
|
|
746
|
+
!this.#u && !f && this.#E();
|
|
747
|
+
let h = this.#u ? this.#p : this.#O(r, u), g = d(this.currentCoords, a, r.properties.cullByVisibleRange);
|
|
748
|
+
if (p(r, i, this.currentCoords, this.#f, (e, t) => {
|
|
749
|
+
let n = Se(r, {
|
|
750
|
+
coords: e,
|
|
751
|
+
data: t,
|
|
752
|
+
group: h,
|
|
799
753
|
visibleBounds: s,
|
|
800
|
-
anchorCullBounds:
|
|
801
|
-
viewOpacity:
|
|
754
|
+
anchorCullBounds: g,
|
|
755
|
+
viewOpacity: r.unitView.getEffectiveOpacity(),
|
|
802
756
|
countOnly: this.#u,
|
|
803
757
|
getViewportEdgeFadeMaskUrl: (e) => this.#u ? void 0 : this.getViewportEdgeFadeMaskUrl(e),
|
|
804
758
|
getShadowFilterUrl: (e) => this.#u ? "" : this.getShadowFilterUrl(e),
|
|
@@ -806,14 +760,14 @@ var J = class extends u {
|
|
|
806
760
|
getRectHatchPatternUrl: (e) => this.#u ? "" : this.getRectHatchPatternUrl(e),
|
|
807
761
|
getLinkArcFadeMaskUrl: (e) => this.#u ? void 0 : this.getLinkArcFadeMaskUrl(e),
|
|
808
762
|
getLegendGradientUrl: (e) => this.#u ? "" : this.getLegendGradientUrl(e),
|
|
809
|
-
warn: (
|
|
810
|
-
this.#u || this.#l.add(`${
|
|
763
|
+
warn: (e) => {
|
|
764
|
+
this.#u || this.#l.add(`${e} View: ${r.unitView.getPathString()}`);
|
|
811
765
|
}
|
|
812
766
|
});
|
|
813
|
-
this.#u && this.#d.set(
|
|
814
|
-
}, (
|
|
767
|
+
this.#u && this.#d.set(r, this.getVisibleInstanceCount(r) + n);
|
|
768
|
+
}, (e) => this.#l.add(`SVG export could not resolve sample facet index ${e}. View: ${r.unitView.getPathString()}`)), !this.#u && !l && h.childElementCount > 0) {
|
|
815
769
|
let e = this.getClipPathUrl(o);
|
|
816
|
-
e &&
|
|
770
|
+
e && h.setAttribute("clip-path", e), this.currentNode.appendChild(h);
|
|
817
771
|
}
|
|
818
772
|
}
|
|
819
773
|
#T(e, t) {
|
|
@@ -845,26 +799,26 @@ var J = class extends u {
|
|
|
845
799
|
e && (this.#g.push(e), this.#_ = void 0);
|
|
846
800
|
}
|
|
847
801
|
#D(e) {
|
|
848
|
-
let t =
|
|
802
|
+
let t = De(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = P("g", {
|
|
849
803
|
id: `rasterized-${n.join("-")}-${this.#w++}`,
|
|
850
804
|
"data-name": `Rasterized ${n.join(", ")}`,
|
|
851
805
|
"data-rasterized": ""
|
|
852
|
-
}), i =
|
|
806
|
+
}), i = P("image", { preserveAspectRatio: "none" });
|
|
853
807
|
r.appendChild(i);
|
|
854
808
|
let a = e.anchor.parentNode;
|
|
855
|
-
t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r,
|
|
856
|
-
for (let n of e.viewNodes)
|
|
809
|
+
t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r, Oe(a, t)), e.anchor.remove();
|
|
810
|
+
for (let n of e.viewNodes) ke(n, t);
|
|
857
811
|
e.image = i;
|
|
858
812
|
}
|
|
859
813
|
#O(e, t) {
|
|
860
814
|
let n = this.#m;
|
|
861
|
-
if (!n) return
|
|
815
|
+
if (!n) return P("g", { "data-mark-type": e.getType() });
|
|
862
816
|
let r = n.markGroups.get(e);
|
|
863
817
|
r || (r = /* @__PURE__ */ new Map(), n.markGroups.set(e, r));
|
|
864
818
|
let i = t ?? "", a = r.get(i);
|
|
865
819
|
if (a) {
|
|
866
820
|
if (a.parentNode !== this.currentNode) throw Error(`Sample-faceted mark was rendered under multiple parents: ${e.unitView.getPathString()}`);
|
|
867
|
-
} else a =
|
|
821
|
+
} else a = P("g", { "data-mark-type": e.getType() }), t && a.setAttribute("clip-path", t), this.currentNode.appendChild(a), r.set(i, a), n.markGroupElements.add(a);
|
|
868
822
|
return a;
|
|
869
823
|
}
|
|
870
824
|
getClipPathUrl(e) {
|
|
@@ -874,14 +828,14 @@ var J = class extends u {
|
|
|
874
828
|
e.clipY ? t.y : 0,
|
|
875
829
|
e.clipX ? t.width : this.width,
|
|
876
830
|
e.clipY ? t.height : this.height
|
|
877
|
-
].map(
|
|
831
|
+
].map(M), r = n.join(","), i = this.#r.get(r);
|
|
878
832
|
if (!i) {
|
|
879
833
|
i = "clip-" + this.#y++;
|
|
880
|
-
let e =
|
|
834
|
+
let e = P("clipPath", {
|
|
881
835
|
id: i,
|
|
882
836
|
clipPathUnits: "userSpaceOnUse"
|
|
883
837
|
});
|
|
884
|
-
e.appendChild(
|
|
838
|
+
e.appendChild(P("rect", {
|
|
885
839
|
x: n[0],
|
|
886
840
|
y: n[1],
|
|
887
841
|
width: n[2],
|
|
@@ -891,28 +845,28 @@ var J = class extends u {
|
|
|
891
845
|
return `url(#${i})`;
|
|
892
846
|
}
|
|
893
847
|
getShadowFilterUrl(e) {
|
|
894
|
-
let t =
|
|
848
|
+
let t = M(Math.max(e.blur / 2.5, .25)), n = M(e.offsetX), r = M(e.offsetY), i = [
|
|
895
849
|
t,
|
|
896
850
|
n,
|
|
897
851
|
r
|
|
898
852
|
].join(","), a = this.#a.get(i);
|
|
899
853
|
if (!a) {
|
|
900
854
|
a = "shadow-" + this.#x++;
|
|
901
|
-
let e =
|
|
855
|
+
let e = P("filter", {
|
|
902
856
|
id: a,
|
|
903
857
|
x: 0,
|
|
904
858
|
y: 0,
|
|
905
|
-
width:
|
|
906
|
-
height:
|
|
859
|
+
width: M(this.width),
|
|
860
|
+
height: M(this.height),
|
|
907
861
|
filterUnits: "userSpaceOnUse",
|
|
908
862
|
primitiveUnits: "userSpaceOnUse",
|
|
909
863
|
"color-interpolation-filters": "sRGB"
|
|
910
864
|
});
|
|
911
|
-
e.appendChild(
|
|
865
|
+
e.appendChild(P("feGaussianBlur", {
|
|
912
866
|
in: "SourceGraphic",
|
|
913
867
|
stdDeviation: t,
|
|
914
868
|
result: "blur"
|
|
915
|
-
})), e.appendChild(
|
|
869
|
+
})), e.appendChild(P("feOffset", {
|
|
916
870
|
in: "blur",
|
|
917
871
|
dx: n,
|
|
918
872
|
dy: r,
|
|
@@ -925,12 +879,12 @@ var J = class extends u {
|
|
|
925
879
|
let t = this.#o.get(e);
|
|
926
880
|
if (!t) {
|
|
927
881
|
t = "shadow-clip-" + this.#y++;
|
|
928
|
-
let n =
|
|
882
|
+
let n = P("clipPath", {
|
|
929
883
|
id: t,
|
|
930
884
|
clipPathUnits: "userSpaceOnUse"
|
|
931
885
|
});
|
|
932
|
-
n.appendChild(
|
|
933
|
-
d: `M 0 0 V ${
|
|
886
|
+
n.appendChild(P("path", {
|
|
887
|
+
d: `M 0 0 V ${M(this.height)} H ${M(this.width)} V 0 Z ${e}`,
|
|
934
888
|
"clip-rule": "evenodd",
|
|
935
889
|
"fill-rule": "evenodd"
|
|
936
890
|
})), this.#t.appendChild(n), this.#o.set(e, t);
|
|
@@ -941,68 +895,68 @@ var J = class extends u {
|
|
|
941
895
|
let t = JSON.stringify([
|
|
942
896
|
e.type,
|
|
943
897
|
e.fill,
|
|
944
|
-
|
|
898
|
+
j(e.fillOpacity),
|
|
945
899
|
e.stroke,
|
|
946
|
-
|
|
947
|
-
|
|
900
|
+
j(e.strokeOpacity),
|
|
901
|
+
j(e.strokeWidth)
|
|
948
902
|
]), n = this.#s.get(t);
|
|
949
|
-
return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(
|
|
903
|
+
return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(Ce(n, e)), this.#s.set(t, n)), `url(#${n})`;
|
|
950
904
|
}
|
|
951
905
|
getLegendGradientUrl(e) {
|
|
952
|
-
let t = "legend-gradient-" + this.#C++, n =
|
|
906
|
+
let t = "legend-gradient-" + this.#C++, n = P("linearGradient", {
|
|
953
907
|
id: t,
|
|
954
908
|
gradientUnits: "userSpaceOnUse",
|
|
955
|
-
x1:
|
|
956
|
-
y1:
|
|
957
|
-
x2:
|
|
958
|
-
y2:
|
|
909
|
+
x1: M(e.x1),
|
|
910
|
+
y1: M(e.y1),
|
|
911
|
+
x2: M(e.x2),
|
|
912
|
+
y2: M(e.y2)
|
|
959
913
|
});
|
|
960
|
-
for (let t of e.stops) n.appendChild(
|
|
961
|
-
offset:
|
|
914
|
+
for (let t of e.stops) n.appendChild(P("stop", {
|
|
915
|
+
offset: j(t.offset),
|
|
962
916
|
"stop-color": t.color
|
|
963
917
|
}));
|
|
964
918
|
return this.#t.appendChild(n), `url(#${t})`;
|
|
965
919
|
}
|
|
966
920
|
getLinkArcFadeMaskUrl(e) {
|
|
967
|
-
let t =
|
|
921
|
+
let t = _(e.p1, e.p4, e.distances);
|
|
968
922
|
if (!t) return;
|
|
969
923
|
let n = this.#c.get(t.key);
|
|
970
924
|
if (!n) {
|
|
971
925
|
n = "link-arc-fade-" + this.#b++;
|
|
972
|
-
let { gradient: e, mask: r } =
|
|
926
|
+
let { gradient: e, mask: r } = Te(n, this.width, this.height, t);
|
|
973
927
|
this.#t.appendChild(e), this.#t.appendChild(r), this.#c.set(t.key, n);
|
|
974
928
|
}
|
|
975
929
|
return `url(#${n})`;
|
|
976
930
|
}
|
|
977
931
|
getViewportEdgeFadeMaskUrl(e) {
|
|
978
|
-
let
|
|
979
|
-
if (!
|
|
980
|
-
let r =
|
|
932
|
+
let t = Object.entries(e).filter(([, e]) => e.width > 0 && Number.isFinite(e.distance));
|
|
933
|
+
if (!t.length) return;
|
|
934
|
+
let r = n(this.#n);
|
|
981
935
|
if (!r) throw Error("No current view in SVG rendering context.");
|
|
982
936
|
let i = this.#i.get(r.view);
|
|
983
937
|
if (!i) {
|
|
984
938
|
i = "edge-fade-" + this.#b++;
|
|
985
|
-
let e =
|
|
939
|
+
let e = M(this.width), n = M(this.height), a = P("mask", {
|
|
986
940
|
id: i,
|
|
987
941
|
x: 0,
|
|
988
942
|
y: 0,
|
|
989
943
|
width: e,
|
|
990
|
-
height:
|
|
944
|
+
height: n,
|
|
991
945
|
maskUnits: "userSpaceOnUse",
|
|
992
946
|
maskContentUnits: "userSpaceOnUse",
|
|
993
947
|
"mask-type": "luminance"
|
|
994
948
|
});
|
|
995
|
-
a.appendChild(
|
|
949
|
+
a.appendChild(P("rect", {
|
|
996
950
|
width: e,
|
|
997
|
-
height:
|
|
951
|
+
height: n,
|
|
998
952
|
fill: "white"
|
|
999
953
|
}));
|
|
1000
|
-
for (let [o, s] of
|
|
1001
|
-
let
|
|
1002
|
-
this.#t.appendChild(c), a.appendChild(
|
|
954
|
+
for (let [o, s] of t) {
|
|
955
|
+
let t = i + "-" + o, c = Ae(t, o, s, r.coords);
|
|
956
|
+
this.#t.appendChild(c), a.appendChild(P("rect", {
|
|
1003
957
|
width: e,
|
|
1004
|
-
height:
|
|
1005
|
-
fill: `url(#${
|
|
958
|
+
height: n,
|
|
959
|
+
fill: `url(#${t})`
|
|
1006
960
|
}));
|
|
1007
961
|
}
|
|
1008
962
|
this.#t.appendChild(a), this.#i.set(r.view, i);
|
|
@@ -1016,52 +970,52 @@ var J = class extends u {
|
|
|
1016
970
|
return Array.from(this.#l);
|
|
1017
971
|
}
|
|
1018
972
|
get currentNode() {
|
|
1019
|
-
return
|
|
973
|
+
return n(this.#n)?.node ?? this.#e;
|
|
1020
974
|
}
|
|
1021
975
|
get currentCoords() {
|
|
1022
|
-
let e =
|
|
976
|
+
let e = n(this.#n);
|
|
1023
977
|
if (!e) throw Error("No current view in SVG rendering context.");
|
|
1024
978
|
return e.coords;
|
|
1025
979
|
}
|
|
1026
980
|
};
|
|
1027
|
-
function
|
|
981
|
+
function Ee(e, t) {
|
|
1028
982
|
let n = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1029
983
|
return `${/^[A-Za-z_]/.test(n) ? n : n ? "view-" + n : "view"}-${t}`;
|
|
1030
984
|
}
|
|
1031
985
|
function Y(e, t) {
|
|
1032
986
|
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);
|
|
1033
987
|
}
|
|
1034
|
-
function
|
|
988
|
+
function De(e) {
|
|
1035
989
|
let [t, ...n] = Array.from(e), r = t;
|
|
1036
990
|
for (; n.some((e) => !r.contains(e));) r = r.parentNode;
|
|
1037
991
|
return r;
|
|
1038
992
|
}
|
|
1039
|
-
function
|
|
993
|
+
function Oe(e, t) {
|
|
1040
994
|
let n = e;
|
|
1041
995
|
for (; n.parentNode != t;) n = n.parentNode;
|
|
1042
996
|
return n;
|
|
1043
997
|
}
|
|
1044
|
-
function
|
|
998
|
+
function ke(e, t) {
|
|
1045
999
|
let n = e;
|
|
1046
1000
|
for (; n != t && n.matches("g[data-view-path]") && Array.from(n.children).every((e) => e.tagName == "title");) {
|
|
1047
1001
|
let e = n.parentNode;
|
|
1048
1002
|
n.remove(), n = e;
|
|
1049
1003
|
}
|
|
1050
1004
|
}
|
|
1051
|
-
function
|
|
1052
|
-
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 =
|
|
1005
|
+
function Ae(e, t, n, r) {
|
|
1006
|
+
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 = P("linearGradient", {
|
|
1053
1007
|
id: e,
|
|
1054
1008
|
gradientUnits: "userSpaceOnUse",
|
|
1055
|
-
x1:
|
|
1056
|
-
y1:
|
|
1057
|
-
x2:
|
|
1058
|
-
y2:
|
|
1009
|
+
x1: M(a ? i : 0),
|
|
1010
|
+
y1: M(a ? 0 : i),
|
|
1011
|
+
x2: M(a ? o : 0),
|
|
1012
|
+
y2: M(a ? 0 : o)
|
|
1059
1013
|
});
|
|
1060
|
-
return s.appendChild(
|
|
1014
|
+
return s.appendChild(P("stop", {
|
|
1061
1015
|
offset: 0,
|
|
1062
1016
|
"stop-color": "black",
|
|
1063
1017
|
"stop-opacity": 1
|
|
1064
|
-
})), s.appendChild(
|
|
1018
|
+
})), s.appendChild(P("stop", {
|
|
1065
1019
|
offset: 1,
|
|
1066
1020
|
"stop-color": "black",
|
|
1067
1021
|
"stop-opacity": 0
|
|
@@ -1075,18 +1029,18 @@ function X({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "wh
|
|
|
1075
1029
|
height: n,
|
|
1076
1030
|
background: r
|
|
1077
1031
|
});
|
|
1078
|
-
return
|
|
1032
|
+
return c(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(i), {
|
|
1079
1033
|
svg: i.getSvg(),
|
|
1080
1034
|
warnings: i.getWarnings()
|
|
1081
1035
|
};
|
|
1082
1036
|
}
|
|
1083
|
-
function
|
|
1037
|
+
function je({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
|
|
1084
1038
|
let r = new J({ picking: !1 }, {
|
|
1085
1039
|
width: t,
|
|
1086
1040
|
height: n,
|
|
1087
1041
|
background: null
|
|
1088
1042
|
});
|
|
1089
|
-
return r.beginInstanceCounting(),
|
|
1043
|
+
return r.beginInstanceCounting(), c(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(r), r.endInstanceCounting(), { layers: Array.from(r.getVisibleInstanceCounts(), ([e, t]) => ({
|
|
1090
1044
|
viewName: e.unitView.name,
|
|
1091
1045
|
viewTitle: e.unitView.getTitleText(),
|
|
1092
1046
|
viewPath: e.unitView.getPathString(),
|
|
@@ -1094,7 +1048,7 @@ function Le({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
|
|
|
1094
1048
|
instanceCount: t
|
|
1095
1049
|
})).filter((e) => e.instanceCount > 0) };
|
|
1096
1050
|
}
|
|
1097
|
-
async function
|
|
1051
|
+
async function Me(e) {
|
|
1098
1052
|
let t = e.rasterization;
|
|
1099
1053
|
return t ? ($(t), e.rasterizeSvgRuns ? Z({
|
|
1100
1054
|
...e,
|
|
@@ -1106,30 +1060,30 @@ async function Re(e) {
|
|
|
1106
1060
|
rasterized: []
|
|
1107
1061
|
};
|
|
1108
1062
|
}
|
|
1109
|
-
async function Z({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHeight: r, background: i = "white", maxVectorInstances:
|
|
1063
|
+
async function Z({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHeight: r, background: i = "white", maxVectorInstances: s, pixelRatio: l = 2 }) {
|
|
1110
1064
|
$({
|
|
1111
|
-
maxVectorInstances:
|
|
1112
|
-
pixelRatio:
|
|
1065
|
+
maxVectorInstances: s,
|
|
1066
|
+
pixelRatio: l
|
|
1113
1067
|
});
|
|
1114
|
-
let
|
|
1068
|
+
let u = new J({ picking: !1 }, {
|
|
1115
1069
|
width: n,
|
|
1116
1070
|
height: r,
|
|
1117
1071
|
background: i,
|
|
1118
|
-
maxVectorInstances:
|
|
1119
|
-
}),
|
|
1120
|
-
|
|
1121
|
-
let f =
|
|
1072
|
+
maxVectorInstances: s
|
|
1073
|
+
}), d = c(e, o.create(0, 0, n, r), { renderingOptions: { firstFacet: !0 } });
|
|
1074
|
+
u.beginInstanceCounting(), d.collectRenderCommands(u), u.endInstanceCounting(), d.collectRenderCommands(u);
|
|
1075
|
+
let f = u.getRasterRuns();
|
|
1122
1076
|
if (f.length) try {
|
|
1123
1077
|
await t({
|
|
1124
1078
|
runs: f,
|
|
1125
1079
|
viewRoot: e,
|
|
1126
|
-
layoutResult:
|
|
1080
|
+
layoutResult: d,
|
|
1127
1081
|
logicalWidth: n,
|
|
1128
1082
|
logicalHeight: r,
|
|
1129
|
-
pixelRatio:
|
|
1083
|
+
pixelRatio: l
|
|
1130
1084
|
});
|
|
1131
1085
|
} catch (t) {
|
|
1132
|
-
if (t instanceof
|
|
1086
|
+
if (t instanceof a) return Q({
|
|
1133
1087
|
viewRoot: e,
|
|
1134
1088
|
logicalWidth: n,
|
|
1135
1089
|
logicalHeight: r,
|
|
@@ -1138,16 +1092,16 @@ async function Z({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
|
|
|
1138
1092
|
throw t;
|
|
1139
1093
|
}
|
|
1140
1094
|
return {
|
|
1141
|
-
svg:
|
|
1142
|
-
warnings:
|
|
1095
|
+
svg: u.getSvg(),
|
|
1096
|
+
warnings: u.getWarnings(),
|
|
1143
1097
|
rasterized: f.map((e) => ({
|
|
1144
1098
|
targets: e.targets.map((e) => ({
|
|
1145
1099
|
markType: e.mark.getType(),
|
|
1146
1100
|
instanceCount: e.instanceCount
|
|
1147
1101
|
})),
|
|
1148
1102
|
reason: "instance-threshold",
|
|
1149
|
-
maxVectorInstances:
|
|
1150
|
-
pixelRatio:
|
|
1103
|
+
maxVectorInstances: s,
|
|
1104
|
+
pixelRatio: l
|
|
1151
1105
|
}))
|
|
1152
1106
|
};
|
|
1153
1107
|
}
|
|
@@ -1164,4 +1118,4 @@ function $(e) {
|
|
|
1164
1118
|
if (e.pixelRatio != null && (!Number.isFinite(e.pixelRatio) || e.pixelRatio <= 0)) throw RangeError("SVG raster pixelRatio must be positive.");
|
|
1165
1119
|
}
|
|
1166
1120
|
//#endregion
|
|
1167
|
-
export {
|
|
1121
|
+
export { je as analyzeSvgExport, Z as createRasterizedSvg, X as createSvg, Me as createSvgExport };
|