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
@@ -1,4 +1,4 @@
1
- import { BulletLegendItemInterface, CrosshairConfig, LegendPosition, AxisConfig } from '../../types';
1
+ import { BulletLegendItemInterface, CrosshairConfig, LegendPosition, AxisConfig, TooltipConfig } from '../../types';
2
2
  export interface GanttChartProps<T> {
3
3
  /**
4
4
  * The data to be displayed in the timeline chart.
@@ -113,4 +113,12 @@ export interface GanttChartProps<T> {
113
113
  * Axis configuration object for customizing the appearance of the axes.
114
114
  */
115
115
  yAxisConfig?: AxisConfig;
116
+ /**
117
+ * Animation duration in milliseconds for the chart components.
118
+ */
119
+ duration?: number;
120
+ /**
121
+ * Configuration object for the chart tooltip.
122
+ */
123
+ tooltip?: TooltipConfig;
116
124
  }
@@ -1,6 +1,6 @@
1
- import { defineComponent as n, useSlots as a, createBlock as r, openBlock as l, mergeProps as p, createSlots as s, withCtx as y, renderSlot as c, normalizeProps as m, guardReactiveProps as d } from "vue";
2
- import x from "../AreaChart/AreaChart.js";
3
- const g = /* @__PURE__ */ n({
1
+ import { defineComponent as t, useSlots as a, createBlock as l, openBlock as r, mergeProps as p, createSlots as s, withCtx as y, renderSlot as c, normalizeProps as d, guardReactiveProps as x } from "vue";
2
+ import m from "../AreaChart/AreaChart.js";
3
+ const T = /* @__PURE__ */ t({
4
4
  __name: "LineChart",
5
5
  props: {
6
6
  data: {},
@@ -19,7 +19,13 @@ const g = /* @__PURE__ */ n({
19
19
  xNumTicks: {},
20
20
  xExplicitTicks: {},
21
21
  minMaxTicksOnly: { type: Boolean },
22
+ xMinMaxTicksOnly: { type: Boolean },
23
+ yMinMaxTicksOnly: { type: Boolean },
24
+ minMaxTicksOnlyShowGridLines: { type: Boolean },
25
+ xMinMaxTicksOnlyShowGridLines: { type: Boolean },
26
+ yMinMaxTicksOnlyShowGridLines: { type: Boolean },
22
27
  yNumTicks: {},
28
+ yExplicitTicks: {},
23
29
  hideLegend: { type: Boolean },
24
30
  hideTooltip: { type: Boolean },
25
31
  legendPosition: {},
@@ -37,15 +43,17 @@ const g = /* @__PURE__ */ n({
37
43
  yAxisConfig: {},
38
44
  yDomain: {},
39
45
  xDomain: {},
40
- stacked: { type: Boolean }
46
+ stacked: { type: Boolean },
47
+ duration: {},
48
+ tooltip: {}
41
49
  },
42
50
  setup(o) {
43
- const t = o;
44
- return a(), (e, B) => (l(), r(x, p(t, { "hide-area": !0 }), s({ _: 2 }, [
51
+ const i = o;
52
+ return a(), (e, B) => (r(), l(m, p(i, { "hide-area": !0 }), s({ _: 2 }, [
45
53
  e.$slots.tooltip ? {
46
54
  name: "tooltip",
47
- fn: y((i) => [
48
- c(e.$slots, "tooltip", m(d(i)))
55
+ fn: y((n) => [
56
+ c(e.$slots, "tooltip", d(x(n)))
49
57
  ]),
50
58
  key: "0"
51
59
  } : void 0
@@ -53,5 +61,5 @@ const g = /* @__PURE__ */ n({
53
61
  }
54
62
  });
55
63
  export {
56
- g as default
64
+ T as default
57
65
  };
@@ -0,0 +1,170 @@
1
+ import { defineComponent as M, ref as $, computed as c, watch as I, createElementBlock as y, openBlock as C, normalizeStyle as S, createElementVNode as O, createCommentVNode as H, renderSlot as m, withModifiers as B, unref as n, createVNode as z, mergeProps as E } from "vue";
2
+ import { REGIONS as V, COUNTRIES as _, DEFAULT_ZOOM as D } from "./regions.js";
3
+ import { USA_PINS as R, WORLD_PINS as L } from "./pins.js";
4
+ import { useMapPanZoom as U } from "./useMapPanZoom.js";
5
+ import j from "./core.js";
6
+ import A from "./MapZoomControls.js";
7
+ const T = {
8
+ key: 0,
9
+ class: "absolute top-0 right-0"
10
+ }, F = { class: "absolute bottom-4 right-4 flex flex-col gap-2" }, Y = /* @__PURE__ */ M({
11
+ __name: "DottedMap",
12
+ props: {
13
+ regionName: { default: "world" },
14
+ defaultZoom: {},
15
+ showControls: { type: Boolean, default: !0 },
16
+ showLegend: { type: Boolean, default: !0 },
17
+ maxHeight: {},
18
+ legend: {},
19
+ mapHeight: {},
20
+ mapWidth: {},
21
+ countries: {},
22
+ region: {},
23
+ grid: {},
24
+ avoidOuterPins: { type: Boolean },
25
+ pins: {},
26
+ precomputedMap: {},
27
+ color: {},
28
+ dotSize: {},
29
+ strokeColor: {},
30
+ strokeWidth: {},
31
+ strokeOpacity: {},
32
+ shape: {},
33
+ countryColors: {},
34
+ backgroundColor: {}
35
+ },
36
+ emits: ["pin-click", "point-click", "pin-add", "pin-remove"],
37
+ setup(p, { expose: P, emit: b }) {
38
+ const e = p, l = b, {
39
+ offset: g,
40
+ scale: N,
41
+ zoomIn: h,
42
+ zoomOut: f,
43
+ resetView: d,
44
+ wasClick: v,
45
+ onWheel: k,
46
+ onMouseDown: w
47
+ } = U(), u = $([]), Z = c(() => e.pins ? e.pins : u.value), t = c(() => {
48
+ const i = V[e.regionName || "world"], o = _[e.regionName || "world"], r = D[e.regionName || "world"] ?? 1, a = e.regionName === "usa" ? R : L, s = {
49
+ region: e.region ?? i,
50
+ countries: e.countries ?? o,
51
+ pins: e.pins ?? a,
52
+ defaultZoom: e.defaultZoom ?? r,
53
+ color: e.color,
54
+ countryColors: e.countryColors,
55
+ dotSize: e.dotSize,
56
+ grid: e.grid,
57
+ mapHeight: e.mapHeight,
58
+ mapWidth: e.mapWidth,
59
+ shape: e.shape,
60
+ strokeWidth: e.strokeWidth,
61
+ strokeOpacity: e.strokeOpacity
62
+ };
63
+ if (e.region || e.countries || e.mapHeight || e.mapWidth)
64
+ return s;
65
+ switch (e.regionName) {
66
+ case "europe":
67
+ return { ...s, dotSize: e.dotSize ?? 0.3 };
68
+ case "usa":
69
+ return { ...s, mapWidth: 130, dotSize: e.dotSize ?? 0.3 };
70
+ case "asia":
71
+ return { ...s, grid: e.grid ?? "vertical" };
72
+ case "oceania":
73
+ return { ...s, dotSize: e.dotSize ?? 0.3 };
74
+ default:
75
+ return { ...s, grid: e.grid ?? "vertical" };
76
+ }
77
+ });
78
+ c(() => e.legend);
79
+ const W = (i) => {
80
+ v() && l("pin-click", i);
81
+ }, x = (i, o) => {
82
+ if (v() && (l("point-click", i, o), !e.pins)) {
83
+ const r = u.value.findIndex(
84
+ (a) => Math.abs(a.lat - o.lat) < 1e-4 && Math.abs(a.lng - o.lng) < 1e-4
85
+ );
86
+ if (r > -1) {
87
+ const a = u.value.splice(r, 1)[0];
88
+ l("pin-remove", a, r);
89
+ } else {
90
+ const a = {
91
+ lat: o.lat,
92
+ lng: o.lng,
93
+ svgOptions: { color: "var(--ui-text)", radius: 0.15 },
94
+ data: { city: "Custom Pin", region: "Other" }
95
+ };
96
+ u.value.push(a), l("pin-add", a);
97
+ }
98
+ }
99
+ };
100
+ return I(
101
+ [() => e.regionName, () => e.defaultZoom],
102
+ () => {
103
+ d(t.value.defaultZoom);
104
+ },
105
+ { immediate: !0 }
106
+ ), P({
107
+ zoomIn: h,
108
+ zoomOut: f,
109
+ resetView: () => d(t.value.defaultZoom)
110
+ }), (i, o) => (C(), y("div", {
111
+ class: "w-full h-full overflow-hidden relative",
112
+ style: S({
113
+ width: "100%",
114
+ height: e.maxHeight
115
+ })
116
+ }, [
117
+ O("div", {
118
+ class: "w-full h-full flex items-center justify-center cursor-grab active:cursor-grabbing select-none touch-none",
119
+ style: S({
120
+ transform: `translate(${n(g).x}px, ${n(g).y}px) scale(${n(N)})`
121
+ }),
122
+ onMousedown: o[0] || (o[0] = //@ts-ignore
123
+ (...r) => n(w) && n(w)(...r)),
124
+ onWheel: o[1] || (o[1] = B(
125
+ //@ts-ignore
126
+ (...r) => n(k) && n(k)(...r),
127
+ ["prevent"]
128
+ ))
129
+ }, [
130
+ z(j, E(i.$attrs, {
131
+ width: "100%",
132
+ height: "100%",
133
+ "map-height": t.value.mapHeight || 60,
134
+ color: t.value.color || "var(--ui-text-dimmed)",
135
+ "dot-size": t.value.dotSize || 0.36,
136
+ grid: t.value.grid,
137
+ shape: t.value.shape,
138
+ countries: t.value.countries,
139
+ region: t.value.region,
140
+ pins: Z.value,
141
+ "stroke-width": t.value.strokeWidth,
142
+ "stroke-opacity": t.value.strokeOpacity,
143
+ "country-colors": t.value.countryColors,
144
+ "avoid-outer-pins": e.avoidOuterPins,
145
+ "precomputed-map": e.precomputedMap,
146
+ "background-color": e.backgroundColor,
147
+ class: "w-full h-full object-contain",
148
+ onPinClick: W,
149
+ onPointClick: x
150
+ }), null, 16, ["map-height", "color", "dot-size", "grid", "shape", "countries", "region", "pins", "stroke-width", "stroke-opacity", "country-colors", "avoid-outer-pins", "precomputed-map", "background-color"])
151
+ ], 36),
152
+ p.showControls ? (C(), y("div", T, [
153
+ m(i.$slots, "controls", {}, () => [
154
+ z(A, {
155
+ onZoomIn: n(h),
156
+ onZoomOut: n(f),
157
+ onReset: o[2] || (o[2] = (r) => n(d)(t.value.defaultZoom))
158
+ }, null, 8, ["onZoomIn", "onZoomOut"])
159
+ ])
160
+ ])) : H("", !0),
161
+ O("div", F, [
162
+ m(i.$slots, "legend")
163
+ ]),
164
+ m(i.$slots, "default")
165
+ ], 4));
166
+ }
167
+ });
168
+ export {
169
+ Y as default
170
+ };
@@ -0,0 +1,52 @@
1
+ import { MapPin, MapRegionName, MapLegendItem, DottedMapProps } from './types';
2
+ interface Props extends DottedMapProps {
3
+ /** The region name for quick setup */
4
+ regionName?: MapRegionName;
5
+ /** Default zoom level */
6
+ defaultZoom?: number;
7
+ /** Show zoom controls */
8
+ showControls?: boolean;
9
+ /** Show legend */
10
+ showLegend?: boolean;
11
+ /** Maximum height of the map container */
12
+ maxHeight?: string | number;
13
+ /** Custom legend items */
14
+ legend?: MapLegendItem[];
15
+ }
16
+ declare function __VLS_template(): {
17
+ attrs: Partial<{}>;
18
+ slots: {
19
+ controls?(_: {}): any;
20
+ legend?(_: {}): any;
21
+ default?(_: {}): any;
22
+ };
23
+ refs: {};
24
+ rootEl: HTMLDivElement;
25
+ };
26
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
27
+ declare const __VLS_component: import('vue').DefineComponent<Props, {
28
+ zoomIn: () => void;
29
+ zoomOut: () => void;
30
+ resetView: () => void;
31
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
32
+ "point-click": (event: MouseEvent, point: MapPin) => any;
33
+ "pin-click": (pin: MapPin) => any;
34
+ "pin-add": (pin: MapPin) => any;
35
+ "pin-remove": (pin: MapPin, index: number) => any;
36
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
37
+ "onPoint-click"?: ((event: MouseEvent, point: MapPin) => any) | undefined;
38
+ "onPin-click"?: ((pin: MapPin) => any) | undefined;
39
+ "onPin-add"?: ((pin: MapPin) => any) | undefined;
40
+ "onPin-remove"?: ((pin: MapPin, index: number) => any) | undefined;
41
+ }>, {
42
+ regionName: MapRegionName;
43
+ showControls: boolean;
44
+ showLegend: boolean;
45
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
46
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
47
+ export default _default;
48
+ type __VLS_WithTemplateSlots<T, S> = T & {
49
+ new (): {
50
+ $slots: S;
51
+ };
52
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./DottedMap.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,6 @@
1
+ import { MapLegendItem } from './types';
2
+ type __VLS_Props = {
3
+ items: MapLegendItem[];
4
+ };
5
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
6
+ export default _default;
@@ -0,0 +1,44 @@
1
+ import { defineComponent as a, resolveComponent as m, createElementBlock as c, openBlock as s, createVNode as i, createBlock as u, createCommentVNode as p } from "vue";
2
+ const d = { class: "flex gap-2" }, k = /* @__PURE__ */ a({
3
+ __name: "MapZoomControls",
4
+ props: {
5
+ showReset: { type: Boolean }
6
+ },
7
+ emits: ["zoomIn", "zoomOut", "reset"],
8
+ setup(r, { emit: l }) {
9
+ const o = l;
10
+ return (v, e) => {
11
+ const t = m("UButton");
12
+ return s(), c("div", d, [
13
+ i(t, {
14
+ icon: "i-lucide-plus",
15
+ color: "neutral",
16
+ variant: "ghost",
17
+ size: "sm",
18
+ "aria-label": "Zoom in",
19
+ onClick: e[0] || (e[0] = (n) => o("zoomIn"))
20
+ }),
21
+ i(t, {
22
+ icon: "i-lucide-minus",
23
+ color: "neutral",
24
+ variant: "ghost",
25
+ size: "sm",
26
+ "aria-label": "Zoom out",
27
+ onClick: e[1] || (e[1] = (n) => o("zoomOut"))
28
+ }),
29
+ r.showReset !== !1 ? (s(), u(t, {
30
+ key: 0,
31
+ icon: "i-lucide-refresh-cw",
32
+ color: "neutral",
33
+ variant: "ghost",
34
+ size: "sm",
35
+ "aria-label": "Reset view",
36
+ onClick: e[2] || (e[2] = (n) => o("reset"))
37
+ })) : p("", !0)
38
+ ]);
39
+ };
40
+ }
41
+ });
42
+ export {
43
+ k as default
44
+ };
@@ -0,0 +1,13 @@
1
+ type __VLS_Props = {
2
+ showReset?: boolean;
3
+ };
4
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
5
+ reset: () => any;
6
+ zoomIn: () => any;
7
+ zoomOut: () => any;
8
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onReset?: (() => any) | undefined;
10
+ onZoomIn?: (() => any) | undefined;
11
+ onZoomOut?: (() => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
13
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import f from "./MapZoomControls.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,122 @@
1
+ import { defineComponent as Y, computed as u, createElementBlock as q, openBlock as F, normalizeStyle as L, renderSlot as T, createElementVNode as J } from "vue";
2
+ import { getMap as R, getPin as V } from "./mapUtils.js";
3
+ import D from "../../../data/countries.geo.json.js";
4
+ const G = ["innerHTML"], Z = /* @__PURE__ */ Y({
5
+ __name: "core",
6
+ props: {
7
+ mapHeight: {},
8
+ mapWidth: {},
9
+ countries: {},
10
+ region: {},
11
+ grid: { default: "vertical" },
12
+ avoidOuterPins: { type: Boolean, default: !1 },
13
+ pins: {},
14
+ precomputedMap: {},
15
+ color: { default: "#ffffff" },
16
+ dotSize: { default: 0.5 },
17
+ strokeColor: {},
18
+ strokeWidth: { default: 0 },
19
+ strokeOpacity: { default: 1 },
20
+ shape: { default: "circle" },
21
+ countryColors: {},
22
+ backgroundColor: {}
23
+ },
24
+ emits: ["pin-click", "point-click"],
25
+ setup(p, { emit: $ }) {
26
+ const o = p, O = $, c = u(() => {
27
+ let n;
28
+ return o.precomputedMap ? n = typeof o.precomputedMap == "string" ? JSON.parse(o.precomputedMap) : o.precomputedMap : n = R({
29
+ height: o.mapHeight,
30
+ width: o.mapWidth,
31
+ countries: o.countries,
32
+ region: o.region,
33
+ grid: o.grid,
34
+ geojsonWorld: D
35
+ }), o.pins && o.pins.length > 0 && o.pins.forEach((e) => {
36
+ if (typeof e.lat == "number" && isFinite(e.lat) && typeof e.lng == "number" && isFinite(e.lng)) {
37
+ const r = V(n, { lat: e.lat, lng: e.lng }), l = [r.x, r.y].join(";");
38
+ n.points[l] = {
39
+ ...r,
40
+ data: e.data,
41
+ svgOptions: {
42
+ radius: o.dotSize,
43
+ strokeColor: o.strokeColor,
44
+ strokeWidth: o.strokeWidth,
45
+ strokeOpacity: o.strokeOpacity,
46
+ ...e.svgOptions
47
+ }
48
+ };
49
+ }
50
+ }), n;
51
+ }), g = u(() => {
52
+ const n = c.value, e = Object.values(n.points);
53
+ if (e.length === 0) return [];
54
+ const r = Math.max(...e.map((i) => i.y)), l = Math.min(...e.map((i) => i.y));
55
+ return e.map((i) => ({
56
+ ...i,
57
+ // Flip Y axis to match geographical orientation in XY container
58
+ y: r + l - i.y
59
+ }));
60
+ }), m = u(() => {
61
+ const n = c.value, { width: e, height: r, points: l } = n, { shape: i, backgroundColor: M, color: w, dotSize: S, strokeColor: W, strokeWidth: j, strokeOpacity: P } = o, _ = (t) => {
62
+ var f, k, v, x, C;
63
+ const s = ((f = t.svgOptions) == null ? void 0 : f.radius) || S, I = t.countryId && o.countryColors ? o.countryColors[t.countryId] : null, d = ((k = t.svgOptions) == null ? void 0 : k.color) || I || w, A = ((v = t.svgOptions) == null ? void 0 : v.strokeColor) || W || d, y = ((x = t.svgOptions) == null ? void 0 : x.strokeWidth) ?? j, E = ((C = t.svgOptions) == null ? void 0 : C.strokeOpacity) ?? P, h = y > 0 ? `stroke="${A}" stroke-width="${y}" stroke-opacity="${E}"` : "";
64
+ if (i === "circle")
65
+ return `<circle cx="${t.x}" cy="${t.y}" r="${s}" fill="${d}" ${h} />`;
66
+ if (i === "hexagon") {
67
+ const a = Math.sqrt(3) * s;
68
+ return `<polyline points="${[
69
+ [t.x + a, t.y - s],
70
+ [t.x + a, t.y + s],
71
+ [t.x, t.y + 2 * s],
72
+ [t.x - a, t.y + s],
73
+ [t.x - a, t.y - s],
74
+ [t.x, t.y - 2 * s]
75
+ ].map((N) => N.join(",")).join(" ")}" fill="${d}" ${h} />`;
76
+ }
77
+ return "";
78
+ }, z = Object.values(l).map(_).join(`
79
+ `), B = `<svg
80
+ viewBox="0 0 ${e} ${r}"
81
+ xmlns="http://www.w3.org/2000/svg"
82
+ preserveAspectRatio="xMidYMid meet"
83
+ style="background-color: ${M}; width: 100%; height: 100%; display: block;"
84
+ >
85
+ ${z}
86
+ </svg>`;
87
+ let H = 0;
88
+ return B.replace(/<(circle|polyline)/g, (t, s) => `<${s} data-index="${H++}" style="cursor: pointer;"`);
89
+ });
90
+ function b(n) {
91
+ const r = n.target.getAttribute("data-index");
92
+ if (r !== null) {
93
+ const l = g.value[Number(r)];
94
+ O("point-click", n, l);
95
+ }
96
+ }
97
+ return (n, e) => (F(), q("div", {
98
+ class: "dotted-world-map-container",
99
+ style: L({
100
+ backgroundColor: p.backgroundColor,
101
+ width: "100%",
102
+ height: "100%",
103
+ position: "relative"
104
+ })
105
+ }, [
106
+ T(n.$slots, "default", {
107
+ points: g.value,
108
+ map: c.value,
109
+ svg: m.value
110
+ }, () => [
111
+ J("div", {
112
+ innerHTML: m.value,
113
+ style: { width: "100%", height: "100%", display: "block" },
114
+ onClick: b
115
+ }, null, 8, G)
116
+ ])
117
+ ], 4));
118
+ }
119
+ });
120
+ export {
121
+ Z as default
122
+ };
@@ -0,0 +1,36 @@
1
+ import { DottedMapProps } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {
6
+ points: any[];
7
+ map: any;
8
+ svg: string;
9
+ }): any;
10
+ };
11
+ refs: {};
12
+ rootEl: HTMLDivElement;
13
+ };
14
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
+ declare const __VLS_component: import('vue').DefineComponent<DottedMapProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
16
+ "point-click": (event: MouseEvent, point: any) => any;
17
+ "pin-click": (point: any) => any;
18
+ }, string, import('vue').PublicProps, Readonly<DottedMapProps> & Readonly<{
19
+ "onPoint-click"?: ((event: MouseEvent, point: any) => any) | undefined;
20
+ "onPin-click"?: ((point: any) => any) | undefined;
21
+ }>, {
22
+ grid: "vertical" | "diagonal";
23
+ color: string;
24
+ avoidOuterPins: boolean;
25
+ dotSize: number;
26
+ strokeWidth: number;
27
+ strokeOpacity: number;
28
+ shape: "circle" | "hexagon";
29
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
30
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
31
+ export default _default;
32
+ type __VLS_WithTemplateSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./core.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,49 @@
1
+ import { MapRegion } from './types';
2
+ export declare const DEFAULT_WORLD_REGION: MapRegion;
3
+ export declare const geojsonToMultiPolygons: (geojson: any) => {
4
+ type: string;
5
+ geometry: {
6
+ type: string;
7
+ coordinates: any;
8
+ };
9
+ };
10
+ export declare const computeGeojsonBox: (geojson: any) => MapRegion;
11
+ export interface MapData {
12
+ points: Record<string, {
13
+ x: number;
14
+ y: number;
15
+ lat: number;
16
+ lng: number;
17
+ countryId?: string;
18
+ data?: any;
19
+ svgOptions?: any;
20
+ }>;
21
+ X_MIN: number;
22
+ Y_MIN: number;
23
+ X_MAX: number;
24
+ Y_MAX: number;
25
+ X_RANGE: number;
26
+ Y_RANGE: number;
27
+ region: MapRegion;
28
+ grid: 'vertical' | 'diagonal';
29
+ height: number;
30
+ width: number;
31
+ ystep: number;
32
+ }
33
+ export declare const getMap: ({ height, width, countries, region, grid, geojsonWorld, }: {
34
+ height?: number;
35
+ width?: number;
36
+ countries?: string[];
37
+ region?: MapRegion;
38
+ grid?: "vertical" | "diagonal";
39
+ geojsonWorld: any;
40
+ }) => MapData;
41
+ export declare const getPin: (map: MapData, { lat, lng }: {
42
+ lat: number;
43
+ lng: number;
44
+ }) => {
45
+ x: number;
46
+ y: number;
47
+ lat: any;
48
+ lng: any;
49
+ };