@undp/data-viz 1.5.1 → 1.5.3

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 (230) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.cjs.map +1 -1
  3. package/dist/AreaChart.js +3 -2
  4. package/dist/AreaChart.js.map +1 -1
  5. package/dist/BarGraph.cjs +1 -1
  6. package/dist/BarGraph.cjs.map +1 -1
  7. package/dist/BarGraph.js +1221 -1247
  8. package/dist/BarGraph.js.map +1 -1
  9. package/dist/BeeSwarmChart.cjs +1 -1
  10. package/dist/BeeSwarmChart.cjs.map +1 -1
  11. package/dist/BeeSwarmChart.js +130 -142
  12. package/dist/BeeSwarmChart.js.map +1 -1
  13. package/dist/BiVariateChoroplethMap.cjs +1 -1
  14. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  15. package/dist/BiVariateChoroplethMap.js +41 -41
  16. package/dist/BiVariateChoroplethMap.js.map +1 -1
  17. package/dist/BulletChart.cjs +1 -1
  18. package/dist/BulletChart.cjs.map +1 -1
  19. package/dist/BulletChart.js +483 -487
  20. package/dist/BulletChart.js.map +1 -1
  21. package/dist/ButterflyChart.cjs +1 -1
  22. package/dist/ButterflyChart.cjs.map +1 -1
  23. package/dist/ButterflyChart.js +99 -99
  24. package/dist/ButterflyChart.js.map +1 -1
  25. package/dist/ChoroplethMap.cjs +1 -1
  26. package/dist/ChoroplethMap.cjs.map +1 -1
  27. package/dist/ChoroplethMap.js +125 -125
  28. package/dist/ChoroplethMap.js.map +1 -1
  29. package/dist/CirclePackingGraph.cjs +1 -1
  30. package/dist/CirclePackingGraph.js +2 -2
  31. package/dist/Data/BureauPerformance.csv +8 -0
  32. package/dist/Data/EGDashboardData.csv +6 -0
  33. package/dist/DataCards.cjs +2 -2
  34. package/dist/DataCards.cjs.map +1 -1
  35. package/dist/DataCards.js +6 -6
  36. package/dist/DataCards.js.map +1 -1
  37. package/dist/DataTable.cjs +1 -1
  38. package/dist/DataTable.cjs.map +1 -1
  39. package/dist/DataTable.js +66 -68
  40. package/dist/DataTable.js.map +1 -1
  41. package/dist/DifferenceLineChart.cjs +1 -1
  42. package/dist/DifferenceLineChart.cjs.map +1 -1
  43. package/dist/DifferenceLineChart.js +3 -2
  44. package/dist/DifferenceLineChart.js.map +1 -1
  45. package/dist/DonutChart.cjs +1 -1
  46. package/dist/DonutChart.cjs.map +1 -1
  47. package/dist/DonutChart.js +205 -205
  48. package/dist/DonutChart.js.map +1 -1
  49. package/dist/DotDensityMap.cjs +1 -1
  50. package/dist/DotDensityMap.cjs.map +1 -1
  51. package/dist/DotDensityMap.js +78 -81
  52. package/dist/DotDensityMap.js.map +1 -1
  53. package/dist/DualAxisLineChart.cjs +1 -1
  54. package/dist/DualAxisLineChart.cjs.map +1 -1
  55. package/dist/DualAxisLineChart.js +3 -2
  56. package/dist/DualAxisLineChart.js.map +1 -1
  57. package/dist/DumbbellChart.cjs +1 -1
  58. package/dist/DumbbellChart.cjs.map +1 -1
  59. package/dist/DumbbellChart.js +64 -65
  60. package/dist/DumbbellChart.js.map +1 -1
  61. package/dist/GeoHubMap.cjs +1 -1
  62. package/dist/GeoHubMap.js +1 -1
  63. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  64. package/dist/GeoHubMapWithLayerSelection.js +1 -1
  65. package/dist/{GraphEl-4RUlclvW.cjs → GraphEl-BcYgMnN2.cjs} +2 -2
  66. package/dist/{GraphEl-4RUlclvW.cjs.map → GraphEl-BcYgMnN2.cjs.map} +1 -1
  67. package/dist/{GraphEl-ClIxlWa3.js → GraphEl-CMWeARJ3.js} +2 -2
  68. package/dist/{GraphEl-ClIxlWa3.js.map → GraphEl-CMWeARJ3.js.map} +1 -1
  69. package/dist/GriddedGraphs.cjs +1 -1
  70. package/dist/GriddedGraphs.js +4 -4
  71. package/dist/GriddedGraphsFromConfig.cjs +1 -1
  72. package/dist/GriddedGraphsFromConfig.js +1 -1
  73. package/dist/HeatMap.cjs +1 -1
  74. package/dist/HeatMap.cjs.map +1 -1
  75. package/dist/HeatMap.js +83 -83
  76. package/dist/HeatMap.js.map +1 -1
  77. package/dist/Histogram.cjs +1 -1
  78. package/dist/Histogram.js +1 -1
  79. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  80. package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
  81. package/dist/LineChartWithConfidenceInterval.js +7 -6
  82. package/dist/LineChartWithConfidenceInterval.js.map +1 -1
  83. package/dist/MultiGraphDashboard.cjs +1 -1
  84. package/dist/MultiGraphDashboard.js +2 -2
  85. package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
  86. package/dist/MultiGraphDashboardFromConfig.js +1 -1
  87. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  88. package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
  89. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
  90. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
  91. package/dist/MultiLineAltChart.cjs +1 -1
  92. package/dist/MultiLineAltChart.cjs.map +1 -1
  93. package/dist/MultiLineAltChart.js +82 -91
  94. package/dist/MultiLineAltChart.js.map +1 -1
  95. package/dist/MultiLineChart.cjs +1 -1
  96. package/dist/MultiLineChart.cjs.map +1 -1
  97. package/dist/MultiLineChart.js +3 -2
  98. package/dist/MultiLineChart.js.map +1 -1
  99. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  100. package/dist/PerformanceIntensiveMultiGraphDashboard.js +2 -2
  101. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
  102. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
  103. package/dist/RadarChart.cjs +1 -1
  104. package/dist/RadarChart.cjs.map +1 -1
  105. package/dist/RadarChart.js +124 -130
  106. package/dist/RadarChart.js.map +1 -1
  107. package/dist/SankeyChart.cjs +1 -1
  108. package/dist/SankeyChart.cjs.map +1 -1
  109. package/dist/SankeyChart.js +200 -200
  110. package/dist/SankeyChart.js.map +1 -1
  111. package/dist/ScatterPlot.cjs +1 -1
  112. package/dist/ScatterPlot.cjs.map +1 -1
  113. package/dist/ScatterPlot.js +149 -155
  114. package/dist/ScatterPlot.js.map +1 -1
  115. package/dist/SimpleLineChart.cjs +1 -1
  116. package/dist/SimpleLineChart.cjs.map +1 -1
  117. package/dist/SimpleLineChart.js +44 -43
  118. package/dist/SimpleLineChart.js.map +1 -1
  119. package/dist/SingleGraphDashboard.cjs +1 -1
  120. package/dist/SingleGraphDashboard.js +4 -4
  121. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  122. package/dist/SingleGraphDashboardFromConfig.js +1 -1
  123. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  124. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
  125. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  126. package/dist/SingleGraphDashboardThreeDGraphs.js +3 -3
  127. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  128. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
  129. package/dist/SlopeChart.cjs +1 -1
  130. package/dist/SlopeChart.cjs.map +1 -1
  131. package/dist/SlopeChart.js +107 -113
  132. package/dist/SlopeChart.js.map +1 -1
  133. package/dist/SparkLine.cjs +1 -1
  134. package/dist/SparkLine.cjs.map +1 -1
  135. package/dist/SparkLine.js +3 -2
  136. package/dist/SparkLine.js.map +1 -1
  137. package/dist/StripChart.cjs +1 -1
  138. package/dist/StripChart.cjs.map +1 -1
  139. package/dist/StripChart.js +159 -159
  140. package/dist/StripChart.js.map +1 -1
  141. package/dist/ThreeDGlobe.cjs +1 -1
  142. package/dist/ThreeDGlobe.cjs.map +1 -1
  143. package/dist/ThreeDGlobe.js +3 -3
  144. package/dist/ThreeDGlobe.js.map +1 -1
  145. package/dist/TreeMapGraph.cjs +1 -1
  146. package/dist/TreeMapGraph.cjs.map +1 -1
  147. package/dist/TreeMapGraph.js +194 -200
  148. package/dist/TreeMapGraph.js.map +1 -1
  149. package/dist/ensureCompleteData-DkQYPeDa.cjs +2 -0
  150. package/dist/ensureCompleteData-DkQYPeDa.cjs.map +1 -0
  151. package/dist/{ensureCompleteData-BALdOrsS.js → ensureCompleteData-DlmibgaI.js} +28 -8
  152. package/dist/ensureCompleteData-DlmibgaI.js.map +1 -0
  153. package/dist/fetchAndParseData-Ba-_CgxS.cjs +16 -0
  154. package/dist/fetchAndParseData-Ba-_CgxS.cjs.map +1 -0
  155. package/dist/fetchAndParseData-sapWbnYk.js +583 -0
  156. package/dist/fetchAndParseData-sapWbnYk.js.map +1 -0
  157. package/dist/fetchAndParseData.cjs +1 -1
  158. package/dist/fetchAndParseData.js +1 -1
  159. package/dist/getJenks-BbngDoBQ.js +19 -0
  160. package/dist/getJenks-BbngDoBQ.js.map +1 -0
  161. package/dist/getJenks-GYmdwBqm.cjs +2 -0
  162. package/dist/getJenks-GYmdwBqm.cjs.map +1 -0
  163. package/dist/getSliderMarks-9cNoRkDx.js +1023 -0
  164. package/dist/getSliderMarks-9cNoRkDx.js.map +1 -0
  165. package/dist/getSliderMarks-CRIbTGYV.cjs +6 -0
  166. package/dist/getSliderMarks-CRIbTGYV.cjs.map +1 -0
  167. package/dist/getUniqValue-DiCh_MOD.js +13 -0
  168. package/dist/getUniqValue-DiCh_MOD.js.map +1 -0
  169. package/dist/getUniqValue-RViz8tTw.cjs +2 -0
  170. package/dist/getUniqValue-RViz8tTw.cjs.map +1 -0
  171. package/dist/{index-BMgDMxKJ.js → index-37q0ULNQ.js} +44 -50
  172. package/dist/index-37q0ULNQ.js.map +1 -0
  173. package/dist/index-CVlCtJbC.cjs +2 -0
  174. package/dist/index-CVlCtJbC.cjs.map +1 -0
  175. package/dist/index.cjs +1 -1
  176. package/dist/index.d.ts +1 -1
  177. package/dist/index.js +6 -6
  178. package/dist/sort-DfK1b0F5.js +34 -0
  179. package/dist/sort-DfK1b0F5.js.map +1 -0
  180. package/dist/sort-O96oMZLb.cjs +2 -0
  181. package/dist/sort-O96oMZLb.cjs.map +1 -0
  182. package/dist/transformData.cjs +1 -1
  183. package/dist/transformData.js +3 -3
  184. package/dist/transformDataForAggregation-KXGm6flX.cjs +2 -0
  185. package/dist/{transformDataForAggregation-BVxVu4yY.cjs.map → transformDataForAggregation-KXGm6flX.cjs.map} +1 -1
  186. package/dist/{transformDataForAggregation-1BYVFqvF.js → transformDataForAggregation-sBpdlX8n.js} +40 -44
  187. package/dist/{transformDataForAggregation-1BYVFqvF.js.map → transformDataForAggregation-sBpdlX8n.js.map} +1 -1
  188. package/dist/{transformDataForGraphFromFile-BC9Ha8hF.js → transformDataForGraphFromFile-ComYvzuz.js} +3 -3
  189. package/dist/{transformDataForGraphFromFile-BC9Ha8hF.js.map → transformDataForGraphFromFile-ComYvzuz.js.map} +1 -1
  190. package/dist/{transformDataForGraphFromFile-b41aNQYY.cjs → transformDataForGraphFromFile-DVZodTHd.cjs} +2 -2
  191. package/dist/{transformDataForGraphFromFile-b41aNQYY.cjs.map → transformDataForGraphFromFile-DVZodTHd.cjs.map} +1 -1
  192. package/dist/uniqBy-BHy4I8PK.js +8 -0
  193. package/dist/uniqBy-BHy4I8PK.js.map +1 -0
  194. package/dist/uniqBy-O05lp2S5.cjs +2 -0
  195. package/dist/uniqBy-O05lp2S5.cjs.map +1 -0
  196. package/dist/utils.cjs +1 -1
  197. package/dist/utils.d.ts +1 -1
  198. package/dist/utils.js +2 -2
  199. package/package.json +1 -7
  200. package/dist/ensureCompleteData-BALdOrsS.js.map +0 -1
  201. package/dist/ensureCompleteData-BU5Zlccy.cjs +0 -2
  202. package/dist/ensureCompleteData-BU5Zlccy.cjs.map +0 -1
  203. package/dist/fetchAndParseData-DBOl1Icl.js +0 -1196
  204. package/dist/fetchAndParseData-DBOl1Icl.js.map +0 -1
  205. package/dist/fetchAndParseData-Dcy7AS_0.cjs +0 -16
  206. package/dist/fetchAndParseData-Dcy7AS_0.cjs.map +0 -1
  207. package/dist/getJenks-DW96UYNE.js +0 -23
  208. package/dist/getJenks-DW96UYNE.js.map +0 -1
  209. package/dist/getJenks-vofIZmeb.cjs +0 -2
  210. package/dist/getJenks-vofIZmeb.cjs.map +0 -1
  211. package/dist/getSliderMarks-C0jptXeP.js +0 -1054
  212. package/dist/getSliderMarks-C0jptXeP.js.map +0 -1
  213. package/dist/getSliderMarks-CtsEXiLV.cjs +0 -6
  214. package/dist/getSliderMarks-CtsEXiLV.cjs.map +0 -1
  215. package/dist/getUniqValue-CfuE_l9c.cjs +0 -2
  216. package/dist/getUniqValue-CfuE_l9c.cjs.map +0 -1
  217. package/dist/getUniqValue-CttuU_wn.js +0 -20
  218. package/dist/getUniqValue-CttuU_wn.js.map +0 -1
  219. package/dist/index-AqnpA7_O.js +0 -631
  220. package/dist/index-AqnpA7_O.js.map +0 -1
  221. package/dist/index-BJOeaYTk.cjs +0 -2
  222. package/dist/index-BJOeaYTk.cjs.map +0 -1
  223. package/dist/index-BMgDMxKJ.js.map +0 -1
  224. package/dist/index-DYH8g9WA.cjs +0 -2
  225. package/dist/index-DYH8g9WA.cjs.map +0 -1
  226. package/dist/index-Da2GUKrr.cjs +0 -2
  227. package/dist/index-Da2GUKrr.cjs.map +0 -1
  228. package/dist/index-fwdktvAS.js +0 -707
  229. package/dist/index-fwdktvAS.js.map +0 -1
  230. package/dist/transformDataForAggregation-BVxVu4yY.cjs +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"StripChart.js","sources":["../src/Utils/getTickPosition.ts","../src/Components/Graphs/StripChart/Horizontal/Graph.tsx","../src/Components/Graphs/StripChart/Horizontal/index.tsx","../src/Components/Graphs/StripChart/Vertical/Graph.tsx","../src/Components/Graphs/StripChart/Vertical/index.tsx","../src/Components/Graphs/StripChart/index.tsx"],"sourcesContent":["export function getTickPositions(count: number, width: number) {\r\n if (count < 2) return [];\r\n const step = width / (count - 1);\r\n return Array.from({ length: count }, (_, i) => i * step);\r\n}\r\n","import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport { scaleLinear } from 'd3-scale';\r\nimport sortBy from 'lodash.sortby';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { getTickPositions } from '@/Utils/getTickPosition';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n width: number;\r\n height: number;\r\n selectedColor?: string;\r\n colors: string[];\r\n colorDomain: string[];\r\n radius: number;\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n prefix: string;\r\n suffix: string;\r\n stripType: 'strip' | 'dot';\r\n highlightColor?: string;\r\n dotOpacity: number;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate: AnimateDataType;\r\n noOfTicks: number;\r\n dimmedOpacity: number;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n colors,\r\n colorDomain,\r\n radius,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n highlightedDataPoints,\r\n selectedColor,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n prefix,\r\n suffix,\r\n stripType,\r\n highlightColor,\r\n dotOpacity,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate,\r\n noOfTicks,\r\n dimmedOpacity,\r\n precision,\r\n customLayers,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin,\r\n right: rightMargin,\r\n };\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n const dataWithId = data.map((d, i) => ({ ...d, id: `${i}` }));\r\n\r\n const sortedData = sortBy(dataWithId, item => {\r\n const index = (highlightedDataPoints || []).indexOf(item.label);\r\n return index === -1 ? Infinity : index;\r\n }).reverse();\r\n const xMaxValue = !checkIfNullOrUndefined(maxValue)\r\n ? (maxValue as number)\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) < 0\r\n ? 0\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const xMinValue = !checkIfNullOrUndefined(minValue)\r\n ? (minValue as number)\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) >= 0\r\n ? 0\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const x = scaleLinear().domain([xMinValue, xMaxValue]).range([0, graphWidth]).nice();\r\n const ticks = getTickPositions(noOfTicks, graphWidth);\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {sortedData.map(d => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: x(0),\r\n y: graphHeight / 2,\r\n },\r\n whileInView: {\r\n x: x(d.position),\r\n y: graphHeight / 2,\r\n opacity: selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(d.color)] === selectedColor\r\n ? 0.95\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 0.95\r\n : dimmedOpacity\r\n : dotOpacity,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {stripType === 'dot' ? (\r\n <motion.circle\r\n cy={0}\r\n cx={0}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n r={radius}\r\n />\r\n ) : (\r\n <motion.rect\r\n y={0 - radius}\r\n x={-1}\r\n height={radius * 2}\r\n width={2}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n />\r\n )}\r\n {highlightedDataPoints.length !== 0 ? (\r\n highlightedDataPoints.indexOf(d.label) !== -1 ? (\r\n <motion.text\r\n x={0}\r\n y={0 - radius - 5}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fill:\r\n valueColor ||\r\n (highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]),\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value text-sm font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n >\r\n {numberFormattingFunction(d.position, 'NA', precision, prefix, suffix)}\r\n </motion.text>\r\n ) : null\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n {ticks.map((tick, i) => (\r\n <text\r\n key={i}\r\n x={tick}\r\n y={graphHeight / 2 + radius}\r\n style={{\r\n textAnchor: i === 0 ? 'start' : i === ticks.length - 1 ? 'end' : 'middle',\r\n ...(styles?.xAxis?.labels || {}),\r\n }}\r\n className={cn(\r\n 'fill-primary-gray-550 dark:fill-primary-gray-500 text-xs',\r\n classNames?.xAxis?.labels,\r\n )}\r\n dy='1em'\r\n >\r\n {numberFormattingFunction(x.invert(tick), 'NA', precision, prefix, suffix)}\r\n </text>\r\n ))}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import uniqBy from 'lodash.uniqby';\r\nimport { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n Languages,\r\n SourcesDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n graphTitle?: string | React.ReactNode;\r\n graphDescription?: string | React.ReactNode;\r\n footNote?: string | React.ReactNode;\r\n width?: number;\r\n height?: number;\r\n sources?: SourcesDataType[];\r\n stripType?: 'strip' | 'dot';\r\n colors?: string | string[];\r\n colorDomain?: string[];\r\n colorLegendTitle?: string;\r\n radius?: number;\r\n backgroundColor?: string | boolean;\r\n padding?: string;\r\n leftMargin?: number;\r\n rightMargin?: number;\r\n topMargin?: number;\r\n bottomMargin?: number;\r\n relativeHeight?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints?: (string | number)[];\r\n showColorScale?: boolean;\r\n graphID?: string;\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n graphDownload?: boolean;\r\n dataDownload?: boolean;\r\n prefix?: string;\r\n suffix?: string;\r\n language?: Languages;\r\n highlightColor?: string;\r\n dotOpacity?: number;\r\n showNAColor?: boolean;\r\n minHeight?: number;\r\n theme?: 'light' | 'dark';\r\n ariaLabel?: string;\r\n resetSelectionOnDoubleClick?: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate?: boolean | AnimateDataType;\r\n noOfTicks?: number;\r\n dimmedOpacity?: number;\r\n precision?: number;\r\n customLayers?: CustomLayerDataType[];\r\n}\r\n\r\nexport function HorizontalStripChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius = 5,\r\n padding,\r\n backgroundColor = false,\r\n leftMargin = 5,\r\n rightMargin = 5,\r\n topMargin = 10,\r\n bottomMargin = 10,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n highlightedDataPoints = [],\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n prefix = '',\r\n suffix = '',\r\n stripType = 'dot',\r\n language = 'en',\r\n highlightColor,\r\n dotOpacity = 0.3,\r\n showNAColor = true,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate = false,\r\n noOfTicks = 2,\r\n dimmedOpacity = 0.3,\r\n precision = 2,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a strip chart showing distribution of data along the horizontal axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale !== false && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={\r\n colorDomain ||\r\n (uniqBy(\r\n data.filter(el => el.color),\r\n 'color',\r\n ).map(d => d.color) as string[])\r\n }\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={\r\n showNAColor === undefined || showNAColor === null ? true : showNAColor\r\n }\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain ||\r\n (uniqBy(\r\n data.filter(el => el.color),\r\n 'color',\r\n ).map(d => d.color) as string[])\r\n }\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n selectedColor={selectedColor}\r\n radius={radius}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n valueColor={valueColor}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n noOfTicks={noOfTicks}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport { scaleLinear } from 'd3-scale';\r\nimport sortBy from 'lodash.sortby';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { getTickPositions } from '@/Utils/getTickPosition';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n width: number;\r\n height: number;\r\n selectedColor?: string;\r\n colors: string[];\r\n colorDomain: string[];\r\n radius: number;\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n prefix: string;\r\n suffix: string;\r\n stripType: 'strip' | 'dot';\r\n highlightColor?: string;\r\n dotOpacity: number;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate: AnimateDataType;\r\n noOfTicks: number;\r\n dimmedOpacity: number;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n colors,\r\n colorDomain,\r\n radius,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n highlightedDataPoints,\r\n selectedColor,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n noOfTicks,\r\n prefix,\r\n suffix,\r\n stripType,\r\n highlightColor,\r\n dotOpacity,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate,\r\n dimmedOpacity,\r\n precision,\r\n customLayers,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin,\r\n right: rightMargin,\r\n };\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n const dataWithId = data.map((d, i) => ({ ...d, id: `${i}` }));\r\n\r\n const sortedData = sortBy(dataWithId, item => {\r\n const index = (highlightedDataPoints || []).indexOf(item.label);\r\n return index === -1 ? Infinity : index;\r\n }).reverse();\r\n const yMaxValue = !checkIfNullOrUndefined(maxValue)\r\n ? (maxValue as number)\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) < 0\r\n ? 0\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const yMinValue = !checkIfNullOrUndefined(minValue)\r\n ? (minValue as number)\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) >= 0\r\n ? 0\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const y = scaleLinear().domain([yMinValue, yMaxValue]).range([graphHeight, 0]).nice();\r\n const ticks = getTickPositions(noOfTicks, graphHeight);\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {sortedData.map(d => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: graphWidth / 2,\r\n y: y(0),\r\n },\r\n whileInView: {\r\n x: graphWidth / 2,\r\n y: y(d.position),\r\n opacity: selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(d.color)] === selectedColor\r\n ? 0.95\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 0.95\r\n : dimmedOpacity\r\n : dotOpacity,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {stripType === 'dot' ? (\r\n <motion.circle\r\n cy={0}\r\n cx={0}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n r={radius}\r\n />\r\n ) : (\r\n <motion.rect\r\n x={0 - radius}\r\n y={-1}\r\n width={radius * 2}\r\n height={2}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n />\r\n )}\r\n {highlightedDataPoints.length !== 0 ? (\r\n highlightedDataPoints.indexOf(d.label) !== -1 ? (\r\n <motion.text\r\n y={0}\r\n dy='0.33em'\r\n x={0 + radius + 3}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fill:\r\n valueColor ||\r\n (highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]),\r\n textAnchor: 'start',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value text-sm font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n >\r\n {numberFormattingFunction(d.position, 'NA', precision, prefix, suffix)}\r\n </motion.text>\r\n ) : null\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n {ticks.map((tick, i) => (\r\n <text\r\n key={i}\r\n y={tick}\r\n x={graphWidth / 2 + radius + 5}\r\n style={{\r\n textAnchor: 'start',\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn(\r\n 'fill-primary-gray-550 dark:fill-primary-gray-500 text-xs',\r\n classNames?.yAxis?.labels,\r\n )}\r\n >\r\n {numberFormattingFunction(y.invert(tick), 'NA', precision, prefix, suffix)}\r\n </text>\r\n ))}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import uniqBy from 'lodash.uniqby';\r\nimport { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n Languages,\r\n SourcesDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n graphTitle?: string | React.ReactNode;\r\n graphDescription?: string | React.ReactNode;\r\n footNote?: string | React.ReactNode;\r\n width?: number;\r\n height?: number;\r\n sources?: SourcesDataType[];\r\n colors?: string | string[];\r\n colorDomain?: string[];\r\n colorLegendTitle?: string;\r\n radius?: number;\r\n backgroundColor?: string | boolean;\r\n padding?: string;\r\n leftMargin?: number;\r\n rightMargin?: number;\r\n topMargin?: number;\r\n bottomMargin?: number;\r\n relativeHeight?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints?: (string | number)[];\r\n showColorScale?: boolean;\r\n graphID?: string;\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n graphDownload?: boolean;\r\n dataDownload?: boolean;\r\n prefix?: string;\r\n suffix?: string;\r\n stripType?: 'strip' | 'dot';\r\n language?: Languages;\r\n highlightColor?: string;\r\n dotOpacity?: number;\r\n showNAColor?: boolean;\r\n minHeight?: number;\r\n theme?: 'light' | 'dark';\r\n ariaLabel?: string;\r\n resetSelectionOnDoubleClick?: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate?: boolean | AnimateDataType;\r\n noOfTicks?: number;\r\n dimmedOpacity?: number;\r\n precision?: number;\r\n customLayers?: CustomLayerDataType[];\r\n}\r\n\r\nexport function VerticalStripChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius = 5,\r\n padding,\r\n backgroundColor = false,\r\n leftMargin = 20,\r\n rightMargin = 20,\r\n topMargin = 10,\r\n bottomMargin = 10,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n highlightedDataPoints = [],\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n prefix = '',\r\n suffix = '',\r\n stripType = 'dot',\r\n language = 'en',\r\n highlightColor,\r\n dotOpacity = 0.3,\r\n showNAColor = true,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate = false,\r\n noOfTicks = 2,\r\n dimmedOpacity = 0.3,\r\n precision = 2,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a strip chart showing distribution of data along the vertical axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale !== false && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={\r\n colorDomain ||\r\n (uniqBy(\r\n data.filter(el => el.color),\r\n 'color',\r\n ).map(d => d.color) as string[])\r\n }\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={showNAColor}\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full leading-0'\r\n ref={graphDiv}\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain ||\r\n (uniqBy(\r\n data.filter(el => el.color),\r\n 'color',\r\n ).map(d => d.color) as string[])\r\n }\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n selectedColor={selectedColor}\r\n radius={radius}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n valueColor={valueColor}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n noOfTicks={noOfTicks}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import { HorizontalStripChart } from './Horizontal';\r\nimport { VerticalStripChart } from './Vertical';\r\n\r\nimport {\r\n SourcesDataType,\r\n Languages,\r\n StripChartDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: StripChartDataType[];\r\n\r\n /** Orientation of the graph */\r\n orientation?: 'vertical' | 'horizontal';\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for circles */\r\n colors?: string | string[];\r\n /** Color of the highlighted data points */\r\n highlightColor?: string;\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color of value labels */\r\n valueColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n /** Maximum value for the chart */\r\n maxValue?: number;\r\n /** Minimum value for the chart */\r\n minValue?: number;\r\n\r\n // Graph Parameters\r\n /** Number of ticks on the axis */\r\n noOfTicks?: number;\r\n /** Radius of the dots or width of the strips */\r\n radius?: number;\r\n /** Opacity of each dot or strip */\r\n dotOpacity?: number;\r\n /** Type of strip */\r\n stripType?: 'strip' | 'dot';\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */\r\n showNAColor?: boolean;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function StripChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius,\r\n padding,\r\n backgroundColor,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n highlightedDataPoints,\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n noOfTicks,\r\n graphDownload,\r\n dataDownload,\r\n prefix,\r\n suffix,\r\n stripType,\r\n language,\r\n highlightColor,\r\n dotOpacity,\r\n showNAColor,\r\n minHeight,\r\n theme,\r\n ariaLabel,\r\n valueColor,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n orientation = 'vertical',\r\n styles,\r\n classNames,\r\n animate,\r\n dimmedOpacity = 0.3,\r\n precision,\r\n customLayers,\r\n } = props;\r\n\r\n if (orientation === 'vertical')\r\n return (\r\n <VerticalStripChart\r\n data={data}\r\n graphTitle={graphTitle}\r\n colors={colors}\r\n sources={sources}\r\n graphDescription={graphDescription}\r\n height={height}\r\n width={width}\r\n footNote={footNote}\r\n colorDomain={colorDomain}\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n padding={padding}\r\n backgroundColor={backgroundColor}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n relativeHeight={relativeHeight}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={showColorScale}\r\n highlightedDataPoints={highlightedDataPoints}\r\n graphID={graphID}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n noOfTicks={noOfTicks}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n language={language}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n showNAColor={showNAColor}\r\n minHeight={minHeight}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n valueColor={valueColor}\r\n detailsOnClick={detailsOnClick}\r\n classNames={classNames}\r\n animate={animate}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n );\r\n return (\r\n <HorizontalStripChart\r\n data={data}\r\n graphTitle={graphTitle}\r\n colors={colors}\r\n sources={sources}\r\n graphDescription={graphDescription}\r\n height={height}\r\n width={width}\r\n footNote={footNote}\r\n colorDomain={colorDomain}\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n padding={padding}\r\n backgroundColor={backgroundColor}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n relativeHeight={relativeHeight}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={showColorScale}\r\n highlightedDataPoints={highlightedDataPoints}\r\n graphID={graphID}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n noOfTicks={noOfTicks}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n language={language}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n showNAColor={showNAColor}\r\n minHeight={minHeight}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n valueColor={valueColor}\r\n detailsOnClick={detailsOnClick}\r\n classNames={classNames}\r\n animate={animate}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n );\r\n}\r\n"],"names":["getTickPositions","count","width","step","_","i","Graph","props","data","height","colors","colorDomain","radius","leftMargin","rightMargin","topMargin","bottomMargin","tooltip","onSeriesMouseOver","highlightedDataPoints","selectedColor","minValue","maxValue","onSeriesMouseClick","prefix","suffix","stripType","highlightColor","dotOpacity","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","valueColor","animate","noOfTicks","dimmedOpacity","precision","customLayers","svgRef","useRef","isInView","useInView","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","margin","graphWidth","graphHeight","dataWithId","d","sortedData","sortBy","item","index","xMaxValue","checkIfNullOrUndefined","xMinValue","x","scaleLinear","ticks","jsxs","Fragment","jsx","motion","AnimatePresence","event","isEqual","el","Colors","cn","tick","numberFormattingFunction","Tooltip","Modal","string2HTML","HorizontalStripChart","graphTitle","sources","graphDescription","footNote","colorLegendTitle","padding","backgroundColor","relativeHeight","showColorScale","graphID","graphDownload","dataDownload","language","showNAColor","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","setSelectedColor","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","GraphHeader","EmptyState","ColorLegendWithMouseOver","uniqBy","GraphFooter","yMaxValue","yMinValue","y","VerticalStripChart","StripChart","orientation"],"mappings":";;;;;;;;;;;;;;;;;;;AAAO,SAASA,GAAiBC,GAAeC,GAAe;AAC7D,MAAID,IAAQ,EAAG,QAAO,CAAA;AACtB,QAAME,IAAOD,KAASD,IAAQ;AAC9B,SAAO,MAAM,KAAK,EAAE,QAAQA,KAAS,CAACG,GAAGC,MAAMA,IAAIF,CAAI;AACzD;ACyDO,SAASG,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAN;AAAA,IACA,QAAAO;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,QAAAC;AAAA,IAC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,UAAAvE;AAAA,MACA,UAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,WAAAY;AAAA,MACA,eAAA0D;AAAA,MACA,cAAAC;AAAA,MACA,QAAAtE;AAAA,MACA,QAAAC;AAAA,MACA,WAAAC;AAAA,MACA,UAAAqE;AAAA,MACA,gBAAApE;AAAA,MACA,YAAAC;AAAA,MACA,aAAAoE;AAAA,MACA,WAAAC;AAAA,MACA,OAAAC;AAAA,MACA,WAAAC;AAAA,MACA,6BAAAtE;AAAA,MACA,QAAAE;AAAA,MACA,YAAAE;AAAA,MACA,gBAAAH;AAAA,MACA,YAAAE;AAAA,MACA,SAAAE;AAAA,MACA,eAAAE;AAAA,MACA,WAAAC;AAAA,MACA,cAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"StripChart.js","sources":["../src/Utils/getTickPosition.ts","../src/Components/Graphs/StripChart/Horizontal/Graph.tsx","../src/Components/Graphs/StripChart/Horizontal/index.tsx","../src/Components/Graphs/StripChart/Vertical/Graph.tsx","../src/Components/Graphs/StripChart/Vertical/index.tsx","../src/Components/Graphs/StripChart/index.tsx"],"sourcesContent":["export function getTickPositions(count: number, width: number) {\r\n if (count < 2) return [];\r\n const step = width / (count - 1);\r\n return Array.from({ length: count }, (_, i) => i * step);\r\n}\r\n","import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport { scaleLinear } from 'd3-scale';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport orderBy from 'lodash.orderby';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { getTickPositions } from '@/Utils/getTickPosition';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n width: number;\r\n height: number;\r\n selectedColor?: string;\r\n colors: string[];\r\n colorDomain: string[];\r\n radius: number;\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n prefix: string;\r\n suffix: string;\r\n stripType: 'strip' | 'dot';\r\n highlightColor?: string;\r\n dotOpacity: number;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate: AnimateDataType;\r\n noOfTicks: number;\r\n dimmedOpacity: number;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n colors,\r\n colorDomain,\r\n radius,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n highlightedDataPoints,\r\n selectedColor,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n prefix,\r\n suffix,\r\n stripType,\r\n highlightColor,\r\n dotOpacity,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate,\r\n noOfTicks,\r\n dimmedOpacity,\r\n precision,\r\n customLayers,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin,\r\n right: rightMargin,\r\n };\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n const dataWithId = data.map((d, i) => ({ ...d, id: `${i}` }));\r\n\r\n const sortedData = orderBy(\r\n dataWithId,\r\n [\r\n item => {\r\n const index = (highlightedDataPoints || []).indexOf(item.label);\r\n return index === -1 ? Infinity : index;\r\n },\r\n ],\r\n ['desc'],\r\n );\r\n const xMaxValue = !checkIfNullOrUndefined(maxValue)\r\n ? (maxValue as number)\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) < 0\r\n ? 0\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const xMinValue = !checkIfNullOrUndefined(minValue)\r\n ? (minValue as number)\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) >= 0\r\n ? 0\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const x = scaleLinear().domain([xMinValue, xMaxValue]).range([0, graphWidth]).nice();\r\n const ticks = getTickPositions(noOfTicks, graphWidth);\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {sortedData.map(d => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: x(0),\r\n y: graphHeight / 2,\r\n },\r\n whileInView: {\r\n x: x(d.position),\r\n y: graphHeight / 2,\r\n opacity: selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(d.color)] === selectedColor\r\n ? 0.95\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 0.95\r\n : dimmedOpacity\r\n : dotOpacity,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {stripType === 'dot' ? (\r\n <motion.circle\r\n cy={0}\r\n cx={0}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n r={radius}\r\n />\r\n ) : (\r\n <motion.rect\r\n y={0 - radius}\r\n x={-1}\r\n height={radius * 2}\r\n width={2}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n />\r\n )}\r\n {highlightedDataPoints.length !== 0 ? (\r\n highlightedDataPoints.indexOf(d.label) !== -1 ? (\r\n <motion.text\r\n x={0}\r\n y={0 - radius - 5}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fill:\r\n valueColor ||\r\n (highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]),\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value text-sm font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n >\r\n {numberFormattingFunction(d.position, 'NA', precision, prefix, suffix)}\r\n </motion.text>\r\n ) : null\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n {ticks.map((tick, i) => (\r\n <text\r\n key={i}\r\n x={tick}\r\n y={graphHeight / 2 + radius}\r\n style={{\r\n textAnchor: i === 0 ? 'start' : i === ticks.length - 1 ? 'end' : 'middle',\r\n ...(styles?.xAxis?.labels || {}),\r\n }}\r\n className={cn(\r\n 'fill-primary-gray-550 dark:fill-primary-gray-500 text-xs',\r\n classNames?.xAxis?.labels,\r\n )}\r\n dy='1em'\r\n >\r\n {numberFormattingFunction(x.invert(tick), 'NA', precision, prefix, suffix)}\r\n </text>\r\n ))}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n Languages,\r\n SourcesDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n graphTitle?: string | React.ReactNode;\r\n graphDescription?: string | React.ReactNode;\r\n footNote?: string | React.ReactNode;\r\n width?: number;\r\n height?: number;\r\n sources?: SourcesDataType[];\r\n stripType?: 'strip' | 'dot';\r\n colors?: string | string[];\r\n colorDomain?: string[];\r\n colorLegendTitle?: string;\r\n radius?: number;\r\n backgroundColor?: string | boolean;\r\n padding?: string;\r\n leftMargin?: number;\r\n rightMargin?: number;\r\n topMargin?: number;\r\n bottomMargin?: number;\r\n relativeHeight?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints?: (string | number)[];\r\n showColorScale?: boolean;\r\n graphID?: string;\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n graphDownload?: boolean;\r\n dataDownload?: boolean;\r\n prefix?: string;\r\n suffix?: string;\r\n language?: Languages;\r\n highlightColor?: string;\r\n dotOpacity?: number;\r\n showNAColor?: boolean;\r\n minHeight?: number;\r\n theme?: 'light' | 'dark';\r\n ariaLabel?: string;\r\n resetSelectionOnDoubleClick?: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate?: boolean | AnimateDataType;\r\n noOfTicks?: number;\r\n dimmedOpacity?: number;\r\n precision?: number;\r\n customLayers?: CustomLayerDataType[];\r\n}\r\n\r\nexport function HorizontalStripChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius = 5,\r\n padding,\r\n backgroundColor = false,\r\n leftMargin = 5,\r\n rightMargin = 5,\r\n topMargin = 10,\r\n bottomMargin = 10,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n highlightedDataPoints = [],\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n prefix = '',\r\n suffix = '',\r\n stripType = 'dot',\r\n language = 'en',\r\n highlightColor,\r\n dotOpacity = 0.3,\r\n showNAColor = true,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate = false,\r\n noOfTicks = 2,\r\n dimmedOpacity = 0.3,\r\n precision = 2,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a strip chart showing distribution of data along the horizontal axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale !== false && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={colorDomain || (uniqBy(data, 'color', true) as string[])}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={\r\n showNAColor === undefined || showNAColor === null ? true : showNAColor\r\n }\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n selectedColor={selectedColor}\r\n radius={radius}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n valueColor={valueColor}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n noOfTicks={noOfTicks}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport { scaleLinear } from 'd3-scale';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport orderBy from 'lodash.orderby';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { getTickPositions } from '@/Utils/getTickPosition';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n width: number;\r\n height: number;\r\n selectedColor?: string;\r\n colors: string[];\r\n colorDomain: string[];\r\n radius: number;\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n prefix: string;\r\n suffix: string;\r\n stripType: 'strip' | 'dot';\r\n highlightColor?: string;\r\n dotOpacity: number;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate: AnimateDataType;\r\n noOfTicks: number;\r\n dimmedOpacity: number;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n colors,\r\n colorDomain,\r\n radius,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n highlightedDataPoints,\r\n selectedColor,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n noOfTicks,\r\n prefix,\r\n suffix,\r\n stripType,\r\n highlightColor,\r\n dotOpacity,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate,\r\n dimmedOpacity,\r\n precision,\r\n customLayers,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin,\r\n right: rightMargin,\r\n };\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n const dataWithId = data.map((d, i) => ({ ...d, id: `${i}` }));\r\n\r\n const sortedData = orderBy(\r\n dataWithId,\r\n [\r\n item => {\r\n const index = (highlightedDataPoints || []).indexOf(item.label);\r\n return index === -1 ? Infinity : index;\r\n },\r\n ],\r\n ['desc'],\r\n );\r\n const yMaxValue = !checkIfNullOrUndefined(maxValue)\r\n ? (maxValue as number)\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) < 0\r\n ? 0\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const yMinValue = !checkIfNullOrUndefined(minValue)\r\n ? (minValue as number)\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) >= 0\r\n ? 0\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const y = scaleLinear().domain([yMinValue, yMaxValue]).range([graphHeight, 0]).nice();\r\n const ticks = getTickPositions(noOfTicks, graphHeight);\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {sortedData.map(d => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: graphWidth / 2,\r\n y: y(0),\r\n },\r\n whileInView: {\r\n x: graphWidth / 2,\r\n y: y(d.position),\r\n opacity: selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(d.color)] === selectedColor\r\n ? 0.95\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 0.95\r\n : dimmedOpacity\r\n : dotOpacity,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {stripType === 'dot' ? (\r\n <motion.circle\r\n cy={0}\r\n cx={0}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n r={radius}\r\n />\r\n ) : (\r\n <motion.rect\r\n x={0 - radius}\r\n y={-1}\r\n width={radius * 2}\r\n height={2}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n />\r\n )}\r\n {highlightedDataPoints.length !== 0 ? (\r\n highlightedDataPoints.indexOf(d.label) !== -1 ? (\r\n <motion.text\r\n y={0}\r\n dy='0.33em'\r\n x={0 + radius + 3}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fill:\r\n valueColor ||\r\n (highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]),\r\n textAnchor: 'start',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value text-sm font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n >\r\n {numberFormattingFunction(d.position, 'NA', precision, prefix, suffix)}\r\n </motion.text>\r\n ) : null\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n {ticks.map((tick, i) => (\r\n <text\r\n key={i}\r\n y={tick}\r\n x={graphWidth / 2 + radius + 5}\r\n style={{\r\n textAnchor: 'start',\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn(\r\n 'fill-primary-gray-550 dark:fill-primary-gray-500 text-xs',\r\n classNames?.yAxis?.labels,\r\n )}\r\n >\r\n {numberFormattingFunction(y.invert(tick), 'NA', precision, prefix, suffix)}\r\n </text>\r\n ))}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n Languages,\r\n SourcesDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n graphTitle?: string | React.ReactNode;\r\n graphDescription?: string | React.ReactNode;\r\n footNote?: string | React.ReactNode;\r\n width?: number;\r\n height?: number;\r\n sources?: SourcesDataType[];\r\n colors?: string | string[];\r\n colorDomain?: string[];\r\n colorLegendTitle?: string;\r\n radius?: number;\r\n backgroundColor?: string | boolean;\r\n padding?: string;\r\n leftMargin?: number;\r\n rightMargin?: number;\r\n topMargin?: number;\r\n bottomMargin?: number;\r\n relativeHeight?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints?: (string | number)[];\r\n showColorScale?: boolean;\r\n graphID?: string;\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n graphDownload?: boolean;\r\n dataDownload?: boolean;\r\n prefix?: string;\r\n suffix?: string;\r\n stripType?: 'strip' | 'dot';\r\n language?: Languages;\r\n highlightColor?: string;\r\n dotOpacity?: number;\r\n showNAColor?: boolean;\r\n minHeight?: number;\r\n theme?: 'light' | 'dark';\r\n ariaLabel?: string;\r\n resetSelectionOnDoubleClick?: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate?: boolean | AnimateDataType;\r\n noOfTicks?: number;\r\n dimmedOpacity?: number;\r\n precision?: number;\r\n customLayers?: CustomLayerDataType[];\r\n}\r\n\r\nexport function VerticalStripChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius = 5,\r\n padding,\r\n backgroundColor = false,\r\n leftMargin = 20,\r\n rightMargin = 20,\r\n topMargin = 10,\r\n bottomMargin = 10,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n highlightedDataPoints = [],\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n prefix = '',\r\n suffix = '',\r\n stripType = 'dot',\r\n language = 'en',\r\n highlightColor,\r\n dotOpacity = 0.3,\r\n showNAColor = true,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate = false,\r\n noOfTicks = 2,\r\n dimmedOpacity = 0.3,\r\n precision = 2,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a strip chart showing distribution of data along the vertical axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale !== false && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={colorDomain || (uniqBy(data, 'color', true) as string[])}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={showNAColor}\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full leading-0'\r\n ref={graphDiv}\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n selectedColor={selectedColor}\r\n radius={radius}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n valueColor={valueColor}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n noOfTicks={noOfTicks}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import { HorizontalStripChart } from './Horizontal';\r\nimport { VerticalStripChart } from './Vertical';\r\n\r\nimport {\r\n SourcesDataType,\r\n Languages,\r\n StripChartDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: StripChartDataType[];\r\n\r\n /** Orientation of the graph */\r\n orientation?: 'vertical' | 'horizontal';\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for circles */\r\n colors?: string | string[];\r\n /** Color of the highlighted data points */\r\n highlightColor?: string;\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color of value labels */\r\n valueColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n /** Maximum value for the chart */\r\n maxValue?: number;\r\n /** Minimum value for the chart */\r\n minValue?: number;\r\n\r\n // Graph Parameters\r\n /** Number of ticks on the axis */\r\n noOfTicks?: number;\r\n /** Radius of the dots or width of the strips */\r\n radius?: number;\r\n /** Opacity of each dot or strip */\r\n dotOpacity?: number;\r\n /** Type of strip */\r\n stripType?: 'strip' | 'dot';\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */\r\n showNAColor?: boolean;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function StripChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius,\r\n padding,\r\n backgroundColor,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n highlightedDataPoints,\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n noOfTicks,\r\n graphDownload,\r\n dataDownload,\r\n prefix,\r\n suffix,\r\n stripType,\r\n language,\r\n highlightColor,\r\n dotOpacity,\r\n showNAColor,\r\n minHeight,\r\n theme,\r\n ariaLabel,\r\n valueColor,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n orientation = 'vertical',\r\n styles,\r\n classNames,\r\n animate,\r\n dimmedOpacity = 0.3,\r\n precision,\r\n customLayers,\r\n } = props;\r\n\r\n if (orientation === 'vertical')\r\n return (\r\n <VerticalStripChart\r\n data={data}\r\n graphTitle={graphTitle}\r\n colors={colors}\r\n sources={sources}\r\n graphDescription={graphDescription}\r\n height={height}\r\n width={width}\r\n footNote={footNote}\r\n colorDomain={colorDomain}\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n padding={padding}\r\n backgroundColor={backgroundColor}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n relativeHeight={relativeHeight}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={showColorScale}\r\n highlightedDataPoints={highlightedDataPoints}\r\n graphID={graphID}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n noOfTicks={noOfTicks}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n language={language}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n showNAColor={showNAColor}\r\n minHeight={minHeight}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n valueColor={valueColor}\r\n detailsOnClick={detailsOnClick}\r\n classNames={classNames}\r\n animate={animate}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n );\r\n return (\r\n <HorizontalStripChart\r\n data={data}\r\n graphTitle={graphTitle}\r\n colors={colors}\r\n sources={sources}\r\n graphDescription={graphDescription}\r\n height={height}\r\n width={width}\r\n footNote={footNote}\r\n colorDomain={colorDomain}\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n padding={padding}\r\n backgroundColor={backgroundColor}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n relativeHeight={relativeHeight}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={showColorScale}\r\n highlightedDataPoints={highlightedDataPoints}\r\n graphID={graphID}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n noOfTicks={noOfTicks}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n language={language}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n showNAColor={showNAColor}\r\n minHeight={minHeight}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n valueColor={valueColor}\r\n detailsOnClick={detailsOnClick}\r\n classNames={classNames}\r\n animate={animate}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n );\r\n}\r\n"],"names":["getTickPositions","count","width","step","_","i","Graph","props","data","height","colors","colorDomain","radius","leftMargin","rightMargin","topMargin","bottomMargin","tooltip","onSeriesMouseOver","highlightedDataPoints","selectedColor","minValue","maxValue","onSeriesMouseClick","prefix","suffix","stripType","highlightColor","dotOpacity","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","valueColor","animate","noOfTicks","dimmedOpacity","precision","customLayers","svgRef","useRef","isInView","useInView","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","margin","graphWidth","graphHeight","dataWithId","d","sortedData","orderBy","item","index","xMaxValue","checkIfNullOrUndefined","xMinValue","x","scaleLinear","ticks","jsxs","Fragment","jsx","motion","AnimatePresence","event","isEqual","el","Colors","cn","tick","numberFormattingFunction","Tooltip","Modal","string2HTML","HorizontalStripChart","graphTitle","sources","graphDescription","footNote","colorLegendTitle","padding","backgroundColor","relativeHeight","showColorScale","graphID","graphDownload","dataDownload","language","showNAColor","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","setSelectedColor","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","GraphHeader","EmptyState","ColorLegendWithMouseOver","uniqBy","GraphFooter","yMaxValue","yMinValue","y","VerticalStripChart","StripChart","orientation"],"mappings":";;;;;;;;;;;;;;;;;;;AAAO,SAASA,GAAiBC,GAAeC,GAAe;AAC7D,MAAID,IAAQ,EAAG,QAAO,CAAA;AACtB,QAAME,IAAOD,KAASD,IAAQ;AAC9B,SAAO,MAAM,KAAK,EAAE,QAAQA,KAAS,CAACG,GAAGC,MAAMA,IAAIF,CAAI;AACzD;ACyDO,SAASG,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAN;AAAA,IACA,QAAAO;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,IACE/B,GACEgC,IAASC,GAAO,IAAI,GACpBC,IAAWC,GAAUH,GAAQ;AAAA,IACjC,MAAML,EAAQ;AAAA,IACd,QAAQA,EAAQ;AAAA,EAAA,CACjB,GAEK,CAACS,GAAeC,CAAgB,IAAIC,EAAc,MAAS,GAE3D,CAACC,GAAgBC,CAAiB,IAAIF,EAAc,MAAS,GAC7D,CAACG,GAAQC,CAAS,IAAIJ,EAA6B,MAAS,GA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AA,MACA,YAAA2E;AAAA,MACA,QAAAzE;AAAA,MACA,SAAA0E;AAAA,MACA,kBAAAC;AAAA,MACA,QAAA5E;AAAA,MACA,OAAAP;AAAA,MACA,UAAAoF;AAAA,MACA,aAAA3E;AAAA,MACA,kBAAA4E;AAAA,MACA,QAAA3E;AAAA,MACA,SAAA4E;AAAA,MACA,iBAAAC;AAAA,MACA,YAAA5E;AAAA,MACA,aAAAC;AAAA,MACA,WAAAC;AAAA,MACA,cAAAC;AAAA,MACA,SAAAC;AAAA,MACA,gBAAAyE;AAAA,MACA,mBAAAxE;AAAA,MACA,gBAAAyE;AAAA,MACA,uBAAAxE;AAAA,MACA,SAAAyE;AAAA,MACA,UAAAvE;AAAA,MACA,UAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,WAAAY;AAAA,MACA,eAAA0D;AAAA,MACA,cAAAC;AAAA,MACA,QAAAtE;AAAA,MACA,QAAAC;AAAA,MACA,WAAAC;AAAA,MACA,UAAAqE;AAAA,MACA,gBAAApE;AAAA,MACA,YAAAC;AAAA,MACA,aAAAoE;AAAA,MACA,WAAAC;AAAA,MACA,OAAAC;AAAA,MACA,WAAAC;AAAA,MACA,6BAAAtE;AAAA,MACA,QAAAE;AAAA,MACA,YAAAE;AAAA,MACA,gBAAAH;AAAA,MACA,YAAAE;AAAA,MACA,SAAAE;AAAA,MACA,eAAAE;AAAA,MACA,WAAAC;AAAA,MACA,cAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),me=require("./Spinner-DA6Z5E4n.cjs"),ge=require("react-globe.gl"),xe=require("./index-DQA8q5sC.cjs"),ye=require("three"),fe=require("./Modal-tXZlLE5s.cjs"),pe=require("./Typography-k-kOjICQ.cjs"),be=require("./index-D05lK1Te.cjs"),ve=require("./Tooltip-De16GWhY.cjs"),je=require("./numberFormattingFunction-02t-wJta.cjs"),we=require("./index-BW_-wD2k.cjs"),Ce=require("./string2HTML-z7CwHXcx.cjs"),Ee=require("./ordinal-BOeNbyae.cjs"),Re=require("./threshold-DNsSUf8Q.cjs"),Se=require("./GraphHeader.cjs"),ke=require("./GraphFooter.cjs"),De=require("./fetchAndParseData-Dcy7AS_0.cjs"),T=require("./Colors.cjs"),Ne=require("./getUniqValue-CfuE_l9c.cjs"),Me=require("./getJenks-vofIZmeb.cjs");function qe(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const u in e)if(u!=="default"){const m=Object.getOwnPropertyDescriptor(e,u);Object.defineProperty(o,u,m.get?m:{enumerable:!0,get:()=>e[u]})}}return o.default=e,Object.freeze(o)}const M=qe(ye);function Oe(e){let o;switch(e.type){case"ambient":o=new M.AmbientLight(e.color,e.intensity);break;case"directional":o=new M.DirectionalLight(e.color,e.intensity),e.position&&(e.position==="camera"?o.position.set(0,0,0):o.position.set(e.position.x,e.position.y,e.position.z)),(e.target||e.position==="camera")&&o.target.position.set(e.target?.x||0,e.target?.y||0,e.target?.z===void 0?-1:e.target.z),e.castShadow&&(o.castShadow=!0,e.shadow&&(o.shadow.mapSize.width=e.shadow.mapSize.width,o.shadow.mapSize.height=e.shadow.mapSize.height,o.shadow.camera.near=e.shadow.camera.near,o.shadow.camera.far=e.shadow.camera.far));break;case"point":o=new M.PointLight(e.color,e.intensity,e.distance||0,e.decay||2),e.position&&(e.position==="camera"?o.position.set(0,0,0):o.position.set(e.position.x,e.position.y,e.position.z));break;case"spot":o=new M.SpotLight(e.color,e.intensity,e.distance||0,e.angle||Math.PI/3,e.penumbra||0,e.decay||2),e.position&&(e.position==="camera"?o.position.set(0,0,0):o.position.set(e.position.x,e.position.y,e.position.z)),(e.target||e.position==="camera")&&o.target.position.set(e.target?.x||0,e.target?.y||0,e.target?.z||0),e.castShadow&&(o.castShadow=!0,e.shadow&&(o.shadow.mapSize.width=e.shadow.mapSize.width,o.shadow.mapSize.height=e.shadow.mapSize.height,o.shadow.camera.near=e.shadow.camera.near,o.shadow.camera.far=e.shadow.camera.far));break;default:throw new Error("Unknown light type")}return o}function Le(e){const{width:o,autoRotate:u,data:m,enableZoom:z,categorical:q,colorDomain:g,colors:l,globeMaterial:c,height:B,polygonData:te,mapProperty:h,mapBorderColor:H,atmosphereColor:I,tooltip:U,styles:E,classNames:re,mapNoDataColor:x,colorLegendTitle:A,showColorScale:oe,hoverStrokeColor:se,detailsOnClick:w,onSeriesMouseClick:k,onSeriesMouseOver:v,resetSelectionOnDoubleClick:O,highlightedIds:V,scale:y,globeOffset:R,polygonAltitude:G,centerLng:$,centerLat:F,atmosphereAltitude:W,globeCurvatureResolution:ae,fogSettings:D,lights:N,highlightedAltitude:J}=e,[X,ie]=n.useState(!1),i=n.useRef(void 0),[j,L]=n.useState(void 0),[P,Z]=n.useState(void 0),[ne,Y]=n.useState(!(o<680)),[K,le]=n.useState({x:0,y:0}),[C,_]=n.useState(void 0),f=q?Ee.ordinal().domain(g).range(l):Re.threshold().domain(g).range(l);n.useEffect(()=>{i.current&&(i.current.controls().enableZoom=z)},[z]),n.useEffect(()=>{i.current&&(C||j?i.current.controls().autoRotate=!1:(i.current.controls().autoRotate=u!==0,i.current.controls().autoRotateSpeed=u))},[C,j,u]),n.useEffect(()=>{i.current&&P&&i.current.pointOfView({lat:P[1],lng:P[0],altitude:y},1e3)},[P,y]),n.useEffect(()=>{const t=i.current?.renderer().domElement;if(!t)return;const a=r=>{le({x:r.clientX,y:r.clientY})};return t.addEventListener("mousemove",a),()=>t.removeEventListener("mousemove",a)},[]),n.useEffect(()=>{i.current&&i.current.pointOfView({lat:F,lng:$,altitude:y},1e3)},[y,$,F]);const Q=c||new M.MeshBasicMaterial({color:"#FFF"}),S=n.useCallback(()=>{if(!i.current)return;const t=i.current.scene(),a=i.current.camera();let r=[];t.traverse(d=>{d instanceof M.Light&&r.push(d)}),r=[...r,...a.children],r.forEach(d=>d.parent?.remove(d)),N.map(d=>Oe(d)).forEach((d,b)=>{N[b].type!=="ambient"&&N[b].position==="camera"?(a.add(d),N[b].type!=="point"&&a.add(d.target)):t.add(d)}),D&&(t.fog=new M.Fog(D.color,D.near,D.far))},[N,D]),ee=n.useCallback(()=>{ie(!0),S()},[S]);return n.useEffect(()=>{X&&S()},[X,S]),s.jsxRuntimeExports.jsxs("div",{className:"relative",children:[s.jsxRuntimeExports.jsx(ge,{ref:i,height:B,width:o,globeOffset:R,lineHoverPrecision:0,polygonsData:te,polygonAltitude:t=>V.includes(t?.properties?.[h])||t?.properties?.[h]===C?.id||t?.properties?.[h]===j?.id?J:G,polygonCapColor:t=>{const a=t?.properties?.[h],r=m.find(p=>p.id===a)?.x;return r!=null?f(r):x},polygonSideColor:t=>{const a=t?.properties?.[h],r=m.find(d=>d.id===a)?.x,p=r!=null?f(r):x;return V.includes(t?.properties?.[h])?p:"rgba(100,100,100,0)"},polygonStrokeColor:t=>t?.properties?.[h]===C?.id?se:H,onGlobeClick:()=>{L(void 0)},onPolygonClick:t=>{const a=t?.properties?.[h]?m.find(r=>r.id===t?.properties?.[h]):void 0;if(k||w)if(xe.isEqual(j,a)&&O&&a)L(void 0),k?.(void 0),Z(void 0);else{L(a),k?.(a);const[r,p]=be.turf_center_of_mass_default(t).geometry.coordinates;Z([r,p])}},onPolygonHover:t=>{const a=t?.properties?.[h]?m.find(r=>r.id===t?.properties?.[h]):void 0;_(a),v?.(a)},atmosphereColor:I,atmosphereAltitude:W,globeCurvatureResolution:ae,globeMaterial:Q,backgroundColor:"rgba(0, 0, 0, 0)",polygonsTransitionDuration:100,onGlobeReady:()=>{if(i.current){i.current.pointOfView({lat:F,lng:$});const t=i.current.scene();setTimeout(()=>{(t.children[3]?.children[0]?.children[4]?.children||[]).forEach(p=>{const d=p.children[1];d.renderOrder=2})},300);const a=i.current.camera();t.add(a),ee()}}}),oe===!1?null:s.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:ne?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{Y(!1)},children:s.jsxRuntimeExports.jsx(we.X,{})}),s.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)",width:q?void 0:"340px"},children:[A&&A!==""?s.jsxRuntimeExports.jsx(pe.u,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:A}):null,q?s.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:g.map((t,a)=>s.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:l[a%l.length]}}),s.jsxRuntimeExports.jsx(pe.u,{size:"sm",marginBottom:"none",leading:"none",children:t})]},a))}):s.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:s.jsxRuntimeExports.jsxs("g",{children:[g.map((t,a)=>s.jsxRuntimeExports.jsxs("g",{className:"cursor-pointer",children:[s.jsxRuntimeExports.jsx("rect",{x:a*320/l.length+1,y:1,width:320/l.length-2,height:8,style:{fill:l[a],stroke:l[a]}}),s.jsxRuntimeExports.jsx("text",{x:(a+1)*320/l.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:je.numberFormattingFunction(t,"NA")})]},a)),s.jsxRuntimeExports.jsx("g",{children:s.jsxRuntimeExports.jsx("rect",{x:g.length*320/l.length+1,y:1,width:320/l.length-2,height:8,style:{fill:l[g.length],stroke:l[g.length]}})})]})})]})]}):s.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{Y(!0)},children:s.jsxRuntimeExports.jsx("div",{className:"items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),C&&U?s.jsxRuntimeExports.jsx(ve.Tooltip,{data:C,body:U,xPos:K.x,yPos:K.y,backgroundStyle:E?.tooltip,className:re?.tooltip}):null,w&&j!==void 0?s.jsxRuntimeExports.jsx(fe.X,{open:j!==void 0,onClose:()=>{L(void 0)},children:s.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof w=="string"?{__html:Ce.string2HTML(w,j)}:void 0,children:typeof w=="function"?w(j):null})}):null]})}function Pe(e){const{data:o,mapData:u="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",graphTitle:m,colors:z,sources:q,graphDescription:g,height:l,width:c,footNote:B="The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.",colorDomain:te,colorLegendTitle:h,scaleType:H="threshold",padding:I,mapNoDataColor:U=T.Colors.light.graphNoData,backgroundColor:E=!1,mapBorderColor:re=T.Colors.light.grays["gray-500"],relativeHeight:x,tooltip:A,graphID:oe,mapProperty:se="ISO3",dataDownload:w=!1,language:k="en",minHeight:v=0,theme:O="light",ariaLabel:V,styles:y,classNames:R,autoRotate:G=!0,enableZoom:$=!0,globeMaterial:F,centerPoint:W=[0,0],atmosphereColor:ae="#999",showColorScale:D=!0,resetSelectionOnDoubleClick:N=!0,detailsOnClick:J,onSeriesMouseOver:X,onSeriesMouseClick:ie,highlightedIds:i=[],highlightedAltitude:j=.1,scale:L=1,globeOffset:P=[0,0],polygonAltitude:Z=.01,globeCurvatureResolution:ne=4,atmosphereAltitude:Y=.15,fogSettings:K,lights:le=[{type:"ambient",color:4210752,intensity:.4},{type:"directional",color:16777215,intensity:1,position:{x:5,y:10,z:5}}]}=e,[C,_]=n.useState(void 0),[f,Q]=n.useState(0),[S,ee]=n.useState(0),t=n.useRef(null);n.useEffect(()=>{const r=new ResizeObserver(p=>{Q(c||p[0].target.clientWidth||760),ee(l||p[0].target.clientHeight||480)});return t.current&&(ee(t.current.clientHeight||480),Q(t.current.clientWidth||760),c||r.observe(t.current)),()=>r.disconnect()},[c,l]),n.useEffect(()=>{typeof u=="string"?De.fetchAndParseJSON(u).then(p=>{if(u==="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json"){const d=p.features.map(b=>{if(b.geometry.type==="Polygon"){const ce=[...b.geometry.coordinates[0]].reverse(),de={...b.geometry,coordinates:[ce]};return{...b,geometry:de}}const ue=[];b.geometry.coordinates.forEach(ce=>{const de=[...ce[0]].reverse();ue.push([de])});const he={...b.geometry,coordinates:ue};return{...b,geometry:he}});_(d)}else _(p.features)}):_(u.features)},[u]);const a=te||(H==="categorical"?Ne.getUniqValue(o,"x"):Me.getJenks(o.map(r=>r.x),z?.length||4));return s.jsxRuntimeExports.jsx("div",{className:`${O||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:k==="he"||k==="ar"?"rtl":void 0,children:s.jsxRuntimeExports.jsx("div",{className:s.mo(`${E?E===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${k||"en"}`,c?"w-fit":"w-full",R?.graphContainer),style:{...y?.graphContainer||{},...E&&E!==!0?{backgroundColor:E}:{}},id:oe,"aria-label":V||`${m?`The graph shows ${m}. `:""}This is a map.${g?` ${g}`:""}`,children:s.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:E?I||"1rem":I||0},children:s.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[m||g||w?s.jsxRuntimeExports.jsx(Se.GraphHeader,{styles:{title:y?.title,description:y?.description},classNames:{title:R?.title,description:R?.description},graphTitle:m,graphDescription:g,width:c,graphDownload:void 0,dataDownload:w?o.map(r=>r.data).filter(r=>r!==void 0).length>0?o.map(r=>r.data).filter(r=>r!==void 0):o.filter(r=>r!==void 0):null}):null,s.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:t,"aria-label":"Map area",children:(c||f)&&(l||S)&&C?s.jsxRuntimeExports.jsx(Le,{data:o,globeOffset:P,polygonData:C,colorDomain:a,width:c||f,height:Math.max(v,l||(x?v?(c||f)*x>v?(c||f)*x:v:(c||f)*x:S)),colors:z||(H==="categorical"?T.Colors[O].sequentialColors[`neutralColorsx0${a.length}`]:T.Colors[O].sequentialColors[`neutralColorsx0${a.length+1}`]),mapNoDataColor:U,categorical:H==="categorical",mapBorderColor:re,tooltip:A,mapProperty:se,styles:y,classNames:R,autoRotate:G===!0?1.5:G===!1?0:G,enableZoom:$,globeMaterial:F,atmosphereColor:ae,colorLegendTitle:h,showColorScale:D,hoverStrokeColor:O==="light"?T.Colors.light.grays["gray-700"]:T.Colors.light.grays["gray-300"],highlightedIds:i,resetSelectionOnDoubleClick:N,detailsOnClick:J,onSeriesMouseOver:X,onSeriesMouseClick:ie,scale:L,polygonAltitude:Z,centerLat:W[0],centerLng:W[1],atmosphereAltitude:Y,globeCurvatureResolution:ne,fogSettings:K,lights:le,highlightedAltitude:j}):s.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(v,l||(x?v?(c||f)*x>v?(c||f)*x:v:(c||f)*x:S))}px`},className:"flex items-center justify-center",children:s.jsxRuntimeExports.jsx(me.y,{"aria-label":"Loading graph"})})}),q||B?s.jsxRuntimeExports.jsx(ke.GraphFooter,{styles:{footnote:y?.footnote,source:y?.source},classNames:{footnote:R?.footnote,source:R?.source},sources:q,footNote:B,width:c}):null]})})})})}exports.ThreeDGlobe=Pe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),me=require("./Spinner-DA6Z5E4n.cjs"),ge=require("react-globe.gl"),xe=require("./index-DQA8q5sC.cjs"),ye=require("three"),fe=require("./Modal-tXZlLE5s.cjs"),pe=require("./Typography-k-kOjICQ.cjs"),be=require("./index-D05lK1Te.cjs"),ve=require("./Tooltip-De16GWhY.cjs"),je=require("./numberFormattingFunction-02t-wJta.cjs"),we=require("./index-BW_-wD2k.cjs"),Ce=require("./string2HTML-z7CwHXcx.cjs"),Ee=require("./ordinal-BOeNbyae.cjs"),Re=require("./threshold-DNsSUf8Q.cjs"),Se=require("./GraphHeader.cjs"),ke=require("./GraphFooter.cjs"),De=require("./fetchAndParseData-Ba-_CgxS.cjs"),T=require("./Colors.cjs"),Ne=require("./getUniqValue-RViz8tTw.cjs"),Me=require("./getJenks-GYmdwBqm.cjs");function qe(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const u in e)if(u!=="default"){const m=Object.getOwnPropertyDescriptor(e,u);Object.defineProperty(o,u,m.get?m:{enumerable:!0,get:()=>e[u]})}}return o.default=e,Object.freeze(o)}const M=qe(ye);function Oe(e){let o;switch(e.type){case"ambient":o=new M.AmbientLight(e.color,e.intensity);break;case"directional":o=new M.DirectionalLight(e.color,e.intensity),e.position&&(e.position==="camera"?o.position.set(0,0,0):o.position.set(e.position.x,e.position.y,e.position.z)),(e.target||e.position==="camera")&&o.target.position.set(e.target?.x||0,e.target?.y||0,e.target?.z===void 0?-1:e.target.z),e.castShadow&&(o.castShadow=!0,e.shadow&&(o.shadow.mapSize.width=e.shadow.mapSize.width,o.shadow.mapSize.height=e.shadow.mapSize.height,o.shadow.camera.near=e.shadow.camera.near,o.shadow.camera.far=e.shadow.camera.far));break;case"point":o=new M.PointLight(e.color,e.intensity,e.distance||0,e.decay||2),e.position&&(e.position==="camera"?o.position.set(0,0,0):o.position.set(e.position.x,e.position.y,e.position.z));break;case"spot":o=new M.SpotLight(e.color,e.intensity,e.distance||0,e.angle||Math.PI/3,e.penumbra||0,e.decay||2),e.position&&(e.position==="camera"?o.position.set(0,0,0):o.position.set(e.position.x,e.position.y,e.position.z)),(e.target||e.position==="camera")&&o.target.position.set(e.target?.x||0,e.target?.y||0,e.target?.z||0),e.castShadow&&(o.castShadow=!0,e.shadow&&(o.shadow.mapSize.width=e.shadow.mapSize.width,o.shadow.mapSize.height=e.shadow.mapSize.height,o.shadow.camera.near=e.shadow.camera.near,o.shadow.camera.far=e.shadow.camera.far));break;default:throw new Error("Unknown light type")}return o}function Le(e){const{width:o,autoRotate:u,data:m,enableZoom:z,categorical:q,colorDomain:g,colors:l,globeMaterial:c,height:B,polygonData:te,mapProperty:h,mapBorderColor:H,atmosphereColor:I,tooltip:U,styles:E,classNames:re,mapNoDataColor:x,colorLegendTitle:A,showColorScale:oe,hoverStrokeColor:se,detailsOnClick:w,onSeriesMouseClick:k,onSeriesMouseOver:v,resetSelectionOnDoubleClick:O,highlightedIds:V,scale:y,globeOffset:R,polygonAltitude:G,centerLng:$,centerLat:F,atmosphereAltitude:W,globeCurvatureResolution:ae,fogSettings:D,lights:N,highlightedAltitude:J}=e,[X,ie]=n.useState(!1),i=n.useRef(void 0),[j,L]=n.useState(void 0),[P,Z]=n.useState(void 0),[ne,Y]=n.useState(!(o<680)),[K,le]=n.useState({x:0,y:0}),[C,_]=n.useState(void 0),f=q?Ee.ordinal().domain(g).range(l):Re.threshold().domain(g).range(l);n.useEffect(()=>{i.current&&(i.current.controls().enableZoom=z)},[z]),n.useEffect(()=>{i.current&&(C||j?i.current.controls().autoRotate=!1:(i.current.controls().autoRotate=u!==0,i.current.controls().autoRotateSpeed=u))},[C,j,u]),n.useEffect(()=>{i.current&&P&&i.current.pointOfView({lat:P[1],lng:P[0],altitude:y},1e3)},[P,y]),n.useEffect(()=>{const t=i.current?.renderer().domElement;if(!t)return;const a=r=>{le({x:r.clientX,y:r.clientY})};return t.addEventListener("mousemove",a),()=>t.removeEventListener("mousemove",a)},[]),n.useEffect(()=>{i.current&&i.current.pointOfView({lat:F,lng:$,altitude:y},1e3)},[y,$,F]);const Q=c||new M.MeshBasicMaterial({color:"#FFF"}),S=n.useCallback(()=>{if(!i.current)return;const t=i.current.scene(),a=i.current.camera();let r=[];t.traverse(d=>{d instanceof M.Light&&r.push(d)}),r=[...r,...a.children],r.forEach(d=>d.parent?.remove(d)),N.map(d=>Oe(d)).forEach((d,b)=>{N[b].type!=="ambient"&&N[b].position==="camera"?(a.add(d),N[b].type!=="point"&&a.add(d.target)):t.add(d)}),D&&(t.fog=new M.Fog(D.color,D.near,D.far))},[N,D]),ee=n.useCallback(()=>{ie(!0),S()},[S]);return n.useEffect(()=>{X&&S()},[X,S]),s.jsxRuntimeExports.jsxs("div",{className:"relative",children:[s.jsxRuntimeExports.jsx(ge,{ref:i,height:B,width:o,globeOffset:R,lineHoverPrecision:0,polygonsData:te,polygonAltitude:t=>V.includes(t?.properties?.[h])||t?.properties?.[h]===C?.id||t?.properties?.[h]===j?.id?J:G,polygonCapColor:t=>{const a=t?.properties?.[h],r=m.find(p=>p.id===a)?.x;return r!=null?f(r):x},polygonSideColor:t=>{const a=t?.properties?.[h],r=m.find(d=>d.id===a)?.x,p=r!=null?f(r):x;return V.includes(t?.properties?.[h])?p:"rgba(100,100,100,0)"},polygonStrokeColor:t=>t?.properties?.[h]===C?.id?se:H,onGlobeClick:()=>{L(void 0)},onPolygonClick:t=>{const a=t?.properties?.[h]?m.find(r=>r.id===t?.properties?.[h]):void 0;if(k||w)if(xe.isEqual(j,a)&&O&&a)L(void 0),k?.(void 0),Z(void 0);else{L(a),k?.(a);const[r,p]=be.turf_center_of_mass_default(t).geometry.coordinates;Z([r,p])}},onPolygonHover:t=>{const a=t?.properties?.[h]?m.find(r=>r.id===t?.properties?.[h]):void 0;_(a),v?.(a)},atmosphereColor:I,atmosphereAltitude:W,globeCurvatureResolution:ae,globeMaterial:Q,backgroundColor:"rgba(0, 0, 0, 0)",polygonsTransitionDuration:100,onGlobeReady:()=>{if(i.current){i.current.pointOfView({lat:F,lng:$});const t=i.current.scene();setTimeout(()=>{(t.children[3]?.children[0]?.children[4]?.children||[]).forEach(p=>{const d=p.children[1];d.renderOrder=2})},300);const a=i.current.camera();t.add(a),ee()}}}),oe===!1?null:s.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:ne?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{Y(!1)},children:s.jsxRuntimeExports.jsx(we.X,{})}),s.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)",width:q?void 0:"340px"},children:[A&&A!==""?s.jsxRuntimeExports.jsx(pe.u,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:A}):null,q?s.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:g.map((t,a)=>s.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:l[a%l.length]}}),s.jsxRuntimeExports.jsx(pe.u,{size:"sm",marginBottom:"none",leading:"none",children:t})]},a))}):s.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:s.jsxRuntimeExports.jsxs("g",{children:[g.map((t,a)=>s.jsxRuntimeExports.jsxs("g",{className:"cursor-pointer",children:[s.jsxRuntimeExports.jsx("rect",{x:a*320/l.length+1,y:1,width:320/l.length-2,height:8,style:{fill:l[a],stroke:l[a]}}),s.jsxRuntimeExports.jsx("text",{x:(a+1)*320/l.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:je.numberFormattingFunction(t,"NA")})]},a)),s.jsxRuntimeExports.jsx("g",{children:s.jsxRuntimeExports.jsx("rect",{x:g.length*320/l.length+1,y:1,width:320/l.length-2,height:8,style:{fill:l[g.length],stroke:l[g.length]}})})]})})]})]}):s.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{Y(!0)},children:s.jsxRuntimeExports.jsx("div",{className:"items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),C&&U?s.jsxRuntimeExports.jsx(ve.Tooltip,{data:C,body:U,xPos:K.x,yPos:K.y,backgroundStyle:E?.tooltip,className:re?.tooltip}):null,w&&j!==void 0?s.jsxRuntimeExports.jsx(fe.X,{open:j!==void 0,onClose:()=>{L(void 0)},children:s.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof w=="string"?{__html:Ce.string2HTML(w,j)}:void 0,children:typeof w=="function"?w(j):null})}):null]})}function Pe(e){const{data:o,mapData:u="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",graphTitle:m,colors:z,sources:q,graphDescription:g,height:l,width:c,footNote:B="The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.",colorDomain:te,colorLegendTitle:h,scaleType:H="threshold",padding:I,mapNoDataColor:U=T.Colors.light.graphNoData,backgroundColor:E=!1,mapBorderColor:re=T.Colors.light.grays["gray-500"],relativeHeight:x,tooltip:A,graphID:oe,mapProperty:se="ISO3",dataDownload:w=!1,language:k="en",minHeight:v=0,theme:O="light",ariaLabel:V,styles:y,classNames:R,autoRotate:G=!0,enableZoom:$=!0,globeMaterial:F,centerPoint:W=[0,0],atmosphereColor:ae="#999",showColorScale:D=!0,resetSelectionOnDoubleClick:N=!0,detailsOnClick:J,onSeriesMouseOver:X,onSeriesMouseClick:ie,highlightedIds:i=[],highlightedAltitude:j=.1,scale:L=1,globeOffset:P=[0,0],polygonAltitude:Z=.01,globeCurvatureResolution:ne=4,atmosphereAltitude:Y=.15,fogSettings:K,lights:le=[{type:"ambient",color:4210752,intensity:.4},{type:"directional",color:16777215,intensity:1,position:{x:5,y:10,z:5}}]}=e,[C,_]=n.useState(void 0),[f,Q]=n.useState(0),[S,ee]=n.useState(0),t=n.useRef(null);n.useEffect(()=>{const r=new ResizeObserver(p=>{Q(c||p[0].target.clientWidth||760),ee(l||p[0].target.clientHeight||480)});return t.current&&(ee(t.current.clientHeight||480),Q(t.current.clientWidth||760),c||r.observe(t.current)),()=>r.disconnect()},[c,l]),n.useEffect(()=>{typeof u=="string"?De.fetchAndParseJSON(u).then(p=>{if(u==="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json"){const d=p.features.map(b=>{if(b.geometry.type==="Polygon"){const ce=[...b.geometry.coordinates[0]].reverse(),de={...b.geometry,coordinates:[ce]};return{...b,geometry:de}}const ue=[];b.geometry.coordinates.forEach(ce=>{const de=[...ce[0]].reverse();ue.push([de])});const he={...b.geometry,coordinates:ue};return{...b,geometry:he}});_(d)}else _(p.features)}):_(u.features)},[u]);const a=te||(H==="categorical"?Ne.getUniqValue(o,"x"):Me.getJenks(o.map(r=>r.x),z?.length||4));return s.jsxRuntimeExports.jsx("div",{className:`${O||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:k==="he"||k==="ar"?"rtl":void 0,children:s.jsxRuntimeExports.jsx("div",{className:s.mo(`${E?E===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${k||"en"}`,c?"w-fit":"w-full",R?.graphContainer),style:{...y?.graphContainer||{},...E&&E!==!0?{backgroundColor:E}:{}},id:oe,"aria-label":V||`${m?`The graph shows ${m}. `:""}This is a map.${g?` ${g}`:""}`,children:s.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:E?I||"1rem":I||0},children:s.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[m||g||w?s.jsxRuntimeExports.jsx(Se.GraphHeader,{styles:{title:y?.title,description:y?.description},classNames:{title:R?.title,description:R?.description},graphTitle:m,graphDescription:g,width:c,graphDownload:void 0,dataDownload:w?o.map(r=>r.data).filter(r=>r!==void 0).length>0?o.map(r=>r.data).filter(r=>r!==void 0):o.filter(r=>r!==void 0):null}):null,s.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:t,"aria-label":"Map area",children:(c||f)&&(l||S)&&C?s.jsxRuntimeExports.jsx(Le,{data:o,globeOffset:P,polygonData:C,colorDomain:a,width:c||f,height:Math.max(v,l||(x?v?(c||f)*x>v?(c||f)*x:v:(c||f)*x:S)),colors:z||(H==="categorical"?T.Colors[O].sequentialColors[`neutralColorsx0${a.length}`]:T.Colors[O].sequentialColors[`neutralColorsx0${a.length+1}`]),mapNoDataColor:U,categorical:H==="categorical",mapBorderColor:re,tooltip:A,mapProperty:se,styles:y,classNames:R,autoRotate:G===!0?1.5:G===!1?0:G,enableZoom:$,globeMaterial:F,atmosphereColor:ae,colorLegendTitle:h,showColorScale:D,hoverStrokeColor:O==="light"?T.Colors.light.grays["gray-700"]:T.Colors.light.grays["gray-300"],highlightedIds:i,resetSelectionOnDoubleClick:N,detailsOnClick:J,onSeriesMouseOver:X,onSeriesMouseClick:ie,scale:L,polygonAltitude:Z,centerLat:W[0],centerLng:W[1],atmosphereAltitude:Y,globeCurvatureResolution:ne,fogSettings:K,lights:le,highlightedAltitude:j}):s.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(v,l||(x?v?(c||f)*x>v?(c||f)*x:v:(c||f)*x:S))}px`},className:"flex items-center justify-center",children:s.jsxRuntimeExports.jsx(me.y,{"aria-label":"Loading graph"})})}),q||B?s.jsxRuntimeExports.jsx(ke.GraphFooter,{styles:{footnote:y?.footnote,source:y?.source},classNames:{footnote:R?.footnote,source:R?.source},sources:q,footNote:B,width:c}):null]})})})})}exports.ThreeDGlobe=Pe;
2
2
  //# sourceMappingURL=ThreeDGlobe.cjs.map