@undp/data-viz 2.4.1 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.cjs.map +1 -1
- package/dist/AreaChart.d.ts +11 -9
- package/dist/AreaChart.js +320 -322
- package/dist/AreaChart.js.map +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.d.ts +15 -25
- package/dist/BarGraph.js +1694 -1694
- package/dist/BarGraph.js.map +1 -1
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.cjs.map +1 -1
- package/dist/BasicStatCard.d.ts +13 -9
- package/dist/BasicStatCard.js +79 -81
- package/dist/BasicStatCard.js.map +1 -1
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.cjs.map +1 -1
- package/dist/BeeSwarmChart.d.ts +11 -9
- package/dist/BeeSwarmChart.js +335 -336
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.d.ts +13 -3
- package/dist/BiVariateChoroplethMap.js +309 -304
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.d.ts +11 -5
- package/dist/BulletChart.js +560 -559
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.d.ts +11 -9
- package/dist/ButterflyChart.js +348 -350
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +11 -3
- package/dist/ChoroplethMap.js +314 -311
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.d.ts +11 -9
- package/dist/CirclePackingGraph.js +1 -1
- package/dist/DataCards.cjs +1 -1
- package/dist/DataCards.d.ts +1 -1
- package/dist/DataCards.js +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.cjs.map +1 -1
- package/dist/DataTable.d.ts +4 -5
- package/dist/DataTable.js +114 -116
- package/dist/DataTable.js.map +1 -1
- package/dist/{DetailsModal-jmmKRMRM.cjs → DetailsModal-Du8Fr1QD.cjs} +2 -2
- package/dist/{DetailsModal-jmmKRMRM.cjs.map → DetailsModal-Du8Fr1QD.cjs.map} +1 -1
- package/dist/{DetailsModal-B2XBWR7w.js → DetailsModal-GqEbGHY2.js} +2 -2
- package/dist/{DetailsModal-B2XBWR7w.js.map → DetailsModal-GqEbGHY2.js.map} +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.d.ts +11 -9
- package/dist/DifferenceLineChart.js +502 -504
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.cjs.map +1 -1
- package/dist/DonutChart.d.ts +14 -9
- package/dist/DonutChart.js +174 -179
- package/dist/DonutChart.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +1 -1
- package/dist/DotDensityMap.js +270 -267
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.d.ts +13 -9
- package/dist/DualAxisLineChart.js +341 -351
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.d.ts +11 -9
- package/dist/DumbbellChart.js +592 -593
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.d.ts +1 -1
- package/dist/GeoHubCompareMaps.js +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.d.ts +1 -1
- package/dist/GeoHubMap.js +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.d.ts +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +1 -1
- package/dist/GraphEl-BgkDbq50.cjs +2 -0
- package/dist/GraphEl-BgkDbq50.cjs.map +1 -0
- package/dist/GraphEl-Ch0uAeZw.js +1830 -0
- package/dist/GraphEl-Ch0uAeZw.js.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +29 -16
- package/dist/GriddedGraphs.js +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +29 -16
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.cjs.map +1 -1
- package/dist/HeatMap.d.ts +11 -9
- package/dist/HeatMap.js +203 -205
- package/dist/HeatMap.js.map +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.cjs.map +1 -1
- package/dist/Histogram.d.ts +11 -5
- package/dist/Histogram.js +88 -89
- package/dist/Histogram.js.map +1 -1
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.d.ts +11 -3
- package/dist/HybridMap.js +339 -336
- package/dist/HybridMap.js.map +1 -1
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.d.ts +11 -9
- package/dist/LineChartWithConfidenceInterval.js +393 -395
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +1 -1
- package/dist/MultiGraphDashboard.d.ts +29 -16
- package/dist/MultiGraphDashboardFromConfig.d.ts +29 -16
- package/dist/MultiGraphDashboardWideToLongFormat.d.ts +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.d.ts +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.d.ts +11 -9
- package/dist/MultiLineAltChart.js +411 -413
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.d.ts +11 -9
- package/dist/MultiLineChart.js +438 -440
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.cjs.map +1 -1
- package/dist/ParetoChart.d.ts +13 -13
- package/dist/ParetoChart.js +347 -355
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +29 -16
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +29 -16
- package/dist/PerformanceIntensiveScrollStory.d.ts +29 -16
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.d.ts +11 -5
- package/dist/RadarChart.js +213 -213
- package/dist/RadarChart.js.map +1 -1
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.cjs.map +1 -1
- package/dist/SankeyChart.d.ts +11 -9
- package/dist/SankeyChart.js +448 -450
- package/dist/SankeyChart.js.map +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.d.ts +15 -13
- package/dist/ScatterPlot.js +477 -483
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.d.ts +29 -16
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.d.ts +11 -9
- package/dist/SimpleLineChart.js +362 -364
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +29 -16
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +29 -16
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +29 -16
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +29 -16
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +29 -16
- package/dist/SingleGraphDashboardThreeDGraphs.js +40 -39
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +29 -16
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.d.ts +1 -1
- package/dist/SlopeChart.js +2 -2
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.d.ts +1 -1
- package/dist/SparkLine.js +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.cjs.map +1 -1
- package/dist/StatCardFromData.d.ts +11 -9
- package/dist/StatCardFromData.js +113 -116
- package/dist/StatCardFromData.js.map +1 -1
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.d.ts +11 -9
- package/dist/StripChart.js +434 -435
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +11 -3
- package/dist/ThreeDGlobe.js +143 -143
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +1 -1
- package/dist/{Tooltip-Bj-s__cI.js → Tooltip-3EYDVa3w.js} +2 -2
- package/dist/{Tooltip-Bj-s__cI.js.map → Tooltip-3EYDVa3w.js.map} +1 -1
- package/dist/{Tooltip-Hr46paWP.cjs → Tooltip-C9F3uYG0.cjs} +2 -2
- package/dist/{Tooltip-Hr46paWP.cjs.map → Tooltip-C9F3uYG0.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.cjs.map +1 -1
- package/dist/TreeMapGraph.d.ts +11 -9
- package/dist/TreeMapGraph.js +369 -371
- package/dist/TreeMapGraph.js.map +1 -1
- package/dist/Types.d.ts +29 -16
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.cjs.map +1 -1
- package/dist/UnitChart.d.ts +11 -5
- package/dist/UnitChart.js +118 -119
- package/dist/UnitChart.js.map +1 -1
- package/dist/WaterfallChart.cjs +1 -1
- package/dist/WaterfallChart.cjs.map +1 -1
- package/dist/WaterfallChart.d.ts +11 -9
- package/dist/WaterfallChart.js +306 -308
- package/dist/WaterfallChart.js.map +1 -1
- package/dist/XTicksAndGridLines-B4UhDVyU.cjs +2 -0
- package/dist/XTicksAndGridLines-B4UhDVyU.cjs.map +1 -0
- package/dist/XTicksAndGridLines-CkYwVshF.js +40 -0
- package/dist/XTicksAndGridLines-CkYwVshF.js.map +1 -0
- package/dist/YTicksAndGridLines-BbujwxOB.js +40 -0
- package/dist/YTicksAndGridLines-BbujwxOB.js.map +1 -0
- package/dist/YTicksAndGridLines-sT3zdCs6.cjs +2 -0
- package/dist/YTicksAndGridLines-sT3zdCs6.cjs.map +1 -0
- package/dist/{imageDownload-Diofs_vY.js → imageDownload-BYsNEtMS.js} +11 -11
- package/dist/{imageDownload-Diofs_vY.js.map → imageDownload-BYsNEtMS.js.map} +1 -1
- package/dist/{imageDownload-61q6jyJW.cjs → imageDownload-CkMwA7Cw.cjs} +4 -4
- package/dist/{imageDownload-61q6jyJW.cjs.map → imageDownload-CkMwA7Cw.cjs.map} +1 -1
- package/dist/index-BPyj_6hG.js +375 -0
- package/dist/index-BPyj_6hG.js.map +1 -0
- package/dist/index-DuLvdHo2.cjs +2 -0
- package/dist/index-DuLvdHo2.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +108 -245
- package/dist/index.js +3 -3
- package/dist/numberFormattingFunction-BUUV_luR.js +28 -0
- package/dist/numberFormattingFunction-BUUV_luR.js.map +1 -0
- package/dist/numberFormattingFunction-u2iNHL_c.cjs +2 -0
- package/dist/numberFormattingFunction-u2iNHL_c.cjs.map +1 -0
- package/dist/{string2HTML-ZoGd08P_.cjs → string2HTML-30nfIm8R.cjs} +2 -2
- package/dist/{string2HTML-ZoGd08P_.cjs.map → string2HTML-30nfIm8R.cjs.map} +1 -1
- package/dist/{string2HTML-BrFperRM.js → string2HTML-DL-pInUB.js} +2 -2
- package/dist/{string2HTML-BrFperRM.js.map → string2HTML-DL-pInUB.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -2
- package/package.json +2 -2
- package/dist/GraphEl-B73N4RIA.js +0 -1906
- package/dist/GraphEl-B73N4RIA.js.map +0 -1
- package/dist/GraphEl-Lt1og0C-.cjs +0 -2
- package/dist/GraphEl-Lt1og0C-.cjs.map +0 -1
- package/dist/XTicksAndGridLines-C5DuC5oY.cjs +0 -2
- package/dist/XTicksAndGridLines-C5DuC5oY.cjs.map +0 -1
- package/dist/XTicksAndGridLines-gdbGX2rm.js +0 -39
- package/dist/XTicksAndGridLines-gdbGX2rm.js.map +0 -1
- package/dist/YTicksAndGridLines-CsNSq9W9.js +0 -39
- package/dist/YTicksAndGridLines-CsNSq9W9.js.map +0 -1
- package/dist/YTicksAndGridLines-DFjm8RCc.cjs +0 -2
- package/dist/YTicksAndGridLines-DFjm8RCc.cjs.map +0 -1
- package/dist/index-B0Awa_de.js +0 -377
- package/dist/index-B0Awa_de.js.map +0 -1
- package/dist/index-CP8cmNzt.cjs +0 -2
- package/dist/index-CP8cmNzt.cjs.map +0 -1
- package/dist/numberFormattingFunction-Cn9R7CM9.cjs +0 -2
- package/dist/numberFormattingFunction-Cn9R7CM9.cjs.map +0 -1
- package/dist/numberFormattingFunction-DqMf_v1m.js +0 -28
- package/dist/numberFormattingFunction-DqMf_v1m.js.map +0 -1
package/dist/DonutChart.js
CHANGED
|
@@ -1,264 +1,259 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { E as
|
|
4
|
-
import { o as
|
|
5
|
-
import { n as
|
|
6
|
-
import { i as
|
|
7
|
-
import { T as
|
|
8
|
-
import { Colors as
|
|
9
|
-
import { n as
|
|
10
|
-
import { D as
|
|
11
|
-
import { c as
|
|
12
|
-
import { m as
|
|
13
|
-
import { u as
|
|
14
|
-
import { A as
|
|
15
|
-
import { GraphFooter as
|
|
16
|
-
import { GraphHeader as
|
|
17
|
-
import { E as
|
|
18
|
-
import { G as
|
|
19
|
-
const
|
|
20
|
-
function
|
|
1
|
+
import { c as pt, j as a, m as dt } from "./index-CHPV5EwG-BzibaIRc.js";
|
|
2
|
+
import { useRef as rt, useState as _, isValidElement as lt, useEffect as ft } from "react";
|
|
3
|
+
import { E as gt, _ as it } from "./Typography-BO0gQDIT.js";
|
|
4
|
+
import { o as ht } from "./index-BZQYSqar.js";
|
|
5
|
+
import { n as xt } from "./Source-QGk8vhkS.js";
|
|
6
|
+
import { i as yt } from "./index-Bwrro8-q.js";
|
|
7
|
+
import { T as bt } from "./Tooltip-3EYDVa3w.js";
|
|
8
|
+
import { Colors as R } from "./Colors.js";
|
|
9
|
+
import { n as ut } from "./numberFormattingFunction-BUUV_luR.js";
|
|
10
|
+
import { D as vt } from "./DetailsModal-GqEbGHY2.js";
|
|
11
|
+
import { c as $, a as jt } from "./array-USo-Szhp.js";
|
|
12
|
+
import { m as nt } from "./proxy-BsxtcZKa.js";
|
|
13
|
+
import { u as Mt } from "./use-in-view-KOXq5Kmc.js";
|
|
14
|
+
import { A as Dt } from "./index-Cv_5q6Rb.js";
|
|
15
|
+
import { GraphFooter as Ct } from "./GraphFooter.js";
|
|
16
|
+
import { GraphHeader as kt } from "./GraphHeader.js";
|
|
17
|
+
import { E as Nt } from "./EmptyState-CaxXCkiN.js";
|
|
18
|
+
import { G as wt, a as At } from "./GraphContainer-B8ZqOzKI.js";
|
|
19
|
+
const Ot = Math.PI, at = 2 * Ot;
|
|
20
|
+
function St(c, t) {
|
|
21
21
|
return t < c ? -1 : t > c ? 1 : t >= c ? 0 : NaN;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function zt(c) {
|
|
24
24
|
return c;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
var c =
|
|
26
|
+
function Et() {
|
|
27
|
+
var c = zt, t = St, o = null, l = $(0), n = $(at), h = $(0);
|
|
28
28
|
function r(e) {
|
|
29
|
-
var s,
|
|
30
|
-
for (s = 0; s <
|
|
31
|
-
(
|
|
32
|
-
for (t != null ?
|
|
33
|
-
return t(b[
|
|
34
|
-
}) : o != null &&
|
|
35
|
-
return o(e[
|
|
36
|
-
}), s = 0,
|
|
37
|
-
|
|
38
|
-
data: e[
|
|
29
|
+
var s, x = (e = jt(e)).length, u, k, N = 0, f = new Array(x), b = new Array(x), y = +l.apply(this, arguments), p = Math.min(at, Math.max(-at, n.apply(this, arguments) - y)), w, v = Math.min(Math.abs(p) / x, h.apply(this, arguments)), P = v * (p < 0 ? -1 : 1), d;
|
|
30
|
+
for (s = 0; s < x; ++s)
|
|
31
|
+
(d = b[f[s] = s] = +c(e[s], s, e)) > 0 && (N += d);
|
|
32
|
+
for (t != null ? f.sort(function(j, L) {
|
|
33
|
+
return t(b[j], b[L]);
|
|
34
|
+
}) : o != null && f.sort(function(j, L) {
|
|
35
|
+
return o(e[j], e[L]);
|
|
36
|
+
}), s = 0, k = N ? (p - x * P) / N : 0; s < x; ++s, y = w)
|
|
37
|
+
u = f[s], d = b[u], w = y + (d > 0 ? d * k : 0) + P, b[u] = {
|
|
38
|
+
data: e[u],
|
|
39
39
|
index: s,
|
|
40
|
-
value:
|
|
41
|
-
startAngle:
|
|
42
|
-
endAngle:
|
|
43
|
-
padAngle:
|
|
40
|
+
value: d,
|
|
41
|
+
startAngle: y,
|
|
42
|
+
endAngle: w,
|
|
43
|
+
padAngle: v
|
|
44
44
|
};
|
|
45
45
|
return b;
|
|
46
46
|
}
|
|
47
47
|
return r.value = function(e) {
|
|
48
|
-
return arguments.length ? (c = typeof e == "function" ? e :
|
|
48
|
+
return arguments.length ? (c = typeof e == "function" ? e : $(+e), r) : c;
|
|
49
49
|
}, r.sortValues = function(e) {
|
|
50
50
|
return arguments.length ? (t = e, o = null, r) : t;
|
|
51
51
|
}, r.sort = function(e) {
|
|
52
52
|
return arguments.length ? (o = e, t = null, r) : o;
|
|
53
53
|
}, r.startAngle = function(e) {
|
|
54
|
-
return arguments.length ? (l = typeof e == "function" ? e :
|
|
54
|
+
return arguments.length ? (l = typeof e == "function" ? e : $(+e), r) : l;
|
|
55
55
|
}, r.endAngle = function(e) {
|
|
56
|
-
return arguments.length ? (n = typeof e == "function" ? e :
|
|
56
|
+
return arguments.length ? (n = typeof e == "function" ? e : $(+e), r) : n;
|
|
57
57
|
}, r.padAngle = function(e) {
|
|
58
|
-
return arguments.length ? (
|
|
58
|
+
return arguments.length ? (h = typeof e == "function" ? e : $(+e), r) : h;
|
|
59
59
|
}, r;
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const st = (c, t, o, l) => ({
|
|
62
62
|
x: c + o * Math.cos(l),
|
|
63
63
|
y: t + o * Math.sin(l)
|
|
64
64
|
});
|
|
65
|
-
function
|
|
66
|
-
const
|
|
67
|
-
return ["M",
|
|
65
|
+
function ct(c, t, o, l, n) {
|
|
66
|
+
const h = st(c, t, o, l), r = st(c, t, o, Math.abs(n - l) === 2 * Math.PI ? 0.999999 * n : n), e = n - l <= Math.PI ? "0" : "1";
|
|
67
|
+
return ["M", h.x, h.y, "A", o, o, 0, e, 1, r.x, r.y].join(" ");
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
const t =
|
|
69
|
+
function Pt(c) {
|
|
70
|
+
const t = pt.c(59), {
|
|
71
71
|
mainText: o,
|
|
72
72
|
data: l,
|
|
73
73
|
radius: n,
|
|
74
|
-
colors:
|
|
74
|
+
colors: h,
|
|
75
75
|
subNote: r,
|
|
76
76
|
strokeWidth: e,
|
|
77
77
|
tooltip: s,
|
|
78
|
-
onSeriesMouseOver:
|
|
79
|
-
onSeriesMouseClick:
|
|
80
|
-
colorDomain:
|
|
81
|
-
resetSelectionOnDoubleClick:
|
|
82
|
-
detailsOnClick:
|
|
78
|
+
onSeriesMouseOver: x,
|
|
79
|
+
onSeriesMouseClick: u,
|
|
80
|
+
colorDomain: k,
|
|
81
|
+
resetSelectionOnDoubleClick: N,
|
|
82
|
+
detailsOnClick: f,
|
|
83
83
|
styles: b,
|
|
84
|
-
classNames:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
let N;
|
|
107
|
-
t[16] !== d.duration || t[17] !== A || t[18] !== p || t[19] !== g || t[20] !== V || t[21] !== z || t[22] !== x || t[23] !== f || t[24] !== y || t[25] !== n || t[26] !== m || t[27] !== E || t[28] !== e ? (N = (u, pt) => /* @__PURE__ */ a.jsx(rt.path, { variants: {
|
|
84
|
+
classNames: y,
|
|
85
|
+
animate: p,
|
|
86
|
+
trackColor: w,
|
|
87
|
+
naLabel: v
|
|
88
|
+
} = c, P = rt(null);
|
|
89
|
+
let d;
|
|
90
|
+
t[0] !== p.amount || t[1] !== p.once ? (d = {
|
|
91
|
+
once: p.once,
|
|
92
|
+
amount: p.amount
|
|
93
|
+
}, t[0] = p.amount, t[1] = p.once, t[2] = d) : d = t[2];
|
|
94
|
+
const j = Mt(P, d), L = Et().sort(null).startAngle(0).value(It), [g, T] = _(void 0), [A, O] = _(void 0), [B, J] = _(void 0), [F, K] = _(void 0), Q = nt, M = `${n * 2}px`, D = `${n * 2}px`, W = `0 0 ${n * 2} ${n * 2}`, ot = "ltr", tt = "mx-auto", S = nt, H = `translate(${n} ${n})`;
|
|
95
|
+
let I;
|
|
96
|
+
t[3] !== l || t[4] !== o || t[5] !== v || t[6] !== n || t[7] !== e || t[8] !== r ? (I = o || r ? /* @__PURE__ */ a.jsx("foreignObject", { y: 0 - (n - e), x: 0 - (n - e), width: 2 * (n - e), height: 2 * (n - e), children: /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4", children: [
|
|
97
|
+
o ? lt(o) ? o : /* @__PURE__ */ a.jsx(gt, { marginBottom: "none", className: "donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center", children: typeof o == "string" ? o : l.findIndex((m) => m.label === o.label) !== -1 ? ut(l[l.findIndex((m) => m.label === o.label)].size, v, o.precision, o.prefix, o.suffix, o.locale, o.padZeros) : v }) : null,
|
|
98
|
+
r ? /* @__PURE__ */ a.jsx(it, { marginBottom: "none", size: "base", leading: "none", className: "donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold", children: r }) : typeof o == "string" || !o || lt(o) ? null : /* @__PURE__ */ a.jsx(it, { size: "base", marginBottom: "none", leading: "none", className: "donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold", children: o.label })
|
|
99
|
+
] }) }) : null, t[3] = l, t[4] = o, t[5] = v, t[6] = n, t[7] = e, t[8] = r, t[9] = I) : I = t[9];
|
|
100
|
+
const V = n - e / 2;
|
|
101
|
+
let z;
|
|
102
|
+
t[10] !== e || t[11] !== V || t[12] !== w ? (z = /* @__PURE__ */ a.jsx("circle", { cx: 0, cy: 0, r: V, fill: "none", stroke: w, strokeWidth: e }), t[10] = e, t[11] = V, t[12] = w, t[13] = z) : z = t[13];
|
|
103
|
+
const E = Dt;
|
|
104
|
+
let i;
|
|
105
|
+
t[14] !== p.duration || t[15] !== k || t[16] !== h || t[17] !== f || t[18] !== j || t[19] !== A || t[20] !== g || t[21] !== u || t[22] !== x || t[23] !== n || t[24] !== N || t[25] !== O || t[26] !== e ? (i = (m, mt) => /* @__PURE__ */ a.jsx(nt.path, { variants: {
|
|
108
106
|
initial: {
|
|
109
107
|
pathLength: 0,
|
|
110
|
-
d:
|
|
111
|
-
opacity:
|
|
108
|
+
d: ct(0, 0, n - e / 2, m.startAngle - Math.PI / 2, m.endAngle - Math.PI / 2),
|
|
109
|
+
opacity: g ? g.label === m.data.label ? 1 : 0.3 : 1
|
|
112
110
|
},
|
|
113
111
|
whileInView: {
|
|
114
112
|
pathLength: 1,
|
|
115
|
-
d:
|
|
116
|
-
opacity:
|
|
113
|
+
d: ct(0, 0, n - e / 2, m.startAngle - Math.PI / 2, m.endAngle - Math.PI / 2),
|
|
114
|
+
opacity: g ? g.label === m.data.label ? 1 : 0.3 : 1,
|
|
117
115
|
transition: {
|
|
118
|
-
duration:
|
|
116
|
+
duration: p.duration
|
|
119
117
|
}
|
|
120
118
|
}
|
|
121
|
-
}, initial: "initial", animate:
|
|
119
|
+
}, initial: "initial", animate: j ? "whileInView" : "initial", exit: {
|
|
122
120
|
opacity: 0,
|
|
123
121
|
transition: {
|
|
124
|
-
duration:
|
|
122
|
+
duration: p.duration
|
|
125
123
|
}
|
|
126
124
|
}, style: {
|
|
127
|
-
stroke:
|
|
125
|
+
stroke: k.indexOf(m.data.label) !== -1 ? h[k.indexOf(m.data.label) % h.length] : R.gray,
|
|
128
126
|
strokeWidth: e,
|
|
129
127
|
fill: "none"
|
|
130
|
-
}, onMouseEnter: (
|
|
131
|
-
|
|
128
|
+
}, onMouseEnter: (U) => {
|
|
129
|
+
T(m.data), K(U.clientY), J(U.clientX), x?.(m);
|
|
132
130
|
}, onClick: () => {
|
|
133
|
-
(
|
|
134
|
-
}, onMouseMove: (
|
|
135
|
-
|
|
131
|
+
(u || f) && (yt(A, m.data) && N ? (O(void 0), u?.(void 0)) : (O(m.data), u && u(m.data)));
|
|
132
|
+
}, onMouseMove: (U) => {
|
|
133
|
+
T(m.data), K(U.clientY), J(U.clientX);
|
|
136
134
|
}, onMouseLeave: () => {
|
|
137
|
-
|
|
138
|
-
} },
|
|
139
|
-
const
|
|
140
|
-
let
|
|
141
|
-
t[
|
|
142
|
-
let
|
|
143
|
-
t[
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
] }), t[
|
|
135
|
+
T(void 0), J(void 0), K(void 0), x?.(void 0);
|
|
136
|
+
} }, mt), t[14] = p.duration, t[15] = k, t[16] = h, t[17] = f, t[18] = j, t[19] = A, t[20] = g, t[21] = u, t[22] = x, t[23] = n, t[24] = N, t[25] = O, t[26] = e, t[27] = i) : i = t[27];
|
|
137
|
+
const G = L(l).map(i);
|
|
138
|
+
let C;
|
|
139
|
+
t[28] !== E || t[29] !== G ? (C = /* @__PURE__ */ a.jsx(E, { children: G }), t[28] = E, t[29] = G, t[30] = C) : C = t[30];
|
|
140
|
+
let X;
|
|
141
|
+
t[31] !== z || t[32] !== C || t[33] !== S.g || t[34] !== H || t[35] !== I ? (X = /* @__PURE__ */ a.jsxs(S.g, { transform: H, children: [
|
|
142
|
+
I,
|
|
143
|
+
z,
|
|
144
|
+
C
|
|
145
|
+
] }), t[31] = z, t[32] = C, t[33] = S.g, t[34] = H, t[35] = I, t[36] = X) : X = t[36];
|
|
148
146
|
let Y;
|
|
149
|
-
t[
|
|
147
|
+
t[37] !== Q.svg || t[38] !== X || t[39] !== M || t[40] !== D || t[41] !== W ? (Y = /* @__PURE__ */ a.jsx(Q.svg, { ref: P, width: M, height: D, viewBox: W, direction: ot, className: tt, children: X }), t[37] = Q.svg, t[38] = X, t[39] = M, t[40] = D, t[41] = W, t[42] = Y) : Y = t[42];
|
|
148
|
+
let Z;
|
|
149
|
+
t[43] !== y?.tooltip || t[44] !== B || t[45] !== F || t[46] !== g || t[47] !== b?.tooltip || t[48] !== s ? (Z = g && s && B && F ? /* @__PURE__ */ a.jsx(bt, { data: g, body: s, xPos: B, yPos: F, backgroundStyle: b?.tooltip, className: y?.tooltip }) : null, t[43] = y?.tooltip, t[44] = B, t[45] = F, t[46] = g, t[47] = b?.tooltip, t[48] = s, t[49] = Z) : Z = t[49];
|
|
150
150
|
let q;
|
|
151
|
-
t[
|
|
152
|
-
let
|
|
153
|
-
|
|
154
|
-
let ot;
|
|
155
|
-
return t[57] !== Y || t[58] !== q || t[59] !== R ? (ot = /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
151
|
+
t[50] !== y?.modal || t[51] !== f || t[52] !== A || t[53] !== O ? (q = f && A !== void 0 ? /* @__PURE__ */ a.jsx(vt, { body: f, data: A, setData: O, className: y?.modal }) : null, t[50] = y?.modal, t[51] = f, t[52] = A, t[53] = O, t[54] = q) : q = t[54];
|
|
152
|
+
let et;
|
|
153
|
+
return t[55] !== Y || t[56] !== Z || t[57] !== q ? (et = /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
156
154
|
Y,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
] }), t[
|
|
155
|
+
Z,
|
|
156
|
+
q
|
|
157
|
+
] }), t[55] = Y, t[56] = Z, t[57] = q, t[58] = et) : et = t[58], et;
|
|
160
158
|
}
|
|
161
|
-
function
|
|
159
|
+
function It(c) {
|
|
162
160
|
return c.size;
|
|
163
161
|
}
|
|
164
|
-
function
|
|
162
|
+
function _t(c) {
|
|
165
163
|
const {
|
|
166
164
|
mainText: t,
|
|
167
165
|
graphTitle: o,
|
|
168
|
-
colors: l =
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
detailsOnClick: U,
|
|
199
|
-
styles: C,
|
|
166
|
+
colors: l = R.light.categoricalColors.colors,
|
|
167
|
+
sources: n,
|
|
168
|
+
strokeWidth: h = 50,
|
|
169
|
+
graphDescription: r,
|
|
170
|
+
subNote: e,
|
|
171
|
+
footNote: s,
|
|
172
|
+
radius: x,
|
|
173
|
+
data: u,
|
|
174
|
+
showColorScale: k = !0,
|
|
175
|
+
padding: N,
|
|
176
|
+
backgroundColor: f = !1,
|
|
177
|
+
tooltip: b,
|
|
178
|
+
onSeriesMouseOver: y,
|
|
179
|
+
graphID: p,
|
|
180
|
+
onSeriesMouseClick: w,
|
|
181
|
+
graphDownload: v = !1,
|
|
182
|
+
dataDownload: P = !1,
|
|
183
|
+
colorDomain: d,
|
|
184
|
+
sortData: j,
|
|
185
|
+
language: L = "en",
|
|
186
|
+
theme: g = "light",
|
|
187
|
+
width: T,
|
|
188
|
+
height: A,
|
|
189
|
+
minHeight: O = 0,
|
|
190
|
+
relativeHeight: B,
|
|
191
|
+
ariaLabel: J,
|
|
192
|
+
resetSelectionOnDoubleClick: F = !0,
|
|
193
|
+
colorScaleMaxWidth: K,
|
|
194
|
+
detailsOnClick: Q,
|
|
195
|
+
styles: M,
|
|
200
196
|
classNames: D,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
Z((Math.min(M[0].target.clientWidth || 620, M[0].target.clientHeight || 480) || 420) / 2);
|
|
197
|
+
animate: W = !1,
|
|
198
|
+
trackColor: ot = R.light.grays["gray-200"],
|
|
199
|
+
naLabel: tt = "NA",
|
|
200
|
+
numberDisplayOptions: S
|
|
201
|
+
} = c, [H, I] = _(0), V = rt(null), z = rt(null);
|
|
202
|
+
ft(() => {
|
|
203
|
+
const i = new ResizeObserver((G) => {
|
|
204
|
+
I((Math.min(G[0].target.clientWidth || 620, G[0].target.clientHeight || 480) || 420) / 2);
|
|
210
205
|
});
|
|
211
|
-
return
|
|
206
|
+
return V.current && i.observe(V.current), () => i.disconnect();
|
|
212
207
|
}, []);
|
|
213
|
-
const
|
|
214
|
-
return /* @__PURE__ */ a.jsxs(
|
|
215
|
-
o ||
|
|
216
|
-
title:
|
|
217
|
-
description:
|
|
208
|
+
const E = j ? ht(u, ["size"], [j]) : u;
|
|
209
|
+
return /* @__PURE__ */ a.jsxs(wt, { className: D?.graphContainer, style: M?.graphContainer, id: p, ref: z, "aria-label": J, backgroundColor: f, theme: g, language: L, minHeight: O, width: T, height: A, relativeHeight: B, padding: N, children: [
|
|
210
|
+
o || r || v || P ? /* @__PURE__ */ a.jsx(kt, { styles: {
|
|
211
|
+
title: M?.title,
|
|
212
|
+
description: M?.description
|
|
218
213
|
}, classNames: {
|
|
219
214
|
title: D?.title,
|
|
220
215
|
description: D?.description
|
|
221
|
-
}, graphTitle: o, graphDescription:
|
|
222
|
-
|
|
223
|
-
/* @__PURE__ */ a.jsx("div", { className:
|
|
224
|
-
maxWidth:
|
|
225
|
-
}, "aria-label": "Color legend", children:
|
|
216
|
+
}, graphTitle: o, graphDescription: r, width: T, graphDownload: v ? z : void 0, dataDownload: P ? u.map((i) => i.data).filter((i) => i !== void 0).length > 0 ? u.map((i) => i.data).filter((i) => i !== void 0) : u.filter((i) => i !== void 0) : null }) : null,
|
|
217
|
+
k && u.length > 0 ? /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
218
|
+
/* @__PURE__ */ a.jsx("div", { className: dt("leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap", D?.colorLegend), style: {
|
|
219
|
+
maxWidth: K
|
|
220
|
+
}, "aria-label": "Color legend", children: E.map((i, G) => /* @__PURE__ */ a.jsxs("div", { className: "flex gap-2 items-center pb-3", children: [
|
|
226
221
|
/* @__PURE__ */ a.jsx("div", { className: "w-3 h-3 rounded-full", style: {
|
|
227
|
-
backgroundColor: (
|
|
222
|
+
backgroundColor: (d || E.map((C) => C.label)).indexOf(i.label) !== -1 ? (l || R[g].categoricalColors.colors)[(d || E.map((C) => C.label)).indexOf(i.label) % (l || R[g].categoricalColors.colors).length] : R.gray
|
|
228
223
|
} }),
|
|
229
|
-
/* @__PURE__ */ a.jsxs(
|
|
224
|
+
/* @__PURE__ */ a.jsxs(it, { marginBottom: "none", size: "sm", className: "text-primary-gray-700 dark:text-primary-gray-100", children: [
|
|
230
225
|
i.label,
|
|
231
226
|
":",
|
|
232
227
|
" ",
|
|
233
228
|
/* @__PURE__ */ a.jsx("span", { className: "font-bold", style: {
|
|
234
229
|
fontSize: "inherit"
|
|
235
|
-
}, children:
|
|
230
|
+
}, children: ut(i.size, tt, S?.precision, S?.prefix, S?.suffix, S?.locale, S?.padZeros) })
|
|
236
231
|
] })
|
|
237
|
-
] },
|
|
238
|
-
/* @__PURE__ */ a.jsx(
|
|
232
|
+
] }, G)) }),
|
|
233
|
+
/* @__PURE__ */ a.jsx(xt, { size: "lg" })
|
|
239
234
|
] }) : null,
|
|
240
|
-
/* @__PURE__ */ a.jsxs(
|
|
241
|
-
|
|
242
|
-
|
|
235
|
+
/* @__PURE__ */ a.jsxs(At, { ref: V, children: [
|
|
236
|
+
u.length === 0 && /* @__PURE__ */ a.jsx(Nt, {}),
|
|
237
|
+
H && u.length > 0 ? /* @__PURE__ */ a.jsx(Pt, { mainText: t, data: E, colors: l, radius: x || H, subNote: e, strokeWidth: h, tooltip: b, colorDomain: d || E.map((i) => i.label), onSeriesMouseOver: y, onSeriesMouseClick: w, resetSelectionOnDoubleClick: F, styles: M, detailsOnClick: Q, animate: W === !0 ? {
|
|
243
238
|
duration: 0.5,
|
|
244
239
|
once: !0,
|
|
245
240
|
amount: 0.5
|
|
246
|
-
} :
|
|
241
|
+
} : W || {
|
|
247
242
|
duration: 0,
|
|
248
243
|
once: !0,
|
|
249
244
|
amount: 0
|
|
250
|
-
},
|
|
245
|
+
}, trackColor: ot, naLabel: tt }) : null
|
|
251
246
|
] }),
|
|
252
|
-
|
|
253
|
-
footnote:
|
|
254
|
-
source:
|
|
247
|
+
n || s ? /* @__PURE__ */ a.jsx(Ct, { styles: {
|
|
248
|
+
footnote: M?.footnote,
|
|
249
|
+
source: M?.source
|
|
255
250
|
}, classNames: {
|
|
256
251
|
footnote: D?.footnote,
|
|
257
252
|
source: D?.source
|
|
258
|
-
}, sources:
|
|
253
|
+
}, sources: n, footNote: s, width: T }) : null
|
|
259
254
|
] });
|
|
260
255
|
}
|
|
261
256
|
export {
|
|
262
|
-
|
|
257
|
+
_t as DonutChart
|
|
263
258
|
};
|
|
264
259
|
//# sourceMappingURL=DonutChart.js.map
|