@unovis/ts 1.1.1-beta.6 → 1.1.1-beta.7

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 (710) hide show
  1. package/declaration.d.ts +1 -0
  2. package/index.ts +1 -0
  3. package/licences.txt +43 -0
  4. package/maps.ts +1 -0
  5. package/package.json +1 -1
  6. package/rollup.config.js +71 -0
  7. package/rules/ts-getter-setter.js +35 -0
  8. package/src/components/area/config.ts +29 -0
  9. package/src/components/area/index.ts +133 -0
  10. package/{components/area/style.js → src/components/area/style.ts} +9 -10
  11. package/src/components/area/types.ts +2 -0
  12. package/src/components/axis/config.ts +76 -0
  13. package/src/components/axis/index.ts +363 -0
  14. package/{components/axis/style.js → src/components/axis/style.ts} +27 -22
  15. package/src/components/axis/types.ts +4 -0
  16. package/src/components/brush/config.ts +51 -0
  17. package/src/components/brush/index.ts +233 -0
  18. package/{components/brush/style.js → src/components/brush/style.ts} +15 -14
  19. package/src/components/brush/types.ts +8 -0
  20. package/src/components/bullet-legend/config.ts +38 -0
  21. package/src/components/bullet-legend/index.ts +104 -0
  22. package/{components/bullet-legend/style.js → src/components/bullet-legend/style.ts} +18 -16
  23. package/src/components/bullet-legend/types.ts +7 -0
  24. package/src/components/chord-diagram/config.ts +53 -0
  25. package/src/components/chord-diagram/index.ts +401 -0
  26. package/src/components/chord-diagram/modules/label.ts +155 -0
  27. package/src/components/chord-diagram/modules/link.ts +91 -0
  28. package/src/components/chord-diagram/modules/node.ts +80 -0
  29. package/{components/chord-diagram/style.js → src/components/chord-diagram/style.ts} +39 -30
  30. package/src/components/chord-diagram/types.ts +68 -0
  31. package/src/components/crosshair/config.ts +48 -0
  32. package/src/components/crosshair/index.ts +220 -0
  33. package/{components/crosshair/style.js → src/components/crosshair/style.ts} +12 -12
  34. package/src/components/crosshair/types.ts +15 -0
  35. package/src/components/donut/config.ts +65 -0
  36. package/src/components/donut/index.ts +148 -0
  37. package/src/components/donut/modules/arc.ts +86 -0
  38. package/{components/donut/style.js → src/components/donut/style.ts} +20 -18
  39. package/src/components/donut/types.ts +17 -0
  40. package/src/components/flow-legend/config.ts +31 -0
  41. package/src/components/flow-legend/index.ts +103 -0
  42. package/{components/flow-legend/style.js → src/components/flow-legend/style.ts} +25 -21
  43. package/src/components/flow-legend/types.ts +10 -0
  44. package/src/components/free-brush/config.ts +54 -0
  45. package/src/components/free-brush/index.ts +207 -0
  46. package/{components/free-brush/style.js → src/components/free-brush/style.ts} +12 -12
  47. package/src/components/free-brush/types.ts +8 -0
  48. package/src/components/graph/config.ts +280 -0
  49. package/src/components/graph/index.ts +809 -0
  50. package/src/components/graph/modules/layout-helpers.ts +96 -0
  51. package/src/components/graph/modules/layout.ts +502 -0
  52. package/src/components/graph/modules/link/helper.ts +105 -0
  53. package/src/components/graph/modules/link/index.ts +302 -0
  54. package/{components/graph/modules/link/style.js → src/components/graph/modules/link/style.ts} +45 -34
  55. package/src/components/graph/modules/node/helper.ts +162 -0
  56. package/src/components/graph/modules/node/index.ts +343 -0
  57. package/{components/graph/modules/node/style.js → src/components/graph/modules/node/style.ts} +72 -52
  58. package/src/components/graph/modules/panel/helper.ts +160 -0
  59. package/src/components/graph/modules/panel/index.ts +137 -0
  60. package/{components/graph/modules/panel/style.js → src/components/graph/modules/panel/style.ts} +42 -32
  61. package/src/components/graph/modules/shape.ts +108 -0
  62. package/src/components/graph/modules/zoom-levels.ts +6 -0
  63. package/src/components/graph/style.ts +72 -0
  64. package/src/components/graph/types.ts +152 -0
  65. package/src/components/grouped-bar/config.ts +40 -0
  66. package/src/components/grouped-bar/index.ts +325 -0
  67. package/{components/grouped-bar/style.js → src/components/grouped-bar/style.ts} +15 -14
  68. package/src/components/leaflet-flow-map/config.ts +60 -0
  69. package/src/components/leaflet-flow-map/index.ts +279 -0
  70. package/src/components/leaflet-flow-map/renderer-utils.ts +14 -0
  71. package/src/components/leaflet-flow-map/renderer.ts +146 -0
  72. package/{components/leaflet-flow-map/shaders.js → src/components/leaflet-flow-map/shaders.ts} +4 -7
  73. package/src/components/leaflet-flow-map/types.ts +18 -0
  74. package/src/components/leaflet-map/config.ts +234 -0
  75. package/src/components/leaflet-map/index.ts +808 -0
  76. package/src/components/leaflet-map/leaflet.css +625 -0
  77. package/src/components/leaflet-map/modules/clusterBackground.ts +34 -0
  78. package/src/components/leaflet-map/modules/donut.ts +37 -0
  79. package/src/components/leaflet-map/modules/map.ts +178 -0
  80. package/src/components/leaflet-map/modules/node.ts +208 -0
  81. package/src/components/leaflet-map/modules/selectionRing.ts +63 -0
  82. package/src/components/leaflet-map/modules/utils.ts +290 -0
  83. package/{components → src/components}/leaflet-map/renderer/leaflet-maplibre-gl.js +76 -78
  84. package/src/components/leaflet-map/renderer/map-style.ts +24 -0
  85. package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json +35 -0
  86. package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json +35 -0
  87. package/src/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json +2185 -0
  88. package/src/components/leaflet-map/renderer/mapboxgl-layer.ts +43 -0
  89. package/src/components/leaflet-map/renderer/mapboxgl-utils.ts +40 -0
  90. package/{components → src/components}/leaflet-map/renderer/maplibre-gl.css.js +2 -4
  91. package/src/components/leaflet-map/style.ts +217 -0
  92. package/src/components/leaflet-map/types.ts +75 -0
  93. package/src/components/line/config.ts +34 -0
  94. package/src/components/line/index.ts +188 -0
  95. package/{components/line/style.js → src/components/line/style.ts} +18 -16
  96. package/src/components/line/types.ts +3 -0
  97. package/src/components/nested-donut/config.ts +75 -0
  98. package/src/components/nested-donut/index.ts +176 -0
  99. package/src/components/nested-donut/modules/arc.ts +78 -0
  100. package/src/components/nested-donut/modules/label.ts +63 -0
  101. package/src/components/nested-donut/style.ts +82 -0
  102. package/src/components/nested-donut/types.ts +29 -0
  103. package/src/components/sankey/config.ts +195 -0
  104. package/src/components/sankey/index.ts +387 -0
  105. package/src/components/sankey/modules/label.ts +228 -0
  106. package/src/components/sankey/modules/link.ts +141 -0
  107. package/src/components/sankey/modules/node.ts +221 -0
  108. package/{components/sankey/style.js → src/components/sankey/style.ts} +60 -44
  109. package/src/components/sankey/types.ts +95 -0
  110. package/src/components/scatter/config.ts +49 -0
  111. package/src/components/scatter/index.ts +220 -0
  112. package/src/components/scatter/modules/point.ts +123 -0
  113. package/src/components/scatter/modules/utils.ts +150 -0
  114. package/{components/scatter/style.js → src/components/scatter/style.ts} +15 -14
  115. package/src/components/scatter/types.ts +21 -0
  116. package/src/components/stacked-bar/config.ts +42 -0
  117. package/src/components/stacked-bar/index.ts +267 -0
  118. package/{components/stacked-bar/style.js → src/components/stacked-bar/style.ts} +15 -14
  119. package/src/components/stacked-bar/types.ts +5 -0
  120. package/src/components/timeline/config.ts +49 -0
  121. package/src/components/timeline/index.ts +302 -0
  122. package/{components/timeline/style.js → src/components/timeline/style.ts} +39 -30
  123. package/src/components/tooltip/config.ts +69 -0
  124. package/src/components/tooltip/index.ts +220 -0
  125. package/{components → src/components}/tooltip/style.js +11 -14
  126. package/src/components/topojson-map/config.ts +124 -0
  127. package/src/components/topojson-map/index.ts +436 -0
  128. package/{components/topojson-map/style.js → src/components/topojson-map/style.ts} +33 -26
  129. package/src/components/topojson-map/types.ts +123 -0
  130. package/src/components/topojson-map/utils.ts +29 -0
  131. package/src/components/vis-controls/config.ts +16 -0
  132. package/src/components/vis-controls/index.ts +68 -0
  133. package/{components/vis-controls/style.js → src/components/vis-controls/style.ts} +34 -27
  134. package/src/components/vis-controls/types.ts +14 -0
  135. package/src/components/xy-labels/config.ts +56 -0
  136. package/src/components/xy-labels/index.ts +109 -0
  137. package/src/components/xy-labels/modules/label.ts +140 -0
  138. package/{components/xy-labels/style.js → src/components/xy-labels/style.ts} +15 -14
  139. package/src/components/xy-labels/types.ts +26 -0
  140. package/src/components.ts +56 -0
  141. package/src/containers/single-container/config.ts +15 -0
  142. package/src/containers/single-container/index.ts +150 -0
  143. package/src/containers/xy-container/config.ts +112 -0
  144. package/src/containers/xy-container/index.ts +407 -0
  145. package/src/containers.ts +6 -0
  146. package/src/core/component/config.ts +61 -0
  147. package/src/core/component/index.ts +154 -0
  148. package/src/core/component/types.ts +9 -0
  149. package/src/core/config/index.ts +12 -0
  150. package/src/core/container/config.ts +56 -0
  151. package/src/core/container/index.ts +136 -0
  152. package/src/core/xy-component/config.ts +46 -0
  153. package/src/core/xy-component/index.ts +90 -0
  154. package/src/data-models/core.ts +15 -0
  155. package/src/data-models/graph.ts +138 -0
  156. package/src/data-models/map-graph.ts +72 -0
  157. package/src/data-models/map.ts +18 -0
  158. package/src/data-models/series.ts +16 -0
  159. package/src/index.ts +7 -0
  160. package/src/maps/china-provinces.json +1 -0
  161. package/src/maps/fr-regions.json +1 -0
  162. package/src/maps/germany-regions.json +1 -0
  163. package/src/maps/ind-regions.json +1 -0
  164. package/src/maps/uk-regions.json +1 -0
  165. package/src/maps/us-counties.json +1 -0
  166. package/src/maps/us-states.json +1 -0
  167. package/src/maps/world-110m-alpha.json +1 -0
  168. package/src/maps/world-simple.json +1 -0
  169. package/src/maps/world-simplest.json +1 -0
  170. package/src/maps.ts +34 -0
  171. package/src/styles/colors.ts +28 -0
  172. package/src/styles/index.ts +38 -0
  173. package/{styles/sizes.js → src/styles/sizes.ts} +6 -8
  174. package/src/types/accessor.ts +5 -0
  175. package/src/types/component.ts +15 -0
  176. package/src/types/curve.ts +62 -0
  177. package/src/types/data.ts +5 -0
  178. package/src/types/direction.ts +6 -0
  179. package/src/types/graph.ts +40 -0
  180. package/src/types/map.ts +5 -0
  181. package/src/types/misc.ts +10 -0
  182. package/src/types/position.ts +23 -0
  183. package/src/types/scale.ts +47 -0
  184. package/src/types/shape.ts +7 -0
  185. package/src/types/spacing.ts +6 -0
  186. package/src/types/svg.ts +32 -0
  187. package/src/types/symbol.ts +21 -0
  188. package/src/types/text.ts +71 -0
  189. package/src/types.ts +31 -0
  190. package/src/utils/color.ts +41 -0
  191. package/src/utils/d3.ts +15 -0
  192. package/src/utils/data.ts +328 -0
  193. package/src/utils/html.ts +13 -0
  194. package/src/utils/map.ts +29 -0
  195. package/src/utils/misc.ts +54 -0
  196. package/src/utils/path.ts +196 -0
  197. package/src/utils/scale.ts +1 -0
  198. package/src/utils/style.ts +37 -0
  199. package/src/utils/svg.ts +49 -0
  200. package/src/utils/text.ts +529 -0
  201. package/src/utils/type.ts +9 -0
  202. package/tsconfig.json +29 -0
  203. package/components/area/config.d.ts +0 -25
  204. package/components/area/config.js +0 -16
  205. package/components/area/config.js.map +0 -1
  206. package/components/area/index.d.ts +0 -19
  207. package/components/area/index.js +0 -102
  208. package/components/area/index.js.map +0 -1
  209. package/components/area/style.d.ts +0 -3
  210. package/components/area/style.js.map +0 -1
  211. package/components/area/types.d.ts +0 -6
  212. package/components/axis/config.d.ts +0 -71
  213. package/components/axis/config.js +0 -32
  214. package/components/axis/config.js.map +0 -1
  215. package/components/axis/index.d.ts +0 -44
  216. package/components/axis/index.js +0 -305
  217. package/components/axis/index.js.map +0 -1
  218. package/components/axis/style.d.ts +0 -9
  219. package/components/axis/style.js.map +0 -1
  220. package/components/axis/types.d.ts +0 -4
  221. package/components/axis/types.js +0 -8
  222. package/components/axis/types.js.map +0 -1
  223. package/components/brush/config.d.ts +0 -42
  224. package/components/brush/config.js +0 -24
  225. package/components/brush/config.js.map +0 -1
  226. package/components/brush/index.d.ts +0 -28
  227. package/components/brush/index.js +0 -199
  228. package/components/brush/index.js.map +0 -1
  229. package/components/brush/style.d.ts +0 -5
  230. package/components/brush/style.js.map +0 -1
  231. package/components/brush/types.d.ts +0 -7
  232. package/components/brush/types.js +0 -8
  233. package/components/brush/types.js.map +0 -1
  234. package/components/bullet-legend/config.d.ts +0 -34
  235. package/components/bullet-legend/config.js +0 -16
  236. package/components/bullet-legend/config.js.map +0 -1
  237. package/components/bullet-legend/index.d.ts +0 -19
  238. package/components/bullet-legend/index.js +0 -79
  239. package/components/bullet-legend/index.js.map +0 -1
  240. package/components/bullet-legend/style.d.ts +0 -6
  241. package/components/bullet-legend/style.js.map +0 -1
  242. package/components/bullet-legend/types.d.ts +0 -7
  243. package/components/bullet-legend/types.js +0 -2
  244. package/components/bullet-legend/types.js.map +0 -1
  245. package/components/chord-diagram/config.d.ts +0 -44
  246. package/components/chord-diagram/config.js +0 -25
  247. package/components/chord-diagram/config.js.map +0 -1
  248. package/components/chord-diagram/index.d.ts +0 -42
  249. package/components/chord-diagram/index.js +0 -305
  250. package/components/chord-diagram/index.js.map +0 -1
  251. package/components/chord-diagram/modules/label.d.ts +0 -8
  252. package/components/chord-diagram/modules/label.js +0 -115
  253. package/components/chord-diagram/modules/label.js.map +0 -1
  254. package/components/chord-diagram/modules/link.d.ts +0 -21
  255. package/components/chord-diagram/modules/link.js +0 -63
  256. package/components/chord-diagram/modules/link.js.map +0 -1
  257. package/components/chord-diagram/modules/node.d.ts +0 -17
  258. package/components/chord-diagram/modules/node.js +0 -52
  259. package/components/chord-diagram/modules/node.js.map +0 -1
  260. package/components/chord-diagram/style.d.ts +0 -13
  261. package/components/chord-diagram/style.js.map +0 -1
  262. package/components/chord-diagram/types.d.ts +0 -58
  263. package/components/chord-diagram/types.js +0 -8
  264. package/components/chord-diagram/types.js.map +0 -1
  265. package/components/crosshair/config.d.ts +0 -43
  266. package/components/crosshair/config.js +0 -19
  267. package/components/crosshair/config.js.map +0 -1
  268. package/components/crosshair/index.d.ts +0 -35
  269. package/components/crosshair/index.js +0 -183
  270. package/components/crosshair/index.js.map +0 -1
  271. package/components/crosshair/style.d.ts +0 -4
  272. package/components/crosshair/style.js.map +0 -1
  273. package/components/crosshair/types.d.ts +0 -13
  274. package/components/crosshair/types.js +0 -2
  275. package/components/crosshair/types.js.map +0 -1
  276. package/components/donut/config.d.ts +0 -59
  277. package/components/donut/config.js +0 -28
  278. package/components/donut/config.js.map +0 -1
  279. package/components/donut/index.d.ts +0 -21
  280. package/components/donut/index.js +0 -107
  281. package/components/donut/index.js.map +0 -1
  282. package/components/donut/modules/arc.d.ts +0 -10
  283. package/components/donut/modules/arc.js +0 -59
  284. package/components/donut/modules/arc.js.map +0 -1
  285. package/components/donut/style.d.ts +0 -7
  286. package/components/donut/style.js.map +0 -1
  287. package/components/donut/types.d.ts +0 -20
  288. package/components/flow-legend/config.d.ts +0 -29
  289. package/components/flow-legend/config.js +0 -18
  290. package/components/flow-legend/config.js.map +0 -1
  291. package/components/flow-legend/index.d.ts +0 -16
  292. package/components/flow-legend/index.js +0 -75
  293. package/components/flow-legend/index.js.map +0 -1
  294. package/components/flow-legend/style.d.ts +0 -8
  295. package/components/flow-legend/style.js.map +0 -1
  296. package/components/flow-legend/types.d.ts +0 -9
  297. package/components/flow-legend/types.js +0 -8
  298. package/components/flow-legend/types.js.map +0 -1
  299. package/components/free-brush/config.d.ts +0 -45
  300. package/components/free-brush/config.js +0 -24
  301. package/components/free-brush/config.js.map +0 -1
  302. package/components/free-brush/index.d.ts +0 -20
  303. package/components/free-brush/index.js +0 -192
  304. package/components/free-brush/index.js.map +0 -1
  305. package/components/free-brush/style.d.ts +0 -4
  306. package/components/free-brush/style.js.map +0 -1
  307. package/components/free-brush/types.d.ts +0 -7
  308. package/components/free-brush/types.js +0 -9
  309. package/components/free-brush/types.js.map +0 -1
  310. package/components/graph/config.d.ts +0 -238
  311. package/components/graph/config.js +0 -84
  312. package/components/graph/config.js.map +0 -1
  313. package/components/graph/index.d.ts +0 -126
  314. package/components/graph/index.js +0 -656
  315. package/components/graph/index.js.map +0 -1
  316. package/components/graph/modules/layout-helpers.d.ts +0 -21
  317. package/components/graph/modules/layout-helpers.js +0 -69
  318. package/components/graph/modules/layout-helpers.js.map +0 -1
  319. package/components/graph/modules/layout.d.ts +0 -10
  320. package/components/graph/modules/layout.js +0 -399
  321. package/components/graph/modules/layout.js.map +0 -1
  322. package/components/graph/modules/link/helper.d.ts +0 -25
  323. package/components/graph/modules/link/helper.js +0 -74
  324. package/components/graph/modules/link/helper.js.map +0 -1
  325. package/components/graph/modules/link/index.d.ts +0 -11
  326. package/components/graph/modules/link/index.js +0 -212
  327. package/components/graph/modules/link/index.js.map +0 -1
  328. package/components/graph/modules/link/style.d.ts +0 -15
  329. package/components/graph/modules/link/style.js.map +0 -1
  330. package/components/graph/modules/node/helper.d.ts +0 -21
  331. package/components/graph/modules/node/helper.js +0 -126
  332. package/components/graph/modules/node/helper.js.map +0 -1
  333. package/components/graph/modules/node/index.d.ts +0 -11
  334. package/components/graph/modules/node/index.js +0 -252
  335. package/components/graph/modules/node/index.js.map +0 -1
  336. package/components/graph/modules/node/style.d.ts +0 -24
  337. package/components/graph/modules/node/style.js.map +0 -1
  338. package/components/graph/modules/panel/helper.d.ts +0 -18
  339. package/components/graph/modules/panel/helper.js +0 -111
  340. package/components/graph/modules/panel/helper.js.map +0 -1
  341. package/components/graph/modules/panel/index.d.ts +0 -7
  342. package/components/graph/modules/panel/index.js +0 -98
  343. package/components/graph/modules/panel/index.js.map +0 -1
  344. package/components/graph/modules/panel/style.d.ts +0 -14
  345. package/components/graph/modules/panel/style.js.map +0 -1
  346. package/components/graph/modules/shape.d.ts +0 -6
  347. package/components/graph/modules/shape.js +0 -80
  348. package/components/graph/modules/shape.js.map +0 -1
  349. package/components/graph/modules/zoom-levels.d.ts +0 -6
  350. package/components/graph/modules/zoom-levels.js +0 -10
  351. package/components/graph/modules/zoom-levels.js.map +0 -1
  352. package/components/graph/style.d.ts +0 -6
  353. package/components/graph/style.js +0 -66
  354. package/components/graph/style.js.map +0 -1
  355. package/components/graph/types.d.ts +0 -125
  356. package/components/graph/types.js +0 -30
  357. package/components/graph/types.js.map +0 -1
  358. package/components/grouped-bar/config.d.ts +0 -36
  359. package/components/grouped-bar/config.js +0 -20
  360. package/components/grouped-bar/config.js.map +0 -1
  361. package/components/grouped-bar/index.d.ts +0 -32
  362. package/components/grouped-bar/index.js +0 -249
  363. package/components/grouped-bar/index.js.map +0 -1
  364. package/components/grouped-bar/style.d.ts +0 -5
  365. package/components/grouped-bar/style.js.map +0 -1
  366. package/components/leaflet-flow-map/config.d.ts +0 -46
  367. package/components/leaflet-flow-map/config.js +0 -25
  368. package/components/leaflet-flow-map/config.js.map +0 -1
  369. package/components/leaflet-flow-map/index.d.ts +0 -52
  370. package/components/leaflet-flow-map/index.js +0 -220
  371. package/components/leaflet-flow-map/index.js.map +0 -1
  372. package/components/leaflet-flow-map/renderer-utils.d.ts +0 -5
  373. package/components/leaflet-flow-map/renderer-utils.js +0 -15
  374. package/components/leaflet-flow-map/renderer-utils.js.map +0 -1
  375. package/components/leaflet-flow-map/renderer.d.ts +0 -26
  376. package/components/leaflet-flow-map/renderer.js +0 -117
  377. package/components/leaflet-flow-map/renderer.js.map +0 -1
  378. package/components/leaflet-flow-map/shaders.d.ts +0 -2
  379. package/components/leaflet-flow-map/shaders.js.map +0 -1
  380. package/components/leaflet-flow-map/types.d.ts +0 -23
  381. package/components/leaflet-map/config.d.ts +0 -193
  382. package/components/leaflet-map/config.js +0 -71
  383. package/components/leaflet-map/config.js.map +0 -1
  384. package/components/leaflet-map/index.d.ts +0 -130
  385. package/components/leaflet-map/index.js +0 -690
  386. package/components/leaflet-map/index.js.map +0 -1
  387. package/components/leaflet-map/leaflet.css.js +0 -5
  388. package/components/leaflet-map/leaflet.css.js.map +0 -1
  389. package/components/leaflet-map/modules/clusterBackground.d.ts +0 -5
  390. package/components/leaflet-map/modules/clusterBackground.js +0 -27
  391. package/components/leaflet-map/modules/clusterBackground.js.map +0 -1
  392. package/components/leaflet-map/modules/donut.d.ts +0 -3
  393. package/components/leaflet-map/modules/donut.js +0 -25
  394. package/components/leaflet-map/modules/donut.js.map +0 -1
  395. package/components/leaflet-map/modules/map.d.ts +0 -14
  396. package/components/leaflet-map/modules/map.js +0 -154
  397. package/components/leaflet-map/modules/map.js.map +0 -1
  398. package/components/leaflet-map/modules/node.d.ts +0 -9
  399. package/components/leaflet-map/modules/node.js +0 -162
  400. package/components/leaflet-map/modules/node.js.map +0 -1
  401. package/components/leaflet-map/modules/selectionRing.d.ts +0 -7
  402. package/components/leaflet-map/modules/selectionRing.js +0 -41
  403. package/components/leaflet-map/modules/selectionRing.js.map +0 -1
  404. package/components/leaflet-map/modules/utils.d.ts +0 -50
  405. package/components/leaflet-map/modules/utils.js +0 -210
  406. package/components/leaflet-map/modules/utils.js.map +0 -1
  407. package/components/leaflet-map/renderer/leaflet-maplibre-gl.js.map +0 -1
  408. package/components/leaflet-map/renderer/map-style.d.ts +0 -4
  409. package/components/leaflet-map/renderer/map-style.js +0 -15
  410. package/components/leaflet-map/renderer/map-style.js.map +0 -1
  411. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js +0 -40
  412. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-dark-theme.json.js.map +0 -1
  413. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js +0 -40
  414. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-light-theme.json.js.map +0 -1
  415. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js +0 -4981
  416. package/components/leaflet-map/renderer/mapboxgl/mapboxgl-settings.json.js.map +0 -1
  417. package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +0 -8
  418. package/components/leaflet-map/renderer/mapboxgl-layer.js +0 -27
  419. package/components/leaflet-map/renderer/mapboxgl-layer.js.map +0 -1
  420. package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +0 -4
  421. package/components/leaflet-map/renderer/mapboxgl-utils.js +0 -39
  422. package/components/leaflet-map/renderer/mapboxgl-utils.js.map +0 -1
  423. package/components/leaflet-map/renderer/maplibre-gl.css.js.map +0 -1
  424. package/components/leaflet-map/style.d.ts +0 -52
  425. package/components/leaflet-map/style.js +0 -183
  426. package/components/leaflet-map/style.js.map +0 -1
  427. package/components/leaflet-map/types.d.ts +0 -75
  428. package/components/leaflet-map/types.js +0 -15
  429. package/components/leaflet-map/types.js.map +0 -1
  430. package/components/line/config.d.ts +0 -30
  431. package/components/line/config.js +0 -17
  432. package/components/line/config.js.map +0 -1
  433. package/components/line/index.d.ts +0 -27
  434. package/components/line/index.js +0 -152
  435. package/components/line/index.js.map +0 -1
  436. package/components/line/style.d.ts +0 -6
  437. package/components/line/style.js.map +0 -1
  438. package/components/line/types.d.ts +0 -12
  439. package/components/nested-donut/config.d.ts +0 -59
  440. package/components/nested-donut/config.js +0 -19
  441. package/components/nested-donut/config.js.map +0 -1
  442. package/components/nested-donut/index.d.ts +0 -38
  443. package/components/nested-donut/index.js +0 -133
  444. package/components/nested-donut/index.js.map +0 -1
  445. package/components/nested-donut/modules/arc.d.ts +0 -17
  446. package/components/nested-donut/modules/arc.js +0 -50
  447. package/components/nested-donut/modules/arc.js.map +0 -1
  448. package/components/nested-donut/modules/label.d.ts +0 -7
  449. package/components/nested-donut/modules/label.js +0 -34
  450. package/components/nested-donut/modules/label.js.map +0 -1
  451. package/components/nested-donut/style.d.ts +0 -26
  452. package/components/nested-donut/style.js +0 -70
  453. package/components/nested-donut/style.js.map +0 -1
  454. package/components/nested-donut/types.d.ts +0 -24
  455. package/components/nested-donut/types.js +0 -11
  456. package/components/nested-donut/types.js.map +0 -1
  457. package/components/sankey/config.d.ts +0 -162
  458. package/components/sankey/config.js +0 -65
  459. package/components/sankey/config.js.map +0 -1
  460. package/components/sankey/index.d.ts +0 -59
  461. package/components/sankey/index.js +0 -306
  462. package/components/sankey/index.js.map +0 -1
  463. package/components/sankey/modules/label.d.ts +0 -23
  464. package/components/sankey/modules/label.js +0 -168
  465. package/components/sankey/modules/label.js.map +0 -1
  466. package/components/sankey/modules/link.d.ts +0 -14
  467. package/components/sankey/modules/link.js +0 -108
  468. package/components/sankey/modules/link.js.map +0 -1
  469. package/components/sankey/modules/node.d.ts +0 -10
  470. package/components/sankey/modules/node.js +0 -156
  471. package/components/sankey/modules/node.js.map +0 -1
  472. package/components/sankey/style.d.ts +0 -20
  473. package/components/sankey/style.js.map +0 -1
  474. package/components/sankey/types.d.ts +0 -84
  475. package/components/sankey/types.js +0 -34
  476. package/components/sankey/types.js.map +0 -1
  477. package/components/scatter/config.d.ts +0 -44
  478. package/components/scatter/config.js +0 -23
  479. package/components/scatter/config.js.map +0 -1
  480. package/components/scatter/index.d.ts +0 -28
  481. package/components/scatter/index.js +0 -167
  482. package/components/scatter/index.js.map +0 -1
  483. package/components/scatter/modules/point.d.ts +0 -7
  484. package/components/scatter/modules/point.js +0 -86
  485. package/components/scatter/modules/point.js.map +0 -1
  486. package/components/scatter/modules/utils.d.ts +0 -11
  487. package/components/scatter/modules/utils.js +0 -112
  488. package/components/scatter/modules/utils.js.map +0 -1
  489. package/components/scatter/style.d.ts +0 -5
  490. package/components/scatter/style.js.map +0 -1
  491. package/components/scatter/types.d.ts +0 -19
  492. package/components/stacked-bar/config.d.ts +0 -38
  493. package/components/stacked-bar/config.js +0 -20
  494. package/components/stacked-bar/config.js.map +0 -1
  495. package/components/stacked-bar/index.d.ts +0 -28
  496. package/components/stacked-bar/index.js +0 -208
  497. package/components/stacked-bar/index.js.map +0 -1
  498. package/components/stacked-bar/style.d.ts +0 -5
  499. package/components/stacked-bar/style.js.map +0 -1
  500. package/components/stacked-bar/types.d.ts +0 -5
  501. package/components/timeline/config.d.ts +0 -43
  502. package/components/timeline/config.js +0 -24
  503. package/components/timeline/config.js.map +0 -1
  504. package/components/timeline/index.d.ts +0 -41
  505. package/components/timeline/index.js +0 -244
  506. package/components/timeline/index.js.map +0 -1
  507. package/components/timeline/style.d.ts +0 -13
  508. package/components/timeline/style.js.map +0 -1
  509. package/components/tooltip/config.d.ts +0 -68
  510. package/components/tooltip/config.js +0 -20
  511. package/components/tooltip/config.js.map +0 -1
  512. package/components/tooltip/index.d.ts +0 -36
  513. package/components/tooltip/index.js +0 -184
  514. package/components/tooltip/index.js.map +0 -1
  515. package/components/tooltip/style.js.map +0 -1
  516. package/components/topojson-map/config.d.ts +0 -99
  517. package/components/topojson-map/config.js +0 -42
  518. package/components/topojson-map/config.js.map +0 -1
  519. package/components/topojson-map/index.d.ts +0 -52
  520. package/components/topojson-map/index.js +0 -355
  521. package/components/topojson-map/index.js.map +0 -1
  522. package/components/topojson-map/style.d.ts +0 -11
  523. package/components/topojson-map/style.js.map +0 -1
  524. package/components/topojson-map/types.d.ts +0 -78
  525. package/components/topojson-map/types.js +0 -80
  526. package/components/topojson-map/types.js.map +0 -1
  527. package/components/topojson-map/utils.d.ts +0 -3
  528. package/components/topojson-map/utils.js +0 -30
  529. package/components/topojson-map/utils.js.map +0 -1
  530. package/components/vis-controls/config.d.ts +0 -12
  531. package/components/vis-controls/config.js +0 -13
  532. package/components/vis-controls/config.js.map +0 -1
  533. package/components/vis-controls/index.d.ts +0 -14
  534. package/components/vis-controls/index.js +0 -52
  535. package/components/vis-controls/index.js.map +0 -1
  536. package/components/vis-controls/style.d.ts +0 -11
  537. package/components/vis-controls/style.js.map +0 -1
  538. package/components/vis-controls/types.d.ts +0 -13
  539. package/components/vis-controls/types.js +0 -8
  540. package/components/vis-controls/types.js.map +0 -1
  541. package/components/xy-labels/config.d.ts +0 -48
  542. package/components/xy-labels/config.js +0 -25
  543. package/components/xy-labels/config.js.map +0 -1
  544. package/components/xy-labels/index.d.ts +0 -15
  545. package/components/xy-labels/index.js +0 -87
  546. package/components/xy-labels/index.js.map +0 -1
  547. package/components/xy-labels/modules/label.d.ts +0 -9
  548. package/components/xy-labels/modules/label.js +0 -107
  549. package/components/xy-labels/modules/label.js.map +0 -1
  550. package/components/xy-labels/style.d.ts +0 -5
  551. package/components/xy-labels/style.js.map +0 -1
  552. package/components/xy-labels/types.d.ts +0 -23
  553. package/components/xy-labels/types.js +0 -9
  554. package/components/xy-labels/types.js.map +0 -1
  555. package/components.d.ts +0 -51
  556. package/components.js +0 -29
  557. package/components.js.map +0 -1
  558. package/containers/single-container/config.d.ts +0 -12
  559. package/containers/single-container/config.js +0 -12
  560. package/containers/single-container/config.js.map +0 -1
  561. package/containers/single-container/index.d.ts +0 -19
  562. package/containers/single-container/index.js +0 -128
  563. package/containers/single-container/index.js.map +0 -1
  564. package/containers/xy-container/config.d.ts +0 -99
  565. package/containers/xy-container/config.js +0 -30
  566. package/containers/xy-container/config.js.map +0 -1
  567. package/containers/xy-container/index.d.ts +0 -34
  568. package/containers/xy-container/index.js +0 -330
  569. package/containers/xy-container/index.js.map +0 -1
  570. package/containers.d.ts +0 -6
  571. package/containers.js +0 -4
  572. package/containers.js.map +0 -1
  573. package/core/component/config.d.ts +0 -58
  574. package/core/component/config.js +0 -14
  575. package/core/component/config.js.map +0 -1
  576. package/core/component/index.d.ts +0 -43
  577. package/core/component/index.js +0 -118
  578. package/core/component/index.js.map +0 -1
  579. package/core/component/types.d.ts +0 -2
  580. package/core/component/types.js +0 -2
  581. package/core/component/types.js.map +0 -1
  582. package/core/config/index.d.ts +0 -3
  583. package/core/config/index.js +0 -16
  584. package/core/config/index.js.map +0 -1
  585. package/core/container/config.d.ts +0 -48
  586. package/core/container/config.js +0 -29
  587. package/core/container/config.js.map +0 -1
  588. package/core/container/index.d.ts +0 -26
  589. package/core/container/index.js +0 -105
  590. package/core/container/index.js.map +0 -1
  591. package/core/xy-component/config.d.ts +0 -38
  592. package/core/xy-component/config.js +0 -20
  593. package/core/xy-component/config.js.map +0 -1
  594. package/core/xy-component/index.d.ts +0 -27
  595. package/core/xy-component/index.js +0 -74
  596. package/core/xy-component/index.js.map +0 -1
  597. package/data-models/core.d.ts +0 -6
  598. package/data-models/core.js +0 -14
  599. package/data-models/core.js.map +0 -1
  600. package/data-models/graph.d.ts +0 -24
  601. package/data-models/graph.js +0 -107
  602. package/data-models/graph.js.map +0 -1
  603. package/data-models/map-graph.d.ts +0 -21
  604. package/data-models/map-graph.js +0 -62
  605. package/data-models/map-graph.js.map +0 -1
  606. package/data-models/map.d.ts +0 -5
  607. package/data-models/map.js +0 -12
  608. package/data-models/map.js.map +0 -1
  609. package/data-models/series.d.ts +0 -6
  610. package/data-models/series.js +0 -19
  611. package/data-models/series.js.map +0 -1
  612. package/index.d.ts +0 -7
  613. package/index.js +0 -55
  614. package/index.js.map +0 -1
  615. package/maps/china-provinces.json.js +0 -140373
  616. package/maps/fr-regions.json.js +0 -14162
  617. package/maps/germany-regions.json.js +0 -35760
  618. package/maps/ind-regions.json.js +0 -290584
  619. package/maps/uk-regions.json.js +0 -96233
  620. package/maps/us-counties.json.js +0 -206318
  621. package/maps/us-states.json.js +0 -16345
  622. package/maps/world-110m-alpha.json.js +0 -251366
  623. package/maps/world-simple.json.js +0 -89428
  624. package/maps/world-simplest.json.js +0 -28175
  625. package/maps.d.ts +0 -60
  626. package/maps.js +0 -23
  627. package/styles/colors.d.ts +0 -7
  628. package/styles/colors.js +0 -24
  629. package/styles/colors.js.map +0 -1
  630. package/styles/index.d.ts +0 -7
  631. package/styles/index.js +0 -38
  632. package/styles/index.js.map +0 -1
  633. package/styles/sizes.d.ts +0 -2
  634. package/styles/sizes.js.map +0 -1
  635. package/types/accessor.d.ts +0 -5
  636. package/types/accessor.js +0 -2
  637. package/types/accessor.js.map +0 -1
  638. package/types/component.d.ts +0 -13
  639. package/types/component.js +0 -14
  640. package/types/component.js.map +0 -1
  641. package/types/curve.d.ts +0 -40
  642. package/types/curve.js +0 -46
  643. package/types/curve.js.map +0 -1
  644. package/types/data.d.ts +0 -7
  645. package/types/data.js +0 -2
  646. package/types/data.js.map +0 -1
  647. package/types/direction.d.ts +0 -6
  648. package/types/direction.js +0 -10
  649. package/types/direction.js.map +0 -1
  650. package/types/graph.d.ts +0 -35
  651. package/types/graph.js +0 -2
  652. package/types/graph.js.map +0 -1
  653. package/types/map.d.ts +0 -4
  654. package/types/map.js +0 -2
  655. package/types/map.js.map +0 -1
  656. package/types/misc.d.ts +0 -8
  657. package/types/position.d.ts +0 -20
  658. package/types/position.js +0 -27
  659. package/types/position.js.map +0 -1
  660. package/types/scale.d.ts +0 -23
  661. package/types/scale.js +0 -27
  662. package/types/scale.js.map +0 -1
  663. package/types/shape.d.ts +0 -7
  664. package/types/shape.js +0 -11
  665. package/types/shape.js.map +0 -1
  666. package/types/spacing.d.ts +0 -6
  667. package/types/spacing.js +0 -2
  668. package/types/spacing.js.map +0 -1
  669. package/types/svg.d.ts +0 -18
  670. package/types/svg.js +0 -22
  671. package/types/svg.js.map +0 -1
  672. package/types/symbol.d.ts +0 -18
  673. package/types/symbol.js +0 -24
  674. package/types/symbol.js.map +0 -1
  675. package/types/text.d.ts +0 -47
  676. package/types/text.js +0 -26
  677. package/types/text.js.map +0 -1
  678. package/types.d.ts +0 -27
  679. package/types.js +0 -30
  680. package/types.js.map +0 -1
  681. package/utils/color.d.ts +0 -10
  682. package/utils/color.js +0 -32
  683. package/utils/color.js.map +0 -1
  684. package/utils/d3.d.ts +0 -3
  685. package/utils/d3.js +0 -16
  686. package/utils/d3.js.map +0 -1
  687. package/utils/data.d.ts +0 -45
  688. package/utils/data.js +0 -274
  689. package/utils/data.js.map +0 -1
  690. package/utils/html.d.ts +0 -1
  691. package/utils/html.js +0 -16
  692. package/utils/html.js.map +0 -1
  693. package/utils/map.d.ts +0 -2
  694. package/utils/map.js +0 -20
  695. package/utils/map.js.map +0 -1
  696. package/utils/misc.d.ts +0 -9
  697. package/utils/misc.js +0 -47
  698. package/utils/misc.js.map +0 -1
  699. package/utils/path.d.ts +0 -23
  700. package/utils/path.js +0 -144
  701. package/utils/path.js.map +0 -1
  702. package/utils/scale.d.ts +0 -1
  703. package/utils/style.d.ts +0 -6
  704. package/utils/style.js +0 -24
  705. package/utils/style.js.map +0 -1
  706. package/utils/svg.d.ts +0 -3
  707. package/utils/text.d.ts +0 -139
  708. package/utils/text.js +0 -443
  709. package/utils/text.js.map +0 -1
  710. package/utils/type.d.ts +0 -5
@@ -1,162 +0,0 @@
1
- import { select } from 'd3-selection';
2
- import { color } from 'd3-color';
3
- import { smartTransition } from '../../../utils/d3.js';
4
- import { trimStringMiddle, estimateTextSize } from '../../../utils/text.js';
5
- import { getString, clamp } from '../../../utils/data.js';
6
- import { getCSSVariableValueInPixels, rectIntersect } from '../../../utils/misc.js';
7
- import { hexToBrightness } from '../../../utils/color.js';
8
- import { cssvar } from '../../../utils/style.js';
9
- import { getPointPos } from './utils.js';
10
- import { LeafletMapPointShape } from '../types.js';
11
- import { updateDonut } from './donut.js';
12
- import { pointPath, donutCluster, innerLabel, innerLabelCluster, bottomLabel, pointPathCluster, pointPathRing, variables } from '../style.js';
13
-
14
- const BOTTOM_LABEL_TOP_MARGIN = 10;
15
- function createNodes(selection) {
16
- selection.append('path')
17
- .attr('class', pointPath)
18
- .attr('id', d => `point-${d.id}`)
19
- .style('opacity', 0);
20
- selection.append('g')
21
- .attr('class', donutCluster);
22
- selection.append('text')
23
- .attr('class', innerLabel)
24
- .classed(innerLabelCluster, d => d.properties.cluster)
25
- .attr('id', d => `label-${d.id}`)
26
- .attr('dy', '0.32em');
27
- selection.append('text')
28
- .attr('class', bottomLabel)
29
- .attr('dy', '0.32em')
30
- .attr('opacity', 1);
31
- }
32
- function updateNodes(selection, config, leafletMap, mapMoveZoomUpdateOnly) {
33
- selection.each((d, i, elements) => {
34
- var _a, _b, _c;
35
- const group = select(elements[i]);
36
- const node = group.select(`.${pointPath}`);
37
- const innerLabel$1 = group.select(`.${innerLabel}`);
38
- const bottomLabel$1 = group.select(`.${bottomLabel}`);
39
- const { x, y } = getPointPos(d, leafletMap);
40
- const donutData = d.donutData;
41
- const isCluster = d.properties.cluster;
42
- const fromExpandedCluster = !!d.properties.expandedClusterPoint;
43
- const innerLabelText = (_a = (isCluster
44
- ? getString(d.properties, config.clusterLabel)
45
- : getString(d.properties, config.pointLabel))) !== null && _a !== void 0 ? _a : '';
46
- const innerLabelColor = (_b = (isCluster
47
- ? getString(d.properties, config.clusterLabelColor)
48
- : getString(d.properties, config.pointLabelColor))) !== null && _b !== void 0 ? _b : null;
49
- const bottomLabelText = (_c = (isCluster
50
- ? getString(d.properties, config.clusterBottomLabel)
51
- : getString(d.properties, config.pointBottomLabel))) !== null && _c !== void 0 ? _c : '';
52
- const pointCursor = getString(d.properties, config.pointCursor);
53
- const pointShape = getString(d.properties, config.pointShape);
54
- const isRing = pointShape === LeafletMapPointShape.Ring;
55
- const isCircular = (pointShape === LeafletMapPointShape.Circle) || isRing || isCluster || !pointShape;
56
- // To get updated on every render call
57
- const ringWidth = (isCluster && config.clusterRingWidth) || (isRing && config.pointRingWidth) || 0;
58
- group.attr('transform', `translate(${x},${y})`);
59
- group.select(`.${donutCluster}`)
60
- .call(updateDonut, donutData, isCircular ? d.radius : 0, ringWidth);
61
- node.attr('d', d.path);
62
- node.style('cursor', isCluster ? 'pointer' : pointCursor);
63
- bottomLabel$1.attr('transform', `translate(0,${d.radius + BOTTOM_LABEL_TOP_MARGIN})`);
64
- innerLabel$1.attr('font-size', () => {
65
- const fontSize = d.radius / Math.pow(innerLabelText.length, 0.4);
66
- return clamp(fontSize, fontSize, 16);
67
- });
68
- if (mapMoveZoomUpdateOnly)
69
- return;
70
- // Updates required only when data changes
71
- node
72
- .classed(pointPathCluster, isCluster)
73
- .classed(pointPathRing, isRing)
74
- .style('fill', d.color)
75
- .style('stroke', d.color) // being used for hover
76
- .style('stroke-width', ringWidth)
77
- .style('opacity', 1);
78
- innerLabel$1
79
- .text(innerLabelText || null)
80
- .attr('visibility', innerLabelText ? null : 'hidden')
81
- .style('fill', () => {
82
- var _a;
83
- if (innerLabelColor)
84
- return innerLabelColor;
85
- // Determine the label color based on the point brightness
86
- const c = getComputedStyle(node.node()).fill;
87
- const hex = (_a = color(c)) === null || _a === void 0 ? void 0 : _a.hex();
88
- if (!hex)
89
- return null;
90
- const brightness = hexToBrightness(hex);
91
- return brightness > 0.5
92
- ? (isCluster ? cssvar(variables.mapClusterInnerLabelTextColorDark) : cssvar(variables.mapPointInnerLabelTextColorDark))
93
- : (isCluster ? cssvar(variables.mapClusterInnerLabelTextColorLight) : cssvar(variables.mapPointInnerLabelTextColorLight));
94
- });
95
- const bottomLabelTextTrimmed = trimStringMiddle(bottomLabelText, 15);
96
- bottomLabel$1
97
- .text(bottomLabelTextTrimmed)
98
- .attr('font-size', getCSSVariableValueInPixels(cssvar(variables.mapPointBottomLabelFontSize), selection.node()))
99
- .attr('visibility', fromExpandedCluster ? 'hidden' : null);
100
- });
101
- }
102
- function collideLabels(selection, leafletMap) {
103
- selection.each((datum1, i, elements) => {
104
- const group1HTMLNode = elements[i];
105
- const group1 = select(group1HTMLNode);
106
- const label1 = group1.select(`.${bottomLabel}`);
107
- // eslint-disable-next-line dot-notation
108
- group1HTMLNode['labelVisible'] = true;
109
- // Calculate bounding rect of point's bottom label
110
- const bottomLabelFontSizePx = getCSSVariableValueInPixels(cssvar(variables.mapPointBottomLabelFontSize), selection.node());
111
- const p1Pos = getPointPos(datum1, leafletMap);
112
- const label1Size = estimateTextSize(label1, bottomLabelFontSizePx, 0.32, true, 0.6);
113
- const label1BoundingRect = {
114
- x: p1Pos.x - label1Size.width / 2,
115
- y: p1Pos.y - label1Size.height / 2 + datum1.radius + BOTTOM_LABEL_TOP_MARGIN,
116
- width: label1Size.width,
117
- height: label1Size.height,
118
- };
119
- for (let j = 0; j < elements.length; j += 1) {
120
- if (i === j)
121
- continue;
122
- const group2HTMLNode = elements[j];
123
- const group2 = select(group2HTMLNode);
124
- const label2 = group2.select(`.${bottomLabel}`);
125
- const datum2 = group2.datum();
126
- // Calculate bounding rect of the second point's circle
127
- const p2Pos = getPointPos(datum2, leafletMap);
128
- const point2BoundingRect = {
129
- x: p2Pos.x - datum2.radius,
130
- y: p2Pos.y - datum2.radius,
131
- width: 2 * datum2.radius,
132
- height: 2 * datum2.radius,
133
- };
134
- let intersect = rectIntersect(label1BoundingRect, point2BoundingRect);
135
- // If there's not intersection, check a collision with the second point's label
136
- // eslint-disable-next-line dot-notation
137
- const label2Visible = group2HTMLNode['labelVisible'];
138
- if (!intersect && label2Visible) {
139
- const label2Size = estimateTextSize(label2, bottomLabelFontSizePx, 0.32, true, 0.6);
140
- intersect = rectIntersect(label1BoundingRect, {
141
- x: p2Pos.x - label2Size.width / 2,
142
- y: p2Pos.y + datum2.radius + BOTTOM_LABEL_TOP_MARGIN - label2Size.height / 2,
143
- width: label2Size.width,
144
- height: label2Size.height,
145
- });
146
- }
147
- if (intersect) {
148
- // eslint-disable-next-line dot-notation
149
- group1HTMLNode['labelVisible'] = false;
150
- break;
151
- }
152
- }
153
- // eslint-disable-next-line dot-notation
154
- smartTransition(label1, 0).attr('opacity', group1HTMLNode['labelVisible'] ? 1 : 0);
155
- });
156
- }
157
- function removeNodes(selection) {
158
- selection.remove();
159
- }
160
-
161
- export { collideLabels, createNodes, removeNodes, updateNodes };
162
- //# sourceMappingURL=node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node.js","sources":["../../../../src/components/leaflet-map/modules/node.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\nimport { color } from 'd3-color'\nimport type L from 'leaflet'\n\n// Types\nimport { Rect } from 'types/misc'\nimport { GenericDataRecord } from 'types/data'\n\n// Utils\nimport { smartTransition } from 'utils/d3'\nimport { estimateTextSize, trimStringMiddle } from 'utils/text'\nimport { clamp, getString } from 'utils/data'\nimport { getCSSVariableValueInPixels, rectIntersect } from 'utils/misc'\nimport { hexToBrightness } from 'utils/color'\nimport { cssvar } from 'utils/style'\nimport { getPointPos } from './utils'\n\n\n// Local Types\nimport { LeafletMapPointDatum, LeafletMapClusterDatum, LeafletMapPoint, LeafletMapPointShape } from '../types'\n\n// Modules\nimport { updateDonut } from './donut'\n\n// Config\nimport { LeafletMapConfigInterface } from '../config'\n\nimport * as s from '../style'\n\nconst BOTTOM_LABEL_TOP_MARGIN = 10\n\nexport function createNodes<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>\n): void {\n selection.append('path')\n .attr('class', s.pointPath)\n .attr('id', d => `point-${d.id}`)\n .style('opacity', 0)\n\n selection.append('g')\n .attr('class', s.donutCluster)\n\n selection.append('text')\n .attr('class', s.innerLabel)\n .classed(s.innerLabelCluster, d => (d.properties as LeafletMapClusterDatum<D>).cluster)\n .attr('id', d => `label-${d.id}`)\n .attr('dy', '0.32em')\n\n selection.append('text')\n .attr('class', s.bottomLabel)\n .attr('dy', '0.32em')\n .attr('opacity', 1)\n}\n\nexport function updateNodes<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>,\n config: LeafletMapConfigInterface<D>,\n leafletMap: L.Map,\n mapMoveZoomUpdateOnly: boolean\n): void {\n selection.each((d, i, elements) => {\n const group = select(elements[i])\n const node: Selection<SVGPathElement, any, SVGGElement, any> = group.select(`.${s.pointPath}`)\n const innerLabel: Selection<SVGTextElement, any, SVGElement, any> = group.select(`.${s.innerLabel}`)\n const bottomLabel: Selection<SVGTextElement, any, SVGElement, any> = group.select(`.${s.bottomLabel}`)\n\n const { x, y } = getPointPos(d, leafletMap)\n const donutData = d.donutData\n const isCluster = (d.properties as LeafletMapClusterDatum<D>).cluster\n const fromExpandedCluster = !!(d.properties as LeafletMapPointDatum<D>).expandedClusterPoint\n\n const innerLabelText = (isCluster\n ? getString(d.properties as LeafletMapClusterDatum<D>, config.clusterLabel)\n : getString(d.properties as LeafletMapPointDatum<D>, config.pointLabel)\n ) ?? ''\n const innerLabelColor = (isCluster\n ? getString(d.properties as LeafletMapClusterDatum<D>, config.clusterLabelColor)\n : getString(d.properties as LeafletMapPointDatum<D>, config.pointLabelColor)\n ) ?? null\n const bottomLabelText = (isCluster\n ? getString(d.properties as LeafletMapClusterDatum<D>, config.clusterBottomLabel)\n : getString(d.properties as LeafletMapPointDatum<D>, config.pointBottomLabel)\n ) ?? ''\n const pointCursor = getString(d.properties as LeafletMapPointDatum<D>, config.pointCursor)\n const pointShape = getString(d.properties as LeafletMapPointDatum<D>, config.pointShape)\n const isRing = pointShape === LeafletMapPointShape.Ring\n const isCircular = (pointShape === LeafletMapPointShape.Circle) || isRing || isCluster || !pointShape\n\n // To get updated on every render call\n const ringWidth = (isCluster && config.clusterRingWidth) || (isRing && config.pointRingWidth) || 0\n group.attr('transform', `translate(${x},${y})`)\n group.select<SVGGElement>(`.${s.donutCluster}`)\n .call(updateDonut, donutData, isCircular ? d.radius : 0, ringWidth)\n\n node.attr('d', d.path)\n node.style('cursor', isCluster ? 'pointer' : pointCursor)\n bottomLabel.attr('transform', `translate(0,${d.radius + BOTTOM_LABEL_TOP_MARGIN})`)\n innerLabel.attr('font-size', () => {\n const fontSize = d.radius / Math.pow(innerLabelText.length, 0.4)\n return clamp(fontSize, fontSize, 16)\n })\n\n if (mapMoveZoomUpdateOnly) return\n\n // Updates required only when data changes\n node\n .classed(s.pointPathCluster, isCluster)\n .classed(s.pointPathRing, isRing)\n .style('fill', d.color)\n .style('stroke', d.color) // being used for hover\n .style('stroke-width', ringWidth)\n .style('opacity', 1)\n\n innerLabel\n .text(innerLabelText || null)\n .attr('visibility', innerLabelText ? null : 'hidden')\n .style('fill', () => {\n if (innerLabelColor) return innerLabelColor\n\n // Determine the label color based on the point brightness\n const c = getComputedStyle(node.node()).fill\n const hex = color(c)?.hex()\n if (!hex) return null\n\n const brightness = hexToBrightness(hex)\n return brightness > 0.5\n ? (isCluster ? cssvar(s.variables.mapClusterInnerLabelTextColorDark) : cssvar(s.variables.mapPointInnerLabelTextColorDark))\n : (isCluster ? cssvar(s.variables.mapClusterInnerLabelTextColorLight) : cssvar(s.variables.mapPointInnerLabelTextColorLight))\n })\n\n const bottomLabelTextTrimmed = trimStringMiddle(bottomLabelText, 15)\n bottomLabel\n .text(bottomLabelTextTrimmed)\n .attr('font-size', getCSSVariableValueInPixels(cssvar(s.variables.mapPointBottomLabelFontSize), selection.node()))\n .attr('visibility', fromExpandedCluster ? 'hidden' : null)\n })\n}\n\nexport function collideLabels<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>,\n leafletMap: L.Map\n): void {\n selection.each((datum1: LeafletMapPoint<D>, i, elements) => {\n const group1HTMLNode = elements[i]\n const group1 = select(group1HTMLNode)\n const label1: Selection<SVGTextElement, any, SVGElement, any> = group1.select(`.${s.bottomLabel}`)\n // eslint-disable-next-line dot-notation\n group1HTMLNode['labelVisible'] = true\n\n // Calculate bounding rect of point's bottom label\n const bottomLabelFontSizePx = getCSSVariableValueInPixels(cssvar(s.variables.mapPointBottomLabelFontSize), selection.node())\n const p1Pos = getPointPos(datum1, leafletMap)\n const label1Size = estimateTextSize(label1, bottomLabelFontSizePx, 0.32, true, 0.6)\n const label1BoundingRect: Rect = {\n x: p1Pos.x - label1Size.width / 2,\n y: p1Pos.y - label1Size.height / 2 + datum1.radius + BOTTOM_LABEL_TOP_MARGIN,\n width: label1Size.width,\n height: label1Size.height,\n }\n\n for (let j = 0; j < elements.length; j += 1) {\n if (i === j) continue\n const group2HTMLNode = elements[j]\n const group2 = select(group2HTMLNode)\n const label2: Selection<SVGTextElement, any, SVGElement, any> = group2.select(`.${s.bottomLabel}`)\n const datum2 = group2.datum() as LeafletMapPoint<D>\n\n // Calculate bounding rect of the second point's circle\n const p2Pos = getPointPos(datum2, leafletMap)\n const point2BoundingRect = {\n x: p2Pos.x - datum2.radius,\n y: p2Pos.y - datum2.radius,\n width: 2 * datum2.radius,\n height: 2 * datum2.radius,\n }\n\n let intersect = rectIntersect(label1BoundingRect, point2BoundingRect)\n\n // If there's not intersection, check a collision with the second point's label\n // eslint-disable-next-line dot-notation\n const label2Visible = group2HTMLNode['labelVisible']\n if (!intersect && label2Visible) {\n const label2Size = estimateTextSize(label2, bottomLabelFontSizePx, 0.32, true, 0.6)\n intersect = rectIntersect(label1BoundingRect, {\n x: p2Pos.x - label2Size.width / 2,\n y: p2Pos.y + datum2.radius + BOTTOM_LABEL_TOP_MARGIN - label2Size.height / 2,\n width: label2Size.width,\n height: label2Size.height,\n })\n }\n\n if (intersect) {\n // eslint-disable-next-line dot-notation\n group1HTMLNode['labelVisible'] = false\n break\n }\n }\n\n // eslint-disable-next-line dot-notation\n smartTransition(label1, 0).attr('opacity', group1HTMLNode['labelVisible'] ? 1 : 0)\n })\n}\n\nexport function removeNodes<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>\n): void {\n selection.remove()\n}\n"],"names":["s.pointPath","s.donutCluster","s.innerLabel","s.innerLabelCluster","s.bottomLabel","innerLabel","bottomLabel","s.pointPathCluster","s.pointPathRing","s.variables"],"mappings":";;;;;;;;;;;;;AA6BA,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAE5B,SAAU,WAAW,CACzB,SAA2E,EAAA;AAE3E,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB,SAAA,IAAI,CAAC,OAAO,EAAEA,SAAW,CAAC;AAC1B,SAAA,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAA,MAAA,EAAS,CAAC,CAAC,EAAE,CAAA,CAAE,CAAC;AAChC,SAAA,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;AAEtB,IAAA,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC;AAClB,SAAA,IAAI,CAAC,OAAO,EAAEC,YAAc,CAAC,CAAA;AAEhC,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB,SAAA,IAAI,CAAC,OAAO,EAAEC,UAAY,CAAC;AAC3B,SAAA,OAAO,CAACC,iBAAmB,EAAE,CAAC,IAAK,CAAC,CAAC,UAAwC,CAAC,OAAO,CAAC;AACtF,SAAA,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAA,MAAA,EAAS,CAAC,CAAC,EAAE,CAAA,CAAE,CAAC;AAChC,SAAA,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AAEvB,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB,SAAA,IAAI,CAAC,OAAO,EAAEC,WAAa,CAAC;AAC5B,SAAA,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AACpB,SAAA,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;AACvB,CAAC;AAEK,SAAU,WAAW,CACzB,SAA2E,EAC3E,MAAoC,EACpC,UAA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,CAAC;AAEK,SAAU,WAAW,CACzB,SAA2E,EAAA;IAE3E,SAAS,CAAC,MAAM,EAAE,CAAA;AACpB;;;;"}
@@ -1,7 +0,0 @@
1
- import type L from 'leaflet';
2
- import { Selection } from 'd3-selection';
3
- import { GenericDataRecord } from "../../../types/data";
4
- import { LeafletMapPoint } from '../types';
5
- import { LeafletMapConfigInterface } from '../config';
6
- export declare function createNodeSelectionRing(selection: Selection<SVGGElement, unknown, SVGElement, undefined>): void;
7
- export declare function updateNodeSelectionRing<D extends GenericDataRecord>(selection: Selection<SVGGElement, unknown, SVGElement, undefined>, selectedPoint: LeafletMapPoint<D>, pointData: LeafletMapPoint<D>[], config: LeafletMapConfigInterface<D>, leafletMap: L.Map): void;
@@ -1,41 +0,0 @@
1
- import { getString } from '../../../utils/data.js';
2
- import { getPointPos } from './utils.js';
3
- import { pointSelection, pointSelectionRing } from '../style.js';
4
-
5
- // Utils
6
- function createNodeSelectionRing(selection) {
7
- selection.datum({ _zIndex: 3 });
8
- selection.append('path').attr('class', pointSelection);
9
- }
10
- function updateNodeSelectionRing(selection, selectedPoint, pointData, config, leafletMap) {
11
- selection.attr('class', pointSelectionRing);
12
- const pointSelection$1 = selection.select(`.${pointSelection}`);
13
- if (selectedPoint) {
14
- const isCluster = selectedPoint.isCluster;
15
- const selectedPointId = getString(selectedPoint.properties, config.pointId);
16
- const foundPoint = pointData.find(d => isCluster
17
- ? (d.id === selectedPoint.id)
18
- : (selectedPointId && (getString(d.properties, config.pointId) === selectedPointId)));
19
- selection
20
- .attr('transform', d => {
21
- const { x, y } = getPointPos(foundPoint !== null && foundPoint !== void 0 ? foundPoint : selectedPoint, leafletMap);
22
- return `translate(${x},${y})`;
23
- })
24
- .classed(`${selectedPoint.properties.shape}`, true);
25
- pointSelection$1
26
- .classed('active', Boolean(foundPoint))
27
- .attr('d', foundPoint ? foundPoint.path : null)
28
- .style('fill', 'transparent')
29
- .style('stroke-width', 1)
30
- .style('stroke', d => {
31
- const node = foundPoint || selectedPoint;
32
- return node === null || node === void 0 ? void 0 : node.color;
33
- });
34
- }
35
- else {
36
- pointSelection$1.classed('active', false);
37
- }
38
- }
39
-
40
- export { createNodeSelectionRing, updateNodeSelectionRing };
41
- //# sourceMappingURL=selectionRing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selectionRing.js","sources":["../../../../src/components/leaflet-map/modules/selectionRing.ts"],"sourcesContent":["import type L from 'leaflet'\nimport { Selection } from 'd3-selection'\n\n// Types\nimport { GenericDataRecord } from 'types/data'\n\n// Utils\nimport { getString } from 'utils/data'\nimport { getPointPos } from './utils'\n\n// Local Types\nimport { LeafletMapPoint, LeafletMapPointDatum } from '../types'\n\n// Config\nimport { LeafletMapConfigInterface } from '../config'\n\nimport * as s from '../style'\n\n\nexport function createNodeSelectionRing (\n selection: Selection<SVGGElement, unknown, SVGElement, undefined>\n): void {\n selection.datum({ _zIndex: 3 })\n selection.append('path').attr('class', s.pointSelection)\n}\n\nexport function updateNodeSelectionRing<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, unknown, SVGElement, undefined>,\n selectedPoint: LeafletMapPoint<D>,\n pointData: LeafletMapPoint<D>[],\n config: LeafletMapConfigInterface<D>,\n leafletMap: L.Map\n): void {\n selection.attr('class', s.pointSelectionRing)\n const pointSelection = selection.select(`.${s.pointSelection}`)\n if (selectedPoint) {\n const isCluster = selectedPoint.isCluster\n const selectedPointId: string | undefined = getString(selectedPoint.properties as LeafletMapPointDatum<D>, config.pointId)\n const foundPoint = pointData.find(d =>\n isCluster\n ? (d.id === selectedPoint.id)\n : (selectedPointId && (getString(d.properties as LeafletMapPointDatum<D>, config.pointId) === selectedPointId))\n )\n selection\n .attr('transform', d => {\n const { x, y } = getPointPos<D>(foundPoint ?? selectedPoint, leafletMap)\n return `translate(${x},${y})`\n })\n .classed(`${(selectedPoint.properties as LeafletMapPointDatum<D>).shape}`, true)\n\n pointSelection\n .classed('active', Boolean(foundPoint))\n .attr('d', foundPoint ? foundPoint.path : null)\n .style('fill', 'transparent')\n .style('stroke-width', 1)\n .style('stroke', d => {\n const node = foundPoint || selectedPoint\n return node?.color\n })\n } else {\n pointSelection.classed('active', false)\n }\n}\n"],"names":["s.pointSelection","s.pointSelectionRing","pointSelection"],"mappings":";;;;AAMA;AAaM,SAAU,uBAAuB,CACrC,SAAiE,EAAA;IAEjE,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAA;AAC/B,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,EAAEA,cAAgB,CAAC,CAAA;AAC1D,CAAC;AAEK,SAAU,uBAAuB,CACrC,SAAiE,EACjE,aAAiC,EACjC,SAA+B,EAC/B,MAAoC,EACpC,UAAiB,EAAA;IAEjB,SAAS,CAAC,IAAI,CAAC,OAAO,EAAEC,kBAAoB,CAAC,CAAA;AAC7C,IAAA,MAAMC,gBAAc,GAAG,SAAS,CAAC,MAAM,CAAC,CAAI,CAAA,EAAAF,cAAgB,CAAE,CAAA,CAAC,CAAA;AAC/D,IAAA,IAAI,aAAa,EAAE;AACjB,QAAA,MAAM,SAAS,GAAG,aAAa,CAAC,SAAS,CAAA;AACzC,QAAA,MAAM,eAAe,GAAuB,SAAS,CAAC,aAAa,CAAC,UAAqC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;QAC1H,MAAM,UAAU,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,IACjC,SAAS;eACJ,CAAC,CAAC,EAAE,KAAK,aAAa,CAAC,EAAE;eACzB,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,UAAqC,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,eAAe,CAAC,CAAC,CAClH,CAAA;QACD,SAAS;AACN,aAAA,IAAI,CAAC,WAAW,EAAE,CAAC,IAAG;AACrB,YAAA,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,WAAW,CAAI,UAAU,KAAV,IAAA,IAAA,UAAU,cAAV,UAAU,GAAI,aAAa,EAAE,UAAU,CAAC,CAAA;AACxE,YAAA,OAAO,CAAa,UAAA,EAAA,CAAC,CAAI,CAAA,EAAA,CAAC,GAAG,CAAA;AAC/B,SAAC,CAAC;aACD,OAAO,CAAC,CAAI,EAAA,aAAa,CAAC,UAAsC,CAAC,KAAK,CAAE,CAAA,EAAE,IAAI,CAAC,CAAA;QAElFE,gBAAc;AACX,aAAA,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;AACtC,aAAA,IAAI,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;AAC9C,aAAA,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC;AAC5B,aAAA,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC;AACxB,aAAA,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAG;AACnB,YAAA,MAAM,IAAI,GAAG,UAAU,IAAI,aAAa,CAAA;AACxC,YAAA,OAAO,IAAI,KAAJ,IAAA,IAAA,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAA;AACpB,SAAC,CAAC,CAAA;AACL,KAAA;AAAM,SAAA;AACL,QAAAA,gBAAc,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;AACxC,KAAA;AACH;;;;"}
@@ -1,50 +0,0 @@
1
- import type L from 'leaflet';
2
- import Supercluster, { ClusterFeature, PointFeature } from 'supercluster';
3
- import { NumericAccessor, StringAccessor } from "../../../types/accessor";
4
- import { GenericDataRecord } from "../../../types/data";
5
- import { LeafletMapPoint, LeafletMapPointShape, LeafletMapPieDatum, LeafletMapPointStyles, PointExpandedClusterProperties, LeafletMapPointDatum, LeafletMapClusterDatum } from '../types';
6
- import { LeafletMapConfig } from '../config';
7
- export declare function bBoxMerge(bBoxArray: ({
8
- x1: number;
9
- x2: number;
10
- y1: number;
11
- y2: number;
12
- })[]): {
13
- x: number;
14
- y: number;
15
- width: number;
16
- height: number;
17
- };
18
- export declare const getNextZoomLevelOnClusterClick: (level: number) => number;
19
- export declare function projectPoint<D extends GenericDataRecord>(geoJSONPoint: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, leafletMap: L.Map): {
20
- x: number;
21
- y: number;
22
- };
23
- export declare function getPointRadius<D extends GenericDataRecord>(geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>> | PointFeature<PointExpandedClusterProperties<D>>, pointRadius: NumericAccessor<D>, zoomLevel: number): number;
24
- export declare function getPointPos<D extends GenericDataRecord>(point: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, leafletMap: L.Map): {
25
- x: number;
26
- y: number;
27
- };
28
- export declare function getPointDisplayOrder<D extends GenericDataRecord>(d: LeafletMapPoint<D>, pointStatus: StringAccessor<LeafletMapPointDatum<D> | LeafletMapClusterDatum<D>>, colorMap: LeafletMapPointStyles<D>): number;
29
- export declare function toGeoJSONPoint<D extends GenericDataRecord>(d: D, pointLatitude: NumericAccessor<D>, pointLongitude: NumericAccessor<D>): PointFeature<D>;
30
- export declare function calculateClusterIndex<D extends GenericDataRecord>(data: D[], config: LeafletMapConfig<D>, maxClusterZoomLevel?: number): Supercluster<D>;
31
- export declare function getNodePathData({ x, y }: {
32
- x: number;
33
- y: number;
34
- }, radius: number, shape: LeafletMapPointShape): string;
35
- export declare function getDonutData<D extends GenericDataRecord>(d: LeafletMapClusterDatum<D> | LeafletMapPointDatum<D>, colorMap: LeafletMapPointStyles<D>): LeafletMapPieDatum[];
36
- export declare function geoJsonPointToScreenPoint<D extends GenericDataRecord>(geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, i: number, leafletMap: L.Map, config: LeafletMapConfig<D>): LeafletMapPoint<D>;
37
- export declare function shouldClusterExpand<D extends GenericDataRecord>(cluster: LeafletMapPoint<D>, zoomLevel: number, midLevel?: number, maxLevel?: number, maxClusterZoomLevel?: number): boolean;
38
- export declare function findPointAndClusterByPointId<D extends GenericDataRecord>(points: LeafletMapPoint<D>[], id: string, pointId: StringAccessor<D>): {
39
- point: PointFeature<D> | undefined;
40
- cluster: LeafletMapPoint<D> | undefined;
41
- };
42
- export declare function getNodeRelativePosition<D extends GenericDataRecord>(d: LeafletMapPoint<D>, leafletMap: L.Map): {
43
- x: number;
44
- y: number;
45
- };
46
- export declare function getClusterRadius<D extends GenericDataRecord>(cluster: {
47
- points: PointFeature<PointExpandedClusterProperties<D>>[];
48
- cluster: LeafletMapPoint<D>;
49
- }): number;
50
- export declare function getClustersAndPoints<D extends GenericDataRecord>(clusterIndex: Supercluster<D>, leafletMap: L.Map, customBounds?: [number, number, number, number]): (ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<D>)[];
@@ -1,210 +0,0 @@
1
- import { max, min } from 'd3-array';
2
- import Supercluster from 'supercluster';
3
- import { clamp, getNumber, getString } from '../../../utils/data.js';
4
- import { getColor } from '../../../utils/color.js';
5
- import { circlePath, polygon } from '../../../utils/path.js';
6
- import { getHTMLTransform } from '../../../utils/html.js';
7
- import { LeafletMapPointShape } from '../types.js';
8
-
9
- function bBoxMerge(bBoxArray) {
10
- let box = { x1: 0, x2: 0, y1: 0, y2: 0 };
11
- bBoxArray.forEach(coords => {
12
- if (!box) {
13
- box = Object.assign({}, coords);
14
- }
15
- else {
16
- if (box.x1 > coords.x1)
17
- box.x1 = coords.x1;
18
- if (box.y1 > coords.y1)
19
- box.y1 = coords.y1;
20
- if (box.x2 < coords.x2)
21
- box.x2 = coords.x2;
22
- if (box.y2 < coords.y2)
23
- box.y2 = coords.y2;
24
- }
25
- });
26
- return {
27
- x: box.x1,
28
- y: box.y1,
29
- width: box.x2 - box.x1,
30
- height: box.y2 - box.y1,
31
- };
32
- }
33
- const getNextZoomLevelOnClusterClick = (level) => clamp(1 + level * 1.5, level, 12);
34
- function projectPoint(geoJSONPoint, leafletMap) {
35
- const lat = geoJSONPoint.geometry.coordinates[1];
36
- const lon = geoJSONPoint.geometry.coordinates[0];
37
- const projected = leafletMap.latLngToLayerPoint([lat, lon]);
38
- return projected;
39
- }
40
- function getPointRadius(geoPoint, pointRadius, zoomLevel) {
41
- const isDynamic = !pointRadius;
42
- const radius = isDynamic ? 1 + 2 * Math.pow(zoomLevel, 0.80) : getNumber(geoPoint.properties, pointRadius);
43
- const isCluster = geoPoint.properties.cluster;
44
- return (isCluster && isDynamic)
45
- ? clamp(Math.pow(geoPoint.properties.point_count, 0.35) * radius, radius * 1.1, radius * 3)
46
- : radius;
47
- }
48
- function getPointPos(point, leafletMap) {
49
- const properties = point.properties;
50
- const isFromCluster = !!(properties).expandedClusterPoint;
51
- if (isFromCluster) {
52
- const { x, y } = projectPoint(properties.expandedClusterPoint, leafletMap);
53
- return {
54
- x: x + properties.dx,
55
- y: y + properties.dy,
56
- };
57
- }
58
- else {
59
- return projectPoint(point, leafletMap);
60
- }
61
- }
62
- function getPointDisplayOrder(d, pointStatus, colorMap) {
63
- const status = getString(d.properties, pointStatus);
64
- const statusList = Object.keys(colorMap);
65
- return Object.keys(statusList).indexOf(status);
66
- }
67
- function toGeoJSONPoint(d, pointLatitude, pointLongitude) {
68
- const lat = getNumber(d, pointLatitude);
69
- const lon = getNumber(d, pointLongitude);
70
- return {
71
- type: 'Feature',
72
- properties: Object.assign({}, d),
73
- geometry: {
74
- type: 'Point',
75
- coordinates: [lon, lat],
76
- },
77
- };
78
- }
79
- function calculateClusterIndex(data, config, maxClusterZoomLevel = 23) {
80
- const { colorMap, pointShape, pointLatitude, pointLongitude, clusteringDistance } = config;
81
- return new Supercluster({
82
- radius: clusteringDistance,
83
- maxZoom: maxClusterZoomLevel,
84
- map: (d) => {
85
- const shape = getString(d, pointShape);
86
- const clusterPoint = { shape };
87
- for (const key of Object.keys(colorMap)) {
88
- clusterPoint[key] = d[key] || 0;
89
- }
90
- return clusterPoint;
91
- },
92
- reduce: (acc, clusterPoint) => {
93
- var _a, _b;
94
- acc.shape = acc.shape === clusterPoint.shape ? acc.shape : LeafletMapPointShape.Circle;
95
- acc.value = ((_a = acc.value) !== null && _a !== void 0 ? _a : 0) + ((_b = clusterPoint.value) !== null && _b !== void 0 ? _b : 0);
96
- for (const key of Object.keys(colorMap)) {
97
- acc[key] += clusterPoint[key];
98
- }
99
- },
100
- }).load(data.map(d => toGeoJSONPoint(d, pointLatitude, pointLongitude)));
101
- }
102
- function getNodePathData({ x, y }, radius, shape) {
103
- switch (shape) {
104
- case LeafletMapPointShape.Triangle:
105
- return polygon(radius * 2, 3);
106
- case LeafletMapPointShape.Square:
107
- return polygon(radius * 2, 4);
108
- case LeafletMapPointShape.Circle:
109
- case LeafletMapPointShape.Ring:
110
- default:
111
- return circlePath(x, y, radius);
112
- }
113
- }
114
- function getDonutData(d, colorMap) {
115
- return Object.keys(colorMap).map(key => ({
116
- name: key,
117
- value: d[key],
118
- color: colorMap[key].color,
119
- className: colorMap[key].className,
120
- }));
121
- }
122
- function geoJsonPointToScreenPoint(geoPoint, i, leafletMap, config) {
123
- var _a;
124
- const zoomLevel = leafletMap.getZoom();
125
- const isCluster = geoPoint.properties.cluster;
126
- const clusterIndex = geoPoint.properties.clusterIndex;
127
- const clusterPoints = isCluster ? clusterIndex.getLeaves(geoPoint.properties.cluster_id, Infinity).map(d => d.properties) : undefined;
128
- const { x, y } = getPointPos(geoPoint, leafletMap);
129
- const id = isCluster ? `cluster-${geoPoint.id}` : ((_a = getString(geoPoint.properties, config.pointId)) !== null && _a !== void 0 ? _a : geoPoint.geometry.coordinates.join(''));
130
- const pointColor = getColor(geoPoint.properties, isCluster ? config.clusterColor : config.pointColor);
131
- const radius = getPointRadius(geoPoint, isCluster ? config.clusterRadius : config.pointRadius, zoomLevel);
132
- const shape = isCluster ? LeafletMapPointShape.Circle : getString(geoPoint.properties, config.pointShape);
133
- const isRing = shape === LeafletMapPointShape.Ring;
134
- const donutData = getDonutData(geoPoint.properties, config.colorMap);
135
- const maxValue = max(donutData, d => d.value);
136
- const maxValueIndex = donutData.map(d => d.value).indexOf(maxValue);
137
- const biggestDatum = donutData[maxValueIndex !== null && maxValueIndex !== void 0 ? maxValueIndex : 0];
138
- const color = isCluster ? pointColor
139
- : (isRing ? null : (pointColor !== null && pointColor !== void 0 ? pointColor : biggestDatum === null || biggestDatum === void 0 ? void 0 : biggestDatum.color));
140
- const bbox = { x1: x - radius, y1: y - radius, x2: x + radius, y2: y + radius };
141
- const path = getNodePathData({ x: 0, y: 0 }, radius, shape);
142
- const _zIndex = 0;
143
- const screenPoint = Object.assign(Object.assign({}, geoPoint), { id,
144
- bbox,
145
- radius,
146
- donutData,
147
- path,
148
- color,
149
- isCluster,
150
- clusterIndex,
151
- clusterPoints,
152
- _zIndex });
153
- return screenPoint;
154
- }
155
- function shouldClusterExpand(cluster, zoomLevel, midLevel = 4, maxLevel = 8, maxClusterZoomLevel = 23) {
156
- if (!cluster)
157
- return false;
158
- const clusterExpansionZoomLevel = cluster.clusterIndex.getClusterExpansionZoom(cluster.properties.cluster_id);
159
- return zoomLevel >= maxLevel ||
160
- (zoomLevel >= midLevel && (cluster.properties.point_count < 20 || clusterExpansionZoomLevel >= maxClusterZoomLevel));
161
- }
162
- function findPointAndClusterByPointId(points, id, pointId) {
163
- let point;
164
- let cluster;
165
- points.forEach(p => {
166
- var _a;
167
- if (p.isCluster) {
168
- const leaves = (_a = p.clusterIndex.getLeaves(p.properties.cluster_id, Infinity)) !== null && _a !== void 0 ? _a : [];
169
- const foundPoint = leaves.find(d => getString(d.properties, pointId) === id);
170
- if (foundPoint) {
171
- point = foundPoint;
172
- cluster = p;
173
- }
174
- }
175
- });
176
- return { point, cluster };
177
- }
178
- function getNodeRelativePosition(d, leafletMap) {
179
- const paneTransform = getHTMLTransform(leafletMap.getPane('mapPane'));
180
- const { x, y } = getPointPos(d, leafletMap);
181
- return { x: x + paneTransform[0], y: y + paneTransform[1] };
182
- }
183
- function getClusterRadius(cluster) {
184
- const { points } = cluster;
185
- const minX = min(points.map(d => d.properties.dx - d.properties.r));
186
- const maxX = max(points.map(d => d.properties.dx + d.properties.r));
187
- const minY = min(points.map(d => d.properties.dy - d.properties.r));
188
- const maxY = max(points.map(d => d.properties.dy + d.properties.r));
189
- return Math.sqrt(Math.pow((maxX - minX), 2) + Math.pow((maxY - minY), 2)) * 0.5;
190
- }
191
- function getClustersAndPoints(clusterIndex, leafletMap, customBounds) {
192
- const leafletBounds = leafletMap.getBounds();
193
- const southWest = leafletBounds.getSouthWest();
194
- const northEast = leafletBounds.getNorthEast();
195
- const bounds = customBounds || [southWest.lng, southWest.lat, northEast.lng, northEast.lat];
196
- const zoom = Math.round(leafletMap.getZoom());
197
- const points = clusterIndex.getClusters(bounds, zoom); // as ClusterFeature<LeafletMapPointDatum<D>>[]
198
- for (const p of points) {
199
- const point = p;
200
- const isCluster = point.properties.cluster;
201
- if (isCluster) {
202
- point.properties.clusterIndex = clusterIndex;
203
- point.properties.clusterPoints = clusterIndex.getLeaves(point.properties.cluster_id, Infinity).map(d => d.properties);
204
- }
205
- }
206
- return points;
207
- }
208
-
209
- export { bBoxMerge, calculateClusterIndex, findPointAndClusterByPointId, geoJsonPointToScreenPoint, getClusterRadius, getClustersAndPoints, getDonutData, getNextZoomLevelOnClusterClick, getNodePathData, getNodeRelativePosition, getPointDisplayOrder, getPointPos, getPointRadius, projectPoint, shouldClusterExpand, toGeoJSONPoint };
210
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../src/components/leaflet-map/modules/utils.ts"],"sourcesContent":["import type L from 'leaflet'\nimport { min, max } from 'd3-array'\nimport Supercluster, { ClusterFeature, PointFeature } from 'supercluster'\n\n// Utils\nimport { clamp, getString, getNumber } from 'utils/data'\nimport { getColor } from 'utils/color'\nimport { polygon, circlePath } from 'utils/path'\nimport { getHTMLTransform } from 'utils/html'\n\n// Types\nimport { NumericAccessor, StringAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\n// Local Types\nimport {\n LeafletMapPoint,\n LeafletMapPointShape,\n LeafletMapPieDatum,\n LeafletMapPointStyles,\n PointExpandedClusterProperties,\n LeafletMapPointDatum,\n LeafletMapClusterDatum,\n} from '../types'\n\n// Config\nimport { LeafletMapConfig } from '../config'\n\nexport function bBoxMerge (\n bBoxArray: ({x1: number; x2: number; y1: number; y2: number})[]):\n { x: number; y: number; width: number; height: number } {\n let box = { x1: 0, x2: 0, y1: 0, y2: 0 }\n bBoxArray.forEach(coords => {\n if (!box) {\n box = { ...coords }\n } else {\n if (box.x1 > coords.x1) box.x1 = coords.x1\n if (box.y1 > coords.y1) box.y1 = coords.y1\n if (box.x2 < coords.x2) box.x2 = coords.x2\n if (box.y2 < coords.y2) box.y2 = coords.y2\n }\n })\n\n return {\n x: box.x1,\n y: box.y1,\n width: box.x2 - box.x1,\n height: box.y2 - box.y1,\n }\n}\n\nexport const getNextZoomLevelOnClusterClick = (level: number): number => clamp(1 + level * 1.5, level, 12)\n\nexport function projectPoint<D extends GenericDataRecord> (\n geoJSONPoint: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>,\n leafletMap: L.Map\n): { x: number; y: number } {\n const lat = geoJSONPoint.geometry.coordinates[1]\n const lon = geoJSONPoint.geometry.coordinates[0]\n const projected = leafletMap.latLngToLayerPoint([lat, lon])\n return projected\n}\n\nexport function getPointRadius<D extends GenericDataRecord> (\n geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>> | PointFeature<PointExpandedClusterProperties<D>>,\n pointRadius: NumericAccessor<D>,\n zoomLevel: number\n): number {\n const isDynamic = !pointRadius\n const radius = isDynamic ? 1 + 2 * Math.pow(zoomLevel, 0.80) : getNumber((geoPoint.properties as LeafletMapPointDatum<D>), pointRadius)\n\n const isCluster = (geoPoint as ClusterFeature<D>).properties.cluster\n return (isCluster && isDynamic)\n ? clamp(Math.pow((geoPoint as ClusterFeature<D>).properties.point_count, 0.35) * radius, radius * 1.1, radius * 3)\n : radius\n}\n\nexport function getPointPos<D extends GenericDataRecord> (point: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, leafletMap: L.Map): { x: number; y: number } {\n const properties = point.properties as LeafletMapPointDatum<D>\n const isFromCluster = !!(properties).expandedClusterPoint\n\n if (isFromCluster) {\n const { x, y } = projectPoint(properties.expandedClusterPoint, leafletMap)\n return {\n x: x + properties.dx,\n y: y + properties.dy,\n }\n } else {\n return projectPoint(point, leafletMap)\n }\n}\n\nexport function getPointDisplayOrder<D extends GenericDataRecord> (\n d: LeafletMapPoint<D>,\n pointStatus: StringAccessor<LeafletMapPointDatum<D> | LeafletMapClusterDatum<D>>,\n colorMap: LeafletMapPointStyles<D>\n): number {\n const status = getString(d.properties, pointStatus)\n const statusList = Object.keys(colorMap)\n return Object.keys(statusList).indexOf(status)\n}\n\nexport function toGeoJSONPoint<D extends GenericDataRecord> (d: D, pointLatitude: NumericAccessor<D>, pointLongitude: NumericAccessor<D>): PointFeature<D> {\n const lat = getNumber(d, pointLatitude) as number\n const lon = getNumber(d, pointLongitude) as number\n\n return {\n type: 'Feature',\n properties: {\n ...d,\n },\n geometry: {\n type: 'Point',\n coordinates: [lon, lat],\n },\n }\n}\n\nexport function calculateClusterIndex<D extends GenericDataRecord> (data: D[], config: LeafletMapConfig<D>, maxClusterZoomLevel = 23): Supercluster<D> {\n const { colorMap, pointShape, pointLatitude, pointLongitude, clusteringDistance } = config\n return new Supercluster<D, Supercluster.AnyProps>({\n radius: clusteringDistance,\n maxZoom: maxClusterZoomLevel,\n map: (d): Supercluster.AnyProps => {\n const shape = getString(d, pointShape)\n\n const clusterPoint = { shape }\n for (const key of Object.keys(colorMap)) {\n clusterPoint[key] = d[key] || 0\n }\n\n return clusterPoint\n },\n reduce: (acc, clusterPoint): void => {\n acc.shape = acc.shape === clusterPoint.shape ? acc.shape : LeafletMapPointShape.Circle\n acc.value = (acc.value ?? 0) + (clusterPoint.value ?? 0)\n\n for (const key of Object.keys(colorMap)) {\n acc[key] += clusterPoint[key]\n }\n },\n }).load(data.map(d => toGeoJSONPoint(d, pointLatitude, pointLongitude)))\n}\n\nexport function getNodePathData ({ x, y }: { x: number; y: number }, radius: number, shape: LeafletMapPointShape): string {\n switch (shape) {\n case LeafletMapPointShape.Triangle:\n return polygon(radius * 2, 3)\n case LeafletMapPointShape.Square:\n return polygon(radius * 2, 4)\n case LeafletMapPointShape.Circle:\n case LeafletMapPointShape.Ring:\n default:\n return circlePath(x, y, radius)\n }\n}\n\nexport function getDonutData<D extends GenericDataRecord> (\n d: LeafletMapClusterDatum<D> | LeafletMapPointDatum<D>,\n colorMap: LeafletMapPointStyles<D>\n): LeafletMapPieDatum[] {\n return Object.keys(colorMap).map(key => ({\n name: key,\n value: d[key] as number,\n color: colorMap[key].color,\n className: colorMap[key].className,\n }))\n}\n\nexport function geoJsonPointToScreenPoint<D extends GenericDataRecord> (\n geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>,\n i: number,\n leafletMap: L.Map,\n config: LeafletMapConfig<D>\n): LeafletMapPoint<D> {\n const zoomLevel = leafletMap.getZoom()\n const isCluster = (geoPoint.properties as LeafletMapClusterDatum<D>).cluster\n const clusterIndex = (geoPoint.properties as LeafletMapClusterDatum<D>).clusterIndex\n const clusterPoints = isCluster ? clusterIndex.getLeaves((geoPoint.properties as LeafletMapClusterDatum<D>).cluster_id as number, Infinity).map(d => d.properties) : undefined\n const { x, y } = getPointPos(geoPoint, leafletMap)\n\n const id = isCluster ? `cluster-${geoPoint.id}` : (getString(geoPoint.properties as LeafletMapPointDatum<D>, config.pointId) ?? geoPoint.geometry.coordinates.join(''))\n const pointColor = getColor(geoPoint.properties, isCluster ? config.clusterColor : config.pointColor)\n const radius = getPointRadius(geoPoint, isCluster ? config.clusterRadius : config.pointRadius, zoomLevel)\n const shape = isCluster ? LeafletMapPointShape.Circle : getString(geoPoint.properties as LeafletMapPointDatum<D>, config.pointShape) as LeafletMapPointShape\n const isRing = shape === LeafletMapPointShape.Ring\n\n const donutData = getDonutData(geoPoint.properties, config.colorMap)\n const maxValue = max(donutData, d => d.value)\n const maxValueIndex = donutData.map(d => d.value).indexOf(maxValue)\n const biggestDatum = donutData[maxValueIndex ?? 0]\n\n const color = isCluster ? pointColor\n : (isRing ? null : (pointColor ?? biggestDatum?.color))\n const bbox = { x1: x - radius, y1: y - radius, x2: x + radius, y2: y + radius }\n const path = getNodePathData({ x: 0, y: 0 }, radius, shape)\n const _zIndex = 0\n\n const screenPoint: LeafletMapPoint<D> = {\n ...geoPoint,\n id,\n bbox,\n radius,\n donutData,\n path,\n color,\n isCluster,\n clusterIndex,\n clusterPoints,\n _zIndex,\n }\n\n return screenPoint\n}\n\nexport function shouldClusterExpand<D extends GenericDataRecord> (\n cluster: LeafletMapPoint<D>,\n zoomLevel: number,\n midLevel = 4,\n maxLevel = 8,\n maxClusterZoomLevel = 23\n): boolean {\n if (!cluster) return false\n\n const clusterExpansionZoomLevel = cluster.clusterIndex.getClusterExpansionZoom(cluster.properties.cluster_id as number)\n return zoomLevel >= maxLevel ||\n (zoomLevel >= midLevel && (cluster.properties.point_count < 20 || clusterExpansionZoomLevel >= maxClusterZoomLevel))\n}\n\nexport function findPointAndClusterByPointId<D extends GenericDataRecord> (\n points: LeafletMapPoint<D>[],\n id: string,\n pointId: StringAccessor<D>\n): {\n point: PointFeature<D> | undefined;\n cluster: LeafletMapPoint<D> | undefined;\n } {\n let point\n let cluster\n points.forEach(p => {\n if (p.isCluster) {\n const leaves = p.clusterIndex.getLeaves((p.properties as LeafletMapClusterDatum<D>).cluster_id as number, Infinity) ?? []\n const foundPoint = leaves.find(d => getString(d.properties, pointId) === id)\n if (foundPoint) {\n point = foundPoint\n cluster = p\n }\n }\n })\n return { point, cluster }\n}\n\nexport function getNodeRelativePosition<D extends GenericDataRecord> (d: LeafletMapPoint<D>, leafletMap: L.Map): { x: number; y: number } {\n const paneTransform = getHTMLTransform(leafletMap.getPane('mapPane'))\n const { x, y } = getPointPos(d, leafletMap)\n return { x: x + paneTransform[0], y: y + paneTransform[1] }\n}\n\nexport function getClusterRadius<D extends GenericDataRecord> (cluster: { points: PointFeature<PointExpandedClusterProperties<D>>[]; cluster: LeafletMapPoint<D> }): number {\n const { points } = cluster\n const minX = min<number>(points.map(d => d.properties.dx - d.properties.r))\n const maxX = max<number>(points.map(d => d.properties.dx + d.properties.r))\n const minY = min<number>(points.map(d => d.properties.dy - d.properties.r))\n const maxY = max<number>(points.map(d => d.properties.dy + d.properties.r))\n return Math.sqrt((maxX - minX) ** 2 + (maxY - minY) ** 2) * 0.5\n}\n\nexport function getClustersAndPoints<D extends GenericDataRecord> (\n clusterIndex: Supercluster<D>,\n leafletMap: L.Map,\n customBounds?: [number, number, number, number]\n): (ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<D>)[] {\n const leafletBounds = leafletMap.getBounds()\n const southWest = leafletBounds.getSouthWest()\n const northEast = leafletBounds.getNorthEast()\n const bounds = customBounds || [southWest.lng, southWest.lat, northEast.lng, northEast.lat]\n const zoom = Math.round(leafletMap.getZoom())\n const points = clusterIndex.getClusters(bounds, zoom) // as ClusterFeature<LeafletMapPointDatum<D>>[]\n\n for (const p of points) {\n const point = p as ClusterFeature<LeafletMapClusterDatum<D>>\n const isCluster = point.properties.cluster\n if (isCluster) {\n point.properties.clusterIndex = clusterIndex\n point.properties.clusterPoints = clusterIndex.getLeaves(point.properties.cluster_id, Infinity).map(d => d.properties)\n }\n }\n\n return points as (ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<D>)[]\n}\n"],"names":[],"mappings":";;;;;;;;AA4BM,SAAU,SAAS,CACvB,SAA+D,EAAA;AAE/D,IAAA,IAAI,GAAG,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,E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AAE,SAAS,CAAC,GAAG,CAAC,CAAA;IAC3F,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAA;AAC7C,IAAA,MAAM,MAAM,GAAG,YAAY,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAErD,IAAA,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;QACtB,MAAM,KAAK,GAAG,CAA8C,CAAA;AAC5D,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,CAAA;AAC1C,QAAA,IAAI,SAAS,EAAE;AACb,YAAA,KAAK,CAAC,UAAU,CAAC,YAAY,GAAG,YAAY,CAAA;AAC5C,YAAA,KAAK,CAAC,UAAU,CAAC,aAAa,GAAG,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAA;AACtH,SAAA;AACF,KAAA;AAED,IAAA,OAAO,MAAyE,CAAA;AAClF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"leaflet-maplibre-gl.js","sources":["../../../../src/components/leaflet-map/renderer/leaflet-maplibre-gl.js"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function MaplibreGLLayer (leaflet, maplibre, options) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const Layer = leaflet.Layer.extend({\n options: {\n updateInterval: 32,\n // How much to extend the overlay view (relative to map size)\n // e.g. 0.1 would be 10% of map view in each direction\n padding: 0.1,\n // whether or not to register the mouse and keyboard\n // events on the maplibre overlay\n interactive: false,\n // set the tilepane as the default pane to draw gl tiles\n pane: 'tilePane',\n },\n\n initialize: function (options) {\n leaflet.setOptions(this, options)\n\n // setup throttling the update event when panning\n this._throttledUpdate = leaflet.Util.throttle(this._update, this.options.updateInterval, this)\n },\n\n onAdd: function (map) {\n if (!this._container) {\n this._initContainer()\n }\n\n const paneName = this.getPaneName()\n map.getPane(paneName).appendChild(this._container)\n\n this._initGL()\n\n this._offset = this._map.containerPointToLayerPoint([0, 0])\n\n // work around https://github.com/mapbox/mapbox-gl-leaflet/issues/47\n if (map.options.zoomAnimation) {\n leaflet.DomEvent.on(map._proxy, leaflet.DomUtil.TRANSITION_END, this._transitionEnd, this)\n }\n },\n\n onRemove: function (map) {\n if (this._map._proxy && this._map.options.zoomAnimation) {\n leaflet.DomEvent.off(this._map._proxy, leaflet.DomUtil.TRANSITION_END, this._transitionEnd, this)\n }\n const paneName = this.getPaneName()\n map.getPane(paneName).removeChild(this._container)\n\n this._glMap.remove()\n this._glMap = null\n },\n\n getEvents: function () {\n return {\n move: this._throttledUpdate, // sensibly throttle updating while panning\n zoomanim: this._animateZoom, // applys the zoom animation to the <canvas>\n zoom: this._pinchZoom, // animate every zoom event for smoother pinch-zooming\n zoomstart: this._zoomStart, // flag starting a zoom to disable panning\n zoomend: this._zoomEnd,\n resize: this._resize,\n }\n },\n\n getMaplibreMap: function () {\n return this._glMap\n },\n\n getCanvas: function () {\n return this._glMap.getCanvas()\n },\n\n getSize: function () {\n return this._map.getSize().multiplyBy(1 + this.options.padding * 2)\n },\n\n getBounds: function () {\n const halfSize = this.getSize().multiplyBy(0.5)\n const center = this._map.latLngToContainerPoint(this._map.getCenter())\n return leaflet.latLngBounds(\n this._map.containerPointToLatLng(center.subtract(halfSize)),\n this._map.containerPointToLatLng(center.add(halfSize))\n )\n },\n\n getContainer: function () {\n return this._container\n },\n\n // returns the pane name set in options if it is a valid pane, defaults to tilePane\n getPaneName: function () {\n return this._map.getPane(this.options.pane) ? this.options.pane : 'tilePane'\n },\n\n _initContainer: function () {\n const container = this._container = leaflet.DomUtil.create('div', 'leaflet-gl-layer')\n\n const size = this.getSize()\n const offset = this._map.getSize().multiplyBy(this.options.padding)\n container.style.width = `${size.x}px`\n container.style.height = `${size.y}px`\n\n const topLeft = this._map.containerPointToLayerPoint([0, 0]).subtract(offset)\n\n leaflet.DomUtil.setPosition(container, topLeft)\n },\n\n _initGL: function () {\n const center = this._map.getCenter()\n\n const options = leaflet.extend({}, this.options, {\n container: this._container,\n center: [center.lng, center.lat],\n zoom: this._map.getZoom() - 1,\n attributionControl: false,\n })\n\n this._glMap = new maplibre.Map(options)\n\n // allow GL base map to pan beyond min/max latitudes\n this._glMap.transform.latRange = null\n this._glMap.transform.maxValidLatitude = Infinity\n\n this._transformGL(this._glMap)\n\n if (this._glMap._canvas.canvas) {\n // older versions of mapbox-gl surfaced the canvas differently\n this._glMap._actualCanvas = this._glMap._canvas.canvas\n } else {\n this._glMap._actualCanvas = this._glMap._canvas\n }\n\n // treat child <canvas> element like leaflet.ImageOverlay\n const canvas = this._glMap._actualCanvas\n leaflet.DomUtil.addClass(canvas, 'leaflet-image-layer')\n leaflet.DomUtil.addClass(canvas, 'leaflet-zoom-animated')\n if (this.options.interactive) {\n leaflet.DomUtil.addClass(canvas, 'leaflet-interactive')\n }\n if (this.options.className) {\n leaflet.DomUtil.addClass(canvas, this.options.className)\n }\n },\n\n _update: function (e) {\n // update the offset so we can correct for it later when we zoom\n this._offset = this._map.containerPointToLayerPoint([0, 0])\n\n if (this._zooming) {\n return\n }\n\n const size = this.getSize()\n const container = this._container\n const gl = this._glMap\n const offset = this._map.getSize().multiplyBy(this.options.padding)\n const topLeft = this._map.containerPointToLayerPoint([0, 0]).subtract(offset)\n\n leaflet.DomUtil.setPosition(container, topLeft)\n\n this._transformGL(gl)\n\n if (gl.transform.width !== size.x || gl.transform.height !== size.y) {\n container.style.width = `${size.x}px`\n container.style.height = `${size.y}px`\n if (gl._resize !== null && gl._resize !== undefined) {\n gl._resize()\n } else {\n gl.resize()\n }\n } else {\n // older versions of mapbox-gl surfaced update publicly\n if (gl._update !== null && gl._update !== undefined) {\n gl._update()\n } else {\n gl.update()\n }\n }\n },\n\n _transformGL: function (gl) {\n const center = this._map.getCenter()\n\n // gl.setView([center.lat, center.lng], this._map.getZoom() - 1, 0);\n // calling setView directly causes sync issues because it uses requestAnimFrame\n\n const tr = gl.transform\n tr.center = maplibre.LngLat.convert([center.lng, center.lat])\n tr.zoom = this._map.getZoom() - 1\n },\n\n // update the map constantly during a pinch zoom\n _pinchZoom: function (e) {\n this._glMap.jumpTo({\n zoom: this._map.getZoom() - 1,\n center: this._map.getCenter(),\n })\n },\n\n // borrowed from leaflet.ImageOverlay\n // https://github.com/Leaflet/Leaflet/blob/master/src/layer/ImageOverlay.js#L139-L144\n _animateZoom: function (e) {\n const scale = this._map.getZoomScale(e.zoom)\n const padding = this._map.getSize().multiplyBy(this.options.padding * scale)\n const viewHalf = this.getSize()._divideBy(2)\n // corrections for padding (scaled), adapted from\n // https://github.com/Leaflet/Leaflet/blob/master/src/map/Map.js#L1490-L1508\n const topLeft = this._map.project(e.center, e.zoom)\n ._subtract(viewHalf)\n ._add(this._map._getMapPanePos()\n .add(padding))._round()\n const offset = this._map.project(this._map.getBounds().getNorthWest(), e.zoom)\n ._subtract(topLeft)\n\n leaflet.DomUtil.setTransform(\n this._glMap._actualCanvas,\n offset.subtract(this._offset),\n scale\n )\n },\n\n _zoomStart: function (e) {\n this._zooming = true\n },\n\n _zoomEnd: function () {\n const scale = this._map.getZoomScale(this._map.getZoom())\n\n leaflet.DomUtil.setTransform(\n this._glMap._actualCanvas,\n // https://github.com/mapbox/mapbox-gl-leaflet/pull/130\n null,\n scale\n )\n\n this._zooming = false\n\n this._update()\n },\n\n _transitionEnd: function (e) {\n leaflet.Util.requestAnimFrame(function () {\n const zoom = this._map.getZoom()\n const center = this._map.getCenter()\n const offset = this._map.latLngToContainerPoint(\n this._map.getBounds().getNorthWest()\n )\n\n // reset the scale and offset\n leaflet.DomUtil.setTransform(this._glMap._actualCanvas, offset, 1)\n\n // enable panning once the gl map is ready again\n this._glMap.once('moveend', leaflet.Util.bind(function () {\n this._zoomEnd()\n }, this))\n\n // update the map position\n this._glMap.jumpTo({\n center: center,\n zoom: zoom - 1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AAS;AACT;AACA;AACA,QAAQ,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,EAAC;AAC1E;AACA;AACA,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY;AAClE,UAAU,IAAI,CAAC,QAAQ,GAAE;AACzB,SAAS,EAAE,IAAI,CAAC,EAAC;AACjB;AACA;AACA,QAAQ,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;AAC3B,UAAU,MAAM,EAAE,MAAM;AACxB,UAAU,IAAI,EAAE,IAAI,GAAG,CAAC;AACxB,SAAS,EAAC;AACV,OAAO,EAAE,IAAI,EAAC;AACd,KAAK;AACL;AACA,IAAI,OAAO,EAAE,UAAU,CAAC,EAAE;AAC1B,MAAM,IAAI,CAAC,cAAc,CAAC,CAAC,EAAC;AAC5B,KAAK;AACL,GAAG,EAAC;AACJ;AACA,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC;AAC3B;;;;"}
@@ -1,4 +0,0 @@
1
- import { StyleSpecification } from 'maplibre-gl';
2
- export declare type MapLibreStyleSpecs = StyleSpecification;
3
- export declare const MapLibreArcticDark: MapLibreStyleSpecs;
4
- export declare const MapLibreArcticLight: MapLibreStyleSpecs;