@undp/data-viz 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +21 -21
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +7 -7
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +2 -2
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.js +5 -5
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +14 -14
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +9 -9
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.js +9 -9
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +1 -1
- package/dist/CopyTextButton.cjs +7 -7
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +4 -4
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/DataCards.cjs +9 -9
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +93 -93
- package/dist/DataCards.js.map +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +18 -18
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.js +8 -8
- package/dist/{DropdownSelect-0I2QxaVy.cjs → DropdownSelect-BmE5JaeE.cjs} +6 -6
- package/dist/{DropdownSelect-0I2QxaVy.cjs.map → DropdownSelect-BmE5JaeE.cjs.map} +1 -1
- package/dist/{DropdownSelect-CDC9lEqU.js → DropdownSelect-CeHog_ih.js} +4 -4
- package/dist/{DropdownSelect-CDC9lEqU.js.map → DropdownSelect-CeHog_ih.js.map} +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +15 -15
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +13 -13
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.js +2 -2
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +2 -2
- package/dist/{GraphEl-B6SoGRFW.cjs → GraphEl-B5gAX1IQ.cjs} +2 -2
- package/dist/{GraphEl-B6SoGRFW.cjs.map → GraphEl-B5gAX1IQ.cjs.map} +1 -1
- package/dist/{GraphEl-Cw2tDUb3.js → GraphEl-BdIyscdt.js} +3 -3
- package/dist/{GraphEl-Cw2tDUb3.js.map → GraphEl-BdIyscdt.js.map} +1 -1
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +4 -4
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.js +1 -1
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +10 -10
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +21 -21
- package/dist/{Modal-CUU6ZK3U.js → Modal-DVVwpKhP.js} +2 -2
- package/dist/{Modal-CUU6ZK3U.js.map → Modal-DVVwpKhP.js.map} +1 -1
- package/dist/{Modal-C_dl0EtQ.cjs → Modal-tXZlLE5s.cjs} +4 -4
- package/dist/{Modal-C_dl0EtQ.cjs.map → Modal-tXZlLE5s.cjs.map} +1 -1
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.js +3 -3
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.js +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +3 -3
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +21 -21
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +19 -19
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +12 -12
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.js +2 -2
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.js +8 -8
- package/dist/{ReferenceLine-CuFMk0cI.cjs → ReferenceLine-CFVBBN__.cjs} +2 -2
- package/dist/{ReferenceLine-CuFMk0cI.cjs.map → ReferenceLine-CFVBBN__.cjs.map} +1 -1
- package/dist/{ReferenceLine-C1GpoG9d.js → ReferenceLine-CfAW3vKJ.js} +2 -2
- package/dist/{ReferenceLine-C1GpoG9d.js.map → ReferenceLine-CfAW3vKJ.js.map} +1 -1
- package/dist/{RegressionLine-BFwDCTUU.js → RegressionLine-mH7UKOPi.js} +3 -3
- package/dist/{RegressionLine-BFwDCTUU.js.map → RegressionLine-mH7UKOPi.js.map} +1 -1
- package/dist/{RegressionLine-7_rKTHN_.cjs → RegressionLine-xKdiJ8sw.cjs} +2 -2
- package/dist/{RegressionLine-7_rKTHN_.cjs.map → RegressionLine-xKdiJ8sw.cjs.map} +1 -1
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +4 -4
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.js +13 -13
- package/dist/ScrollStory.cjs +1 -1
- package/dist/ScrollStory.js +2 -2
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +20 -20
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.js +4 -4
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.js +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +3 -3
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.js +7 -7
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.js +9 -9
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.js +2 -2
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +4 -4
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +3 -3
- package/dist/{XAxesLabels-DQFo_z2R.js → XAxesLabels-CaV2q-6H.js} +2 -2
- package/dist/{XAxesLabels-DQFo_z2R.js.map → XAxesLabels-CaV2q-6H.js.map} +1 -1
- package/dist/{XAxesLabels-CJMQbfVy.cjs → XAxesLabels-OjBNl_lS.cjs} +2 -2
- package/dist/{XAxesLabels-CJMQbfVy.cjs.map → XAxesLabels-OjBNl_lS.cjs.map} +1 -1
- package/dist/{YAxesLabels-H5-002X5.js → YAxesLabels-CPGZjmZJ.js} +2 -2
- package/dist/{YAxesLabels-H5-002X5.js.map → YAxesLabels-CPGZjmZJ.js.map} +1 -1
- package/dist/{YAxesLabels-BXLTX7AI.cjs → YAxesLabels-D8IydyZj.cjs} +2 -2
- package/dist/{YAxesLabels-BXLTX7AI.cjs.map → YAxesLabels-D8IydyZj.cjs.map} +1 -1
- package/dist/{checkIfMultiple-Do4kADNr.cjs → checkIfMultiple-BXbHUCWM.cjs} +6 -6
- package/dist/{checkIfMultiple-Do4kADNr.cjs.map → checkIfMultiple-BXbHUCWM.cjs.map} +1 -1
- package/dist/{checkIfMultiple-CYp3vADF.js → checkIfMultiple-ChTJk2Tk.js} +5 -5
- package/dist/{checkIfMultiple-CYp3vADF.js.map → checkIfMultiple-ChTJk2Tk.js.map} +1 -1
- package/dist/{customArea-CaxScFmW.js → customArea-B-dWU0zZ.js} +2 -2
- package/dist/{customArea-CaxScFmW.js.map → customArea-B-dWU0zZ.js.map} +1 -1
- package/dist/{customArea-BYNyxAkm.cjs → customArea-CK768gCn.cjs} +2 -2
- package/dist/{customArea-BYNyxAkm.cjs.map → customArea-CK768gCn.cjs.map} +1 -1
- package/dist/{fetchAndParseData-Bcmr659B.js → fetchAndParseData-4gsYTy6_.js} +3 -3
- package/dist/fetchAndParseData-4gsYTy6_.js.map +1 -0
- package/dist/{fetchAndParseData-DmgQtB9n.cjs → fetchAndParseData-CQyVGCul.cjs} +6 -6
- package/dist/fetchAndParseData-CQyVGCul.cjs.map +1 -0
- package/dist/fetchAndParseData.cjs +1 -1
- package/dist/fetchAndParseData.js +1 -1
- package/dist/index-BW8iNx7E.cjs +10 -0
- package/dist/index-BW8iNx7E.cjs.map +1 -0
- package/dist/index-CNvov0eg.js +122 -0
- package/dist/index-CNvov0eg.js.map +1 -0
- package/dist/{index-D_n8aamX.cjs → index-CZLvTu6p.cjs} +2 -2
- package/dist/{index-D_n8aamX.cjs.map → index-CZLvTu6p.cjs.map} +1 -1
- package/dist/{index-n_RI8T0n.js → index-Cdcfp4nk.js} +2 -2
- package/dist/{index-n_RI8T0n.js.map → index-Cdcfp4nk.js.map} +1 -1
- package/dist/{index-BVnYktl4.js → index-DGAaLNu9.js} +2 -2
- package/dist/{index-BVnYktl4.js.map → index-DGAaLNu9.js.map} +1 -1
- package/dist/{index-CylX-pWB.cjs → index-DNj994Pv.cjs} +2 -2
- package/dist/{index-CylX-pWB.cjs.map → index-DNj994Pv.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/proxy-BHRoeZgd.cjs +2 -0
- package/dist/proxy-BHRoeZgd.cjs.map +1 -0
- package/dist/{proxy-DJxJg1kD.js → proxy-CkpFesk1.js} +4123 -4075
- package/dist/proxy-CkpFesk1.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/transformData.cjs +1 -1
- package/dist/transformData.js +2 -2
- package/dist/{transformDataForGraphFromFile-D9G3ToQf.cjs → transformDataForGraphFromFile-B1A0AS-Z.cjs} +2 -2
- package/dist/{transformDataForGraphFromFile-D9G3ToQf.cjs.map → transformDataForGraphFromFile-B1A0AS-Z.cjs.map} +1 -1
- package/dist/{transformDataForGraphFromFile-CA0rw80A.js → transformDataForGraphFromFile-BCjsizvb.js} +2 -2
- package/dist/{transformDataForGraphFromFile-CA0rw80A.js.map → transformDataForGraphFromFile-BCjsizvb.js.map} +1 -1
- package/dist/{use-in-view-BCmzDU2O.cjs → use-in-view-sQJZ_xDO.cjs} +2 -2
- package/dist/use-in-view-sQJZ_xDO.cjs.map +1 -0
- package/dist/{use-in-view-BAHrBy6b.js → use-in-view-yS6jzJAp.js} +2 -2
- package/dist/use-in-view-yS6jzJAp.js.map +1 -0
- package/dist/x-BBpi7a_7-Dz2vKSfu.cjs +27 -0
- package/dist/x-BBpi7a_7-Dz2vKSfu.cjs.map +1 -0
- package/dist/x-BBpi7a_7-WVdj1j6r.js +106 -0
- package/dist/x-BBpi7a_7-WVdj1j6r.js.map +1 -0
- package/package.json +50 -51
- package/dist/fetchAndParseData-Bcmr659B.js.map +0 -1
- package/dist/fetchAndParseData-DmgQtB9n.cjs.map +0 -1
- package/dist/index-BxAUvrua.js +0 -120
- package/dist/index-BxAUvrua.js.map +0 -1
- package/dist/index-DVOJ7vxH.cjs +0 -10
- package/dist/index-DVOJ7vxH.cjs.map +0 -1
- package/dist/proxy-DJxJg1kD.js.map +0 -1
- package/dist/proxy-PQd2AItT.cjs +0 -2
- package/dist/proxy-PQd2AItT.cjs.map +0 -1
- package/dist/use-in-view-BAHrBy6b.js.map +0 -1
- package/dist/use-in-view-BCmzDU2O.cjs.map +0 -1
- package/dist/x-CnsEH4Ox-CGGXQl4M.cjs +0 -27
- package/dist/x-CnsEH4Ox-CGGXQl4M.cjs.map +0 -1
- package/dist/x-CnsEH4Ox-DDvAJndW.js +0 -101
- package/dist/x-CnsEH4Ox-DDvAJndW.js.map +0 -1
package/dist/SimpleLineChart.js
CHANGED
|
@@ -6,23 +6,23 @@ import { l as Le, a as $e } from "./simple-statistics-flVzqVtt.js";
|
|
|
6
6
|
import { n as Ae } from "./numberFormattingFunction-14YCbkN2.js";
|
|
7
7
|
import { T as Ne } from "./Tooltip-DyM5snqx.js";
|
|
8
8
|
import { c as k } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
9
|
-
import { C as ke, g as Te, A as Se } from "./customArea-
|
|
9
|
+
import { C as ke, g as Te, A as Se } from "./customArea-B-dWU0zZ.js";
|
|
10
10
|
import { A as Me } from "./Axis-Ddg-seDi.js";
|
|
11
11
|
import { A as Ve } from "./AxisTitle-BmHLMRJZ.js";
|
|
12
12
|
import { X as Re } from "./XTicksAndGridLines-Bn9u5gOM.js";
|
|
13
|
-
import { R as He } from "./ReferenceLine-
|
|
14
|
-
import { R as Ie } from "./RegressionLine-
|
|
13
|
+
import { R as He } from "./ReferenceLine-CfAW3vKJ.js";
|
|
14
|
+
import { R as Ie } from "./RegressionLine-mH7UKOPi.js";
|
|
15
15
|
import { Y as We } from "./YTicksAndGridLines-B6ah7CRf.js";
|
|
16
|
-
import { H as Fe } from "./index-
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
16
|
+
import { H as Fe } from "./index-Cdcfp4nk.js";
|
|
17
|
+
import { t as Ye } from "./time-BzJP5SPC.js";
|
|
18
|
+
import { a as Pe } from "./linear-DUdu7l2G.js";
|
|
19
|
+
import { l as Xe, c as Ee } from "./line-CPfhohvF.js";
|
|
20
|
+
import { c as Ge, s as Be, a as ze, m as Ue } from "./step-BrDul-H4.js";
|
|
21
|
+
import { s as qe } from "./select-DKy99ogv.js";
|
|
22
|
+
import { a as Je } from "./init-BhZylTFx.js";
|
|
23
|
+
import { p as Ke } from "./pointer-CWRWOsrb.js";
|
|
24
|
+
import { u as Qe } from "./use-in-view-yS6jzJAp.js";
|
|
25
|
+
import { m as F } from "./proxy-CkpFesk1.js";
|
|
26
26
|
import { GraphFooter as Ze } from "./GraphFooter.js";
|
|
27
27
|
import { GraphHeader as _e } from "./GraphHeader.js";
|
|
28
28
|
import { Colors as et } from "./Colors.js";
|
|
@@ -64,7 +64,7 @@ function it(re) {
|
|
|
64
64
|
classNames: x,
|
|
65
65
|
precision: w,
|
|
66
66
|
customLayers: J
|
|
67
|
-
} = re, K = oe(null), g =
|
|
67
|
+
} = re, K = oe(null), g = Qe(K, {
|
|
68
68
|
once: a.once,
|
|
69
69
|
amount: a.amount
|
|
70
70
|
}), [C, ge] = M(!1);
|
|
@@ -79,7 +79,7 @@ function it(re) {
|
|
|
79
79
|
return () => clearTimeout(e);
|
|
80
80
|
}
|
|
81
81
|
}, [g, C, a.duration]);
|
|
82
|
-
const ue = $ === "linear" ?
|
|
82
|
+
const ue = $ === "linear" ? Ee : $ === "step" ? Ge : $ === "stepAfter" ? Be : $ === "stepBefore" ? ze : Ue, [N, Q] = M(void 0), [Z, _] = M(void 0), [j, b] = M(void 0), p = {
|
|
83
83
|
top: le,
|
|
84
84
|
bottom: E,
|
|
85
85
|
left: q ? d + 30 : d,
|
|
@@ -101,22 +101,22 @@ function it(re) {
|
|
|
101
101
|
coordinates: e.coordinates.map(
|
|
102
102
|
(y, O) => O % 2 === 0 ? h(`${y}`, o, /* @__PURE__ */ new Date()) : y
|
|
103
103
|
)
|
|
104
|
-
})), l = A - p.left - p.right, f = V - p.top - p.bottom, ae = W ? h(`${W}`, o, /* @__PURE__ */ new Date()) : i[0].date, c = I ? h(`${I}`, o, /* @__PURE__ */ new Date()) : i[i.length - 1].date, u = k(B) ? Math.min(...i.map((e) => e.y).filter((e) => e != null)) !== 1 / 0 ? Math.min(...i.map((e) => e.y).filter((e) => e != null)) > 0 ? 0 : Math.min(...i.map((e) => e.y).filter((e) => e != null)) : 0 : B, pe = Math.max(...i.map((e) => e.y).filter((e) => e != null)) !== 1 / 0 ? Math.max(...i.map((e) => e.y).filter((e) => e != null)) : 0, s =
|
|
104
|
+
})), l = A - p.left - p.right, f = V - p.top - p.bottom, ae = W ? h(`${W}`, o, /* @__PURE__ */ new Date()) : i[0].date, c = I ? h(`${I}`, o, /* @__PURE__ */ new Date()) : i[i.length - 1].date, u = k(B) ? Math.min(...i.map((e) => e.y).filter((e) => e != null)) !== 1 / 0 ? Math.min(...i.map((e) => e.y).filter((e) => e != null)) > 0 ? 0 : Math.min(...i.map((e) => e.y).filter((e) => e != null)) : 0 : B, pe = Math.max(...i.map((e) => e.y).filter((e) => e != null)) !== 1 / 0 ? Math.max(...i.map((e) => e.y).filter((e) => e != null)) : 0, s = Ye().domain([ae, c]).range([0, l]), r = Pe().domain([
|
|
105
105
|
u,
|
|
106
106
|
k(z) ? pe > 0 ? pe : 0 : z
|
|
107
|
-
]).range([f, 0]).nice(), ve =
|
|
107
|
+
]).range([f, 0]).nice(), ve = Xe().x((e) => s(e.date)).y((e) => r(e.y)).curve(ue), we = r.ticks(he), je = s.ticks(X);
|
|
108
108
|
de(() => {
|
|
109
109
|
const e = (O) => {
|
|
110
|
-
const se = i[
|
|
110
|
+
const se = i[Je(
|
|
111
111
|
i.map((ye) => ye.date),
|
|
112
|
-
s.invert(
|
|
112
|
+
s.invert(Ke(O)[0]),
|
|
113
113
|
1
|
|
114
114
|
)];
|
|
115
115
|
Q(se || i[i.length - 1]), R?.(se || i[i.length - 1]), b(O.clientY), _(O.clientX);
|
|
116
116
|
}, y = () => {
|
|
117
117
|
Q(void 0), _(void 0), b(void 0), R?.(void 0);
|
|
118
118
|
};
|
|
119
|
-
|
|
119
|
+
qe(ee.current).on("mousemove", e).on("mouseout", y);
|
|
120
120
|
}, [s, i, R]);
|
|
121
121
|
const Ce = Le(
|
|
122
122
|
i.filter((e) => !k(e.date) && !k(e.y)).map((e) => [s(e.date), r(e.y)])
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-DDoeWRVt.cjs"),o=require("react"),ae=require("./index-Ds0uHjK9.cjs"),A=require("./index-B0rbzOoC.cjs"),te=require("./index-BXns0-ng.cjs"),C=require("./DropdownSelect-0I2QxaVy.cjs"),h=require("./checkIfMultiple-Do4kADNr.cjs"),le=require("./Typography-k-kOjICQ.cjs"),ne=require("./Spinner-DA6Z5E4n.cjs"),re=require("./GraphEl-B6SoGRFW.cjs"),G=require("./fetchAndParseData-DmgQtB9n.cjs"),U=require("./transformDataForAggregation-Du-Hei-W.cjs"),z=require("./getUniqValue-CHqgSss5.cjs"),ie=require("./GraphHeader.cjs"),W=require("./filterData-DN6py7y_.cjs"),oe=require("./getGraphList-gf02xgT2.cjs"),Z=require("./transformDataForSelect-YmStusCI.cjs"),se=s=>{if(s.findIndex(r=>r.chartConfigId==="yMin")!==-1&&s.findIndex(r=>r.chartConfigId==="yMax")!==-1)return s;const l=[...s];return s.findIndex(r=>r.chartConfigId==="yMin")===-1&&l.push({chartConfigId:"yMin",columnId:`${s[s.findIndex(r=>r.chartConfigId==="y")].columnId}Min`}),s.findIndex(r=>r.chartConfigId==="yMax")===-1&&l.push({chartConfigId:"yMax",columnId:`${s[s.findIndex(r=>r.chartConfigId==="y")].columnId}Max`}),l},F=(s,l)=>{const r=l?.map(y=>{const f=s?.findIndex(i=>i.chartConfigId===y.chartConfigId);if(f===-1)return{};const v=s[f]?.allowedColumnIds?.findIndex(i=>i.value===y.columnId);return v===-1?{}:s[f].allowedColumnIds[v].graphSettings||{}})||[];return Object.assign({},...r)};function ue(s){const{graphSettings:l,dataSettings:r,filters:y,graphType:f,dataTransform:v,graphDataConfiguration:i,dataFilters:q,debugMode:D,dataSelectionOptions:j,advancedDataSelectionOptions:N,readableHeader:J,noOfFiltersPerRow:p=4,updateFilters:B,uiMode:g="normal",highlightDataPointSettings:I}=s,[b,K]=o.useState(void 0),[S,Q]=o.useState(void 0),[m,w]=o.useState(i),[x,R]=o.useState({}),[V,X]=o.useState(void 0),[Y,_]=o.useState([]),P=o.useRef(null),H=o.useRef(i),[E,O]=o.useState([]),k=o.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),L=o.useCallback(async()=>{if(r)try{const d=await(r.dataURL?typeof r.dataURL=="string"?r.fileType==="json"?G.fetchAndParseJSON(r.dataURL,r.columnsToArray,r.dataTransformation,D):r.fileType==="api"?G.fetchAndTransformDataFromAPI(r.dataURL,r.apiHeaders,r.columnsToArray,r.dataTransformation,D):G.fetchAndParseCSV(r.dataURL,r.dataTransformation,r.columnsToArray,D,r.delimiter,!0):G.fetchAndParseMultipleDataSources(r.dataURL,r.idColumnTitle):G.transformColumnsToArray(r.data,r.columnsToArray));Q(d);const a=(y||[]).map(t=>({filter:t.column,label:t.label||`Filter by ${t.column}`,singleSelect:t.singleSelect,clearable:t.clearable,defaultValue:Z.transformDefaultValue(t.defaultValue),value:Z.transformDefaultValue(t.defaultValue),availableValues:z.getUniqValue(d,t.column).filter(u=>!t.excludeValues?.includes(`${u}`)).map(u=>({value:u,label:u})),allowSelectAll:t.allowSelectAll,width:t.width}));O(a)}catch(e){console.error("Data fetching error:",e)}},[r,y,D]);o.useEffect(()=>{L()},[L]);const $=o.useMemo(()=>!S||E.length===0?S:S.filter(d=>E.every(a=>a.value&&A.flattenDeep([a.value]).length>0?ae.intersection(A.flattenDeep([d[a.filter]]),A.flattenDeep([a.value]).map(t=>t.value)).length>0:!0)),[E,S]);o.useEffect(()=>{j&&R(F(j,i))},[j,i]),o.useEffect(()=>{S&&K($)},[$,f,S]),o.useEffect(()=>{I?.column&&$&&_(z.getUniqValue($,I.column).filter(e=>!I?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))},[$,I]),o.useEffect(()=>{te.isEqual(H.current,i)||(w(i),H.current=i)},[i]);const M=o.useCallback((e,d)=>{O(a=>a.map(t=>t.filter===e?{...t,value:d}:t))},[]),ee=o.useMemo(()=>{if(!b)return;const e=f==="lineChartWithConfidenceInterval"&&m?se(m):m;return U.transformDataForGraph(v?U.transformDataForAggregation(W.filterData(b,q||[]),v.keyColumn,v.aggregationColumnsSetting):W.filterData(b,q||[]),f,e)},[f,m,b,q,v]);return r?n.jsxRuntimeExports.jsx("div",{className:`${l?.theme||"light"} flex ${l?.width?"w-fit grow-0":"w-full grow"}${l?.height?"":" h-full"}`,dir:l?.language==="he"||l?.language==="ar"?"rtl":void 0,children:n.jsxRuntimeExports.jsx("div",{className:n.mo(`${l?.backgroundColor?l?.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${l?.language||"en"}`,l?.classNames?.graphContainer),style:{...l?.styles?.graphContainer||{},...l?.backgroundColor&&l?.backgroundColor!==!0?{backgroundColor:l?.backgroundColor}:{}},id:l?.graphID,ref:P,children:n.jsxRuntimeExports.jsx("div",{style:{padding:l?.backgroundColor?l?.padding||"1rem":l?.padding||0,flexGrow:1,display:"flex"},children:n.jsxRuntimeExports.jsx("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:b||oe.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(f)!==-1?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[x?.graphTitle||x?.graphDescription||l?.graphTitle||l?.graphDescription||l?.graphDownload||l?.dataDownload?n.jsxRuntimeExports.jsx(ie.GraphHeader,{styles:{title:x?.styles?.title||l?.styles?.title,description:x?.styles?.description||l?.styles?.description},classNames:{title:x?.classNames?.title||l?.classNames?.title,description:x?.classNames?.description||l?.classNames?.description},graphTitle:x?.graphTitle||l?.graphTitle,graphDescription:x?.graphDescription||l?.graphDescription,width:x?.width||l?.width,graphDownload:l?.graphDownload?P.current:void 0,dataDownload:l?.dataDownload&&b&&b.length>0?b:null}):null,E.length!==0||(j||[]).length!==0||(N||[]).length!==0||I?n.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:[N?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.options.map(a=>({...a,value:a.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{R(a?.graphSettings||{}),w(a?.dataConfiguration)}}):n.jsxRuntimeExports.jsx(h.fe,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:g,onValueChange:a=>{const t=e.options[e.options.findIndex(u=>u.label===a)];R(t.graphSettings||{}),w(t.dataConfiguration)},children:e.options.map((a,t)=>n.jsxRuntimeExports.jsx(h.ve,{label:a.label,value:a.label},t))})]},d)),j?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),h.checkIfMultiple(e.chartConfigId,m||[])?e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:i?i[i.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]):void 0,filterOption:C.Hu(k),onChange:a=>{const t={columnId:(a||[]).map(c=>c.value),chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);w(u)}}):n.jsxRuntimeExports.jsx(h.w,{variant:g,defaultValue:i?i[i.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]).map(a=>a.value):[],onValueChange:a=>{const t={columnId:a||[],chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);w(u)},children:e.allowedColumnIds.map((a,t)=>n.jsxRuntimeExports.jsx(h.G,{label:a.label,value:a.label},t))}):e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:i?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===i[i.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:a=>{const t={columnId:a?.value,chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);R(F(j,u)),w(u)}}):n.jsxRuntimeExports.jsx(h.fe,{variant:g,defaultValue:i?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===i[i.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const u={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(T=>T.label===a)].value,chartConfigId:e.chartConfigId},c=m?.map(T=>T.chartConfigId===u.chartConfigId?u:T);R(F(j,c)),w(c)},children:e.allowedColumnIds.map((a,t)=>n.jsxRuntimeExports.jsx(h.ve,{label:a.label,value:a.label},t))})]},d)),E?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label}),e.singleSelect?n.jsxRuntimeExports.jsx(C.Za,{options:e.availableValues,variant:g,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:a=>{M(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.availableValues,variant:g,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:a=>{M(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):n.jsxRuntimeExports.jsx(h.w,{variant:g,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{M(e.filter,e.availableValues.filter(t=>a.indexOf(`${t.value}`)!==-1))},children:e.availableValues.map((a,t)=>n.jsxRuntimeExports.jsx(h.G,{label:`${a.label}`,value:`${a.value}`},t))}),e.allowSelectAll?n.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{M(e.filter,e.availableValues)},children:"Select all options"}):null]})]},d)),I?n.jsxRuntimeExports.jsxs("div",{style:{width:I.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:I.label||"Highlight data"}),n.jsxRuntimeExports.jsx(C.Za,{options:Y,variant:g,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:e=>{X(e?.map(d=>d.value))},value:V?.map(e=>({label:e,value:e})),defaultValue:I.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,n.jsxRuntimeExports.jsx(re.GraphEl,{graph:f,graphData:ee,graphDataConfiguration:m,debugMode:D,readableHeader:J||[],updateFilters:B,settings:{...l||{},...x,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",theme:l?.theme,...V?{highlightedDataPoints:V,highlightedIds:V?.map(e=>`${e}`),highlightedLines:V?.map(e=>e)}:{}}})]}):n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:n.jsxRuntimeExports.jsx(ne.y,{})})})})})}):n.jsxRuntimeExports.jsx(le.u,{size:"xs",className:"text-center text-accent-dark-red dark:text-accent-red p-2",children:"Please make sure either `dataSettings` props are present as they are required for data."})}exports.SingleGraphDashboard=ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-DDoeWRVt.cjs"),o=require("react"),ae=require("./index-Ds0uHjK9.cjs"),A=require("./index-B0rbzOoC.cjs"),te=require("./index-BXns0-ng.cjs"),C=require("./DropdownSelect-BmE5JaeE.cjs"),h=require("./checkIfMultiple-BXbHUCWM.cjs"),le=require("./Typography-k-kOjICQ.cjs"),ne=require("./Spinner-DA6Z5E4n.cjs"),re=require("./GraphEl-B5gAX1IQ.cjs"),G=require("./fetchAndParseData-CQyVGCul.cjs"),U=require("./transformDataForAggregation-Du-Hei-W.cjs"),z=require("./getUniqValue-CHqgSss5.cjs"),ie=require("./GraphHeader.cjs"),W=require("./filterData-DN6py7y_.cjs"),oe=require("./getGraphList-gf02xgT2.cjs"),Z=require("./transformDataForSelect-YmStusCI.cjs"),se=s=>{if(s.findIndex(r=>r.chartConfigId==="yMin")!==-1&&s.findIndex(r=>r.chartConfigId==="yMax")!==-1)return s;const l=[...s];return s.findIndex(r=>r.chartConfigId==="yMin")===-1&&l.push({chartConfigId:"yMin",columnId:`${s[s.findIndex(r=>r.chartConfigId==="y")].columnId}Min`}),s.findIndex(r=>r.chartConfigId==="yMax")===-1&&l.push({chartConfigId:"yMax",columnId:`${s[s.findIndex(r=>r.chartConfigId==="y")].columnId}Max`}),l},F=(s,l)=>{const r=l?.map(y=>{const f=s?.findIndex(i=>i.chartConfigId===y.chartConfigId);if(f===-1)return{};const v=s[f]?.allowedColumnIds?.findIndex(i=>i.value===y.columnId);return v===-1?{}:s[f].allowedColumnIds[v].graphSettings||{}})||[];return Object.assign({},...r)};function ue(s){const{graphSettings:l,dataSettings:r,filters:y,graphType:f,dataTransform:v,graphDataConfiguration:i,dataFilters:q,debugMode:D,dataSelectionOptions:j,advancedDataSelectionOptions:N,readableHeader:J,noOfFiltersPerRow:p=4,updateFilters:B,uiMode:g="normal",highlightDataPointSettings:I}=s,[b,K]=o.useState(void 0),[S,Q]=o.useState(void 0),[m,w]=o.useState(i),[x,R]=o.useState({}),[V,X]=o.useState(void 0),[Y,_]=o.useState([]),P=o.useRef(null),H=o.useRef(i),[E,O]=o.useState([]),k=o.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),L=o.useCallback(async()=>{if(r)try{const d=await(r.dataURL?typeof r.dataURL=="string"?r.fileType==="json"?G.fetchAndParseJSON(r.dataURL,r.columnsToArray,r.dataTransformation,D):r.fileType==="api"?G.fetchAndTransformDataFromAPI(r.dataURL,r.apiHeaders,r.columnsToArray,r.dataTransformation,D):G.fetchAndParseCSV(r.dataURL,r.dataTransformation,r.columnsToArray,D,r.delimiter,!0):G.fetchAndParseMultipleDataSources(r.dataURL,r.idColumnTitle):G.transformColumnsToArray(r.data,r.columnsToArray));Q(d);const a=(y||[]).map(t=>({filter:t.column,label:t.label||`Filter by ${t.column}`,singleSelect:t.singleSelect,clearable:t.clearable,defaultValue:Z.transformDefaultValue(t.defaultValue),value:Z.transformDefaultValue(t.defaultValue),availableValues:z.getUniqValue(d,t.column).filter(u=>!t.excludeValues?.includes(`${u}`)).map(u=>({value:u,label:u})),allowSelectAll:t.allowSelectAll,width:t.width}));O(a)}catch(e){console.error("Data fetching error:",e)}},[r,y,D]);o.useEffect(()=>{L()},[L]);const $=o.useMemo(()=>!S||E.length===0?S:S.filter(d=>E.every(a=>a.value&&A.flattenDeep([a.value]).length>0?ae.intersection(A.flattenDeep([d[a.filter]]),A.flattenDeep([a.value]).map(t=>t.value)).length>0:!0)),[E,S]);o.useEffect(()=>{j&&R(F(j,i))},[j,i]),o.useEffect(()=>{S&&K($)},[$,f,S]),o.useEffect(()=>{I?.column&&$&&_(z.getUniqValue($,I.column).filter(e=>!I?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))},[$,I]),o.useEffect(()=>{te.isEqual(H.current,i)||(w(i),H.current=i)},[i]);const M=o.useCallback((e,d)=>{O(a=>a.map(t=>t.filter===e?{...t,value:d}:t))},[]),ee=o.useMemo(()=>{if(!b)return;const e=f==="lineChartWithConfidenceInterval"&&m?se(m):m;return U.transformDataForGraph(v?U.transformDataForAggregation(W.filterData(b,q||[]),v.keyColumn,v.aggregationColumnsSetting):W.filterData(b,q||[]),f,e)},[f,m,b,q,v]);return r?n.jsxRuntimeExports.jsx("div",{className:`${l?.theme||"light"} flex ${l?.width?"w-fit grow-0":"w-full grow"}${l?.height?"":" h-full"}`,dir:l?.language==="he"||l?.language==="ar"?"rtl":void 0,children:n.jsxRuntimeExports.jsx("div",{className:n.mo(`${l?.backgroundColor?l?.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${l?.language||"en"}`,l?.classNames?.graphContainer),style:{...l?.styles?.graphContainer||{},...l?.backgroundColor&&l?.backgroundColor!==!0?{backgroundColor:l?.backgroundColor}:{}},id:l?.graphID,ref:P,children:n.jsxRuntimeExports.jsx("div",{style:{padding:l?.backgroundColor?l?.padding||"1rem":l?.padding||0,flexGrow:1,display:"flex"},children:n.jsxRuntimeExports.jsx("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:b||oe.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(f)!==-1?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[x?.graphTitle||x?.graphDescription||l?.graphTitle||l?.graphDescription||l?.graphDownload||l?.dataDownload?n.jsxRuntimeExports.jsx(ie.GraphHeader,{styles:{title:x?.styles?.title||l?.styles?.title,description:x?.styles?.description||l?.styles?.description},classNames:{title:x?.classNames?.title||l?.classNames?.title,description:x?.classNames?.description||l?.classNames?.description},graphTitle:x?.graphTitle||l?.graphTitle,graphDescription:x?.graphDescription||l?.graphDescription,width:x?.width||l?.width,graphDownload:l?.graphDownload?P.current:void 0,dataDownload:l?.dataDownload&&b&&b.length>0?b:null}):null,E.length!==0||(j||[]).length!==0||(N||[]).length!==0||I?n.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:[N?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.options.map(a=>({...a,value:a.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{R(a?.graphSettings||{}),w(a?.dataConfiguration)}}):n.jsxRuntimeExports.jsx(h.fe,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:g,onValueChange:a=>{const t=e.options[e.options.findIndex(u=>u.label===a)];R(t.graphSettings||{}),w(t.dataConfiguration)},children:e.options.map((a,t)=>n.jsxRuntimeExports.jsx(h.ve,{label:a.label,value:a.label},t))})]},d)),j?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),h.checkIfMultiple(e.chartConfigId,m||[])?e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:i?i[i.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]):void 0,filterOption:C.Hu(k),onChange:a=>{const t={columnId:(a||[]).map(c=>c.value),chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);w(u)}}):n.jsxRuntimeExports.jsx(h.w,{variant:g,defaultValue:i?i[i.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]).map(a=>a.value):[],onValueChange:a=>{const t={columnId:a||[],chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);w(u)},children:e.allowedColumnIds.map((a,t)=>n.jsxRuntimeExports.jsx(h.G,{label:a.label,value:a.label},t))}):e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:i?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===i[i.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:a=>{const t={columnId:a?.value,chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);R(F(j,u)),w(u)}}):n.jsxRuntimeExports.jsx(h.fe,{variant:g,defaultValue:i?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===i[i.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const u={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(T=>T.label===a)].value,chartConfigId:e.chartConfigId},c=m?.map(T=>T.chartConfigId===u.chartConfigId?u:T);R(F(j,c)),w(c)},children:e.allowedColumnIds.map((a,t)=>n.jsxRuntimeExports.jsx(h.ve,{label:a.label,value:a.label},t))})]},d)),E?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label}),e.singleSelect?n.jsxRuntimeExports.jsx(C.Za,{options:e.availableValues,variant:g,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:a=>{M(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.availableValues,variant:g,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:a=>{M(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):n.jsxRuntimeExports.jsx(h.w,{variant:g,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{M(e.filter,e.availableValues.filter(t=>a.indexOf(`${t.value}`)!==-1))},children:e.availableValues.map((a,t)=>n.jsxRuntimeExports.jsx(h.G,{label:`${a.label}`,value:`${a.value}`},t))}),e.allowSelectAll?n.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{M(e.filter,e.availableValues)},children:"Select all options"}):null]})]},d)),I?n.jsxRuntimeExports.jsxs("div",{style:{width:I.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:I.label||"Highlight data"}),n.jsxRuntimeExports.jsx(C.Za,{options:Y,variant:g,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:e=>{X(e?.map(d=>d.value))},value:V?.map(e=>({label:e,value:e})),defaultValue:I.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,n.jsxRuntimeExports.jsx(re.GraphEl,{graph:f,graphData:ee,graphDataConfiguration:m,debugMode:D,readableHeader:J||[],updateFilters:B,settings:{...l||{},...x,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",theme:l?.theme,...V?{highlightedDataPoints:V,highlightedIds:V?.map(e=>`${e}`),highlightedLines:V?.map(e=>e)}:{}}})]}):n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:n.jsxRuntimeExports.jsx(ne.y,{})})})})})}):n.jsxRuntimeExports.jsx(le.u,{size:"xs",className:"text-center text-accent-dark-red dark:text-accent-red p-2",children:"Please make sure either `dataSettings` props are present as they are required for data."})}exports.SingleGraphDashboard=ue;
|
|
2
2
|
//# sourceMappingURL=SingleGraphDashboard.cjs.map
|
|
@@ -3,12 +3,12 @@ import { useState as b, useRef as q, useMemo as O, useCallback as Z, useEffect a
|
|
|
3
3
|
import { i as da } from "./index-C1rRk_50.js";
|
|
4
4
|
import { f as P } from "./index-UV9hjG_S.js";
|
|
5
5
|
import { i as ua } from "./index-27yTRcko.js";
|
|
6
|
-
import { Z as y, H as N } from "./DropdownSelect-
|
|
7
|
-
import { f as F, a as J, v as B, c as ca, w as K, G as Q } from "./checkIfMultiple-
|
|
6
|
+
import { Z as y, H as N } from "./DropdownSelect-CeHog_ih.js";
|
|
7
|
+
import { f as F, a as J, v as B, c as ca, w as K, G as Q } from "./checkIfMultiple-ChTJk2Tk.js";
|
|
8
8
|
import { u as ha } from "./Typography-Ctgfl1J5.js";
|
|
9
9
|
import { y as fa } from "./Spinner-C85UF28E.js";
|
|
10
|
-
import { G as ga } from "./GraphEl-
|
|
11
|
-
import { f as pa, a as ma, b as Ca, c as xa, t as Ia } from "./fetchAndParseData-
|
|
10
|
+
import { G as ga } from "./GraphEl-BdIyscdt.js";
|
|
11
|
+
import { f as pa, a as ma, b as Ca, c as xa, t as Ia } from "./fetchAndParseData-4gsYTy6_.js";
|
|
12
12
|
import { a as va, t as ba } from "./transformDataForAggregation-CdcwlnNe.js";
|
|
13
13
|
import { g as X } from "./getUniqValue-BtUENB2H.js";
|
|
14
14
|
import { GraphHeader as wa } from "./GraphHeader.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),s=require("./Spinner-DA6Z5E4n.cjs"),d=require("./SingleGraphDashboard.cjs"),g=require("./fetchAndParseData-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),s=require("./Spinner-DA6Z5E4n.cjs"),d=require("./SingleGraphDashboard.cjs"),g=require("./fetchAndParseData-CQyVGCul.cjs");function c(r){const{config:t}=r,[e,i]=n.useState(void 0);return n.useEffect(()=>{typeof t=="string"?g.fetchAndParseJSON(t).then(o=>{i(o)}):i(t)},[t]),e?a.jsxRuntimeExports.jsx(d.SingleGraphDashboard,{graphSettings:e.graphSettings,dataSettings:e.dataSettings,filters:e.filters,graphType:e.graphType,dataTransform:e.dataTransform,graphDataConfiguration:e.graphDataConfiguration,dataFilters:e.dataFilters,debugMode:e.debugMode,dataSelectionOptions:e.dataSelectionOptions,advancedDataSelectionOptions:e.advancedDataSelectionOptions,readableHeader:e.readableHeader,noOfFiltersPerRow:e.noOfFiltersPerRow,uiMode:e.uiMode,highlightDataPointSettings:e.highlightDataPointSettings}):a.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:a.jsxRuntimeExports.jsx(s.y,{})})}exports.SingleGraphDashboardFromConfig=c;
|
|
2
2
|
//# sourceMappingURL=SingleGraphDashboardFromConfig.cjs.map
|
|
@@ -2,7 +2,7 @@ import { j as a } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
|
2
2
|
import { useState as n, useEffect as s } from "react";
|
|
3
3
|
import { y as f } from "./Spinner-C85UF28E.js";
|
|
4
4
|
import { SingleGraphDashboard as g } from "./SingleGraphDashboard.js";
|
|
5
|
-
import { f as d } from "./fetchAndParseData-
|
|
5
|
+
import { f as d } from "./fetchAndParseData-4gsYTy6_.js";
|
|
6
6
|
function u(o) {
|
|
7
7
|
const { config: e } = o, [t, i] = n(void 0);
|
|
8
8
|
return s(() => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),a=require("./Spinner-DA6Z5E4n.cjs"),u=require("./SingleGraphDashboardGeoHubMaps.cjs"),g=require("./fetchAndParseData-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),a=require("./Spinner-DA6Z5E4n.cjs"),u=require("./SingleGraphDashboardGeoHubMaps.cjs"),g=require("./fetchAndParseData-CQyVGCul.cjs");function c(o){const{config:t}=o,[e,s]=n.useState(void 0);return n.useEffect(()=>{typeof t=="string"?g.fetchAndParseJSON(t).then(i=>{s(i)}):s(t)},[t]),e?r.jsxRuntimeExports.jsx(u.SingleGraphDashboardGeoHubMaps,{graphSettings:e.graphSettings,graphType:e.graphType,debugMode:e.debugMode,uiMode:e.uiMode}):r.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:r.jsxRuntimeExports.jsx(a.y,{})})}exports.SingleGraphDashboardGeoHubMapsFromConfig=c;
|
|
2
2
|
//# sourceMappingURL=SingleGraphDashboardGeoHubMapsFromConfig.cjs.map
|
|
@@ -2,7 +2,7 @@ import { j as o } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
|
2
2
|
import { useState as n, useEffect as a } from "react";
|
|
3
3
|
import { y as f } from "./Spinner-C85UF28E.js";
|
|
4
4
|
import { SingleGraphDashboardGeoHubMaps as p } from "./SingleGraphDashboardGeoHubMaps.js";
|
|
5
|
-
import { f as g } from "./fetchAndParseData-
|
|
5
|
+
import { f as g } from "./fetchAndParseData-4gsYTy6_.js";
|
|
6
6
|
function S(s) {
|
|
7
7
|
const { config: t } = s, [e, r] = n(void 0);
|
|
8
8
|
return a(() => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),i=require("react"),te=require("./index-Ds0uHjK9.cjs"),A=require("./index-B0rbzOoC.cjs"),le=require("./index-BXns0-ng.cjs"),x=require("./DropdownSelect-0I2QxaVy.cjs"),d=require("./checkIfMultiple-Do4kADNr.cjs"),M=require("./Typography-k-kOjICQ.cjs"),re=require("./Spinner-DA6Z5E4n.cjs"),ne=require("./ThreeDGlobe.cjs"),$=require("./fetchAndParseData-DmgQtB9n.cjs"),W=require("./transformDataForAggregation-Du-Hei-W.cjs"),B=require("./getUniqValue-CHqgSss5.cjs"),oe=require("./GraphHeader.cjs"),J=require("./filterData-DN6py7y_.cjs"),ie=require("./getGraphList-gf02xgT2.cjs"),K=require("./transformDataForSelect-YmStusCI.cjs");function se(I){const{settings:a,graph:n,graphData:p,debugMode:g,graphDataConfiguration:C,readableHeader:o,updateFilters:R}=I;if(g&&(console.log(`Graph: ${n}`),console.log("Transformed data:",p),console.log("Settings:",a)),typeof p=="string")return r.jsxRuntimeExports.jsx("div",{className:`flex my-0 mx-auto grow flex-col justify-center ${a?.width?"w-fit":"w-full"}`,style:{height:"inherit"},children:r.jsxRuntimeExports.jsx(M.u,{size:"sm",marginBottom:"none",className:"p-2 text-center text-accent-dark-red dark:text-accent-red",children:p})});const D={threeDGlobe:ne.ThreeDGlobe},b=c=>{switch(c){case"threeDGlobe":return{globeOffset:a?.globeOffset,polygonAltitude:a?.polygonAltitude,highlightedIds:a?.highlightedIds,scale:a?.scale,theme:a?.theme,resetSelectionOnDoubleClick:a?.resetSelectionOnDoubleClick,graphTitle:a?.graphTitle,mapData:a?.mapData,graphDescription:a?.graphDescription,footNote:a?.footNote,width:a?.width,height:a?.height,sources:a?.sources,colorDomain:a?.colorDomain,colors:a?.colors,colorLegendTitle:Object.keys(a||{}).indexOf("colorLegendTitle")!==-1?a?.colorLegendTitle:d.getValues("x",C||[],o||[]),scaleType:a?.scaleType,data:p,centerPoint:a?.centerPoint,backgroundColor:a?.backgroundColor,mapNoDataColor:a?.mapNoDataColor,mapBorderColor:a?.mapBorderColor,relativeHeight:a?.relativeHeight,padding:a?.padding,tooltip:a?.tooltip,showColorScale:a?.showColorScale,graphID:a?.graphID,dataDownload:a?.dataDownload,mapProperty:a?.mapProperty,language:a?.language,minHeight:a?.minHeight,ariaLabel:a?.ariaLabel,onSeriesMouseClick:H=>{R?.(H.id)},detailsOnClick:a?.detailsOnClick,styles:a?.styles,classNames:a?.classNames,categorical:a?.categorical,autoRotate:a?.autoRotate,globeMaterial:a?.globeMaterial,atmosphereColor:a?.atmosphereColor,enableZoom:a?.enableZoom};default:return{}}},E=D[n],q=b(n);return r.jsxRuntimeExports.jsx("div",{className:`grow my-0 mx-auto flex flex-col h-inherit ${a?.width?"w-fit":"w-full"} justify-center ${a?.theme||"light"}`,style:{minHeight:"inherit"},children:E?r.jsxRuntimeExports.jsx(E,{...q}):r.jsxRuntimeExports.jsx(M.u,{size:"sm",marginBottom:"none",className:"p-2 text-center text-accent-dark-red dark:text-accent-red",children:`Invalid chart type: ${n}`})})}const F=(I,a)=>{const n=a?.map(p=>{const g=I?.findIndex(o=>o.chartConfigId===p.chartConfigId);if(g===-1)return{};const C=I[g]?.allowedColumnIds?.findIndex(o=>o.value===p.columnId);return C===-1?{}:I[g].allowedColumnIds[C].graphSettings||{}})||[];return Object.assign({},...n)};function ue(I){const{graphSettings:a,dataSettings:n,filters:p,graphType:g,dataTransform:C,graphDataConfiguration:o,dataFilters:R,debugMode:D,dataSelectionOptions:b,advancedDataSelectionOptions:E,readableHeader:q,noOfFiltersPerRow:c=4,updateFilters:H,uiMode:f="normal",highlightDataPointSettings:v}=I,[j,Q]=i.useState(void 0),[S,X]=i.useState(void 0),[w,y]=i.useState(o),[m,V]=i.useState({}),[k,Y]=i.useState(void 0),[_,ee]=i.useState([]),L=i.useRef(null),z=i.useRef(o),[T,U]=i.useState([]),N=i.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),Z=i.useCallback(async()=>{try{const u=await(n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?$.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,D):n.fileType==="api"?$.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,D):$.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,D,n.delimiter,!0):$.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):$.transformColumnsToArray(n.data,n.columnsToArray));X(u);const t=(p||[]).map(l=>({filter:l.column,label:l.label||`Filter by ${l.column}`,singleSelect:l.singleSelect,clearable:l.clearable,defaultValue:K.transformDefaultValue(l.defaultValue),value:K.transformDefaultValue(l.defaultValue),availableValues:B.getUniqValue(u,l.column).filter(s=>!l.excludeValues?.includes(`${s}`)).map(s=>({value:s,label:s})),allowSelectAll:l.allowSelectAll,width:l.width}));U(t)}catch(e){console.error("Data fetching error:",e)}},[n,p,D]);i.useEffect(()=>{Z()},[Z]);const G=i.useMemo(()=>!S||T.length===0?S:S.filter(u=>T.every(t=>t.value&&A.flattenDeep([t.value]).length>0?te.intersection(A.flattenDeep([u[t.filter]]),A.flattenDeep([t.value]).map(l=>l.value)).length>0:!0)),[T,S]);i.useEffect(()=>{b&&V(F(b,o))},[b,o]),i.useEffect(()=>{S&&Q(G)},[G,S]),i.useEffect(()=>{v?.column&&G&&ee(B.getUniqValue(G,v.column).filter(e=>!v?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))},[G,v]),i.useEffect(()=>{le.isEqual(z.current,o)||(y(o),z.current=o)},[o]);const O=i.useCallback((e,u)=>{U(t=>t.map(l=>l.filter===e?{...l,value:u}:l))},[]),ae=i.useMemo(()=>{if(!j)return;const e=w;return W.transformDataForGraph(C?W.transformDataForAggregation(J.filterData(j,R||[]),C.keyColumn,C.aggregationColumnsSetting):J.filterData(j,R||[]),g,e)},[g,w,j,R,C]);return n?r.jsxRuntimeExports.jsx("div",{className:`${a?.theme||"light"} flex ${a?.width?"w-fit grow-0":"w-full grow"}${a?.height?"":" h-full"}`,dir:a?.language==="he"||a?.language==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:r.mo(`${a?.backgroundColor?a?.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${a?.language||"en"}`,a?.classNames?.graphContainer),style:{...a?.styles?.graphContainer||{},...a?.backgroundColor&&a?.backgroundColor!==!0?{backgroundColor:a?.backgroundColor}:{}},id:a?.graphID,ref:L,children:r.jsxRuntimeExports.jsx("div",{style:{padding:a?.backgroundColor?a?.padding||"1rem":a?.padding||0,flexGrow:1,display:"flex"},children:r.jsxRuntimeExports.jsx("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:j||ie.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(g)!==-1?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[m?.graphTitle||m?.graphDescription||a?.graphTitle||a?.graphDescription||a?.graphDownload||a?.dataDownload?r.jsxRuntimeExports.jsx(oe.GraphHeader,{styles:{title:m?.styles?.title||a?.styles?.title,description:m?.styles?.description||a?.styles?.description},classNames:{title:m?.classNames?.title||a?.classNames?.title,description:m?.classNames?.description||a?.classNames?.description},graphTitle:m?.graphTitle||a?.graphTitle,graphDescription:m?.graphDescription||a?.graphDescription,width:m?.width||a?.width,graphDownload:a?.graphDownload?L.current:void 0,dataDownload:a?.dataDownload&&j&&j.length>0?j:null}):null,T.length!==0||(b||[]).length!==0||(E||[]).length!==0||v?r.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:[E?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/c}% - ${(c-1)/c}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(d.f,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?r.jsxRuntimeExports.jsx(x.Za,{options:e.options.map(t=>({...t,value:t.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:t=>{V(t?.graphSettings||{}),y(t?.dataConfiguration)}}):r.jsxRuntimeExports.jsx(d.fe,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:f,onValueChange:t=>{const l=e.options[e.options.findIndex(s=>s.label===t)];V(l.graphSettings||{}),y(l.dataConfiguration)},children:e.options.map((t,l)=>r.jsxRuntimeExports.jsx(d.ve,{label:t.label,value:t.label},l))})]},u)),b?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/c}% - ${(c-1)/c}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(d.f,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),d.checkIfMultiple(e.chartConfigId,w||[])?e.ui!=="radio"?r.jsxRuntimeExports.jsx(x.Za,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:o?o[o.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId.map(t=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===t)]):void 0,filterOption:x.Hu(N),onChange:t=>{const l={columnId:(t||[]).map(h=>h.value),chartConfigId:e.chartConfigId},s=w?.map(h=>h.chartConfigId===l.chartConfigId?l:h);y(s)}}):r.jsxRuntimeExports.jsx(d.w,{variant:f,defaultValue:o?o[o.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId.map(t=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===t)]).map(t=>t.value):[],onValueChange:t=>{const l={columnId:t||[],chartConfigId:e.chartConfigId},s=w?.map(h=>h.chartConfigId===l.chartConfigId?l:h);y(s)},children:e.allowedColumnIds.map((t,l)=>r.jsxRuntimeExports.jsx(d.G,{label:t.label,value:t.label},l))}):e.ui!=="radio"?r.jsxRuntimeExports.jsx(x.Za,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:o?e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===o[o.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:t=>{const l={columnId:t?.value,chartConfigId:e.chartConfigId},s=w?.map(h=>h.chartConfigId===l.chartConfigId?l:h);V(F(b,s)),y(s)}}):r.jsxRuntimeExports.jsx(d.fe,{variant:f,defaultValue:o?e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===o[o.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:t=>{const s={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(P=>P.label===t)].value,chartConfigId:e.chartConfigId},h=w?.map(P=>P.chartConfigId===s.chartConfigId?s:P);V(F(b,h)),y(h)},children:e.allowedColumnIds.map((t,l)=>r.jsxRuntimeExports.jsx(d.ve,{label:t.label,value:t.label},l))})]},u)),T?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/c}% - ${(c-1)/c}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(d.f,{className:"mb-2",children:e.label}),e.singleSelect?r.jsxRuntimeExports.jsx(x.Za,{options:e.availableValues,variant:f,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:x.Hu(N),onChange:t=>{O(e.filter,t)},value:e.value,defaultValue:e.defaultValue}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?r.jsxRuntimeExports.jsx(x.Za,{options:e.availableValues,variant:f,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:x.Hu(N),onChange:t=>{O(e.filter,t)},value:e.value,defaultValue:e.defaultValue}):r.jsxRuntimeExports.jsx(d.w,{variant:f,defaultValue:e.defaultValue?e.defaultValue.map(t=>`${t.value}`):[],value:e.value?e.value.map(t=>`${t.value}`):void 0,onValueChange:t=>{O(e.filter,e.availableValues.filter(l=>t.indexOf(`${l.value}`)!==-1))},children:e.availableValues.map((t,l)=>r.jsxRuntimeExports.jsx(d.G,{label:`${t.label}`,value:`${t.value}`},l))}),e.allowSelectAll?r.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{O(e.filter,e.availableValues)},children:"Select all options"}):null]})]},u)),v?r.jsxRuntimeExports.jsxs("div",{style:{width:v.width||`calc(${100/c}% - ${(c-1)/c}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(d.f,{className:"mb-2",children:v.label||"Highlight data"}),r.jsxRuntimeExports.jsx(x.Za,{options:_,variant:f,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:x.Hu(N),onChange:e=>{Y(e?.map(u=>u.value))},value:k?.map(e=>({label:e,value:e})),defaultValue:v.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,r.jsxRuntimeExports.jsx(se,{graph:g,graphData:ae,graphDataConfiguration:w,debugMode:D,readableHeader:q||[],updateFilters:H,settings:{...a||{},...m,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",theme:a?.theme,...k?{highlightedDataPoints:k,highlightedIds:k?.map(e=>`${e}`),highlightedLines:k?.map(e=>e)}:{}}})]}):r.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:r.jsxRuntimeExports.jsx(re.y,{})})})})})}):r.jsxRuntimeExports.jsx(M.u,{size:"xs",className:"text-center text-accent-dark-red dark:text-accent-red p-2",children:"Please make sure either `dataSettings` props are present as they are required for data."})}exports.SingleGraphDashboardThreeDGraphs=ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),i=require("react"),te=require("./index-Ds0uHjK9.cjs"),A=require("./index-B0rbzOoC.cjs"),le=require("./index-BXns0-ng.cjs"),x=require("./DropdownSelect-BmE5JaeE.cjs"),d=require("./checkIfMultiple-BXbHUCWM.cjs"),M=require("./Typography-k-kOjICQ.cjs"),re=require("./Spinner-DA6Z5E4n.cjs"),ne=require("./ThreeDGlobe.cjs"),$=require("./fetchAndParseData-CQyVGCul.cjs"),W=require("./transformDataForAggregation-Du-Hei-W.cjs"),B=require("./getUniqValue-CHqgSss5.cjs"),oe=require("./GraphHeader.cjs"),J=require("./filterData-DN6py7y_.cjs"),ie=require("./getGraphList-gf02xgT2.cjs"),K=require("./transformDataForSelect-YmStusCI.cjs");function se(I){const{settings:a,graph:n,graphData:p,debugMode:g,graphDataConfiguration:C,readableHeader:o,updateFilters:R}=I;if(g&&(console.log(`Graph: ${n}`),console.log("Transformed data:",p),console.log("Settings:",a)),typeof p=="string")return r.jsxRuntimeExports.jsx("div",{className:`flex my-0 mx-auto grow flex-col justify-center ${a?.width?"w-fit":"w-full"}`,style:{height:"inherit"},children:r.jsxRuntimeExports.jsx(M.u,{size:"sm",marginBottom:"none",className:"p-2 text-center text-accent-dark-red dark:text-accent-red",children:p})});const D={threeDGlobe:ne.ThreeDGlobe},b=c=>{switch(c){case"threeDGlobe":return{globeOffset:a?.globeOffset,polygonAltitude:a?.polygonAltitude,highlightedIds:a?.highlightedIds,scale:a?.scale,theme:a?.theme,resetSelectionOnDoubleClick:a?.resetSelectionOnDoubleClick,graphTitle:a?.graphTitle,mapData:a?.mapData,graphDescription:a?.graphDescription,footNote:a?.footNote,width:a?.width,height:a?.height,sources:a?.sources,colorDomain:a?.colorDomain,colors:a?.colors,colorLegendTitle:Object.keys(a||{}).indexOf("colorLegendTitle")!==-1?a?.colorLegendTitle:d.getValues("x",C||[],o||[]),scaleType:a?.scaleType,data:p,centerPoint:a?.centerPoint,backgroundColor:a?.backgroundColor,mapNoDataColor:a?.mapNoDataColor,mapBorderColor:a?.mapBorderColor,relativeHeight:a?.relativeHeight,padding:a?.padding,tooltip:a?.tooltip,showColorScale:a?.showColorScale,graphID:a?.graphID,dataDownload:a?.dataDownload,mapProperty:a?.mapProperty,language:a?.language,minHeight:a?.minHeight,ariaLabel:a?.ariaLabel,onSeriesMouseClick:H=>{R?.(H.id)},detailsOnClick:a?.detailsOnClick,styles:a?.styles,classNames:a?.classNames,categorical:a?.categorical,autoRotate:a?.autoRotate,globeMaterial:a?.globeMaterial,atmosphereColor:a?.atmosphereColor,enableZoom:a?.enableZoom};default:return{}}},E=D[n],q=b(n);return r.jsxRuntimeExports.jsx("div",{className:`grow my-0 mx-auto flex flex-col h-inherit ${a?.width?"w-fit":"w-full"} justify-center ${a?.theme||"light"}`,style:{minHeight:"inherit"},children:E?r.jsxRuntimeExports.jsx(E,{...q}):r.jsxRuntimeExports.jsx(M.u,{size:"sm",marginBottom:"none",className:"p-2 text-center text-accent-dark-red dark:text-accent-red",children:`Invalid chart type: ${n}`})})}const F=(I,a)=>{const n=a?.map(p=>{const g=I?.findIndex(o=>o.chartConfigId===p.chartConfigId);if(g===-1)return{};const C=I[g]?.allowedColumnIds?.findIndex(o=>o.value===p.columnId);return C===-1?{}:I[g].allowedColumnIds[C].graphSettings||{}})||[];return Object.assign({},...n)};function ue(I){const{graphSettings:a,dataSettings:n,filters:p,graphType:g,dataTransform:C,graphDataConfiguration:o,dataFilters:R,debugMode:D,dataSelectionOptions:b,advancedDataSelectionOptions:E,readableHeader:q,noOfFiltersPerRow:c=4,updateFilters:H,uiMode:f="normal",highlightDataPointSettings:v}=I,[j,Q]=i.useState(void 0),[S,X]=i.useState(void 0),[w,y]=i.useState(o),[m,V]=i.useState({}),[k,Y]=i.useState(void 0),[_,ee]=i.useState([]),L=i.useRef(null),z=i.useRef(o),[T,U]=i.useState([]),N=i.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),Z=i.useCallback(async()=>{try{const u=await(n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?$.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,D):n.fileType==="api"?$.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,D):$.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,D,n.delimiter,!0):$.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):$.transformColumnsToArray(n.data,n.columnsToArray));X(u);const t=(p||[]).map(l=>({filter:l.column,label:l.label||`Filter by ${l.column}`,singleSelect:l.singleSelect,clearable:l.clearable,defaultValue:K.transformDefaultValue(l.defaultValue),value:K.transformDefaultValue(l.defaultValue),availableValues:B.getUniqValue(u,l.column).filter(s=>!l.excludeValues?.includes(`${s}`)).map(s=>({value:s,label:s})),allowSelectAll:l.allowSelectAll,width:l.width}));U(t)}catch(e){console.error("Data fetching error:",e)}},[n,p,D]);i.useEffect(()=>{Z()},[Z]);const G=i.useMemo(()=>!S||T.length===0?S:S.filter(u=>T.every(t=>t.value&&A.flattenDeep([t.value]).length>0?te.intersection(A.flattenDeep([u[t.filter]]),A.flattenDeep([t.value]).map(l=>l.value)).length>0:!0)),[T,S]);i.useEffect(()=>{b&&V(F(b,o))},[b,o]),i.useEffect(()=>{S&&Q(G)},[G,S]),i.useEffect(()=>{v?.column&&G&&ee(B.getUniqValue(G,v.column).filter(e=>!v?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))},[G,v]),i.useEffect(()=>{le.isEqual(z.current,o)||(y(o),z.current=o)},[o]);const O=i.useCallback((e,u)=>{U(t=>t.map(l=>l.filter===e?{...l,value:u}:l))},[]),ae=i.useMemo(()=>{if(!j)return;const e=w;return W.transformDataForGraph(C?W.transformDataForAggregation(J.filterData(j,R||[]),C.keyColumn,C.aggregationColumnsSetting):J.filterData(j,R||[]),g,e)},[g,w,j,R,C]);return n?r.jsxRuntimeExports.jsx("div",{className:`${a?.theme||"light"} flex ${a?.width?"w-fit grow-0":"w-full grow"}${a?.height?"":" h-full"}`,dir:a?.language==="he"||a?.language==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:r.mo(`${a?.backgroundColor?a?.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${a?.language||"en"}`,a?.classNames?.graphContainer),style:{...a?.styles?.graphContainer||{},...a?.backgroundColor&&a?.backgroundColor!==!0?{backgroundColor:a?.backgroundColor}:{}},id:a?.graphID,ref:L,children:r.jsxRuntimeExports.jsx("div",{style:{padding:a?.backgroundColor?a?.padding||"1rem":a?.padding||0,flexGrow:1,display:"flex"},children:r.jsxRuntimeExports.jsx("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:j||ie.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(g)!==-1?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[m?.graphTitle||m?.graphDescription||a?.graphTitle||a?.graphDescription||a?.graphDownload||a?.dataDownload?r.jsxRuntimeExports.jsx(oe.GraphHeader,{styles:{title:m?.styles?.title||a?.styles?.title,description:m?.styles?.description||a?.styles?.description},classNames:{title:m?.classNames?.title||a?.classNames?.title,description:m?.classNames?.description||a?.classNames?.description},graphTitle:m?.graphTitle||a?.graphTitle,graphDescription:m?.graphDescription||a?.graphDescription,width:m?.width||a?.width,graphDownload:a?.graphDownload?L.current:void 0,dataDownload:a?.dataDownload&&j&&j.length>0?j:null}):null,T.length!==0||(b||[]).length!==0||(E||[]).length!==0||v?r.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:[E?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/c}% - ${(c-1)/c}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(d.f,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?r.jsxRuntimeExports.jsx(x.Za,{options:e.options.map(t=>({...t,value:t.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:t=>{V(t?.graphSettings||{}),y(t?.dataConfiguration)}}):r.jsxRuntimeExports.jsx(d.fe,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:f,onValueChange:t=>{const l=e.options[e.options.findIndex(s=>s.label===t)];V(l.graphSettings||{}),y(l.dataConfiguration)},children:e.options.map((t,l)=>r.jsxRuntimeExports.jsx(d.ve,{label:t.label,value:t.label},l))})]},u)),b?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/c}% - ${(c-1)/c}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(d.f,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),d.checkIfMultiple(e.chartConfigId,w||[])?e.ui!=="radio"?r.jsxRuntimeExports.jsx(x.Za,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:o?o[o.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId.map(t=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===t)]):void 0,filterOption:x.Hu(N),onChange:t=>{const l={columnId:(t||[]).map(h=>h.value),chartConfigId:e.chartConfigId},s=w?.map(h=>h.chartConfigId===l.chartConfigId?l:h);y(s)}}):r.jsxRuntimeExports.jsx(d.w,{variant:f,defaultValue:o?o[o.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId.map(t=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===t)]).map(t=>t.value):[],onValueChange:t=>{const l={columnId:t||[],chartConfigId:e.chartConfigId},s=w?.map(h=>h.chartConfigId===l.chartConfigId?l:h);y(s)},children:e.allowedColumnIds.map((t,l)=>r.jsxRuntimeExports.jsx(d.G,{label:t.label,value:t.label},l))}):e.ui!=="radio"?r.jsxRuntimeExports.jsx(x.Za,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:o?e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===o[o.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:t=>{const l={columnId:t?.value,chartConfigId:e.chartConfigId},s=w?.map(h=>h.chartConfigId===l.chartConfigId?l:h);V(F(b,s)),y(s)}}):r.jsxRuntimeExports.jsx(d.fe,{variant:f,defaultValue:o?e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===o[o.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:t=>{const s={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(P=>P.label===t)].value,chartConfigId:e.chartConfigId},h=w?.map(P=>P.chartConfigId===s.chartConfigId?s:P);V(F(b,h)),y(h)},children:e.allowedColumnIds.map((t,l)=>r.jsxRuntimeExports.jsx(d.ve,{label:t.label,value:t.label},l))})]},u)),T?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/c}% - ${(c-1)/c}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(d.f,{className:"mb-2",children:e.label}),e.singleSelect?r.jsxRuntimeExports.jsx(x.Za,{options:e.availableValues,variant:f,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:x.Hu(N),onChange:t=>{O(e.filter,t)},value:e.value,defaultValue:e.defaultValue}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?r.jsxRuntimeExports.jsx(x.Za,{options:e.availableValues,variant:f,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:x.Hu(N),onChange:t=>{O(e.filter,t)},value:e.value,defaultValue:e.defaultValue}):r.jsxRuntimeExports.jsx(d.w,{variant:f,defaultValue:e.defaultValue?e.defaultValue.map(t=>`${t.value}`):[],value:e.value?e.value.map(t=>`${t.value}`):void 0,onValueChange:t=>{O(e.filter,e.availableValues.filter(l=>t.indexOf(`${l.value}`)!==-1))},children:e.availableValues.map((t,l)=>r.jsxRuntimeExports.jsx(d.G,{label:`${t.label}`,value:`${t.value}`},l))}),e.allowSelectAll?r.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{O(e.filter,e.availableValues)},children:"Select all options"}):null]})]},u)),v?r.jsxRuntimeExports.jsxs("div",{style:{width:v.width||`calc(${100/c}% - ${(c-1)/c}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(d.f,{className:"mb-2",children:v.label||"Highlight data"}),r.jsxRuntimeExports.jsx(x.Za,{options:_,variant:f,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:x.Hu(N),onChange:e=>{Y(e?.map(u=>u.value))},value:k?.map(e=>({label:e,value:e})),defaultValue:v.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,r.jsxRuntimeExports.jsx(se,{graph:g,graphData:ae,graphDataConfiguration:w,debugMode:D,readableHeader:q||[],updateFilters:H,settings:{...a||{},...m,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",theme:a?.theme,...k?{highlightedDataPoints:k,highlightedIds:k?.map(e=>`${e}`),highlightedLines:k?.map(e=>e)}:{}}})]}):r.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:r.jsxRuntimeExports.jsx(re.y,{})})})})})}):r.jsxRuntimeExports.jsx(M.u,{size:"xs",className:"text-center text-accent-dark-red dark:text-accent-red p-2",children:"Please make sure either `dataSettings` props are present as they are required for data."})}exports.SingleGraphDashboardThreeDGraphs=ue;
|
|
2
2
|
//# sourceMappingURL=SingleGraphDashboardThreeDGraphs.cjs.map
|
|
@@ -3,12 +3,12 @@ import { useState as D, useRef as J, useMemo as M, useCallback as K, useEffect a
|
|
|
3
3
|
import { i as ue } from "./index-C1rRk_50.js";
|
|
4
4
|
import { f as z } from "./index-UV9hjG_S.js";
|
|
5
5
|
import { i as ce } from "./index-27yTRcko.js";
|
|
6
|
-
import { Z as j, H as R } from "./DropdownSelect-
|
|
7
|
-
import { g as he, f as F, a as Q, v as X, c as ge, w as Y, G as _ } from "./checkIfMultiple-
|
|
6
|
+
import { Z as j, H as R } from "./DropdownSelect-CeHog_ih.js";
|
|
7
|
+
import { g as he, f as F, a as Q, v as X, c as ge, w as Y, G as _ } from "./checkIfMultiple-ChTJk2Tk.js";
|
|
8
8
|
import { u as W } from "./Typography-Ctgfl1J5.js";
|
|
9
9
|
import { y as pe } from "./Spinner-C85UF28E.js";
|
|
10
10
|
import { ThreeDGlobe as fe } from "./ThreeDGlobe.js";
|
|
11
|
-
import { f as me, a as Ce, b as xe, c as be, t as ve } from "./fetchAndParseData-
|
|
11
|
+
import { f as me, a as Ce, b as xe, c as be, t as ve } from "./fetchAndParseData-4gsYTy6_.js";
|
|
12
12
|
import { a as we, t as Ie } from "./transformDataForAggregation-CdcwlnNe.js";
|
|
13
13
|
import { g as ee } from "./getUniqValue-BtUENB2H.js";
|
|
14
14
|
import { GraphHeader as De } from "./GraphHeader.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-DDoeWRVt.cjs"),i=require("react"),o=require("./Spinner-DA6Z5E4n.cjs"),d=require("./SingleGraphDashboardThreeDGraphs.cjs"),g=require("./fetchAndParseData-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-DDoeWRVt.cjs"),i=require("react"),o=require("./Spinner-DA6Z5E4n.cjs"),d=require("./SingleGraphDashboardThreeDGraphs.cjs"),g=require("./fetchAndParseData-CQyVGCul.cjs");function h(n){const{config:t}=n,[e,r]=i.useState(void 0);return i.useEffect(()=>{typeof t=="string"?g.fetchAndParseJSON(t).then(s=>{r(s)}):r(t)},[t]),e?a.jsxRuntimeExports.jsx(d.SingleGraphDashboardThreeDGraphs,{graphSettings:e.graphSettings,dataSettings:e.dataSettings,filters:e.filters,graphType:e.graphType,dataTransform:e.dataTransform,graphDataConfiguration:e.graphDataConfiguration,dataFilters:e.dataFilters,debugMode:e.debugMode,dataSelectionOptions:e.dataSelectionOptions,advancedDataSelectionOptions:e.advancedDataSelectionOptions,readableHeader:e.readableHeader,noOfFiltersPerRow:e.noOfFiltersPerRow,uiMode:e.uiMode,highlightDataPointSettings:e.highlightDataPointSettings}):a.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:a.jsxRuntimeExports.jsx(o.y,{})})}exports.SingleGraphDashboardThreeDGraphsFromConfig=h;
|
|
2
2
|
//# sourceMappingURL=SingleGraphDashboardThreeDGraphsFromConfig.cjs.map
|
|
@@ -2,7 +2,7 @@ import { j as a } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
|
2
2
|
import { useState as n, useEffect as s } from "react";
|
|
3
3
|
import { y as f } from "./Spinner-C85UF28E.js";
|
|
4
4
|
import { SingleGraphDashboardThreeDGraphs as g } from "./SingleGraphDashboardThreeDGraphs.js";
|
|
5
|
-
import { f as d } from "./fetchAndParseData-
|
|
5
|
+
import { f as d } from "./fetchAndParseData-4gsYTy6_.js";
|
|
6
6
|
function u(r) {
|
|
7
7
|
const { config: e } = r, [t, i] = n(void 0);
|
|
8
8
|
return s(() => {
|
package/dist/SlopeChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),oi=require("./index-CZbIGs8q.cjs"),f=require("react"),si=require("./index-BXns0-ng.cjs"),ci=require("./Modal-C_dl0EtQ.cjs"),xi=require("./Tooltip-n8z5bfav.cjs"),_=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),a=require("./Colors.cjs"),ui=require("./string2HTML-D2Avudmb.cjs"),ri=require("./Axis-DE7dSn1_.cjs"),li=require("./AxisTitle-CK9YeovX.cjs"),mi=require("./use-in-view-BCmzDU2O.cjs"),yi=require("./linear-BVckp9RD.cjs"),b=require("./proxy-PQd2AItT.cjs"),hi=require("./index-DVOJ7vxH.cjs"),gi=require("./GraphFooter.cjs"),fi=require("./GraphHeader.cjs"),pi=require("./ColorLegendWithMouseOver.cjs"),di=require("./EmptyState-d8_8SxeW.cjs");function ji(J){const{data:r,width:O,height:E,showLabels:V,colors:o,colorDomain:n,radius:c,leftMargin:m,rightMargin:P,topMargin:W,bottomMargin:K,tooltip:G,onSeriesMouseOver:Y,axisTitles:q,highlightedDataPoints:u,selectedColor:A,minValue:U,maxValue:X,onSeriesMouseClick:D,resetSelectionOnDoubleClick:Q,detailsOnClick:g,styles:p,classNames:y,animate:s,dimmedOpacity:d,customLayers:F}=J,B=f.useRef(null),j=mi.useInView(B,{once:s.once,amount:s.amount}),[w,I]=f.useState(void 0),[k,M]=f.useState(void 0),[z,R]=f.useState(void 0),[S,T]=f.useState(void 0),$={top:W,bottom:K,left:m,right:P},v=O-$.left-$.right,h=E-$.top-$.bottom,C=Math.min(Math.min(...r.map(i=>i.y1)),Math.min(...r.map(i=>i.y2))),H=Math.max(Math.max(...r.map(i=>i.y1)),Math.max(...r.map(i=>i.y2))),x=yi.linear().domain([_.checkIfNullOrUndefined(U)?C>0?0:C:U,_.checkIfNullOrUndefined(X)?H>0?H:0:X]).range([h,0]).nice();return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(b.motion.svg,{width:`${O}px`,height:`${E}px`,viewBox:`0 0 ${O} ${E}`,className:"mx-auto",direction:"ltr",ref:B,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${$.left},${$.top})`,children:[e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(ri.Axis,{y1:0,y2:h,x1:c,x2:c,classNames:{axis:e.mo("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",y?.yAxis?.axis)}}),e.jsxRuntimeExports.jsx(li.AxisTitle,{x:c,y:h+15,style:p?.yAxis?.title,className:e.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",y?.yAxis?.title),text:q[0]})]}),e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(ri.Axis,{y1:0,y2:h,x1:v-c,x2:v-c,classNames:{axis:e.mo("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",y?.yAxis?.axis)}}),e.jsxRuntimeExports.jsx(li.AxisTitle,{x:v-c,y:h+15,style:p?.yAxis?.title,className:e.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",y?.yAxis?.title),text:q[1]})]}),F.filter(i=>i.position==="before").map(i=>i.layer),e.jsxRuntimeExports.jsx(hi.AnimatePresence,{children:r.map((i,N)=>e.jsxRuntimeExports.jsxs(b.motion.g,{variants:{initial:{opacity:A?i.color&&o[n.indexOf(`${i.color}`)]===A?1:d:w?w.label===i.label?1:d:u.length!==0?u.indexOf(i.label)!==-1?1:d:1},whileInView:{opacity:A?i.color&&o[n.indexOf(`${i.color}`)]===A?1:d:w?w.label===i.label?1:d:u.length!==0?u.indexOf(i.label)!==-1?1:d:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},onMouseEnter:t=>{I(i),T(t.clientY),R(t.clientX),Y?.(i)},onMouseMove:t=>{I(i),T(t.clientY),R(t.clientX)},onMouseLeave:()=>{I(void 0),R(void 0),T(void 0),Y?.(void 0)},onClick:()=>{(D||g)&&(si.isEqual(k,i)&&Q?(M(void 0),D?.(void 0)):(M(i),D?.(i)))},children:[e.jsxRuntimeExports.jsx(b.motion.circle,{cx:c,variants:{initial:{cy:x(i.y1),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,stroke:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:0},whileInView:{cy:x(i.y1),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,stroke:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},r:c,style:{fillOpacity:.6}}),V?e.jsxRuntimeExports.jsx(b.motion.text,{variants:{initial:{y:x(i.y1),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:0},whileInView:{y:x(i.y1),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},style:{textAnchor:"end",...p?.yAxis?.labels||{}},className:e.mo("text-xs",y?.yAxis?.labels),x:5,dy:"0.33em",textAnchor:"end",dx:0-c-3,children:i.label}):u.length!==0&&u.indexOf(i.label)!==-1?e.jsxRuntimeExports.jsx(b.motion.text,{variants:{initial:{y:x(i.y1),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:0},whileInView:{y:x(i.y1),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},style:{textAnchor:"end",...p?.yAxis?.labels||{}},className:e.mo("text-xs",y?.yAxis?.labels),x:5,dy:"0.33em",dx:-3,children:i.label}):null,e.jsxRuntimeExports.jsx(b.motion.circle,{cx:v-c,variants:{initial:{cy:x(i.y2),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,stroke:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:0},whileInView:{cy:x(i.y2),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,stroke:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},r:c,style:{fillOpacity:.6}}),V?e.jsxRuntimeExports.jsx(b.motion.text,{variants:{initial:{y:x(i.y2),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:0},whileInView:{y:x(i.y2),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},style:{textAnchor:"start",...p?.yAxis?.labels||{}},className:e.mo("text-xs",y?.yAxis?.labels),x:v-5,dy:"0.33em",dx:c+3,children:i.label}):u.length!==0&&u.indexOf(i.label)!==-1?e.jsxRuntimeExports.jsx(b.motion.text,{variants:{initial:{y:x(i.y2),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:0},whileInView:{y:x(i.y2),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},style:{textAnchor:"start",...p?.yAxis?.labels||{}},className:e.mo("text-xs",y?.yAxis?.labels),x:v-5,dy:"0.33em",dx:3,children:i.label}):null,e.jsxRuntimeExports.jsx(b.motion.line,{x1:c,x2:v-c,variants:{initial:{y1:x(i.y1),y2:x(i.y1),stroke:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray},whileInView:{y1:x(i.y1),y2:x(i.y2),stroke:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},className:y?.dataConnectors,style:{fill:"none",strokeWidth:1,...p?.dataConnectors}})]},N))}),F.filter(i=>i.position==="after").map(i=>i.layer)]})}),w&&G&&z&&S?e.jsxRuntimeExports.jsx(xi.Tooltip,{data:w,body:G,xPos:z,yPos:S,backgroundStyle:p?.tooltip,className:y?.tooltip}):null,g&&k!==void 0?e.jsxRuntimeExports.jsx(ci.X,{open:k!==void 0,onClose:()=>{M(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof g=="string"?{__html:ui.string2HTML(g,k)}:void 0,children:typeof g=="function"?g(k):null})}):null]})}function wi(J){const{data:r,graphTitle:O,colors:E,sources:V,graphDescription:o,showLabels:n=!1,height:c,width:m,footNote:P,colorDomain:W,colorLegendTitle:K,radius:G=5,axisTitles:Y=["",""],padding:q,backgroundColor:u=!1,leftMargin:A=50,rightMargin:U=50,topMargin:X=20,bottomMargin:D=20,tooltip:Q,relativeHeight:g,onSeriesMouseOver:p,showColorScale:y=!0,highlightedDataPoints:s=[],graphID:d,minValue:F,maxValue:B,onSeriesMouseClick:j,graphDownload:w=!1,dataDownload:I=!1,fillContainer:k=!0,language:M="en",showNAColor:z=!0,minHeight:R=0,theme:S="light",ariaLabel:T,resetSelectionOnDoubleClick:$=!0,detailsOnClick:v,styles:h,classNames:C,animate:H=!1,dimmedOpacity:x=.3,customLayers:i=[]}=J,[N,t]=f.useState(0),[Z,ii]=f.useState(0),[ni,ai]=f.useState(void 0),L=f.useRef(null),ti=f.useRef(null);return f.useEffect(()=>{const l=new ResizeObserver(ei=>{t(m||ei[0].target.clientWidth||620),ii(c||ei[0].target.clientHeight||480)});return L.current&&(ii(L.current.clientHeight||480),t(L.current.clientWidth||620),m||l.observe(L.current)),()=>l.disconnect()},[m,c]),e.jsxRuntimeExports.jsx("div",{className:`${S||"light"} flex ${m?"grow-0":"grow"} ${k?"w-full":"w-fit"} `,dir:M==="he"||M==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${u?u===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,C?.graphContainer),style:{...h?.graphContainer||{},...u&&u!==!0?{backgroundColor:u}:{}},id:d,ref:ti,"aria-label":T||`${O?`The graph shows ${O}. `:""}This is a slope chart showing changes in data between two category or starting and ending time. Each line represents a different row in data, with lines sloping up or down to show increase or decrease over two categories or time.${o?` ${o}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:u?q||"1rem":q||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[O||o||w||I?e.jsxRuntimeExports.jsx(fi.GraphHeader,{styles:{title:h?.title,description:h?.description},classNames:{title:C?.title,description:C?.description},graphTitle:O,graphDescription:o,width:m,graphDownload:w?ti.current:void 0,dataDownload:I?r.map(l=>l.data).filter(l=>l!==void 0).length>0?r.map(l=>l.data).filter(l=>l!==void 0):r.filter(l=>l!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:r.length===0?e.jsxRuntimeExports.jsx(di.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[y&&r.filter(l=>l.color).length!==0?e.jsxRuntimeExports.jsx(pi.ColorLegendWithMouseOver,{width:m,colorLegendTitle:K,colors:E||a.Colors[S].categoricalColors.colors,colorDomain:W||oi.uniqBy(r.filter(l=>l.color),"color").map(l=>l.color),setSelectedColor:ai,showNAColor:z}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:L,"aria-label":"Graph area",children:(m||N)&&(c||Z)?e.jsxRuntimeExports.jsx(ji,{data:r.filter(l=>!_.checkIfNullOrUndefined(l.y1)&&!_.checkIfNullOrUndefined(l.y2)),width:m||N,height:Math.max(R,c||(g?R?(m||N)*g>R?(m||N)*g:R:(m||N)*g:Z)),colorDomain:r.filter(l=>l.color).length===0?[]:W||oi.uniqBy(r.filter(l=>l.color),"color").map(l=>l.color),colors:r.filter(l=>l.color).length===0?E?[E]:[a.Colors.primaryColors["blue-600"]]:E||a.Colors[S].categoricalColors.colors,selectedColor:ni,axisTitles:Y,showLabels:n,radius:G,leftMargin:A,rightMargin:U,topMargin:X,bottomMargin:D,tooltip:Q,onSeriesMouseOver:p,highlightedDataPoints:s,minValue:F,maxValue:B,onSeriesMouseClick:j,resetSelectionOnDoubleClick:$,detailsOnClick:v,styles:h,classNames:C,animate:H===!0?{duration:.5,once:!0,amount:.5}:H||{duration:0,once:!0,amount:0},dimmedOpacity:x,customLayers:i}):null})]})}),V||P?e.jsxRuntimeExports.jsx(gi.GraphFooter,{styles:{footnote:h?.footnote,source:h?.source},classNames:{footnote:C?.footnote,source:C?.source},sources:V,footNote:P,width:m}):null]})})})})}exports.SlopeChart=wi;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),oi=require("./index-CZbIGs8q.cjs"),f=require("react"),si=require("./index-BXns0-ng.cjs"),ci=require("./Modal-tXZlLE5s.cjs"),xi=require("./Tooltip-n8z5bfav.cjs"),_=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),a=require("./Colors.cjs"),ui=require("./string2HTML-D2Avudmb.cjs"),ri=require("./Axis-DE7dSn1_.cjs"),li=require("./AxisTitle-CK9YeovX.cjs"),mi=require("./linear-BVckp9RD.cjs"),yi=require("./use-in-view-sQJZ_xDO.cjs"),b=require("./proxy-BHRoeZgd.cjs"),hi=require("./index-BW8iNx7E.cjs"),gi=require("./GraphFooter.cjs"),fi=require("./GraphHeader.cjs"),pi=require("./ColorLegendWithMouseOver.cjs"),di=require("./EmptyState-d8_8SxeW.cjs");function ji(J){const{data:r,width:O,height:E,showLabels:V,colors:o,colorDomain:n,radius:c,leftMargin:m,rightMargin:P,topMargin:W,bottomMargin:K,tooltip:G,onSeriesMouseOver:Y,axisTitles:q,highlightedDataPoints:u,selectedColor:A,minValue:U,maxValue:X,onSeriesMouseClick:D,resetSelectionOnDoubleClick:Q,detailsOnClick:g,styles:p,classNames:y,animate:s,dimmedOpacity:d,customLayers:F}=J,B=f.useRef(null),j=yi.useInView(B,{once:s.once,amount:s.amount}),[w,I]=f.useState(void 0),[k,M]=f.useState(void 0),[z,R]=f.useState(void 0),[S,T]=f.useState(void 0),$={top:W,bottom:K,left:m,right:P},v=O-$.left-$.right,h=E-$.top-$.bottom,C=Math.min(Math.min(...r.map(i=>i.y1)),Math.min(...r.map(i=>i.y2))),H=Math.max(Math.max(...r.map(i=>i.y1)),Math.max(...r.map(i=>i.y2))),x=mi.linear().domain([_.checkIfNullOrUndefined(U)?C>0?0:C:U,_.checkIfNullOrUndefined(X)?H>0?H:0:X]).range([h,0]).nice();return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(b.motion.svg,{width:`${O}px`,height:`${E}px`,viewBox:`0 0 ${O} ${E}`,className:"mx-auto",direction:"ltr",ref:B,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${$.left},${$.top})`,children:[e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(ri.Axis,{y1:0,y2:h,x1:c,x2:c,classNames:{axis:e.mo("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",y?.yAxis?.axis)}}),e.jsxRuntimeExports.jsx(li.AxisTitle,{x:c,y:h+15,style:p?.yAxis?.title,className:e.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",y?.yAxis?.title),text:q[0]})]}),e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(ri.Axis,{y1:0,y2:h,x1:v-c,x2:v-c,classNames:{axis:e.mo("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",y?.yAxis?.axis)}}),e.jsxRuntimeExports.jsx(li.AxisTitle,{x:v-c,y:h+15,style:p?.yAxis?.title,className:e.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",y?.yAxis?.title),text:q[1]})]}),F.filter(i=>i.position==="before").map(i=>i.layer),e.jsxRuntimeExports.jsx(hi.AnimatePresence,{children:r.map((i,N)=>e.jsxRuntimeExports.jsxs(b.motion.g,{variants:{initial:{opacity:A?i.color&&o[n.indexOf(`${i.color}`)]===A?1:d:w?w.label===i.label?1:d:u.length!==0?u.indexOf(i.label)!==-1?1:d:1},whileInView:{opacity:A?i.color&&o[n.indexOf(`${i.color}`)]===A?1:d:w?w.label===i.label?1:d:u.length!==0?u.indexOf(i.label)!==-1?1:d:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},onMouseEnter:t=>{I(i),T(t.clientY),R(t.clientX),Y?.(i)},onMouseMove:t=>{I(i),T(t.clientY),R(t.clientX)},onMouseLeave:()=>{I(void 0),R(void 0),T(void 0),Y?.(void 0)},onClick:()=>{(D||g)&&(si.isEqual(k,i)&&Q?(M(void 0),D?.(void 0)):(M(i),D?.(i)))},children:[e.jsxRuntimeExports.jsx(b.motion.circle,{cx:c,variants:{initial:{cy:x(i.y1),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,stroke:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:0},whileInView:{cy:x(i.y1),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,stroke:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},r:c,style:{fillOpacity:.6}}),V?e.jsxRuntimeExports.jsx(b.motion.text,{variants:{initial:{y:x(i.y1),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:0},whileInView:{y:x(i.y1),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},style:{textAnchor:"end",...p?.yAxis?.labels||{}},className:e.mo("text-xs",y?.yAxis?.labels),x:5,dy:"0.33em",textAnchor:"end",dx:0-c-3,children:i.label}):u.length!==0&&u.indexOf(i.label)!==-1?e.jsxRuntimeExports.jsx(b.motion.text,{variants:{initial:{y:x(i.y1),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:0},whileInView:{y:x(i.y1),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},style:{textAnchor:"end",...p?.yAxis?.labels||{}},className:e.mo("text-xs",y?.yAxis?.labels),x:5,dy:"0.33em",dx:-3,children:i.label}):null,e.jsxRuntimeExports.jsx(b.motion.circle,{cx:v-c,variants:{initial:{cy:x(i.y2),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,stroke:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:0},whileInView:{cy:x(i.y2),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,stroke:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},r:c,style:{fillOpacity:.6}}),V?e.jsxRuntimeExports.jsx(b.motion.text,{variants:{initial:{y:x(i.y2),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:0},whileInView:{y:x(i.y2),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},style:{textAnchor:"start",...p?.yAxis?.labels||{}},className:e.mo("text-xs",y?.yAxis?.labels),x:v-5,dy:"0.33em",dx:c+3,children:i.label}):u.length!==0&&u.indexOf(i.label)!==-1?e.jsxRuntimeExports.jsx(b.motion.text,{variants:{initial:{y:x(i.y2),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:0},whileInView:{y:x(i.y2),fill:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},style:{textAnchor:"start",...p?.yAxis?.labels||{}},className:e.mo("text-xs",y?.yAxis?.labels),x:v-5,dy:"0.33em",dx:3,children:i.label}):null,e.jsxRuntimeExports.jsx(b.motion.line,{x1:c,x2:v-c,variants:{initial:{y1:x(i.y1),y2:x(i.y1),stroke:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray},whileInView:{y1:x(i.y1),y2:x(i.y2),stroke:r.filter(t=>t.color).length===0?o[0]:i.color?o[n.indexOf(`${i.color}`)]:a.Colors.gray,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:s.duration}},className:y?.dataConnectors,style:{fill:"none",strokeWidth:1,...p?.dataConnectors}})]},N))}),F.filter(i=>i.position==="after").map(i=>i.layer)]})}),w&&G&&z&&S?e.jsxRuntimeExports.jsx(xi.Tooltip,{data:w,body:G,xPos:z,yPos:S,backgroundStyle:p?.tooltip,className:y?.tooltip}):null,g&&k!==void 0?e.jsxRuntimeExports.jsx(ci.X,{open:k!==void 0,onClose:()=>{M(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof g=="string"?{__html:ui.string2HTML(g,k)}:void 0,children:typeof g=="function"?g(k):null})}):null]})}function wi(J){const{data:r,graphTitle:O,colors:E,sources:V,graphDescription:o,showLabels:n=!1,height:c,width:m,footNote:P,colorDomain:W,colorLegendTitle:K,radius:G=5,axisTitles:Y=["",""],padding:q,backgroundColor:u=!1,leftMargin:A=50,rightMargin:U=50,topMargin:X=20,bottomMargin:D=20,tooltip:Q,relativeHeight:g,onSeriesMouseOver:p,showColorScale:y=!0,highlightedDataPoints:s=[],graphID:d,minValue:F,maxValue:B,onSeriesMouseClick:j,graphDownload:w=!1,dataDownload:I=!1,fillContainer:k=!0,language:M="en",showNAColor:z=!0,minHeight:R=0,theme:S="light",ariaLabel:T,resetSelectionOnDoubleClick:$=!0,detailsOnClick:v,styles:h,classNames:C,animate:H=!1,dimmedOpacity:x=.3,customLayers:i=[]}=J,[N,t]=f.useState(0),[Z,ii]=f.useState(0),[ni,ai]=f.useState(void 0),L=f.useRef(null),ti=f.useRef(null);return f.useEffect(()=>{const l=new ResizeObserver(ei=>{t(m||ei[0].target.clientWidth||620),ii(c||ei[0].target.clientHeight||480)});return L.current&&(ii(L.current.clientHeight||480),t(L.current.clientWidth||620),m||l.observe(L.current)),()=>l.disconnect()},[m,c]),e.jsxRuntimeExports.jsx("div",{className:`${S||"light"} flex ${m?"grow-0":"grow"} ${k?"w-full":"w-fit"} `,dir:M==="he"||M==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${u?u===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,C?.graphContainer),style:{...h?.graphContainer||{},...u&&u!==!0?{backgroundColor:u}:{}},id:d,ref:ti,"aria-label":T||`${O?`The graph shows ${O}. `:""}This is a slope chart showing changes in data between two category or starting and ending time. Each line represents a different row in data, with lines sloping up or down to show increase or decrease over two categories or time.${o?` ${o}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:u?q||"1rem":q||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[O||o||w||I?e.jsxRuntimeExports.jsx(fi.GraphHeader,{styles:{title:h?.title,description:h?.description},classNames:{title:C?.title,description:C?.description},graphTitle:O,graphDescription:o,width:m,graphDownload:w?ti.current:void 0,dataDownload:I?r.map(l=>l.data).filter(l=>l!==void 0).length>0?r.map(l=>l.data).filter(l=>l!==void 0):r.filter(l=>l!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:r.length===0?e.jsxRuntimeExports.jsx(di.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[y&&r.filter(l=>l.color).length!==0?e.jsxRuntimeExports.jsx(pi.ColorLegendWithMouseOver,{width:m,colorLegendTitle:K,colors:E||a.Colors[S].categoricalColors.colors,colorDomain:W||oi.uniqBy(r.filter(l=>l.color),"color").map(l=>l.color),setSelectedColor:ai,showNAColor:z}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:L,"aria-label":"Graph area",children:(m||N)&&(c||Z)?e.jsxRuntimeExports.jsx(ji,{data:r.filter(l=>!_.checkIfNullOrUndefined(l.y1)&&!_.checkIfNullOrUndefined(l.y2)),width:m||N,height:Math.max(R,c||(g?R?(m||N)*g>R?(m||N)*g:R:(m||N)*g:Z)),colorDomain:r.filter(l=>l.color).length===0?[]:W||oi.uniqBy(r.filter(l=>l.color),"color").map(l=>l.color),colors:r.filter(l=>l.color).length===0?E?[E]:[a.Colors.primaryColors["blue-600"]]:E||a.Colors[S].categoricalColors.colors,selectedColor:ni,axisTitles:Y,showLabels:n,radius:G,leftMargin:A,rightMargin:U,topMargin:X,bottomMargin:D,tooltip:Q,onSeriesMouseOver:p,highlightedDataPoints:s,minValue:F,maxValue:B,onSeriesMouseClick:j,resetSelectionOnDoubleClick:$,detailsOnClick:v,styles:h,classNames:C,animate:H===!0?{duration:.5,once:!0,amount:.5}:H||{duration:0,once:!0,amount:0},dimmedOpacity:x,customLayers:i}):null})]})}),V||P?e.jsxRuntimeExports.jsx(gi.GraphFooter,{styles:{footnote:h?.footnote,source:h?.source},classNames:{footnote:C?.footnote,source:C?.source},sources:V,footNote:P,width:m}):null]})})})})}exports.SlopeChart=wi;
|
|
2
2
|
//# sourceMappingURL=SlopeChart.cjs.map
|
package/dist/SlopeChart.js
CHANGED
|
@@ -2,17 +2,17 @@ import { j as o, m as j } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
|
2
2
|
import { u as ri } from "./index-CaAIPGZo.js";
|
|
3
3
|
import { useRef as ii, useState as I, useEffect as yi } from "react";
|
|
4
4
|
import { i as mi } from "./index-27yTRcko.js";
|
|
5
|
-
import { X as xi } from "./Modal-
|
|
5
|
+
import { X as xi } from "./Modal-DVVwpKhP.js";
|
|
6
6
|
import { T as hi } from "./Tooltip-DyM5snqx.js";
|
|
7
7
|
import { c as J } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
8
8
|
import { Colors as n } from "./Colors.js";
|
|
9
9
|
import { s as fi } from "./string2HTML-CWHGfz_d.js";
|
|
10
10
|
import { A as ai } from "./Axis-Ddg-seDi.js";
|
|
11
11
|
import { A as ni } from "./AxisTitle-BmHLMRJZ.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { m as O } from "./proxy-
|
|
15
|
-
import { A as pi } from "./index-
|
|
12
|
+
import { a as gi } from "./linear-DUdu7l2G.js";
|
|
13
|
+
import { u as ui } from "./use-in-view-yS6jzJAp.js";
|
|
14
|
+
import { m as O } from "./proxy-CkpFesk1.js";
|
|
15
|
+
import { A as pi } from "./index-CNvov0eg.js";
|
|
16
16
|
import { GraphFooter as di } from "./GraphFooter.js";
|
|
17
17
|
import { GraphHeader as wi } from "./GraphHeader.js";
|
|
18
18
|
import { ColorLegendWithMouseOver as vi } from "./ColorLegendWithMouseOver.js";
|
|
@@ -45,7 +45,7 @@ function Oi(K) {
|
|
|
45
45
|
animate: s,
|
|
46
46
|
dimmedOpacity: p,
|
|
47
47
|
customLayers: B
|
|
48
|
-
} = K, _ = ii(null), d =
|
|
48
|
+
} = K, _ = ii(null), d = ui(_, {
|
|
49
49
|
once: s.once,
|
|
50
50
|
amount: s.amount
|
|
51
51
|
}), [w, S] = I(void 0), [A, N] = I(void 0), [U, M] = I(void 0), [T, W] = I(void 0), C = {
|
|
@@ -53,7 +53,7 @@ function Oi(K) {
|
|
|
53
53
|
bottom: Q,
|
|
54
54
|
left: x,
|
|
55
55
|
right: X
|
|
56
|
-
}, v = $ - C.left - C.right, f = k - C.top - C.bottom, b = Math.min(Math.min(...l.map((i) => i.y1)), Math.min(...l.map((i) => i.y2))), P = Math.max(Math.max(...l.map((i) => i.y1)), Math.max(...l.map((i) => i.y2))), y =
|
|
56
|
+
}, v = $ - C.left - C.right, f = k - C.top - C.bottom, b = Math.min(Math.min(...l.map((i) => i.y1)), Math.min(...l.map((i) => i.y2))), P = Math.max(Math.max(...l.map((i) => i.y1)), Math.max(...l.map((i) => i.y2))), y = gi().domain([
|
|
57
57
|
J(q) ? b > 0 ? 0 : b : q,
|
|
58
58
|
J(z) ? P > 0 ? P : 0 : z
|
|
59
59
|
]).range([f, 0]).nice();
|
package/dist/StripChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),ce=require("./index-CZbIGs8q.cjs"),p=require("react"),xe=require("./index-BXns0-ng.cjs"),de=require("./index-BzeLQvXk.cjs"),ge=require("./Modal-C_dl0EtQ.cjs"),pe=require("./Tooltip-n8z5bfav.cjs"),J=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ue=require("./numberFormattingFunction-02t-wJta.cjs"),c=require("./Colors.cjs"),fe=require("./string2HTML-D2Avudmb.cjs"),me=require("./use-in-view-BCmzDU2O.cjs"),ye=require("./linear-BVckp9RD.cjs"),le=require("./proxy-PQd2AItT.cjs"),ve=require("./index-DVOJ7vxH.cjs"),je=require("./GraphFooter.cjs"),we=require("./GraphHeader.cjs"),Oe=require("./ColorLegendWithMouseOver.cjs"),Ce=require("./EmptyState-d8_8SxeW.cjs");function be(L,o){if(L<2)return[];const x=o/(L-1);return Array.from({length:L},(f,r)=>r*x)}function Ee(L){const{data:o,width:x,height:f,colors:r,colorDomain:a,radius:u,leftMargin:s,rightMargin:P,topMargin:W,bottomMargin:ee,tooltip:U,onSeriesMouseOver:k,highlightedDataPoints:l,selectedColor:z,minValue:G,maxValue:X,onSeriesMouseClick:D,prefix:K,suffix:C,stripType:Q,highlightColor:v,dotOpacity:j,resetSelectionOnDoubleClick:te,detailsOnClick:N,styles:E,classNames:I,valueColor:V,animate:m,noOfTicks:w,dimmedOpacity:$,precision:B,customLayers:M}=L,Y=p.useRef(null),R=me.useInView(Y,{once:m.once,amount:m.amount}),[T,y]=p.useState(void 0),[d,H]=p.useState(void 0),[_,q]=p.useState(void 0),[g,h]=p.useState(void 0),O={top:W,bottom:ee,left:s,right:P},S=x-O.left-O.right,A=f-O.top-O.bottom,ie=o.map((e,t)=>({...e,id:`${t}`})),oe=de.sortBy(ie,e=>{const t=(l||[]).indexOf(e.label);return t===-1?1/0:t}).reverse(),re=J.checkIfNullOrUndefined(X)?Math.max(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))<0?0:Math.max(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):X,b=J.checkIfNullOrUndefined(G)?Math.min(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))>=0?0:Math.min(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):G,F=ye.linear().domain([b,re]).range([0,S]).nice(),ne=be(w,S);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(le.motion.svg,{width:`${x}px`,height:`${f}px`,viewBox:`0 0 ${x} ${f}`,direction:"ltr",ref:Y,children:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${O.left},${O.top})`,children:[M.filter(e=>e.position==="before").map(e=>e.layer),i.jsxRuntimeExports.jsxs(ve.AnimatePresence,{children:[oe.map(e=>i.jsxRuntimeExports.jsxs(le.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:F(0),y:A/2},whileInView:{x:F(e.position),y:A/2,opacity:z?e.color&&r[a.indexOf(e.color)]===z?.95:$:l.length!==0?l.indexOf(e.label)!==-1?.95:$:j,transition:{duration:m.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},onMouseEnter:t=>{y(e),h(t.clientY),q(t.clientX),k?.(e)},onClick:()=>{(D||N)&&(xe.isEqual(d,e)&&te?(H(void 0),D?.(void 0)):(H(e),D?.(e)))},onMouseMove:t=>{y(e),h(t.clientY),q(t.clientX)},onMouseLeave:()=>{y(void 0),q(void 0),h(void 0),k?.(void 0)},children:[Q==="dot"?i.jsxRuntimeExports.jsx(le.motion.circle,{cy:0,cx:0,variants:{initial:{fill:v&&l?l.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray},whileInView:{fill:v&&l?l.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray,transition:{duration:m.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},r:u}):i.jsxRuntimeExports.jsx(le.motion.rect,{y:0-u,x:-1,height:u*2,width:2,variants:{initial:{fill:v&&l?l.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray},whileInView:{fill:v&&l?l.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray,transition:{duration:m.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}}}),l.length!==0&&l.indexOf(e.label)!==-1?i.jsxRuntimeExports.jsx(le.motion.text,{x:0,y:0-u-5,variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},style:{fill:V||(v&&l?l.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray),textAnchor:"middle",...E?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",I?.graphObjectValues),children:ue.numberFormattingFunction(e.position,"NA",B,K,C)}):null]},e.label)),ne.map((e,t)=>i.jsxRuntimeExports.jsx("text",{x:e,y:A/2+u,style:{textAnchor:t===0?"start":t===ne.length-1?"end":"middle",...E?.xAxis?.labels||{}},className:i.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",I?.xAxis?.labels),dy:"1em",children:ue.numberFormattingFunction(F.invert(e),"NA",B,K,C)},t))]}),M.filter(e=>e.position==="after").map(e=>e.layer)]})}),T&&U&&_&&g?i.jsxRuntimeExports.jsx(pe.Tooltip,{data:T,body:U,xPos:_,yPos:g,backgroundStyle:E?.tooltip,className:I?.tooltip}):null,N&&d!==void 0?i.jsxRuntimeExports.jsx(ge.X,{open:d!==void 0,onClose:()=>{H(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof N=="string"?{__html:fe.string2HTML(N,d)}:void 0,children:typeof N=="function"?N(d):null})}):null]})}function Me(L){const{data:o,graphTitle:x,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U=5,padding:k,backgroundColor:l=!1,leftMargin:z=5,rightMargin:G=5,topMargin:X=10,bottomMargin:D=10,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v=!0,highlightedDataPoints:j=[],graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,graphDownload:V=!1,dataDownload:m=!1,prefix:w="",suffix:$="",stripType:B="dot",language:M="en",highlightColor:Y,dotOpacity:R=.3,showNAColor:T=!0,minHeight:y=0,theme:d="light",ariaLabel:H,resetSelectionOnDoubleClick:_=!0,detailsOnClick:q,styles:g,classNames:h,valueColor:O,animate:S=!1,noOfTicks:A=2,dimmedOpacity:ie=.3,precision:oe=2,customLayers:re=[]}=L,[b,F]=p.useState(0),[ne,e]=p.useState(0),[t,he]=p.useState(void 0),Z=p.useRef(null),ae=p.useRef(null);return p.useEffect(()=>{const n=new ResizeObserver(se=>{F(s||se[0].target.clientWidth||620),e(u||se[0].target.clientHeight||480)});return Z.current&&(e(Z.current.clientHeight||480),F(Z.current.clientWidth||620),s||n.observe(Z.current)),()=>n.disconnect()},[s,u]),i.jsxRuntimeExports.jsx("div",{className:`${d||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${l?l===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,h?.graphContainer),style:{...g?.graphContainer||{},...l&&l!==!0?{backgroundColor:l}:{}},id:te,ref:ae,"aria-label":H||`${x?`The graph shows ${x}. `:""}This is a strip chart showing distribution of data along the horizontal axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${a?` ${a}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:l?k||"1rem":k||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[x||a||V||m?i.jsxRuntimeExports.jsx(we.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:h?.title,description:h?.description},graphTitle:x,graphDescription:a,width:s,graphDownload:V?ae.current:void 0,dataDownload:m?o.map(n=>n.data).filter(n=>n!==void 0).length>0?o.map(n=>n.data).filter(n=>n!==void 0):o.filter(n=>n!==void 0):null}):null,i.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:o.length===0?i.jsxRuntimeExports.jsx(Ce.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[v!==!1&&o.filter(n=>n.color).length!==0?i.jsxRuntimeExports.jsx(Oe.ColorLegendWithMouseOver,{width:s,colorLegendTitle:ee,colors:f||c.Colors[d].categoricalColors.colors,colorDomain:W||ce.uniqBy(o.filter(n=>n.color),"color").map(n=>n.color),setSelectedColor:he,showNAColor:T??!0}):null,i.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:Z,"aria-label":"Graph area",children:(s||b)&&(u||ne)?i.jsxRuntimeExports.jsx(Ee,{data:o,width:s||b,height:Math.max(y,u||(C?y?(s||b)*C>y?(s||b)*C:y:(s||b)*C:ne)),colorDomain:o.filter(n=>n.color).length===0?[]:W||ce.uniqBy(o.filter(n=>n.color),"color").map(n=>n.color),colors:o.filter(n=>n.color).length===0?f?[f]:[c.Colors.primaryColors["blue-600"]]:f||c.Colors[d].categoricalColors.colors,selectedColor:t,radius:U,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,onSeriesMouseOver:Q,highlightedDataPoints:j,minValue:N,maxValue:E,onSeriesMouseClick:I,prefix:w,suffix:$,stripType:B,highlightColor:Y,dotOpacity:R,resetSelectionOnDoubleClick:_,detailsOnClick:q,styles:g,classNames:h,valueColor:O,animate:S===!0?{duration:.5,once:!0,amount:.5}:S||{duration:0,once:!0,amount:0},noOfTicks:A,dimmedOpacity:ie,precision:oe,customLayers:re}):null})]})}),r||P?i.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:r,footNote:P,width:s}):null]})})})})}function Re(L){const{data:o,width:x,height:f,colors:r,colorDomain:a,radius:u,leftMargin:s,rightMargin:P,topMargin:W,bottomMargin:ee,tooltip:U,onSeriesMouseOver:k,highlightedDataPoints:l,selectedColor:z,minValue:G,maxValue:X,onSeriesMouseClick:D,noOfTicks:K,prefix:C,suffix:Q,stripType:v,highlightColor:j,dotOpacity:te,resetSelectionOnDoubleClick:N,detailsOnClick:E,styles:I,classNames:V,valueColor:m,animate:w,dimmedOpacity:$,precision:B,customLayers:M}=L,Y=p.useRef(null),R=me.useInView(Y,{once:w.once,amount:w.amount}),[T,y]=p.useState(void 0),[d,H]=p.useState(void 0),[_,q]=p.useState(void 0),[g,h]=p.useState(void 0),O={top:W,bottom:ee,left:s,right:P},S=x-O.left-O.right,A=f-O.top-O.bottom,ie=o.map((e,t)=>({...e,id:`${t}`})),oe=de.sortBy(ie,e=>{const t=(l||[]).indexOf(e.label);return t===-1?1/0:t}).reverse(),re=J.checkIfNullOrUndefined(X)?Math.max(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))<0?0:Math.max(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):X,b=J.checkIfNullOrUndefined(G)?Math.min(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))>=0?0:Math.min(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):G,F=ye.linear().domain([b,re]).range([A,0]).nice(),ne=be(K,A);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(le.motion.svg,{width:`${x}px`,height:`${f}px`,viewBox:`0 0 ${x} ${f}`,direction:"ltr",ref:Y,children:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${O.left},${O.top})`,children:[M.filter(e=>e.position==="before").map(e=>e.layer),i.jsxRuntimeExports.jsxs(ve.AnimatePresence,{children:[oe.map(e=>i.jsxRuntimeExports.jsxs(le.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:S/2,y:F(0)},whileInView:{x:S/2,y:F(e.position),opacity:z?e.color&&r[a.indexOf(e.color)]===z?.95:$:l.length!==0?l.indexOf(e.label)!==-1?.95:$:te,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},onMouseEnter:t=>{y(e),h(t.clientY),q(t.clientX),k?.(e)},onClick:()=>{(D||E)&&(xe.isEqual(d,e)&&N?(H(void 0),D?.(void 0)):(H(e),D?.(e)))},onMouseMove:t=>{y(e),h(t.clientY),q(t.clientX)},onMouseLeave:()=>{y(void 0),q(void 0),h(void 0),k?.(void 0)},children:[v==="dot"?i.jsxRuntimeExports.jsx(le.motion.circle,{cy:0,cx:0,variants:{initial:{fill:j&&l?l.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray},whileInView:{fill:j&&l?l.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},r:u}):i.jsxRuntimeExports.jsx(le.motion.rect,{x:0-u,y:-1,width:u*2,height:2,variants:{initial:{fill:j&&l?l.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray},whileInView:{fill:j&&l?l.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}}}),l.length!==0&&l.indexOf(e.label)!==-1?i.jsxRuntimeExports.jsx(le.motion.text,{y:0,dy:"0.33em",x:0+u+3,variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},style:{fill:m||(j&&l?l.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray),textAnchor:"start",...I?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",V?.graphObjectValues),children:ue.numberFormattingFunction(e.position,"NA",B,C,Q)}):null]},e.label)),ne.map((e,t)=>i.jsxRuntimeExports.jsx("text",{y:e,x:S/2+u+5,style:{textAnchor:"start",...I?.yAxis?.labels||{}},className:i.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",V?.yAxis?.labels),children:ue.numberFormattingFunction(F.invert(e),"NA",B,C,Q)},t))]}),M.filter(e=>e.position==="after").map(e=>e.layer)]})}),T&&U&&_&&g?i.jsxRuntimeExports.jsx(pe.Tooltip,{data:T,body:U,xPos:_,yPos:g,backgroundStyle:I?.tooltip,className:V?.tooltip}):null,E&&d!==void 0?i.jsxRuntimeExports.jsx(ge.X,{open:d!==void 0,onClose:()=>{H(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof E=="string"?{__html:fe.string2HTML(E,d)}:void 0,children:typeof E=="function"?E(d):null})}):null]})}function Ne(L){const{data:o,graphTitle:x,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U=5,padding:k,backgroundColor:l=!1,leftMargin:z=20,rightMargin:G=20,topMargin:X=10,bottomMargin:D=10,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v=!0,highlightedDataPoints:j=[],graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,graphDownload:V=!1,dataDownload:m=!1,prefix:w="",suffix:$="",stripType:B="dot",language:M="en",highlightColor:Y,dotOpacity:R=.3,showNAColor:T=!0,minHeight:y=0,theme:d="light",ariaLabel:H,resetSelectionOnDoubleClick:_=!0,detailsOnClick:q,styles:g,classNames:h,valueColor:O,animate:S=!1,noOfTicks:A=2,dimmedOpacity:ie=.3,precision:oe=2,customLayers:re=[]}=L,[b,F]=p.useState(0),[ne,e]=p.useState(0),[t,he]=p.useState(void 0),Z=p.useRef(null),ae=p.useRef(null);return p.useEffect(()=>{const n=new ResizeObserver(se=>{F(s||se[0].target.clientWidth||620),e(u||se[0].target.clientHeight||480)});return Z.current&&(e(Z.current.clientHeight||480),F(Z.current.clientWidth||620),s||n.observe(Z.current)),()=>n.disconnect()},[s,u]),i.jsxRuntimeExports.jsx("div",{className:`${d||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${l?l===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,h?.graphContainer),style:{...g?.graphContainer||{},...l&&l!==!0?{backgroundColor:l}:{}},id:te,ref:ae,"aria-label":H||`${x?`The graph shows ${x}. `:""}This is a strip chart showing distribution of data along the vertical axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${a?` ${a}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:l?k||"1rem":k||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[x||a||V||m?i.jsxRuntimeExports.jsx(we.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:h?.title,description:h?.description},graphTitle:x,graphDescription:a,width:s,graphDownload:V?ae.current:void 0,dataDownload:m?o.map(n=>n.data).filter(n=>n!==void 0).length>0?o.map(n=>n.data).filter(n=>n!==void 0):o.filter(n=>n!==void 0):null}):null,i.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:o.length===0?i.jsxRuntimeExports.jsx(Ce.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[v!==!1&&o.filter(n=>n.color).length!==0?i.jsxRuntimeExports.jsx(Oe.ColorLegendWithMouseOver,{width:s,colorLegendTitle:ee,colors:f||c.Colors[d].categoricalColors.colors,colorDomain:W||ce.uniqBy(o.filter(n=>n.color),"color").map(n=>n.color),setSelectedColor:he,showNAColor:T}):null,i.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:Z,children:(s||b)&&(u||ne)?i.jsxRuntimeExports.jsx(Re,{data:o,width:s||b,height:Math.max(y,u||(C?y?(s||b)*C>y?(s||b)*C:y:(s||b)*C:ne)),colorDomain:o.filter(n=>n.color).length===0?[]:W||ce.uniqBy(o.filter(n=>n.color),"color").map(n=>n.color),colors:o.filter(n=>n.color).length===0?f?[f]:[c.Colors.primaryColors["blue-600"]]:f||c.Colors[d].categoricalColors.colors,selectedColor:t,radius:U,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,onSeriesMouseOver:Q,highlightedDataPoints:j,minValue:N,maxValue:E,onSeriesMouseClick:I,prefix:w,suffix:$,stripType:B,highlightColor:Y,dotOpacity:R,resetSelectionOnDoubleClick:_,detailsOnClick:q,styles:g,classNames:h,valueColor:O,animate:S===!0?{duration:.5,once:!0,amount:.5}:S||{duration:0,once:!0,amount:0},noOfTicks:A,dimmedOpacity:ie,precision:oe,customLayers:re}):null})]})}),r||P?i.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:r,footNote:P,width:s}):null]})})})})}function Se(L){const{data:o,graphTitle:x,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:k,backgroundColor:l,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v,highlightedDataPoints:j,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,noOfTicks:V,graphDownload:m,dataDownload:w,prefix:$,suffix:B,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:y,minHeight:d,theme:H,ariaLabel:_,valueColor:q,resetSelectionOnDoubleClick:g,detailsOnClick:h,orientation:O="vertical",styles:S,classNames:A,animate:ie,dimmedOpacity:oe=.3,precision:re,customLayers:b}=L;return O==="vertical"?i.jsxRuntimeExports.jsx(Ne,{data:o,graphTitle:x,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:k,backgroundColor:l,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v,highlightedDataPoints:j,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,noOfTicks:V,graphDownload:m,dataDownload:w,prefix:$,suffix:B,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:y,minHeight:d,theme:H,ariaLabel:_,resetSelectionOnDoubleClick:g,styles:S,valueColor:q,detailsOnClick:h,classNames:A,animate:ie,dimmedOpacity:oe,precision:re,customLayers:b}):i.jsxRuntimeExports.jsx(Me,{data:o,graphTitle:x,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:k,backgroundColor:l,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v,highlightedDataPoints:j,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,noOfTicks:V,graphDownload:m,dataDownload:w,prefix:$,suffix:B,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:y,minHeight:d,theme:H,ariaLabel:_,resetSelectionOnDoubleClick:g,styles:S,valueColor:q,detailsOnClick:h,classNames:A,animate:ie,dimmedOpacity:oe,precision:re,customLayers:b})}exports.StripChart=Se;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),ce=require("./index-CZbIGs8q.cjs"),p=require("react"),xe=require("./index-BXns0-ng.cjs"),de=require("./index-BzeLQvXk.cjs"),ge=require("./Modal-tXZlLE5s.cjs"),pe=require("./Tooltip-n8z5bfav.cjs"),J=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ue=require("./numberFormattingFunction-02t-wJta.cjs"),c=require("./Colors.cjs"),fe=require("./string2HTML-D2Avudmb.cjs"),me=require("./linear-BVckp9RD.cjs"),ye=require("./use-in-view-sQJZ_xDO.cjs"),le=require("./proxy-BHRoeZgd.cjs"),ve=require("./index-BW8iNx7E.cjs"),je=require("./GraphFooter.cjs"),we=require("./GraphHeader.cjs"),Oe=require("./ColorLegendWithMouseOver.cjs"),Ce=require("./EmptyState-d8_8SxeW.cjs");function be(L,o){if(L<2)return[];const x=o/(L-1);return Array.from({length:L},(f,r)=>r*x)}function Ee(L){const{data:o,width:x,height:f,colors:r,colorDomain:a,radius:u,leftMargin:s,rightMargin:P,topMargin:W,bottomMargin:ee,tooltip:U,onSeriesMouseOver:k,highlightedDataPoints:l,selectedColor:z,minValue:G,maxValue:X,onSeriesMouseClick:D,prefix:K,suffix:C,stripType:Q,highlightColor:v,dotOpacity:j,resetSelectionOnDoubleClick:te,detailsOnClick:N,styles:E,classNames:I,valueColor:V,animate:m,noOfTicks:w,dimmedOpacity:$,precision:B,customLayers:M}=L,Y=p.useRef(null),R=ye.useInView(Y,{once:m.once,amount:m.amount}),[T,y]=p.useState(void 0),[d,H]=p.useState(void 0),[_,q]=p.useState(void 0),[g,h]=p.useState(void 0),O={top:W,bottom:ee,left:s,right:P},S=x-O.left-O.right,A=f-O.top-O.bottom,ie=o.map((e,t)=>({...e,id:`${t}`})),oe=de.sortBy(ie,e=>{const t=(l||[]).indexOf(e.label);return t===-1?1/0:t}).reverse(),re=J.checkIfNullOrUndefined(X)?Math.max(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))<0?0:Math.max(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):X,b=J.checkIfNullOrUndefined(G)?Math.min(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))>=0?0:Math.min(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):G,F=me.linear().domain([b,re]).range([0,S]).nice(),ne=be(w,S);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(le.motion.svg,{width:`${x}px`,height:`${f}px`,viewBox:`0 0 ${x} ${f}`,direction:"ltr",ref:Y,children:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${O.left},${O.top})`,children:[M.filter(e=>e.position==="before").map(e=>e.layer),i.jsxRuntimeExports.jsxs(ve.AnimatePresence,{children:[oe.map(e=>i.jsxRuntimeExports.jsxs(le.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:F(0),y:A/2},whileInView:{x:F(e.position),y:A/2,opacity:z?e.color&&r[a.indexOf(e.color)]===z?.95:$:l.length!==0?l.indexOf(e.label)!==-1?.95:$:j,transition:{duration:m.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},onMouseEnter:t=>{y(e),h(t.clientY),q(t.clientX),k?.(e)},onClick:()=>{(D||N)&&(xe.isEqual(d,e)&&te?(H(void 0),D?.(void 0)):(H(e),D?.(e)))},onMouseMove:t=>{y(e),h(t.clientY),q(t.clientX)},onMouseLeave:()=>{y(void 0),q(void 0),h(void 0),k?.(void 0)},children:[Q==="dot"?i.jsxRuntimeExports.jsx(le.motion.circle,{cy:0,cx:0,variants:{initial:{fill:v&&l?l.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray},whileInView:{fill:v&&l?l.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray,transition:{duration:m.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},r:u}):i.jsxRuntimeExports.jsx(le.motion.rect,{y:0-u,x:-1,height:u*2,width:2,variants:{initial:{fill:v&&l?l.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray},whileInView:{fill:v&&l?l.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray,transition:{duration:m.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}}}),l.length!==0&&l.indexOf(e.label)!==-1?i.jsxRuntimeExports.jsx(le.motion.text,{x:0,y:0-u-5,variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},style:{fill:V||(v&&l?l.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray),textAnchor:"middle",...E?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",I?.graphObjectValues),children:ue.numberFormattingFunction(e.position,"NA",B,K,C)}):null]},e.label)),ne.map((e,t)=>i.jsxRuntimeExports.jsx("text",{x:e,y:A/2+u,style:{textAnchor:t===0?"start":t===ne.length-1?"end":"middle",...E?.xAxis?.labels||{}},className:i.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",I?.xAxis?.labels),dy:"1em",children:ue.numberFormattingFunction(F.invert(e),"NA",B,K,C)},t))]}),M.filter(e=>e.position==="after").map(e=>e.layer)]})}),T&&U&&_&&g?i.jsxRuntimeExports.jsx(pe.Tooltip,{data:T,body:U,xPos:_,yPos:g,backgroundStyle:E?.tooltip,className:I?.tooltip}):null,N&&d!==void 0?i.jsxRuntimeExports.jsx(ge.X,{open:d!==void 0,onClose:()=>{H(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof N=="string"?{__html:fe.string2HTML(N,d)}:void 0,children:typeof N=="function"?N(d):null})}):null]})}function Me(L){const{data:o,graphTitle:x,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U=5,padding:k,backgroundColor:l=!1,leftMargin:z=5,rightMargin:G=5,topMargin:X=10,bottomMargin:D=10,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v=!0,highlightedDataPoints:j=[],graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,graphDownload:V=!1,dataDownload:m=!1,prefix:w="",suffix:$="",stripType:B="dot",language:M="en",highlightColor:Y,dotOpacity:R=.3,showNAColor:T=!0,minHeight:y=0,theme:d="light",ariaLabel:H,resetSelectionOnDoubleClick:_=!0,detailsOnClick:q,styles:g,classNames:h,valueColor:O,animate:S=!1,noOfTicks:A=2,dimmedOpacity:ie=.3,precision:oe=2,customLayers:re=[]}=L,[b,F]=p.useState(0),[ne,e]=p.useState(0),[t,he]=p.useState(void 0),Z=p.useRef(null),ae=p.useRef(null);return p.useEffect(()=>{const n=new ResizeObserver(se=>{F(s||se[0].target.clientWidth||620),e(u||se[0].target.clientHeight||480)});return Z.current&&(e(Z.current.clientHeight||480),F(Z.current.clientWidth||620),s||n.observe(Z.current)),()=>n.disconnect()},[s,u]),i.jsxRuntimeExports.jsx("div",{className:`${d||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${l?l===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,h?.graphContainer),style:{...g?.graphContainer||{},...l&&l!==!0?{backgroundColor:l}:{}},id:te,ref:ae,"aria-label":H||`${x?`The graph shows ${x}. `:""}This is a strip chart showing distribution of data along the horizontal axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${a?` ${a}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:l?k||"1rem":k||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[x||a||V||m?i.jsxRuntimeExports.jsx(we.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:h?.title,description:h?.description},graphTitle:x,graphDescription:a,width:s,graphDownload:V?ae.current:void 0,dataDownload:m?o.map(n=>n.data).filter(n=>n!==void 0).length>0?o.map(n=>n.data).filter(n=>n!==void 0):o.filter(n=>n!==void 0):null}):null,i.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:o.length===0?i.jsxRuntimeExports.jsx(Ce.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[v!==!1&&o.filter(n=>n.color).length!==0?i.jsxRuntimeExports.jsx(Oe.ColorLegendWithMouseOver,{width:s,colorLegendTitle:ee,colors:f||c.Colors[d].categoricalColors.colors,colorDomain:W||ce.uniqBy(o.filter(n=>n.color),"color").map(n=>n.color),setSelectedColor:he,showNAColor:T??!0}):null,i.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:Z,"aria-label":"Graph area",children:(s||b)&&(u||ne)?i.jsxRuntimeExports.jsx(Ee,{data:o,width:s||b,height:Math.max(y,u||(C?y?(s||b)*C>y?(s||b)*C:y:(s||b)*C:ne)),colorDomain:o.filter(n=>n.color).length===0?[]:W||ce.uniqBy(o.filter(n=>n.color),"color").map(n=>n.color),colors:o.filter(n=>n.color).length===0?f?[f]:[c.Colors.primaryColors["blue-600"]]:f||c.Colors[d].categoricalColors.colors,selectedColor:t,radius:U,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,onSeriesMouseOver:Q,highlightedDataPoints:j,minValue:N,maxValue:E,onSeriesMouseClick:I,prefix:w,suffix:$,stripType:B,highlightColor:Y,dotOpacity:R,resetSelectionOnDoubleClick:_,detailsOnClick:q,styles:g,classNames:h,valueColor:O,animate:S===!0?{duration:.5,once:!0,amount:.5}:S||{duration:0,once:!0,amount:0},noOfTicks:A,dimmedOpacity:ie,precision:oe,customLayers:re}):null})]})}),r||P?i.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:r,footNote:P,width:s}):null]})})})})}function Re(L){const{data:o,width:x,height:f,colors:r,colorDomain:a,radius:u,leftMargin:s,rightMargin:P,topMargin:W,bottomMargin:ee,tooltip:U,onSeriesMouseOver:k,highlightedDataPoints:l,selectedColor:z,minValue:G,maxValue:X,onSeriesMouseClick:D,noOfTicks:K,prefix:C,suffix:Q,stripType:v,highlightColor:j,dotOpacity:te,resetSelectionOnDoubleClick:N,detailsOnClick:E,styles:I,classNames:V,valueColor:m,animate:w,dimmedOpacity:$,precision:B,customLayers:M}=L,Y=p.useRef(null),R=ye.useInView(Y,{once:w.once,amount:w.amount}),[T,y]=p.useState(void 0),[d,H]=p.useState(void 0),[_,q]=p.useState(void 0),[g,h]=p.useState(void 0),O={top:W,bottom:ee,left:s,right:P},S=x-O.left-O.right,A=f-O.top-O.bottom,ie=o.map((e,t)=>({...e,id:`${t}`})),oe=de.sortBy(ie,e=>{const t=(l||[]).indexOf(e.label);return t===-1?1/0:t}).reverse(),re=J.checkIfNullOrUndefined(X)?Math.max(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))<0?0:Math.max(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):X,b=J.checkIfNullOrUndefined(G)?Math.min(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))>=0?0:Math.min(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):G,F=me.linear().domain([b,re]).range([A,0]).nice(),ne=be(K,A);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(le.motion.svg,{width:`${x}px`,height:`${f}px`,viewBox:`0 0 ${x} ${f}`,direction:"ltr",ref:Y,children:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${O.left},${O.top})`,children:[M.filter(e=>e.position==="before").map(e=>e.layer),i.jsxRuntimeExports.jsxs(ve.AnimatePresence,{children:[oe.map(e=>i.jsxRuntimeExports.jsxs(le.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:S/2,y:F(0)},whileInView:{x:S/2,y:F(e.position),opacity:z?e.color&&r[a.indexOf(e.color)]===z?.95:$:l.length!==0?l.indexOf(e.label)!==-1?.95:$:te,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},onMouseEnter:t=>{y(e),h(t.clientY),q(t.clientX),k?.(e)},onClick:()=>{(D||E)&&(xe.isEqual(d,e)&&N?(H(void 0),D?.(void 0)):(H(e),D?.(e)))},onMouseMove:t=>{y(e),h(t.clientY),q(t.clientX)},onMouseLeave:()=>{y(void 0),q(void 0),h(void 0),k?.(void 0)},children:[v==="dot"?i.jsxRuntimeExports.jsx(le.motion.circle,{cy:0,cx:0,variants:{initial:{fill:j&&l?l.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray},whileInView:{fill:j&&l?l.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},r:u}):i.jsxRuntimeExports.jsx(le.motion.rect,{x:0-u,y:-1,width:u*2,height:2,variants:{initial:{fill:j&&l?l.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray},whileInView:{fill:j&&l?l.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}}}),l.length!==0&&l.indexOf(e.label)!==-1?i.jsxRuntimeExports.jsx(le.motion.text,{y:0,dy:"0.33em",x:0+u+3,variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},style:{fill:m||(j&&l?l.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray),textAnchor:"start",...I?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",V?.graphObjectValues),children:ue.numberFormattingFunction(e.position,"NA",B,C,Q)}):null]},e.label)),ne.map((e,t)=>i.jsxRuntimeExports.jsx("text",{y:e,x:S/2+u+5,style:{textAnchor:"start",...I?.yAxis?.labels||{}},className:i.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",V?.yAxis?.labels),children:ue.numberFormattingFunction(F.invert(e),"NA",B,C,Q)},t))]}),M.filter(e=>e.position==="after").map(e=>e.layer)]})}),T&&U&&_&&g?i.jsxRuntimeExports.jsx(pe.Tooltip,{data:T,body:U,xPos:_,yPos:g,backgroundStyle:I?.tooltip,className:V?.tooltip}):null,E&&d!==void 0?i.jsxRuntimeExports.jsx(ge.X,{open:d!==void 0,onClose:()=>{H(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof E=="string"?{__html:fe.string2HTML(E,d)}:void 0,children:typeof E=="function"?E(d):null})}):null]})}function Ne(L){const{data:o,graphTitle:x,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U=5,padding:k,backgroundColor:l=!1,leftMargin:z=20,rightMargin:G=20,topMargin:X=10,bottomMargin:D=10,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v=!0,highlightedDataPoints:j=[],graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,graphDownload:V=!1,dataDownload:m=!1,prefix:w="",suffix:$="",stripType:B="dot",language:M="en",highlightColor:Y,dotOpacity:R=.3,showNAColor:T=!0,minHeight:y=0,theme:d="light",ariaLabel:H,resetSelectionOnDoubleClick:_=!0,detailsOnClick:q,styles:g,classNames:h,valueColor:O,animate:S=!1,noOfTicks:A=2,dimmedOpacity:ie=.3,precision:oe=2,customLayers:re=[]}=L,[b,F]=p.useState(0),[ne,e]=p.useState(0),[t,he]=p.useState(void 0),Z=p.useRef(null),ae=p.useRef(null);return p.useEffect(()=>{const n=new ResizeObserver(se=>{F(s||se[0].target.clientWidth||620),e(u||se[0].target.clientHeight||480)});return Z.current&&(e(Z.current.clientHeight||480),F(Z.current.clientWidth||620),s||n.observe(Z.current)),()=>n.disconnect()},[s,u]),i.jsxRuntimeExports.jsx("div",{className:`${d||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${l?l===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,h?.graphContainer),style:{...g?.graphContainer||{},...l&&l!==!0?{backgroundColor:l}:{}},id:te,ref:ae,"aria-label":H||`${x?`The graph shows ${x}. `:""}This is a strip chart showing distribution of data along the vertical axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${a?` ${a}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:l?k||"1rem":k||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[x||a||V||m?i.jsxRuntimeExports.jsx(we.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:h?.title,description:h?.description},graphTitle:x,graphDescription:a,width:s,graphDownload:V?ae.current:void 0,dataDownload:m?o.map(n=>n.data).filter(n=>n!==void 0).length>0?o.map(n=>n.data).filter(n=>n!==void 0):o.filter(n=>n!==void 0):null}):null,i.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:o.length===0?i.jsxRuntimeExports.jsx(Ce.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[v!==!1&&o.filter(n=>n.color).length!==0?i.jsxRuntimeExports.jsx(Oe.ColorLegendWithMouseOver,{width:s,colorLegendTitle:ee,colors:f||c.Colors[d].categoricalColors.colors,colorDomain:W||ce.uniqBy(o.filter(n=>n.color),"color").map(n=>n.color),setSelectedColor:he,showNAColor:T}):null,i.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:Z,children:(s||b)&&(u||ne)?i.jsxRuntimeExports.jsx(Re,{data:o,width:s||b,height:Math.max(y,u||(C?y?(s||b)*C>y?(s||b)*C:y:(s||b)*C:ne)),colorDomain:o.filter(n=>n.color).length===0?[]:W||ce.uniqBy(o.filter(n=>n.color),"color").map(n=>n.color),colors:o.filter(n=>n.color).length===0?f?[f]:[c.Colors.primaryColors["blue-600"]]:f||c.Colors[d].categoricalColors.colors,selectedColor:t,radius:U,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,onSeriesMouseOver:Q,highlightedDataPoints:j,minValue:N,maxValue:E,onSeriesMouseClick:I,prefix:w,suffix:$,stripType:B,highlightColor:Y,dotOpacity:R,resetSelectionOnDoubleClick:_,detailsOnClick:q,styles:g,classNames:h,valueColor:O,animate:S===!0?{duration:.5,once:!0,amount:.5}:S||{duration:0,once:!0,amount:0},noOfTicks:A,dimmedOpacity:ie,precision:oe,customLayers:re}):null})]})}),r||P?i.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:r,footNote:P,width:s}):null]})})})})}function Se(L){const{data:o,graphTitle:x,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:k,backgroundColor:l,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v,highlightedDataPoints:j,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,noOfTicks:V,graphDownload:m,dataDownload:w,prefix:$,suffix:B,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:y,minHeight:d,theme:H,ariaLabel:_,valueColor:q,resetSelectionOnDoubleClick:g,detailsOnClick:h,orientation:O="vertical",styles:S,classNames:A,animate:ie,dimmedOpacity:oe=.3,precision:re,customLayers:b}=L;return O==="vertical"?i.jsxRuntimeExports.jsx(Ne,{data:o,graphTitle:x,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:k,backgroundColor:l,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v,highlightedDataPoints:j,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,noOfTicks:V,graphDownload:m,dataDownload:w,prefix:$,suffix:B,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:y,minHeight:d,theme:H,ariaLabel:_,resetSelectionOnDoubleClick:g,styles:S,valueColor:q,detailsOnClick:h,classNames:A,animate:ie,dimmedOpacity:oe,precision:re,customLayers:b}):i.jsxRuntimeExports.jsx(Me,{data:o,graphTitle:x,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:k,backgroundColor:l,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v,highlightedDataPoints:j,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,noOfTicks:V,graphDownload:m,dataDownload:w,prefix:$,suffix:B,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:y,minHeight:d,theme:H,ariaLabel:_,resetSelectionOnDoubleClick:g,styles:S,valueColor:q,detailsOnClick:h,classNames:A,animate:ie,dimmedOpacity:oe,precision:re,customLayers:b})}exports.StripChart=Se;
|
|
2
2
|
//# sourceMappingURL=StripChart.cjs.map
|
package/dist/StripChart.js
CHANGED
|
@@ -3,16 +3,16 @@ import { u as gi } from "./index-CaAIPGZo.js";
|
|
|
3
3
|
import { useRef as si, useState as E, useEffect as ui } from "react";
|
|
4
4
|
import { i as pi } from "./index-27yTRcko.js";
|
|
5
5
|
import { s as mi } from "./index-DxagiOHo.js";
|
|
6
|
-
import { X as xi } from "./Modal-
|
|
6
|
+
import { X as xi } from "./Modal-DVVwpKhP.js";
|
|
7
7
|
import { T as yi } from "./Tooltip-DyM5snqx.js";
|
|
8
8
|
import { c as J } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
9
9
|
import { n as di } from "./numberFormattingFunction-14YCbkN2.js";
|
|
10
10
|
import { Colors as c } from "./Colors.js";
|
|
11
11
|
import { s as vi } from "./string2HTML-CWHGfz_d.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { m as ai } from "./proxy-
|
|
15
|
-
import { A as bi } from "./index-
|
|
12
|
+
import { a as wi } from "./linear-DUdu7l2G.js";
|
|
13
|
+
import { u as Oi } from "./use-in-view-yS6jzJAp.js";
|
|
14
|
+
import { m as ai } from "./proxy-CkpFesk1.js";
|
|
15
|
+
import { A as bi } from "./index-CNvov0eg.js";
|
|
16
16
|
import { GraphFooter as Ci } from "./GraphFooter.js";
|
|
17
17
|
import { GraphHeader as ji } from "./GraphHeader.js";
|
|
18
18
|
import { ColorLegendWithMouseOver as Mi } from "./ColorLegendWithMouseOver.js";
|
|
@@ -56,7 +56,7 @@ function Vi(P) {
|
|
|
56
56
|
dimmedOpacity: T,
|
|
57
57
|
precision: B,
|
|
58
58
|
customLayers: M
|
|
59
|
-
} = P, q = si(null), D =
|
|
59
|
+
} = P, q = si(null), D = Oi(q, {
|
|
60
60
|
once: m.once,
|
|
61
61
|
amount: m.amount
|
|
62
62
|
}), [H, x] = E(void 0), [f, A] = E(void 0), [U, L] = E(void 0), [u, g] = E(void 0), O = {
|
|
@@ -67,7 +67,7 @@ function Vi(P) {
|
|
|
67
67
|
}, V = d - O.left - O.right, W = p - O.top - O.bottom, oi = o.map((i, t) => ({ ...i, id: `${t}` })), ei = mi(oi, (i) => {
|
|
68
68
|
const t = (a || []).indexOf(i.label);
|
|
69
69
|
return t === -1 ? 1 / 0 : t;
|
|
70
|
-
}).reverse(), ri = J(_) ? Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) < 0 ? 0 : Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) : _, C = J(G) ? Math.min(...o.filter((i) => !J(i.position)).map((i) => i.position)) >= 0 ? 0 : Math.min(...o.filter((i) => !J(i.position)).map((i) => i.position)) : G, z =
|
|
70
|
+
}).reverse(), ri = J(_) ? Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) < 0 ? 0 : Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) : _, C = J(G) ? Math.min(...o.filter((i) => !J(i.position)).map((i) => i.position)) >= 0 ? 0 : Math.min(...o.filter((i) => !J(i.position)).map((i) => i.position)) : G, z = wi().domain([C, ri]).range([0, V]).nice(), li = Ni(w, V);
|
|
71
71
|
return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
72
72
|
/* @__PURE__ */ r.jsx(
|
|
73
73
|
ai.svg,
|
|
@@ -458,7 +458,7 @@ function Si(P) {
|
|
|
458
458
|
dimmedOpacity: T,
|
|
459
459
|
precision: B,
|
|
460
460
|
customLayers: M
|
|
461
|
-
} = P, q = si(null), D =
|
|
461
|
+
} = P, q = si(null), D = Oi(q, {
|
|
462
462
|
once: w.once,
|
|
463
463
|
amount: w.amount
|
|
464
464
|
}), [H, x] = E(void 0), [f, A] = E(void 0), [U, L] = E(void 0), [u, g] = E(void 0), O = {
|
|
@@ -469,7 +469,7 @@ function Si(P) {
|
|
|
469
469
|
}, V = d - O.left - O.right, W = p - O.top - O.bottom, oi = o.map((i, t) => ({ ...i, id: `${t}` })), ei = mi(oi, (i) => {
|
|
470
470
|
const t = (a || []).indexOf(i.label);
|
|
471
471
|
return t === -1 ? 1 / 0 : t;
|
|
472
|
-
}).reverse(), ri = J(_) ? Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) < 0 ? 0 : Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) : _, C = J(G) ? Math.min(...o.filter((i) => !J(i.position)).map((i) => i.position)) >= 0 ? 0 : Math.min(...o.filter((i) => !J(i.position)).map((i) => i.position)) : G, z =
|
|
472
|
+
}).reverse(), ri = J(_) ? Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) < 0 ? 0 : Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) : _, C = J(G) ? Math.min(...o.filter((i) => !J(i.position)).map((i) => i.position)) >= 0 ? 0 : Math.min(...o.filter((i) => !J(i.position)).map((i) => i.position)) : G, z = wi().domain([C, ri]).range([W, 0]).nice(), li = Ni(K, W);
|
|
473
473
|
return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
474
474
|
/* @__PURE__ */ r.jsx(
|
|
475
475
|
ai.svg,
|