@unovis/ts 1.3.0-beta.3 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/components/area/config.d.ts +6 -10
  2. package/components/area/config.js +3 -12
  3. package/components/area/config.js.map +1 -1
  4. package/components/area/index.d.ts +5 -6
  5. package/components/area/index.js +10 -9
  6. package/components/area/index.js.map +1 -1
  7. package/components/axis/config.d.ts +3 -27
  8. package/components/axis/config.js +3 -30
  9. package/components/axis/config.js.map +1 -1
  10. package/components/axis/index.d.ts +4 -3
  11. package/components/axis/index.js +8 -5
  12. package/components/axis/index.js.map +1 -1
  13. package/components/brush/config.d.ts +2 -12
  14. package/components/brush/config.js +11 -20
  15. package/components/brush/config.js.map +1 -1
  16. package/components/brush/index.d.ts +4 -3
  17. package/components/brush/index.js +4 -3
  18. package/components/brush/index.js.map +1 -1
  19. package/components/bullet-legend/config.d.ts +1 -10
  20. package/components/bullet-legend/config.js +11 -14
  21. package/components/bullet-legend/config.js.map +1 -1
  22. package/components/bullet-legend/index.d.ts +4 -3
  23. package/components/bullet-legend/index.js +5 -2
  24. package/components/bullet-legend/index.js.map +1 -1
  25. package/components/chord-diagram/config.d.ts +7 -23
  26. package/components/chord-diagram/config.js +4 -23
  27. package/components/chord-diagram/config.js.map +1 -1
  28. package/components/chord-diagram/index.d.ts +4 -3
  29. package/components/chord-diagram/index.js +8 -7
  30. package/components/chord-diagram/index.js.map +1 -1
  31. package/components/chord-diagram/modules/label.d.ts +3 -3
  32. package/components/chord-diagram/modules/label.js +1 -1
  33. package/components/chord-diagram/modules/label.js.map +1 -1
  34. package/components/chord-diagram/modules/link.d.ts +2 -2
  35. package/components/chord-diagram/modules/link.js.map +1 -1
  36. package/components/chord-diagram/modules/node.d.ts +2 -2
  37. package/components/chord-diagram/modules/node.js.map +1 -1
  38. package/components/chord-diagram/types.d.ts +3 -2
  39. package/components/chord-diagram/types.js.map +1 -1
  40. package/components/crosshair/config.d.ts +4 -14
  41. package/components/crosshair/config.js +3 -16
  42. package/components/crosshair/config.js.map +1 -1
  43. package/components/crosshair/index.d.ts +4 -3
  44. package/components/crosshair/index.js +4 -3
  45. package/components/crosshair/index.js.map +1 -1
  46. package/components/donut/config.d.ts +3 -20
  47. package/components/donut/config.js +3 -24
  48. package/components/donut/config.js.map +1 -1
  49. package/components/donut/index.d.ts +4 -3
  50. package/components/donut/index.js +5 -4
  51. package/components/donut/index.js.map +1 -1
  52. package/components/donut/modules/arc.d.ts +3 -3
  53. package/components/donut/modules/arc.js.map +1 -1
  54. package/components/flow-legend/config.d.ts +1 -11
  55. package/components/flow-legend/config.js +11 -16
  56. package/components/flow-legend/config.js.map +1 -1
  57. package/components/flow-legend/index.d.ts +4 -3
  58. package/components/flow-legend/index.js +5 -2
  59. package/components/flow-legend/index.js.map +1 -1
  60. package/components/free-brush/config.d.ts +2 -12
  61. package/components/free-brush/config.js +11 -20
  62. package/components/free-brush/config.js.map +1 -1
  63. package/components/free-brush/index.d.ts +4 -3
  64. package/components/free-brush/index.js +13 -12
  65. package/components/free-brush/index.js.map +1 -1
  66. package/components/graph/config.d.ts +3 -75
  67. package/components/graph/config.js +13 -79
  68. package/components/graph/config.js.map +1 -1
  69. package/components/graph/index.d.ts +8 -7
  70. package/components/graph/index.js +7 -5
  71. package/components/graph/index.js.map +1 -1
  72. package/components/graph/modules/layout.d.ts +7 -7
  73. package/components/graph/modules/layout.js +7 -2
  74. package/components/graph/modules/layout.js.map +1 -1
  75. package/components/graph/modules/link/helper.d.ts +5 -5
  76. package/components/graph/modules/link/helper.js.map +1 -1
  77. package/components/graph/modules/link/index.d.ts +6 -6
  78. package/components/graph/modules/link/index.js.map +1 -1
  79. package/components/graph/modules/node/helper.d.ts +1 -1
  80. package/components/graph/modules/node/helper.js.map +1 -1
  81. package/components/graph/modules/node/index.d.ts +9 -6
  82. package/components/graph/modules/node/index.js +7 -9
  83. package/components/graph/modules/node/index.js.map +1 -1
  84. package/components/graph/modules/panel/helper.d.ts +4 -4
  85. package/components/graph/modules/panel/helper.js.map +1 -1
  86. package/components/graph/modules/panel/index.d.ts +3 -3
  87. package/components/graph/modules/panel/index.js.map +1 -1
  88. package/components/graph/modules/shape.js +2 -2
  89. package/components/graph/modules/shape.js.map +1 -1
  90. package/components/grouped-bar/config.d.ts +5 -13
  91. package/components/grouped-bar/config.js +3 -16
  92. package/components/grouped-bar/config.js.map +1 -1
  93. package/components/grouped-bar/index.d.ts +5 -9
  94. package/components/grouped-bar/index.js +5 -15
  95. package/components/grouped-bar/index.js.map +1 -1
  96. package/components/leaflet-flow-map/config.d.ts +2 -16
  97. package/components/leaflet-flow-map/config.js +3 -21
  98. package/components/leaflet-flow-map/config.js.map +1 -1
  99. package/components/leaflet-flow-map/index.d.ts +4 -3
  100. package/components/leaflet-flow-map/index.js +3 -2
  101. package/components/leaflet-flow-map/index.js.map +1 -1
  102. package/components/leaflet-map/config.d.ts +4 -59
  103. package/components/leaflet-map/config.js +24 -68
  104. package/components/leaflet-map/config.js.map +1 -1
  105. package/components/leaflet-map/index.d.ts +5 -4
  106. package/components/leaflet-map/index.js +4 -3
  107. package/components/leaflet-map/index.js.map +1 -1
  108. package/components/leaflet-map/modules/clusterBackground.d.ts +4 -2
  109. package/components/leaflet-map/modules/clusterBackground.js.map +1 -1
  110. package/components/leaflet-map/modules/map.d.ts +4 -4
  111. package/components/leaflet-map/modules/map.js +6 -6
  112. package/components/leaflet-map/modules/map.js.map +1 -1
  113. package/components/leaflet-map/modules/node.d.ts +3 -0
  114. package/components/leaflet-map/modules/node.js +8 -12
  115. package/components/leaflet-map/modules/node.js.map +1 -1
  116. package/components/leaflet-map/modules/utils.d.ts +4 -4
  117. package/components/leaflet-map/modules/utils.js +6 -2
  118. package/components/leaflet-map/modules/utils.js.map +1 -1
  119. package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +2 -2
  120. package/components/leaflet-map/renderer/mapboxgl-layer.js.map +1 -1
  121. package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +5 -1
  122. package/components/leaflet-map/renderer/mapboxgl-utils.js +3 -3
  123. package/components/leaflet-map/renderer/mapboxgl-utils.js.map +1 -1
  124. package/components/leaflet-map/style.js.map +1 -1
  125. package/components/leaflet-map/types.d.ts +5 -1
  126. package/components/leaflet-map/types.js.map +1 -1
  127. package/components/line/config.d.ts +6 -11
  128. package/components/line/config.js +3 -13
  129. package/components/line/config.js.map +1 -1
  130. package/components/line/index.d.ts +6 -5
  131. package/components/line/index.js +7 -6
  132. package/components/line/index.js.map +1 -1
  133. package/components/nested-donut/config.d.ts +2 -21
  134. package/components/nested-donut/config.js +3 -24
  135. package/components/nested-donut/config.js.map +1 -1
  136. package/components/nested-donut/index.d.ts +4 -3
  137. package/components/nested-donut/index.js +18 -8
  138. package/components/nested-donut/index.js.map +1 -1
  139. package/components/nested-donut/modules/arc.d.ts +3 -3
  140. package/components/nested-donut/modules/arc.js.map +1 -1
  141. package/components/nested-donut/modules/label.d.ts +2 -2
  142. package/components/nested-donut/modules/label.js.map +1 -1
  143. package/components/nested-donut/style.js.map +1 -1
  144. package/components/sankey/config.d.ts +3 -48
  145. package/components/sankey/config.js +11 -58
  146. package/components/sankey/config.js.map +1 -1
  147. package/components/sankey/index.d.ts +4 -3
  148. package/components/sankey/index.js +3 -2
  149. package/components/sankey/index.js.map +1 -1
  150. package/components/sankey/modules/label.d.ts +7 -7
  151. package/components/sankey/modules/label.js.map +1 -1
  152. package/components/sankey/modules/link.d.ts +12 -2
  153. package/components/sankey/modules/link.js +4 -8
  154. package/components/sankey/modules/link.js.map +1 -1
  155. package/components/sankey/modules/node.d.ts +7 -7
  156. package/components/sankey/modules/node.js +1 -1
  157. package/components/sankey/modules/node.js.map +1 -1
  158. package/components/scatter/config.d.ts +5 -17
  159. package/components/scatter/config.js +3 -19
  160. package/components/scatter/config.js.map +1 -1
  161. package/components/scatter/index.d.ts +4 -3
  162. package/components/scatter/index.js +8 -8
  163. package/components/scatter/index.js.map +1 -1
  164. package/components/scatter/modules/point.d.ts +2 -2
  165. package/components/scatter/modules/point.js.map +1 -1
  166. package/components/scatter/modules/utils.d.ts +2 -2
  167. package/components/scatter/modules/utils.js.map +1 -1
  168. package/components/stacked-bar/config.d.ts +5 -13
  169. package/components/stacked-bar/config.js +3 -16
  170. package/components/stacked-bar/config.js.map +1 -1
  171. package/components/stacked-bar/index.d.ts +4 -3
  172. package/components/stacked-bar/index.js +4 -3
  173. package/components/stacked-bar/index.js.map +1 -1
  174. package/components/timeline/config.d.ts +5 -16
  175. package/components/timeline/config.js +3 -21
  176. package/components/timeline/config.js.map +1 -1
  177. package/components/timeline/index.d.ts +4 -3
  178. package/components/timeline/index.js +4 -3
  179. package/components/timeline/index.js.map +1 -1
  180. package/components/tooltip/config.d.ts +1 -15
  181. package/components/tooltip/config.js +12 -16
  182. package/components/tooltip/config.js.map +1 -1
  183. package/components/tooltip/index.d.ts +6 -4
  184. package/components/tooltip/index.js +15 -6
  185. package/components/tooltip/index.js.map +1 -1
  186. package/components/tooltip/style.d.ts +6 -0
  187. package/components/tooltip/style.js +13 -14
  188. package/components/tooltip/style.js.map +1 -1
  189. package/components/topojson-map/config.d.ts +4 -36
  190. package/components/topojson-map/config.js +3 -38
  191. package/components/topojson-map/config.js.map +1 -1
  192. package/components/topojson-map/index.d.ts +4 -3
  193. package/components/topojson-map/index.js +4 -5
  194. package/components/topojson-map/index.js.map +1 -1
  195. package/components/vis-controls/config.d.ts +1 -5
  196. package/components/vis-controls/config.js +6 -9
  197. package/components/vis-controls/config.js.map +1 -1
  198. package/components/vis-controls/index.d.ts +3 -2
  199. package/components/vis-controls/index.js +5 -2
  200. package/components/vis-controls/index.js.map +1 -1
  201. package/components/xy-labels/config.d.ts +4 -16
  202. package/components/xy-labels/config.js +3 -20
  203. package/components/xy-labels/config.js.map +1 -1
  204. package/components/xy-labels/index.d.ts +4 -3
  205. package/components/xy-labels/index.js +3 -2
  206. package/components/xy-labels/index.js.map +1 -1
  207. package/components/xy-labels/modules/label.d.ts +3 -3
  208. package/components/xy-labels/modules/label.js +1 -1
  209. package/components/xy-labels/modules/label.js.map +1 -1
  210. package/containers/single-container/config.d.ts +2 -4
  211. package/containers/single-container/config.js +3 -8
  212. package/containers/single-container/config.js.map +1 -1
  213. package/containers/single-container/index.d.ts +4 -3
  214. package/containers/single-container/index.js +2 -2
  215. package/containers/single-container/index.js.map +1 -1
  216. package/containers/xy-container/config.d.ts +2 -22
  217. package/containers/xy-container/config.js +3 -26
  218. package/containers/xy-container/config.js.map +1 -1
  219. package/containers/xy-container/index.d.ts +5 -2
  220. package/containers/xy-container/index.js +7 -6
  221. package/containers/xy-container/index.js.map +1 -1
  222. package/core/component/config.d.ts +1 -6
  223. package/core/component/config.js +6 -12
  224. package/core/component/config.js.map +1 -1
  225. package/core/component/index.d.ts +7 -5
  226. package/core/component/index.js +14 -9
  227. package/core/component/index.js.map +1 -1
  228. package/core/container/config.d.ts +1 -21
  229. package/core/container/config.js +21 -25
  230. package/core/container/config.js.map +1 -1
  231. package/core/container/index.d.ts +5 -4
  232. package/core/container/index.js +4 -3
  233. package/core/container/index.js.map +1 -1
  234. package/core/xy-component/config.d.ts +2 -10
  235. package/core/xy-component/config.js +3 -16
  236. package/core/xy-component/config.js.map +1 -1
  237. package/core/xy-component/index.d.ts +5 -4
  238. package/core/xy-component/index.js +2 -0
  239. package/core/xy-component/index.js.map +1 -1
  240. package/data-models/map-graph.d.ts +1 -1
  241. package/data-models/map-graph.js +4 -7
  242. package/data-models/map-graph.js.map +1 -1
  243. package/package.json +3 -1
  244. package/styles/colors.d.ts +2 -2
  245. package/styles/index.d.ts +1 -1
  246. package/styles/patterns.js +2 -1
  247. package/styles/patterns.js.map +1 -1
  248. package/types/accessor.d.ts +5 -5
  249. package/types/component.js +2 -0
  250. package/types/component.js.map +1 -1
  251. package/utils/d3.d.ts +10 -1
  252. package/utils/d3.js.map +1 -1
  253. package/utils/data.d.ts +7 -7
  254. package/utils/data.js +2 -1
  255. package/utils/data.js.map +1 -1
  256. package/utils/text.js +2 -2
  257. package/utils/text.js.map +1 -1
  258. package/core/config/index.d.ts +0 -3
  259. package/core/config/index.js +0 -16
  260. package/core/config/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/leaflet-flow-map/index.ts"],"sourcesContent":["import { select } from 'd3-selection'\n\nimport { ComponentCore } from 'core/component'\nimport { ComponentType } from 'types/component'\n\n// Utils\nimport { ResizeObserver } from 'utils/resize-observer'\nimport { getNumber, throttle } from 'utils/data'\nimport { getDataLatLngBounds } from 'utils/map'\nimport { getColor } from 'utils/color'\n\n// Components\nimport { LeafletMap } from 'components/leaflet-map'\n\n// Types\nimport { Bounds } from 'components/leaflet-map/types'\nimport { GenericDataRecord } from 'types/data'\n\n// Config\nimport { LeafletFlowMapConfig, LeafletFlowMapConfigInterface } from './config'\n\n// Local Types\nimport { LatLon, Particle } from './types'\n\n// Renderer\nimport { PointRenderer as PointRendererType } from './renderer'\n\nexport class LeafletFlowMap<\n PointDatum extends GenericDataRecord,\n FlowDatum extends GenericDataRecord,\n> extends ComponentCore<\n { points: PointDatum[]; flows?: FlowDatum[] },\n LeafletFlowMapConfig<PointDatum, FlowDatum>,\n LeafletFlowMapConfigInterface<PointDatum, FlowDatum>\n > {\n static selectors = LeafletMap.selectors\n type = ComponentType.HTML\n private leafletMap: LeafletMap<PointDatum>\n private leafletMapInstance: L.Map\n private flows: FlowDatum[] = []\n private points: PointDatum[] = []\n private hoveredSourcePoint: FlowDatum | undefined\n private onCanvasMouseMoveBound = throttle(this.onCanvasMouseMove.bind(this), 60)\n private onCanvasClickBound = this.onCanvasClick.bind(this)\n private canvasElement: HTMLCanvasElement | undefined\n config: LeafletFlowMapConfig<PointDatum, FlowDatum> = new LeafletFlowMapConfig()\n private panningOffset = { x: 0, y: 0 }\n\n private resizeObserver: ResizeObserver | undefined\n private renderer: PointRendererType | undefined\n particles: Particle[] = []\n\n constructor (container: HTMLDivElement, config?: LeafletFlowMapConfigInterface<PointDatum, FlowDatum>, data?: { points: PointDatum[]; flows?: FlowDatum[] }) {\n super(ComponentType.HTML)\n\n this.leafletMap = new LeafletMap<PointDatum>(container, config, data?.points ?? [])\n\n const rendererImportPromise = import('./renderer')\n Promise.all([rendererImportPromise, this.leafletMap.getLeafletInstancePromise()])\n .then((imports) => {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const [{ PointRenderer }, leaflet] = imports\n\n this.leafletMapInstance = leaflet\n const canvasContainer = this.leafletMapInstance.getPanes().overlayPane as HTMLDivElement\n\n // Initialize renderer\n const canvas = select(canvasContainer).insert('canvas', ':first-child')\n this.canvasElement = canvas.node()\n this.renderer = new PointRenderer(canvasContainer, container.offsetWidth, container.offsetHeight, this.canvasElement)\n this.canvasElement.addEventListener('mousemove', this.onCanvasMouseMoveBound)\n this.canvasElement.addEventListener('click', this.onCanvasClickBound)\n\n this.leafletMap._onMapMoveEndInternal = this.onMapMove.bind(this)\n\n // Update renderer size on container resize\n this.resizeObserver = new ResizeObserver(() => {\n this.renderer.setSize(container.offsetWidth, container.offsetHeight)\n })\n this.resizeObserver.observe(container)\n\n if (config) this.setConfig(config)\n if (data) this.setData(data)\n this.animate()\n })\n }\n\n setConfig (config: LeafletFlowMapConfigInterface<PointDatum, FlowDatum>): void {\n super.setConfig(config)\n this.leafletMap.setConfig({ ...config, clusteringDistance: 0 })\n }\n\n setData (data: { points: PointDatum[]; flows?: FlowDatum[] }): void {\n super.setData(data)\n this.flows = data.flows\n this.points = data.points\n this.initParticles()\n this.leafletMap.setData(this.points)\n this.render()\n }\n\n render (): void {\n super.render()\n }\n\n initParticles (): void {\n this.clearParticles()\n for (const flow of this.flows) {\n const source = {\n lat: getNumber(flow, this.config.sourceLatitude),\n lon: getNumber(flow, this.config.sourceLongitude),\n }\n\n const target = {\n lat: getNumber(flow, this.config.targetLatitude),\n lon: getNumber(flow, this.config.targetLongitude),\n }\n\n // Add source particle, showing the origin of the flow\n const sourcePointRadius = getNumber(flow, this.config.sourcePointRadius)\n const sourcePointColor = getColor(flow, this.config.sourcePointColor)\n this.addParticle(source, source, source, 0, sourcePointRadius, sourcePointColor)\n\n // Add flow particles\n const dist = Math.sqrt((target.lat - source.lat) ** 2 + (target.lon - source.lon) ** 2)\n const numParticles = Math.round(dist * getNumber(flow, this.config.flowParticleDensity))\n const velocity = getNumber(flow, this.config.flowParticleSpeed)\n const r = getNumber(flow, this.config.flowParticleRadius)\n const color = getColor(flow, this.config.flowParticleColor)\n for (let i = 0; i < numParticles; i += 1) {\n const location = {\n lat: source.lat + (target.lat - source.lat) * i / numParticles,\n lon: source.lon + (target.lon - source.lon) * i / numParticles,\n }\n this.addParticle(source, target, location, velocity, r, color)\n }\n }\n\n this.renderer?.update(this.particles)\n }\n\n private addParticle (source: LatLon, target: LatLon, location = source, velocity = 0.05, r = 0.75, color?: string): void {\n const x = 0\n const y = 0\n this.particles.push({ x, y, source, target, location, velocity, r, color })\n }\n\n private clearParticles (): void {\n this.particles = []\n }\n\n private animate (): void {\n const map = this.leafletMapInstance\n\n requestAnimationFrame(() => {\n const zoomLevel = map?.getZoom()\n for (const p of this.particles) {\n const fullDist = Math.sqrt((p.target.lat - p.source.lat) ** 2 + (p.target.lon - p.source.lon) ** 2)\n const remainedDist = Math.sqrt((p.target.lat - p.location.lat) ** 2 + (p.target.lon - p.location.lon) ** 2)\n const angle = Math.atan2(p.target.lat - p.source.lat, p.target.lon - p.source.lon)\n p.location.lat += p.velocity * Math.sin(angle)\n p.location.lon += p.velocity * Math.cos(angle)\n\n if (\n (((p.target.lat > p.source.lat) && (p.location.lat > p.target.lat)) || ((p.target.lon > p.source.lon) && (p.location.lon > p.target.lon))) ||\n (((p.target.lat < p.source.lat) && (p.location.lat < p.target.lat)) || ((p.target.lon < p.source.lon) && (p.location.lon < p.target.lon)))\n ) {\n p.location.lat = p.source.lat\n p.location.lon = p.source.lon\n }\n\n const pos = map?.latLngToLayerPoint([p.location.lat, p.location.lon])\n const orthogonalArcShift = -(zoomLevel ** 2 * fullDist / 8) * Math.cos(Math.PI / 2 * (fullDist / 2 - remainedDist) / (fullDist / 2)) || 0\n p.x = pos?.x - this.panningOffset.x\n p.y = pos?.y + orthogonalArcShift - this.panningOffset.y\n }\n\n this.renderer.updatePointsPosition(this.particles)\n this.renderer.draw()\n this.animate()\n })\n }\n\n private getPointByScreenPos (x: number, y: number): [FlowDatum, number, number] | [] {\n const map = this.leafletMapInstance\n\n for (const flow of this.flows) {\n const lat = getNumber(flow, this.config.sourceLatitude)\n const lon = getNumber(flow, this.config.sourceLongitude)\n const r = getNumber(flow, this.config.sourcePointRadius)\n const pos = map?.latLngToLayerPoint([lat, lon])\n const posX = pos.x - this.panningOffset.x\n const posY = pos.y - this.panningOffset.y\n\n if ((Math.abs(x - posX) < r) && (Math.abs(y - posY) < r)) {\n return [flow, posX, posY]\n }\n }\n\n return []\n }\n\n private onCanvasMouseMove (event: MouseEvent): void {\n const { config } = this\n\n this.canvasElement.style.removeProperty('cursor')\n const [hoveredPoint, x, y] = this.getPointByScreenPos(event.offsetX, event.offsetY)\n if (hoveredPoint) this.canvasElement.style.cursor = 'default'\n\n if (this.hoveredSourcePoint !== hoveredPoint) {\n if (hoveredPoint) config.onSourcePointMouseEnter?.(hoveredPoint, x, y, event)\n if (this.hoveredSourcePoint) config.onSourcePointMouseLeave?.(this.hoveredSourcePoint, event)\n this.hoveredSourcePoint = hoveredPoint\n }\n }\n\n private onCanvasClick (event: MouseEvent): void {\n const { config } = this\n\n const [clickedPoint, x, y] = this.getPointByScreenPos(event.offsetX, event.offsetY)\n if (clickedPoint) config.onSourcePointClick?.(clickedPoint, x, y, event)\n }\n\n private onMapMove (leaflet: L.Map): void {\n const shift = leaflet.containerPointToLayerPoint([0, 0])\n this.panningOffset.x = shift.x\n this.panningOffset.y = shift.y\n this.canvasElement.style.transform = `translate(${shift.x}px, ${shift.y}px)`\n }\n\n public destroy (): void {\n this.resizeObserver?.disconnect()\n this.renderer?.destroy()\n this.canvasElement?.removeEventListener('mousemove', this.onCanvasMouseMoveBound)\n this.canvasElement?.removeEventListener('click', this.onCanvasClickBound)\n super.destroy()\n }\n\n // Leaflet Map useful methods\n public selectPointById (id: string, centerPoint = false): void { this.leafletMap.selectPointById(id, centerPoint) }\n public getSelectedPointId (): string | number | undefined { return this.leafletMap.getSelectedPointId() }\n public unselectPoint (): void { this.leafletMap.unselectPoint() }\n public zoomToPointById (id: string, selectNode = false, customZoomLevel?: number): void { this.leafletMap.zoomToPointById(id, selectNode, customZoomLevel) }\n public zoomIn (increment = 1): void { this.leafletMap.zoomIn(increment) }\n public zoomOut (increment = 1): void { this.leafletMap.zoomOut(increment) }\n public setZoom (zoomLevel: number): void { this.leafletMap.setZoom(zoomLevel) }\n public fitView (): void {\n const points: { lat: number; lon: number }[] = []\n\n for (const point of this.points) {\n points.push({\n lat: getNumber(point, this.config.pointLatitude),\n lon: getNumber(point, this.config.pointLongitude),\n })\n }\n\n for (const flow of this.flows) {\n const source = {\n lat: getNumber(flow, this.config.sourceLatitude),\n lon: getNumber(flow, this.config.sourceLongitude),\n }\n\n const target = {\n lat: getNumber(flow, this.config.targetLatitude),\n lon: getNumber(flow, this.config.targetLongitude),\n }\n\n points.push(source)\n points.push(target)\n }\n\n const boundsArray = getDataLatLngBounds(points, d => d.lat, d => d.lon, 0)\n const bounds: Bounds = {\n northEast: { lat: boundsArray[0][0], lng: boundsArray[1][1] },\n southWest: { lat: boundsArray[1][0], lng: boundsArray[0][1] },\n }\n this.leafletMap.fitToBounds(bounds)\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AA2BM,MAAO,cAGX,SAAQ,aAIP,CAAA;AAkBD,IAAA,WAAA,CAAa,SAAyB,EAAE,MAA6D,EAAE,IAAoD,EAAA;;AACzJ,QAAA,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;AAjB3B,QAAA,IAAA,CAAA,IAAI,GAAG,aAAa,CAAC,IAAI,CAAA;QAGjB,IAAK,CAAA,KAAA,GA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AM,GAAG;gBACb,GAAG,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;gBAChD,GAAG,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;aAClD,CAAA;AAED,YAAA,MAAM,MAAM,GAAG;gBACb,GAAG,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;gBAChD,GAAG,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;aAClD,CAAA;AAED,YAAA,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACnB,YAAA,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACpB,SAAA;QAED,MAAM,WAAW,GAAG,mBAAmB,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;AAC1E,QAAA,MAAM,MAAM,GAAW;YACrB,SAAS,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YAC7D,SAAS,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;SAC9D,CAAA;AACD,QAAA,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;KACpC;;AAlPM,cAAA,CAAA,SAAS,GAAG,UAAU,CAAC,SAAS;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/leaflet-flow-map/index.ts"],"sourcesContent":["import { select } from 'd3-selection'\n\nimport { ComponentCore } from 'core/component'\nimport { ComponentType } from 'types/component'\n\n// Utils\nimport { ResizeObserver } from 'utils/resize-observer'\nimport { getNumber, throttle } from 'utils/data'\nimport { getDataLatLngBounds } from 'utils/map'\nimport { getColor } from 'utils/color'\n\n// Components\nimport { LeafletMap } from 'components/leaflet-map'\n\n// Types\nimport { Bounds } from 'components/leaflet-map/types'\nimport { GenericDataRecord } from 'types/data'\n\n// Config\nimport { LeafletFlowMapDefaultConfig, LeafletFlowMapConfigInterface } from './config'\n\n// Local Types\nimport { LatLon, Particle } from './types'\n\n// Renderer\nimport { PointRenderer as PointRendererType } from './renderer'\n\nexport class LeafletFlowMap<\n PointDatum extends GenericDataRecord,\n FlowDatum extends GenericDataRecord,\n> extends ComponentCore<\n { points: PointDatum[]; flows?: FlowDatum[] },\n LeafletFlowMapConfigInterface<PointDatum, FlowDatum>\n > {\n static selectors = LeafletMap.selectors\n protected _defaultConfig = LeafletFlowMapDefaultConfig as LeafletFlowMapConfigInterface<PointDatum, FlowDatum>\n public config: LeafletFlowMapConfigInterface<PointDatum, FlowDatum> = this._defaultConfig\n\n type = ComponentType.HTML\n private leafletMap: LeafletMap<PointDatum>\n private leafletMapInstance: L.Map\n private flows: FlowDatum[] = []\n private points: PointDatum[] = []\n private hoveredSourcePoint: FlowDatum | undefined\n private onCanvasMouseMoveBound = throttle(this.onCanvasMouseMove.bind(this), 60)\n private onCanvasClickBound = this.onCanvasClick.bind(this)\n private canvasElement: HTMLCanvasElement | undefined\n private panningOffset = { x: 0, y: 0 }\n\n private resizeObserver: ResizeObserver | undefined\n private renderer: PointRendererType | undefined\n particles: Particle[] = []\n\n constructor (container: HTMLDivElement, config?: LeafletFlowMapConfigInterface<PointDatum, FlowDatum>, data?: { points: PointDatum[]; flows?: FlowDatum[] }) {\n super(ComponentType.HTML)\n\n this.leafletMap = new LeafletMap<PointDatum>(container, config, data?.points ?? [])\n\n const rendererImportPromise = import('./renderer')\n Promise.all([rendererImportPromise, this.leafletMap.getLeafletInstancePromise()])\n .then((imports) => {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const [{ PointRenderer }, leaflet] = imports\n\n this.leafletMapInstance = leaflet\n const canvasContainer = this.leafletMapInstance.getPanes().overlayPane as HTMLDivElement\n\n // Initialize renderer\n const canvas = select(canvasContainer).insert('canvas', ':first-child')\n this.canvasElement = canvas.node()\n this.renderer = new PointRenderer(canvasContainer, container.offsetWidth, container.offsetHeight, this.canvasElement)\n this.canvasElement.addEventListener('mousemove', this.onCanvasMouseMoveBound)\n this.canvasElement.addEventListener('click', this.onCanvasClickBound)\n\n this.leafletMap._onMapMoveEndInternal = this.onMapMove.bind(this)\n\n // Update renderer size on container resize\n this.resizeObserver = new ResizeObserver(() => {\n this.renderer.setSize(container.offsetWidth, container.offsetHeight)\n })\n this.resizeObserver.observe(container)\n\n if (config) this.setConfig(config)\n if (data) this.setData(data)\n this.animate()\n })\n }\n\n setConfig (config: LeafletFlowMapConfigInterface<PointDatum, FlowDatum>): void {\n super.setConfig(config)\n this.leafletMap.setConfig({ ...config, clusteringDistance: 0 })\n }\n\n setData (data: { points: PointDatum[]; flows?: FlowDatum[] }): void {\n super.setData(data)\n this.flows = data.flows\n this.points = data.points\n this.initParticles()\n this.leafletMap.setData(this.points)\n this.render()\n }\n\n render (): void {\n super.render()\n }\n\n initParticles (): void {\n this.clearParticles()\n for (const flow of this.flows) {\n const source = {\n lat: getNumber(flow, this.config.sourceLatitude),\n lon: getNumber(flow, this.config.sourceLongitude),\n }\n\n const target = {\n lat: getNumber(flow, this.config.targetLatitude),\n lon: getNumber(flow, this.config.targetLongitude),\n }\n\n // Add source particle, showing the origin of the flow\n const sourcePointRadius = getNumber(flow, this.config.sourcePointRadius)\n const sourcePointColor = getColor(flow, this.config.sourcePointColor)\n this.addParticle(source, source, source, 0, sourcePointRadius, sourcePointColor)\n\n // Add flow particles\n const dist = Math.sqrt((target.lat - source.lat) ** 2 + (target.lon - source.lon) ** 2)\n const numParticles = Math.round(dist * getNumber(flow, this.config.flowParticleDensity))\n const velocity = getNumber(flow, this.config.flowParticleSpeed)\n const r = getNumber(flow, this.config.flowParticleRadius)\n const color = getColor(flow, this.config.flowParticleColor)\n for (let i = 0; i < numParticles; i += 1) {\n const location = {\n lat: source.lat + (target.lat - source.lat) * i / numParticles,\n lon: source.lon + (target.lon - source.lon) * i / numParticles,\n }\n this.addParticle(source, target, location, velocity, r, color)\n }\n }\n\n this.renderer?.update(this.particles)\n }\n\n private addParticle (source: LatLon, target: LatLon, location = source, velocity = 0.05, r = 0.75, color?: string): void {\n const x = 0\n const y = 0\n this.particles.push({ x, y, source, target, location, velocity, r, color })\n }\n\n private clearParticles (): void {\n this.particles = []\n }\n\n private animate (): void {\n const map = this.leafletMapInstance\n\n requestAnimationFrame(() => {\n const zoomLevel = map?.getZoom()\n for (const p of this.particles) {\n const fullDist = Math.sqrt((p.target.lat - p.source.lat) ** 2 + (p.target.lon - p.source.lon) ** 2)\n const remainedDist = Math.sqrt((p.target.lat - p.location.lat) ** 2 + (p.target.lon - p.location.lon) ** 2)\n const angle = Math.atan2(p.target.lat - p.source.lat, p.target.lon - p.source.lon)\n p.location.lat += p.velocity * Math.sin(angle)\n p.location.lon += p.velocity * Math.cos(angle)\n\n if (\n (((p.target.lat > p.source.lat) && (p.location.lat > p.target.lat)) || ((p.target.lon > p.source.lon) && (p.location.lon > p.target.lon))) ||\n (((p.target.lat < p.source.lat) && (p.location.lat < p.target.lat)) || ((p.target.lon < p.source.lon) && (p.location.lon < p.target.lon)))\n ) {\n p.location.lat = p.source.lat\n p.location.lon = p.source.lon\n }\n\n const pos = map?.latLngToLayerPoint([p.location.lat, p.location.lon])\n const orthogonalArcShift = -(zoomLevel ** 2 * fullDist / 8) * Math.cos(Math.PI / 2 * (fullDist / 2 - remainedDist) / (fullDist / 2)) || 0\n p.x = pos?.x - this.panningOffset.x\n p.y = pos?.y + orthogonalArcShift - this.panningOffset.y\n }\n\n this.renderer.updatePointsPosition(this.particles)\n this.renderer.draw()\n this.animate()\n })\n }\n\n private getPointByScreenPos (x: number, y: number): [FlowDatum, number, number] | [] {\n const map = this.leafletMapInstance\n\n for (const flow of this.flows) {\n const lat = getNumber(flow, this.config.sourceLatitude)\n const lon = getNumber(flow, this.config.sourceLongitude)\n const r = getNumber(flow, this.config.sourcePointRadius)\n const pos = map?.latLngToLayerPoint([lat, lon])\n const posX = pos.x - this.panningOffset.x\n const posY = pos.y - this.panningOffset.y\n\n if ((Math.abs(x - posX) < r) && (Math.abs(y - posY) < r)) {\n return [flow, posX, posY]\n }\n }\n\n return []\n }\n\n private onCanvasMouseMove (event: MouseEvent): void {\n const { config } = this\n\n this.canvasElement.style.removeProperty('cursor')\n const [hoveredPoint, x, y] = this.getPointByScreenPos(event.offsetX, event.offsetY)\n if (hoveredPoint) this.canvasElement.style.cursor = 'default'\n\n if (this.hoveredSourcePoint !== hoveredPoint) {\n if (hoveredPoint) config.onSourcePointMouseEnter?.(hoveredPoint, x, y, event)\n if (this.hoveredSourcePoint) config.onSourcePointMouseLeave?.(this.hoveredSourcePoint, event)\n this.hoveredSourcePoint = hoveredPoint\n }\n }\n\n private onCanvasClick (event: MouseEvent): void {\n const { config } = this\n\n const [clickedPoint, x, y] = this.getPointByScreenPos(event.offsetX, event.offsetY)\n if (clickedPoint) config.onSourcePointClick?.(clickedPoint, x, y, event)\n }\n\n private onMapMove (leaflet: L.Map): void {\n const shift = leaflet.containerPointToLayerPoint([0, 0])\n this.panningOffset.x = shift.x\n this.panningOffset.y = shift.y\n this.canvasElement.style.transform = `translate(${shift.x}px, ${shift.y}px)`\n }\n\n public destroy (): void {\n this.resizeObserver?.disconnect()\n this.renderer?.destroy()\n this.canvasElement?.removeEventListener('mousemove', this.onCanvasMouseMoveBound)\n this.canvasElement?.removeEventListener('click', this.onCanvasClickBound)\n super.destroy()\n }\n\n // Leaflet Map useful methods\n public selectPointById (id: string, centerPoint = false): void { this.leafletMap.selectPointById(id, centerPoint) }\n public getSelectedPointId (): string | number | undefined { return this.leafletMap.getSelectedPointId() }\n public unselectPoint (): void { this.leafletMap.unselectPoint() }\n public zoomToPointById (id: string, selectNode = false, customZoomLevel?: number): void { this.leafletMap.zoomToPointById(id, selectNode, customZoomLevel) }\n public zoomIn (increment = 1): void { this.leafletMap.zoomIn(increment) }\n public zoomOut (increment = 1): void { this.leafletMap.zoomOut(increment) }\n public setZoom (zoomLevel: number): void { this.leafletMap.setZoom(zoomLevel) }\n public fitView (): void {\n const points: { lat: number; lon: number }[] = []\n\n for (const point of this.points) {\n points.push({\n lat: getNumber(point, this.config.pointLatitude),\n lon: getNumber(point, this.config.pointLongitude),\n })\n }\n\n for (const flow of this.flows) {\n const source = {\n lat: getNumber(flow, this.config.sourceLatitude),\n lon: getNumber(flow, this.config.sourceLongitude),\n }\n\n const target = {\n lat: getNumber(flow, this.config.targetLatitude),\n lon: getNumber(flow, this.config.targetLongitude),\n }\n\n points.push(source)\n points.push(target)\n }\n\n const boundsArray = getDataLatLngBounds(points, d => d.lat, d => d.lon, 0)\n const bounds: Bounds = {\n northEast: { lat: boundsArray[0][0], lng: boundsArray[1][1] },\n southWest: { lat: boundsArray[1][0], lng: boundsArray[0][1] },\n }\n this.leafletMap.fitToBounds(bounds)\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AA2BM,MAAO,cAGX,SAAQ,aAGP,CAAA;AAoBD,IAAA,WAAA,CAAa,SAAyB,EAAE,MAA6D,EAAE,IAAoD,EAAA;;AACzJ,QAAA,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;QAnBjB,IAAc,CAAA,cAAA,GAAG,2BAAmF,CAAA;AACvG,QAAA,IAAA,CAAA,MAAM,GAAyD,IAAI,CAAC,cAAc,CAAA;AAEzF,QAAA,IAAA,CAAA,IAAI,GAAG,aAAa,CAAC,IAAI,CAAA;QAGjB,IAAK,CAAA,KAAA,GAAgB,EAAE,CAAA;QACvB,IAAM,CAAA,MAAA,GAAiB,EAAE,CAAA;AAEzB,QAAA,IAAA,CAAA,sBAAsB,GAAG,QAAQ,CAAC,IAAI,CAAC,iBAA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,MAAM,GAAG;gBACb,GAAG,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;gBAChD,GAAG,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;aAClD,CAAA;AAED,YAAA,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACnB,YAAA,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACpB,SAAA;QAED,MAAM,WAAW,GAAG,mBAAmB,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;AAC1E,QAAA,MAAM,MAAM,GAAW;YACrB,SAAS,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YAC7D,SAAS,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;SAC9D,CAAA;AACD,QAAA,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;KACpC;;AApPM,cAAA,CAAA,SAAS,GAAG,UAAU,CAAC,SAAS;;;;"}
@@ -1,4 +1,4 @@
1
- import { ComponentConfig, ComponentConfigInterface } from "../../core/component/config";
1
+ import { ComponentConfigInterface } from "../../core/component/config";
2
2
  import { Tooltip } from "../tooltip";
3
3
  import { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from "../../types/accessor";
4
4
  import { GenericDataRecord } from "../../types/data";
@@ -56,7 +56,7 @@ export interface LeafletMapConfigInterface<Datum extends GenericDataRecord> exte
56
56
  /** Point shape accessor function or constant value. Default: `d => d.shape` */
57
57
  pointShape?: GenericAccessor<LeafletMapPointShape | string, Datum>;
58
58
  /** Point color accessor function or constant value. Default: `d => d.color` */
59
- pointColor?: ColorAccessor<Datum>;
59
+ pointColor?: ColorAccessor<LeafletMapPointDatum<Datum>>;
60
60
  /** Point radius accessor function or constant value. Default: `undefined` */
61
61
  pointRadius?: NumericAccessor<LeafletMapPointDatum<Datum>>;
62
62
  /** Point inner label accessor function. Default: `undefined` */
@@ -76,7 +76,7 @@ export interface LeafletMapConfigInterface<Datum extends GenericDataRecord> exte
76
76
  /** Set selected point by its unique id. Default: `undefined` */
77
77
  selectedPointId?: string;
78
78
  /** Cluster color accessor function or constant value. Default: `undefined` */
79
- clusterColor?: ColorAccessor<Datum>;
79
+ clusterColor?: ColorAccessor<LeafletMapClusterDatum<Datum>>;
80
80
  /** Cluster radius accessor function or constant value. Default: `undefined` */
81
81
  clusterRadius?: NumericAccessor<LeafletMapClusterDatum<Datum>>;
82
82
  /** Cluster inner label accessor function. Default: `d => d.point_count` */
@@ -140,59 +140,4 @@ export interface LeafletMapConfigInterface<Datum extends GenericDataRecord> exte
140
140
  */
141
141
  ariaLabel?: string | null | undefined;
142
142
  }
143
- export declare class LeafletMapConfig<Datum extends GenericDataRecord> extends ComponentConfig implements LeafletMapConfigInterface<Datum> {
144
- width: any;
145
- height: any;
146
- flyToDuration: number;
147
- fitViewPadding: [number, number];
148
- zoomDuration: number;
149
- initialBounds: any;
150
- fitBoundsOnUpdate: any;
151
- fitViewOnInit: boolean;
152
- fitViewOnUpdate: boolean;
153
- attribution: string[];
154
- accessToken: string;
155
- style: any;
156
- styleDarkTheme: any;
157
- renderer: LeafletMapRenderer;
158
- onMapInitialized: any;
159
- onMapMoveZoom: any;
160
- onMapMoveStart: any;
161
- onMapMoveEnd: any;
162
- onMapZoomStart: any;
163
- onMapZoomEnd: any;
164
- onMapClick: any;
165
- pointLongitude: (d: Datum) => number;
166
- pointLatitude: (d: Datum) => number;
167
- pointId: (d: Datum) => string;
168
- pointShape: (d: Datum) => string;
169
- pointColor: (d: Datum) => string;
170
- pointRadius: any;
171
- pointLabel: any;
172
- pointLabelColor: any;
173
- pointBottomLabel: string;
174
- pointCursor: any;
175
- pointRingWidth: number;
176
- selectedPointId: any;
177
- clusterColor: any;
178
- clusterRadius: any;
179
- clusterLabel: (d: LeafletMapClusterDatum<Datum>) => string;
180
- clusterLabelColor: any;
181
- clusterBottomLabel: string;
182
- clusterRingWidth: number;
183
- clusterBackground: boolean;
184
- clusterExpandOnClick: boolean;
185
- clusteringDistance: number;
186
- colorMap: LeafletMapPointStyles<Datum>;
187
- topoJSONLayer: {
188
- sources: any;
189
- fillOpacity: number;
190
- strokeOpacity: number;
191
- strokeWidth: number;
192
- featureName: any;
193
- fillProperty: any;
194
- strokeProperty: any;
195
- };
196
- tooltip: any;
197
- ariaLabel: any;
198
- }
143
+ export declare const LeafletMapDefaultConfig: LeafletMapConfigInterface<GenericDataRecord>;
@@ -1,72 +1,28 @@
1
- import { ComponentConfig } from '../../core/component/config.js';
1
+ import { ComponentDefaultConfig } from '../../core/component/config.js';
2
2
  import { LeafletMapRenderer } from './types.js';
3
3
 
4
- /* eslint-disable dot-notation, no-irregular-whitespace */
5
- class LeafletMapConfig extends ComponentConfig {
6
- constructor() {
7
- super(...arguments);
8
- // General
9
- this.width = undefined;
10
- this.height = undefined;
11
- this.flyToDuration = 1500;
12
- this.fitViewPadding = [150, 150];
13
- this.zoomDuration = 800;
14
- this.initialBounds = undefined;
15
- this.fitBoundsOnUpdate = undefined;
16
- this.fitViewOnInit = true;
17
- this.fitViewOnUpdate = false;
18
- this.attribution = ['<a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>'];
19
- this.accessToken = '';
20
- this.style = undefined;
21
- this.styleDarkTheme = undefined;
22
- this.renderer = LeafletMapRenderer.MapLibre;
23
- // Map events
24
- this.onMapInitialized = undefined;
25
- this.onMapMoveZoom = undefined;
26
- this.onMapMoveStart = undefined;
27
- this.onMapMoveEnd = undefined;
28
- this.onMapZoomStart = undefined;
29
- this.onMapZoomEnd = undefined;
30
- this.onMapClick = undefined;
31
- // Point
32
- this.pointLongitude = (d) => d['longitude'];
33
- this.pointLatitude = (d) => d['latitude'];
34
- this.pointId = (d) => d['id'];
35
- this.pointShape = (d) => d['shape'];
36
- this.pointColor = (d) => d['color'];
37
- this.pointRadius = undefined;
38
- this.pointLabel = undefined;
39
- this.pointLabelColor = undefined;
40
- this.pointBottomLabel = '';
41
- this.pointCursor = null;
42
- this.pointRingWidth = 1.25;
43
- this.selectedPointId = undefined;
44
- // Cluster
45
- this.clusterColor = undefined;
46
- this.clusterRadius = undefined;
47
- this.clusterLabel = (d) => `${d.point_count}`;
48
- this.clusterLabelColor = undefined;
49
- this.clusterBottomLabel = '';
50
- this.clusterRingWidth = 1.25;
51
- this.clusterBackground = true;
52
- this.clusterExpandOnClick = true;
53
- this.clusteringDistance = 55;
54
- this.colorMap = {};
55
- // TopoJSON Overlay
56
- this.topoJSONLayer = {
57
- sources: undefined,
58
- fillOpacity: 0.6,
59
- strokeOpacity: 0.8,
60
- strokeWidth: 1,
61
- featureName: undefined,
62
- fillProperty: undefined,
63
- strokeProperty: undefined,
64
- };
65
- // Misc
66
- this.tooltip = undefined;
67
- this.ariaLabel = undefined;
68
- }
69
- }
4
+ /* eslint-disable no-irregular-whitespace */
5
+ const LeafletMapDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfig), {
6
+ // General
7
+ width: undefined, height: undefined, flyToDuration: 1500, fitViewPadding: [150, 150], zoomDuration: 800, initialBounds: undefined, fitBoundsOnUpdate: undefined, fitViewOnInit: true, fitViewOnUpdate: false, attribution: ['<a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>'], accessToken: '', style: undefined, styleDarkTheme: undefined, renderer: LeafletMapRenderer.MapLibre,
8
+ // Map events
9
+ onMapInitialized: undefined, onMapMoveZoom: undefined, onMapMoveStart: undefined, onMapMoveEnd: undefined, onMapZoomStart: undefined, onMapZoomEnd: undefined, onMapClick: undefined,
10
+ // Point
11
+ pointLongitude: (d) => d.longitude, pointLatitude: (d) => d.latitude, pointId: (d) => d.id, pointShape: (d) => d.shape, pointColor: (d) => d.color, pointRadius: undefined, pointLabel: undefined, pointLabelColor: undefined, pointBottomLabel: '', pointCursor: null, pointRingWidth: 1.25, selectedPointId: undefined,
12
+ // Cluster
13
+ clusterColor: undefined, clusterRadius: undefined, clusterLabel: (d) => `${d.point_count}`, clusterLabelColor: undefined, clusterBottomLabel: '', clusterRingWidth: 1.25, clusterBackground: true, clusterExpandOnClick: true, clusteringDistance: 55, colorMap: {},
14
+ // TopoJSON Overlay
15
+ topoJSONLayer: {
16
+ sources: undefined,
17
+ fillOpacity: 0.6,
18
+ strokeOpacity: 0.8,
19
+ strokeWidth: 1,
20
+ featureName: undefined,
21
+ fillProperty: undefined,
22
+ strokeProperty: undefined,
23
+ },
24
+ // Misc
25
+ tooltip: undefined, ariaLabel: undefined });
70
26
 
71
- export { LeafletMapConfig };
27
+ export { LeafletMapDefaultConfig };
72
28
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../../src/components/leaflet-map/config.ts"],"sourcesContent":["/* eslint-disable dot-notation, no-irregular-whitespace */\n\n// Core\nimport { ComponentConfig, ComponentConfigInterface } from 'core/component/config'\nimport { Tooltip } from 'components/tooltip'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\n// Local Types\nimport {\n Bounds,\n LeafletMapPointStyles,\n MapZoomState,\n LeafletMapPointDatum,\n LeafletMapPointShape,\n LeafletMapClusterDatum,\n LeafletMapRenderer,\n} from './types'\n\n// Renderer settings\nimport { MapLibreStyleSpecs } from './renderer/map-style'\n\nexport interface LeafletMapConfigInterface<Datum extends GenericDataRecord> extends ComponentConfigInterface {\n // General\n /** Width in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n width?: number | string;\n /** Height in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n height?: number | string;\n /** Animation duration when the map is automatically panning or zooming to a point or area. Default: `1500` ms */\n flyToDuration?: number;\n /** Padding to be used when the `fitView` function has been called. The value is in pixels, [topLeft, bottomRight]. Default: `[150, 150]` */\n fitViewPadding?: [number, number];\n /** Animation duration for the `setZoom` function. Default: `800` ms */\n zoomDuration?: number;\n /** Default bounds that will be applied on the first map render if the bounds property is not set. Default: `undefined` */\n initialBounds?: Bounds;\n /** Force set map bounds on config and data updates. Default: `undefined` */\n fitBoundsOnUpdate?: Bounds;\n /** Fit the view to contain the data points on map initialization. Default: `true` */\n fitViewOnInit?: boolean;\n /** Fit the view to contain the data points on map config and data updates. Default: `false` */\n fitViewOnUpdate?: boolean;\n /** MapLibre `StyleSpecification` settings, or a URL to it. When renderer is set to`LeafletMapRenderer.Raster`, provide a template URL. Default: `undefined` */\n style: MapLibreStyleSpecs | string | undefined;\n /** MapLibre `StyleSpecification` settings or URL for dark theme. Default: `undefined` */\n styleDarkTheme?: MapLibreStyleSpecs | string | undefined;\n /** Tile server access token or API key. Default: `''` */\n accessToken?: string;\n /** Array of attribution labels. Default: `['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>']` */\n attribution?: string[];\n /** Rendering mode for map's tile layer. For raster files, use `LeafletMapRenderer.Raster`. Default: `LeafletMapRenderer.MapLibre` */\n renderer?: LeafletMapRenderer | string;\n\n // Map events\n /** Function to be called after the map's async initialization is done. Default: `undefined` */\n onMapInitialized?: (() => void);\n /** Map Move / Zoom unified callback function. Default: `undefined` */\n onMapMoveZoom?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move Start callback function. Default: `undefined` */\n onMapMoveStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move End callback function. Default: `undefined` */\n onMapMoveEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Start callback function. Default: `undefined` */\n onMapZoomStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom End callback function. Default: `undefined` */\n onMapZoomEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Click callback function. Default: `undefined` */\n onMapClick?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n\n // Point\n /** Point longitude accessor function. Default: `d => d.longitude` */\n pointLongitude?: NumericAccessor<Datum>;\n /** Point latitude accessor function. Default: `d => d.latitude` */\n pointLatitude?: NumericAccessor<Datum>;\n /** Point id accessor function or constant value. Default: `d => d.id` */\n pointId?: StringAccessor<Datum>;\n /** Point shape accessor function or constant value. Default: `d => d.shape` */\n pointShape?: GenericAccessor<LeafletMapPointShape | string, Datum>;\n /** Point color accessor function or constant value. Default: `d => d.color` */\n pointColor?: ColorAccessor<Datum>;\n /** Point radius accessor function or constant value. Default: `undefined` */\n pointRadius?: NumericAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label accessor function. Default: `undefined` */\n pointLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-point-inner-label-text-color-light` or to `--vis-map-point-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n pointLabelColor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point bottom label accessor function. Default: `''` */\n pointBottomLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point cursor value or accessor function. Default: `null` */\n pointCursor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** The width of the ring when a point has a `LeafletMapPointShape.Ring` shape. Default: `1.25` */\n pointRingWidth?: number;\n /** Set selected point by its unique id. Default: `undefined` */\n selectedPointId?: string;\n\n // Cluster\n /** Cluster color accessor function or constant value. Default: `undefined` */\n clusterColor?: ColorAccessor<Datum>;\n /** Cluster radius accessor function or constant value. Default: `undefined` */\n clusterRadius?: NumericAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label accessor function. Default: `d => d.point_count` */\n clusterLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-cluster-inner-label-text-color-light` or to `--vis-map-cluster-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n clusterLabelColor?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster bottom label accessor function. Default: `''` */\n clusterBottomLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** The width of the cluster point ring. Default: `1.25` */\n clusterRingWidth?: number;\n /** When cluster is expanded, show a background circle to better separate points from the base map. Default: `true` */\n clusterBackground?: boolean;\n /** Defines whether the cluster should expand on click or not. Default: `true` */\n clusterExpandOnClick?: boolean;\n /** Clustering distance in pixels. This value will be passed to Supercluster as the `radius` property https://github.com/mapbox/supercluster. Default: `55` */\n clusteringDistance?: number;\n /** A single map point can have multiple properties displayed as a small pie chart (or a donut chart for a cluster of points).\n * By setting the colorMap configuration you can specify data properties that should be mapped to various pie / donut segments.\n *\n * ```\n * {\n *  [key in keyof Datum]?: { color: string, className?: string }\n * }\n * ```\n * e.g.:\n * ```\n * {\n *  healthy: { color: 'green' },\n *  warning: { color: 'orange' },\n *  danger: { color: 'red' }\n * }\n * ```\n * where every data point has the `healthy`, `warning` and `danger` numerical or boolean property.\n */\n colorMap?: LeafletMapPointStyles<Datum>;\n\n // TopoJSON overlay\n /** A TopoJSON Geometry layer to be displayed on top of the map. Supports fill and stroke */\n topoJSONLayer?: {\n /** The TopoJSON.Topology object. Default: `undefined` */\n sources: any;\n /** Name of the geometry feature to be displayed. Default: `undefined` */\n featureName?: string;\n /** Name of the property to be used for defining the fill color of the geometry. Default: `undefined` */\n fillProperty?: string;\n /** Name of the property to be used for defining the stroke color of the geometry. Default: `undefined` */\n strokeProperty?: string;\n /** Geometry fill opacity value. Default: `0.6` */\n fillOpacity?: number;\n /** Geometry stroke opacity value. Default: `0.8` */\n strokeOpacity?: number;\n /** Geometry stroke width. Default: `2` */\n strokeWidth?: number;\n };\n\n // Misc\n /** Tooltip component. Default: `undefined` */\n tooltip?: Tooltip;\n\n /** Alternative text description of the chart for accessibility purposes. It will be applied as an\n * `aria-label` attribute to the div element containing your chart. Default: `undefined`.\n */\n ariaLabel?: string | null | undefined;\n}\n\nexport class LeafletMapConfig<Datum extends GenericDataRecord> extends ComponentConfig implements LeafletMapConfigInterface<Datum> {\n // General\n width = undefined\n height = undefined\n flyToDuration = 1500\n fitViewPadding = [150, 150] as [number, number]\n zoomDuration = 800\n initialBounds = undefined\n fitBoundsOnUpdate = undefined\n fitViewOnInit = true\n fitViewOnUpdate = false\n attribution = ['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>']\n accessToken = ''\n style = undefined\n styleDarkTheme = undefined\n renderer = LeafletMapRenderer.MapLibre\n\n // Map events\n onMapInitialized = undefined\n onMapMoveZoom = undefined\n onMapMoveStart = undefined\n onMapMoveEnd = undefined\n onMapZoomStart = undefined\n onMapZoomEnd = undefined\n onMapClick = undefined\n\n // Point\n pointLongitude = (d: Datum): number => d['longitude'] as number\n pointLatitude = (d: Datum): number => d['latitude'] as number\n pointId = (d: Datum): string => d['id'] as string\n pointShape = (d: Datum): string => d['shape'] as string\n pointColor = (d: Datum): string => d['color'] as string\n pointRadius = undefined\n pointLabel = undefined\n pointLabelColor = undefined\n pointBottomLabel = ''\n pointCursor = null\n pointRingWidth = 1.25\n selectedPointId = undefined\n\n // Cluster\n clusterColor = undefined\n clusterRadius = undefined\n clusterLabel = (d: LeafletMapClusterDatum<Datum>): string => `${d.point_count}`\n clusterLabelColor = undefined\n clusterBottomLabel = ''\n clusterRingWidth = 1.25\n clusterBackground = true\n clusterExpandOnClick = true\n clusteringDistance = 55\n colorMap = {} as LeafletMapPointStyles<Datum>\n\n // TopoJSON Overlay\n topoJSONLayer = {\n sources: undefined,\n fillOpacity: 0.6,\n strokeOpacity: 0.8,\n strokeWidth: 1,\n featureName: undefined,\n fillProperty: undefined,\n strokeProperty: undefined,\n }\n\n // Misc\n tooltip = undefined\n ariaLabel = undefined\n}\n"],"names":[],"mappings":";;;AAAA;AA6KM,MAAO,gBAAkD,SAAQ,eAAe,CAAA;AAAtF,IAAA,WAAA,GAAA;;;QAEE,IAAK,CAAA,KAAA,GAAG,SAAS,CAAA;QACjB,IAAM,CAAA,MAAA,GAAG,SAAS,CAAA;QAClB,IAAa,CAAA,aAAA,GAAG,IAAI,CAAA;AACpB,QAAA,IAAA,CAAA,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,CAAqB,CAAA;QAC/C,IAAY,CAAA,YAAA,GAAG,GAAG,CAAA;QAClB,IAAa,CAAA,aAAA,GAAG,SAAS,CAAA;QACzB,IAAiB,CAAA,iBAAA,GAAG,SAAS,CAAA;QAC7B,IAAa,CAAA,aAAA,GAAG,IAAI,CAAA;QACpB,IAAe,CAAA,eAAA,GAAG,KAAK,CAAA;AACvB,QAAA,IAAA,CAAA,WAAW,GAAG,CAAC,kGAAkG,CAAC,CAAA;QAClH,IAAW,CAAA,WAAA,GAAG,EAAE,CAAA;QAChB,IAAK,CAAA,KAAA,GAAG,SAAS,CAAA;QACjB,IAAc,CAAA,cAAA,GAAG,SAAS,CAAA;AAC1B,QAAA,IAAA,CAAA,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,CAAA;;QAGtC,IAAgB,CAAA,gBAAA,GAAG,SAAS,CAAA;QAC5B,IAAa,CAAA,aAAA,GAAG,SAAS,CAAA;QACzB,IAAc,CAAA,cAAA,GAAG,SAAS,CAAA;QAC1B,IAAY,CAAA,YAAA,GAAG,SAAS,CAAA;QACxB,IAAc,CAAA,cAAA,GAAG,SAAS,CAAA;QAC1B,IAAY,CAAA,YAAA,GAAG,SAAS,CAAA;QACxB,IAAU,CAAA,UAAA,GAAG,SAAS,CAAA;;QAGtB,IAAc,CAAA,cAAA,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E,SAAS;AAClB,YAAA,WAAW,EAAE,GAAG;AAChB,YAAA,aAAa,EAAE,GAAG;AAClB,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,WAAW,EAAE,SAAS;AACtB,YAAA,YAAY,EAAE,SAAS;AACvB,YAAA,cAAc,EAAE,SAAS;SAC1B,CAAA;;QAGD,IAAO,CAAA,OAAA,GAAG,SAAS,CAAA;QACnB,IAAS,CAAA,SAAA,GAAG,SAAS,CAAA;KACtB;AAAA;;;;"}
1
+ {"version":3,"file":"config.js","sources":["../../../src/components/leaflet-map/config.ts"],"sourcesContent":["/* eslint-disable no-irregular-whitespace */\n\n// Core\nimport { ComponentDefaultConfig, ComponentConfigInterface } from 'core/component/config'\nimport { Tooltip } from 'components/tooltip'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\n// Local Types\nimport {\n Bounds,\n LeafletMapPointStyles,\n MapZoomState,\n LeafletMapPointDatum,\n LeafletMapPointShape,\n LeafletMapClusterDatum,\n LeafletMapRenderer,\n} from './types'\n\n// Renderer settings\nimport { MapLibreStyleSpecs } from './renderer/map-style'\n\nexport interface LeafletMapConfigInterface<Datum extends GenericDataRecord> extends ComponentConfigInterface {\n // General\n /** Width in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n width?: number | string;\n /** Height in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n height?: number | string;\n /** Animation duration when the map is automatically panning or zooming to a point or area. Default: `1500` ms */\n flyToDuration?: number;\n /** Padding to be used when the `fitView` function has been called. The value is in pixels, [topLeft, bottomRight]. Default: `[150, 150]` */\n fitViewPadding?: [number, number];\n /** Animation duration for the `setZoom` function. Default: `800` ms */\n zoomDuration?: number;\n /** Default bounds that will be applied on the first map render if the bounds property is not set. Default: `undefined` */\n initialBounds?: Bounds;\n /** Force set map bounds on config and data updates. Default: `undefined` */\n fitBoundsOnUpdate?: Bounds;\n /** Fit the view to contain the data points on map initialization. Default: `true` */\n fitViewOnInit?: boolean;\n /** Fit the view to contain the data points on map config and data updates. Default: `false` */\n fitViewOnUpdate?: boolean;\n /** MapLibre `StyleSpecification` settings, or a URL to it. When renderer is set to`LeafletMapRenderer.Raster`, provide a template URL. Default: `undefined` */\n style: MapLibreStyleSpecs | string | undefined;\n /** MapLibre `StyleSpecification` settings or URL for dark theme. Default: `undefined` */\n styleDarkTheme?: MapLibreStyleSpecs | string | undefined;\n /** Tile server access token or API key. Default: `''` */\n accessToken?: string;\n /** Array of attribution labels. Default: `['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>']` */\n attribution?: string[];\n /** Rendering mode for map's tile layer. For raster files, use `LeafletMapRenderer.Raster`. Default: `LeafletMapRenderer.MapLibre` */\n renderer?: LeafletMapRenderer | string;\n\n // Map events\n /** Function to be called after the map's async initialization is done. Default: `undefined` */\n onMapInitialized?: (() => void);\n /** Map Move / Zoom unified callback function. Default: `undefined` */\n onMapMoveZoom?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move Start callback function. Default: `undefined` */\n onMapMoveStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move End callback function. Default: `undefined` */\n onMapMoveEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Start callback function. Default: `undefined` */\n onMapZoomStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom End callback function. Default: `undefined` */\n onMapZoomEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Click callback function. Default: `undefined` */\n onMapClick?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n\n // Point\n /** Point longitude accessor function. Default: `d => d.longitude` */\n pointLongitude?: NumericAccessor<Datum>;\n /** Point latitude accessor function. Default: `d => d.latitude` */\n pointLatitude?: NumericAccessor<Datum>;\n /** Point id accessor function or constant value. Default: `d => d.id` */\n pointId?: StringAccessor<Datum>;\n /** Point shape accessor function or constant value. Default: `d => d.shape` */\n pointShape?: GenericAccessor<LeafletMapPointShape | string, Datum>;\n /** Point color accessor function or constant value. Default: `d => d.color` */\n pointColor?: ColorAccessor<LeafletMapPointDatum<Datum>>;\n /** Point radius accessor function or constant value. Default: `undefined` */\n pointRadius?: NumericAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label accessor function. Default: `undefined` */\n pointLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-point-inner-label-text-color-light` or to `--vis-map-point-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n pointLabelColor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point bottom label accessor function. Default: `''` */\n pointBottomLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point cursor value or accessor function. Default: `null` */\n pointCursor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** The width of the ring when a point has a `LeafletMapPointShape.Ring` shape. Default: `1.25` */\n pointRingWidth?: number;\n /** Set selected point by its unique id. Default: `undefined` */\n selectedPointId?: string;\n\n // Cluster\n /** Cluster color accessor function or constant value. Default: `undefined` */\n clusterColor?: ColorAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster radius accessor function or constant value. Default: `undefined` */\n clusterRadius?: NumericAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label accessor function. Default: `d => d.point_count` */\n clusterLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-cluster-inner-label-text-color-light` or to `--vis-map-cluster-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n clusterLabelColor?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster bottom label accessor function. Default: `''` */\n clusterBottomLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** The width of the cluster point ring. Default: `1.25` */\n clusterRingWidth?: number;\n /** When cluster is expanded, show a background circle to better separate points from the base map. Default: `true` */\n clusterBackground?: boolean;\n /** Defines whether the cluster should expand on click or not. Default: `true` */\n clusterExpandOnClick?: boolean;\n /** Clustering distance in pixels. This value will be passed to Supercluster as the `radius` property https://github.com/mapbox/supercluster. Default: `55` */\n clusteringDistance?: number;\n /** A single map point can have multiple properties displayed as a small pie chart (or a donut chart for a cluster of points).\n * By setting the colorMap configuration you can specify data properties that should be mapped to various pie / donut segments.\n *\n * ```\n * {\n *  [key in keyof Datum]?: { color: string, className?: string }\n * }\n * ```\n * e.g.:\n * ```\n * {\n *  healthy: { color: 'green' },\n *  warning: { color: 'orange' },\n *  danger: { color: 'red' }\n * }\n * ```\n * where every data point has the `healthy`, `warning` and `danger` numerical or boolean property.\n */\n colorMap?: LeafletMapPointStyles<Datum>;\n\n // TopoJSON overlay\n /** A TopoJSON Geometry layer to be displayed on top of the map. Supports fill and stroke */\n topoJSONLayer?: {\n /** The TopoJSON.Topology object. Default: `undefined` */\n sources: any;\n /** Name of the geometry feature to be displayed. Default: `undefined` */\n featureName?: string;\n /** Name of the property to be used for defining the fill color of the geometry. Default: `undefined` */\n fillProperty?: string;\n /** Name of the property to be used for defining the stroke color of the geometry. Default: `undefined` */\n strokeProperty?: string;\n /** Geometry fill opacity value. Default: `0.6` */\n fillOpacity?: number;\n /** Geometry stroke opacity value. Default: `0.8` */\n strokeOpacity?: number;\n /** Geometry stroke width. Default: `2` */\n strokeWidth?: number;\n };\n\n // Misc\n /** Tooltip component. Default: `undefined` */\n tooltip?: Tooltip;\n\n /** Alternative text description of the chart for accessibility purposes. It will be applied as an\n * `aria-label` attribute to the div element containing your chart. Default: `undefined`.\n */\n ariaLabel?: string | null | undefined;\n}\n\nexport const LeafletMapDefaultConfig: LeafletMapConfigInterface<GenericDataRecord> = {\n ...ComponentDefaultConfig,\n // General\n width: undefined,\n height: undefined,\n flyToDuration: 1500,\n fitViewPadding: [150, 150],\n zoomDuration: 800,\n initialBounds: undefined,\n fitBoundsOnUpdate: undefined,\n fitViewOnInit: true,\n fitViewOnUpdate: false,\n attribution: ['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>'],\n accessToken: '',\n style: undefined,\n styleDarkTheme: undefined,\n renderer: LeafletMapRenderer.MapLibre,\n\n // Map events\n onMapInitialized: undefined,\n onMapMoveZoom: undefined,\n onMapMoveStart: undefined,\n onMapMoveEnd: undefined,\n onMapZoomStart: undefined,\n onMapZoomEnd: undefined,\n onMapClick: undefined,\n\n // Point\n pointLongitude: (d: unknown): number => (d as { longitude: number }).longitude,\n pointLatitude: (d: unknown): number => (d as { latitude: number }).latitude,\n pointId: (d: unknown): string => (d as { id: string }).id,\n pointShape: (d: unknown): string => (d as { shape: string }).shape,\n pointColor: (d: unknown): string => (d as { color: string }).color,\n pointRadius: undefined,\n pointLabel: undefined,\n pointLabelColor: undefined,\n pointBottomLabel: '',\n pointCursor: null,\n pointRingWidth: 1.25,\n selectedPointId: undefined,\n\n // Cluster\n clusterColor: undefined,\n clusterRadius: undefined,\n clusterLabel: <Datum extends GenericDataRecord>(d: LeafletMapClusterDatum<Datum>): string => `${d.point_count}`,\n clusterLabelColor: undefined,\n clusterBottomLabel: '',\n clusterRingWidth: 1.25,\n clusterBackground: true,\n clusterExpandOnClick: true,\n clusteringDistance: 55,\n colorMap: {},\n\n // TopoJSON Overlay\n topoJSONLayer: {\n sources: undefined,\n fillOpacity: 0.6,\n strokeOpacity: 0.8,\n strokeWidth: 1,\n featureName: undefined,\n fillProperty: undefined,\n strokeProperty: undefined,\n },\n\n // Misc\n tooltip: undefined,\n ariaLabel: undefined,\n}\n"],"names":[],"mappings":";;;AAAA;AA6KO,MAAM,uBAAuB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAC/B,sBAAsB,CAAA,EAA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B,gBAAgB,EAAE,IAAI,EACtB,iBAAiB,EAAE,IAAI,EACvB,oBAAoB,EAAE,IAAI,EAC1B,kBAAkB,EAAE,EAAE,EACtB,QAAQ,EAAE,EAAE;;AAGZ,IAAA,aAAa,EAAE;AACb,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,WAAW,EAAE,GAAG;AAChB,QAAA,aAAa,EAAE,GAAG;AAClB,QAAA,WAAW,EAAE,CAAC;AACd,QAAA,WAAW,EAAE,SAAS;AACtB,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,cAAc,EAAE,SAAS;AAC1B,KAAA;;AAGD,IAAA,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,SAAS;;;;"}
@@ -6,9 +6,9 @@ import { MapDataModel } from "../../data-models/map";
6
6
  import { ComponentType } from "../../types/component";
7
7
  import { GenericDataRecord } from "../../types/data";
8
8
  import { Bounds, LeafletMapPoint } from './types';
9
- import { LeafletMapConfig, LeafletMapConfigInterface } from './config';
9
+ import { LeafletMapConfigInterface } from './config';
10
10
  import * as s from './style';
11
- export declare class LeafletMap<Datum extends GenericDataRecord> extends ComponentCore<Datum[], LeafletMapConfig<Datum>, LeafletMapConfigInterface<Datum>> {
11
+ export declare class LeafletMap<Datum extends GenericDataRecord> extends ComponentCore<Datum[], LeafletMapConfigInterface<Datum>> {
12
12
  static selectors: typeof s;
13
13
  static cssVariables: {
14
14
  mapContainerBackgroundColor: "--vis-map-container-background-color";
@@ -43,10 +43,11 @@ export declare class LeafletMap<Datum extends GenericDataRecord> extends Compone
43
43
  darkMapPointBottomLabelTextColor: "--vis-dark-map-point-bottom-label-text-color";
44
44
  darkMapClusterExpandedBackgroundFillColor: "--vis-dark-map-cluster-expanded-background-fill-color";
45
45
  };
46
+ protected _defaultConfig: LeafletMapConfigInterface<Datum>;
47
+ config: LeafletMapConfigInterface<Datum>;
46
48
  g: Selection<HTMLElement, unknown, null, undefined>;
47
49
  type: ComponentType;
48
50
  element: HTMLElement;
49
- config: LeafletMapConfig<Datum>;
50
51
  datamodel: MapDataModel<Datum>;
51
52
  protected _container: HTMLElement;
52
53
  protected _containerSelection: Selection<HTMLElement, unknown, null, undefined>;
@@ -78,7 +79,7 @@ export declare class LeafletMap<Datum extends GenericDataRecord> extends Compone
78
79
  private _flyToBoundsAnimationFrameId;
79
80
  readonly _leafletInitializationPromise: Promise<L.Map>;
80
81
  static DEFAULT_CONTAINER_HEIGHT: number;
81
- events: {
82
+ protected events: {
82
83
  [x: string]: {
83
84
  mouseup: (d: LeafletMapPoint<Datum>, event: MouseEvent) => void;
84
85
  mousedown: (d: LeafletMapPoint<Datum>, event: MouseEvent) => void;
@@ -8,7 +8,7 @@ import { isString, getNumber, isNil, getString, clamp } from '../../utils/data.j
8
8
  import { constraintMapViewThrottled } from './renderer/mapboxgl-utils.js';
9
9
  import { calculateClusterIndex, projectPoint, findPointAndClusterByPointId, getNodeRelativePosition, bBoxMerge, shouldClusterExpand, getNextZoomLevelOnClusterClick, getPointRadius, getClusterRadius, getClustersAndPoints, geoJsonPointToScreenPoint } from './modules/utils.js';
10
10
  import { LeafletMapRenderer } from './types.js';
11
- import { LeafletMapConfig } from './config.js';
11
+ import { LeafletMapDefaultConfig } from './config.js';
12
12
  import * as style from './style.js';
13
13
  import { root, map, svgOverlay, backgroundRect, points, clusterBackground, pointSelectionRing, point, variables } from './style.js';
14
14
  import { setupMap, initialMapCenter, initialMapZoom, updateTopoJson } from './modules/map.js';
@@ -19,8 +19,9 @@ import { createBackgroundNode, updateBackgroundNode } from './modules/clusterBac
19
19
  class LeafletMap extends ComponentCore {
20
20
  constructor(container, config, data) {
21
21
  super(ComponentType.HTML);
22
+ this._defaultConfig = LeafletMapDefaultConfig;
23
+ this.config = this._defaultConfig;
22
24
  this.type = ComponentType.HTML;
23
- this.config = new LeafletMapConfig();
24
25
  this.datamodel = new MapDataModel();
25
26
  this._expandedCluster = null;
26
27
  this._cancelBackgroundClick = false;
@@ -141,7 +142,7 @@ class LeafletMap extends ComponentCore {
141
142
  }
142
143
  }
143
144
  setConfig(config) {
144
- this.config = new LeafletMapConfig().init(config);
145
+ super.setConfig(config);
145
146
  if (config.width)
146
147
  this._containerSelection.style('width', isString(config.width) ? config.width : `${config.width}px`);
147
148
  if (config.height)