@guardian/interactive-component-library 0.2.0-rc3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/dist/interactive-component-library.js +8338 -0
  2. package/dist/interactive-component-library.js.map +1 -0
  3. package/dist/interactive-component-library.umd.cjs +8333 -0
  4. package/dist/interactive-component-library.umd.cjs.map +1 -0
  5. package/dist/style.css +157 -73
  6. package/package.json +10 -6
  7. package/dist/components/index.d.ts +0 -3
  8. package/dist/components/molecules/canvas-map/Map.d.ts +0 -17
  9. package/dist/components/molecules/canvas-map/Map.js +0 -89
  10. package/dist/components/molecules/canvas-map/context/MapContext.d.ts +0 -19
  11. package/dist/components/molecules/canvas-map/context/MapContext.js +0 -20
  12. package/dist/components/molecules/canvas-map/controls/ZoomControl.d.ts +0 -6
  13. package/dist/components/molecules/canvas-map/controls/ZoomControl.js +0 -40
  14. package/dist/components/molecules/canvas-map/controls/icons/index.d.ts +0 -3
  15. package/dist/components/molecules/canvas-map/controls/icons/minus.d.ts +0 -1
  16. package/dist/components/molecules/canvas-map/controls/icons/minus.js +0 -25
  17. package/dist/components/molecules/canvas-map/controls/icons/plus.d.ts +0 -1
  18. package/dist/components/molecules/canvas-map/controls/icons/plus.js +0 -25
  19. package/dist/components/molecules/canvas-map/controls/icons/reset.d.ts +0 -3
  20. package/dist/components/molecules/canvas-map/controls/icons/reset.js +0 -25
  21. package/dist/components/molecules/canvas-map/controls/index.d.ts +0 -1
  22. package/dist/components/molecules/canvas-map/controls/style.module.css.js +0 -11
  23. package/dist/components/molecules/canvas-map/index.d.ts +0 -12
  24. package/dist/components/molecules/canvas-map/lib/Feature.d.ts +0 -38
  25. package/dist/components/molecules/canvas-map/lib/Feature.js +0 -104
  26. package/dist/components/molecules/canvas-map/lib/FeatureCollection.d.ts +0 -20
  27. package/dist/components/molecules/canvas-map/lib/FeatureCollection.js +0 -23
  28. package/dist/components/molecules/canvas-map/lib/Map.d.ts +0 -69
  29. package/dist/components/molecules/canvas-map/lib/Map.js +0 -254
  30. package/dist/components/molecules/canvas-map/lib/View.d.ts +0 -136
  31. package/dist/components/molecules/canvas-map/lib/View.js +0 -179
  32. package/dist/components/molecules/canvas-map/lib/events/Dispatcher.d.ts +0 -8
  33. package/dist/components/molecules/canvas-map/lib/events/Dispatcher.js +0 -35
  34. package/dist/components/molecules/canvas-map/lib/events/MapEvent.d.ts +0 -6
  35. package/dist/components/molecules/canvas-map/lib/events/MapEvent.js +0 -9
  36. package/dist/components/molecules/canvas-map/lib/events/index.d.ts +0 -2
  37. package/dist/components/molecules/canvas-map/lib/formats/GeoJSON.d.ts +0 -10
  38. package/dist/components/molecules/canvas-map/lib/formats/GeoJSON.js +0 -96
  39. package/dist/components/molecules/canvas-map/lib/geometry/Geometry.d.ts +0 -32
  40. package/dist/components/molecules/canvas-map/lib/geometry/Geometry.js +0 -41
  41. package/dist/components/molecules/canvas-map/lib/geometry/LineString.d.ts +0 -12
  42. package/dist/components/molecules/canvas-map/lib/geometry/LineString.js +0 -19
  43. package/dist/components/molecules/canvas-map/lib/geometry/Point.d.ts +0 -11
  44. package/dist/components/molecules/canvas-map/lib/geometry/Point.js +0 -16
  45. package/dist/components/molecules/canvas-map/lib/geometry/Polygon.d.ts +0 -16
  46. package/dist/components/molecules/canvas-map/lib/geometry/Polygon.js +0 -46
  47. package/dist/components/molecules/canvas-map/lib/geometry/index.d.ts +0 -4
  48. package/dist/components/molecules/canvas-map/lib/interpolators/index.d.ts +0 -2
  49. package/dist/components/molecules/canvas-map/lib/interpolators/interpolateFeatures.d.ts +0 -5
  50. package/dist/components/molecules/canvas-map/lib/interpolators/interpolateFeatures.js +0 -95
  51. package/dist/components/molecules/canvas-map/lib/interpolators/interpolateStyles.d.ts +0 -4
  52. package/dist/components/molecules/canvas-map/lib/interpolators/interpolateStyles.js +0 -65
  53. package/dist/components/molecules/canvas-map/lib/layers/TextLayer.d.ts +0 -52
  54. package/dist/components/molecules/canvas-map/lib/layers/TextLayer.js +0 -111
  55. package/dist/components/molecules/canvas-map/lib/layers/VectorLayer.d.ts +0 -53
  56. package/dist/components/molecules/canvas-map/lib/layers/VectorLayer.js +0 -132
  57. package/dist/components/molecules/canvas-map/lib/layers/index.d.ts +0 -3
  58. package/dist/components/molecules/canvas-map/lib/projection/index.d.ts +0 -22
  59. package/dist/components/molecules/canvas-map/lib/projection/index.js +0 -12
  60. package/dist/components/molecules/canvas-map/lib/renderers/FeatureRenderer.d.ts +0 -6
  61. package/dist/components/molecules/canvas-map/lib/renderers/FeatureRenderer.js +0 -46
  62. package/dist/components/molecules/canvas-map/lib/renderers/MapRenderer.d.ts +0 -6
  63. package/dist/components/molecules/canvas-map/lib/renderers/MapRenderer.js +0 -53
  64. package/dist/components/molecules/canvas-map/lib/renderers/TextLayerRenderer.d.ts +0 -17
  65. package/dist/components/molecules/canvas-map/lib/renderers/TextLayerRenderer.js +0 -119
  66. package/dist/components/molecules/canvas-map/lib/renderers/VectorLayerRenderer.d.ts +0 -10
  67. package/dist/components/molecules/canvas-map/lib/renderers/VectorLayerRenderer.js +0 -78
  68. package/dist/components/molecules/canvas-map/lib/sources/VectorSource.d.ts +0 -15
  69. package/dist/components/molecules/canvas-map/lib/sources/VectorSource.js +0 -56
  70. package/dist/components/molecules/canvas-map/lib/styles/Fill.d.ts +0 -7
  71. package/dist/components/molecules/canvas-map/lib/styles/Fill.js +0 -15
  72. package/dist/components/molecules/canvas-map/lib/styles/Stroke.d.ts +0 -8
  73. package/dist/components/molecules/canvas-map/lib/styles/Stroke.js +0 -16
  74. package/dist/components/molecules/canvas-map/lib/styles/Style.d.ts +0 -24
  75. package/dist/components/molecules/canvas-map/lib/styles/Style.js +0 -17
  76. package/dist/components/molecules/canvas-map/lib/styles/Text.d.ts +0 -10
  77. package/dist/components/molecules/canvas-map/lib/styles/Text.js +0 -14
  78. package/dist/components/molecules/canvas-map/lib/styles/index.d.ts +0 -4
  79. package/dist/components/molecules/canvas-map/lib/util/array.d.ts +0 -6
  80. package/dist/components/molecules/canvas-map/lib/util/array.js +0 -15
  81. package/dist/components/molecules/canvas-map/lib/util/bboxFeature.d.ts +0 -8
  82. package/dist/components/molecules/canvas-map/lib/util/bboxFeature.js +0 -26
  83. package/dist/components/molecules/canvas-map/lib/util/debug.d.ts +0 -11
  84. package/dist/components/molecules/canvas-map/lib/util/debug.js +0 -27
  85. package/dist/components/molecules/canvas-map/lib/util/deflate.d.ts +0 -36
  86. package/dist/components/molecules/canvas-map/lib/util/distance.d.ts +0 -1
  87. package/dist/components/molecules/canvas-map/lib/util/distance.js +0 -12
  88. package/dist/components/molecules/canvas-map/lib/util/dom.d.ts +0 -9
  89. package/dist/components/molecules/canvas-map/lib/util/dom.js +0 -28
  90. package/dist/components/molecules/canvas-map/lib/util/extent.d.ts +0 -21
  91. package/dist/components/molecules/canvas-map/lib/util/extent.js +0 -38
  92. package/dist/components/molecules/canvas-map/lib/util/memoise.d.ts +0 -10
  93. package/dist/components/molecules/canvas-map/lib/util/memoise.js +0 -20
  94. package/dist/components/molecules/canvas-map/lib/util/resolution.d.ts +0 -9
  95. package/dist/components/molecules/canvas-map/lib/util/resolution.js +0 -11
  96. package/dist/components/molecules/canvas-map/lib/util/simplify.d.ts +0 -114
  97. package/dist/components/molecules/canvas-map/lib/util/size.d.ts +0 -32
  98. package/dist/components/molecules/canvas-map/lib/util/size.js +0 -53
  99. package/dist/components/molecules/canvas-map/lib/util/toRgba.d.ts +0 -1
  100. package/dist/components/molecules/canvas-map/lib/util/toRgba.js +0 -25
  101. package/dist/components/molecules/canvas-map/lib/util/uid.d.ts +0 -5
  102. package/dist/components/molecules/canvas-map/lib/util/uid.js +0 -7
  103. package/dist/components/molecules/canvas-map/lib/util/zoomLevel.d.ts +0 -2
  104. package/dist/components/molecules/canvas-map/lib/util/zoomLevel.js +0 -14
  105. package/dist/components/molecules/canvas-map/style.module.scss.js +0 -20
  106. package/dist/components/molecules/column-chart/column-chart-example.d.ts +0 -35
  107. package/dist/components/molecules/column-chart/column-chart-util.d.ts +0 -1
  108. package/dist/components/molecules/column-chart/index.d.ts +0 -11
  109. package/dist/components/molecules/column-chart/index.js +0 -63
  110. package/dist/components/molecules/column-chart/style.module.css.js +0 -14
  111. package/dist/components/molecules/control-change/index.d.ts +0 -6
  112. package/dist/components/molecules/control-change/index.js +0 -29
  113. package/dist/components/molecules/control-change/style.module.css.js +0 -11
  114. package/dist/components/molecules/dropdown/index.d.ts +0 -11
  115. package/dist/components/molecules/dropdown/index.js +0 -191
  116. package/dist/components/molecules/dropdown/style.module.css.js +0 -50
  117. package/dist/components/molecules/first-past-the-post-waffle/index.d.ts +0 -5
  118. package/dist/components/molecules/first-past-the-post-waffle/index.js +0 -14
  119. package/dist/components/molecules/first-past-the-post-waffle/style.module.css.js +0 -14
  120. package/dist/components/molecules/index.d.ts +0 -17
  121. package/dist/components/molecules/modal/index.d.ts +0 -8
  122. package/dist/components/molecules/modal/index.js +0 -59
  123. package/dist/components/molecules/modal/style.module.css.js +0 -26
  124. package/dist/components/molecules/page-section/index.d.ts +0 -8
  125. package/dist/components/molecules/page-section/index.js +0 -52
  126. package/dist/components/molecules/page-section/style.module.scss.js +0 -20
  127. package/dist/components/molecules/party-profile/index.d.ts +0 -10
  128. package/dist/components/molecules/party-profile/index.js +0 -29
  129. package/dist/components/molecules/party-profile/style.module.css.js +0 -26
  130. package/dist/components/molecules/refresh-indicator/index.d.ts +0 -4
  131. package/dist/components/molecules/refresh-indicator/index.js +0 -18
  132. package/dist/components/molecules/refresh-indicator/style.module.scss.js +0 -17
  133. package/dist/components/molecules/responsive-grid/index.d.ts +0 -10
  134. package/dist/components/molecules/responsive-grid/index.js +0 -19
  135. package/dist/components/molecules/responsive-grid/style.module.scss.js +0 -8
  136. package/dist/components/molecules/result-summary/index.d.ts +0 -8
  137. package/dist/components/molecules/result-summary/index.js +0 -38
  138. package/dist/components/molecules/result-summary/style.module.css.js +0 -11
  139. package/dist/components/molecules/search-input/icons/search.d.ts +0 -1
  140. package/dist/components/molecules/search-input/icons/search.js +0 -24
  141. package/dist/components/molecules/search-input/icons/search.module.css.js +0 -11
  142. package/dist/components/molecules/search-input/index.d.ts +0 -11
  143. package/dist/components/molecules/search-input/index.js +0 -164
  144. package/dist/components/molecules/search-input/style.module.css.js +0 -32
  145. package/dist/components/molecules/slope-chart/index.d.ts +0 -16
  146. package/dist/components/molecules/slope-chart/index.js +0 -139
  147. package/dist/components/molecules/slope-chart/style.module.css.js +0 -35
  148. package/dist/components/molecules/svg-map/context/MapContext.d.ts +0 -1
  149. package/dist/components/molecules/svg-map/context/MapContext.js +0 -5
  150. package/dist/components/molecules/svg-map/context/SVGMapProvider.d.ts +0 -10
  151. package/dist/components/molecules/svg-map/context/SVGMapProvider.js +0 -88
  152. package/dist/components/molecules/svg-map/helpers/bboxFeature.d.ts +0 -8
  153. package/dist/components/molecules/svg-map/helpers/bboxFeature.js +0 -26
  154. package/dist/components/molecules/svg-map/helpers/dynamicPropValue.d.ts +0 -1
  155. package/dist/components/molecules/svg-map/helpers/dynamicPropValue.js +0 -9
  156. package/dist/components/molecules/svg-map/helpers/geoMath.d.ts +0 -4
  157. package/dist/components/molecules/svg-map/helpers/saveSVG.d.ts +0 -1
  158. package/dist/components/molecules/svg-map/hooks/useCamera.d.ts +0 -0
  159. package/dist/components/molecules/svg-map/hooks/useThrowIfNonLayerChildren.d.ts +0 -4
  160. package/dist/components/molecules/svg-map/hooks/useThrowIfNonLayerChildren.js +0 -19
  161. package/dist/components/molecules/svg-map/index.d.ts +0 -38
  162. package/dist/components/molecules/svg-map/index.js +0 -121
  163. package/dist/components/molecules/svg-map/layers/CompositionBorders.d.ts +0 -3
  164. package/dist/components/molecules/svg-map/layers/CompositionBorders.js +0 -14
  165. package/dist/components/molecules/svg-map/layers/Line.d.ts +0 -7
  166. package/dist/components/molecules/svg-map/layers/Line.js +0 -48
  167. package/dist/components/molecules/svg-map/layers/Point.d.ts +0 -10
  168. package/dist/components/molecules/svg-map/layers/Point.js +0 -59
  169. package/dist/components/molecules/svg-map/layers/Polygon.d.ts +0 -9
  170. package/dist/components/molecules/svg-map/layers/Polygon.js +0 -75
  171. package/dist/components/molecules/svg-map/layers/Prerendered.d.ts +0 -3
  172. package/dist/components/molecules/svg-map/layers/Prerendered.js +0 -11
  173. package/dist/components/molecules/svg-map/layers/compositionBorders.module.scss.js +0 -8
  174. package/dist/components/molecules/svg-map/layers/index.d.ts +0 -5
  175. package/dist/components/molecules/svg-map/layers/index.js +0 -12
  176. package/dist/components/molecules/svg-map/renderers/SVGRenderer.d.ts +0 -3
  177. package/dist/components/molecules/svg-map/renderers/SVGRenderer.js +0 -32
  178. package/dist/components/molecules/svg-map/style.module.css.js +0 -11
  179. package/dist/components/molecules/table/index.d.ts +0 -7
  180. package/dist/components/molecules/table/index.js +0 -90
  181. package/dist/components/molecules/table/style.module.scss.js +0 -29
  182. package/dist/components/molecules/table/useTable.d.ts +0 -8
  183. package/dist/components/molecules/table/useTable.js +0 -128
  184. package/dist/components/molecules/tooltip/index.d.ts +0 -82
  185. package/dist/components/molecules/tooltip/index.js +0 -117
  186. package/dist/components/molecules/tooltip/style.module.css.js +0 -8
  187. package/dist/components/molecules/topline-result/index.d.ts +0 -3
  188. package/dist/components/molecules/topline-result/index.js +0 -61
  189. package/dist/components/molecules/topline-result/style.module.scss.js +0 -38
  190. package/dist/components/organisms/coalitions-tracker/index.d.ts +0 -16
  191. package/dist/components/organisms/coalitions-tracker/index.js +0 -151
  192. package/dist/components/organisms/coalitions-tracker/style.module.scss.js +0 -32
  193. package/dist/components/organisms/index.d.ts +0 -2
  194. package/dist/components/organisms/ticker/gradient/index.d.ts +0 -1
  195. package/dist/components/organisms/ticker/gradient/index.js +0 -35
  196. package/dist/components/organisms/ticker/gradient/style.module.scss.js +0 -14
  197. package/dist/components/organisms/ticker/index.d.ts +0 -5
  198. package/dist/components/organisms/ticker/index.js +0 -102
  199. package/dist/components/organisms/ticker/style.module.scss.js +0 -32
  200. package/dist/components/particles/ad-slot/index.d.ts +0 -40
  201. package/dist/components/particles/ad-slot/index.js +0 -34
  202. package/dist/components/particles/ad-slot/style.module.css.js +0 -11
  203. package/dist/components/particles/arrow-button/index.d.ts +0 -6
  204. package/dist/components/particles/arrow-button/index.js +0 -32
  205. package/dist/components/particles/arrow-button/style.module.css.js +0 -11
  206. package/dist/components/particles/aspect-ratio-box/index.d.ts +0 -4
  207. package/dist/components/particles/aspect-ratio-box/index.js +0 -15
  208. package/dist/components/particles/aspect-ratio-box/style.module.css.js +0 -6
  209. package/dist/components/particles/button/index.d.ts +0 -6
  210. package/dist/components/particles/button/index.js +0 -10
  211. package/dist/components/particles/button/style.module.css.js +0 -11
  212. package/dist/components/particles/change-bar/index.d.ts +0 -8
  213. package/dist/components/particles/change-bar/index.js +0 -27
  214. package/dist/components/particles/change-bar/style.module.scss.js +0 -14
  215. package/dist/components/particles/chevron/index.d.ts +0 -6
  216. package/dist/components/particles/chevron/index.js +0 -78
  217. package/dist/components/particles/chevron/style.module.css.js +0 -20
  218. package/dist/components/particles/circle-icon/index.d.ts +0 -6
  219. package/dist/components/particles/circle-icon/index.js +0 -32
  220. package/dist/components/particles/circle-icon/style.module.css.js +0 -14
  221. package/dist/components/particles/close-button/index.d.ts +0 -5
  222. package/dist/components/particles/close-button/index.js +0 -35
  223. package/dist/components/particles/close-button/style.module.css.js +0 -17
  224. package/dist/components/particles/container/index.d.ts +0 -5
  225. package/dist/components/particles/container/index.js +0 -13
  226. package/dist/components/particles/container/style.module.scss.js +0 -11
  227. package/dist/components/particles/gradient-icon/index.d.ts +0 -1
  228. package/dist/components/particles/gradient-icon/index.js +0 -46
  229. package/dist/components/particles/gradient-icon/style.module.css.js +0 -14
  230. package/dist/components/particles/index.d.ts +0 -18
  231. package/dist/components/particles/info-button/index.d.ts +0 -3
  232. package/dist/components/particles/info-button/index.js +0 -19
  233. package/dist/components/particles/info-button/style.module.css.js +0 -11
  234. package/dist/components/particles/legend-item/index.d.ts +0 -6
  235. package/dist/components/particles/legend-item/index.js +0 -26
  236. package/dist/components/particles/legend-item/style.module.css.js +0 -17
  237. package/dist/components/particles/relative-time-sentence/index.d.ts +0 -4
  238. package/dist/components/particles/relative-time-sentence/index.js +0 -14
  239. package/dist/components/particles/relative-time-sentence/style.module.css.js +0 -8
  240. package/dist/components/particles/square-cut-corner-icon/index.d.ts +0 -6
  241. package/dist/components/particles/square-cut-corner-icon/index.js +0 -56
  242. package/dist/components/particles/square-cut-corner-icon/style.module.scss.js +0 -17
  243. package/dist/components/particles/square-icon/index.d.ts +0 -5
  244. package/dist/components/particles/square-icon/index.js +0 -28
  245. package/dist/components/particles/square-icon/style.module.scss.js +0 -11
  246. package/dist/components/particles/stacked-bar/index.d.ts +0 -23
  247. package/dist/components/particles/stacked-bar/index.js +0 -140
  248. package/dist/components/particles/stacked-bar/style.module.css.js +0 -17
  249. package/dist/components/particles/stacked-grid/index.d.ts +0 -6
  250. package/dist/components/particles/stacked-grid/index.js +0 -35
  251. package/dist/components/particles/stacked-grid/style.module.css.js +0 -20
  252. package/dist/components/particles/waffle/index.d.ts +0 -14
  253. package/dist/components/particles/waffle/index.js +0 -76
  254. package/dist/components/particles/waffle/style.module.css.js +0 -11
  255. package/dist/index.d.ts +0 -2
  256. package/dist/index.js +0 -128
  257. package/dist/shared/colors/index.d.ts +0 -2
  258. package/dist/shared/helpers/createStore.d.ts +0 -1
  259. package/dist/shared/helpers/geometry.d.ts +0 -3
  260. package/dist/shared/helpers/geometry.js +0 -16
  261. package/dist/shared/helpers/geometry.test.d.ts +0 -1
  262. package/dist/shared/helpers/labelsUtil.d.ts +0 -54
  263. package/dist/shared/helpers/labelsUtil.js +0 -58
  264. package/dist/shared/helpers/labelsUtils.test.d.ts +0 -1
  265. package/dist/shared/helpers/shouldUpdate.d.ts +0 -7
  266. package/dist/shared/hooks/index.d.ts +0 -3
  267. package/dist/shared/hooks/useContainerSize.d.ts +0 -1
  268. package/dist/shared/hooks/useContainerSize.js +0 -24
  269. package/dist/shared/hooks/useTouchOrHover.d.ts +0 -6
  270. package/dist/shared/hooks/useTouchOrHover.js +0 -95
  271. package/dist/shared/hooks/useWindowSize.d.ts +0 -4
  272. package/dist/shared/hooks/useWindowSize.js +0 -27
  273. package/dist/styles/helpers/mergeStyles.d.ts +0 -1
  274. package/dist/styles/helpers/mergeStyles.js +0 -22
  275. package/dist/styles/helpers/mergeStyles.test.d.ts +0 -1
  276. package/dist/styles/theme.config.d.ts +0 -124
@@ -1,10 +0,0 @@
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;
@@ -1,20 +0,0 @@
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
- };
@@ -1,9 +0,0 @@
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;
@@ -1,11 +0,0 @@
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
- };
@@ -1,114 +0,0 @@
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;
@@ -1,32 +0,0 @@
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[];
@@ -1,53 +0,0 @@
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
- };
@@ -1 +0,0 @@
1
- export function toRgba(color: any, opacity?: number): string;
@@ -1,25 +0,0 @@
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
- };
@@ -1,5 +0,0 @@
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;
@@ -1,7 +0,0 @@
1
- let _uidCounter = 0;
2
- function createUid() {
3
- return String(++_uidCounter);
4
- }
5
- export {
6
- createUid
7
- };
@@ -1,2 +0,0 @@
1
- export function zoomLevelToZoomScale(zoomLevel: any, initialResolution: any): number;
2
- export function zoomLevelForResolution(currentResolution: any): number;
@@ -1,14 +0,0 @@
1
- const BASE_RESOLUTION = 156543.03392;
2
- function zoomLevelToZoomScale(zoomLevel, initialResolution) {
3
- const resolution = BASE_RESOLUTION / Math.pow(2, zoomLevel);
4
- const zoomScale = initialResolution / resolution;
5
- return zoomScale;
6
- }
7
- function zoomLevelForResolution(currentResolution) {
8
- const zoomLevel = Math.log2(BASE_RESOLUTION / currentResolution);
9
- return zoomLevel;
10
- }
11
- export {
12
- zoomLevelForResolution,
13
- zoomLevelToZoomScale
14
- };
@@ -1,20 +0,0 @@
1
- const mapContainer = "_mapContainer_1ogf3_9";
2
- const helpTextContainer = "_helpTextContainer_1ogf3_15";
3
- const helpText = "_helpText_1ogf3_15";
4
- const desktopHelpText = "_desktopHelpText_1ogf3_40";
5
- const mobileHelpText = "_mobileHelpText_1ogf3_48";
6
- const styles = {
7
- mapContainer,
8
- helpTextContainer,
9
- helpText,
10
- desktopHelpText,
11
- mobileHelpText
12
- };
13
- export {
14
- styles as default,
15
- desktopHelpText,
16
- helpText,
17
- helpTextContainer,
18
- mapContainer,
19
- mobileHelpText
20
- };
@@ -1,35 +0,0 @@
1
- export namespace example {
2
- namespace sop {
3
- let numResults: string;
4
- let numCouncils: string;
5
- let parties: ({
6
- paId: number;
7
- name: string;
8
- abbreviation: string;
9
- totalCouncils: number;
10
- changeInControl: number;
11
- seatsWon: number;
12
- netChangeInSeats: number;
13
- heldCouncils: string[];
14
- lostCouncils: string[];
15
- gainedCouncils: string[];
16
- totalGainedCouncils: number;
17
- totalLostCouncils: number;
18
- totalHeldCouncils: number;
19
- } | {
20
- name: string;
21
- abbreviation: string;
22
- totalCouncils: number;
23
- changeInControl: number;
24
- seatsWon: number;
25
- netChangeInSeats: number;
26
- heldCouncils: string[];
27
- lostCouncils: string[];
28
- gainedCouncils: string[];
29
- totalGainedCouncils: number;
30
- totalLostCouncils: number;
31
- totalHeldCouncils: number;
32
- paId?: undefined;
33
- })[];
34
- }
35
- }
@@ -1 +0,0 @@
1
- export function scaleLinear(domain: any, range: any): (x: any) => number;
@@ -1,11 +0,0 @@
1
- export function ColumnChart({ columns, maxValue, minValue, chartHeight, chartWidth, columnWidth, columnPadding, styles, }: {
2
- columns: any;
3
- maxValue: any;
4
- minValue: any;
5
- chartHeight: any;
6
- chartWidth: any;
7
- columnWidth: any;
8
- columnPadding: any;
9
- styles: any;
10
- }): import("preact").JSX.Element;
11
- export default ColumnChart;
@@ -1,63 +0,0 @@
1
- import { jsxs, jsx } from "preact/jsx-runtime";
2
- import defaultStyles from "./style.module.css.js";
3
- import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
4
- import { scaleLinear } from "d3-scale";
5
- const ColumnChart = ({
6
- columns,
7
- maxValue,
8
- minValue,
9
- chartHeight,
10
- chartWidth,
11
- columnWidth,
12
- columnPadding,
13
- styles
14
- }) => {
15
- styles = mergeStyles(defaultStyles, styles);
16
- const yScale = scaleLinear([maxValue, minValue], [0, chartHeight]);
17
- const totalColumnWidth = Number(columnWidth) + Number(columnPadding.left) + Number(columnPadding.right);
18
- let marginBottom = minValue < 0 ? 0 : 40;
19
- return /* @__PURE__ */ jsxs("svg", { width: chartWidth, height: chartHeight + marginBottom, children: [
20
- columns.map((column, index) => {
21
- const getHeight = (input) => {
22
- return yScale(0) - yScale(input);
23
- };
24
- return /* @__PURE__ */ jsxs("g", { children: [
25
- /* @__PURE__ */ jsx(
26
- "rect",
27
- {
28
- x: index * totalColumnWidth,
29
- height: getHeight(Math.abs(column.value)),
30
- width: columnWidth,
31
- y: column.value > 0 ? yScale(column.value) : yScale(0),
32
- fill: column.color,
33
- className: `${styles.bar} fill-color--${column.id}`,
34
- id: column.id
35
- }
36
- ),
37
- /* @__PURE__ */ jsx(
38
- "text",
39
- {
40
- className: styles.text,
41
- x: index * totalColumnWidth + 2,
42
- y: column.value < 0 ? yScale(0) - 6 : yScale(0) + 20,
43
- children: column.label
44
- }
45
- )
46
- ] }, index);
47
- }),
48
- /* @__PURE__ */ jsx(
49
- "rect",
50
- {
51
- className: styles.axis,
52
- x: 0,
53
- y: yScale(0),
54
- width: chartWidth,
55
- height: 1
56
- }
57
- )
58
- ] });
59
- };
60
- export {
61
- ColumnChart,
62
- ColumnChart as default
63
- };
@@ -1,14 +0,0 @@
1
- const text = "_text_1ci1k_1";
2
- const axis = "_axis_1ci1k_6";
3
- const bar = "_bar_1ci1k_10";
4
- const defaultStyles = {
5
- text,
6
- axis,
7
- bar
8
- };
9
- export {
10
- axis,
11
- bar,
12
- defaultStyles as default,
13
- text
14
- };
@@ -1,6 +0,0 @@
1
- export function ControlChange({ previous, next, text, styles }: {
2
- previous: any;
3
- next: any;
4
- text: any;
5
- styles: any;
6
- }): import("preact").JSX.Element;
@@ -1,29 +0,0 @@
1
- import { jsxs, jsx } from "preact/jsx-runtime";
2
- import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
3
- import "preact/hooks";
4
- import { GradientIcon } from "../../particles/gradient-icon/index.js";
5
- import "../../particles/info-button/index.js";
6
- import { CircleIcon } from "../../particles/circle-icon/index.js";
7
- import "../../particles/relative-time-sentence/index.js";
8
- import defaultStyles from "./style.module.css.js";
9
- const ControlChange = ({ previous, next, text, styles }) => {
10
- styles = mergeStyles({ ...defaultStyles }, styles);
11
- let hasChanged = next !== previous;
12
- return /* @__PURE__ */ jsxs("div", { className: styles.container, children: [
13
- hasChanged ? /* @__PURE__ */ jsx(
14
- GradientIcon,
15
- {
16
- previous,
17
- next,
18
- styles: {
19
- previous: styles.previous,
20
- next: styles.next
21
- }
22
- }
23
- ) : /* @__PURE__ */ jsx(CircleIcon, { styles: { circle: `fill-color--${next}` } }),
24
- /* @__PURE__ */ jsx("strong", { className: styles.text, children: text })
25
- ] });
26
- };
27
- export {
28
- ControlChange
29
- };
@@ -1,11 +0,0 @@
1
- const text = "_text_1b8t2_1";
2
- const container = "_container_1b8t2_10";
3
- const defaultStyles = {
4
- text,
5
- container
6
- };
7
- export {
8
- container,
9
- defaultStyles as default,
10
- text
11
- };
@@ -1,11 +0,0 @@
1
- export function Dropdown({ title, hint, options, onSelect, multipleSelect, iconForSelectedIndexPaths, collapseOnSelect, expandByDefault, styles, }: {
2
- title: any;
3
- hint: any;
4
- options: any;
5
- onSelect: any;
6
- multipleSelect?: boolean;
7
- iconForSelectedIndexPaths: any;
8
- collapseOnSelect?: boolean;
9
- expandByDefault?: boolean;
10
- styles: any;
11
- }): import("preact").JSX.Element;