@undp/data-viz 1.4.1 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +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.d.ts +4 -7
- package/dist/GriddedGraphs.js +4 -4
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +4 -7
- 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.d.ts +4 -7
- package/dist/MultiGraphDashboard.js +3 -3
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +4 -7
- 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.d.ts +4 -7
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +4 -7
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +4 -7
- 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.d.ts +4 -7
- 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.d.ts +4 -7
- package/dist/SingleGraphDashboard.js +4 -4
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +4 -7
- package/dist/SingleGraphDashboardFromConfig.js +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +4 -7
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +4 -7
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +4 -7
- package/dist/SingleGraphDashboardThreeDGraphs.js +30 -27
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +4 -7
- 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.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +11 -2
- package/dist/ThreeDGlobe.js +278 -253
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +4 -4
- package/dist/Types.d.ts +4 -7
- 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.d.ts +15 -9
- 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/ScatterPlot.js
CHANGED
|
@@ -6,26 +6,26 @@ import { s as We, g as Fe, x as Ee } from "./getSliderMarks-C0jptXeP.js";
|
|
|
6
6
|
import { i as $e } from "./index-27yTRcko.js";
|
|
7
7
|
import { o as Ge } from "./index-BLizQDlg.js";
|
|
8
8
|
import { l as qe, a as Be } from "./simple-statistics-flVzqVtt.js";
|
|
9
|
-
import { X as ze } from "./Modal-
|
|
9
|
+
import { X as ze } from "./Modal-DVVwpKhP.js";
|
|
10
10
|
import { T as Ue } from "./Tooltip-DyM5snqx.js";
|
|
11
11
|
import { c } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
12
12
|
import { Colors as N } from "./Colors.js";
|
|
13
13
|
import { n as Te } from "./numberFormattingFunction-14YCbkN2.js";
|
|
14
|
-
import { C as _e, g as Je, A as Ke } from "./customArea-
|
|
14
|
+
import { C as _e, g as Je, A as Ke } from "./customArea-B-dWU0zZ.js";
|
|
15
15
|
import { s as Qe } from "./string2HTML-CWHGfz_d.js";
|
|
16
16
|
import { A as Pe } from "./Axis-Ddg-seDi.js";
|
|
17
17
|
import { A as Xe } from "./AxisTitle-BmHLMRJZ.js";
|
|
18
18
|
import { X as Ze } from "./XTicksAndGridLines-Bn9u5gOM.js";
|
|
19
|
-
import { a as ei, R as ii } from "./ReferenceLine-
|
|
20
|
-
import { R as ti } from "./RegressionLine-
|
|
19
|
+
import { a as ei, R as ii } from "./ReferenceLine-CfAW3vKJ.js";
|
|
20
|
+
import { R as ti } from "./RegressionLine-mH7UKOPi.js";
|
|
21
21
|
import { Y as oi } from "./YTicksAndGridLines-B6ah7CRf.js";
|
|
22
|
-
import { a as ai } from "./index-
|
|
23
|
-
import {
|
|
24
|
-
import { s as li } from "./pow-e8zx3AQJ.js";
|
|
22
|
+
import { a as ai } from "./index-Cdcfp4nk.js";
|
|
23
|
+
import { s as ri } from "./pow-e8zx3AQJ.js";
|
|
25
24
|
import { a as Ye } from "./linear-DUdu7l2G.js";
|
|
26
|
-
import { D as
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
25
|
+
import { D as li } from "./delaunay-C1uAf38t.js";
|
|
26
|
+
import { u as si } from "./use-in-view-yS6jzJAp.js";
|
|
27
|
+
import { m as te } from "./proxy-CkpFesk1.js";
|
|
28
|
+
import { A as Ie } from "./index-CNvov0eg.js";
|
|
29
29
|
import { GraphFooter as ni } from "./GraphFooter.js";
|
|
30
30
|
import { GraphHeader as ci } from "./GraphHeader.js";
|
|
31
31
|
import { ColorLegendWithMouseOver as xi } from "./ColorLegendWithMouseOver.js";
|
|
@@ -80,7 +80,7 @@ function yi(ye) {
|
|
|
80
80
|
dimmedOpacity: k,
|
|
81
81
|
precision: S,
|
|
82
82
|
customLayers: fe
|
|
83
|
-
} = ye, ue = Se(null), p =
|
|
83
|
+
} = ye, ue = Se(null), p = si(ue, {
|
|
84
84
|
once: l.once,
|
|
85
85
|
amount: l.amount
|
|
86
86
|
}), [X, Y] = V(void 0), [I, W] = V(void 0), [ge, R] = V(void 0), [he, v] = V(void 0), h = {
|
|
@@ -88,11 +88,11 @@ function yi(ye) {
|
|
|
88
88
|
bottom: g ? ae + 50 : ae,
|
|
89
89
|
left: J ? q + 30 : q,
|
|
90
90
|
right: de
|
|
91
|
-
}, _ = o.map((e, d) => ({ ...e, id: `${d}` })), y = L - h.left - h.right, b = D - h.top - h.bottom, C = o.filter((e) => e.radius === void 0 || e.radius === null).length !== o.length ?
|
|
91
|
+
}, _ = o.map((e, d) => ({ ...e, id: `${d}` })), y = L - h.left - h.right, b = D - h.top - h.bottom, C = o.filter((e) => e.radius === void 0 || e.radius === null).length !== o.length ? ri().domain([0, Ce]).range([0.25, O]).nice() : void 0, u = _.filter((e) => !c(e.radius)).length === 0 ? _ : Ge(
|
|
92
92
|
_.filter((e) => !c(e.radius)),
|
|
93
93
|
"radius",
|
|
94
94
|
"desc"
|
|
95
|
-
), r = Ye().domain([j, z]).range([0, y]).nice(), n = Ye().domain([A, we]).range([b, 0]).nice(), ee = r.ticks(le), ie = n.ticks(se), F =
|
|
95
|
+
), r = Ye().domain([j, z]).range([0, y]).nice(), n = Ye().domain([A, we]).range([b, 0]).nice(), ee = r.ticks(le), ie = n.ticks(se), F = li.from(
|
|
96
96
|
u.filter((e) => !c(e.x) && !c(e.y)),
|
|
97
97
|
(e) => r(e.x),
|
|
98
98
|
(e) => n(e.y)
|
package/dist/ScrollStory.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),x=require("react"),d=require("./SingleGraphDashboard.cjs"),y=require("./proxy-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),x=require("react"),d=require("./SingleGraphDashboard.cjs"),y=require("./proxy-BHRoeZgd.cjs"),m=require("./use-in-view-sQJZ_xDO.cjs");function S(o){const{chapters:l,visibilityThreshold:u=.5,mode:n="overlay",infoWidth:a="320px",infoPosition:s="left",infoBackgroundColor:h="rgba(255,255,255,0.8)"}=o,[i,c]=x.useState(0),e=[];return l.forEach((t,p)=>{t.sections.forEach((g,f)=>{e.push({chapter:p,dataSettings:t.dataSettings,section:f,graphType:t.graphType,infoBox:g.infoBox,graphSettings:{...t.graphSettings,...g.graphSettings||{},animate:!0},graphDataConfiguration:g.graphDataConfiguration||t.graphDataConfiguration||[]})})}),r.jsxRuntimeExports.jsxs("div",{className:"relative w-full h-full",children:[r.jsxRuntimeExports.jsx(y.motion.div,{className:"fixed top-0 h-full -z-10",initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},style:{left:n==="overlay"||s==="right"?0:a,width:n==="overlay"?"100%":`calc(100% - ${a})`},children:r.jsxRuntimeExports.jsx(d.SingleGraphDashboard,{graphType:e[i].graphType,dataSettings:e[i].dataSettings,graphSettings:e[i].graphSettings,graphDataConfiguration:e[i].graphDataConfiguration})},e[i].chapter),r.jsxRuntimeExports.jsx("div",{children:e.map((t,p)=>r.jsxRuntimeExports.jsx(j,{width:a,index:p,infoBox:t.infoBox,setActiveIndex:c,position:s,mode:n,visibilityThreshold:u,backgroundColor:h},`${t.chapter}-${t.section}`))})]})}function j({infoBox:o,index:l,setActiveIndex:u,position:n,mode:a,visibilityThreshold:s,backgroundColor:h,width:i}){const c=x.useRef(null);return m.useInView(c,{once:!1,amount:s})&&u(l),r.jsxRuntimeExports.jsx("section",{ref:c,className:`min-h-screen flex ${n==="center"?"justify-center":n==="right"?"justify-end":"justify-start"}`,children:r.jsxRuntimeExports.jsxs("div",{className:`p-8 ${a==="overlay"?"h-fit mx-10 ":""}`,style:{backgroundColor:h,width:i},children:[o.title,o.description]})})}exports.ScrollStory=S;
|
|
2
2
|
//# sourceMappingURL=ScrollStory.cjs.map
|
package/dist/ScrollStory.d.ts
CHANGED
|
@@ -365,7 +365,7 @@ declare interface GraphSettingsDataType {
|
|
|
365
365
|
labelsToBeHidden?: (string | number)[];
|
|
366
366
|
autoRotate?: boolean;
|
|
367
367
|
enableZoom?: boolean;
|
|
368
|
-
globeMaterial?:
|
|
368
|
+
globeMaterial?: any;
|
|
369
369
|
categorical?: boolean;
|
|
370
370
|
atmosphereColor?: string;
|
|
371
371
|
lineAxisTitle?: string;
|
|
@@ -373,6 +373,9 @@ declare interface GraphSettingsDataType {
|
|
|
373
373
|
naLabel?: string;
|
|
374
374
|
globeOffset?: [number, number];
|
|
375
375
|
polygonAltitude?: number;
|
|
376
|
+
atmosphereAltitude?: number;
|
|
377
|
+
globeCurvatureResolution?: number;
|
|
378
|
+
lightColor?: string;
|
|
376
379
|
}
|
|
377
380
|
|
|
378
381
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -409,12 +412,6 @@ declare interface MapLegendDataType {
|
|
|
409
412
|
|
|
410
413
|
declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
|
|
411
414
|
|
|
412
|
-
declare interface MaterialDataType {
|
|
413
|
-
color: string;
|
|
414
|
-
opacity: number;
|
|
415
|
-
transparent: boolean;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
415
|
declare interface Props {
|
|
419
416
|
/** Defines if the information is shown as overlay or on the side */
|
|
420
417
|
mode?: 'overlay' | 'side';
|
package/dist/ScrollStory.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as e } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
2
|
import { useState as d, useRef as m } from "react";
|
|
3
3
|
import { SingleGraphDashboard as x } from "./SingleGraphDashboard.js";
|
|
4
|
-
import { m as y } from "./proxy-
|
|
5
|
-
import { u as S } from "./use-in-view-
|
|
4
|
+
import { m as y } from "./proxy-CkpFesk1.js";
|
|
5
|
+
import { u as S } from "./use-in-view-yS6jzJAp.js";
|
|
6
6
|
function T(o) {
|
|
7
7
|
const {
|
|
8
8
|
chapters: l,
|
package/dist/SimpleLineChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),h=require("react"),x=require("./parse-hMnG_lRV.cjs"),Ce=require("./index-BzeLQvXk.cjs"),Re=require("./simple-statistics-xm8c0LQQ.cjs"),Ee=require("./numberFormattingFunction-02t-wJta.cjs"),Oe=require("./Tooltip-n8z5bfav.cjs"),S=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),fe=require("./customArea-BYNyxAkm.cjs"),Le=require("./Axis-DE7dSn1_.cjs"),Ne=require("./AxisTitle-CK9YeovX.cjs"),ke=require("./XTicksAndGridLines-CCzXIV8d.cjs"),Se=require("./ReferenceLine-CuFMk0cI.cjs"),De=require("./RegressionLine-7_rKTHN_.cjs"),qe=require("./YTicksAndGridLines-DBDuz6vb.cjs"),$e=require("./index-CylX-pWB.cjs"),Te=require("./use-in-view-BCmzDU2O.cjs"),Ie=require("./time-Byw_jYQ7.cjs"),Me=require("./linear-BVckp9RD.cjs"),be=require("./line-DHV4JwCR.cjs"),ne=require("./step-BZ3C8QFW.cjs"),Ve=require("./select-Bnfk0lJx.cjs"),F=require("./proxy-PQd2AItT.cjs"),Fe=require("./init-DU0ybBc_.cjs"),He=require("./pointer-Dkq5NV1q.cjs"),Ge=require("./GraphFooter.cjs"),Pe=require("./GraphHeader.cjs"),We=require("./Colors.cjs"),Ye=require("./EmptyState-d8_8SxeW.cjs");function Xe(re){const{data:O,width:b,height:$,lineColor:H,suffix:L,prefix:D,dateFormat:r,highlightAreaSettings:q,showValues:u,noOfXTicks:G,rightMargin:oe,leftMargin:j,topMargin:ae,bottomMargin:P,tooltip:v,onSeriesMouseOver:T,refValues:W,minValue:Y,maxValue:X,animate:s,rtl:U,strokeWidth:le,showDots:ce,annotations:xe,customHighlightAreaSettings:ue,regressionLine:I,yAxisTitle:B,noOfYTicks:me,maxDate:M,minDate:V,curveType:N,styles:a,classNames:m,precision:w,customLayers:z}=re,J=h.useRef(null),d=Te.useInView(J,{once:s.once,amount:s.amount}),[A,pe]=h.useState(!1);h.useEffect(()=>{if(d&&!A){const e=setTimeout(()=>{pe(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[d,A,s.duration]);const he=N==="linear"?be.curveLinear:N==="step"?ne.curveStep:N==="stepAfter"?ne.stepAfter:N==="stepBefore"?ne.stepBefore:ne.monotoneX,[k,K]=h.useState(void 0),[Q,Z]=h.useState(void 0),[R,E]=h.useState(void 0),f={top:ae,bottom:P,left:B?j+30:j,right:oe},_=h.useRef(null),i=Ce.sortBy(O.map(e=>({...e,date:x.parse(`${e.date}`,r,new Date)})),"date"),ee=q.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:x.parse(`${e.coordinates[0]}`,r,new Date),e.coordinates[1]===null?null:x.parse(`${e.coordinates[1]}`,r,new Date)]})),te=ue.map(e=>({...e,coordinates:e.coordinates.map((y,C)=>C%2===0?x.parse(`${y}`,r,new Date):y)})),l=b-f.left-f.right,p=$-f.top-f.bottom,ie=V?x.parse(`${V}`,r,new Date):i[0].date,c=M?x.parse(`${M}`,r,new Date):i[i.length-1].date,g=S.checkIfNullOrUndefined(Y)?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:Y,de=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,n=Ie.time().domain([ie,c]).range([0,l]),o=Me.linear().domain([g,S.checkIfNullOrUndefined(X)?de>0?de:0:X]).range([p,0]).nice(),ye=be.line().x(e=>n(e.date)).y(e=>o(e.y)).curve(he),je=o.ticks(me),ve=n.ticks(G);h.useEffect(()=>{const e=C=>{const se=i[Fe.bisectCenter(i.map(ge=>ge.date),n.invert(He.pointer(C)[0]),1)];K(se||i[i.length-1]),T?.(se||i[i.length-1]),E(C.clientY),Z(C.clientX)},y=()=>{K(void 0),Z(void 0),E(void 0),T?.(void 0)};Ve.select(_.current).on("mousemove",e).on("mouseout",y)},[n,i,T]);const Ae=Re.linearRegression(i.filter(e=>!S.checkIfNullOrUndefined(e.date)&&!S.checkIfNullOrUndefined(e.y)).map(e=>[n(e.date),o(e.y)])),we=Re.linearRegressionLine(Ae);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(F.motion.svg,{width:`${b}px`,height:`${$}px`,viewBox:`0 0 ${b} ${$}`,direction:"ltr",ref:J,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${f.left},${f.top})`,children:[t.jsxRuntimeExports.jsx($e.HighlightArea,{areaSettings:ee,width:l,height:p,scale:n,animate:s,isInView:d}),t.jsxRuntimeExports.jsx(fe.CustomArea,{areaSettings:te,scaleX:n,scaleY:o,animate:s,isInView:d}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(qe.YTicksAndGridLines,{values:je.filter(e=>e!==0),y:je.filter(e=>e!==0).map(e=>o(e)),x1:0-j,x2:l+f.right,styles:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},classNames:{gridLines:m?.yAxis?.gridLines,labels:m?.yAxis?.labels},suffix:L,prefix:D,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:w}),t.jsxRuntimeExports.jsx(Le.Axis,{y1:o(g<0?0:g),y2:o(g<0?0:g),x1:0-j,x2:l+f.right,label:Ee.numberFormattingFunction(g<0?0:g,"NA",w,D,L),labelPos:{x:0-j,y:o(g<0?0:g),dx:0,dy:de<0?"1em":-5},classNames:{axis:m?.xAxis?.axis,label:m?.yAxis?.labels},styles:{axis:a?.xAxis?.axis,label:a?.yAxis?.labels}}),t.jsxRuntimeExports.jsx(Ne.AxisTitle,{x:0-j-15,y:p/2,style:a?.yAxis?.title,className:m?.yAxis?.title,text:B,rotate90:!0})]}),t.jsxRuntimeExports.jsx(ke.XTicksAndGridLines,{values:ve.map(e=>x.format(e,r)),x:ve.map(e=>n(e)),y1:0,y2:p,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",m?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",m?.xAxis?.labels)},suffix:L,prefix:D,labelType:"primary",showGridLines:!0,precision:w}),z.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(F.motion.path,{style:{stroke:H,fill:"none",strokeWidth:le},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:ye(i)||"",opacity:1},whileInView:{pathLength:1,d:ye(i)||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),k?t.jsxRuntimeExports.jsx("line",{y1:0,y2:p,x1:n(k.date),x2:n(k.date),className:t.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",m?.mouseOverLine),style:a?.mouseOverLine}):null]}),t.jsxRuntimeExports.jsx("g",{children:i.map((e,y)=>t.jsxRuntimeExports.jsx(F.motion.g,{children:S.checkIfNullOrUndefined(e.y)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[ce?t.jsxRuntimeExports.jsx(F.motion.circle,{r:l/i.length<5?0:l/i.length<20?2:4,style:{fill:H},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:n(e.date),cy:o(e.y)},whileInView:{opacity:1,transition:{duration:A?s.duration:.5,delay:A?0:s.duration},cx:n(e.date),cy:o(e.y)}},initial:"initial",animate:d?"whileInView":"initial"}):null,u?t.jsxRuntimeExports.jsx(F.motion.text,{dy:-8,style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:t.mo("graph-value text-xs font-bold",m?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:n(e.date),y:o(e.y)},whileInView:{opacity:1,x:n(e.date),y:o(e.y),transition:{duration:A?s.duration:.5,delay:A?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:Ee.numberFormattingFunction(e.y,"NA",w,D,L)}):null]})},y))}),W?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:W.map((e,y)=>t.jsxRuntimeExports.jsx(Se.RefLineY,{text:e.text,color:e.color,y:o(e.value),x1:0-j,x2:l+f.right,classNames:e.classNames,styles:e.styles,animate:s,isInView:d},y))}):null,t.jsxRuntimeExports.jsx("g",{children:xe.map((e,y)=>{const C=fe.getLineEndPoint({x:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date)):0,y:e.yCoordinate?o(e.yCoordinate):0},S.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),se=e.showConnector?{y1:C.y,x1:C.x,y2:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?o(e.yCoordinate):0,cx:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date)):0,circleRadius:S.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,ge={y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:U?0:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:U?e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0):l-(e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return t.jsxRuntimeExports.jsx(fe.Annotation,{color:e.color,connectorsSettings:se,labelSettings:ge,text:e.text,classNames:e.classNames,styles:e.styles,animate:s,isInView:d},y)})}),t.jsxRuntimeExports.jsx("g",{children:I?t.jsxRuntimeExports.jsx(De.RegressionLine,{x1:0,x2:l,y1:we(0),y2:we(l),graphHeight:p,graphWidth:l,className:m?.regLine,style:a?.regLine,color:typeof I=="string"?I:void 0,animate:s,isInView:d}):null}),z.filter(e=>e.position==="after").map(e=>e.layer),t.jsxRuntimeExports.jsx("rect",{ref:_,style:{fill:"none",pointerEvents:"all"},width:l,height:p})]})}),k&&v&&Q&&R?t.jsxRuntimeExports.jsx(Oe.Tooltip,{data:k,body:v,xPos:Q,yPos:R,backgroundStyle:a?.tooltip,className:m?.tooltip}):null]})}function Ue(re){const{data:O,graphTitle:b,lineColor:$,suffix:H="",sources:L,prefix:D="",graphDescription:r,height:q,width:u,footNote:G,noOfXTicks:oe=10,dateFormat:j="yyyy",showValues:ae=!1,padding:P,backgroundColor:v=!1,leftMargin:T=30,rightMargin:W=30,topMargin:Y=20,bottomMargin:X=25,relativeHeight:s,tooltip:U,onSeriesMouseOver:le,highlightAreaSettings:ce=[],graphID:xe,minValue:ue,maxValue:I,maxDate:B,minDate:me,graphDownload:M=!1,dataDownload:V=!1,animate:N=!1,language:a="en",refValues:m=[],minHeight:w=0,strokeWidth:z=2,showDots:J=!0,annotations:d=[],customHighlightAreaSettings:A=[],theme:pe="light",ariaLabel:he,regressionLine:k=!1,yAxisTitle:K,noOfYTicks:Q=5,curveType:Z="curve",styles:R,classNames:E,precision:f=2,customLayers:_=[]}=re,[i,ee]=h.useState(0),[te,l]=h.useState(0),p=h.useRef(null),ie=h.useRef(null);return h.useEffect(()=>{const c=new ResizeObserver(g=>{ee(u||g[0].target.clientWidth||620),l(q||g[0].target.clientHeight||480)});return p.current&&(l(p.current.clientHeight||480),ee(p.current.clientWidth||620),u||c.observe(p.current)),()=>c.disconnect()},[u,q]),t.jsxRuntimeExports.jsx("div",{className:`${pe||"light"} flex ${u?"w-fit grow-0":"w-full grow"}`,dir:a==="he"||a==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${a||"en"}`,E?.graphContainer),style:{...R?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:xe,ref:ie,"aria-label":he||`${b?`The graph shows ${b}. `:""}This is a line chart that shows trends over time.${r?` ${r}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:v?P||"1rem":P||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[b||r||M||V?t.jsxRuntimeExports.jsx(Pe.GraphHeader,{styles:{title:R?.title,description:R?.description},classNames:{title:E?.title,description:E?.description},graphTitle:b,graphDescription:r,width:u,graphDownload:M?ie.current:void 0,dataDownload:V?O.map(c=>c.data).filter(c=>c!==void 0).length>0?O.map(c=>c.data).filter(c=>c!==void 0):O.filter(c=>c!==void 0):null}):null,O.length===0?t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:t.jsxRuntimeExports.jsx(Ye.EmptyState,{})}):t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:p,"aria-label":"Graph area",children:(u||i)&&(q||te)?t.jsxRuntimeExports.jsx(Xe,{data:O,lineColor:$||We.Colors.primaryColors["blue-600"],width:u||i,height:Math.max(w,q||(s?w?(u||i)*s>w?(u||i)*s:w:(u||i)*s:te)),suffix:H,prefix:D,dateFormat:j,showValues:ae,noOfXTicks:oe,leftMargin:T,rightMargin:W,topMargin:Y,bottomMargin:X,tooltip:U,highlightAreaSettings:ce,onSeriesMouseOver:le,refValues:m,minValue:ue,maxValue:I,animate:N===!0?{duration:.5,once:!0,amount:.5}:N||{duration:0,once:!0,amount:0},rtl:a==="he"||a==="ar",strokeWidth:z,showDots:J,annotations:d,customHighlightAreaSettings:A,regressionLine:k,yAxisTitle:K,noOfYTicks:Q,maxDate:B,minDate:me,curveType:Z,styles:R,classNames:E,precision:f,customLayers:_}):null}),L||G?t.jsxRuntimeExports.jsx(Ge.GraphFooter,{styles:{footnote:R?.footnote,source:R?.source},classNames:{footnote:E?.footnote,source:E?.source},sources:L,footNote:G,width:u}):null]})})})})}exports.SimpleLineChart=Ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),h=require("react"),x=require("./parse-hMnG_lRV.cjs"),Ce=require("./index-BzeLQvXk.cjs"),Re=require("./simple-statistics-xm8c0LQQ.cjs"),Ee=require("./numberFormattingFunction-02t-wJta.cjs"),Oe=require("./Tooltip-n8z5bfav.cjs"),S=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),fe=require("./customArea-CK768gCn.cjs"),Le=require("./Axis-DE7dSn1_.cjs"),Ne=require("./AxisTitle-CK9YeovX.cjs"),ke=require("./XTicksAndGridLines-CCzXIV8d.cjs"),Se=require("./ReferenceLine-CFVBBN__.cjs"),De=require("./RegressionLine-xKdiJ8sw.cjs"),qe=require("./YTicksAndGridLines-DBDuz6vb.cjs"),$e=require("./index-DNj994Pv.cjs"),Te=require("./time-Byw_jYQ7.cjs"),Ie=require("./linear-BVckp9RD.cjs"),be=require("./line-DHV4JwCR.cjs"),ne=require("./step-BZ3C8QFW.cjs"),Me=require("./select-Bnfk0lJx.cjs"),Ve=require("./init-DU0ybBc_.cjs"),Fe=require("./pointer-Dkq5NV1q.cjs"),He=require("./use-in-view-sQJZ_xDO.cjs"),F=require("./proxy-BHRoeZgd.cjs"),Ge=require("./GraphFooter.cjs"),Pe=require("./GraphHeader.cjs"),We=require("./Colors.cjs"),Ye=require("./EmptyState-d8_8SxeW.cjs");function Xe(re){const{data:O,width:b,height:$,lineColor:H,suffix:L,prefix:D,dateFormat:r,highlightAreaSettings:q,showValues:u,noOfXTicks:G,rightMargin:oe,leftMargin:j,topMargin:ae,bottomMargin:P,tooltip:v,onSeriesMouseOver:T,refValues:W,minValue:Y,maxValue:X,animate:s,rtl:U,strokeWidth:le,showDots:ce,annotations:xe,customHighlightAreaSettings:ue,regressionLine:I,yAxisTitle:B,noOfYTicks:me,maxDate:M,minDate:V,curveType:N,styles:a,classNames:m,precision:w,customLayers:z}=re,J=h.useRef(null),d=He.useInView(J,{once:s.once,amount:s.amount}),[A,pe]=h.useState(!1);h.useEffect(()=>{if(d&&!A){const e=setTimeout(()=>{pe(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[d,A,s.duration]);const he=N==="linear"?be.curveLinear:N==="step"?ne.curveStep:N==="stepAfter"?ne.stepAfter:N==="stepBefore"?ne.stepBefore:ne.monotoneX,[k,K]=h.useState(void 0),[Q,Z]=h.useState(void 0),[R,E]=h.useState(void 0),f={top:ae,bottom:P,left:B?j+30:j,right:oe},_=h.useRef(null),i=Ce.sortBy(O.map(e=>({...e,date:x.parse(`${e.date}`,r,new Date)})),"date"),ee=q.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:x.parse(`${e.coordinates[0]}`,r,new Date),e.coordinates[1]===null?null:x.parse(`${e.coordinates[1]}`,r,new Date)]})),te=ue.map(e=>({...e,coordinates:e.coordinates.map((y,C)=>C%2===0?x.parse(`${y}`,r,new Date):y)})),l=b-f.left-f.right,p=$-f.top-f.bottom,ie=V?x.parse(`${V}`,r,new Date):i[0].date,c=M?x.parse(`${M}`,r,new Date):i[i.length-1].date,g=S.checkIfNullOrUndefined(Y)?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:Y,de=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,n=Te.time().domain([ie,c]).range([0,l]),o=Ie.linear().domain([g,S.checkIfNullOrUndefined(X)?de>0?de:0:X]).range([p,0]).nice(),ye=be.line().x(e=>n(e.date)).y(e=>o(e.y)).curve(he),je=o.ticks(me),ve=n.ticks(G);h.useEffect(()=>{const e=C=>{const se=i[Ve.bisectCenter(i.map(ge=>ge.date),n.invert(Fe.pointer(C)[0]),1)];K(se||i[i.length-1]),T?.(se||i[i.length-1]),E(C.clientY),Z(C.clientX)},y=()=>{K(void 0),Z(void 0),E(void 0),T?.(void 0)};Me.select(_.current).on("mousemove",e).on("mouseout",y)},[n,i,T]);const Ae=Re.linearRegression(i.filter(e=>!S.checkIfNullOrUndefined(e.date)&&!S.checkIfNullOrUndefined(e.y)).map(e=>[n(e.date),o(e.y)])),we=Re.linearRegressionLine(Ae);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(F.motion.svg,{width:`${b}px`,height:`${$}px`,viewBox:`0 0 ${b} ${$}`,direction:"ltr",ref:J,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${f.left},${f.top})`,children:[t.jsxRuntimeExports.jsx($e.HighlightArea,{areaSettings:ee,width:l,height:p,scale:n,animate:s,isInView:d}),t.jsxRuntimeExports.jsx(fe.CustomArea,{areaSettings:te,scaleX:n,scaleY:o,animate:s,isInView:d}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(qe.YTicksAndGridLines,{values:je.filter(e=>e!==0),y:je.filter(e=>e!==0).map(e=>o(e)),x1:0-j,x2:l+f.right,styles:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},classNames:{gridLines:m?.yAxis?.gridLines,labels:m?.yAxis?.labels},suffix:L,prefix:D,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:w}),t.jsxRuntimeExports.jsx(Le.Axis,{y1:o(g<0?0:g),y2:o(g<0?0:g),x1:0-j,x2:l+f.right,label:Ee.numberFormattingFunction(g<0?0:g,"NA",w,D,L),labelPos:{x:0-j,y:o(g<0?0:g),dx:0,dy:de<0?"1em":-5},classNames:{axis:m?.xAxis?.axis,label:m?.yAxis?.labels},styles:{axis:a?.xAxis?.axis,label:a?.yAxis?.labels}}),t.jsxRuntimeExports.jsx(Ne.AxisTitle,{x:0-j-15,y:p/2,style:a?.yAxis?.title,className:m?.yAxis?.title,text:B,rotate90:!0})]}),t.jsxRuntimeExports.jsx(ke.XTicksAndGridLines,{values:ve.map(e=>x.format(e,r)),x:ve.map(e=>n(e)),y1:0,y2:p,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",m?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",m?.xAxis?.labels)},suffix:L,prefix:D,labelType:"primary",showGridLines:!0,precision:w}),z.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(F.motion.path,{style:{stroke:H,fill:"none",strokeWidth:le},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:ye(i)||"",opacity:1},whileInView:{pathLength:1,d:ye(i)||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),k?t.jsxRuntimeExports.jsx("line",{y1:0,y2:p,x1:n(k.date),x2:n(k.date),className:t.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",m?.mouseOverLine),style:a?.mouseOverLine}):null]}),t.jsxRuntimeExports.jsx("g",{children:i.map((e,y)=>t.jsxRuntimeExports.jsx(F.motion.g,{children:S.checkIfNullOrUndefined(e.y)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[ce?t.jsxRuntimeExports.jsx(F.motion.circle,{r:l/i.length<5?0:l/i.length<20?2:4,style:{fill:H},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:n(e.date),cy:o(e.y)},whileInView:{opacity:1,transition:{duration:A?s.duration:.5,delay:A?0:s.duration},cx:n(e.date),cy:o(e.y)}},initial:"initial",animate:d?"whileInView":"initial"}):null,u?t.jsxRuntimeExports.jsx(F.motion.text,{dy:-8,style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:t.mo("graph-value text-xs font-bold",m?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:n(e.date),y:o(e.y)},whileInView:{opacity:1,x:n(e.date),y:o(e.y),transition:{duration:A?s.duration:.5,delay:A?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:Ee.numberFormattingFunction(e.y,"NA",w,D,L)}):null]})},y))}),W?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:W.map((e,y)=>t.jsxRuntimeExports.jsx(Se.RefLineY,{text:e.text,color:e.color,y:o(e.value),x1:0-j,x2:l+f.right,classNames:e.classNames,styles:e.styles,animate:s,isInView:d},y))}):null,t.jsxRuntimeExports.jsx("g",{children:xe.map((e,y)=>{const C=fe.getLineEndPoint({x:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date)):0,y:e.yCoordinate?o(e.yCoordinate):0},S.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),se=e.showConnector?{y1:C.y,x1:C.x,y2:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?o(e.yCoordinate):0,cx:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date)):0,circleRadius:S.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,ge={y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:U?0:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:U?e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0):l-(e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return t.jsxRuntimeExports.jsx(fe.Annotation,{color:e.color,connectorsSettings:se,labelSettings:ge,text:e.text,classNames:e.classNames,styles:e.styles,animate:s,isInView:d},y)})}),t.jsxRuntimeExports.jsx("g",{children:I?t.jsxRuntimeExports.jsx(De.RegressionLine,{x1:0,x2:l,y1:we(0),y2:we(l),graphHeight:p,graphWidth:l,className:m?.regLine,style:a?.regLine,color:typeof I=="string"?I:void 0,animate:s,isInView:d}):null}),z.filter(e=>e.position==="after").map(e=>e.layer),t.jsxRuntimeExports.jsx("rect",{ref:_,style:{fill:"none",pointerEvents:"all"},width:l,height:p})]})}),k&&v&&Q&&R?t.jsxRuntimeExports.jsx(Oe.Tooltip,{data:k,body:v,xPos:Q,yPos:R,backgroundStyle:a?.tooltip,className:m?.tooltip}):null]})}function Ue(re){const{data:O,graphTitle:b,lineColor:$,suffix:H="",sources:L,prefix:D="",graphDescription:r,height:q,width:u,footNote:G,noOfXTicks:oe=10,dateFormat:j="yyyy",showValues:ae=!1,padding:P,backgroundColor:v=!1,leftMargin:T=30,rightMargin:W=30,topMargin:Y=20,bottomMargin:X=25,relativeHeight:s,tooltip:U,onSeriesMouseOver:le,highlightAreaSettings:ce=[],graphID:xe,minValue:ue,maxValue:I,maxDate:B,minDate:me,graphDownload:M=!1,dataDownload:V=!1,animate:N=!1,language:a="en",refValues:m=[],minHeight:w=0,strokeWidth:z=2,showDots:J=!0,annotations:d=[],customHighlightAreaSettings:A=[],theme:pe="light",ariaLabel:he,regressionLine:k=!1,yAxisTitle:K,noOfYTicks:Q=5,curveType:Z="curve",styles:R,classNames:E,precision:f=2,customLayers:_=[]}=re,[i,ee]=h.useState(0),[te,l]=h.useState(0),p=h.useRef(null),ie=h.useRef(null);return h.useEffect(()=>{const c=new ResizeObserver(g=>{ee(u||g[0].target.clientWidth||620),l(q||g[0].target.clientHeight||480)});return p.current&&(l(p.current.clientHeight||480),ee(p.current.clientWidth||620),u||c.observe(p.current)),()=>c.disconnect()},[u,q]),t.jsxRuntimeExports.jsx("div",{className:`${pe||"light"} flex ${u?"w-fit grow-0":"w-full grow"}`,dir:a==="he"||a==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${a||"en"}`,E?.graphContainer),style:{...R?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:xe,ref:ie,"aria-label":he||`${b?`The graph shows ${b}. `:""}This is a line chart that shows trends over time.${r?` ${r}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:v?P||"1rem":P||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[b||r||M||V?t.jsxRuntimeExports.jsx(Pe.GraphHeader,{styles:{title:R?.title,description:R?.description},classNames:{title:E?.title,description:E?.description},graphTitle:b,graphDescription:r,width:u,graphDownload:M?ie.current:void 0,dataDownload:V?O.map(c=>c.data).filter(c=>c!==void 0).length>0?O.map(c=>c.data).filter(c=>c!==void 0):O.filter(c=>c!==void 0):null}):null,O.length===0?t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:t.jsxRuntimeExports.jsx(Ye.EmptyState,{})}):t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:p,"aria-label":"Graph area",children:(u||i)&&(q||te)?t.jsxRuntimeExports.jsx(Xe,{data:O,lineColor:$||We.Colors.primaryColors["blue-600"],width:u||i,height:Math.max(w,q||(s?w?(u||i)*s>w?(u||i)*s:w:(u||i)*s:te)),suffix:H,prefix:D,dateFormat:j,showValues:ae,noOfXTicks:oe,leftMargin:T,rightMargin:W,topMargin:Y,bottomMargin:X,tooltip:U,highlightAreaSettings:ce,onSeriesMouseOver:le,refValues:m,minValue:ue,maxValue:I,animate:N===!0?{duration:.5,once:!0,amount:.5}:N||{duration:0,once:!0,amount:0},rtl:a==="he"||a==="ar",strokeWidth:z,showDots:J,annotations:d,customHighlightAreaSettings:A,regressionLine:k,yAxisTitle:K,noOfYTicks:Q,maxDate:B,minDate:me,curveType:Z,styles:R,classNames:E,precision:f,customLayers:_}):null}),L||G?t.jsxRuntimeExports.jsx(Ge.GraphFooter,{styles:{footnote:R?.footnote,source:R?.source},classNames:{footnote:E?.footnote,source:E?.source},sources:L,footNote:G,width:u}):null]})})})})}exports.SimpleLineChart=Ue;
|
|
2
2
|
//# sourceMappingURL=SimpleLineChart.cjs.map
|
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
|
|
@@ -413,7 +413,7 @@ declare interface GraphSettingsDataType {
|
|
|
413
413
|
labelsToBeHidden?: (string | number)[];
|
|
414
414
|
autoRotate?: boolean;
|
|
415
415
|
enableZoom?: boolean;
|
|
416
|
-
globeMaterial?:
|
|
416
|
+
globeMaterial?: any;
|
|
417
417
|
categorical?: boolean;
|
|
418
418
|
atmosphereColor?: string;
|
|
419
419
|
lineAxisTitle?: string;
|
|
@@ -421,6 +421,9 @@ declare interface GraphSettingsDataType {
|
|
|
421
421
|
naLabel?: string;
|
|
422
422
|
globeOffset?: [number, number];
|
|
423
423
|
polygonAltitude?: number;
|
|
424
|
+
atmosphereAltitude?: number;
|
|
425
|
+
globeCurvatureResolution?: number;
|
|
426
|
+
lightColor?: string;
|
|
424
427
|
}
|
|
425
428
|
|
|
426
429
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -460,12 +463,6 @@ declare interface MapLegendDataType {
|
|
|
460
463
|
|
|
461
464
|
declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
|
|
462
465
|
|
|
463
|
-
declare interface MaterialDataType {
|
|
464
|
-
color: string;
|
|
465
|
-
opacity: number;
|
|
466
|
-
transparent: boolean;
|
|
467
|
-
}
|
|
468
|
-
|
|
469
466
|
declare interface Props {
|
|
470
467
|
graphSettings?: GraphSettingsDataType;
|
|
471
468
|
readableHeader?: {
|
|
@@ -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
|
|
@@ -436,7 +436,7 @@ declare interface GraphSettingsDataType {
|
|
|
436
436
|
labelsToBeHidden?: (string | number)[];
|
|
437
437
|
autoRotate?: boolean;
|
|
438
438
|
enableZoom?: boolean;
|
|
439
|
-
globeMaterial?:
|
|
439
|
+
globeMaterial?: any;
|
|
440
440
|
categorical?: boolean;
|
|
441
441
|
atmosphereColor?: string;
|
|
442
442
|
lineAxisTitle?: string;
|
|
@@ -444,6 +444,9 @@ declare interface GraphSettingsDataType {
|
|
|
444
444
|
naLabel?: string;
|
|
445
445
|
globeOffset?: [number, number];
|
|
446
446
|
polygonAltitude?: number;
|
|
447
|
+
atmosphereAltitude?: number;
|
|
448
|
+
globeCurvatureResolution?: number;
|
|
449
|
+
lightColor?: string;
|
|
447
450
|
}
|
|
448
451
|
|
|
449
452
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -483,12 +486,6 @@ declare interface MapLegendDataType {
|
|
|
483
486
|
|
|
484
487
|
declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
|
|
485
488
|
|
|
486
|
-
declare interface MaterialDataType {
|
|
487
|
-
color: string;
|
|
488
|
-
opacity: number;
|
|
489
|
-
transparent: boolean;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
489
|
declare interface Props {
|
|
493
490
|
config: string | ConfigObject;
|
|
494
491
|
}
|
|
@@ -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(() => {
|
|
@@ -328,7 +328,7 @@ declare interface GraphSettingsDataType {
|
|
|
328
328
|
labelsToBeHidden?: (string | number)[];
|
|
329
329
|
autoRotate?: boolean;
|
|
330
330
|
enableZoom?: boolean;
|
|
331
|
-
globeMaterial?:
|
|
331
|
+
globeMaterial?: any;
|
|
332
332
|
categorical?: boolean;
|
|
333
333
|
atmosphereColor?: string;
|
|
334
334
|
lineAxisTitle?: string;
|
|
@@ -336,6 +336,9 @@ declare interface GraphSettingsDataType {
|
|
|
336
336
|
naLabel?: string;
|
|
337
337
|
globeOffset?: [number, number];
|
|
338
338
|
polygonAltitude?: number;
|
|
339
|
+
atmosphereAltitude?: number;
|
|
340
|
+
globeCurvatureResolution?: number;
|
|
341
|
+
lightColor?: string;
|
|
339
342
|
}
|
|
340
343
|
|
|
341
344
|
declare interface HighlightAreaSettingsDataType {
|
|
@@ -363,12 +366,6 @@ declare interface MapLegendDataType {
|
|
|
363
366
|
|
|
364
367
|
declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
|
|
365
368
|
|
|
366
|
-
declare interface MaterialDataType {
|
|
367
|
-
color: string;
|
|
368
|
-
opacity: number;
|
|
369
|
-
transparent: boolean;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
369
|
declare interface Props {
|
|
373
370
|
graphSettings?: GraphSettingsDataType;
|
|
374
371
|
graphType: GeoHubGraphType;
|
|
@@ -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
|
|
@@ -335,7 +335,7 @@ declare interface GraphSettingsDataType {
|
|
|
335
335
|
labelsToBeHidden?: (string | number)[];
|
|
336
336
|
autoRotate?: boolean;
|
|
337
337
|
enableZoom?: boolean;
|
|
338
|
-
globeMaterial?:
|
|
338
|
+
globeMaterial?: any;
|
|
339
339
|
categorical?: boolean;
|
|
340
340
|
atmosphereColor?: string;
|
|
341
341
|
lineAxisTitle?: string;
|
|
@@ -343,6 +343,9 @@ declare interface GraphSettingsDataType {
|
|
|
343
343
|
naLabel?: string;
|
|
344
344
|
globeOffset?: [number, number];
|
|
345
345
|
polygonAltitude?: number;
|
|
346
|
+
atmosphereAltitude?: number;
|
|
347
|
+
globeCurvatureResolution?: number;
|
|
348
|
+
lightColor?: string;
|
|
346
349
|
}
|
|
347
350
|
|
|
348
351
|
declare interface HighlightAreaSettingsDataType {
|
|
@@ -370,12 +373,6 @@ declare interface MapLegendDataType {
|
|
|
370
373
|
|
|
371
374
|
declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
|
|
372
375
|
|
|
373
|
-
declare interface MaterialDataType {
|
|
374
|
-
color: string;
|
|
375
|
-
opacity: number;
|
|
376
|
-
transparent: boolean;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
376
|
declare interface Props {
|
|
380
377
|
config: string | ConfigObject;
|
|
381
378
|
}
|
|
@@ -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"),H=require("./index-B0rbzOoC.cjs"),le=require("./index-BXns0-ng.cjs"),x=require("./DropdownSelect-BmE5JaeE.cjs"),c=require("./checkIfMultiple-BXbHUCWM.cjs"),M=require("./Typography-k-kOjICQ.cjs"),re=require("./Spinner-DA6Z5E4n.cjs"),oe=require("./ThreeDGlobe.cjs"),$=require("./fetchAndParseData-CQyVGCul.cjs"),W=require("./transformDataForAggregation-Du-Hei-W.cjs"),B=require("./getUniqValue-CHqgSss5.cjs"),ne=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:o,graphData:p,debugMode:g,graphDataConfiguration:C,readableHeader:n,updateFilters:S}=I;if(g&&(console.log(`Graph: ${o}`),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:oe.ThreeDGlobe},b=d=>{switch(d){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:c.getValues("x",C||[],n||[]),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:A=>{S?.(A.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,atmosphereAltitude:a?.atmosphereAltitude,globeCurvatureResolution:a?.globeCurvatureResolution,lightColor:a?.lightColor};default:return{}}},E=D[o],q=b(o);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: ${o}`})})}const F=(I,a)=>{const o=a?.map(p=>{const g=I?.findIndex(n=>n.chartConfigId===p.chartConfigId);if(g===-1)return{};const C=I[g]?.allowedColumnIds?.findIndex(n=>n.value===p.columnId);return C===-1?{}:I[g].allowedColumnIds[C].graphSettings||{}})||[];return Object.assign({},...o)};function ue(I){const{graphSettings:a,dataSettings:o,filters:p,graphType:g,dataTransform:C,graphDataConfiguration:n,dataFilters:S,debugMode:D,dataSelectionOptions:b,advancedDataSelectionOptions:E,readableHeader:q,noOfFiltersPerRow:d=4,updateFilters:A,uiMode:m="normal",highlightDataPointSettings:v}=I,[j,Q]=i.useState(void 0),[R,X]=i.useState(void 0),[w,y]=i.useState(n),[f,V]=i.useState({}),[k,Y]=i.useState(void 0),[_,ee]=i.useState([]),L=i.useRef(null),z=i.useRef(n),[T,U]=i.useState([]),N=i.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),Z=i.useCallback(async()=>{try{const u=await(o.dataURL?typeof o.dataURL=="string"?o.fileType==="json"?$.fetchAndParseJSON(o.dataURL,o.columnsToArray,o.dataTransformation,D):o.fileType==="api"?$.fetchAndTransformDataFromAPI(o.dataURL,o.apiHeaders,o.columnsToArray,o.dataTransformation,D):$.fetchAndParseCSV(o.dataURL,o.dataTransformation,o.columnsToArray,D,o.delimiter,!0):$.fetchAndParseMultipleDataSources(o.dataURL,o.idColumnTitle):$.transformColumnsToArray(o.data,o.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)}},[o,p,D]);i.useEffect(()=>{Z()},[Z]);const G=i.useMemo(()=>!R||T.length===0?R:R.filter(u=>T.every(t=>t.value&&H.flattenDeep([t.value]).length>0?te.intersection(H.flattenDeep([u[t.filter]]),H.flattenDeep([t.value]).map(l=>l.value)).length>0:!0)),[T,R]);i.useEffect(()=>{b&&V(F(b,n))},[b,n]),i.useEffect(()=>{R&&Q(G)},[G,R]),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,n)||(y(n),z.current=n)},[n]);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,S||[]),C.keyColumn,C.aggregationColumnsSetting):J.filterData(j,S||[]),g,e)},[g,w,j,S,C]);return o?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:[f?.graphTitle||f?.graphDescription||a?.graphTitle||a?.graphDescription||a?.graphDownload||a?.dataDownload?r.jsxRuntimeExports.jsx(ne.GraphHeader,{styles:{title:f?.styles?.title||a?.styles?.title,description:f?.styles?.description||a?.styles?.description},classNames:{title:f?.classNames?.title||a?.classNames?.title,description:f?.classNames?.description||a?.classNames?.description},graphTitle:f?.graphTitle||a?.graphTitle,graphDescription:f?.graphDescription||a?.graphDescription,width:f?.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/d}% - ${(d-1)/d}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(c.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:m,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(c.fe,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:m,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(c.ve,{label:t.label,value:t.label},l))})]},u)),b?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/d}% - ${(d-1)/d}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(c.f,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),c.checkIfMultiple(e.chartConfigId,w||[])?e.ui!=="radio"?r.jsxRuntimeExports.jsx(x.Za,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:m,controlShouldRenderValue:!0,defaultValue:n?n[n.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(c.w,{variant:m,defaultValue:n?n[n.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(c.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:m,controlShouldRenderValue:!0,defaultValue:n?e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===n[n.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(c.fe,{variant:m,defaultValue:n?e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===n[n.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(c.ve,{label:t.label,value:t.label},l))})]},u)),T?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/d}% - ${(d-1)/d}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(c.f,{className:"mb-2",children:e.label}),e.singleSelect?r.jsxRuntimeExports.jsx(x.Za,{options:e.availableValues,variant:m,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:m,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(c.w,{variant:m,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(c.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/d}% - ${(d-1)/d}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(c.f,{className:"mb-2",children:v.label||"Highlight data"}),r.jsxRuntimeExports.jsx(x.Za,{options:_,variant:m,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:A,settings:{...a||{},...f,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
|