vue-chrts 2.1.0-beta-2 → 2.1.0-beta-4

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 (159) hide show
  1. package/dist/components/AreaChart/AreaChart.js +127 -107
  2. package/dist/components/AreaChart/types.d.ts +34 -1
  3. package/dist/components/BarChart/BarChart.js +76 -65
  4. package/dist/components/BarChart/types.d.ts +9 -1
  5. package/dist/components/BubbleChart/BubbleChart.js +55 -45
  6. package/dist/components/BubbleChart/types.d.ts +9 -1
  7. package/dist/components/DagreGraph/DagreGraph.js +33 -24
  8. package/dist/components/DagreGraph/types.d.ts +5 -1
  9. package/dist/components/DonutChart/DonutChart.js +69 -59
  10. package/dist/components/DonutChart/types.d.ts +14 -2
  11. package/dist/components/DualChart/DualChart.js +56 -46
  12. package/dist/components/DualChart/types.d.ts +10 -1
  13. package/dist/components/GanttChart/GanttChart.js +58 -48
  14. package/dist/components/GanttChart/types.d.ts +9 -1
  15. package/dist/components/LineChart/LineChart.js +17 -9
  16. package/dist/components/Maps/DottedMap/DottedMap.js +170 -0
  17. package/dist/components/Maps/DottedMap/DottedMap.vue.d.ts +52 -0
  18. package/dist/components/Maps/DottedMap/DottedMap2.js +4 -0
  19. package/dist/components/Maps/DottedMap/MapLegend.vue.d.ts +6 -0
  20. package/dist/components/Maps/DottedMap/MapZoomControls.js +44 -0
  21. package/dist/components/Maps/DottedMap/MapZoomControls.vue.d.ts +13 -0
  22. package/dist/components/Maps/DottedMap/MapZoomControls2.js +4 -0
  23. package/dist/components/Maps/DottedMap/core.js +122 -0
  24. package/dist/components/Maps/DottedMap/core.vue.d.ts +36 -0
  25. package/dist/components/Maps/DottedMap/core2.js +4 -0
  26. package/dist/components/Maps/DottedMap/mapUtils.d.ts +49 -0
  27. package/dist/components/Maps/DottedMap/mapUtils.js +130 -0
  28. package/dist/components/Maps/DottedMap/pins.d.ts +9 -0
  29. package/dist/components/Maps/DottedMap/pins.js +58 -0
  30. package/dist/components/Maps/DottedMap/regions.d.ts +4 -0
  31. package/dist/components/Maps/DottedMap/regions.js +66 -0
  32. package/dist/components/Maps/DottedMap/types.d.ts +127 -0
  33. package/dist/components/Maps/DottedMap/useMapPanZoom.d.ts +22 -0
  34. package/dist/components/Maps/DottedMap/useMapPanZoom.js +41 -0
  35. package/dist/components/Maps/TopoJSONMap/TopoJSONMap.js +170 -0
  36. package/dist/components/Maps/TopoJSONMap/TopoJSONMap.vue.d.ts +30 -0
  37. package/dist/components/Maps/TopoJSONMap/TopoJSONMap2.js +4 -0
  38. package/dist/components/Maps/TopoJSONMap/data.d.ts +13 -0
  39. package/dist/components/Maps/TopoJSONMap/types.d.ts +40 -0
  40. package/dist/components/Maps/types.d.ts +48 -0
  41. package/dist/components/SankeyChart/SankeyChart.js +50 -40
  42. package/dist/components/SankeyChart/SankeyChart.vue.d.ts +1 -1
  43. package/dist/components/SankeyChart/types.d.ts +14 -1
  44. package/dist/components/Tooltip.js +32 -27
  45. package/dist/data/countries.geo.json.js +9 -0
  46. package/dist/index.d.ts +6 -3
  47. package/dist/index.js +27 -23
  48. package/dist/node_modules/.pnpm/@turf_boolean-point-in-polygon@7.3.1/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js +28 -0
  49. package/dist/node_modules/.pnpm/@turf_invariant@7.3.1/node_modules/@turf/invariant/dist/esm/index.js +20 -0
  50. package/dist/node_modules/.pnpm/mgrs@1.0.0/node_modules/mgrs/mgrs.js +222 -0
  51. package/dist/node_modules/.pnpm/point-in-polygon-hao@1.2.4/node_modules/point-in-polygon-hao/dist/esm/index.js +25 -0
  52. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/Point.js +24 -0
  53. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/Proj.js +46 -0
  54. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/adjust_axis.js +31 -0
  55. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/checkSanity.js +15 -0
  56. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_lat.js +8 -0
  57. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_lon.js +8 -0
  58. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_zone.js +13 -0
  59. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/asinhy.js +9 -0
  60. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/asinz.js +6 -0
  61. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/clens.js +8 -0
  62. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/clens_cmplx.js +10 -0
  63. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/cosh.js +7 -0
  64. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e0fn.js +6 -0
  65. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e1fn.js +6 -0
  66. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e2fn.js +6 -0
  67. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e3fn.js +6 -0
  68. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/gN.js +7 -0
  69. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/gatg.js +8 -0
  70. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/hypot.js +8 -0
  71. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/imlfn.js +11 -0
  72. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/iqsfnz.js +13 -0
  73. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/log1py.js +7 -0
  74. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/mlfn.js +6 -0
  75. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/msfnz.js +7 -0
  76. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/phi2z.js +10 -0
  77. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_enfn.js +10 -0
  78. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_inv_mlfn.js +14 -0
  79. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_mlfn.js +6 -0
  80. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/qsfnz.js +7 -0
  81. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/sign.js +6 -0
  82. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/sinh.js +7 -0
  83. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/srat.js +6 -0
  84. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/toPoint.js +10 -0
  85. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/tsfnz.js +8 -0
  86. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/vincenty.js +33 -0
  87. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/Datum.js +1278 -0
  88. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/Ellipsoid.js +226 -0
  89. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/PrimeMeridian.js +17 -0
  90. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/units.js +25 -0
  91. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/values.js +22 -0
  92. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/core.js +65 -0
  93. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datum.js +8 -0
  94. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datumUtils.js +82 -0
  95. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datum_transform.js +94 -0
  96. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/defs.js +39 -0
  97. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/deriveConstants.js +30 -0
  98. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/extend.js +12 -0
  99. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/global.js +9 -0
  100. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/index.js +25 -0
  101. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/match.js +11 -0
  102. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/nadgrid.js +128 -0
  103. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/parseCode.js +47 -0
  104. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projString.js +119 -0
  105. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/aea.js +43 -0
  106. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/aeqd.js +36 -0
  107. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/bonne.js +55 -0
  108. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/cass.js +52 -0
  109. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/cea.js +36 -0
  110. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqc.js +27 -0
  111. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqdc.js +48 -0
  112. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqearth.js +30 -0
  113. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/etmerc.js +54 -0
  114. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/gauss.js +27 -0
  115. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/geocent.js +26 -0
  116. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/geos.js +49 -0
  117. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/gnom.js +28 -0
  118. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/krovak.js +31 -0
  119. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/laea.js +134 -0
  120. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/lcc.js +61 -0
  121. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/longlat.js +19 -0
  122. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/merc.js +49 -0
  123. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/mill.js +26 -0
  124. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/moll.js +37 -0
  125. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/nzmg.js +48 -0
  126. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/ob_tran.js +173 -0
  127. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/omerc.js +58 -0
  128. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/ortho.js +28 -0
  129. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/poly.js +68 -0
  130. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/qsc.js +67 -0
  131. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/robin.js +104 -0
  132. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/sinu.js +47 -0
  133. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/somerc.js +34 -0
  134. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/stere.js +46 -0
  135. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/sterea.js +33 -0
  136. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/tmerc.js +60 -0
  137. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/tpers.js +110 -0
  138. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/utm.js +22 -0
  139. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/vandg.js +34 -0
  140. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections.js +34 -0
  141. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/transform.js +49 -0
  142. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/projs.js +38 -0
  143. package/dist/node_modules/.pnpm/robust-predicates@3.0.2/node_modules/robust-predicates/esm/orient2d.js +23 -0
  144. package/dist/node_modules/.pnpm/robust-predicates@3.0.2/node_modules/robust-predicates/esm/util.js +30 -0
  145. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilder2015.js +9 -0
  146. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilder2019.js +20 -0
  147. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilderBase.js +171 -0
  148. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/buildPROJJSON.js +11 -0
  149. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/detectWKTVersion.js +7 -0
  150. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/index.js +104 -0
  151. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/parser.js +117 -0
  152. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/process.js +89 -0
  153. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/transformPROJJSON.js +73 -0
  154. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/util.js +12 -0
  155. package/dist/types.d.ts +60 -13
  156. package/dist/types.js +4 -6
  157. package/dist/utils/geoJsonToGrid.d.ts +14 -0
  158. package/dist/utils/index.d.ts +1 -0
  159. package/package.json +8 -2
@@ -0,0 +1,130 @@
1
+ import y from "../../../node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/index.js";
2
+ import Y from "../../../node_modules/.pnpm/@turf_boolean-point-in-polygon@7.3.1/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js";
3
+ y.defs("GOOGLE") || y.defs("GOOGLE", "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs");
4
+ const h = {
5
+ lat: { min: -56, max: 71 },
6
+ lng: { min: -179, max: 179 }
7
+ }, P = (t) => ({ type: "Feature", geometry: { type: "MultiPolygon", coordinates: t.features.reduce(
8
+ (c, o) => c.concat(
9
+ o.geometry.type === "Polygon" ? [o.geometry.coordinates] : o.geometry.coordinates
10
+ ),
11
+ []
12
+ ) } }), M = (t) => {
13
+ const { type: n, features: c, geometry: o, coordinates: i } = t;
14
+ if (n === "FeatureCollection") {
15
+ const l = c.map(M);
16
+ return {
17
+ lat: {
18
+ min: Math.min(...l.map((e) => e.lat.min)),
19
+ max: Math.max(...l.map((e) => e.lat.max))
20
+ },
21
+ lng: {
22
+ min: Math.min(...l.map((e) => e.lng.min)),
23
+ max: Math.max(...l.map((e) => e.lng.max))
24
+ }
25
+ };
26
+ } else {
27
+ if (n === "Feature")
28
+ return M(o);
29
+ if (n === "MultiPolygon")
30
+ return M({
31
+ type: "Polygon",
32
+ coordinates: i.flat(1)
33
+ });
34
+ if (n === "Polygon") {
35
+ const l = i.flat(1), e = l.map(([u, r]) => r), a = l.map(([u, r]) => u);
36
+ return {
37
+ lat: {
38
+ min: Math.min(...e),
39
+ max: Math.max(...e)
40
+ },
41
+ lng: {
42
+ min: Math.min(...a),
43
+ max: Math.max(...a)
44
+ }
45
+ };
46
+ } else
47
+ throw new Error(`Unknown geojson type ${n}`);
48
+ }
49
+ }, w = ({
50
+ height: t = 0,
51
+ width: n = 0,
52
+ countries: c = [],
53
+ region: o,
54
+ grid: i = "vertical",
55
+ geojsonWorld: l
56
+ }) => {
57
+ if (t <= 0 && n <= 0)
58
+ throw new Error("height or width is required");
59
+ const e = l.features.reduce((s, m) => (s[m.id] = m, s), {});
60
+ let a = l;
61
+ c.length > 0 ? (a = {
62
+ type: "FeatureCollection",
63
+ features: c.map((s) => e[s]).filter(Boolean)
64
+ }, o || (o = M(a))) : o || (o = h), P(a);
65
+ const [u, r] = y("GOOGLE", [
66
+ o.lng.min,
67
+ o.lat.min
68
+ ]), [d, f] = y("GOOGLE", [
69
+ o.lng.max,
70
+ o.lat.max
71
+ ]), g = d - u, x = f - r;
72
+ n <= 0 ? n = Math.round(t * g / x) : t <= 0 && (t = Math.round(n * x / g));
73
+ const E = {}, G = i === "diagonal" ? Math.sqrt(3) / 2 : 1;
74
+ for (let s = 0; s * G < t; s += 1)
75
+ for (let m = 0; m < n; m += 1) {
76
+ const O = s % 2 === 0 && i === "diagonal" ? m + 0.5 : m, X = s * G, L = [
77
+ O / n * g + u,
78
+ f - X / t * x
79
+ ], p = y(
80
+ "GOOGLE",
81
+ "WGS84",
82
+ L
83
+ ), A = a.features.find((_) => Y(p, _));
84
+ if (A) {
85
+ const [_, N] = p;
86
+ E[[m, s].join(";")] = { x: O, y: X, lat: N, lng: _, countryId: A.id };
87
+ }
88
+ }
89
+ return {
90
+ points: E,
91
+ X_MIN: u,
92
+ Y_MIN: r,
93
+ X_MAX: d,
94
+ Y_MAX: f,
95
+ X_RANGE: g,
96
+ Y_RANGE: x,
97
+ region: o,
98
+ grid: i,
99
+ height: t,
100
+ width: n,
101
+ ystep: G
102
+ };
103
+ }, F = (t, { lat: n, lng: c }) => {
104
+ const [o, i] = y("GOOGLE", [c, n]);
105
+ let [l, e] = [
106
+ t.width * (o - t.X_MIN) / t.X_RANGE,
107
+ t.height * (t.Y_MAX - i) / t.Y_RANGE
108
+ ];
109
+ const a = Math.round(e / t.ystep);
110
+ a % 2 === 0 && t.grid === "diagonal" && (l -= 0.5);
111
+ const u = Math.round(l);
112
+ let [r, d] = [u, Math.round(a) * t.ystep];
113
+ a % 2 === 0 && t.grid === "diagonal" && (r += 0.5);
114
+ const [f, g] = y(
115
+ "GOOGLE",
116
+ "WGS84",
117
+ [
118
+ r * t.X_RANGE / t.width + t.X_MIN,
119
+ t.Y_MAX - d * t.Y_RANGE / t.height
120
+ ]
121
+ );
122
+ return { x: r, y: d, lat: g, lng: f };
123
+ };
124
+ export {
125
+ h as DEFAULT_WORLD_REGION,
126
+ M as computeGeojsonBox,
127
+ P as geojsonToMultiPolygons,
128
+ w as getMap,
129
+ F as getPin
130
+ };
@@ -0,0 +1,9 @@
1
+ import { MapPin } from './types';
2
+ export declare const DEFAULT_PIN_OPTIONS: {
3
+ color: string;
4
+ radius: number;
5
+ };
6
+ export declare function createPin(lat: number, lng: number, data?: Record<string, unknown>, svgOptions?: MapPin['svgOptions']): MapPin;
7
+ export declare const WORLD_PINS: MapPin[];
8
+ export declare const USA_PINS: MapPin[];
9
+ export declare function filterPinsByRegion(pins: MapPin[], region: string): MapPin[];
@@ -0,0 +1,58 @@
1
+ const t = {
2
+ color: "var(--ui-text)",
3
+ radius: 0.15
4
+ };
5
+ function i(o, e, r = {}, c = {}) {
6
+ return {
7
+ lat: o,
8
+ lng: e,
9
+ svgOptions: { ...t, ...c },
10
+ data: r
11
+ };
12
+ }
13
+ const n = [
14
+ // North America (USA)
15
+ i(40.7128, -74.006, { city: "New York", region: "USA" }),
16
+ i(34.0522, -118.2437, { city: "Los Angeles", region: "USA" }),
17
+ i(41.8781, -87.6298, { city: "Chicago", region: "USA" }),
18
+ i(25.7617, -80.1918, { city: "Miami", region: "USA" }),
19
+ i(47.6062, -122.3321, { city: "Seattle", region: "USA" }),
20
+ // South America
21
+ i(-23.5505, -46.6333, { city: "São Paulo", region: "South America" }),
22
+ i(-34.6037, -58.3816, { city: "Buenos Aires", region: "South America" }),
23
+ i(-12.0464, -77.0428, { city: "Lima", region: "South America" }),
24
+ i(4.711, -74.0721, { city: "Bogotá", region: "South America" }),
25
+ i(-33.4489, -70.6693, { city: "Santiago", region: "South America" }),
26
+ // Europe
27
+ i(48.8566, 2.3522, { city: "Paris", region: "Europe" }),
28
+ i(51.5074, -0.1278, { city: "London", region: "Europe" }),
29
+ i(52.52, 13.405, { city: "Berlin", region: "Europe" }),
30
+ i(41.9028, 12.4964, { city: "Rome", region: "Europe" }),
31
+ i(59.3293, 18.0686, { city: "Stockholm", region: "Europe" }),
32
+ // Asia
33
+ i(35.6762, 139.6503, { city: "Tokyo", region: "Asia" }),
34
+ i(1.3521, 103.8198, { city: "Singapore", region: "Asia" }),
35
+ i(28.6139, 77.209, { city: "New Delhi", region: "Asia" }),
36
+ i(31.2304, 121.4737, { city: "Shanghai", region: "Asia" }),
37
+ i(25.2048, 55.2708, { city: "Dubai", region: "Asia" }),
38
+ // Oceania
39
+ i(-33.8688, 151.2093, { city: "Sydney", region: "Oceania" }),
40
+ i(-37.8136, 144.9631, { city: "Melbourne", region: "Oceania" }),
41
+ i(-36.8485, 174.7633, { city: "Auckland", region: "Oceania" }),
42
+ i(-27.4705, 153.026, { city: "Brisbane", region: "Oceania" }),
43
+ i(-31.9505, 115.8605, { city: "Perth", region: "Oceania" })
44
+ ], a = [
45
+ i(37.7749, -122.4194, { city: "San Francisco" }, { color: "#6366f1", radius: 0.3 }),
46
+ i(34.0522, -118.2437, { city: "Los Angeles" }, { color: "#6366f1", radius: 0.3 }),
47
+ i(47.6062, -122.3321, { city: "Seattle" }, { color: "#6366f1", radius: 0.3 }),
48
+ i(40.7128, -74.006, { city: "New York" }, { color: "#f59e0b", radius: 0.3 }),
49
+ i(42.3601, -71.0589, { city: "Boston" }, { color: "#f59e0b", radius: 0.3 }),
50
+ i(25.7617, -80.1918, { city: "Miami" }, { color: "#ec4899", radius: 0.3 }),
51
+ i(30.2672, -97.7431, { city: "Austin" }, { color: "#10b981", radius: 0.3 })
52
+ ];
53
+ export {
54
+ t as DEFAULT_PIN_OPTIONS,
55
+ a as USA_PINS,
56
+ n as WORLD_PINS,
57
+ i as createPin
58
+ };
@@ -0,0 +1,4 @@
1
+ import { MapRegion } from './types';
2
+ export declare const REGIONS: Record<string, MapRegion>;
3
+ export declare const COUNTRIES: Record<string, string[]>;
4
+ export declare const DEFAULT_ZOOM: Record<string, number>;
@@ -0,0 +1,66 @@
1
+ const a = {
2
+ usa: {
3
+ lat: { min: 24, max: 50 },
4
+ lng: { min: -125, max: -66 }
5
+ },
6
+ europe: {
7
+ lat: { min: 20, max: 72 },
8
+ lng: { min: -75, max: 75 }
9
+ },
10
+ asia: {
11
+ lat: { min: -10, max: 55 },
12
+ lng: { min: 60, max: 150 }
13
+ },
14
+ oceania: {
15
+ lat: { min: -50, max: 0 },
16
+ lng: { min: 110, max: 180 }
17
+ }
18
+ }, n = {
19
+ europe: [
20
+ "FRA",
21
+ "DEU",
22
+ "BEL",
23
+ "NLD",
24
+ "LUX",
25
+ "CHE",
26
+ "AUT",
27
+ "CZE",
28
+ "POL",
29
+ "SVK",
30
+ "HUN",
31
+ "SVN",
32
+ "ITA",
33
+ "ESP",
34
+ "PRT",
35
+ "GBR",
36
+ "IRL",
37
+ "DNK",
38
+ "SWE",
39
+ "FIN",
40
+ "ISL",
41
+ "EST",
42
+ "LVA",
43
+ "LTU",
44
+ "HRV",
45
+ "SRB",
46
+ "BIH",
47
+ "MNE",
48
+ "MKD",
49
+ "UKR",
50
+ "BLR"
51
+ ],
52
+ asia: ["CHN", "IND", "JPN", "KOR", "IDN", "PAK", "BGD", "SAU", "IRN"],
53
+ usa: ["USA"],
54
+ oceania: ["AUS", "NZL"]
55
+ }, m = {
56
+ world: 1,
57
+ europe: 0.75,
58
+ asia: 0.5,
59
+ oceania: 0.5,
60
+ usa: 0.5
61
+ };
62
+ export {
63
+ n as COUNTRIES,
64
+ m as DEFAULT_ZOOM,
65
+ a as REGIONS
66
+ };
@@ -0,0 +1,127 @@
1
+ export type MapRegion = {
2
+ lat: {
3
+ min: number;
4
+ max: number;
5
+ };
6
+ lng: {
7
+ min: number;
8
+ max: number;
9
+ };
10
+ };
11
+ export type MapPin = {
12
+ lat: number;
13
+ lng: number;
14
+ svgOptions?: {
15
+ color?: string;
16
+ radius?: number;
17
+ strokeColor?: string;
18
+ strokeWidth?: number;
19
+ strokeOpacity?: number;
20
+ };
21
+ data?: Record<string, unknown>;
22
+ };
23
+ export interface DottedMapProps {
24
+ /**
25
+ * The height of the map in dots.
26
+ * If specified, width will be calculated automatically to preserve aspect ratio.
27
+ */
28
+ mapHeight?: number;
29
+ /**
30
+ * The width of the map in dots.
31
+ * If specified, height will be calculated automatically to preserve aspect ratio.
32
+ */
33
+ mapWidth?: number;
34
+ /**
35
+ * Array of ISO 3166-1 alpha-3 country codes to include in the map.
36
+ * If omitted, the whole world is used.
37
+ */
38
+ countries?: string[];
39
+ /**
40
+ * Specific region to display.
41
+ */
42
+ region?: MapRegion;
43
+ /**
44
+ * How points should be aligned.
45
+ * @default 'vertical'
46
+ */
47
+ grid?: 'vertical' | 'diagonal';
48
+ /**
49
+ * If true, prevent adding pins when they are outside of region/countries.
50
+ * @default false
51
+ */
52
+ avoidOuterPins?: boolean;
53
+ /**
54
+ * Array of pins to add to the map.
55
+ */
56
+ pins?: MapPin[];
57
+ /**
58
+ * Precomputed map data (JSON string or object).
59
+ * If provided, it will be used instead of computing the map from scratch.
60
+ */
61
+ precomputedMap?: string | object;
62
+ /**
63
+ * Default color of the dots.
64
+ * @default '#ffffff'
65
+ */
66
+ color?: string;
67
+ /**
68
+ * Default size (radius) of the dots.
69
+ * @default 0.5
70
+ */
71
+ dotSize?: number;
72
+ /**
73
+ * Stroke color of the dots.
74
+ */
75
+ strokeColor?: string;
76
+ /**
77
+ * Stroke width of the dots.
78
+ */
79
+ strokeWidth?: number;
80
+ /**
81
+ * Stroke opacity of the dots.
82
+ */
83
+ strokeOpacity?: number;
84
+ /**
85
+ * Shape of the dots.
86
+ * @default 'circle'
87
+ */
88
+ shape?: 'circle' | 'hexagon';
89
+ /**
90
+ * Custom colors for specific countries.
91
+ */
92
+ countryColors?: Record<string, string>;
93
+ /**
94
+ * Background color of the map container.
95
+ */
96
+ backgroundColor?: string;
97
+ }
98
+ export type DottedWorldMapProps = DottedMapProps;
99
+ export interface MapVariant {
100
+ mapWidth?: number;
101
+ mapHeight?: number;
102
+ dotSize?: number;
103
+ grid?: 'vertical' | 'diagonal';
104
+ shape?: 'circle' | 'hexagon';
105
+ /**
106
+ * Custom colors for specific countries.
107
+ */
108
+ countryColors?: Record<string, string>;
109
+ strokeWidth?: number;
110
+ strokeOpacity?: number;
111
+ countries?: string[];
112
+ region?: MapRegion;
113
+ pins?: MapPin[];
114
+ color?: string;
115
+ defaultZoom?: number;
116
+ }
117
+ export type MapRegionName = 'world' | 'europe' | 'asia' | 'oceania' | 'usa';
118
+ export interface MapLegendItem {
119
+ color: string;
120
+ label: string;
121
+ }
122
+ export interface ZoomConfig {
123
+ min: number;
124
+ max: number;
125
+ step: number;
126
+ default: number;
127
+ }
@@ -0,0 +1,22 @@
1
+ export interface PanZoomState {
2
+ x: number;
3
+ y: number;
4
+ }
5
+ export interface UseMapPanZoomOptions {
6
+ minScale?: number;
7
+ maxScale?: number;
8
+ scaleStep?: number;
9
+ }
10
+ export declare function useMapPanZoom(options?: UseMapPanZoomOptions): {
11
+ scale: import('vue').Ref<number, number>;
12
+ offset: {
13
+ x: number;
14
+ y: number;
15
+ };
16
+ zoomIn: () => void;
17
+ zoomOut: () => void;
18
+ resetView: (defaultZoom?: number) => void;
19
+ wasClick: () => boolean;
20
+ onWheel: (event: WheelEvent) => void;
21
+ onMouseDown: (event: MouseEvent) => void;
22
+ };
@@ -0,0 +1,41 @@
1
+ import { ref as X, reactive as y } from "vue";
2
+ function b(x = {}) {
3
+ const {
4
+ minScale: w = 0.25,
5
+ maxScale: Y = 4,
6
+ scaleStep: a = 0.25
7
+ } = x, o = X(1), e = y({ x: 0, y: 0 });
8
+ let s = !1, l = 0, c = 0, u = 0, r = 0, n = !1;
9
+ const i = 5, m = () => {
10
+ o.value = Math.min(o.value + a, Y);
11
+ }, f = () => {
12
+ o.value = Math.max(o.value - a, w);
13
+ };
14
+ return {
15
+ scale: o,
16
+ offset: e,
17
+ zoomIn: m,
18
+ zoomOut: f,
19
+ resetView: (t = 1) => {
20
+ o.value = t, e.x = 0, e.y = 0;
21
+ },
22
+ wasClick: () => !n,
23
+ onWheel: (t) => {
24
+ t.preventDefault(), t.deltaY < 0 ? m() : f();
25
+ },
26
+ onMouseDown: (t) => {
27
+ s = !0, n = !1, l = t.clientX, c = t.clientY, u = e.x, r = e.y;
28
+ const v = (M) => {
29
+ if (!s) return;
30
+ const h = M.clientX - l, p = M.clientY - c;
31
+ (Math.abs(h) > i || Math.abs(p) > i) && (n = !0), e.x = u + h, e.y = r + p;
32
+ }, d = () => {
33
+ s = !1, document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", d);
34
+ };
35
+ document.addEventListener("mousemove", v), document.addEventListener("mouseup", d);
36
+ }
37
+ };
38
+ }
39
+ export {
40
+ b as useMapPanZoom
41
+ };
@@ -0,0 +1,170 @@
1
+ import { defineComponent as O, useSlots as A, useTemplateRef as y, ref as C, computed as c, createElementBlock as h, openBlock as d, normalizeStyle as f, createVNode as s, createCommentVNode as m, createElementVNode as J, unref as r, withCtx as R, createBlock as $, renderSlot as v } from "vue";
2
+ import { VisSingleContainer as D, VisTopoJSONMap as K, VisTooltip as H, VisBulletLegend as q } from "@unovis/vue";
3
+ import { TopoJSONMap as p } from "@unovis/ts";
4
+ import G from "../../Tooltip.js";
5
+ import { LegendPosition as I } from "../../../types.js";
6
+ const Q = {
7
+ ref: "slotWrapper",
8
+ style: { display: "none" }
9
+ }, et = /* @__PURE__ */ O({
10
+ __name: "TopoJSONMap",
11
+ props: {
12
+ mapFeatureKey: {},
13
+ data: {},
14
+ topojson: {},
15
+ zoomFactor: { default: 1 },
16
+ zoomExtent: { default: () => [0.5, 6] },
17
+ projection: {},
18
+ areaColor: {},
19
+ areaCursor: {},
20
+ pointColor: {},
21
+ pointSize: { type: [Number, Function], default: 5 },
22
+ pointLabel: {},
23
+ pointCursor: {},
24
+ linkColor: {},
25
+ linkWidth: {},
26
+ linkCursor: {},
27
+ height: {},
28
+ width: {},
29
+ fitView: { type: Boolean },
30
+ fitViewPadding: {},
31
+ hideTooltip: { type: Boolean },
32
+ tooltipTitleFormatter: {},
33
+ yFormatter: {},
34
+ categories: {},
35
+ legendPosition: { default: I.BottomCenter },
36
+ legendStyle: {},
37
+ hideLegend: { type: Boolean, default: !1 },
38
+ duration: { default: 600 },
39
+ pointStrokeWidth: {},
40
+ mapFitToPoints: { type: Boolean, default: !1 },
41
+ padding: { default: () => ({
42
+ top: 5,
43
+ right: 5,
44
+ bottom: 5,
45
+ left: 5
46
+ }) }
47
+ },
48
+ emits: ["mouseenter", "mouseleave", "feature-click", "point-click"],
49
+ setup(T, { emit: S }) {
50
+ const e = T, a = S, w = A(), g = y("slotWrapper"), n = C(), F = c(() => {
51
+ var t;
52
+ return (t = e.legendPosition) == null ? void 0 : t.startsWith("top");
53
+ }), P = c(() => {
54
+ var t, i;
55
+ return (t = e.legendPosition) != null && t.includes("left") ? "flex-start" : (i = e.legendPosition) != null && i.includes("right") ? "flex-end" : "center";
56
+ });
57
+ function k(t) {
58
+ return typeof window > "u" ? "" : g.value ? g.value.innerHTML : "";
59
+ }
60
+ const V = {
61
+ [p.selectors.feature]: (t) => {
62
+ const i = t.data ?? t.datum ?? {}, o = t.properties ?? {};
63
+ return n.value = { ...o, ...i, ...t }, k();
64
+ },
65
+ [p.selectors.point]: (t) => (n.value = t, k())
66
+ }, u = y("map"), z = (t) => e.pointLabel ? e.pointLabel(t) : t.label, W = (t) => typeof e.pointSize == "function" ? e.pointSize(t) : e.pointSize ?? t.radius ?? 5, j = (t) => typeof e.pointColor == "function" ? e.pointColor(t) : e.pointColor ?? t.color, x = (t) => {
67
+ var o;
68
+ if (typeof e.linkColor == "function") return e.linkColor(t);
69
+ const i = typeof t.source == "object" ? t.source : (o = e.data.points) == null ? void 0 : o.find((M) => M.id === t.target);
70
+ return e.linkColor ?? t.color ?? (i == null ? void 0 : i.color);
71
+ }, _ = (t) => typeof e.areaColor == "function" ? e.areaColor(t) : e.areaColor ?? t.color, b = (t) => typeof e.linkWidth == "function" ? e.linkWidth(t) : e.linkWidth ?? t.width ?? 1, L = C(null), B = (t, i) => {
72
+ a("feature-click", t, i);
73
+ }, N = (t, i) => {
74
+ var o;
75
+ L.value = t, a("point-click", t, i), (o = u.value) != null && o.component && u.value.component._fitToPoints([t], 0.1);
76
+ }, E = (t) => e.tooltipTitleFormatter ? e.tooltipTitleFormatter(t) : t ? ((t == null ? void 0 : t.properties) ?? {}).name ?? "" : "", l = c(() => e.data);
77
+ return (t, i) => (d(), h("div", {
78
+ style: f({
79
+ display: "flex",
80
+ flexDirection: F.value ? "column-reverse" : "column",
81
+ gap: "var(--vis-legend-spacing)"
82
+ })
83
+ }, [
84
+ s(r(D), {
85
+ duration: e.duration,
86
+ data: l.value,
87
+ height: e.height,
88
+ width: e.width,
89
+ padding: e.padding
90
+ }, {
91
+ default: R(() => [
92
+ s(r(K), {
93
+ ref_key: "map",
94
+ ref: u,
95
+ data: l.value.areas,
96
+ "point-data": l.value.points,
97
+ "link-data": l.value.links,
98
+ topojson: e.topojson,
99
+ projection: e.projection,
100
+ "zoom-factor": e.zoomFactor,
101
+ "zoom-extent": e.zoomExtent,
102
+ fitView: e.fitView,
103
+ fitViewPadding: e.fitViewPadding,
104
+ pointLabel: z,
105
+ pointRadius: W,
106
+ pointColor: j,
107
+ pointCursor: e.pointCursor,
108
+ pointStrokeWidth: e.pointStrokeWidth,
109
+ linkColor: x,
110
+ linkWidth: b,
111
+ linkCursor: e.linkCursor,
112
+ mapFitToPoints: e.mapFitToPoints,
113
+ areaColor: _,
114
+ areaCursor: e.areaCursor,
115
+ "map-feature-name": e.mapFeatureKey,
116
+ events: {
117
+ [r(p).selectors.feature]: {
118
+ click: B,
119
+ mouseover: (o) => a("mouseenter", o),
120
+ mouseout: (o) => a("mouseleave", o)
121
+ },
122
+ [r(p).selectors.point]: {
123
+ click: N
124
+ }
125
+ }
126
+ }, null, 8, ["data", "point-data", "link-data", "topojson", "projection", "zoom-factor", "zoom-extent", "fitView", "fitViewPadding", "pointCursor", "pointStrokeWidth", "linkCursor", "mapFitToPoints", "areaCursor", "map-feature-name", "events"]),
127
+ e.hideTooltip ? m("", !0) : (d(), $(r(H), {
128
+ key: 0,
129
+ triggers: V
130
+ }))
131
+ ]),
132
+ _: 1
133
+ }, 8, ["duration", "data", "height", "width", "padding"]),
134
+ e.categories && !e.hideLegend ? (d(), h("div", {
135
+ key: 0,
136
+ style: f({
137
+ display: "flex",
138
+ justifyContent: P.value
139
+ })
140
+ }, [
141
+ s(r(q), {
142
+ style: f([
143
+ e.legendStyle,
144
+ "display: flex; gap: var(--vis-legend-spacing);"
145
+ ]),
146
+ items: Object.values(e.categories).map((o) => ({
147
+ ...o,
148
+ color: Array.isArray(o.color) ? o.color[0] : o.color
149
+ }))
150
+ }, null, 8, ["style", "items"])
151
+ ], 4)) : m("", !0),
152
+ J("div", Q, [
153
+ r(w).tooltip ? v(t.$slots, "tooltip", {
154
+ key: 0,
155
+ values: n.value
156
+ }) : n.value ? v(t.$slots, "fallback", { key: 1 }, () => [
157
+ s(G, {
158
+ data: n.value,
159
+ categories: e.categories ?? {},
160
+ "title-formatter": e.tooltipTitleFormatter ?? E,
161
+ "y-formatter": e.yFormatter
162
+ }, null, 8, ["data", "categories", "title-formatter", "y-formatter"])
163
+ ]) : m("", !0)
164
+ ], 512)
165
+ ], 4));
166
+ }
167
+ });
168
+ export {
169
+ et as default
170
+ };
@@ -0,0 +1,30 @@
1
+ import { MapsData } from './types';
2
+ import { MapPoint } from '../types';
3
+ declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
+ readonly onMouseenter?: ((d: any) => any) | undefined;
6
+ readonly onMouseleave?: ((d: any) => any) | undefined;
7
+ readonly "onFeature-click"?: ((d: any, event: MouseEvent) => any) | undefined;
8
+ readonly "onPoint-click"?: ((d: MapPoint, event: MouseEvent) => any) | undefined;
9
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onMouseenter" | "onMouseleave" | "onFeature-click" | "onPoint-click"> & MapsData<T> & Partial<{}>> & import('vue').PublicProps;
10
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
11
+ attrs: any;
12
+ slots: {
13
+ tooltip?(_: {
14
+ values: T | undefined;
15
+ }): any;
16
+ fallback?(_: {}): any;
17
+ };
18
+ emit: {
19
+ (e: "mouseenter", d: any): void;
20
+ (e: "mouseleave", d: any): void;
21
+ (e: "feature-click", d: any, event: MouseEvent): void;
22
+ (e: "point-click", d: MapPoint, event: MouseEvent): void;
23
+ };
24
+ }>) => import('vue').VNode & {
25
+ __ctx?: Awaited<typeof __VLS_setup>;
26
+ };
27
+ export default _default;
28
+ type __VLS_PrettifyLocal<T> = {
29
+ [K in keyof T]: T[K];
30
+ } & {};
@@ -0,0 +1,4 @@
1
+ import f from "./TopoJSONMap.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,13 @@
1
+ import { MapLibreStyleSpecs } from '@unovis/ts';
2
+ export type MapPointDataRecord = {
3
+ name: string;
4
+ longitude: number;
5
+ latitude: number;
6
+ normal: number;
7
+ blocked: number;
8
+ };
9
+ export declare const data: MapPointDataRecord[];
10
+ export declare const totalEvents: number;
11
+ export declare const generateStyle: (backgroundColor: string, countryFillColor: string, countryBoundaryColor: string, coastlineColor: string) => MapLibreStyleSpecs;
12
+ export declare const mapStyleLight: MapLibreStyleSpecs;
13
+ export declare const mapStyleDark: MapLibreStyleSpecs;