vue-data-ui 3.8.5 → 3.9.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.
- package/README.md +8 -4
- package/dist/{BaseDraggableDialog-C2wzOVzX.js → BaseDraggableDialog-B6wHUQPl.js} +1 -1
- package/dist/{BaseIcon-_2VlkSHq.js → BaseIcon-CQaciFyv.js} +3 -2
- package/dist/BaseScanner-BMpwQAfz.js +30 -0
- package/dist/BaseZoomControls-AMmyXEyM.js +110 -0
- package/dist/{ColorPicker-Y-VfX-24.js → ColorPicker-nZHFmXUV.js} +1 -1
- package/dist/{DataTable-CokMin24.js → DataTable-C8cgUUyx.js} +1 -1
- package/dist/{NonSvgPenAndPaper-ir3Z1ZAu.js → NonSvgPenAndPaper-CVjActC2.js} +2 -2
- package/dist/{PackageVersion-DU6pdQRM.js → PackageVersion-CIhhY-aH.js} +1 -1
- package/dist/{PenAndPaper-CFRubEEG.js → PenAndPaper-DtbXViIl.js} +2 -2
- package/dist/{Slicer-CVcdknEx.js → Slicer-DtlEs698.js} +1 -1
- package/dist/{SlicerPreview-C1EQEgYE.js → SlicerPreview-DmzwkUJ4.js} +1 -1
- package/dist/{Title-m5US8voB.js → Title-osQjQYc-.js} +1 -1
- package/dist/{UserOptions-M5A9w5GL.js → UserOptions-DeiXBImO.js} +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-accordion.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-annotator.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dag.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-geo.js +5 -0
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-icon.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-mini-loader.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-rating.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-smiley.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-stackline.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-heatmap.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy-canvas.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/geoProjections-D0Vxsz_O.js +154 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.ts +210 -4
- package/dist/types/vue-ui-geo.d.ts +10 -0
- package/dist/{useNestedProp-B696zdq-.js → useNestedProp-BeKjhKny.js} +99 -17
- package/dist/usePanZoom-CDF7rb3o.js +132 -0
- package/dist/{vue-data-ui-DA30aOVt.js → vue-data-ui-bVCjAfu8.js} +113 -108
- package/dist/vue-data-ui.js +101 -98
- package/dist/{vue-ui-3d-bar-B8vwrYhQ.js → vue-ui-3d-bar-Bs1SXAWI.js} +4 -4
- package/dist/{vue-ui-accordion-q1EhHbRP.js → vue-ui-accordion-nCaoOi6x.js} +2 -2
- package/dist/{vue-ui-age-pyramid-D6joh86v.js → vue-ui-age-pyramid-D25YLhPh.js} +4 -4
- package/dist/{vue-ui-annotator-749kzlDJ.js → vue-ui-annotator-3wBuXKBn.js} +4 -4
- package/dist/{vue-ui-bullet-YJv-2ZQ9.js → vue-ui-bullet-XX1owNiy.js} +4 -4
- package/dist/{vue-ui-candlestick-BjeFFWuf.js → vue-ui-candlestick-CbKnRXLs.js} +5 -5
- package/dist/{vue-ui-carousel-table-C7sPVM5f.js → vue-ui-carousel-table-B95eZm5f.js} +2 -2
- package/dist/{vue-ui-chestnut-CUMsJRhG.js → vue-ui-chestnut-D6B8mFCb.js} +3 -3
- package/dist/{vue-ui-chord-BE5LirVm.js → vue-ui-chord-C-Fe5nTC.js} +4 -4
- package/dist/{vue-ui-circle-pack-Ddemd-Lq.js → vue-ui-circle-pack-DbGOEbwG.js} +4 -4
- package/dist/{vue-ui-cursor-DxGbCKPl.js → vue-ui-cursor-D99JZotY.js} +2 -2
- package/dist/{vue-ui-dag-DnaGtaUA.js → vue-ui-dag-D7R60BRH.js} +706 -809
- package/dist/{vue-ui-dashboard-CJ-bIPTN.js → vue-ui-dashboard-Dxhaj5E6.js} +66 -66
- package/dist/{vue-ui-digits-DlZPpTdG.js → vue-ui-digits-D2zs8kUV.js} +1 -1
- package/dist/{vue-ui-donut-D6cI982K.js → vue-ui-donut-CbHumHFw.js} +4 -4
- package/dist/{vue-ui-donut-evolution-D1FPSupz.js → vue-ui-donut-evolution--rlD_bzN.js} +5 -5
- package/dist/{vue-ui-dumbbell-CeM87r9l.js → vue-ui-dumbbell-Bak094f4.js} +4 -4
- package/dist/{vue-ui-flow-DFqmvJ62.js → vue-ui-flow-BU_3xWDD.js} +4 -4
- package/dist/{vue-ui-funnel-53eVC-iv.js → vue-ui-funnel-aOfTIY8A.js} +3 -3
- package/dist/{vue-ui-galaxy-C_UY_GdO.js → vue-ui-galaxy-CFnCDW6L.js} +4 -4
- package/dist/{vue-ui-gauge-CrkujWLj.js → vue-ui-gauge-Te_U6eYB.js} +4 -4
- package/dist/vue-ui-geo-qkJZph6o.js +977 -0
- package/dist/{vue-ui-gizmo-DdXZShbC.js → vue-ui-gizmo-BKGL0hrf.js} +3 -3
- package/dist/{vue-ui-heatmap-fF1TTdvJ.js → vue-ui-heatmap-CxupvmxZ.js} +5 -5
- package/dist/{vue-ui-history-plot-Blv-HI5D.js → vue-ui-history-plot-CRNGUd--.js} +4 -4
- package/dist/{vue-ui-horizontal-bar-CxUf7XvD.js → vue-ui-horizontal-bar-GXt7JlrG.js} +9 -9
- package/dist/{vue-ui-kpi-CmaIZcHA.js → vue-ui-kpi-C_sejZsA.js} +2 -2
- package/dist/{vue-ui-mini-loader-9HFOVyYQ.js → vue-ui-mini-loader-BEBv2BjZ.js} +1 -1
- package/dist/{vue-ui-molecule-1gMD_IGa.js → vue-ui-molecule-D5MQWvsl.js} +4 -4
- package/dist/{vue-ui-mood-radar-De7XXM1S.js → vue-ui-mood-radar-DkwW-6_J.js} +4 -4
- package/dist/{vue-ui-nested-donuts-C3U1D_tk.js → vue-ui-nested-donuts-Cl2CtNHY.js} +4 -4
- package/dist/{vue-ui-onion-DmNqk1KG.js → vue-ui-onion-BbTd3-9h.js} +4 -4
- package/dist/{vue-ui-parallel-coordinate-plot-Ck9zrf0f.js → vue-ui-parallel-coordinate-plot-CAuAUcJe.js} +4 -4
- package/dist/{vue-ui-quadrant-c1P_mUWA.js → vue-ui-quadrant-CiQOwv_x.js} +4 -4
- package/dist/{vue-ui-quick-chart-aC-unW5B.js → vue-ui-quick-chart-Db_p50n_.js} +4 -4
- package/dist/{vue-ui-radar-B79zcusd.js → vue-ui-radar-Cq0FzSuo.js} +4 -4
- package/dist/{vue-ui-rating-CMg5akXd.js → vue-ui-rating-Ci09laQN.js} +1 -1
- package/dist/{vue-ui-relation-circle-BLSlYwzp.js → vue-ui-relation-circle-0TKhiI54.js} +4 -4
- package/dist/{vue-ui-ridgeline-DJI-8Jea.js → vue-ui-ridgeline-BpKSoxMw.js} +4 -4
- package/dist/{vue-ui-rings-DedSjGyQ.js → vue-ui-rings-vn5kZZRA.js} +4 -4
- package/dist/{vue-ui-scatter-Bl92_3zT.js → vue-ui-scatter-CF_h6seO.js} +4 -4
- package/dist/{vue-ui-skeleton-I3jcxaGr.js → vue-ui-skeleton-pcNjmtIm.js} +2 -2
- package/dist/{vue-ui-smiley-Cr4XG1yP.js → vue-ui-smiley-BW0ksZH3.js} +1 -1
- package/dist/{vue-ui-spark-trend-_2A6BJsZ.js → vue-ui-spark-trend-Gwr_mhU3.js} +3 -3
- package/dist/{vue-ui-sparkbar-Mcw9XS3C.js → vue-ui-sparkbar-Ti79zXlf.js} +3 -3
- package/dist/{vue-ui-sparkgauge-DC4me9S4.js → vue-ui-sparkgauge-Cw076CAR.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-CCQMAuWU.js → vue-ui-sparkhistogram-DAQatxbk.js} +3 -3
- package/dist/{vue-ui-sparkline-vzFXbBM3.js → vue-ui-sparkline-DIFjHdAd.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-Bb1A_xq-.js → vue-ui-sparkstackbar-CV48OIlq.js} +3 -3
- package/dist/{vue-ui-stackbar-SEv0BiEx.js → vue-ui-stackbar-iNQuoaFJ.js} +5 -5
- package/dist/{vue-ui-stackline-j8dlN7IX.js → vue-ui-stackline-Ba_T3bRL.js} +5 -5
- package/dist/{vue-ui-strip-plot-C1H4_vRX.js → vue-ui-strip-plot-DQHiecxa.js} +4 -4
- package/dist/{vue-ui-table-1fioweBm.js → vue-ui-table-BNvnkqgr.js} +4 -4
- package/dist/{vue-ui-table-heatmap-C9B50I8F.js → vue-ui-table-heatmap-BecLm3ow.js} +2 -2
- package/dist/{vue-ui-table-sparkline-CHRU9kcU.js → vue-ui-table-sparkline-Z9G-8VPL.js} +2 -2
- package/dist/{vue-ui-thermometer-BkYFDCK_.js → vue-ui-thermometer-NJ6mFchh.js} +4 -4
- package/dist/{vue-ui-timer-Qec1qL9Y.js → vue-ui-timer-BzWAHC6N.js} +4 -4
- package/dist/{vue-ui-tiremarks-DWJFmX5I.js → vue-ui-tiremarks-DUVReJRZ.js} +4 -4
- package/dist/{vue-ui-treemap-CZl4JSsA.js → vue-ui-treemap-pLbU0XEi.js} +5 -5
- package/dist/{vue-ui-waffle-CVo_6Vo6.js → vue-ui-waffle-QkCm05fN.js} +4 -4
- package/dist/{vue-ui-wheel-oRl2lzXg.js → vue-ui-wheel-DaRAOHXK.js} +4 -4
- package/dist/{vue-ui-word-cloud-D9URPA8p.js → vue-ui-word-cloud-CEIaALCH.js} +5 -5
- package/dist/{vue-ui-world-6qUyz6us.js → vue-ui-world-BS0oWBVp.js} +430 -579
- package/dist/{vue-ui-xy-canvas-QsBOBS05.js → vue-ui-xy-canvas-CLoA6DTt.js} +7 -7
- package/dist/{vue-ui-xy-DCIyTcrb.js → vue-ui-xy-l6mUNMUu.js} +6 -6
- package/package.json +1 -1
- package/dist/BaseScanner-BgWxam9d.js +0 -29
- package/dist/usePanZoom-DMfuOfaC.js +0 -135
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
const A = {
|
|
2
|
+
mercator([M, n], o, s, r) {
|
|
3
|
+
n = Math.max(Math.min(n, 85.05113), -85.05113);
|
|
4
|
+
const [t, i] = r, c = (M - t) * Math.PI / 180, l = o / (2 * Math.PI) * (c + Math.PI), e = (I) => Math.log(Math.tan(Math.PI / 4 + I * Math.PI / 180 / 2)), y = e(85.05113), P = e(-72), x = (e(n) - y) / (P - y) * s;
|
|
5
|
+
return [l, x];
|
|
6
|
+
},
|
|
7
|
+
equirectangular([M, n], o, s, r) {
|
|
8
|
+
const [h, t] = r;
|
|
9
|
+
n = Math.max(Math.min(n, 90), -80);
|
|
10
|
+
const i = (M - h + 180) / 360 * o, c = (90 - (n - t)) / 170 * s;
|
|
11
|
+
return [i, c];
|
|
12
|
+
},
|
|
13
|
+
robinson([M, n], o, s, r) {
|
|
14
|
+
const a = [
|
|
15
|
+
[1, 0],
|
|
16
|
+
[0.9986, 0.062],
|
|
17
|
+
[0.9954, 0.124],
|
|
18
|
+
[0.99, 0.186],
|
|
19
|
+
[0.9822, 0.248],
|
|
20
|
+
[0.973, 0.31],
|
|
21
|
+
[0.96, 0.372],
|
|
22
|
+
[0.9427, 0.434],
|
|
23
|
+
[0.9216, 0.4958],
|
|
24
|
+
[0.8962, 0.5571],
|
|
25
|
+
[0.8679, 0.6176],
|
|
26
|
+
[0.835, 0.6769],
|
|
27
|
+
[0.7986, 0.7346],
|
|
28
|
+
[0.7597, 0.7903],
|
|
29
|
+
[0.7186, 0.8435],
|
|
30
|
+
[0.6732, 0.8936],
|
|
31
|
+
[0.6213, 0.9394],
|
|
32
|
+
[0.5722, 0.9761],
|
|
33
|
+
[0.5322, 1]
|
|
34
|
+
], [m, h] = r;
|
|
35
|
+
M = M - m, n = Math.max(-89.9999, Math.min(89.9999, n));
|
|
36
|
+
const t = Math.abs(n), i = Math.floor(t / 5), c = t % 5 / 5, [l, e] = a[i], [y, P] = a[Math.min(i + 1, a.length - 1)], u = l + (y - l) * c, x = e + (P - e) * c, I = M * Math.PI / 180, f = o / 2 + o / 2 * u * I / Math.PI, p = s / 2 - Math.sign(n) * (s / 2) * x / 1;
|
|
37
|
+
return !Number.isFinite(f) || !Number.isFinite(p) ? [-9999, -9999] : [f, p];
|
|
38
|
+
},
|
|
39
|
+
mollweide([M, n], o, s, r) {
|
|
40
|
+
n = Math.max(Math.min(n, 89.9999), -89.9999);
|
|
41
|
+
const [a] = r, m = (M - a) * Math.PI / 180, h = n * Math.PI / 180;
|
|
42
|
+
let t = h;
|
|
43
|
+
const i = 1e-10;
|
|
44
|
+
let c = 1, l = 0;
|
|
45
|
+
for (; Math.abs(c) > i && l < 10; )
|
|
46
|
+
c = -(2 * t + Math.sin(2 * t) - Math.PI * Math.sin(h)) / (2 + 2 * Math.cos(2 * t)), t += c, l++;
|
|
47
|
+
isFinite(t) || (t = h > 0 ? Math.PI / 2 : -Math.PI / 2);
|
|
48
|
+
const e = o / (2 * Math.SQRT2), P = (e * (2 * Math.SQRT2 / Math.PI) * m * Math.cos(t) + 2 * e) / (4.6 * e) * o, u = -e * Math.SQRT2 * Math.sin(t), x = -e * Math.SQRT2, I = e * Math.SQRT2, f = (u - x) / (I - x) * s;
|
|
49
|
+
return [
|
|
50
|
+
isFinite(P) ? P : 0,
|
|
51
|
+
isFinite(f) ? f : 0
|
|
52
|
+
];
|
|
53
|
+
},
|
|
54
|
+
winkelTripel([M, n], o, s, r) {
|
|
55
|
+
const [a, m] = r, h = (M - a) * Math.PI / 180, t = n * Math.PI / 180, i = h * Math.cos(Math.PI / 6), c = t, l = Math.acos(Math.cos(t) * Math.cos(h / 2)), e = 2 * Math.cos(t) * Math.sin(h / 2) / (Math.sin(l) / l || 1), y = Math.sin(t) / (Math.sin(l) / l || 1), P = o / 2 + o / (2 * Math.PI) * (i + e) / 2, u = s / 2 - s / (2 * Math.PI) * (c + y) / 2;
|
|
56
|
+
return [P, u];
|
|
57
|
+
},
|
|
58
|
+
aitoff([M, n], o, s, r) {
|
|
59
|
+
Math.sinc || (Math.sinc = function(e) {
|
|
60
|
+
return e === 0 ? 1 : Math.sin(Math.PI * e) / (Math.PI * e);
|
|
61
|
+
});
|
|
62
|
+
const [a, m] = r, h = (M - a) * Math.PI / 180, t = n * Math.PI / 180, i = Math.acos(Math.cos(t) * Math.cos(h / 2));
|
|
63
|
+
let c = 0, l = 0;
|
|
64
|
+
return i !== 0 && (c = 2 * Math.cos(t) * Math.sin(h / 2) / Math.sinc(i / Math.PI), l = Math.sin(t) / Math.sinc(i / Math.PI)), c = o / 2 + c * (o / 4), l = s / 2 - l * (s / 2), [c, l];
|
|
65
|
+
},
|
|
66
|
+
hammer([M, n], o, s, r) {
|
|
67
|
+
const [a, m] = r, h = (M - a) * Math.PI / 180, t = n * Math.PI / 180, i = Math.sqrt(1 + Math.cos(t) * Math.cos(h / 2)), c = o / 2 + o / 2 * (2 * Math.SQRT2 * Math.cos(t) * Math.sin(h / 2) / i) / 2.8284271247461903, l = s / 2 - s / 2 * (Math.SQRT2 * Math.sin(t) / i) / 1.4142135623730951;
|
|
68
|
+
return [c, l];
|
|
69
|
+
},
|
|
70
|
+
bonne([M, n], o, s, r = [0, 0]) {
|
|
71
|
+
const a = 45 * Math.PI / 180, [m, h] = r, t = (M - m) * Math.PI / 180, c = Math.max(Math.min(n, 89.9), -89.9) * Math.PI / 180, l = 1 / Math.tan(a), e = l + a - c, y = e === 0 ? 0 : t * Math.cos(c) / e, P = Math.min(o, s) / 2.6, u = o / 2 + P * e * Math.sin(y), x = s / 2 - P * (l - e * Math.cos(y));
|
|
72
|
+
return [u, x];
|
|
73
|
+
},
|
|
74
|
+
sinusoidal([M, n], o, s, r) {
|
|
75
|
+
const [a, m] = r, h = (M - a) * Math.PI / 180, t = n * Math.PI / 180, i = o / 2 + o / (2 * Math.PI) * h * Math.cos(t), c = s / 2 - s / Math.PI * t;
|
|
76
|
+
return [i, c];
|
|
77
|
+
},
|
|
78
|
+
gallPeters([M, n], o, s, r) {
|
|
79
|
+
const [a, m] = r;
|
|
80
|
+
n = Math.max(Math.min(n, 89.9999), -89.9999);
|
|
81
|
+
const h = (M - a + 180) / 360 * o, t = s / 2 - s / Math.PI * Math.sin(n * Math.PI / 180);
|
|
82
|
+
return [h, t];
|
|
83
|
+
},
|
|
84
|
+
vanDerGrinten([M, n], o, s, r = [0, 0]) {
|
|
85
|
+
const a = Math.PI, m = Math.PI / 2, h = 1e-6;
|
|
86
|
+
let t = (M - (r[0] || 0)) * a / 180, i = (n - (r[1] || 0)) * a / 180, c = Math.abs(t), l = Math.abs(i), e, y;
|
|
87
|
+
if (l < h)
|
|
88
|
+
e = t, y = 0;
|
|
89
|
+
else if (c < h || Math.abs(l - m) < h)
|
|
90
|
+
e = 0, y = Math.sign(i) * a * Math.tan(Math.asin(l / m) / 2);
|
|
91
|
+
else {
|
|
92
|
+
let I = l / m, f = Math.asin(I), p = Math.cos(f), d = 0.5 * Math.abs(a / t - t / a), g = d * d, b = p / (I + p - 1), R = b * (2 / I - 1), L = R * R, T = L + g, _ = b - L, F = g + b;
|
|
93
|
+
e = Math.sign(t) * a * (d * _ + Math.sqrt(Math.max(0, g * _ * _ - T * (b * b - L)))) / T, y = Math.sign(i) * a * (R * F - d * Math.sqrt(Math.max(0, (g + 1) * T - F * F))) / T;
|
|
94
|
+
}
|
|
95
|
+
const P = o / 2 / a * 0.98, u = o / 2, x = s / 2;
|
|
96
|
+
return [u + e * P, x - y * P];
|
|
97
|
+
},
|
|
98
|
+
globe([M, n], o, s, r) {
|
|
99
|
+
const [a, m] = r, h = (M - a) * Math.PI / 180, t = n * Math.PI / 180, i = m * Math.PI / 180, c = Math.min(o, s) / 2 * 0.95, l = o / 2, e = s / 2, y = c * Math.cos(t) * Math.sin(h) + l, P = -c * (Math.cos(i) * Math.sin(t) - Math.sin(i) * Math.cos(t) * Math.cos(h)) + e;
|
|
100
|
+
return Math.sin(i) * Math.sin(t) + Math.cos(i) * Math.cos(t) * Math.cos(h) < 0 ? [NaN, NaN] : [y, P];
|
|
101
|
+
},
|
|
102
|
+
azimuthalEquidistant([M, n], o, s, r = [0, 0]) {
|
|
103
|
+
const a = (p) => p * Math.PI / 180, [m, h] = r, t = a(M - m), i = a(n), c = a(h), l = Math.sin(c) * Math.sin(i) + Math.cos(c) * Math.cos(i) * Math.cos(t), e = Math.acos(Math.max(-1, Math.min(1, l)));
|
|
104
|
+
let y = e === 0 ? 1 : e / Math.sin(e);
|
|
105
|
+
const P = y * Math.cos(i) * Math.sin(t), u = y * (Math.cos(c) * Math.sin(i) - Math.sin(c) * Math.cos(i) * Math.cos(t)), x = Math.min(o, s) / 2 / Math.PI, I = o / 2, f = s / 2;
|
|
106
|
+
return [
|
|
107
|
+
I + P * x,
|
|
108
|
+
f - u * x
|
|
109
|
+
];
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
function N(M, n, o, s, r = [0, 0]) {
|
|
113
|
+
let a = 1 / 0, m = 1 / 0, h = -1 / 0, t = -1 / 0;
|
|
114
|
+
for (const i of n) {
|
|
115
|
+
const c = i.geometry, l = c.type === "Polygon" ? [c.coordinates] : c.type === "MultiPolygon" ? c.coordinates : [];
|
|
116
|
+
for (const e of l)
|
|
117
|
+
for (const y of e)
|
|
118
|
+
for (const [P, u] of y) {
|
|
119
|
+
const [x, I] = M([P, u], o, s, r);
|
|
120
|
+
!Number.isFinite(x) || !Number.isFinite(I) || (a = Math.min(a, x), h = Math.max(h, x), m = Math.min(m, I), t = Math.max(t, I));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
minX: Math.floor(a) - 10,
|
|
125
|
+
minY: Math.floor(m) - 10,
|
|
126
|
+
width: Math.ceil(h - a) + 20,
|
|
127
|
+
height: Math.ceil(t - m) + 20
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function Q(M, n, o) {
|
|
131
|
+
const s = M.find(
|
|
132
|
+
(a) => a.properties.admin === n || a.properties.name === n
|
|
133
|
+
), r = M.find(
|
|
134
|
+
(a) => a.properties.admin === o || a.properties.name === o
|
|
135
|
+
);
|
|
136
|
+
return s && r && (s.geometry.type === "Polygon" && (s.geometry = {
|
|
137
|
+
type: "MultiPolygon",
|
|
138
|
+
coordinates: [s.geometry.coordinates]
|
|
139
|
+
}), r.geometry.type === "Polygon" ? s.geometry.coordinates.push(r.geometry.coordinates) : r.geometry.type === "MultiPolygon" && s.geometry.coordinates.push(...r.geometry.coordinates), M = M.filter(
|
|
140
|
+
(a) => !(a.properties.admin === o || a.properties.name === o)
|
|
141
|
+
)), M;
|
|
142
|
+
}
|
|
143
|
+
function C(M, n) {
|
|
144
|
+
let o = Array.isArray(n) ? n.map((s) => ({ ...s })) : n.features ? n.features.map((s) => ({ ...s })) : [];
|
|
145
|
+
return M.style.chart.territory.showTaiwanAsPartOfChina && (o = Q(o, "China", "Taiwan")), n.type === "FeatureCollection" ? { ...n, features: o } : o;
|
|
146
|
+
}
|
|
147
|
+
const S = {
|
|
148
|
+
projections: A,
|
|
149
|
+
getProjectedBounds: N,
|
|
150
|
+
setupTerritories: C
|
|
151
|
+
};
|
|
152
|
+
export {
|
|
153
|
+
S as g
|
|
154
|
+
};
|