@genome-spy/app 0.88.1 → 0.90.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-BIpg3JKh.js → agentApi-Z65dw-sD.js} +5976 -6711
- package/dist/agentApi.es.js +3580 -4470
- package/dist/agentShared.es.js +742 -683
- package/dist/{canvas2d-BVQ7-2eJ.js → canvas2d-DiPQvNtZ.js} +122 -109
- package/dist/{canvas2d-D7SZK3xv.js → canvas2d-t_N10CeW.js} +114 -101
- package/dist/{canvasSizeHelper-7h_8rOcx.js → canvasSizeHelper-foL2YvGL.js} +15 -8
- package/dist/{clipOptions-DTMcB_9z.js → clipOptions-B5PibDq3.js} +1610 -1342
- package/dist/{clipOptions-BWHr3aTa.js → clipOptions-Cba4I0AO.js} +1872 -1644
- package/dist/{componentStyles-FsNmIb22.js → componentStyles-DGtQXvwc.js} +17 -15
- package/dist/{debug-CVpoEOWx.js → debug-CVAlrcZt.js} +2 -2
- package/dist/{debug-DYAMZZKl.js → debug-DP4WzTNo.js} +2 -2
- package/dist/dialog.es.js +4 -3
- package/dist/esm-BiqrFjMh.js +443 -0
- package/dist/{esm-lwYrRdbg.js → esm-Bv7Frz7C.js} +142 -79
- package/dist/{esm-VvpZ9hsq.js → esm-C3A-AuRi.js} +1 -1
- package/dist/esm-CvpR1OcU.js +322 -0
- package/dist/esm-DFHFX1sH.js +1526 -0
- package/dist/esm-Dndm-NaA.js +1193 -0
- package/dist/{esm-CcDLRSvC.js → esm-DtNElqRr.js} +64 -63
- package/dist/esm-L53qjcYH.js +1155 -0
- package/dist/esm-VFJeyk9i.js +249 -0
- package/dist/{esm-BdLYkz-m.js → esm-_xCtpDwm.js} +1 -1
- package/dist/index.es.js +4203 -3910
- package/dist/index.js +971 -482
- package/dist/{indexer-CXjZDo2Q.js → indexer-DbFTKGlm.js} +1 -1
- package/dist/{indexer-DAH_ruVn.js → indexer-En7gpvLN.js} +1 -1
- package/dist/{lit-ByuJ0FJ4.js → lit-CoXp9NFX.js} +12 -10
- package/dist/order-BkYCnwD7.js +1062 -0
- package/dist/order-R043xTpC.js +1062 -0
- package/dist/{parquetRead-Cs2xRrvz.js → parquetRead-0hFIa3Cc.js} +532 -350
- package/dist/rasterExport-C_FcNBkC.js +52 -0
- package/dist/rasterExport-Z7gs5346.js +52 -0
- package/dist/rasterization-_-9JmSas.js +63 -0
- package/dist/rectangle-DE98gIxF.js +108 -0
- package/dist/{renderCanvas2D-DxturTEW.js → renderCanvas2D-DK1c9TFK.js} +68 -67
- package/dist/{renderCanvas2D-DtcJjqpB.js → renderCanvas2D-IM-A9DYG.js} +57 -56
- package/dist/schema.json +599 -116
- package/dist/{src-DjOlFqSn.js → src-DJtvThVC.js} +3 -5
- package/dist/style.css +1 -1
- package/dist/{svg-SDJMzL--.js → svg-DW3tfUmm.js} +339 -326
- package/dist/{svg-CyrLfa9e.js → svg-PabUdcDi.js} +365 -352
- package/dist/{svgRasterizer-f7DJ3UO0.js → svgRasterizer-B6YtWLJs.js} +6 -5
- package/dist/{svgRasterizer-mWK7HTkx.js → svgRasterizer-BEVDyyS3.js} +6 -5
- package/dist/{vega-scale-DLKCwWRs.js → vega-scale-Byaw1K8O.js} +823 -780
- package/dist/{vega-scale-CypF85iS.js → vega-scale-Ctz_wa3z.js} +963 -923
- package/dist/{viewIdentityRegistry-Dl-vMN9I.js → viewIdentityRegistry-BW415b3o.js} +1 -1
- package/dist/{viewIdentityRegistry-DIDo44XQ.js → viewIdentityRegistry-_F0E7nkA.js} +1 -1
- package/dist/{viewSelectors-CymbZyE6.js → viewSelectors-DYz-PhTO.js} +407 -340
- package/dist/{viewSelectors-DNiDip5e.js → viewSelectors-KtD-QSN0.js} +349 -282
- package/dist/{viewUtils-BrJLIj2o.js → viewUtils-BZGPseMx.js} +2052 -1871
- package/dist/{webgl-tZfZ8y3q.js → webgl-BKSGqHaz.js} +2144 -784
- package/dist/{webgl-CTJt7jQd.js → webgl-tdKf9SlZ.js} +2386 -1026
- package/package.json +5 -5
- package/dist/esm-80V4xF_D.js +0 -1098
- package/dist/esm-BA6yMcc-.js +0 -1222
- package/dist/esm-BdT7qUL-.js +0 -157
- package/dist/esm-CfYZhLHN.js +0 -1367
- package/dist/esm-D-iG_TIX.js +0 -441
- package/dist/esm-JAiZmFIS.js +0 -128
- package/dist/order-C5CzA37O.js +0 -918
- package/dist/order-DvY7KNcu.js +0 -918
- package/dist/rasterExport-BgZ98e6U.js +0 -44
- package/dist/rasterExport-DEr8fOLm.js +0 -44
- package/dist/rasterization-CFogVB3B.js +0 -50
- package/dist/rectangle-DKnrAmKs.js +0 -142
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { v as r } from "./vega-scale-
|
|
3
|
-
import { x as i } from "./viewSelectors-
|
|
4
|
-
import { t as a } from "./rasterization-
|
|
5
|
-
import { t as o } from "./rectangle-
|
|
1
|
+
import { Kt as e, o as t, s as n } from "./clipOptions-B5PibDq3.js";
|
|
2
|
+
import { v as r } from "./vega-scale-Ctz_wa3z.js";
|
|
3
|
+
import { x as i } from "./viewSelectors-KtD-QSN0.js";
|
|
4
|
+
import { t as a } from "./rasterization-_-9JmSas.js";
|
|
5
|
+
import { t as o } from "./rectangle-DE98gIxF.js";
|
|
6
6
|
import { n as s, t as c } from "./layoutResult-D50MSHXR.js";
|
|
7
|
-
import { A as l,
|
|
8
|
-
import { n as
|
|
7
|
+
import { A as l, D as u, E as d, F as f, I as p, M as m, N as h, O as g, P as _, S as v, _ as y, a as b, b as x, c as S, d as C, f as w, g as T, h as E, i as D, j as O, k, l as A, m as ee, n as te, o as ne, p as j, r as re, s as ie, t as ae, u as oe, v as se, w as ce, x as le, y as ue } from "./order-BkYCnwD7.js";
|
|
8
|
+
import { n as M, t as N } from "./svgNumber-DNxESJQB.js";
|
|
9
9
|
//#region ../core/src/rendering/svg/svgElement.js
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let n = document.createElementNS(
|
|
10
|
+
var P = "http://www.w3.org/2000/svg";
|
|
11
|
+
function F(e, t) {
|
|
12
|
+
let n = document.createElementNS(P, 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
|
|
20
|
-
return (e) => Object.fromEntries(n.map(([t, n]) => [t,
|
|
18
|
+
function I(e, t) {
|
|
19
|
+
let n = Object.entries(t).filter(([t, n]) => !n.encoder.constant || (e.setAttribute(t, "" + L(n, {})), !1));
|
|
20
|
+
return (e) => Object.fromEntries(n.map(([t, n]) => [t, L(n, e)]));
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function L(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
28
|
function de(e, t) {
|
|
29
|
-
let n = e, { coords: r, data: i, group: a, viewOpacity: o, visibleBounds: s } = t, c = n.encoders,
|
|
29
|
+
let n = e, { coords: r, data: i, group: a, viewOpacity: o, visibleBounds: s } = t, c = n.encoders, u = I(a, {
|
|
30
30
|
fill: {
|
|
31
31
|
encoder: c.fill,
|
|
32
|
-
transform:
|
|
32
|
+
transform: l
|
|
33
33
|
},
|
|
34
34
|
"fill-opacity": {
|
|
35
35
|
encoder: c.fillOpacity,
|
|
@@ -37,7 +37,7 @@ function de(e, t) {
|
|
|
37
37
|
},
|
|
38
38
|
stroke: {
|
|
39
39
|
encoder: c.stroke,
|
|
40
|
-
transform:
|
|
40
|
+
transform: l
|
|
41
41
|
},
|
|
42
42
|
"stroke-opacity": {
|
|
43
43
|
encoder: c.strokeOpacity,
|
|
@@ -45,21 +45,21 @@ function de(e, t) {
|
|
|
45
45
|
},
|
|
46
46
|
"stroke-width": {
|
|
47
47
|
encoder: c.strokeWidth,
|
|
48
|
-
transform: (e) =>
|
|
48
|
+
transform: (e) => N(+e)
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
a.setAttribute("stroke-linejoin", "miter");
|
|
52
|
-
let
|
|
53
|
-
return
|
|
52
|
+
let d = v(n);
|
|
53
|
+
return ce(n, d, {
|
|
54
54
|
coords: r,
|
|
55
55
|
data: i,
|
|
56
56
|
visibleBounds: s,
|
|
57
57
|
viewOpacity: o,
|
|
58
58
|
countOnly: t.countOnly
|
|
59
59
|
}, (e) => {
|
|
60
|
-
t.countOnly || (e.headShapeFallback && t.warn(`SVG export rendered unsupported arrow headShape "${
|
|
60
|
+
t.countOnly || (e.headShapeFallback && t.warn(`SVG export rendered unsupported arrow headShape "${d.headShape}" as a triangle.`), a.appendChild(F("path", {
|
|
61
61
|
d: e.boundaryLoops.map(fe).join(" "),
|
|
62
|
-
...
|
|
62
|
+
...u(e.datum)
|
|
63
63
|
})));
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -67,57 +67,57 @@ function fe(e) {
|
|
|
67
67
|
return `M ${e.map(pe).join(" L ")} Z`;
|
|
68
68
|
}
|
|
69
69
|
function pe(e) {
|
|
70
|
-
return `${
|
|
70
|
+
return `${N(e.x)} ${N(e.y)}`;
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region ../core/src/rendering/svg/renderers/link.js
|
|
74
74
|
function me(e, t) {
|
|
75
|
-
let n = e, r =
|
|
75
|
+
let n = e, r = y(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, u = n.encoders, d = le(n, r.shape, t.secondOrderPass), f = I(o, {
|
|
76
76
|
stroke: {
|
|
77
|
-
encoder:
|
|
78
|
-
transform:
|
|
77
|
+
encoder: u.color,
|
|
78
|
+
transform: l
|
|
79
79
|
},
|
|
80
80
|
"stroke-opacity": {
|
|
81
|
-
encoder:
|
|
81
|
+
encoder: u.opacity,
|
|
82
82
|
transform: (e) => +e * s
|
|
83
83
|
},
|
|
84
84
|
"stroke-width": {
|
|
85
|
-
encoder:
|
|
86
|
-
transform: (e) =>
|
|
85
|
+
encoder: u.size,
|
|
86
|
+
transform: (e) => N(+e)
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
o.setAttribute("fill", "none"), o.setAttribute("stroke-linecap", "butt");
|
|
90
90
|
let p = o, m;
|
|
91
|
-
return
|
|
91
|
+
return se(n, r, {
|
|
92
92
|
coords: i,
|
|
93
93
|
data: a,
|
|
94
94
|
visibleBounds: c
|
|
95
95
|
}, ({ datum: e, points: n }) => {
|
|
96
96
|
let [r, i, a, s] = n;
|
|
97
97
|
if (t.countOnly) return;
|
|
98
|
-
let c = f(e), l =
|
|
98
|
+
let c = f(e), l = d ? t.getLinkArcFadeMaskUrl({
|
|
99
99
|
p1: r,
|
|
100
100
|
p4: s,
|
|
101
|
-
distances:
|
|
101
|
+
distances: d
|
|
102
102
|
}) : void 0;
|
|
103
|
-
l !== m && (m = l, p = l ?
|
|
104
|
-
d: `M ${
|
|
103
|
+
l !== m && (m = l, p = l ? F("g", { mask: l }) : o, l && o.appendChild(p)), p.appendChild(F("path", {
|
|
104
|
+
d: `M ${R(r)} C ${R(i)} ${R(a)} ${R(s)}`,
|
|
105
105
|
...c
|
|
106
106
|
}));
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
return e.map(
|
|
109
|
+
function R(e) {
|
|
110
|
+
return e.map(N).join(" ");
|
|
111
111
|
}
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region ../core/src/rendering/svg/renderers/point.js
|
|
114
|
-
function
|
|
114
|
+
function z(e, t) {
|
|
115
115
|
let n = e;
|
|
116
|
-
|
|
117
|
-
let r =
|
|
116
|
+
k(n, n.properties.fillGradientStrength) && t.warn("SVG export ignored unsupported point property fillGradientStrength."), n.properties.geometricZoomBound && t.warn("SVG export ignored unsupported point property geometricZoomBound.");
|
|
117
|
+
let r = E(n), { inwardStroke: i } = r, { group: a, viewOpacity: o } = t, s = n.encoders, c = I(a, {
|
|
118
118
|
fill: {
|
|
119
119
|
encoder: s.fill,
|
|
120
|
-
transform:
|
|
120
|
+
transform: l
|
|
121
121
|
},
|
|
122
122
|
"fill-opacity": {
|
|
123
123
|
encoder: s.fillOpacity,
|
|
@@ -125,7 +125,7 @@ function I(e, t) {
|
|
|
125
125
|
},
|
|
126
126
|
stroke: {
|
|
127
127
|
encoder: s.stroke,
|
|
128
|
-
transform:
|
|
128
|
+
transform: l
|
|
129
129
|
},
|
|
130
130
|
"stroke-opacity": {
|
|
131
131
|
encoder: s.strokeOpacity,
|
|
@@ -133,47 +133,47 @@ function I(e, t) {
|
|
|
133
133
|
},
|
|
134
134
|
"stroke-width": {
|
|
135
135
|
encoder: s.strokeWidth,
|
|
136
|
-
transform: (e) =>
|
|
136
|
+
transform: (e) => N(+e)
|
|
137
137
|
}
|
|
138
|
-
}),
|
|
139
|
-
return
|
|
138
|
+
}), u = ge();
|
|
139
|
+
return T(n, r, t, (e) => {
|
|
140
140
|
if (t.countOnly) return;
|
|
141
|
-
let { datum: n, shape: r, x:
|
|
141
|
+
let { datum: n, shape: r, x: l, y: d, geometryRadius: f, angle: p, strokeWidth: m, lineShape: h } = e, g = {
|
|
142
142
|
...c(n),
|
|
143
|
-
...i && !h ? { "stroke-width":
|
|
144
|
-
...h ?
|
|
145
|
-
}, _ =
|
|
146
|
-
_ ? (p && _.setAttribute("transform", `rotate(${
|
|
147
|
-
cx:
|
|
148
|
-
cy:
|
|
149
|
-
r:
|
|
143
|
+
...i && !h ? { "stroke-width": N(m) } : {},
|
|
144
|
+
...h ? _e(s, n, o) : {}
|
|
145
|
+
}, _ = he(r, l, d, f, g, u);
|
|
146
|
+
_ ? (p && _.setAttribute("transform", `rotate(${N(p)} ${N(l)} ${N(d)})`), a.appendChild(_)) : (t.warn(`SVG export rendered unsupported point shape "${r}" as a circle.`), a.appendChild(F("circle", {
|
|
147
|
+
cx: N(l),
|
|
148
|
+
cy: N(d),
|
|
149
|
+
r: N(f),
|
|
150
150
|
...g
|
|
151
151
|
})));
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
let o =
|
|
156
|
-
if (e == "circle") return
|
|
154
|
+
function he(e, t, n, r, i, a) {
|
|
155
|
+
let o = N(t), s = N(n), c = N(r);
|
|
156
|
+
if (e == "circle") return F("circle", {
|
|
157
157
|
cx: o,
|
|
158
158
|
cy: s,
|
|
159
159
|
r: c,
|
|
160
160
|
...i
|
|
161
161
|
});
|
|
162
|
-
if (e == "square") return
|
|
163
|
-
x:
|
|
164
|
-
y:
|
|
165
|
-
width:
|
|
166
|
-
height:
|
|
162
|
+
if (e == "square") return F("rect", {
|
|
163
|
+
x: N(t - r),
|
|
164
|
+
y: N(n - r),
|
|
165
|
+
width: N(r * 2),
|
|
166
|
+
height: N(r * 2),
|
|
167
167
|
...i
|
|
168
168
|
});
|
|
169
169
|
let l = a.build(e, t, n, r);
|
|
170
|
-
return l ?
|
|
170
|
+
return l ? F("path", {
|
|
171
171
|
d: l,
|
|
172
172
|
...i
|
|
173
173
|
}) : void 0;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
let e = "", t = (e, t) => `${
|
|
175
|
+
function ge() {
|
|
176
|
+
let e = "", t = (e, t) => `${N(e)} ${N(t)}`, n = {
|
|
177
177
|
moveTo(n, r) {
|
|
178
178
|
e += `${e ? " M" : "M"} ${t(n, r)}`;
|
|
179
179
|
},
|
|
@@ -185,26 +185,26 @@ function R() {
|
|
|
185
185
|
}
|
|
186
186
|
};
|
|
187
187
|
return { build(t, r, i, a) {
|
|
188
|
-
return e = "",
|
|
188
|
+
return e = "", ee(t, r, i, a, n) ? e : void 0;
|
|
189
189
|
} };
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
let r = e.stroke(t), i =
|
|
191
|
+
function _e(e, t, n) {
|
|
192
|
+
let r = e.stroke(t), i = d(e.strokeOpacity, t), a = r == null || i <= 0;
|
|
193
193
|
return {
|
|
194
194
|
fill: "none",
|
|
195
|
-
stroke:
|
|
196
|
-
"stroke-opacity": (a ?
|
|
197
|
-
"stroke-width":
|
|
195
|
+
stroke: l(a ? e.fill(t) : r),
|
|
196
|
+
"stroke-opacity": (a ? d(e.fillOpacity, t) : i) * n,
|
|
197
|
+
"stroke-width": N(d(e.strokeWidth, t)),
|
|
198
198
|
"stroke-linecap": "butt"
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
201
|
//#endregion
|
|
202
202
|
//#region ../core/src/rendering/svg/renderers/rect.js
|
|
203
|
-
function
|
|
204
|
-
let n = e, r =
|
|
203
|
+
function ve(e, t) {
|
|
204
|
+
let n = e, r = w(n), { shadow: i, hatch: a } = r, { group: o, viewOpacity: s } = t, c = n.encoders, u = I(o, {
|
|
205
205
|
fill: {
|
|
206
206
|
encoder: c.fill,
|
|
207
|
-
transform:
|
|
207
|
+
transform: l
|
|
208
208
|
},
|
|
209
209
|
"fill-opacity": {
|
|
210
210
|
encoder: c.fillOpacity,
|
|
@@ -212,7 +212,7 @@ function he(e, t) {
|
|
|
212
212
|
},
|
|
213
213
|
stroke: {
|
|
214
214
|
encoder: c.stroke,
|
|
215
|
-
transform:
|
|
215
|
+
transform: l
|
|
216
216
|
},
|
|
217
217
|
"stroke-opacity": {
|
|
218
218
|
encoder: c.strokeOpacity,
|
|
@@ -220,37 +220,37 @@ function he(e, t) {
|
|
|
220
220
|
},
|
|
221
221
|
"stroke-width": {
|
|
222
222
|
encoder: c.strokeWidth,
|
|
223
|
-
transform: (e) =>
|
|
223
|
+
transform: (e) => N(+e)
|
|
224
224
|
}
|
|
225
225
|
}), f = i.opacity > 0 ? {
|
|
226
226
|
fill: i.color,
|
|
227
227
|
"fill-opacity": 1,
|
|
228
228
|
stroke: i.color,
|
|
229
229
|
"stroke-opacity": 1,
|
|
230
|
-
opacity:
|
|
230
|
+
opacity: M(i.opacity * s),
|
|
231
231
|
filter: t.getShadowFilterUrl(i)
|
|
232
232
|
} : null;
|
|
233
|
-
return
|
|
233
|
+
return j(n, r, t, (e) => {
|
|
234
234
|
if (t.countOnly) return;
|
|
235
235
|
let { datum: n, x: r, y: i, width: p, height: m, radii: h, opacityFactor: g, strokeWidth: _, fill: v, fillOpacity: y } = e, b = {
|
|
236
|
-
...
|
|
237
|
-
...g == 1 ? {} : { opacity:
|
|
236
|
+
...u(n),
|
|
237
|
+
...g == 1 ? {} : { opacity: M(g) }
|
|
238
238
|
};
|
|
239
239
|
if (a != "none" && _ > 0 && (b.fill = t.getRectHatchPatternUrl({
|
|
240
240
|
type: a,
|
|
241
|
-
fill:
|
|
242
|
-
fillOpacity:
|
|
243
|
-
stroke:
|
|
244
|
-
strokeOpacity:
|
|
241
|
+
fill: l(c.fill(n)),
|
|
242
|
+
fillOpacity: d(c.fillOpacity, n) * s,
|
|
243
|
+
stroke: l(c.stroke(n)),
|
|
244
|
+
strokeOpacity: d(c.strokeOpacity, n) * s,
|
|
245
245
|
strokeWidth: _
|
|
246
246
|
}), b["fill-opacity"] = 1), f) {
|
|
247
247
|
let e = B(r, i, p, m, h, {
|
|
248
248
|
...f,
|
|
249
|
-
"stroke-width":
|
|
249
|
+
"stroke-width": N(_)
|
|
250
250
|
});
|
|
251
251
|
if (a == "none" && v != "none" && y == 1 && g == 1) o.appendChild(e);
|
|
252
252
|
else {
|
|
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 =
|
|
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 = F("g", { "clip-path": t.getShadowClipPathUrl(s) });
|
|
254
254
|
c.appendChild(e), o.appendChild(c);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
@@ -258,210 +258,209 @@ function he(e, t) {
|
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
function B(e, t, n, r, i, a) {
|
|
261
|
-
if (
|
|
262
|
-
let o = i.topLeft, s =
|
|
263
|
-
return
|
|
261
|
+
if (ye(i)) {
|
|
262
|
+
let o = i.topLeft, s = N(e), c = N(t), l = N(e + n), u = N(t + r);
|
|
263
|
+
return F("rect", {
|
|
264
264
|
x: s,
|
|
265
265
|
y: c,
|
|
266
|
-
width:
|
|
267
|
-
height:
|
|
266
|
+
width: N(l - s),
|
|
267
|
+
height: N(u - c),
|
|
268
268
|
...o ? {
|
|
269
|
-
rx:
|
|
270
|
-
ry:
|
|
269
|
+
rx: N(o),
|
|
270
|
+
ry: N(o)
|
|
271
271
|
} : {},
|
|
272
272
|
...a
|
|
273
273
|
});
|
|
274
|
-
}
|
|
274
|
+
}
|
|
275
|
+
return F("path", {
|
|
275
276
|
d: V(e, t, n, r, i),
|
|
276
277
|
...a
|
|
277
278
|
});
|
|
278
279
|
}
|
|
279
|
-
function
|
|
280
|
+
function ye(e) {
|
|
280
281
|
return Object.values(e).every((t) => t == e.topLeft);
|
|
281
282
|
}
|
|
282
283
|
function V(e, t, n, r, i) {
|
|
283
284
|
let a = e + n, o = t + r, { topLeft: s, topRight: c, bottomRight: l, bottomLeft: u } = i;
|
|
284
285
|
return [
|
|
285
286
|
`M ${U(e + s, t)}`,
|
|
286
|
-
`H ${
|
|
287
|
+
`H ${N(a - c)}`,
|
|
287
288
|
H(c, a, t + c, a, t),
|
|
288
|
-
`V ${
|
|
289
|
+
`V ${N(o - l)}`,
|
|
289
290
|
H(l, a - l, o, a, o),
|
|
290
|
-
`H ${
|
|
291
|
+
`H ${N(e + u)}`,
|
|
291
292
|
H(u, e, o - u, e, o),
|
|
292
|
-
`V ${
|
|
293
|
+
`V ${N(t + s)}`,
|
|
293
294
|
H(s, e + s, t, e, t),
|
|
294
295
|
"Z"
|
|
295
296
|
].join(" ");
|
|
296
297
|
}
|
|
297
298
|
function H(e, t, n, r, i) {
|
|
298
|
-
return e ? `A ${
|
|
299
|
+
return e ? `A ${N(e)} ${N(e)} 0 0 1 ${U(t, n)}` : `L ${U(r, i)}`;
|
|
299
300
|
}
|
|
300
301
|
function U(e, t) {
|
|
301
|
-
return `${
|
|
302
|
+
return `${N(e)} ${N(t)}`;
|
|
302
303
|
}
|
|
303
304
|
//#endregion
|
|
304
305
|
//#region ../core/src/rendering/svg/renderers/rule.js
|
|
305
306
|
function W(e, t) {
|
|
306
|
-
let n = e, r =
|
|
307
|
+
let n = e, r = oe(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, u = n.encoders, d = n.properties.strokeDash, f = I(o, {
|
|
307
308
|
stroke: {
|
|
308
|
-
encoder:
|
|
309
|
-
transform:
|
|
309
|
+
encoder: u.color,
|
|
310
|
+
transform: l
|
|
310
311
|
},
|
|
311
312
|
"stroke-opacity": {
|
|
312
|
-
encoder:
|
|
313
|
+
encoder: u.opacity,
|
|
313
314
|
transform: (e) => +e * s
|
|
314
315
|
},
|
|
315
316
|
"stroke-width": {
|
|
316
|
-
encoder:
|
|
317
|
-
transform: (e) =>
|
|
317
|
+
encoder: u.size,
|
|
318
|
+
transform: (e) => N(+e)
|
|
318
319
|
}
|
|
319
320
|
});
|
|
320
|
-
return o.setAttribute("stroke-linecap", "" + n.properties.strokeCap),
|
|
321
|
+
return o.setAttribute("stroke-linecap", "" + n.properties.strokeCap), d && (o.setAttribute("stroke-dasharray", d.map(N).join(" ")), o.setAttribute("stroke-dashoffset", "" + N(n.properties.strokeDashOffset))), C(n, r, {
|
|
321
322
|
coords: i,
|
|
322
323
|
data: a,
|
|
323
324
|
visibleBounds: c
|
|
324
325
|
}, (e) => {
|
|
325
|
-
t.countOnly || o.appendChild(
|
|
326
|
-
x1:
|
|
327
|
-
y1:
|
|
328
|
-
x2:
|
|
329
|
-
y2:
|
|
326
|
+
t.countOnly || o.appendChild(F("line", {
|
|
327
|
+
x1: N(e.x1),
|
|
328
|
+
y1: N(e.y1),
|
|
329
|
+
x2: N(e.x2),
|
|
330
|
+
y2: N(e.y2),
|
|
330
331
|
...f(e.datum)
|
|
331
332
|
}));
|
|
332
333
|
});
|
|
333
334
|
}
|
|
334
335
|
//#endregion
|
|
335
336
|
//#region ../core/src/rendering/svg/renderers/text.js
|
|
336
|
-
function
|
|
337
|
-
let n = e, r = n.properties, i =
|
|
337
|
+
function be(e, t) {
|
|
338
|
+
let n = e, r = n.properties, i = t.textMetrics ?? n.unitView.context.textMetrics, a = i.requestFont(r), o = D(i, r), s = S(n), { coords: c, data: u, group: d, viewOpacity: f, visibleBounds: p, anchorCullBounds: m } = t, h = n.encoders, g = I(d, {
|
|
338
339
|
fill: {
|
|
339
|
-
encoder:
|
|
340
|
-
transform:
|
|
340
|
+
encoder: h.color,
|
|
341
|
+
transform: l
|
|
341
342
|
},
|
|
342
343
|
"fill-opacity": {
|
|
343
|
-
encoder:
|
|
344
|
-
transform: (e) => +e *
|
|
344
|
+
encoder: h.opacity,
|
|
345
|
+
transform: (e) => +e * f
|
|
345
346
|
},
|
|
346
347
|
"font-size": {
|
|
347
|
-
encoder:
|
|
348
|
-
transform: (e) =>
|
|
348
|
+
encoder: h.size,
|
|
349
|
+
transform: (e) => N(+e)
|
|
349
350
|
}
|
|
350
351
|
});
|
|
351
|
-
|
|
352
|
-
let
|
|
352
|
+
d.setAttribute("font-family", b(r.font)), d.setAttribute("font-style", r.fontStyle ?? "normal"), d.setAttribute("font-weight", "" + ie(r.fontWeight ?? "normal")), d.setAttribute("text-anchor", xe[s.align]);
|
|
353
|
+
let _ = {
|
|
353
354
|
top: {
|
|
354
|
-
width:
|
|
355
|
-
distance:
|
|
355
|
+
width: k(n, r.viewportEdgeFadeWidthTop),
|
|
356
|
+
distance: k(n, r.viewportEdgeFadeDistanceTop)
|
|
356
357
|
},
|
|
357
358
|
right: {
|
|
358
|
-
width:
|
|
359
|
-
distance:
|
|
359
|
+
width: k(n, r.viewportEdgeFadeWidthRight),
|
|
360
|
+
distance: k(n, r.viewportEdgeFadeDistanceRight)
|
|
360
361
|
},
|
|
361
362
|
bottom: {
|
|
362
|
-
width:
|
|
363
|
-
distance:
|
|
363
|
+
width: k(n, r.viewportEdgeFadeWidthBottom),
|
|
364
|
+
distance: k(n, r.viewportEdgeFadeDistanceBottom)
|
|
364
365
|
},
|
|
365
366
|
left: {
|
|
366
|
-
width:
|
|
367
|
-
distance:
|
|
367
|
+
width: k(n, r.viewportEdgeFadeWidthLeft),
|
|
368
|
+
distance: k(n, r.viewportEdgeFadeDistanceLeft)
|
|
368
369
|
}
|
|
369
|
-
},
|
|
370
|
-
coords:
|
|
371
|
-
data:
|
|
372
|
-
visibleBounds:
|
|
373
|
-
anchorCullBounds:
|
|
370
|
+
}, v = A(n, s, {
|
|
371
|
+
coords: c,
|
|
372
|
+
data: u,
|
|
373
|
+
visibleBounds: p,
|
|
374
|
+
anchorCullBounds: m,
|
|
375
|
+
fontMeasurement: a,
|
|
376
|
+
measureLogoInkBounds: o
|
|
374
377
|
}, (e) => {
|
|
375
378
|
if (t.countOnly) return;
|
|
376
|
-
if (e.
|
|
379
|
+
if (e.logoTransform) {
|
|
377
380
|
e.multiCharacterLogo && t.warn("SVG export stretches multi-character logo text as a single glyph cell.");
|
|
378
|
-
let n = [`translate(${
|
|
379
|
-
e.angle && n.push(`rotate(${
|
|
380
|
-
let r =
|
|
381
|
+
let n = [`translate(${N(e.x)} ${N(e.y)})`];
|
|
382
|
+
e.angle && n.push(`rotate(${N(e.angle)})`), (e.dx || e.dy) && n.push(`translate(${N(e.dx)} ${N(e.dy)})`), n.push(`scale(${N(e.logoTransform.scaleX)} ${N(e.logoTransform.scaleY)})`), n.push(`translate(${N(-e.logoTransform.originX)} ${N(-e.logoTransform.originY)})`);
|
|
383
|
+
let r = F("text", {
|
|
381
384
|
x: 0,
|
|
382
385
|
y: 0,
|
|
383
|
-
|
|
384
|
-
"text-anchor": "middle",
|
|
385
|
-
lengthAdjust: "spacingAndGlyphs",
|
|
386
|
-
textLength: 1,
|
|
386
|
+
"text-anchor": "start",
|
|
387
387
|
transform: n.join(" "),
|
|
388
|
-
...
|
|
389
|
-
"font-size":
|
|
388
|
+
...g(e.datum),
|
|
389
|
+
"font-size": e.size
|
|
390
390
|
});
|
|
391
|
-
r.textContent = e.text,
|
|
391
|
+
r.textContent = e.text, d.appendChild(r);
|
|
392
392
|
return;
|
|
393
393
|
}
|
|
394
|
-
let n =
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
...
|
|
402
|
-
|
|
403
|
-
...e.fadeOpacity == 1 ? {} : { opacity: k(e.fadeOpacity) }
|
|
394
|
+
let n = [`translate(${N(e.x)} ${N(e.y)})`];
|
|
395
|
+
e.angle && n.push(`rotate(${N(e.angle)})`), (e.dx || e.dy) && n.push(`translate(${N(e.dx)} ${N(e.dy)})`), e.scale != 1 && n.push(`scale(${N(e.scale)})`);
|
|
396
|
+
let r = F("text", {
|
|
397
|
+
x: 0,
|
|
398
|
+
y: 0,
|
|
399
|
+
dy: N(ne(s.baseline, e.size)),
|
|
400
|
+
...g(e.datum),
|
|
401
|
+
...e.fadeOpacity == 1 ? {} : { opacity: M(e.fadeOpacity) },
|
|
402
|
+
transform: n.join(" ")
|
|
404
403
|
});
|
|
405
|
-
|
|
404
|
+
r.textContent = e.text, d.appendChild(r);
|
|
406
405
|
});
|
|
407
|
-
if (!t.countOnly &&
|
|
408
|
-
let e = t.getViewportEdgeFadeMaskUrl(
|
|
409
|
-
e &&
|
|
406
|
+
if (!t.countOnly && d.childElementCount > 0) {
|
|
407
|
+
let e = t.getViewportEdgeFadeMaskUrl(_);
|
|
408
|
+
e && d.setAttribute("mask", e);
|
|
410
409
|
}
|
|
411
|
-
return
|
|
410
|
+
return v;
|
|
412
411
|
}
|
|
413
|
-
var
|
|
412
|
+
var xe = {
|
|
414
413
|
left: "start",
|
|
415
414
|
center: "middle",
|
|
416
415
|
right: "end"
|
|
417
416
|
}, G = 64;
|
|
418
|
-
function
|
|
419
|
-
let n =
|
|
417
|
+
function Se(e, t) {
|
|
418
|
+
let n = we(e.unitView);
|
|
420
419
|
if (!n) return;
|
|
421
420
|
let i = e.unitView.getScaleResolution(n.channel)?.getScale();
|
|
422
421
|
if (!i || !r(i.type)) return;
|
|
423
|
-
let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds:
|
|
422
|
+
let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: d } = t;
|
|
424
423
|
if (!o.length) return 0;
|
|
425
|
-
let
|
|
426
|
-
let [t, n] =
|
|
427
|
-
return
|
|
424
|
+
let f = e.encoders, p = n.channel == "stroke" ? f.stroke : f.fill, m = Te(e.unitView.spec.encoding.x), h = Infinity, v = Infinity, y = -Infinity, b = -Infinity, x = o.map((e) => {
|
|
425
|
+
let [t, n] = u(a, f, e), [r, i] = g(a, f, e);
|
|
426
|
+
return h = Math.min(h, t, n), v = Math.min(v, r, i), y = Math.max(y, t, n), b = Math.max(b, r, i), {
|
|
428
427
|
offset: Number(e.position),
|
|
429
|
-
color:
|
|
428
|
+
color: l(p(e))
|
|
430
429
|
};
|
|
431
430
|
}).sort((e, t) => e.offset - t.offset);
|
|
432
|
-
if (!
|
|
431
|
+
if (!_(d, h, v, y, b)) return 0;
|
|
433
432
|
if (t.countOnly) return o.length;
|
|
434
|
-
let
|
|
433
|
+
let S = Ce(x), C = [
|
|
435
434
|
{
|
|
436
435
|
offset: 0,
|
|
437
|
-
color:
|
|
436
|
+
color: S[0].color
|
|
438
437
|
},
|
|
439
|
-
...
|
|
438
|
+
...S,
|
|
440
439
|
{
|
|
441
440
|
offset: 1,
|
|
442
|
-
color:
|
|
441
|
+
color: S.at(-1).color
|
|
443
442
|
}
|
|
444
|
-
],
|
|
445
|
-
x1:
|
|
446
|
-
y1:
|
|
447
|
-
x2:
|
|
448
|
-
y2:
|
|
449
|
-
stops:
|
|
450
|
-
}),
|
|
451
|
-
return s.appendChild(
|
|
452
|
-
x:
|
|
453
|
-
y:
|
|
454
|
-
width:
|
|
455
|
-
height:
|
|
456
|
-
fill:
|
|
457
|
-
"fill-opacity": k
|
|
443
|
+
], w = t.getLegendGradientUrl({
|
|
444
|
+
x1: h,
|
|
445
|
+
y1: m ? v : b,
|
|
446
|
+
x2: m ? y : h,
|
|
447
|
+
y2: v,
|
|
448
|
+
stops: C
|
|
449
|
+
}), T = N(h), E = N(v), D = N(y), O = N(b), k = Number(f.fillOpacity(o[0])) * c;
|
|
450
|
+
return s.appendChild(F("rect", {
|
|
451
|
+
x: T,
|
|
452
|
+
y: E,
|
|
453
|
+
width: N(D - T),
|
|
454
|
+
height: N(O - E),
|
|
455
|
+
fill: w,
|
|
456
|
+
"fill-opacity": M(k),
|
|
458
457
|
stroke: "none"
|
|
459
458
|
})), o.length;
|
|
460
459
|
}
|
|
461
|
-
function
|
|
462
|
-
return e.length <= G ? e : Array.from({ length: G }, (t, n) => e[Math.round(n * (e.length - 1) /
|
|
460
|
+
function Ce(e) {
|
|
461
|
+
return e.length <= G ? e : Array.from({ length: G }, (t, n) => e[Math.round(n * (e.length - 1) / 63)]);
|
|
463
462
|
}
|
|
464
|
-
function
|
|
463
|
+
function we(e) {
|
|
465
464
|
let t = e;
|
|
466
465
|
for (; t;) {
|
|
467
466
|
let e = t.spec.data;
|
|
@@ -469,32 +468,32 @@ function xe(e) {
|
|
|
469
468
|
t = t.dataParent;
|
|
470
469
|
}
|
|
471
470
|
}
|
|
472
|
-
function
|
|
471
|
+
function Te(e) {
|
|
473
472
|
return e != null && "field" in e && (e.field == "position0" || e.field == "position1");
|
|
474
473
|
}
|
|
475
474
|
//#endregion
|
|
476
475
|
//#region ../core/src/rendering/svg/renderers/index.js
|
|
477
|
-
var
|
|
476
|
+
var Ee = /* @__PURE__ */ new Map([
|
|
478
477
|
["arrow", de],
|
|
479
478
|
["link", me],
|
|
480
|
-
["point",
|
|
481
|
-
["rect",
|
|
479
|
+
["point", z],
|
|
480
|
+
["rect", ve],
|
|
482
481
|
["rule", W],
|
|
483
|
-
["text",
|
|
482
|
+
["text", be],
|
|
484
483
|
["tick", W]
|
|
485
484
|
]);
|
|
486
|
-
function
|
|
485
|
+
function De(e, t) {
|
|
487
486
|
if (e.getType() == "rect") {
|
|
488
|
-
let n =
|
|
487
|
+
let n = Se(e, t);
|
|
489
488
|
if (n !== void 0) return n;
|
|
490
489
|
}
|
|
491
|
-
let n =
|
|
490
|
+
let n = Ee.get(e.getType());
|
|
492
491
|
if (!n) throw Error(`SVG rendering is not implemented for mark type "${e.getType()}". View: ${e.unitView.getPathString()}`);
|
|
493
492
|
return n(e, t);
|
|
494
493
|
}
|
|
495
494
|
//#endregion
|
|
496
495
|
//#region ../core/src/rendering/svg/rectHatchPattern.js
|
|
497
|
-
function
|
|
496
|
+
function Oe(e, t) {
|
|
498
497
|
let n = t.strokeWidth, r = [
|
|
499
498
|
"dots",
|
|
500
499
|
"rings",
|
|
@@ -507,31 +506,31 @@ function Te(e, t) {
|
|
|
507
506
|
"vertical",
|
|
508
507
|
"horizontal",
|
|
509
508
|
"grid"
|
|
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 =
|
|
509
|
+
].includes(t.type), o = r ? n * 7 : n * (i ? 6 : 4), s = a ? n * 2 : n, c = o, l = r ? o * 2 : o, u = F("pattern", {
|
|
511
510
|
id: e,
|
|
512
511
|
x: 0,
|
|
513
512
|
y: 0,
|
|
514
|
-
width:
|
|
515
|
-
height:
|
|
513
|
+
width: N(c),
|
|
514
|
+
height: N(l),
|
|
516
515
|
patternUnits: "userSpaceOnUse"
|
|
517
516
|
});
|
|
518
|
-
u.appendChild(
|
|
519
|
-
width:
|
|
520
|
-
height:
|
|
517
|
+
u.appendChild(F("rect", {
|
|
518
|
+
width: N(c),
|
|
519
|
+
height: N(l),
|
|
521
520
|
fill: t.fill,
|
|
522
|
-
"fill-opacity":
|
|
521
|
+
"fill-opacity": M(t.fillOpacity)
|
|
523
522
|
}));
|
|
524
|
-
let d =
|
|
523
|
+
let d = F("g", {
|
|
525
524
|
fill: "none",
|
|
526
525
|
stroke: t.stroke,
|
|
527
|
-
"stroke-opacity":
|
|
528
|
-
"stroke-width":
|
|
526
|
+
"stroke-opacity": M(t.strokeOpacity),
|
|
527
|
+
"stroke-width": N(s),
|
|
529
528
|
"stroke-linecap": "square"
|
|
530
529
|
});
|
|
531
|
-
return
|
|
530
|
+
return ke(d, t.type, o, s), u.appendChild(d), u;
|
|
532
531
|
}
|
|
533
|
-
function
|
|
534
|
-
let i = (t) => e.appendChild(
|
|
532
|
+
function ke(e, t, n, r) {
|
|
533
|
+
let i = (t) => e.appendChild(F("path", { d: t })), a = (e) => N(e), o = (e) => {
|
|
535
534
|
for (let t of [
|
|
536
535
|
-n,
|
|
537
536
|
0,
|
|
@@ -560,10 +559,10 @@ function Ee(e, t, n, r) {
|
|
|
560
559
|
case "dots":
|
|
561
560
|
case "rings":
|
|
562
561
|
case "ringsLarge": {
|
|
563
|
-
let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(
|
|
564
|
-
cx:
|
|
565
|
-
cy:
|
|
566
|
-
r:
|
|
562
|
+
let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(F("circle", {
|
|
563
|
+
cx: N(t),
|
|
564
|
+
cy: N(n),
|
|
565
|
+
r: N(r)
|
|
567
566
|
}));
|
|
568
567
|
i(n / 2, 0), i(n / 2, n * 2), i(0, n), i(n, n);
|
|
569
568
|
break;
|
|
@@ -573,34 +572,34 @@ function Ee(e, t, n, r) {
|
|
|
573
572
|
}
|
|
574
573
|
//#endregion
|
|
575
574
|
//#region ../core/src/rendering/svg/linkArcFadeMask.js
|
|
576
|
-
function
|
|
577
|
-
let { normalX: i, normalY: a, offset: o, start: s, end: c } = r, l = i * o, u = a * o, d = e + "-gradient", f =
|
|
575
|
+
function Ae(e, t, n, r) {
|
|
576
|
+
let { normalX: i, normalY: a, offset: o, start: s, end: c } = r, l = i * o, u = a * o, d = e + "-gradient", f = F("linearGradient", {
|
|
578
577
|
id: d,
|
|
579
578
|
gradientUnits: "userSpaceOnUse",
|
|
580
|
-
x1:
|
|
581
|
-
y1:
|
|
582
|
-
x2:
|
|
583
|
-
y2:
|
|
579
|
+
x1: N(l - i * c),
|
|
580
|
+
y1: N(u - a * c),
|
|
581
|
+
x2: N(l + i * c),
|
|
582
|
+
y2: N(u + a * c),
|
|
584
583
|
spreadMethod: "pad"
|
|
585
584
|
});
|
|
586
|
-
for (let { offset: e, opacity: t } of
|
|
585
|
+
for (let { offset: e, opacity: t } of ue(s, c)) f.appendChild(F("stop", {
|
|
587
586
|
offset: K(e, 3),
|
|
588
587
|
"stop-color": "white",
|
|
589
588
|
"stop-opacity": K(t, 3)
|
|
590
589
|
}));
|
|
591
|
-
let p =
|
|
590
|
+
let p = F("mask", {
|
|
592
591
|
id: e,
|
|
593
592
|
x: 0,
|
|
594
593
|
y: 0,
|
|
595
|
-
width:
|
|
596
|
-
height:
|
|
594
|
+
width: N(t),
|
|
595
|
+
height: N(n),
|
|
597
596
|
maskUnits: "userSpaceOnUse",
|
|
598
597
|
maskContentUnits: "userSpaceOnUse",
|
|
599
598
|
"mask-type": "luminance"
|
|
600
599
|
});
|
|
601
|
-
return p.appendChild(
|
|
602
|
-
width:
|
|
603
|
-
height:
|
|
600
|
+
return p.appendChild(F("rect", {
|
|
601
|
+
width: N(t),
|
|
602
|
+
height: N(n),
|
|
604
603
|
fill: `url(#${d})`
|
|
605
604
|
})), {
|
|
606
605
|
gradient: f,
|
|
@@ -626,8 +625,8 @@ var q = class extends s {
|
|
|
626
625
|
#l = /* @__PURE__ */ new Set();
|
|
627
626
|
#u = !1;
|
|
628
627
|
#d = /* @__PURE__ */ new Map();
|
|
629
|
-
#f = new
|
|
630
|
-
#p =
|
|
628
|
+
#f = new f();
|
|
629
|
+
#p = F("g");
|
|
631
630
|
#m;
|
|
632
631
|
#h;
|
|
633
632
|
#g = [];
|
|
@@ -640,14 +639,14 @@ var q = class extends s {
|
|
|
640
639
|
#C = 0;
|
|
641
640
|
#w = 0;
|
|
642
641
|
constructor(e, t) {
|
|
643
|
-
super(e), this.width = t.width, this.height = t.height, this.#h = t.maxVectorInstances;
|
|
644
|
-
let n =
|
|
645
|
-
this.#e =
|
|
646
|
-
xmlns:
|
|
642
|
+
super(e), this.width = t.width, this.height = t.height, this.textMetrics = t.textMetrics, this.#h = t.maxVectorInstances;
|
|
643
|
+
let n = N(t.width), r = N(t.height);
|
|
644
|
+
this.#e = F("svg", {
|
|
645
|
+
xmlns: P,
|
|
647
646
|
width: n,
|
|
648
647
|
height: r,
|
|
649
648
|
viewBox: `0 0 ${n} ${r}`
|
|
650
|
-
}), this.#t =
|
|
649
|
+
}), this.#t = F("defs"), this.#e.appendChild(this.#t), t.background != null && this.#e.appendChild(F("rect", {
|
|
651
650
|
width: n,
|
|
652
651
|
height: r,
|
|
653
652
|
fill: t.background,
|
|
@@ -688,42 +687,42 @@ var q = class extends s {
|
|
|
688
687
|
for (let t of e.markGroupElements) t.childElementCount || t.remove();
|
|
689
688
|
this.#m = void 0;
|
|
690
689
|
}
|
|
691
|
-
pushView(
|
|
692
|
-
let r =
|
|
693
|
-
if (
|
|
690
|
+
pushView(t, n) {
|
|
691
|
+
let r = t.getPathString();
|
|
692
|
+
if (e(this.#n)?.exportExcluded || i(t) && t.name.startsWith("scrollbar-")) {
|
|
694
693
|
this.#n.push({
|
|
695
|
-
view:
|
|
694
|
+
view: t,
|
|
696
695
|
node: this.currentNode,
|
|
697
|
-
coords:
|
|
696
|
+
coords: n,
|
|
698
697
|
exportExcluded: !0
|
|
699
698
|
});
|
|
700
699
|
return;
|
|
701
700
|
}
|
|
702
701
|
if (this.#u) {
|
|
703
702
|
this.#n.push({
|
|
704
|
-
view:
|
|
703
|
+
view: t,
|
|
705
704
|
node: this.currentNode,
|
|
706
|
-
coords:
|
|
705
|
+
coords: n,
|
|
707
706
|
exportExcluded: !1
|
|
708
707
|
});
|
|
709
708
|
return;
|
|
710
709
|
}
|
|
711
|
-
let a = this.#m, o = a?.viewGroups.get(
|
|
710
|
+
let a = this.#m, o = a?.viewGroups.get(t);
|
|
712
711
|
if (o) {
|
|
713
712
|
if (o.parentNode !== this.currentNode) throw Error(`Sample-faceted view was rendered under multiple parents: ${r}`);
|
|
714
713
|
} else {
|
|
715
|
-
o =
|
|
716
|
-
id:
|
|
717
|
-
"data-name":
|
|
714
|
+
o = F("g", {
|
|
715
|
+
id: je(t.name, this.#v++),
|
|
716
|
+
"data-name": t.name,
|
|
718
717
|
"data-view-path": r
|
|
719
718
|
});
|
|
720
|
-
let
|
|
721
|
-
|
|
719
|
+
let e = F("title");
|
|
720
|
+
e.textContent = r, o.appendChild(e), this.currentNode.appendChild(o), a?.viewGroups.set(t, o);
|
|
722
721
|
}
|
|
723
722
|
this.#n.push({
|
|
724
|
-
view:
|
|
723
|
+
view: t,
|
|
725
724
|
node: o,
|
|
726
|
-
coords:
|
|
725
|
+
coords: n,
|
|
727
726
|
exportExcluded: !1
|
|
728
727
|
});
|
|
729
728
|
}
|
|
@@ -731,27 +730,28 @@ var q = class extends s {
|
|
|
731
730
|
if (this.#n.pop()?.view !== e) throw Error("Unbalanced SVG view rendering context stack.");
|
|
732
731
|
}
|
|
733
732
|
renderMark(r, i) {
|
|
734
|
-
if (
|
|
735
|
-
let a =
|
|
736
|
-
if (!
|
|
733
|
+
if (e(this.#n)?.exportExcluded || r.unitView.getEffectiveOpacity() <= 0) return;
|
|
734
|
+
let a = t(i), o = n(a, r.properties.clip, this.currentCoords), s = m(this.width, this.height, o);
|
|
735
|
+
if (!h(s)) return;
|
|
737
736
|
let c = this.getVisibleInstanceCount(r);
|
|
738
737
|
if (!this.#u && this.#h != null && c == 0) return;
|
|
739
738
|
if (!this.#u && this.#h != null && c > this.#h) {
|
|
740
739
|
this.#T(r, s);
|
|
741
740
|
return;
|
|
742
741
|
}
|
|
743
|
-
let
|
|
744
|
-
!this.#u && !
|
|
745
|
-
let
|
|
746
|
-
if (
|
|
742
|
+
let l = !this.#u && this.#m != null, u = l ? this.getClipPathUrl(o) : void 0, d = l ? this.#m.markGroups.get(r)?.get(u ?? "") : void 0;
|
|
743
|
+
!this.#u && !d && this.#E();
|
|
744
|
+
let f = this.#u ? this.#p : this.#O(r, u), g = O(this.currentCoords, a, r.properties.cullByVisibleRange), _ = r.getOrder?.(), v = !this.#u && _ && _.isActive();
|
|
745
|
+
if (p(r, i, this.currentCoords, this.#f, (e, t) => {
|
|
747
746
|
let n = (t, n = !1) => {
|
|
748
|
-
let i =
|
|
747
|
+
let i = De(r, {
|
|
749
748
|
coords: e,
|
|
750
749
|
data: t,
|
|
751
|
-
group:
|
|
750
|
+
group: f,
|
|
752
751
|
visibleBounds: s,
|
|
753
752
|
anchorCullBounds: g,
|
|
754
753
|
viewOpacity: r.unitView.getEffectiveOpacity(),
|
|
754
|
+
textMetrics: this.textMetrics,
|
|
755
755
|
secondOrderPass: n,
|
|
756
756
|
countOnly: this.#u,
|
|
757
757
|
getViewportEdgeFadeMaskUrl: (e) => this.#u ? void 0 : this.getViewportEdgeFadeMaskUrl(e),
|
|
@@ -772,9 +772,9 @@ var q = class extends s {
|
|
|
772
772
|
}
|
|
773
773
|
let i = ae(t, 0, t.length, _.predicate, _.passes);
|
|
774
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 && !
|
|
775
|
+
}, (e) => this.#l.add(`SVG export could not resolve sample facet index ${e}. View: ${r.unitView.getPathString()}`)), !this.#u && !l && f.childElementCount > 0) {
|
|
776
776
|
let e = this.getClipPathUrl(o);
|
|
777
|
-
e &&
|
|
777
|
+
e && f.setAttribute("clip-path", e), this.currentNode.appendChild(f);
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
780
|
#T(e, t) {
|
|
@@ -806,26 +806,26 @@ var q = class extends s {
|
|
|
806
806
|
e && (this.#g.push(e), this.#_ = void 0);
|
|
807
807
|
}
|
|
808
808
|
#D(e) {
|
|
809
|
-
let t =
|
|
809
|
+
let t = Me(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = F("g", {
|
|
810
810
|
id: `rasterized-${n.join("-")}-${this.#w++}`,
|
|
811
811
|
"data-name": `Rasterized ${n.join(", ")}`,
|
|
812
812
|
"data-rasterized": ""
|
|
813
|
-
}), i =
|
|
813
|
+
}), i = F("image", { preserveAspectRatio: "none" });
|
|
814
814
|
r.appendChild(i);
|
|
815
815
|
let a = e.anchor.parentNode;
|
|
816
|
-
t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r,
|
|
817
|
-
for (let n of e.viewNodes)
|
|
816
|
+
t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r, Ne(a, t)), e.anchor.remove();
|
|
817
|
+
for (let n of e.viewNodes) Pe(n, t);
|
|
818
818
|
e.image = i;
|
|
819
819
|
}
|
|
820
820
|
#O(e, t) {
|
|
821
821
|
let n = this.#m;
|
|
822
|
-
if (!n) return
|
|
822
|
+
if (!n) return F("g", { "data-mark-type": e.getType() });
|
|
823
823
|
let r = n.markGroups.get(e);
|
|
824
824
|
r || (r = /* @__PURE__ */ new Map(), n.markGroups.set(e, r));
|
|
825
825
|
let i = t ?? "", a = r.get(i);
|
|
826
826
|
if (a) {
|
|
827
827
|
if (a.parentNode !== this.currentNode) throw Error(`Sample-faceted mark was rendered under multiple parents: ${e.unitView.getPathString()}`);
|
|
828
|
-
} else a =
|
|
828
|
+
} else a = F("g", { "data-mark-type": e.getType() }), t && a.setAttribute("clip-path", t), this.currentNode.appendChild(a), r.set(i, a), n.markGroupElements.add(a);
|
|
829
829
|
return a;
|
|
830
830
|
}
|
|
831
831
|
getClipPathUrl(e) {
|
|
@@ -835,14 +835,14 @@ var q = class extends s {
|
|
|
835
835
|
e.clipY ? t.y : 0,
|
|
836
836
|
e.clipX ? t.width : this.width,
|
|
837
837
|
e.clipY ? t.height : this.height
|
|
838
|
-
].map(
|
|
838
|
+
].map(N), r = n.join(","), i = this.#r.get(r);
|
|
839
839
|
if (!i) {
|
|
840
840
|
i = "clip-" + this.#y++;
|
|
841
|
-
let e =
|
|
841
|
+
let e = F("clipPath", {
|
|
842
842
|
id: i,
|
|
843
843
|
clipPathUnits: "userSpaceOnUse"
|
|
844
844
|
});
|
|
845
|
-
e.appendChild(
|
|
845
|
+
e.appendChild(F("rect", {
|
|
846
846
|
x: n[0],
|
|
847
847
|
y: n[1],
|
|
848
848
|
width: n[2],
|
|
@@ -852,28 +852,28 @@ var q = class extends s {
|
|
|
852
852
|
return `url(#${i})`;
|
|
853
853
|
}
|
|
854
854
|
getShadowFilterUrl(e) {
|
|
855
|
-
let t =
|
|
855
|
+
let t = N(Math.max(e.blur / 2.5, .25)), n = N(e.offsetX), r = N(e.offsetY), i = [
|
|
856
856
|
t,
|
|
857
857
|
n,
|
|
858
858
|
r
|
|
859
859
|
].join(","), a = this.#a.get(i);
|
|
860
860
|
if (!a) {
|
|
861
861
|
a = "shadow-" + this.#x++;
|
|
862
|
-
let e =
|
|
862
|
+
let e = F("filter", {
|
|
863
863
|
id: a,
|
|
864
864
|
x: 0,
|
|
865
865
|
y: 0,
|
|
866
|
-
width:
|
|
867
|
-
height:
|
|
866
|
+
width: N(this.width),
|
|
867
|
+
height: N(this.height),
|
|
868
868
|
filterUnits: "userSpaceOnUse",
|
|
869
869
|
primitiveUnits: "userSpaceOnUse",
|
|
870
870
|
"color-interpolation-filters": "sRGB"
|
|
871
871
|
});
|
|
872
|
-
e.appendChild(
|
|
872
|
+
e.appendChild(F("feGaussianBlur", {
|
|
873
873
|
in: "SourceGraphic",
|
|
874
874
|
stdDeviation: t,
|
|
875
875
|
result: "blur"
|
|
876
|
-
})), e.appendChild(
|
|
876
|
+
})), e.appendChild(F("feOffset", {
|
|
877
877
|
in: "blur",
|
|
878
878
|
dx: n,
|
|
879
879
|
dy: r,
|
|
@@ -886,12 +886,12 @@ var q = class extends s {
|
|
|
886
886
|
let t = this.#o.get(e);
|
|
887
887
|
if (!t) {
|
|
888
888
|
t = "shadow-clip-" + this.#y++;
|
|
889
|
-
let n =
|
|
889
|
+
let n = F("clipPath", {
|
|
890
890
|
id: t,
|
|
891
891
|
clipPathUnits: "userSpaceOnUse"
|
|
892
892
|
});
|
|
893
|
-
n.appendChild(
|
|
894
|
-
d: `M 0 0 V ${
|
|
893
|
+
n.appendChild(F("path", {
|
|
894
|
+
d: `M 0 0 V ${N(this.height)} H ${N(this.width)} V 0 Z ${e}`,
|
|
895
895
|
"clip-rule": "evenodd",
|
|
896
896
|
"fill-rule": "evenodd"
|
|
897
897
|
})), this.#t.appendChild(n), this.#o.set(e, t);
|
|
@@ -902,68 +902,68 @@ var q = class extends s {
|
|
|
902
902
|
let t = JSON.stringify([
|
|
903
903
|
e.type,
|
|
904
904
|
e.fill,
|
|
905
|
-
|
|
905
|
+
M(e.fillOpacity),
|
|
906
906
|
e.stroke,
|
|
907
|
-
|
|
908
|
-
|
|
907
|
+
M(e.strokeOpacity),
|
|
908
|
+
M(e.strokeWidth)
|
|
909
909
|
]), n = this.#s.get(t);
|
|
910
|
-
return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(
|
|
910
|
+
return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(Oe(n, e)), this.#s.set(t, n)), `url(#${n})`;
|
|
911
911
|
}
|
|
912
912
|
getLegendGradientUrl(e) {
|
|
913
|
-
let t = "legend-gradient-" + this.#C++, n =
|
|
913
|
+
let t = "legend-gradient-" + this.#C++, n = F("linearGradient", {
|
|
914
914
|
id: t,
|
|
915
915
|
gradientUnits: "userSpaceOnUse",
|
|
916
|
-
x1:
|
|
917
|
-
y1:
|
|
918
|
-
x2:
|
|
919
|
-
y2:
|
|
916
|
+
x1: N(e.x1),
|
|
917
|
+
y1: N(e.y1),
|
|
918
|
+
x2: N(e.x2),
|
|
919
|
+
y2: N(e.y2)
|
|
920
920
|
});
|
|
921
|
-
for (let t of e.stops) n.appendChild(
|
|
922
|
-
offset:
|
|
921
|
+
for (let t of e.stops) n.appendChild(F("stop", {
|
|
922
|
+
offset: M(t.offset),
|
|
923
923
|
"stop-color": t.color
|
|
924
924
|
}));
|
|
925
925
|
return this.#t.appendChild(n), `url(#${t})`;
|
|
926
926
|
}
|
|
927
927
|
getLinkArcFadeMaskUrl(e) {
|
|
928
|
-
let t =
|
|
928
|
+
let t = x(e.p1, e.p4, e.distances);
|
|
929
929
|
if (!t) return;
|
|
930
930
|
let n = this.#c.get(t.key);
|
|
931
931
|
if (!n) {
|
|
932
932
|
n = "link-arc-fade-" + this.#b++;
|
|
933
|
-
let { gradient: e, mask: r } =
|
|
933
|
+
let { gradient: e, mask: r } = Ae(n, this.width, this.height, t);
|
|
934
934
|
this.#t.appendChild(e), this.#t.appendChild(r), this.#c.set(t.key, n);
|
|
935
935
|
}
|
|
936
936
|
return `url(#${n})`;
|
|
937
937
|
}
|
|
938
|
-
getViewportEdgeFadeMaskUrl(
|
|
939
|
-
let
|
|
940
|
-
if (!
|
|
941
|
-
let r =
|
|
938
|
+
getViewportEdgeFadeMaskUrl(t) {
|
|
939
|
+
let n = Object.entries(t).filter(([, e]) => e.width > 0 && Number.isFinite(e.distance));
|
|
940
|
+
if (!n.length) return;
|
|
941
|
+
let r = e(this.#n);
|
|
942
942
|
if (!r) throw Error("No current view in SVG rendering context.");
|
|
943
943
|
let i = this.#i.get(r.view);
|
|
944
944
|
if (!i) {
|
|
945
945
|
i = "edge-fade-" + this.#b++;
|
|
946
|
-
let e =
|
|
946
|
+
let e = N(this.width), t = N(this.height), a = F("mask", {
|
|
947
947
|
id: i,
|
|
948
948
|
x: 0,
|
|
949
949
|
y: 0,
|
|
950
950
|
width: e,
|
|
951
|
-
height:
|
|
951
|
+
height: t,
|
|
952
952
|
maskUnits: "userSpaceOnUse",
|
|
953
953
|
maskContentUnits: "userSpaceOnUse",
|
|
954
954
|
"mask-type": "luminance"
|
|
955
955
|
});
|
|
956
|
-
a.appendChild(
|
|
956
|
+
a.appendChild(F("rect", {
|
|
957
957
|
width: e,
|
|
958
|
-
height:
|
|
958
|
+
height: t,
|
|
959
959
|
fill: "white"
|
|
960
960
|
}));
|
|
961
|
-
for (let [o, s] of
|
|
962
|
-
let
|
|
963
|
-
this.#t.appendChild(c), a.appendChild(
|
|
961
|
+
for (let [o, s] of n) {
|
|
962
|
+
let n = i + "-" + o, c = Fe(n, o, s, r.coords);
|
|
963
|
+
this.#t.appendChild(c), a.appendChild(F("rect", {
|
|
964
964
|
width: e,
|
|
965
|
-
height:
|
|
966
|
-
fill: `url(#${
|
|
965
|
+
height: t,
|
|
966
|
+
fill: `url(#${n})`
|
|
967
967
|
}));
|
|
968
968
|
}
|
|
969
969
|
this.#t.appendChild(a), this.#i.set(r.view, i);
|
|
@@ -977,52 +977,52 @@ var q = class extends s {
|
|
|
977
977
|
return Array.from(this.#l);
|
|
978
978
|
}
|
|
979
979
|
get currentNode() {
|
|
980
|
-
return
|
|
980
|
+
return e(this.#n)?.node ?? this.#e;
|
|
981
981
|
}
|
|
982
982
|
get currentCoords() {
|
|
983
|
-
let
|
|
984
|
-
if (!
|
|
985
|
-
return
|
|
983
|
+
let t = e(this.#n);
|
|
984
|
+
if (!t) throw Error("No current view in SVG rendering context.");
|
|
985
|
+
return t.coords;
|
|
986
986
|
}
|
|
987
987
|
};
|
|
988
|
-
function
|
|
988
|
+
function je(e, t) {
|
|
989
989
|
let n = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
990
990
|
return `${/^[A-Za-z_]/.test(n) ? n : n ? "view-" + n : "view"}-${t}`;
|
|
991
991
|
}
|
|
992
992
|
function J(e, t) {
|
|
993
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);
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function Me(e) {
|
|
996
996
|
let [t, ...n] = Array.from(e), r = t;
|
|
997
997
|
for (; n.some((e) => !r.contains(e));) r = r.parentNode;
|
|
998
998
|
return r;
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1000
|
+
function Ne(e, t) {
|
|
1001
1001
|
let n = e;
|
|
1002
1002
|
for (; n.parentNode != t;) n = n.parentNode;
|
|
1003
1003
|
return n;
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1005
|
+
function Pe(e, t) {
|
|
1006
1006
|
let n = e;
|
|
1007
1007
|
for (; n != t && n.matches("g[data-view-path]") && Array.from(n.children).every((e) => e.tagName == "title");) {
|
|
1008
1008
|
let e = n.parentNode;
|
|
1009
1009
|
n.remove(), n = e;
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
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 =
|
|
1012
|
+
function Fe(e, t, n, r) {
|
|
1013
|
+
let i = t == "top" ? r.y + n.distance : t == "right" ? r.x2 - n.distance : t == "bottom" ? r.y2 - n.distance : r.x + n.distance, a = t == "left" || t == "right", o = i + (t == "top" || t == "left" ? 1 : -1) * n.width, s = F("linearGradient", {
|
|
1014
1014
|
id: e,
|
|
1015
1015
|
gradientUnits: "userSpaceOnUse",
|
|
1016
|
-
x1:
|
|
1017
|
-
y1:
|
|
1018
|
-
x2:
|
|
1019
|
-
y2:
|
|
1016
|
+
x1: N(a ? i : 0),
|
|
1017
|
+
y1: N(a ? 0 : i),
|
|
1018
|
+
x2: N(a ? o : 0),
|
|
1019
|
+
y2: N(a ? 0 : o)
|
|
1020
1020
|
});
|
|
1021
|
-
return s.appendChild(
|
|
1021
|
+
return s.appendChild(F("stop", {
|
|
1022
1022
|
offset: 0,
|
|
1023
1023
|
"stop-color": "black",
|
|
1024
1024
|
"stop-opacity": 1
|
|
1025
|
-
})), s.appendChild(
|
|
1025
|
+
})), s.appendChild(F("stop", {
|
|
1026
1026
|
offset: 1,
|
|
1027
1027
|
"stop-color": "black",
|
|
1028
1028
|
"stop-opacity": 0
|
|
@@ -1030,22 +1030,24 @@ function Me(e, t, n, r) {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
//#endregion
|
|
1032
1032
|
//#region ../core/src/rendering/svg/index.js
|
|
1033
|
-
function Y({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "white" }) {
|
|
1034
|
-
let
|
|
1033
|
+
function Y({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "white", textMetrics: i = e.context.textMetrics }) {
|
|
1034
|
+
let a = new q({ picking: !1 }, {
|
|
1035
1035
|
width: t,
|
|
1036
1036
|
height: n,
|
|
1037
|
-
background: r
|
|
1037
|
+
background: r,
|
|
1038
|
+
textMetrics: i
|
|
1038
1039
|
});
|
|
1039
|
-
return c(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(
|
|
1040
|
-
svg:
|
|
1041
|
-
warnings:
|
|
1040
|
+
return c(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(a), {
|
|
1041
|
+
svg: a.getSvg(),
|
|
1042
|
+
warnings: a.getWarnings()
|
|
1042
1043
|
};
|
|
1043
1044
|
}
|
|
1044
|
-
function
|
|
1045
|
+
async function Ie({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
|
|
1045
1046
|
let r = new q({ picking: !1 }, {
|
|
1046
1047
|
width: t,
|
|
1047
1048
|
height: n,
|
|
1048
|
-
background: null
|
|
1049
|
+
background: null,
|
|
1050
|
+
textMetrics: await Z(e)
|
|
1049
1051
|
});
|
|
1050
1052
|
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]) => ({
|
|
1051
1053
|
viewName: e.unitView.name,
|
|
@@ -1055,36 +1057,41 @@ function Ne({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
|
|
|
1055
1057
|
instanceCount: t
|
|
1056
1058
|
})).filter((e) => e.instanceCount > 0) };
|
|
1057
1059
|
}
|
|
1058
|
-
async function
|
|
1059
|
-
let t = e.
|
|
1060
|
-
return t ? ($(t), e.rasterizeSvgRuns ? Z({
|
|
1060
|
+
async function Le(e) {
|
|
1061
|
+
let t = await Z(e.viewRoot), n = {
|
|
1061
1062
|
...e,
|
|
1063
|
+
textMetrics: t
|
|
1064
|
+
}, r = e.rasterization;
|
|
1065
|
+
return r ? ($(r), e.rasterizeSvgRuns ? X({
|
|
1066
|
+
...n,
|
|
1062
1067
|
rasterizeSvgRuns: e.rasterizeSvgRuns,
|
|
1063
|
-
maxVectorInstances:
|
|
1064
|
-
pixelRatio:
|
|
1065
|
-
}) : Q(
|
|
1066
|
-
...Y(
|
|
1068
|
+
maxVectorInstances: r.maxVectorInstances,
|
|
1069
|
+
pixelRatio: r.pixelRatio
|
|
1070
|
+
}) : Q(n)) : {
|
|
1071
|
+
...Y(n),
|
|
1067
1072
|
rasterized: []
|
|
1068
1073
|
};
|
|
1069
1074
|
}
|
|
1070
|
-
async function
|
|
1071
|
-
$({
|
|
1075
|
+
async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHeight: r, background: i = "white", maxVectorInstances: s, pixelRatio: l = 2, textMetrics: u }) {
|
|
1076
|
+
u ??= await Z(e), $({
|
|
1072
1077
|
maxVectorInstances: s,
|
|
1073
1078
|
pixelRatio: l
|
|
1074
1079
|
});
|
|
1075
|
-
let
|
|
1080
|
+
let d = new q({ picking: !1 }, {
|
|
1076
1081
|
width: n,
|
|
1077
1082
|
height: r,
|
|
1078
1083
|
background: i,
|
|
1079
|
-
maxVectorInstances: s
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
+
maxVectorInstances: s,
|
|
1085
|
+
textMetrics: u
|
|
1086
|
+
}), f = o.create(0, 0, n, r), p = c(e, f, { renderingOptions: { firstFacet: !0 } });
|
|
1087
|
+
d.beginInstanceCounting(), p.collectRenderCommands(d), d.endInstanceCounting(), p.collectRenderCommands(d);
|
|
1088
|
+
let m = d.getRasterRuns();
|
|
1089
|
+
if (m.length) try {
|
|
1084
1090
|
await t({
|
|
1085
|
-
runs:
|
|
1091
|
+
runs: m,
|
|
1086
1092
|
viewRoot: e,
|
|
1087
|
-
layoutResult:
|
|
1093
|
+
layoutResult: p,
|
|
1094
|
+
textMetrics: u,
|
|
1088
1095
|
logicalWidth: n,
|
|
1089
1096
|
logicalHeight: r,
|
|
1090
1097
|
pixelRatio: l
|
|
@@ -1094,14 +1101,15 @@ async function Z({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
|
|
|
1094
1101
|
viewRoot: e,
|
|
1095
1102
|
logicalWidth: n,
|
|
1096
1103
|
logicalHeight: r,
|
|
1097
|
-
background: i
|
|
1104
|
+
background: i,
|
|
1105
|
+
textMetrics: u
|
|
1098
1106
|
});
|
|
1099
1107
|
throw t;
|
|
1100
1108
|
}
|
|
1101
1109
|
return {
|
|
1102
|
-
svg:
|
|
1103
|
-
warnings:
|
|
1104
|
-
rasterized:
|
|
1110
|
+
svg: d.getSvg(),
|
|
1111
|
+
warnings: d.getWarnings(),
|
|
1112
|
+
rasterized: m.map((e) => ({
|
|
1105
1113
|
targets: e.targets.map((e) => ({
|
|
1106
1114
|
markType: e.mark.getType(),
|
|
1107
1115
|
instanceCount: e.instanceCount
|
|
@@ -1112,6 +1120,11 @@ async function Z({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
|
|
|
1112
1120
|
}))
|
|
1113
1121
|
};
|
|
1114
1122
|
}
|
|
1123
|
+
async function Z(e) {
|
|
1124
|
+
if (!document.fonts) return e.context.textMetrics;
|
|
1125
|
+
let t = te(document);
|
|
1126
|
+
return await re(t, e), t;
|
|
1127
|
+
}
|
|
1115
1128
|
function Q(e) {
|
|
1116
1129
|
let t = Y(e);
|
|
1117
1130
|
return {
|
|
@@ -1125,4 +1138,4 @@ function $(e) {
|
|
|
1125
1138
|
if (e.pixelRatio != null && (!Number.isFinite(e.pixelRatio) || e.pixelRatio <= 0)) throw RangeError("SVG raster pixelRatio must be positive.");
|
|
1126
1139
|
}
|
|
1127
1140
|
//#endregion
|
|
1128
|
-
export {
|
|
1141
|
+
export { Ie as analyzeSvgExport, X as createRasterizedSvg, Y as createSvg, Le as createSvgExport };
|