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