@hpcc-js/map 2.79.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/dist/index.js +888 -31380
  2. package/dist/index.js.map +7 -1
  3. package/package.json +41 -40
  4. package/src/CanvasPinLayer.ts +2 -2
  5. package/src/CanvasPins.ts +12 -11
  6. package/src/Choropleth.ts +13 -5
  7. package/src/ChoroplethContinents.ts +1 -1
  8. package/src/ChoroplethCounties.ts +9 -7
  9. package/src/ChoroplethCountries.ts +2 -2
  10. package/src/ChoroplethStates.ts +1 -2
  11. package/src/ChoroplethStatesHeat.ts +1 -1
  12. package/src/GMap.ts +4 -3
  13. package/src/GMapCounties.ts +2 -2
  14. package/src/GMapGraph.ts +1 -1
  15. package/src/GMapHeat.ts +1 -1
  16. package/src/GMapLayered.ts +2 -2
  17. package/src/GMapPin.ts +2 -2
  18. package/src/GMapPinLine.ts +38 -25
  19. package/src/GeoHash.ts +31 -17
  20. package/src/Graph.ts +1 -1
  21. package/src/Graticule.ts +14 -7
  22. package/src/Heat.ts +13 -8
  23. package/src/Layer.ts +28 -19
  24. package/src/Layered.ts +1 -1
  25. package/src/Lines.ts +6 -3
  26. package/src/OpenStreet.ts +7 -4
  27. package/src/Pins.ts +75 -44
  28. package/src/Projection.ts +1 -1
  29. package/src/TestHeatMap.ts +1 -1
  30. package/src/TopoJSONChoropleth.ts +106 -95
  31. package/src/__package__.ts +2 -2
  32. package/src/index.ts +29 -30
  33. package/src/leaflet/AlbersPR.ts +3 -3
  34. package/src/leaflet/Blank.ts +1 -1
  35. package/src/leaflet/Circles.ts +2 -2
  36. package/src/leaflet/ClusterCircles.ts +2 -2
  37. package/src/leaflet/Countries.ts +2 -2
  38. package/src/leaflet/DrawLayer.ts +2 -2
  39. package/src/leaflet/FeatureLayer.ts +3 -3
  40. package/src/leaflet/GMap.ts +3 -3
  41. package/src/leaflet/HeatLayer.ts +2 -2
  42. package/src/leaflet/Icons.ts +2 -2
  43. package/src/leaflet/Leaflet.ts +10 -9
  44. package/src/leaflet/MapBox.ts +2 -2
  45. package/src/leaflet/Markers.ts +2 -2
  46. package/src/leaflet/OpenStreet.ts +2 -2
  47. package/src/leaflet/Path.ts +3 -3
  48. package/src/leaflet/Pins.ts +2 -2
  49. package/src/leaflet/Polygons.ts +2 -2
  50. package/src/leaflet/Region.ts +2 -2
  51. package/src/leaflet/Text.ts +2 -2
  52. package/src/leaflet/TileLayer.ts +1 -1
  53. package/src/leaflet/TopoJSON.ts +3 -3
  54. package/src/leaflet/US.ts +2 -2
  55. package/src/leaflet/USCounties.ts +2 -2
  56. package/src/leaflet/USStates.ts +2 -2
  57. package/src/leaflet/World.ts +8 -7
  58. package/src/leaflet/index.ts +18 -18
  59. package/src/leaflet/leaflet-shim.ts +19 -0
  60. package/src/leaflet/plugins/BeautifyIcon.css +44 -0
  61. package/src/leaflet/plugins/BeautifyIcon.ts +190 -0
  62. package/src/leaflet/plugins/BeutifyIcon.licence +21 -0
  63. package/src/leaflet/plugins/D3SvgOverlay.css +3 -0
  64. package/src/leaflet/plugins/D3SvgOverlay.licence +21 -0
  65. package/src/leaflet/plugins/D3SvgOverlay.ts +175 -0
  66. package/src/leaflet/plugins/HeatLayer.license +22 -0
  67. package/src/leaflet/plugins/HeatLayer.ts +224 -0
  68. package/src/leaflet/plugins/Leaflet.GoogleMutant.ts +425 -0
  69. package/src/leaflet/plugins/lru_map.ts +352 -0
  70. package/types/CanvasPinLayer.d.ts +1 -2
  71. package/types/CanvasPins.d.ts +10 -12
  72. package/types/Choropleth.d.ts +6 -6
  73. package/types/ChoroplethContinents.d.ts +1 -2
  74. package/types/ChoroplethCounties.d.ts +6 -8
  75. package/types/ChoroplethCountries.d.ts +1 -3
  76. package/types/ChoroplethStates.d.ts +1 -3
  77. package/types/ChoroplethStatesHeat.d.ts +1 -2
  78. package/types/GMap.d.ts +3 -4
  79. package/types/GMapCounties.d.ts +2 -3
  80. package/types/GMapGraph.d.ts +1 -2
  81. package/types/GMapHeat.d.ts +1 -2
  82. package/types/GMapLayered.d.ts +1 -2
  83. package/types/GMapPin.d.ts +1 -2
  84. package/types/GMapPinLine.d.ts +35 -56
  85. package/types/GeoHash.d.ts +23 -34
  86. package/types/Graph.d.ts +1 -2
  87. package/types/Graticule.d.ts +12 -17
  88. package/types/Heat.d.ts +12 -17
  89. package/types/IChoropleth.d.ts +0 -1
  90. package/types/Layer.d.ts +26 -40
  91. package/types/Layered.d.ts +0 -1
  92. package/types/Lines.d.ts +5 -6
  93. package/types/OpenStreet.d.ts +6 -7
  94. package/types/Pins.d.ts +64 -103
  95. package/types/Projection.d.ts +0 -1
  96. package/types/TopoJSONChoropleth.d.ts +15 -4
  97. package/types/Utility.d.ts +0 -1
  98. package/types/__package__.d.ts +2 -3
  99. package/types/index.d.ts +29 -31
  100. package/types/leaflet/AlbersPR.d.ts +2 -3
  101. package/types/leaflet/Blank.d.ts +1 -2
  102. package/types/leaflet/Circles.d.ts +2 -3
  103. package/types/leaflet/ClusterCircles.d.ts +2 -3
  104. package/types/leaflet/Countries.d.ts +1 -2
  105. package/types/leaflet/DrawLayer.d.ts +2 -3
  106. package/types/leaflet/FeatureLayer.d.ts +3 -4
  107. package/types/leaflet/GMap.d.ts +2 -3
  108. package/types/leaflet/HeatLayer.d.ts +2 -3
  109. package/types/leaflet/Icons.d.ts +2 -3
  110. package/types/leaflet/Leaflet.d.ts +9 -9
  111. package/types/leaflet/MapBox.d.ts +2 -3
  112. package/types/leaflet/Markers.d.ts +2 -3
  113. package/types/leaflet/OpenStreet.d.ts +2 -3
  114. package/types/leaflet/Path.d.ts +2 -3
  115. package/types/leaflet/Pins.d.ts +2 -3
  116. package/types/leaflet/Polygons.d.ts +2 -3
  117. package/types/leaflet/Region.d.ts +1 -2
  118. package/types/leaflet/Text.d.ts +2 -3
  119. package/types/leaflet/TileLayer.d.ts +1 -2
  120. package/types/leaflet/TopoJSON.d.ts +2 -3
  121. package/types/leaflet/US.d.ts +2 -3
  122. package/types/leaflet/USCounties.d.ts +1 -2
  123. package/types/leaflet/USStates.d.ts +1 -2
  124. package/types/leaflet/World.d.ts +5 -8
  125. package/types/leaflet/index.d.ts +18 -19
  126. package/types/leaflet/leaflet-shim.d.ts +14 -0
  127. package/types/leaflet/plugins/BeautifyIcon.d.ts +2 -0
  128. package/types/leaflet/plugins/D3SvgOverlay.d.ts +36 -0
  129. package/types/leaflet/plugins/HeatLayer.d.ts +23 -0
  130. package/types/leaflet/plugins/Leaflet.GoogleMutant.d.ts +1 -0
  131. package/types/leaflet/plugins/lru_map.d.ts +33 -0
  132. package/TopoJSON/AT.json +0 -1
  133. package/TopoJSON/BE.json +0 -1
  134. package/TopoJSON/BG.json +0 -1
  135. package/TopoJSON/BR.json +0 -123
  136. package/TopoJSON/CHLI.json +0 -1
  137. package/TopoJSON/CY.json +0 -1
  138. package/TopoJSON/CZ.json +0 -1
  139. package/TopoJSON/DE.json +0 -1
  140. package/TopoJSON/DK.json +0 -1
  141. package/TopoJSON/EE.json +0 -1
  142. package/TopoJSON/ES.json +0 -1
  143. package/TopoJSON/FI.json +0 -1
  144. package/TopoJSON/FR.json +0 -1
  145. package/TopoJSON/GB.json +0 -1
  146. package/TopoJSON/GB_idx.json +0 -1
  147. package/TopoJSON/GE.json +0 -1
  148. package/TopoJSON/GR.json +0 -1
  149. package/TopoJSON/HR.json +0 -1
  150. package/TopoJSON/HU.json +0 -1
  151. package/TopoJSON/IE.json +0 -1
  152. package/TopoJSON/IE_idx.json +0 -1
  153. package/TopoJSON/IS.json +0 -1
  154. package/TopoJSON/IT.json +0 -1
  155. package/TopoJSON/KS.json +0 -1
  156. package/TopoJSON/LT.json +0 -1
  157. package/TopoJSON/LU.json +0 -1
  158. package/TopoJSON/LV.json +0 -1
  159. package/TopoJSON/MD.json +0 -1
  160. package/TopoJSON/MK.json +0 -1
  161. package/TopoJSON/MT.json +0 -1
  162. package/TopoJSON/ND.json +0 -1
  163. package/TopoJSON/ND_idx.json +0 -1
  164. package/TopoJSON/NL.json +0 -1
  165. package/TopoJSON/NO.json +0 -1
  166. package/TopoJSON/PL.json +0 -1
  167. package/TopoJSON/PT.json +0 -1
  168. package/TopoJSON/RO.json +0 -1
  169. package/TopoJSON/RS.json +0 -1
  170. package/TopoJSON/SE.json +0 -1
  171. package/TopoJSON/SI.json +0 -1
  172. package/TopoJSON/SK.json +0 -1
  173. package/TopoJSON/UA.json +0 -1
  174. package/TopoJSON/countries.json +0 -257
  175. package/TopoJSON/us-counties.json +0 -16550
  176. package/TopoJSON/us-states.json +0 -458
  177. package/dist/index.es6.js +0 -31436
  178. package/dist/index.es6.js.map +0 -1
  179. package/dist/index.min.js +0 -7
  180. package/dist/index.min.js.map +0 -1
  181. package/types/CanvasPinLayer.d.ts.map +0 -1
  182. package/types/CanvasPins.d.ts.map +0 -1
  183. package/types/Choropleth.d.ts.map +0 -1
  184. package/types/ChoroplethContinents.d.ts.map +0 -1
  185. package/types/ChoroplethCounties.d.ts.map +0 -1
  186. package/types/ChoroplethCountries.d.ts.map +0 -1
  187. package/types/ChoroplethStates.d.ts.map +0 -1
  188. package/types/ChoroplethStatesHeat.d.ts.map +0 -1
  189. package/types/GMap.d.ts.map +0 -1
  190. package/types/GMapCounties.d.ts.map +0 -1
  191. package/types/GMapGraph.d.ts.map +0 -1
  192. package/types/GMapHeat.d.ts.map +0 -1
  193. package/types/GMapLayered.d.ts.map +0 -1
  194. package/types/GMapPin.d.ts.map +0 -1
  195. package/types/GMapPinLine.d.ts.map +0 -1
  196. package/types/GeoHash.d.ts.map +0 -1
  197. package/types/Graph.d.ts.map +0 -1
  198. package/types/Graticule.d.ts.map +0 -1
  199. package/types/Heat.d.ts.map +0 -1
  200. package/types/IChoropleth.d.ts.map +0 -1
  201. package/types/Layer.d.ts.map +0 -1
  202. package/types/Layered.d.ts.map +0 -1
  203. package/types/Lines.d.ts.map +0 -1
  204. package/types/OpenStreet.d.ts.map +0 -1
  205. package/types/Pins.d.ts.map +0 -1
  206. package/types/Projection.d.ts.map +0 -1
  207. package/types/TestHeatMap.d.ts +0 -5
  208. package/types/TestHeatMap.d.ts.map +0 -1
  209. package/types/TopoJSONChoropleth.d.ts.map +0 -1
  210. package/types/Utility.d.ts.map +0 -1
  211. package/types/__package__.d.ts.map +0 -1
  212. package/types/index.d.ts.map +0 -1
  213. package/types/leaflet/AlbersPR.d.ts.map +0 -1
  214. package/types/leaflet/Blank.d.ts.map +0 -1
  215. package/types/leaflet/Circles.d.ts.map +0 -1
  216. package/types/leaflet/ClusterCircles.d.ts.map +0 -1
  217. package/types/leaflet/Countries.d.ts.map +0 -1
  218. package/types/leaflet/DrawLayer.d.ts.map +0 -1
  219. package/types/leaflet/FeatureLayer.d.ts.map +0 -1
  220. package/types/leaflet/GMap.d.ts.map +0 -1
  221. package/types/leaflet/HeatLayer.d.ts.map +0 -1
  222. package/types/leaflet/Icons.d.ts.map +0 -1
  223. package/types/leaflet/Leaflet.d.ts.map +0 -1
  224. package/types/leaflet/MapBox.d.ts.map +0 -1
  225. package/types/leaflet/Markers.d.ts.map +0 -1
  226. package/types/leaflet/OpenStreet.d.ts.map +0 -1
  227. package/types/leaflet/Path.d.ts.map +0 -1
  228. package/types/leaflet/Pins.d.ts.map +0 -1
  229. package/types/leaflet/Polygons.d.ts.map +0 -1
  230. package/types/leaflet/Region.d.ts.map +0 -1
  231. package/types/leaflet/Text.d.ts.map +0 -1
  232. package/types/leaflet/TileLayer.d.ts.map +0 -1
  233. package/types/leaflet/TopoJSON.d.ts.map +0 -1
  234. package/types/leaflet/US.d.ts.map +0 -1
  235. package/types/leaflet/USCounties.d.ts.map +0 -1
  236. package/types/leaflet/USStates.d.ts.map +0 -1
  237. package/types/leaflet/World.d.ts.map +0 -1
  238. package/types/leaflet/index.d.ts.map +0 -1
  239. package/types/test.d.ts +0 -24
  240. package/types/test.d.ts.map +0 -1
  241. package/types-3.4/CanvasPinLayer.d.ts +0 -23
  242. package/types-3.4/CanvasPins.d.ts +0 -72
  243. package/types-3.4/Choropleth.d.ts +0 -59
  244. package/types-3.4/ChoroplethContinents.d.ts +0 -6
  245. package/types-3.4/ChoroplethCounties.d.ts +0 -17
  246. package/types-3.4/ChoroplethCountries.d.ts +0 -12
  247. package/types-3.4/ChoroplethStates.d.ts +0 -12
  248. package/types-3.4/ChoroplethStatesHeat.d.ts +0 -5
  249. package/types-3.4/GMap.d.ts +0 -137
  250. package/types-3.4/GMapCounties.d.ts +0 -23
  251. package/types-3.4/GMapGraph.d.ts +0 -6
  252. package/types-3.4/GMapHeat.d.ts +0 -6
  253. package/types-3.4/GMapLayered.d.ts +0 -20
  254. package/types-3.4/GMapPin.d.ts +0 -33
  255. package/types-3.4/GMapPinLine.d.ts +0 -72
  256. package/types-3.4/GeoHash.d.ts +0 -48
  257. package/types-3.4/Graph.d.ts +0 -14
  258. package/types-3.4/Graticule.d.ts +0 -30
  259. package/types-3.4/Heat.d.ts +0 -28
  260. package/types-3.4/IChoropleth.d.ts +0 -2
  261. package/types-3.4/Layer.d.ts +0 -58
  262. package/types-3.4/Layered.d.ts +0 -47
  263. package/types-3.4/Lines.d.ts +0 -17
  264. package/types-3.4/OpenStreet.d.ts +0 -22
  265. package/types-3.4/Pins.d.ts +0 -122
  266. package/types-3.4/Projection.d.ts +0 -6
  267. package/types-3.4/TestHeatMap.d.ts +0 -5
  268. package/types-3.4/TopoJSONChoropleth.d.ts +0 -5
  269. package/types-3.4/Utility.d.ts +0 -80
  270. package/types-3.4/__package__.d.ts +0 -4
  271. package/types-3.4/index.d.ts +0 -32
  272. package/types-3.4/leaflet/AlbersPR.d.ts +0 -16
  273. package/types-3.4/leaflet/Blank.d.ts +0 -5
  274. package/types-3.4/leaflet/Circles.d.ts +0 -56
  275. package/types-3.4/leaflet/ClusterCircles.d.ts +0 -30
  276. package/types-3.4/leaflet/Countries.d.ts +0 -7
  277. package/types-3.4/leaflet/DrawLayer.d.ts +0 -40
  278. package/types-3.4/leaflet/FeatureLayer.d.ts +0 -40
  279. package/types-3.4/leaflet/GMap.d.ts +0 -14
  280. package/types-3.4/leaflet/HeatLayer.d.ts +0 -32
  281. package/types-3.4/leaflet/Icons.d.ts +0 -26
  282. package/types-3.4/leaflet/Leaflet.d.ts +0 -53
  283. package/types-3.4/leaflet/MapBox.d.ts +0 -9
  284. package/types-3.4/leaflet/Markers.d.ts +0 -38
  285. package/types-3.4/leaflet/OpenStreet.d.ts +0 -9
  286. package/types-3.4/leaflet/Path.d.ts +0 -43
  287. package/types-3.4/leaflet/Pins.d.ts +0 -32
  288. package/types-3.4/leaflet/Polygons.d.ts +0 -36
  289. package/types-3.4/leaflet/Region.d.ts +0 -15
  290. package/types-3.4/leaflet/Text.d.ts +0 -41
  291. package/types-3.4/leaflet/TileLayer.d.ts +0 -33
  292. package/types-3.4/leaflet/TopoJSON.d.ts +0 -14
  293. package/types-3.4/leaflet/US.d.ts +0 -7
  294. package/types-3.4/leaflet/USCounties.d.ts +0 -6
  295. package/types-3.4/leaflet/USStates.d.ts +0 -6
  296. package/types-3.4/leaflet/World.d.ts +0 -59
  297. package/types-3.4/leaflet/index.d.ts +0 -19
  298. package/types-3.4/test.d.ts +0 -24
package/src/Layer.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ITooltip } from "@hpcc-js/api";
2
- import { Layered } from "./Layered";
2
+ import { Layered } from "./Layered.ts";
3
3
 
4
4
  export class Layer extends Layered {
5
5
  _svgElement;
@@ -65,26 +65,35 @@ export class Layer extends Layered {
65
65
 
66
66
  layerZoomed(base) {
67
67
  }
68
+ }
69
+ Layer.prototype._class += " map_Layer";
70
+ Layer.prototype.implements(ITooltip.prototype);
68
71
 
72
+ export interface Layer {
69
73
  // ITooltip ---
70
74
  tooltip: any;
71
75
 
72
- tooltipHTML: (_: any) => any;
73
- tooltipFormat: (opts: any) => string;
74
- tooltipStyle: { (): string; (_: string): ITooltip };
75
- tooltipStyle_exists: () => boolean;
76
- tooltipValueFormat: { (): string; (_: string): ITooltip };
77
- tooltipValueFormat_exists: () => boolean;
78
- tooltipSeriesColor: { (): string; (_: string): ITooltip };
79
- tooltipSeriesColor_exists: () => boolean;
80
- tooltipLabelColor: { (): string; (_: string): ITooltip };
81
- tooltipLabelColor_exists: () => boolean;
82
- tooltipValueColor: { (): string; (_: string): ITooltip };
83
- tooltipValueColor_exists: () => boolean;
84
- tooltipTick: { (): boolean; (_: boolean): ITooltip };
85
- tooltipTick_exists: () => boolean;
86
- tooltipOffset: { (): number; (_: number): ITooltip };
87
- tooltipOffset_exists: () => boolean;
76
+ tooltipHTML(_: any): any;
77
+ tooltipFormat(opts: any): string;
78
+ tooltipStyle(): string;
79
+ tooltipStyle(_: string): Layer;
80
+ tooltipStyle_exists(): boolean;
81
+ tooltipValueFormat(): string;
82
+ tooltipValueFormat(_: string): Layer;
83
+ tooltipValueFormat_exists(): boolean;
84
+ tooltipSeriesColor(): string;
85
+ tooltipSeriesColor(_: string): Layer;
86
+ tooltipSeriesColor_exists(): boolean;
87
+ tooltipLabelColor(): string;
88
+ tooltipLabelColor(_: string): Layer;
89
+ tooltipLabelColor_exists(): boolean;
90
+ tooltipValueColor(): string;
91
+ tooltipValueColor(_: string): Layer;
92
+ tooltipValueColor_exists(): boolean;
93
+ tooltipTick(): boolean;
94
+ tooltipTick(_: boolean): Layer;
95
+ tooltipTick_exists(): boolean;
96
+ tooltipOffset(): number;
97
+ tooltipOffset(_: number): Layer;
98
+ tooltipOffset_exists(): boolean;
88
99
  }
89
- Layer.prototype._class += " map_Layer";
90
- Layer.prototype.implements(ITooltip.prototype);
package/src/Layered.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { SVGZoomWidget } from "@hpcc-js/common";
2
2
  import { geoPath as d3GeoPath } from "d3-geo";
3
3
  import { select as d3Select } from "d3-selection";
4
- import { resolve, types as projectionTypes } from "./Projection";
4
+ import { resolve, types as projectionTypes } from "./Projection.ts";
5
5
  import "./Utility"; // For albersUsaPr
6
6
 
7
7
  import "../src/Layered.css";
package/src/Lines.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Layer } from "./Layer";
1
+ import { Layer } from "./Layer.ts";
2
2
 
3
3
  import "../src/Lines.css";
4
4
 
@@ -67,9 +67,12 @@ export class Lines extends Layer {
67
67
  .attr("stroke-width", `${0.5 / base.zoomScale()}px`)
68
68
  ;
69
69
  }
70
-
71
- opacity: { (): number; (_: number): Lines };
72
70
  }
73
71
  Lines.prototype._class += " map_Lines";
74
72
 
73
+ export interface Lines {
74
+ opacity(): number;
75
+ opacity(_: number): this;
76
+ }
77
+
75
78
  Lines.prototype.publish("opacity", 1.0, "number", "Opacity", null, { tags: ["Advanced"] });
package/src/OpenStreet.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { select as d3Select } from "d3-selection";
2
2
  import { tile as d3Tile } from "d3-tile";
3
- import { Layer } from "./Layer";
3
+ import { Layer } from "./Layer.ts";
4
4
 
5
5
  // import * as Utility from "./Utility";
6
6
 
@@ -109,12 +109,15 @@ export class OpenStreet extends Layer {
109
109
  .style("opacity", 1)
110
110
  ;
111
111
  }
112
-
113
- tileProvider: { (): string; (_: string): OpenStreet };
114
- tileProvider_exists: () => boolean;
115
112
  }
116
113
  OpenStreet.prototype._class += " map_OpenStreet";
117
114
 
115
+ export interface OpenStreet {
116
+ tileProvider(): string;
117
+ tileProvider(_: string): this;
118
+ tileProvider_exists(): boolean;
119
+ }
120
+
118
121
  OpenStreet.prototype.publish("tileProvider", "OpenStreetMap", "set", "Tile Provider", ["OpenStreetMap", "OpenStreetMap Hot", "MapQuest", "MapQuest Sat", "Stamen Watercolor", "OpenCycleMap"], { tags: ["Basic", "Shared"] });
119
122
 
120
123
  function stringify(scale, translate) {
package/src/Pins.ts CHANGED
@@ -1,14 +1,13 @@
1
1
  import { Platform, Utility } from "@hpcc-js/common";
2
2
  import { select as d3Select } from "d3-selection";
3
- import { Layer } from "./Layer";
4
- import * as MapUtility from "./Utility";
3
+ import { Layer } from "./Layer.ts";
4
+ import * as MapUtility from "./Utility.ts";
5
5
 
6
6
  import "../src/Pins.css";
7
7
 
8
8
  export class Pins extends Layer {
9
9
  _geohash;
10
10
  _pinsTransform;
11
- _selection;
12
11
  pinsPaths;
13
12
 
14
13
  constructor() {
@@ -246,51 +245,83 @@ export class Pins extends Layer {
246
245
 
247
246
  dblclick(row, column, selected) {
248
247
  }
249
-
250
- latColumn: { (): string; (_: string): Pins };
251
- latColumn_exists: () => boolean;
252
- longColumn: { (): string; (_: string): Pins };
253
- longColumn_exists: () => boolean;
254
- geohashColumn: { (): string; (_: string): Pins };
255
- geohashColumn_exists: () => boolean;
256
- tooltipColumn: { (): string; (_: string): Pins };
257
- tooltipColumn_exists: () => boolean;
258
- opacity: { (): number; (_: number): Pins };
259
- opacity_exists: () => boolean;
260
- fillColor: { (): string; (_: string): Pins };
261
- fillColor_exists: () => boolean;
262
- omitNullLatLong: { (): boolean; (_: boolean): Pins };
263
- omitNullLatLong_exists: () => boolean;
264
- strokeWidth: { (): number; (_: number): Pins };
265
- strokeWidth_exists: () => boolean;
266
- strokeColor: { (): string; (_: string): Pins };
267
- strokeColor_exists: () => boolean;
268
- fontSize: { (): number; (_: number): Pins };
269
- fontSize_exists: () => boolean;
270
- fontFamily: { (): string; (_: string): Pins };
271
- fontFamily_exists: () => boolean;
272
- fontColor: { (): string; (_: string): Pins };
273
- fontColor_exists: () => boolean;
274
- pinType: { (): string; (_: string): Pins };
275
- pinType_exists: () => boolean;
276
- arrowWidth: { (): number; (_: number): Pins };
277
- arrowWidth_exists: () => boolean;
278
- arrowHeight: { (): number; (_: number): Pins };
279
- arrowHeight_exists: () => boolean;
280
- pinWidth: { (): number; (_: number): Pins };
281
- pinWidth_exists: () => boolean;
282
- pinHeight: { (): number; (_: number): Pins };
283
- pinHeight_exists: () => boolean;
284
- cornerRadius: { (): number; (_: number): Pins };
285
- cornerRadius_exists: () => boolean;
286
- pinRadius: { (): number; (_: number): Pins };
287
- pinRadius_exists: () => boolean;
288
- textBaseline: { (): string; (_: string): Pins };
289
- textBaseline_exists: () => boolean;
290
248
  }
291
249
  Pins.prototype._class += " map_Pins";
292
250
  Pins.prototype.mixin(Utility.SimpleSelectionMixin);
293
251
 
252
+ export interface Pins {
253
+ // Simple Selection ---
254
+ _selection;
255
+
256
+ // Properties ---
257
+ latColumn(): string;
258
+ latColumn(_: string): this;
259
+ latColumn_exists(): boolean;
260
+ longColumn(): string;
261
+ longColumn(_: string): this;
262
+ longColumn_exists(): boolean;
263
+ geohashColumn(): string;
264
+ geohashColumn(_: string): this;
265
+ geohashColumn_exists(): boolean;
266
+ tooltipColumn(): string;
267
+ tooltipColumn(_: string): this;
268
+ tooltipColumn_exists(): boolean;
269
+ opacity(): number;
270
+ opacity(_: number): this;
271
+ opacity_exists(): boolean;
272
+ fillColor(): string;
273
+ fillColor(_: string): this;
274
+ fillColor_exists(): boolean;
275
+ omitNullLatLong(): boolean;
276
+ omitNullLatLong(_: boolean): this;
277
+ omitNullLatLong_exists(): boolean;
278
+
279
+ strokeWidth(): number;
280
+ strokeWidth(_: number): this;
281
+ strokeWidth_exists(): boolean;
282
+ strokeColor(): string;
283
+ strokeColor(_: string): this;
284
+ strokeColor_exists(): boolean;
285
+
286
+ fontSize(): number;
287
+ fontSize(_: number): this;
288
+ fontSize_exists(): boolean;
289
+ fontFamily(): string;
290
+ fontFamily(_: string): this;
291
+ fontFamily_exists(): boolean;
292
+ fontColor(): string;
293
+ fontColor(_: string): this;
294
+ fontColor_exists(): boolean;
295
+
296
+ pinType(): string;
297
+ pinType(_: string): this;
298
+ pinType_exists(): boolean;
299
+ arrowWidth(): number;
300
+ arrowWidth(_: number): this;
301
+ arrowWidth_exists(): boolean;
302
+ arrowHeight(): number;
303
+ arrowHeight(_: number): this;
304
+ arrowHeight_exists(): boolean;
305
+
306
+ pinWidth(): number;
307
+ pinWidth(_: number): this;
308
+ pinWidth_exists(): boolean;
309
+ pinHeight(): number;
310
+ pinHeight(_: number): this;
311
+ pinHeight_exists(): boolean;
312
+ cornerRadius(): number;
313
+ cornerRadius(_: number): this;
314
+ cornerRadius_exists(): boolean;
315
+
316
+ pinRadius(): number;
317
+ pinRadius(_: number): this;
318
+ pinRadius_exists(): boolean;
319
+
320
+ textBaseline(): string;
321
+ textBaseline(_: string): this;
322
+ textBaseline_exists(): boolean;
323
+ }
324
+
294
325
  Pins.prototype.publish("geohashColumn", null, "set", "Geohash column", function () { return this.columns(); }, { optional: true });
295
326
  Pins.prototype.publish("tooltipColumn", null, "set", "Tooltip column", function () { return this.columns(); }, { optional: true });
296
327
  Pins.prototype.publish("latColumn", null, "set", "Latitude column", function () { return this.columns(); }, { optional: true });
package/src/Projection.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as d3Geo from "d3-geo";
2
- import { albersUsaPr } from "./Utility";
2
+ import { albersUsaPr } from "./Utility.ts";
3
3
 
4
4
  // const d3Geo = _d3Geo.geo || _d3Geo.default || _d3Geo;
5
5
 
@@ -1,4 +1,4 @@
1
- import { Layered } from "./Layered";
1
+ import { Layered } from "./Layered.ts";
2
2
 
3
3
  export class TestHeatMap extends Layered {
4
4
  constructor() {
@@ -1,114 +1,125 @@
1
1
  import { json as d3Json } from "d3-request";
2
2
  import { select as d3Select } from "d3-selection";
3
3
  import * as topojson from "topojson-client";
4
- import { Choropleth, topoJsonFolder } from "./Choropleth";
4
+ import { Choropleth, topoJsonFolder } from "./Choropleth.ts";
5
5
 
6
- export function TopoJSONChoropleth() {
7
- Choropleth.call(this);
6
+ export class TopoJSONChoropleth extends Choropleth {
7
+ protected _prevRegion: string;
8
+ protected choroPaths: any;
9
+ protected _choroTopologyIndex: any;
10
+ protected _choroTopologyFeatures: any;
8
11
 
9
- this.projection("Mercator");
10
- }
11
- TopoJSONChoropleth.prototype = Object.create(Choropleth.prototype);
12
- TopoJSONChoropleth.prototype.constructor = TopoJSONChoropleth;
13
- TopoJSONChoropleth.prototype._class += " map_TopoJSONChoropleth";
12
+ constructor() {
13
+ super();
14
14
 
15
- TopoJSONChoropleth.prototype.publish("region", "GB", "set", "Region Data", ["AT", "BE", "BG", "BR", "CHLI", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "GE", "GR", "HR", "HU", "IE", "IS", "IT", "KS", "LT", "LU", "LV", "MD", "MK", "MT", "ND", "NL", "NO", "PL", "PT", "RO", "RS", "SE", "SI", "SK", "UA"]);
15
+ this.projection("Mercator");
16
+ }
16
17
 
17
- TopoJSONChoropleth.prototype.layerEnter = function (base, svgElement, domElement) {
18
- Choropleth.prototype.layerEnter.apply(this, arguments);
18
+ layerEnter(base, svgElement, domElement) {
19
+ Choropleth.prototype.layerEnter.apply(this, arguments);
19
20
 
20
- this._selection.widgetElement(this._choroplethData);
21
- this.choroPaths = d3Select(null);
21
+ this._selection.widgetElement(this._choroplethData);
22
+ this.choroPaths = d3Select(null);
22
23
 
23
- const context = this;
24
- this
25
- .tooltipHTML(function (d) {
26
- const columns = context.columns();
27
- const series = columns && columns.length ? columns[0] : "Location";
28
- const origData = d && d.length ? d[d.length - 1] : [""];
29
- return context.tooltipFormat({ label: origData[0], series, value: d[1] });
30
- })
31
- ;
32
- };
24
+ const context = this;
25
+ this
26
+ .tooltipHTML(function (d) {
27
+ const columns = context.columns();
28
+ const series = columns && columns.length ? columns[0] : "Location";
29
+ const origData = d && d.length ? d[d.length - 1] : [""];
30
+ return context.tooltipFormat({ label: origData[0], series, value: d[1] });
31
+ })
32
+ ;
33
+ }
33
34
 
34
- TopoJSONChoropleth.prototype.layerUpdate = function (base) {
35
- Choropleth.prototype.layerUpdate.apply(this, arguments);
36
- const data = [];
37
- const context = this;
38
- this.data().forEach(function (row) {
39
- if (isNaN(row[0])) {
40
- for (const key in context._choroTopologyIndex) {
41
- for (const key2 in context._choroTopologyIndex[key]) {
42
- if (key2 === row[0]) {
43
- context._choroTopologyIndex[key][key2].forEach(function (idx) {
44
- data.push([idx].concat(row.filter(function (d, i) { return i > 0; })).concat([row]));
45
- });
35
+ layerUpdate(base) {
36
+ Choropleth.prototype.layerUpdate.apply(this, arguments);
37
+ const data = [];
38
+ const context = this;
39
+ this.data().forEach(function (row) {
40
+ if (isNaN(row[0])) {
41
+ for (const key in context._choroTopologyIndex) {
42
+ for (const key2 in context._choroTopologyIndex[key]) {
43
+ if (key2 === row[0]) {
44
+ context._choroTopologyIndex[key][key2].forEach(function (idx) {
45
+ data.push([idx].concat(row.filter(function (d, i) { return i > 0; })).concat([row]));
46
+ });
47
+ }
46
48
  }
47
49
  }
50
+ } else {
51
+ data.push(row.concat([row]));
48
52
  }
49
- } else {
50
- data.push(row.concat([row]));
51
- }
52
- });
53
- this.choroPaths = this._choroplethData.selectAll(".data").data(this.visible() ? data : [], function (d) { return d[0]; });
54
- this.choroPaths.enter().append("path")
55
- .attr("class", "data")
56
- .call(this._selection.enter.bind(this._selection))
57
- .on("click", function (d) {
58
- if (context._dataMap[d[0]]) {
59
- context.click(context.rowToObj(context._dataMap[d[0]]), "weight", context._selection.selected(context));
60
- }
61
- })
62
- .on("dblclick", function (d) {
63
- if (context._dataMap[d[0]]) {
64
- context.dblclick(context.rowToObj(context._dataMap[d[0]]), "weight", context._selection.selected(context));
65
- }
66
- })
67
- .on("mouseout.tooltip", this.tooltip.hide)
68
- .on("mousemove.tooltip", this.tooltip.show)
69
- ;
70
- this.choroPaths
71
- .attr("d", function (d) {
72
- const retVal = base._d3GeoPath(context._choroTopologyFeatures[d[0]]);
73
- if (!retVal) {
74
- console.warn("Unknown Country: " + d);
75
- }
76
- return retVal;
77
- })
78
- .style("fill", function (d) {
79
- const retVal = context._palette(d[1], context._dataMinWeight, context._dataMaxWeight);
80
- return retVal;
81
- })
82
- ;
83
- this.choroPaths.exit().remove();
84
- };
85
-
86
- TopoJSONChoropleth.prototype.layerPreRender = function () {
87
- if (this._prevRegion !== this.region()) {
88
- this._prevRegion = this.region();
89
- delete this._topoJsonPromise;
53
+ });
54
+ this.choroPaths = this._choroplethData.selectAll(".data").data(this.visible() ? data : [], function (d) { return d[0]; });
55
+ this.choroPaths.enter().append("path")
56
+ .attr("class", "data")
57
+ .call(this._selection.enter.bind(this._selection))
58
+ .on("click", function (d) {
59
+ if (context._dataMap[d[0]]) {
60
+ context.click(context.rowToObj(context._dataMap[d[0]]), "weight", context._selection.selected(context));
61
+ }
62
+ })
63
+ .on("dblclick", function (d) {
64
+ if (context._dataMap[d[0]]) {
65
+ context.dblclick(context.rowToObj(context._dataMap[d[0]]), "weight", context._selection.selected(context));
66
+ }
67
+ })
68
+ .on("mouseout.tooltip", this.tooltip.hide)
69
+ .on("mousemove.tooltip", this.tooltip.show)
70
+ ;
71
+ this.choroPaths
72
+ .attr("d", function (d) {
73
+ const retVal = base._d3GeoPath(context._choroTopologyFeatures[d[0]]);
74
+ if (!retVal) {
75
+ console.warn("Unknown Country: " + d);
76
+ }
77
+ return retVal;
78
+ })
79
+ .style("fill", function (d) {
80
+ const retVal = context._palette(d[1], context._dataMinWeight, context._dataMaxWeight);
81
+ return retVal;
82
+ })
83
+ ;
84
+ this.choroPaths.exit().remove();
90
85
  }
91
86
 
92
- if (!this._topoJsonPromise) {
93
- const context = this;
94
- this._topoJsonPromise = new Promise<void>(function (resolve, reject) {
95
- d3Json(`${topoJsonFolder()}/${context.region()}.json`, function (region) {
96
- context._choroTopology = region;
97
- context._choroTopologyObjects = region.objects.PolbndA;
98
- context._choroTopologyFeatures = topojson.feature(context._choroTopology, context._choroTopologyObjects).features;
87
+ layerPreRender() {
88
+ if (this._prevRegion !== this.region()) {
89
+ this._prevRegion = this.region();
90
+ delete this._topoJsonPromise;
91
+ }
99
92
 
100
- d3Json(`${topoJsonFolder()}/${context.region()}_idx.json`, indexLoad)
101
- .on("error", function (err) {
102
- indexLoad({});
103
- })
104
- ;
93
+ if (!this._topoJsonPromise) {
94
+ const context = this;
95
+ this._topoJsonPromise = new Promise<void>(function (resolve, reject) {
96
+ d3Json(`${topoJsonFolder()}/${context.region()}.json`, function (region) {
97
+ context._choroTopology = region;
98
+ context._choroTopologyObjects = region.objects.PolbndA;
99
+ context._choroTopologyFeatures = topojson.feature(context._choroTopology, context._choroTopologyObjects).features;
105
100
 
106
- function indexLoad(index) {
107
- context._choroTopologyIndex = index;
108
- resolve();
109
- }
101
+ d3Json(`${topoJsonFolder()}/${context.region()}_idx.json`, indexLoad)
102
+ .on("error", function (err) {
103
+ indexLoad({});
104
+ })
105
+ ;
106
+
107
+ function indexLoad(index) {
108
+ context._choroTopologyIndex = index;
109
+ resolve();
110
+ }
111
+ });
110
112
  });
111
- });
113
+ }
114
+ return this._topoJsonPromise;
112
115
  }
113
- return this._topoJsonPromise;
114
- };
116
+ }
117
+ TopoJSONChoropleth.prototype._class += " map_TopoJSONChoropleth";
118
+
119
+ export interface TopoJSONChoropleth {
120
+ region(): string;
121
+ region(_: string): this;
122
+ region_exists(): boolean;
123
+ }
124
+
125
+ TopoJSONChoropleth.prototype.publish("region", "GB", "set", "Region Data", ["AT", "BE", "BG", "BR", "CHLI", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "GE", "GR", "HR", "HU", "IE", "IS", "IT", "KS", "LT", "LU", "LV", "MD", "MK", "MT", "ND", "NL", "NO", "PL", "PT", "RO", "RS", "SE", "SI", "SK", "UA"]);
@@ -1,3 +1,3 @@
1
1
  export const PKG_NAME = "@hpcc-js/map";
2
- export const PKG_VERSION = "2.79.0";
3
- export const BUILD_VERSION = "2.107.0";
2
+ export const PKG_VERSION = "3.1.0";
3
+ export const BUILD_VERSION = "3.2.0";
package/src/index.ts CHANGED
@@ -1,34 +1,33 @@
1
- export * from "./__package__";
2
- export * from "./CanvasPinLayer";
3
- export * from "./CanvasPins";
4
- export * from "./Choropleth";
5
- export * from "./ChoroplethContinents";
6
- export * from "./ChoroplethCounties";
7
- export * from "./ChoroplethCountries";
8
- export * from "./ChoroplethStates";
9
- export * from "./ChoroplethStatesHeat";
10
- export * from "./GeoHash";
11
- export * from "./GMap";
12
- export * from "./GMapCounties";
13
- export * from "./GMapGraph";
14
- export * from "./GMapHeat";
15
- export * from "./GMapLayered";
16
- export * from "./GMapPin";
17
- export * from "./GMapPinLine";
18
- export * from "./Graph";
19
- export * from "./Graticule";
20
- export * from "./Heat";
21
- export * from "./IChoropleth";
22
- export * from "./Layer";
23
- export * from "./Layered";
24
- export * from "./Lines";
25
- export * from "./OpenStreet";
26
- export * from "./Pins";
27
- export * from "./Projection";
28
- export * from "./TestHeatMap";
29
- export * from "./TopoJSONChoropleth";
1
+ export * from "./__package__.ts";
2
+ export * from "./CanvasPinLayer.ts";
3
+ export * from "./CanvasPins.ts";
4
+ export * from "./Choropleth.ts";
5
+ export * from "./ChoroplethContinents.ts";
6
+ export * from "./ChoroplethCounties.ts";
7
+ export * from "./ChoroplethCountries.ts";
8
+ export * from "./ChoroplethStates.ts";
9
+ export * from "./ChoroplethStatesHeat.ts";
10
+ export * from "./GeoHash.ts";
11
+ export * from "./GMap.ts";
12
+ export * from "./GMapCounties.ts";
13
+ export * from "./GMapGraph.ts";
14
+ export * from "./GMapHeat.ts";
15
+ export * from "./GMapLayered.ts";
16
+ export * from "./GMapPin.ts";
17
+ export * from "./GMapPinLine.ts";
18
+ export * from "./Graph.ts";
19
+ export * from "./Graticule.ts";
20
+ export * from "./Heat.ts";
21
+ export * from "./IChoropleth.ts";
22
+ export * from "./Layer.ts";
23
+ export * from "./Layered.ts";
24
+ export * from "./Lines.ts";
25
+ export * from "./OpenStreet.ts";
26
+ export * from "./Pins.ts";
27
+ export * from "./Projection.ts";
28
+ export * from "./TopoJSONChoropleth.ts";
30
29
 
31
- import * as Leaflet from "./leaflet/index";
30
+ import * as Leaflet from "./leaflet/index.ts";
32
31
  export {
33
32
  Leaflet
34
33
  };
@@ -1,6 +1,6 @@
1
- import { CRS, LatLng, LatLngBounds, Point, Transformation, Util } from "@hpcc-js/leaflet-shim";
2
- import { resolve } from "../Projection";
3
- import { TileLayer } from "./TileLayer";
1
+ import { CRS, LatLng, LatLngBounds, Point, Transformation, Util } from "./leaflet-shim.ts";
2
+ import { resolve } from "../Projection.ts";
3
+ import { TileLayer } from "./TileLayer.ts";
4
4
 
5
5
  const projAlbers = resolve("Albers").scale(.5);
6
6
  const projAlbersUsaPr = resolve("AlbersUsaPr").scale(.5);
@@ -1,4 +1,4 @@
1
- import { TileLayer } from "./TileLayer";
1
+ import { TileLayer } from "./TileLayer.ts";
2
2
 
3
3
  export class BlankLayer extends TileLayer {
4
4
 
@@ -1,5 +1,5 @@
1
- import { Circle, Map } from "@hpcc-js/leaflet-shim";
2
- import { ClusterLayer, D3SurfaceLayer } from "./FeatureLayer";
1
+ import { Circle, Map } from "./leaflet-shim.ts";
2
+ import { ClusterLayer, D3SurfaceLayer } from "./FeatureLayer.ts";
3
3
 
4
4
  export class Circles extends ClusterLayer {
5
5
 
@@ -1,8 +1,8 @@
1
1
  import { extent as d3Extent, Palette } from "@hpcc-js/common";
2
- import { DivIcon, Map, Marker, Point } from "@hpcc-js/leaflet-shim";
2
+ import { DivIcon, Map, Marker, Point } from "./leaflet-shim.ts";
3
3
  import { hsl as d3Hsl } from "d3-color";
4
4
  import { format as d3Format } from "d3-format";
5
- import { FeatureLayer } from "./FeatureLayer";
5
+ import { FeatureLayer } from "./FeatureLayer.ts";
6
6
 
7
7
  import "../../src/leaflet/ClusterCircles.css";
8
8
 
@@ -1,7 +1,7 @@
1
1
  import { json as d3Json } from "d3-request";
2
2
  import * as topojson from "topojson-client";
3
- import { topoJsonFolder } from "../Choropleth";
4
- import { World } from "./World";
3
+ import { topoJsonFolder } from "../Choropleth.ts";
4
+ import { World } from "./World.ts";
5
5
 
6
6
  let countries = null;
7
7
 
@@ -1,6 +1,6 @@
1
- import { Circle, Control, Draw, LatLng, LatLngBounds, LatLngExpression, Map, Polygon, Polyline, Rectangle } from "@hpcc-js/leaflet-shim";
1
+ import { Circle, Control, Draw, LatLng, LatLngBounds, LatLngExpression, Map, Polygon, Polyline, Rectangle } from "./leaflet-shim.ts";
2
2
  import { hashSum } from "@hpcc-js/util";
3
- import { FeatureLayer } from "./FeatureLayer";
3
+ import { FeatureLayer } from "./FeatureLayer.ts";
4
4
 
5
5
  function del(arr: any[], item: object) {
6
6
  const idx = arr.indexOf(item);
@@ -1,7 +1,7 @@
1
1
  import { HTMLWidget, select as d3Select, Utility } from "@hpcc-js/common";
2
- import { D3SvgOverlay, FeatureGroup, LatLngBounds, LeafletEvent, Map, MarkerClusterGroup } from "@hpcc-js/leaflet-shim";
3
- import { Leaflet } from "./Leaflet";
4
- import { ILayer } from "./TileLayer";
2
+ import { D3SvgOverlay, FeatureGroup, LatLngBounds, LeafletEvent, Map, MarkerClusterGroup } from "./leaflet-shim.ts";
3
+ import { Leaflet } from "./Leaflet.ts";
4
+ import { ILayer } from "./TileLayer.ts";
5
5
 
6
6
  export class FeatureLayer extends Leaflet implements ILayer {
7
7
  protected _layer: FeatureGroup | MarkerClusterGroup;