@guardian/interactive-component-library 0.2.0-rc1 → 0.2.0-rc2

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 (335) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +8 -0
  2. package/dist/_virtual/dayjs.min.js +4 -0
  3. package/dist/_virtual/relativeTime.js +4 -0
  4. package/dist/components/index.d.ts +3 -0
  5. package/dist/components/molecules/canvas-map/Map.d.ts +17 -0
  6. package/dist/components/molecules/canvas-map/Map.js +89 -0
  7. package/dist/components/molecules/canvas-map/context/MapContext.d.ts +19 -0
  8. package/dist/components/molecules/canvas-map/context/MapContext.js +20 -0
  9. package/dist/components/molecules/canvas-map/controls/ZoomControl.d.ts +6 -0
  10. package/dist/components/molecules/canvas-map/controls/ZoomControl.js +40 -0
  11. package/dist/components/molecules/canvas-map/controls/icons/index.d.ts +3 -0
  12. package/dist/components/molecules/canvas-map/controls/icons/minus.d.ts +1 -0
  13. package/dist/components/molecules/canvas-map/controls/icons/minus.js +25 -0
  14. package/dist/components/molecules/canvas-map/controls/icons/plus.d.ts +1 -0
  15. package/dist/components/molecules/canvas-map/controls/icons/plus.js +25 -0
  16. package/dist/components/molecules/canvas-map/controls/icons/reset.d.ts +3 -0
  17. package/dist/components/molecules/canvas-map/controls/icons/reset.js +25 -0
  18. package/dist/components/molecules/canvas-map/controls/index.d.ts +1 -0
  19. package/dist/components/molecules/canvas-map/controls/style.module.css.js +11 -0
  20. package/dist/components/molecules/canvas-map/index.d.ts +12 -0
  21. package/dist/components/molecules/canvas-map/lib/Feature.d.ts +38 -0
  22. package/dist/components/molecules/canvas-map/lib/Feature.js +104 -0
  23. package/dist/components/molecules/canvas-map/lib/FeatureCollection.d.ts +20 -0
  24. package/dist/components/molecules/canvas-map/lib/FeatureCollection.js +23 -0
  25. package/dist/components/molecules/canvas-map/lib/Map.d.ts +69 -0
  26. package/dist/components/molecules/canvas-map/lib/Map.js +254 -0
  27. package/dist/components/molecules/canvas-map/lib/View.d.ts +136 -0
  28. package/dist/components/molecules/canvas-map/lib/View.js +179 -0
  29. package/dist/components/molecules/canvas-map/lib/events/Dispatcher.d.ts +8 -0
  30. package/dist/components/molecules/canvas-map/lib/events/Dispatcher.js +35 -0
  31. package/dist/components/molecules/canvas-map/lib/events/MapEvent.d.ts +6 -0
  32. package/dist/components/molecules/canvas-map/lib/events/MapEvent.js +9 -0
  33. package/dist/components/molecules/canvas-map/lib/events/index.d.ts +2 -0
  34. package/dist/components/molecules/canvas-map/lib/formats/GeoJSON.d.ts +10 -0
  35. package/dist/components/molecules/canvas-map/lib/formats/GeoJSON.js +96 -0
  36. package/dist/components/molecules/canvas-map/lib/geometry/Geometry.d.ts +32 -0
  37. package/dist/components/molecules/canvas-map/lib/geometry/Geometry.js +41 -0
  38. package/dist/components/molecules/canvas-map/lib/geometry/LineString.d.ts +12 -0
  39. package/dist/components/molecules/canvas-map/lib/geometry/LineString.js +19 -0
  40. package/dist/components/molecules/canvas-map/lib/geometry/Point.d.ts +11 -0
  41. package/dist/components/molecules/canvas-map/lib/geometry/Point.js +16 -0
  42. package/dist/components/molecules/canvas-map/lib/geometry/Polygon.d.ts +16 -0
  43. package/dist/components/molecules/canvas-map/lib/geometry/Polygon.js +46 -0
  44. package/dist/components/molecules/canvas-map/lib/geometry/index.d.ts +4 -0
  45. package/dist/components/molecules/canvas-map/lib/interpolators/index.d.ts +2 -0
  46. package/dist/components/molecules/canvas-map/lib/interpolators/interpolateFeatures.d.ts +5 -0
  47. package/dist/components/molecules/canvas-map/lib/interpolators/interpolateFeatures.js +95 -0
  48. package/dist/components/molecules/canvas-map/lib/interpolators/interpolateStyles.d.ts +4 -0
  49. package/dist/components/molecules/canvas-map/lib/interpolators/interpolateStyles.js +65 -0
  50. package/dist/components/molecules/canvas-map/lib/layers/TextLayer.d.ts +52 -0
  51. package/dist/components/molecules/canvas-map/lib/layers/TextLayer.js +111 -0
  52. package/dist/components/molecules/canvas-map/lib/layers/VectorLayer.d.ts +53 -0
  53. package/dist/components/molecules/canvas-map/lib/layers/VectorLayer.js +132 -0
  54. package/dist/components/molecules/canvas-map/lib/layers/index.d.ts +3 -0
  55. package/dist/components/molecules/canvas-map/lib/projection/index.d.ts +22 -0
  56. package/dist/components/molecules/canvas-map/lib/projection/index.js +12 -0
  57. package/dist/components/molecules/canvas-map/lib/renderers/FeatureRenderer.d.ts +6 -0
  58. package/dist/components/molecules/canvas-map/lib/renderers/FeatureRenderer.js +46 -0
  59. package/dist/components/molecules/canvas-map/lib/renderers/MapRenderer.d.ts +6 -0
  60. package/dist/components/molecules/canvas-map/lib/renderers/MapRenderer.js +53 -0
  61. package/dist/components/molecules/canvas-map/lib/renderers/TextLayerRenderer.d.ts +17 -0
  62. package/dist/components/molecules/canvas-map/lib/renderers/TextLayerRenderer.js +119 -0
  63. package/dist/components/molecules/canvas-map/lib/renderers/VectorLayerRenderer.d.ts +10 -0
  64. package/dist/components/molecules/canvas-map/lib/renderers/VectorLayerRenderer.js +78 -0
  65. package/dist/components/molecules/canvas-map/lib/sources/VectorSource.d.ts +15 -0
  66. package/dist/components/molecules/canvas-map/lib/sources/VectorSource.js +56 -0
  67. package/dist/components/molecules/canvas-map/lib/styles/Fill.d.ts +7 -0
  68. package/dist/components/molecules/canvas-map/lib/styles/Fill.js +15 -0
  69. package/dist/components/molecules/canvas-map/lib/styles/Stroke.d.ts +8 -0
  70. package/dist/components/molecules/canvas-map/lib/styles/Stroke.js +16 -0
  71. package/dist/components/molecules/canvas-map/lib/styles/Style.d.ts +24 -0
  72. package/dist/components/molecules/canvas-map/lib/styles/Style.js +17 -0
  73. package/dist/components/molecules/canvas-map/lib/styles/Text.d.ts +10 -0
  74. package/dist/components/molecules/canvas-map/lib/styles/Text.js +14 -0
  75. package/dist/components/molecules/canvas-map/lib/styles/index.d.ts +4 -0
  76. package/dist/components/molecules/canvas-map/lib/util/array.d.ts +6 -0
  77. package/dist/components/molecules/canvas-map/lib/util/array.js +15 -0
  78. package/dist/components/molecules/canvas-map/lib/util/bboxFeature.d.ts +8 -0
  79. package/dist/components/molecules/canvas-map/lib/util/bboxFeature.js +26 -0
  80. package/dist/components/molecules/canvas-map/lib/util/debug.d.ts +11 -0
  81. package/dist/components/molecules/canvas-map/lib/util/debug.js +27 -0
  82. package/dist/components/molecules/canvas-map/lib/util/deflate.d.ts +36 -0
  83. package/dist/components/molecules/canvas-map/lib/util/distance.d.ts +1 -0
  84. package/dist/components/molecules/canvas-map/lib/util/distance.js +12 -0
  85. package/dist/components/molecules/canvas-map/lib/util/dom.d.ts +9 -0
  86. package/dist/components/molecules/canvas-map/lib/util/dom.js +28 -0
  87. package/dist/components/molecules/canvas-map/lib/util/extent.d.ts +21 -0
  88. package/dist/components/molecules/canvas-map/lib/util/extent.js +38 -0
  89. package/dist/components/molecules/canvas-map/lib/util/memoise.d.ts +10 -0
  90. package/dist/components/molecules/canvas-map/lib/util/memoise.js +20 -0
  91. package/dist/components/molecules/canvas-map/lib/util/resolution.d.ts +9 -0
  92. package/dist/components/molecules/canvas-map/lib/util/resolution.js +11 -0
  93. package/dist/components/molecules/canvas-map/lib/util/simplify.d.ts +114 -0
  94. package/dist/components/molecules/canvas-map/lib/util/size.d.ts +32 -0
  95. package/dist/components/molecules/canvas-map/lib/util/size.js +53 -0
  96. package/dist/components/molecules/canvas-map/lib/util/toRgba.d.ts +1 -0
  97. package/dist/components/molecules/canvas-map/lib/util/toRgba.js +25 -0
  98. package/dist/components/molecules/canvas-map/lib/util/uid.d.ts +5 -0
  99. package/dist/components/molecules/canvas-map/lib/util/uid.js +7 -0
  100. package/dist/components/molecules/canvas-map/lib/util/zoomLevel.d.ts +2 -0
  101. package/dist/components/molecules/canvas-map/lib/util/zoomLevel.js +14 -0
  102. package/dist/components/molecules/canvas-map/style.module.scss.js +20 -0
  103. package/dist/components/molecules/column-chart/column-chart-example.d.ts +35 -0
  104. package/dist/components/molecules/column-chart/column-chart-util.d.ts +1 -0
  105. package/dist/components/molecules/column-chart/index.d.ts +11 -0
  106. package/dist/components/molecules/column-chart/index.js +63 -0
  107. package/dist/components/molecules/column-chart/style.module.css.js +14 -0
  108. package/dist/components/molecules/control-change/index.d.ts +6 -0
  109. package/dist/components/molecules/control-change/index.js +29 -0
  110. package/dist/components/molecules/control-change/style.module.css.js +11 -0
  111. package/dist/components/molecules/dropdown/index.d.ts +11 -0
  112. package/dist/components/molecules/dropdown/index.js +191 -0
  113. package/dist/components/molecules/dropdown/style.module.css.js +50 -0
  114. package/dist/components/molecules/first-past-the-post-waffle/index.d.ts +5 -0
  115. package/dist/components/molecules/first-past-the-post-waffle/index.js +14 -0
  116. package/dist/components/molecules/first-past-the-post-waffle/style.module.css.js +14 -0
  117. package/dist/components/molecules/index.d.ts +17 -0
  118. package/dist/components/molecules/modal/index.d.ts +8 -0
  119. package/dist/components/molecules/modal/index.js +59 -0
  120. package/dist/components/molecules/modal/style.module.css.js +26 -0
  121. package/dist/components/molecules/page-section/index.d.ts +8 -0
  122. package/dist/components/molecules/page-section/index.js +52 -0
  123. package/dist/components/molecules/page-section/style.module.scss.js +20 -0
  124. package/dist/components/molecules/party-profile/index.d.ts +10 -0
  125. package/dist/components/molecules/party-profile/index.js +29 -0
  126. package/dist/components/molecules/party-profile/style.module.css.js +26 -0
  127. package/dist/components/molecules/refresh-indicator/index.d.ts +4 -0
  128. package/dist/components/molecules/refresh-indicator/index.js +18 -0
  129. package/dist/components/molecules/refresh-indicator/style.module.scss.js +17 -0
  130. package/dist/components/molecules/responsive-grid/index.d.ts +10 -0
  131. package/dist/components/molecules/responsive-grid/index.js +19 -0
  132. package/dist/components/molecules/responsive-grid/style.module.scss.js +8 -0
  133. package/dist/components/molecules/result-summary/index.d.ts +8 -0
  134. package/dist/components/molecules/result-summary/index.js +36 -0
  135. package/dist/components/molecules/result-summary/style.module.css.js +11 -0
  136. package/dist/components/molecules/search-input/icons/search.d.ts +1 -0
  137. package/dist/components/molecules/search-input/icons/search.js +24 -0
  138. package/dist/components/molecules/search-input/icons/search.module.css.js +11 -0
  139. package/dist/components/molecules/search-input/index.d.ts +11 -0
  140. package/dist/components/molecules/search-input/index.js +164 -0
  141. package/dist/components/molecules/search-input/style.module.css.js +32 -0
  142. package/dist/components/molecules/slope-chart/index.d.ts +16 -0
  143. package/dist/components/molecules/slope-chart/index.js +139 -0
  144. package/dist/components/molecules/slope-chart/style.module.css.js +35 -0
  145. package/dist/components/molecules/svg-map/context/MapContext.d.ts +1 -0
  146. package/dist/components/molecules/svg-map/context/MapContext.js +5 -0
  147. package/dist/components/molecules/svg-map/context/SVGMapProvider.d.ts +10 -0
  148. package/dist/components/molecules/svg-map/context/SVGMapProvider.js +88 -0
  149. package/dist/components/molecules/svg-map/helpers/bboxFeature.d.ts +8 -0
  150. package/dist/components/molecules/svg-map/helpers/bboxFeature.js +26 -0
  151. package/dist/components/molecules/svg-map/helpers/dynamicPropValue.d.ts +1 -0
  152. package/dist/components/molecules/svg-map/helpers/dynamicPropValue.js +9 -0
  153. package/dist/components/molecules/svg-map/helpers/geoMath.d.ts +4 -0
  154. package/dist/components/molecules/svg-map/helpers/saveSVG.d.ts +1 -0
  155. package/dist/components/molecules/svg-map/hooks/useCamera.d.ts +0 -0
  156. package/dist/components/molecules/svg-map/hooks/useThrowIfNonLayerChildren.d.ts +4 -0
  157. package/dist/components/molecules/svg-map/hooks/useThrowIfNonLayerChildren.js +19 -0
  158. package/dist/components/molecules/svg-map/index.d.ts +38 -0
  159. package/dist/components/molecules/svg-map/index.js +120 -0
  160. package/dist/components/molecules/svg-map/layers/CompositionBorders.d.ts +3 -0
  161. package/dist/components/molecules/svg-map/layers/CompositionBorders.js +14 -0
  162. package/dist/components/molecules/svg-map/layers/Line.d.ts +7 -0
  163. package/dist/components/molecules/svg-map/layers/Line.js +48 -0
  164. package/dist/components/molecules/svg-map/layers/Point.d.ts +10 -0
  165. package/dist/components/molecules/svg-map/layers/Point.js +59 -0
  166. package/dist/components/molecules/svg-map/layers/Polygon.d.ts +9 -0
  167. package/dist/components/molecules/svg-map/layers/Polygon.js +75 -0
  168. package/dist/components/molecules/svg-map/layers/Prerendered.d.ts +3 -0
  169. package/dist/components/molecules/svg-map/layers/Prerendered.js +11 -0
  170. package/dist/components/molecules/svg-map/layers/compositionBorders.module.scss.js +8 -0
  171. package/dist/components/molecules/svg-map/layers/index.d.ts +5 -0
  172. package/dist/components/molecules/svg-map/layers/index.js +12 -0
  173. package/dist/components/molecules/svg-map/renderers/SVGRenderer.d.ts +3 -0
  174. package/dist/components/molecules/svg-map/renderers/SVGRenderer.js +32 -0
  175. package/dist/components/molecules/svg-map/style.module.css.js +11 -0
  176. package/dist/components/molecules/table/index.d.ts +7 -0
  177. package/dist/components/molecules/table/index.js +90 -0
  178. package/dist/components/molecules/table/style.module.scss.js +29 -0
  179. package/dist/components/molecules/table/useTable.d.ts +8 -0
  180. package/dist/components/molecules/table/useTable.js +128 -0
  181. package/dist/components/molecules/tooltip/index.d.ts +82 -0
  182. package/dist/components/molecules/tooltip/index.js +117 -0
  183. package/dist/components/molecules/tooltip/style.module.css.js +8 -0
  184. package/dist/components/molecules/topline-result/index.d.ts +3 -0
  185. package/dist/components/molecules/topline-result/index.js +61 -0
  186. package/dist/components/molecules/topline-result/style.module.scss.js +38 -0
  187. package/dist/components/organisms/coalitions-tracker/index.d.ts +16 -0
  188. package/dist/components/organisms/coalitions-tracker/index.js +151 -0
  189. package/dist/components/organisms/coalitions-tracker/style.module.scss.js +32 -0
  190. package/dist/components/organisms/index.d.ts +2 -0
  191. package/dist/components/organisms/ticker/gradient/index.d.ts +1 -0
  192. package/dist/components/organisms/ticker/gradient/index.js +35 -0
  193. package/dist/components/organisms/ticker/gradient/style.module.scss.js +14 -0
  194. package/dist/components/organisms/ticker/index.d.ts +5 -0
  195. package/dist/components/organisms/ticker/index.js +102 -0
  196. package/dist/components/organisms/ticker/style.module.scss.js +32 -0
  197. package/dist/components/particles/ad-slot/index.d.ts +40 -0
  198. package/dist/components/particles/ad-slot/index.js +34 -0
  199. package/dist/components/particles/ad-slot/style.module.css.js +11 -0
  200. package/dist/components/particles/arrow-button/index.d.ts +6 -0
  201. package/dist/components/particles/arrow-button/index.js +32 -0
  202. package/dist/components/particles/arrow-button/style.module.css.js +11 -0
  203. package/dist/components/particles/aspect-ratio-box/index.d.ts +4 -0
  204. package/dist/components/particles/aspect-ratio-box/index.js +15 -0
  205. package/dist/components/particles/aspect-ratio-box/style.module.css.js +6 -0
  206. package/dist/components/particles/button/index.d.ts +6 -0
  207. package/dist/components/particles/button/index.js +10 -0
  208. package/dist/components/particles/button/style.module.css.js +11 -0
  209. package/dist/components/particles/change-bar/index.d.ts +8 -0
  210. package/dist/components/particles/change-bar/index.js +27 -0
  211. package/dist/components/particles/change-bar/style.module.scss.js +14 -0
  212. package/dist/components/particles/chevron/index.d.ts +6 -0
  213. package/dist/components/particles/chevron/index.js +78 -0
  214. package/dist/components/particles/chevron/style.module.css.js +20 -0
  215. package/dist/components/particles/circle-icon/index.d.ts +6 -0
  216. package/dist/components/particles/circle-icon/index.js +32 -0
  217. package/dist/components/particles/circle-icon/style.module.css.js +14 -0
  218. package/dist/components/particles/close-button/index.d.ts +5 -0
  219. package/dist/components/particles/close-button/index.js +35 -0
  220. package/dist/components/particles/close-button/style.module.css.js +17 -0
  221. package/dist/components/particles/container/index.d.ts +5 -0
  222. package/dist/components/particles/container/index.js +13 -0
  223. package/dist/components/particles/container/style.module.scss.js +11 -0
  224. package/dist/components/particles/gradient-icon/index.d.ts +1 -0
  225. package/dist/components/particles/gradient-icon/index.js +46 -0
  226. package/dist/components/particles/gradient-icon/style.module.css.js +14 -0
  227. package/dist/components/particles/index.d.ts +18 -0
  228. package/dist/components/particles/info-button/index.d.ts +3 -0
  229. package/dist/components/particles/info-button/index.js +19 -0
  230. package/dist/components/particles/info-button/style.module.css.js +11 -0
  231. package/dist/components/particles/legend-item/index.d.ts +6 -0
  232. package/dist/components/particles/legend-item/index.js +26 -0
  233. package/dist/components/particles/legend-item/style.module.css.js +17 -0
  234. package/dist/components/particles/relative-time-sentence/index.d.ts +4 -0
  235. package/dist/components/particles/relative-time-sentence/index.js +14 -0
  236. package/dist/components/particles/relative-time-sentence/style.module.css.js +8 -0
  237. package/dist/components/particles/square-cut-corner-icon/index.d.ts +6 -0
  238. package/dist/components/particles/square-cut-corner-icon/index.js +56 -0
  239. package/dist/components/particles/square-cut-corner-icon/style.module.scss.js +17 -0
  240. package/dist/components/particles/square-icon/index.d.ts +5 -0
  241. package/dist/components/particles/square-icon/index.js +28 -0
  242. package/dist/components/particles/square-icon/style.module.scss.js +11 -0
  243. package/dist/components/particles/stacked-bar/index.d.ts +23 -0
  244. package/dist/components/particles/stacked-bar/index.js +140 -0
  245. package/dist/components/particles/stacked-bar/style.module.css.js +17 -0
  246. package/dist/components/particles/stacked-grid/index.d.ts +6 -0
  247. package/dist/components/particles/stacked-grid/index.js +35 -0
  248. package/dist/components/particles/stacked-grid/style.module.css.js +20 -0
  249. package/dist/components/particles/waffle/index.d.ts +14 -0
  250. package/dist/components/particles/waffle/index.js +76 -0
  251. package/dist/components/particles/waffle/style.module.css.js +11 -0
  252. package/dist/index.d.ts +2 -0
  253. package/dist/index.js +128 -0
  254. package/dist/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js +338 -0
  255. package/dist/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js +13 -0
  256. package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/albersUk.js +108 -0
  257. package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/bounds.js +24 -0
  258. package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/fit.js +18 -0
  259. package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/math.js +4 -0
  260. package/dist/node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js +70 -0
  261. package/dist/node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js +6 -0
  262. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js +24 -0
  263. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js +4 -0
  264. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js +8 -0
  265. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js +20 -0
  266. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js +43 -0
  267. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js +28 -0
  268. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js +59 -0
  269. package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js +18 -0
  270. package/dist/node_modules/.pnpm/d3-path@2.0.0/node_modules/d3-path/src/path.js +73 -0
  271. package/dist/node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js +13 -0
  272. package/dist/node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js +96 -0
  273. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js +21 -0
  274. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js +5 -0
  275. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js +9 -0
  276. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js +39 -0
  277. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js +55 -0
  278. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js +42 -0
  279. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js +18 -0
  280. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js +18 -0
  281. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js +14 -0
  282. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js +15 -0
  283. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js +23 -0
  284. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js +16 -0
  285. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js +68 -0
  286. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js +11 -0
  287. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js +18 -0
  288. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js +23 -0
  289. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js +13 -0
  290. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js +125 -0
  291. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js +20 -0
  292. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js +24 -0
  293. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js +8 -0
  294. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js +47 -0
  295. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js +25 -0
  296. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js +18 -0
  297. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js +25 -0
  298. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js +22 -0
  299. package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js +64 -0
  300. package/dist/node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/dayjs.min.js +282 -0
  301. package/dist/node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/relativeTime.js +48 -0
  302. package/dist/node_modules/.pnpm/flatbush@4.4.0/node_modules/flatbush/index.js +339 -0
  303. package/dist/node_modules/.pnpm/flatqueue@2.0.3/node_modules/flatqueue/index.js +67 -0
  304. package/dist/node_modules/.pnpm/preact-merge-refs@1.0.2_preact@10.21.0/node_modules/preact-merge-refs/lib/preact-merge-refs.modern.js +10 -0
  305. package/dist/node_modules/.pnpm/preact-transitioning@1.4.1_preact@10.21.0/node_modules/preact-transitioning/lib/preact-transitioning.modern.js +63 -0
  306. package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.js +47 -0
  307. package/dist/node_modules/.pnpm/rbush-knn@4.0.0/node_modules/rbush-knn/index.js +42 -0
  308. package/dist/node_modules/.pnpm/rbush@4.0.0/node_modules/rbush/index.js +378 -0
  309. package/dist/node_modules/.pnpm/tinyqueue@2.0.3/node_modules/tinyqueue/index.js +65 -0
  310. package/dist/shared/colors/index.d.ts +2 -0
  311. package/dist/shared/helpers/createStore.d.ts +1 -0
  312. package/dist/shared/helpers/geometry.d.ts +3 -0
  313. package/dist/shared/helpers/geometry.js +16 -0
  314. package/dist/shared/helpers/geometry.test.d.ts +1 -0
  315. package/dist/shared/helpers/labelsUtil.d.ts +54 -0
  316. package/dist/shared/helpers/labelsUtil.js +58 -0
  317. package/dist/shared/helpers/labelsUtils.test.d.ts +1 -0
  318. package/dist/shared/helpers/shouldUpdate.d.ts +7 -0
  319. package/dist/shared/hooks/index.d.ts +3 -0
  320. package/dist/shared/hooks/useContainerSize.d.ts +1 -0
  321. package/dist/shared/hooks/useContainerSize.js +24 -0
  322. package/dist/shared/hooks/useTouchOrHover.d.ts +6 -0
  323. package/dist/shared/hooks/useTouchOrHover.js +95 -0
  324. package/dist/shared/hooks/useWindowSize.d.ts +4 -0
  325. package/dist/shared/hooks/useWindowSize.js +27 -0
  326. package/dist/style.css +74 -74
  327. package/dist/styles/helpers/mergeStyles.d.ts +1 -0
  328. package/dist/styles/helpers/mergeStyles.js +22 -0
  329. package/dist/styles/helpers/mergeStyles.test.d.ts +1 -0
  330. package/dist/styles/theme.config.d.ts +124 -0
  331. package/package.json +6 -9
  332. package/dist/interactive-component-library.js +0 -7993
  333. package/dist/interactive-component-library.js.map +0 -1
  334. package/dist/interactive-component-library.umd.cjs +0 -7989
  335. package/dist/interactive-component-library.umd.cjs.map +0 -1
@@ -0,0 +1,16 @@
1
+ import { memoise } from "../util/memoise.js";
2
+ import { toRgba } from "../util/toRgba.js";
3
+ class Stroke {
4
+ constructor(options) {
5
+ this.color = (options == null ? void 0 : options.color) || "#121212";
6
+ this.width = (options == null ? void 0 : options.width) || 0.5;
7
+ this.opacity = (options == null ? void 0 : options.opacity) || 1;
8
+ this._getRgba = memoise(toRgba);
9
+ }
10
+ getRgba() {
11
+ return this._getRgba(this.color, this.opacity);
12
+ }
13
+ }
14
+ export {
15
+ Stroke
16
+ };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * A function that takes a {@link import("../Feature").Feature} and returns a {@link Style}
3
+ *
4
+ * @typedef {function(import("../Feature").Feature):(Style)} StyleFunction
5
+ */
6
+ /**
7
+ * Class representing a style.
8
+ * @class
9
+ * @property {Object} properties - The properties of the style
10
+ * @property {Object} properties.stroke - The stroke color of the style
11
+ * @property {Object} properties.fill - The fill color of the style
12
+ * @property {Object} properties.text - The text color of the style
13
+ */
14
+ export class Style {
15
+ constructor(properties: any);
16
+ stroke: any;
17
+ fill: any;
18
+ text: any;
19
+ clone(): Style;
20
+ }
21
+ /**
22
+ * A function that takes a {@link import ("../Feature").Feature} and returns a {@link Style}
23
+ */
24
+ export type StyleFunction = (arg0: import('../Feature').Feature) => (Style);
@@ -0,0 +1,17 @@
1
+ class Style {
2
+ constructor(properties) {
3
+ this.stroke = properties == null ? void 0 : properties.stroke;
4
+ this.fill = properties == null ? void 0 : properties.fill;
5
+ this.text = properties == null ? void 0 : properties.text;
6
+ }
7
+ clone() {
8
+ return new Style({
9
+ stroke: this.stroke,
10
+ fill: this.fill,
11
+ text: this.text
12
+ });
13
+ }
14
+ }
15
+ export {
16
+ Style
17
+ };
@@ -0,0 +1,10 @@
1
+ export class Text {
2
+ constructor(options: any);
3
+ content: any;
4
+ fontFamily: any;
5
+ fontSize: any;
6
+ fontWeight: any;
7
+ lineHeight: any;
8
+ color: any;
9
+ textShadow: any;
10
+ }
@@ -0,0 +1,14 @@
1
+ class Text {
2
+ constructor(options) {
3
+ this.content = options == null ? void 0 : options.content;
4
+ this.fontFamily = (options == null ? void 0 : options.fontFamily) || "var(--text-sans)";
5
+ this.fontSize = (options == null ? void 0 : options.fontSize) || "17px";
6
+ this.fontWeight = (options == null ? void 0 : options.fontWeight) || "400";
7
+ this.lineHeight = (options == null ? void 0 : options.lineHeight) || 1.3;
8
+ this.color = (options == null ? void 0 : options.color) || "#121212";
9
+ this.textShadow = (options == null ? void 0 : options.textShadow) || "1px 1px 0px #f6f6f6, -1px -1px 0px #f6f6f6, -1px 1px 0px #f6f6f6, 1px -1px #f6f6f6";
10
+ }
11
+ }
12
+ export {
13
+ Text
14
+ };
@@ -0,0 +1,4 @@
1
+ export * from './Style';
2
+ export * from './Stroke';
3
+ export * from './Fill';
4
+ export * from './Text';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @param {Array<any>|Uint8ClampedArray} arr1 The first array to compare.
3
+ * @param {Array<any>|Uint8ClampedArray} arr2 The second array to compare.
4
+ * @return {boolean} Whether the two arrays are equal.
5
+ */
6
+ export function arrayEquals(arr1: Array<any> | Uint8ClampedArray, arr2: Array<any> | Uint8ClampedArray): boolean;
@@ -0,0 +1,15 @@
1
+ function arrayEquals(arr1, arr2) {
2
+ const len1 = arr1.length;
3
+ if (len1 !== arr2.length) {
4
+ return false;
5
+ }
6
+ for (let i = 0; i < len1; i++) {
7
+ if (arr1[i] !== arr2[i]) {
8
+ return false;
9
+ }
10
+ }
11
+ return true;
12
+ }
13
+ export {
14
+ arrayEquals
15
+ };
@@ -0,0 +1,8 @@
1
+ export function bboxFeature(bounds: any): {
2
+ type: string;
3
+ properties: {};
4
+ geometry: {
5
+ coordinates: any[][][];
6
+ type: string;
7
+ };
8
+ };
@@ -0,0 +1,26 @@
1
+ function bboxFeature(bounds) {
2
+ const minLon = bounds[0][0];
3
+ const minLat = bounds[0][1];
4
+ const maxLon = bounds[1][0];
5
+ const maxLat = bounds[1][1];
6
+ const feature = {
7
+ type: "Feature",
8
+ properties: {},
9
+ geometry: {
10
+ coordinates: [
11
+ [
12
+ [minLon, maxLat],
13
+ [maxLon, maxLat],
14
+ [maxLon, minLat],
15
+ [minLon, minLat],
16
+ [minLon, maxLat]
17
+ ]
18
+ ],
19
+ type: "Polygon"
20
+ }
21
+ };
22
+ return feature;
23
+ }
24
+ export {
25
+ bboxFeature
26
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @function
3
+ * @param {Array<import('../geometry').Geometry>} geometries
4
+ */
5
+ export function validateGeometries(geometries: Array<import('../geometry').Geometry>): void;
6
+ /**
7
+ *
8
+ * @param {import('../Feature').Feature | Object} feature - The feature you want to inspect
9
+ * @returns {string} URL to geojson.io, with feature embedded
10
+ */
11
+ export function generateDebugUrl(feature: import('../Feature').Feature | any, convertToGeoJSON?: boolean): string;
@@ -0,0 +1,27 @@
1
+ function validateGeometries(geometries) {
2
+ if (!Array.isArray(geometries)) {
3
+ throw new Error("geometries must be an array");
4
+ }
5
+ geometries.forEach((geometry) => {
6
+ var _a;
7
+ if (!geometry.type) {
8
+ throw new Error("geometry must have a type");
9
+ }
10
+ if (!((_a = geometry.coordinates) == null ? void 0 : _a.length)) {
11
+ throw new Error("geometry must have coordinates");
12
+ }
13
+ });
14
+ }
15
+ function generateDebugUrl(feature, convertToGeoJSON = true) {
16
+ const featureGeoJSON = convertToGeoJSON ? feature.getGeoJSON() : feature;
17
+ const featureCollection = {
18
+ type: "FeatureCollection",
19
+ features: [featureGeoJSON]
20
+ };
21
+ const jsonString = encodeURIComponent(JSON.stringify(featureCollection));
22
+ return `https://geojson.io/#data=data:application/json,${jsonString}`;
23
+ }
24
+ export {
25
+ generateDebugUrl,
26
+ validateGeometries
27
+ };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @module ol/geom/flat/deflate
3
+ */
4
+ /**
5
+ * @param {Array<number>} flatCoordinates Flat coordinates.
6
+ * @param {number} offset Offset.
7
+ * @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
8
+ * @return {number} offset Offset.
9
+ */
10
+ export function deflateCoordinate(flatCoordinates: Array<number>, offset: number, coordinate: any): number;
11
+ /**
12
+ * @param {Array<number>} flatCoordinates Flat coordinates.
13
+ * @param {number} offset Offset.
14
+ * @param {Array<import("../../coordinate.js").Coordinate>} coordinates Coordinates.
15
+ * @param {number} stride Stride.
16
+ * @return {number} offset Offset.
17
+ */
18
+ export function deflateCoordinates(flatCoordinates: Array<number>, offset: number, coordinates: Array<any>, stride: number): number;
19
+ /**
20
+ * @param {Array<number>} flatCoordinates Flat coordinates.
21
+ * @param {number} offset Offset.
22
+ * @param {Array<Array<import("../../coordinate.js").Coordinate>>} coordinatess Coordinatess.
23
+ * @param {number} stride Stride.
24
+ * @param {Array<number>} [ends] Ends.
25
+ * @return {Array<number>} Ends.
26
+ */
27
+ export function deflateCoordinatesArray(flatCoordinates: Array<number>, offset: number, coordinatess: Array<Array<any>>, stride: number, ends?: Array<number>): Array<number>;
28
+ /**
29
+ * @param {Array<number>} flatCoordinates Flat coordinates.
30
+ * @param {number} offset Offset.
31
+ * @param {Array<Array<Array<import("../../coordinate.js").Coordinate>>>} coordinatesss Coordinatesss.
32
+ * @param {number} stride Stride.
33
+ * @param {Array<Array<number>>} [endss] Endss.
34
+ * @return {Array<Array<number>>} Endss.
35
+ */
36
+ export function deflateMultiCoordinatesArray(flatCoordinates: Array<number>, offset: number, coordinatesss: Array<Array<Array<any>>>, stride: number, endss?: Array<Array<number>>): Array<Array<number>>;
@@ -0,0 +1 @@
1
+ export function haversineDistance(lat1: any, lon1: any, lat2: any, lon2: any): number;
@@ -0,0 +1,12 @@
1
+ function haversineDistance(lat1, lon1, lat2, lon2) {
2
+ const R = 6371e3;
3
+ const toRadians = (degrees) => degrees * Math.PI / 180;
4
+ const dLat = toRadians(lat2 - lat1);
5
+ const dLon = toRadians(lon2 - lon1);
6
+ const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(toRadians(lat1)) * Math.cos(toRadians(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2);
7
+ const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
8
+ return R * c;
9
+ }
10
+ export {
11
+ haversineDistance
12
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Transform the children of a parent node so they match the
3
+ * provided list of children. This function aims to efficiently
4
+ * remove, add, and reorder child nodes while maintaining a simple
5
+ * implementation (it is not guaranteed to minimize DOM operations).
6
+ * @param {Node} node The parent node whose children need reworking.
7
+ * @param {Array<Node>} children The desired children.
8
+ */
9
+ export function replaceChildren(node: Node, children: Array<Node>): void;
@@ -0,0 +1,28 @@
1
+ function replaceChildren(node, children) {
2
+ const oldChildren = node.childNodes;
3
+ let done = false;
4
+ for (let i = 0; !done; ++i) {
5
+ const oldChild = oldChildren[i];
6
+ const newChild = children[i];
7
+ if (!oldChild && !newChild) {
8
+ done = true;
9
+ break;
10
+ }
11
+ if (oldChild === newChild) {
12
+ continue;
13
+ }
14
+ if (!oldChild) {
15
+ node.appendChild(newChild);
16
+ continue;
17
+ }
18
+ if (!newChild) {
19
+ node.removeChild(oldChild);
20
+ --i;
21
+ continue;
22
+ }
23
+ node.insertBefore(newChild, oldChild);
24
+ }
25
+ }
26
+ export {
27
+ replaceChildren
28
+ };
@@ -0,0 +1,21 @@
1
+ export function extentForCoordinates(coordinates: any): number[];
2
+ export function combineExtents(extent1: any, extent2: any): number[];
3
+ /**
4
+ * Check if the passed coordinate is contained or on the edge of the extent.
5
+ *
6
+ * @param {Extent} extent Extent.
7
+ * @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
8
+ * @return {boolean} The coordinate is contained in the extent.
9
+ * @api
10
+ */
11
+ export function containsCoordinate(extent: Extent, coordinate: any): boolean;
12
+ /**
13
+ * Check if the passed coordinate is contained or on the edge of the extent.
14
+ *
15
+ * @param {Extent} extent Extent.
16
+ * @param {number} x X coordinate.
17
+ * @param {number} y Y coordinate.
18
+ * @return {boolean} The x, y values are contained in the extent.
19
+ * @api
20
+ */
21
+ export function containsXY(extent: Extent, x: number, y: number): boolean;
@@ -0,0 +1,38 @@
1
+ function extentForCoordinates(coordinates) {
2
+ let minX = Infinity, minY = Infinity;
3
+ let maxX = -Infinity, maxY = -Infinity;
4
+ for (const coordinate of coordinates) {
5
+ if (coordinate[0] < minX) {
6
+ minX = coordinate[0];
7
+ }
8
+ if (coordinate[0] > maxX) {
9
+ maxX = coordinate[0];
10
+ }
11
+ if (coordinate[1] < minY) {
12
+ minY = coordinate[1];
13
+ }
14
+ if (coordinate[1] > maxY) {
15
+ maxY = coordinate[1];
16
+ }
17
+ }
18
+ return [minX, minY, maxX, maxY];
19
+ }
20
+ function combineExtents(extent1, extent2) {
21
+ const minX = Math.min(extent1[0], extent2[0]);
22
+ const minY = Math.min(extent1[1], extent2[1]);
23
+ const maxX = Math.max(extent1[2], extent2[2]);
24
+ const maxY = Math.max(extent1[3], extent2[3]);
25
+ return [minX, minY, maxX, maxY];
26
+ }
27
+ function containsCoordinate(extent, coordinate) {
28
+ return containsXY(extent, coordinate[0], coordinate[1]);
29
+ }
30
+ function containsXY(extent, x, y) {
31
+ return extent[0] <= x && x <= extent[2] && extent[1] <= y && y <= extent[3];
32
+ }
33
+ export {
34
+ combineExtents,
35
+ containsCoordinate,
36
+ containsXY,
37
+ extentForCoordinates
38
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Wraps a function in another function that remembers the last return. If the
3
+ * returned function is called twice in a row with the same arguments and the same
4
+ * this object, it will return the value from the first call in the second call.
5
+ * @function
6
+ * @template ReturnType
7
+ * @param {function(...any): ReturnType} fn - The function to memoise
8
+ * @returns {function(...any): ReturnType} The memoised function
9
+ */
10
+ export function memoise<ReturnType>(fn: (...args: any[]) => ReturnType): (...args: any[]) => ReturnType;
@@ -0,0 +1,20 @@
1
+ import { arrayEquals } from "./array.js";
2
+ function memoise(fn) {
3
+ let called = false;
4
+ let lastResult;
5
+ let lastArgs;
6
+ let lastThis;
7
+ return function(...args) {
8
+ const nextArgs = Array.prototype.slice.call(args);
9
+ if (!called || this !== lastThis || !arrayEquals(nextArgs, lastArgs)) {
10
+ called = true;
11
+ lastThis = this;
12
+ lastArgs = nextArgs;
13
+ lastResult = fn.apply(this, args);
14
+ }
15
+ return lastResult;
16
+ };
17
+ }
18
+ export {
19
+ memoise
20
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Get map resolution
3
+ *
4
+ * @param {Extent} extent Geographical extent: [ lonMin, latMin, lonMax, latMax ]
5
+ * @param {size} viewportSize Viewport size: [ width, height ]
6
+ * @return {number} Map resolution (horizontal)
7
+ * @api
8
+ */
9
+ export function resolutionForExtent(extent: Extent, viewportSize: size): number;
@@ -0,0 +1,11 @@
1
+ import { haversineDistance } from "./distance.js";
2
+ function resolutionForExtent(extent, viewportSize) {
3
+ const [lonMin, latMin, lonMax, latMax] = extent;
4
+ const latMid = (latMin + latMax) / 2;
5
+ const distance = haversineDistance(latMid, lonMin, latMid, lonMax);
6
+ const resolution = distance / viewportSize[0];
7
+ return resolution;
8
+ }
9
+ export {
10
+ resolutionForExtent
11
+ };
@@ -0,0 +1,114 @@
1
+ /**
2
+ * @param {Array<number>} flatCoordinates Flat coordinates.
3
+ * @param {number} offset Offset.
4
+ * @param {number} end End.
5
+ * @param {number} stride Stride.
6
+ * @param {number} squaredTolerance Squared tolerance.
7
+ * @param {boolean} highQuality Highest quality.
8
+ * @param {Array<number>} [simplifiedFlatCoordinates] Simplified flat
9
+ * coordinates.
10
+ * @return {Array<number>} Simplified line string.
11
+ */
12
+ export function simplifyLineString(flatCoordinates: Array<number>, offset: number, end: number, stride: number, squaredTolerance: number, highQuality: boolean, simplifiedFlatCoordinates?: Array<number>): Array<number>;
13
+ /**
14
+ * @param {Array<number>} flatCoordinates Flat coordinates.
15
+ * @param {number} offset Offset.
16
+ * @param {number} end End.
17
+ * @param {number} stride Stride.
18
+ * @param {number} squaredTolerance Squared tolerance.
19
+ * @param {Array<number>} simplifiedFlatCoordinates Simplified flat
20
+ * coordinates.
21
+ * @param {number} simplifiedOffset Simplified offset.
22
+ * @return {number} Simplified offset.
23
+ */
24
+ export function douglasPeucker(flatCoordinates: Array<number>, offset: number, end: number, stride: number, squaredTolerance: number, simplifiedFlatCoordinates: Array<number>, simplifiedOffset: number): number;
25
+ /**
26
+ * @param {Array<number>} flatCoordinates Flat coordinates.
27
+ * @param {number} offset Offset.
28
+ * @param {Array<number>} ends Ends.
29
+ * @param {number} stride Stride.
30
+ * @param {number} squaredTolerance Squared tolerance.
31
+ * @param {Array<number>} simplifiedFlatCoordinates Simplified flat
32
+ * coordinates.
33
+ * @param {number} simplifiedOffset Simplified offset.
34
+ * @param {Array<number>} simplifiedEnds Simplified ends.
35
+ * @return {number} Simplified offset.
36
+ */
37
+ export function douglasPeuckerArray(flatCoordinates: Array<number>, offset: number, ends: Array<number>, stride: number, squaredTolerance: number, simplifiedFlatCoordinates: Array<number>, simplifiedOffset: number, simplifiedEnds: Array<number>): number;
38
+ /**
39
+ * @param {Array<number>} flatCoordinates Flat coordinates.
40
+ * @param {number} offset Offset.
41
+ * @param {Array<Array<number>>} endss Endss.
42
+ * @param {number} stride Stride.
43
+ * @param {number} squaredTolerance Squared tolerance.
44
+ * @param {Array<number>} simplifiedFlatCoordinates Simplified flat
45
+ * coordinates.
46
+ * @param {number} simplifiedOffset Simplified offset.
47
+ * @param {Array<Array<number>>} simplifiedEndss Simplified endss.
48
+ * @return {number} Simplified offset.
49
+ */
50
+ export function douglasPeuckerMultiArray(flatCoordinates: Array<number>, offset: number, endss: Array<Array<number>>, stride: number, squaredTolerance: number, simplifiedFlatCoordinates: Array<number>, simplifiedOffset: number, simplifiedEndss: Array<Array<number>>): number;
51
+ /**
52
+ * @param {Array<number>} flatCoordinates Flat coordinates.
53
+ * @param {number} offset Offset.
54
+ * @param {number} end End.
55
+ * @param {number} stride Stride.
56
+ * @param {number} squaredTolerance Squared tolerance.
57
+ * @param {Array<number>} simplifiedFlatCoordinates Simplified flat
58
+ * coordinates.
59
+ * @param {number} simplifiedOffset Simplified offset.
60
+ * @return {number} Simplified offset.
61
+ */
62
+ export function radialDistance(flatCoordinates: Array<number>, offset: number, end: number, stride: number, squaredTolerance: number, simplifiedFlatCoordinates: Array<number>, simplifiedOffset: number): number;
63
+ /**
64
+ * @param {number} value Value.
65
+ * @param {number} tolerance Tolerance.
66
+ * @return {number} Rounded value.
67
+ */
68
+ export function snap(value: number, tolerance: number): number;
69
+ /**
70
+ * Simplifies a line string using an algorithm designed by Tim Schaub.
71
+ * Coordinates are snapped to the nearest value in a virtual grid and
72
+ * consecutive duplicate coordinates are discarded. This effectively preserves
73
+ * topology as the simplification of any subsection of a line string is
74
+ * independent of the rest of the line string. This means that, for example,
75
+ * the common edge between two polygons will be simplified to the same line
76
+ * string independently in both polygons. This implementation uses a single
77
+ * pass over the coordinates and eliminates intermediate collinear points.
78
+ * @param {Array<number>} flatCoordinates Flat coordinates.
79
+ * @param {number} offset Offset.
80
+ * @param {number} end End.
81
+ * @param {number} stride Stride.
82
+ * @param {number} tolerance Tolerance.
83
+ * @param {Array<number>} simplifiedFlatCoordinates Simplified flat
84
+ * coordinates.
85
+ * @param {number} simplifiedOffset Simplified offset.
86
+ * @return {number} Simplified offset.
87
+ */
88
+ export function quantize(flatCoordinates: Array<number>, offset: number, end: number, stride: number, tolerance: number, simplifiedFlatCoordinates: Array<number>, simplifiedOffset: number): number;
89
+ /**
90
+ * @param {Array<number>} flatCoordinates Flat coordinates.
91
+ * @param {number} offset Offset.
92
+ * @param {Array<number>} ends Ends.
93
+ * @param {number} stride Stride.
94
+ * @param {number} tolerance Tolerance.
95
+ * @param {Array<number>} simplifiedFlatCoordinates Simplified flat
96
+ * coordinates.
97
+ * @param {number} simplifiedOffset Simplified offset.
98
+ * @param {Array<number>} simplifiedEnds Simplified ends.
99
+ * @return {number} Simplified offset.
100
+ */
101
+ export function quantizeArray(flatCoordinates: Array<number>, offset: number, ends: Array<number>, stride: number, tolerance: number, simplifiedFlatCoordinates: Array<number>, simplifiedOffset: number, simplifiedEnds: Array<number>): number;
102
+ /**
103
+ * @param {Array<number>} flatCoordinates Flat coordinates.
104
+ * @param {number} offset Offset.
105
+ * @param {Array<Array<number>>} endss Endss.
106
+ * @param {number} stride Stride.
107
+ * @param {number} tolerance Tolerance.
108
+ * @param {Array<number>} simplifiedFlatCoordinates Simplified flat
109
+ * coordinates.
110
+ * @param {number} simplifiedOffset Simplified offset.
111
+ * @param {Array<Array<number>>} simplifiedEndss Simplified endss.
112
+ * @return {number} Simplified offset.
113
+ */
114
+ export function quantizeMultiArray(flatCoordinates: Array<number>, offset: number, endss: Array<Array<number>>, stride: number, tolerance: number, simplifiedFlatCoordinates: Array<number>, simplifiedOffset: number, simplifiedEndss: Array<Array<number>>): number;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Determines if a size has a positive area.
3
+ */
4
+ export function hasArea(size: any): boolean;
5
+ /**
6
+ * Calculate size minus padding
7
+ *
8
+ * @function sizeMinusPadding
9
+ * @param {[number, number]} size
10
+ * @param {{top: number, right: number, bottom: number, left: number}} padding
11
+ * @returns {[number, number]} size after subtracting padding
12
+ */
13
+ export function sizeMinusPadding(size: [number, number], padding: {
14
+ top: number;
15
+ right: number;
16
+ bottom: number;
17
+ left: number;
18
+ }): [number, number];
19
+ /**
20
+ * Returns a size scaled by a ratio. The result will be an array of integers.
21
+ */
22
+ export function scaleSize(size: any, ratio: any, dest: any): any;
23
+ /**
24
+ * Returns padding object scaled by a ratio
25
+ */
26
+ export function scalePadding(padding: any, ratio: any): {
27
+ top: number;
28
+ right: number;
29
+ bottom: number;
30
+ left: number;
31
+ };
32
+ export function sizeForElement(element: any): number[];
@@ -0,0 +1,53 @@
1
+ function hasArea(size) {
2
+ return size[0] > 0 && size[1] > 0;
3
+ }
4
+ function sizeMinusPadding(size, padding) {
5
+ let newSize = [...size];
6
+ if (padding) {
7
+ newSize = [
8
+ size[0] - padding.left - padding.right,
9
+ size[1] - padding.top - padding.bottom
10
+ ];
11
+ }
12
+ return newSize;
13
+ }
14
+ function scaleSize(size, ratio, dest) {
15
+ if (dest === void 0) {
16
+ dest = [0, 0];
17
+ }
18
+ dest[0] = size[0] * ratio + 0.5 | 0;
19
+ dest[1] = size[1] * ratio + 0.5 | 0;
20
+ return dest;
21
+ }
22
+ function scalePadding(padding, ratio) {
23
+ const scaled = {
24
+ top: Math.round(padding.top * ratio),
25
+ right: Math.round(padding.right * ratio),
26
+ bottom: Math.round(padding.bottom * ratio),
27
+ left: Math.round(padding.left * ratio)
28
+ };
29
+ return scaled;
30
+ }
31
+ function sizeForElement(element) {
32
+ const computedStyle = getComputedStyle(element);
33
+ if (!computedStyle) return null;
34
+ let size;
35
+ const width = element.offsetWidth - parseFloat(computedStyle["borderLeftWidth"]) - parseFloat(computedStyle["paddingLeft"]) - parseFloat(computedStyle["paddingRight"]) - parseFloat(computedStyle["borderRightWidth"]);
36
+ const height = element.offsetHeight - parseFloat(computedStyle["borderTopWidth"]) - parseFloat(computedStyle["paddingTop"]) - parseFloat(computedStyle["paddingBottom"]) - parseFloat(computedStyle["borderBottomWidth"]);
37
+ if (!isNaN(width) && !isNaN(height)) {
38
+ size = [width, height];
39
+ if (!hasArea(size) && !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length)) {
40
+ console.warn(
41
+ "No map visible because the map container's width or height are 0."
42
+ );
43
+ }
44
+ }
45
+ return size;
46
+ }
47
+ export {
48
+ hasArea,
49
+ scalePadding,
50
+ scaleSize,
51
+ sizeForElement,
52
+ sizeMinusPadding
53
+ };
@@ -0,0 +1 @@
1
+ export function toRgba(color: any, opacity?: number): string;
@@ -0,0 +1,25 @@
1
+ function toRgba(color, opacity = 1) {
2
+ color = color.replace(/\s+/g, "").toLowerCase();
3
+ if (color.startsWith("#")) {
4
+ color = color.replace(/^#/, "");
5
+ if (color.length === 3) {
6
+ color = color.split("").map((char) => char + char).join("");
7
+ }
8
+ let r = parseInt(color.substring(0, 2), 16);
9
+ let g = parseInt(color.substring(2, 4), 16);
10
+ let b = parseInt(color.substring(4, 6), 16);
11
+ return `rgba(${r}, ${g}, ${b}, ${opacity})`;
12
+ }
13
+ let rgbaMatch = color.match(/^rgba?\((\d+),(\d+),(\d+)(?:,(\d+(\.\d+)?))?\)$/);
14
+ if (rgbaMatch) {
15
+ let r = parseInt(rgbaMatch[1], 10);
16
+ let g = parseInt(rgbaMatch[2], 10);
17
+ let b = parseInt(rgbaMatch[3], 10);
18
+ let a = rgbaMatch[4] !== void 0 ? parseFloat(rgbaMatch[4]) : opacity;
19
+ return `rgba(${r}, ${g}, ${b}, ${a})`;
20
+ }
21
+ throw new Error("Unsupported color format");
22
+ }
23
+ export {
24
+ toRgba
25
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generates a unique ID for an object. Unique IDs are generated
3
+ * as a strictly increasing sequence.
4
+ */
5
+ export function createUid(): string;
@@ -0,0 +1,7 @@
1
+ let _uidCounter = 0;
2
+ function createUid() {
3
+ return String(++_uidCounter);
4
+ }
5
+ export {
6
+ createUid
7
+ };
@@ -0,0 +1,2 @@
1
+ export function zoomLevelToZoomScale(zoomLevel: any, initialResolution: any): number;
2
+ export function zoomLevelForResolution(currentResolution: any): number;