@undp/data-viz 1.4.15 → 1.5.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 (232) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.js +4 -4
  3. package/dist/BarGraph.cjs +1 -1
  4. package/dist/BarGraph.js +8 -8
  5. package/dist/BeeSwarmChart.cjs +1 -1
  6. package/dist/BeeSwarmChart.js +5 -5
  7. package/dist/BiVariateChoroplethMap.cjs +1 -1
  8. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  9. package/dist/BiVariateChoroplethMap.js +35 -34
  10. package/dist/BiVariateChoroplethMap.js.map +1 -1
  11. package/dist/BulletChart.cjs +1 -1
  12. package/dist/BulletChart.js +5 -5
  13. package/dist/ButterflyChart.cjs +1 -1
  14. package/dist/ButterflyChart.js +5 -5
  15. package/dist/ChoroplethMap.cjs +1 -1
  16. package/dist/ChoroplethMap.cjs.map +1 -1
  17. package/dist/ChoroplethMap.js +52 -51
  18. package/dist/ChoroplethMap.js.map +1 -1
  19. package/dist/CirclePackingGraph.cjs +1 -1
  20. package/dist/CirclePackingGraph.js +3 -3
  21. package/dist/DataCards.cjs +1 -1
  22. package/dist/DataCards.js +5 -5
  23. package/dist/DataTable.cjs +1 -1
  24. package/dist/DataTable.js +3 -3
  25. package/dist/DifferenceLineChart.cjs +1 -1
  26. package/dist/DifferenceLineChart.js +3 -3
  27. package/dist/DonutChart.cjs +1 -1
  28. package/dist/DonutChart.js +4 -4
  29. package/dist/DotDensityMap.cjs +1 -1
  30. package/dist/DotDensityMap.cjs.map +1 -1
  31. package/dist/DotDensityMap.js +39 -38
  32. package/dist/DotDensityMap.js.map +1 -1
  33. package/dist/DualAxisLineChart.cjs +1 -1
  34. package/dist/DualAxisLineChart.js +3 -3
  35. package/dist/DumbbellChart.cjs +1 -1
  36. package/dist/DumbbellChart.js +6 -6
  37. package/dist/GeoHubCompareMaps.cjs +1 -1
  38. package/dist/GeoHubCompareMaps.js +1 -1
  39. package/dist/GeoHubMap.cjs +1 -1
  40. package/dist/GeoHubMap.js +3 -3
  41. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  42. package/dist/GeoHubMapWithLayerSelection.js +4 -4
  43. package/dist/{GraphEl-Bz2jatkM.cjs → GraphEl-4RUlclvW.cjs} +2 -2
  44. package/dist/{GraphEl-Bz2jatkM.cjs.map → GraphEl-4RUlclvW.cjs.map} +1 -1
  45. package/dist/{GraphEl-zNOHBYrK.js → GraphEl-ClIxlWa3.js} +2 -2
  46. package/dist/{GraphEl-zNOHBYrK.js.map → GraphEl-ClIxlWa3.js.map} +1 -1
  47. package/dist/GriddedGraphs.cjs +1 -1
  48. package/dist/GriddedGraphs.d.ts +58 -1
  49. package/dist/GriddedGraphs.js +7 -7
  50. package/dist/GriddedGraphsFromConfig.cjs +1 -1
  51. package/dist/GriddedGraphsFromConfig.d.ts +58 -1
  52. package/dist/GriddedGraphsFromConfig.js +1 -1
  53. package/dist/HeatMap.cjs +1 -1
  54. package/dist/HeatMap.js +4 -4
  55. package/dist/Histogram.cjs +1 -1
  56. package/dist/Histogram.js +1 -1
  57. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  58. package/dist/LineChartWithConfidenceInterval.js +3 -3
  59. package/dist/MultiGraphDashboard.cjs +1 -1
  60. package/dist/MultiGraphDashboard.d.ts +58 -1
  61. package/dist/MultiGraphDashboard.js +5 -5
  62. package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
  63. package/dist/MultiGraphDashboardFromConfig.d.ts +58 -1
  64. package/dist/MultiGraphDashboardFromConfig.js +1 -1
  65. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  66. package/dist/MultiGraphDashboardWideToLongFormat.js +2 -2
  67. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
  68. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
  69. package/dist/MultiLineAltChart.cjs +1 -1
  70. package/dist/MultiLineAltChart.js +4 -4
  71. package/dist/MultiLineChart.cjs +1 -1
  72. package/dist/MultiLineChart.js +3 -3
  73. package/dist/ParetoChart.cjs +1 -1
  74. package/dist/ParetoChart.js +3 -3
  75. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  76. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +58 -1
  77. package/dist/PerformanceIntensiveMultiGraphDashboard.js +5 -5
  78. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
  79. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +58 -1
  80. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
  81. package/dist/PerformanceIntensiveScrollStory.d.ts +58 -1
  82. package/dist/RadarChart.cjs +1 -1
  83. package/dist/RadarChart.js +4 -4
  84. package/dist/SankeyChart.cjs +1 -1
  85. package/dist/SankeyChart.js +6 -6
  86. package/dist/ScatterPlot.cjs +1 -1
  87. package/dist/ScatterPlot.cjs.map +1 -1
  88. package/dist/ScatterPlot.js +31 -29
  89. package/dist/ScatterPlot.js.map +1 -1
  90. package/dist/ScrollStory.d.ts +58 -1
  91. package/dist/SimpleLineChart.cjs +1 -1
  92. package/dist/SimpleLineChart.js +3 -3
  93. package/dist/SingleGraphDashboard.cjs +1 -1
  94. package/dist/SingleGraphDashboard.d.ts +58 -1
  95. package/dist/SingleGraphDashboard.js +8 -8
  96. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  97. package/dist/SingleGraphDashboardFromConfig.d.ts +58 -1
  98. package/dist/SingleGraphDashboardFromConfig.js +1 -1
  99. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +58 -1
  100. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  101. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +58 -1
  102. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
  103. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  104. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
  105. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +58 -1
  106. package/dist/SingleGraphDashboardThreeDGraphs.js +20 -19
  107. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
  108. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  109. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +58 -1
  110. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
  111. package/dist/SlopeChart.cjs +1 -1
  112. package/dist/SlopeChart.js +4 -4
  113. package/dist/SparkLine.cjs +1 -1
  114. package/dist/SparkLine.js +2 -2
  115. package/dist/StatCardFromData.cjs +1 -1
  116. package/dist/StatCardFromData.js +1 -1
  117. package/dist/StripChart.cjs +1 -1
  118. package/dist/StripChart.js +5 -5
  119. package/dist/ThreeDGlobe.cjs +1 -1
  120. package/dist/ThreeDGlobe.cjs.map +1 -1
  121. package/dist/ThreeDGlobe.d.ts +61 -6
  122. package/dist/ThreeDGlobe.js +385 -314
  123. package/dist/ThreeDGlobe.js.map +1 -1
  124. package/dist/{Tooltip-DyM5snqx.js → Tooltip-CVCGWyzw.js} +2 -2
  125. package/dist/{Tooltip-DyM5snqx.js.map → Tooltip-CVCGWyzw.js.map} +1 -1
  126. package/dist/{Tooltip-n8z5bfav.cjs → Tooltip-De16GWhY.cjs} +2 -2
  127. package/dist/{Tooltip-n8z5bfav.cjs.map → Tooltip-De16GWhY.cjs.map} +1 -1
  128. package/dist/TreeMapGraph.cjs +1 -1
  129. package/dist/TreeMapGraph.js +3 -3
  130. package/dist/Types.d.ts +58 -1
  131. package/dist/UnitChart.cjs +1 -1
  132. package/dist/UnitChart.js +1 -1
  133. package/dist/_commonjsHelpers-BH3jXuIh.cjs +2 -0
  134. package/dist/_commonjsHelpers-BH3jXuIh.cjs.map +1 -0
  135. package/dist/_commonjsHelpers-ByX85dGu.js +34 -0
  136. package/dist/_commonjsHelpers-ByX85dGu.js.map +1 -0
  137. package/dist/{ensureCompleteData-BBDZbDCE.js → ensureCompleteData-BALdOrsS.js} +2 -2
  138. package/dist/{ensureCompleteData-BBDZbDCE.js.map → ensureCompleteData-BALdOrsS.js.map} +1 -1
  139. package/dist/{ensureCompleteData-DqWQ2Zbi.cjs → ensureCompleteData-BU5Zlccy.cjs} +2 -2
  140. package/dist/{ensureCompleteData-DqWQ2Zbi.cjs.map → ensureCompleteData-BU5Zlccy.cjs.map} +1 -1
  141. package/dist/{fetchAndParseData-4gsYTy6_.js → fetchAndParseData-DBOl1Icl.js} +2 -2
  142. package/dist/{fetchAndParseData-4gsYTy6_.js.map → fetchAndParseData-DBOl1Icl.js.map} +1 -1
  143. package/dist/{fetchAndParseData-CQyVGCul.cjs → fetchAndParseData-Dcy7AS_0.cjs} +2 -2
  144. package/dist/{fetchAndParseData-CQyVGCul.cjs.map → fetchAndParseData-Dcy7AS_0.cjs.map} +1 -1
  145. package/dist/fetchAndParseData.cjs +1 -1
  146. package/dist/fetchAndParseData.js +1 -1
  147. package/dist/{filterData-B8ocT57s.js → filterData-9nEcQ-Jp.js} +3 -3
  148. package/dist/{filterData-B8ocT57s.js.map → filterData-9nEcQ-Jp.js.map} +1 -1
  149. package/dist/{filterData-DN6py7y_.cjs → filterData-BoYadk0l.cjs} +2 -2
  150. package/dist/{filterData-DN6py7y_.cjs.map → filterData-BoYadk0l.cjs.map} +1 -1
  151. package/dist/{getJenks-VhM3GIoC.js → getJenks-DW96UYNE.js} +2 -2
  152. package/dist/{getJenks-VhM3GIoC.js.map → getJenks-DW96UYNE.js.map} +1 -1
  153. package/dist/{getJenks-TWQvbuOz.cjs → getJenks-vofIZmeb.cjs} +2 -2
  154. package/dist/{getJenks-TWQvbuOz.cjs.map → getJenks-vofIZmeb.cjs.map} +1 -1
  155. package/dist/{getUniqValue-CHqgSss5.cjs → getUniqValue-CfuE_l9c.cjs} +2 -2
  156. package/dist/{getUniqValue-CHqgSss5.cjs.map → getUniqValue-CfuE_l9c.cjs.map} +1 -1
  157. package/dist/{getUniqValue-BtUENB2H.js → getUniqValue-CttuU_wn.js} +4 -4
  158. package/dist/{getUniqValue-BtUENB2H.js.map → getUniqValue-CttuU_wn.js.map} +1 -1
  159. package/dist/{index-CaAIPGZo.js → index-AqnpA7_O.js} +2 -2
  160. package/dist/{index-CaAIPGZo.js.map → index-AqnpA7_O.js.map} +1 -1
  161. package/dist/{index-CZbIGs8q.cjs → index-BJOeaYTk.cjs} +2 -2
  162. package/dist/{index-CZbIGs8q.cjs.map → index-BJOeaYTk.cjs.map} +1 -1
  163. package/dist/{index-Bc5VF70V.js → index-BMgDMxKJ.js} +6 -6
  164. package/dist/{index-Bc5VF70V.js.map → index-BMgDMxKJ.js.map} +1 -1
  165. package/dist/{index-B0rbzOoC.cjs → index-BS2TADPj.cjs} +2 -2
  166. package/dist/{index-B0rbzOoC.cjs.map → index-BS2TADPj.cjs.map} +1 -1
  167. package/dist/{index-DNj994Pv.cjs → index-BYzIB5V6.cjs} +2 -2
  168. package/dist/index-BYzIB5V6.cjs.map +1 -0
  169. package/dist/{index-27yTRcko.js → index-Bwrro8-q.js} +2 -2
  170. package/dist/{index-27yTRcko.js.map → index-Bwrro8-q.js.map} +1 -1
  171. package/dist/{index-BczVvEBZ.cjs → index-CQ3e6Ewi.cjs} +2 -2
  172. package/dist/{index-BczVvEBZ.cjs.map → index-CQ3e6Ewi.cjs.map} +1 -1
  173. package/dist/{index-C21TvELx.cjs → index-CSNtgibC.cjs} +2 -2
  174. package/dist/{index-C21TvELx.cjs.map → index-CSNtgibC.cjs.map} +1 -1
  175. package/dist/{index-D7ltPi18.js → index-CeVNqhMO.js} +2 -2
  176. package/dist/{index-D7ltPi18.js.map → index-CeVNqhMO.js.map} +1 -1
  177. package/dist/index-D05lK1Te.cjs +2 -0
  178. package/dist/index-D05lK1Te.cjs.map +1 -0
  179. package/dist/{index-Ds0uHjK9.cjs → index-D72cOtq7.cjs} +2 -2
  180. package/dist/{index-Ds0uHjK9.cjs.map → index-D72cOtq7.cjs.map} +1 -1
  181. package/dist/{index-Cdcfp4nk.js → index-DKCxu1Gh.js} +2 -2
  182. package/dist/index-DKCxu1Gh.js.map +1 -0
  183. package/dist/{index-BXns0-ng.cjs → index-DQA8q5sC.cjs} +2 -2
  184. package/dist/{index-BXns0-ng.cjs.map → index-DQA8q5sC.cjs.map} +1 -1
  185. package/dist/{index-BzeLQvXk.cjs → index-DYH8g9WA.cjs} +2 -2
  186. package/dist/{index-BzeLQvXk.cjs.map → index-DYH8g9WA.cjs.map} +1 -1
  187. package/dist/{index-BbNoLJ_w.cjs → index-Da2GUKrr.cjs} +2 -2
  188. package/dist/{index-BbNoLJ_w.cjs.map → index-Da2GUKrr.cjs.map} +1 -1
  189. package/dist/{index-BLizQDlg.js → index-DvVprvy6.js} +2 -2
  190. package/dist/{index-BLizQDlg.js.map → index-DvVprvy6.js.map} +1 -1
  191. package/dist/{index-UV9hjG_S.js → index-EArKRVKg.js} +2 -2
  192. package/dist/{index-UV9hjG_S.js.map → index-EArKRVKg.js.map} +1 -1
  193. package/dist/{index-C1rRk_50.js → index-V_JXij1_.js} +2 -2
  194. package/dist/{index-C1rRk_50.js.map → index-V_JXij1_.js.map} +1 -1
  195. package/dist/{index-DxagiOHo.js → index-fwdktvAS.js} +2 -2
  196. package/dist/{index-DxagiOHo.js.map → index-fwdktvAS.js.map} +1 -1
  197. package/dist/index-qfWCwobm.js +682 -0
  198. package/dist/index-qfWCwobm.js.map +1 -0
  199. package/dist/index.cjs +1 -1
  200. package/dist/index.d.ts +63 -7
  201. package/dist/index.js +6 -6
  202. package/dist/{string2HTML-CWHGfz_d.js → string2HTML-oFCROsus.js} +2 -2
  203. package/dist/{string2HTML-CWHGfz_d.js.map → string2HTML-oFCROsus.js.map} +1 -1
  204. package/dist/{string2HTML-D2Avudmb.cjs → string2HTML-z7CwHXcx.cjs} +2 -2
  205. package/dist/{string2HTML-D2Avudmb.cjs.map → string2HTML-z7CwHXcx.cjs.map} +1 -1
  206. package/dist/transformData.cjs +1 -1
  207. package/dist/transformData.js +3 -3
  208. package/dist/{transformDataForAggregation-CdcwlnNe.js → transformDataForAggregation-1BYVFqvF.js} +4 -4
  209. package/dist/{transformDataForAggregation-CdcwlnNe.js.map → transformDataForAggregation-1BYVFqvF.js.map} +1 -1
  210. package/dist/{transformDataForAggregation-Du-Hei-W.cjs → transformDataForAggregation-BVxVu4yY.cjs} +2 -2
  211. package/dist/{transformDataForAggregation-Du-Hei-W.cjs.map → transformDataForAggregation-BVxVu4yY.cjs.map} +1 -1
  212. package/dist/{transformDataForGraphFromFile-BCjsizvb.js → transformDataForGraphFromFile-BC9Ha8hF.js} +3 -3
  213. package/dist/{transformDataForGraphFromFile-BCjsizvb.js.map → transformDataForGraphFromFile-BC9Ha8hF.js.map} +1 -1
  214. package/dist/{transformDataForGraphFromFile-B1A0AS-Z.cjs → transformDataForGraphFromFile-b41aNQYY.cjs} +2 -2
  215. package/dist/{transformDataForGraphFromFile-B1A0AS-Z.cjs.map → transformDataForGraphFromFile-b41aNQYY.cjs.map} +1 -1
  216. package/dist/utils.cjs +1 -1
  217. package/dist/utils.js +2 -2
  218. package/dist/zoom-Bsbhil-K.cjs +2 -0
  219. package/dist/zoom-Bsbhil-K.cjs.map +1 -0
  220. package/dist/zoom-DAu91HKr.js +1864 -0
  221. package/dist/zoom-DAu91HKr.js.map +1 -0
  222. package/package.json +2 -2
  223. package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -2
  224. package/dist/_commonjsHelpers-DKOUU3wS.cjs.map +0 -1
  225. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -9
  226. package/dist/_commonjsHelpers-DaMA6jEr.js.map +0 -1
  227. package/dist/index-Cdcfp4nk.js.map +0 -1
  228. package/dist/index-DNj994Pv.cjs.map +0 -1
  229. package/dist/zoom-Lo7IAUfC.cjs +0 -2
  230. package/dist/zoom-Lo7IAUfC.cjs.map +0 -1
  231. package/dist/zoom-_lqdiGoI.js +0 -1983
  232. package/dist/zoom-_lqdiGoI.js.map +0 -1
@@ -1,5 +1,9 @@
1
1
  import { JSX } from 'react/jsx-runtime';
2
2
 
3
+ declare interface AmbientLightConfig extends BaseLightConfig {
4
+ type: 'ambient';
5
+ }
6
+
3
7
  declare interface AnimateDataType {
4
8
  duration: number;
5
9
  once: boolean;
@@ -42,6 +46,12 @@ declare interface AxesStyleObject {
42
46
  axis?: React.CSSProperties;
43
47
  }
44
48
 
49
+ declare interface BaseLightConfig {
50
+ type: string;
51
+ color: number;
52
+ intensity: number;
53
+ }
54
+
45
55
  declare interface ChaptersDataType {
46
56
  dataSettings: DataSettingsDataType;
47
57
  graphSettings: GraphSettingsDataType;
@@ -117,6 +127,14 @@ declare interface DataTableColumnDataType {
117
127
  columnWidth?: number;
118
128
  }
119
129
 
130
+ declare interface DirectionalLightConfig extends BaseLightConfig {
131
+ type: 'directional';
132
+ target?: Position;
133
+ castShadow?: boolean;
134
+ shadow?: ShadowConfig;
135
+ position?: Position | 'camera';
136
+ }
137
+
120
138
  declare interface FileSettingsDataType {
121
139
  dataURL: string;
122
140
  idColumnName: string;
@@ -381,9 +399,10 @@ declare interface GraphSettingsDataType {
381
399
  polygonAltitude?: number;
382
400
  atmosphereAltitude?: number;
383
401
  globeCurvatureResolution?: number;
384
- lightColor?: string;
402
+ lights?: LightConfig[];
385
403
  fogSetting?: FogDataType;
386
404
  showAxisLabels?: boolean;
405
+ highlightedAltitude?: number;
387
406
  }
388
407
 
389
408
  declare type GraphType = GraphTypeForGriddedGraph;
@@ -413,6 +432,8 @@ declare interface InfoBoxDataType {
413
432
 
414
433
  declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
415
434
 
435
+ declare type LightConfig = AmbientLightConfig | DirectionalLightConfig | PointLightConfig | SpotLightConfig;
436
+
416
437
  declare interface MapLegendDataType {
417
438
  mapStyleName: string;
418
439
  legend: string | React.ReactNode;
@@ -420,6 +441,19 @@ declare interface MapLegendDataType {
420
441
 
421
442
  declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
422
443
 
444
+ declare interface PointLightConfig extends BaseLightConfig {
445
+ type: 'point';
446
+ distance?: number;
447
+ decay?: number;
448
+ position?: Position | 'camera';
449
+ }
450
+
451
+ declare interface Position {
452
+ x: number;
453
+ y: number;
454
+ z: number;
455
+ }
456
+
423
457
  declare interface Props {
424
458
  /** Defines if the information is shown as overlay or on the side */
425
459
  mode?: 'overlay' | 'side';
@@ -460,11 +494,34 @@ declare interface SectionsDataType {
460
494
  infoBox: InfoBoxDataType;
461
495
  }
462
496
 
497
+ declare interface ShadowConfig {
498
+ mapSize: {
499
+ width: number;
500
+ height: number;
501
+ };
502
+ camera: {
503
+ near: number;
504
+ far: number;
505
+ };
506
+ }
507
+
463
508
  declare interface SourcesDataType {
464
509
  source: string;
465
510
  link?: string;
466
511
  }
467
512
 
513
+ declare interface SpotLightConfig extends BaseLightConfig {
514
+ type: 'spot';
515
+ target?: Position;
516
+ distance?: number;
517
+ angle?: number;
518
+ penumbra?: number;
519
+ decay?: number;
520
+ castShadow?: boolean;
521
+ shadow?: ShadowConfig;
522
+ position?: Position | 'camera';
523
+ }
524
+
468
525
  declare interface StyleObject {
469
526
  title?: React.CSSProperties;
470
527
  footnote?: React.CSSProperties;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),h=require("react"),u=require("./parse-hMnG_lRV.cjs"),Ce=require("./index-BzeLQvXk.cjs"),Re=require("./simple-statistics-xm8c0LQQ.cjs"),Ee=require("./numberFormattingFunction-02t-wJta.cjs"),Oe=require("./Tooltip-n8z5bfav.cjs"),S=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),fe=require("./customArea-CK768gCn.cjs"),Le=require("./Axis-DE7dSn1_.cjs"),Ne=require("./AxisTitle-CK9YeovX.cjs"),ke=require("./XTicksAndGridLines-CCzXIV8d.cjs"),Se=require("./ReferenceLine-CFVBBN__.cjs"),De=require("./RegressionLine-xKdiJ8sw.cjs"),qe=require("./YTicksAndGridLines-DBDuz6vb.cjs"),$e=require("./index-DNj994Pv.cjs"),Te=require("./time-Byw_jYQ7.cjs"),Ie=require("./linear-BVckp9RD.cjs"),be=require("./line-DHV4JwCR.cjs"),ne=require("./step-BZ3C8QFW.cjs"),Me=require("./select-Bnfk0lJx.cjs"),Ve=require("./init-DU0ybBc_.cjs"),Fe=require("./pointer-Dkq5NV1q.cjs"),He=require("./use-in-view-sQJZ_xDO.cjs"),F=require("./proxy-BHRoeZgd.cjs"),Ge=require("./GraphFooter.cjs"),Pe=require("./GraphHeader.cjs"),We=require("./Colors.cjs"),Ye=require("./EmptyState-d8_8SxeW.cjs");function Xe(re){const{data:O,width:b,height:$,lineColor:H,suffix:L,prefix:D,dateFormat:r,highlightAreaSettings:q,showValues:c,noOfXTicks:G,rightMargin:oe,leftMargin:j,topMargin:ae,bottomMargin:P,tooltip:v,onSeriesMouseOver:T,refValues:W,minValue:Y,maxValue:X,animate:s,rtl:U,strokeWidth:le,showDots:ce,annotations:xe,customHighlightAreaSettings:ue,regressionLine:I,yAxisTitle:B,noOfYTicks:me,maxDate:M,minDate:V,curveType:N,styles:a,classNames:m,precision:w,customLayers:z}=re,J=h.useRef(null),d=He.useInView(J,{once:s.once,amount:s.amount}),[A,pe]=h.useState(!1);h.useEffect(()=>{if(d&&!A){const e=setTimeout(()=>{pe(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[d,A,s.duration]);const he=N==="linear"?be.curveLinear:N==="step"?ne.curveStep:N==="stepAfter"?ne.stepAfter:N==="stepBefore"?ne.stepBefore:ne.monotoneX,[k,K]=h.useState(void 0),[Q,Z]=h.useState(void 0),[R,E]=h.useState(void 0),g={top:ae,bottom:P,left:B?j+30:j,right:oe},_=h.useRef(null),i=Ce.sortBy(O.map(e=>({...e,date:u.parse(`${e.date}`,r,new Date)})),"date"),ee=q.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:u.parse(`${e.coordinates[0]}`,r,new Date),e.coordinates[1]===null?null:u.parse(`${e.coordinates[1]}`,r,new Date)]})),te=ue.map(e=>({...e,coordinates:e.coordinates.map((y,C)=>C%2===0?u.parse(`${y}`,r,new Date):y)})),l=b-g.left-g.right,p=$-g.top-g.bottom,ie=V?u.parse(`${V}`,r,new Date):i[0].date,x=M?u.parse(`${M}`,r,new Date):i[i.length-1].date,f=S.checkIfNullOrUndefined(Y)?Math.min(...i.map(e=>e.y).filter(e=>e!=null))!==1/0?Math.min(...i.map(e=>e.y).filter(e=>e!=null))>0?0:Math.min(...i.map(e=>e.y).filter(e=>e!=null)):0:Y,de=Math.max(...i.map(e=>e.y).filter(e=>e!=null))!==1/0?Math.max(...i.map(e=>e.y).filter(e=>e!=null)):0,n=Te.time().domain([ie,x]).range([0,l]),o=Ie.linear().domain([f,S.checkIfNullOrUndefined(X)?de>0?de:0:X]).range([p,0]).nice(),ye=be.line().x(e=>n(e.date)).y(e=>o(e.y)).curve(he),je=o.ticks(me),ve=n.ticks(G);h.useEffect(()=>{const e=C=>{const se=i[Ve.bisectCenter(i.map(ge=>ge.date),n.invert(Fe.pointer(C)[0]),0)];K(se||i[i.length-1]),T?.(se||i[i.length-1]),E(C.clientY),Z(C.clientX)},y=()=>{K(void 0),Z(void 0),E(void 0),T?.(void 0)};Me.select(_.current).on("mousemove",e).on("mouseout",y)},[n,i,T]);const Ae=Re.linearRegression(i.filter(e=>!S.checkIfNullOrUndefined(e.date)&&!S.checkIfNullOrUndefined(e.y)).map(e=>[n(e.date),o(e.y)])),we=Re.linearRegressionLine(Ae);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(F.motion.svg,{width:`${b}px`,height:`${$}px`,viewBox:`0 0 ${b} ${$}`,direction:"ltr",ref:J,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${g.left},${g.top})`,children:[t.jsxRuntimeExports.jsx($e.HighlightArea,{areaSettings:ee,width:l,height:p,scale:n,animate:s,isInView:d}),t.jsxRuntimeExports.jsx(fe.CustomArea,{areaSettings:te,scaleX:n,scaleY:o,animate:s,isInView:d}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(qe.YTicksAndGridLines,{values:je.filter(e=>e!==0),y:je.filter(e=>e!==0).map(e=>o(e)),x1:0-j,x2:l+g.right,styles:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},classNames:{gridLines:m?.yAxis?.gridLines,labels:m?.yAxis?.labels},suffix:L,prefix:D,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:w}),t.jsxRuntimeExports.jsx(Le.Axis,{y1:o(f<0?0:f),y2:o(f<0?0:f),x1:0-j,x2:l+g.right,label:Ee.numberFormattingFunction(f<0?0:f,"NA",w,D,L),labelPos:{x:0-j,y:o(f<0?0:f),dx:0,dy:de<0?"1em":-5},classNames:{axis:m?.xAxis?.axis,label:m?.yAxis?.labels},styles:{axis:a?.xAxis?.axis,label:a?.yAxis?.labels}}),t.jsxRuntimeExports.jsx(Ne.AxisTitle,{x:0-j-15,y:p/2,style:a?.yAxis?.title,className:m?.yAxis?.title,text:B,rotate90:!0})]}),t.jsxRuntimeExports.jsx(ke.XTicksAndGridLines,{values:ve.map(e=>u.format(e,r)),x:ve.map(e=>n(e)),y1:0,y2:p,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",m?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",m?.xAxis?.labels)},suffix:L,prefix:D,labelType:"primary",showGridLines:!0,precision:w}),z.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(F.motion.path,{style:{stroke:H,fill:"none",strokeWidth:le},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:ye(i)||"",opacity:1},whileInView:{pathLength:1,d:ye(i)||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),k?t.jsxRuntimeExports.jsx("line",{y1:0,y2:p,x1:n(k.date),x2:n(k.date),className:t.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",m?.mouseOverLine),style:a?.mouseOverLine}):null]}),t.jsxRuntimeExports.jsx("g",{children:i.map((e,y)=>t.jsxRuntimeExports.jsx(F.motion.g,{children:S.checkIfNullOrUndefined(e.y)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[ce?t.jsxRuntimeExports.jsx(F.motion.circle,{r:l/i.length<5?0:l/i.length<20?2:4,style:{fill:H},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:n(e.date),cy:o(e.y)},whileInView:{opacity:1,transition:{duration:A?s.duration:.5,delay:A?0:s.duration},cx:n(e.date),cy:o(e.y)}},initial:"initial",animate:d?"whileInView":"initial"}):null,c?t.jsxRuntimeExports.jsx(F.motion.text,{dy:-8,style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:t.mo("graph-value text-xs font-bold",m?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:n(e.date),y:o(e.y)},whileInView:{opacity:1,x:n(e.date),y:o(e.y),transition:{duration:A?s.duration:.5,delay:A?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:Ee.numberFormattingFunction(e.y,"NA",w,D,L)}):null]})},y))}),W?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:W.map((e,y)=>t.jsxRuntimeExports.jsx(Se.RefLineY,{text:e.text,color:e.color,y:o(e.value),x1:0-j,x2:l+g.right,classNames:e.classNames,styles:e.styles,animate:s,isInView:d},y))}):null,t.jsxRuntimeExports.jsx("g",{children:xe.map((e,y)=>{const C=fe.getLineEndPoint({x:e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date)):0,y:e.yCoordinate?o(e.yCoordinate):0},S.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),se=e.showConnector?{y1:C.y,x1:C.x,y2:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?o(e.yCoordinate):0,cx:e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date)):0,circleRadius:S.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,ge={y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:U?0:e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:U?e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0):l+g.right-(e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return t.jsxRuntimeExports.jsx(fe.Annotation,{color:e.color,connectorsSettings:se,labelSettings:ge,text:e.text,classNames:e.classNames,styles:e.styles,animate:s,isInView:d},y)})}),t.jsxRuntimeExports.jsx("g",{children:I?t.jsxRuntimeExports.jsx(De.RegressionLine,{x1:0,x2:l,y1:we(0),y2:we(l),graphHeight:p,graphWidth:l,className:m?.regLine,style:a?.regLine,color:typeof I=="string"?I:void 0,animate:s,isInView:d}):null}),z.filter(e=>e.position==="after").map(e=>e.layer),t.jsxRuntimeExports.jsx("rect",{ref:_,style:{fill:"none",pointerEvents:"all"},width:l,height:p})]})}),k&&v&&Q&&R?t.jsxRuntimeExports.jsx(Oe.Tooltip,{data:k,body:v,xPos:Q,yPos:R,backgroundStyle:a?.tooltip,className:m?.tooltip}):null]})}function Ue(re){const{data:O,graphTitle:b,lineColor:$,suffix:H="",sources:L,prefix:D="",graphDescription:r,height:q,width:c,footNote:G,noOfXTicks:oe=10,dateFormat:j="yyyy",showValues:ae=!1,padding:P,backgroundColor:v=!1,leftMargin:T=30,rightMargin:W=30,topMargin:Y=20,bottomMargin:X=25,relativeHeight:s,tooltip:U,onSeriesMouseOver:le,highlightAreaSettings:ce=[],graphID:xe,minValue:ue,maxValue:I,maxDate:B,minDate:me,graphDownload:M=!1,dataDownload:V=!1,animate:N=!1,language:a="en",refValues:m=[],minHeight:w=0,strokeWidth:z=2,showDots:J=!0,annotations:d=[],customHighlightAreaSettings:A=[],theme:pe="light",ariaLabel:he,regressionLine:k=!1,yAxisTitle:K,noOfYTicks:Q=5,curveType:Z="curve",styles:R,classNames:E,precision:g=2,customLayers:_=[]}=re,[i,ee]=h.useState(0),[te,l]=h.useState(0),p=h.useRef(null),ie=h.useRef(null);return h.useEffect(()=>{const x=new ResizeObserver(f=>{ee(c||f[0].target.clientWidth||620),l(q||f[0].target.clientHeight||480)});return p.current&&(l(p.current.clientHeight||480),ee(p.current.clientWidth||620),c||x.observe(p.current)),()=>x.disconnect()},[c,q]),t.jsxRuntimeExports.jsx("div",{className:`${pe||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:a==="he"||a==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${a||"en"}`,c?"w-fit":"w-full",E?.graphContainer),style:{...R?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:xe,ref:ie,"aria-label":he||`${b?`The graph shows ${b}. `:""}This is a line chart that shows trends over time.${r?` ${r}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:v?P||"1rem":P||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[b||r||M||V?t.jsxRuntimeExports.jsx(Pe.GraphHeader,{styles:{title:R?.title,description:R?.description},classNames:{title:E?.title,description:E?.description},graphTitle:b,graphDescription:r,width:c,graphDownload:M?ie.current:void 0,dataDownload:V?O.map(x=>x.data).filter(x=>x!==void 0).length>0?O.map(x=>x.data).filter(x=>x!==void 0):O.filter(x=>x!==void 0):null}):null,O.length===0?t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:t.jsxRuntimeExports.jsx(Ye.EmptyState,{})}):t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:p,"aria-label":"Graph area",children:(c||i)&&(q||te)?t.jsxRuntimeExports.jsx(Xe,{data:O,lineColor:$||We.Colors.primaryColors["blue-600"],width:c||i,height:Math.max(w,q||(s?w?(c||i)*s>w?(c||i)*s:w:(c||i)*s:te)),suffix:H,prefix:D,dateFormat:j,showValues:ae,noOfXTicks:oe,leftMargin:T,rightMargin:W,topMargin:Y,bottomMargin:X,tooltip:U,highlightAreaSettings:ce,onSeriesMouseOver:le,refValues:m,minValue:ue,maxValue:I,animate:N===!0?{duration:.5,once:!0,amount:.5}:N||{duration:0,once:!0,amount:0},rtl:a==="he"||a==="ar",strokeWidth:z,showDots:J,annotations:d,customHighlightAreaSettings:A,regressionLine:k,yAxisTitle:K,noOfYTicks:Q,maxDate:B,minDate:me,curveType:Z,styles:R,classNames:E,precision:g,customLayers:_}):null}),L||G?t.jsxRuntimeExports.jsx(Ge.GraphFooter,{styles:{footnote:R?.footnote,source:R?.source},classNames:{footnote:E?.footnote,source:E?.source},sources:L,footNote:G,width:c}):null]})})})})}exports.SimpleLineChart=Ue;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),h=require("react"),u=require("./parse-hMnG_lRV.cjs"),Ce=require("./index-DYH8g9WA.cjs"),Re=require("./simple-statistics-xm8c0LQQ.cjs"),Ee=require("./numberFormattingFunction-02t-wJta.cjs"),Oe=require("./Tooltip-De16GWhY.cjs"),S=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),fe=require("./customArea-CK768gCn.cjs"),Le=require("./Axis-DE7dSn1_.cjs"),Ne=require("./AxisTitle-CK9YeovX.cjs"),ke=require("./XTicksAndGridLines-CCzXIV8d.cjs"),Se=require("./ReferenceLine-CFVBBN__.cjs"),De=require("./RegressionLine-xKdiJ8sw.cjs"),qe=require("./YTicksAndGridLines-DBDuz6vb.cjs"),$e=require("./index-BYzIB5V6.cjs"),Te=require("./time-Byw_jYQ7.cjs"),Ie=require("./linear-BVckp9RD.cjs"),be=require("./line-DHV4JwCR.cjs"),ne=require("./step-BZ3C8QFW.cjs"),Me=require("./select-Bnfk0lJx.cjs"),Ve=require("./init-DU0ybBc_.cjs"),Fe=require("./pointer-Dkq5NV1q.cjs"),He=require("./use-in-view-sQJZ_xDO.cjs"),F=require("./proxy-BHRoeZgd.cjs"),Ge=require("./GraphFooter.cjs"),Pe=require("./GraphHeader.cjs"),We=require("./Colors.cjs"),Ye=require("./EmptyState-d8_8SxeW.cjs");function Xe(re){const{data:O,width:b,height:$,lineColor:H,suffix:L,prefix:D,dateFormat:r,highlightAreaSettings:q,showValues:c,noOfXTicks:G,rightMargin:oe,leftMargin:j,topMargin:ae,bottomMargin:P,tooltip:v,onSeriesMouseOver:T,refValues:W,minValue:Y,maxValue:X,animate:s,rtl:U,strokeWidth:le,showDots:ce,annotations:xe,customHighlightAreaSettings:ue,regressionLine:I,yAxisTitle:B,noOfYTicks:me,maxDate:M,minDate:V,curveType:N,styles:a,classNames:m,precision:w,customLayers:z}=re,J=h.useRef(null),d=He.useInView(J,{once:s.once,amount:s.amount}),[A,pe]=h.useState(!1);h.useEffect(()=>{if(d&&!A){const e=setTimeout(()=>{pe(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[d,A,s.duration]);const he=N==="linear"?be.curveLinear:N==="step"?ne.curveStep:N==="stepAfter"?ne.stepAfter:N==="stepBefore"?ne.stepBefore:ne.monotoneX,[k,K]=h.useState(void 0),[Q,Z]=h.useState(void 0),[R,E]=h.useState(void 0),g={top:ae,bottom:P,left:B?j+30:j,right:oe},_=h.useRef(null),i=Ce.sortBy(O.map(e=>({...e,date:u.parse(`${e.date}`,r,new Date)})),"date"),ee=q.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:u.parse(`${e.coordinates[0]}`,r,new Date),e.coordinates[1]===null?null:u.parse(`${e.coordinates[1]}`,r,new Date)]})),te=ue.map(e=>({...e,coordinates:e.coordinates.map((y,C)=>C%2===0?u.parse(`${y}`,r,new Date):y)})),l=b-g.left-g.right,p=$-g.top-g.bottom,ie=V?u.parse(`${V}`,r,new Date):i[0].date,x=M?u.parse(`${M}`,r,new Date):i[i.length-1].date,f=S.checkIfNullOrUndefined(Y)?Math.min(...i.map(e=>e.y).filter(e=>e!=null))!==1/0?Math.min(...i.map(e=>e.y).filter(e=>e!=null))>0?0:Math.min(...i.map(e=>e.y).filter(e=>e!=null)):0:Y,de=Math.max(...i.map(e=>e.y).filter(e=>e!=null))!==1/0?Math.max(...i.map(e=>e.y).filter(e=>e!=null)):0,n=Te.time().domain([ie,x]).range([0,l]),o=Ie.linear().domain([f,S.checkIfNullOrUndefined(X)?de>0?de:0:X]).range([p,0]).nice(),ye=be.line().x(e=>n(e.date)).y(e=>o(e.y)).curve(he),je=o.ticks(me),ve=n.ticks(G);h.useEffect(()=>{const e=C=>{const se=i[Ve.bisectCenter(i.map(ge=>ge.date),n.invert(Fe.pointer(C)[0]),0)];K(se||i[i.length-1]),T?.(se||i[i.length-1]),E(C.clientY),Z(C.clientX)},y=()=>{K(void 0),Z(void 0),E(void 0),T?.(void 0)};Me.select(_.current).on("mousemove",e).on("mouseout",y)},[n,i,T]);const Ae=Re.linearRegression(i.filter(e=>!S.checkIfNullOrUndefined(e.date)&&!S.checkIfNullOrUndefined(e.y)).map(e=>[n(e.date),o(e.y)])),we=Re.linearRegressionLine(Ae);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(F.motion.svg,{width:`${b}px`,height:`${$}px`,viewBox:`0 0 ${b} ${$}`,direction:"ltr",ref:J,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${g.left},${g.top})`,children:[t.jsxRuntimeExports.jsx($e.HighlightArea,{areaSettings:ee,width:l,height:p,scale:n,animate:s,isInView:d}),t.jsxRuntimeExports.jsx(fe.CustomArea,{areaSettings:te,scaleX:n,scaleY:o,animate:s,isInView:d}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(qe.YTicksAndGridLines,{values:je.filter(e=>e!==0),y:je.filter(e=>e!==0).map(e=>o(e)),x1:0-j,x2:l+g.right,styles:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},classNames:{gridLines:m?.yAxis?.gridLines,labels:m?.yAxis?.labels},suffix:L,prefix:D,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:w}),t.jsxRuntimeExports.jsx(Le.Axis,{y1:o(f<0?0:f),y2:o(f<0?0:f),x1:0-j,x2:l+g.right,label:Ee.numberFormattingFunction(f<0?0:f,"NA",w,D,L),labelPos:{x:0-j,y:o(f<0?0:f),dx:0,dy:de<0?"1em":-5},classNames:{axis:m?.xAxis?.axis,label:m?.yAxis?.labels},styles:{axis:a?.xAxis?.axis,label:a?.yAxis?.labels}}),t.jsxRuntimeExports.jsx(Ne.AxisTitle,{x:0-j-15,y:p/2,style:a?.yAxis?.title,className:m?.yAxis?.title,text:B,rotate90:!0})]}),t.jsxRuntimeExports.jsx(ke.XTicksAndGridLines,{values:ve.map(e=>u.format(e,r)),x:ve.map(e=>n(e)),y1:0,y2:p,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",m?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",m?.xAxis?.labels)},suffix:L,prefix:D,labelType:"primary",showGridLines:!0,precision:w}),z.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(F.motion.path,{style:{stroke:H,fill:"none",strokeWidth:le},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:ye(i)||"",opacity:1},whileInView:{pathLength:1,d:ye(i)||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),k?t.jsxRuntimeExports.jsx("line",{y1:0,y2:p,x1:n(k.date),x2:n(k.date),className:t.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",m?.mouseOverLine),style:a?.mouseOverLine}):null]}),t.jsxRuntimeExports.jsx("g",{children:i.map((e,y)=>t.jsxRuntimeExports.jsx(F.motion.g,{children:S.checkIfNullOrUndefined(e.y)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[ce?t.jsxRuntimeExports.jsx(F.motion.circle,{r:l/i.length<5?0:l/i.length<20?2:4,style:{fill:H},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:n(e.date),cy:o(e.y)},whileInView:{opacity:1,transition:{duration:A?s.duration:.5,delay:A?0:s.duration},cx:n(e.date),cy:o(e.y)}},initial:"initial",animate:d?"whileInView":"initial"}):null,c?t.jsxRuntimeExports.jsx(F.motion.text,{dy:-8,style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:t.mo("graph-value text-xs font-bold",m?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:n(e.date),y:o(e.y)},whileInView:{opacity:1,x:n(e.date),y:o(e.y),transition:{duration:A?s.duration:.5,delay:A?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:Ee.numberFormattingFunction(e.y,"NA",w,D,L)}):null]})},y))}),W?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:W.map((e,y)=>t.jsxRuntimeExports.jsx(Se.RefLineY,{text:e.text,color:e.color,y:o(e.value),x1:0-j,x2:l+g.right,classNames:e.classNames,styles:e.styles,animate:s,isInView:d},y))}):null,t.jsxRuntimeExports.jsx("g",{children:xe.map((e,y)=>{const C=fe.getLineEndPoint({x:e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date)):0,y:e.yCoordinate?o(e.yCoordinate):0},S.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),se=e.showConnector?{y1:C.y,x1:C.x,y2:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?o(e.yCoordinate):0,cx:e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date)):0,circleRadius:S.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,ge={y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:U?0:e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:U?e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0):l+g.right-(e.xCoordinate?n(u.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return t.jsxRuntimeExports.jsx(fe.Annotation,{color:e.color,connectorsSettings:se,labelSettings:ge,text:e.text,classNames:e.classNames,styles:e.styles,animate:s,isInView:d},y)})}),t.jsxRuntimeExports.jsx("g",{children:I?t.jsxRuntimeExports.jsx(De.RegressionLine,{x1:0,x2:l,y1:we(0),y2:we(l),graphHeight:p,graphWidth:l,className:m?.regLine,style:a?.regLine,color:typeof I=="string"?I:void 0,animate:s,isInView:d}):null}),z.filter(e=>e.position==="after").map(e=>e.layer),t.jsxRuntimeExports.jsx("rect",{ref:_,style:{fill:"none",pointerEvents:"all"},width:l,height:p})]})}),k&&v&&Q&&R?t.jsxRuntimeExports.jsx(Oe.Tooltip,{data:k,body:v,xPos:Q,yPos:R,backgroundStyle:a?.tooltip,className:m?.tooltip}):null]})}function Ue(re){const{data:O,graphTitle:b,lineColor:$,suffix:H="",sources:L,prefix:D="",graphDescription:r,height:q,width:c,footNote:G,noOfXTicks:oe=10,dateFormat:j="yyyy",showValues:ae=!1,padding:P,backgroundColor:v=!1,leftMargin:T=30,rightMargin:W=30,topMargin:Y=20,bottomMargin:X=25,relativeHeight:s,tooltip:U,onSeriesMouseOver:le,highlightAreaSettings:ce=[],graphID:xe,minValue:ue,maxValue:I,maxDate:B,minDate:me,graphDownload:M=!1,dataDownload:V=!1,animate:N=!1,language:a="en",refValues:m=[],minHeight:w=0,strokeWidth:z=2,showDots:J=!0,annotations:d=[],customHighlightAreaSettings:A=[],theme:pe="light",ariaLabel:he,regressionLine:k=!1,yAxisTitle:K,noOfYTicks:Q=5,curveType:Z="curve",styles:R,classNames:E,precision:g=2,customLayers:_=[]}=re,[i,ee]=h.useState(0),[te,l]=h.useState(0),p=h.useRef(null),ie=h.useRef(null);return h.useEffect(()=>{const x=new ResizeObserver(f=>{ee(c||f[0].target.clientWidth||620),l(q||f[0].target.clientHeight||480)});return p.current&&(l(p.current.clientHeight||480),ee(p.current.clientWidth||620),c||x.observe(p.current)),()=>x.disconnect()},[c,q]),t.jsxRuntimeExports.jsx("div",{className:`${pe||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:a==="he"||a==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${a||"en"}`,c?"w-fit":"w-full",E?.graphContainer),style:{...R?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:xe,ref:ie,"aria-label":he||`${b?`The graph shows ${b}. `:""}This is a line chart that shows trends over time.${r?` ${r}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:v?P||"1rem":P||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[b||r||M||V?t.jsxRuntimeExports.jsx(Pe.GraphHeader,{styles:{title:R?.title,description:R?.description},classNames:{title:E?.title,description:E?.description},graphTitle:b,graphDescription:r,width:c,graphDownload:M?ie.current:void 0,dataDownload:V?O.map(x=>x.data).filter(x=>x!==void 0).length>0?O.map(x=>x.data).filter(x=>x!==void 0):O.filter(x=>x!==void 0):null}):null,O.length===0?t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:t.jsxRuntimeExports.jsx(Ye.EmptyState,{})}):t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:p,"aria-label":"Graph area",children:(c||i)&&(q||te)?t.jsxRuntimeExports.jsx(Xe,{data:O,lineColor:$||We.Colors.primaryColors["blue-600"],width:c||i,height:Math.max(w,q||(s?w?(c||i)*s>w?(c||i)*s:w:(c||i)*s:te)),suffix:H,prefix:D,dateFormat:j,showValues:ae,noOfXTicks:oe,leftMargin:T,rightMargin:W,topMargin:Y,bottomMargin:X,tooltip:U,highlightAreaSettings:ce,onSeriesMouseOver:le,refValues:m,minValue:ue,maxValue:I,animate:N===!0?{duration:.5,once:!0,amount:.5}:N||{duration:0,once:!0,amount:0},rtl:a==="he"||a==="ar",strokeWidth:z,showDots:J,annotations:d,customHighlightAreaSettings:A,regressionLine:k,yAxisTitle:K,noOfYTicks:Q,maxDate:B,minDate:me,curveType:Z,styles:R,classNames:E,precision:g,customLayers:_}):null}),L||G?t.jsxRuntimeExports.jsx(Ge.GraphFooter,{styles:{footnote:R?.footnote,source:R?.source},classNames:{footnote:E?.footnote,source:E?.source},sources:L,footNote:G,width:c}):null]})})})})}exports.SimpleLineChart=Ue;
2
2
  //# sourceMappingURL=SimpleLineChart.cjs.map
@@ -1,10 +1,10 @@
1
1
  import { j as t, m as Y } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { useRef as oe, useState as M, useEffect as de } from "react";
3
3
  import { p as h, f as Oe } from "./parse-DlCRUFh_.js";
4
- import { s as De } from "./index-DxagiOHo.js";
4
+ import { s as De } from "./index-fwdktvAS.js";
5
5
  import { l as Le, a as $e } from "./simple-statistics-flVzqVtt.js";
6
6
  import { n as Ae } from "./numberFormattingFunction-14YCbkN2.js";
7
- import { T as Ne } from "./Tooltip-DyM5snqx.js";
7
+ import { T as Ne } from "./Tooltip-CVCGWyzw.js";
8
8
  import { c as k } from "./checkIfNullOrUndefined-DmfiKkNw.js";
9
9
  import { C as ke, g as Te, A as Se } from "./customArea-B-dWU0zZ.js";
10
10
  import { A as Me } from "./Axis-Ddg-seDi.js";
@@ -13,7 +13,7 @@ import { X as Re } from "./XTicksAndGridLines-Bn9u5gOM.js";
13
13
  import { R as He } from "./ReferenceLine-CfAW3vKJ.js";
14
14
  import { R as Ie } from "./RegressionLine-mH7UKOPi.js";
15
15
  import { Y as We } from "./YTicksAndGridLines-B6ah7CRf.js";
16
- import { H as Fe } from "./index-Cdcfp4nk.js";
16
+ import { H as Fe } from "./index-DKCxu1Gh.js";
17
17
  import { t as Ye } from "./time-BzJP5SPC.js";
18
18
  import { a as Pe } from "./linear-DUdu7l2G.js";
19
19
  import { l as Xe, c as Ee } from "./line-CPfhohvF.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-DDoeWRVt.cjs"),o=require("react"),ae=require("./index-Ds0uHjK9.cjs"),A=require("./index-B0rbzOoC.cjs"),te=require("./index-BXns0-ng.cjs"),C=require("./DropdownSelect-DBDM64B5.cjs"),h=require("./checkIfMultiple-BXbHUCWM.cjs"),le=require("./Typography-k-kOjICQ.cjs"),ne=require("./Spinner-DA6Z5E4n.cjs"),re=require("./GraphEl-Bz2jatkM.cjs"),G=require("./fetchAndParseData-CQyVGCul.cjs"),U=require("./transformDataForAggregation-Du-Hei-W.cjs"),z=require("./getUniqValue-CHqgSss5.cjs"),ie=require("./GraphHeader.cjs"),W=require("./filterData-DN6py7y_.cjs"),oe=require("./getGraphList-gf02xgT2.cjs"),Z=require("./transformDataForSelect-YmStusCI.cjs"),se=s=>{if(s.findIndex(r=>r.chartConfigId==="yMin")!==-1&&s.findIndex(r=>r.chartConfigId==="yMax")!==-1)return s;const l=[...s];return s.findIndex(r=>r.chartConfigId==="yMin")===-1&&l.push({chartConfigId:"yMin",columnId:`${s[s.findIndex(r=>r.chartConfigId==="y")].columnId}Min`}),s.findIndex(r=>r.chartConfigId==="yMax")===-1&&l.push({chartConfigId:"yMax",columnId:`${s[s.findIndex(r=>r.chartConfigId==="y")].columnId}Max`}),l},F=(s,l)=>{const r=l?.map(y=>{const f=s?.findIndex(i=>i.chartConfigId===y.chartConfigId);if(f===-1)return{};const v=s[f]?.allowedColumnIds?.findIndex(i=>i.value===y.columnId);return v===-1?{}:s[f].allowedColumnIds[v].graphSettings||{}})||[];return Object.assign({},...r)};function ue(s){const{graphSettings:l,dataSettings:r,filters:y,graphType:f,dataTransform:v,graphDataConfiguration:i,dataFilters:q,debugMode:D,dataSelectionOptions:j,advancedDataSelectionOptions:N,readableHeader:J,noOfFiltersPerRow:p=4,updateFilters:B,uiMode:g="normal",highlightDataPointSettings:I}=s,[b,K]=o.useState(void 0),[S,Q]=o.useState(void 0),[m,w]=o.useState(i),[x,R]=o.useState({}),[V,X]=o.useState(void 0),[Y,_]=o.useState([]),P=o.useRef(null),H=o.useRef(i),[E,O]=o.useState([]),k=o.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),L=o.useCallback(async()=>{if(r)try{const d=await(r.dataURL?typeof r.dataURL=="string"?r.fileType==="json"?G.fetchAndParseJSON(r.dataURL,r.columnsToArray,r.dataTransformation,D):r.fileType==="api"?G.fetchAndTransformDataFromAPI(r.dataURL,r.apiHeaders,r.columnsToArray,r.dataTransformation,D):G.fetchAndParseCSV(r.dataURL,r.dataTransformation,r.columnsToArray,D,r.delimiter,!0):G.fetchAndParseMultipleDataSources(r.dataURL,r.idColumnTitle):G.transformColumnsToArray(r.data,r.columnsToArray));Q(d);const a=(y||[]).map(t=>({filter:t.column,label:t.label||`Filter by ${t.column}`,singleSelect:t.singleSelect,clearable:t.clearable,defaultValue:Z.transformDefaultValue(t.defaultValue),value:Z.transformDefaultValue(t.defaultValue),availableValues:z.getUniqValue(d,t.column).filter(u=>!t.excludeValues?.includes(`${u}`)).map(u=>({value:u,label:u})),allowSelectAll:t.allowSelectAll,width:t.width}));O(a)}catch(e){console.error("Data fetching error:",e)}},[r,y,D]);o.useEffect(()=>{L()},[L]);const $=o.useMemo(()=>!S||E.length===0?S:S.filter(d=>E.every(a=>a.value&&A.flattenDeep([a.value]).length>0?ae.intersection(A.flattenDeep([d[a.filter]]),A.flattenDeep([a.value]).map(t=>t.value)).length>0:!0)),[E,S]);o.useEffect(()=>{j&&R(F(j,i))},[j,i]),o.useEffect(()=>{S&&K($)},[$,f,S]),o.useEffect(()=>{I?.column&&$&&_(z.getUniqValue($,I.column).filter(e=>!I?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))},[$,I]),o.useEffect(()=>{te.isEqual(H.current,i)||(w(i),H.current=i)},[i]);const M=o.useCallback((e,d)=>{O(a=>a.map(t=>t.filter===e?{...t,value:d}:t))},[]),ee=o.useMemo(()=>{if(!b)return;const e=f==="lineChartWithConfidenceInterval"&&m?se(m):m;return U.transformDataForGraph(v?U.transformDataForAggregation(W.filterData(b,q||[]),v.keyColumn,v.aggregationColumnsSetting):W.filterData(b,q||[]),f,e)},[f,m,b,q,v]);return r?n.jsxRuntimeExports.jsx("div",{className:`${l?.theme||"light"} flex ${l?.width?"w-fit grow-0":"w-full grow"}${l?.height?"":" h-full"}`,dir:l?.language==="he"||l?.language==="ar"?"rtl":void 0,children:n.jsxRuntimeExports.jsx("div",{className:n.mo(`${l?.backgroundColor?l?.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${l?.language||"en"}`,l?.classNames?.graphContainer),style:{...l?.styles?.graphContainer||{},...l?.backgroundColor&&l?.backgroundColor!==!0?{backgroundColor:l?.backgroundColor}:{}},id:l?.graphID,ref:P,children:n.jsxRuntimeExports.jsx("div",{style:{padding:l?.backgroundColor?l?.padding||"1rem":l?.padding||0,flexGrow:1,display:"flex"},children:n.jsxRuntimeExports.jsx("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:b||oe.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(f)!==-1?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[x?.graphTitle||x?.graphDescription||l?.graphTitle||l?.graphDescription||l?.graphDownload||l?.dataDownload?n.jsxRuntimeExports.jsx(ie.GraphHeader,{styles:{title:x?.styles?.title||l?.styles?.title,description:x?.styles?.description||l?.styles?.description},classNames:{title:x?.classNames?.title||l?.classNames?.title,description:x?.classNames?.description||l?.classNames?.description},graphTitle:x?.graphTitle||l?.graphTitle,graphDescription:x?.graphDescription||l?.graphDescription,width:x?.width||l?.width,graphDownload:l?.graphDownload?P.current:void 0,dataDownload:l?.dataDownload&&b&&b.length>0?b:null}):null,E.length!==0||(j||[]).length!==0||(N||[]).length!==0||I?n.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:[N?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.options.map(a=>({...a,value:a.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{R(a?.graphSettings||{}),w(a?.dataConfiguration)}}):n.jsxRuntimeExports.jsx(h.fe,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:g,onValueChange:a=>{const t=e.options[e.options.findIndex(u=>u.label===a)];R(t.graphSettings||{}),w(t.dataConfiguration)},children:e.options.map((a,t)=>n.jsxRuntimeExports.jsx(h.ve,{label:a.label,value:a.label},t))})]},d)),j?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),h.checkIfMultiple(e.chartConfigId,m||[])?e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:i?i[i.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]):void 0,filterOption:C.Hu(k),onChange:a=>{const t={columnId:(a||[]).map(c=>c.value),chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);w(u)}}):n.jsxRuntimeExports.jsx(h.w,{variant:g,defaultValue:i?i[i.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]).map(a=>a.value):[],onValueChange:a=>{const t={columnId:a||[],chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);w(u)},children:e.allowedColumnIds.map((a,t)=>n.jsxRuntimeExports.jsx(h.G,{label:a.label,value:a.label},t))}):e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:i?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===i[i.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:a=>{const t={columnId:a?.value,chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);R(F(j,u)),w(u)}}):n.jsxRuntimeExports.jsx(h.fe,{variant:g,defaultValue:i?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===i[i.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const u={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(T=>T.label===a)].value,chartConfigId:e.chartConfigId},c=m?.map(T=>T.chartConfigId===u.chartConfigId?u:T);R(F(j,c)),w(c)},children:e.allowedColumnIds.map((a,t)=>n.jsxRuntimeExports.jsx(h.ve,{label:a.label,value:a.label},t))})]},d)),E?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label}),e.singleSelect?n.jsxRuntimeExports.jsx(C.Za,{options:e.availableValues,variant:g,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:a=>{M(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.availableValues,variant:g,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:a=>{M(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):n.jsxRuntimeExports.jsx(h.w,{variant:g,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{M(e.filter,e.availableValues.filter(t=>a.indexOf(`${t.value}`)!==-1))},children:e.availableValues.map((a,t)=>n.jsxRuntimeExports.jsx(h.G,{label:`${a.label}`,value:`${a.value}`},t))}),e.allowSelectAll?n.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{M(e.filter,e.availableValues)},children:"Select all options"}):null]})]},d)),I?n.jsxRuntimeExports.jsxs("div",{style:{width:I.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:I.label||"Highlight data"}),n.jsxRuntimeExports.jsx(C.Za,{options:Y,variant:g,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:e=>{X(e?.map(d=>d.value))},value:V?.map(e=>({label:e,value:e})),defaultValue:I.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,n.jsxRuntimeExports.jsx(re.GraphEl,{graph:f,graphData:ee,graphDataConfiguration:m,debugMode:D,readableHeader:J||[],updateFilters:B,settings:{...l||{},...x,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",theme:l?.theme,...V?{highlightedDataPoints:V,highlightedIds:V?.map(e=>`${e}`),highlightedLines:V?.map(e=>e)}:{}}})]}):n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:n.jsxRuntimeExports.jsx(ne.y,{})})})})})}):n.jsxRuntimeExports.jsx(le.u,{size:"xs",className:"text-center text-accent-dark-red dark:text-accent-red p-2",children:"Please make sure either `dataSettings` props are present as they are required for data."})}exports.SingleGraphDashboard=ue;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-DDoeWRVt.cjs"),o=require("react"),ae=require("./index-D72cOtq7.cjs"),A=require("./index-BS2TADPj.cjs"),te=require("./index-DQA8q5sC.cjs"),C=require("./DropdownSelect-DBDM64B5.cjs"),h=require("./checkIfMultiple-BXbHUCWM.cjs"),le=require("./Typography-k-kOjICQ.cjs"),ne=require("./Spinner-DA6Z5E4n.cjs"),re=require("./GraphEl-4RUlclvW.cjs"),G=require("./fetchAndParseData-Dcy7AS_0.cjs"),U=require("./transformDataForAggregation-BVxVu4yY.cjs"),z=require("./getUniqValue-CfuE_l9c.cjs"),ie=require("./GraphHeader.cjs"),W=require("./filterData-BoYadk0l.cjs"),oe=require("./getGraphList-gf02xgT2.cjs"),Z=require("./transformDataForSelect-YmStusCI.cjs"),se=s=>{if(s.findIndex(r=>r.chartConfigId==="yMin")!==-1&&s.findIndex(r=>r.chartConfigId==="yMax")!==-1)return s;const l=[...s];return s.findIndex(r=>r.chartConfigId==="yMin")===-1&&l.push({chartConfigId:"yMin",columnId:`${s[s.findIndex(r=>r.chartConfigId==="y")].columnId}Min`}),s.findIndex(r=>r.chartConfigId==="yMax")===-1&&l.push({chartConfigId:"yMax",columnId:`${s[s.findIndex(r=>r.chartConfigId==="y")].columnId}Max`}),l},F=(s,l)=>{const r=l?.map(y=>{const f=s?.findIndex(i=>i.chartConfigId===y.chartConfigId);if(f===-1)return{};const v=s[f]?.allowedColumnIds?.findIndex(i=>i.value===y.columnId);return v===-1?{}:s[f].allowedColumnIds[v].graphSettings||{}})||[];return Object.assign({},...r)};function ue(s){const{graphSettings:l,dataSettings:r,filters:y,graphType:f,dataTransform:v,graphDataConfiguration:i,dataFilters:q,debugMode:D,dataSelectionOptions:j,advancedDataSelectionOptions:N,readableHeader:J,noOfFiltersPerRow:p=4,updateFilters:B,uiMode:g="normal",highlightDataPointSettings:I}=s,[b,K]=o.useState(void 0),[S,Q]=o.useState(void 0),[m,w]=o.useState(i),[x,R]=o.useState({}),[V,X]=o.useState(void 0),[Y,_]=o.useState([]),P=o.useRef(null),H=o.useRef(i),[E,O]=o.useState([]),k=o.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),L=o.useCallback(async()=>{if(r)try{const d=await(r.dataURL?typeof r.dataURL=="string"?r.fileType==="json"?G.fetchAndParseJSON(r.dataURL,r.columnsToArray,r.dataTransformation,D):r.fileType==="api"?G.fetchAndTransformDataFromAPI(r.dataURL,r.apiHeaders,r.columnsToArray,r.dataTransformation,D):G.fetchAndParseCSV(r.dataURL,r.dataTransformation,r.columnsToArray,D,r.delimiter,!0):G.fetchAndParseMultipleDataSources(r.dataURL,r.idColumnTitle):G.transformColumnsToArray(r.data,r.columnsToArray));Q(d);const a=(y||[]).map(t=>({filter:t.column,label:t.label||`Filter by ${t.column}`,singleSelect:t.singleSelect,clearable:t.clearable,defaultValue:Z.transformDefaultValue(t.defaultValue),value:Z.transformDefaultValue(t.defaultValue),availableValues:z.getUniqValue(d,t.column).filter(u=>!t.excludeValues?.includes(`${u}`)).map(u=>({value:u,label:u})),allowSelectAll:t.allowSelectAll,width:t.width}));O(a)}catch(e){console.error("Data fetching error:",e)}},[r,y,D]);o.useEffect(()=>{L()},[L]);const $=o.useMemo(()=>!S||E.length===0?S:S.filter(d=>E.every(a=>a.value&&A.flattenDeep([a.value]).length>0?ae.intersection(A.flattenDeep([d[a.filter]]),A.flattenDeep([a.value]).map(t=>t.value)).length>0:!0)),[E,S]);o.useEffect(()=>{j&&R(F(j,i))},[j,i]),o.useEffect(()=>{S&&K($)},[$,f,S]),o.useEffect(()=>{I?.column&&$&&_(z.getUniqValue($,I.column).filter(e=>!I?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))},[$,I]),o.useEffect(()=>{te.isEqual(H.current,i)||(w(i),H.current=i)},[i]);const M=o.useCallback((e,d)=>{O(a=>a.map(t=>t.filter===e?{...t,value:d}:t))},[]),ee=o.useMemo(()=>{if(!b)return;const e=f==="lineChartWithConfidenceInterval"&&m?se(m):m;return U.transformDataForGraph(v?U.transformDataForAggregation(W.filterData(b,q||[]),v.keyColumn,v.aggregationColumnsSetting):W.filterData(b,q||[]),f,e)},[f,m,b,q,v]);return r?n.jsxRuntimeExports.jsx("div",{className:`${l?.theme||"light"} flex ${l?.width?"w-fit grow-0":"w-full grow"}${l?.height?"":" h-full"}`,dir:l?.language==="he"||l?.language==="ar"?"rtl":void 0,children:n.jsxRuntimeExports.jsx("div",{className:n.mo(`${l?.backgroundColor?l?.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${l?.language||"en"}`,l?.classNames?.graphContainer),style:{...l?.styles?.graphContainer||{},...l?.backgroundColor&&l?.backgroundColor!==!0?{backgroundColor:l?.backgroundColor}:{}},id:l?.graphID,ref:P,children:n.jsxRuntimeExports.jsx("div",{style:{padding:l?.backgroundColor?l?.padding||"1rem":l?.padding||0,flexGrow:1,display:"flex"},children:n.jsxRuntimeExports.jsx("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:b||oe.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(f)!==-1?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[x?.graphTitle||x?.graphDescription||l?.graphTitle||l?.graphDescription||l?.graphDownload||l?.dataDownload?n.jsxRuntimeExports.jsx(ie.GraphHeader,{styles:{title:x?.styles?.title||l?.styles?.title,description:x?.styles?.description||l?.styles?.description},classNames:{title:x?.classNames?.title||l?.classNames?.title,description:x?.classNames?.description||l?.classNames?.description},graphTitle:x?.graphTitle||l?.graphTitle,graphDescription:x?.graphDescription||l?.graphDescription,width:x?.width||l?.width,graphDownload:l?.graphDownload?P.current:void 0,dataDownload:l?.dataDownload&&b&&b.length>0?b:null}):null,E.length!==0||(j||[]).length!==0||(N||[]).length!==0||I?n.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:[N?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.options.map(a=>({...a,value:a.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{R(a?.graphSettings||{}),w(a?.dataConfiguration)}}):n.jsxRuntimeExports.jsx(h.fe,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:g,onValueChange:a=>{const t=e.options[e.options.findIndex(u=>u.label===a)];R(t.graphSettings||{}),w(t.dataConfiguration)},children:e.options.map((a,t)=>n.jsxRuntimeExports.jsx(h.ve,{label:a.label,value:a.label},t))})]},d)),j?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),h.checkIfMultiple(e.chartConfigId,m||[])?e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:i?i[i.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]):void 0,filterOption:C.Hu(k),onChange:a=>{const t={columnId:(a||[]).map(c=>c.value),chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);w(u)}}):n.jsxRuntimeExports.jsx(h.w,{variant:g,defaultValue:i?i[i.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]).map(a=>a.value):[],onValueChange:a=>{const t={columnId:a||[],chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);w(u)},children:e.allowedColumnIds.map((a,t)=>n.jsxRuntimeExports.jsx(h.G,{label:a.label,value:a.label},t))}):e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:i?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===i[i.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:a=>{const t={columnId:a?.value,chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);R(F(j,u)),w(u)}}):n.jsxRuntimeExports.jsx(h.fe,{variant:g,defaultValue:i?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===i[i.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const u={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(T=>T.label===a)].value,chartConfigId:e.chartConfigId},c=m?.map(T=>T.chartConfigId===u.chartConfigId?u:T);R(F(j,c)),w(c)},children:e.allowedColumnIds.map((a,t)=>n.jsxRuntimeExports.jsx(h.ve,{label:a.label,value:a.label},t))})]},d)),E?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label}),e.singleSelect?n.jsxRuntimeExports.jsx(C.Za,{options:e.availableValues,variant:g,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:a=>{M(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.availableValues,variant:g,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:a=>{M(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):n.jsxRuntimeExports.jsx(h.w,{variant:g,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{M(e.filter,e.availableValues.filter(t=>a.indexOf(`${t.value}`)!==-1))},children:e.availableValues.map((a,t)=>n.jsxRuntimeExports.jsx(h.G,{label:`${a.label}`,value:`${a.value}`},t))}),e.allowSelectAll?n.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{M(e.filter,e.availableValues)},children:"Select all options"}):null]})]},d)),I?n.jsxRuntimeExports.jsxs("div",{style:{width:I.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:I.label||"Highlight data"}),n.jsxRuntimeExports.jsx(C.Za,{options:Y,variant:g,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:e=>{X(e?.map(d=>d.value))},value:V?.map(e=>({label:e,value:e})),defaultValue:I.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,n.jsxRuntimeExports.jsx(re.GraphEl,{graph:f,graphData:ee,graphDataConfiguration:m,debugMode:D,readableHeader:J||[],updateFilters:B,settings:{...l||{},...x,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",theme:l?.theme,...V?{highlightedDataPoints:V,highlightedIds:V?.map(e=>`${e}`),highlightedLines:V?.map(e=>e)}:{}}})]}):n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:n.jsxRuntimeExports.jsx(ne.y,{})})})})})}):n.jsxRuntimeExports.jsx(le.u,{size:"xs",className:"text-center text-accent-dark-red dark:text-accent-red p-2",children:"Please make sure either `dataSettings` props are present as they are required for data."})}exports.SingleGraphDashboard=ue;
2
2
  //# sourceMappingURL=SingleGraphDashboard.cjs.map
@@ -27,6 +27,10 @@ declare interface AggregationSettingsDataType {
27
27
  aggregationMethod?: 'sum' | 'average' | 'min' | 'max';
28
28
  }
29
29
 
30
+ declare interface AmbientLightConfig extends BaseLightConfig {
31
+ type: 'ambient';
32
+ }
33
+
30
34
  declare interface AnimateDataType {
31
35
  duration: number;
32
36
  once: boolean;
@@ -69,6 +73,12 @@ declare interface AxesStyleObject {
69
73
  axis?: React.CSSProperties;
70
74
  }
71
75
 
76
+ declare interface BaseLightConfig {
77
+ type: string;
78
+ color: number;
79
+ intensity: number;
80
+ }
81
+
72
82
  declare interface ClassNameObject {
73
83
  title?: string;
74
84
  footnote?: string;
@@ -154,6 +164,14 @@ declare interface DataTableColumnDataType {
154
164
  columnWidth?: number;
155
165
  }
156
166
 
167
+ declare interface DirectionalLightConfig extends BaseLightConfig {
168
+ type: 'directional';
169
+ target?: Position;
170
+ castShadow?: boolean;
171
+ shadow?: ShadowConfig;
172
+ position?: Position | 'camera';
173
+ }
174
+
157
175
  declare interface FileSettingsDataType {
158
176
  dataURL: string;
159
177
  idColumnName: string;
@@ -429,9 +447,10 @@ declare interface GraphSettingsDataType {
429
447
  polygonAltitude?: number;
430
448
  atmosphereAltitude?: number;
431
449
  globeCurvatureResolution?: number;
432
- lightColor?: string;
450
+ lights?: LightConfig[];
433
451
  fogSetting?: FogDataType;
434
452
  showAxisLabels?: boolean;
453
+ highlightedAltitude?: number;
435
454
  }
436
455
 
437
456
  declare type GraphType = GraphTypeForGriddedGraph;
@@ -464,6 +483,8 @@ declare type HighlightDataPointSettingsDataType = {
464
483
 
465
484
  declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
466
485
 
486
+ declare type LightConfig = AmbientLightConfig | DirectionalLightConfig | PointLightConfig | SpotLightConfig;
487
+
467
488
  declare interface MapLegendDataType {
468
489
  mapStyleName: string;
469
490
  legend: string | React.ReactNode;
@@ -471,6 +492,19 @@ declare interface MapLegendDataType {
471
492
 
472
493
  declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
473
494
 
495
+ declare interface PointLightConfig extends BaseLightConfig {
496
+ type: 'point';
497
+ distance?: number;
498
+ decay?: number;
499
+ position?: Position | 'camera';
500
+ }
501
+
502
+ declare interface Position {
503
+ x: number;
504
+ y: number;
505
+ z: number;
506
+ }
507
+
474
508
  declare interface Props {
475
509
  graphSettings?: GraphSettingsDataType;
476
510
  readableHeader?: {
@@ -511,6 +545,17 @@ declare interface ReferenceDataType {
511
545
 
512
546
  declare type ScaleDataType = 'categorical' | 'linear' | 'threshold';
513
547
 
548
+ declare interface ShadowConfig {
549
+ mapSize: {
550
+ width: number;
551
+ height: number;
552
+ };
553
+ camera: {
554
+ near: number;
555
+ far: number;
556
+ };
557
+ }
558
+
514
559
  export declare function SingleGraphDashboard(props: Props): JSX.Element;
515
560
 
516
561
  declare interface SourcesDataType {
@@ -518,6 +563,18 @@ declare interface SourcesDataType {
518
563
  link?: string;
519
564
  }
520
565
 
566
+ declare interface SpotLightConfig extends BaseLightConfig {
567
+ type: 'spot';
568
+ target?: Position;
569
+ distance?: number;
570
+ angle?: number;
571
+ penumbra?: number;
572
+ decay?: number;
573
+ castShadow?: boolean;
574
+ shadow?: ShadowConfig;
575
+ position?: Position | 'camera';
576
+ }
577
+
521
578
  declare interface StyleObject {
522
579
  title?: React.CSSProperties;
523
580
  footnote?: React.CSSProperties;
@@ -1,18 +1,18 @@
1
1
  import { j as n, m as sa } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { useState as b, useRef as q, useMemo as O, useCallback as Z, useEffect as G } from "react";
3
- import { i as da } from "./index-C1rRk_50.js";
4
- import { f as P } from "./index-UV9hjG_S.js";
5
- import { i as ua } from "./index-27yTRcko.js";
3
+ import { i as da } from "./index-V_JXij1_.js";
4
+ import { f as P } from "./index-EArKRVKg.js";
5
+ import { i as ua } from "./index-Bwrro8-q.js";
6
6
  import { Z as y, H as N } from "./DropdownSelect-CtOKZHD0.js";
7
7
  import { f as F, a as J, v as B, c as ca, w as K, G as Q } from "./checkIfMultiple-ChTJk2Tk.js";
8
8
  import { u as ha } from "./Typography-Ctgfl1J5.js";
9
9
  import { y as fa } from "./Spinner-C85UF28E.js";
10
- import { G as ga } from "./GraphEl-zNOHBYrK.js";
11
- import { f as pa, a as ma, b as Ca, c as xa, t as Ia } from "./fetchAndParseData-4gsYTy6_.js";
12
- import { a as va, t as ba } from "./transformDataForAggregation-CdcwlnNe.js";
13
- import { g as X } from "./getUniqValue-BtUENB2H.js";
10
+ import { G as ga } from "./GraphEl-ClIxlWa3.js";
11
+ import { f as pa, a as ma, b as Ca, c as xa, t as Ia } from "./fetchAndParseData-DBOl1Icl.js";
12
+ import { a as va, t as ba } from "./transformDataForAggregation-1BYVFqvF.js";
13
+ import { g as X } from "./getUniqValue-CttuU_wn.js";
14
14
  import { GraphHeader as wa } from "./GraphHeader.js";
15
- import { f as Y } from "./filterData-B8ocT57s.js";
15
+ import { f as Y } from "./filterData-9nEcQ-Jp.js";
16
16
  import { g as ya } from "./getGraphList-DuColTJM.js";
17
17
  import { t as _ } from "./transformDataForSelect-D8AuvYdf.js";
18
18
  const Va = (o) => {
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),s=require("./Spinner-DA6Z5E4n.cjs"),d=require("./SingleGraphDashboard.cjs"),g=require("./fetchAndParseData-CQyVGCul.cjs");function c(r){const{config:t}=r,[e,i]=n.useState(void 0);return n.useEffect(()=>{typeof t=="string"?g.fetchAndParseJSON(t).then(o=>{i(o)}):i(t)},[t]),e?a.jsxRuntimeExports.jsx(d.SingleGraphDashboard,{graphSettings:e.graphSettings,dataSettings:e.dataSettings,filters:e.filters,graphType:e.graphType,dataTransform:e.dataTransform,graphDataConfiguration:e.graphDataConfiguration,dataFilters:e.dataFilters,debugMode:e.debugMode,dataSelectionOptions:e.dataSelectionOptions,advancedDataSelectionOptions:e.advancedDataSelectionOptions,readableHeader:e.readableHeader,noOfFiltersPerRow:e.noOfFiltersPerRow,uiMode:e.uiMode,highlightDataPointSettings:e.highlightDataPointSettings}):a.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:a.jsxRuntimeExports.jsx(s.y,{})})}exports.SingleGraphDashboardFromConfig=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),s=require("./Spinner-DA6Z5E4n.cjs"),d=require("./SingleGraphDashboard.cjs"),g=require("./fetchAndParseData-Dcy7AS_0.cjs");function c(r){const{config:t}=r,[e,i]=n.useState(void 0);return n.useEffect(()=>{typeof t=="string"?g.fetchAndParseJSON(t).then(o=>{i(o)}):i(t)},[t]),e?a.jsxRuntimeExports.jsx(d.SingleGraphDashboard,{graphSettings:e.graphSettings,dataSettings:e.dataSettings,filters:e.filters,graphType:e.graphType,dataTransform:e.dataTransform,graphDataConfiguration:e.graphDataConfiguration,dataFilters:e.dataFilters,debugMode:e.debugMode,dataSelectionOptions:e.dataSelectionOptions,advancedDataSelectionOptions:e.advancedDataSelectionOptions,readableHeader:e.readableHeader,noOfFiltersPerRow:e.noOfFiltersPerRow,uiMode:e.uiMode,highlightDataPointSettings:e.highlightDataPointSettings}):a.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:a.jsxRuntimeExports.jsx(s.y,{})})}exports.SingleGraphDashboardFromConfig=c;
2
2
  //# sourceMappingURL=SingleGraphDashboardFromConfig.cjs.map
@@ -27,6 +27,10 @@ declare interface AggregationSettingsDataType {
27
27
  aggregationMethod?: 'sum' | 'average' | 'min' | 'max';
28
28
  }
29
29
 
30
+ declare interface AmbientLightConfig extends BaseLightConfig {
31
+ type: 'ambient';
32
+ }
33
+
30
34
  declare interface AnimateDataType {
31
35
  duration: number;
32
36
  once: boolean;
@@ -69,6 +73,12 @@ declare interface AxesStyleObject {
69
73
  axis?: React.CSSProperties;
70
74
  }
71
75
 
76
+ declare interface BaseLightConfig {
77
+ type: string;
78
+ color: number;
79
+ intensity: number;
80
+ }
81
+
72
82
  declare interface ClassNameObject {
73
83
  title?: string;
74
84
  footnote?: string;
@@ -177,6 +187,14 @@ declare interface DataTableColumnDataType {
177
187
  columnWidth?: number;
178
188
  }
179
189
 
190
+ declare interface DirectionalLightConfig extends BaseLightConfig {
191
+ type: 'directional';
192
+ target?: Position;
193
+ castShadow?: boolean;
194
+ shadow?: ShadowConfig;
195
+ position?: Position | 'camera';
196
+ }
197
+
180
198
  declare interface FileSettingsDataType {
181
199
  dataURL: string;
182
200
  idColumnName: string;
@@ -452,9 +470,10 @@ declare interface GraphSettingsDataType {
452
470
  polygonAltitude?: number;
453
471
  atmosphereAltitude?: number;
454
472
  globeCurvatureResolution?: number;
455
- lightColor?: string;
473
+ lights?: LightConfig[];
456
474
  fogSetting?: FogDataType;
457
475
  showAxisLabels?: boolean;
476
+ highlightedAltitude?: number;
458
477
  }
459
478
 
460
479
  declare type GraphType = GraphTypeForGriddedGraph;
@@ -487,6 +506,8 @@ declare type HighlightDataPointSettingsDataType = {
487
506
 
488
507
  declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
489
508
 
509
+ declare type LightConfig = AmbientLightConfig | DirectionalLightConfig | PointLightConfig | SpotLightConfig;
510
+
490
511
  declare interface MapLegendDataType {
491
512
  mapStyleName: string;
492
513
  legend: string | React.ReactNode;
@@ -494,6 +515,19 @@ declare interface MapLegendDataType {
494
515
 
495
516
  declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
496
517
 
518
+ declare interface PointLightConfig extends BaseLightConfig {
519
+ type: 'point';
520
+ distance?: number;
521
+ decay?: number;
522
+ position?: Position | 'camera';
523
+ }
524
+
525
+ declare interface Position {
526
+ x: number;
527
+ y: number;
528
+ z: number;
529
+ }
530
+
497
531
  declare interface Props {
498
532
  config: string | ConfigObject;
499
533
  }
@@ -514,6 +548,17 @@ declare interface ReferenceDataType {
514
548
 
515
549
  declare type ScaleDataType = 'categorical' | 'linear' | 'threshold';
516
550
 
551
+ declare interface ShadowConfig {
552
+ mapSize: {
553
+ width: number;
554
+ height: number;
555
+ };
556
+ camera: {
557
+ near: number;
558
+ far: number;
559
+ };
560
+ }
561
+
517
562
  export declare function SingleGraphDashboardFromConfig(props: Props): JSX.Element;
518
563
 
519
564
  declare interface SourcesDataType {
@@ -521,6 +566,18 @@ declare interface SourcesDataType {
521
566
  link?: string;
522
567
  }
523
568
 
569
+ declare interface SpotLightConfig extends BaseLightConfig {
570
+ type: 'spot';
571
+ target?: Position;
572
+ distance?: number;
573
+ angle?: number;
574
+ penumbra?: number;
575
+ decay?: number;
576
+ castShadow?: boolean;
577
+ shadow?: ShadowConfig;
578
+ position?: Position | 'camera';
579
+ }
580
+
524
581
  declare interface StyleObject {
525
582
  title?: React.CSSProperties;
526
583
  footnote?: React.CSSProperties;
@@ -2,7 +2,7 @@ import { j as a } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { useState as n, useEffect as s } from "react";
3
3
  import { y as f } from "./Spinner-C85UF28E.js";
4
4
  import { SingleGraphDashboard as g } from "./SingleGraphDashboard.js";
5
- import { f as d } from "./fetchAndParseData-4gsYTy6_.js";
5
+ import { f as d } from "./fetchAndParseData-DBOl1Icl.js";
6
6
  function u(o) {
7
7
  const { config: e } = o, [t, i] = n(void 0);
8
8
  return s(() => {
@@ -1,5 +1,9 @@
1
1
  import { JSX } from 'react/jsx-runtime';
2
2
 
3
+ declare interface AmbientLightConfig extends BaseLightConfig {
4
+ type: 'ambient';
5
+ }
6
+
3
7
  declare interface AnimateDataType {
4
8
  duration: number;
5
9
  once: boolean;
@@ -42,6 +46,12 @@ declare interface AxesStyleObject {
42
46
  axis?: React.CSSProperties;
43
47
  }
44
48
 
49
+ declare interface BaseLightConfig {
50
+ type: string;
51
+ color: number;
52
+ intensity: number;
53
+ }
54
+
45
55
  declare interface ClassNameObject {
46
56
  title?: string;
47
57
  footnote?: string;
@@ -93,6 +103,14 @@ declare interface DataTableColumnDataType {
93
103
  columnWidth?: number;
94
104
  }
95
105
 
106
+ declare interface DirectionalLightConfig extends BaseLightConfig {
107
+ type: 'directional';
108
+ target?: Position;
109
+ castShadow?: boolean;
110
+ shadow?: ShadowConfig;
111
+ position?: Position | 'camera';
112
+ }
113
+
96
114
  declare interface FogDataType {
97
115
  color: string;
98
116
  near: number;
@@ -344,9 +362,10 @@ declare interface GraphSettingsDataType {
344
362
  polygonAltitude?: number;
345
363
  atmosphereAltitude?: number;
346
364
  globeCurvatureResolution?: number;
347
- lightColor?: string;
365
+ lights?: LightConfig[];
348
366
  fogSetting?: FogDataType;
349
367
  showAxisLabels?: boolean;
368
+ highlightedAltitude?: number;
350
369
  }
351
370
 
352
371
  declare interface HighlightAreaSettingsDataType {
@@ -367,6 +386,8 @@ declare interface HighlightAreaSettingsForScatterPlotDataType {
367
386
 
368
387
  declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
369
388
 
389
+ declare type LightConfig = AmbientLightConfig | DirectionalLightConfig | PointLightConfig | SpotLightConfig;
390
+
370
391
  declare interface MapLegendDataType {
371
392
  mapStyleName: string;
372
393
  legend: string | React.ReactNode;
@@ -374,6 +395,19 @@ declare interface MapLegendDataType {
374
395
 
375
396
  declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
376
397
 
398
+ declare interface PointLightConfig extends BaseLightConfig {
399
+ type: 'point';
400
+ distance?: number;
401
+ decay?: number;
402
+ position?: Position | 'camera';
403
+ }
404
+
405
+ declare interface Position {
406
+ x: number;
407
+ y: number;
408
+ z: number;
409
+ }
410
+
377
411
  declare interface Props {
378
412
  graphSettings?: GraphSettingsDataType;
379
413
  graphType: GeoHubGraphType;
@@ -397,6 +431,17 @@ declare interface ReferenceDataType {
397
431
 
398
432
  declare type ScaleDataType = 'categorical' | 'linear' | 'threshold';
399
433
 
434
+ declare interface ShadowConfig {
435
+ mapSize: {
436
+ width: number;
437
+ height: number;
438
+ };
439
+ camera: {
440
+ near: number;
441
+ far: number;
442
+ };
443
+ }
444
+
400
445
  export declare function SingleGraphDashboardGeoHubMaps(props: Props): JSX.Element;
401
446
 
402
447
  declare interface SourcesDataType {
@@ -404,6 +449,18 @@ declare interface SourcesDataType {
404
449
  link?: string;
405
450
  }
406
451
 
452
+ declare interface SpotLightConfig extends BaseLightConfig {
453
+ type: 'spot';
454
+ target?: Position;
455
+ distance?: number;
456
+ angle?: number;
457
+ penumbra?: number;
458
+ decay?: number;
459
+ castShadow?: boolean;
460
+ shadow?: ShadowConfig;
461
+ position?: Position | 'camera';
462
+ }
463
+
407
464
  declare interface StyleObject {
408
465
  title?: React.CSSProperties;
409
466
  footnote?: React.CSSProperties;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),a=require("./Spinner-DA6Z5E4n.cjs"),u=require("./SingleGraphDashboardGeoHubMaps.cjs"),g=require("./fetchAndParseData-CQyVGCul.cjs");function c(o){const{config:t}=o,[e,s]=n.useState(void 0);return n.useEffect(()=>{typeof t=="string"?g.fetchAndParseJSON(t).then(i=>{s(i)}):s(t)},[t]),e?r.jsxRuntimeExports.jsx(u.SingleGraphDashboardGeoHubMaps,{graphSettings:e.graphSettings,graphType:e.graphType,debugMode:e.debugMode,uiMode:e.uiMode}):r.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:r.jsxRuntimeExports.jsx(a.y,{})})}exports.SingleGraphDashboardGeoHubMapsFromConfig=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),a=require("./Spinner-DA6Z5E4n.cjs"),u=require("./SingleGraphDashboardGeoHubMaps.cjs"),g=require("./fetchAndParseData-Dcy7AS_0.cjs");function c(o){const{config:t}=o,[e,s]=n.useState(void 0);return n.useEffect(()=>{typeof t=="string"?g.fetchAndParseJSON(t).then(i=>{s(i)}):s(t)},[t]),e?r.jsxRuntimeExports.jsx(u.SingleGraphDashboardGeoHubMaps,{graphSettings:e.graphSettings,graphType:e.graphType,debugMode:e.debugMode,uiMode:e.uiMode}):r.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:r.jsxRuntimeExports.jsx(a.y,{})})}exports.SingleGraphDashboardGeoHubMapsFromConfig=c;
2
2
  //# sourceMappingURL=SingleGraphDashboardGeoHubMapsFromConfig.cjs.map