@genome-spy/app 0.88.1 → 0.89.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-BUcXm-JC.js} +5544 -6449
- package/dist/agentApi.es.js +3328 -4255
- package/dist/agentShared.es.js +9 -9
- package/dist/{canvas2d-BVQ7-2eJ.js → canvas2d-CGuVGvQk.js} +117 -106
- package/dist/{canvas2d-D7SZK3xv.js → canvas2d-DgF0kstG.js} +99 -88
- package/dist/{canvasSizeHelper-7h_8rOcx.js → canvasSizeHelper-foL2YvGL.js} +15 -8
- package/dist/{clipOptions-DTMcB_9z.js → clipOptions-8BPf0WMZ.js} +1013 -755
- package/dist/{clipOptions-BWHr3aTa.js → clipOptions-DBJX_W31.js} +1033 -775
- package/dist/{debug-CVpoEOWx.js → debug-BEWbYuZD.js} +2 -2
- package/dist/{debug-DYAMZZKl.js → debug-DQj_7mFm.js} +2 -2
- package/dist/index.es.js +65 -65
- package/dist/index.js +406 -362
- package/dist/{indexer-DAH_ruVn.js → indexer-Cdt_U05k.js} +1 -1
- package/dist/{indexer-CXjZDo2Q.js → indexer-D8Bgkkb8.js} +1 -1
- package/dist/order-BPOzLe80.js +1056 -0
- package/dist/order-DIxlclRN.js +1056 -0
- package/dist/rasterExport-Bl6w9t3J.js +51 -0
- package/dist/rasterExport-DRvNAH-r.js +51 -0
- package/dist/rasterization-D0tOoKu_.js +62 -0
- package/dist/rectangle-DE98gIxF.js +108 -0
- package/dist/{renderCanvas2D-DxturTEW.js → renderCanvas2D-Ct95auF3.js} +60 -59
- package/dist/{renderCanvas2D-DtcJjqpB.js → renderCanvas2D-LdEYFnRo.js} +71 -70
- package/dist/schema.json +588 -116
- package/dist/{svg-CyrLfa9e.js → svg-Ag36-h_I.js} +394 -382
- package/dist/{svg-SDJMzL--.js → svg-pkTPD4bv.js} +368 -356
- package/dist/{svgRasterizer-f7DJ3UO0.js → svgRasterizer-CksK4QTB.js} +6 -5
- package/dist/{svgRasterizer-mWK7HTkx.js → svgRasterizer-DrtJ9nLk.js} +6 -5
- package/dist/{vega-scale-CypF85iS.js → vega-scale-BJaDSHBJ.js} +891 -959
- package/dist/{vega-scale-DLKCwWRs.js → vega-scale-BWBFykuI.js} +692 -760
- package/dist/{viewIdentityRegistry-DIDo44XQ.js → viewIdentityRegistry-B-snqI3y.js} +1 -1
- package/dist/{viewIdentityRegistry-Dl-vMN9I.js → viewIdentityRegistry-BvCJajXG.js} +1 -1
- package/dist/{viewSelectors-CymbZyE6.js → viewSelectors-BlvzvG-z.js} +445 -380
- package/dist/{viewSelectors-DNiDip5e.js → viewSelectors-C5q3qBiR.js} +364 -299
- package/dist/{viewUtils-BrJLIj2o.js → viewUtils-C3vBtSvE.js} +1714 -1689
- package/dist/{webgl-tZfZ8y3q.js → webgl-CZX2pe5v.js} +2319 -972
- package/dist/{webgl-CTJt7jQd.js → webgl-CexXSw_I.js} +2371 -1024
- package/package.json +5 -5
- 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 { o as e, s as t, u as n } from "./clipOptions-
|
|
2
|
-
import { b as r } from "./viewSelectors-
|
|
3
|
-
import { v as i } from "./vega-scale-
|
|
4
|
-
import { t as a } from "./rasterization-
|
|
5
|
-
import { t as o } from "./rectangle-
|
|
1
|
+
import { o as e, s as t, u as n } from "./clipOptions-8BPf0WMZ.js";
|
|
2
|
+
import { b as r } from "./viewSelectors-BlvzvG-z.js";
|
|
3
|
+
import { v as i } from "./vega-scale-BWBFykuI.js";
|
|
4
|
+
import { t as a } from "./rasterization-D0tOoKu_.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 re, r as ie, s as ae, t as oe, u as se, v as ce, w as le, x as ue, y as de } from "./order-BPOzLe80.js";
|
|
8
|
+
import { n as j, t as M } from "./svgNumber-DNxESJQB.js";
|
|
9
9
|
//#region ../core/src/rendering/svg/svgElement.js
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let n = document.createElementNS(
|
|
10
|
+
var N = "http://www.w3.org/2000/svg";
|
|
11
|
+
function P(e, t) {
|
|
12
|
+
let n = document.createElementNS(N, e);
|
|
13
13
|
if (t) for (let [e, r] of Object.entries(t)) n.setAttribute(e, "" + r);
|
|
14
14
|
return n;
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region ../core/src/rendering/svg/svgAttributes.js
|
|
18
|
-
function
|
|
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 F(e, t) {
|
|
19
|
+
let n = Object.entries(t).filter(([t, n]) => n.encoder.constant ? (e.setAttribute(t, "" + I(n, {})), !1) : !0);
|
|
20
|
+
return (e) => Object.fromEntries(n.map(([t, n]) => [t, I(n, e)]));
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function I(e, t) {
|
|
23
23
|
let n = e.encoder(t);
|
|
24
24
|
return e.transform ? e.transform(n) : "" + n;
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region ../core/src/rendering/svg/renderers/arrow.js
|
|
28
|
-
function
|
|
29
|
-
let n = e, { coords: r, data: i, group: a, viewOpacity: o, visibleBounds: s } = t, c = n.encoders,
|
|
28
|
+
function fe(e, t) {
|
|
29
|
+
let n = e, { coords: r, data: i, group: a, viewOpacity: o, visibleBounds: s } = t, c = n.encoders, u = F(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,79 +45,79 @@ function de(e, t) {
|
|
|
45
45
|
},
|
|
46
46
|
"stroke-width": {
|
|
47
47
|
encoder: c.strokeWidth,
|
|
48
|
-
transform: (e) =>
|
|
48
|
+
transform: (e) => M(+e)
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
a.setAttribute("stroke-linejoin", "miter");
|
|
52
|
-
let
|
|
53
|
-
return le(n,
|
|
52
|
+
let d = v(n);
|
|
53
|
+
return le(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 "${
|
|
61
|
-
d: e.boundaryLoops.map(
|
|
62
|
-
...
|
|
60
|
+
t.countOnly || (e.headShapeFallback && t.warn(`SVG export rendered unsupported arrow headShape "${d.headShape}" as a triangle.`), a.appendChild(P("path", {
|
|
61
|
+
d: e.boundaryLoops.map(pe).join(" "),
|
|
62
|
+
...u(e.datum)
|
|
63
63
|
})));
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
function fe(e) {
|
|
67
|
-
return `M ${e.map(pe).join(" L ")} Z`;
|
|
68
|
-
}
|
|
69
66
|
function pe(e) {
|
|
70
|
-
return
|
|
67
|
+
return `M ${e.map(me).join(" L ")} Z`;
|
|
68
|
+
}
|
|
69
|
+
function me(e) {
|
|
70
|
+
return `${M(e.x)} ${M(e.y)}`;
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region ../core/src/rendering/svg/renderers/link.js
|
|
74
|
-
function
|
|
75
|
-
let n = e, r =
|
|
74
|
+
function he(e, t) {
|
|
75
|
+
let n = e, r = y(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, u = n.encoders, d = ue(n, r.shape, t.secondOrderPass), f = F(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) => M(+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 ce(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 ? P("g", { mask: l }) : o, l && o.appendChild(p)), p.appendChild(P("path", {
|
|
104
|
+
d: `M ${L(r)} C ${L(i)} ${L(a)} ${L(s)}`,
|
|
105
105
|
...c
|
|
106
106
|
}));
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
return e.map(
|
|
109
|
+
function L(e) {
|
|
110
|
+
return e.map(M).join(" ");
|
|
111
111
|
}
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region ../core/src/rendering/svg/renderers/point.js
|
|
114
|
-
function
|
|
114
|
+
function R(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 = F(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) => M(+e)
|
|
137
137
|
}
|
|
138
|
-
}),
|
|
139
|
-
return
|
|
138
|
+
}), u = _e();
|
|
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": M(m) } : {},
|
|
144
|
+
...h ? ve(s, n, o) : {}
|
|
145
|
+
}, _ = ge(r, l, d, f, g, u);
|
|
146
|
+
_ ? (p && _.setAttribute("transform", `rotate(${M(p)} ${M(l)} ${M(d)})`), a.appendChild(_)) : (t.warn(`SVG export rendered unsupported point shape "${r}" as a circle.`), a.appendChild(P("circle", {
|
|
147
|
+
cx: M(l),
|
|
148
|
+
cy: M(d),
|
|
149
|
+
r: M(f),
|
|
150
150
|
...g
|
|
151
151
|
})));
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
let o =
|
|
156
|
-
if (e == "circle") return
|
|
154
|
+
function ge(e, t, n, r, i, a) {
|
|
155
|
+
let o = M(t), s = M(n), c = M(r);
|
|
156
|
+
if (e == "circle") return P("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 P("rect", {
|
|
163
|
+
x: M(t - r),
|
|
164
|
+
y: M(n - r),
|
|
165
|
+
width: M(r * 2),
|
|
166
|
+
height: M(r * 2),
|
|
167
167
|
...i
|
|
168
168
|
});
|
|
169
169
|
let l = a.build(e, t, n, r);
|
|
170
|
-
return l ?
|
|
170
|
+
return l ? P("path", {
|
|
171
171
|
d: l,
|
|
172
172
|
...i
|
|
173
173
|
}) : void 0;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
let e = "", t = (e, t) => `${
|
|
175
|
+
function _e() {
|
|
176
|
+
let e = "", t = (e, t) => `${M(e)} ${M(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 ve(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": M(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 ye(e, t) {
|
|
204
|
+
let n = e, r = w(n), { shadow: i, hatch: a } = r, { group: o, viewOpacity: s } = t, c = n.encoders, u = F(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,248 +220,246 @@ function he(e, t) {
|
|
|
220
220
|
},
|
|
221
221
|
"stroke-width": {
|
|
222
222
|
encoder: c.strokeWidth,
|
|
223
|
-
transform: (e) =>
|
|
223
|
+
transform: (e) => M(+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: j(i.opacity * s),
|
|
231
231
|
filter: t.getShadowFilterUrl(i)
|
|
232
232
|
} : null;
|
|
233
|
-
return
|
|
233
|
+
return re(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: j(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
|
-
let e =
|
|
247
|
+
let e = z(r, i, p, m, h, {
|
|
248
248
|
...f,
|
|
249
|
-
"stroke-width":
|
|
249
|
+
"stroke-width": M(_)
|
|
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 =
|
|
253
|
+
let n = _ / 2, a = Object.fromEntries(Object.entries(h).map(([e, t]) => [e, t + n])), s = B(r - n, i - n, p + n * 2, m + n * 2, a), c = P("g", { "clip-path": t.getShadowClipPathUrl(s) });
|
|
254
254
|
c.appendChild(e), o.appendChild(c);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
o.appendChild(
|
|
257
|
+
o.appendChild(z(r, i, p, m, h, b));
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
|
-
function
|
|
261
|
-
if (
|
|
262
|
-
let o = i.topLeft, s =
|
|
263
|
-
return
|
|
260
|
+
function z(e, t, n, r, i, a) {
|
|
261
|
+
if (be(i)) {
|
|
262
|
+
let o = i.topLeft, s = M(e), c = M(t), l = M(e + n), u = M(t + r);
|
|
263
|
+
return P("rect", {
|
|
264
264
|
x: s,
|
|
265
265
|
y: c,
|
|
266
|
-
width:
|
|
267
|
-
height:
|
|
266
|
+
width: M(l - s),
|
|
267
|
+
height: M(u - c),
|
|
268
268
|
...o ? {
|
|
269
|
-
rx:
|
|
270
|
-
ry:
|
|
269
|
+
rx: M(o),
|
|
270
|
+
ry: M(o)
|
|
271
271
|
} : {},
|
|
272
272
|
...a
|
|
273
273
|
});
|
|
274
|
-
} else return
|
|
275
|
-
d:
|
|
274
|
+
} else return P("path", {
|
|
275
|
+
d: B(e, t, n, r, i),
|
|
276
276
|
...a
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function be(e) {
|
|
280
280
|
return Object.values(e).every((t) => t == e.topLeft);
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function B(e, t, n, r, i) {
|
|
283
283
|
let a = e + n, o = t + r, { topLeft: s, topRight: c, bottomRight: l, bottomLeft: u } = i;
|
|
284
284
|
return [
|
|
285
|
-
`M ${
|
|
286
|
-
`H ${
|
|
287
|
-
|
|
288
|
-
`V ${
|
|
289
|
-
|
|
290
|
-
`H ${
|
|
291
|
-
|
|
292
|
-
`V ${
|
|
293
|
-
|
|
285
|
+
`M ${H(e + s, t)}`,
|
|
286
|
+
`H ${M(a - c)}`,
|
|
287
|
+
V(c, a, t + c, a, t),
|
|
288
|
+
`V ${M(o - l)}`,
|
|
289
|
+
V(l, a - l, o, a, o),
|
|
290
|
+
`H ${M(e + u)}`,
|
|
291
|
+
V(u, e, o - u, e, o),
|
|
292
|
+
`V ${M(t + s)}`,
|
|
293
|
+
V(s, e + s, t, e, t),
|
|
294
294
|
"Z"
|
|
295
295
|
].join(" ");
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
return e ? `A ${
|
|
297
|
+
function V(e, t, n, r, i) {
|
|
298
|
+
return e ? `A ${M(e)} ${M(e)} 0 0 1 ${H(t, n)}` : `L ${H(r, i)}`;
|
|
299
299
|
}
|
|
300
|
-
function
|
|
301
|
-
return `${
|
|
300
|
+
function H(e, t) {
|
|
301
|
+
return `${M(e)} ${M(t)}`;
|
|
302
302
|
}
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region ../core/src/rendering/svg/renderers/rule.js
|
|
305
|
-
function
|
|
306
|
-
let n = e, r =
|
|
305
|
+
function U(e, t) {
|
|
306
|
+
let n = e, r = se(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, u = n.encoders, d = n.properties.strokeDash, f = F(o, {
|
|
307
307
|
stroke: {
|
|
308
|
-
encoder:
|
|
309
|
-
transform:
|
|
308
|
+
encoder: u.color,
|
|
309
|
+
transform: l
|
|
310
310
|
},
|
|
311
311
|
"stroke-opacity": {
|
|
312
|
-
encoder:
|
|
312
|
+
encoder: u.opacity,
|
|
313
313
|
transform: (e) => +e * s
|
|
314
314
|
},
|
|
315
315
|
"stroke-width": {
|
|
316
|
-
encoder:
|
|
317
|
-
transform: (e) =>
|
|
316
|
+
encoder: u.size,
|
|
317
|
+
transform: (e) => M(+e)
|
|
318
318
|
}
|
|
319
319
|
});
|
|
320
|
-
return o.setAttribute("stroke-linecap", "" + n.properties.strokeCap),
|
|
320
|
+
return o.setAttribute("stroke-linecap", "" + n.properties.strokeCap), d && (o.setAttribute("stroke-dasharray", d.map(M).join(" ")), o.setAttribute("stroke-dashoffset", "" + M(n.properties.strokeDashOffset))), C(n, r, {
|
|
321
321
|
coords: i,
|
|
322
322
|
data: a,
|
|
323
323
|
visibleBounds: c
|
|
324
324
|
}, (e) => {
|
|
325
|
-
t.countOnly || o.appendChild(
|
|
326
|
-
x1:
|
|
327
|
-
y1:
|
|
328
|
-
x2:
|
|
329
|
-
y2:
|
|
325
|
+
t.countOnly || o.appendChild(P("line", {
|
|
326
|
+
x1: M(e.x1),
|
|
327
|
+
y1: M(e.y1),
|
|
328
|
+
x2: M(e.x2),
|
|
329
|
+
y2: M(e.y2),
|
|
330
330
|
...f(e.datum)
|
|
331
331
|
}));
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
334
|
//#endregion
|
|
335
335
|
//#region ../core/src/rendering/svg/renderers/text.js
|
|
336
|
-
function
|
|
337
|
-
let n = e, r = n.properties, i =
|
|
336
|
+
function xe(e, t) {
|
|
337
|
+
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 = F(d, {
|
|
338
338
|
fill: {
|
|
339
|
-
encoder:
|
|
340
|
-
transform:
|
|
339
|
+
encoder: h.color,
|
|
340
|
+
transform: l
|
|
341
341
|
},
|
|
342
342
|
"fill-opacity": {
|
|
343
|
-
encoder:
|
|
344
|
-
transform: (e) => +e *
|
|
343
|
+
encoder: h.opacity,
|
|
344
|
+
transform: (e) => +e * f
|
|
345
345
|
},
|
|
346
346
|
"font-size": {
|
|
347
|
-
encoder:
|
|
348
|
-
transform: (e) =>
|
|
347
|
+
encoder: h.size,
|
|
348
|
+
transform: (e) => M(+e)
|
|
349
349
|
}
|
|
350
350
|
});
|
|
351
|
-
|
|
352
|
-
let
|
|
351
|
+
d.setAttribute("font-family", b(r.font)), d.setAttribute("font-style", r.fontStyle ?? "normal"), d.setAttribute("font-weight", "" + ae(r.fontWeight ?? "normal")), d.setAttribute("text-anchor", Se[s.align]);
|
|
352
|
+
let _ = {
|
|
353
353
|
top: {
|
|
354
|
-
width:
|
|
355
|
-
distance:
|
|
354
|
+
width: k(n, r.viewportEdgeFadeWidthTop),
|
|
355
|
+
distance: k(n, r.viewportEdgeFadeDistanceTop)
|
|
356
356
|
},
|
|
357
357
|
right: {
|
|
358
|
-
width:
|
|
359
|
-
distance:
|
|
358
|
+
width: k(n, r.viewportEdgeFadeWidthRight),
|
|
359
|
+
distance: k(n, r.viewportEdgeFadeDistanceRight)
|
|
360
360
|
},
|
|
361
361
|
bottom: {
|
|
362
|
-
width:
|
|
363
|
-
distance:
|
|
362
|
+
width: k(n, r.viewportEdgeFadeWidthBottom),
|
|
363
|
+
distance: k(n, r.viewportEdgeFadeDistanceBottom)
|
|
364
364
|
},
|
|
365
365
|
left: {
|
|
366
|
-
width:
|
|
367
|
-
distance:
|
|
366
|
+
width: k(n, r.viewportEdgeFadeWidthLeft),
|
|
367
|
+
distance: k(n, r.viewportEdgeFadeDistanceLeft)
|
|
368
368
|
}
|
|
369
|
-
},
|
|
370
|
-
coords:
|
|
371
|
-
data:
|
|
372
|
-
visibleBounds:
|
|
373
|
-
anchorCullBounds:
|
|
369
|
+
}, v = A(n, s, {
|
|
370
|
+
coords: c,
|
|
371
|
+
data: u,
|
|
372
|
+
visibleBounds: p,
|
|
373
|
+
anchorCullBounds: m,
|
|
374
|
+
fontMeasurement: a,
|
|
375
|
+
measureLogoInkBounds: o
|
|
374
376
|
}, (e) => {
|
|
375
377
|
if (t.countOnly) return;
|
|
376
|
-
if (e.
|
|
378
|
+
if (e.logoTransform) {
|
|
377
379
|
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 =
|
|
380
|
+
let n = [`translate(${M(e.x)} ${M(e.y)})`];
|
|
381
|
+
e.angle && n.push(`rotate(${M(e.angle)})`), (e.dx || e.dy) && n.push(`translate(${M(e.dx)} ${M(e.dy)})`), n.push(`scale(${M(e.logoTransform.scaleX)} ${M(e.logoTransform.scaleY)})`), n.push(`translate(${M(-e.logoTransform.originX)} ${M(-e.logoTransform.originY)})`);
|
|
382
|
+
let r = P("text", {
|
|
381
383
|
x: 0,
|
|
382
384
|
y: 0,
|
|
383
|
-
|
|
384
|
-
"text-anchor": "middle",
|
|
385
|
-
lengthAdjust: "spacingAndGlyphs",
|
|
386
|
-
textLength: 1,
|
|
385
|
+
"text-anchor": "start",
|
|
387
386
|
transform: n.join(" "),
|
|
388
|
-
...
|
|
389
|
-
"font-size":
|
|
387
|
+
...g(e.datum),
|
|
388
|
+
"font-size": e.size
|
|
390
389
|
});
|
|
391
|
-
r.textContent = e.text,
|
|
390
|
+
r.textContent = e.text, d.appendChild(r);
|
|
392
391
|
return;
|
|
393
392
|
}
|
|
394
|
-
let n =
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
...
|
|
402
|
-
|
|
403
|
-
...e.fadeOpacity == 1 ? {} : { opacity: k(e.fadeOpacity) }
|
|
393
|
+
let n = [`translate(${M(e.x)} ${M(e.y)})`];
|
|
394
|
+
e.angle && n.push(`rotate(${M(e.angle)})`), (e.dx || e.dy) && n.push(`translate(${M(e.dx)} ${M(e.dy)})`), e.scale != 1 && n.push(`scale(${M(e.scale)})`);
|
|
395
|
+
let r = P("text", {
|
|
396
|
+
x: 0,
|
|
397
|
+
y: 0,
|
|
398
|
+
dy: M(ne(s.baseline, e.size)),
|
|
399
|
+
...g(e.datum),
|
|
400
|
+
...e.fadeOpacity == 1 ? {} : { opacity: j(e.fadeOpacity) },
|
|
401
|
+
transform: n.join(" ")
|
|
404
402
|
});
|
|
405
|
-
|
|
403
|
+
r.textContent = e.text, d.appendChild(r);
|
|
406
404
|
});
|
|
407
|
-
if (!t.countOnly &&
|
|
408
|
-
let e = t.getViewportEdgeFadeMaskUrl(
|
|
409
|
-
e &&
|
|
405
|
+
if (!t.countOnly && d.childElementCount > 0) {
|
|
406
|
+
let e = t.getViewportEdgeFadeMaskUrl(_);
|
|
407
|
+
e && d.setAttribute("mask", e);
|
|
410
408
|
}
|
|
411
|
-
return
|
|
409
|
+
return v;
|
|
412
410
|
}
|
|
413
|
-
var
|
|
411
|
+
var Se = {
|
|
414
412
|
left: "start",
|
|
415
413
|
center: "middle",
|
|
416
414
|
right: "end"
|
|
417
|
-
},
|
|
418
|
-
function
|
|
419
|
-
let n =
|
|
415
|
+
}, W = 64;
|
|
416
|
+
function Ce(e, t) {
|
|
417
|
+
let n = Te(e.unitView);
|
|
420
418
|
if (!n) return;
|
|
421
419
|
let r = e.unitView.getScaleResolution(n.channel)?.getScale();
|
|
422
420
|
if (!r || !i(r.type)) return;
|
|
423
|
-
let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds:
|
|
421
|
+
let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: d } = t;
|
|
424
422
|
if (!o.length) return 0;
|
|
425
|
-
let
|
|
426
|
-
let [t, n] =
|
|
427
|
-
return
|
|
423
|
+
let f = e.encoders, p = n.channel == "stroke" ? f.stroke : f.fill, m = Ee(e.unitView.spec.encoding.x), h = Infinity, v = Infinity, y = -Infinity, b = -Infinity, x = o.map((e) => {
|
|
424
|
+
let [t, n] = u(a, f, e), [r, i] = g(a, f, e);
|
|
425
|
+
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
426
|
offset: Number(e.position),
|
|
429
|
-
color:
|
|
427
|
+
color: l(p(e))
|
|
430
428
|
};
|
|
431
429
|
}).sort((e, t) => e.offset - t.offset);
|
|
432
|
-
if (!
|
|
430
|
+
if (!_(d, h, v, y, b)) return 0;
|
|
433
431
|
if (t.countOnly) return o.length;
|
|
434
|
-
let
|
|
432
|
+
let S = we(x), C = [
|
|
435
433
|
{
|
|
436
434
|
offset: 0,
|
|
437
|
-
color:
|
|
435
|
+
color: S[0].color
|
|
438
436
|
},
|
|
439
|
-
...
|
|
437
|
+
...S,
|
|
440
438
|
{
|
|
441
439
|
offset: 1,
|
|
442
|
-
color:
|
|
440
|
+
color: S.at(-1).color
|
|
443
441
|
}
|
|
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
|
|
442
|
+
], w = t.getLegendGradientUrl({
|
|
443
|
+
x1: h,
|
|
444
|
+
y1: m ? v : b,
|
|
445
|
+
x2: m ? y : h,
|
|
446
|
+
y2: v,
|
|
447
|
+
stops: C
|
|
448
|
+
}), T = M(h), E = M(v), D = M(y), O = M(b), k = Number(f.fillOpacity(o[0])) * c;
|
|
449
|
+
return s.appendChild(P("rect", {
|
|
450
|
+
x: T,
|
|
451
|
+
y: E,
|
|
452
|
+
width: M(D - T),
|
|
453
|
+
height: M(O - E),
|
|
454
|
+
fill: w,
|
|
455
|
+
"fill-opacity": j(k),
|
|
458
456
|
stroke: "none"
|
|
459
457
|
})), o.length;
|
|
460
458
|
}
|
|
461
|
-
function
|
|
462
|
-
return e.length <=
|
|
459
|
+
function we(e) {
|
|
460
|
+
return e.length <= W ? e : Array.from({ length: W }, (t, n) => e[Math.round(n * (e.length - 1) / (W - 1))]);
|
|
463
461
|
}
|
|
464
|
-
function
|
|
462
|
+
function Te(e) {
|
|
465
463
|
let t = e;
|
|
466
464
|
for (; t;) {
|
|
467
465
|
let e = t.spec.data;
|
|
@@ -469,32 +467,32 @@ function xe(e) {
|
|
|
469
467
|
t = t.dataParent;
|
|
470
468
|
}
|
|
471
469
|
}
|
|
472
|
-
function
|
|
470
|
+
function Ee(e) {
|
|
473
471
|
return e != null && "field" in e && (e.field == "position0" || e.field == "position1");
|
|
474
472
|
}
|
|
475
473
|
//#endregion
|
|
476
474
|
//#region ../core/src/rendering/svg/renderers/index.js
|
|
477
|
-
var
|
|
478
|
-
["arrow",
|
|
479
|
-
["link",
|
|
480
|
-
["point",
|
|
481
|
-
["rect",
|
|
482
|
-
["rule",
|
|
483
|
-
["text",
|
|
484
|
-
["tick",
|
|
475
|
+
var De = /* @__PURE__ */ new Map([
|
|
476
|
+
["arrow", fe],
|
|
477
|
+
["link", he],
|
|
478
|
+
["point", R],
|
|
479
|
+
["rect", ye],
|
|
480
|
+
["rule", U],
|
|
481
|
+
["text", xe],
|
|
482
|
+
["tick", U]
|
|
485
483
|
]);
|
|
486
|
-
function
|
|
484
|
+
function Oe(e, t) {
|
|
487
485
|
if (e.getType() == "rect") {
|
|
488
|
-
let n =
|
|
486
|
+
let n = Ce(e, t);
|
|
489
487
|
if (n !== void 0) return n;
|
|
490
488
|
}
|
|
491
|
-
let n =
|
|
489
|
+
let n = De.get(e.getType());
|
|
492
490
|
if (!n) throw Error(`SVG rendering is not implemented for mark type "${e.getType()}". View: ${e.unitView.getPathString()}`);
|
|
493
491
|
return n(e, t);
|
|
494
492
|
}
|
|
495
493
|
//#endregion
|
|
496
494
|
//#region ../core/src/rendering/svg/rectHatchPattern.js
|
|
497
|
-
function
|
|
495
|
+
function ke(e, t) {
|
|
498
496
|
let n = t.strokeWidth, r = [
|
|
499
497
|
"dots",
|
|
500
498
|
"rings",
|
|
@@ -507,31 +505,31 @@ function Te(e, t) {
|
|
|
507
505
|
"vertical",
|
|
508
506
|
"horizontal",
|
|
509
507
|
"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 =
|
|
508
|
+
].includes(t.type), o = r ? n * 7 : n * (i ? 6 : 4), s = a ? n * 2 : n, c = o, l = r ? o * 2 : o, u = P("pattern", {
|
|
511
509
|
id: e,
|
|
512
510
|
x: 0,
|
|
513
511
|
y: 0,
|
|
514
|
-
width:
|
|
515
|
-
height:
|
|
512
|
+
width: M(c),
|
|
513
|
+
height: M(l),
|
|
516
514
|
patternUnits: "userSpaceOnUse"
|
|
517
515
|
});
|
|
518
|
-
u.appendChild(
|
|
519
|
-
width:
|
|
520
|
-
height:
|
|
516
|
+
u.appendChild(P("rect", {
|
|
517
|
+
width: M(c),
|
|
518
|
+
height: M(l),
|
|
521
519
|
fill: t.fill,
|
|
522
|
-
"fill-opacity":
|
|
520
|
+
"fill-opacity": j(t.fillOpacity)
|
|
523
521
|
}));
|
|
524
|
-
let d =
|
|
522
|
+
let d = P("g", {
|
|
525
523
|
fill: "none",
|
|
526
524
|
stroke: t.stroke,
|
|
527
|
-
"stroke-opacity":
|
|
528
|
-
"stroke-width":
|
|
525
|
+
"stroke-opacity": j(t.strokeOpacity),
|
|
526
|
+
"stroke-width": M(s),
|
|
529
527
|
"stroke-linecap": "square"
|
|
530
528
|
});
|
|
531
|
-
return
|
|
529
|
+
return Ae(d, t.type, o, s), u.appendChild(d), u;
|
|
532
530
|
}
|
|
533
|
-
function
|
|
534
|
-
let i = (t) => e.appendChild(
|
|
531
|
+
function Ae(e, t, n, r) {
|
|
532
|
+
let i = (t) => e.appendChild(P("path", { d: t })), a = (e) => M(e), o = (e) => {
|
|
535
533
|
for (let t of [
|
|
536
534
|
-n,
|
|
537
535
|
0,
|
|
@@ -560,10 +558,10 @@ function Ee(e, t, n, r) {
|
|
|
560
558
|
case "dots":
|
|
561
559
|
case "rings":
|
|
562
560
|
case "ringsLarge": {
|
|
563
|
-
let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(
|
|
564
|
-
cx:
|
|
565
|
-
cy:
|
|
566
|
-
r:
|
|
561
|
+
let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(P("circle", {
|
|
562
|
+
cx: M(t),
|
|
563
|
+
cy: M(n),
|
|
564
|
+
r: M(r)
|
|
567
565
|
}));
|
|
568
566
|
i(n / 2, 0), i(n / 2, n * 2), i(0, n), i(n, n);
|
|
569
567
|
break;
|
|
@@ -573,47 +571,47 @@ function Ee(e, t, n, r) {
|
|
|
573
571
|
}
|
|
574
572
|
//#endregion
|
|
575
573
|
//#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 =
|
|
574
|
+
function je(e, t, n, r) {
|
|
575
|
+
let { normalX: i, normalY: a, offset: o, start: s, end: c } = r, l = i * o, u = a * o, d = e + "-gradient", f = P("linearGradient", {
|
|
578
576
|
id: d,
|
|
579
577
|
gradientUnits: "userSpaceOnUse",
|
|
580
|
-
x1:
|
|
581
|
-
y1:
|
|
582
|
-
x2:
|
|
583
|
-
y2:
|
|
578
|
+
x1: M(l - i * c),
|
|
579
|
+
y1: M(u - a * c),
|
|
580
|
+
x2: M(l + i * c),
|
|
581
|
+
y2: M(u + a * c),
|
|
584
582
|
spreadMethod: "pad"
|
|
585
583
|
});
|
|
586
|
-
for (let { offset: e, opacity: t } of
|
|
587
|
-
offset:
|
|
584
|
+
for (let { offset: e, opacity: t } of de(s, c)) f.appendChild(P("stop", {
|
|
585
|
+
offset: G(e, 3),
|
|
588
586
|
"stop-color": "white",
|
|
589
|
-
"stop-opacity":
|
|
587
|
+
"stop-opacity": G(t, 3)
|
|
590
588
|
}));
|
|
591
|
-
let p =
|
|
589
|
+
let p = P("mask", {
|
|
592
590
|
id: e,
|
|
593
591
|
x: 0,
|
|
594
592
|
y: 0,
|
|
595
|
-
width:
|
|
596
|
-
height:
|
|
593
|
+
width: M(t),
|
|
594
|
+
height: M(n),
|
|
597
595
|
maskUnits: "userSpaceOnUse",
|
|
598
596
|
maskContentUnits: "userSpaceOnUse",
|
|
599
597
|
"mask-type": "luminance"
|
|
600
598
|
});
|
|
601
|
-
return p.appendChild(
|
|
602
|
-
width:
|
|
603
|
-
height:
|
|
599
|
+
return p.appendChild(P("rect", {
|
|
600
|
+
width: M(t),
|
|
601
|
+
height: M(n),
|
|
604
602
|
fill: `url(#${d})`
|
|
605
603
|
})), {
|
|
606
604
|
gradient: f,
|
|
607
605
|
mask: p
|
|
608
606
|
};
|
|
609
607
|
}
|
|
610
|
-
function
|
|
608
|
+
function G(e, t) {
|
|
611
609
|
let n = 10 ** t;
|
|
612
610
|
return Math.round(e * n) / n;
|
|
613
611
|
}
|
|
614
612
|
//#endregion
|
|
615
613
|
//#region ../core/src/rendering/svg/svgViewRenderingContext.js
|
|
616
|
-
var
|
|
614
|
+
var K = class extends s {
|
|
617
615
|
#e;
|
|
618
616
|
#t;
|
|
619
617
|
#n = [];
|
|
@@ -626,8 +624,8 @@ var q = class extends s {
|
|
|
626
624
|
#l = /* @__PURE__ */ new Set();
|
|
627
625
|
#u = !1;
|
|
628
626
|
#d = /* @__PURE__ */ new Map();
|
|
629
|
-
#f = new
|
|
630
|
-
#p =
|
|
627
|
+
#f = new f();
|
|
628
|
+
#p = P("g");
|
|
631
629
|
#m;
|
|
632
630
|
#h;
|
|
633
631
|
#g = [];
|
|
@@ -640,14 +638,14 @@ var q = class extends s {
|
|
|
640
638
|
#C = 0;
|
|
641
639
|
#w = 0;
|
|
642
640
|
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:
|
|
641
|
+
super(e), this.width = t.width, this.height = t.height, this.textMetrics = t.textMetrics, this.#h = t.maxVectorInstances;
|
|
642
|
+
let n = M(t.width), r = M(t.height);
|
|
643
|
+
this.#e = P("svg", {
|
|
644
|
+
xmlns: N,
|
|
647
645
|
width: n,
|
|
648
646
|
height: r,
|
|
649
647
|
viewBox: `0 0 ${n} ${r}`
|
|
650
|
-
}), this.#t =
|
|
648
|
+
}), this.#t = P("defs"), this.#e.appendChild(this.#t), t.background != null && this.#e.appendChild(P("rect", {
|
|
651
649
|
width: n,
|
|
652
650
|
height: r,
|
|
653
651
|
fill: t.background,
|
|
@@ -712,12 +710,12 @@ var q = class extends s {
|
|
|
712
710
|
if (o) {
|
|
713
711
|
if (o.parentNode !== this.currentNode) throw Error(`Sample-faceted view was rendered under multiple parents: ${i}`);
|
|
714
712
|
} else {
|
|
715
|
-
o =
|
|
716
|
-
id:
|
|
713
|
+
o = P("g", {
|
|
714
|
+
id: q(e.name, this.#v++),
|
|
717
715
|
"data-name": e.name,
|
|
718
716
|
"data-view-path": i
|
|
719
717
|
});
|
|
720
|
-
let t =
|
|
718
|
+
let t = P("title");
|
|
721
719
|
t.textContent = i, o.appendChild(t), this.currentNode.appendChild(o), a?.viewGroups.set(e, o);
|
|
722
720
|
}
|
|
723
721
|
this.#n.push({
|
|
@@ -732,26 +730,27 @@ var q = class extends s {
|
|
|
732
730
|
}
|
|
733
731
|
renderMark(r, i) {
|
|
734
732
|
if (n(this.#n)?.exportExcluded || r.unitView.getEffectiveOpacity() <= 0) return;
|
|
735
|
-
let a = e(i), o = t(a, r.properties.clip, this.currentCoords), s =
|
|
736
|
-
if (!
|
|
733
|
+
let a = e(i), o = t(a, r.properties.clip, this.currentCoords), s = m(this.width, this.height, o);
|
|
734
|
+
if (!h(s)) return;
|
|
737
735
|
let c = this.getVisibleInstanceCount(r);
|
|
738
736
|
if (!this.#u && this.#h != null && c == 0) return;
|
|
739
737
|
if (!this.#u && this.#h != null && c > this.#h) {
|
|
740
738
|
this.#T(r, s);
|
|
741
739
|
return;
|
|
742
740
|
}
|
|
743
|
-
let
|
|
744
|
-
!this.#u && !
|
|
745
|
-
let
|
|
746
|
-
if (
|
|
741
|
+
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;
|
|
742
|
+
!this.#u && !d && this.#E();
|
|
743
|
+
let f = this.#u ? this.#p : this.#O(r, u), g = O(this.currentCoords, a, r.properties.cullByVisibleRange), _ = r.getOrder?.(), v = !this.#u && _ && _.isActive();
|
|
744
|
+
if (p(r, i, this.currentCoords, this.#f, (e, t) => {
|
|
747
745
|
let n = (t, n = !1) => {
|
|
748
|
-
let i =
|
|
746
|
+
let i = Oe(r, {
|
|
749
747
|
coords: e,
|
|
750
748
|
data: t,
|
|
751
|
-
group:
|
|
749
|
+
group: f,
|
|
752
750
|
visibleBounds: s,
|
|
753
751
|
anchorCullBounds: g,
|
|
754
752
|
viewOpacity: r.unitView.getEffectiveOpacity(),
|
|
753
|
+
textMetrics: this.textMetrics,
|
|
755
754
|
secondOrderPass: n,
|
|
756
755
|
countOnly: this.#u,
|
|
757
756
|
getViewportEdgeFadeMaskUrl: (e) => this.#u ? void 0 : this.getViewportEdgeFadeMaskUrl(e),
|
|
@@ -770,11 +769,11 @@ var q = class extends s {
|
|
|
770
769
|
n(t);
|
|
771
770
|
return;
|
|
772
771
|
}
|
|
773
|
-
let i =
|
|
772
|
+
let i = oe(t, 0, t.length, _.predicate, _.passes);
|
|
774
773
|
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 && !
|
|
774
|
+
}, (e) => this.#l.add(`SVG export could not resolve sample facet index ${e}. View: ${r.unitView.getPathString()}`)), !this.#u && !l && f.childElementCount > 0) {
|
|
776
775
|
let e = this.getClipPathUrl(o);
|
|
777
|
-
e &&
|
|
776
|
+
e && f.setAttribute("clip-path", e), this.currentNode.appendChild(f);
|
|
778
777
|
}
|
|
779
778
|
}
|
|
780
779
|
#T(e, t) {
|
|
@@ -806,26 +805,26 @@ var q = class extends s {
|
|
|
806
805
|
e && (this.#g.push(e), this.#_ = void 0);
|
|
807
806
|
}
|
|
808
807
|
#D(e) {
|
|
809
|
-
let t =
|
|
808
|
+
let t = Me(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = P("g", {
|
|
810
809
|
id: `rasterized-${n.join("-")}-${this.#w++}`,
|
|
811
810
|
"data-name": `Rasterized ${n.join(", ")}`,
|
|
812
811
|
"data-rasterized": ""
|
|
813
|
-
}), i =
|
|
812
|
+
}), i = P("image", { preserveAspectRatio: "none" });
|
|
814
813
|
r.appendChild(i);
|
|
815
814
|
let a = e.anchor.parentNode;
|
|
816
|
-
t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r,
|
|
817
|
-
for (let n of e.viewNodes)
|
|
815
|
+
t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r, Ne(a, t)), e.anchor.remove();
|
|
816
|
+
for (let n of e.viewNodes) Pe(n, t);
|
|
818
817
|
e.image = i;
|
|
819
818
|
}
|
|
820
819
|
#O(e, t) {
|
|
821
820
|
let n = this.#m;
|
|
822
|
-
if (!n) return
|
|
821
|
+
if (!n) return P("g", { "data-mark-type": e.getType() });
|
|
823
822
|
let r = n.markGroups.get(e);
|
|
824
823
|
r || (r = /* @__PURE__ */ new Map(), n.markGroups.set(e, r));
|
|
825
824
|
let i = t ?? "", a = r.get(i);
|
|
826
825
|
if (a) {
|
|
827
826
|
if (a.parentNode !== this.currentNode) throw Error(`Sample-faceted mark was rendered under multiple parents: ${e.unitView.getPathString()}`);
|
|
828
|
-
} else a =
|
|
827
|
+
} else a = P("g", { "data-mark-type": e.getType() }), t && a.setAttribute("clip-path", t), this.currentNode.appendChild(a), r.set(i, a), n.markGroupElements.add(a);
|
|
829
828
|
return a;
|
|
830
829
|
}
|
|
831
830
|
getClipPathUrl(e) {
|
|
@@ -835,14 +834,14 @@ var q = class extends s {
|
|
|
835
834
|
e.clipY ? t.y : 0,
|
|
836
835
|
e.clipX ? t.width : this.width,
|
|
837
836
|
e.clipY ? t.height : this.height
|
|
838
|
-
].map(
|
|
837
|
+
].map(M), r = n.join(","), i = this.#r.get(r);
|
|
839
838
|
if (!i) {
|
|
840
839
|
i = "clip-" + this.#y++;
|
|
841
|
-
let e =
|
|
840
|
+
let e = P("clipPath", {
|
|
842
841
|
id: i,
|
|
843
842
|
clipPathUnits: "userSpaceOnUse"
|
|
844
843
|
});
|
|
845
|
-
e.appendChild(
|
|
844
|
+
e.appendChild(P("rect", {
|
|
846
845
|
x: n[0],
|
|
847
846
|
y: n[1],
|
|
848
847
|
width: n[2],
|
|
@@ -852,28 +851,28 @@ var q = class extends s {
|
|
|
852
851
|
return `url(#${i})`;
|
|
853
852
|
}
|
|
854
853
|
getShadowFilterUrl(e) {
|
|
855
|
-
let t =
|
|
854
|
+
let t = M(Math.max(e.blur / 2.5, .25)), n = M(e.offsetX), r = M(e.offsetY), i = [
|
|
856
855
|
t,
|
|
857
856
|
n,
|
|
858
857
|
r
|
|
859
858
|
].join(","), a = this.#a.get(i);
|
|
860
859
|
if (!a) {
|
|
861
860
|
a = "shadow-" + this.#x++;
|
|
862
|
-
let e =
|
|
861
|
+
let e = P("filter", {
|
|
863
862
|
id: a,
|
|
864
863
|
x: 0,
|
|
865
864
|
y: 0,
|
|
866
|
-
width:
|
|
867
|
-
height:
|
|
865
|
+
width: M(this.width),
|
|
866
|
+
height: M(this.height),
|
|
868
867
|
filterUnits: "userSpaceOnUse",
|
|
869
868
|
primitiveUnits: "userSpaceOnUse",
|
|
870
869
|
"color-interpolation-filters": "sRGB"
|
|
871
870
|
});
|
|
872
|
-
e.appendChild(
|
|
871
|
+
e.appendChild(P("feGaussianBlur", {
|
|
873
872
|
in: "SourceGraphic",
|
|
874
873
|
stdDeviation: t,
|
|
875
874
|
result: "blur"
|
|
876
|
-
})), e.appendChild(
|
|
875
|
+
})), e.appendChild(P("feOffset", {
|
|
877
876
|
in: "blur",
|
|
878
877
|
dx: n,
|
|
879
878
|
dy: r,
|
|
@@ -886,12 +885,12 @@ var q = class extends s {
|
|
|
886
885
|
let t = this.#o.get(e);
|
|
887
886
|
if (!t) {
|
|
888
887
|
t = "shadow-clip-" + this.#y++;
|
|
889
|
-
let n =
|
|
888
|
+
let n = P("clipPath", {
|
|
890
889
|
id: t,
|
|
891
890
|
clipPathUnits: "userSpaceOnUse"
|
|
892
891
|
});
|
|
893
|
-
n.appendChild(
|
|
894
|
-
d: `M 0 0 V ${
|
|
892
|
+
n.appendChild(P("path", {
|
|
893
|
+
d: `M 0 0 V ${M(this.height)} H ${M(this.width)} V 0 Z ${e}`,
|
|
895
894
|
"clip-rule": "evenodd",
|
|
896
895
|
"fill-rule": "evenodd"
|
|
897
896
|
})), this.#t.appendChild(n), this.#o.set(e, t);
|
|
@@ -902,35 +901,35 @@ var q = class extends s {
|
|
|
902
901
|
let t = JSON.stringify([
|
|
903
902
|
e.type,
|
|
904
903
|
e.fill,
|
|
905
|
-
|
|
904
|
+
j(e.fillOpacity),
|
|
906
905
|
e.stroke,
|
|
907
|
-
|
|
908
|
-
|
|
906
|
+
j(e.strokeOpacity),
|
|
907
|
+
j(e.strokeWidth)
|
|
909
908
|
]), n = this.#s.get(t);
|
|
910
|
-
return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(
|
|
909
|
+
return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(ke(n, e)), this.#s.set(t, n)), `url(#${n})`;
|
|
911
910
|
}
|
|
912
911
|
getLegendGradientUrl(e) {
|
|
913
|
-
let t = "legend-gradient-" + this.#C++, n =
|
|
912
|
+
let t = "legend-gradient-" + this.#C++, n = P("linearGradient", {
|
|
914
913
|
id: t,
|
|
915
914
|
gradientUnits: "userSpaceOnUse",
|
|
916
|
-
x1:
|
|
917
|
-
y1:
|
|
918
|
-
x2:
|
|
919
|
-
y2:
|
|
915
|
+
x1: M(e.x1),
|
|
916
|
+
y1: M(e.y1),
|
|
917
|
+
x2: M(e.x2),
|
|
918
|
+
y2: M(e.y2)
|
|
920
919
|
});
|
|
921
|
-
for (let t of e.stops) n.appendChild(
|
|
922
|
-
offset:
|
|
920
|
+
for (let t of e.stops) n.appendChild(P("stop", {
|
|
921
|
+
offset: j(t.offset),
|
|
923
922
|
"stop-color": t.color
|
|
924
923
|
}));
|
|
925
924
|
return this.#t.appendChild(n), `url(#${t})`;
|
|
926
925
|
}
|
|
927
926
|
getLinkArcFadeMaskUrl(e) {
|
|
928
|
-
let t =
|
|
927
|
+
let t = x(e.p1, e.p4, e.distances);
|
|
929
928
|
if (!t) return;
|
|
930
929
|
let n = this.#c.get(t.key);
|
|
931
930
|
if (!n) {
|
|
932
931
|
n = "link-arc-fade-" + this.#b++;
|
|
933
|
-
let { gradient: e, mask: r } =
|
|
932
|
+
let { gradient: e, mask: r } = je(n, this.width, this.height, t);
|
|
934
933
|
this.#t.appendChild(e), this.#t.appendChild(r), this.#c.set(t.key, n);
|
|
935
934
|
}
|
|
936
935
|
return `url(#${n})`;
|
|
@@ -943,7 +942,7 @@ var q = class extends s {
|
|
|
943
942
|
let i = this.#i.get(r.view);
|
|
944
943
|
if (!i) {
|
|
945
944
|
i = "edge-fade-" + this.#b++;
|
|
946
|
-
let e =
|
|
945
|
+
let e = M(this.width), n = M(this.height), a = P("mask", {
|
|
947
946
|
id: i,
|
|
948
947
|
x: 0,
|
|
949
948
|
y: 0,
|
|
@@ -953,14 +952,14 @@ var q = class extends s {
|
|
|
953
952
|
maskContentUnits: "userSpaceOnUse",
|
|
954
953
|
"mask-type": "luminance"
|
|
955
954
|
});
|
|
956
|
-
a.appendChild(
|
|
955
|
+
a.appendChild(P("rect", {
|
|
957
956
|
width: e,
|
|
958
957
|
height: n,
|
|
959
958
|
fill: "white"
|
|
960
959
|
}));
|
|
961
960
|
for (let [o, s] of t) {
|
|
962
|
-
let t = i + "-" + o, c =
|
|
963
|
-
this.#t.appendChild(c), a.appendChild(
|
|
961
|
+
let t = i + "-" + o, c = Fe(t, o, s, r.coords);
|
|
962
|
+
this.#t.appendChild(c), a.appendChild(P("rect", {
|
|
964
963
|
width: e,
|
|
965
964
|
height: n,
|
|
966
965
|
fill: `url(#${t})`
|
|
@@ -985,44 +984,44 @@ var q = class extends s {
|
|
|
985
984
|
return e.coords;
|
|
986
985
|
}
|
|
987
986
|
};
|
|
988
|
-
function
|
|
987
|
+
function q(e, t) {
|
|
989
988
|
let n = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
990
989
|
return `${/^[A-Za-z_]/.test(n) ? n : n ? "view-" + n : "view"}-${t}`;
|
|
991
990
|
}
|
|
992
991
|
function J(e, t) {
|
|
993
992
|
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
993
|
}
|
|
995
|
-
function
|
|
994
|
+
function Me(e) {
|
|
996
995
|
let [t, ...n] = Array.from(e), r = t;
|
|
997
996
|
for (; n.some((e) => !r.contains(e));) r = r.parentNode;
|
|
998
997
|
return r;
|
|
999
998
|
}
|
|
1000
|
-
function
|
|
999
|
+
function Ne(e, t) {
|
|
1001
1000
|
let n = e;
|
|
1002
1001
|
for (; n.parentNode != t;) n = n.parentNode;
|
|
1003
1002
|
return n;
|
|
1004
1003
|
}
|
|
1005
|
-
function
|
|
1004
|
+
function Pe(e, t) {
|
|
1006
1005
|
let n = e;
|
|
1007
1006
|
for (; n != t && n.matches("g[data-view-path]") && Array.from(n.children).every((e) => e.tagName == "title");) {
|
|
1008
1007
|
let e = n.parentNode;
|
|
1009
1008
|
n.remove(), n = e;
|
|
1010
1009
|
}
|
|
1011
1010
|
}
|
|
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 =
|
|
1011
|
+
function Fe(e, t, n, r) {
|
|
1012
|
+
let i = t == "top" ? r.y + n.distance : t == "right" ? r.x2 - n.distance : t == "bottom" ? r.y2 - n.distance : r.x + n.distance, a = t == "left" || t == "right", o = i + (t == "top" || t == "left" ? 1 : -1) * n.width, s = P("linearGradient", {
|
|
1014
1013
|
id: e,
|
|
1015
1014
|
gradientUnits: "userSpaceOnUse",
|
|
1016
|
-
x1:
|
|
1017
|
-
y1:
|
|
1018
|
-
x2:
|
|
1019
|
-
y2:
|
|
1015
|
+
x1: M(a ? i : 0),
|
|
1016
|
+
y1: M(a ? 0 : i),
|
|
1017
|
+
x2: M(a ? o : 0),
|
|
1018
|
+
y2: M(a ? 0 : o)
|
|
1020
1019
|
});
|
|
1021
|
-
return s.appendChild(
|
|
1020
|
+
return s.appendChild(P("stop", {
|
|
1022
1021
|
offset: 0,
|
|
1023
1022
|
"stop-color": "black",
|
|
1024
1023
|
"stop-opacity": 1
|
|
1025
|
-
})), s.appendChild(
|
|
1024
|
+
})), s.appendChild(P("stop", {
|
|
1026
1025
|
offset: 1,
|
|
1027
1026
|
"stop-color": "black",
|
|
1028
1027
|
"stop-opacity": 0
|
|
@@ -1030,22 +1029,24 @@ function Me(e, t, n, r) {
|
|
|
1030
1029
|
}
|
|
1031
1030
|
//#endregion
|
|
1032
1031
|
//#region ../core/src/rendering/svg/index.js
|
|
1033
|
-
function Y({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "white" }) {
|
|
1034
|
-
let
|
|
1032
|
+
function Y({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "white", textMetrics: i = e.context.textMetrics }) {
|
|
1033
|
+
let a = new K({ picking: !1 }, {
|
|
1035
1034
|
width: t,
|
|
1036
1035
|
height: n,
|
|
1037
|
-
background: r
|
|
1036
|
+
background: r,
|
|
1037
|
+
textMetrics: i
|
|
1038
1038
|
});
|
|
1039
|
-
return c(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(
|
|
1040
|
-
svg:
|
|
1041
|
-
warnings:
|
|
1039
|
+
return c(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(a), {
|
|
1040
|
+
svg: a.getSvg(),
|
|
1041
|
+
warnings: a.getWarnings()
|
|
1042
1042
|
};
|
|
1043
1043
|
}
|
|
1044
|
-
function
|
|
1045
|
-
let r = new
|
|
1044
|
+
async function Ie({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
|
|
1045
|
+
let r = new K({ picking: !1 }, {
|
|
1046
1046
|
width: t,
|
|
1047
1047
|
height: n,
|
|
1048
|
-
background: null
|
|
1048
|
+
background: null,
|
|
1049
|
+
textMetrics: await Z(e)
|
|
1049
1050
|
});
|
|
1050
1051
|
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
1052
|
viewName: e.unitView.name,
|
|
@@ -1055,36 +1056,41 @@ function Ne({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
|
|
|
1055
1056
|
instanceCount: t
|
|
1056
1057
|
})).filter((e) => e.instanceCount > 0) };
|
|
1057
1058
|
}
|
|
1058
|
-
async function
|
|
1059
|
-
let t = e.
|
|
1060
|
-
return t ? ($(t), e.rasterizeSvgRuns ? Z({
|
|
1059
|
+
async function Le(e) {
|
|
1060
|
+
let t = await Z(e.viewRoot), n = {
|
|
1061
1061
|
...e,
|
|
1062
|
+
textMetrics: t
|
|
1063
|
+
}, r = e.rasterization;
|
|
1064
|
+
return r ? ($(r), e.rasterizeSvgRuns ? X({
|
|
1065
|
+
...n,
|
|
1062
1066
|
rasterizeSvgRuns: e.rasterizeSvgRuns,
|
|
1063
|
-
maxVectorInstances:
|
|
1064
|
-
pixelRatio:
|
|
1065
|
-
}) : Q(
|
|
1066
|
-
...Y(
|
|
1067
|
+
maxVectorInstances: r.maxVectorInstances,
|
|
1068
|
+
pixelRatio: r.pixelRatio
|
|
1069
|
+
}) : Q(n)) : {
|
|
1070
|
+
...Y(n),
|
|
1067
1071
|
rasterized: []
|
|
1068
1072
|
};
|
|
1069
1073
|
}
|
|
1070
|
-
async function
|
|
1071
|
-
$({
|
|
1074
|
+
async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHeight: r, background: i = "white", maxVectorInstances: s, pixelRatio: l = 2, textMetrics: u }) {
|
|
1075
|
+
u ??= await Z(e), $({
|
|
1072
1076
|
maxVectorInstances: s,
|
|
1073
1077
|
pixelRatio: l
|
|
1074
1078
|
});
|
|
1075
|
-
let
|
|
1079
|
+
let d = new K({ picking: !1 }, {
|
|
1076
1080
|
width: n,
|
|
1077
1081
|
height: r,
|
|
1078
1082
|
background: i,
|
|
1079
|
-
maxVectorInstances: s
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1083
|
+
maxVectorInstances: s,
|
|
1084
|
+
textMetrics: u
|
|
1085
|
+
}), f = c(e, o.create(0, 0, n, r), { renderingOptions: { firstFacet: !0 } });
|
|
1086
|
+
d.beginInstanceCounting(), f.collectRenderCommands(d), d.endInstanceCounting(), f.collectRenderCommands(d);
|
|
1087
|
+
let p = d.getRasterRuns();
|
|
1088
|
+
if (p.length) try {
|
|
1084
1089
|
await t({
|
|
1085
|
-
runs:
|
|
1090
|
+
runs: p,
|
|
1086
1091
|
viewRoot: e,
|
|
1087
|
-
layoutResult:
|
|
1092
|
+
layoutResult: f,
|
|
1093
|
+
textMetrics: u,
|
|
1088
1094
|
logicalWidth: n,
|
|
1089
1095
|
logicalHeight: r,
|
|
1090
1096
|
pixelRatio: l
|
|
@@ -1094,14 +1100,15 @@ async function Z({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
|
|
|
1094
1100
|
viewRoot: e,
|
|
1095
1101
|
logicalWidth: n,
|
|
1096
1102
|
logicalHeight: r,
|
|
1097
|
-
background: i
|
|
1103
|
+
background: i,
|
|
1104
|
+
textMetrics: u
|
|
1098
1105
|
});
|
|
1099
1106
|
throw t;
|
|
1100
1107
|
}
|
|
1101
1108
|
return {
|
|
1102
|
-
svg:
|
|
1103
|
-
warnings:
|
|
1104
|
-
rasterized:
|
|
1109
|
+
svg: d.getSvg(),
|
|
1110
|
+
warnings: d.getWarnings(),
|
|
1111
|
+
rasterized: p.map((e) => ({
|
|
1105
1112
|
targets: e.targets.map((e) => ({
|
|
1106
1113
|
markType: e.mark.getType(),
|
|
1107
1114
|
instanceCount: e.instanceCount
|
|
@@ -1112,6 +1119,11 @@ async function Z({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
|
|
|
1112
1119
|
}))
|
|
1113
1120
|
};
|
|
1114
1121
|
}
|
|
1122
|
+
async function Z(e) {
|
|
1123
|
+
if (!document.fonts) return e.context.textMetrics;
|
|
1124
|
+
let t = te(document);
|
|
1125
|
+
return await ie(t, e), t;
|
|
1126
|
+
}
|
|
1115
1127
|
function Q(e) {
|
|
1116
1128
|
let t = Y(e);
|
|
1117
1129
|
return {
|
|
@@ -1125,4 +1137,4 @@ function $(e) {
|
|
|
1125
1137
|
if (e.pixelRatio != null && (!Number.isFinite(e.pixelRatio) || e.pixelRatio <= 0)) throw RangeError("SVG raster pixelRatio must be positive.");
|
|
1126
1138
|
}
|
|
1127
1139
|
//#endregion
|
|
1128
|
-
export {
|
|
1140
|
+
export { Ie as analyzeSvgExport, X as createRasterizedSvg, Y as createSvg, Le as createSvgExport };
|