@undp/data-viz 2.0.2 → 2.0.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/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +2 -2
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.cjs.map +1 -1
- package/dist/BeeSwarmChart.js +107 -106
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +2 -2
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.cjs.map +1 -1
- package/dist/DonutChart.js +24 -32
- package/dist/DonutChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +2 -2
- package/dist/{GraphEl-D5MUfp45.cjs → GraphEl-D5RBCD7p.cjs} +2 -2
- package/dist/{GraphEl-D5MUfp45.cjs.map → GraphEl-D5RBCD7p.cjs.map} +1 -1
- package/dist/{GraphEl-BZne2JIx.js → GraphEl-VtiYqELy.js} +2 -2
- package/dist/{GraphEl-BZne2JIx.js.map → GraphEl-VtiYqELy.js.map} +1 -1
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +1 -1
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +2 -2
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +1 -1
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/XAxesLabels-Bt5NZBmX.cjs +2 -0
- package/dist/XAxesLabels-Bt5NZBmX.cjs.map +1 -0
- package/dist/XAxesLabels-Dy8E1SEo.js +63 -0
- package/dist/XAxesLabels-Dy8E1SEo.js.map +1 -0
- package/dist/YAxesLabels-DesLesUP.cjs +2 -0
- package/dist/YAxesLabels-DesLesUP.cjs.map +1 -0
- package/dist/YAxesLabels-a57ZRv-0.js +61 -0
- package/dist/YAxesLabels-a57ZRv-0.js.map +1 -0
- package/dist/imageDownload-BU4qnxJP.js +991 -0
- package/dist/imageDownload-BU4qnxJP.js.map +1 -0
- package/dist/imageDownload-NYXbvKob.cjs +15 -0
- package/dist/imageDownload-NYXbvKob.cjs.map +1 -0
- package/dist/{index-Ceppbd8C.js → index-B2LQV7Tk.js} +109 -116
- package/dist/index-B2LQV7Tk.js.map +1 -0
- package/dist/index-xRHRLDIp.cjs +2 -0
- package/dist/index-xRHRLDIp.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +2 -2
- package/readme.md +1 -1
- package/dist/XAxesLabels-C1XSXoWG.cjs +0 -2
- package/dist/XAxesLabels-C1XSXoWG.cjs.map +0 -1
- package/dist/XAxesLabels-Dmbk50u4.js +0 -75
- package/dist/XAxesLabels-Dmbk50u4.js.map +0 -1
- package/dist/YAxesLabels-1XTb-D0_.js +0 -72
- package/dist/YAxesLabels-1XTb-D0_.js.map +0 -1
- package/dist/YAxesLabels-pjdsVwIM.cjs +0 -2
- package/dist/YAxesLabels-pjdsVwIM.cjs.map +0 -1
- package/dist/imageDownload-BX6SILNZ.js +0 -497
- package/dist/imageDownload-BX6SILNZ.js.map +0 -1
- package/dist/imageDownload-CgDcm1Sj.cjs +0 -3
- package/dist/imageDownload-CgDcm1Sj.cjs.map +0 -1
- package/dist/index-C6LorfZ-.cjs +0 -2
- package/dist/index-C6LorfZ-.cjs.map +0 -1
- package/dist/index-Ceppbd8C.js.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\nimport { Modal } from '@undp/design-system-react/Modal';\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 { string2HTML } from '@/Utils/string2HTML';\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\r\n className='flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4'\r\n style={{\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '0.125rem',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n height: 'inherit',\r\n padding: '0 1rem',\r\n }}\r\n >\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 <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { 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","D","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","display","flexDirection","gap","justifyContent","alignItems","height","padding","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","__html","string2HTML","t13","Fragment","DonutChart","graphTitle","light","categoricalColors","sources","graphDescription","footNote","showColorScale","backgroundColor","graphID","graphDownload","dataDownload","sortData","language","theme","width","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;AACzB,SAAOA,EAAE;AACX;AAEA,SAASC,GAAeD,GAAG;AACzB,SAAOA,EAAE;AACX;AAEA,SAASE,GAAcF,GAAG;AACxB,SAAOA,EAAE;AACX;AAEA,SAASG,GAAYH,GAAG;AACtB,SAAOA,EAAE;AACX;AAEA,SAASI,GAAYJ,GAAG;AACtB,SAAOA,KAAKA,EAAE;AAChB;AAEA,SAASK,GAAUC,G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J,UAAAA;AAAAA,UAAAA,EAAEuJ;AAAAA,UAAM;AAAA,UAAE;AAAA,UACXZ,gBAAAA,EAAAA,IAAC,QAAA,EAAK,WAAU,aAAY,OAAO;AAAA,YAAE8F,UAAU;AAAA,UAAA,GAC5CjF,aAAyBxJ,EAAE0J,MAAM,MAAMjC,GAAWkC,GAAQC,CAAM,EAAA,CACnE;AAAA,QAAA,EAAA,CACF;AAAA,MAAA,EAAA,GAtBiD/D,CAuBnD,CACD,EAAA,CACH,IACE;AAAA,MACJ8C,gBAAAA,EAAAA,IAAC+F,IAAA,EAAO,MAAK,KAAA,CAAI;AAAA,MACjB/F,gBAAAA,EAAAA,IAACgG,IAAA,EAAU,KAAK9B,GACbF,UAAAA,IACChE,gBAAAA,EAAAA,IAACnC,IAAA,EACC,UAAAI,GACA,MAAMgH,GACN,QAAA9G,GACA,QAAQ6F,GACR,SAAA5F,GACA,aAAAC,GACA,SAAAC,GACA,aAAaG,KAAewG,EAAWhD,IAAI5K,CAAAA,MAAKA,EAAEuJ,KAAK,GACvD,mBAAArC,GACA,oBAAAC,GACA,6BAAAE,GACA,QAAAE,GACA,gBAAAD,GACA,WAAAG,EAAA,CAAqB,IAErB,KAAA,CACN;AAAA,IAAA,GACF;AAAA,IAEDkE,KAAWE,IACVlD,gBAAAA,EAAAA,IAACiG,IAAA,EACC,QAAQ;AAAA,MAAEC,UAAUtH,GAAQsH;AAAAA,MAAUC,QAAQvH,GAAQuH;AAAAA,IAAAA,GACtD,YAAY;AAAA,MACVD,UAAUrH,GAAYqH;AAAAA,MACtBC,QAAQtH,GAAYsH;AAAAA,IAAAA,GAEtB,SAAAnD,GACA,UAAAE,GACA,OAAAS,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/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\nimport { Modal } from '@undp/design-system-react/Modal';\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 { string2HTML } from '@/Utils/string2HTML';\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 <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { 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","D","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","__html","string2HTML","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;AACzB,SAAOA,EAAE;AACX;AAEA,SAASC,GAAeD,GAAG;AACzB,SAAOA,EAAE;AACX;AAEA,SAASE,GAAcF,GAAG;AACxB,SAAOA,EAAE;AACX;AAEA,SAASG,GAAYH,GAAG;AACtB,SAAOA,EAAE;AACX;AAEA,SAASI,GAAYJ,GAAG;AACtB,SAAOA,KAAKA,EAAE;AAChB;AAEA,SAASK,GAAUC,GAAIC,GAAIC,GAAIC,GAAIC,GAAIC,GAAIC,GAAIC,GAAI;AACjD,MAAIC,IAAMN,IAAKF,GAAIS,IAAMN,IAAKF,GAC1BS,IAAMJ,IAAKF,GAAIO,IAAMJ,IAAKF,GAC1BO,IAAID,IAAMH,IAAME,IAAMD;AAC1B,MAAI,EAAAG,IAAIA,IAAI1B;AACZ,WAAA0B,KAAKF,KAAOT,IAAKI,KAAMM,KAAOX,IAAKI,MAAOQ,GACnC,CAACZ,IAAKY,I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F,UAAAA,IACC3D,gBAAAA,EAAAA,IAACnC,IAAA,EACC,UAAAI,GACA,MAAM2G,GACN,QAAAzG,GACA,QAAQwF,GACR,SAAAvF,GACA,aAAAC,GACA,SAAAC,GACA,aAAaG,KAAemG,EAAWlD,IAAIrK,CAAAA,MAAKA,EAAEgJ,KAAK,GACvD,mBAAA9B,GACA,oBAAAC,GACA,6BAAAE,GACA,QAAAE,GACA,gBAAAD,GACA,WAAAG,EAAA,CAAqB,IAErB,KAAA,CACN;AAAA,IAAA,GACF;AAAA,IAED2D,KAAWE,IACV3C,gBAAAA,EAAAA,IAAC4F,IAAA,EACC,QAAQ;AAAA,MAAEC,UAAUjH,GAAQiH;AAAAA,MAAUC,QAAQlH,GAAQkH;AAAAA,IAAAA,GACtD,YAAY;AAAA,MACVD,UAAUhH,GAAYgH;AAAAA,MACtBC,QAAQjH,GAAYiH;AAAAA,IAAAA,GAEtB,SAAArD,GACA,UAAAE,GACA,OAAAU,EAAA,CAAa,IAEb;AAAA,EAAA,GACN;AAEJ;","x_google_ignoreList":[0,1,2,3,4]}
|
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"),be=require("./index-Cno4Q0YE.cjs"),he=require("./parse-hMnG_lRV.cjs"),C=require("react"),ve=require("./getSliderMarks-BmADcPQt.cjs"),ke=require("./index-DQA8q5sC.cjs"),Ae=require("./Modal-JW_IExO3.cjs"),ye=require("./numberFormattingFunction-02t-wJta.cjs"),Ee=require("./Tooltip-4dJo4_AF.cjs"),Ct=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Re=require("./string2HTML-CPGr_I5E.cjs"),Ce=require("./AxisTitle-sS5bLLR7.cjs"),Te=require("./Axis-DxRV2yMi.cjs"),Se=require("./XAxesLabels-C1XSXoWG.cjs"),Oe=require("./YTicksAndGridLines-4pxTRlRK.cjs"),Me=require("./ReferenceLine-BH0qdf4R.cjs"),De=require("./XTicksAndGridLines-B6CELS7q.cjs"),qe=require("./YAxesLabels-pjdsVwIM.cjs"),Ie=require("./linear-BwPAspcq.cjs"),Le=require("./band-VYfcZeJ2.cjs"),$e=require("./use-in-view-QcfiW0w3.cjs"),Rt=require("./proxy-BxvUI_9l.cjs"),Ne=require("./index-DG2bgAva.cjs"),fe=require("./ensureCompleteData-I6nYmT8E.cjs"),Fe=require("./uniqBy-O05lp2S5.cjs"),je=require("./GraphContainer-d8A46BK2.cjs"),Pe=require("./GraphHeader.cjs"),we=require("./index-DRXx7m-C.cjs"),Be=require("./GraphFooter.cjs"),He=require("./ColorLegendWithMouseOver.cjs"),We=require("./EmptyState-sAEZ_5rU.cjs"),Ge=require("./Colors.cjs"),Ye=require("./sort-O96oMZLb.cjs"),Xe=require("./init-DU0ybBc_.cjs");function Ue(e){const t=i.compilerRuntimeExports.c(139),{data:h,leftMargin:Dt,rightMargin:ie,topMargin:qt,bottomMargin:Ft,dotColors:v,barPadding:Ot,showTicks:Pt,truncateBy:Bt,width:Mt,height:It,radius:st,showLabels:ut,tooltip:g,onSeriesMouseOver:D,maxValue:Ht,minValue:O,onSeriesMouseClick:X,showValues:Wt,suffix:ot,prefix:q,selectedColor:M,arrowConnector:k,connectorStrokeWidth:Ut,maxBarThickness:xt,minBarThickness:vt,resetSelectionOnDoubleClick:Gt,detailsOnClick:m,axisTitle:F,noOfTicks:zt,valueColor:jt,styles:n,classNames:s,labelOrder:I,refValues:wt,animate:d,precision:u,customLayers:$,highlightedDataPoints:L,dimmedOpacity:dt}=e,b=Dt===void 0?20:Dt,Jt=ie===void 0?20:ie,Lt=qt===void 0?20:qt,kt=Ft===void 0?25:Ft,ne=C.useRef(null);let Kt;t[0]!==d.amount||t[1]!==d.once?(Kt={once:d.once,amount:d.amount},t[0]=d.amount,t[1]=d.once,t[2]=Kt):Kt=t[2];const N=$e.useInView(ne,Kt),U=F?b+30:b;let $t;t[3]!==kt||t[4]!==Jt||t[5]!==U||t[6]!==Lt?($t={top:Lt,bottom:kt,left:U,right:Jt},t[3]=kt,t[4]=Jt,t[5]=U,t[6]=Lt,t[7]=$t):$t=t[7];const a=$t,o=Mt-a.left-a.right,rt=It-a.top-a.bottom,[at,Nt]=C.useState(void 0),[P,B]=C.useState(void 0),[Vt,mt]=C.useState(void 0),[pt,Tt]=C.useState(void 0);let ht,H,W,z,A,V,E,J,K,Q,Z,j,w,_,tt;if(t[8]!==d||t[9]!==k||t[10]!==F||t[11]!==Ot||t[12]!==s?.dataConnectors||t[13]!==s?.graphObjectValues||t[14]!==s?.xAxis?.axis||t[15]!==s?.xAxis?.labels||t[16]!==s?.yAxis?.gridLines||t[17]!==s?.yAxis?.labels||t[18]!==s?.yAxis?.title||t[19]!==Ut||t[20]!==$||t[21]!==h||t[22]!==m||t[23]!==dt||t[24]!==v||t[25]!==rt||t[26]!==o||t[27]!==It||t[28]!==L||t[29]!==N||t[30]!==I||t[31]!==b||t[32]!==a.bottom||t[33]!==a.left||t[34]!==a.right||t[35]!==a.top||t[36]!==xt||t[37]!==Ht||t[38]!==vt||t[39]!==O||t[40]!==P||t[41]!==zt||t[42]!==X||t[43]!==D||t[44]!==u||t[45]!==q||t[46]!==st||t[47]!==wt||t[48]!==Gt||t[49]!==M||t[50]!==ut||t[51]!==Pt||t[52]!==Wt||t[53]!==n?.dataConnectors||t[54]!==n?.graphObjectValues||t[55]!==n?.xAxis?.axis||t[56]!==n?.xAxis?.labels||t[57]!==n?.yAxis?.gridLines||t[58]!==n?.yAxis?.labels||t[59]!==n?.yAxis?.title||t[60]!==ot||t[61]!==Bt||t[62]!==jt||t[63]!==Mt){let yt;t[79]!==I?(yt=(l,ct)=>({...l,id:I?`${l.label}`:`${ct}`}),t[79]=I,t[80]=yt):yt=t[80];const At=h.map(yt),Qt=I||At.map(si),G=Ie.linear().domain([O,Ht]).range([rt,0]).nice(),f=Le.band().domain(Qt).range([0,vt?Math.max(o,vt*At.length):xt?Math.min(o,xt*At.length):o]).paddingInner(Ot),gt=G.ticks(zt);H=Rt.motion.svg,E=`${Mt}px`,J=`${It}px`,K=`0 0 ${Mt} ${It}`,Q="ltr",Z=ne,t[81]!==k?(j=k?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[81]=k,t[82]=j):j=t[82],tt=`translate(${a.left},${a.top})`;const Zt=G(O<0?0:O),se=G(O<0?0:O),_t=O<0?0:O;let p;t[83]!==u||t[84]!==q||t[85]!==ot||t[86]!==_t?(p=ye.numberFormattingFunction(_t,"NA",u,q,ot),t[83]=u,t[84]=q,t[85]=ot,t[86]=_t,t[87]=p):p=t[87];const Yt=s?.xAxis?.axis,te=s?.yAxis?.labels;let Et;t[88]!==Yt||t[89]!==te?(Et={axis:Yt,label:te},t[88]=Yt,t[89]=te,t[90]=Et):Et=t[90];const ee=n?.xAxis?.axis,lt=n?.yAxis?.labels;let r;t[91]!==ee||t[92]!==lt?(r={axis:ee,label:lt},t[91]=ee,t[92]=lt,t[93]=r):r=t[93],W=i.jsxRuntimeExports.jsx(Te.Axis,{y1:Zt,y2:se,x1:0-b,x2:o+a.right,label:p,labelPos:{x:0-b,dx:0,dy:Ht<0?"1em":-5,y:G(O<0?0:O)},classNames:Et,styles:r}),z=Pt?i.jsxRuntimeExports.jsx(Oe.YTicksAndGridLines,{values:gt.filter(ni),y:gt.filter(ii).map(l=>G(l)),x1:0-b,x2:o+a.right,styles:{gridLines:n?.yAxis?.gridLines,labels:n?.yAxis?.labels},classNames:{gridLines:s?.yAxis?.gridLines,labels:s?.yAxis?.labels},suffix:ot,prefix:q,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:u}):null;const x=0-b-15,y=rt/2,bt=n?.yAxis?.title,ae=s?.yAxis?.title;t[94]!==F||t[95]!==x||t[96]!==y||t[97]!==bt||t[98]!==ae?(A=i.jsxRuntimeExports.jsx(Ce.AxisTitle,{x,y,style:bt,className:ae,text:F,rotate90:!0}),t[94]=F,t[95]=x,t[96]=y,t[97]=bt,t[98]=ae,t[99]=A):A=t[99],t[100]!==$?(V=$.filter(ei).map(ti),t[100]=$,t[101]=V):V=t[101],ht=Ne.AnimatePresence,w=At.map(l=>i.jsxRuntimeExports.jsxs(Rt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:f(`${l.id}`)+f.bandwidth()/2,y:0,opacity:L.length!==0?L.indexOf(l.label)!==-1?.85:dt:.85},whileInView:{x:f(`${l.id}`)+f.bandwidth()/2,y:0,opacity:L.length!==0?L.indexOf(l.label)!==-1?.85:dt:.85,transition:{duration:d.duration}}},initial:"initial",animate:N?"whileInView":"initial",exit:{opacity:0,transition:{duration:d.duration}},children:[ut?i.jsxRuntimeExports.jsx(Se.XAxesLabels,{value:`${l.label}`.length<Bt?`${l.label}`:`${`${l.label}`.substring(0,Bt)}...`,y:rt+5,x:0-f.bandwidth()/2,width:f.bandwidth(),height:a.bottom,style:n?.xAxis?.labels,className:s?.xAxis?.labels,alignment:"top",animate:d,isInView:N}):null,i.jsxRuntimeExports.jsx(Rt.motion.line,{x1:0,x2:0,style:{strokeWidth:Ut,...n?.dataConnectors||{},opacity:M?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",s?.dataConnectors),markerEnd:k&&l.x.indexOf(Math.min(...l.x.filter(_e)))===0?"url(#arrow)":"",markerStart:k&&l.x.indexOf(Math.min(...l.x.filter(Ze)))===l.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:d.duration}},variants:{initial:{y1:0,y2:0},whileInView:{y1:G(Math.min(...l.x.filter(Qe)))+st,y2:G(Math.max(...l.x.filter(Ke)))-st,transition:{duration:d.duration}}},initial:"initial",animate:N?"whileInView":"initial"}),l.x.map((ct,Y)=>i.jsxRuntimeExports.jsx(Rt.motion.g,{onMouseEnter:Xt=>{Nt({...l,xIndex:Y}),Tt(Xt.clientY),mt(Xt.clientX),D?.({...l,xIndex:Y})},onClick:()=>{(X||m)&&(ke.isEqual(P,{...l,xIndex:Y})&&Gt?(B(void 0),X?.(void 0)):(B({...l,xIndex:Y}),X&&X({...l,xIndex:Y})))},onMouseMove:Xt=>{Nt({...l,xIndex:Y}),Tt(Xt.clientY),mt(Xt.clientX)},onMouseLeave:()=>{Nt(void 0),mt(void 0),Tt(void 0),D?.(void 0)},exit:{opacity:0,transition:{duration:d.duration}},variants:{initial:{opacity:M?v[Y]===M?1:.3:1},whileInView:{opacity:M?v[Y]===M?1:.3:1,transition:{duration:d.duration}}},initial:"initial",animate:N?"whileInView":"initial",children:Ct.checkIfNullOrUndefined(ct)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Rt.motion.circle,{cx:0,r:st,style:{fill:v[Y],fillOpacity:.85,stroke:v[Y],strokeWidth:1},exit:{opacity:0,transition:{duration:d.duration}},variants:{initial:{cy:G(0),opacity:0},whileInView:{cy:G(ct||0),opacity:Ct.checkIfNullOrUndefined(ct)?0:1,transition:{duration:d.duration}}},initial:"initial",animate:N?"whileInView":"initial"}),Wt?i.jsxRuntimeExports.jsx(Rt.motion.text,{x:0,style:{textAnchor:"start",...n?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",Ct.checkIfNullOrUndefined(ct)?"opacity-0":"opacity-100",s?.graphObjectValues),dx:st+3,dy:"0.33em",exit:{opacity:0,transition:{duration:d.duration}},variants:{initial:{y:G(0),opacity:0,fill:jt||v[Y]},whileInView:{y:G(ct||0),fill:jt||v[Y],opacity:1,transition:{duration:d.duration}}},initial:"initial",animate:N?"whileInView":"initial",children:ye.numberFormattingFunction(ct,"NA",u,q,ot)}):null]})},Y))]},l.label)),_=wt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:wt.map((l,ct)=>i.jsxRuntimeExports.jsx(Me.RefLineY,{text:l.text,color:l.color,y:G(l.value),x1:0-b,x2:o+a.right,classNames:l.classNames,styles:l.styles,animate:d,isInView:N},ct))}):null,t[8]=d,t[9]=k,t[10]=F,t[11]=Ot,t[12]=s?.dataConnectors,t[13]=s?.graphObjectValues,t[14]=s?.xAxis?.axis,t[15]=s?.xAxis?.labels,t[16]=s?.yAxis?.gridLines,t[17]=s?.yAxis?.labels,t[18]=s?.yAxis?.title,t[19]=Ut,t[20]=$,t[21]=h,t[22]=m,t[23]=dt,t[24]=v,t[25]=rt,t[26]=o,t[27]=It,t[28]=L,t[29]=N,t[30]=I,t[31]=b,t[32]=a.bottom,t[33]=a.left,t[34]=a.right,t[35]=a.top,t[36]=xt,t[37]=Ht,t[38]=vt,t[39]=O,t[40]=P,t[41]=zt,t[42]=X,t[43]=D,t[44]=u,t[45]=q,t[46]=st,t[47]=wt,t[48]=Gt,t[49]=M,t[50]=ut,t[51]=Pt,t[52]=Wt,t[53]=n?.dataConnectors,t[54]=n?.graphObjectValues,t[55]=n?.xAxis?.axis,t[56]=n?.xAxis?.labels,t[57]=n?.yAxis?.gridLines,t[58]=n?.yAxis?.labels,t[59]=n?.yAxis?.title,t[60]=ot,t[61]=Bt,t[62]=jt,t[63]=Mt,t[64]=ht,t[65]=H,t[66]=W,t[67]=z,t[68]=A,t[69]=V,t[70]=E,t[71]=J,t[72]=K,t[73]=Q,t[74]=Z,t[75]=j,t[76]=w,t[77]=_,t[78]=tt}else ht=t[64],H=t[65],W=t[66],z=t[67],A=t[68],V=t[69],E=t[70],J=t[71],K=t[72],Q=t[73],Z=t[74],j=t[75],w=t[76],_=t[77],tt=t[78];let et;t[102]!==ht||t[103]!==w||t[104]!==_?(et=i.jsxRuntimeExports.jsxs(ht,{children:[w,_]}),t[102]=ht,t[103]=w,t[104]=_,t[105]=et):et=t[105];let R;t[106]!==$?(R=$.filter(Je).map(ze),t[106]=$,t[107]=R):R=t[107];let T;t[108]!==W||t[109]!==z||t[110]!==A||t[111]!==V||t[112]!==et||t[113]!==R||t[114]!==tt?(T=i.jsxRuntimeExports.jsxs("g",{transform:tt,children:[W,z,A,V,et,R]}),t[108]=W,t[109]=z,t[110]=A,t[111]=V,t[112]=et,t[113]=R,t[114]=tt,t[115]=T):T=t[115];let S;t[116]!==H||t[117]!==E||t[118]!==J||t[119]!==K||t[120]!==Q||t[121]!==Z||t[122]!==j||t[123]!==T?(S=i.jsxRuntimeExports.jsxs(H,{width:E,height:J,viewBox:K,direction:Q,ref:Z,children:[j,T]}),t[116]=H,t[117]=E,t[118]=J,t[119]=K,t[120]=Q,t[121]=Z,t[122]=j,t[123]=T,t[124]=S):S=t[124];let it;t[125]!==s?.tooltip||t[126]!==Vt||t[127]!==pt||t[128]!==at||t[129]!==n?.tooltip||t[130]!==g?(it=at&&g&&Vt&&pt?i.jsxRuntimeExports.jsx(Ee.Tooltip,{data:at,body:g,xPos:Vt,yPos:pt,backgroundStyle:n?.tooltip,className:s?.tooltip}):null,t[125]=s?.tooltip,t[126]=Vt,t[127]=pt,t[128]=at,t[129]=n?.tooltip,t[130]=g,t[131]=it):it=t[131];let nt;t[132]!==m||t[133]!==P?(nt=m&&P!==void 0?i.jsxRuntimeExports.jsx(Ae.le,{open:P!==void 0,onClose:()=>{B(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof m=="string"?{__html:Re.string2HTML(m,P)}:void 0,children:typeof m=="function"?m(P):null})}):null,t[132]=m,t[133]=P,t[134]=nt):nt=t[134];let ft;return t[135]!==S||t[136]!==it||t[137]!==nt?(ft=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[S,it,nt]}),t[135]=S,t[136]=it,t[137]=nt,t[138]=ft):ft=t[138],ft}function ze(e){return e.layer}function Je(e){return e.position==="after"}function Ke(e){return e!==null}function Qe(e){return e!==null}function Ze(e){return e!==null}function _e(e){return e!==null}function ti(e){return e.layer}function ei(e){return e.position==="before"}function ii(e){return e!==0}function ni(e){return e!==0}function si(e){return`${e.id}`}function oi(e){const t=i.compilerRuntimeExports.c(132),{data:h,leftMargin:Dt,rightMargin:ie,topMargin:qt,bottomMargin:Ft,dotColors:v,suffix:Ot,prefix:Pt,barPadding:Bt,showValues:Mt,showTicks:It,truncateBy:st,width:ut,height:g,radius:D,showLabels:Ht,tooltip:O,onSeriesMouseOver:X,maxValue:Wt,minValue:ot,onSeriesMouseClick:q,selectedColor:M,arrowConnector:k,connectorStrokeWidth:Ut,maxBarThickness:xt,minBarThickness:vt,resetSelectionOnDoubleClick:Gt,detailsOnClick:m,axisTitle:F,noOfTicks:zt,valueColor:jt,styles:n,classNames:s,labelOrder:I,refValues:wt,rtl:d,animate:u,precision:$,customLayers:L,highlightedDataPoints:dt,dimmedOpacity:b}=e,Jt=Dt===void 0?100:Dt,Lt=ie===void 0?40:ie,kt=qt===void 0?20:qt,ne=Ft===void 0?10:Ft,Kt=C.useRef(null);let N;t[0]!==u.amount||t[1]!==u.once?(N={once:u.once,amount:u.amount},t[0]=u.amount,t[1]=u.once,t[2]=N):N=t[2];const U=$e.useInView(Kt,N),$t=F?kt+25:kt;let a;t[3]!==ne||t[4]!==Jt||t[5]!==Lt||t[6]!==$t?(a={top:$t,bottom:ne,left:Jt,right:Lt},t[3]=ne,t[4]=Jt,t[5]=Lt,t[6]=$t,t[7]=a):a=t[7];const o=a,rt=ut-o.left-o.right,at=g-o.top-o.bottom,[Nt,P]=C.useState(void 0),[B,Vt]=C.useState(void 0),[mt,pt]=C.useState(void 0),[Tt,ht]=C.useState(void 0);let H,W,z,A,V,E,J,K,Q,Z,j,w,_,tt,et;if(t[8]!==u||t[9]!==k||t[10]!==F||t[11]!==Bt||t[12]!==s?.dataConnectors||t[13]!==s?.graphObjectValues||t[14]!==s?.xAxis?.gridLines||t[15]!==s?.xAxis?.labels||t[16]!==s?.xAxis?.title||t[17]!==s?.yAxis?.gridLines||t[18]!==s?.yAxis?.labels||t[19]!==Ut||t[20]!==L||t[21]!==h||t[22]!==m||t[23]!==b||t[24]!==v||t[25]!==at||t[26]!==rt||t[27]!==g||t[28]!==dt||t[29]!==U||t[30]!==I||t[31]!==o.bottom||t[32]!==o.left||t[33]!==o.top||t[34]!==xt||t[35]!==Wt||t[36]!==vt||t[37]!==ot||t[38]!==B||t[39]!==zt||t[40]!==q||t[41]!==X||t[42]!==$||t[43]!==Pt||t[44]!==D||t[45]!==wt||t[46]!==Gt||t[47]!==d||t[48]!==M||t[49]!==Ht||t[50]!==It||t[51]!==Mt||t[52]!==n?.dataConnectors||t[53]!==n?.graphObjectValues||t[54]!==n?.xAxis?.gridLines||t[55]!==n?.xAxis?.labels||t[56]!==n?.xAxis?.title||t[57]!==n?.yAxis?.gridLines||t[58]!==n?.yAxis?.labels||t[59]!==Ot||t[60]!==kt||t[61]!==st||t[62]!==jt||t[63]!==ut){let At;t[79]!==I?(At=(r,x)=>({...r,id:I?`${r.label}`:`${x}`}),t[79]=I,t[80]=At):At=t[80];const Qt=h.map(At),G=I||Qt.map(fi),f=Ie.linear().domain([ot,Wt]).range([0,rt]).nice(),gt=Le.band().domain(G).range([0,vt?Math.max(at,vt*Qt.length):xt?Math.min(at,xt*Qt.length):at]).paddingInner(Bt),Zt=f.ticks(zt);W=Rt.motion.svg,J=`${ut}px`,K=`${g}px`,Q=`0 0 ${ut} ${g}`,Z="ltr",j=Kt,t[81]!==k?(w=k?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[81]=k,t[82]=w):w=t[82],et=`translate(${o.left},${o.top})`,z=It?i.jsxRuntimeExports.jsx(De.XTicksAndGridLines,{values:Zt.filter(hi),x:Zt.filter(pi).map(r=>f(r)),y1:0-kt,y2:at+o.bottom,styles:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},classNames:{gridLines:s?.xAxis?.gridLines,labels:s?.xAxis?.labels},suffix:Ot,prefix:Pt,labelType:"secondary",showGridLines:!0,precision:$}):null;const se=rt/2,_t=0-o.top+15,p=n?.xAxis?.title,Yt=s?.xAxis?.title;t[83]!==F||t[84]!==se||t[85]!==_t||t[86]!==p||t[87]!==Yt?(A=i.jsxRuntimeExports.jsx(Ce.AxisTitle,{x:se,y:_t,style:p,className:Yt,text:F}),t[83]=F,t[84]=se,t[85]=_t,t[86]=p,t[87]=Yt,t[88]=A):A=t[88];const te=n?.yAxis?.gridLines;let Et;t[89]!==te?(Et={gridLines:te},t[89]=te,t[90]=Et):Et=t[90];const ee=s?.yAxis?.gridLines;let lt;t[91]!==ee?(lt={gridLines:ee},t[91]=ee,t[92]=lt):lt=t[92],V=i.jsxRuntimeExports.jsx(Oe.YTicksAndGridLines,{y:Qt.map(r=>gt(`${r.id}`)+gt.bandwidth()/2),x1:0,x2:rt,styles:Et,classNames:lt,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:$}),t[93]!==L?(E=L.filter(mi).map(di),t[93]=L,t[94]=E):E=t[94],H=Ne.AnimatePresence,_=Qt.map(r=>i.jsxRuntimeExports.jsxs(Rt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:0,y:gt(`${r.id}`)+gt.bandwidth()/2,opacity:dt.length!==0?dt.indexOf(r.label)!==-1?.85:b:.85},whileInView:{x:0,y:gt(`${r.id}`)+gt.bandwidth()/2,opacity:dt.length!==0?dt.indexOf(r.label)!==-1?.85:b:.85,transition:{duration:u.duration}}},initial:"initial",animate:U?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},children:[Ht?i.jsxRuntimeExports.jsx(qe.YAxesLabels,{value:`${r.label}`.length<st?`${r.label}`:`${`${r.label}`.substring(0,st)}...`,y:0-gt.bandwidth()/2,x:0-o.left,width:o.left,height:gt.bandwidth(),alignment:"right",style:n?.yAxis?.labels,className:s?.yAxis?.labels,animate:u,isInView:U}):null,i.jsxRuntimeExports.jsx(Rt.motion.line,{y1:0,y2:0,style:{strokeWidth:Ut,...n?.dataConnectors||{},opacity:M?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",s?.dataConnectors),markerEnd:k&&r.x.indexOf(Math.min(...r.x.filter(xi)))===0?"url(#arrow)":"",markerStart:k&&r.x.indexOf(Math.min(...r.x.filter(ui)))===r.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x1:0,x2:0},whileInView:{x1:f(Math.min(...r.x.filter(ci)))+D,x2:f(Math.max(...r.x.filter(li)))-D,transition:{duration:u.duration}}},initial:"initial",animate:U?"whileInView":"initial"}),r.x.map((x,y)=>i.jsxRuntimeExports.jsx(Rt.motion.g,{onMouseEnter:bt=>{P({...r,xIndex:y}),ht(bt.clientY),pt(bt.clientX),X?.({...r,xIndex:y})},onClick:()=>{(q||m)&&(ke.isEqual(B,{...r,xIndex:y})&&Gt?(Vt(void 0),q?.(void 0)):(Vt({...r,xIndex:y}),q&&q({...r,xIndex:y})))},onMouseMove:bt=>{P({...r,xIndex:y}),ht(bt.clientY),pt(bt.clientX)},onMouseLeave:()=>{P(void 0),pt(void 0),ht(void 0),X?.(void 0)},exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{opacity:M?v[y]===M?1:.3:1},whileInView:{opacity:M?v[y]===M?1:.3:1,transition:{duration:u.duration}}},initial:"initial",animate:U?"whileInView":"initial",children:Ct.checkIfNullOrUndefined(x)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Rt.motion.circle,{cy:0,r:D,style:{fill:v[y],fillOpacity:.85,stroke:v[y],strokeWidth:1,opacity:Ct.checkIfNullOrUndefined(x)?0:1},exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{cx:f(0),opacity:0},whileInView:{cx:f(x||0),opacity:Ct.checkIfNullOrUndefined(x)?0:1,transition:{duration:u.duration}}},initial:"initial",animate:U?"whileInView":"initial"}),Mt?i.jsxRuntimeExports.jsx(Rt.motion.text,{y:0,style:{textAnchor:"middle",...n?.graphObjectValues||{}},dx:0,dy:0-D-3,className:i.mo("graph-value text-sm font-bold",Ct.checkIfNullOrUndefined(x)?"0opacity-0":"opacity-100",s?.graphObjectValues),exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x:f(0),opacity:0,fill:jt||v[y]},whileInView:{x:f(x||0),fill:jt||v[y],opacity:1,transition:{duration:u.duration}}},initial:"initial",animate:U?"whileInView":"initial",children:ye.numberFormattingFunction(x,"NA",$,Pt,Ot)}):null]})},y))]},r.label)),tt=wt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:wt.map((r,x)=>i.jsxRuntimeExports.jsx(Me.RefLineX,{text:r.text,color:r.color,x:f(r.value),y1:0-o.top,y2:at+o.bottom,textSide:f(r.value)>rt*.75||d?"left":"right",classNames:r.classNames,styles:r.styles,animate:u,isInView:U},x))}):null,t[8]=u,t[9]=k,t[10]=F,t[11]=Bt,t[12]=s?.dataConnectors,t[13]=s?.graphObjectValues,t[14]=s?.xAxis?.gridLines,t[15]=s?.xAxis?.labels,t[16]=s?.xAxis?.title,t[17]=s?.yAxis?.gridLines,t[18]=s?.yAxis?.labels,t[19]=Ut,t[20]=L,t[21]=h,t[22]=m,t[23]=b,t[24]=v,t[25]=at,t[26]=rt,t[27]=g,t[28]=dt,t[29]=U,t[30]=I,t[31]=o.bottom,t[32]=o.left,t[33]=o.top,t[34]=xt,t[35]=Wt,t[36]=vt,t[37]=ot,t[38]=B,t[39]=zt,t[40]=q,t[41]=X,t[42]=$,t[43]=Pt,t[44]=D,t[45]=wt,t[46]=Gt,t[47]=d,t[48]=M,t[49]=Ht,t[50]=It,t[51]=Mt,t[52]=n?.dataConnectors,t[53]=n?.graphObjectValues,t[54]=n?.xAxis?.gridLines,t[55]=n?.xAxis?.labels,t[56]=n?.xAxis?.title,t[57]=n?.yAxis?.gridLines,t[58]=n?.yAxis?.labels,t[59]=Ot,t[60]=kt,t[61]=st,t[62]=jt,t[63]=ut,t[64]=H,t[65]=W,t[66]=z,t[67]=A,t[68]=V,t[69]=E,t[70]=J,t[71]=K,t[72]=Q,t[73]=Z,t[74]=j,t[75]=w,t[76]=_,t[77]=tt,t[78]=et}else H=t[64],W=t[65],z=t[66],A=t[67],V=t[68],E=t[69],J=t[70],K=t[71],Q=t[72],Z=t[73],j=t[74],w=t[75],_=t[76],tt=t[77],et=t[78];let R;t[95]!==H||t[96]!==_||t[97]!==tt?(R=i.jsxRuntimeExports.jsxs(H,{children:[_,tt]}),t[95]=H,t[96]=_,t[97]=tt,t[98]=R):R=t[98];let T;t[99]!==L?(T=L.filter(ai).map(ri),t[99]=L,t[100]=T):T=t[100];let S;t[101]!==z||t[102]!==A||t[103]!==V||t[104]!==E||t[105]!==R||t[106]!==T||t[107]!==et?(S=i.jsxRuntimeExports.jsxs("g",{transform:et,children:[z,A,V,E,R,T]}),t[101]=z,t[102]=A,t[103]=V,t[104]=E,t[105]=R,t[106]=T,t[107]=et,t[108]=S):S=t[108];let it;t[109]!==W||t[110]!==J||t[111]!==K||t[112]!==Q||t[113]!==Z||t[114]!==j||t[115]!==w||t[116]!==S?(it=i.jsxRuntimeExports.jsxs(W,{width:J,height:K,viewBox:Q,direction:Z,ref:j,children:[w,S]}),t[109]=W,t[110]=J,t[111]=K,t[112]=Q,t[113]=Z,t[114]=j,t[115]=w,t[116]=S,t[117]=it):it=t[117];let nt;t[118]!==s?.tooltip||t[119]!==mt||t[120]!==Tt||t[121]!==Nt||t[122]!==n?.tooltip||t[123]!==O?(nt=Nt&&O&&mt&&Tt?i.jsxRuntimeExports.jsx(Ee.Tooltip,{data:Nt,body:O,xPos:mt,yPos:Tt,backgroundStyle:n?.tooltip,className:s?.tooltip}):null,t[118]=s?.tooltip,t[119]=mt,t[120]=Tt,t[121]=Nt,t[122]=n?.tooltip,t[123]=O,t[124]=nt):nt=t[124];let ft;t[125]!==m||t[126]!==B?(ft=m&&B!==void 0?i.jsxRuntimeExports.jsx(Ae.le,{open:B!==void 0,onClose:()=>{Vt(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof m=="string"?{__html:Re.string2HTML(m,B)}:void 0,children:typeof m=="function"?m(B):null})}):null,t[125]=m,t[126]=B,t[127]=ft):ft=t[127];let yt;return t[128]!==it||t[129]!==nt||t[130]!==ft?(yt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[it,nt,ft]}),t[128]=it,t[129]=nt,t[130]=ft,t[131]=yt):yt=t[131],yt}function ri(e){return e.layer}function ai(e){return e.position==="after"}function li(e){return e!==null}function ci(e){return e!==null}function ui(e){return e!==null}function xi(e){return e!==null}function di(e){return e.layer}function mi(e){return e.position==="before"}function pi(e,t){return t!==0}function hi(e,t){return t!==0}function fi(e){return`${e.id}`}function yi(e){const t=i.compilerRuntimeExports.c(43),{data:h,graphTitle:Dt,colors:ie,sources:qt,graphDescription:Ft,barPadding:v,showTicks:Ot,leftMargin:Pt,rightMargin:Bt,topMargin:Mt,bottomMargin:It,truncateBy:st,height:ut,width:g,footNote:D,colorDomain:Ht,colorLegendTitle:O,padding:X,backgroundColor:Wt,radius:ot,tooltip:q,showLabels:M,relativeHeight:k,onSeriesMouseOver:Ut,graphID:xt,suffix:vt,prefix:Gt,maxValue:m,minValue:F,onSeriesMouseClick:zt,graphDownload:jt,dataDownload:n,showValues:s,sortParameter:I,arrowConnector:wt,connectorStrokeWidth:d,language:u,minHeight:$,theme:L,maxBarThickness:dt,maxNumberOfBars:b,minBarThickness:Jt,ariaLabel:Lt,resetSelectionOnDoubleClick:kt,detailsOnClick:ne,axisTitle:Kt,noOfTicks:N,valueColor:U,orientation:$t,styles:a,classNames:o,labelOrder:rt,refValues:at,filterNA:Nt,animate:P,precision:B,showColorScale:Vt,customLayers:mt,highlightedDataPoints:pt,dimmedOpacity:Tt,timeline:ht,sortData:H}=e,W=ie===void 0?Ge.Colors.light.categoricalColors.colors:ie,z=v===void 0?.25:v,A=Ot===void 0?!0:Ot,V=st===void 0?999:st,E=Wt===void 0?!0:Wt,J=ot===void 0?3:ot,K=M===void 0?!0:M,Q=vt===void 0?"":vt,Z=Gt===void 0?"":Gt,j=jt===void 0?!1:jt,w=n===void 0?!1:n,_=s===void 0?!0:s,tt=wt===void 0?!1:wt,et=d===void 0?2:d,R=u===void 0?"en":u,T=$===void 0?0:$,S=L===void 0?"light":L,it=kt===void 0?!0:kt,nt=N===void 0?5:N,ft=$t===void 0?"vertical":$t,yt=Nt===void 0?!0:Nt,At=P===void 0?!1:P,Qt=B===void 0?2:B,G=Vt===void 0?!0:Vt;let f;t[0]!==mt?(f=mt===void 0?[]:mt,t[0]=mt,t[1]=f):f=t[1];const gt=f;let Zt;t[2]!==pt?(Zt=pt===void 0?[]:pt,t[2]=pt,t[3]=Zt):Zt=t[3];const se=Zt,_t=Tt===void 0?.3:Tt,p=ht===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:ht,[Yt,te]=C.useState(0),[Et,ee]=C.useState(0),[lt,r]=C.useState(p.autoplay),x=Ye.sort(Fe.uniqBy(h,"date",!0).map(c=>he.parse(`${c}`,p.dateFormat||"yyyy",new Date).getTime()),Ti),[y,bt]=C.useState(p.autoplay?0:x.length-1),[ae,l]=C.useState(void 0),ct=C.useRef(null),Y=C.useRef(null);let Xt,le;t[4]===Symbol.for("react.memo_cache_sentinel")?(Xt=()=>{const c=new ResizeObserver(St=>{te(St[0].target.clientWidth||620),ee(St[0].target.clientHeight||480)});return ct.current&&c.observe(ct.current),()=>c.disconnect()},le=[],t[4]=Xt,t[5]=le):(Xt=t[4],le=t[5]),C.useEffect(Xt,le),C.useEffect(()=>{const c=setInterval(()=>{bt(St=>St<x.length-1?St+1:0)},(p.speed||2)*1e3);return lt||clearInterval(c),()=>clearInterval(c)},[x,lt,p.speed]);const ge=ve.getSliderMarks(x,y,p.showOnlyActiveDate,p.dateFormat||"yyyy"),Ve=ft==="horizontal"?oi:Ue,ue=je.GraphContainer,xe=o?.graphContainer,de=a?.graphContainer;let oe;t[6]!==o?.description||t[7]!==o?.title||t[8]!==h||t[9]!==w||t[10]!==Ft||t[11]!==j||t[12]!==Dt||t[13]!==a?.description||t[14]!==a?.title||t[15]!==g?(oe=Dt||Ft||j||w?i.jsxRuntimeExports.jsx(Pe.GraphHeader,{styles:{title:a?.title,description:a?.description},classNames:{title:o?.title,description:o?.description},graphTitle:Dt,graphDescription:Ft,width:g,graphDownload:j?Y:void 0,dataDownload:w?h.map(Vi).filter(Ni).length>0?h.map($i).filter(Li):h.filter(Ii):null}):null,t[6]=o?.description,t[7]=o?.title,t[8]=h,t[9]=w,t[10]=Ft,t[11]=j,t[12]=Dt,t[13]=a?.description,t[14]=a?.title,t[15]=g,t[16]=oe):oe=t[16];const me=p.enabled&&x.length>0&&ge?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{r(!lt)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":lt?"Click to pause animation":"Click to play animation",children:lt?i.jsxRuntimeExports.jsx(we.Pause,{}):i.jsxRuntimeExports.jsx(we.Play,{})}),i.jsxRuntimeExports.jsx(ve.Nr,{min:x[0],max:x[x.length-1],marks:ge,step:null,defaultValue:x[x.length-1],value:x[y],onChangeComplete:c=>{bt(x.indexOf(c))},onChange:c=>{bt(x.indexOf(c))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,pe=h.length===0?i.jsxRuntimeExports.jsx(We.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[G?i.jsxRuntimeExports.jsx(He.ColorLegendWithMouseOver,{width:g,colorDomain:Ht,colors:W,colorLegendTitle:O,setSelectedColor:l,showNAColor:!1,className:o?.colorLegend}):null,i.jsxRuntimeExports.jsx(je.GraphArea,{ref:ct,children:Yt&&Et?i.jsxRuntimeExports.jsx(Ve,{data:I!==void 0?I==="diff"?be.orderBy(fe.ensureCompleteDataForDumbbellChart(h,p.dateFormat||"yyyy").filter(c=>p.enabled?c.date===he.format(new Date(x[y]),p.dateFormat||"yyyy"):c).filter(c=>yt?!c.x.every(Mi):c),Oi,[H||"asc"]).filter((c,St)=>b?St<b:!0):be.orderBy(fe.ensureCompleteDataForDumbbellChart(h,p.dateFormat||"yyyy").filter(c=>p.enabled?c.date===he.format(new Date(x[y]),p.dateFormat||"yyyy"):c).filter(c=>yt?!c.x.every(Ci):c),c=>Ct.checkIfNullOrUndefined(c.x[I])?-1/0:c.x[I],[H||"asc"]).filter((c,St)=>b?St<b:!0):fe.ensureCompleteDataForDumbbellChart(h,p.dateFormat||"yyyy").filter(c=>yt?!c.x.every(Ri):c).filter((c,St)=>b?St<b:!0),dotColors:W,width:Yt,height:Et,radius:J,barPadding:z,showTicks:A,leftMargin:Pt,rightMargin:Bt,topMargin:Mt,bottomMargin:It,truncateBy:V,showLabels:K,showValues:_,tooltip:q,suffix:Q,prefix:Z,onSeriesMouseOver:Ut,maxValue:Ct.checkIfNullOrUndefined(m)?Math.max(...h.map(Ai))<0?0:Math.max(...h.map(wi)):m,minValue:Ct.checkIfNullOrUndefined(F)?Math.min(...h.map(vi))>0?0:Math.min(...h.map(gi)):F,onSeriesMouseClick:zt,selectedColor:ae,arrowConnector:tt,connectorStrokeWidth:et,maxBarThickness:dt,minBarThickness:Jt,resetSelectionOnDoubleClick:it,detailsOnClick:ne,axisTitle:Kt,noOfTicks:nt,valueColor:U,styles:a,classNames:o,labelOrder:rt,refValues:at,animate:At===!0?{duration:.5,once:!0,amount:.5}:At||{duration:0,once:!0,amount:0},precision:Qt,customLayers:gt,highlightedDataPoints:se,dimmedOpacity:_t,rtl:R==="ar"||R==="he"}):null})]});let re;t[17]!==o?.footnote||t[18]!==o?.source||t[19]!==D||t[20]!==qt||t[21]!==a?.footnote||t[22]!==a?.source||t[23]!==g?(re=qt||D?i.jsxRuntimeExports.jsx(Be.GraphFooter,{styles:{footnote:a?.footnote,source:a?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:qt,footNote:D,width:g}):null,t[17]=o?.footnote,t[18]=o?.source,t[19]=D,t[20]=qt,t[21]=a?.footnote,t[22]=a?.source,t[23]=g,t[24]=re):re=t[24];let ce;return t[25]!==ue||t[26]!==Lt||t[27]!==E||t[28]!==xt||t[29]!==ut||t[30]!==R||t[31]!==T||t[32]!==X||t[33]!==k||t[34]!==xe||t[35]!==de||t[36]!==oe||t[37]!==me||t[38]!==pe||t[39]!==re||t[40]!==S||t[41]!==g?(ce=i.jsxRuntimeExports.jsxs(ue,{className:xe,style:de,id:xt,ref:Y,"aria-label":Lt,backgroundColor:E,theme:S,language:R,minHeight:T,width:g,height:ut,relativeHeight:k,padding:X,children:[oe,me,pe,re]}),t[25]=ue,t[26]=Lt,t[27]=E,t[28]=xt,t[29]=ut,t[30]=R,t[31]=T,t[32]=X,t[33]=k,t[34]=xe,t[35]=de,t[36]=oe,t[37]=me,t[38]=pe,t[39]=re,t[40]=S,t[41]=g,t[42]=ce):ce=t[42],ce}function gi(e){return Math.min(...e.x.filter(bi))}function bi(e){return e!==null}function vi(e){return Math.min(...e.x.filter(ji))}function ji(e){return e!==null}function wi(e){return Math.max(...e.x.filter(ki))}function ki(e){return e!==null}function Ai(e){return Math.max(...e.x.filter(Ei))}function Ei(e){return e!==null}function Ri(e){return e==null}function Ci(e){return e==null}function Oi(e){return Ct.checkIfNullOrUndefined(e.x[e.x.length-1])||Ct.checkIfNullOrUndefined(e.x[0])?-1/0:e.x[e.x.length-1]-e.x[0]}function Mi(e){return e==null}function Ii(e){return e!==void 0}function Li(e){return e!==void 0}function $i(e){return e.data}function Ni(e){return e!==void 0}function Vi(e){return e.data}function Ti(e,t){return Xe.ascending(e,t)}exports.DumbbellChart=yi;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),be=require("./index-Cno4Q0YE.cjs"),he=require("./parse-hMnG_lRV.cjs"),C=require("react"),ve=require("./getSliderMarks-BmADcPQt.cjs"),ke=require("./index-DQA8q5sC.cjs"),Ae=require("./Modal-JW_IExO3.cjs"),ye=require("./numberFormattingFunction-02t-wJta.cjs"),Ee=require("./Tooltip-4dJo4_AF.cjs"),Ct=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Re=require("./string2HTML-CPGr_I5E.cjs"),Ce=require("./AxisTitle-sS5bLLR7.cjs"),Te=require("./Axis-DxRV2yMi.cjs"),Se=require("./XAxesLabels-Bt5NZBmX.cjs"),Oe=require("./YTicksAndGridLines-4pxTRlRK.cjs"),Me=require("./ReferenceLine-BH0qdf4R.cjs"),De=require("./XTicksAndGridLines-B6CELS7q.cjs"),qe=require("./YAxesLabels-DesLesUP.cjs"),Ie=require("./linear-BwPAspcq.cjs"),Le=require("./band-VYfcZeJ2.cjs"),$e=require("./use-in-view-QcfiW0w3.cjs"),Rt=require("./proxy-BxvUI_9l.cjs"),Ne=require("./index-DG2bgAva.cjs"),fe=require("./ensureCompleteData-I6nYmT8E.cjs"),Fe=require("./uniqBy-O05lp2S5.cjs"),je=require("./GraphContainer-d8A46BK2.cjs"),Pe=require("./GraphHeader.cjs"),we=require("./index-DRXx7m-C.cjs"),Be=require("./GraphFooter.cjs"),He=require("./ColorLegendWithMouseOver.cjs"),We=require("./EmptyState-sAEZ_5rU.cjs"),Ge=require("./Colors.cjs"),Ye=require("./sort-O96oMZLb.cjs"),Xe=require("./init-DU0ybBc_.cjs");function Ue(e){const t=i.compilerRuntimeExports.c(139),{data:h,leftMargin:Dt,rightMargin:ie,topMargin:qt,bottomMargin:Ft,dotColors:v,barPadding:Ot,showTicks:Pt,truncateBy:Bt,width:Mt,height:It,radius:st,showLabels:ut,tooltip:g,onSeriesMouseOver:D,maxValue:Ht,minValue:O,onSeriesMouseClick:X,showValues:Wt,suffix:ot,prefix:q,selectedColor:M,arrowConnector:k,connectorStrokeWidth:Ut,maxBarThickness:xt,minBarThickness:vt,resetSelectionOnDoubleClick:Gt,detailsOnClick:m,axisTitle:F,noOfTicks:zt,valueColor:jt,styles:n,classNames:s,labelOrder:I,refValues:wt,animate:d,precision:u,customLayers:$,highlightedDataPoints:L,dimmedOpacity:dt}=e,b=Dt===void 0?20:Dt,Jt=ie===void 0?20:ie,Lt=qt===void 0?20:qt,kt=Ft===void 0?25:Ft,ne=C.useRef(null);let Kt;t[0]!==d.amount||t[1]!==d.once?(Kt={once:d.once,amount:d.amount},t[0]=d.amount,t[1]=d.once,t[2]=Kt):Kt=t[2];const N=$e.useInView(ne,Kt),U=F?b+30:b;let $t;t[3]!==kt||t[4]!==Jt||t[5]!==U||t[6]!==Lt?($t={top:Lt,bottom:kt,left:U,right:Jt},t[3]=kt,t[4]=Jt,t[5]=U,t[6]=Lt,t[7]=$t):$t=t[7];const a=$t,o=Mt-a.left-a.right,rt=It-a.top-a.bottom,[at,Nt]=C.useState(void 0),[P,B]=C.useState(void 0),[Vt,mt]=C.useState(void 0),[pt,Tt]=C.useState(void 0);let ht,H,W,z,A,V,E,J,K,Q,Z,j,w,_,tt;if(t[8]!==d||t[9]!==k||t[10]!==F||t[11]!==Ot||t[12]!==s?.dataConnectors||t[13]!==s?.graphObjectValues||t[14]!==s?.xAxis?.axis||t[15]!==s?.xAxis?.labels||t[16]!==s?.yAxis?.gridLines||t[17]!==s?.yAxis?.labels||t[18]!==s?.yAxis?.title||t[19]!==Ut||t[20]!==$||t[21]!==h||t[22]!==m||t[23]!==dt||t[24]!==v||t[25]!==rt||t[26]!==o||t[27]!==It||t[28]!==L||t[29]!==N||t[30]!==I||t[31]!==b||t[32]!==a.bottom||t[33]!==a.left||t[34]!==a.right||t[35]!==a.top||t[36]!==xt||t[37]!==Ht||t[38]!==vt||t[39]!==O||t[40]!==P||t[41]!==zt||t[42]!==X||t[43]!==D||t[44]!==u||t[45]!==q||t[46]!==st||t[47]!==wt||t[48]!==Gt||t[49]!==M||t[50]!==ut||t[51]!==Pt||t[52]!==Wt||t[53]!==n?.dataConnectors||t[54]!==n?.graphObjectValues||t[55]!==n?.xAxis?.axis||t[56]!==n?.xAxis?.labels||t[57]!==n?.yAxis?.gridLines||t[58]!==n?.yAxis?.labels||t[59]!==n?.yAxis?.title||t[60]!==ot||t[61]!==Bt||t[62]!==jt||t[63]!==Mt){let yt;t[79]!==I?(yt=(l,ct)=>({...l,id:I?`${l.label}`:`${ct}`}),t[79]=I,t[80]=yt):yt=t[80];const At=h.map(yt),Qt=I||At.map(si),G=Ie.linear().domain([O,Ht]).range([rt,0]).nice(),f=Le.band().domain(Qt).range([0,vt?Math.max(o,vt*At.length):xt?Math.min(o,xt*At.length):o]).paddingInner(Ot),gt=G.ticks(zt);H=Rt.motion.svg,E=`${Mt}px`,J=`${It}px`,K=`0 0 ${Mt} ${It}`,Q="ltr",Z=ne,t[81]!==k?(j=k?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[81]=k,t[82]=j):j=t[82],tt=`translate(${a.left},${a.top})`;const Zt=G(O<0?0:O),se=G(O<0?0:O),_t=O<0?0:O;let p;t[83]!==u||t[84]!==q||t[85]!==ot||t[86]!==_t?(p=ye.numberFormattingFunction(_t,"NA",u,q,ot),t[83]=u,t[84]=q,t[85]=ot,t[86]=_t,t[87]=p):p=t[87];const Yt=s?.xAxis?.axis,te=s?.yAxis?.labels;let Et;t[88]!==Yt||t[89]!==te?(Et={axis:Yt,label:te},t[88]=Yt,t[89]=te,t[90]=Et):Et=t[90];const ee=n?.xAxis?.axis,lt=n?.yAxis?.labels;let r;t[91]!==ee||t[92]!==lt?(r={axis:ee,label:lt},t[91]=ee,t[92]=lt,t[93]=r):r=t[93],W=i.jsxRuntimeExports.jsx(Te.Axis,{y1:Zt,y2:se,x1:0-b,x2:o+a.right,label:p,labelPos:{x:0-b,dx:0,dy:Ht<0?"1em":-5,y:G(O<0?0:O)},classNames:Et,styles:r}),z=Pt?i.jsxRuntimeExports.jsx(Oe.YTicksAndGridLines,{values:gt.filter(ni),y:gt.filter(ii).map(l=>G(l)),x1:0-b,x2:o+a.right,styles:{gridLines:n?.yAxis?.gridLines,labels:n?.yAxis?.labels},classNames:{gridLines:s?.yAxis?.gridLines,labels:s?.yAxis?.labels},suffix:ot,prefix:q,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:u}):null;const x=0-b-15,y=rt/2,bt=n?.yAxis?.title,ae=s?.yAxis?.title;t[94]!==F||t[95]!==x||t[96]!==y||t[97]!==bt||t[98]!==ae?(A=i.jsxRuntimeExports.jsx(Ce.AxisTitle,{x,y,style:bt,className:ae,text:F,rotate90:!0}),t[94]=F,t[95]=x,t[96]=y,t[97]=bt,t[98]=ae,t[99]=A):A=t[99],t[100]!==$?(V=$.filter(ei).map(ti),t[100]=$,t[101]=V):V=t[101],ht=Ne.AnimatePresence,w=At.map(l=>i.jsxRuntimeExports.jsxs(Rt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:f(`${l.id}`)+f.bandwidth()/2,y:0,opacity:L.length!==0?L.indexOf(l.label)!==-1?.85:dt:.85},whileInView:{x:f(`${l.id}`)+f.bandwidth()/2,y:0,opacity:L.length!==0?L.indexOf(l.label)!==-1?.85:dt:.85,transition:{duration:d.duration}}},initial:"initial",animate:N?"whileInView":"initial",exit:{opacity:0,transition:{duration:d.duration}},children:[ut?i.jsxRuntimeExports.jsx(Se.XAxesLabels,{value:`${l.label}`.length<Bt?`${l.label}`:`${`${l.label}`.substring(0,Bt)}...`,y:rt+5,x:0-f.bandwidth()/2,width:f.bandwidth(),height:a.bottom,style:n?.xAxis?.labels,className:s?.xAxis?.labels,alignment:"top",animate:d,isInView:N}):null,i.jsxRuntimeExports.jsx(Rt.motion.line,{x1:0,x2:0,style:{strokeWidth:Ut,...n?.dataConnectors||{},opacity:M?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",s?.dataConnectors),markerEnd:k&&l.x.indexOf(Math.min(...l.x.filter(_e)))===0?"url(#arrow)":"",markerStart:k&&l.x.indexOf(Math.min(...l.x.filter(Ze)))===l.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:d.duration}},variants:{initial:{y1:0,y2:0},whileInView:{y1:G(Math.min(...l.x.filter(Qe)))+st,y2:G(Math.max(...l.x.filter(Ke)))-st,transition:{duration:d.duration}}},initial:"initial",animate:N?"whileInView":"initial"}),l.x.map((ct,Y)=>i.jsxRuntimeExports.jsx(Rt.motion.g,{onMouseEnter:Xt=>{Nt({...l,xIndex:Y}),Tt(Xt.clientY),mt(Xt.clientX),D?.({...l,xIndex:Y})},onClick:()=>{(X||m)&&(ke.isEqual(P,{...l,xIndex:Y})&&Gt?(B(void 0),X?.(void 0)):(B({...l,xIndex:Y}),X&&X({...l,xIndex:Y})))},onMouseMove:Xt=>{Nt({...l,xIndex:Y}),Tt(Xt.clientY),mt(Xt.clientX)},onMouseLeave:()=>{Nt(void 0),mt(void 0),Tt(void 0),D?.(void 0)},exit:{opacity:0,transition:{duration:d.duration}},variants:{initial:{opacity:M?v[Y]===M?1:.3:1},whileInView:{opacity:M?v[Y]===M?1:.3:1,transition:{duration:d.duration}}},initial:"initial",animate:N?"whileInView":"initial",children:Ct.checkIfNullOrUndefined(ct)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Rt.motion.circle,{cx:0,r:st,style:{fill:v[Y],fillOpacity:.85,stroke:v[Y],strokeWidth:1},exit:{opacity:0,transition:{duration:d.duration}},variants:{initial:{cy:G(0),opacity:0},whileInView:{cy:G(ct||0),opacity:Ct.checkIfNullOrUndefined(ct)?0:1,transition:{duration:d.duration}}},initial:"initial",animate:N?"whileInView":"initial"}),Wt?i.jsxRuntimeExports.jsx(Rt.motion.text,{x:0,style:{textAnchor:"start",...n?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",Ct.checkIfNullOrUndefined(ct)?"opacity-0":"opacity-100",s?.graphObjectValues),dx:st+3,dy:"0.33em",exit:{opacity:0,transition:{duration:d.duration}},variants:{initial:{y:G(0),opacity:0,fill:jt||v[Y]},whileInView:{y:G(ct||0),fill:jt||v[Y],opacity:1,transition:{duration:d.duration}}},initial:"initial",animate:N?"whileInView":"initial",children:ye.numberFormattingFunction(ct,"NA",u,q,ot)}):null]})},Y))]},l.label)),_=wt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:wt.map((l,ct)=>i.jsxRuntimeExports.jsx(Me.RefLineY,{text:l.text,color:l.color,y:G(l.value),x1:0-b,x2:o+a.right,classNames:l.classNames,styles:l.styles,animate:d,isInView:N},ct))}):null,t[8]=d,t[9]=k,t[10]=F,t[11]=Ot,t[12]=s?.dataConnectors,t[13]=s?.graphObjectValues,t[14]=s?.xAxis?.axis,t[15]=s?.xAxis?.labels,t[16]=s?.yAxis?.gridLines,t[17]=s?.yAxis?.labels,t[18]=s?.yAxis?.title,t[19]=Ut,t[20]=$,t[21]=h,t[22]=m,t[23]=dt,t[24]=v,t[25]=rt,t[26]=o,t[27]=It,t[28]=L,t[29]=N,t[30]=I,t[31]=b,t[32]=a.bottom,t[33]=a.left,t[34]=a.right,t[35]=a.top,t[36]=xt,t[37]=Ht,t[38]=vt,t[39]=O,t[40]=P,t[41]=zt,t[42]=X,t[43]=D,t[44]=u,t[45]=q,t[46]=st,t[47]=wt,t[48]=Gt,t[49]=M,t[50]=ut,t[51]=Pt,t[52]=Wt,t[53]=n?.dataConnectors,t[54]=n?.graphObjectValues,t[55]=n?.xAxis?.axis,t[56]=n?.xAxis?.labels,t[57]=n?.yAxis?.gridLines,t[58]=n?.yAxis?.labels,t[59]=n?.yAxis?.title,t[60]=ot,t[61]=Bt,t[62]=jt,t[63]=Mt,t[64]=ht,t[65]=H,t[66]=W,t[67]=z,t[68]=A,t[69]=V,t[70]=E,t[71]=J,t[72]=K,t[73]=Q,t[74]=Z,t[75]=j,t[76]=w,t[77]=_,t[78]=tt}else ht=t[64],H=t[65],W=t[66],z=t[67],A=t[68],V=t[69],E=t[70],J=t[71],K=t[72],Q=t[73],Z=t[74],j=t[75],w=t[76],_=t[77],tt=t[78];let et;t[102]!==ht||t[103]!==w||t[104]!==_?(et=i.jsxRuntimeExports.jsxs(ht,{children:[w,_]}),t[102]=ht,t[103]=w,t[104]=_,t[105]=et):et=t[105];let R;t[106]!==$?(R=$.filter(Je).map(ze),t[106]=$,t[107]=R):R=t[107];let T;t[108]!==W||t[109]!==z||t[110]!==A||t[111]!==V||t[112]!==et||t[113]!==R||t[114]!==tt?(T=i.jsxRuntimeExports.jsxs("g",{transform:tt,children:[W,z,A,V,et,R]}),t[108]=W,t[109]=z,t[110]=A,t[111]=V,t[112]=et,t[113]=R,t[114]=tt,t[115]=T):T=t[115];let S;t[116]!==H||t[117]!==E||t[118]!==J||t[119]!==K||t[120]!==Q||t[121]!==Z||t[122]!==j||t[123]!==T?(S=i.jsxRuntimeExports.jsxs(H,{width:E,height:J,viewBox:K,direction:Q,ref:Z,children:[j,T]}),t[116]=H,t[117]=E,t[118]=J,t[119]=K,t[120]=Q,t[121]=Z,t[122]=j,t[123]=T,t[124]=S):S=t[124];let it;t[125]!==s?.tooltip||t[126]!==Vt||t[127]!==pt||t[128]!==at||t[129]!==n?.tooltip||t[130]!==g?(it=at&&g&&Vt&&pt?i.jsxRuntimeExports.jsx(Ee.Tooltip,{data:at,body:g,xPos:Vt,yPos:pt,backgroundStyle:n?.tooltip,className:s?.tooltip}):null,t[125]=s?.tooltip,t[126]=Vt,t[127]=pt,t[128]=at,t[129]=n?.tooltip,t[130]=g,t[131]=it):it=t[131];let nt;t[132]!==m||t[133]!==P?(nt=m&&P!==void 0?i.jsxRuntimeExports.jsx(Ae.le,{open:P!==void 0,onClose:()=>{B(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof m=="string"?{__html:Re.string2HTML(m,P)}:void 0,children:typeof m=="function"?m(P):null})}):null,t[132]=m,t[133]=P,t[134]=nt):nt=t[134];let ft;return t[135]!==S||t[136]!==it||t[137]!==nt?(ft=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[S,it,nt]}),t[135]=S,t[136]=it,t[137]=nt,t[138]=ft):ft=t[138],ft}function ze(e){return e.layer}function Je(e){return e.position==="after"}function Ke(e){return e!==null}function Qe(e){return e!==null}function Ze(e){return e!==null}function _e(e){return e!==null}function ti(e){return e.layer}function ei(e){return e.position==="before"}function ii(e){return e!==0}function ni(e){return e!==0}function si(e){return`${e.id}`}function oi(e){const t=i.compilerRuntimeExports.c(132),{data:h,leftMargin:Dt,rightMargin:ie,topMargin:qt,bottomMargin:Ft,dotColors:v,suffix:Ot,prefix:Pt,barPadding:Bt,showValues:Mt,showTicks:It,truncateBy:st,width:ut,height:g,radius:D,showLabels:Ht,tooltip:O,onSeriesMouseOver:X,maxValue:Wt,minValue:ot,onSeriesMouseClick:q,selectedColor:M,arrowConnector:k,connectorStrokeWidth:Ut,maxBarThickness:xt,minBarThickness:vt,resetSelectionOnDoubleClick:Gt,detailsOnClick:m,axisTitle:F,noOfTicks:zt,valueColor:jt,styles:n,classNames:s,labelOrder:I,refValues:wt,rtl:d,animate:u,precision:$,customLayers:L,highlightedDataPoints:dt,dimmedOpacity:b}=e,Jt=Dt===void 0?100:Dt,Lt=ie===void 0?40:ie,kt=qt===void 0?20:qt,ne=Ft===void 0?10:Ft,Kt=C.useRef(null);let N;t[0]!==u.amount||t[1]!==u.once?(N={once:u.once,amount:u.amount},t[0]=u.amount,t[1]=u.once,t[2]=N):N=t[2];const U=$e.useInView(Kt,N),$t=F?kt+25:kt;let a;t[3]!==ne||t[4]!==Jt||t[5]!==Lt||t[6]!==$t?(a={top:$t,bottom:ne,left:Jt,right:Lt},t[3]=ne,t[4]=Jt,t[5]=Lt,t[6]=$t,t[7]=a):a=t[7];const o=a,rt=ut-o.left-o.right,at=g-o.top-o.bottom,[Nt,P]=C.useState(void 0),[B,Vt]=C.useState(void 0),[mt,pt]=C.useState(void 0),[Tt,ht]=C.useState(void 0);let H,W,z,A,V,E,J,K,Q,Z,j,w,_,tt,et;if(t[8]!==u||t[9]!==k||t[10]!==F||t[11]!==Bt||t[12]!==s?.dataConnectors||t[13]!==s?.graphObjectValues||t[14]!==s?.xAxis?.gridLines||t[15]!==s?.xAxis?.labels||t[16]!==s?.xAxis?.title||t[17]!==s?.yAxis?.gridLines||t[18]!==s?.yAxis?.labels||t[19]!==Ut||t[20]!==L||t[21]!==h||t[22]!==m||t[23]!==b||t[24]!==v||t[25]!==at||t[26]!==rt||t[27]!==g||t[28]!==dt||t[29]!==U||t[30]!==I||t[31]!==o.bottom||t[32]!==o.left||t[33]!==o.top||t[34]!==xt||t[35]!==Wt||t[36]!==vt||t[37]!==ot||t[38]!==B||t[39]!==zt||t[40]!==q||t[41]!==X||t[42]!==$||t[43]!==Pt||t[44]!==D||t[45]!==wt||t[46]!==Gt||t[47]!==d||t[48]!==M||t[49]!==Ht||t[50]!==It||t[51]!==Mt||t[52]!==n?.dataConnectors||t[53]!==n?.graphObjectValues||t[54]!==n?.xAxis?.gridLines||t[55]!==n?.xAxis?.labels||t[56]!==n?.xAxis?.title||t[57]!==n?.yAxis?.gridLines||t[58]!==n?.yAxis?.labels||t[59]!==Ot||t[60]!==kt||t[61]!==st||t[62]!==jt||t[63]!==ut){let At;t[79]!==I?(At=(r,x)=>({...r,id:I?`${r.label}`:`${x}`}),t[79]=I,t[80]=At):At=t[80];const Qt=h.map(At),G=I||Qt.map(fi),f=Ie.linear().domain([ot,Wt]).range([0,rt]).nice(),gt=Le.band().domain(G).range([0,vt?Math.max(at,vt*Qt.length):xt?Math.min(at,xt*Qt.length):at]).paddingInner(Bt),Zt=f.ticks(zt);W=Rt.motion.svg,J=`${ut}px`,K=`${g}px`,Q=`0 0 ${ut} ${g}`,Z="ltr",j=Kt,t[81]!==k?(w=k?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[81]=k,t[82]=w):w=t[82],et=`translate(${o.left},${o.top})`,z=It?i.jsxRuntimeExports.jsx(De.XTicksAndGridLines,{values:Zt.filter(hi),x:Zt.filter(pi).map(r=>f(r)),y1:0-kt,y2:at+o.bottom,styles:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},classNames:{gridLines:s?.xAxis?.gridLines,labels:s?.xAxis?.labels},suffix:Ot,prefix:Pt,labelType:"secondary",showGridLines:!0,precision:$}):null;const se=rt/2,_t=0-o.top+15,p=n?.xAxis?.title,Yt=s?.xAxis?.title;t[83]!==F||t[84]!==se||t[85]!==_t||t[86]!==p||t[87]!==Yt?(A=i.jsxRuntimeExports.jsx(Ce.AxisTitle,{x:se,y:_t,style:p,className:Yt,text:F}),t[83]=F,t[84]=se,t[85]=_t,t[86]=p,t[87]=Yt,t[88]=A):A=t[88];const te=n?.yAxis?.gridLines;let Et;t[89]!==te?(Et={gridLines:te},t[89]=te,t[90]=Et):Et=t[90];const ee=s?.yAxis?.gridLines;let lt;t[91]!==ee?(lt={gridLines:ee},t[91]=ee,t[92]=lt):lt=t[92],V=i.jsxRuntimeExports.jsx(Oe.YTicksAndGridLines,{y:Qt.map(r=>gt(`${r.id}`)+gt.bandwidth()/2),x1:0,x2:rt,styles:Et,classNames:lt,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:$}),t[93]!==L?(E=L.filter(mi).map(di),t[93]=L,t[94]=E):E=t[94],H=Ne.AnimatePresence,_=Qt.map(r=>i.jsxRuntimeExports.jsxs(Rt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:0,y:gt(`${r.id}`)+gt.bandwidth()/2,opacity:dt.length!==0?dt.indexOf(r.label)!==-1?.85:b:.85},whileInView:{x:0,y:gt(`${r.id}`)+gt.bandwidth()/2,opacity:dt.length!==0?dt.indexOf(r.label)!==-1?.85:b:.85,transition:{duration:u.duration}}},initial:"initial",animate:U?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},children:[Ht?i.jsxRuntimeExports.jsx(qe.YAxesLabels,{value:`${r.label}`.length<st?`${r.label}`:`${`${r.label}`.substring(0,st)}...`,y:0-gt.bandwidth()/2,x:0-o.left,width:o.left,height:gt.bandwidth(),alignment:"right",style:n?.yAxis?.labels,className:s?.yAxis?.labels,animate:u,isInView:U}):null,i.jsxRuntimeExports.jsx(Rt.motion.line,{y1:0,y2:0,style:{strokeWidth:Ut,...n?.dataConnectors||{},opacity:M?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",s?.dataConnectors),markerEnd:k&&r.x.indexOf(Math.min(...r.x.filter(xi)))===0?"url(#arrow)":"",markerStart:k&&r.x.indexOf(Math.min(...r.x.filter(ui)))===r.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x1:0,x2:0},whileInView:{x1:f(Math.min(...r.x.filter(ci)))+D,x2:f(Math.max(...r.x.filter(li)))-D,transition:{duration:u.duration}}},initial:"initial",animate:U?"whileInView":"initial"}),r.x.map((x,y)=>i.jsxRuntimeExports.jsx(Rt.motion.g,{onMouseEnter:bt=>{P({...r,xIndex:y}),ht(bt.clientY),pt(bt.clientX),X?.({...r,xIndex:y})},onClick:()=>{(q||m)&&(ke.isEqual(B,{...r,xIndex:y})&&Gt?(Vt(void 0),q?.(void 0)):(Vt({...r,xIndex:y}),q&&q({...r,xIndex:y})))},onMouseMove:bt=>{P({...r,xIndex:y}),ht(bt.clientY),pt(bt.clientX)},onMouseLeave:()=>{P(void 0),pt(void 0),ht(void 0),X?.(void 0)},exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{opacity:M?v[y]===M?1:.3:1},whileInView:{opacity:M?v[y]===M?1:.3:1,transition:{duration:u.duration}}},initial:"initial",animate:U?"whileInView":"initial",children:Ct.checkIfNullOrUndefined(x)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Rt.motion.circle,{cy:0,r:D,style:{fill:v[y],fillOpacity:.85,stroke:v[y],strokeWidth:1,opacity:Ct.checkIfNullOrUndefined(x)?0:1},exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{cx:f(0),opacity:0},whileInView:{cx:f(x||0),opacity:Ct.checkIfNullOrUndefined(x)?0:1,transition:{duration:u.duration}}},initial:"initial",animate:U?"whileInView":"initial"}),Mt?i.jsxRuntimeExports.jsx(Rt.motion.text,{y:0,style:{textAnchor:"middle",...n?.graphObjectValues||{}},dx:0,dy:0-D-3,className:i.mo("graph-value text-sm font-bold",Ct.checkIfNullOrUndefined(x)?"0opacity-0":"opacity-100",s?.graphObjectValues),exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x:f(0),opacity:0,fill:jt||v[y]},whileInView:{x:f(x||0),fill:jt||v[y],opacity:1,transition:{duration:u.duration}}},initial:"initial",animate:U?"whileInView":"initial",children:ye.numberFormattingFunction(x,"NA",$,Pt,Ot)}):null]})},y))]},r.label)),tt=wt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:wt.map((r,x)=>i.jsxRuntimeExports.jsx(Me.RefLineX,{text:r.text,color:r.color,x:f(r.value),y1:0-o.top,y2:at+o.bottom,textSide:f(r.value)>rt*.75||d?"left":"right",classNames:r.classNames,styles:r.styles,animate:u,isInView:U},x))}):null,t[8]=u,t[9]=k,t[10]=F,t[11]=Bt,t[12]=s?.dataConnectors,t[13]=s?.graphObjectValues,t[14]=s?.xAxis?.gridLines,t[15]=s?.xAxis?.labels,t[16]=s?.xAxis?.title,t[17]=s?.yAxis?.gridLines,t[18]=s?.yAxis?.labels,t[19]=Ut,t[20]=L,t[21]=h,t[22]=m,t[23]=b,t[24]=v,t[25]=at,t[26]=rt,t[27]=g,t[28]=dt,t[29]=U,t[30]=I,t[31]=o.bottom,t[32]=o.left,t[33]=o.top,t[34]=xt,t[35]=Wt,t[36]=vt,t[37]=ot,t[38]=B,t[39]=zt,t[40]=q,t[41]=X,t[42]=$,t[43]=Pt,t[44]=D,t[45]=wt,t[46]=Gt,t[47]=d,t[48]=M,t[49]=Ht,t[50]=It,t[51]=Mt,t[52]=n?.dataConnectors,t[53]=n?.graphObjectValues,t[54]=n?.xAxis?.gridLines,t[55]=n?.xAxis?.labels,t[56]=n?.xAxis?.title,t[57]=n?.yAxis?.gridLines,t[58]=n?.yAxis?.labels,t[59]=Ot,t[60]=kt,t[61]=st,t[62]=jt,t[63]=ut,t[64]=H,t[65]=W,t[66]=z,t[67]=A,t[68]=V,t[69]=E,t[70]=J,t[71]=K,t[72]=Q,t[73]=Z,t[74]=j,t[75]=w,t[76]=_,t[77]=tt,t[78]=et}else H=t[64],W=t[65],z=t[66],A=t[67],V=t[68],E=t[69],J=t[70],K=t[71],Q=t[72],Z=t[73],j=t[74],w=t[75],_=t[76],tt=t[77],et=t[78];let R;t[95]!==H||t[96]!==_||t[97]!==tt?(R=i.jsxRuntimeExports.jsxs(H,{children:[_,tt]}),t[95]=H,t[96]=_,t[97]=tt,t[98]=R):R=t[98];let T;t[99]!==L?(T=L.filter(ai).map(ri),t[99]=L,t[100]=T):T=t[100];let S;t[101]!==z||t[102]!==A||t[103]!==V||t[104]!==E||t[105]!==R||t[106]!==T||t[107]!==et?(S=i.jsxRuntimeExports.jsxs("g",{transform:et,children:[z,A,V,E,R,T]}),t[101]=z,t[102]=A,t[103]=V,t[104]=E,t[105]=R,t[106]=T,t[107]=et,t[108]=S):S=t[108];let it;t[109]!==W||t[110]!==J||t[111]!==K||t[112]!==Q||t[113]!==Z||t[114]!==j||t[115]!==w||t[116]!==S?(it=i.jsxRuntimeExports.jsxs(W,{width:J,height:K,viewBox:Q,direction:Z,ref:j,children:[w,S]}),t[109]=W,t[110]=J,t[111]=K,t[112]=Q,t[113]=Z,t[114]=j,t[115]=w,t[116]=S,t[117]=it):it=t[117];let nt;t[118]!==s?.tooltip||t[119]!==mt||t[120]!==Tt||t[121]!==Nt||t[122]!==n?.tooltip||t[123]!==O?(nt=Nt&&O&&mt&&Tt?i.jsxRuntimeExports.jsx(Ee.Tooltip,{data:Nt,body:O,xPos:mt,yPos:Tt,backgroundStyle:n?.tooltip,className:s?.tooltip}):null,t[118]=s?.tooltip,t[119]=mt,t[120]=Tt,t[121]=Nt,t[122]=n?.tooltip,t[123]=O,t[124]=nt):nt=t[124];let ft;t[125]!==m||t[126]!==B?(ft=m&&B!==void 0?i.jsxRuntimeExports.jsx(Ae.le,{open:B!==void 0,onClose:()=>{Vt(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof m=="string"?{__html:Re.string2HTML(m,B)}:void 0,children:typeof m=="function"?m(B):null})}):null,t[125]=m,t[126]=B,t[127]=ft):ft=t[127];let yt;return t[128]!==it||t[129]!==nt||t[130]!==ft?(yt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[it,nt,ft]}),t[128]=it,t[129]=nt,t[130]=ft,t[131]=yt):yt=t[131],yt}function ri(e){return e.layer}function ai(e){return e.position==="after"}function li(e){return e!==null}function ci(e){return e!==null}function ui(e){return e!==null}function xi(e){return e!==null}function di(e){return e.layer}function mi(e){return e.position==="before"}function pi(e,t){return t!==0}function hi(e,t){return t!==0}function fi(e){return`${e.id}`}function yi(e){const t=i.compilerRuntimeExports.c(43),{data:h,graphTitle:Dt,colors:ie,sources:qt,graphDescription:Ft,barPadding:v,showTicks:Ot,leftMargin:Pt,rightMargin:Bt,topMargin:Mt,bottomMargin:It,truncateBy:st,height:ut,width:g,footNote:D,colorDomain:Ht,colorLegendTitle:O,padding:X,backgroundColor:Wt,radius:ot,tooltip:q,showLabels:M,relativeHeight:k,onSeriesMouseOver:Ut,graphID:xt,suffix:vt,prefix:Gt,maxValue:m,minValue:F,onSeriesMouseClick:zt,graphDownload:jt,dataDownload:n,showValues:s,sortParameter:I,arrowConnector:wt,connectorStrokeWidth:d,language:u,minHeight:$,theme:L,maxBarThickness:dt,maxNumberOfBars:b,minBarThickness:Jt,ariaLabel:Lt,resetSelectionOnDoubleClick:kt,detailsOnClick:ne,axisTitle:Kt,noOfTicks:N,valueColor:U,orientation:$t,styles:a,classNames:o,labelOrder:rt,refValues:at,filterNA:Nt,animate:P,precision:B,showColorScale:Vt,customLayers:mt,highlightedDataPoints:pt,dimmedOpacity:Tt,timeline:ht,sortData:H}=e,W=ie===void 0?Ge.Colors.light.categoricalColors.colors:ie,z=v===void 0?.25:v,A=Ot===void 0?!0:Ot,V=st===void 0?999:st,E=Wt===void 0?!0:Wt,J=ot===void 0?3:ot,K=M===void 0?!0:M,Q=vt===void 0?"":vt,Z=Gt===void 0?"":Gt,j=jt===void 0?!1:jt,w=n===void 0?!1:n,_=s===void 0?!0:s,tt=wt===void 0?!1:wt,et=d===void 0?2:d,R=u===void 0?"en":u,T=$===void 0?0:$,S=L===void 0?"light":L,it=kt===void 0?!0:kt,nt=N===void 0?5:N,ft=$t===void 0?"vertical":$t,yt=Nt===void 0?!0:Nt,At=P===void 0?!1:P,Qt=B===void 0?2:B,G=Vt===void 0?!0:Vt;let f;t[0]!==mt?(f=mt===void 0?[]:mt,t[0]=mt,t[1]=f):f=t[1];const gt=f;let Zt;t[2]!==pt?(Zt=pt===void 0?[]:pt,t[2]=pt,t[3]=Zt):Zt=t[3];const se=Zt,_t=Tt===void 0?.3:Tt,p=ht===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:ht,[Yt,te]=C.useState(0),[Et,ee]=C.useState(0),[lt,r]=C.useState(p.autoplay),x=Ye.sort(Fe.uniqBy(h,"date",!0).map(c=>he.parse(`${c}`,p.dateFormat||"yyyy",new Date).getTime()),Ti),[y,bt]=C.useState(p.autoplay?0:x.length-1),[ae,l]=C.useState(void 0),ct=C.useRef(null),Y=C.useRef(null);let Xt,le;t[4]===Symbol.for("react.memo_cache_sentinel")?(Xt=()=>{const c=new ResizeObserver(St=>{te(St[0].target.clientWidth||620),ee(St[0].target.clientHeight||480)});return ct.current&&c.observe(ct.current),()=>c.disconnect()},le=[],t[4]=Xt,t[5]=le):(Xt=t[4],le=t[5]),C.useEffect(Xt,le),C.useEffect(()=>{const c=setInterval(()=>{bt(St=>St<x.length-1?St+1:0)},(p.speed||2)*1e3);return lt||clearInterval(c),()=>clearInterval(c)},[x,lt,p.speed]);const ge=ve.getSliderMarks(x,y,p.showOnlyActiveDate,p.dateFormat||"yyyy"),Ve=ft==="horizontal"?oi:Ue,ue=je.GraphContainer,xe=o?.graphContainer,de=a?.graphContainer;let oe;t[6]!==o?.description||t[7]!==o?.title||t[8]!==h||t[9]!==w||t[10]!==Ft||t[11]!==j||t[12]!==Dt||t[13]!==a?.description||t[14]!==a?.title||t[15]!==g?(oe=Dt||Ft||j||w?i.jsxRuntimeExports.jsx(Pe.GraphHeader,{styles:{title:a?.title,description:a?.description},classNames:{title:o?.title,description:o?.description},graphTitle:Dt,graphDescription:Ft,width:g,graphDownload:j?Y:void 0,dataDownload:w?h.map(Vi).filter(Ni).length>0?h.map($i).filter(Li):h.filter(Ii):null}):null,t[6]=o?.description,t[7]=o?.title,t[8]=h,t[9]=w,t[10]=Ft,t[11]=j,t[12]=Dt,t[13]=a?.description,t[14]=a?.title,t[15]=g,t[16]=oe):oe=t[16];const me=p.enabled&&x.length>0&&ge?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{r(!lt)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":lt?"Click to pause animation":"Click to play animation",children:lt?i.jsxRuntimeExports.jsx(we.Pause,{}):i.jsxRuntimeExports.jsx(we.Play,{})}),i.jsxRuntimeExports.jsx(ve.Nr,{min:x[0],max:x[x.length-1],marks:ge,step:null,defaultValue:x[x.length-1],value:x[y],onChangeComplete:c=>{bt(x.indexOf(c))},onChange:c=>{bt(x.indexOf(c))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,pe=h.length===0?i.jsxRuntimeExports.jsx(We.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[G?i.jsxRuntimeExports.jsx(He.ColorLegendWithMouseOver,{width:g,colorDomain:Ht,colors:W,colorLegendTitle:O,setSelectedColor:l,showNAColor:!1,className:o?.colorLegend}):null,i.jsxRuntimeExports.jsx(je.GraphArea,{ref:ct,children:Yt&&Et?i.jsxRuntimeExports.jsx(Ve,{data:I!==void 0?I==="diff"?be.orderBy(fe.ensureCompleteDataForDumbbellChart(h,p.dateFormat||"yyyy").filter(c=>p.enabled?c.date===he.format(new Date(x[y]),p.dateFormat||"yyyy"):c).filter(c=>yt?!c.x.every(Mi):c),Oi,[H||"asc"]).filter((c,St)=>b?St<b:!0):be.orderBy(fe.ensureCompleteDataForDumbbellChart(h,p.dateFormat||"yyyy").filter(c=>p.enabled?c.date===he.format(new Date(x[y]),p.dateFormat||"yyyy"):c).filter(c=>yt?!c.x.every(Ci):c),c=>Ct.checkIfNullOrUndefined(c.x[I])?-1/0:c.x[I],[H||"asc"]).filter((c,St)=>b?St<b:!0):fe.ensureCompleteDataForDumbbellChart(h,p.dateFormat||"yyyy").filter(c=>yt?!c.x.every(Ri):c).filter((c,St)=>b?St<b:!0),dotColors:W,width:Yt,height:Et,radius:J,barPadding:z,showTicks:A,leftMargin:Pt,rightMargin:Bt,topMargin:Mt,bottomMargin:It,truncateBy:V,showLabels:K,showValues:_,tooltip:q,suffix:Q,prefix:Z,onSeriesMouseOver:Ut,maxValue:Ct.checkIfNullOrUndefined(m)?Math.max(...h.map(Ai))<0?0:Math.max(...h.map(wi)):m,minValue:Ct.checkIfNullOrUndefined(F)?Math.min(...h.map(vi))>0?0:Math.min(...h.map(gi)):F,onSeriesMouseClick:zt,selectedColor:ae,arrowConnector:tt,connectorStrokeWidth:et,maxBarThickness:dt,minBarThickness:Jt,resetSelectionOnDoubleClick:it,detailsOnClick:ne,axisTitle:Kt,noOfTicks:nt,valueColor:U,styles:a,classNames:o,labelOrder:rt,refValues:at,animate:At===!0?{duration:.5,once:!0,amount:.5}:At||{duration:0,once:!0,amount:0},precision:Qt,customLayers:gt,highlightedDataPoints:se,dimmedOpacity:_t,rtl:R==="ar"||R==="he"}):null})]});let re;t[17]!==o?.footnote||t[18]!==o?.source||t[19]!==D||t[20]!==qt||t[21]!==a?.footnote||t[22]!==a?.source||t[23]!==g?(re=qt||D?i.jsxRuntimeExports.jsx(Be.GraphFooter,{styles:{footnote:a?.footnote,source:a?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:qt,footNote:D,width:g}):null,t[17]=o?.footnote,t[18]=o?.source,t[19]=D,t[20]=qt,t[21]=a?.footnote,t[22]=a?.source,t[23]=g,t[24]=re):re=t[24];let ce;return t[25]!==ue||t[26]!==Lt||t[27]!==E||t[28]!==xt||t[29]!==ut||t[30]!==R||t[31]!==T||t[32]!==X||t[33]!==k||t[34]!==xe||t[35]!==de||t[36]!==oe||t[37]!==me||t[38]!==pe||t[39]!==re||t[40]!==S||t[41]!==g?(ce=i.jsxRuntimeExports.jsxs(ue,{className:xe,style:de,id:xt,ref:Y,"aria-label":Lt,backgroundColor:E,theme:S,language:R,minHeight:T,width:g,height:ut,relativeHeight:k,padding:X,children:[oe,me,pe,re]}),t[25]=ue,t[26]=Lt,t[27]=E,t[28]=xt,t[29]=ut,t[30]=R,t[31]=T,t[32]=X,t[33]=k,t[34]=xe,t[35]=de,t[36]=oe,t[37]=me,t[38]=pe,t[39]=re,t[40]=S,t[41]=g,t[42]=ce):ce=t[42],ce}function gi(e){return Math.min(...e.x.filter(bi))}function bi(e){return e!==null}function vi(e){return Math.min(...e.x.filter(ji))}function ji(e){return e!==null}function wi(e){return Math.max(...e.x.filter(ki))}function ki(e){return e!==null}function Ai(e){return Math.max(...e.x.filter(Ei))}function Ei(e){return e!==null}function Ri(e){return e==null}function Ci(e){return e==null}function Oi(e){return Ct.checkIfNullOrUndefined(e.x[e.x.length-1])||Ct.checkIfNullOrUndefined(e.x[0])?-1/0:e.x[e.x.length-1]-e.x[0]}function Mi(e){return e==null}function Ii(e){return e!==void 0}function Li(e){return e!==void 0}function $i(e){return e.data}function Ni(e){return e!==void 0}function Vi(e){return e.data}function Ti(e,t){return Xe.ascending(e,t)}exports.DumbbellChart=yi;
|
|
2
2
|
//# sourceMappingURL=DumbbellChart.cjs.map
|
package/dist/DumbbellChart.js
CHANGED
|
@@ -11,11 +11,11 @@ import { c as Lt } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
|
11
11
|
import { s as Le } from "./string2HTML-DhG75NqA.js";
|
|
12
12
|
import { A as $e } from "./AxisTitle-jeI7am8o.js";
|
|
13
13
|
import { A as We } from "./Axis-CRyfcLjc.js";
|
|
14
|
-
import { X as Be } from "./XAxesLabels-
|
|
14
|
+
import { X as Be } from "./XAxesLabels-Dy8E1SEo.js";
|
|
15
15
|
import { Y as Ve } from "./YTicksAndGridLines-Blepl7XF.js";
|
|
16
16
|
import { R as He, a as Xe } from "./ReferenceLine-2XCwHXQ4.js";
|
|
17
17
|
import { X as Ye } from "./XTicksAndGridLines-CObVFSm4.js";
|
|
18
|
-
import { Y as Ee } from "./YAxesLabels-
|
|
18
|
+
import { Y as Ee } from "./YAxesLabels-a57ZRv-0.js";
|
|
19
19
|
import { a as je } from "./linear-BwnDd9KF.js";
|
|
20
20
|
import { b as Ie } from "./band-CyHaVft5.js";
|
|
21
21
|
import { u as Ne } from "./use-in-view-Cxa7y1TH.js";
|