@genome-spy/app 0.89.0 → 1.0.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-BUcXm-JC.js → agentApi-Z65dw-sD.js} +2808 -2638
- package/dist/agentApi.es.js +1607 -1570
- package/dist/agentShared.es.js +737 -678
- package/dist/{canvas2d-CGuVGvQk.js → canvas2d-DiPQvNtZ.js} +11 -9
- package/dist/{canvas2d-DgF0kstG.js → canvas2d-t_N10CeW.js} +24 -22
- package/dist/{clipOptions-DBJX_W31.js → clipOptions-B5PibDq3.js} +890 -900
- package/dist/{clipOptions-8BPf0WMZ.js → clipOptions-Cba4I0AO.js} +544 -554
- package/dist/{componentStyles-FsNmIb22.js → componentStyles-DGtQXvwc.js} +17 -15
- package/dist/{debug-BEWbYuZD.js → debug-CVAlrcZt.js} +2 -2
- package/dist/{debug-DQj_7mFm.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 +900 -455
- package/dist/{indexer-D8Bgkkb8.js → indexer-DbFTKGlm.js} +1 -1
- package/dist/{indexer-Cdt_U05k.js → indexer-En7gpvLN.js} +1 -1
- package/dist/{lit-ByuJ0FJ4.js → lit-CoXp9NFX.js} +12 -10
- package/dist/{order-DIxlclRN.js → order-BkYCnwD7.js} +36 -30
- package/dist/{order-BPOzLe80.js → order-R043xTpC.js} +47 -41
- package/dist/{parquetRead-Cs2xRrvz.js → parquetRead-0hFIa3Cc.js} +532 -350
- package/dist/{rasterExport-Bl6w9t3J.js → rasterExport-C_FcNBkC.js} +8 -7
- package/dist/{rasterExport-DRvNAH-r.js → rasterExport-Z7gs5346.js} +8 -7
- package/dist/{rasterization-D0tOoKu_.js → rasterization-_-9JmSas.js} +3 -2
- package/dist/{renderCanvas2D-LdEYFnRo.js → renderCanvas2D-DK1c9TFK.js} +10 -10
- package/dist/{renderCanvas2D-Ct95auF3.js → renderCanvas2D-IM-A9DYG.js} +16 -16
- package/dist/schema.json +11 -0
- package/dist/{src-DjOlFqSn.js → src-DJtvThVC.js} +3 -5
- package/dist/style.css +1 -1
- package/dist/{svg-pkTPD4bv.js → svg-DW3tfUmm.js} +233 -232
- package/dist/{svg-Ag36-h_I.js → svg-PabUdcDi.js} +233 -232
- package/dist/{svgRasterizer-DrtJ9nLk.js → svgRasterizer-B6YtWLJs.js} +2 -2
- package/dist/{svgRasterizer-CksK4QTB.js → svgRasterizer-BEVDyyS3.js} +2 -2
- package/dist/{vega-scale-BWBFykuI.js → vega-scale-Byaw1K8O.js} +837 -726
- package/dist/{vega-scale-BJaDSHBJ.js → vega-scale-Ctz_wa3z.js} +942 -834
- package/dist/{viewIdentityRegistry-BvCJajXG.js → viewIdentityRegistry-BW415b3o.js} +1 -1
- package/dist/{viewIdentityRegistry-B-snqI3y.js → viewIdentityRegistry-_F0E7nkA.js} +1 -1
- package/dist/{viewSelectors-BlvzvG-z.js → viewSelectors-DYz-PhTO.js} +245 -243
- package/dist/{viewSelectors-C5q3qBiR.js → viewSelectors-KtD-QSN0.js} +106 -104
- package/dist/{viewUtils-C3vBtSvE.js → viewUtils-BZGPseMx.js} +1833 -1677
- package/dist/{webgl-CZX2pe5v.js → webgl-BKSGqHaz.js} +964 -951
- package/dist/{webgl-CexXSw_I.js → webgl-tdKf9SlZ.js} +239 -226
- 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
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { v as r } from "./vega-scale-
|
|
3
|
-
import { x as i } from "./viewSelectors-
|
|
4
|
-
import { t as a } from "./rasterization-
|
|
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
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, 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
|
|
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 F(e, t) {
|
|
19
|
-
let n = Object.entries(t).filter(([t, n]) => n.encoder.constant ? (e.setAttribute(t, "" + I(n, {})), !1) : !0);
|
|
20
|
-
return (e) => Object.fromEntries(n.map(([t, n]) => [t, I(n, e)]));
|
|
21
|
-
}
|
|
22
18
|
function I(e, t) {
|
|
19
|
+
let n = Object.entries(t).filter(([t, n]) => !n.encoder.constant || (e.setAttribute(t, "" + L(n, {})), !1));
|
|
20
|
+
return (e) => Object.fromEntries(n.map(([t, n]) => [t, L(n, e)]));
|
|
21
|
+
}
|
|
22
|
+
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
|
-
function
|
|
29
|
-
let n = e, { coords: r, data: i, group: a, viewOpacity: o, visibleBounds: s } = t, c = n.encoders, u =
|
|
28
|
+
function de(e, t) {
|
|
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
32
|
transform: l
|
|
@@ -45,34 +45,34 @@ function fe(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
52
|
let d = v(n);
|
|
53
|
-
return
|
|
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 "${d.headShape}" as a triangle.`), a.appendChild(
|
|
61
|
-
d: e.boundaryLoops.map(
|
|
60
|
+
t.countOnly || (e.headShapeFallback && t.warn(`SVG export rendered unsupported arrow headShape "${d.headShape}" as a triangle.`), a.appendChild(F("path", {
|
|
61
|
+
d: e.boundaryLoops.map(fe).join(" "),
|
|
62
62
|
...u(e.datum)
|
|
63
63
|
})));
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return `M ${e.map(
|
|
66
|
+
function fe(e) {
|
|
67
|
+
return `M ${e.map(pe).join(" L ")} Z`;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return `${
|
|
69
|
+
function pe(e) {
|
|
70
|
+
return `${N(e.x)} ${N(e.y)}`;
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region ../core/src/rendering/svg/renderers/link.js
|
|
74
|
-
function
|
|
75
|
-
let n = e, r = y(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, u = n.encoders, d =
|
|
74
|
+
function me(e, t) {
|
|
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
77
|
encoder: u.color,
|
|
78
78
|
transform: l
|
|
@@ -83,12 +83,12 @@ function he(e, t) {
|
|
|
83
83
|
},
|
|
84
84
|
"stroke-width": {
|
|
85
85
|
encoder: u.size,
|
|
86
|
-
transform: (e) =>
|
|
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
|
|
@@ -100,21 +100,21 @@ function he(e, t) {
|
|
|
100
100
|
p4: s,
|
|
101
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
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 =
|
|
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
120
|
transform: l
|
|
@@ -133,47 +133,47 @@ function R(e, t) {
|
|
|
133
133
|
},
|
|
134
134
|
"stroke-width": {
|
|
135
135
|
encoder: s.strokeWidth,
|
|
136
|
-
transform: (e) =>
|
|
136
|
+
transform: (e) => N(+e)
|
|
137
137
|
}
|
|
138
|
-
}), u =
|
|
138
|
+
}), u = ge();
|
|
139
139
|
return T(n, r, t, (e) => {
|
|
140
140
|
if (t.countOnly) return;
|
|
141
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
|
},
|
|
@@ -188,20 +188,20 @@ function _e() {
|
|
|
188
188
|
return e = "", ee(t, r, i, a, n) ? e : void 0;
|
|
189
189
|
} };
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function _e(e, t, n) {
|
|
192
192
|
let r = e.stroke(t), i = d(e.strokeOpacity, t), a = r == null || i <= 0;
|
|
193
193
|
return {
|
|
194
194
|
fill: "none",
|
|
195
195
|
stroke: l(a ? e.fill(t) : r),
|
|
196
196
|
"stroke-opacity": (a ? d(e.fillOpacity, t) : i) * n,
|
|
197
|
-
"stroke-width":
|
|
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 = w(n), { shadow: i, hatch: a } = r, { group: o, viewOpacity: s } = t, c = n.encoders, u =
|
|
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
207
|
transform: l
|
|
@@ -220,21 +220,21 @@ function ye(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
236
|
...u(n),
|
|
237
|
-
...g == 1 ? {} : { opacity:
|
|
237
|
+
...g == 1 ? {} : { opacity: M(g) }
|
|
238
238
|
};
|
|
239
239
|
if (a != "none" && _ > 0 && (b.fill = t.getRectHatchPatternUrl({
|
|
240
240
|
type: a,
|
|
@@ -244,66 +244,67 @@ function ye(e, t) {
|
|
|
244
244
|
strokeOpacity: d(c.strokeOpacity, n) * s,
|
|
245
245
|
strokeWidth: _
|
|
246
246
|
}), b["fill-opacity"] = 1), f) {
|
|
247
|
-
let e =
|
|
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 =
|
|
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
|
}
|
|
257
|
-
o.appendChild(
|
|
257
|
+
o.appendChild(B(r, i, p, m, h, b));
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
|
-
function
|
|
261
|
-
if (
|
|
262
|
-
let o = i.topLeft, s =
|
|
263
|
-
return
|
|
260
|
+
function B(e, t, n, r, i, a) {
|
|
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
|
-
}
|
|
275
|
-
|
|
274
|
+
}
|
|
275
|
+
return F("path", {
|
|
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
|
-
function
|
|
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
|
-
`M ${
|
|
286
|
-
`H ${
|
|
287
|
-
|
|
288
|
-
`V ${
|
|
289
|
-
|
|
290
|
-
`H ${
|
|
291
|
-
|
|
292
|
-
`V ${
|
|
293
|
-
|
|
286
|
+
`M ${U(e + s, t)}`,
|
|
287
|
+
`H ${N(a - c)}`,
|
|
288
|
+
H(c, a, t + c, a, t),
|
|
289
|
+
`V ${N(o - l)}`,
|
|
290
|
+
H(l, a - l, o, a, o),
|
|
291
|
+
`H ${N(e + u)}`,
|
|
292
|
+
H(u, e, o - u, e, o),
|
|
293
|
+
`V ${N(t + s)}`,
|
|
294
|
+
H(s, e + s, t, e, t),
|
|
294
295
|
"Z"
|
|
295
296
|
].join(" ");
|
|
296
297
|
}
|
|
297
|
-
function
|
|
298
|
-
return e ? `A ${
|
|
298
|
+
function H(e, t, n, r, i) {
|
|
299
|
+
return e ? `A ${N(e)} ${N(e)} 0 0 1 ${U(t, n)}` : `L ${U(r, i)}`;
|
|
299
300
|
}
|
|
300
|
-
function
|
|
301
|
-
return `${
|
|
301
|
+
function U(e, t) {
|
|
302
|
+
return `${N(e)} ${N(t)}`;
|
|
302
303
|
}
|
|
303
304
|
//#endregion
|
|
304
305
|
//#region ../core/src/rendering/svg/renderers/rule.js
|
|
305
|
-
function
|
|
306
|
-
let n = e, r =
|
|
306
|
+
function W(e, t) {
|
|
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
309
|
encoder: u.color,
|
|
309
310
|
transform: l
|
|
@@ -314,27 +315,27 @@ function U(e, t) {
|
|
|
314
315
|
},
|
|
315
316
|
"stroke-width": {
|
|
316
317
|
encoder: u.size,
|
|
317
|
-
transform: (e) =>
|
|
318
|
+
transform: (e) => N(+e)
|
|
318
319
|
}
|
|
319
320
|
});
|
|
320
|
-
return o.setAttribute("stroke-linecap", "" + n.properties.strokeCap), d && (o.setAttribute("stroke-dasharray", d.map(
|
|
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 = 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 =
|
|
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
340
|
encoder: h.color,
|
|
340
341
|
transform: l
|
|
@@ -345,10 +346,10 @@ function xe(e, t) {
|
|
|
345
346
|
},
|
|
346
347
|
"font-size": {
|
|
347
348
|
encoder: h.size,
|
|
348
|
-
transform: (e) =>
|
|
349
|
+
transform: (e) => N(+e)
|
|
349
350
|
}
|
|
350
351
|
});
|
|
351
|
-
d.setAttribute("font-family", b(r.font)), d.setAttribute("font-style", r.fontStyle ?? "normal"), d.setAttribute("font-weight", "" +
|
|
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]);
|
|
352
353
|
let _ = {
|
|
353
354
|
top: {
|
|
354
355
|
width: k(n, r.viewportEdgeFadeWidthTop),
|
|
@@ -377,9 +378,9 @@ function xe(e, t) {
|
|
|
377
378
|
if (t.countOnly) return;
|
|
378
379
|
if (e.logoTransform) {
|
|
379
380
|
e.multiCharacterLogo && t.warn("SVG export stretches multi-character logo text as a single glyph cell.");
|
|
380
|
-
let n = [`translate(${
|
|
381
|
-
e.angle && n.push(`rotate(${
|
|
382
|
-
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", {
|
|
383
384
|
x: 0,
|
|
384
385
|
y: 0,
|
|
385
386
|
"text-anchor": "start",
|
|
@@ -390,14 +391,14 @@ function xe(e, t) {
|
|
|
390
391
|
r.textContent = e.text, d.appendChild(r);
|
|
391
392
|
return;
|
|
392
393
|
}
|
|
393
|
-
let n = [`translate(${
|
|
394
|
-
e.angle && n.push(`rotate(${
|
|
395
|
-
let r =
|
|
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", {
|
|
396
397
|
x: 0,
|
|
397
398
|
y: 0,
|
|
398
|
-
dy:
|
|
399
|
+
dy: N(ne(s.baseline, e.size)),
|
|
399
400
|
...g(e.datum),
|
|
400
|
-
...e.fadeOpacity == 1 ? {} : { opacity:
|
|
401
|
+
...e.fadeOpacity == 1 ? {} : { opacity: M(e.fadeOpacity) },
|
|
401
402
|
transform: n.join(" ")
|
|
402
403
|
});
|
|
403
404
|
r.textContent = e.text, d.appendChild(r);
|
|
@@ -408,19 +409,19 @@ function xe(e, t) {
|
|
|
408
409
|
}
|
|
409
410
|
return v;
|
|
410
411
|
}
|
|
411
|
-
var
|
|
412
|
+
var xe = {
|
|
412
413
|
left: "start",
|
|
413
414
|
center: "middle",
|
|
414
415
|
right: "end"
|
|
415
|
-
},
|
|
416
|
-
function
|
|
417
|
-
let n =
|
|
416
|
+
}, G = 64;
|
|
417
|
+
function Se(e, t) {
|
|
418
|
+
let n = we(e.unitView);
|
|
418
419
|
if (!n) return;
|
|
419
420
|
let i = e.unitView.getScaleResolution(n.channel)?.getScale();
|
|
420
421
|
if (!i || !r(i.type)) return;
|
|
421
422
|
let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: d } = t;
|
|
422
423
|
if (!o.length) return 0;
|
|
423
|
-
let f = e.encoders, p = n.channel == "stroke" ? f.stroke : f.fill, m =
|
|
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) => {
|
|
424
425
|
let [t, n] = u(a, f, e), [r, i] = g(a, f, e);
|
|
425
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), {
|
|
426
427
|
offset: Number(e.position),
|
|
@@ -429,7 +430,7 @@ function Ce(e, t) {
|
|
|
429
430
|
}).sort((e, t) => e.offset - t.offset);
|
|
430
431
|
if (!_(d, h, v, y, b)) return 0;
|
|
431
432
|
if (t.countOnly) return o.length;
|
|
432
|
-
let S =
|
|
433
|
+
let S = Ce(x), C = [
|
|
433
434
|
{
|
|
434
435
|
offset: 0,
|
|
435
436
|
color: S[0].color
|
|
@@ -445,21 +446,21 @@ function Ce(e, t) {
|
|
|
445
446
|
x2: m ? y : h,
|
|
446
447
|
y2: v,
|
|
447
448
|
stops: C
|
|
448
|
-
}), T =
|
|
449
|
-
return s.appendChild(
|
|
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", {
|
|
450
451
|
x: T,
|
|
451
452
|
y: E,
|
|
452
|
-
width:
|
|
453
|
-
height:
|
|
453
|
+
width: N(D - T),
|
|
454
|
+
height: N(O - E),
|
|
454
455
|
fill: w,
|
|
455
|
-
"fill-opacity":
|
|
456
|
+
"fill-opacity": M(k),
|
|
456
457
|
stroke: "none"
|
|
457
458
|
})), o.length;
|
|
458
459
|
}
|
|
459
|
-
function
|
|
460
|
-
return e.length <=
|
|
460
|
+
function Ce(e) {
|
|
461
|
+
return e.length <= G ? e : Array.from({ length: G }, (t, n) => e[Math.round(n * (e.length - 1) / 63)]);
|
|
461
462
|
}
|
|
462
|
-
function
|
|
463
|
+
function we(e) {
|
|
463
464
|
let t = e;
|
|
464
465
|
for (; t;) {
|
|
465
466
|
let e = t.spec.data;
|
|
@@ -467,32 +468,32 @@ function Te(e) {
|
|
|
467
468
|
t = t.dataParent;
|
|
468
469
|
}
|
|
469
470
|
}
|
|
470
|
-
function
|
|
471
|
+
function Te(e) {
|
|
471
472
|
return e != null && "field" in e && (e.field == "position0" || e.field == "position1");
|
|
472
473
|
}
|
|
473
474
|
//#endregion
|
|
474
475
|
//#region ../core/src/rendering/svg/renderers/index.js
|
|
475
|
-
var
|
|
476
|
-
["arrow",
|
|
477
|
-
["link",
|
|
478
|
-
["point",
|
|
479
|
-
["rect",
|
|
480
|
-
["rule",
|
|
481
|
-
["text",
|
|
482
|
-
["tick",
|
|
476
|
+
var Ee = /* @__PURE__ */ new Map([
|
|
477
|
+
["arrow", de],
|
|
478
|
+
["link", me],
|
|
479
|
+
["point", z],
|
|
480
|
+
["rect", ve],
|
|
481
|
+
["rule", W],
|
|
482
|
+
["text", be],
|
|
483
|
+
["tick", W]
|
|
483
484
|
]);
|
|
484
|
-
function
|
|
485
|
+
function De(e, t) {
|
|
485
486
|
if (e.getType() == "rect") {
|
|
486
|
-
let n =
|
|
487
|
+
let n = Se(e, t);
|
|
487
488
|
if (n !== void 0) return n;
|
|
488
489
|
}
|
|
489
|
-
let n =
|
|
490
|
+
let n = Ee.get(e.getType());
|
|
490
491
|
if (!n) throw Error(`SVG rendering is not implemented for mark type "${e.getType()}". View: ${e.unitView.getPathString()}`);
|
|
491
492
|
return n(e, t);
|
|
492
493
|
}
|
|
493
494
|
//#endregion
|
|
494
495
|
//#region ../core/src/rendering/svg/rectHatchPattern.js
|
|
495
|
-
function
|
|
496
|
+
function Oe(e, t) {
|
|
496
497
|
let n = t.strokeWidth, r = [
|
|
497
498
|
"dots",
|
|
498
499
|
"rings",
|
|
@@ -505,31 +506,31 @@ function ke(e, t) {
|
|
|
505
506
|
"vertical",
|
|
506
507
|
"horizontal",
|
|
507
508
|
"grid"
|
|
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 =
|
|
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", {
|
|
509
510
|
id: e,
|
|
510
511
|
x: 0,
|
|
511
512
|
y: 0,
|
|
512
|
-
width:
|
|
513
|
-
height:
|
|
513
|
+
width: N(c),
|
|
514
|
+
height: N(l),
|
|
514
515
|
patternUnits: "userSpaceOnUse"
|
|
515
516
|
});
|
|
516
|
-
u.appendChild(
|
|
517
|
-
width:
|
|
518
|
-
height:
|
|
517
|
+
u.appendChild(F("rect", {
|
|
518
|
+
width: N(c),
|
|
519
|
+
height: N(l),
|
|
519
520
|
fill: t.fill,
|
|
520
|
-
"fill-opacity":
|
|
521
|
+
"fill-opacity": M(t.fillOpacity)
|
|
521
522
|
}));
|
|
522
|
-
let d =
|
|
523
|
+
let d = F("g", {
|
|
523
524
|
fill: "none",
|
|
524
525
|
stroke: t.stroke,
|
|
525
|
-
"stroke-opacity":
|
|
526
|
-
"stroke-width":
|
|
526
|
+
"stroke-opacity": M(t.strokeOpacity),
|
|
527
|
+
"stroke-width": N(s),
|
|
527
528
|
"stroke-linecap": "square"
|
|
528
529
|
});
|
|
529
|
-
return
|
|
530
|
+
return ke(d, t.type, o, s), u.appendChild(d), u;
|
|
530
531
|
}
|
|
531
|
-
function
|
|
532
|
-
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) => {
|
|
533
534
|
for (let t of [
|
|
534
535
|
-n,
|
|
535
536
|
0,
|
|
@@ -558,10 +559,10 @@ function Ae(e, t, n, r) {
|
|
|
558
559
|
case "dots":
|
|
559
560
|
case "rings":
|
|
560
561
|
case "ringsLarge": {
|
|
561
|
-
let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(
|
|
562
|
-
cx:
|
|
563
|
-
cy:
|
|
564
|
-
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)
|
|
565
566
|
}));
|
|
566
567
|
i(n / 2, 0), i(n / 2, n * 2), i(0, n), i(n, n);
|
|
567
568
|
break;
|
|
@@ -571,47 +572,47 @@ function Ae(e, t, n, r) {
|
|
|
571
572
|
}
|
|
572
573
|
//#endregion
|
|
573
574
|
//#region ../core/src/rendering/svg/linkArcFadeMask.js
|
|
574
|
-
function
|
|
575
|
-
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", {
|
|
576
577
|
id: d,
|
|
577
578
|
gradientUnits: "userSpaceOnUse",
|
|
578
|
-
x1:
|
|
579
|
-
y1:
|
|
580
|
-
x2:
|
|
581
|
-
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),
|
|
582
583
|
spreadMethod: "pad"
|
|
583
584
|
});
|
|
584
|
-
for (let { offset: e, opacity: t } of
|
|
585
|
-
offset:
|
|
585
|
+
for (let { offset: e, opacity: t } of ue(s, c)) f.appendChild(F("stop", {
|
|
586
|
+
offset: K(e, 3),
|
|
586
587
|
"stop-color": "white",
|
|
587
|
-
"stop-opacity":
|
|
588
|
+
"stop-opacity": K(t, 3)
|
|
588
589
|
}));
|
|
589
|
-
let p =
|
|
590
|
+
let p = F("mask", {
|
|
590
591
|
id: e,
|
|
591
592
|
x: 0,
|
|
592
593
|
y: 0,
|
|
593
|
-
width:
|
|
594
|
-
height:
|
|
594
|
+
width: N(t),
|
|
595
|
+
height: N(n),
|
|
595
596
|
maskUnits: "userSpaceOnUse",
|
|
596
597
|
maskContentUnits: "userSpaceOnUse",
|
|
597
598
|
"mask-type": "luminance"
|
|
598
599
|
});
|
|
599
|
-
return p.appendChild(
|
|
600
|
-
width:
|
|
601
|
-
height:
|
|
600
|
+
return p.appendChild(F("rect", {
|
|
601
|
+
width: N(t),
|
|
602
|
+
height: N(n),
|
|
602
603
|
fill: `url(#${d})`
|
|
603
604
|
})), {
|
|
604
605
|
gradient: f,
|
|
605
606
|
mask: p
|
|
606
607
|
};
|
|
607
608
|
}
|
|
608
|
-
function
|
|
609
|
+
function K(e, t) {
|
|
609
610
|
let n = 10 ** t;
|
|
610
611
|
return Math.round(e * n) / n;
|
|
611
612
|
}
|
|
612
613
|
//#endregion
|
|
613
614
|
//#region ../core/src/rendering/svg/svgViewRenderingContext.js
|
|
614
|
-
var
|
|
615
|
+
var q = class extends s {
|
|
615
616
|
#e;
|
|
616
617
|
#t;
|
|
617
618
|
#n = [];
|
|
@@ -625,7 +626,7 @@ var K = class extends s {
|
|
|
625
626
|
#u = !1;
|
|
626
627
|
#d = /* @__PURE__ */ new Map();
|
|
627
628
|
#f = new f();
|
|
628
|
-
#p =
|
|
629
|
+
#p = F("g");
|
|
629
630
|
#m;
|
|
630
631
|
#h;
|
|
631
632
|
#g = [];
|
|
@@ -639,13 +640,13 @@ var K = class extends s {
|
|
|
639
640
|
#w = 0;
|
|
640
641
|
constructor(e, t) {
|
|
641
642
|
super(e), this.width = t.width, this.height = t.height, this.textMetrics = t.textMetrics, this.#h = t.maxVectorInstances;
|
|
642
|
-
let n =
|
|
643
|
-
this.#e =
|
|
644
|
-
xmlns:
|
|
643
|
+
let n = N(t.width), r = N(t.height);
|
|
644
|
+
this.#e = F("svg", {
|
|
645
|
+
xmlns: P,
|
|
645
646
|
width: n,
|
|
646
647
|
height: r,
|
|
647
648
|
viewBox: `0 0 ${n} ${r}`
|
|
648
|
-
}), this.#t =
|
|
649
|
+
}), this.#t = F("defs"), this.#e.appendChild(this.#t), t.background != null && this.#e.appendChild(F("rect", {
|
|
649
650
|
width: n,
|
|
650
651
|
height: r,
|
|
651
652
|
fill: t.background,
|
|
@@ -710,12 +711,12 @@ var K = class extends s {
|
|
|
710
711
|
if (o) {
|
|
711
712
|
if (o.parentNode !== this.currentNode) throw Error(`Sample-faceted view was rendered under multiple parents: ${r}`);
|
|
712
713
|
} else {
|
|
713
|
-
o =
|
|
714
|
-
id:
|
|
714
|
+
o = F("g", {
|
|
715
|
+
id: je(t.name, this.#v++),
|
|
715
716
|
"data-name": t.name,
|
|
716
717
|
"data-view-path": r
|
|
717
718
|
});
|
|
718
|
-
let e =
|
|
719
|
+
let e = F("title");
|
|
719
720
|
e.textContent = r, o.appendChild(e), this.currentNode.appendChild(o), a?.viewGroups.set(t, o);
|
|
720
721
|
}
|
|
721
722
|
this.#n.push({
|
|
@@ -743,7 +744,7 @@ var K = class extends s {
|
|
|
743
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();
|
|
744
745
|
if (p(r, i, this.currentCoords, this.#f, (e, t) => {
|
|
745
746
|
let n = (t, n = !1) => {
|
|
746
|
-
let i =
|
|
747
|
+
let i = De(r, {
|
|
747
748
|
coords: e,
|
|
748
749
|
data: t,
|
|
749
750
|
group: f,
|
|
@@ -769,7 +770,7 @@ var K = class extends s {
|
|
|
769
770
|
n(t);
|
|
770
771
|
return;
|
|
771
772
|
}
|
|
772
|
-
let i =
|
|
773
|
+
let i = ae(t, 0, t.length, _.predicate, _.passes);
|
|
773
774
|
for (let [e, t] of i.entries()) t.length !== 0 && n(t, e === 1);
|
|
774
775
|
}, (e) => this.#l.add(`SVG export could not resolve sample facet index ${e}. View: ${r.unitView.getPathString()}`)), !this.#u && !l && f.childElementCount > 0) {
|
|
775
776
|
let e = this.getClipPathUrl(o);
|
|
@@ -805,11 +806,11 @@ var K = class extends s {
|
|
|
805
806
|
e && (this.#g.push(e), this.#_ = void 0);
|
|
806
807
|
}
|
|
807
808
|
#D(e) {
|
|
808
|
-
let t = Me(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r =
|
|
809
|
+
let t = Me(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = F("g", {
|
|
809
810
|
id: `rasterized-${n.join("-")}-${this.#w++}`,
|
|
810
811
|
"data-name": `Rasterized ${n.join(", ")}`,
|
|
811
812
|
"data-rasterized": ""
|
|
812
|
-
}), i =
|
|
813
|
+
}), i = F("image", { preserveAspectRatio: "none" });
|
|
813
814
|
r.appendChild(i);
|
|
814
815
|
let a = e.anchor.parentNode;
|
|
815
816
|
t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r, Ne(a, t)), e.anchor.remove();
|
|
@@ -818,13 +819,13 @@ var K = class extends s {
|
|
|
818
819
|
}
|
|
819
820
|
#O(e, t) {
|
|
820
821
|
let n = this.#m;
|
|
821
|
-
if (!n) return
|
|
822
|
+
if (!n) return F("g", { "data-mark-type": e.getType() });
|
|
822
823
|
let r = n.markGroups.get(e);
|
|
823
824
|
r || (r = /* @__PURE__ */ new Map(), n.markGroups.set(e, r));
|
|
824
825
|
let i = t ?? "", a = r.get(i);
|
|
825
826
|
if (a) {
|
|
826
827
|
if (a.parentNode !== this.currentNode) throw Error(`Sample-faceted mark was rendered under multiple parents: ${e.unitView.getPathString()}`);
|
|
827
|
-
} 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);
|
|
828
829
|
return a;
|
|
829
830
|
}
|
|
830
831
|
getClipPathUrl(e) {
|
|
@@ -834,14 +835,14 @@ var K = class extends s {
|
|
|
834
835
|
e.clipY ? t.y : 0,
|
|
835
836
|
e.clipX ? t.width : this.width,
|
|
836
837
|
e.clipY ? t.height : this.height
|
|
837
|
-
].map(
|
|
838
|
+
].map(N), r = n.join(","), i = this.#r.get(r);
|
|
838
839
|
if (!i) {
|
|
839
840
|
i = "clip-" + this.#y++;
|
|
840
|
-
let e =
|
|
841
|
+
let e = F("clipPath", {
|
|
841
842
|
id: i,
|
|
842
843
|
clipPathUnits: "userSpaceOnUse"
|
|
843
844
|
});
|
|
844
|
-
e.appendChild(
|
|
845
|
+
e.appendChild(F("rect", {
|
|
845
846
|
x: n[0],
|
|
846
847
|
y: n[1],
|
|
847
848
|
width: n[2],
|
|
@@ -851,28 +852,28 @@ var K = class extends s {
|
|
|
851
852
|
return `url(#${i})`;
|
|
852
853
|
}
|
|
853
854
|
getShadowFilterUrl(e) {
|
|
854
|
-
let t =
|
|
855
|
+
let t = N(Math.max(e.blur / 2.5, .25)), n = N(e.offsetX), r = N(e.offsetY), i = [
|
|
855
856
|
t,
|
|
856
857
|
n,
|
|
857
858
|
r
|
|
858
859
|
].join(","), a = this.#a.get(i);
|
|
859
860
|
if (!a) {
|
|
860
861
|
a = "shadow-" + this.#x++;
|
|
861
|
-
let e =
|
|
862
|
+
let e = F("filter", {
|
|
862
863
|
id: a,
|
|
863
864
|
x: 0,
|
|
864
865
|
y: 0,
|
|
865
|
-
width:
|
|
866
|
-
height:
|
|
866
|
+
width: N(this.width),
|
|
867
|
+
height: N(this.height),
|
|
867
868
|
filterUnits: "userSpaceOnUse",
|
|
868
869
|
primitiveUnits: "userSpaceOnUse",
|
|
869
870
|
"color-interpolation-filters": "sRGB"
|
|
870
871
|
});
|
|
871
|
-
e.appendChild(
|
|
872
|
+
e.appendChild(F("feGaussianBlur", {
|
|
872
873
|
in: "SourceGraphic",
|
|
873
874
|
stdDeviation: t,
|
|
874
875
|
result: "blur"
|
|
875
|
-
})), e.appendChild(
|
|
876
|
+
})), e.appendChild(F("feOffset", {
|
|
876
877
|
in: "blur",
|
|
877
878
|
dx: n,
|
|
878
879
|
dy: r,
|
|
@@ -885,12 +886,12 @@ var K = class extends s {
|
|
|
885
886
|
let t = this.#o.get(e);
|
|
886
887
|
if (!t) {
|
|
887
888
|
t = "shadow-clip-" + this.#y++;
|
|
888
|
-
let n =
|
|
889
|
+
let n = F("clipPath", {
|
|
889
890
|
id: t,
|
|
890
891
|
clipPathUnits: "userSpaceOnUse"
|
|
891
892
|
});
|
|
892
|
-
n.appendChild(
|
|
893
|
-
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}`,
|
|
894
895
|
"clip-rule": "evenodd",
|
|
895
896
|
"fill-rule": "evenodd"
|
|
896
897
|
})), this.#t.appendChild(n), this.#o.set(e, t);
|
|
@@ -901,24 +902,24 @@ var K = class extends s {
|
|
|
901
902
|
let t = JSON.stringify([
|
|
902
903
|
e.type,
|
|
903
904
|
e.fill,
|
|
904
|
-
|
|
905
|
+
M(e.fillOpacity),
|
|
905
906
|
e.stroke,
|
|
906
|
-
|
|
907
|
-
|
|
907
|
+
M(e.strokeOpacity),
|
|
908
|
+
M(e.strokeWidth)
|
|
908
909
|
]), n = this.#s.get(t);
|
|
909
|
-
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})`;
|
|
910
911
|
}
|
|
911
912
|
getLegendGradientUrl(e) {
|
|
912
|
-
let t = "legend-gradient-" + this.#C++, n =
|
|
913
|
+
let t = "legend-gradient-" + this.#C++, n = F("linearGradient", {
|
|
913
914
|
id: t,
|
|
914
915
|
gradientUnits: "userSpaceOnUse",
|
|
915
|
-
x1:
|
|
916
|
-
y1:
|
|
917
|
-
x2:
|
|
918
|
-
y2:
|
|
916
|
+
x1: N(e.x1),
|
|
917
|
+
y1: N(e.y1),
|
|
918
|
+
x2: N(e.x2),
|
|
919
|
+
y2: N(e.y2)
|
|
919
920
|
});
|
|
920
|
-
for (let t of e.stops) n.appendChild(
|
|
921
|
-
offset:
|
|
921
|
+
for (let t of e.stops) n.appendChild(F("stop", {
|
|
922
|
+
offset: M(t.offset),
|
|
922
923
|
"stop-color": t.color
|
|
923
924
|
}));
|
|
924
925
|
return this.#t.appendChild(n), `url(#${t})`;
|
|
@@ -929,7 +930,7 @@ var K = class extends s {
|
|
|
929
930
|
let n = this.#c.get(t.key);
|
|
930
931
|
if (!n) {
|
|
931
932
|
n = "link-arc-fade-" + this.#b++;
|
|
932
|
-
let { gradient: e, mask: r } =
|
|
933
|
+
let { gradient: e, mask: r } = Ae(n, this.width, this.height, t);
|
|
933
934
|
this.#t.appendChild(e), this.#t.appendChild(r), this.#c.set(t.key, n);
|
|
934
935
|
}
|
|
935
936
|
return `url(#${n})`;
|
|
@@ -942,7 +943,7 @@ var K = class extends s {
|
|
|
942
943
|
let i = this.#i.get(r.view);
|
|
943
944
|
if (!i) {
|
|
944
945
|
i = "edge-fade-" + this.#b++;
|
|
945
|
-
let e =
|
|
946
|
+
let e = N(this.width), t = N(this.height), a = F("mask", {
|
|
946
947
|
id: i,
|
|
947
948
|
x: 0,
|
|
948
949
|
y: 0,
|
|
@@ -952,14 +953,14 @@ var K = class extends s {
|
|
|
952
953
|
maskContentUnits: "userSpaceOnUse",
|
|
953
954
|
"mask-type": "luminance"
|
|
954
955
|
});
|
|
955
|
-
a.appendChild(
|
|
956
|
+
a.appendChild(F("rect", {
|
|
956
957
|
width: e,
|
|
957
958
|
height: t,
|
|
958
959
|
fill: "white"
|
|
959
960
|
}));
|
|
960
961
|
for (let [o, s] of n) {
|
|
961
962
|
let n = i + "-" + o, c = Fe(n, o, s, r.coords);
|
|
962
|
-
this.#t.appendChild(c), a.appendChild(
|
|
963
|
+
this.#t.appendChild(c), a.appendChild(F("rect", {
|
|
963
964
|
width: e,
|
|
964
965
|
height: t,
|
|
965
966
|
fill: `url(#${n})`
|
|
@@ -984,7 +985,7 @@ var K = class extends s {
|
|
|
984
985
|
return t.coords;
|
|
985
986
|
}
|
|
986
987
|
};
|
|
987
|
-
function
|
|
988
|
+
function je(e, t) {
|
|
988
989
|
let n = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
989
990
|
return `${/^[A-Za-z_]/.test(n) ? n : n ? "view-" + n : "view"}-${t}`;
|
|
990
991
|
}
|
|
@@ -1009,19 +1010,19 @@ function Pe(e, t) {
|
|
|
1009
1010
|
}
|
|
1010
1011
|
}
|
|
1011
1012
|
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 =
|
|
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", {
|
|
1013
1014
|
id: e,
|
|
1014
1015
|
gradientUnits: "userSpaceOnUse",
|
|
1015
|
-
x1:
|
|
1016
|
-
y1:
|
|
1017
|
-
x2:
|
|
1018
|
-
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)
|
|
1019
1020
|
});
|
|
1020
|
-
return s.appendChild(
|
|
1021
|
+
return s.appendChild(F("stop", {
|
|
1021
1022
|
offset: 0,
|
|
1022
1023
|
"stop-color": "black",
|
|
1023
1024
|
"stop-opacity": 1
|
|
1024
|
-
})), s.appendChild(
|
|
1025
|
+
})), s.appendChild(F("stop", {
|
|
1025
1026
|
offset: 1,
|
|
1026
1027
|
"stop-color": "black",
|
|
1027
1028
|
"stop-opacity": 0
|
|
@@ -1030,7 +1031,7 @@ function Fe(e, t, n, r) {
|
|
|
1030
1031
|
//#endregion
|
|
1031
1032
|
//#region ../core/src/rendering/svg/index.js
|
|
1032
1033
|
function Y({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "white", textMetrics: i = e.context.textMetrics }) {
|
|
1033
|
-
let a = new
|
|
1034
|
+
let a = new q({ picking: !1 }, {
|
|
1034
1035
|
width: t,
|
|
1035
1036
|
height: n,
|
|
1036
1037
|
background: r,
|
|
@@ -1042,7 +1043,7 @@ function Y({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "wh
|
|
|
1042
1043
|
};
|
|
1043
1044
|
}
|
|
1044
1045
|
async function Ie({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
|
|
1045
|
-
let r = new
|
|
1046
|
+
let r = new q({ picking: !1 }, {
|
|
1046
1047
|
width: t,
|
|
1047
1048
|
height: n,
|
|
1048
1049
|
background: null,
|
|
@@ -1076,20 +1077,20 @@ async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
|
|
|
1076
1077
|
maxVectorInstances: s,
|
|
1077
1078
|
pixelRatio: l
|
|
1078
1079
|
});
|
|
1079
|
-
let d = new
|
|
1080
|
+
let d = new q({ picking: !1 }, {
|
|
1080
1081
|
width: n,
|
|
1081
1082
|
height: r,
|
|
1082
1083
|
background: i,
|
|
1083
1084
|
maxVectorInstances: s,
|
|
1084
1085
|
textMetrics: u
|
|
1085
|
-
}), f =
|
|
1086
|
-
d.beginInstanceCounting(),
|
|
1087
|
-
let
|
|
1088
|
-
if (
|
|
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 {
|
|
1089
1090
|
await t({
|
|
1090
|
-
runs:
|
|
1091
|
+
runs: m,
|
|
1091
1092
|
viewRoot: e,
|
|
1092
|
-
layoutResult:
|
|
1093
|
+
layoutResult: p,
|
|
1093
1094
|
textMetrics: u,
|
|
1094
1095
|
logicalWidth: n,
|
|
1095
1096
|
logicalHeight: r,
|
|
@@ -1108,7 +1109,7 @@ async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
|
|
|
1108
1109
|
return {
|
|
1109
1110
|
svg: d.getSvg(),
|
|
1110
1111
|
warnings: d.getWarnings(),
|
|
1111
|
-
rasterized:
|
|
1112
|
+
rasterized: m.map((e) => ({
|
|
1112
1113
|
targets: e.targets.map((e) => ({
|
|
1113
1114
|
markType: e.mark.getType(),
|
|
1114
1115
|
instanceCount: e.instanceCount
|
|
@@ -1122,7 +1123,7 @@ async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
|
|
|
1122
1123
|
async function Z(e) {
|
|
1123
1124
|
if (!document.fonts) return e.context.textMetrics;
|
|
1124
1125
|
let t = te(document);
|
|
1125
|
-
return await
|
|
1126
|
+
return await re(t, e), t;
|
|
1126
1127
|
}
|
|
1127
1128
|
function Q(e) {
|
|
1128
1129
|
let t = Y(e);
|