@undp/data-viz 1.4.16 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.js +3 -3
  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 +2 -2
  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 +2 -2
  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 +2 -2
  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 +3 -3
  71. package/dist/MultiLineChart.cjs +1 -1
  72. package/dist/MultiLineChart.js +2 -2
  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.js +6 -6
  88. package/dist/ScrollStory.d.ts +58 -1
  89. package/dist/SimpleLineChart.cjs +1 -1
  90. package/dist/SimpleLineChart.js +2 -2
  91. package/dist/SingleGraphDashboard.cjs +1 -1
  92. package/dist/SingleGraphDashboard.d.ts +58 -1
  93. package/dist/SingleGraphDashboard.js +8 -8
  94. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  95. package/dist/SingleGraphDashboardFromConfig.d.ts +58 -1
  96. package/dist/SingleGraphDashboardFromConfig.js +1 -1
  97. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +58 -1
  98. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  99. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +58 -1
  100. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
  101. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  102. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
  103. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +58 -1
  104. package/dist/SingleGraphDashboardThreeDGraphs.js +20 -19
  105. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
  106. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  107. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +58 -1
  108. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
  109. package/dist/SlopeChart.cjs +1 -1
  110. package/dist/SlopeChart.js +4 -4
  111. package/dist/SparkLine.cjs +1 -1
  112. package/dist/SparkLine.js +2 -2
  113. package/dist/StatCardFromData.cjs +1 -1
  114. package/dist/StatCardFromData.js +1 -1
  115. package/dist/StripChart.cjs +1 -1
  116. package/dist/StripChart.js +5 -5
  117. package/dist/ThreeDGlobe.cjs +1 -1
  118. package/dist/ThreeDGlobe.cjs.map +1 -1
  119. package/dist/ThreeDGlobe.d.ts +61 -6
  120. package/dist/ThreeDGlobe.js +385 -314
  121. package/dist/ThreeDGlobe.js.map +1 -1
  122. package/dist/{Tooltip-DyM5snqx.js → Tooltip-CVCGWyzw.js} +2 -2
  123. package/dist/{Tooltip-DyM5snqx.js.map → Tooltip-CVCGWyzw.js.map} +1 -1
  124. package/dist/{Tooltip-n8z5bfav.cjs → Tooltip-De16GWhY.cjs} +2 -2
  125. package/dist/{Tooltip-n8z5bfav.cjs.map → Tooltip-De16GWhY.cjs.map} +1 -1
  126. package/dist/TreeMapGraph.cjs +1 -1
  127. package/dist/TreeMapGraph.js +3 -3
  128. package/dist/Types.d.ts +58 -1
  129. package/dist/UnitChart.cjs +1 -1
  130. package/dist/UnitChart.js +1 -1
  131. package/dist/_commonjsHelpers-BH3jXuIh.cjs +2 -0
  132. package/dist/_commonjsHelpers-BH3jXuIh.cjs.map +1 -0
  133. package/dist/_commonjsHelpers-ByX85dGu.js +34 -0
  134. package/dist/_commonjsHelpers-ByX85dGu.js.map +1 -0
  135. package/dist/{ensureCompleteData-BBDZbDCE.js → ensureCompleteData-BALdOrsS.js} +2 -2
  136. package/dist/{ensureCompleteData-BBDZbDCE.js.map → ensureCompleteData-BALdOrsS.js.map} +1 -1
  137. package/dist/{ensureCompleteData-DqWQ2Zbi.cjs → ensureCompleteData-BU5Zlccy.cjs} +2 -2
  138. package/dist/{ensureCompleteData-DqWQ2Zbi.cjs.map → ensureCompleteData-BU5Zlccy.cjs.map} +1 -1
  139. package/dist/{fetchAndParseData-4gsYTy6_.js → fetchAndParseData-DBOl1Icl.js} +2 -2
  140. package/dist/{fetchAndParseData-4gsYTy6_.js.map → fetchAndParseData-DBOl1Icl.js.map} +1 -1
  141. package/dist/{fetchAndParseData-CQyVGCul.cjs → fetchAndParseData-Dcy7AS_0.cjs} +2 -2
  142. package/dist/{fetchAndParseData-CQyVGCul.cjs.map → fetchAndParseData-Dcy7AS_0.cjs.map} +1 -1
  143. package/dist/fetchAndParseData.cjs +1 -1
  144. package/dist/fetchAndParseData.js +1 -1
  145. package/dist/{filterData-B8ocT57s.js → filterData-9nEcQ-Jp.js} +3 -3
  146. package/dist/{filterData-B8ocT57s.js.map → filterData-9nEcQ-Jp.js.map} +1 -1
  147. package/dist/{filterData-DN6py7y_.cjs → filterData-BoYadk0l.cjs} +2 -2
  148. package/dist/{filterData-DN6py7y_.cjs.map → filterData-BoYadk0l.cjs.map} +1 -1
  149. package/dist/{getJenks-VhM3GIoC.js → getJenks-DW96UYNE.js} +2 -2
  150. package/dist/{getJenks-VhM3GIoC.js.map → getJenks-DW96UYNE.js.map} +1 -1
  151. package/dist/{getJenks-TWQvbuOz.cjs → getJenks-vofIZmeb.cjs} +2 -2
  152. package/dist/{getJenks-TWQvbuOz.cjs.map → getJenks-vofIZmeb.cjs.map} +1 -1
  153. package/dist/{getUniqValue-CHqgSss5.cjs → getUniqValue-CfuE_l9c.cjs} +2 -2
  154. package/dist/{getUniqValue-CHqgSss5.cjs.map → getUniqValue-CfuE_l9c.cjs.map} +1 -1
  155. package/dist/{getUniqValue-BtUENB2H.js → getUniqValue-CttuU_wn.js} +4 -4
  156. package/dist/{getUniqValue-BtUENB2H.js.map → getUniqValue-CttuU_wn.js.map} +1 -1
  157. package/dist/{index-CaAIPGZo.js → index-AqnpA7_O.js} +2 -2
  158. package/dist/{index-CaAIPGZo.js.map → index-AqnpA7_O.js.map} +1 -1
  159. package/dist/{index-CZbIGs8q.cjs → index-BJOeaYTk.cjs} +2 -2
  160. package/dist/{index-CZbIGs8q.cjs.map → index-BJOeaYTk.cjs.map} +1 -1
  161. package/dist/{index-Bc5VF70V.js → index-BMgDMxKJ.js} +6 -6
  162. package/dist/{index-Bc5VF70V.js.map → index-BMgDMxKJ.js.map} +1 -1
  163. package/dist/{index-B0rbzOoC.cjs → index-BS2TADPj.cjs} +2 -2
  164. package/dist/{index-B0rbzOoC.cjs.map → index-BS2TADPj.cjs.map} +1 -1
  165. package/dist/{index-27yTRcko.js → index-Bwrro8-q.js} +2 -2
  166. package/dist/{index-27yTRcko.js.map → index-Bwrro8-q.js.map} +1 -1
  167. package/dist/{index-BczVvEBZ.cjs → index-CQ3e6Ewi.cjs} +2 -2
  168. package/dist/{index-BczVvEBZ.cjs.map → index-CQ3e6Ewi.cjs.map} +1 -1
  169. package/dist/{index-C21TvELx.cjs → index-CSNtgibC.cjs} +2 -2
  170. package/dist/{index-C21TvELx.cjs.map → index-CSNtgibC.cjs.map} +1 -1
  171. package/dist/{index-D7ltPi18.js → index-CeVNqhMO.js} +2 -2
  172. package/dist/{index-D7ltPi18.js.map → index-CeVNqhMO.js.map} +1 -1
  173. package/dist/index-D05lK1Te.cjs +2 -0
  174. package/dist/index-D05lK1Te.cjs.map +1 -0
  175. package/dist/{index-Ds0uHjK9.cjs → index-D72cOtq7.cjs} +2 -2
  176. package/dist/{index-Ds0uHjK9.cjs.map → index-D72cOtq7.cjs.map} +1 -1
  177. package/dist/{index-BXns0-ng.cjs → index-DQA8q5sC.cjs} +2 -2
  178. package/dist/{index-BXns0-ng.cjs.map → index-DQA8q5sC.cjs.map} +1 -1
  179. package/dist/{index-BzeLQvXk.cjs → index-DYH8g9WA.cjs} +2 -2
  180. package/dist/{index-BzeLQvXk.cjs.map → index-DYH8g9WA.cjs.map} +1 -1
  181. package/dist/{index-BbNoLJ_w.cjs → index-Da2GUKrr.cjs} +2 -2
  182. package/dist/{index-BbNoLJ_w.cjs.map → index-Da2GUKrr.cjs.map} +1 -1
  183. package/dist/{index-BLizQDlg.js → index-DvVprvy6.js} +2 -2
  184. package/dist/{index-BLizQDlg.js.map → index-DvVprvy6.js.map} +1 -1
  185. package/dist/{index-UV9hjG_S.js → index-EArKRVKg.js} +2 -2
  186. package/dist/{index-UV9hjG_S.js.map → index-EArKRVKg.js.map} +1 -1
  187. package/dist/{index-C1rRk_50.js → index-V_JXij1_.js} +2 -2
  188. package/dist/{index-C1rRk_50.js.map → index-V_JXij1_.js.map} +1 -1
  189. package/dist/{index-DxagiOHo.js → index-fwdktvAS.js} +2 -2
  190. package/dist/{index-DxagiOHo.js.map → index-fwdktvAS.js.map} +1 -1
  191. package/dist/index-qfWCwobm.js +682 -0
  192. package/dist/index-qfWCwobm.js.map +1 -0
  193. package/dist/index.cjs +1 -1
  194. package/dist/index.d.ts +63 -7
  195. package/dist/index.js +6 -6
  196. package/dist/{string2HTML-CWHGfz_d.js → string2HTML-oFCROsus.js} +2 -2
  197. package/dist/{string2HTML-CWHGfz_d.js.map → string2HTML-oFCROsus.js.map} +1 -1
  198. package/dist/{string2HTML-D2Avudmb.cjs → string2HTML-z7CwHXcx.cjs} +2 -2
  199. package/dist/{string2HTML-D2Avudmb.cjs.map → string2HTML-z7CwHXcx.cjs.map} +1 -1
  200. package/dist/style.css +1 -1
  201. package/dist/transformData.cjs +1 -1
  202. package/dist/transformData.js +3 -3
  203. package/dist/{transformDataForAggregation-CdcwlnNe.js → transformDataForAggregation-1BYVFqvF.js} +4 -4
  204. package/dist/{transformDataForAggregation-CdcwlnNe.js.map → transformDataForAggregation-1BYVFqvF.js.map} +1 -1
  205. package/dist/{transformDataForAggregation-Du-Hei-W.cjs → transformDataForAggregation-BVxVu4yY.cjs} +2 -2
  206. package/dist/{transformDataForAggregation-Du-Hei-W.cjs.map → transformDataForAggregation-BVxVu4yY.cjs.map} +1 -1
  207. package/dist/{transformDataForGraphFromFile-BCjsizvb.js → transformDataForGraphFromFile-BC9Ha8hF.js} +3 -3
  208. package/dist/{transformDataForGraphFromFile-BCjsizvb.js.map → transformDataForGraphFromFile-BC9Ha8hF.js.map} +1 -1
  209. package/dist/{transformDataForGraphFromFile-B1A0AS-Z.cjs → transformDataForGraphFromFile-b41aNQYY.cjs} +2 -2
  210. package/dist/{transformDataForGraphFromFile-B1A0AS-Z.cjs.map → transformDataForGraphFromFile-b41aNQYY.cjs.map} +1 -1
  211. package/dist/utils.cjs +1 -1
  212. package/dist/utils.js +2 -2
  213. package/dist/zoom-Bsbhil-K.cjs +2 -0
  214. package/dist/zoom-Bsbhil-K.cjs.map +1 -0
  215. package/dist/zoom-DAu91HKr.js +1864 -0
  216. package/dist/zoom-DAu91HKr.js.map +1 -0
  217. package/package.json +3 -3
  218. package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -2
  219. package/dist/_commonjsHelpers-DKOUU3wS.cjs.map +0 -1
  220. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -9
  221. package/dist/_commonjsHelpers-DaMA6jEr.js.map +0 -1
  222. package/dist/zoom-Lo7IAUfC.cjs +0 -2
  223. package/dist/zoom-Lo7IAUfC.cjs.map +0 -1
  224. package/dist/zoom-_lqdiGoI.js +0 -1983
  225. package/dist/zoom-_lqdiGoI.js.map +0 -1
@@ -1,14 +1,14 @@
1
1
  import { j as h, m as rt } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { useRef as wt, useState as Z, useEffect as _t } from "react";
3
- import { u as ot } from "./index-CaAIPGZo.js";
4
- import { s as ct } from "./index-DxagiOHo.js";
5
- import { s as Nt } from "./index-D7ltPi18.js";
6
- import { i as Ht } from "./index-27yTRcko.js";
3
+ import { u as ot } from "./index-AqnpA7_O.js";
4
+ import { s as ct } from "./index-fwdktvAS.js";
5
+ import { s as Nt } from "./index-CeVNqhMO.js";
6
+ import { i as Ht } from "./index-Bwrro8-q.js";
7
7
  import { X as Wt } from "./Modal-DVVwpKhP.js";
8
8
  import { u as ft } from "./Typography-Ctgfl1J5.js";
9
9
  import { n as St } from "./numberFormattingFunction-14YCbkN2.js";
10
- import { T as Rt } from "./Tooltip-DyM5snqx.js";
11
- import { s as Gt } from "./string2HTML-CWHGfz_d.js";
10
+ import { T as Rt } from "./Tooltip-CVCGWyzw.js";
11
+ import { s as Gt } from "./string2HTML-oFCROsus.js";
12
12
  import { u as qt } from "./use-in-view-yS6jzJAp.js";
13
13
  import { m as mt } from "./proxy-CkpFesk1.js";
14
14
  import { A as Xt } from "./index-CNvov0eg.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),ke=require("./index-CZbIGs8q.cjs"),Me=require("./parse-hMnG_lRV.cjs"),j=require("react"),Ae=require("./getSliderMarks-CtsEXiLV.cjs"),Ie=require("./index-BXns0-ng.cjs"),Ue=require("./index-BczVvEBZ.cjs"),Le=require("./simple-statistics-xm8c0LQQ.cjs"),Fe=require("./Modal-tXZlLE5s.cjs"),He=require("./Tooltip-n8z5bfav.cjs"),c=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),N=require("./Colors.cjs"),Ve=require("./numberFormattingFunction-02t-wJta.cjs"),Ne=require("./customArea-CK768gCn.cjs"),Ge=require("./string2HTML-D2Avudmb.cjs"),$e=require("./Axis-DE7dSn1_.cjs"),Te=require("./AxisTitle-CK9YeovX.cjs"),We=require("./XTicksAndGridLines-CCzXIV8d.cjs"),De=require("./ReferenceLine-CFVBBN__.cjs"),Be=require("./RegressionLine-xKdiJ8sw.cjs"),_e=require("./YTicksAndGridLines-DBDuz6vb.cjs"),ze=require("./index-BYzIB5V6.cjs"),Je=require("./pow-B5-jkdHU.cjs"),Pe=require("./linear-BVckp9RD.cjs"),Ke=require("./delaunay-rcy0HhZi.cjs"),Qe=require("./use-in-view-sQJZ_xDO.cjs"),ie=require("./proxy-BHRoeZgd.cjs"),Xe=require("./index-BW8iNx7E.cjs"),Ze=require("./GraphFooter.cjs"),et=require("./GraphHeader.cjs"),tt=require("./ColorLegendWithMouseOver.cjs"),it=require("./EmptyState-d8_8SxeW.cjs"),Ye=require("./index-BW_-wD2k.cjs"),st=require("./ensureCompleteData-DqWQ2Zbi.cjs"),ot=require("./init-DU0ybBc_.cjs");function rt(ge){const{data:s,width:q,height:M,showLabels:se,colors:l,colorDomain:C,radius:R,xAxisTitle:m,yAxisTitle:J,leftMargin:G,rightMargin:ye,topMargin:pe,bottomMargin:oe,tooltip:re,onSeriesMouseOver:X,refXValues:I,refYValues:je,highlightAreaSettings:ve,selectedColor:W,highlightedDataPoints:L,maxRadiusValue:be,maxXValue:B,minXValue:w,maxYValue:Oe,minYValue:E,onSeriesMouseClick:V,rtl:K,annotations:Ce,customHighlightAreaSettings:Re,regressionLine:_,resetSelectionOnDoubleClick:Q,detailsOnClick:k,noOfXTicks:ne,noOfYTicks:le,labelColor:Z,xSuffix:ae,ySuffix:ce,xPrefix:xe,yPrefix:ue,styles:x,classNames:u,animate:n,dimmedOpacity:A,precision:S,customLayers:fe}=ge,me=j.useRef(null),p=Qe.useInView(me,{once:n.once,amount:n.amount}),[$,T]=j.useState(void 0),[D,Y]=j.useState(void 0),[de,P]=j.useState(void 0),[he,v]=j.useState(void 0),d={top:pe,bottom:m?oe+50:oe,left:J?G+30:G,right:ye},z=s.map((e,y)=>({...e,id:`${y}`})),g=q-d.left-d.right,b=M-d.top-d.bottom,O=s.filter(e=>e.radius===void 0||e.radius===null).length!==s.length?Je.sqrt().domain([0,be]).range([.25,R]).nice():void 0,h=z.filter(e=>!c.checkIfNullOrUndefined(e.radius)).length===0?z:Ue.orderBy(z.filter(e=>!c.checkIfNullOrUndefined(e.radius)),"radius","desc"),r=Pe.linear().domain([w,B]).range([0,g]).nice(),a=Pe.linear().domain([E,Oe]).range([b,0]).nice(),ee=r.ticks(ne),te=a.ticks(le),U=Ke.Delaunay.from(h.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)),e=>r(e.x),e=>a(e.y)).voronoi([0,0,g<0?0:g,b<0?0:b]),we=Le.linearRegression(s.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map(e=>[r(e.x),a(e.y)])),f=Le.linearRegressionLine(we);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(ie.motion.svg,{width:`${q}px`,height:`${M}px`,viewBox:`0 0 ${q} ${M}`,direction:"ltr",ref:me,children:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${d.left},${d.top})`,children:[i.jsxRuntimeExports.jsxs(Xe.AnimatePresence,{children:[i.jsxRuntimeExports.jsx(ze.HighlightAreaForScatterPlot,{areaSettings:ve,width:g,height:b,scaleX:r,scaleY:a,animate:n,isInView:p},"highlight-area"),i.jsxRuntimeExports.jsx(Ne.CustomArea,{areaSettings:Re,scaleX:r,scaleY:a,animate:n,isInView:p},"custom-area")]}),i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx(_e.YTicksAndGridLines,{values:te.filter(e=>e!==0),y:te.filter(e=>e!==0).map(e=>a(e)),x1:0,x2:g+d.right,styles:{gridLines:x?.yAxis?.gridLines,labels:x?.yAxis?.labels},classNames:{gridLines:u?.yAxis?.gridLines,labels:u?.yAxis?.labels},suffix:ce,prefix:ue,labelType:"secondary",showGridLines:!0,labelPos:"side",precision:S}),i.jsxRuntimeExports.jsx($e.Axis,{y1:a(E<0?0:E),y2:a(E<0?0:E),x1:0,x2:g+d.right,label:Ve.numberFormattingFunction(E<0?0:E,"NA",S,ue,ce),labelPos:{x:0,y:a(E<0?0:E),dy:"0.33em",dx:-4},classNames:{axis:u?.xAxis?.axis,label:u?.yAxis?.labels},styles:{axis:x?.xAxis?.axis,label:{textAnchor:"end",...x?.yAxis?.labels||{}}}}),i.jsxRuntimeExports.jsx(Te.AxisTitle,{x:0-G-15,y:b/2,style:x?.yAxis?.title,className:u?.yAxis?.title,text:J,rotate90:!0})]}),i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx(We.XTicksAndGridLines,{values:ee.filter(e=>e!==0),x:ee.filter(e=>e!==0).map(e=>r(e)),y1:0,y2:b,styles:{gridLines:x?.xAxis?.gridLines,labels:x?.xAxis?.labels},classNames:{gridLines:u?.xAxis?.gridLines,labels:u?.xAxis?.labels},suffix:ae,prefix:xe,labelType:"primary",showGridLines:!0,precision:S}),i.jsxRuntimeExports.jsx($e.Axis,{x1:r(w<0?0:w),x2:r(w<0?0:w),y1:0,y2:b,label:Ve.numberFormattingFunction(w<0?0:w,"NA",S,xe,ae),labelPos:{x:r(w<0?0:w),y:b,dy:"1em",dx:0},classNames:{axis:u?.xAxis?.axis,label:u?.yAxis?.labels},styles:{axis:x?.xAxis?.axis,label:{textAnchor:"middle",...x?.yAxis?.labels||{}}}}),i.jsxRuntimeExports.jsx(Te.AxisTitle,{x:g/2,y:b+30,style:x?.xAxis?.title,className:u?.xAxis?.title,text:m})]}),fe.filter(e=>e.position==="before").map(e=>e.layer),i.jsxRuntimeExports.jsxs(Xe.AnimatePresence,{children:[h.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map((e,y)=>i.jsxRuntimeExports.jsx("path",{d:U.renderCell(h.findIndex(o=>o.id===e.id)),opacity:0,onMouseEnter:o=>{T(e),v(o.clientY),P(o.clientX),X?.(e)},onMouseMove:o=>{T(e),v(o.clientY),P(o.clientX)},onMouseLeave:()=>{T(void 0),P(void 0),v(void 0),X?.(void 0)},onClick:()=>{(V||k)&&(Ie.isEqual(D,e)&&Q?(Y(void 0),V?.(void 0)):(Y(e),V?.(e)))}},`tesselation_${e.label||y}`)),h.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map((e,y)=>i.jsxRuntimeExports.jsxs(ie.motion.g,{variants:{initial:{x:r(e.x),y:a(e.y),opacity:W?e.color&&l[C.indexOf(`${e.color}`)]===W?1:A:$?$.id===e.id?1:A:L.length!==0?L.indexOf(e.label||"")!==-1?1:A:1},whileInView:{x:r(e.x),y:a(e.y),opacity:W?e.color&&l[C.indexOf(`${e.color}`)]===W?1:A:$?$.id===e.id?1:A:L.length!==0?L.indexOf(e.label||"")!==-1?1:A:1,transition:{duration:n.duration}}},initial:"initial",animate:p?"whileInView":"initial",exit:{opacity:0,transition:{duration:n.duration}},onMouseEnter:o=>{T(e),v(o.clientY),P(o.clientX),X?.(e)},onMouseMove:o=>{T(e),v(o.clientY),P(o.clientX)},onMouseLeave:()=>{T(void 0),P(void 0),v(void 0),X?.(void 0)},onClick:()=>{(V||k)&&(Ie.isEqual(D,e)&&Q?(Y(void 0),V?.(void 0)):(Y(e),V?.(e)))},children:[i.jsxRuntimeExports.jsx(ie.motion.circle,{cx:0,cy:0,exit:{r:0,transition:{duration:n.duration}},variants:{initial:{r:0,fill:s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray,stroke:s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray},whileInView:{r:O?O(e.radius||0):R,fill:s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray,stroke:s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray,transition:{duration:n.duration}}},initial:"initial",animate:p?"whileInView":"initial",style:{fillOpacity:.6}}),se&&!c.checkIfNullOrUndefined(e.label)?i.jsxRuntimeExports.jsx(ie.motion.text,{style:{...x?.graphObjectValues||{}},className:i.mo("graph-value text-sm",u?.graphObjectValues),y:0,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{x:O?O(e.radius||0):R,opacity:0,fill:Z||(s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray)},whileInView:{x:O?O(e.radius||0):R,opacity:1,fill:Z||(s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray),transition:{duration:n.duration}}},initial:"initial",animate:p?"whileInView":"initial",dy:"0.33em",dx:3,children:e.label}):L.length!==0&&!c.checkIfNullOrUndefined(e.label)&&L.indexOf(e.label)!==-1?i.jsxRuntimeExports.jsx(ie.motion.text,{style:{fill:Z||(s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray),...x?.graphObjectValues||{}},className:i.mo("graph-value text-sm",u?.graphObjectValues),y:0,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{x:O?O(e.radius||0):R,opacity:0},whileInView:{x:O?O(e.radius||0):R,opacity:1,transition:{duration:n.duration}}},initial:"initial",animate:p?"whileInView":"initial",dy:"0.33em",dx:3,children:e.label}):null]},`${e.label||y}`)),I.map((e,y)=>i.jsxRuntimeExports.jsx(De.RefLineX,{text:e.text,color:e.color,x:r(e.value),y1:0,y2:b,textSide:r(e.value)>g*.75||K?"left":"right",classNames:e.classNames,styles:e.styles,animate:n,isInView:p},y)),je.map((e,y)=>i.jsxRuntimeExports.jsx(De.RefLineY,{text:e.text,color:e.color,y:a(e.value),x1:0,x2:g,classNames:e.classNames,styles:e.styles,animate:n,isInView:p},y)),i.jsxRuntimeExports.jsx("g",{children:Ce.map((e,y)=>{const o=Ne.getLineEndPoint({x:e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?a(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?r(e.xCoordinate):0,y:e.yCoordinate?a(e.yCoordinate):0},c.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),Ee=e.showConnector?{y1:o.y,x1:o.x,y2:e.yCoordinate?a(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?a(e.yCoordinate):0,cx:e.xCoordinate?r(e.xCoordinate):0,circleRadius:c.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,F={y:e.yCoordinate?a(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:K?0:e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0),width:K?e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0):g+d.right-(e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return i.jsxRuntimeExports.jsx(Ne.Annotation,{color:e.color,connectorsSettings:Ee,labelSettings:F,text:e.text,classNames:e.classNames,styles:e.styles,animate:n,isInView:p},y)})}),_?i.jsxRuntimeExports.jsx(Be.RegressionLine,{x1:0,x2:g,y1:f(0),y2:f(g),graphHeight:b,graphWidth:g,className:u?.regLine,style:x?.regLine,color:typeof _=="string"?_:void 0,animate:n,isInView:p}):null]}),fe.filter(e=>e.position==="after").map(e=>e.layer)]})}),$&&re&&de&&he?i.jsxRuntimeExports.jsx(He.Tooltip,{data:$,body:re,xPos:de,yPos:he,backgroundStyle:x?.tooltip,className:u?.tooltip}):null,k&&D!==void 0?i.jsxRuntimeExports.jsx(Fe.X,{open:D!==void 0,onClose:()=>{Y(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof k=="string"?{__html:Ge.string2HTML(k,D)}:void 0,children:typeof k=="function"?k(D):null})}):null]})}function nt(ge){const{data:s,graphTitle:q,colors:M,sources:se,graphDescription:l,showLabels:C=!1,height:R,width:m,footNote:J,colorDomain:G,colorLegendTitle:ye,radius:pe=5,xAxisTitle:oe="X Axis",yAxisTitle:re="Y Axis",padding:X,backgroundColor:I=!1,leftMargin:je=0,rightMargin:ve=10,topMargin:W=20,bottomMargin:L=50,tooltip:be,relativeHeight:B,onSeriesMouseOver:w,refXValues:Oe=[],refYValues:E=[],highlightAreaSettings:V=[],showColorScale:K=!0,highlightedDataPoints:Ce=[],graphID:Re,maxRadiusValue:_,maxXValue:Q,minXValue:k,maxYValue:ne,minYValue:le,xSuffix:Z="",ySuffix:ae="",xPrefix:ce="",yPrefix:xe="",onSeriesMouseClick:ue,graphDownload:x=!1,dataDownload:u=!1,language:n="en",showNAColor:A=!0,minHeight:S=0,annotations:fe=[],customHighlightAreaSettings:me=[],theme:p="light",regressionLine:$=!1,ariaLabel:T,resetSelectionOnDoubleClick:D=!0,detailsOnClick:Y,noOfXTicks:de=5,noOfYTicks:P=5,labelColor:he,styles:v,classNames:d,animate:z=!1,dimmedOpacity:g=.3,precision:b=2,customLayers:O=[],timeline:h={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=ge,[r,a]=j.useState(0),[ee,te]=j.useState(0),[U,we]=j.useState(h.autoplay),f=Ae.sort(ke.uniqBy(s.filter(t=>t.date!==void 0&&t.date!==null),t=>t.date).map(t=>Me.parse(`${t.date}`,h.dateFormat||"yyyy",new Date).getTime()),(t,H)=>ot.ascending(t,H)),[e,y]=j.useState(h.autoplay?0:f.length-1),[o,Ee]=j.useState(void 0),F=j.useRef(null),Se=j.useRef(null);j.useEffect(()=>{const t=new ResizeObserver(H=>{a(m||H[0].target.clientWidth||620),te(R||H[0].target.clientHeight||480)});return F.current&&(te(F.current.clientHeight||480),a(F.current.clientWidth||620),m||t.observe(F.current)),()=>t.disconnect()},[m,R]),j.useEffect(()=>{const t=setInterval(()=>{y(H=>H<f.length-1?H+1:0)},(h.speed||2)*1e3);return U||clearInterval(t),()=>clearInterval(t)},[f,U,h.speed]);const qe=Ae.getSliderMarks(f,e,h.showOnlyActiveDate,h.dateFormat||"yyyy");return i.jsxRuntimeExports.jsx("div",{className:`${p||"light"} flex ${m?"w-fit grow-0":"w-full grow"}`,dir:n==="he"||n==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${I?I===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${n||"en"}`,m?"w-fit":"w-full",d?.graphContainer),style:{...v?.graphContainer||{},...I&&I!==!0?{backgroundColor:I}:{}},id:Re,ref:Se,"aria-label":T||`${q?`The graph shows ${q}. `:""}This is a scatter plot that shows correlation between two variables.${l?` ${l}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:I?X||"1rem":X||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[q||l||x||u?i.jsxRuntimeExports.jsx(et.GraphHeader,{styles:{title:v?.title,description:v?.description},classNames:{title:d?.title,description:d?.description},graphTitle:q,graphDescription:l,width:m,graphDownload:x?Se.current:void 0,dataDownload:u?s.map(t=>t.data).filter(t=>t!==void 0).length>0?s.map(t=>t.data).filter(t=>t!==void 0):s.filter(t=>t!==void 0):null}):null,h.enabled&&f.length>0&&qe?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{we(!U)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":U?"Click to pause animation":"Click to play animation",children:U?i.jsxRuntimeExports.jsx(Ye.Pause,{}):i.jsxRuntimeExports.jsx(Ye.Play,{})}),i.jsxRuntimeExports.jsx(Ae.xr,{min:f[0],max:f[f.length-1],marks:qe,step:null,defaultValue:f[f.length-1],value:f[e],onChangeComplete:t=>{y(f.indexOf(t))},onChange:t=>{y(f.indexOf(t))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,i.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:s.length===0?i.jsxRuntimeExports.jsx(it.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[K&&s.filter(t=>t.color).length!==0?i.jsxRuntimeExports.jsx(tt.ColorLegendWithMouseOver,{width:m,colorLegendTitle:ye,colors:M||N.Colors[p].categoricalColors.colors,colorDomain:G||ke.uniqBy(s.filter(t=>t.color),"color").map(t=>t.color),setSelectedColor:Ee,showNAColor:A}):null,i.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:F,"aria-label":"Graph area",children:(m||r)&&(R||ee)?i.jsxRuntimeExports.jsx(rt,{data:st.ensureCompleteDataForScatterPlot(s,h.dateFormat||"yyyy").filter(t=>h.enabled?t.date===Me.format(new Date(f[e]),h.dateFormat||"yyyy"):t),width:m||r,height:Math.max(S,R||(B?S?(m||r)*B>S?(m||r)*B:S:(m||r)*B:ee)),colorDomain:s.filter(t=>t.color).length===0?[]:G||ke.uniqBy(s.filter(t=>t.color),"color").map(t=>t.color),colors:s.filter(t=>t.color).length===0?M?[M]:[N.Colors.primaryColors["blue-600"]]:M||N.Colors[p].categoricalColors.colors,xAxisTitle:oe,yAxisTitle:re,refXValues:Oe,refYValues:E,showLabels:C,radius:pe,leftMargin:je,rightMargin:ve,topMargin:W,bottomMargin:L,tooltip:be,onSeriesMouseOver:w,highlightAreaSettings:V,highlightedDataPoints:s.filter(t=>t.label).length===0?[]:Ce,selectedColor:o,maxRadiusValue:c.checkIfNullOrUndefined(_)?Math.max(...s.map(t=>t.radius).filter(t=>t!=null)):_,maxXValue:c.checkIfNullOrUndefined(Q)?Math.max(...s.map(t=>t.x).filter(t=>t!=null))>0?Math.max(...s.map(t=>t.x).filter(t=>t!=null)):0:Q,minXValue:c.checkIfNullOrUndefined(k)?Math.min(...s.map(t=>t.x).filter(t=>t!=null))>0?0:Math.min(...s.map(t=>t.x).filter(t=>t!=null)):k,maxYValue:c.checkIfNullOrUndefined(ne)?Math.max(...s.map(t=>t.y).filter(t=>t!=null))>0?Math.max(...s.map(t=>t.y).filter(t=>t!=null)):0:ne,minYValue:c.checkIfNullOrUndefined(le)?Math.min(...s.map(t=>t.y).filter(t=>t!=null))>0?0:Math.min(...s.map(t=>t.y).filter(t=>t!=null)):le,onSeriesMouseClick:ue,rtl:n==="he"||n==="ar",annotations:fe,customHighlightAreaSettings:me,regressionLine:$,resetSelectionOnDoubleClick:D,detailsOnClick:Y,noOfXTicks:de,noOfYTicks:P,labelColor:he,xSuffix:Z,ySuffix:ae,xPrefix:ce,yPrefix:xe,styles:v,classNames:d,animate:z===!0?{duration:.5,once:!0,amount:.5}:z||{duration:0,once:!0,amount:0},dimmedOpacity:g,precision:b,customLayers:O}):null})]})}),se||J?i.jsxRuntimeExports.jsx(Ze.GraphFooter,{styles:{footnote:v?.footnote,source:v?.source},classNames:{footnote:d?.footnote,source:d?.source},sources:se,footNote:J,width:m}):null]})})})})}exports.ScatterPlot=nt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),ke=require("./index-BJOeaYTk.cjs"),Me=require("./parse-hMnG_lRV.cjs"),j=require("react"),Ae=require("./getSliderMarks-CtsEXiLV.cjs"),Ie=require("./index-DQA8q5sC.cjs"),Ue=require("./index-CQ3e6Ewi.cjs"),Le=require("./simple-statistics-xm8c0LQQ.cjs"),Fe=require("./Modal-tXZlLE5s.cjs"),He=require("./Tooltip-De16GWhY.cjs"),c=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),N=require("./Colors.cjs"),Ve=require("./numberFormattingFunction-02t-wJta.cjs"),Ne=require("./customArea-CK768gCn.cjs"),Ge=require("./string2HTML-z7CwHXcx.cjs"),$e=require("./Axis-DE7dSn1_.cjs"),Te=require("./AxisTitle-CK9YeovX.cjs"),We=require("./XTicksAndGridLines-CCzXIV8d.cjs"),De=require("./ReferenceLine-CFVBBN__.cjs"),Be=require("./RegressionLine-xKdiJ8sw.cjs"),_e=require("./YTicksAndGridLines-DBDuz6vb.cjs"),ze=require("./index-BYzIB5V6.cjs"),Je=require("./pow-B5-jkdHU.cjs"),Pe=require("./linear-BVckp9RD.cjs"),Ke=require("./delaunay-rcy0HhZi.cjs"),Qe=require("./use-in-view-sQJZ_xDO.cjs"),ie=require("./proxy-BHRoeZgd.cjs"),Xe=require("./index-BW8iNx7E.cjs"),Ze=require("./GraphFooter.cjs"),et=require("./GraphHeader.cjs"),tt=require("./ColorLegendWithMouseOver.cjs"),it=require("./EmptyState-d8_8SxeW.cjs"),Ye=require("./index-BW_-wD2k.cjs"),st=require("./ensureCompleteData-BU5Zlccy.cjs"),ot=require("./init-DU0ybBc_.cjs");function rt(ge){const{data:s,width:q,height:M,showLabels:se,colors:l,colorDomain:C,radius:R,xAxisTitle:m,yAxisTitle:J,leftMargin:G,rightMargin:ye,topMargin:pe,bottomMargin:oe,tooltip:re,onSeriesMouseOver:X,refXValues:I,refYValues:je,highlightAreaSettings:ve,selectedColor:W,highlightedDataPoints:L,maxRadiusValue:be,maxXValue:B,minXValue:w,maxYValue:Oe,minYValue:E,onSeriesMouseClick:V,rtl:K,annotations:Ce,customHighlightAreaSettings:Re,regressionLine:_,resetSelectionOnDoubleClick:Q,detailsOnClick:k,noOfXTicks:ne,noOfYTicks:le,labelColor:Z,xSuffix:ae,ySuffix:ce,xPrefix:xe,yPrefix:ue,styles:x,classNames:u,animate:n,dimmedOpacity:A,precision:S,customLayers:fe}=ge,me=j.useRef(null),p=Qe.useInView(me,{once:n.once,amount:n.amount}),[$,T]=j.useState(void 0),[D,Y]=j.useState(void 0),[de,P]=j.useState(void 0),[he,v]=j.useState(void 0),d={top:pe,bottom:m?oe+50:oe,left:J?G+30:G,right:ye},z=s.map((e,y)=>({...e,id:`${y}`})),g=q-d.left-d.right,b=M-d.top-d.bottom,O=s.filter(e=>e.radius===void 0||e.radius===null).length!==s.length?Je.sqrt().domain([0,be]).range([.25,R]).nice():void 0,h=z.filter(e=>!c.checkIfNullOrUndefined(e.radius)).length===0?z:Ue.orderBy(z.filter(e=>!c.checkIfNullOrUndefined(e.radius)),"radius","desc"),r=Pe.linear().domain([w,B]).range([0,g]).nice(),a=Pe.linear().domain([E,Oe]).range([b,0]).nice(),ee=r.ticks(ne),te=a.ticks(le),U=Ke.Delaunay.from(h.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)),e=>r(e.x),e=>a(e.y)).voronoi([0,0,g<0?0:g,b<0?0:b]),we=Le.linearRegression(s.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map(e=>[r(e.x),a(e.y)])),f=Le.linearRegressionLine(we);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(ie.motion.svg,{width:`${q}px`,height:`${M}px`,viewBox:`0 0 ${q} ${M}`,direction:"ltr",ref:me,children:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${d.left},${d.top})`,children:[i.jsxRuntimeExports.jsxs(Xe.AnimatePresence,{children:[i.jsxRuntimeExports.jsx(ze.HighlightAreaForScatterPlot,{areaSettings:ve,width:g,height:b,scaleX:r,scaleY:a,animate:n,isInView:p},"highlight-area"),i.jsxRuntimeExports.jsx(Ne.CustomArea,{areaSettings:Re,scaleX:r,scaleY:a,animate:n,isInView:p},"custom-area")]}),i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx(_e.YTicksAndGridLines,{values:te.filter(e=>e!==0),y:te.filter(e=>e!==0).map(e=>a(e)),x1:0,x2:g+d.right,styles:{gridLines:x?.yAxis?.gridLines,labels:x?.yAxis?.labels},classNames:{gridLines:u?.yAxis?.gridLines,labels:u?.yAxis?.labels},suffix:ce,prefix:ue,labelType:"secondary",showGridLines:!0,labelPos:"side",precision:S}),i.jsxRuntimeExports.jsx($e.Axis,{y1:a(E<0?0:E),y2:a(E<0?0:E),x1:0,x2:g+d.right,label:Ve.numberFormattingFunction(E<0?0:E,"NA",S,ue,ce),labelPos:{x:0,y:a(E<0?0:E),dy:"0.33em",dx:-4},classNames:{axis:u?.xAxis?.axis,label:u?.yAxis?.labels},styles:{axis:x?.xAxis?.axis,label:{textAnchor:"end",...x?.yAxis?.labels||{}}}}),i.jsxRuntimeExports.jsx(Te.AxisTitle,{x:0-G-15,y:b/2,style:x?.yAxis?.title,className:u?.yAxis?.title,text:J,rotate90:!0})]}),i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx(We.XTicksAndGridLines,{values:ee.filter(e=>e!==0),x:ee.filter(e=>e!==0).map(e=>r(e)),y1:0,y2:b,styles:{gridLines:x?.xAxis?.gridLines,labels:x?.xAxis?.labels},classNames:{gridLines:u?.xAxis?.gridLines,labels:u?.xAxis?.labels},suffix:ae,prefix:xe,labelType:"primary",showGridLines:!0,precision:S}),i.jsxRuntimeExports.jsx($e.Axis,{x1:r(w<0?0:w),x2:r(w<0?0:w),y1:0,y2:b,label:Ve.numberFormattingFunction(w<0?0:w,"NA",S,xe,ae),labelPos:{x:r(w<0?0:w),y:b,dy:"1em",dx:0},classNames:{axis:u?.xAxis?.axis,label:u?.yAxis?.labels},styles:{axis:x?.xAxis?.axis,label:{textAnchor:"middle",...x?.yAxis?.labels||{}}}}),i.jsxRuntimeExports.jsx(Te.AxisTitle,{x:g/2,y:b+30,style:x?.xAxis?.title,className:u?.xAxis?.title,text:m})]}),fe.filter(e=>e.position==="before").map(e=>e.layer),i.jsxRuntimeExports.jsxs(Xe.AnimatePresence,{children:[h.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map((e,y)=>i.jsxRuntimeExports.jsx("path",{d:U.renderCell(h.findIndex(o=>o.id===e.id)),opacity:0,onMouseEnter:o=>{T(e),v(o.clientY),P(o.clientX),X?.(e)},onMouseMove:o=>{T(e),v(o.clientY),P(o.clientX)},onMouseLeave:()=>{T(void 0),P(void 0),v(void 0),X?.(void 0)},onClick:()=>{(V||k)&&(Ie.isEqual(D,e)&&Q?(Y(void 0),V?.(void 0)):(Y(e),V?.(e)))}},`tesselation_${e.label||y}`)),h.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map((e,y)=>i.jsxRuntimeExports.jsxs(ie.motion.g,{variants:{initial:{x:r(e.x),y:a(e.y),opacity:W?e.color&&l[C.indexOf(`${e.color}`)]===W?1:A:$?$.id===e.id?1:A:L.length!==0?L.indexOf(e.label||"")!==-1?1:A:1},whileInView:{x:r(e.x),y:a(e.y),opacity:W?e.color&&l[C.indexOf(`${e.color}`)]===W?1:A:$?$.id===e.id?1:A:L.length!==0?L.indexOf(e.label||"")!==-1?1:A:1,transition:{duration:n.duration}}},initial:"initial",animate:p?"whileInView":"initial",exit:{opacity:0,transition:{duration:n.duration}},onMouseEnter:o=>{T(e),v(o.clientY),P(o.clientX),X?.(e)},onMouseMove:o=>{T(e),v(o.clientY),P(o.clientX)},onMouseLeave:()=>{T(void 0),P(void 0),v(void 0),X?.(void 0)},onClick:()=>{(V||k)&&(Ie.isEqual(D,e)&&Q?(Y(void 0),V?.(void 0)):(Y(e),V?.(e)))},children:[i.jsxRuntimeExports.jsx(ie.motion.circle,{cx:0,cy:0,exit:{r:0,transition:{duration:n.duration}},variants:{initial:{r:0,fill:s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray,stroke:s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray},whileInView:{r:O?O(e.radius||0):R,fill:s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray,stroke:s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray,transition:{duration:n.duration}}},initial:"initial",animate:p?"whileInView":"initial",style:{fillOpacity:.6}}),se&&!c.checkIfNullOrUndefined(e.label)?i.jsxRuntimeExports.jsx(ie.motion.text,{style:{...x?.graphObjectValues||{}},className:i.mo("graph-value text-sm",u?.graphObjectValues),y:0,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{x:O?O(e.radius||0):R,opacity:0,fill:Z||(s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray)},whileInView:{x:O?O(e.radius||0):R,opacity:1,fill:Z||(s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray),transition:{duration:n.duration}}},initial:"initial",animate:p?"whileInView":"initial",dy:"0.33em",dx:3,children:e.label}):L.length!==0&&!c.checkIfNullOrUndefined(e.label)&&L.indexOf(e.label)!==-1?i.jsxRuntimeExports.jsx(ie.motion.text,{style:{fill:Z||(s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray),...x?.graphObjectValues||{}},className:i.mo("graph-value text-sm",u?.graphObjectValues),y:0,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{x:O?O(e.radius||0):R,opacity:0},whileInView:{x:O?O(e.radius||0):R,opacity:1,transition:{duration:n.duration}}},initial:"initial",animate:p?"whileInView":"initial",dy:"0.33em",dx:3,children:e.label}):null]},`${e.label||y}`)),I.map((e,y)=>i.jsxRuntimeExports.jsx(De.RefLineX,{text:e.text,color:e.color,x:r(e.value),y1:0,y2:b,textSide:r(e.value)>g*.75||K?"left":"right",classNames:e.classNames,styles:e.styles,animate:n,isInView:p},y)),je.map((e,y)=>i.jsxRuntimeExports.jsx(De.RefLineY,{text:e.text,color:e.color,y:a(e.value),x1:0,x2:g,classNames:e.classNames,styles:e.styles,animate:n,isInView:p},y)),i.jsxRuntimeExports.jsx("g",{children:Ce.map((e,y)=>{const o=Ne.getLineEndPoint({x:e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?a(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?r(e.xCoordinate):0,y:e.yCoordinate?a(e.yCoordinate):0},c.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),Ee=e.showConnector?{y1:o.y,x1:o.x,y2:e.yCoordinate?a(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?a(e.yCoordinate):0,cx:e.xCoordinate?r(e.xCoordinate):0,circleRadius:c.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,F={y:e.yCoordinate?a(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:K?0:e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0),width:K?e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0):g+d.right-(e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return i.jsxRuntimeExports.jsx(Ne.Annotation,{color:e.color,connectorsSettings:Ee,labelSettings:F,text:e.text,classNames:e.classNames,styles:e.styles,animate:n,isInView:p},y)})}),_?i.jsxRuntimeExports.jsx(Be.RegressionLine,{x1:0,x2:g,y1:f(0),y2:f(g),graphHeight:b,graphWidth:g,className:u?.regLine,style:x?.regLine,color:typeof _=="string"?_:void 0,animate:n,isInView:p}):null]}),fe.filter(e=>e.position==="after").map(e=>e.layer)]})}),$&&re&&de&&he?i.jsxRuntimeExports.jsx(He.Tooltip,{data:$,body:re,xPos:de,yPos:he,backgroundStyle:x?.tooltip,className:u?.tooltip}):null,k&&D!==void 0?i.jsxRuntimeExports.jsx(Fe.X,{open:D!==void 0,onClose:()=>{Y(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof k=="string"?{__html:Ge.string2HTML(k,D)}:void 0,children:typeof k=="function"?k(D):null})}):null]})}function nt(ge){const{data:s,graphTitle:q,colors:M,sources:se,graphDescription:l,showLabels:C=!1,height:R,width:m,footNote:J,colorDomain:G,colorLegendTitle:ye,radius:pe=5,xAxisTitle:oe="X Axis",yAxisTitle:re="Y Axis",padding:X,backgroundColor:I=!1,leftMargin:je=0,rightMargin:ve=10,topMargin:W=20,bottomMargin:L=50,tooltip:be,relativeHeight:B,onSeriesMouseOver:w,refXValues:Oe=[],refYValues:E=[],highlightAreaSettings:V=[],showColorScale:K=!0,highlightedDataPoints:Ce=[],graphID:Re,maxRadiusValue:_,maxXValue:Q,minXValue:k,maxYValue:ne,minYValue:le,xSuffix:Z="",ySuffix:ae="",xPrefix:ce="",yPrefix:xe="",onSeriesMouseClick:ue,graphDownload:x=!1,dataDownload:u=!1,language:n="en",showNAColor:A=!0,minHeight:S=0,annotations:fe=[],customHighlightAreaSettings:me=[],theme:p="light",regressionLine:$=!1,ariaLabel:T,resetSelectionOnDoubleClick:D=!0,detailsOnClick:Y,noOfXTicks:de=5,noOfYTicks:P=5,labelColor:he,styles:v,classNames:d,animate:z=!1,dimmedOpacity:g=.3,precision:b=2,customLayers:O=[],timeline:h={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=ge,[r,a]=j.useState(0),[ee,te]=j.useState(0),[U,we]=j.useState(h.autoplay),f=Ae.sort(ke.uniqBy(s.filter(t=>t.date!==void 0&&t.date!==null),t=>t.date).map(t=>Me.parse(`${t.date}`,h.dateFormat||"yyyy",new Date).getTime()),(t,H)=>ot.ascending(t,H)),[e,y]=j.useState(h.autoplay?0:f.length-1),[o,Ee]=j.useState(void 0),F=j.useRef(null),Se=j.useRef(null);j.useEffect(()=>{const t=new ResizeObserver(H=>{a(m||H[0].target.clientWidth||620),te(R||H[0].target.clientHeight||480)});return F.current&&(te(F.current.clientHeight||480),a(F.current.clientWidth||620),m||t.observe(F.current)),()=>t.disconnect()},[m,R]),j.useEffect(()=>{const t=setInterval(()=>{y(H=>H<f.length-1?H+1:0)},(h.speed||2)*1e3);return U||clearInterval(t),()=>clearInterval(t)},[f,U,h.speed]);const qe=Ae.getSliderMarks(f,e,h.showOnlyActiveDate,h.dateFormat||"yyyy");return i.jsxRuntimeExports.jsx("div",{className:`${p||"light"} flex ${m?"w-fit grow-0":"w-full grow"}`,dir:n==="he"||n==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${I?I===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${n||"en"}`,m?"w-fit":"w-full",d?.graphContainer),style:{...v?.graphContainer||{},...I&&I!==!0?{backgroundColor:I}:{}},id:Re,ref:Se,"aria-label":T||`${q?`The graph shows ${q}. `:""}This is a scatter plot that shows correlation between two variables.${l?` ${l}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:I?X||"1rem":X||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[q||l||x||u?i.jsxRuntimeExports.jsx(et.GraphHeader,{styles:{title:v?.title,description:v?.description},classNames:{title:d?.title,description:d?.description},graphTitle:q,graphDescription:l,width:m,graphDownload:x?Se.current:void 0,dataDownload:u?s.map(t=>t.data).filter(t=>t!==void 0).length>0?s.map(t=>t.data).filter(t=>t!==void 0):s.filter(t=>t!==void 0):null}):null,h.enabled&&f.length>0&&qe?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{we(!U)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":U?"Click to pause animation":"Click to play animation",children:U?i.jsxRuntimeExports.jsx(Ye.Pause,{}):i.jsxRuntimeExports.jsx(Ye.Play,{})}),i.jsxRuntimeExports.jsx(Ae.xr,{min:f[0],max:f[f.length-1],marks:qe,step:null,defaultValue:f[f.length-1],value:f[e],onChangeComplete:t=>{y(f.indexOf(t))},onChange:t=>{y(f.indexOf(t))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,i.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:s.length===0?i.jsxRuntimeExports.jsx(it.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[K&&s.filter(t=>t.color).length!==0?i.jsxRuntimeExports.jsx(tt.ColorLegendWithMouseOver,{width:m,colorLegendTitle:ye,colors:M||N.Colors[p].categoricalColors.colors,colorDomain:G||ke.uniqBy(s.filter(t=>t.color),"color").map(t=>t.color),setSelectedColor:Ee,showNAColor:A}):null,i.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:F,"aria-label":"Graph area",children:(m||r)&&(R||ee)?i.jsxRuntimeExports.jsx(rt,{data:st.ensureCompleteDataForScatterPlot(s,h.dateFormat||"yyyy").filter(t=>h.enabled?t.date===Me.format(new Date(f[e]),h.dateFormat||"yyyy"):t),width:m||r,height:Math.max(S,R||(B?S?(m||r)*B>S?(m||r)*B:S:(m||r)*B:ee)),colorDomain:s.filter(t=>t.color).length===0?[]:G||ke.uniqBy(s.filter(t=>t.color),"color").map(t=>t.color),colors:s.filter(t=>t.color).length===0?M?[M]:[N.Colors.primaryColors["blue-600"]]:M||N.Colors[p].categoricalColors.colors,xAxisTitle:oe,yAxisTitle:re,refXValues:Oe,refYValues:E,showLabels:C,radius:pe,leftMargin:je,rightMargin:ve,topMargin:W,bottomMargin:L,tooltip:be,onSeriesMouseOver:w,highlightAreaSettings:V,highlightedDataPoints:s.filter(t=>t.label).length===0?[]:Ce,selectedColor:o,maxRadiusValue:c.checkIfNullOrUndefined(_)?Math.max(...s.map(t=>t.radius).filter(t=>t!=null)):_,maxXValue:c.checkIfNullOrUndefined(Q)?Math.max(...s.map(t=>t.x).filter(t=>t!=null))>0?Math.max(...s.map(t=>t.x).filter(t=>t!=null)):0:Q,minXValue:c.checkIfNullOrUndefined(k)?Math.min(...s.map(t=>t.x).filter(t=>t!=null))>0?0:Math.min(...s.map(t=>t.x).filter(t=>t!=null)):k,maxYValue:c.checkIfNullOrUndefined(ne)?Math.max(...s.map(t=>t.y).filter(t=>t!=null))>0?Math.max(...s.map(t=>t.y).filter(t=>t!=null)):0:ne,minYValue:c.checkIfNullOrUndefined(le)?Math.min(...s.map(t=>t.y).filter(t=>t!=null))>0?0:Math.min(...s.map(t=>t.y).filter(t=>t!=null)):le,onSeriesMouseClick:ue,rtl:n==="he"||n==="ar",annotations:fe,customHighlightAreaSettings:me,regressionLine:$,resetSelectionOnDoubleClick:D,detailsOnClick:Y,noOfXTicks:de,noOfYTicks:P,labelColor:he,xSuffix:Z,ySuffix:ae,xPrefix:ce,yPrefix:xe,styles:v,classNames:d,animate:z===!0?{duration:.5,once:!0,amount:.5}:z||{duration:0,once:!0,amount:0},dimmedOpacity:g,precision:b,customLayers:O}):null})]})}),se||J?i.jsxRuntimeExports.jsx(Ze.GraphFooter,{styles:{footnote:v?.footnote,source:v?.source},classNames:{footnote:d?.footnote,source:d?.source},sources:se,footNote:J,width:m}):null]})})})})}exports.ScatterPlot=nt;
2
2
  //# sourceMappingURL=ScatterPlot.cjs.map
@@ -1,18 +1,18 @@
1
1
  import { j as t, m as Ne } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
- import { u as ke } from "./index-CaAIPGZo.js";
2
+ import { u as ke } from "./index-AqnpA7_O.js";
3
3
  import { p as Re, f as He } from "./parse-DlCRUFh_.js";
4
4
  import { useRef as Se, useState as V, useEffect as De } from "react";
5
5
  import { s as We, g as Fe, x as Ee } from "./getSliderMarks-C0jptXeP.js";
6
- import { i as $e } from "./index-27yTRcko.js";
7
- import { o as Ge } from "./index-BLizQDlg.js";
6
+ import { i as $e } from "./index-Bwrro8-q.js";
7
+ import { o as Ge } from "./index-DvVprvy6.js";
8
8
  import { l as qe, a as Be } from "./simple-statistics-flVzqVtt.js";
9
9
  import { X as _e } from "./Modal-DVVwpKhP.js";
10
- import { T as ze } from "./Tooltip-DyM5snqx.js";
10
+ import { T as ze } from "./Tooltip-CVCGWyzw.js";
11
11
  import { c } from "./checkIfNullOrUndefined-DmfiKkNw.js";
12
12
  import { Colors as N } from "./Colors.js";
13
13
  import { n as Te } from "./numberFormattingFunction-14YCbkN2.js";
14
14
  import { C as Ue, g as Je, A as Ke } from "./customArea-B-dWU0zZ.js";
15
- import { s as Qe } from "./string2HTML-CWHGfz_d.js";
15
+ import { s as Qe } from "./string2HTML-oFCROsus.js";
16
16
  import { A as Pe } from "./Axis-Ddg-seDi.js";
17
17
  import { A as Xe } from "./AxisTitle-BmHLMRJZ.js";
18
18
  import { X as Ze } from "./XTicksAndGridLines-Bn9u5gOM.js";
@@ -31,7 +31,7 @@ import { GraphHeader as ci } from "./GraphHeader.js";
31
31
  import { ColorLegendWithMouseOver as xi } from "./ColorLegendWithMouseOver.js";
32
32
  import { E as mi } from "./EmptyState-DdTp-Mdn.js";
33
33
  import { P as fi, f as ui } from "./index-BmCqpO1B.js";
34
- import { e as gi } from "./ensureCompleteData-BBDZbDCE.js";
34
+ import { e as gi } from "./ensureCompleteData-BALdOrsS.js";
35
35
  import { c as hi } from "./init-BhZylTFx.js";
36
36
  function yi(ye) {
37
37
  const {
@@ -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-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;
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";
@@ -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