@undp/data-viz 2.1.2 → 2.1.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.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +2 -2
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +223 -223
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +2 -2
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.cjs.map +1 -1
- package/dist/DonutChart.d.ts +10 -0
- package/dist/DonutChart.js +230 -264
- package/dist/DonutChart.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +1 -1
- package/dist/{GraphEl-YKUlz-37.cjs → GraphEl-BLMih7RN.cjs} +2 -2
- package/dist/GraphEl-BLMih7RN.cjs.map +1 -0
- package/dist/{GraphEl-sVZvlyWe.js → GraphEl-CRrAlbcr.js} +4 -2
- package/dist/GraphEl-CRrAlbcr.js.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +2 -2
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.js +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.js +1 -1
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +2 -2
- package/dist/Types.d.ts +1 -0
- package/dist/{area-BE2wo7fv.js → area-B6r7cv2o.js} +5 -5
- package/dist/{area-BE2wo7fv.js.map → area-B6r7cv2o.js.map} +1 -1
- package/dist/area-C1gxfNGD.cjs +2 -0
- package/dist/{area-D3Qx7k7K.cjs.map → area-C1gxfNGD.cjs.map} +1 -1
- package/dist/array-DMyR1sql.cjs +2 -0
- package/dist/array-DMyR1sql.cjs.map +1 -0
- package/dist/array-USo-Szhp.js +13 -0
- package/dist/array-USo-Szhp.js.map +1 -0
- package/dist/{ensureCompleteData-DS7gCvVd.js → ensureCompleteData-DH5c52Ub.js} +6 -6
- package/dist/{ensureCompleteData-DS7gCvVd.js.map → ensureCompleteData-DH5c52Ub.js.map} +1 -1
- package/dist/{ensureCompleteData-Oib-vGb0.cjs → ensureCompleteData-pZ9QO6kB.cjs} +2 -2
- package/dist/{ensureCompleteData-Oib-vGb0.cjs.map → ensureCompleteData-pZ9QO6kB.cjs.map} +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/line-DFlZsxI1.js +144 -0
- package/dist/line-DFlZsxI1.js.map +1 -0
- package/dist/line-DaEMhXmx.cjs +2 -0
- package/dist/line-DaEMhXmx.cjs.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/GraphEl-YKUlz-37.cjs.map +0 -1
- package/dist/GraphEl-sVZvlyWe.js.map +0 -1
- package/dist/area-D3Qx7k7K.cjs +0 -2
- package/dist/array-B7TkkRH0.js +0 -89
- package/dist/array-B7TkkRH0.js.map +0 -1
- package/dist/array-DKbXV8lR.cjs +0 -2
- package/dist/array-DKbXV8lR.cjs.map +0 -1
- package/dist/line-CPfhohvF.js +0 -68
- package/dist/line-CPfhohvF.js.map +0 -1
- package/dist/line-DHV4JwCR.cjs +0 -2
- package/dist/line-DHV4JwCR.cjs.map +0 -1
package/dist/DonutChart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DonutChart.js","sources":["../node_modules/d3-shape/src/math.js","../node_modules/d3-shape/src/arc.js","../node_modules/d3-shape/src/descending.js","../node_modules/d3-shape/src/identity.js","../node_modules/d3-shape/src/pie.js","../src/Components/Graphs/DonutChart/Graph.tsx","../src/Components/Graphs/DonutChart/index.tsx"],"sourcesContent":["export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it’s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport isEqual from 'fast-deep-equal';\r\nimport { pie, arc } from 'd3-shape';\r\nimport { useState } from 'react';\r\nimport { H2, P } from '@undp/design-system-react/Typography';\r\n\r\nimport { ClassNameObject, DonutChartDataType, StyleObject } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n radius: number;\r\n colors: string[];\r\n subNote?: string;\r\n strokeWidth: number;\r\n data: DonutChartDataType[];\r\n\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n\r\n onSeriesMouseOver?: (_d: any) => void;\r\n\r\n onSeriesMouseClick?: (_d: any) => void;\r\n colorDomain: string[];\r\n resetSelectionOnDoubleClick: boolean;\r\n\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n precision: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n mainText,\r\n data,\r\n radius,\r\n colors,\r\n subNote,\r\n strokeWidth,\r\n tooltip,\r\n onSeriesMouseOver,\r\n onSeriesMouseClick,\r\n colorDomain,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision,\r\n } = props;\r\n const pieData = pie()\r\n .sort(null)\r\n .startAngle(0)\r\n\r\n .value((d: any) => d.size);\r\n\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n\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 return (\r\n <>\r\n <svg\r\n width={`${radius * 2}px`}\r\n height={`${radius * 2}px`}\r\n viewBox={`0 0 ${radius * 2} ${radius * 2}`}\r\n direction='ltr'\r\n className='mx-auto'\r\n >\r\n <g transform={`translate(${radius} ${radius})`}>\r\n {mainText || subNote ? (\r\n <foreignObject\r\n y={0 - (radius - strokeWidth)}\r\n x={0 - (radius - strokeWidth)}\r\n width={2 * (radius - strokeWidth)}\r\n height={2 * (radius - strokeWidth)}\r\n >\r\n <div className='flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4'>\r\n {mainText ? (\r\n <H2\r\n marginBottom='none'\r\n className='donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center'\r\n >\r\n {typeof mainText === 'string'\r\n ? mainText\r\n : data.findIndex(d => d.label === mainText.label) !== -1\r\n ? numberFormattingFunction(\r\n data[data.findIndex(d => d.label === mainText.label)].size,\r\n 'NA',\r\n precision,\r\n mainText.prefix,\r\n mainText.suffix,\r\n )\r\n : 'NA'}\r\n </H2>\r\n ) : null}\r\n {subNote ? (\r\n <P\r\n marginBottom='none'\r\n size='base'\r\n leading='none'\r\n className='donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {subNote}\r\n </P>\r\n ) : typeof mainText === 'string' || !mainText ? null : (\r\n <P\r\n size='base'\r\n marginBottom='none'\r\n leading='none'\r\n className='donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {mainText.label}\r\n </P>\r\n )}\r\n </div>\r\n </foreignObject>\r\n ) : null}\r\n {pieData(data as any).map((d, i) => (\r\n <path\r\n key={i}\r\n d={\r\n arc()({\r\n innerRadius: radius - strokeWidth,\r\n outerRadius: radius,\r\n startAngle: d.startAngle,\r\n endAngle: d.endAngle,\r\n }) as string\r\n }\r\n style={{\r\n fill:\r\n colorDomain.indexOf((d.data as any).label) !== -1\r\n ? colors[colorDomain.indexOf((d.data as any).label) % colors.length]\r\n : Colors.gray,\r\n opacity: mouseOverData\r\n ? mouseOverData.label === (d.data as any).label\r\n ? 1\r\n : 0.3\r\n : 1,\r\n }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d.data);\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.data) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d.data);\r\n if (onSeriesMouseClick) onSeriesMouseClick(d.data);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d.data);\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 ))}\r\n </g>\r\n </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 <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useRef, useState } from 'react';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport orderBy from 'lodash.orderby';\r\nimport { Spacer } from '@undp/design-system-react/Spacer';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n DonutChartDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DonutChartDataType[];\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 /** Array of colors for each segment */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: 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 /** Radius of the donut chart */\r\n radius?: 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\r\n // Graph Parameters\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Max width of the color scale as a css property */\r\n colorScaleMaxWidth?: string;\r\n /** Stroke width of the arcs and circle of the donut */\r\n strokeWidth?: number;\r\n /** Sorting order for data. This is overwritten by labelOrder prop */\r\n sortData?: 'asc' | 'desc';\r\n /** Large text at the center of the donut chart. If the type is an object then the text is the value in the data for the label mentioned in the object */\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n /** Small text at the center of the donut chart */\r\n subNote?: string;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\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 DonutChart(props: Props) {\r\n const {\r\n mainText,\r\n graphTitle,\r\n colors = Colors.light.categoricalColors.colors,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n strokeWidth = 50,\r\n graphDescription,\r\n subNote,\r\n footNote,\r\n radius,\r\n data,\r\n showColorScale = true,\r\n padding,\r\n backgroundColor = false,\r\n tooltip,\r\n onSeriesMouseOver,\r\n graphID,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n colorDomain,\r\n sortData,\r\n language = 'en',\r\n theme = 'light',\r\n width,\r\n height,\r\n minHeight = 0,\r\n relativeHeight,\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n colorScaleMaxWidth,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision = 2,\r\n } = props;\r\n\r\n const [graphRadius, setGraphRadius] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setGraphRadius(\r\n (Math.min(\r\n ...[\r\n entries[0].target.clientWidth || 620,\r\n entries[0].target.clientHeight || 480,\r\n radius || Infinity,\r\n ],\r\n ) || 420) / 2,\r\n );\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [radius]);\r\n\r\n const sortedData = sortData ? orderBy(data, ['size'], [sortData]) : data;\r\n\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\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 : 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 {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale ? (\r\n <div\r\n className={cn(\r\n 'leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap',\r\n classNames?.colorLegend,\r\n )}\r\n style={{ maxWidth: colorScaleMaxWidth }}\r\n aria-label='Color legend'\r\n >\r\n {sortedData.map((d, i) => (\r\n <div className='flex gap-2 items-center pb-3' key={i}>\r\n <div\r\n className='w-3 h-3 rounded-full'\r\n style={{\r\n backgroundColor:\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) !== -1\r\n ? (colors || Colors[theme].categoricalColors.colors)[\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) %\r\n (colors || Colors[theme].categoricalColors.colors).length\r\n ]\r\n : Colors.gray,\r\n }}\r\n />\r\n <P\r\n marginBottom='none'\r\n size='sm'\r\n className='text-primary-gray-700 dark:text-primary-gray-100'\r\n >\r\n {d.label}:{' '}\r\n <span className='font-bold' style={{ fontSize: 'inherit' }}>\r\n {numberFormattingFunction(d.size, 'NA', precision, prefix, suffix)}\r\n </span>\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n ) : null}\r\n <Spacer size='lg' />\r\n <GraphArea ref={graphDiv}>\r\n {graphRadius ? (\r\n <Graph\r\n mainText={mainText}\r\n data={sortedData}\r\n colors={colors}\r\n radius={graphRadius}\r\n subNote={subNote}\r\n strokeWidth={strokeWidth}\r\n tooltip={tooltip}\r\n colorDomain={colorDomain || sortedData.map(d => d.label)}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n detailsOnClick={detailsOnClick}\r\n precision={precision}\r\n />\r\n ) : null}\r\n </GraphArea>\r\n </>\r\n )}\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 </GraphContainer>\r\n );\r\n}\r\n"],"names":["abs","atan2","cos","max","min","sin","sqrt","epsilon","pi","halfPi","tau","acos","x","asin","arcInnerRadius","d","arcOuterRadius","arcStartAngle","arcEndAngle","arcPadAngle","intersect","x0","y0","x1","y1","x2","y2","x3","y3","x10","y10","x32","y32","t","cornerTangents","r1","rc","cw","x01","y01","lo","ox","oy","x11","y11","x00","y00","dx","dy","d2","r","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","arc","innerRadius","outerRadius","cornerRadius","constant","padRadius","startAngle","endAngle","padAngle","context","path","withPath","buffer","r0","a0","a1","da","a01","a11","a00","a10","da0","da1","ap","rp","rc0","rc1","t0","t1","p0","p1","oc","ax","ay","bx","by","kc","lc","a","_","descending","b","identity","pie","value","sortValues","sort","data","i","n","array","j","k","sum","index","arcs","p","pa","v","Graph","props","$","_c","mainText","radius","colors","subNote","strokeWidth","tooltip","onSeriesMouseOver","onSeriesMouseClick","colorDomain","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","precision","pieData","_temp","mouseOverData","setMouseOverData","useState","undefined","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","t2","t3","t4","t5","t6","jsx","jsxs","H2","findIndex","d_1","label","numberFormattingFunction","d_0","size","prefix","suffix","P","t7","d_2","fill","indexOf","length","Colors","gray","opacity","event","clientY","clientX","isEqual","event_0","t8","map","t9","t10","t11","Tooltip","t12","modal","DetailsModal","t13","Fragment","DonutChart","graphTitle","light","categoricalColors","sources","graphDescription","footNote","showColorScale","padding","backgroundColor","graphID","graphDownload","dataDownload","sortData","language","theme","width","height","minHeight","relativeHeight","ariaLabel","colorScaleMaxWidth","graphRadius","setGraphRadius","graphDiv","useRef","graphParentDiv","useEffect","resizeObserver","ResizeObserver","entries","Math","target","clientWidth","clientHeight","Infinity","current","observe","disconnect","sortedData","orderBy","GraphContainer","graphContainer","GraphHeader","title","description","filter","EmptyState","cn","colorLegend","maxWidth","el","fontSize","Spacer","GraphArea","GraphFooter","footnote","source"],"mappings":";;;;;;;;;;;;;;;AAAO,MAAMA,KAAM,KAAK,KACXC,IAAQ,KAAK,OACbC,IAAM,KAAK,KACXC,KAAM,KAAK,KACXC,KAAM,KAAK,KACXC,IAAM,KAAK,KACXC,IAAO,KAAK,MAEZC,IAAU,OACVC,KAAK,KAAK,IACVC,KAASD,KAAK,GACdE,KAAM,IAAIF;AAEhB,SAASG,GAAKC,GAAG;AACtB,SAAOA,IAAI,IAAI,IAAIA,IAAI,KAAKJ,KAAK,KAAK,KAAKI,CAAC;AAC9C;AAEO,SAASC,GAAKD,GAAG;AACtB,SAAOA,KAAK,IAAIH,KAASG,KAAK,KAAK,CAACH,KAAS,KAAK,KAAKG,CAAC;AAC1D;ACfA,SAASE,GAAeC,GAAG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AA,EAAE+I;AAAAA,UAAM;AAAA,UAAE;AAAA,UACXL,gBAAAA,EAAAA,IAAC,QAAA,EAAK,WAAU,aAAY,OAAO;AAAA,YAAEwF,UAAU;AAAA,UAAA,GAC5ClF,aAAyBhJ,EAAEkJ,MAAM,MAAM1B,GAAW2B,GAAQC,CAAM,EAAA,CACnE;AAAA,QAAA,EAAA,CACF;AAAA,MAAA,EAAA,GAtBiDxD,CAuBnD,CACD,EAAA,CACH,IACE;AAAA,MACJ8C,gBAAAA,EAAAA,IAACyF,IAAA,EAAO,MAAK,KAAA,CAAI;AAAA,MACjBzF,gBAAAA,EAAAA,IAAC0F,IAAA,EAAU,KAAK9B,GACbF,UAAAA,IACC1D,gBAAAA,EAAAA,IAACnC,IAAA,EACC,UAAAI,GACA,MAAM0G,GACN,QAAAxG,GACA,QAAQuF,GACR,SAAAtF,GACA,aAAAC,GACA,SAAAC,GACA,aAAaG,KAAekG,EAAWjD,IAAIpK,CAAAA,MAAKA,EAAE+I,KAAK,GACvD,mBAAA9B,GACA,oBAAAC,GACA,6BAAAE,GACA,QAAAE,GACA,gBAAAD,GACA,WAAAG,EAAA,CAAqB,IAErB,KAAA,CACN;AAAA,IAAA,GACF;AAAA,IAED0D,KAAWE,IACV1C,gBAAAA,EAAAA,IAAC2F,IAAA,EACC,QAAQ;AAAA,MAAEC,UAAUhH,GAAQgH;AAAAA,MAAUC,QAAQjH,GAAQiH;AAAAA,IAAAA,GACtD,YAAY;AAAA,MACVD,UAAU/G,GAAY+G;AAAAA,MACtBC,QAAQhH,GAAYgH;AAAAA,IAAAA,GAEtB,SAAArD,GACA,UAAAE,GACA,OAAAU,EAAA,CAAa,IAEb;AAAA,EAAA,GACN;AAEJ;","x_google_ignoreList":[0,1,2,3,4]}
|
|
1
|
+
{"version":3,"file":"DonutChart.js","sources":["../node_modules/d3-shape/src/math.js","../node_modules/d3-shape/src/descending.js","../node_modules/d3-shape/src/identity.js","../node_modules/d3-shape/src/pie.js","../src/Utils/getArc.ts","../src/Components/Graphs/DonutChart/Graph.tsx","../src/Components/Graphs/DonutChart/index.tsx"],"sourcesContent":["export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","const polarToCartesian = (\r\n centerX: number,\r\n centerY: number,\r\n radius: number,\r\n angleInRadians: number,\r\n) => {\r\n return {\r\n x: centerX + radius * Math.cos(angleInRadians),\r\n y: centerY + radius * Math.sin(angleInRadians),\r\n };\r\n};\r\n\r\nexport function getArc(\r\n x: number,\r\n y: number,\r\n radius: number,\r\n startAngleInRadians: number,\r\n endAngleInRadians: number,\r\n) {\r\n const start = polarToCartesian(x, y, radius, startAngleInRadians);\r\n const end = polarToCartesian(x, y, radius, endAngleInRadians);\r\n const largeArcFlag = endAngleInRadians - startAngleInRadians <= Math.PI ? '0' : '1';\r\n const d = ['M', start.x, start.y, 'A', radius, radius, 0, largeArcFlag, 1, end.x, end.y].join(\r\n ' ',\r\n );\r\n return d;\r\n}\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport isEqual from 'fast-deep-equal';\r\nimport { pie } from 'd3-shape';\r\nimport { useRef, useState } from 'react';\r\nimport { H2, P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport { AnimateDataType, ClassNameObject, DonutChartDataType, StyleObject } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\nimport { getArc } from '@/Utils/getArc';\r\n\r\ninterface Props {\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n radius: number;\r\n colors: string[];\r\n subNote?: string;\r\n strokeWidth: number;\r\n data: DonutChartDataType[];\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n onSeriesMouseOver?: (_d: any) => void;\r\n onSeriesMouseClick?: (_d: any) => void;\r\n colorDomain: string[];\r\n resetSelectionOnDoubleClick: boolean;\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n precision: number;\r\n animate: AnimateDataType;\r\n trackColor: string;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n mainText,\r\n data,\r\n radius,\r\n colors,\r\n subNote,\r\n strokeWidth,\r\n tooltip,\r\n onSeriesMouseOver,\r\n onSeriesMouseClick,\r\n colorDomain,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision,\r\n animate,\r\n trackColor,\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 const pieData = pie()\r\n .sort(null)\r\n .startAngle(0)\r\n .value((d: any) => d.size);\r\n\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n\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 return (\r\n <>\r\n <motion.svg\r\n ref={svgRef}\r\n width={`${radius * 2}px`}\r\n height={`${radius * 2}px`}\r\n viewBox={`0 0 ${radius * 2} ${radius * 2}`}\r\n direction='ltr'\r\n className='mx-auto'\r\n >\r\n <motion.g transform={`translate(${radius} ${radius})`}>\r\n {mainText || subNote ? (\r\n <foreignObject\r\n y={0 - (radius - strokeWidth)}\r\n x={0 - (radius - strokeWidth)}\r\n width={2 * (radius - strokeWidth)}\r\n height={2 * (radius - strokeWidth)}\r\n >\r\n <div className='flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4'>\r\n {mainText ? (\r\n <H2\r\n marginBottom='none'\r\n className='donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center'\r\n >\r\n {typeof mainText === 'string'\r\n ? mainText\r\n : data.findIndex(d => d.label === mainText.label) !== -1\r\n ? numberFormattingFunction(\r\n data[data.findIndex(d => d.label === mainText.label)].size,\r\n 'NA',\r\n precision,\r\n mainText.prefix,\r\n mainText.suffix,\r\n )\r\n : 'NA'}\r\n </H2>\r\n ) : null}\r\n {subNote ? (\r\n <P\r\n marginBottom='none'\r\n size='base'\r\n leading='none'\r\n className='donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {subNote}\r\n </P>\r\n ) : typeof mainText === 'string' || !mainText ? null : (\r\n <P\r\n size='base'\r\n marginBottom='none'\r\n leading='none'\r\n className='donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {mainText.label}\r\n </P>\r\n )}\r\n </div>\r\n </foreignObject>\r\n ) : null}\r\n <circle\r\n cx={0}\r\n cy={0}\r\n r={radius - strokeWidth / 2}\r\n fill='none'\r\n stroke={trackColor}\r\n strokeWidth={strokeWidth}\r\n />\r\n <AnimatePresence>\r\n {pieData(data as any).map((d, i) => (\r\n <motion.path\r\n key={i}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d: getArc(\r\n 0,\r\n 0,\r\n radius - strokeWidth / 2,\r\n d.startAngle - Math.PI / 2,\r\n d.endAngle - Math.PI / 2,\r\n ),\r\n opacity: mouseOverData\r\n ? mouseOverData.label === (d.data as any).label\r\n ? 1\r\n : 0.3\r\n : 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d: getArc(\r\n 0,\r\n 0,\r\n radius - strokeWidth / 2,\r\n d.startAngle - Math.PI / 2,\r\n d.endAngle - Math.PI / 2,\r\n ),\r\n opacity: mouseOverData\r\n ? mouseOverData.label === (d.data as any).label\r\n ? 1\r\n : 0.3\r\n : 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 stroke:\r\n colorDomain.indexOf((d.data as any).label) !== -1\r\n ? colors[colorDomain.indexOf((d.data as any).label) % colors.length]\r\n : Colors.gray,\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d.data);\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.data) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d.data);\r\n if (onSeriesMouseClick) onSeriesMouseClick(d.data);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d.data);\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 ))}\r\n </AnimatePresence>\r\n </motion.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 <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useRef, useState } from 'react';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport orderBy from 'lodash.orderby';\r\nimport { Spacer } from '@undp/design-system-react/Spacer';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n DonutChartDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DonutChartDataType[];\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 /** Array of colors for each segment */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: 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 /** Radius of the donut chart */\r\n radius?: 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\r\n // Graph Parameters\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Max width of the color scale as a css property */\r\n colorScaleMaxWidth?: string;\r\n /** Stroke width of the arcs and circle of the donut */\r\n strokeWidth?: number;\r\n /** Sorting order for data. This is overwritten by labelOrder prop */\r\n sortData?: 'asc' | 'desc';\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Large text at the center of the donut chart. If the type is an object then the text is the value in the data for the label mentioned in the object */\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n /** Small text at the center of the donut chart */\r\n subNote?: string;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Track color (i.e. the color of the donut chart's background) of the donut chart */\r\n trackColor?: string;\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 DonutChart(props: Props) {\r\n const {\r\n mainText,\r\n graphTitle,\r\n colors = Colors.light.categoricalColors.colors,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n strokeWidth = 50,\r\n graphDescription,\r\n subNote,\r\n footNote,\r\n radius,\r\n data,\r\n showColorScale = true,\r\n padding,\r\n backgroundColor = false,\r\n tooltip,\r\n onSeriesMouseOver,\r\n graphID,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n colorDomain,\r\n sortData,\r\n language = 'en',\r\n theme = 'light',\r\n width,\r\n height,\r\n minHeight = 0,\r\n relativeHeight,\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n colorScaleMaxWidth,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision = 2,\r\n animate = false,\r\n trackColor = Colors.light.grays['gray-200'],\r\n } = props;\r\n\r\n const [graphRadius, setGraphRadius] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setGraphRadius(\r\n (Math.min(\r\n ...[\r\n entries[0].target.clientWidth || 620,\r\n entries[0].target.clientHeight || 480,\r\n radius || Infinity,\r\n ],\r\n ) || 420) / 2,\r\n );\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [radius]);\r\n\r\n const sortedData = sortData ? orderBy(data, ['size'], [sortData]) : data;\r\n\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\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 : 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 {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale ? (\r\n <div\r\n className={cn(\r\n 'leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap',\r\n classNames?.colorLegend,\r\n )}\r\n style={{ maxWidth: colorScaleMaxWidth }}\r\n aria-label='Color legend'\r\n >\r\n {sortedData.map((d, i) => (\r\n <div className='flex gap-2 items-center pb-3' key={i}>\r\n <div\r\n className='w-3 h-3 rounded-full'\r\n style={{\r\n backgroundColor:\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) !== -1\r\n ? (colors || Colors[theme].categoricalColors.colors)[\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) %\r\n (colors || Colors[theme].categoricalColors.colors).length\r\n ]\r\n : Colors.gray,\r\n }}\r\n />\r\n <P\r\n marginBottom='none'\r\n size='sm'\r\n className='text-primary-gray-700 dark:text-primary-gray-100'\r\n >\r\n {d.label}:{' '}\r\n <span className='font-bold' style={{ fontSize: 'inherit' }}>\r\n {numberFormattingFunction(d.size, 'NA', precision, prefix, suffix)}\r\n </span>\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n ) : null}\r\n <Spacer size='lg' />\r\n <GraphArea ref={graphDiv}>\r\n {graphRadius ? (\r\n <Graph\r\n mainText={mainText}\r\n data={sortedData}\r\n colors={colors}\r\n radius={graphRadius}\r\n subNote={subNote}\r\n strokeWidth={strokeWidth}\r\n tooltip={tooltip}\r\n colorDomain={colorDomain || sortedData.map(d => d.label)}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n detailsOnClick={detailsOnClick}\r\n precision={precision}\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 trackColor={trackColor}\r\n />\r\n ) : null}\r\n </GraphArea>\r\n </>\r\n )}\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 </GraphContainer>\r\n );\r\n}\r\n"],"names":["pi","tau","descending","a","b","identity","d","pie","value","sortValues","sort","startAngle","constant","endAngle","padAngle","data","i","n","array","j","k","sum","index","arcs","a0","da","a1","p","pa","v","_","polarToCartesian","centerX","centerY","radius","angleInRadians","x","Math","cos","y","sin","getArc","startAngleInRadians","endAngleInRadians","start","end","largeArcFlag","PI","join","Graph","props","$","_c","mainText","colors","subNote","strokeWidth","tooltip","onSeriesMouseOver","onSeriesMouseClick","colorDomain","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","precision","animate","trackColor","svgRef","useRef","t0","amount","once","isInView","useInView","pieData","_temp","mouseOverData","setMouseOverData","useState","undefined","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","t1","motion","t2","t3","t4","t5","t6","t7","t8","t9","jsx","jsxs","H2","findIndex","d_1","label","numberFormattingFunction","d_0","size","prefix","suffix","P","t10","t11","T0","AnimatePresence","t12","duration","d_2","initial","pathLength","opacity","whileInView","transition","stroke","indexOf","length","Colors","gray","fill","event","clientY","clientX","isEqual","event_0","t13","map","t14","t15","g","t16","svg","t17","Tooltip","t18","modal","DetailsModal","t19","Fragment","DonutChart","graphTitle","light","categoricalColors","sources","graphDescription","footNote","showColorScale","padding","backgroundColor","graphID","graphDownload","dataDownload","sortData","language","theme","width","height","minHeight","relativeHeight","ariaLabel","colorScaleMaxWidth","grays","graphRadius","setGraphRadius","graphDiv","graphParentDiv","useEffect","resizeObserver","ResizeObserver","entries","min","target","clientWidth","clientHeight","Infinity","current","observe","disconnect","sortedData","orderBy","GraphContainer","graphContainer","GraphHeader","title","description","filter","EmptyState","cn","colorLegend","maxWidth","el","fontSize","Spacer","GraphArea","GraphFooter","footnote","source"],"mappings":";;;;;;;;;;;;;;;;;;AASO,MAAMA,KAAK,KAAK,IAEVC,KAAM,IAAID;ACXR,SAAAE,GAASC,GAAGC,GAAG;AAC5B,SAAOA,IAAID,IAAI,KAAKC,IAAID,IAAI,IAAIC,KAAKD,IAAI,IAAI;AAC/C;ACFe,SAAAE,GAASC,GAAG;AACzB,SAAOA;AACT;ACIe,SAAAC,KAAW;AACxB,MAAIC,IAAQH,IACRI,IAAaP,IACbQ,IAAO,MACPC,IAAaC,EAAS,CAAC,GACvBC,IAAWD,EAASX,EAAG,GACvBa,IAAWF,EAAS,CAAC;AAEzB,WAASL,EAAIQ,GAAM;AACjB,QAAIC,GACAC,KAAKF,IAAOG,GAAMH,CAAI,GAAG,QACzBI,GACAC,GACAC,IAAM,GACNC,IAAQ,IAAI,MAAML,CAAC,GACnBM,IAAO,IAAI,MAAMN,CAAC,GAClBO,IAAK,CAACb,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,CACD,EAAA,CACH,IACE;AAAA,MACJiF,gBAAAA,EAAAA,IAACsG,IAAA,EAAO,MAAK,KAAA,CAAI;AAAA,MACjBtG,gBAAAA,EAAAA,IAACuG,IAAA,EAAU,KAAK7B,GACbF,cACCxE,gBAAAA,MAAChD,IAAA,EACC,UAAAI,GACA,MAAMoI,GACN,QAAAnI,GACA,QAAQmH,GACR,SAAAlH,GACA,aAAAC,GACA,SAAAC,GACA,aAAaG,KAAe6H,EAAWpD,IAAI/H,CAAAA,MAAKA,EAAEgG,KAAK,GACvD,mBAAA5C,GACA,oBAAAC,GACA,6BAAAE,GACA,QAAAE,GACA,gBAAAD,GACA,WAAAG,IACA,SACEC,MAAY,KACR;AAAA,QAAEgD,UAAU;AAAA,QAAK1C,MAAM;AAAA,QAAMD,QAAQ;AAAA,MAAA,IACrCL,KAAW;AAAA,QAAEgD,UAAU;AAAA,QAAG1C,MAAM;AAAA,QAAMD,QAAQ;AAAA,MAAA,GAEpD,YAAAJ,EAAA,CAAuB,IAEvB,KAAA,CACN;AAAA,IAAA,GACF;AAAA,IAEDmF,KAAWE,IACVvD,gBAAAA,EAAAA,IAACwG,IAAA,EACC,QAAQ;AAAA,MAAEC,UAAU3I,GAAQ2I;AAAAA,MAAUC,QAAQ5I,GAAQ4I;AAAAA,IAAAA,GACtD,YAAY;AAAA,MACVD,UAAU1I,GAAY0I;AAAAA,MACtBC,QAAQ3I,GAAY2I;AAAAA,IAAAA,GAEtB,SAAArD,GACA,UAAAE,GACA,OAAAU,EAAA,CAAa,IAEb;AAAA,EAAA,GACN;AAEJ;","x_google_ignoreList":[0,1,2,3]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-CTPQjnHt.cjs"),E=require("react"),Vt=require("./parse-hMnG_lRV.cjs"),be=require("./index-Cno4Q0YE.cjs"),ae=require("./numberFormattingFunction-02t-wJta.cjs"),ke=require("./Tooltip-uUdw6wJL.cjs"),L=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ne=require("./XTicksAndGridLines-B6CELS7q.cjs"),he=require("./Axis-DxRV2yMi.cjs"),ve=require("./AxisTitle-sS5bLLR7.cjs"),Oe=require("./index-B_sAFsEV.cjs"),Ie=require("./time-CZd5YLSP.cjs"),je=require("./linear-BwPAspcq.cjs"),ye=require("./line-DHV4JwCR.cjs"),ce=require("./step-BZ3C8QFW.cjs"),Le=require("./select-Bnfk0lJx.cjs"),Se=require("./init-DU0ybBc_.cjs"),De=require("./pointer-Dkq5NV1q.cjs"),qe=require("./use-in-view-QcfiW0w3.cjs"),ct=require("./proxy-BxvUI_9l.cjs"),Me=require("./GraphFooter.cjs"),Te=require("./GraphHeader.cjs"),Ce=require("./ColorLegend.cjs"),Ae=require("./Colors.cjs"),Ve=require("./EmptyState-sAEZ_5rU.cjs"),we=require("./GraphContainer-d8A46BK2.cjs"),Fe=require("./getNoOfTicks-C_1CFXv_.cjs");function $e(e){const t=n.compilerRuntimeExports.c(117),{data:b,width:B,height:z,lineColors:o,labels:v,sameAxes:j,dateFormat:p,showValues:Rt,noOfXTicks:zt,rightMargin:Jt,leftMargin:Ft,topMargin:J,bottomMargin:bt,tooltip:ut,highlightAreaSettings:kt,onSeriesMouseOver:Nt,animate:s,strokeWidth:V,showDots:xt,noOfYTicks:mt,lineSuffixes:F,linePrefixes:K,minDate:pt,maxDate:Ot,curveType:Q,styles:a,classNames:c,precision:Z,customLayers:$,showAxisLabels:P}=e,$t=E.useRef(null);let ft;t[0]!==s.amount||t[1]!==s.once?(ft={once:s.once,amount:s.amount},t[0]=s.amount,t[1]=s.once,t[2]=ft):ft=t[2];const d=qe.useInView($t,ft),[y,Pt]=E.useState(!1);let dt,_;t[3]!==s.duration||t[4]!==y||t[5]!==d?(dt=()=>{if(d&&!y){const i=setTimeout(()=>{Pt(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(i)}},_=[d,y,s.duration],t[3]=s.duration,t[4]=y,t[5]=d,t[6]=dt,t[7]=_):(dt=t[6],_=t[7]),E.useEffect(dt,_);const Gt=Q==="linear"?ye.curveLinear:Q==="step"?ce.curveStep:Q==="stepAfter"?ce.stepAfter:Q==="stepBefore"?ce.stepBefore:ce.monotoneX,[k,It]=E.useState(void 0),[ht,f]=E.useState(void 0),[m,Ht]=E.useState(void 0),tt=Ft+50,Lt=Jt+65;let et;t[8]!==bt||t[9]!==tt||t[10]!==Lt||t[11]!==J?(et={top:J,bottom:bt,left:tt,right:Lt},t[8]=bt,t[9]=tt,t[10]=Lt,t[11]=J,t[12]=et):et=t[12];const h=et,G=E.useRef(null);let H;t[13]!==p?(H=i=>({...i,date:Vt.parse(`${i.date}`,p,new Date)}),t[13]=p,t[14]=H):H=t[14];const r=be.orderBy(b.map(H),["date"],["asc"]);let it;if(t[15]!==p||t[16]!==kt){let i;t[18]!==p?(i=w=>({...w,coordinates:[w.coordinates[0]===null?null:Vt.parse(`${w.coordinates[0]}`,p,new Date),w.coordinates[1]===null?null:Vt.parse(`${w.coordinates[1]}`,p,new Date)]}),t[18]=p,t[19]=i):i=t[19],it=kt.map(i),t[15]=p,t[16]=kt,t[17]=it}else it=t[17];const yt=it,u=B-h.left-h.right,l=z-h.top-h.bottom,Ut=pt?Vt.parse(`${pt}`,p,new Date):r[0].date,St=Ot?Vt.parse(`${Ot}`,p,new Date):r[r.length-1].date,gt=Math.min(...r.map(yi).filter(hi))!==1/0?Math.min(...r.map(di).filter(fi))>0?0:Math.min(...r.map(pi).filter(mi)):0,nt=Math.min(...r.map(xi).filter(ui))!==1/0?Math.min(...r.map(ci).filter(ai))>0?0:Math.min(...r.map(li).filter(ri)):0,st=Math.max(...r.map(oi).filter(si))!==1/0?Math.max(...r.map(ni).filter(ii)):0,U=Math.max(...r.map(ei).filter(ti))!==1/0?Math.max(...r.map(_e).filter(Ze)):0,Dt=gt<nt?gt:nt,W=st>U?st:U,x=Ie.time().domain([Ut,St]).range([0,u]),R=je.linear().domain([j?Dt:gt,j?W>0?W:0:st>0?st:0]).range([l,0]).nice(),g=je.linear().domain([j?Dt:nt,j?W>0?W:0:U>0?U:0]).range([l,0]).nice(),qt=ye.line().defined(Qe).x(i=>x(i.date)).y(i=>R(i.y1)).curve(Gt),vt=ye.line().defined(Ke).x(i=>x(i.date)).y(i=>g(i.y2)).curve(Gt),Wt=R.ticks(mt),Xt=g.ticks(mt),Mt=x.ticks(zt);E.useEffect(()=>{const i=de=>{const ge=r[Se.bisectCenter(r.map(Je),x.invert(De.pointer(de)[0]),0)];It(ge||r[r.length-1]),Nt?.(ge||r[r.length-1]),Ht(de.clientY),f(de.clientX)},w=()=>{It(void 0),f(void 0),Ht(void 0),Nt?.(void 0)};Le.select(G.current).on("mousemove",i).on("mouseout",w)},[x,r,Nt]);let ot;t[20]!==s||t[21]!==l||t[22]!==u||t[23]!==yt||t[24]!==d||t[25]!==x?(ot=n.jsxRuntimeExports.jsx(Oe.HighlightArea,{areaSettings:yt,width:u,height:l,scale:x,animate:s,isInView:d}),t[20]=s,t[21]=l,t[22]=u,t[23]=yt,t[24]=d,t[25]=x,t[26]=ot):ot=t[26];const jt=c?.xAxis?.axis;let S;t[27]!==jt?(S={axis:jt},t[27]=jt,t[28]=S):S=t[28];let N;t[29]!==a?.xAxis?.axis?(N=a?.xAxis?.axis||{},t[29]=a?.xAxis?.axis,t[30]=N):N=t[30];let D;t[31]!==o[0]||t[32]!==N?(D={axis:{stroke:o[0],...N}},t[31]=o[0],t[32]=N,t[33]=D):D=t[33];let rt;t[34]!==l||t[35]!==S||t[36]!==D?(rt=n.jsxRuntimeExports.jsx(he.Axis,{y1:0,y2:l,x1:-15,x2:-15,classNames:S,styles:D}),t[34]=l,t[35]=S,t[36]=D,t[37]=rt):rt=t[37];let q;t[38]!==c?.yAxis?.title||t[39]!==l||t[40]!==v||t[41]!==o[0]||t[42]!==h.left||t[43]!==P||t[44]!==a?.yAxis?.title?(q=P?n.jsxRuntimeExports.jsx(ve.AxisTitle,{x:10-h.left,y:l/2,style:{fill:o[0],...a?.yAxis?.title||{}},className:c?.yAxis?.title,text:v[0].length>100?`${v[0].substring(0,100)}...`:v[0],rotate90:!0}):null,t[38]=c?.yAxis?.title,t[39]=l,t[40]=v,t[41]=o[0],t[42]=h.left,t[43]=P,t[44]=a?.yAxis?.title,t[45]=q):q=t[45];const Yt=u+15,lt=u+15,Bt=c?.xAxis?.axis;let M;t[46]!==Bt?(M={axis:Bt},t[46]=Bt,t[47]=M):M=t[47];let X;t[48]!==a?.xAxis?.axis?(X=a?.xAxis?.axis||{},t[48]=a?.xAxis?.axis,t[49]=X):X=t[49];let O;t[50]!==o[1]||t[51]!==X?(O={axis:{stroke:o[1],...X}},t[50]=o[1],t[51]=X,t[52]=O):O=t[52];let Y;t[53]!==l||t[54]!==Yt||t[55]!==lt||t[56]!==M||t[57]!==O?(Y=n.jsxRuntimeExports.jsx(he.Axis,{y1:0,y2:l,x1:Yt,x2:lt,classNames:M,styles:O}),t[53]=l,t[54]=Yt,t[55]=lt,t[56]=M,t[57]=O,t[58]=Y):Y=t[58];let at;t[59]!==c?.yAxis?.title||t[60]!==l||t[61]!==u||t[62]!==v||t[63]!==o[1]||t[64]!==h.right||t[65]!==P||t[66]!==a?.yAxis?.title?(at=P?n.jsxRuntimeExports.jsx(ve.AxisTitle,{x:u+h.right-15,y:l/2,style:{fill:o[1],...a?.yAxis?.title||{}},className:c?.yAxis?.title,text:v[1].length>100?`${v[1].substring(0,100)}...`:v[1],rotate90:!0}):null,t[59]=c?.yAxis?.title,t[60]=l,t[61]=u,t[62]=v,t[63]=o[1],t[64]=h.right,t[65]=P,t[66]=a?.yAxis?.title,t[67]=at):at=t[67];const At=u+15,T=c?.xAxis?.axis;let A;t[68]!==T?(A={axis:T},t[68]=T,t[69]=A):A=t[69];const C=a?.xAxis?.axis;let I;t[70]!==C?(I={axis:C},t[70]=C,t[71]=I):I=t[71];let wt;t[72]!==l||t[73]!==At||t[74]!==A||t[75]!==I?(wt=n.jsxRuntimeExports.jsx(he.Axis,{y1:l,y2:l,x1:-15,x2:At,classNames:A,styles:I}),t[72]=l,t[73]=At,t[74]=A,t[75]=I,t[76]=wt):wt=t[76];let Et;t[77]!==p?(Et=i=>Vt.format(i,p),t[77]=p,t[78]=Et):Et=t[78];const Ee=Mt.map(Et),Re=Mt.map(i=>x(i)),ue=a?.xAxis?.gridLines,xe=a?.xAxis?.labels;let Kt;t[79]!==ue||t[80]!==xe?(Kt={gridLines:ue,labels:xe},t[79]=ue,t[80]=xe,t[81]=Kt):Kt=t[81];const me=c?.xAxis?.gridLines;let Tt;t[82]!==me?(Tt=n.mo("opacity-0",me),t[82]=me,t[83]=Tt):Tt=t[83];const pe=c?.xAxis?.labels;let Ct;t[84]!==pe?(Ct=n.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",pe),t[84]=pe,t[85]=Ct):Ct=t[85];let Qt;t[86]!==Tt||t[87]!==Ct?(Qt={gridLines:Tt,labels:Ct},t[86]=Tt,t[87]=Ct,t[88]=Qt):Qt=t[88];let Zt;t[89]!==$?(Zt=$.filter(ze).map(Be),t[89]=$,t[90]=Zt):Zt=t[90];let _t;t[91]!==o[0]||t[92]!==V?(_t={stroke:o[0],strokeWidth:V,fill:"none"},t[91]=o[0],t[92]=V,t[93]=_t):_t=t[93];let te;t[94]!==s.duration?(te={opacity:0,transition:{duration:s.duration}},t[94]=s.duration,t[95]=te):te=t[95];let ee;t[96]!==o[1]||t[97]!==V?(ee={stroke:o[1],strokeWidth:V,fill:"none"},t[96]=o[1],t[97]=V,t[98]=ee):ee=t[98];let ie;t[99]!==s.duration?(ie={opacity:0,transition:{duration:s.duration}},t[99]=s.duration,t[100]=ie):ie=t[100];const fe=r.map((i,w)=>n.jsxRuntimeExports.jsxs(ct.motion.g,{children:[L.checkIfNullOrUndefined(i.y1)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[xt?n.jsxRuntimeExports.jsx(ct.motion.circle,{r:u/r.length<5?0:u/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:x(i.date),cy:R(i.y1),fill:o[0]},whileInView:{opacity:1,fill:o[0],transition:{duration:y?s.duration:.5,delay:y?0:s.duration},cx:x(i.date),cy:R(i.y1)}},initial:"initial",animate:d?"whileInView":"initial"}):null,Rt?n.jsxRuntimeExports.jsx(ct.motion.text,{dy:L.checkIfNullOrUndefined(i.y2)||i.y2<i.y1?-8:"1em",style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:n.mo("graph-value graph-value-line-1 text-xs font-bold",c?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:x(i.date),y:g(i.y1),fill:o[0]},whileInView:{opacity:1,x:x(i.date),fill:o[0],y:g(i.y1),transition:{duration:y?s.duration:.5,delay:y?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:ae.numberFormattingFunction(i.y1,"NA",Z,K[0],F[0])}):null]}),L.checkIfNullOrUndefined(i.y2)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[xt?n.jsxRuntimeExports.jsx(ct.motion.circle,{r:u/r.length<5?0:u/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:x(i.date),cy:g(i.y2),fill:o[1]},whileInView:{opacity:1,transition:{duration:y?s.duration:.5,delay:y?0:s.duration},fill:o[1],cx:x(i.date),cy:g(i.y2)}},initial:"initial",animate:d?"whileInView":"initial"}):null,Rt?n.jsxRuntimeExports.jsx(ct.motion.text,{dy:L.checkIfNullOrUndefined(i.y1)||i.y1<i.y2?-8:"1em",style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:n.mo("graph-value graph-value-line-2 text-xs font-bold",c?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:x(i.date),y:g(i.y2),fill:o[1]},whileInView:{opacity:1,x:x(i.date),y:g(i.y2),fill:o[1],transition:{duration:y?s.duration:.5,delay:y?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:ae.numberFormattingFunction(i.y2,"NA",Z,K[1],F[1])}):null]})]},w));let ne;t[101]!==fe?(ne=n.jsxRuntimeExports.jsx("g",{children:fe}),t[101]=fe,t[102]=ne):ne=t[102];let se;t[103]!==$?(se=$.filter(Ge).map(Pe),t[103]=$,t[104]=se):se=t[104];let oe;t[105]===Symbol.for("react.memo_cache_sentinel")?(oe={fill:"none",pointerEvents:"all"},t[105]=oe):oe=t[105];let re;t[106]!==G||t[107]!==l||t[108]!==u?(re=n.jsxRuntimeExports.jsx("rect",{ref:G,style:oe,width:u,height:l}),t[106]=G,t[107]=l,t[108]=u,t[109]=re):re=t[109];let le;return t[110]!==c?.tooltip||t[111]!==ht||t[112]!==m||t[113]!==k||t[114]!==a?.tooltip||t[115]!==ut?(le=k&&ut&&ht&&m?n.jsxRuntimeExports.jsx(ke.Tooltip,{data:k,body:ut,xPos:ht,yPos:m,backgroundStyle:a?.tooltip,className:c?.tooltip}):null,t[110]=c?.tooltip,t[111]=ht,t[112]=m,t[113]=k,t[114]=a?.tooltip,t[115]=ut,t[116]=le):le=t[116],n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(ct.motion.svg,{width:`${B}px`,height:`${z}px`,viewBox:`0 0 ${B} ${z}`,direction:"ltr",ref:$t,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${h.left},${h.top})`,children:[ot,n.jsxRuntimeExports.jsxs("g",{children:[Wt.map((i,w)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{y1:R(i),y2:R(i),x1:-15,x2:-20,style:{stroke:o[0],strokeWidth:1,...a?.yAxis?.gridLines||{}},className:c?.yAxis?.gridLines}),n.jsxRuntimeExports.jsx("text",{x:-25,y:R(i),dy:"0.33em",className:n.mo("text-xs",c?.yAxis?.labels),style:{textAnchor:"end",fill:o[0],...a?.yAxis?.labels||{}},children:ae.numberFormattingFunction(i,"NA",Z,K[0],F[0])})]},w)),rt,q]}),n.jsxRuntimeExports.jsxs("g",{children:[Xt.map((i,w)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{y1:g(i),y2:g(i),x1:u+15,x2:u+20,style:{stroke:o[1],strokeWidth:1,...a?.yAxis?.gridLines||{}},className:c?.yAxis?.gridLines}),n.jsxRuntimeExports.jsx("text",{x:u+25,y:g(i),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:o[1],...a?.yAxis?.labels||{}},className:n.mo("text-xs",c?.yAxis?.labels),children:ae.numberFormattingFunction(i,"NA",Z,K[1],F[1])})]},w)),Y,at]}),n.jsxRuntimeExports.jsxs("g",{children:[wt,n.jsxRuntimeExports.jsx(Ne.XTicksAndGridLines,{values:Ee,x:Re,y1:0,y2:l,styles:Kt,classNames:Qt,labelType:"primary",showGridLines:!0,precision:Z})]}),Zt,n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx(ct.motion.path,{style:_t,exit:te,variants:{initial:{pathLength:0,d:qt(r.filter(Ye))||"",opacity:1},whileInView:{pathLength:1,d:qt(r.filter(Xe))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),n.jsxRuntimeExports.jsx(ct.motion.path,{d:vt(r.filter(We))||"",style:ee,exit:ie,variants:{initial:{pathLength:0,d:vt(r.filter(Ue))||"",opacity:1},whileInView:{pathLength:1,d:vt(r.filter(He))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),k?n.jsxRuntimeExports.jsx("line",{y1:0,y2:l,x1:x(k.date),x2:x(k.date),className:n.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",c?.mouseOverLine),style:a?.mouseOverLine}):null]}),ne,se,re]})}),le]})}function Pe(e){return e.layer}function Ge(e){return e.position==="after"}function He(e){return!L.checkIfNullOrUndefined(e.y2)}function Ue(e){return!L.checkIfNullOrUndefined(e.y2)}function We(e){return!L.checkIfNullOrUndefined(e.y2)}function Xe(e){return!L.checkIfNullOrUndefined(e.y1)}function Ye(e){return!L.checkIfNullOrUndefined(e.y1)}function Be(e){return e.layer}function ze(e){return e.position==="before"}function Je(e){return e.date}function Ke(e){return!L.checkIfNullOrUndefined(e.y2)}function Qe(e){return!L.checkIfNullOrUndefined(e.y1)}function Ze(e){return e!=null}function _e(e){return e.y2}function ti(e){return e!=null}function ei(e){return e.y2}function ii(e){return e!=null}function ni(e){return e.y1}function si(e){return e!=null}function oi(e){return e.y1}function ri(e){return e!=null}function li(e){return e.y2}function ai(e){return e!=null}function ci(e){return e.y2}function ui(e){return e!=null}function xi(e){return e.y2}function mi(e){return e!=null}function pi(e){return e.y1}function fi(e){return e!=null}function di(e){return e.y2}function hi(e){return e!=null}function yi(e){return e.y1}function gi(e){const t=n.compilerRuntimeExports.c(80),{data:b,graphTitle:B,sources:z,graphDescription:o,height:v,width:j,footNote:p,noOfXTicks:Rt,dateFormat:zt,showValues:Jt,padding:Ft,lineColors:J,sameAxes:bt,backgroundColor:ut,leftMargin:kt,rightMargin:Nt,topMargin:s,bottomMargin:V,labels:xt,lineSuffixes:mt,linePrefixes:F,tooltip:K,highlightAreaSettings:pt,relativeHeight:Ot,onSeriesMouseOver:Q,graphID:a,graphDownload:c,dataDownload:Z,animate:$,strokeWidth:P,showDots:$t,language:ft,showColorScale:d,minHeight:y,colorLegendTitle:Pt,theme:dt,ariaLabel:_,noOfYTicks:Gt,maxDate:k,minDate:It,curveType:ht,styles:f,classNames:m,precision:Ht,customLayers:tt,showAxisLabels:Lt}=e,et=zt===void 0?"yyyy":zt,h=Jt===void 0?!1:Jt;let G;t[0]!==J?(G=J===void 0?[Ae.Colors.light.categoricalColors.colors[0],Ae.Colors.light.categoricalColors.colors[1]]:J,t[0]=J,t[1]=G):G=t[1];const H=G,r=bt===void 0?!1:bt,it=ut===void 0?!1:ut,yt=kt===void 0?80:kt,u=Nt===void 0?80:Nt,l=s===void 0?20:s,Ut=V===void 0?25:V;let St;t[2]!==mt?(St=mt===void 0?["",""]:mt,t[2]=mt,t[3]=St):St=t[3];const gt=St;let nt;t[4]!==F?(nt=F===void 0?["",""]:F,t[4]=F,t[5]=nt):nt=t[5];const st=nt;let U;t[6]!==pt?(U=pt===void 0?[]:pt,t[6]=pt,t[7]=U):U=t[7];const Dt=U,W=c===void 0?!1:c,x=Z===void 0?!1:Z,R=$===void 0?!1:$,g=P===void 0?2:P,qt=$t===void 0?!0:$t,vt=ft===void 0?"en":ft,Wt=d===void 0?!0:d,Xt=y===void 0?0:y,Mt=dt===void 0?"light":dt,ot=Gt===void 0?5:Gt,jt=ht===void 0?"curve":ht,S=Ht===void 0?2:Ht;let N;t[8]!==tt?(N=tt===void 0?[]:tt,t[8]=tt,t[9]=N):N=t[9];const D=N,rt=Lt===void 0?!0:Lt,[q,Yt]=E.useState(0),[lt,Bt]=E.useState(0),M=E.useRef(null),X=E.useRef(null);let O,Y;t[10]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{const wt=new ResizeObserver(Et=>{Yt(Et[0].target.clientWidth||620),Bt(Et[0].target.clientHeight||480)});return M.current&&wt.observe(M.current),()=>wt.disconnect()},Y=[],t[10]=O,t[11]=Y):(O=t[10],Y=t[11]),E.useEffect(O,Y);const at=m?.graphContainer,At=f?.graphContainer;let T;t[12]!==m?.description||t[13]!==m?.title||t[14]!==b||t[15]!==x||t[16]!==o||t[17]!==W||t[18]!==B||t[19]!==f?.description||t[20]!==f?.title||t[21]!==j?(T=B||o||W||x?n.jsxRuntimeExports.jsx(Te.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:m?.title,description:m?.description},graphTitle:B,graphDescription:o,width:j,graphDownload:W?X:void 0,dataDownload:x?b.map(Ei).filter(wi).length>0?b.map(Ai).filter(ji):b.filter(vi):null}):null,t[12]=m?.description,t[13]=m?.title,t[14]=b,t[15]=x,t[16]=o,t[17]=W,t[18]=B,t[19]=f?.description,t[20]=f?.title,t[21]=j,t[22]=T):T=t[22];let A;t[23]!==R||t[24]!==Ut||t[25]!==m||t[26]!==Pt||t[27]!==jt||t[28]!==D||t[29]!==b||t[30]!==et||t[31]!==Dt||t[32]!==xt||t[33]!==yt||t[34]!==H||t[35]!==st||t[36]!==gt||t[37]!==k||t[38]!==It||t[39]!==Rt||t[40]!==ot||t[41]!==Q||t[42]!==S||t[43]!==u||t[44]!==r||t[45]!==rt||t[46]!==Wt||t[47]!==qt||t[48]!==h||t[49]!==g||t[50]!==f||t[51]!==lt||t[52]!==q||t[53]!==K||t[54]!==l?(A=b.length===0?n.jsxRuntimeExports.jsx(Ve.EmptyState,{}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[Wt?n.jsxRuntimeExports.jsx(Ce.ColorLegend,{colorDomain:xt,colorLegendTitle:Pt,colors:H,showNAColor:!1,className:m?.colorLegend}):null,n.jsxRuntimeExports.jsx(we.GraphArea,{ref:M,children:q&<?n.jsxRuntimeExports.jsx($e,{data:b,sameAxes:r,lineColors:H,width:q,height:lt,dateFormat:et,showValues:h,noOfXTicks:Rt??Fe.getNoOfTicks(q),leftMargin:yt,rightMargin:u,topMargin:l,bottomMargin:Ut,labels:xt,highlightAreaSettings:Dt,tooltip:K,onSeriesMouseOver:Q,animate:R===!0?{duration:.5,once:!0,amount:.5}:R||{duration:0,once:!0,amount:0},strokeWidth:g,showDots:qt,noOfYTicks:ot,lineSuffixes:gt,linePrefixes:st,minDate:It,maxDate:k,curveType:jt,styles:f,classNames:m,precision:S,customLayers:D,showAxisLabels:rt}):null})]}),t[23]=R,t[24]=Ut,t[25]=m,t[26]=Pt,t[27]=jt,t[28]=D,t[29]=b,t[30]=et,t[31]=Dt,t[32]=xt,t[33]=yt,t[34]=H,t[35]=st,t[36]=gt,t[37]=k,t[38]=It,t[39]=Rt,t[40]=ot,t[41]=Q,t[42]=S,t[43]=u,t[44]=r,t[45]=rt,t[46]=Wt,t[47]=qt,t[48]=h,t[49]=g,t[50]=f,t[51]=lt,t[52]=q,t[53]=K,t[54]=l,t[55]=A):A=t[55];let C;t[56]!==m?.footnote||t[57]!==m?.source||t[58]!==p||t[59]!==z||t[60]!==f?.footnote||t[61]!==f?.source||t[62]!==j?(C=z||p?n.jsxRuntimeExports.jsx(Me.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:z,footNote:p,width:j}):null,t[56]=m?.footnote,t[57]=m?.source,t[58]=p,t[59]=z,t[60]=f?.footnote,t[61]=f?.source,t[62]=j,t[63]=C):C=t[63];let I;return t[64]!==_||t[65]!==it||t[66]!==a||t[67]!==v||t[68]!==vt||t[69]!==Xt||t[70]!==Ft||t[71]!==Ot||t[72]!==at||t[73]!==At||t[74]!==T||t[75]!==A||t[76]!==C||t[77]!==Mt||t[78]!==j?(I=n.jsxRuntimeExports.jsxs(we.GraphContainer,{className:at,style:At,id:a,ref:X,"aria-label":_,backgroundColor:it,theme:Mt,language:vt,minHeight:Xt,width:j,height:v,relativeHeight:Ot,padding:Ft,children:[T,A,C]}),t[64]=_,t[65]=it,t[66]=a,t[67]=v,t[68]=vt,t[69]=Xt,t[70]=Ft,t[71]=Ot,t[72]=at,t[73]=At,t[74]=T,t[75]=A,t[76]=C,t[77]=Mt,t[78]=j,t[79]=I):I=t[79],I}function vi(e){return e!==void 0}function ji(e){return e!==void 0}function Ai(e){return e.data}function wi(e){return e!==void 0}function Ei(e){return e.data}exports.DualAxisLineChart=gi;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-CTPQjnHt.cjs"),E=require("react"),Vt=require("./parse-hMnG_lRV.cjs"),be=require("./index-Cno4Q0YE.cjs"),ae=require("./numberFormattingFunction-02t-wJta.cjs"),ke=require("./Tooltip-uUdw6wJL.cjs"),L=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ne=require("./XTicksAndGridLines-B6CELS7q.cjs"),he=require("./Axis-DxRV2yMi.cjs"),ve=require("./AxisTitle-sS5bLLR7.cjs"),Oe=require("./index-B_sAFsEV.cjs"),Ie=require("./time-CZd5YLSP.cjs"),je=require("./linear-BwPAspcq.cjs"),ye=require("./line-DaEMhXmx.cjs"),ce=require("./step-BZ3C8QFW.cjs"),Le=require("./select-Bnfk0lJx.cjs"),Se=require("./init-DU0ybBc_.cjs"),De=require("./pointer-Dkq5NV1q.cjs"),qe=require("./use-in-view-QcfiW0w3.cjs"),ct=require("./proxy-BxvUI_9l.cjs"),Me=require("./GraphFooter.cjs"),Te=require("./GraphHeader.cjs"),Ce=require("./ColorLegend.cjs"),Ae=require("./Colors.cjs"),Ve=require("./EmptyState-sAEZ_5rU.cjs"),we=require("./GraphContainer-d8A46BK2.cjs"),Fe=require("./getNoOfTicks-C_1CFXv_.cjs");function $e(e){const t=n.compilerRuntimeExports.c(117),{data:b,width:B,height:z,lineColors:o,labels:v,sameAxes:j,dateFormat:p,showValues:Rt,noOfXTicks:zt,rightMargin:Jt,leftMargin:Ft,topMargin:J,bottomMargin:bt,tooltip:ut,highlightAreaSettings:kt,onSeriesMouseOver:Nt,animate:s,strokeWidth:V,showDots:xt,noOfYTicks:mt,lineSuffixes:F,linePrefixes:K,minDate:pt,maxDate:Ot,curveType:Q,styles:a,classNames:c,precision:Z,customLayers:$,showAxisLabels:P}=e,$t=E.useRef(null);let ft;t[0]!==s.amount||t[1]!==s.once?(ft={once:s.once,amount:s.amount},t[0]=s.amount,t[1]=s.once,t[2]=ft):ft=t[2];const d=qe.useInView($t,ft),[y,Pt]=E.useState(!1);let dt,_;t[3]!==s.duration||t[4]!==y||t[5]!==d?(dt=()=>{if(d&&!y){const i=setTimeout(()=>{Pt(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(i)}},_=[d,y,s.duration],t[3]=s.duration,t[4]=y,t[5]=d,t[6]=dt,t[7]=_):(dt=t[6],_=t[7]),E.useEffect(dt,_);const Gt=Q==="linear"?ye.curveLinear:Q==="step"?ce.curveStep:Q==="stepAfter"?ce.stepAfter:Q==="stepBefore"?ce.stepBefore:ce.monotoneX,[k,It]=E.useState(void 0),[ht,f]=E.useState(void 0),[m,Ht]=E.useState(void 0),tt=Ft+50,Lt=Jt+65;let et;t[8]!==bt||t[9]!==tt||t[10]!==Lt||t[11]!==J?(et={top:J,bottom:bt,left:tt,right:Lt},t[8]=bt,t[9]=tt,t[10]=Lt,t[11]=J,t[12]=et):et=t[12];const h=et,G=E.useRef(null);let H;t[13]!==p?(H=i=>({...i,date:Vt.parse(`${i.date}`,p,new Date)}),t[13]=p,t[14]=H):H=t[14];const r=be.orderBy(b.map(H),["date"],["asc"]);let it;if(t[15]!==p||t[16]!==kt){let i;t[18]!==p?(i=w=>({...w,coordinates:[w.coordinates[0]===null?null:Vt.parse(`${w.coordinates[0]}`,p,new Date),w.coordinates[1]===null?null:Vt.parse(`${w.coordinates[1]}`,p,new Date)]}),t[18]=p,t[19]=i):i=t[19],it=kt.map(i),t[15]=p,t[16]=kt,t[17]=it}else it=t[17];const yt=it,u=B-h.left-h.right,l=z-h.top-h.bottom,Ut=pt?Vt.parse(`${pt}`,p,new Date):r[0].date,St=Ot?Vt.parse(`${Ot}`,p,new Date):r[r.length-1].date,gt=Math.min(...r.map(yi).filter(hi))!==1/0?Math.min(...r.map(di).filter(fi))>0?0:Math.min(...r.map(pi).filter(mi)):0,nt=Math.min(...r.map(xi).filter(ui))!==1/0?Math.min(...r.map(ci).filter(ai))>0?0:Math.min(...r.map(li).filter(ri)):0,st=Math.max(...r.map(oi).filter(si))!==1/0?Math.max(...r.map(ni).filter(ii)):0,U=Math.max(...r.map(ei).filter(ti))!==1/0?Math.max(...r.map(_e).filter(Ze)):0,Dt=gt<nt?gt:nt,W=st>U?st:U,x=Ie.time().domain([Ut,St]).range([0,u]),R=je.linear().domain([j?Dt:gt,j?W>0?W:0:st>0?st:0]).range([l,0]).nice(),g=je.linear().domain([j?Dt:nt,j?W>0?W:0:U>0?U:0]).range([l,0]).nice(),qt=ye.line().defined(Qe).x(i=>x(i.date)).y(i=>R(i.y1)).curve(Gt),vt=ye.line().defined(Ke).x(i=>x(i.date)).y(i=>g(i.y2)).curve(Gt),Wt=R.ticks(mt),Xt=g.ticks(mt),Mt=x.ticks(zt);E.useEffect(()=>{const i=de=>{const ge=r[Se.bisectCenter(r.map(Je),x.invert(De.pointer(de)[0]),0)];It(ge||r[r.length-1]),Nt?.(ge||r[r.length-1]),Ht(de.clientY),f(de.clientX)},w=()=>{It(void 0),f(void 0),Ht(void 0),Nt?.(void 0)};Le.select(G.current).on("mousemove",i).on("mouseout",w)},[x,r,Nt]);let ot;t[20]!==s||t[21]!==l||t[22]!==u||t[23]!==yt||t[24]!==d||t[25]!==x?(ot=n.jsxRuntimeExports.jsx(Oe.HighlightArea,{areaSettings:yt,width:u,height:l,scale:x,animate:s,isInView:d}),t[20]=s,t[21]=l,t[22]=u,t[23]=yt,t[24]=d,t[25]=x,t[26]=ot):ot=t[26];const jt=c?.xAxis?.axis;let S;t[27]!==jt?(S={axis:jt},t[27]=jt,t[28]=S):S=t[28];let N;t[29]!==a?.xAxis?.axis?(N=a?.xAxis?.axis||{},t[29]=a?.xAxis?.axis,t[30]=N):N=t[30];let D;t[31]!==o[0]||t[32]!==N?(D={axis:{stroke:o[0],...N}},t[31]=o[0],t[32]=N,t[33]=D):D=t[33];let rt;t[34]!==l||t[35]!==S||t[36]!==D?(rt=n.jsxRuntimeExports.jsx(he.Axis,{y1:0,y2:l,x1:-15,x2:-15,classNames:S,styles:D}),t[34]=l,t[35]=S,t[36]=D,t[37]=rt):rt=t[37];let q;t[38]!==c?.yAxis?.title||t[39]!==l||t[40]!==v||t[41]!==o[0]||t[42]!==h.left||t[43]!==P||t[44]!==a?.yAxis?.title?(q=P?n.jsxRuntimeExports.jsx(ve.AxisTitle,{x:10-h.left,y:l/2,style:{fill:o[0],...a?.yAxis?.title||{}},className:c?.yAxis?.title,text:v[0].length>100?`${v[0].substring(0,100)}...`:v[0],rotate90:!0}):null,t[38]=c?.yAxis?.title,t[39]=l,t[40]=v,t[41]=o[0],t[42]=h.left,t[43]=P,t[44]=a?.yAxis?.title,t[45]=q):q=t[45];const Yt=u+15,lt=u+15,Bt=c?.xAxis?.axis;let M;t[46]!==Bt?(M={axis:Bt},t[46]=Bt,t[47]=M):M=t[47];let X;t[48]!==a?.xAxis?.axis?(X=a?.xAxis?.axis||{},t[48]=a?.xAxis?.axis,t[49]=X):X=t[49];let O;t[50]!==o[1]||t[51]!==X?(O={axis:{stroke:o[1],...X}},t[50]=o[1],t[51]=X,t[52]=O):O=t[52];let Y;t[53]!==l||t[54]!==Yt||t[55]!==lt||t[56]!==M||t[57]!==O?(Y=n.jsxRuntimeExports.jsx(he.Axis,{y1:0,y2:l,x1:Yt,x2:lt,classNames:M,styles:O}),t[53]=l,t[54]=Yt,t[55]=lt,t[56]=M,t[57]=O,t[58]=Y):Y=t[58];let at;t[59]!==c?.yAxis?.title||t[60]!==l||t[61]!==u||t[62]!==v||t[63]!==o[1]||t[64]!==h.right||t[65]!==P||t[66]!==a?.yAxis?.title?(at=P?n.jsxRuntimeExports.jsx(ve.AxisTitle,{x:u+h.right-15,y:l/2,style:{fill:o[1],...a?.yAxis?.title||{}},className:c?.yAxis?.title,text:v[1].length>100?`${v[1].substring(0,100)}...`:v[1],rotate90:!0}):null,t[59]=c?.yAxis?.title,t[60]=l,t[61]=u,t[62]=v,t[63]=o[1],t[64]=h.right,t[65]=P,t[66]=a?.yAxis?.title,t[67]=at):at=t[67];const At=u+15,T=c?.xAxis?.axis;let A;t[68]!==T?(A={axis:T},t[68]=T,t[69]=A):A=t[69];const C=a?.xAxis?.axis;let I;t[70]!==C?(I={axis:C},t[70]=C,t[71]=I):I=t[71];let wt;t[72]!==l||t[73]!==At||t[74]!==A||t[75]!==I?(wt=n.jsxRuntimeExports.jsx(he.Axis,{y1:l,y2:l,x1:-15,x2:At,classNames:A,styles:I}),t[72]=l,t[73]=At,t[74]=A,t[75]=I,t[76]=wt):wt=t[76];let Et;t[77]!==p?(Et=i=>Vt.format(i,p),t[77]=p,t[78]=Et):Et=t[78];const Ee=Mt.map(Et),Re=Mt.map(i=>x(i)),ue=a?.xAxis?.gridLines,xe=a?.xAxis?.labels;let Kt;t[79]!==ue||t[80]!==xe?(Kt={gridLines:ue,labels:xe},t[79]=ue,t[80]=xe,t[81]=Kt):Kt=t[81];const me=c?.xAxis?.gridLines;let Tt;t[82]!==me?(Tt=n.mo("opacity-0",me),t[82]=me,t[83]=Tt):Tt=t[83];const pe=c?.xAxis?.labels;let Ct;t[84]!==pe?(Ct=n.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",pe),t[84]=pe,t[85]=Ct):Ct=t[85];let Qt;t[86]!==Tt||t[87]!==Ct?(Qt={gridLines:Tt,labels:Ct},t[86]=Tt,t[87]=Ct,t[88]=Qt):Qt=t[88];let Zt;t[89]!==$?(Zt=$.filter(ze).map(Be),t[89]=$,t[90]=Zt):Zt=t[90];let _t;t[91]!==o[0]||t[92]!==V?(_t={stroke:o[0],strokeWidth:V,fill:"none"},t[91]=o[0],t[92]=V,t[93]=_t):_t=t[93];let te;t[94]!==s.duration?(te={opacity:0,transition:{duration:s.duration}},t[94]=s.duration,t[95]=te):te=t[95];let ee;t[96]!==o[1]||t[97]!==V?(ee={stroke:o[1],strokeWidth:V,fill:"none"},t[96]=o[1],t[97]=V,t[98]=ee):ee=t[98];let ie;t[99]!==s.duration?(ie={opacity:0,transition:{duration:s.duration}},t[99]=s.duration,t[100]=ie):ie=t[100];const fe=r.map((i,w)=>n.jsxRuntimeExports.jsxs(ct.motion.g,{children:[L.checkIfNullOrUndefined(i.y1)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[xt?n.jsxRuntimeExports.jsx(ct.motion.circle,{r:u/r.length<5?0:u/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:x(i.date),cy:R(i.y1),fill:o[0]},whileInView:{opacity:1,fill:o[0],transition:{duration:y?s.duration:.5,delay:y?0:s.duration},cx:x(i.date),cy:R(i.y1)}},initial:"initial",animate:d?"whileInView":"initial"}):null,Rt?n.jsxRuntimeExports.jsx(ct.motion.text,{dy:L.checkIfNullOrUndefined(i.y2)||i.y2<i.y1?-8:"1em",style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:n.mo("graph-value graph-value-line-1 text-xs font-bold",c?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:x(i.date),y:g(i.y1),fill:o[0]},whileInView:{opacity:1,x:x(i.date),fill:o[0],y:g(i.y1),transition:{duration:y?s.duration:.5,delay:y?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:ae.numberFormattingFunction(i.y1,"NA",Z,K[0],F[0])}):null]}),L.checkIfNullOrUndefined(i.y2)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[xt?n.jsxRuntimeExports.jsx(ct.motion.circle,{r:u/r.length<5?0:u/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:x(i.date),cy:g(i.y2),fill:o[1]},whileInView:{opacity:1,transition:{duration:y?s.duration:.5,delay:y?0:s.duration},fill:o[1],cx:x(i.date),cy:g(i.y2)}},initial:"initial",animate:d?"whileInView":"initial"}):null,Rt?n.jsxRuntimeExports.jsx(ct.motion.text,{dy:L.checkIfNullOrUndefined(i.y1)||i.y1<i.y2?-8:"1em",style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:n.mo("graph-value graph-value-line-2 text-xs font-bold",c?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:x(i.date),y:g(i.y2),fill:o[1]},whileInView:{opacity:1,x:x(i.date),y:g(i.y2),fill:o[1],transition:{duration:y?s.duration:.5,delay:y?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:ae.numberFormattingFunction(i.y2,"NA",Z,K[1],F[1])}):null]})]},w));let ne;t[101]!==fe?(ne=n.jsxRuntimeExports.jsx("g",{children:fe}),t[101]=fe,t[102]=ne):ne=t[102];let se;t[103]!==$?(se=$.filter(Ge).map(Pe),t[103]=$,t[104]=se):se=t[104];let oe;t[105]===Symbol.for("react.memo_cache_sentinel")?(oe={fill:"none",pointerEvents:"all"},t[105]=oe):oe=t[105];let re;t[106]!==G||t[107]!==l||t[108]!==u?(re=n.jsxRuntimeExports.jsx("rect",{ref:G,style:oe,width:u,height:l}),t[106]=G,t[107]=l,t[108]=u,t[109]=re):re=t[109];let le;return t[110]!==c?.tooltip||t[111]!==ht||t[112]!==m||t[113]!==k||t[114]!==a?.tooltip||t[115]!==ut?(le=k&&ut&&ht&&m?n.jsxRuntimeExports.jsx(ke.Tooltip,{data:k,body:ut,xPos:ht,yPos:m,backgroundStyle:a?.tooltip,className:c?.tooltip}):null,t[110]=c?.tooltip,t[111]=ht,t[112]=m,t[113]=k,t[114]=a?.tooltip,t[115]=ut,t[116]=le):le=t[116],n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(ct.motion.svg,{width:`${B}px`,height:`${z}px`,viewBox:`0 0 ${B} ${z}`,direction:"ltr",ref:$t,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${h.left},${h.top})`,children:[ot,n.jsxRuntimeExports.jsxs("g",{children:[Wt.map((i,w)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{y1:R(i),y2:R(i),x1:-15,x2:-20,style:{stroke:o[0],strokeWidth:1,...a?.yAxis?.gridLines||{}},className:c?.yAxis?.gridLines}),n.jsxRuntimeExports.jsx("text",{x:-25,y:R(i),dy:"0.33em",className:n.mo("text-xs",c?.yAxis?.labels),style:{textAnchor:"end",fill:o[0],...a?.yAxis?.labels||{}},children:ae.numberFormattingFunction(i,"NA",Z,K[0],F[0])})]},w)),rt,q]}),n.jsxRuntimeExports.jsxs("g",{children:[Xt.map((i,w)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{y1:g(i),y2:g(i),x1:u+15,x2:u+20,style:{stroke:o[1],strokeWidth:1,...a?.yAxis?.gridLines||{}},className:c?.yAxis?.gridLines}),n.jsxRuntimeExports.jsx("text",{x:u+25,y:g(i),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:o[1],...a?.yAxis?.labels||{}},className:n.mo("text-xs",c?.yAxis?.labels),children:ae.numberFormattingFunction(i,"NA",Z,K[1],F[1])})]},w)),Y,at]}),n.jsxRuntimeExports.jsxs("g",{children:[wt,n.jsxRuntimeExports.jsx(Ne.XTicksAndGridLines,{values:Ee,x:Re,y1:0,y2:l,styles:Kt,classNames:Qt,labelType:"primary",showGridLines:!0,precision:Z})]}),Zt,n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx(ct.motion.path,{style:_t,exit:te,variants:{initial:{pathLength:0,d:qt(r.filter(Ye))||"",opacity:1},whileInView:{pathLength:1,d:qt(r.filter(Xe))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),n.jsxRuntimeExports.jsx(ct.motion.path,{d:vt(r.filter(We))||"",style:ee,exit:ie,variants:{initial:{pathLength:0,d:vt(r.filter(Ue))||"",opacity:1},whileInView:{pathLength:1,d:vt(r.filter(He))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),k?n.jsxRuntimeExports.jsx("line",{y1:0,y2:l,x1:x(k.date),x2:x(k.date),className:n.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",c?.mouseOverLine),style:a?.mouseOverLine}):null]}),ne,se,re]})}),le]})}function Pe(e){return e.layer}function Ge(e){return e.position==="after"}function He(e){return!L.checkIfNullOrUndefined(e.y2)}function Ue(e){return!L.checkIfNullOrUndefined(e.y2)}function We(e){return!L.checkIfNullOrUndefined(e.y2)}function Xe(e){return!L.checkIfNullOrUndefined(e.y1)}function Ye(e){return!L.checkIfNullOrUndefined(e.y1)}function Be(e){return e.layer}function ze(e){return e.position==="before"}function Je(e){return e.date}function Ke(e){return!L.checkIfNullOrUndefined(e.y2)}function Qe(e){return!L.checkIfNullOrUndefined(e.y1)}function Ze(e){return e!=null}function _e(e){return e.y2}function ti(e){return e!=null}function ei(e){return e.y2}function ii(e){return e!=null}function ni(e){return e.y1}function si(e){return e!=null}function oi(e){return e.y1}function ri(e){return e!=null}function li(e){return e.y2}function ai(e){return e!=null}function ci(e){return e.y2}function ui(e){return e!=null}function xi(e){return e.y2}function mi(e){return e!=null}function pi(e){return e.y1}function fi(e){return e!=null}function di(e){return e.y2}function hi(e){return e!=null}function yi(e){return e.y1}function gi(e){const t=n.compilerRuntimeExports.c(80),{data:b,graphTitle:B,sources:z,graphDescription:o,height:v,width:j,footNote:p,noOfXTicks:Rt,dateFormat:zt,showValues:Jt,padding:Ft,lineColors:J,sameAxes:bt,backgroundColor:ut,leftMargin:kt,rightMargin:Nt,topMargin:s,bottomMargin:V,labels:xt,lineSuffixes:mt,linePrefixes:F,tooltip:K,highlightAreaSettings:pt,relativeHeight:Ot,onSeriesMouseOver:Q,graphID:a,graphDownload:c,dataDownload:Z,animate:$,strokeWidth:P,showDots:$t,language:ft,showColorScale:d,minHeight:y,colorLegendTitle:Pt,theme:dt,ariaLabel:_,noOfYTicks:Gt,maxDate:k,minDate:It,curveType:ht,styles:f,classNames:m,precision:Ht,customLayers:tt,showAxisLabels:Lt}=e,et=zt===void 0?"yyyy":zt,h=Jt===void 0?!1:Jt;let G;t[0]!==J?(G=J===void 0?[Ae.Colors.light.categoricalColors.colors[0],Ae.Colors.light.categoricalColors.colors[1]]:J,t[0]=J,t[1]=G):G=t[1];const H=G,r=bt===void 0?!1:bt,it=ut===void 0?!1:ut,yt=kt===void 0?80:kt,u=Nt===void 0?80:Nt,l=s===void 0?20:s,Ut=V===void 0?25:V;let St;t[2]!==mt?(St=mt===void 0?["",""]:mt,t[2]=mt,t[3]=St):St=t[3];const gt=St;let nt;t[4]!==F?(nt=F===void 0?["",""]:F,t[4]=F,t[5]=nt):nt=t[5];const st=nt;let U;t[6]!==pt?(U=pt===void 0?[]:pt,t[6]=pt,t[7]=U):U=t[7];const Dt=U,W=c===void 0?!1:c,x=Z===void 0?!1:Z,R=$===void 0?!1:$,g=P===void 0?2:P,qt=$t===void 0?!0:$t,vt=ft===void 0?"en":ft,Wt=d===void 0?!0:d,Xt=y===void 0?0:y,Mt=dt===void 0?"light":dt,ot=Gt===void 0?5:Gt,jt=ht===void 0?"curve":ht,S=Ht===void 0?2:Ht;let N;t[8]!==tt?(N=tt===void 0?[]:tt,t[8]=tt,t[9]=N):N=t[9];const D=N,rt=Lt===void 0?!0:Lt,[q,Yt]=E.useState(0),[lt,Bt]=E.useState(0),M=E.useRef(null),X=E.useRef(null);let O,Y;t[10]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{const wt=new ResizeObserver(Et=>{Yt(Et[0].target.clientWidth||620),Bt(Et[0].target.clientHeight||480)});return M.current&&wt.observe(M.current),()=>wt.disconnect()},Y=[],t[10]=O,t[11]=Y):(O=t[10],Y=t[11]),E.useEffect(O,Y);const at=m?.graphContainer,At=f?.graphContainer;let T;t[12]!==m?.description||t[13]!==m?.title||t[14]!==b||t[15]!==x||t[16]!==o||t[17]!==W||t[18]!==B||t[19]!==f?.description||t[20]!==f?.title||t[21]!==j?(T=B||o||W||x?n.jsxRuntimeExports.jsx(Te.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:m?.title,description:m?.description},graphTitle:B,graphDescription:o,width:j,graphDownload:W?X:void 0,dataDownload:x?b.map(Ei).filter(wi).length>0?b.map(Ai).filter(ji):b.filter(vi):null}):null,t[12]=m?.description,t[13]=m?.title,t[14]=b,t[15]=x,t[16]=o,t[17]=W,t[18]=B,t[19]=f?.description,t[20]=f?.title,t[21]=j,t[22]=T):T=t[22];let A;t[23]!==R||t[24]!==Ut||t[25]!==m||t[26]!==Pt||t[27]!==jt||t[28]!==D||t[29]!==b||t[30]!==et||t[31]!==Dt||t[32]!==xt||t[33]!==yt||t[34]!==H||t[35]!==st||t[36]!==gt||t[37]!==k||t[38]!==It||t[39]!==Rt||t[40]!==ot||t[41]!==Q||t[42]!==S||t[43]!==u||t[44]!==r||t[45]!==rt||t[46]!==Wt||t[47]!==qt||t[48]!==h||t[49]!==g||t[50]!==f||t[51]!==lt||t[52]!==q||t[53]!==K||t[54]!==l?(A=b.length===0?n.jsxRuntimeExports.jsx(Ve.EmptyState,{}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[Wt?n.jsxRuntimeExports.jsx(Ce.ColorLegend,{colorDomain:xt,colorLegendTitle:Pt,colors:H,showNAColor:!1,className:m?.colorLegend}):null,n.jsxRuntimeExports.jsx(we.GraphArea,{ref:M,children:q&<?n.jsxRuntimeExports.jsx($e,{data:b,sameAxes:r,lineColors:H,width:q,height:lt,dateFormat:et,showValues:h,noOfXTicks:Rt??Fe.getNoOfTicks(q),leftMargin:yt,rightMargin:u,topMargin:l,bottomMargin:Ut,labels:xt,highlightAreaSettings:Dt,tooltip:K,onSeriesMouseOver:Q,animate:R===!0?{duration:.5,once:!0,amount:.5}:R||{duration:0,once:!0,amount:0},strokeWidth:g,showDots:qt,noOfYTicks:ot,lineSuffixes:gt,linePrefixes:st,minDate:It,maxDate:k,curveType:jt,styles:f,classNames:m,precision:S,customLayers:D,showAxisLabels:rt}):null})]}),t[23]=R,t[24]=Ut,t[25]=m,t[26]=Pt,t[27]=jt,t[28]=D,t[29]=b,t[30]=et,t[31]=Dt,t[32]=xt,t[33]=yt,t[34]=H,t[35]=st,t[36]=gt,t[37]=k,t[38]=It,t[39]=Rt,t[40]=ot,t[41]=Q,t[42]=S,t[43]=u,t[44]=r,t[45]=rt,t[46]=Wt,t[47]=qt,t[48]=h,t[49]=g,t[50]=f,t[51]=lt,t[52]=q,t[53]=K,t[54]=l,t[55]=A):A=t[55];let C;t[56]!==m?.footnote||t[57]!==m?.source||t[58]!==p||t[59]!==z||t[60]!==f?.footnote||t[61]!==f?.source||t[62]!==j?(C=z||p?n.jsxRuntimeExports.jsx(Me.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:z,footNote:p,width:j}):null,t[56]=m?.footnote,t[57]=m?.source,t[58]=p,t[59]=z,t[60]=f?.footnote,t[61]=f?.source,t[62]=j,t[63]=C):C=t[63];let I;return t[64]!==_||t[65]!==it||t[66]!==a||t[67]!==v||t[68]!==vt||t[69]!==Xt||t[70]!==Ft||t[71]!==Ot||t[72]!==at||t[73]!==At||t[74]!==T||t[75]!==A||t[76]!==C||t[77]!==Mt||t[78]!==j?(I=n.jsxRuntimeExports.jsxs(we.GraphContainer,{className:at,style:At,id:a,ref:X,"aria-label":_,backgroundColor:it,theme:Mt,language:vt,minHeight:Xt,width:j,height:v,relativeHeight:Ot,padding:Ft,children:[T,A,C]}),t[64]=_,t[65]=it,t[66]=a,t[67]=v,t[68]=vt,t[69]=Xt,t[70]=Ft,t[71]=Ot,t[72]=at,t[73]=At,t[74]=T,t[75]=A,t[76]=C,t[77]=Mt,t[78]=j,t[79]=I):I=t[79],I}function vi(e){return e!==void 0}function ji(e){return e!==void 0}function Ai(e){return e.data}function wi(e){return e!==void 0}function Ei(e){return e.data}exports.DualAxisLineChart=gi;
|
|
2
2
|
//# sourceMappingURL=DualAxisLineChart.cjs.map
|
|
@@ -11,7 +11,7 @@ import { A as Ae } from "./AxisTitle-jeI7am8o.js";
|
|
|
11
11
|
import { H as Te } from "./index-SKgJALZg.js";
|
|
12
12
|
import { t as Ve } from "./time-BUL-dwnK.js";
|
|
13
13
|
import { a as we } from "./linear-BqltdMeF.js";
|
|
14
|
-
import { l as je, c as Ie } from "./line-
|
|
14
|
+
import { l as je, c as Ie } from "./line-DFlZsxI1.js";
|
|
15
15
|
import { c as $e, s as Ce, a as Fe, m as Pe } from "./step-BrDul-H4.js";
|
|
16
16
|
import { s as He } from "./select-DKy99ogv.js";
|
|
17
17
|
import { a as We } from "./init-BhZylTFx.js";
|
package/dist/DumbbellChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),Ee=require("./index-Cno4Q0YE.cjs"),je=require("./parse-hMnG_lRV.cjs"),T=require("react"),Oe=require("./getSliderMarks-BmADcPQt.cjs"),Me=require("./index-DQA8q5sC.cjs"),ke=require("./numberFormattingFunction-02t-wJta.cjs"),Ie=require("./Tooltip-uUdw6wJL.cjs"),qt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Le=require("./AxisTitle-sS5bLLR7.cjs"),Fe=require("./Axis-DxRV2yMi.cjs"),Pe=require("./XAxesLabels-Bt5NZBmX.cjs"),$e=require("./YTicksAndGridLines-4pxTRlRK.cjs"),Ne=require("./ReferenceLine-BH0qdf4R.cjs"),We=require("./XTicksAndGridLines-B6CELS7q.cjs"),Ge=require("./YAxesLabels-DesLesUP.cjs"),Ve=require("./DetailsModal-BN0HDFlV.cjs"),De=require("./linear-BwPAspcq.cjs"),Se=require("./band-VYfcZeJ2.cjs"),Te=require("./use-in-view-QcfiW0w3.cjs"),Tt=require("./proxy-BxvUI_9l.cjs"),qe=require("./index-DG2bgAva.cjs"),Ae=require("./ensureCompleteData-Oib-vGb0.cjs"),Re=require("./GraphContainer-d8A46BK2.cjs"),Be=require("./GraphHeader.cjs"),Ce=require("./index-DRXx7m-C.cjs"),Ye=require("./GraphFooter.cjs"),Xe=require("./ColorLegendWithMouseOver.cjs"),He=require("./EmptyState-sAEZ_5rU.cjs"),Ue=require("./Colors.cjs");function ze(e){const t=i.compilerRuntimeExports.c(146),{data:d,leftMargin:Jt,rightMargin:se,topMargin:Kt,bottomMargin:Qt,dotColors:k,barPadding:Ft,showTicks:Mt,truncateBy:It,width:wt,height:jt,radius:ht,showLabels:At,tooltip:g,onSeriesMouseOver:at,maxValue:Lt,minValue:E,onSeriesMouseClick:ct,showValues:Zt,suffix:ft,prefix:q,selectedColor:F,arrowConnector:L,connectorStrokeWidth:Pt,maxBarThickness:kt,minBarThickness:$t,resetSelectionOnDoubleClick:_t,detailsOnClick:O,axisTitle:P,noOfTicks:Wt,valueColor:Nt,styles:s,classNames:n,labelOrder:y,refValues:Vt,animate:p,precision:m,customLayers:X,highlightedDataPoints:W,dimmedOpacity:ut}=e,b=Jt===void 0?20:Jt,Gt=se===void 0?20:se,Bt=Kt===void 0?20:Kt,Dt=Qt===void 0?25:Qt,te=T.useRef(null);let Yt;t[0]!==p.amount||t[1]!==p.once?(Yt={once:p.once,amount:p.amount},t[0]=p.amount,t[1]=p.once,t[2]=Yt):Yt=t[2];const H=Te.useInView(te,Yt),U=P?b+30:b;let Xt;t[3]!==Dt||t[4]!==Gt||t[5]!==U||t[6]!==Bt?(Xt={top:Bt,bottom:Dt,left:U,right:Gt},t[3]=Dt,t[4]=Gt,t[5]=U,t[6]=Bt,t[7]=Xt):Xt=t[7];const l=Xt,o=wt-l.left-l.right,rt=jt-l.top-l.bottom,[lt,Ht]=T.useState(void 0),[yt,gt]=T.useState(void 0),[Ut,Et]=T.useState(void 0),[Ot,zt]=T.useState(void 0);let Rt;if(t[8]!==d||t[9]!==y){const f=new Set,h=d.map((v,w)=>{const a=y?`${v.label}`:`${w}`;return f.add(a),{...v,id:a}}),M=y?y.filter(v=>!f.has(v)):[];let mt;t[11]!==d[0]?(mt=v=>({id:v,label:v,x:Array(d[0].x.length).fill(null)}),t[11]=d[0],t[12]=mt):mt=t[12],Rt=[...h,...M.map(mt)],t[8]=d,t[9]=y,t[10]=Rt}else Rt=t[10];const G=Rt;let $;t[13]!==G||t[14]!==y?($=y??G.map(oi),t[13]=G,t[14]=y,t[15]=$):$=t[15];const St=$;let bt,z,J,K,Q,Z,j,R,C,_,tt,et,A,N,V;if(t[16]!==p||t[17]!==L||t[18]!==P||t[19]!==St||t[20]!==Ft||t[21]!==n?.dataConnectors||t[22]!==n?.graphObjectValues||t[23]!==n?.xAxis?.axis||t[24]!==n?.xAxis?.labels||t[25]!==n?.yAxis?.gridLines||t[26]!==n?.yAxis?.labels||t[27]!==n?.yAxis?.title||t[28]!==Pt||t[29]!==X||t[30]!==G||t[31]!==O||t[32]!==ut||t[33]!==k||t[34]!==rt||t[35]!==o||t[36]!==jt||t[37]!==W||t[38]!==H||t[39]!==b||t[40]!==l.bottom||t[41]!==l.left||t[42]!==l.right||t[43]!==l.top||t[44]!==kt||t[45]!==Lt||t[46]!==$t||t[47]!==E||t[48]!==yt||t[49]!==Wt||t[50]!==ct||t[51]!==at||t[52]!==m||t[53]!==q||t[54]!==ht||t[55]!==Vt||t[56]!==_t||t[57]!==F||t[58]!==At||t[59]!==Mt||t[60]!==Zt||t[61]!==s?.dataConnectors||t[62]!==s?.graphObjectValues||t[63]!==s?.xAxis?.axis||t[64]!==s?.xAxis?.labels||t[65]!==s?.yAxis?.gridLines||t[66]!==s?.yAxis?.labels||t[67]!==s?.yAxis?.title||t[68]!==ft||t[69]!==It||t[70]!==Nt||t[71]!==wt){const f=De.linear().domain([E,Lt]).range([rt,0]).nice(),h=Se.band().domain(St).range([0,$t?Math.max(o,$t*G.length):kt?Math.min(o,kt*G.length):o]).paddingInner(Ft),M=f.ticks(Wt);z=Tt.motion.svg,C=`${wt}px`,_=`${jt}px`,tt=`0 0 ${wt} ${jt}`,et="ltr",A=te,t[87]!==L?(N=L?i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:i.jsxRuntimeExports.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,t[87]=L,t[88]=N):N=t[88],K=`translate(${l.left},${l.top})`;const mt=f(E<0?0:E),v=f(E<0?0:E),w=E<0?0:E;let a;t[89]!==m||t[90]!==q||t[91]!==ft||t[92]!==w?(a=ke.numberFormattingFunction(w,"NA",m,q,ft),t[89]=m,t[90]=q,t[91]=ft,t[92]=w,t[93]=a):a=t[93];const pt=n?.xAxis?.axis,ie=n?.yAxis?.labels;let vt;t[94]!==pt||t[95]!==ie?(vt={axis:pt,label:ie},t[94]=pt,t[95]=ie,t[96]=vt):vt=t[96];const ne=s?.xAxis?.axis,Y=s?.yAxis?.labels;let c;t[97]!==ne||t[98]!==Y?(c={axis:ne,label:Y},t[97]=ne,t[98]=Y,t[99]=c):c=t[99],Q=i.jsxRuntimeExports.jsx(Fe.Axis,{y1:mt,y2:v,x1:0-b,x2:o+l.right,label:a,labelPos:{x:0-b,dx:0,dy:Lt<0?"1em":-5,y:f(E<0?0:E)},classNames:vt,styles:c}),Z=Mt?i.jsxRuntimeExports.jsx($e.YTicksAndGridLines,{values:M.filter(si),y:M.filter(ni).map(x=>f(x)),x1:0-b,x2:o+l.right,styles:{gridLines:s?.yAxis?.gridLines,labels:s?.yAxis?.labels},classNames:{gridLines:n?.yAxis?.gridLines,labels:n?.yAxis?.labels},suffix:ft,prefix:q,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:m}):null;const S=0-b-15,r=rt/2,I=s?.yAxis?.title,ae=n?.yAxis?.title;t[100]!==P||t[101]!==S||t[102]!==r||t[103]!==I||t[104]!==ae?(j=i.jsxRuntimeExports.jsx(Le.AxisTitle,{x:S,y:r,style:I,className:ae,text:P,rotate90:!0}),t[100]=P,t[101]=S,t[102]=r,t[103]=I,t[104]=ae,t[105]=j):j=t[105],t[106]!==X?(R=X.filter(ii).map(ei),t[106]=X,t[107]=R):R=t[107],bt=qe.AnimatePresence,V=G.map(x=>i.jsxRuntimeExports.jsxs(Tt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:h(`${x.id}`)+h.bandwidth()/2,y:0,opacity:W.length!==0?W.indexOf(x.label)!==-1?.85:ut:.85},whileInView:{x:h(`${x.id}`)+h.bandwidth()/2,y:0,opacity:W.length!==0?W.indexOf(x.label)!==-1?.85:ut:.85,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial",exit:{opacity:0,transition:{duration:p.duration}},children:[At?i.jsxRuntimeExports.jsx(Pe.XAxesLabels,{value:`${x.label}`.length<It?`${x.label}`:`${`${x.label}`.substring(0,It)}...`,y:rt+5,x:0-h.bandwidth()/2,width:h.bandwidth(),height:l.bottom,style:s?.xAxis?.labels,className:n?.xAxis?.labels,alignment:"top",animate:p,isInView:H}):null,i.jsxRuntimeExports.jsx(Tt.motion.line,{x1:0,x2:0,style:{strokeWidth:Pt,...s?.dataConnectors||{},opacity:F?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",n?.dataConnectors),markerEnd:L&&x.x.indexOf(Math.min(...x.x.filter(ti)))===0?"url(#arrow)":"",markerStart:L&&x.x.indexOf(Math.min(...x.x.filter(_e)))===x.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{y1:0,y2:0},whileInView:{y1:f(Math.min(...x.x.filter(Ze)))+ht,y2:f(Math.max(...x.x.filter(Qe)))-ht,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial"}),x.x.map((ee,ot)=>i.jsxRuntimeExports.jsx(Tt.motion.g,{onMouseEnter:oe=>{Ht({...x,xIndex:ot}),zt(oe.clientY),Et(oe.clientX),at?.({...x,xIndex:ot})},onClick:()=>{(ct||O)&&(Me.isEqual(yt,{...x,xIndex:ot})&&_t?(gt(void 0),ct?.(void 0)):(gt({...x,xIndex:ot}),ct&&ct({...x,xIndex:ot})))},onMouseMove:oe=>{Ht({...x,xIndex:ot}),zt(oe.clientY),Et(oe.clientX)},onMouseLeave:()=>{Ht(void 0),Et(void 0),zt(void 0),at?.(void 0)},exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{opacity:F?k[ot]===F?1:.3:1},whileInView:{opacity:F?k[ot]===F?1:.3:1,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial",children:qt.checkIfNullOrUndefined(ee)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Tt.motion.circle,{cx:0,r:ht,style:{fill:k[ot],fillOpacity:.85,stroke:k[ot],strokeWidth:1},exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{cy:f(0),opacity:0},whileInView:{cy:f(ee||0),opacity:qt.checkIfNullOrUndefined(ee)?0:1,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial"}),Zt?i.jsxRuntimeExports.jsx(Tt.motion.text,{x:0,style:{textAnchor:"start",...s?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",qt.checkIfNullOrUndefined(ee)?"opacity-0":"opacity-100",n?.graphObjectValues),dx:ht+3,dy:"0.33em",exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{y:f(0),opacity:0,fill:Nt||k[ot]},whileInView:{y:f(ee||0),fill:Nt||k[ot],opacity:1,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial",children:ke.numberFormattingFunction(ee,"NA",m,q,ft)}):null]})},ot))]},x.label)),J=Vt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:Vt.map((x,ee)=>i.jsxRuntimeExports.jsx(Ne.RefLineY,{text:x.text,color:x.color,y:f(x.value),x1:0-b,x2:o+l.right,classNames:x.classNames,styles:x.styles,animate:p,isInView:H},ee))}):null,t[16]=p,t[17]=L,t[18]=P,t[19]=St,t[20]=Ft,t[21]=n?.dataConnectors,t[22]=n?.graphObjectValues,t[23]=n?.xAxis?.axis,t[24]=n?.xAxis?.labels,t[25]=n?.yAxis?.gridLines,t[26]=n?.yAxis?.labels,t[27]=n?.yAxis?.title,t[28]=Pt,t[29]=X,t[30]=G,t[31]=O,t[32]=ut,t[33]=k,t[34]=rt,t[35]=o,t[36]=jt,t[37]=W,t[38]=H,t[39]=b,t[40]=l.bottom,t[41]=l.left,t[42]=l.right,t[43]=l.top,t[44]=kt,t[45]=Lt,t[46]=$t,t[47]=E,t[48]=yt,t[49]=Wt,t[50]=ct,t[51]=at,t[52]=m,t[53]=q,t[54]=ht,t[55]=Vt,t[56]=_t,t[57]=F,t[58]=At,t[59]=Mt,t[60]=Zt,t[61]=s?.dataConnectors,t[62]=s?.graphObjectValues,t[63]=s?.xAxis?.axis,t[64]=s?.xAxis?.labels,t[65]=s?.yAxis?.gridLines,t[66]=s?.yAxis?.labels,t[67]=s?.yAxis?.title,t[68]=ft,t[69]=It,t[70]=Nt,t[71]=wt,t[72]=bt,t[73]=z,t[74]=J,t[75]=K,t[76]=Q,t[77]=Z,t[78]=j,t[79]=R,t[80]=C,t[81]=_,t[82]=tt,t[83]=et,t[84]=A,t[85]=N,t[86]=V}else bt=t[72],z=t[73],J=t[74],K=t[75],Q=t[76],Z=t[77],j=t[78],R=t[79],C=t[80],_=t[81],tt=t[82],et=t[83],A=t[84],N=t[85],V=t[86];let it;t[108]!==bt||t[109]!==J||t[110]!==V?(it=i.jsxRuntimeExports.jsxs(bt,{children:[V,J]}),t[108]=bt,t[109]=J,t[110]=V,t[111]=it):it=t[111];let nt;t[112]!==X?(nt=X.filter(Ke).map(Je),t[112]=X,t[113]=nt):nt=t[113];let xt;t[114]!==K||t[115]!==Q||t[116]!==Z||t[117]!==j||t[118]!==R||t[119]!==it||t[120]!==nt?(xt=i.jsxRuntimeExports.jsxs("g",{transform:K,children:[Q,Z,j,R,it,nt]}),t[114]=K,t[115]=Q,t[116]=Z,t[117]=j,t[118]=R,t[119]=it,t[120]=nt,t[121]=xt):xt=t[121];let D;t[122]!==z||t[123]!==C||t[124]!==_||t[125]!==tt||t[126]!==et||t[127]!==A||t[128]!==N||t[129]!==xt?(D=i.jsxRuntimeExports.jsxs(z,{width:C,height:_,viewBox:tt,direction:et,ref:A,children:[N,xt]}),t[122]=z,t[123]=C,t[124]=_,t[125]=tt,t[126]=et,t[127]=A,t[128]=N,t[129]=xt,t[130]=D):D=t[130];let B;t[131]!==n?.tooltip||t[132]!==Ut||t[133]!==Ot||t[134]!==lt||t[135]!==s?.tooltip||t[136]!==g?(B=lt&&g&&Ut&&Ot?i.jsxRuntimeExports.jsx(Ie.Tooltip,{data:lt,body:g,xPos:Ut,yPos:Ot,backgroundStyle:s?.tooltip,className:n?.tooltip}):null,t[131]=n?.tooltip,t[132]=Ut,t[133]=Ot,t[134]=lt,t[135]=s?.tooltip,t[136]=g,t[137]=B):B=t[137];let st;t[138]!==n?.modal||t[139]!==O||t[140]!==yt?(st=O&&yt!==void 0?i.jsxRuntimeExports.jsx(Ve.DetailsModal,{body:O,data:yt,setData:gt,className:n?.modal}):null,t[138]=n?.modal,t[139]=O,t[140]=yt,t[141]=st):st=t[141];let dt;return t[142]!==D||t[143]!==B||t[144]!==st?(dt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[D,B,st]}),t[142]=D,t[143]=B,t[144]=st,t[145]=dt):dt=t[145],dt}function Je(e){return e.layer}function Ke(e){return e.position==="after"}function Qe(e){return e!==null}function Ze(e){return e!==null}function _e(e){return e!==null}function ti(e){return e!==null}function ei(e){return e.layer}function ii(e){return e.position==="before"}function ni(e){return e!==0}function si(e){return e!==0}function oi(e){return`${e.id}`}function ai(e){const t=i.compilerRuntimeExports.c(139),{data:d,leftMargin:Jt,rightMargin:se,topMargin:Kt,bottomMargin:Qt,dotColors:k,suffix:Ft,prefix:Mt,barPadding:It,showValues:wt,showTicks:jt,truncateBy:ht,width:At,height:g,radius:at,showLabels:Lt,tooltip:E,onSeriesMouseOver:ct,maxValue:Zt,minValue:ft,onSeriesMouseClick:q,selectedColor:F,arrowConnector:L,connectorStrokeWidth:Pt,maxBarThickness:kt,minBarThickness:$t,resetSelectionOnDoubleClick:_t,detailsOnClick:O,axisTitle:P,noOfTicks:Wt,valueColor:Nt,styles:s,classNames:n,labelOrder:y,refValues:Vt,rtl:p,animate:m,precision:X,customLayers:W,highlightedDataPoints:ut,dimmedOpacity:b}=e,Gt=Jt===void 0?100:Jt,Bt=se===void 0?40:se,Dt=Kt===void 0?20:Kt,te=Qt===void 0?10:Qt,Yt=T.useRef(null);let H;t[0]!==m.amount||t[1]!==m.once?(H={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=H):H=t[2];const U=Te.useInView(Yt,H),Xt=P?Dt+25:Dt;let l;t[3]!==te||t[4]!==Gt||t[5]!==Bt||t[6]!==Xt?(l={top:Xt,bottom:te,left:Gt,right:Bt},t[3]=te,t[4]=Gt,t[5]=Bt,t[6]=Xt,t[7]=l):l=t[7];const o=l,rt=At-o.left-o.right,lt=g-o.top-o.bottom,[Ht,yt]=T.useState(void 0),[gt,Ut]=T.useState(void 0),[Et,Ot]=T.useState(void 0),[zt,Rt]=T.useState(void 0);let G;if(t[8]!==d||t[9]!==y){const h=new Set,M=d.map((w,a)=>{const pt=y?`${w.label}`:`${a}`;return h.add(pt),{...w,id:pt}}),mt=y?y.filter(w=>!h.has(w)):[];let v;t[11]!==d[0]?(v=w=>({id:w,label:w,x:Array(d[0].x.length).fill(null)}),t[11]=d[0],t[12]=v):v=t[12],G=[...M,...mt.map(v)],t[8]=d,t[9]=y,t[10]=G}else G=t[10];const $=G;let St;t[13]!==$||t[14]!==y?(St=y??$.map(yi),t[13]=$,t[14]=y,t[15]=St):St=t[15];const bt=St;let z,J,K,Q,Z,j,R,C,_,tt,et,A,N,V,it;if(t[16]!==m||t[17]!==L||t[18]!==P||t[19]!==bt||t[20]!==It||t[21]!==n?.dataConnectors||t[22]!==n?.graphObjectValues||t[23]!==n?.xAxis?.gridLines||t[24]!==n?.xAxis?.labels||t[25]!==n?.xAxis?.title||t[26]!==n?.yAxis?.gridLines||t[27]!==n?.yAxis?.labels||t[28]!==Pt||t[29]!==W||t[30]!==$||t[31]!==O||t[32]!==b||t[33]!==k||t[34]!==lt||t[35]!==rt||t[36]!==g||t[37]!==ut||t[38]!==U||t[39]!==o.bottom||t[40]!==o.left||t[41]!==o.top||t[42]!==kt||t[43]!==Zt||t[44]!==$t||t[45]!==ft||t[46]!==gt||t[47]!==Wt||t[48]!==q||t[49]!==ct||t[50]!==X||t[51]!==Mt||t[52]!==at||t[53]!==Vt||t[54]!==_t||t[55]!==p||t[56]!==F||t[57]!==Lt||t[58]!==jt||t[59]!==wt||t[60]!==s?.dataConnectors||t[61]!==s?.graphObjectValues||t[62]!==s?.xAxis?.gridLines||t[63]!==s?.xAxis?.labels||t[64]!==s?.xAxis?.title||t[65]!==s?.yAxis?.gridLines||t[66]!==s?.yAxis?.labels||t[67]!==Ft||t[68]!==Dt||t[69]!==ht||t[70]!==Nt||t[71]!==At){const h=De.linear().domain([ft,Zt]).range([0,rt]).nice(),M=Se.band().domain(bt).range([0,$t?Math.max(lt,$t*$.length):kt?Math.min(lt,kt*$.length):lt]).paddingInner(It),mt=h.ticks(Wt);J=Tt.motion.svg,_=`${At}px`,tt=`${g}px`,et=`0 0 ${At} ${g}`,A="ltr",N=Yt,t[87]!==L?(V=L?i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:i.jsxRuntimeExports.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,t[87]=L,t[88]=V):V=t[88],Q=`translate(${o.left},${o.top})`,Z=jt?i.jsxRuntimeExports.jsx(We.XTicksAndGridLines,{values:mt.filter(fi),x:mt.filter(hi).map(c=>h(c)),y1:0-Dt,y2:lt+o.bottom,styles:{gridLines:s?.xAxis?.gridLines,labels:s?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:Ft,prefix:Mt,labelType:"secondary",showGridLines:!0,precision:X}):null;const v=rt/2,w=0-o.top+15,a=s?.xAxis?.title,pt=n?.xAxis?.title;t[89]!==P||t[90]!==v||t[91]!==w||t[92]!==a||t[93]!==pt?(j=i.jsxRuntimeExports.jsx(Le.AxisTitle,{x:v,y:w,style:a,className:pt,text:P}),t[89]=P,t[90]=v,t[91]=w,t[92]=a,t[93]=pt,t[94]=j):j=t[94];const ie=s?.yAxis?.gridLines;let vt;t[95]!==ie?(vt={gridLines:ie},t[95]=ie,t[96]=vt):vt=t[96];const ne=n?.yAxis?.gridLines;let Y;t[97]!==ne?(Y={gridLines:ne},t[97]=ne,t[98]=Y):Y=t[98],R=i.jsxRuntimeExports.jsx($e.YTicksAndGridLines,{y:$.map(c=>M(`${c.id}`)+M.bandwidth()/2),x1:0,x2:rt,styles:vt,classNames:Y,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:X}),t[99]!==W?(C=W.filter(pi).map(mi),t[99]=W,t[100]=C):C=t[100],z=qe.AnimatePresence,it=$.map(c=>i.jsxRuntimeExports.jsxs(Tt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:0,y:M(`${c.id}`)+M.bandwidth()/2,opacity:ut.length!==0?ut.indexOf(c.label)!==-1?.85:b:.85},whileInView:{x:0,y:M(`${c.id}`)+M.bandwidth()/2,opacity:ut.length!==0?ut.indexOf(c.label)!==-1?.85:b:.85,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},children:[Lt?i.jsxRuntimeExports.jsx(Ge.YAxesLabels,{value:`${c.label}`.length<ht?`${c.label}`:`${`${c.label}`.substring(0,ht)}...`,y:0-M.bandwidth()/2,x:0-o.left,width:o.left,height:M.bandwidth(),alignment:"right",style:s?.yAxis?.labels,className:n?.yAxis?.labels,animate:m,isInView:U}):null,i.jsxRuntimeExports.jsx(Tt.motion.line,{y1:0,y2:0,style:{strokeWidth:Pt,...s?.dataConnectors||{},opacity:F?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",n?.dataConnectors),markerEnd:L&&c.x.indexOf(Math.min(...c.x.filter(di)))===0?"url(#arrow)":"",markerStart:L&&c.x.indexOf(Math.min(...c.x.filter(xi)))===c.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x1:0,x2:0},whileInView:{x1:h(Math.min(...c.x.filter(ui)))+at,x2:h(Math.max(...c.x.filter(ci)))-at,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial"}),c.x.map((S,r)=>i.jsxRuntimeExports.jsx(Tt.motion.g,{onMouseEnter:I=>{yt({...c,xIndex:r}),Rt(I.clientY),Ot(I.clientX),ct?.({...c,xIndex:r})},onClick:()=>{(q||O)&&(Me.isEqual(gt,{...c,xIndex:r})&&_t?(Ut(void 0),q?.(void 0)):(Ut({...c,xIndex:r}),q&&q({...c,xIndex:r})))},onMouseMove:I=>{yt({...c,xIndex:r}),Rt(I.clientY),Ot(I.clientX)},onMouseLeave:()=>{yt(void 0),Ot(void 0),Rt(void 0),ct?.(void 0)},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:F?k[r]===F?1:.3:1},whileInView:{opacity:F?k[r]===F?1:.3:1,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial",children:qt.checkIfNullOrUndefined(S)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Tt.motion.circle,{cy:0,r:at,style:{fill:k[r],fillOpacity:.85,stroke:k[r],strokeWidth:1,opacity:qt.checkIfNullOrUndefined(S)?0:1},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{cx:h(0),opacity:0},whileInView:{cx:h(S||0),opacity:qt.checkIfNullOrUndefined(S)?0:1,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial"}),wt?i.jsxRuntimeExports.jsx(Tt.motion.text,{y:0,style:{textAnchor:"middle",...s?.graphObjectValues||{}},dx:0,dy:0-at-3,className:i.mo("graph-value text-sm font-bold",qt.checkIfNullOrUndefined(S)?"0opacity-0":"opacity-100",n?.graphObjectValues),exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:h(0),opacity:0,fill:Nt||k[r]},whileInView:{x:h(S||0),fill:Nt||k[r],opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial",children:ke.numberFormattingFunction(S,"NA",X,Mt,Ft)}):null]})},r))]},c.label)),K=Vt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:Vt.map((c,S)=>i.jsxRuntimeExports.jsx(Ne.RefLineX,{text:c.text,color:c.color,x:h(c.value),y1:0-o.top,y2:lt+o.bottom,textSide:h(c.value)>rt*.75||p?"left":"right",classNames:c.classNames,styles:c.styles,animate:m,isInView:U},S))}):null,t[16]=m,t[17]=L,t[18]=P,t[19]=bt,t[20]=It,t[21]=n?.dataConnectors,t[22]=n?.graphObjectValues,t[23]=n?.xAxis?.gridLines,t[24]=n?.xAxis?.labels,t[25]=n?.xAxis?.title,t[26]=n?.yAxis?.gridLines,t[27]=n?.yAxis?.labels,t[28]=Pt,t[29]=W,t[30]=$,t[31]=O,t[32]=b,t[33]=k,t[34]=lt,t[35]=rt,t[36]=g,t[37]=ut,t[38]=U,t[39]=o.bottom,t[40]=o.left,t[41]=o.top,t[42]=kt,t[43]=Zt,t[44]=$t,t[45]=ft,t[46]=gt,t[47]=Wt,t[48]=q,t[49]=ct,t[50]=X,t[51]=Mt,t[52]=at,t[53]=Vt,t[54]=_t,t[55]=p,t[56]=F,t[57]=Lt,t[58]=jt,t[59]=wt,t[60]=s?.dataConnectors,t[61]=s?.graphObjectValues,t[62]=s?.xAxis?.gridLines,t[63]=s?.xAxis?.labels,t[64]=s?.xAxis?.title,t[65]=s?.yAxis?.gridLines,t[66]=s?.yAxis?.labels,t[67]=Ft,t[68]=Dt,t[69]=ht,t[70]=Nt,t[71]=At,t[72]=z,t[73]=J,t[74]=K,t[75]=Q,t[76]=Z,t[77]=j,t[78]=R,t[79]=C,t[80]=_,t[81]=tt,t[82]=et,t[83]=A,t[84]=N,t[85]=V,t[86]=it}else z=t[72],J=t[73],K=t[74],Q=t[75],Z=t[76],j=t[77],R=t[78],C=t[79],_=t[80],tt=t[81],et=t[82],A=t[83],N=t[84],V=t[85],it=t[86];let nt;t[101]!==z||t[102]!==K||t[103]!==it?(nt=i.jsxRuntimeExports.jsxs(z,{children:[it,K]}),t[101]=z,t[102]=K,t[103]=it,t[104]=nt):nt=t[104];let xt;t[105]!==W?(xt=W.filter(li).map(ri),t[105]=W,t[106]=xt):xt=t[106];let D;t[107]!==Q||t[108]!==Z||t[109]!==j||t[110]!==R||t[111]!==C||t[112]!==nt||t[113]!==xt?(D=i.jsxRuntimeExports.jsxs("g",{transform:Q,children:[Z,j,R,C,nt,xt]}),t[107]=Q,t[108]=Z,t[109]=j,t[110]=R,t[111]=C,t[112]=nt,t[113]=xt,t[114]=D):D=t[114];let B;t[115]!==J||t[116]!==_||t[117]!==tt||t[118]!==et||t[119]!==A||t[120]!==N||t[121]!==V||t[122]!==D?(B=i.jsxRuntimeExports.jsxs(J,{width:_,height:tt,viewBox:et,direction:A,ref:N,children:[V,D]}),t[115]=J,t[116]=_,t[117]=tt,t[118]=et,t[119]=A,t[120]=N,t[121]=V,t[122]=D,t[123]=B):B=t[123];let st;t[124]!==n?.tooltip||t[125]!==Et||t[126]!==zt||t[127]!==Ht||t[128]!==s?.tooltip||t[129]!==E?(st=Ht&&E&&Et&&zt?i.jsxRuntimeExports.jsx(Ie.Tooltip,{data:Ht,body:E,xPos:Et,yPos:zt,backgroundStyle:s?.tooltip,className:n?.tooltip}):null,t[124]=n?.tooltip,t[125]=Et,t[126]=zt,t[127]=Ht,t[128]=s?.tooltip,t[129]=E,t[130]=st):st=t[130];let dt;t[131]!==n?.modal||t[132]!==O||t[133]!==gt?(dt=O&>!==void 0?i.jsxRuntimeExports.jsx(Ve.DetailsModal,{body:O,data:gt,setData:Ut,className:n?.modal}):null,t[131]=n?.modal,t[132]=O,t[133]=gt,t[134]=dt):dt=t[134];let f;return t[135]!==B||t[136]!==st||t[137]!==dt?(f=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[B,st,dt]}),t[135]=B,t[136]=st,t[137]=dt,t[138]=f):f=t[138],f}function ri(e){return e.layer}function li(e){return e.position==="after"}function ci(e){return e!==null}function ui(e){return e!==null}function xi(e){return e!==null}function di(e){return e!==null}function mi(e){return e.layer}function pi(e){return e.position==="before"}function hi(e,t){return t!==0}function fi(e,t){return t!==0}function yi(e){return`${e.id}`}function gi(e){const t=i.compilerRuntimeExports.c(120),{data:d,graphTitle:Jt,colors:se,sources:Kt,graphDescription:Qt,barPadding:k,showTicks:Ft,leftMargin:Mt,rightMargin:It,topMargin:wt,bottomMargin:jt,truncateBy:ht,height:At,width:g,footNote:at,colorDomain:Lt,colorLegendTitle:E,padding:ct,backgroundColor:Zt,radius:ft,tooltip:q,showLabels:F,relativeHeight:L,onSeriesMouseOver:Pt,graphID:kt,suffix:$t,prefix:_t,maxValue:O,minValue:P,onSeriesMouseClick:Wt,graphDownload:Nt,dataDownload:s,showValues:n,sortParameter:y,arrowConnector:Vt,connectorStrokeWidth:p,language:m,minHeight:X,theme:W,maxBarThickness:ut,maxNumberOfBars:b,minBarThickness:Gt,ariaLabel:Bt,resetSelectionOnDoubleClick:Dt,detailsOnClick:te,axisTitle:Yt,noOfTicks:H,valueColor:U,orientation:Xt,styles:l,classNames:o,labelOrder:rt,refValues:lt,filterNA:Ht,animate:yt,precision:gt,showColorScale:Ut,customLayers:Et,highlightedDataPoints:Ot,dimmedOpacity:zt,timeline:Rt,sortData:G}=e,$=se===void 0?Ue.Colors.light.categoricalColors.colors:se,St=k===void 0?.25:k,bt=Ft===void 0?!0:Ft,z=ht===void 0?999:ht,J=Zt===void 0?!0:Zt,K=ft===void 0?3:ft,Q=F===void 0?!0:F,Z=$t===void 0?"":$t,j=_t===void 0?"":_t,R=Nt===void 0?!1:Nt,C=s===void 0?!1:s,_=n===void 0?!0:n,tt=Vt===void 0?!1:Vt,et=p===void 0?2:p,A=m===void 0?"en":m,N=X===void 0?0:X,V=W===void 0?"light":W,it=Dt===void 0?!0:Dt,nt=H===void 0?5:H,xt=Xt===void 0?"vertical":Xt,D=Ht===void 0?!0:Ht,B=yt===void 0?!1:yt,st=gt===void 0?2:gt,dt=Ut===void 0?!0:Ut;let f;t[0]!==Et?(f=Et===void 0?[]:Et,t[0]=Et,t[1]=f):f=t[1];const h=f;let M;t[2]!==Ot?(M=Ot===void 0?[]:Ot,t[2]=Ot,t[3]=M):M=t[3];const mt=M,v=zt===void 0?.3:zt;let w;t[4]!==Rt?(w=Rt===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:Rt,t[4]=Rt,t[5]=w):w=t[5];const a=w,[pt,ie]=T.useState(0),[vt,ne]=T.useState(0),[Y,c]=T.useState(a.autoplay);let S;if(t[6]!==d||t[7]!==a.dateFormat){let u;t[9]!==a.dateFormat?(u=Ct=>je.parse(`${Ct.date}`,a.dateFormat||"yyyy",new Date).getTime(),t[9]=a.dateFormat,t[10]=u):u=t[10],S=[...new Set(d.filter(Ti).map(u))],S.sort(Si),t[6]=d,t[7]=a.dateFormat,t[8]=S}else S=t[8];const r=S,[I,ae]=T.useState(a.autoplay?0:r.length-1),[x,ee]=T.useState(void 0),ot=T.useRef(null),oe=T.useRef(null);let xe,de;t[11]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>{const u=new ResizeObserver(Ct=>{ie(Ct[0].target.clientWidth||620),ne(Ct[0].target.clientHeight||480)});return ot.current&&u.observe(ot.current),()=>u.disconnect()},de=[],t[11]=xe,t[12]=de):(xe=t[11],de=t[12]),T.useEffect(xe,de);let me,pe;t[13]!==Y||t[14]!==a.speed||t[15]!==r?(me=()=>{const u=setInterval(()=>{ae(Ct=>Ct<r.length-1?Ct+1:0)},(a.speed||2)*1e3);return Y||clearInterval(u),()=>clearInterval(u)},pe=[r,Y,a.speed],t[13]=Y,t[14]=a.speed,t[15]=r,t[16]=me,t[17]=pe):(me=t[16],pe=t[17]),T.useEffect(me,pe);const ge=a.dateFormat||"yyyy";let he;t[18]!==I||t[19]!==ge||t[20]!==a.showOnlyActiveDate||t[21]!==r?(he=Oe.getSliderMarks(r,I,a.showOnlyActiveDate,ge),t[18]=I,t[19]=ge,t[20]=a.showOnlyActiveDate,t[21]=r,t[22]=he):he=t[22];const fe=he,be=xt==="horizontal"?ai:ze,ve=o?.graphContainer,we=l?.graphContainer;let re;t[23]!==o?.description||t[24]!==o?.title||t[25]!==d||t[26]!==C||t[27]!==Qt||t[28]!==R||t[29]!==Jt||t[30]!==l?.description||t[31]!==l?.title||t[32]!==g?(re=Jt||Qt||R||C?i.jsxRuntimeExports.jsx(Be.GraphHeader,{styles:{title:l?.title,description:l?.description},classNames:{title:o?.title,description:o?.description},graphTitle:Jt,graphDescription:Qt,width:g,graphDownload:R?oe:void 0,dataDownload:C?d.map(Di).filter(Vi).length>0?d.map(Ni).filter($i):d.filter(Li):null}):null,t[23]=o?.description,t[24]=o?.title,t[25]=d,t[26]=C,t[27]=Qt,t[28]=R,t[29]=Jt,t[30]=l?.description,t[31]=l?.title,t[32]=g,t[33]=re):re=t[33];let le;t[34]!==I||t[35]!==fe||t[36]!==Y||t[37]!==a.enabled||t[38]!==r?(le=a.enabled&&r.length>0&&fe?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{c(!Y)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":Y?"Click to pause animation":"Click to play animation",children:Y?i.jsxRuntimeExports.jsx(Ce.Pause,{}):i.jsxRuntimeExports.jsx(Ce.Play,{})}),i.jsxRuntimeExports.jsx(Oe.Nr,{min:r[0],max:r[r.length-1],marks:fe,step:null,defaultValue:r[r.length-1],value:r[I],onChangeComplete:u=>{ae(r.indexOf(u))},onChange:u=>{ae(r.indexOf(u))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[34]=I,t[35]=fe,t[36]=Y,t[37]=a.enabled,t[38]=r,t[39]=le):le=t[39];let ce;t[40]!==be||t[41]!==B||t[42]!==tt||t[43]!==Yt||t[44]!==St||t[45]!==jt||t[46]!==o||t[47]!==Lt||t[48]!==E||t[49]!==$||t[50]!==et||t[51]!==h||t[52]!==d||t[53]!==te||t[54]!==v||t[55]!==D||t[56]!==mt||t[57]!==I||t[58]!==rt||t[59]!==A||t[60]!==Mt||t[61]!==ut||t[62]!==b||t[63]!==O||t[64]!==Gt||t[65]!==P||t[66]!==nt||t[67]!==Wt||t[68]!==Pt||t[69]!==st||t[70]!==j||t[71]!==K||t[72]!==lt||t[73]!==it||t[74]!==It||t[75]!==x||t[76]!==dt||t[77]!==Q||t[78]!==bt||t[79]!==_||t[80]!==G||t[81]!==y||t[82]!==l||t[83]!==Z||t[84]!==vt||t[85]!==pt||t[86]!==a.dateFormat||t[87]!==a.enabled||t[88]!==q||t[89]!==wt||t[90]!==z||t[91]!==r||t[92]!==U||t[93]!==g?(ce=d.length===0?i.jsxRuntimeExports.jsx(He.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[dt?i.jsxRuntimeExports.jsx(Xe.ColorLegendWithMouseOver,{width:g,colorDomain:Lt,colors:$,colorLegendTitle:E,setSelectedColor:ee,showNAColor:!1,className:o?.colorLegend}):null,i.jsxRuntimeExports.jsx(Re.GraphArea,{ref:ot,children:pt&&vt?i.jsxRuntimeExports.jsx(be,{data:y!==void 0?y==="diff"?Ee.orderBy(Ae.ensureCompleteDataForDumbbellChart(d,a.dateFormat||"yyyy").filter(u=>a.enabled?u.date===je.format(new Date(r[I]),a.dateFormat||"yyyy"):u).filter(u=>D?!u.x.every(Ii):u),Mi,[G||"asc"]).filter((u,Ct)=>b?Ct<b:!0):Ee.orderBy(Ae.ensureCompleteDataForDumbbellChart(d,a.dateFormat||"yyyy").filter(u=>a.enabled?u.date===je.format(new Date(r[I]),a.dateFormat||"yyyy"):u).filter(u=>D?!u.x.every(Ci):u),u=>qt.checkIfNullOrUndefined(u.x[y])?-1/0:u.x[y],[G||"asc"]).filter((u,Ct)=>b?Ct<b:!0):Ae.ensureCompleteDataForDumbbellChart(d,a.dateFormat||"yyyy").filter(u=>D?!u.x.every(Ri):u).filter((u,Ct)=>b?Ct<b:!0),dotColors:$,width:pt,height:vt,radius:K,barPadding:St,showTicks:bt,leftMargin:Mt,rightMargin:It,topMargin:wt,bottomMargin:jt,truncateBy:z,showLabels:Q,showValues:_,tooltip:q,suffix:Z,prefix:j,onSeriesMouseOver:Pt,maxValue:qt.checkIfNullOrUndefined(O)?Math.max(...d.map(Ei))<0?0:Math.max(...d.map(Ai)):O,minValue:qt.checkIfNullOrUndefined(P)?Math.min(...d.map(wi))>0?0:Math.min(...d.map(bi)):P,onSeriesMouseClick:Wt,selectedColor:x,arrowConnector:tt,connectorStrokeWidth:et,maxBarThickness:ut,minBarThickness:Gt,resetSelectionOnDoubleClick:it,detailsOnClick:te,axisTitle:Yt,noOfTicks:nt,valueColor:U,styles:l,classNames:o,labelOrder:rt,refValues:lt,animate:B===!0?{duration:.5,once:!0,amount:.5}:B||{duration:0,once:!0,amount:0},precision:st,customLayers:h,highlightedDataPoints:mt,dimmedOpacity:v,rtl:A==="ar"||A==="he"}):null})]}),t[40]=be,t[41]=B,t[42]=tt,t[43]=Yt,t[44]=St,t[45]=jt,t[46]=o,t[47]=Lt,t[48]=E,t[49]=$,t[50]=et,t[51]=h,t[52]=d,t[53]=te,t[54]=v,t[55]=D,t[56]=mt,t[57]=I,t[58]=rt,t[59]=A,t[60]=Mt,t[61]=ut,t[62]=b,t[63]=O,t[64]=Gt,t[65]=P,t[66]=nt,t[67]=Wt,t[68]=Pt,t[69]=st,t[70]=j,t[71]=K,t[72]=lt,t[73]=it,t[74]=It,t[75]=x,t[76]=dt,t[77]=Q,t[78]=bt,t[79]=_,t[80]=G,t[81]=y,t[82]=l,t[83]=Z,t[84]=vt,t[85]=pt,t[86]=a.dateFormat,t[87]=a.enabled,t[88]=q,t[89]=wt,t[90]=z,t[91]=r,t[92]=U,t[93]=g,t[94]=ce):ce=t[94];let ue;t[95]!==o?.footnote||t[96]!==o?.source||t[97]!==at||t[98]!==Kt||t[99]!==l?.footnote||t[100]!==l?.source||t[101]!==g?(ue=Kt||at?i.jsxRuntimeExports.jsx(Ye.GraphFooter,{styles:{footnote:l?.footnote,source:l?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:Kt,footNote:at,width:g}):null,t[95]=o?.footnote,t[96]=o?.source,t[97]=at,t[98]=Kt,t[99]=l?.footnote,t[100]=l?.source,t[101]=g,t[102]=ue):ue=t[102];let ye;return t[103]!==Bt||t[104]!==J||t[105]!==kt||t[106]!==At||t[107]!==A||t[108]!==N||t[109]!==ct||t[110]!==L||t[111]!==ve||t[112]!==we||t[113]!==re||t[114]!==le||t[115]!==ce||t[116]!==ue||t[117]!==V||t[118]!==g?(ye=i.jsxRuntimeExports.jsxs(Re.GraphContainer,{className:ve,style:we,id:kt,ref:oe,"aria-label":Bt,backgroundColor:J,theme:V,language:A,minHeight:N,width:g,height:At,relativeHeight:L,padding:ct,children:[re,le,ce,ue]}),t[103]=Bt,t[104]=J,t[105]=kt,t[106]=At,t[107]=A,t[108]=N,t[109]=ct,t[110]=L,t[111]=ve,t[112]=we,t[113]=re,t[114]=le,t[115]=ce,t[116]=ue,t[117]=V,t[118]=g,t[119]=ye):ye=t[119],ye}function bi(e){return Math.min(...e.x.filter(vi))}function vi(e){return e!==null}function wi(e){return Math.min(...e.x.filter(ji))}function ji(e){return e!==null}function Ai(e){return Math.max(...e.x.filter(ki))}function ki(e){return e!==null}function Ei(e){return Math.max(...e.x.filter(Oi))}function Oi(e){return e!==null}function Ri(e){return e==null}function Ci(e){return e==null}function Mi(e){return qt.checkIfNullOrUndefined(e.x[e.x.length-1])||qt.checkIfNullOrUndefined(e.x[0])?-1/0:e.x[e.x.length-1]-e.x[0]}function Ii(e){return e==null}function Li(e){return e!==void 0}function $i(e){return e!==void 0}function Ni(e){return e.data}function Vi(e){return e!==void 0}function Di(e){return e.data}function Si(e,t){return e-t}function Ti(e){return e.date}exports.DumbbellChart=gi;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),Ee=require("./index-Cno4Q0YE.cjs"),je=require("./parse-hMnG_lRV.cjs"),T=require("react"),Oe=require("./getSliderMarks-BmADcPQt.cjs"),Me=require("./index-DQA8q5sC.cjs"),ke=require("./numberFormattingFunction-02t-wJta.cjs"),Ie=require("./Tooltip-uUdw6wJL.cjs"),qt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Le=require("./AxisTitle-sS5bLLR7.cjs"),Fe=require("./Axis-DxRV2yMi.cjs"),Pe=require("./XAxesLabels-Bt5NZBmX.cjs"),$e=require("./YTicksAndGridLines-4pxTRlRK.cjs"),Ne=require("./ReferenceLine-BH0qdf4R.cjs"),We=require("./XTicksAndGridLines-B6CELS7q.cjs"),Ge=require("./YAxesLabels-DesLesUP.cjs"),Ve=require("./DetailsModal-BN0HDFlV.cjs"),De=require("./linear-BwPAspcq.cjs"),Se=require("./band-VYfcZeJ2.cjs"),Te=require("./use-in-view-QcfiW0w3.cjs"),Tt=require("./proxy-BxvUI_9l.cjs"),qe=require("./index-DG2bgAva.cjs"),Ae=require("./ensureCompleteData-pZ9QO6kB.cjs"),Re=require("./GraphContainer-d8A46BK2.cjs"),Be=require("./GraphHeader.cjs"),Ce=require("./index-DRXx7m-C.cjs"),Ye=require("./GraphFooter.cjs"),Xe=require("./ColorLegendWithMouseOver.cjs"),He=require("./EmptyState-sAEZ_5rU.cjs"),Ue=require("./Colors.cjs");function ze(e){const t=i.compilerRuntimeExports.c(146),{data:d,leftMargin:Jt,rightMargin:se,topMargin:Kt,bottomMargin:Qt,dotColors:k,barPadding:Ft,showTicks:Mt,truncateBy:It,width:wt,height:jt,radius:ht,showLabels:At,tooltip:g,onSeriesMouseOver:at,maxValue:Lt,minValue:E,onSeriesMouseClick:ct,showValues:Zt,suffix:ft,prefix:q,selectedColor:F,arrowConnector:L,connectorStrokeWidth:Pt,maxBarThickness:kt,minBarThickness:$t,resetSelectionOnDoubleClick:_t,detailsOnClick:O,axisTitle:P,noOfTicks:Wt,valueColor:Nt,styles:s,classNames:n,labelOrder:y,refValues:Vt,animate:p,precision:m,customLayers:X,highlightedDataPoints:W,dimmedOpacity:ut}=e,b=Jt===void 0?20:Jt,Gt=se===void 0?20:se,Bt=Kt===void 0?20:Kt,Dt=Qt===void 0?25:Qt,te=T.useRef(null);let Yt;t[0]!==p.amount||t[1]!==p.once?(Yt={once:p.once,amount:p.amount},t[0]=p.amount,t[1]=p.once,t[2]=Yt):Yt=t[2];const H=Te.useInView(te,Yt),U=P?b+30:b;let Xt;t[3]!==Dt||t[4]!==Gt||t[5]!==U||t[6]!==Bt?(Xt={top:Bt,bottom:Dt,left:U,right:Gt},t[3]=Dt,t[4]=Gt,t[5]=U,t[6]=Bt,t[7]=Xt):Xt=t[7];const l=Xt,o=wt-l.left-l.right,rt=jt-l.top-l.bottom,[lt,Ht]=T.useState(void 0),[yt,gt]=T.useState(void 0),[Ut,Et]=T.useState(void 0),[Ot,zt]=T.useState(void 0);let Rt;if(t[8]!==d||t[9]!==y){const f=new Set,h=d.map((v,w)=>{const a=y?`${v.label}`:`${w}`;return f.add(a),{...v,id:a}}),M=y?y.filter(v=>!f.has(v)):[];let mt;t[11]!==d[0]?(mt=v=>({id:v,label:v,x:Array(d[0].x.length).fill(null)}),t[11]=d[0],t[12]=mt):mt=t[12],Rt=[...h,...M.map(mt)],t[8]=d,t[9]=y,t[10]=Rt}else Rt=t[10];const G=Rt;let $;t[13]!==G||t[14]!==y?($=y??G.map(oi),t[13]=G,t[14]=y,t[15]=$):$=t[15];const St=$;let bt,z,J,K,Q,Z,j,R,C,_,tt,et,A,N,V;if(t[16]!==p||t[17]!==L||t[18]!==P||t[19]!==St||t[20]!==Ft||t[21]!==n?.dataConnectors||t[22]!==n?.graphObjectValues||t[23]!==n?.xAxis?.axis||t[24]!==n?.xAxis?.labels||t[25]!==n?.yAxis?.gridLines||t[26]!==n?.yAxis?.labels||t[27]!==n?.yAxis?.title||t[28]!==Pt||t[29]!==X||t[30]!==G||t[31]!==O||t[32]!==ut||t[33]!==k||t[34]!==rt||t[35]!==o||t[36]!==jt||t[37]!==W||t[38]!==H||t[39]!==b||t[40]!==l.bottom||t[41]!==l.left||t[42]!==l.right||t[43]!==l.top||t[44]!==kt||t[45]!==Lt||t[46]!==$t||t[47]!==E||t[48]!==yt||t[49]!==Wt||t[50]!==ct||t[51]!==at||t[52]!==m||t[53]!==q||t[54]!==ht||t[55]!==Vt||t[56]!==_t||t[57]!==F||t[58]!==At||t[59]!==Mt||t[60]!==Zt||t[61]!==s?.dataConnectors||t[62]!==s?.graphObjectValues||t[63]!==s?.xAxis?.axis||t[64]!==s?.xAxis?.labels||t[65]!==s?.yAxis?.gridLines||t[66]!==s?.yAxis?.labels||t[67]!==s?.yAxis?.title||t[68]!==ft||t[69]!==It||t[70]!==Nt||t[71]!==wt){const f=De.linear().domain([E,Lt]).range([rt,0]).nice(),h=Se.band().domain(St).range([0,$t?Math.max(o,$t*G.length):kt?Math.min(o,kt*G.length):o]).paddingInner(Ft),M=f.ticks(Wt);z=Tt.motion.svg,C=`${wt}px`,_=`${jt}px`,tt=`0 0 ${wt} ${jt}`,et="ltr",A=te,t[87]!==L?(N=L?i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:i.jsxRuntimeExports.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,t[87]=L,t[88]=N):N=t[88],K=`translate(${l.left},${l.top})`;const mt=f(E<0?0:E),v=f(E<0?0:E),w=E<0?0:E;let a;t[89]!==m||t[90]!==q||t[91]!==ft||t[92]!==w?(a=ke.numberFormattingFunction(w,"NA",m,q,ft),t[89]=m,t[90]=q,t[91]=ft,t[92]=w,t[93]=a):a=t[93];const pt=n?.xAxis?.axis,ie=n?.yAxis?.labels;let vt;t[94]!==pt||t[95]!==ie?(vt={axis:pt,label:ie},t[94]=pt,t[95]=ie,t[96]=vt):vt=t[96];const ne=s?.xAxis?.axis,Y=s?.yAxis?.labels;let c;t[97]!==ne||t[98]!==Y?(c={axis:ne,label:Y},t[97]=ne,t[98]=Y,t[99]=c):c=t[99],Q=i.jsxRuntimeExports.jsx(Fe.Axis,{y1:mt,y2:v,x1:0-b,x2:o+l.right,label:a,labelPos:{x:0-b,dx:0,dy:Lt<0?"1em":-5,y:f(E<0?0:E)},classNames:vt,styles:c}),Z=Mt?i.jsxRuntimeExports.jsx($e.YTicksAndGridLines,{values:M.filter(si),y:M.filter(ni).map(x=>f(x)),x1:0-b,x2:o+l.right,styles:{gridLines:s?.yAxis?.gridLines,labels:s?.yAxis?.labels},classNames:{gridLines:n?.yAxis?.gridLines,labels:n?.yAxis?.labels},suffix:ft,prefix:q,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:m}):null;const S=0-b-15,r=rt/2,I=s?.yAxis?.title,ae=n?.yAxis?.title;t[100]!==P||t[101]!==S||t[102]!==r||t[103]!==I||t[104]!==ae?(j=i.jsxRuntimeExports.jsx(Le.AxisTitle,{x:S,y:r,style:I,className:ae,text:P,rotate90:!0}),t[100]=P,t[101]=S,t[102]=r,t[103]=I,t[104]=ae,t[105]=j):j=t[105],t[106]!==X?(R=X.filter(ii).map(ei),t[106]=X,t[107]=R):R=t[107],bt=qe.AnimatePresence,V=G.map(x=>i.jsxRuntimeExports.jsxs(Tt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:h(`${x.id}`)+h.bandwidth()/2,y:0,opacity:W.length!==0?W.indexOf(x.label)!==-1?.85:ut:.85},whileInView:{x:h(`${x.id}`)+h.bandwidth()/2,y:0,opacity:W.length!==0?W.indexOf(x.label)!==-1?.85:ut:.85,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial",exit:{opacity:0,transition:{duration:p.duration}},children:[At?i.jsxRuntimeExports.jsx(Pe.XAxesLabels,{value:`${x.label}`.length<It?`${x.label}`:`${`${x.label}`.substring(0,It)}...`,y:rt+5,x:0-h.bandwidth()/2,width:h.bandwidth(),height:l.bottom,style:s?.xAxis?.labels,className:n?.xAxis?.labels,alignment:"top",animate:p,isInView:H}):null,i.jsxRuntimeExports.jsx(Tt.motion.line,{x1:0,x2:0,style:{strokeWidth:Pt,...s?.dataConnectors||{},opacity:F?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",n?.dataConnectors),markerEnd:L&&x.x.indexOf(Math.min(...x.x.filter(ti)))===0?"url(#arrow)":"",markerStart:L&&x.x.indexOf(Math.min(...x.x.filter(_e)))===x.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{y1:0,y2:0},whileInView:{y1:f(Math.min(...x.x.filter(Ze)))+ht,y2:f(Math.max(...x.x.filter(Qe)))-ht,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial"}),x.x.map((ee,ot)=>i.jsxRuntimeExports.jsx(Tt.motion.g,{onMouseEnter:oe=>{Ht({...x,xIndex:ot}),zt(oe.clientY),Et(oe.clientX),at?.({...x,xIndex:ot})},onClick:()=>{(ct||O)&&(Me.isEqual(yt,{...x,xIndex:ot})&&_t?(gt(void 0),ct?.(void 0)):(gt({...x,xIndex:ot}),ct&&ct({...x,xIndex:ot})))},onMouseMove:oe=>{Ht({...x,xIndex:ot}),zt(oe.clientY),Et(oe.clientX)},onMouseLeave:()=>{Ht(void 0),Et(void 0),zt(void 0),at?.(void 0)},exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{opacity:F?k[ot]===F?1:.3:1},whileInView:{opacity:F?k[ot]===F?1:.3:1,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial",children:qt.checkIfNullOrUndefined(ee)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Tt.motion.circle,{cx:0,r:ht,style:{fill:k[ot],fillOpacity:.85,stroke:k[ot],strokeWidth:1},exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{cy:f(0),opacity:0},whileInView:{cy:f(ee||0),opacity:qt.checkIfNullOrUndefined(ee)?0:1,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial"}),Zt?i.jsxRuntimeExports.jsx(Tt.motion.text,{x:0,style:{textAnchor:"start",...s?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",qt.checkIfNullOrUndefined(ee)?"opacity-0":"opacity-100",n?.graphObjectValues),dx:ht+3,dy:"0.33em",exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{y:f(0),opacity:0,fill:Nt||k[ot]},whileInView:{y:f(ee||0),fill:Nt||k[ot],opacity:1,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial",children:ke.numberFormattingFunction(ee,"NA",m,q,ft)}):null]})},ot))]},x.label)),J=Vt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:Vt.map((x,ee)=>i.jsxRuntimeExports.jsx(Ne.RefLineY,{text:x.text,color:x.color,y:f(x.value),x1:0-b,x2:o+l.right,classNames:x.classNames,styles:x.styles,animate:p,isInView:H},ee))}):null,t[16]=p,t[17]=L,t[18]=P,t[19]=St,t[20]=Ft,t[21]=n?.dataConnectors,t[22]=n?.graphObjectValues,t[23]=n?.xAxis?.axis,t[24]=n?.xAxis?.labels,t[25]=n?.yAxis?.gridLines,t[26]=n?.yAxis?.labels,t[27]=n?.yAxis?.title,t[28]=Pt,t[29]=X,t[30]=G,t[31]=O,t[32]=ut,t[33]=k,t[34]=rt,t[35]=o,t[36]=jt,t[37]=W,t[38]=H,t[39]=b,t[40]=l.bottom,t[41]=l.left,t[42]=l.right,t[43]=l.top,t[44]=kt,t[45]=Lt,t[46]=$t,t[47]=E,t[48]=yt,t[49]=Wt,t[50]=ct,t[51]=at,t[52]=m,t[53]=q,t[54]=ht,t[55]=Vt,t[56]=_t,t[57]=F,t[58]=At,t[59]=Mt,t[60]=Zt,t[61]=s?.dataConnectors,t[62]=s?.graphObjectValues,t[63]=s?.xAxis?.axis,t[64]=s?.xAxis?.labels,t[65]=s?.yAxis?.gridLines,t[66]=s?.yAxis?.labels,t[67]=s?.yAxis?.title,t[68]=ft,t[69]=It,t[70]=Nt,t[71]=wt,t[72]=bt,t[73]=z,t[74]=J,t[75]=K,t[76]=Q,t[77]=Z,t[78]=j,t[79]=R,t[80]=C,t[81]=_,t[82]=tt,t[83]=et,t[84]=A,t[85]=N,t[86]=V}else bt=t[72],z=t[73],J=t[74],K=t[75],Q=t[76],Z=t[77],j=t[78],R=t[79],C=t[80],_=t[81],tt=t[82],et=t[83],A=t[84],N=t[85],V=t[86];let it;t[108]!==bt||t[109]!==J||t[110]!==V?(it=i.jsxRuntimeExports.jsxs(bt,{children:[V,J]}),t[108]=bt,t[109]=J,t[110]=V,t[111]=it):it=t[111];let nt;t[112]!==X?(nt=X.filter(Ke).map(Je),t[112]=X,t[113]=nt):nt=t[113];let xt;t[114]!==K||t[115]!==Q||t[116]!==Z||t[117]!==j||t[118]!==R||t[119]!==it||t[120]!==nt?(xt=i.jsxRuntimeExports.jsxs("g",{transform:K,children:[Q,Z,j,R,it,nt]}),t[114]=K,t[115]=Q,t[116]=Z,t[117]=j,t[118]=R,t[119]=it,t[120]=nt,t[121]=xt):xt=t[121];let D;t[122]!==z||t[123]!==C||t[124]!==_||t[125]!==tt||t[126]!==et||t[127]!==A||t[128]!==N||t[129]!==xt?(D=i.jsxRuntimeExports.jsxs(z,{width:C,height:_,viewBox:tt,direction:et,ref:A,children:[N,xt]}),t[122]=z,t[123]=C,t[124]=_,t[125]=tt,t[126]=et,t[127]=A,t[128]=N,t[129]=xt,t[130]=D):D=t[130];let B;t[131]!==n?.tooltip||t[132]!==Ut||t[133]!==Ot||t[134]!==lt||t[135]!==s?.tooltip||t[136]!==g?(B=lt&&g&&Ut&&Ot?i.jsxRuntimeExports.jsx(Ie.Tooltip,{data:lt,body:g,xPos:Ut,yPos:Ot,backgroundStyle:s?.tooltip,className:n?.tooltip}):null,t[131]=n?.tooltip,t[132]=Ut,t[133]=Ot,t[134]=lt,t[135]=s?.tooltip,t[136]=g,t[137]=B):B=t[137];let st;t[138]!==n?.modal||t[139]!==O||t[140]!==yt?(st=O&&yt!==void 0?i.jsxRuntimeExports.jsx(Ve.DetailsModal,{body:O,data:yt,setData:gt,className:n?.modal}):null,t[138]=n?.modal,t[139]=O,t[140]=yt,t[141]=st):st=t[141];let dt;return t[142]!==D||t[143]!==B||t[144]!==st?(dt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[D,B,st]}),t[142]=D,t[143]=B,t[144]=st,t[145]=dt):dt=t[145],dt}function Je(e){return e.layer}function Ke(e){return e.position==="after"}function Qe(e){return e!==null}function Ze(e){return e!==null}function _e(e){return e!==null}function ti(e){return e!==null}function ei(e){return e.layer}function ii(e){return e.position==="before"}function ni(e){return e!==0}function si(e){return e!==0}function oi(e){return`${e.id}`}function ai(e){const t=i.compilerRuntimeExports.c(139),{data:d,leftMargin:Jt,rightMargin:se,topMargin:Kt,bottomMargin:Qt,dotColors:k,suffix:Ft,prefix:Mt,barPadding:It,showValues:wt,showTicks:jt,truncateBy:ht,width:At,height:g,radius:at,showLabels:Lt,tooltip:E,onSeriesMouseOver:ct,maxValue:Zt,minValue:ft,onSeriesMouseClick:q,selectedColor:F,arrowConnector:L,connectorStrokeWidth:Pt,maxBarThickness:kt,minBarThickness:$t,resetSelectionOnDoubleClick:_t,detailsOnClick:O,axisTitle:P,noOfTicks:Wt,valueColor:Nt,styles:s,classNames:n,labelOrder:y,refValues:Vt,rtl:p,animate:m,precision:X,customLayers:W,highlightedDataPoints:ut,dimmedOpacity:b}=e,Gt=Jt===void 0?100:Jt,Bt=se===void 0?40:se,Dt=Kt===void 0?20:Kt,te=Qt===void 0?10:Qt,Yt=T.useRef(null);let H;t[0]!==m.amount||t[1]!==m.once?(H={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=H):H=t[2];const U=Te.useInView(Yt,H),Xt=P?Dt+25:Dt;let l;t[3]!==te||t[4]!==Gt||t[5]!==Bt||t[6]!==Xt?(l={top:Xt,bottom:te,left:Gt,right:Bt},t[3]=te,t[4]=Gt,t[5]=Bt,t[6]=Xt,t[7]=l):l=t[7];const o=l,rt=At-o.left-o.right,lt=g-o.top-o.bottom,[Ht,yt]=T.useState(void 0),[gt,Ut]=T.useState(void 0),[Et,Ot]=T.useState(void 0),[zt,Rt]=T.useState(void 0);let G;if(t[8]!==d||t[9]!==y){const h=new Set,M=d.map((w,a)=>{const pt=y?`${w.label}`:`${a}`;return h.add(pt),{...w,id:pt}}),mt=y?y.filter(w=>!h.has(w)):[];let v;t[11]!==d[0]?(v=w=>({id:w,label:w,x:Array(d[0].x.length).fill(null)}),t[11]=d[0],t[12]=v):v=t[12],G=[...M,...mt.map(v)],t[8]=d,t[9]=y,t[10]=G}else G=t[10];const $=G;let St;t[13]!==$||t[14]!==y?(St=y??$.map(yi),t[13]=$,t[14]=y,t[15]=St):St=t[15];const bt=St;let z,J,K,Q,Z,j,R,C,_,tt,et,A,N,V,it;if(t[16]!==m||t[17]!==L||t[18]!==P||t[19]!==bt||t[20]!==It||t[21]!==n?.dataConnectors||t[22]!==n?.graphObjectValues||t[23]!==n?.xAxis?.gridLines||t[24]!==n?.xAxis?.labels||t[25]!==n?.xAxis?.title||t[26]!==n?.yAxis?.gridLines||t[27]!==n?.yAxis?.labels||t[28]!==Pt||t[29]!==W||t[30]!==$||t[31]!==O||t[32]!==b||t[33]!==k||t[34]!==lt||t[35]!==rt||t[36]!==g||t[37]!==ut||t[38]!==U||t[39]!==o.bottom||t[40]!==o.left||t[41]!==o.top||t[42]!==kt||t[43]!==Zt||t[44]!==$t||t[45]!==ft||t[46]!==gt||t[47]!==Wt||t[48]!==q||t[49]!==ct||t[50]!==X||t[51]!==Mt||t[52]!==at||t[53]!==Vt||t[54]!==_t||t[55]!==p||t[56]!==F||t[57]!==Lt||t[58]!==jt||t[59]!==wt||t[60]!==s?.dataConnectors||t[61]!==s?.graphObjectValues||t[62]!==s?.xAxis?.gridLines||t[63]!==s?.xAxis?.labels||t[64]!==s?.xAxis?.title||t[65]!==s?.yAxis?.gridLines||t[66]!==s?.yAxis?.labels||t[67]!==Ft||t[68]!==Dt||t[69]!==ht||t[70]!==Nt||t[71]!==At){const h=De.linear().domain([ft,Zt]).range([0,rt]).nice(),M=Se.band().domain(bt).range([0,$t?Math.max(lt,$t*$.length):kt?Math.min(lt,kt*$.length):lt]).paddingInner(It),mt=h.ticks(Wt);J=Tt.motion.svg,_=`${At}px`,tt=`${g}px`,et=`0 0 ${At} ${g}`,A="ltr",N=Yt,t[87]!==L?(V=L?i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:i.jsxRuntimeExports.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,t[87]=L,t[88]=V):V=t[88],Q=`translate(${o.left},${o.top})`,Z=jt?i.jsxRuntimeExports.jsx(We.XTicksAndGridLines,{values:mt.filter(fi),x:mt.filter(hi).map(c=>h(c)),y1:0-Dt,y2:lt+o.bottom,styles:{gridLines:s?.xAxis?.gridLines,labels:s?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:Ft,prefix:Mt,labelType:"secondary",showGridLines:!0,precision:X}):null;const v=rt/2,w=0-o.top+15,a=s?.xAxis?.title,pt=n?.xAxis?.title;t[89]!==P||t[90]!==v||t[91]!==w||t[92]!==a||t[93]!==pt?(j=i.jsxRuntimeExports.jsx(Le.AxisTitle,{x:v,y:w,style:a,className:pt,text:P}),t[89]=P,t[90]=v,t[91]=w,t[92]=a,t[93]=pt,t[94]=j):j=t[94];const ie=s?.yAxis?.gridLines;let vt;t[95]!==ie?(vt={gridLines:ie},t[95]=ie,t[96]=vt):vt=t[96];const ne=n?.yAxis?.gridLines;let Y;t[97]!==ne?(Y={gridLines:ne},t[97]=ne,t[98]=Y):Y=t[98],R=i.jsxRuntimeExports.jsx($e.YTicksAndGridLines,{y:$.map(c=>M(`${c.id}`)+M.bandwidth()/2),x1:0,x2:rt,styles:vt,classNames:Y,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:X}),t[99]!==W?(C=W.filter(pi).map(mi),t[99]=W,t[100]=C):C=t[100],z=qe.AnimatePresence,it=$.map(c=>i.jsxRuntimeExports.jsxs(Tt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:0,y:M(`${c.id}`)+M.bandwidth()/2,opacity:ut.length!==0?ut.indexOf(c.label)!==-1?.85:b:.85},whileInView:{x:0,y:M(`${c.id}`)+M.bandwidth()/2,opacity:ut.length!==0?ut.indexOf(c.label)!==-1?.85:b:.85,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},children:[Lt?i.jsxRuntimeExports.jsx(Ge.YAxesLabels,{value:`${c.label}`.length<ht?`${c.label}`:`${`${c.label}`.substring(0,ht)}...`,y:0-M.bandwidth()/2,x:0-o.left,width:o.left,height:M.bandwidth(),alignment:"right",style:s?.yAxis?.labels,className:n?.yAxis?.labels,animate:m,isInView:U}):null,i.jsxRuntimeExports.jsx(Tt.motion.line,{y1:0,y2:0,style:{strokeWidth:Pt,...s?.dataConnectors||{},opacity:F?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",n?.dataConnectors),markerEnd:L&&c.x.indexOf(Math.min(...c.x.filter(di)))===0?"url(#arrow)":"",markerStart:L&&c.x.indexOf(Math.min(...c.x.filter(xi)))===c.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x1:0,x2:0},whileInView:{x1:h(Math.min(...c.x.filter(ui)))+at,x2:h(Math.max(...c.x.filter(ci)))-at,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial"}),c.x.map((S,r)=>i.jsxRuntimeExports.jsx(Tt.motion.g,{onMouseEnter:I=>{yt({...c,xIndex:r}),Rt(I.clientY),Ot(I.clientX),ct?.({...c,xIndex:r})},onClick:()=>{(q||O)&&(Me.isEqual(gt,{...c,xIndex:r})&&_t?(Ut(void 0),q?.(void 0)):(Ut({...c,xIndex:r}),q&&q({...c,xIndex:r})))},onMouseMove:I=>{yt({...c,xIndex:r}),Rt(I.clientY),Ot(I.clientX)},onMouseLeave:()=>{yt(void 0),Ot(void 0),Rt(void 0),ct?.(void 0)},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:F?k[r]===F?1:.3:1},whileInView:{opacity:F?k[r]===F?1:.3:1,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial",children:qt.checkIfNullOrUndefined(S)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Tt.motion.circle,{cy:0,r:at,style:{fill:k[r],fillOpacity:.85,stroke:k[r],strokeWidth:1,opacity:qt.checkIfNullOrUndefined(S)?0:1},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{cx:h(0),opacity:0},whileInView:{cx:h(S||0),opacity:qt.checkIfNullOrUndefined(S)?0:1,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial"}),wt?i.jsxRuntimeExports.jsx(Tt.motion.text,{y:0,style:{textAnchor:"middle",...s?.graphObjectValues||{}},dx:0,dy:0-at-3,className:i.mo("graph-value text-sm font-bold",qt.checkIfNullOrUndefined(S)?"0opacity-0":"opacity-100",n?.graphObjectValues),exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:h(0),opacity:0,fill:Nt||k[r]},whileInView:{x:h(S||0),fill:Nt||k[r],opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial",children:ke.numberFormattingFunction(S,"NA",X,Mt,Ft)}):null]})},r))]},c.label)),K=Vt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:Vt.map((c,S)=>i.jsxRuntimeExports.jsx(Ne.RefLineX,{text:c.text,color:c.color,x:h(c.value),y1:0-o.top,y2:lt+o.bottom,textSide:h(c.value)>rt*.75||p?"left":"right",classNames:c.classNames,styles:c.styles,animate:m,isInView:U},S))}):null,t[16]=m,t[17]=L,t[18]=P,t[19]=bt,t[20]=It,t[21]=n?.dataConnectors,t[22]=n?.graphObjectValues,t[23]=n?.xAxis?.gridLines,t[24]=n?.xAxis?.labels,t[25]=n?.xAxis?.title,t[26]=n?.yAxis?.gridLines,t[27]=n?.yAxis?.labels,t[28]=Pt,t[29]=W,t[30]=$,t[31]=O,t[32]=b,t[33]=k,t[34]=lt,t[35]=rt,t[36]=g,t[37]=ut,t[38]=U,t[39]=o.bottom,t[40]=o.left,t[41]=o.top,t[42]=kt,t[43]=Zt,t[44]=$t,t[45]=ft,t[46]=gt,t[47]=Wt,t[48]=q,t[49]=ct,t[50]=X,t[51]=Mt,t[52]=at,t[53]=Vt,t[54]=_t,t[55]=p,t[56]=F,t[57]=Lt,t[58]=jt,t[59]=wt,t[60]=s?.dataConnectors,t[61]=s?.graphObjectValues,t[62]=s?.xAxis?.gridLines,t[63]=s?.xAxis?.labels,t[64]=s?.xAxis?.title,t[65]=s?.yAxis?.gridLines,t[66]=s?.yAxis?.labels,t[67]=Ft,t[68]=Dt,t[69]=ht,t[70]=Nt,t[71]=At,t[72]=z,t[73]=J,t[74]=K,t[75]=Q,t[76]=Z,t[77]=j,t[78]=R,t[79]=C,t[80]=_,t[81]=tt,t[82]=et,t[83]=A,t[84]=N,t[85]=V,t[86]=it}else z=t[72],J=t[73],K=t[74],Q=t[75],Z=t[76],j=t[77],R=t[78],C=t[79],_=t[80],tt=t[81],et=t[82],A=t[83],N=t[84],V=t[85],it=t[86];let nt;t[101]!==z||t[102]!==K||t[103]!==it?(nt=i.jsxRuntimeExports.jsxs(z,{children:[it,K]}),t[101]=z,t[102]=K,t[103]=it,t[104]=nt):nt=t[104];let xt;t[105]!==W?(xt=W.filter(li).map(ri),t[105]=W,t[106]=xt):xt=t[106];let D;t[107]!==Q||t[108]!==Z||t[109]!==j||t[110]!==R||t[111]!==C||t[112]!==nt||t[113]!==xt?(D=i.jsxRuntimeExports.jsxs("g",{transform:Q,children:[Z,j,R,C,nt,xt]}),t[107]=Q,t[108]=Z,t[109]=j,t[110]=R,t[111]=C,t[112]=nt,t[113]=xt,t[114]=D):D=t[114];let B;t[115]!==J||t[116]!==_||t[117]!==tt||t[118]!==et||t[119]!==A||t[120]!==N||t[121]!==V||t[122]!==D?(B=i.jsxRuntimeExports.jsxs(J,{width:_,height:tt,viewBox:et,direction:A,ref:N,children:[V,D]}),t[115]=J,t[116]=_,t[117]=tt,t[118]=et,t[119]=A,t[120]=N,t[121]=V,t[122]=D,t[123]=B):B=t[123];let st;t[124]!==n?.tooltip||t[125]!==Et||t[126]!==zt||t[127]!==Ht||t[128]!==s?.tooltip||t[129]!==E?(st=Ht&&E&&Et&&zt?i.jsxRuntimeExports.jsx(Ie.Tooltip,{data:Ht,body:E,xPos:Et,yPos:zt,backgroundStyle:s?.tooltip,className:n?.tooltip}):null,t[124]=n?.tooltip,t[125]=Et,t[126]=zt,t[127]=Ht,t[128]=s?.tooltip,t[129]=E,t[130]=st):st=t[130];let dt;t[131]!==n?.modal||t[132]!==O||t[133]!==gt?(dt=O&>!==void 0?i.jsxRuntimeExports.jsx(Ve.DetailsModal,{body:O,data:gt,setData:Ut,className:n?.modal}):null,t[131]=n?.modal,t[132]=O,t[133]=gt,t[134]=dt):dt=t[134];let f;return t[135]!==B||t[136]!==st||t[137]!==dt?(f=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[B,st,dt]}),t[135]=B,t[136]=st,t[137]=dt,t[138]=f):f=t[138],f}function ri(e){return e.layer}function li(e){return e.position==="after"}function ci(e){return e!==null}function ui(e){return e!==null}function xi(e){return e!==null}function di(e){return e!==null}function mi(e){return e.layer}function pi(e){return e.position==="before"}function hi(e,t){return t!==0}function fi(e,t){return t!==0}function yi(e){return`${e.id}`}function gi(e){const t=i.compilerRuntimeExports.c(120),{data:d,graphTitle:Jt,colors:se,sources:Kt,graphDescription:Qt,barPadding:k,showTicks:Ft,leftMargin:Mt,rightMargin:It,topMargin:wt,bottomMargin:jt,truncateBy:ht,height:At,width:g,footNote:at,colorDomain:Lt,colorLegendTitle:E,padding:ct,backgroundColor:Zt,radius:ft,tooltip:q,showLabels:F,relativeHeight:L,onSeriesMouseOver:Pt,graphID:kt,suffix:$t,prefix:_t,maxValue:O,minValue:P,onSeriesMouseClick:Wt,graphDownload:Nt,dataDownload:s,showValues:n,sortParameter:y,arrowConnector:Vt,connectorStrokeWidth:p,language:m,minHeight:X,theme:W,maxBarThickness:ut,maxNumberOfBars:b,minBarThickness:Gt,ariaLabel:Bt,resetSelectionOnDoubleClick:Dt,detailsOnClick:te,axisTitle:Yt,noOfTicks:H,valueColor:U,orientation:Xt,styles:l,classNames:o,labelOrder:rt,refValues:lt,filterNA:Ht,animate:yt,precision:gt,showColorScale:Ut,customLayers:Et,highlightedDataPoints:Ot,dimmedOpacity:zt,timeline:Rt,sortData:G}=e,$=se===void 0?Ue.Colors.light.categoricalColors.colors:se,St=k===void 0?.25:k,bt=Ft===void 0?!0:Ft,z=ht===void 0?999:ht,J=Zt===void 0?!0:Zt,K=ft===void 0?3:ft,Q=F===void 0?!0:F,Z=$t===void 0?"":$t,j=_t===void 0?"":_t,R=Nt===void 0?!1:Nt,C=s===void 0?!1:s,_=n===void 0?!0:n,tt=Vt===void 0?!1:Vt,et=p===void 0?2:p,A=m===void 0?"en":m,N=X===void 0?0:X,V=W===void 0?"light":W,it=Dt===void 0?!0:Dt,nt=H===void 0?5:H,xt=Xt===void 0?"vertical":Xt,D=Ht===void 0?!0:Ht,B=yt===void 0?!1:yt,st=gt===void 0?2:gt,dt=Ut===void 0?!0:Ut;let f;t[0]!==Et?(f=Et===void 0?[]:Et,t[0]=Et,t[1]=f):f=t[1];const h=f;let M;t[2]!==Ot?(M=Ot===void 0?[]:Ot,t[2]=Ot,t[3]=M):M=t[3];const mt=M,v=zt===void 0?.3:zt;let w;t[4]!==Rt?(w=Rt===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:Rt,t[4]=Rt,t[5]=w):w=t[5];const a=w,[pt,ie]=T.useState(0),[vt,ne]=T.useState(0),[Y,c]=T.useState(a.autoplay);let S;if(t[6]!==d||t[7]!==a.dateFormat){let u;t[9]!==a.dateFormat?(u=Ct=>je.parse(`${Ct.date}`,a.dateFormat||"yyyy",new Date).getTime(),t[9]=a.dateFormat,t[10]=u):u=t[10],S=[...new Set(d.filter(Ti).map(u))],S.sort(Si),t[6]=d,t[7]=a.dateFormat,t[8]=S}else S=t[8];const r=S,[I,ae]=T.useState(a.autoplay?0:r.length-1),[x,ee]=T.useState(void 0),ot=T.useRef(null),oe=T.useRef(null);let xe,de;t[11]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>{const u=new ResizeObserver(Ct=>{ie(Ct[0].target.clientWidth||620),ne(Ct[0].target.clientHeight||480)});return ot.current&&u.observe(ot.current),()=>u.disconnect()},de=[],t[11]=xe,t[12]=de):(xe=t[11],de=t[12]),T.useEffect(xe,de);let me,pe;t[13]!==Y||t[14]!==a.speed||t[15]!==r?(me=()=>{const u=setInterval(()=>{ae(Ct=>Ct<r.length-1?Ct+1:0)},(a.speed||2)*1e3);return Y||clearInterval(u),()=>clearInterval(u)},pe=[r,Y,a.speed],t[13]=Y,t[14]=a.speed,t[15]=r,t[16]=me,t[17]=pe):(me=t[16],pe=t[17]),T.useEffect(me,pe);const ge=a.dateFormat||"yyyy";let he;t[18]!==I||t[19]!==ge||t[20]!==a.showOnlyActiveDate||t[21]!==r?(he=Oe.getSliderMarks(r,I,a.showOnlyActiveDate,ge),t[18]=I,t[19]=ge,t[20]=a.showOnlyActiveDate,t[21]=r,t[22]=he):he=t[22];const fe=he,be=xt==="horizontal"?ai:ze,ve=o?.graphContainer,we=l?.graphContainer;let re;t[23]!==o?.description||t[24]!==o?.title||t[25]!==d||t[26]!==C||t[27]!==Qt||t[28]!==R||t[29]!==Jt||t[30]!==l?.description||t[31]!==l?.title||t[32]!==g?(re=Jt||Qt||R||C?i.jsxRuntimeExports.jsx(Be.GraphHeader,{styles:{title:l?.title,description:l?.description},classNames:{title:o?.title,description:o?.description},graphTitle:Jt,graphDescription:Qt,width:g,graphDownload:R?oe:void 0,dataDownload:C?d.map(Di).filter(Vi).length>0?d.map(Ni).filter($i):d.filter(Li):null}):null,t[23]=o?.description,t[24]=o?.title,t[25]=d,t[26]=C,t[27]=Qt,t[28]=R,t[29]=Jt,t[30]=l?.description,t[31]=l?.title,t[32]=g,t[33]=re):re=t[33];let le;t[34]!==I||t[35]!==fe||t[36]!==Y||t[37]!==a.enabled||t[38]!==r?(le=a.enabled&&r.length>0&&fe?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{c(!Y)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":Y?"Click to pause animation":"Click to play animation",children:Y?i.jsxRuntimeExports.jsx(Ce.Pause,{}):i.jsxRuntimeExports.jsx(Ce.Play,{})}),i.jsxRuntimeExports.jsx(Oe.Nr,{min:r[0],max:r[r.length-1],marks:fe,step:null,defaultValue:r[r.length-1],value:r[I],onChangeComplete:u=>{ae(r.indexOf(u))},onChange:u=>{ae(r.indexOf(u))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[34]=I,t[35]=fe,t[36]=Y,t[37]=a.enabled,t[38]=r,t[39]=le):le=t[39];let ce;t[40]!==be||t[41]!==B||t[42]!==tt||t[43]!==Yt||t[44]!==St||t[45]!==jt||t[46]!==o||t[47]!==Lt||t[48]!==E||t[49]!==$||t[50]!==et||t[51]!==h||t[52]!==d||t[53]!==te||t[54]!==v||t[55]!==D||t[56]!==mt||t[57]!==I||t[58]!==rt||t[59]!==A||t[60]!==Mt||t[61]!==ut||t[62]!==b||t[63]!==O||t[64]!==Gt||t[65]!==P||t[66]!==nt||t[67]!==Wt||t[68]!==Pt||t[69]!==st||t[70]!==j||t[71]!==K||t[72]!==lt||t[73]!==it||t[74]!==It||t[75]!==x||t[76]!==dt||t[77]!==Q||t[78]!==bt||t[79]!==_||t[80]!==G||t[81]!==y||t[82]!==l||t[83]!==Z||t[84]!==vt||t[85]!==pt||t[86]!==a.dateFormat||t[87]!==a.enabled||t[88]!==q||t[89]!==wt||t[90]!==z||t[91]!==r||t[92]!==U||t[93]!==g?(ce=d.length===0?i.jsxRuntimeExports.jsx(He.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[dt?i.jsxRuntimeExports.jsx(Xe.ColorLegendWithMouseOver,{width:g,colorDomain:Lt,colors:$,colorLegendTitle:E,setSelectedColor:ee,showNAColor:!1,className:o?.colorLegend}):null,i.jsxRuntimeExports.jsx(Re.GraphArea,{ref:ot,children:pt&&vt?i.jsxRuntimeExports.jsx(be,{data:y!==void 0?y==="diff"?Ee.orderBy(Ae.ensureCompleteDataForDumbbellChart(d,a.dateFormat||"yyyy").filter(u=>a.enabled?u.date===je.format(new Date(r[I]),a.dateFormat||"yyyy"):u).filter(u=>D?!u.x.every(Ii):u),Mi,[G||"asc"]).filter((u,Ct)=>b?Ct<b:!0):Ee.orderBy(Ae.ensureCompleteDataForDumbbellChart(d,a.dateFormat||"yyyy").filter(u=>a.enabled?u.date===je.format(new Date(r[I]),a.dateFormat||"yyyy"):u).filter(u=>D?!u.x.every(Ci):u),u=>qt.checkIfNullOrUndefined(u.x[y])?-1/0:u.x[y],[G||"asc"]).filter((u,Ct)=>b?Ct<b:!0):Ae.ensureCompleteDataForDumbbellChart(d,a.dateFormat||"yyyy").filter(u=>D?!u.x.every(Ri):u).filter((u,Ct)=>b?Ct<b:!0),dotColors:$,width:pt,height:vt,radius:K,barPadding:St,showTicks:bt,leftMargin:Mt,rightMargin:It,topMargin:wt,bottomMargin:jt,truncateBy:z,showLabels:Q,showValues:_,tooltip:q,suffix:Z,prefix:j,onSeriesMouseOver:Pt,maxValue:qt.checkIfNullOrUndefined(O)?Math.max(...d.map(Ei))<0?0:Math.max(...d.map(Ai)):O,minValue:qt.checkIfNullOrUndefined(P)?Math.min(...d.map(wi))>0?0:Math.min(...d.map(bi)):P,onSeriesMouseClick:Wt,selectedColor:x,arrowConnector:tt,connectorStrokeWidth:et,maxBarThickness:ut,minBarThickness:Gt,resetSelectionOnDoubleClick:it,detailsOnClick:te,axisTitle:Yt,noOfTicks:nt,valueColor:U,styles:l,classNames:o,labelOrder:rt,refValues:lt,animate:B===!0?{duration:.5,once:!0,amount:.5}:B||{duration:0,once:!0,amount:0},precision:st,customLayers:h,highlightedDataPoints:mt,dimmedOpacity:v,rtl:A==="ar"||A==="he"}):null})]}),t[40]=be,t[41]=B,t[42]=tt,t[43]=Yt,t[44]=St,t[45]=jt,t[46]=o,t[47]=Lt,t[48]=E,t[49]=$,t[50]=et,t[51]=h,t[52]=d,t[53]=te,t[54]=v,t[55]=D,t[56]=mt,t[57]=I,t[58]=rt,t[59]=A,t[60]=Mt,t[61]=ut,t[62]=b,t[63]=O,t[64]=Gt,t[65]=P,t[66]=nt,t[67]=Wt,t[68]=Pt,t[69]=st,t[70]=j,t[71]=K,t[72]=lt,t[73]=it,t[74]=It,t[75]=x,t[76]=dt,t[77]=Q,t[78]=bt,t[79]=_,t[80]=G,t[81]=y,t[82]=l,t[83]=Z,t[84]=vt,t[85]=pt,t[86]=a.dateFormat,t[87]=a.enabled,t[88]=q,t[89]=wt,t[90]=z,t[91]=r,t[92]=U,t[93]=g,t[94]=ce):ce=t[94];let ue;t[95]!==o?.footnote||t[96]!==o?.source||t[97]!==at||t[98]!==Kt||t[99]!==l?.footnote||t[100]!==l?.source||t[101]!==g?(ue=Kt||at?i.jsxRuntimeExports.jsx(Ye.GraphFooter,{styles:{footnote:l?.footnote,source:l?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:Kt,footNote:at,width:g}):null,t[95]=o?.footnote,t[96]=o?.source,t[97]=at,t[98]=Kt,t[99]=l?.footnote,t[100]=l?.source,t[101]=g,t[102]=ue):ue=t[102];let ye;return t[103]!==Bt||t[104]!==J||t[105]!==kt||t[106]!==At||t[107]!==A||t[108]!==N||t[109]!==ct||t[110]!==L||t[111]!==ve||t[112]!==we||t[113]!==re||t[114]!==le||t[115]!==ce||t[116]!==ue||t[117]!==V||t[118]!==g?(ye=i.jsxRuntimeExports.jsxs(Re.GraphContainer,{className:ve,style:we,id:kt,ref:oe,"aria-label":Bt,backgroundColor:J,theme:V,language:A,minHeight:N,width:g,height:At,relativeHeight:L,padding:ct,children:[re,le,ce,ue]}),t[103]=Bt,t[104]=J,t[105]=kt,t[106]=At,t[107]=A,t[108]=N,t[109]=ct,t[110]=L,t[111]=ve,t[112]=we,t[113]=re,t[114]=le,t[115]=ce,t[116]=ue,t[117]=V,t[118]=g,t[119]=ye):ye=t[119],ye}function bi(e){return Math.min(...e.x.filter(vi))}function vi(e){return e!==null}function wi(e){return Math.min(...e.x.filter(ji))}function ji(e){return e!==null}function Ai(e){return Math.max(...e.x.filter(ki))}function ki(e){return e!==null}function Ei(e){return Math.max(...e.x.filter(Oi))}function Oi(e){return e!==null}function Ri(e){return e==null}function Ci(e){return e==null}function Mi(e){return qt.checkIfNullOrUndefined(e.x[e.x.length-1])||qt.checkIfNullOrUndefined(e.x[0])?-1/0:e.x[e.x.length-1]-e.x[0]}function Ii(e){return e==null}function Li(e){return e!==void 0}function $i(e){return e!==void 0}function Ni(e){return e.data}function Vi(e){return e!==void 0}function Di(e){return e.data}function Si(e,t){return e-t}function Ti(e){return e.date}exports.DumbbellChart=gi;
|
|
2
2
|
//# sourceMappingURL=DumbbellChart.cjs.map
|
package/dist/DumbbellChart.js
CHANGED
|
@@ -20,7 +20,7 @@ import { b as Fe } from "./band-DHUZ2X7J.js";
|
|
|
20
20
|
import { u as Pe } from "./use-in-view-Cxa7y1TH.js";
|
|
21
21
|
import { m as Pt } from "./proxy-BxkFHwUw.js";
|
|
22
22
|
import { A as We } from "./index-BqfRwk1n.js";
|
|
23
|
-
import { e as Me } from "./ensureCompleteData-
|
|
23
|
+
import { e as Me } from "./ensureCompleteData-DH5c52Ub.js";
|
|
24
24
|
import { a as Ue, G as Je } from "./GraphContainer-CRqzdKu2.js";
|
|
25
25
|
import { GraphHeader as Ke } from "./GraphHeader.js";
|
|
26
26
|
import { P as Qe, e as Ze } from "./index-D491FEn1.js";
|