@undp/data-viz 2.2.3 → 2.3.1

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.
Files changed (60) hide show
  1. package/dist/BiVariateChoroplethMap.cjs +1 -1
  2. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  3. package/dist/BiVariateChoroplethMap.d.ts +4 -0
  4. package/dist/BiVariateChoroplethMap.js +328 -401
  5. package/dist/BiVariateChoroplethMap.js.map +1 -1
  6. package/dist/ChoroplethMap.cjs +1 -1
  7. package/dist/ChoroplethMap.cjs.map +1 -1
  8. package/dist/ChoroplethMap.d.ts +4 -0
  9. package/dist/ChoroplethMap.js +341 -416
  10. package/dist/ChoroplethMap.js.map +1 -1
  11. package/dist/Data/01.json +4042 -0
  12. package/dist/Data/mapData.json +4543 -0
  13. package/dist/Data/testMap.json +361 -0
  14. package/dist/DotDensityMap.cjs +1 -1
  15. package/dist/DotDensityMap.cjs.map +1 -1
  16. package/dist/DotDensityMap.d.ts +4 -0
  17. package/dist/DotDensityMap.js +297 -311
  18. package/dist/DotDensityMap.js.map +1 -1
  19. package/dist/{GraphEl-C1Rz1V__.js → GraphEl-L5hNe7wJ.js} +25 -17
  20. package/dist/GraphEl-L5hNe7wJ.js.map +1 -0
  21. package/dist/GraphEl-ic8C5Ksc.cjs +2 -0
  22. package/dist/GraphEl-ic8C5Ksc.cjs.map +1 -0
  23. package/dist/GriddedGraphs.cjs +1 -1
  24. package/dist/GriddedGraphs.d.ts +2 -0
  25. package/dist/GriddedGraphs.js +1 -1
  26. package/dist/GriddedGraphsFromConfig.d.ts +2 -0
  27. package/dist/HybridMap.cjs +1 -1
  28. package/dist/HybridMap.cjs.map +1 -1
  29. package/dist/HybridMap.d.ts +4 -0
  30. package/dist/HybridMap.js +398 -445
  31. package/dist/HybridMap.js.map +1 -1
  32. package/dist/MultiGraphDashboard.d.ts +2 -0
  33. package/dist/MultiGraphDashboardFromConfig.d.ts +2 -0
  34. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +2 -0
  35. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +2 -0
  36. package/dist/PerformanceIntensiveScrollStory.d.ts +2 -0
  37. package/dist/ScrollStory.d.ts +2 -0
  38. package/dist/SingleGraphDashboard.cjs +1 -1
  39. package/dist/SingleGraphDashboard.d.ts +2 -0
  40. package/dist/SingleGraphDashboard.js +1 -1
  41. package/dist/SingleGraphDashboardFromConfig.d.ts +2 -0
  42. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +2 -0
  43. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +2 -0
  44. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +2 -0
  45. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +2 -0
  46. package/dist/Types.d.ts +2 -0
  47. package/dist/index-DLFt97gy.cjs +2 -0
  48. package/dist/index-DLFt97gy.cjs.map +1 -0
  49. package/dist/index-Dp_SfsUA.js +2344 -0
  50. package/dist/index-Dp_SfsUA.js.map +1 -0
  51. package/dist/index.d.ts +18 -0
  52. package/package.json +2 -1
  53. package/readme.md +0 -7
  54. package/dist/GraphEl-BZbunD1_.cjs +0 -2
  55. package/dist/GraphEl-BZbunD1_.cjs.map +0 -1
  56. package/dist/GraphEl-C1Rz1V__.js.map +0 -1
  57. package/dist/zoom-5AkJSuWO.js +0 -1864
  58. package/dist/zoom-5AkJSuWO.js.map +0 -1
  59. package/dist/zoom-ChcvXFIz.cjs +0 -2
  60. package/dist/zoom-ChcvXFIz.cjs.map +0 -1
@@ -1,1864 +0,0 @@
1
- import { c as ee } from "./index-DCsFBfJ_.js";
2
- import { T as ie, d as Xn, t as re, n as oe } from "./timer-B39XOBYL.js";
3
- import { i as lt, a as cn, b as ue, d as fn } from "./string-C_xJ4Wg4.js";
4
- import { s as st, n as Cn, m as ae, a as le, b as se, c as Ft, d as _t } from "./select-DKy99ogv.js";
5
- import { p as at } from "./pointer-CWRWOsrb.js";
6
- class ce {
7
- constructor() {
8
- this._partials = new Float64Array(32), this._n = 0;
9
- }
10
- add(n) {
11
- const e = this._partials;
12
- let i = 0;
13
- for (let r = 0; r < this._n && r < 32; r++) {
14
- const a = e[r], o = n + a, s = Math.abs(n) < Math.abs(a) ? n - (o - a) : a - (o - n);
15
- s && (e[i++] = s), n = o;
16
- }
17
- return e[i] = n, this._n = i + 1, this;
18
- }
19
- valueOf() {
20
- const n = this._partials;
21
- let e = this._n, i, r, a, o = 0;
22
- if (e > 0) {
23
- for (o = n[--e]; e > 0 && (i = o, r = n[--e], o = i + r, a = r - (o - i), !a); )
24
- ;
25
- e > 0 && (a < 0 && n[e - 1] < 0 || a > 0 && n[e - 1] > 0) && (r = a * 2, i = o + r, r == i - o && (o = i));
26
- }
27
- return o;
28
- }
29
- }
30
- function* fe(t) {
31
- for (const n of t)
32
- yield* n;
33
- }
34
- function kn(t) {
35
- return Array.from(fe(t));
36
- }
37
- var hn = 180 / Math.PI, $t = {
38
- translateX: 0,
39
- translateY: 0,
40
- rotate: 0,
41
- skewX: 0,
42
- scaleX: 1,
43
- scaleY: 1
44
- };
45
- function Yn(t, n, e, i, r, a) {
46
- var o, s, g;
47
- return (o = Math.sqrt(t * t + n * n)) && (t /= o, n /= o), (g = t * e + n * i) && (e -= t * g, i -= n * g), (s = Math.sqrt(e * e + i * i)) && (e /= s, i /= s, g /= s), t * i < n * e && (t = -t, n = -n, g = -g, o = -o), {
48
- translateX: r,
49
- translateY: a,
50
- rotate: Math.atan2(n, t) * hn,
51
- skewX: Math.atan(g) * hn,
52
- scaleX: o,
53
- scaleY: s
54
- };
55
- }
56
- var St;
57
- function he(t) {
58
- const n = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + "");
59
- return n.isIdentity ? $t : Yn(n.a, n.b, n.c, n.d, n.e, n.f);
60
- }
61
- function pe(t) {
62
- return t == null || (St || (St = document.createElementNS("http://www.w3.org/2000/svg", "g")), St.setAttribute("transform", t), !(t = St.transform.baseVal.consolidate())) ? $t : (t = t.matrix, Yn(t.a, t.b, t.c, t.d, t.e, t.f));
63
- }
64
- function qn(t, n, e, i) {
65
- function r(c) {
66
- return c.length ? c.pop() + " " : "";
67
- }
68
- function a(c, u, f, l, h, y) {
69
- if (c !== f || u !== l) {
70
- var w = h.push("translate(", null, n, null, e);
71
- y.push({ i: w - 4, x: lt(c, f) }, { i: w - 2, x: lt(u, l) });
72
- } else (f || l) && h.push("translate(" + f + n + l + e);
73
- }
74
- function o(c, u, f, l) {
75
- c !== u ? (c - u > 180 ? u += 360 : u - c > 180 && (c += 360), l.push({ i: f.push(r(f) + "rotate(", null, i) - 2, x: lt(c, u) })) : u && f.push(r(f) + "rotate(" + u + i);
76
- }
77
- function s(c, u, f, l) {
78
- c !== u ? l.push({ i: f.push(r(f) + "skewX(", null, i) - 2, x: lt(c, u) }) : u && f.push(r(f) + "skewX(" + u + i);
79
- }
80
- function g(c, u, f, l, h, y) {
81
- if (c !== f || u !== l) {
82
- var w = h.push(r(h) + "scale(", null, ",", null, ")");
83
- y.push({ i: w - 4, x: lt(c, f) }, { i: w - 2, x: lt(u, l) });
84
- } else (f !== 1 || l !== 1) && h.push(r(h) + "scale(" + f + "," + l + ")");
85
- }
86
- return function(c, u) {
87
- var f = [], l = [];
88
- return c = t(c), u = t(u), a(c.translateX, c.translateY, u.translateX, u.translateY, f, l), o(c.rotate, u.rotate, f, l), s(c.skewX, u.skewX, f, l), g(c.scaleX, c.scaleY, u.scaleX, u.scaleY, f, l), c = u = null, function(h) {
89
- for (var y = -1, w = l.length, _; ++y < w; ) f[(_ = l[y]).i] = _.x(h);
90
- return f.join("");
91
- };
92
- };
93
- }
94
- var ve = qn(he, "px, ", "px)", "deg)"), ge = qn(pe, ", ", ")", ")"), me = 1e-12;
95
- function pn(t) {
96
- return ((t = Math.exp(t)) + 1 / t) / 2;
97
- }
98
- function ye(t) {
99
- return ((t = Math.exp(t)) - 1 / t) / 2;
100
- }
101
- function de(t) {
102
- return ((t = Math.exp(2 * t)) - 1) / (t + 1);
103
- }
104
- const we = (function t(n, e, i) {
105
- function r(a, o) {
106
- var s = a[0], g = a[1], c = a[2], u = o[0], f = o[1], l = o[2], h = u - s, y = f - g, w = h * h + y * y, _, d;
107
- if (w < me)
108
- d = Math.log(l / c) / n, _ = function(D) {
109
- return [
110
- s + D * h,
111
- g + D * y,
112
- c * Math.exp(n * D * d)
113
- ];
114
- };
115
- else {
116
- var M = Math.sqrt(w), T = (l * l - c * c + i * w) / (2 * c * e * M), S = (l * l - c * c - i * w) / (2 * l * e * M), N = Math.log(Math.sqrt(T * T + 1) - T), A = Math.log(Math.sqrt(S * S + 1) - S);
117
- d = (A - N) / n, _ = function(D) {
118
- var X = D * d, C = pn(N), F = c / (e * M) * (C * de(n * X + N) - ye(N));
119
- return [
120
- s + F * h,
121
- g + F * y,
122
- c * C / pn(n * X + N)
123
- ];
124
- };
125
- }
126
- return _.duration = d * 1e3 * n / Math.SQRT2, _;
127
- }
128
- return r.rho = function(a) {
129
- var o = Math.max(1e-3, +a), s = o * o, g = s * s;
130
- return t(o, s, g);
131
- }, r;
132
- })(Math.SQRT2, 2, 4);
133
- function vn(t, n, e) {
134
- var i = new ie();
135
- return n = n == null ? 0 : +n, i.restart((r) => {
136
- i.stop(), t(r + n);
137
- }, n, e), i;
138
- }
139
- function _e(t, n = {}) {
140
- if (t.bbox != null && n.recompute !== !0)
141
- return t.bbox;
142
- const e = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
143
- return ee(t, (i) => {
144
- e[0] > i[0] && (e[0] = i[0]), e[1] > i[1] && (e[1] = i[1]), e[2] < i[0] && (e[2] = i[0]), e[3] < i[1] && (e[3] = i[1]);
145
- }), e;
146
- }
147
- var dr = _e, P = 1e-6, Fn = 1e-12, Y = Math.PI, Q = Y / 2, gn = Y / 4, Z = Y * 2, K = 180 / Y, U = Y / 180, L = Math.abs, On = Math.atan, ct = Math.atan2, V = Math.cos, Ee = Math.exp, Se = Math.log, q = Math.sin, Nt = Math.sign || function(t) {
148
- return t > 0 ? 1 : t < 0 ? -1 : 0;
149
- }, ut = Math.sqrt, Me = Math.tan;
150
- function ze(t) {
151
- return t > 1 ? 0 : t < -1 ? Y : Math.acos(t);
152
- }
153
- function j(t) {
154
- return t > 1 ? Q : t < -1 ? -Q : Math.asin(t);
155
- }
156
- function vt() {
157
- }
158
- function Xt(t, n) {
159
- t && yn.hasOwnProperty(t.type) && yn[t.type](t, n);
160
- }
161
- var mn = {
162
- Feature: function(t, n) {
163
- Xt(t.geometry, n);
164
- },
165
- FeatureCollection: function(t, n) {
166
- for (var e = t.features, i = -1, r = e.length; ++i < r; ) Xt(e[i].geometry, n);
167
- }
168
- }, yn = {
169
- Sphere: function(t, n) {
170
- n.sphere();
171
- },
172
- Point: function(t, n) {
173
- t = t.coordinates, n.point(t[0], t[1], t[2]);
174
- },
175
- MultiPoint: function(t, n) {
176
- for (var e = t.coordinates, i = -1, r = e.length; ++i < r; ) t = e[i], n.point(t[0], t[1], t[2]);
177
- },
178
- LineString: function(t, n) {
179
- Ht(t.coordinates, n, 0);
180
- },
181
- MultiLineString: function(t, n) {
182
- for (var e = t.coordinates, i = -1, r = e.length; ++i < r; ) Ht(e[i], n, 0);
183
- },
184
- Polygon: function(t, n) {
185
- dn(t.coordinates, n);
186
- },
187
- MultiPolygon: function(t, n) {
188
- for (var e = t.coordinates, i = -1, r = e.length; ++i < r; ) dn(e[i], n);
189
- },
190
- GeometryCollection: function(t, n) {
191
- for (var e = t.geometries, i = -1, r = e.length; ++i < r; ) Xt(e[i], n);
192
- }
193
- };
194
- function Ht(t, n, e) {
195
- var i = -1, r = t.length - e, a;
196
- for (n.lineStart(); ++i < r; ) a = t[i], n.point(a[0], a[1], a[2]);
197
- n.lineEnd();
198
- }
199
- function dn(t, n) {
200
- var e = -1, i = t.length;
201
- for (n.polygonStart(); ++e < i; ) Ht(t[e], n, 1);
202
- n.polygonEnd();
203
- }
204
- function Te(t, n) {
205
- t && mn.hasOwnProperty(t.type) ? mn[t.type](t, n) : Xt(t, n);
206
- }
207
- function Wt(t) {
208
- return [ct(t[1], t[0]), j(t[2])];
209
- }
210
- function ft(t) {
211
- var n = t[0], e = t[1], i = V(e);
212
- return [i * V(n), i * q(n), q(e)];
213
- }
214
- function Mt(t, n) {
215
- return t[0] * n[0] + t[1] * n[1] + t[2] * n[2];
216
- }
217
- function Ct(t, n) {
218
- return [t[1] * n[2] - t[2] * n[1], t[2] * n[0] - t[0] * n[2], t[0] * n[1] - t[1] * n[0]];
219
- }
220
- function Gt(t, n) {
221
- t[0] += n[0], t[1] += n[1], t[2] += n[2];
222
- }
223
- function zt(t, n) {
224
- return [t[0] * n, t[1] * n, t[2] * n];
225
- }
226
- function Kt(t) {
227
- var n = ut(t[0] * t[0] + t[1] * t[1] + t[2] * t[2]);
228
- t[0] /= n, t[1] /= n, t[2] /= n;
229
- }
230
- function Qt(t, n) {
231
- function e(i, r) {
232
- return i = t(i, r), n(i[0], i[1]);
233
- }
234
- return t.invert && n.invert && (e.invert = function(i, r) {
235
- return i = n.invert(i, r), i && t.invert(i[0], i[1]);
236
- }), e;
237
- }
238
- function Zt(t, n) {
239
- return L(t) > Y && (t -= Math.round(t / Z) * Z), [t, n];
240
- }
241
- Zt.invert = Zt;
242
- function Vn(t, n, e) {
243
- return (t %= Z) ? n || e ? Qt(_n(t), En(n, e)) : _n(t) : n || e ? En(n, e) : Zt;
244
- }
245
- function wn(t) {
246
- return function(n, e) {
247
- return n += t, L(n) > Y && (n -= Math.round(n / Z) * Z), [n, e];
248
- };
249
- }
250
- function _n(t) {
251
- var n = wn(t);
252
- return n.invert = wn(-t), n;
253
- }
254
- function En(t, n) {
255
- var e = V(t), i = q(t), r = V(n), a = q(n);
256
- function o(s, g) {
257
- var c = V(g), u = V(s) * c, f = q(s) * c, l = q(g), h = l * e + u * i;
258
- return [
259
- ct(f * r - h * a, u * e - l * i),
260
- j(h * r + f * a)
261
- ];
262
- }
263
- return o.invert = function(s, g) {
264
- var c = V(g), u = V(s) * c, f = q(s) * c, l = q(g), h = l * r - f * a;
265
- return [
266
- ct(f * r + l * a, u * e + h * i),
267
- j(h * e - u * i)
268
- ];
269
- }, o;
270
- }
271
- function Ae(t) {
272
- t = Vn(t[0] * U, t[1] * U, t.length > 2 ? t[2] * U : 0);
273
- function n(e) {
274
- return e = t(e[0] * U, e[1] * U), e[0] *= K, e[1] *= K, e;
275
- }
276
- return n.invert = function(e) {
277
- return e = t.invert(e[0] * U, e[1] * U), e[0] *= K, e[1] *= K, e;
278
- }, n;
279
- }
280
- function Ie(t, n, e, i, r, a) {
281
- if (e) {
282
- var o = V(n), s = q(n), g = i * e;
283
- r == null ? (r = n + i * Z, a = n - g / 2) : (r = Sn(o, r), a = Sn(o, a), (i > 0 ? r < a : r > a) && (r += i * Z));
284
- for (var c, u = r; i > 0 ? u > a : u < a; u -= g)
285
- c = Wt([o, -s * V(u), -s * q(u)]), t.point(c[0], c[1]);
286
- }
287
- }
288
- function Sn(t, n) {
289
- n = ft(n), n[0] -= t, Kt(n);
290
- var e = ze(-n[1]);
291
- return ((-n[2] < 0 ? -e : e) + Z - P) % Z;
292
- }
293
- function Ln() {
294
- var t = [], n;
295
- return {
296
- point: function(e, i, r) {
297
- n.push([e, i, r]);
298
- },
299
- lineStart: function() {
300
- t.push(n = []);
301
- },
302
- lineEnd: vt,
303
- rejoin: function() {
304
- t.length > 1 && t.push(t.pop().concat(t.shift()));
305
- },
306
- result: function() {
307
- var e = t;
308
- return t = [], n = null, e;
309
- }
310
- };
311
- }
312
- function xt(t, n) {
313
- return L(t[0] - n[0]) < P && L(t[1] - n[1]) < P;
314
- }
315
- function Tt(t, n, e, i) {
316
- this.x = t, this.z = n, this.o = e, this.e = i, this.v = !1, this.n = this.p = null;
317
- }
318
- function Gn(t, n, e, i, r) {
319
- var a = [], o = [], s, g;
320
- if (t.forEach(function(y) {
321
- if (!((w = y.length - 1) <= 0)) {
322
- var w, _ = y[0], d = y[w], M;
323
- if (xt(_, d)) {
324
- if (!_[2] && !d[2]) {
325
- for (r.lineStart(), s = 0; s < w; ++s) r.point((_ = y[s])[0], _[1]);
326
- r.lineEnd();
327
- return;
328
- }
329
- d[0] += 2 * P;
330
- }
331
- a.push(M = new Tt(_, y, null, !0)), o.push(M.o = new Tt(_, null, M, !1)), a.push(M = new Tt(d, y, null, !1)), o.push(M.o = new Tt(d, null, M, !0));
332
- }
333
- }), !!a.length) {
334
- for (o.sort(n), Mn(a), Mn(o), s = 0, g = o.length; s < g; ++s)
335
- o[s].e = e = !e;
336
- for (var c = a[0], u, f; ; ) {
337
- for (var l = c, h = !0; l.v; ) if ((l = l.n) === c) return;
338
- u = l.z, r.lineStart();
339
- do {
340
- if (l.v = l.o.v = !0, l.e) {
341
- if (h)
342
- for (s = 0, g = u.length; s < g; ++s) r.point((f = u[s])[0], f[1]);
343
- else
344
- i(l.x, l.n.x, 1, r);
345
- l = l.n;
346
- } else {
347
- if (h)
348
- for (u = l.p.z, s = u.length - 1; s >= 0; --s) r.point((f = u[s])[0], f[1]);
349
- else
350
- i(l.x, l.p.x, -1, r);
351
- l = l.p;
352
- }
353
- l = l.o, u = l.z, h = !h;
354
- } while (!l.v);
355
- r.lineEnd();
356
- }
357
- }
358
- }
359
- function Mn(t) {
360
- if (n = t.length) {
361
- for (var n, e = 0, i = t[0], r; ++e < n; )
362
- i.n = r = t[e], r.p = i, i = r;
363
- i.n = r = t[0], r.p = i;
364
- }
365
- }
366
- function Bt(t) {
367
- return L(t[0]) <= Y ? t[0] : Nt(t[0]) * ((L(t[0]) + Y) % Z - Y);
368
- }
369
- function Ne(t, n) {
370
- var e = Bt(n), i = n[1], r = q(i), a = [q(e), -V(e), 0], o = 0, s = 0, g = new ce();
371
- r === 1 ? i = Q + P : r === -1 && (i = -Q - P);
372
- for (var c = 0, u = t.length; c < u; ++c)
373
- if (l = (f = t[c]).length)
374
- for (var f, l, h = f[l - 1], y = Bt(h), w = h[1] / 2 + gn, _ = q(w), d = V(w), M = 0; M < l; ++M, y = S, _ = A, d = D, h = T) {
375
- var T = f[M], S = Bt(T), N = T[1] / 2 + gn, A = q(N), D = V(N), X = S - y, C = X >= 0 ? 1 : -1, F = C * X, x = F > Y, W = _ * A;
376
- if (g.add(ct(W * C * q(F), d * D + W * V(F))), o += x ? X + C * Z : X, x ^ y >= e ^ S >= e) {
377
- var G = Ct(ft(h), ft(T));
378
- Kt(G);
379
- var p = Ct(a, G);
380
- Kt(p);
381
- var v = (x ^ X >= 0 ? -1 : 1) * j(p[2]);
382
- (i > v || i === v && (G[0] || G[1])) && (s += x ^ X >= 0 ? 1 : -1);
383
- }
384
- }
385
- return (o < -P || o < P && g < -Fn) ^ s & 1;
386
- }
387
- function Bn(t, n, e, i) {
388
- return function(r) {
389
- var a = n(r), o = Ln(), s = n(o), g = !1, c, u, f, l = {
390
- point: h,
391
- lineStart: w,
392
- lineEnd: _,
393
- polygonStart: function() {
394
- l.point = d, l.lineStart = M, l.lineEnd = T, u = [], c = [];
395
- },
396
- polygonEnd: function() {
397
- l.point = h, l.lineStart = w, l.lineEnd = _, u = kn(u);
398
- var S = Ne(c, i);
399
- u.length ? (g || (r.polygonStart(), g = !0), Gn(u, Re, S, e, r)) : S && (g || (r.polygonStart(), g = !0), r.lineStart(), e(null, null, 1, r), r.lineEnd()), g && (r.polygonEnd(), g = !1), u = c = null;
400
- },
401
- sphere: function() {
402
- r.polygonStart(), r.lineStart(), e(null, null, 1, r), r.lineEnd(), r.polygonEnd();
403
- }
404
- };
405
- function h(S, N) {
406
- t(S, N) && r.point(S, N);
407
- }
408
- function y(S, N) {
409
- a.point(S, N);
410
- }
411
- function w() {
412
- l.point = y, a.lineStart();
413
- }
414
- function _() {
415
- l.point = h, a.lineEnd();
416
- }
417
- function d(S, N) {
418
- f.push([S, N]), s.point(S, N);
419
- }
420
- function M() {
421
- s.lineStart(), f = [];
422
- }
423
- function T() {
424
- d(f[0][0], f[0][1]), s.lineEnd();
425
- var S = s.clean(), N = o.result(), A, D = N.length, X, C, F;
426
- if (f.pop(), c.push(f), f = null, !!D) {
427
- if (S & 1) {
428
- if (C = N[0], (X = C.length - 1) > 0) {
429
- for (g || (r.polygonStart(), g = !0), r.lineStart(), A = 0; A < X; ++A) r.point((F = C[A])[0], F[1]);
430
- r.lineEnd();
431
- }
432
- return;
433
- }
434
- D > 1 && S & 2 && N.push(N.pop().concat(N.shift())), u.push(N.filter(xe));
435
- }
436
- }
437
- return l;
438
- };
439
- }
440
- function xe(t) {
441
- return t.length > 1;
442
- }
443
- function Re(t, n) {
444
- return ((t = t.x)[0] < 0 ? t[1] - Q - P : Q - t[1]) - ((n = n.x)[0] < 0 ? n[1] - Q - P : Q - n[1]);
445
- }
446
- const zn = Bn(
447
- function() {
448
- return !0;
449
- },
450
- Pe,
451
- Xe,
452
- [-Y, -Q]
453
- );
454
- function Pe(t) {
455
- var n = NaN, e = NaN, i = NaN, r;
456
- return {
457
- lineStart: function() {
458
- t.lineStart(), r = 1;
459
- },
460
- point: function(a, o) {
461
- var s = a > 0 ? Y : -Y, g = L(a - n);
462
- L(g - Y) < P ? (t.point(n, e = (e + o) / 2 > 0 ? Q : -Q), t.point(i, e), t.lineEnd(), t.lineStart(), t.point(s, e), t.point(a, e), r = 0) : i !== s && g >= Y && (L(n - i) < P && (n -= i * P), L(a - s) < P && (a -= s * P), e = De(n, e, a, o), t.point(i, e), t.lineEnd(), t.lineStart(), t.point(s, e), r = 0), t.point(n = a, e = o), i = s;
463
- },
464
- lineEnd: function() {
465
- t.lineEnd(), n = e = NaN;
466
- },
467
- clean: function() {
468
- return 2 - r;
469
- }
470
- };
471
- }
472
- function De(t, n, e, i) {
473
- var r, a, o = q(t - e);
474
- return L(o) > P ? On((q(n) * (a = V(i)) * q(e) - q(i) * (r = V(n)) * q(t)) / (r * a * o)) : (n + i) / 2;
475
- }
476
- function Xe(t, n, e, i) {
477
- var r;
478
- if (t == null)
479
- r = e * Q, i.point(-Y, r), i.point(0, r), i.point(Y, r), i.point(Y, 0), i.point(Y, -r), i.point(0, -r), i.point(-Y, -r), i.point(-Y, 0), i.point(-Y, r);
480
- else if (L(t[0] - n[0]) > P) {
481
- var a = t[0] < n[0] ? Y : -Y;
482
- r = e * a / 2, i.point(-a, r), i.point(0, r), i.point(a, r);
483
- } else
484
- i.point(n[0], n[1]);
485
- }
486
- function Ce(t) {
487
- var n = V(t), e = 2 * U, i = n > 0, r = L(n) > P;
488
- function a(u, f, l, h) {
489
- Ie(h, t, e, l, u, f);
490
- }
491
- function o(u, f) {
492
- return V(u) * V(f) > n;
493
- }
494
- function s(u) {
495
- var f, l, h, y, w;
496
- return {
497
- lineStart: function() {
498
- y = h = !1, w = 1;
499
- },
500
- point: function(_, d) {
501
- var M = [_, d], T, S = o(_, d), N = i ? S ? 0 : c(_, d) : S ? c(_ + (_ < 0 ? Y : -Y), d) : 0;
502
- if (!f && (y = h = S) && u.lineStart(), S !== h && (T = g(f, M), (!T || xt(f, T) || xt(M, T)) && (M[2] = 1)), S !== h)
503
- w = 0, S ? (u.lineStart(), T = g(M, f), u.point(T[0], T[1])) : (T = g(f, M), u.point(T[0], T[1], 2), u.lineEnd()), f = T;
504
- else if (r && f && i ^ S) {
505
- var A;
506
- !(N & l) && (A = g(M, f, !0)) && (w = 0, i ? (u.lineStart(), u.point(A[0][0], A[0][1]), u.point(A[1][0], A[1][1]), u.lineEnd()) : (u.point(A[1][0], A[1][1]), u.lineEnd(), u.lineStart(), u.point(A[0][0], A[0][1], 3)));
507
- }
508
- S && (!f || !xt(f, M)) && u.point(M[0], M[1]), f = M, h = S, l = N;
509
- },
510
- lineEnd: function() {
511
- h && u.lineEnd(), f = null;
512
- },
513
- // Rejoin first and last segments if there were intersections and the first
514
- // and last points were visible.
515
- clean: function() {
516
- return w | (y && h) << 1;
517
- }
518
- };
519
- }
520
- function g(u, f, l) {
521
- var h = ft(u), y = ft(f), w = [1, 0, 0], _ = Ct(h, y), d = Mt(_, _), M = _[0], T = d - M * M;
522
- if (!T) return !l && u;
523
- var S = n * d / T, N = -n * M / T, A = Ct(w, _), D = zt(w, S), X = zt(_, N);
524
- Gt(D, X);
525
- var C = A, F = Mt(D, C), x = Mt(C, C), W = F * F - x * (Mt(D, D) - 1);
526
- if (!(W < 0)) {
527
- var G = ut(W), p = zt(C, (-F - G) / x);
528
- if (Gt(p, D), p = Wt(p), !l) return p;
529
- var v = u[0], m = f[0], E = u[1], z = f[1], I;
530
- m < v && (I = v, v = m, m = I);
531
- var R = m - v, k = L(R - Y) < P, O = k || R < P;
532
- if (!k && z < E && (I = E, E = z, z = I), O ? k ? E + z > 0 ^ p[1] < (L(p[0] - v) < P ? E : z) : E <= p[1] && p[1] <= z : R > Y ^ (v <= p[0] && p[0] <= m)) {
533
- var $ = zt(C, (-F + G) / x);
534
- return Gt($, D), [p, Wt($)];
535
- }
536
- }
537
- }
538
- function c(u, f) {
539
- var l = i ? t : Y - t, h = 0;
540
- return u < -l ? h |= 1 : u > l && (h |= 2), f < -l ? h |= 4 : f > l && (h |= 8), h;
541
- }
542
- return Bn(o, s, a, i ? [0, -t] : [-Y, t - Y]);
543
- }
544
- function ke(t, n, e, i, r, a) {
545
- var o = t[0], s = t[1], g = n[0], c = n[1], u = 0, f = 1, l = g - o, h = c - s, y;
546
- if (y = e - o, !(!l && y > 0)) {
547
- if (y /= l, l < 0) {
548
- if (y < u) return;
549
- y < f && (f = y);
550
- } else if (l > 0) {
551
- if (y > f) return;
552
- y > u && (u = y);
553
- }
554
- if (y = r - o, !(!l && y < 0)) {
555
- if (y /= l, l < 0) {
556
- if (y > f) return;
557
- y > u && (u = y);
558
- } else if (l > 0) {
559
- if (y < u) return;
560
- y < f && (f = y);
561
- }
562
- if (y = i - s, !(!h && y > 0)) {
563
- if (y /= h, h < 0) {
564
- if (y < u) return;
565
- y < f && (f = y);
566
- } else if (h > 0) {
567
- if (y > f) return;
568
- y > u && (u = y);
569
- }
570
- if (y = a - s, !(!h && y < 0)) {
571
- if (y /= h, h < 0) {
572
- if (y > f) return;
573
- y > u && (u = y);
574
- } else if (h > 0) {
575
- if (y < u) return;
576
- y < f && (f = y);
577
- }
578
- return u > 0 && (t[0] = o + u * l, t[1] = s + u * h), f < 1 && (n[0] = o + f * l, n[1] = s + f * h), !0;
579
- }
580
- }
581
- }
582
- }
583
- }
584
- var gt = 1e9, At = -gt;
585
- function Ye(t, n, e, i) {
586
- function r(c, u) {
587
- return t <= c && c <= e && n <= u && u <= i;
588
- }
589
- function a(c, u, f, l) {
590
- var h = 0, y = 0;
591
- if (c == null || (h = o(c, f)) !== (y = o(u, f)) || g(c, u) < 0 ^ f > 0)
592
- do
593
- l.point(h === 0 || h === 3 ? t : e, h > 1 ? i : n);
594
- while ((h = (h + f + 4) % 4) !== y);
595
- else
596
- l.point(u[0], u[1]);
597
- }
598
- function o(c, u) {
599
- return L(c[0] - t) < P ? u > 0 ? 0 : 3 : L(c[0] - e) < P ? u > 0 ? 2 : 1 : L(c[1] - n) < P ? u > 0 ? 1 : 0 : u > 0 ? 3 : 2;
600
- }
601
- function s(c, u) {
602
- return g(c.x, u.x);
603
- }
604
- function g(c, u) {
605
- var f = o(c, 1), l = o(u, 1);
606
- return f !== l ? f - l : f === 0 ? u[1] - c[1] : f === 1 ? c[0] - u[0] : f === 2 ? c[1] - u[1] : u[0] - c[0];
607
- }
608
- return function(c) {
609
- var u = c, f = Ln(), l, h, y, w, _, d, M, T, S, N, A, D = {
610
- point: X,
611
- lineStart: W,
612
- lineEnd: G,
613
- polygonStart: F,
614
- polygonEnd: x
615
- };
616
- function X(v, m) {
617
- r(v, m) && u.point(v, m);
618
- }
619
- function C() {
620
- for (var v = 0, m = 0, E = h.length; m < E; ++m)
621
- for (var z = h[m], I = 1, R = z.length, k = z[0], O, $, B = k[0], H = k[1]; I < R; ++I)
622
- O = B, $ = H, k = z[I], B = k[0], H = k[1], $ <= i ? H > i && (B - O) * (i - $) > (H - $) * (t - O) && ++v : H <= i && (B - O) * (i - $) < (H - $) * (t - O) && --v;
623
- return v;
624
- }
625
- function F() {
626
- u = f, l = [], h = [], A = !0;
627
- }
628
- function x() {
629
- var v = C(), m = A && v, E = (l = kn(l)).length;
630
- (m || E) && (c.polygonStart(), m && (c.lineStart(), a(null, null, 1, c), c.lineEnd()), E && Gn(l, s, v, a, c), c.polygonEnd()), u = c, l = h = y = null;
631
- }
632
- function W() {
633
- D.point = p, h && h.push(y = []), N = !0, S = !1, M = T = NaN;
634
- }
635
- function G() {
636
- l && (p(w, _), d && S && f.rejoin(), l.push(f.result())), D.point = X, S && u.lineEnd();
637
- }
638
- function p(v, m) {
639
- var E = r(v, m);
640
- if (h && y.push([v, m]), N)
641
- w = v, _ = m, d = E, N = !1, E && (u.lineStart(), u.point(v, m));
642
- else if (E && S) u.point(v, m);
643
- else {
644
- var z = [M = Math.max(At, Math.min(gt, M)), T = Math.max(At, Math.min(gt, T))], I = [v = Math.max(At, Math.min(gt, v)), m = Math.max(At, Math.min(gt, m))];
645
- ke(z, I, t, n, e, i) ? (S || (u.lineStart(), u.point(z[0], z[1])), u.point(I[0], I[1]), E || u.lineEnd(), A = !1) : E && (u.lineStart(), u.point(v, m), A = !1);
646
- }
647
- M = v, T = m, S = E;
648
- }
649
- return D;
650
- };
651
- }
652
- const Tn = (t) => t;
653
- var ht = 1 / 0, kt = ht, Et = -ht, Yt = Et, An = {
654
- point: qe,
655
- lineStart: vt,
656
- lineEnd: vt,
657
- polygonStart: vt,
658
- polygonEnd: vt,
659
- result: function() {
660
- var t = [[ht, kt], [Et, Yt]];
661
- return Et = Yt = -(kt = ht = 1 / 0), t;
662
- }
663
- };
664
- function qe(t, n) {
665
- t < ht && (ht = t), t > Et && (Et = t), n < kt && (kt = n), n > Yt && (Yt = n);
666
- }
667
- function rn(t) {
668
- return function(n) {
669
- var e = new Jt();
670
- for (var i in t) e[i] = t[i];
671
- return e.stream = n, e;
672
- };
673
- }
674
- function Jt() {
675
- }
676
- Jt.prototype = {
677
- constructor: Jt,
678
- point: function(t, n) {
679
- this.stream.point(t, n);
680
- },
681
- sphere: function() {
682
- this.stream.sphere();
683
- },
684
- lineStart: function() {
685
- this.stream.lineStart();
686
- },
687
- lineEnd: function() {
688
- this.stream.lineEnd();
689
- },
690
- polygonStart: function() {
691
- this.stream.polygonStart();
692
- },
693
- polygonEnd: function() {
694
- this.stream.polygonEnd();
695
- }
696
- };
697
- function on(t, n, e) {
698
- var i = t.clipExtent && t.clipExtent();
699
- return t.scale(150).translate([0, 0]), i != null && t.clipExtent(null), Te(e, t.stream(An)), n(An.result()), i != null && t.clipExtent(i), t;
700
- }
701
- function un(t, n, e) {
702
- return on(t, function(i) {
703
- var r = n[1][0] - n[0][0], a = n[1][1] - n[0][1], o = Math.min(r / (i[1][0] - i[0][0]), a / (i[1][1] - i[0][1])), s = +n[0][0] + (r - o * (i[1][0] + i[0][0])) / 2, g = +n[0][1] + (a - o * (i[1][1] + i[0][1])) / 2;
704
- t.scale(150 * o).translate([s, g]);
705
- }, e);
706
- }
707
- function Un(t, n, e) {
708
- return un(t, [[0, 0], n], e);
709
- }
710
- function $n(t, n, e) {
711
- return on(t, function(i) {
712
- var r = +n, a = r / (i[1][0] - i[0][0]), o = (r - a * (i[1][0] + i[0][0])) / 2, s = -a * i[0][1];
713
- t.scale(150 * a).translate([o, s]);
714
- }, e);
715
- }
716
- function Hn(t, n, e) {
717
- return on(t, function(i) {
718
- var r = +n, a = r / (i[1][1] - i[0][1]), o = -a * i[0][0], s = (r - a * (i[1][1] + i[0][1])) / 2;
719
- t.scale(150 * a).translate([o, s]);
720
- }, e);
721
- }
722
- var In = 16, Fe = V(30 * U);
723
- function Nn(t, n) {
724
- return +n ? Ve(t, n) : Oe(t);
725
- }
726
- function Oe(t) {
727
- return rn({
728
- point: function(n, e) {
729
- n = t(n, e), this.stream.point(n[0], n[1]);
730
- }
731
- });
732
- }
733
- function Ve(t, n) {
734
- function e(i, r, a, o, s, g, c, u, f, l, h, y, w, _) {
735
- var d = c - i, M = u - r, T = d * d + M * M;
736
- if (T > 4 * n && w--) {
737
- var S = o + l, N = s + h, A = g + y, D = ut(S * S + N * N + A * A), X = j(A /= D), C = L(L(A) - 1) < P || L(a - f) < P ? (a + f) / 2 : ct(N, S), F = t(C, X), x = F[0], W = F[1], G = x - i, p = W - r, v = M * G - d * p;
738
- (v * v / T > n || L((d * G + M * p) / T - 0.5) > 0.3 || o * l + s * h + g * y < Fe) && (e(i, r, a, o, s, g, x, W, C, S /= D, N /= D, A, w, _), _.point(x, W), e(x, W, C, S, N, A, c, u, f, l, h, y, w, _));
739
- }
740
- }
741
- return function(i) {
742
- var r, a, o, s, g, c, u, f, l, h, y, w, _ = {
743
- point: d,
744
- lineStart: M,
745
- lineEnd: S,
746
- polygonStart: function() {
747
- i.polygonStart(), _.lineStart = N;
748
- },
749
- polygonEnd: function() {
750
- i.polygonEnd(), _.lineStart = M;
751
- }
752
- };
753
- function d(X, C) {
754
- X = t(X, C), i.point(X[0], X[1]);
755
- }
756
- function M() {
757
- f = NaN, _.point = T, i.lineStart();
758
- }
759
- function T(X, C) {
760
- var F = ft([X, C]), x = t(X, C);
761
- e(f, l, u, h, y, w, f = x[0], l = x[1], u = X, h = F[0], y = F[1], w = F[2], In, i), i.point(f, l);
762
- }
763
- function S() {
764
- _.point = d, i.lineEnd();
765
- }
766
- function N() {
767
- M(), _.point = A, _.lineEnd = D;
768
- }
769
- function A(X, C) {
770
- T(r = X, C), a = f, o = l, s = h, g = y, c = w, _.point = T;
771
- }
772
- function D() {
773
- e(f, l, u, h, y, w, a, o, r, s, g, c, In, i), _.lineEnd = S, S();
774
- }
775
- return _;
776
- };
777
- }
778
- var Le = rn({
779
- point: function(t, n) {
780
- this.stream.point(t * U, n * U);
781
- }
782
- });
783
- function Ge(t) {
784
- return rn({
785
- point: function(n, e) {
786
- var i = t(n, e);
787
- return this.stream.point(i[0], i[1]);
788
- }
789
- });
790
- }
791
- function Be(t, n, e, i, r) {
792
- function a(o, s) {
793
- return o *= i, s *= r, [n + t * o, e - t * s];
794
- }
795
- return a.invert = function(o, s) {
796
- return [(o - n) / t * i, (e - s) / t * r];
797
- }, a;
798
- }
799
- function xn(t, n, e, i, r, a) {
800
- if (!a) return Be(t, n, e, i, r);
801
- var o = V(a), s = q(a), g = o * t, c = s * t, u = o / t, f = s / t, l = (s * e - o * n) / t, h = (s * n + o * e) / t;
802
- function y(w, _) {
803
- return w *= i, _ *= r, [g * w - c * _ + n, e - c * w - g * _];
804
- }
805
- return y.invert = function(w, _) {
806
- return [i * (u * w - f * _ + l), r * (h - f * w - u * _)];
807
- }, y;
808
- }
809
- function Ot(t) {
810
- return Wn(function() {
811
- return t;
812
- })();
813
- }
814
- function Wn(t) {
815
- var n, e = 150, i = 480, r = 250, a = 0, o = 0, s = 0, g = 0, c = 0, u, f = 0, l = 1, h = 1, y = null, w = zn, _ = null, d, M, T, S = Tn, N = 0.5, A, D, X, C, F;
816
- function x(v) {
817
- return X(v[0] * U, v[1] * U);
818
- }
819
- function W(v) {
820
- return v = X.invert(v[0], v[1]), v && [v[0] * K, v[1] * K];
821
- }
822
- x.stream = function(v) {
823
- return C && F === v ? C : C = Le(Ge(u)(w(A(S(F = v)))));
824
- }, x.preclip = function(v) {
825
- return arguments.length ? (w = v, y = void 0, p()) : w;
826
- }, x.postclip = function(v) {
827
- return arguments.length ? (S = v, _ = d = M = T = null, p()) : S;
828
- }, x.clipAngle = function(v) {
829
- return arguments.length ? (w = +v ? Ce(y = v * U) : (y = null, zn), p()) : y * K;
830
- }, x.clipExtent = function(v) {
831
- return arguments.length ? (S = v == null ? (_ = d = M = T = null, Tn) : Ye(_ = +v[0][0], d = +v[0][1], M = +v[1][0], T = +v[1][1]), p()) : _ == null ? null : [[_, d], [M, T]];
832
- }, x.scale = function(v) {
833
- return arguments.length ? (e = +v, G()) : e;
834
- }, x.translate = function(v) {
835
- return arguments.length ? (i = +v[0], r = +v[1], G()) : [i, r];
836
- }, x.center = function(v) {
837
- return arguments.length ? (a = v[0] % 360 * U, o = v[1] % 360 * U, G()) : [a * K, o * K];
838
- }, x.rotate = function(v) {
839
- return arguments.length ? (s = v[0] % 360 * U, g = v[1] % 360 * U, c = v.length > 2 ? v[2] % 360 * U : 0, G()) : [s * K, g * K, c * K];
840
- }, x.angle = function(v) {
841
- return arguments.length ? (f = v % 360 * U, G()) : f * K;
842
- }, x.reflectX = function(v) {
843
- return arguments.length ? (l = v ? -1 : 1, G()) : l < 0;
844
- }, x.reflectY = function(v) {
845
- return arguments.length ? (h = v ? -1 : 1, G()) : h < 0;
846
- }, x.precision = function(v) {
847
- return arguments.length ? (A = Nn(D, N = v * v), p()) : ut(N);
848
- }, x.fitExtent = function(v, m) {
849
- return un(x, v, m);
850
- }, x.fitSize = function(v, m) {
851
- return Un(x, v, m);
852
- }, x.fitWidth = function(v, m) {
853
- return $n(x, v, m);
854
- }, x.fitHeight = function(v, m) {
855
- return Hn(x, v, m);
856
- };
857
- function G() {
858
- var v = xn(e, 0, 0, l, h, f).apply(null, n(a, o)), m = xn(e, i - v[0], r - v[1], l, h, f);
859
- return u = Vn(s, g, c), D = Qt(n, m), X = Qt(u, D), A = Nn(D, N), p();
860
- }
861
- function p() {
862
- return C = F = null, x;
863
- }
864
- return function() {
865
- return n = t.apply(this, arguments), x.invert = n.invert && W, G();
866
- };
867
- }
868
- function Ue(t) {
869
- var n = 0, e = Y / 3, i = Wn(t), r = i(n, e);
870
- return r.parallels = function(a) {
871
- return arguments.length ? i(n = a[0] * U, e = a[1] * U) : [n * K, e * K];
872
- }, r;
873
- }
874
- function $e(t) {
875
- var n = V(t);
876
- function e(i, r) {
877
- return [i * n, q(r) / n];
878
- }
879
- return e.invert = function(i, r) {
880
- return [i / n, j(r * n)];
881
- }, e;
882
- }
883
- function He(t, n) {
884
- var e = q(t), i = (e + q(n)) / 2;
885
- if (L(i) < P) return $e(t);
886
- var r = 1 + e * (2 * i - e), a = ut(r) / i;
887
- function o(s, g) {
888
- var c = ut(r - 2 * i * q(g)) / i;
889
- return [c * q(s *= i), a - c * V(s)];
890
- }
891
- return o.invert = function(s, g) {
892
- var c = a - g, u = ct(s, L(c)) * Nt(c);
893
- return c * i < 0 && (u -= Y * Nt(s) * Nt(c)), [u / i, j((r - (s * s + c * c) * i * i) / (2 * i))];
894
- }, o;
895
- }
896
- function jt() {
897
- return Ue(He).scale(155.424).center([0, 33.6442]);
898
- }
899
- function We() {
900
- return jt().parallels([29.5, 45.5]).scale(1070).translate([480, 250]).rotate([96, 0]).center([-0.6, 38.7]);
901
- }
902
- function Ke(t) {
903
- var n = t.length;
904
- return {
905
- point: function(e, i) {
906
- for (var r = -1; ++r < n; ) t[r].point(e, i);
907
- },
908
- sphere: function() {
909
- for (var e = -1; ++e < n; ) t[e].sphere();
910
- },
911
- lineStart: function() {
912
- for (var e = -1; ++e < n; ) t[e].lineStart();
913
- },
914
- lineEnd: function() {
915
- for (var e = -1; ++e < n; ) t[e].lineEnd();
916
- },
917
- polygonStart: function() {
918
- for (var e = -1; ++e < n; ) t[e].polygonStart();
919
- },
920
- polygonEnd: function() {
921
- for (var e = -1; ++e < n; ) t[e].polygonEnd();
922
- }
923
- };
924
- }
925
- function wr() {
926
- var t, n, e = We(), i, r = jt().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), a, o = jt().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), s, g, c = { point: function(l, h) {
927
- g = [l, h];
928
- } };
929
- function u(l) {
930
- var h = l[0], y = l[1];
931
- return g = null, i.point(h, y), g || (a.point(h, y), g) || (s.point(h, y), g);
932
- }
933
- u.invert = function(l) {
934
- var h = e.scale(), y = e.translate(), w = (l[0] - y[0]) / h, _ = (l[1] - y[1]) / h;
935
- return (_ >= 0.12 && _ < 0.234 && w >= -0.425 && w < -0.214 ? r : _ >= 0.166 && _ < 0.234 && w >= -0.214 && w < -0.115 ? o : e).invert(l);
936
- }, u.stream = function(l) {
937
- return t && n === l ? t : t = Ke([e.stream(n = l), r.stream(l), o.stream(l)]);
938
- }, u.precision = function(l) {
939
- return arguments.length ? (e.precision(l), r.precision(l), o.precision(l), f()) : e.precision();
940
- }, u.scale = function(l) {
941
- return arguments.length ? (e.scale(l), r.scale(l * 0.35), o.scale(l), u.translate(e.translate())) : e.scale();
942
- }, u.translate = function(l) {
943
- if (!arguments.length) return e.translate();
944
- var h = e.scale(), y = +l[0], w = +l[1];
945
- return i = e.translate(l).clipExtent([[y - 0.455 * h, w - 0.238 * h], [y + 0.455 * h, w + 0.238 * h]]).stream(c), a = r.translate([y - 0.307 * h, w + 0.201 * h]).clipExtent([[y - 0.425 * h + P, w + 0.12 * h + P], [y - 0.214 * h - P, w + 0.234 * h - P]]).stream(c), s = o.translate([y - 0.205 * h, w + 0.212 * h]).clipExtent([[y - 0.214 * h + P, w + 0.166 * h + P], [y - 0.115 * h - P, w + 0.234 * h - P]]).stream(c), f();
946
- }, u.fitExtent = function(l, h) {
947
- return un(u, l, h);
948
- }, u.fitSize = function(l, h) {
949
- return Un(u, l, h);
950
- }, u.fitWidth = function(l, h) {
951
- return $n(u, l, h);
952
- }, u.fitHeight = function(l, h) {
953
- return Hn(u, l, h);
954
- };
955
- function f() {
956
- return t = n = null, u;
957
- }
958
- return u.scale(1070);
959
- }
960
- function Qe(t) {
961
- return function(n, e) {
962
- var i = ut(n * n + e * e), r = t(i), a = q(r), o = V(r);
963
- return [
964
- ct(n * a, i * o),
965
- j(i && e * a / i)
966
- ];
967
- };
968
- }
969
- function an(t, n) {
970
- return [t, Se(Me((Q + n) / 2))];
971
- }
972
- an.invert = function(t, n) {
973
- return [t, 2 * On(Ee(n)) - Q];
974
- };
975
- function _r() {
976
- return Ze(an).scale(961 / Z);
977
- }
978
- function Ze(t) {
979
- var n = Ot(t), e = n.center, i = n.scale, r = n.translate, a = n.clipExtent, o = null, s, g, c;
980
- n.scale = function(f) {
981
- return arguments.length ? (i(f), u()) : i();
982
- }, n.translate = function(f) {
983
- return arguments.length ? (r(f), u()) : r();
984
- }, n.center = function(f) {
985
- return arguments.length ? (e(f), u()) : e();
986
- }, n.clipExtent = function(f) {
987
- return arguments.length ? (f == null ? o = s = g = c = null : (o = +f[0][0], s = +f[0][1], g = +f[1][0], c = +f[1][1]), u()) : o == null ? null : [[o, s], [g, c]];
988
- };
989
- function u() {
990
- var f = Y * i(), l = n(Ae(n.rotate()).invert([0, 0]));
991
- return a(o == null ? [[l[0] - f, l[1] - f], [l[0] + f, l[1] + f]] : t === an ? [[Math.max(l[0] - f, o), s], [Math.min(l[0] + f, g), c]] : [[o, Math.max(l[1] - f, s)], [g, Math.min(l[1] + f, c)]]);
992
- }
993
- return u();
994
- }
995
- var mt = 1.340264, yt = -0.081106, dt = 893e-6, wt = 3796e-6, qt = ut(3) / 2, Je = 12;
996
- function Kn(t, n) {
997
- var e = j(qt * q(n)), i = e * e, r = i * i * i;
998
- return [
999
- t * V(e) / (qt * (mt + 3 * yt * i + r * (7 * dt + 9 * wt * i))),
1000
- e * (mt + yt * i + r * (dt + wt * i))
1001
- ];
1002
- }
1003
- Kn.invert = function(t, n) {
1004
- for (var e = n, i = e * e, r = i * i * i, a = 0, o, s, g; a < Je && (s = e * (mt + yt * i + r * (dt + wt * i)) - n, g = mt + 3 * yt * i + r * (7 * dt + 9 * wt * i), e -= o = s / g, i = e * e, r = i * i * i, !(L(o) < Fn)); ++a)
1005
- ;
1006
- return [
1007
- qt * t * (mt + 3 * yt * i + r * (7 * dt + 9 * wt * i)) / V(e),
1008
- j(q(e) / qt)
1009
- ];
1010
- };
1011
- function Er() {
1012
- return Ot(Kn).scale(177.158);
1013
- }
1014
- function Qn(t, n) {
1015
- var e = n * n, i = e * e;
1016
- return [
1017
- t * (0.8707 - 0.131979 * e + i * (-0.013791 + i * (3971e-6 * e - 1529e-6 * i))),
1018
- n * (1.007226 + e * (0.015085 + i * (-0.044475 + 0.028874 * e - 5916e-6 * i)))
1019
- ];
1020
- }
1021
- Qn.invert = function(t, n) {
1022
- var e = n, i = 25, r;
1023
- do {
1024
- var a = e * e, o = a * a;
1025
- e -= r = (e * (1.007226 + a * (0.015085 + o * (-0.044475 + 0.028874 * a - 5916e-6 * o))) - n) / (1.007226 + a * (0.015085 * 3 + o * (-0.044475 * 7 + 0.028874 * 9 * a - 5916e-6 * 11 * o)));
1026
- } while (L(r) > P && --i > 0);
1027
- return [
1028
- t / (0.8707 + (a = e * e) * (-0.131979 + a * (-0.013791 + a * a * a * (3971e-6 - 1529e-6 * a)))),
1029
- e
1030
- ];
1031
- };
1032
- function Sr() {
1033
- return Ot(Qn).scale(175.295);
1034
- }
1035
- function Zn(t, n) {
1036
- return [V(n) * q(t), q(n)];
1037
- }
1038
- Zn.invert = Qe(j);
1039
- function Mr() {
1040
- return Ot(Zn).scale(249.5).clipAngle(90 + P);
1041
- }
1042
- const bt = { capture: !0, passive: !1 };
1043
- function tn(t) {
1044
- t.preventDefault(), t.stopImmediatePropagation();
1045
- }
1046
- function je(t) {
1047
- var n = t.document.documentElement, e = st(t).on("dragstart.drag", tn, bt);
1048
- "onselectstart" in n ? e.on("selectstart.drag", tn, bt) : (n.__noselect = n.style.MozUserSelect, n.style.MozUserSelect = "none");
1049
- }
1050
- function be(t, n) {
1051
- var e = t.document.documentElement, i = st(t).on("dragstart.drag", null);
1052
- n && (i.on("click.drag", tn, bt), setTimeout(function() {
1053
- i.on("click.drag", null);
1054
- }, 0)), "onselectstart" in e ? i.on("selectstart.drag", null) : (e.style.MozUserSelect = e.__noselect, delete e.__noselect);
1055
- }
1056
- var ti = Xn("start", "end", "cancel", "interrupt"), ni = [], Jn = 0, Rn = 1, nn = 2, Rt = 3, Pn = 4, en = 5, Pt = 6;
1057
- function Vt(t, n, e, i, r, a) {
1058
- var o = t.__transition;
1059
- if (!o) t.__transition = {};
1060
- else if (e in o) return;
1061
- ei(t, e, {
1062
- name: n,
1063
- index: i,
1064
- // For context during callback.
1065
- group: r,
1066
- // For context during callback.
1067
- on: ti,
1068
- tween: ni,
1069
- time: a.time,
1070
- delay: a.delay,
1071
- duration: a.duration,
1072
- ease: a.ease,
1073
- timer: null,
1074
- state: Jn
1075
- });
1076
- }
1077
- function ln(t, n) {
1078
- var e = b(t, n);
1079
- if (e.state > Jn) throw new Error("too late; already scheduled");
1080
- return e;
1081
- }
1082
- function tt(t, n) {
1083
- var e = b(t, n);
1084
- if (e.state > Rt) throw new Error("too late; already running");
1085
- return e;
1086
- }
1087
- function b(t, n) {
1088
- var e = t.__transition;
1089
- if (!e || !(e = e[n])) throw new Error("transition not found");
1090
- return e;
1091
- }
1092
- function ei(t, n, e) {
1093
- var i = t.__transition, r;
1094
- i[n] = e, e.timer = re(a, 0, e.time);
1095
- function a(c) {
1096
- e.state = Rn, e.timer.restart(o, e.delay, e.time), e.delay <= c && o(c - e.delay);
1097
- }
1098
- function o(c) {
1099
- var u, f, l, h;
1100
- if (e.state !== Rn) return g();
1101
- for (u in i)
1102
- if (h = i[u], h.name === e.name) {
1103
- if (h.state === Rt) return vn(o);
1104
- h.state === Pn ? (h.state = Pt, h.timer.stop(), h.on.call("interrupt", t, t.__data__, h.index, h.group), delete i[u]) : +u < n && (h.state = Pt, h.timer.stop(), h.on.call("cancel", t, t.__data__, h.index, h.group), delete i[u]);
1105
- }
1106
- if (vn(function() {
1107
- e.state === Rt && (e.state = Pn, e.timer.restart(s, e.delay, e.time), s(c));
1108
- }), e.state = nn, e.on.call("start", t, t.__data__, e.index, e.group), e.state === nn) {
1109
- for (e.state = Rt, r = new Array(l = e.tween.length), u = 0, f = -1; u < l; ++u)
1110
- (h = e.tween[u].value.call(t, t.__data__, e.index, e.group)) && (r[++f] = h);
1111
- r.length = f + 1;
1112
- }
1113
- }
1114
- function s(c) {
1115
- for (var u = c < e.duration ? e.ease.call(null, c / e.duration) : (e.timer.restart(g), e.state = en, 1), f = -1, l = r.length; ++f < l; )
1116
- r[f].call(t, u);
1117
- e.state === en && (e.on.call("end", t, t.__data__, e.index, e.group), g());
1118
- }
1119
- function g() {
1120
- e.state = Pt, e.timer.stop(), delete i[n];
1121
- for (var c in i) return;
1122
- delete t.__transition;
1123
- }
1124
- }
1125
- function Dt(t, n) {
1126
- var e = t.__transition, i, r, a = !0, o;
1127
- if (e) {
1128
- n = n == null ? null : n + "";
1129
- for (o in e) {
1130
- if ((i = e[o]).name !== n) {
1131
- a = !1;
1132
- continue;
1133
- }
1134
- r = i.state > nn && i.state < en, i.state = Pt, i.timer.stop(), i.on.call(r ? "interrupt" : "cancel", t, t.__data__, i.index, i.group), delete e[o];
1135
- }
1136
- a && delete t.__transition;
1137
- }
1138
- }
1139
- function ii(t) {
1140
- return this.each(function() {
1141
- Dt(this, t);
1142
- });
1143
- }
1144
- function ri(t, n) {
1145
- var e, i;
1146
- return function() {
1147
- var r = tt(this, t), a = r.tween;
1148
- if (a !== e) {
1149
- i = e = a;
1150
- for (var o = 0, s = i.length; o < s; ++o)
1151
- if (i[o].name === n) {
1152
- i = i.slice(), i.splice(o, 1);
1153
- break;
1154
- }
1155
- }
1156
- r.tween = i;
1157
- };
1158
- }
1159
- function oi(t, n, e) {
1160
- var i, r;
1161
- if (typeof e != "function") throw new Error();
1162
- return function() {
1163
- var a = tt(this, t), o = a.tween;
1164
- if (o !== i) {
1165
- r = (i = o).slice();
1166
- for (var s = { name: n, value: e }, g = 0, c = r.length; g < c; ++g)
1167
- if (r[g].name === n) {
1168
- r[g] = s;
1169
- break;
1170
- }
1171
- g === c && r.push(s);
1172
- }
1173
- a.tween = r;
1174
- };
1175
- }
1176
- function ui(t, n) {
1177
- var e = this._id;
1178
- if (t += "", arguments.length < 2) {
1179
- for (var i = b(this.node(), e).tween, r = 0, a = i.length, o; r < a; ++r)
1180
- if ((o = i[r]).name === t)
1181
- return o.value;
1182
- return null;
1183
- }
1184
- return this.each((n == null ? ri : oi)(e, t, n));
1185
- }
1186
- function sn(t, n, e) {
1187
- var i = t._id;
1188
- return t.each(function() {
1189
- var r = tt(this, i);
1190
- (r.value || (r.value = {}))[n] = e.apply(this, arguments);
1191
- }), function(r) {
1192
- return b(r, i).value[n];
1193
- };
1194
- }
1195
- function jn(t, n) {
1196
- var e;
1197
- return (typeof n == "number" ? lt : n instanceof fn ? cn : (e = fn(n)) ? (n = e, cn) : ue)(t, n);
1198
- }
1199
- function ai(t) {
1200
- return function() {
1201
- this.removeAttribute(t);
1202
- };
1203
- }
1204
- function li(t) {
1205
- return function() {
1206
- this.removeAttributeNS(t.space, t.local);
1207
- };
1208
- }
1209
- function si(t, n, e) {
1210
- var i, r = e + "", a;
1211
- return function() {
1212
- var o = this.getAttribute(t);
1213
- return o === r ? null : o === i ? a : a = n(i = o, e);
1214
- };
1215
- }
1216
- function ci(t, n, e) {
1217
- var i, r = e + "", a;
1218
- return function() {
1219
- var o = this.getAttributeNS(t.space, t.local);
1220
- return o === r ? null : o === i ? a : a = n(i = o, e);
1221
- };
1222
- }
1223
- function fi(t, n, e) {
1224
- var i, r, a;
1225
- return function() {
1226
- var o, s = e(this), g;
1227
- return s == null ? void this.removeAttribute(t) : (o = this.getAttribute(t), g = s + "", o === g ? null : o === i && g === r ? a : (r = g, a = n(i = o, s)));
1228
- };
1229
- }
1230
- function hi(t, n, e) {
1231
- var i, r, a;
1232
- return function() {
1233
- var o, s = e(this), g;
1234
- return s == null ? void this.removeAttributeNS(t.space, t.local) : (o = this.getAttributeNS(t.space, t.local), g = s + "", o === g ? null : o === i && g === r ? a : (r = g, a = n(i = o, s)));
1235
- };
1236
- }
1237
- function pi(t, n) {
1238
- var e = Cn(t), i = e === "transform" ? ge : jn;
1239
- return this.attrTween(t, typeof n == "function" ? (e.local ? hi : fi)(e, i, sn(this, "attr." + t, n)) : n == null ? (e.local ? li : ai)(e) : (e.local ? ci : si)(e, i, n));
1240
- }
1241
- function vi(t, n) {
1242
- return function(e) {
1243
- this.setAttribute(t, n.call(this, e));
1244
- };
1245
- }
1246
- function gi(t, n) {
1247
- return function(e) {
1248
- this.setAttributeNS(t.space, t.local, n.call(this, e));
1249
- };
1250
- }
1251
- function mi(t, n) {
1252
- var e, i;
1253
- function r() {
1254
- var a = n.apply(this, arguments);
1255
- return a !== i && (e = (i = a) && gi(t, a)), e;
1256
- }
1257
- return r._value = n, r;
1258
- }
1259
- function yi(t, n) {
1260
- var e, i;
1261
- function r() {
1262
- var a = n.apply(this, arguments);
1263
- return a !== i && (e = (i = a) && vi(t, a)), e;
1264
- }
1265
- return r._value = n, r;
1266
- }
1267
- function di(t, n) {
1268
- var e = "attr." + t;
1269
- if (arguments.length < 2) return (e = this.tween(e)) && e._value;
1270
- if (n == null) return this.tween(e, null);
1271
- if (typeof n != "function") throw new Error();
1272
- var i = Cn(t);
1273
- return this.tween(e, (i.local ? mi : yi)(i, n));
1274
- }
1275
- function wi(t, n) {
1276
- return function() {
1277
- ln(this, t).delay = +n.apply(this, arguments);
1278
- };
1279
- }
1280
- function _i(t, n) {
1281
- return n = +n, function() {
1282
- ln(this, t).delay = n;
1283
- };
1284
- }
1285
- function Ei(t) {
1286
- var n = this._id;
1287
- return arguments.length ? this.each((typeof t == "function" ? wi : _i)(n, t)) : b(this.node(), n).delay;
1288
- }
1289
- function Si(t, n) {
1290
- return function() {
1291
- tt(this, t).duration = +n.apply(this, arguments);
1292
- };
1293
- }
1294
- function Mi(t, n) {
1295
- return n = +n, function() {
1296
- tt(this, t).duration = n;
1297
- };
1298
- }
1299
- function zi(t) {
1300
- var n = this._id;
1301
- return arguments.length ? this.each((typeof t == "function" ? Si : Mi)(n, t)) : b(this.node(), n).duration;
1302
- }
1303
- function Ti(t, n) {
1304
- if (typeof n != "function") throw new Error();
1305
- return function() {
1306
- tt(this, t).ease = n;
1307
- };
1308
- }
1309
- function Ai(t) {
1310
- var n = this._id;
1311
- return arguments.length ? this.each(Ti(n, t)) : b(this.node(), n).ease;
1312
- }
1313
- function Ii(t, n) {
1314
- return function() {
1315
- var e = n.apply(this, arguments);
1316
- if (typeof e != "function") throw new Error();
1317
- tt(this, t).ease = e;
1318
- };
1319
- }
1320
- function Ni(t) {
1321
- if (typeof t != "function") throw new Error();
1322
- return this.each(Ii(this._id, t));
1323
- }
1324
- function xi(t) {
1325
- typeof t != "function" && (t = ae(t));
1326
- for (var n = this._groups, e = n.length, i = new Array(e), r = 0; r < e; ++r)
1327
- for (var a = n[r], o = a.length, s = i[r] = [], g, c = 0; c < o; ++c)
1328
- (g = a[c]) && t.call(g, g.__data__, c, a) && s.push(g);
1329
- return new ot(i, this._parents, this._name, this._id);
1330
- }
1331
- function Ri(t) {
1332
- if (t._id !== this._id) throw new Error();
1333
- for (var n = this._groups, e = t._groups, i = n.length, r = e.length, a = Math.min(i, r), o = new Array(i), s = 0; s < a; ++s)
1334
- for (var g = n[s], c = e[s], u = g.length, f = o[s] = new Array(u), l, h = 0; h < u; ++h)
1335
- (l = g[h] || c[h]) && (f[h] = l);
1336
- for (; s < i; ++s)
1337
- o[s] = n[s];
1338
- return new ot(o, this._parents, this._name, this._id);
1339
- }
1340
- function Pi(t) {
1341
- return (t + "").trim().split(/^|\s+/).every(function(n) {
1342
- var e = n.indexOf(".");
1343
- return e >= 0 && (n = n.slice(0, e)), !n || n === "start";
1344
- });
1345
- }
1346
- function Di(t, n, e) {
1347
- var i, r, a = Pi(n) ? ln : tt;
1348
- return function() {
1349
- var o = a(this, t), s = o.on;
1350
- s !== i && (r = (i = s).copy()).on(n, e), o.on = r;
1351
- };
1352
- }
1353
- function Xi(t, n) {
1354
- var e = this._id;
1355
- return arguments.length < 2 ? b(this.node(), e).on.on(t) : this.each(Di(e, t, n));
1356
- }
1357
- function Ci(t) {
1358
- return function() {
1359
- var n = this.parentNode;
1360
- for (var e in this.__transition) if (+e !== t) return;
1361
- n && n.removeChild(this);
1362
- };
1363
- }
1364
- function ki() {
1365
- return this.on("end.remove", Ci(this._id));
1366
- }
1367
- function Yi(t) {
1368
- var n = this._name, e = this._id;
1369
- typeof t != "function" && (t = le(t));
1370
- for (var i = this._groups, r = i.length, a = new Array(r), o = 0; o < r; ++o)
1371
- for (var s = i[o], g = s.length, c = a[o] = new Array(g), u, f, l = 0; l < g; ++l)
1372
- (u = s[l]) && (f = t.call(u, u.__data__, l, s)) && ("__data__" in u && (f.__data__ = u.__data__), c[l] = f, Vt(c[l], n, e, l, c, b(u, e)));
1373
- return new ot(a, this._parents, n, e);
1374
- }
1375
- function qi(t) {
1376
- var n = this._name, e = this._id;
1377
- typeof t != "function" && (t = se(t));
1378
- for (var i = this._groups, r = i.length, a = [], o = [], s = 0; s < r; ++s)
1379
- for (var g = i[s], c = g.length, u, f = 0; f < c; ++f)
1380
- if (u = g[f]) {
1381
- for (var l = t.call(u, u.__data__, f, g), h, y = b(u, e), w = 0, _ = l.length; w < _; ++w)
1382
- (h = l[w]) && Vt(h, n, e, w, l, y);
1383
- a.push(l), o.push(u);
1384
- }
1385
- return new ot(a, o, n, e);
1386
- }
1387
- var Fi = Ft.prototype.constructor;
1388
- function Oi() {
1389
- return new Fi(this._groups, this._parents);
1390
- }
1391
- function Vi(t, n) {
1392
- var e, i, r;
1393
- return function() {
1394
- var a = _t(this, t), o = (this.style.removeProperty(t), _t(this, t));
1395
- return a === o ? null : a === e && o === i ? r : r = n(e = a, i = o);
1396
- };
1397
- }
1398
- function bn(t) {
1399
- return function() {
1400
- this.style.removeProperty(t);
1401
- };
1402
- }
1403
- function Li(t, n, e) {
1404
- var i, r = e + "", a;
1405
- return function() {
1406
- var o = _t(this, t);
1407
- return o === r ? null : o === i ? a : a = n(i = o, e);
1408
- };
1409
- }
1410
- function Gi(t, n, e) {
1411
- var i, r, a;
1412
- return function() {
1413
- var o = _t(this, t), s = e(this), g = s + "";
1414
- return s == null && (g = s = (this.style.removeProperty(t), _t(this, t))), o === g ? null : o === i && g === r ? a : (r = g, a = n(i = o, s));
1415
- };
1416
- }
1417
- function Bi(t, n) {
1418
- var e, i, r, a = "style." + n, o = "end." + a, s;
1419
- return function() {
1420
- var g = tt(this, t), c = g.on, u = g.value[a] == null ? s || (s = bn(n)) : void 0;
1421
- (c !== e || r !== u) && (i = (e = c).copy()).on(o, r = u), g.on = i;
1422
- };
1423
- }
1424
- function Ui(t, n, e) {
1425
- var i = (t += "") == "transform" ? ve : jn;
1426
- return n == null ? this.styleTween(t, Vi(t, i)).on("end.style." + t, bn(t)) : typeof n == "function" ? this.styleTween(t, Gi(t, i, sn(this, "style." + t, n))).each(Bi(this._id, t)) : this.styleTween(t, Li(t, i, n), e).on("end.style." + t, null);
1427
- }
1428
- function $i(t, n, e) {
1429
- return function(i) {
1430
- this.style.setProperty(t, n.call(this, i), e);
1431
- };
1432
- }
1433
- function Hi(t, n, e) {
1434
- var i, r;
1435
- function a() {
1436
- var o = n.apply(this, arguments);
1437
- return o !== r && (i = (r = o) && $i(t, o, e)), i;
1438
- }
1439
- return a._value = n, a;
1440
- }
1441
- function Wi(t, n, e) {
1442
- var i = "style." + (t += "");
1443
- if (arguments.length < 2) return (i = this.tween(i)) && i._value;
1444
- if (n == null) return this.tween(i, null);
1445
- if (typeof n != "function") throw new Error();
1446
- return this.tween(i, Hi(t, n, e ?? ""));
1447
- }
1448
- function Ki(t) {
1449
- return function() {
1450
- this.textContent = t;
1451
- };
1452
- }
1453
- function Qi(t) {
1454
- return function() {
1455
- var n = t(this);
1456
- this.textContent = n ?? "";
1457
- };
1458
- }
1459
- function Zi(t) {
1460
- return this.tween("text", typeof t == "function" ? Qi(sn(this, "text", t)) : Ki(t == null ? "" : t + ""));
1461
- }
1462
- function Ji(t) {
1463
- return function(n) {
1464
- this.textContent = t.call(this, n);
1465
- };
1466
- }
1467
- function ji(t) {
1468
- var n, e;
1469
- function i() {
1470
- var r = t.apply(this, arguments);
1471
- return r !== e && (n = (e = r) && Ji(r)), n;
1472
- }
1473
- return i._value = t, i;
1474
- }
1475
- function bi(t) {
1476
- var n = "text";
1477
- if (arguments.length < 1) return (n = this.tween(n)) && n._value;
1478
- if (t == null) return this.tween(n, null);
1479
- if (typeof t != "function") throw new Error();
1480
- return this.tween(n, ji(t));
1481
- }
1482
- function tr() {
1483
- for (var t = this._name, n = this._id, e = te(), i = this._groups, r = i.length, a = 0; a < r; ++a)
1484
- for (var o = i[a], s = o.length, g, c = 0; c < s; ++c)
1485
- if (g = o[c]) {
1486
- var u = b(g, n);
1487
- Vt(g, t, e, c, o, {
1488
- time: u.time + u.delay + u.duration,
1489
- delay: 0,
1490
- duration: u.duration,
1491
- ease: u.ease
1492
- });
1493
- }
1494
- return new ot(i, this._parents, t, e);
1495
- }
1496
- function nr() {
1497
- var t, n, e = this, i = e._id, r = e.size();
1498
- return new Promise(function(a, o) {
1499
- var s = { value: o }, g = { value: function() {
1500
- --r === 0 && a();
1501
- } };
1502
- e.each(function() {
1503
- var c = tt(this, i), u = c.on;
1504
- u !== t && (n = (t = u).copy(), n._.cancel.push(s), n._.interrupt.push(s), n._.end.push(g)), c.on = n;
1505
- }), r === 0 && a();
1506
- });
1507
- }
1508
- var er = 0;
1509
- function ot(t, n, e, i) {
1510
- this._groups = t, this._parents = n, this._name = e, this._id = i;
1511
- }
1512
- function te() {
1513
- return ++er;
1514
- }
1515
- var it = Ft.prototype;
1516
- ot.prototype = {
1517
- constructor: ot,
1518
- select: Yi,
1519
- selectAll: qi,
1520
- selectChild: it.selectChild,
1521
- selectChildren: it.selectChildren,
1522
- filter: xi,
1523
- merge: Ri,
1524
- selection: Oi,
1525
- transition: tr,
1526
- call: it.call,
1527
- nodes: it.nodes,
1528
- node: it.node,
1529
- size: it.size,
1530
- empty: it.empty,
1531
- each: it.each,
1532
- on: Xi,
1533
- attr: pi,
1534
- attrTween: di,
1535
- style: Ui,
1536
- styleTween: Wi,
1537
- text: Zi,
1538
- textTween: bi,
1539
- remove: ki,
1540
- tween: ui,
1541
- delay: Ei,
1542
- duration: zi,
1543
- ease: Ai,
1544
- easeVarying: Ni,
1545
- end: nr,
1546
- [Symbol.iterator]: it[Symbol.iterator]
1547
- };
1548
- function ir(t) {
1549
- return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
1550
- }
1551
- var rr = {
1552
- time: null,
1553
- // Set on use.
1554
- delay: 0,
1555
- duration: 250,
1556
- ease: ir
1557
- };
1558
- function or(t, n) {
1559
- for (var e; !(e = t.__transition) || !(e = e[n]); )
1560
- if (!(t = t.parentNode))
1561
- throw new Error(`transition ${n} not found`);
1562
- return e;
1563
- }
1564
- function ur(t) {
1565
- var n, e;
1566
- t instanceof ot ? (n = t._id, t = t._name) : (n = te(), (e = rr).time = oe(), t = t == null ? null : t + "");
1567
- for (var i = this._groups, r = i.length, a = 0; a < r; ++a)
1568
- for (var o = i[a], s = o.length, g, c = 0; c < s; ++c)
1569
- (g = o[c]) && Vt(g, t, n, c, o, e || or(g, n));
1570
- return new ot(i, this._parents, t, n);
1571
- }
1572
- Ft.prototype.interrupt = ii;
1573
- Ft.prototype.transition = ur;
1574
- const It = (t) => () => t;
1575
- function ar(t, {
1576
- sourceEvent: n,
1577
- target: e,
1578
- transform: i,
1579
- dispatch: r
1580
- }) {
1581
- Object.defineProperties(this, {
1582
- type: { value: t, enumerable: !0, configurable: !0 },
1583
- sourceEvent: { value: n, enumerable: !0, configurable: !0 },
1584
- target: { value: e, enumerable: !0, configurable: !0 },
1585
- transform: { value: i, enumerable: !0, configurable: !0 },
1586
- _: { value: r }
1587
- });
1588
- }
1589
- function rt(t, n, e) {
1590
- this.k = t, this.x = n, this.y = e;
1591
- }
1592
- rt.prototype = {
1593
- constructor: rt,
1594
- scale: function(t) {
1595
- return t === 1 ? this : new rt(this.k * t, this.x, this.y);
1596
- },
1597
- translate: function(t, n) {
1598
- return t === 0 & n === 0 ? this : new rt(this.k, this.x + this.k * t, this.y + this.k * n);
1599
- },
1600
- apply: function(t) {
1601
- return [t[0] * this.k + this.x, t[1] * this.k + this.y];
1602
- },
1603
- applyX: function(t) {
1604
- return t * this.k + this.x;
1605
- },
1606
- applyY: function(t) {
1607
- return t * this.k + this.y;
1608
- },
1609
- invert: function(t) {
1610
- return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k];
1611
- },
1612
- invertX: function(t) {
1613
- return (t - this.x) / this.k;
1614
- },
1615
- invertY: function(t) {
1616
- return (t - this.y) / this.k;
1617
- },
1618
- rescaleX: function(t) {
1619
- return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t));
1620
- },
1621
- rescaleY: function(t) {
1622
- return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t));
1623
- },
1624
- toString: function() {
1625
- return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
1626
- }
1627
- };
1628
- var ne = new rt(1, 0, 0);
1629
- rt.prototype;
1630
- function Ut(t) {
1631
- t.stopImmediatePropagation();
1632
- }
1633
- function pt(t) {
1634
- t.preventDefault(), t.stopImmediatePropagation();
1635
- }
1636
- function lr(t) {
1637
- return (!t.ctrlKey || t.type === "wheel") && !t.button;
1638
- }
1639
- function sr() {
1640
- var t = this;
1641
- return t instanceof SVGElement ? (t = t.ownerSVGElement || t, t.hasAttribute("viewBox") ? (t = t.viewBox.baseVal, [[t.x, t.y], [t.x + t.width, t.y + t.height]]) : [[0, 0], [t.width.baseVal.value, t.height.baseVal.value]]) : [[0, 0], [t.clientWidth, t.clientHeight]];
1642
- }
1643
- function Dn() {
1644
- return this.__zoom || ne;
1645
- }
1646
- function cr(t) {
1647
- return -t.deltaY * (t.deltaMode === 1 ? 0.05 : t.deltaMode ? 1 : 2e-3) * (t.ctrlKey ? 10 : 1);
1648
- }
1649
- function fr() {
1650
- return navigator.maxTouchPoints || "ontouchstart" in this;
1651
- }
1652
- function hr(t, n, e) {
1653
- var i = t.invertX(n[0][0]) - e[0][0], r = t.invertX(n[1][0]) - e[1][0], a = t.invertY(n[0][1]) - e[0][1], o = t.invertY(n[1][1]) - e[1][1];
1654
- return t.translate(
1655
- r > i ? (i + r) / 2 : Math.min(0, i) || Math.max(0, r),
1656
- o > a ? (a + o) / 2 : Math.min(0, a) || Math.max(0, o)
1657
- );
1658
- }
1659
- function zr() {
1660
- var t = lr, n = sr, e = hr, i = cr, r = fr, a = [0, 1 / 0], o = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], s = 250, g = we, c = Xn("start", "zoom", "end"), u, f, l, h = 500, y = 150, w = 0, _ = 10;
1661
- function d(p) {
1662
- p.property("__zoom", Dn).on("wheel.zoom", X, { passive: !1 }).on("mousedown.zoom", C).on("dblclick.zoom", F).filter(r).on("touchstart.zoom", x).on("touchmove.zoom", W).on("touchend.zoom touchcancel.zoom", G).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
1663
- }
1664
- d.transform = function(p, v, m, E) {
1665
- var z = p.selection ? p.selection() : p;
1666
- z.property("__zoom", Dn), p !== z ? N(p, v, m, E) : z.interrupt().each(function() {
1667
- A(this, arguments).event(E).start().zoom(null, typeof v == "function" ? v.apply(this, arguments) : v).end();
1668
- });
1669
- }, d.scaleBy = function(p, v, m, E) {
1670
- d.scaleTo(p, function() {
1671
- var z = this.__zoom.k, I = typeof v == "function" ? v.apply(this, arguments) : v;
1672
- return z * I;
1673
- }, m, E);
1674
- }, d.scaleTo = function(p, v, m, E) {
1675
- d.transform(p, function() {
1676
- var z = n.apply(this, arguments), I = this.__zoom, R = m == null ? S(z) : typeof m == "function" ? m.apply(this, arguments) : m, k = I.invert(R), O = typeof v == "function" ? v.apply(this, arguments) : v;
1677
- return e(T(M(I, O), R, k), z, o);
1678
- }, m, E);
1679
- }, d.translateBy = function(p, v, m, E) {
1680
- d.transform(p, function() {
1681
- return e(this.__zoom.translate(
1682
- typeof v == "function" ? v.apply(this, arguments) : v,
1683
- typeof m == "function" ? m.apply(this, arguments) : m
1684
- ), n.apply(this, arguments), o);
1685
- }, null, E);
1686
- }, d.translateTo = function(p, v, m, E, z) {
1687
- d.transform(p, function() {
1688
- var I = n.apply(this, arguments), R = this.__zoom, k = E == null ? S(I) : typeof E == "function" ? E.apply(this, arguments) : E;
1689
- return e(ne.translate(k[0], k[1]).scale(R.k).translate(
1690
- typeof v == "function" ? -v.apply(this, arguments) : -v,
1691
- typeof m == "function" ? -m.apply(this, arguments) : -m
1692
- ), I, o);
1693
- }, E, z);
1694
- };
1695
- function M(p, v) {
1696
- return v = Math.max(a[0], Math.min(a[1], v)), v === p.k ? p : new rt(v, p.x, p.y);
1697
- }
1698
- function T(p, v, m) {
1699
- var E = v[0] - m[0] * p.k, z = v[1] - m[1] * p.k;
1700
- return E === p.x && z === p.y ? p : new rt(p.k, E, z);
1701
- }
1702
- function S(p) {
1703
- return [(+p[0][0] + +p[1][0]) / 2, (+p[0][1] + +p[1][1]) / 2];
1704
- }
1705
- function N(p, v, m, E) {
1706
- p.on("start.zoom", function() {
1707
- A(this, arguments).event(E).start();
1708
- }).on("interrupt.zoom end.zoom", function() {
1709
- A(this, arguments).event(E).end();
1710
- }).tween("zoom", function() {
1711
- var z = this, I = arguments, R = A(z, I).event(E), k = n.apply(z, I), O = m == null ? S(k) : typeof m == "function" ? m.apply(z, I) : m, $ = Math.max(k[1][0] - k[0][0], k[1][1] - k[0][1]), B = z.__zoom, H = typeof v == "function" ? v.apply(z, I) : v, nt = g(B.invert(O).concat($ / B.k), H.invert(O).concat($ / H.k));
1712
- return function(J) {
1713
- if (J === 1) J = H;
1714
- else {
1715
- var et = nt(J), Lt = $ / et[2];
1716
- J = new rt(Lt, O[0] - et[0] * Lt, O[1] - et[1] * Lt);
1717
- }
1718
- R.zoom(null, J);
1719
- };
1720
- });
1721
- }
1722
- function A(p, v, m) {
1723
- return !m && p.__zooming || new D(p, v);
1724
- }
1725
- function D(p, v) {
1726
- this.that = p, this.args = v, this.active = 0, this.sourceEvent = null, this.extent = n.apply(p, v), this.taps = 0;
1727
- }
1728
- D.prototype = {
1729
- event: function(p) {
1730
- return p && (this.sourceEvent = p), this;
1731
- },
1732
- start: function() {
1733
- return ++this.active === 1 && (this.that.__zooming = this, this.emit("start")), this;
1734
- },
1735
- zoom: function(p, v) {
1736
- return this.mouse && p !== "mouse" && (this.mouse[1] = v.invert(this.mouse[0])), this.touch0 && p !== "touch" && (this.touch0[1] = v.invert(this.touch0[0])), this.touch1 && p !== "touch" && (this.touch1[1] = v.invert(this.touch1[0])), this.that.__zoom = v, this.emit("zoom"), this;
1737
- },
1738
- end: function() {
1739
- return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
1740
- },
1741
- emit: function(p) {
1742
- var v = st(this.that).datum();
1743
- c.call(
1744
- p,
1745
- this.that,
1746
- new ar(p, {
1747
- sourceEvent: this.sourceEvent,
1748
- target: d,
1749
- transform: this.that.__zoom,
1750
- dispatch: c
1751
- }),
1752
- v
1753
- );
1754
- }
1755
- };
1756
- function X(p, ...v) {
1757
- if (!t.apply(this, arguments)) return;
1758
- var m = A(this, v).event(p), E = this.__zoom, z = Math.max(a[0], Math.min(a[1], E.k * Math.pow(2, i.apply(this, arguments)))), I = at(p);
1759
- if (m.wheel)
1760
- (m.mouse[0][0] !== I[0] || m.mouse[0][1] !== I[1]) && (m.mouse[1] = E.invert(m.mouse[0] = I)), clearTimeout(m.wheel);
1761
- else {
1762
- if (E.k === z) return;
1763
- m.mouse = [I, E.invert(I)], Dt(this), m.start();
1764
- }
1765
- pt(p), m.wheel = setTimeout(R, y), m.zoom("mouse", e(T(M(E, z), m.mouse[0], m.mouse[1]), m.extent, o));
1766
- function R() {
1767
- m.wheel = null, m.end();
1768
- }
1769
- }
1770
- function C(p, ...v) {
1771
- if (l || !t.apply(this, arguments)) return;
1772
- var m = p.currentTarget, E = A(this, v, !0).event(p), z = st(p.view).on("mousemove.zoom", O, !0).on("mouseup.zoom", $, !0), I = at(p, m), R = p.clientX, k = p.clientY;
1773
- je(p.view), Ut(p), E.mouse = [I, this.__zoom.invert(I)], Dt(this), E.start();
1774
- function O(B) {
1775
- if (pt(B), !E.moved) {
1776
- var H = B.clientX - R, nt = B.clientY - k;
1777
- E.moved = H * H + nt * nt > w;
1778
- }
1779
- E.event(B).zoom("mouse", e(T(E.that.__zoom, E.mouse[0] = at(B, m), E.mouse[1]), E.extent, o));
1780
- }
1781
- function $(B) {
1782
- z.on("mousemove.zoom mouseup.zoom", null), be(B.view, E.moved), pt(B), E.event(B).end();
1783
- }
1784
- }
1785
- function F(p, ...v) {
1786
- if (t.apply(this, arguments)) {
1787
- var m = this.__zoom, E = at(p.changedTouches ? p.changedTouches[0] : p, this), z = m.invert(E), I = m.k * (p.shiftKey ? 0.5 : 2), R = e(T(M(m, I), E, z), n.apply(this, v), o);
1788
- pt(p), s > 0 ? st(this).transition().duration(s).call(N, R, E, p) : st(this).call(d.transform, R, E, p);
1789
- }
1790
- }
1791
- function x(p, ...v) {
1792
- if (t.apply(this, arguments)) {
1793
- var m = p.touches, E = m.length, z = A(this, v, p.changedTouches.length === E).event(p), I, R, k, O;
1794
- for (Ut(p), R = 0; R < E; ++R)
1795
- k = m[R], O = at(k, this), O = [O, this.__zoom.invert(O), k.identifier], z.touch0 ? !z.touch1 && z.touch0[2] !== O[2] && (z.touch1 = O, z.taps = 0) : (z.touch0 = O, I = !0, z.taps = 1 + !!u);
1796
- u && (u = clearTimeout(u)), I && (z.taps < 2 && (f = O[0], u = setTimeout(function() {
1797
- u = null;
1798
- }, h)), Dt(this), z.start());
1799
- }
1800
- }
1801
- function W(p, ...v) {
1802
- if (this.__zooming) {
1803
- var m = A(this, v).event(p), E = p.changedTouches, z = E.length, I, R, k, O;
1804
- for (pt(p), I = 0; I < z; ++I)
1805
- R = E[I], k = at(R, this), m.touch0 && m.touch0[2] === R.identifier ? m.touch0[0] = k : m.touch1 && m.touch1[2] === R.identifier && (m.touch1[0] = k);
1806
- if (R = m.that.__zoom, m.touch1) {
1807
- var $ = m.touch0[0], B = m.touch0[1], H = m.touch1[0], nt = m.touch1[1], J = (J = H[0] - $[0]) * J + (J = H[1] - $[1]) * J, et = (et = nt[0] - B[0]) * et + (et = nt[1] - B[1]) * et;
1808
- R = M(R, Math.sqrt(J / et)), k = [($[0] + H[0]) / 2, ($[1] + H[1]) / 2], O = [(B[0] + nt[0]) / 2, (B[1] + nt[1]) / 2];
1809
- } else if (m.touch0) k = m.touch0[0], O = m.touch0[1];
1810
- else return;
1811
- m.zoom("touch", e(T(R, k, O), m.extent, o));
1812
- }
1813
- }
1814
- function G(p, ...v) {
1815
- if (this.__zooming) {
1816
- var m = A(this, v).event(p), E = p.changedTouches, z = E.length, I, R;
1817
- for (Ut(p), l && clearTimeout(l), l = setTimeout(function() {
1818
- l = null;
1819
- }, h), I = 0; I < z; ++I)
1820
- R = E[I], m.touch0 && m.touch0[2] === R.identifier ? delete m.touch0 : m.touch1 && m.touch1[2] === R.identifier && delete m.touch1;
1821
- if (m.touch1 && !m.touch0 && (m.touch0 = m.touch1, delete m.touch1), m.touch0) m.touch0[1] = this.__zoom.invert(m.touch0[0]);
1822
- else if (m.end(), m.taps === 2 && (R = at(R, this), Math.hypot(f[0] - R[0], f[1] - R[1]) < _)) {
1823
- var k = st(this).on("dblclick.zoom");
1824
- k && k.apply(this, arguments);
1825
- }
1826
- }
1827
- }
1828
- return d.wheelDelta = function(p) {
1829
- return arguments.length ? (i = typeof p == "function" ? p : It(+p), d) : i;
1830
- }, d.filter = function(p) {
1831
- return arguments.length ? (t = typeof p == "function" ? p : It(!!p), d) : t;
1832
- }, d.touchable = function(p) {
1833
- return arguments.length ? (r = typeof p == "function" ? p : It(!!p), d) : r;
1834
- }, d.extent = function(p) {
1835
- return arguments.length ? (n = typeof p == "function" ? p : It([[+p[0][0], +p[0][1]], [+p[1][0], +p[1][1]]]), d) : n;
1836
- }, d.scaleExtent = function(p) {
1837
- return arguments.length ? (a[0] = +p[0], a[1] = +p[1], d) : [a[0], a[1]];
1838
- }, d.translateExtent = function(p) {
1839
- return arguments.length ? (o[0][0] = +p[0][0], o[1][0] = +p[1][0], o[0][1] = +p[0][1], o[1][1] = +p[1][1], d) : [[o[0][0], o[0][1]], [o[1][0], o[1][1]]];
1840
- }, d.constrain = function(p) {
1841
- return arguments.length ? (e = p, d) : e;
1842
- }, d.duration = function(p) {
1843
- return arguments.length ? (s = +p, d) : s;
1844
- }, d.interpolate = function(p) {
1845
- return arguments.length ? (g = p, d) : g;
1846
- }, d.on = function() {
1847
- var p = c.on.apply(c, arguments);
1848
- return p === c ? d : p;
1849
- }, d.clickDistance = function(p) {
1850
- return arguments.length ? (w = (p = +p) * p, d) : Math.sqrt(w);
1851
- }, d.tapDistance = function(p) {
1852
- return arguments.length ? (_ = +p, d) : _;
1853
- }, d;
1854
- }
1855
- export {
1856
- Er as a,
1857
- Sr as b,
1858
- Mr as c,
1859
- wr as d,
1860
- _r as g,
1861
- dr as i,
1862
- zr as z
1863
- };
1864
- //# sourceMappingURL=zoom-5AkJSuWO.js.map