@undp/data-viz 1.4.15 → 1.5.0
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 +4 -4
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +8 -8
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +5 -5
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +35 -34
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +5 -5
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +5 -5
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +52 -51
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +3 -3
- package/dist/DataCards.cjs +1 -1
- package/dist/DataCards.js +5 -5
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +3 -3
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +3 -3
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +4 -4
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +39 -38
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +3 -3
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +6 -6
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.js +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.js +3 -3
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +4 -4
- package/dist/{GraphEl-Bz2jatkM.cjs → GraphEl-4RUlclvW.cjs} +2 -2
- package/dist/{GraphEl-Bz2jatkM.cjs.map → GraphEl-4RUlclvW.cjs.map} +1 -1
- package/dist/{GraphEl-zNOHBYrK.js → GraphEl-ClIxlWa3.js} +2 -2
- package/dist/{GraphEl-zNOHBYrK.js.map → GraphEl-ClIxlWa3.js.map} +1 -1
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +58 -1
- package/dist/GriddedGraphs.js +7 -7
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +58 -1
- package/dist/GriddedGraphsFromConfig.js +1 -1
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +4 -4
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +3 -3
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +58 -1
- package/dist/MultiGraphDashboard.js +5 -5
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +58 -1
- package/dist/MultiGraphDashboardFromConfig.js +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +2 -2
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +4 -4
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +3 -3
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +3 -3
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +58 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +5 -5
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +58 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +58 -1
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.js +4 -4
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +6 -6
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +31 -29
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.d.ts +58 -1
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +3 -3
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +58 -1
- package/dist/SingleGraphDashboard.js +8 -8
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +58 -1
- package/dist/SingleGraphDashboardFromConfig.js +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +58 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +58 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +58 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +20 -19
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +58 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.js +4 -4
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +2 -2
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +1 -1
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.js +5 -5
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +61 -6
- package/dist/ThreeDGlobe.js +385 -314
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/{Tooltip-DyM5snqx.js → Tooltip-CVCGWyzw.js} +2 -2
- package/dist/{Tooltip-DyM5snqx.js.map → Tooltip-CVCGWyzw.js.map} +1 -1
- package/dist/{Tooltip-n8z5bfav.cjs → Tooltip-De16GWhY.cjs} +2 -2
- package/dist/{Tooltip-n8z5bfav.cjs.map → Tooltip-De16GWhY.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +3 -3
- package/dist/Types.d.ts +58 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +1 -1
- package/dist/_commonjsHelpers-BH3jXuIh.cjs +2 -0
- package/dist/_commonjsHelpers-BH3jXuIh.cjs.map +1 -0
- package/dist/_commonjsHelpers-ByX85dGu.js +34 -0
- package/dist/_commonjsHelpers-ByX85dGu.js.map +1 -0
- package/dist/{ensureCompleteData-BBDZbDCE.js → ensureCompleteData-BALdOrsS.js} +2 -2
- package/dist/{ensureCompleteData-BBDZbDCE.js.map → ensureCompleteData-BALdOrsS.js.map} +1 -1
- package/dist/{ensureCompleteData-DqWQ2Zbi.cjs → ensureCompleteData-BU5Zlccy.cjs} +2 -2
- package/dist/{ensureCompleteData-DqWQ2Zbi.cjs.map → ensureCompleteData-BU5Zlccy.cjs.map} +1 -1
- package/dist/{fetchAndParseData-4gsYTy6_.js → fetchAndParseData-DBOl1Icl.js} +2 -2
- package/dist/{fetchAndParseData-4gsYTy6_.js.map → fetchAndParseData-DBOl1Icl.js.map} +1 -1
- package/dist/{fetchAndParseData-CQyVGCul.cjs → fetchAndParseData-Dcy7AS_0.cjs} +2 -2
- package/dist/{fetchAndParseData-CQyVGCul.cjs.map → fetchAndParseData-Dcy7AS_0.cjs.map} +1 -1
- package/dist/fetchAndParseData.cjs +1 -1
- package/dist/fetchAndParseData.js +1 -1
- package/dist/{filterData-B8ocT57s.js → filterData-9nEcQ-Jp.js} +3 -3
- package/dist/{filterData-B8ocT57s.js.map → filterData-9nEcQ-Jp.js.map} +1 -1
- package/dist/{filterData-DN6py7y_.cjs → filterData-BoYadk0l.cjs} +2 -2
- package/dist/{filterData-DN6py7y_.cjs.map → filterData-BoYadk0l.cjs.map} +1 -1
- package/dist/{getJenks-VhM3GIoC.js → getJenks-DW96UYNE.js} +2 -2
- package/dist/{getJenks-VhM3GIoC.js.map → getJenks-DW96UYNE.js.map} +1 -1
- package/dist/{getJenks-TWQvbuOz.cjs → getJenks-vofIZmeb.cjs} +2 -2
- package/dist/{getJenks-TWQvbuOz.cjs.map → getJenks-vofIZmeb.cjs.map} +1 -1
- package/dist/{getUniqValue-CHqgSss5.cjs → getUniqValue-CfuE_l9c.cjs} +2 -2
- package/dist/{getUniqValue-CHqgSss5.cjs.map → getUniqValue-CfuE_l9c.cjs.map} +1 -1
- package/dist/{getUniqValue-BtUENB2H.js → getUniqValue-CttuU_wn.js} +4 -4
- package/dist/{getUniqValue-BtUENB2H.js.map → getUniqValue-CttuU_wn.js.map} +1 -1
- package/dist/{index-CaAIPGZo.js → index-AqnpA7_O.js} +2 -2
- package/dist/{index-CaAIPGZo.js.map → index-AqnpA7_O.js.map} +1 -1
- package/dist/{index-CZbIGs8q.cjs → index-BJOeaYTk.cjs} +2 -2
- package/dist/{index-CZbIGs8q.cjs.map → index-BJOeaYTk.cjs.map} +1 -1
- package/dist/{index-Bc5VF70V.js → index-BMgDMxKJ.js} +6 -6
- package/dist/{index-Bc5VF70V.js.map → index-BMgDMxKJ.js.map} +1 -1
- package/dist/{index-B0rbzOoC.cjs → index-BS2TADPj.cjs} +2 -2
- package/dist/{index-B0rbzOoC.cjs.map → index-BS2TADPj.cjs.map} +1 -1
- package/dist/{index-DNj994Pv.cjs → index-BYzIB5V6.cjs} +2 -2
- package/dist/index-BYzIB5V6.cjs.map +1 -0
- package/dist/{index-27yTRcko.js → index-Bwrro8-q.js} +2 -2
- package/dist/{index-27yTRcko.js.map → index-Bwrro8-q.js.map} +1 -1
- package/dist/{index-BczVvEBZ.cjs → index-CQ3e6Ewi.cjs} +2 -2
- package/dist/{index-BczVvEBZ.cjs.map → index-CQ3e6Ewi.cjs.map} +1 -1
- package/dist/{index-C21TvELx.cjs → index-CSNtgibC.cjs} +2 -2
- package/dist/{index-C21TvELx.cjs.map → index-CSNtgibC.cjs.map} +1 -1
- package/dist/{index-D7ltPi18.js → index-CeVNqhMO.js} +2 -2
- package/dist/{index-D7ltPi18.js.map → index-CeVNqhMO.js.map} +1 -1
- package/dist/index-D05lK1Te.cjs +2 -0
- package/dist/index-D05lK1Te.cjs.map +1 -0
- package/dist/{index-Ds0uHjK9.cjs → index-D72cOtq7.cjs} +2 -2
- package/dist/{index-Ds0uHjK9.cjs.map → index-D72cOtq7.cjs.map} +1 -1
- package/dist/{index-Cdcfp4nk.js → index-DKCxu1Gh.js} +2 -2
- package/dist/index-DKCxu1Gh.js.map +1 -0
- package/dist/{index-BXns0-ng.cjs → index-DQA8q5sC.cjs} +2 -2
- package/dist/{index-BXns0-ng.cjs.map → index-DQA8q5sC.cjs.map} +1 -1
- package/dist/{index-BzeLQvXk.cjs → index-DYH8g9WA.cjs} +2 -2
- package/dist/{index-BzeLQvXk.cjs.map → index-DYH8g9WA.cjs.map} +1 -1
- package/dist/{index-BbNoLJ_w.cjs → index-Da2GUKrr.cjs} +2 -2
- package/dist/{index-BbNoLJ_w.cjs.map → index-Da2GUKrr.cjs.map} +1 -1
- package/dist/{index-BLizQDlg.js → index-DvVprvy6.js} +2 -2
- package/dist/{index-BLizQDlg.js.map → index-DvVprvy6.js.map} +1 -1
- package/dist/{index-UV9hjG_S.js → index-EArKRVKg.js} +2 -2
- package/dist/{index-UV9hjG_S.js.map → index-EArKRVKg.js.map} +1 -1
- package/dist/{index-C1rRk_50.js → index-V_JXij1_.js} +2 -2
- package/dist/{index-C1rRk_50.js.map → index-V_JXij1_.js.map} +1 -1
- package/dist/{index-DxagiOHo.js → index-fwdktvAS.js} +2 -2
- package/dist/{index-DxagiOHo.js.map → index-fwdktvAS.js.map} +1 -1
- package/dist/index-qfWCwobm.js +682 -0
- package/dist/index-qfWCwobm.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +63 -7
- package/dist/index.js +6 -6
- package/dist/{string2HTML-CWHGfz_d.js → string2HTML-oFCROsus.js} +2 -2
- package/dist/{string2HTML-CWHGfz_d.js.map → string2HTML-oFCROsus.js.map} +1 -1
- package/dist/{string2HTML-D2Avudmb.cjs → string2HTML-z7CwHXcx.cjs} +2 -2
- package/dist/{string2HTML-D2Avudmb.cjs.map → string2HTML-z7CwHXcx.cjs.map} +1 -1
- package/dist/transformData.cjs +1 -1
- package/dist/transformData.js +3 -3
- package/dist/{transformDataForAggregation-CdcwlnNe.js → transformDataForAggregation-1BYVFqvF.js} +4 -4
- package/dist/{transformDataForAggregation-CdcwlnNe.js.map → transformDataForAggregation-1BYVFqvF.js.map} +1 -1
- package/dist/{transformDataForAggregation-Du-Hei-W.cjs → transformDataForAggregation-BVxVu4yY.cjs} +2 -2
- package/dist/{transformDataForAggregation-Du-Hei-W.cjs.map → transformDataForAggregation-BVxVu4yY.cjs.map} +1 -1
- package/dist/{transformDataForGraphFromFile-BCjsizvb.js → transformDataForGraphFromFile-BC9Ha8hF.js} +3 -3
- package/dist/{transformDataForGraphFromFile-BCjsizvb.js.map → transformDataForGraphFromFile-BC9Ha8hF.js.map} +1 -1
- package/dist/{transformDataForGraphFromFile-B1A0AS-Z.cjs → transformDataForGraphFromFile-b41aNQYY.cjs} +2 -2
- package/dist/{transformDataForGraphFromFile-B1A0AS-Z.cjs.map → transformDataForGraphFromFile-b41aNQYY.cjs.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +2 -2
- package/dist/zoom-Bsbhil-K.cjs +2 -0
- package/dist/zoom-Bsbhil-K.cjs.map +1 -0
- package/dist/zoom-DAu91HKr.js +1864 -0
- package/dist/zoom-DAu91HKr.js.map +1 -0
- package/package.json +2 -2
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -2
- package/dist/_commonjsHelpers-DKOUU3wS.cjs.map +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -9
- package/dist/_commonjsHelpers-DaMA6jEr.js.map +0 -1
- package/dist/index-Cdcfp4nk.js.map +0 -1
- package/dist/index-DNj994Pv.cjs.map +0 -1
- package/dist/zoom-Lo7IAUfC.cjs +0 -2
- package/dist/zoom-Lo7IAUfC.cjs.map +0 -1
- package/dist/zoom-_lqdiGoI.js +0 -1983
- package/dist/zoom-_lqdiGoI.js.map +0 -1
package/dist/GriddedGraphs.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),d=require("react"),ee=require("./index-Ds0uHjK9.cjs"),N=require("./index-B0rbzOoC.cjs"),h=require("./checkIfMultiple-BXbHUCWM.cjs"),ae=require("./Spinner-DA6Z5E4n.cjs"),f=require("./DropdownSelect-DBDM64B5.cjs"),te=require("./GraphEl-Bz2jatkM.cjs"),v=require("./fetchAndParseData-CQyVGCul.cjs"),le=require("./Colors.cjs"),W=require("./transformDataForAggregation-Du-Hei-W.cjs"),Z=require("./getUniqValue-CHqgSss5.cjs"),re=require("./GraphHeader.cjs"),oe=require("./GraphFooter.cjs"),z=require("./filterData-DN6py7y_.cjs"),ne=require("./ColorLegend.cjs"),ie=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),B=require("./transformDataForSelect-YmStusCI.cjs");function se(J){const{graphSettings:a,dataSettings:n,filters:T,graphType:A,dataTransform:D,graphDataConfiguration:s,noOfColumns:E,columnGridBy:I,dataFilters:$,showCommonColorScale:k,minGraphHeight:K,minGraphWidth:q,debugMode:w,dataSelectionOptions:F,advancedDataSelectionOptions:O,readableHeader:Q,noOfFiltersPerRow:g=4,uiMode:p="normal",theme:H="light"}=J,[C,X]=d.useState(void 0),[S,Y]=d.useState(void 0),[b,_]=d.useState([]),M=d.useRef(null),[m,x]=d.useState(s),[j,L]=d.useState([]),[c,R]=d.useState({}),V=d.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),U=d.useMemo(()=>!S||j.length===0?S:S.filter(u=>j.every(t=>t.value&&N.flattenDeep([t.value]).length>0?ee.intersection(N.flattenDeep([u[t.filter]]),N.flattenDeep([t.value]).map(l=>l.value)).length>0:!0)),[j,S]);d.useEffect(()=>{X(U)},[U]);const P=d.useCallback(async()=>{if(n)try{const u=await(n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?v.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,w):n.fileType==="api"?v.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,w):v.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,w,n.delimiter,!0):v.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):v.transformColumnsToArray(n.data,n.columnsToArray));Y(u);const t=Z.getUniqValue(u,I);_(t);const l=(T||[]).map(o=>({filter:o.column,label:o.label||`Filter by ${o.column}`,singleSelect:o.singleSelect,clearable:o.clearable,defaultValue:B.transformDefaultValue(o.defaultValue),value:B.transformDefaultValue(o.defaultValue),availableValues:Z.getUniqValue(u,o.column).filter(i=>!o.excludeValues?.includes(`${i}`)).map(i=>({value:i,label:i})),allowSelectAll:o.allowSelectAll,width:o.width}));L(l)}catch(e){console.error("Data fetching error:",e)}},[n,w,I,T]);d.useEffect(()=>{P()},[P]),d.useEffect(()=>{x(s)},[s]);const G=d.useCallback((e,u)=>{L(t=>t.map(l=>l.filter===e?{...l,value:u}:l))},[]);return r.jsxRuntimeExports.jsx("div",{className:`${H||a?.theme||"light"} flex ${a?.width?"w-fit grow-0":"w-full grow"}`,dir:a?.language==="he"||a?.language==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:`${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"}`,style:{...a?.backgroundColor&&a?.backgroundColor!==!0?{backgroundColor:a?.backgroundColor}:{}},id:a?.graphID,ref:M,"aria-label":a?.ariaLabel||`${a?.graphTitle?`The graph shows ${a?.graphTitle}. `:""}This is a gridded chart.${a?.graphDescription?` ${a?.graphDescription}`:""}`,children:r.jsxRuntimeExports.jsx("div",{style:{padding:a?.backgroundColor?a?.padding||"1rem":a?.padding||0,flexGrow:1,display:"flex"},children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[c?.graphTitle||c?.graphDescription||a?.graphTitle||a?.graphDescription||a?.graphDownload||a?.dataDownload?r.jsxRuntimeExports.jsx(re.GraphHeader,{styles:{title:c?.styles?.title||a?.styles?.title,description:c?.styles?.description||a?.styles?.description},classNames:{title:c?.classNames?.title||a?.classNames?.title,description:c?.classNames?.description||a?.classNames?.description},graphTitle:c?.graphTitle||a?.graphTitle,graphDescription:c?.graphDescription||a?.graphDescription,width:c?.width||a?.width,graphDownload:a?.graphDownload?M.current:void 0,dataDownload:a?.dataDownload&&C&&C.length>0?C:null}):null,C&&b.length>0?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[j.length!==0||(F||[]).length!==0||(O||[]).length!==0?r.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:[O?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/g}% - ${(g-1)/g}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?r.jsxRuntimeExports.jsx(f.Za,{options:e.options.map(t=>({...t,value:t.label})),isClearable:!1,isSearchable:!0,variant:p,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:t=>{R(t?.graphSettings||{}),x(t?.dataConfiguration)}}):r.jsxRuntimeExports.jsx(h.fe,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:p,onValueChange:t=>{const l=e.options[e.options.findIndex(o=>o.label===t)];R(l.graphSettings||{}),x(l.dataConfiguration)},children:e.options.map((t,l)=>r.jsxRuntimeExports.jsx(h.ve,{label:t.label,value:t.label},l))})]},u)),F?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/g}% - ${(g-1)/g}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),h.checkIfMultiple(e.chartConfigId,m||[])?e.ui!=="radio"?r.jsxRuntimeExports.jsx(f.Za,{options:e.allowedColumnIds,isMulti:!0,variant:p,isSearchable:!0,controlShouldRenderValue:!0,defaultValue:s?s[s.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId.map(t=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===t)]):void 0,filterOption:f.Hu(V),onChange:t=>{const l={columnId:t.map(i=>i.value),chartConfigId:e.chartConfigId},o=m?.map(i=>i.chartConfigId===l.chartConfigId?l:i);x(o)},isRtl:a?.language==="ar"||a?.language==="he"}):r.jsxRuntimeExports.jsx(h.w,{variant:p,defaultValue:s?s[s.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},o=m?.map(i=>i.chartConfigId===l.chartConfigId?l:i);x(o)},children:e.allowedColumnIds.map((t,l)=>r.jsxRuntimeExports.jsx(h.G,{label:t.label,value:t.label},l))}):e.ui!=="radio"?r.jsxRuntimeExports.jsx(f.Za,{options:e.allowedColumnIds,isClearable:!1,isSearchable:!0,variant:p,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)]:void 0,controlShouldRenderValue:!0,onChange:t=>{const l={columnId:t?.value,chartConfigId:e.chartConfigId},o=m?.map(i=>i.chartConfigId===l.chartConfigId?l:i);R(t?.graphSettings||{}),x(o)}}):r.jsxRuntimeExports.jsx(h.fe,{variant:p,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:t=>{const l=e.allowedColumnIds[e.allowedColumnIds.findIndex(y=>y.label===t)],o={columnId:l.value,chartConfigId:e.chartConfigId},i=m?.map(y=>y.chartConfigId===o.chartConfigId?o:y);R(l.graphSettings||{}),x(i)},children:e.allowedColumnIds.map((t,l)=>r.jsxRuntimeExports.jsx(h.ve,{label:t.label,value:t.label},l))})]},u)),j?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/g}% - ${(g-1)/g}rem)`,flexGrow:1,flexShrink:0,flexWrap:"wrap"},children:[r.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label}),e.singleSelect?r.jsxRuntimeExports.jsx(f.Za,{variant:p,options:e.availableValues,isClearable:e.clearable===void 0?!0:e.clearable,isRtl:a?.language==="ar"||a?.language==="he",isSearchable:!0,controlShouldRenderValue:!0,filterOption:f.Hu(V),onChange:t=>{G(e.filter,t)},defaultValue:e.defaultValue}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(f.Za,{variant:p,options:e.availableValues,isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:f.Hu(V),onChange:t=>{G(e.filter,t)},defaultValue:e.defaultValue,isRtl:a?.language==="ar"||a?.language==="he"}),e.allowSelectAll?r.jsxRuntimeExports.jsx("button",{className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",type:"button",onClick:()=>{G(e.filter,e.availableValues)},children:"Select all options"}):null]})]},u))]}):null,k!==!1&&a?.showColorScale!==!1?r.jsxRuntimeExports.jsx(ne.ColorLegend,{width:a?.width,colorLegendTitle:a?.colorLegendTitle,colors:a?.colors||a?.lineColors||le.Colors[a?.theme||"light"].categoricalColors.colors,colorDomain:a?.colorDomain||a?.labels||[],showNAColor:a?.showNAColor===void 0||a?.showNAColor===null?!0:a?.showNAColor}):null,r.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"1rem",flexDirection:a?.language==="ar"||a?.language==="he"?"row-reverse":"row",justifyContent:"center"},children:b.map((e,u)=>r.jsxRuntimeExports.jsx("div",{style:{width:`calc(${100/(E||Math.min(4,b.length||0))}% - ${((E||Math.min(4,b.length||0))-1)/(E||Math.min(4,b.length||0))}rem)`,minWidth:ie.checkIfNullOrUndefined(q)?"280px":`${q}px`},children:r.jsxRuntimeExports.jsx(te.GraphEl,{graph:A,graphDataConfiguration:m,graphData:W.transformDataForGraph(D?W.transformDataForAggregation(z.filterData(C,$||[]).filter(t=>t[I]===e),D.keyColumn,D.aggregationColumnsSetting):z.filterData(C,$||[]).filter(t=>t[I]===e),A,m)||[],debugMode:w,settings:{...a||{},...c,theme:a?.theme||H,width:void 0,height:void 0,relativeHeight:a?.relativeHeight||.67,minHeight:K,graphTitle:`${e}`,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",footNote:void 0,sources:void 0,showColorScale:a?.showColorScale===!1?!1:k===!1},readableHeader:Q||[]})},u))})]}):r.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:r.jsxRuntimeExports.jsx(ae.y,{})}),a?.sources||a?.footNote?r.jsxRuntimeExports.jsx(oe.GraphFooter,{styles:{footnote:a?.styles?.footnote,source:a?.styles?.source},classNames:{footnote:a?.classNames?.footnote,source:a?.classNames?.source},sources:a?.sources,footNote:a?.footNote,width:a?.width}):null]})})})})}exports.GriddedGraphs=se;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),d=require("react"),ee=require("./index-D72cOtq7.cjs"),N=require("./index-BS2TADPj.cjs"),h=require("./checkIfMultiple-BXbHUCWM.cjs"),ae=require("./Spinner-DA6Z5E4n.cjs"),f=require("./DropdownSelect-DBDM64B5.cjs"),te=require("./GraphEl-4RUlclvW.cjs"),v=require("./fetchAndParseData-Dcy7AS_0.cjs"),le=require("./Colors.cjs"),W=require("./transformDataForAggregation-BVxVu4yY.cjs"),Z=require("./getUniqValue-CfuE_l9c.cjs"),re=require("./GraphHeader.cjs"),oe=require("./GraphFooter.cjs"),z=require("./filterData-BoYadk0l.cjs"),ne=require("./ColorLegend.cjs"),ie=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),B=require("./transformDataForSelect-YmStusCI.cjs");function se(J){const{graphSettings:a,dataSettings:n,filters:T,graphType:A,dataTransform:D,graphDataConfiguration:s,noOfColumns:E,columnGridBy:I,dataFilters:$,showCommonColorScale:k,minGraphHeight:K,minGraphWidth:q,debugMode:w,dataSelectionOptions:F,advancedDataSelectionOptions:O,readableHeader:Q,noOfFiltersPerRow:g=4,uiMode:p="normal",theme:H="light"}=J,[C,X]=d.useState(void 0),[S,Y]=d.useState(void 0),[b,_]=d.useState([]),M=d.useRef(null),[m,x]=d.useState(s),[j,L]=d.useState([]),[c,R]=d.useState({}),V=d.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),U=d.useMemo(()=>!S||j.length===0?S:S.filter(u=>j.every(t=>t.value&&N.flattenDeep([t.value]).length>0?ee.intersection(N.flattenDeep([u[t.filter]]),N.flattenDeep([t.value]).map(l=>l.value)).length>0:!0)),[j,S]);d.useEffect(()=>{X(U)},[U]);const P=d.useCallback(async()=>{if(n)try{const u=await(n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?v.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,w):n.fileType==="api"?v.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,w):v.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,w,n.delimiter,!0):v.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):v.transformColumnsToArray(n.data,n.columnsToArray));Y(u);const t=Z.getUniqValue(u,I);_(t);const l=(T||[]).map(o=>({filter:o.column,label:o.label||`Filter by ${o.column}`,singleSelect:o.singleSelect,clearable:o.clearable,defaultValue:B.transformDefaultValue(o.defaultValue),value:B.transformDefaultValue(o.defaultValue),availableValues:Z.getUniqValue(u,o.column).filter(i=>!o.excludeValues?.includes(`${i}`)).map(i=>({value:i,label:i})),allowSelectAll:o.allowSelectAll,width:o.width}));L(l)}catch(e){console.error("Data fetching error:",e)}},[n,w,I,T]);d.useEffect(()=>{P()},[P]),d.useEffect(()=>{x(s)},[s]);const G=d.useCallback((e,u)=>{L(t=>t.map(l=>l.filter===e?{...l,value:u}:l))},[]);return r.jsxRuntimeExports.jsx("div",{className:`${H||a?.theme||"light"} flex ${a?.width?"w-fit grow-0":"w-full grow"}`,dir:a?.language==="he"||a?.language==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:`${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"}`,style:{...a?.backgroundColor&&a?.backgroundColor!==!0?{backgroundColor:a?.backgroundColor}:{}},id:a?.graphID,ref:M,"aria-label":a?.ariaLabel||`${a?.graphTitle?`The graph shows ${a?.graphTitle}. `:""}This is a gridded chart.${a?.graphDescription?` ${a?.graphDescription}`:""}`,children:r.jsxRuntimeExports.jsx("div",{style:{padding:a?.backgroundColor?a?.padding||"1rem":a?.padding||0,flexGrow:1,display:"flex"},children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[c?.graphTitle||c?.graphDescription||a?.graphTitle||a?.graphDescription||a?.graphDownload||a?.dataDownload?r.jsxRuntimeExports.jsx(re.GraphHeader,{styles:{title:c?.styles?.title||a?.styles?.title,description:c?.styles?.description||a?.styles?.description},classNames:{title:c?.classNames?.title||a?.classNames?.title,description:c?.classNames?.description||a?.classNames?.description},graphTitle:c?.graphTitle||a?.graphTitle,graphDescription:c?.graphDescription||a?.graphDescription,width:c?.width||a?.width,graphDownload:a?.graphDownload?M.current:void 0,dataDownload:a?.dataDownload&&C&&C.length>0?C:null}):null,C&&b.length>0?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[j.length!==0||(F||[]).length!==0||(O||[]).length!==0?r.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:[O?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/g}% - ${(g-1)/g}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?r.jsxRuntimeExports.jsx(f.Za,{options:e.options.map(t=>({...t,value:t.label})),isClearable:!1,isSearchable:!0,variant:p,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:t=>{R(t?.graphSettings||{}),x(t?.dataConfiguration)}}):r.jsxRuntimeExports.jsx(h.fe,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:p,onValueChange:t=>{const l=e.options[e.options.findIndex(o=>o.label===t)];R(l.graphSettings||{}),x(l.dataConfiguration)},children:e.options.map((t,l)=>r.jsxRuntimeExports.jsx(h.ve,{label:t.label,value:t.label},l))})]},u)),F?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/g}% - ${(g-1)/g}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),h.checkIfMultiple(e.chartConfigId,m||[])?e.ui!=="radio"?r.jsxRuntimeExports.jsx(f.Za,{options:e.allowedColumnIds,isMulti:!0,variant:p,isSearchable:!0,controlShouldRenderValue:!0,defaultValue:s?s[s.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId.map(t=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===t)]):void 0,filterOption:f.Hu(V),onChange:t=>{const l={columnId:t.map(i=>i.value),chartConfigId:e.chartConfigId},o=m?.map(i=>i.chartConfigId===l.chartConfigId?l:i);x(o)},isRtl:a?.language==="ar"||a?.language==="he"}):r.jsxRuntimeExports.jsx(h.w,{variant:p,defaultValue:s?s[s.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},o=m?.map(i=>i.chartConfigId===l.chartConfigId?l:i);x(o)},children:e.allowedColumnIds.map((t,l)=>r.jsxRuntimeExports.jsx(h.G,{label:t.label,value:t.label},l))}):e.ui!=="radio"?r.jsxRuntimeExports.jsx(f.Za,{options:e.allowedColumnIds,isClearable:!1,isSearchable:!0,variant:p,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)]:void 0,controlShouldRenderValue:!0,onChange:t=>{const l={columnId:t?.value,chartConfigId:e.chartConfigId},o=m?.map(i=>i.chartConfigId===l.chartConfigId?l:i);R(t?.graphSettings||{}),x(o)}}):r.jsxRuntimeExports.jsx(h.fe,{variant:p,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:t=>{const l=e.allowedColumnIds[e.allowedColumnIds.findIndex(y=>y.label===t)],o={columnId:l.value,chartConfigId:e.chartConfigId},i=m?.map(y=>y.chartConfigId===o.chartConfigId?o:y);R(l.graphSettings||{}),x(i)},children:e.allowedColumnIds.map((t,l)=>r.jsxRuntimeExports.jsx(h.ve,{label:t.label,value:t.label},l))})]},u)),j?.map((e,u)=>r.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/g}% - ${(g-1)/g}rem)`,flexGrow:1,flexShrink:0,flexWrap:"wrap"},children:[r.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label}),e.singleSelect?r.jsxRuntimeExports.jsx(f.Za,{variant:p,options:e.availableValues,isClearable:e.clearable===void 0?!0:e.clearable,isRtl:a?.language==="ar"||a?.language==="he",isSearchable:!0,controlShouldRenderValue:!0,filterOption:f.Hu(V),onChange:t=>{G(e.filter,t)},defaultValue:e.defaultValue}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(f.Za,{variant:p,options:e.availableValues,isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:f.Hu(V),onChange:t=>{G(e.filter,t)},defaultValue:e.defaultValue,isRtl:a?.language==="ar"||a?.language==="he"}),e.allowSelectAll?r.jsxRuntimeExports.jsx("button",{className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",type:"button",onClick:()=>{G(e.filter,e.availableValues)},children:"Select all options"}):null]})]},u))]}):null,k!==!1&&a?.showColorScale!==!1?r.jsxRuntimeExports.jsx(ne.ColorLegend,{width:a?.width,colorLegendTitle:a?.colorLegendTitle,colors:a?.colors||a?.lineColors||le.Colors[a?.theme||"light"].categoricalColors.colors,colorDomain:a?.colorDomain||a?.labels||[],showNAColor:a?.showNAColor===void 0||a?.showNAColor===null?!0:a?.showNAColor}):null,r.jsxRuntimeExports.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"1rem",flexDirection:a?.language==="ar"||a?.language==="he"?"row-reverse":"row",justifyContent:"center"},children:b.map((e,u)=>r.jsxRuntimeExports.jsx("div",{style:{width:`calc(${100/(E||Math.min(4,b.length||0))}% - ${((E||Math.min(4,b.length||0))-1)/(E||Math.min(4,b.length||0))}rem)`,minWidth:ie.checkIfNullOrUndefined(q)?"280px":`${q}px`},children:r.jsxRuntimeExports.jsx(te.GraphEl,{graph:A,graphDataConfiguration:m,graphData:W.transformDataForGraph(D?W.transformDataForAggregation(z.filterData(C,$||[]).filter(t=>t[I]===e),D.keyColumn,D.aggregationColumnsSetting):z.filterData(C,$||[]).filter(t=>t[I]===e),A,m)||[],debugMode:w,settings:{...a||{},...c,theme:a?.theme||H,width:void 0,height:void 0,relativeHeight:a?.relativeHeight||.67,minHeight:K,graphTitle:`${e}`,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",footNote:void 0,sources:void 0,showColorScale:a?.showColorScale===!1?!1:k===!1},readableHeader:Q||[]})},u))})]}):r.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:r.jsxRuntimeExports.jsx(ae.y,{})}),a?.sources||a?.footNote?r.jsxRuntimeExports.jsx(oe.GraphFooter,{styles:{footnote:a?.styles?.footnote,source:a?.styles?.source},classNames:{footnote:a?.classNames?.footnote,source:a?.classNames?.source},sources:a?.sources,footNote:a?.footNote,width:a?.width}):null]})})})})}exports.GriddedGraphs=se;
|
|
2
2
|
//# sourceMappingURL=GriddedGraphs.cjs.map
|
package/dist/GriddedGraphs.d.ts
CHANGED
|
@@ -27,6 +27,10 @@ declare interface AggregationSettingsDataType {
|
|
|
27
27
|
aggregationMethod?: 'sum' | 'average' | 'min' | 'max';
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
declare interface AmbientLightConfig extends BaseLightConfig {
|
|
31
|
+
type: 'ambient';
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
declare interface AnimateDataType {
|
|
31
35
|
duration: number;
|
|
32
36
|
once: boolean;
|
|
@@ -69,6 +73,12 @@ declare interface AxesStyleObject {
|
|
|
69
73
|
axis?: React.CSSProperties;
|
|
70
74
|
}
|
|
71
75
|
|
|
76
|
+
declare interface BaseLightConfig {
|
|
77
|
+
type: string;
|
|
78
|
+
color: number;
|
|
79
|
+
intensity: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
72
82
|
declare interface ClassNameObject {
|
|
73
83
|
title?: string;
|
|
74
84
|
footnote?: string;
|
|
@@ -154,6 +164,14 @@ declare interface DataTableColumnDataType {
|
|
|
154
164
|
columnWidth?: number;
|
|
155
165
|
}
|
|
156
166
|
|
|
167
|
+
declare interface DirectionalLightConfig extends BaseLightConfig {
|
|
168
|
+
type: 'directional';
|
|
169
|
+
target?: Position;
|
|
170
|
+
castShadow?: boolean;
|
|
171
|
+
shadow?: ShadowConfig;
|
|
172
|
+
position?: Position | 'camera';
|
|
173
|
+
}
|
|
174
|
+
|
|
157
175
|
declare interface FileSettingsDataType {
|
|
158
176
|
dataURL: string;
|
|
159
177
|
idColumnName: string;
|
|
@@ -429,9 +447,10 @@ declare interface GraphSettingsDataType {
|
|
|
429
447
|
polygonAltitude?: number;
|
|
430
448
|
atmosphereAltitude?: number;
|
|
431
449
|
globeCurvatureResolution?: number;
|
|
432
|
-
|
|
450
|
+
lights?: LightConfig[];
|
|
433
451
|
fogSetting?: FogDataType;
|
|
434
452
|
showAxisLabels?: boolean;
|
|
453
|
+
highlightedAltitude?: number;
|
|
435
454
|
}
|
|
436
455
|
|
|
437
456
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -458,6 +477,8 @@ declare interface HighlightAreaSettingsForScatterPlotDataType {
|
|
|
458
477
|
|
|
459
478
|
declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
|
|
460
479
|
|
|
480
|
+
declare type LightConfig = AmbientLightConfig | DirectionalLightConfig | PointLightConfig | SpotLightConfig;
|
|
481
|
+
|
|
461
482
|
declare interface MapLegendDataType {
|
|
462
483
|
mapStyleName: string;
|
|
463
484
|
legend: string | React.ReactNode;
|
|
@@ -465,6 +486,19 @@ declare interface MapLegendDataType {
|
|
|
465
486
|
|
|
466
487
|
declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
|
|
467
488
|
|
|
489
|
+
declare interface PointLightConfig extends BaseLightConfig {
|
|
490
|
+
type: 'point';
|
|
491
|
+
distance?: number;
|
|
492
|
+
decay?: number;
|
|
493
|
+
position?: Position | 'camera';
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
declare interface Position {
|
|
497
|
+
x: number;
|
|
498
|
+
y: number;
|
|
499
|
+
z: number;
|
|
500
|
+
}
|
|
501
|
+
|
|
468
502
|
declare interface Props {
|
|
469
503
|
noOfColumns?: number;
|
|
470
504
|
columnGridBy: string;
|
|
@@ -509,11 +543,34 @@ declare interface ReferenceDataType {
|
|
|
509
543
|
|
|
510
544
|
declare type ScaleDataType = 'categorical' | 'linear' | 'threshold';
|
|
511
545
|
|
|
546
|
+
declare interface ShadowConfig {
|
|
547
|
+
mapSize: {
|
|
548
|
+
width: number;
|
|
549
|
+
height: number;
|
|
550
|
+
};
|
|
551
|
+
camera: {
|
|
552
|
+
near: number;
|
|
553
|
+
far: number;
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
|
|
512
557
|
declare interface SourcesDataType {
|
|
513
558
|
source: string;
|
|
514
559
|
link?: string;
|
|
515
560
|
}
|
|
516
561
|
|
|
562
|
+
declare interface SpotLightConfig extends BaseLightConfig {
|
|
563
|
+
type: 'spot';
|
|
564
|
+
target?: Position;
|
|
565
|
+
distance?: number;
|
|
566
|
+
angle?: number;
|
|
567
|
+
penumbra?: number;
|
|
568
|
+
decay?: number;
|
|
569
|
+
castShadow?: boolean;
|
|
570
|
+
shadow?: ShadowConfig;
|
|
571
|
+
position?: Position | 'camera';
|
|
572
|
+
}
|
|
573
|
+
|
|
517
574
|
declare interface StyleObject {
|
|
518
575
|
title?: React.CSSProperties;
|
|
519
576
|
footnote?: React.CSSProperties;
|
package/dist/GriddedGraphs.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { j as o } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
2
|
import { useState as m, useRef as oa, useMemo as q, useEffect as T, useCallback as z } from "react";
|
|
3
|
-
import { i as ra } from "./index-
|
|
4
|
-
import { f as G } from "./index-
|
|
3
|
+
import { i as ra } from "./index-V_JXij1_.js";
|
|
4
|
+
import { f as G } from "./index-EArKRVKg.js";
|
|
5
5
|
import { f as $, a as B, v as J, c as na, w as ia, G as sa } from "./checkIfMultiple-ChTJk2Tk.js";
|
|
6
6
|
import { y as da } from "./Spinner-C85UF28E.js";
|
|
7
7
|
import { Z as x, H as A } from "./DropdownSelect-CtOKZHD0.js";
|
|
8
|
-
import { G as ca } from "./GraphEl-
|
|
9
|
-
import { f as ua, a as ha, b as ga, c as fa, t as pa } from "./fetchAndParseData-
|
|
8
|
+
import { G as ca } from "./GraphEl-ClIxlWa3.js";
|
|
9
|
+
import { f as ua, a as ha, b as ga, c as fa, t as pa } from "./fetchAndParseData-DBOl1Icl.js";
|
|
10
10
|
import { Colors as ma } from "./Colors.js";
|
|
11
|
-
import { a as Ca, t as wa } from "./transformDataForAggregation-
|
|
12
|
-
import { g as K } from "./getUniqValue-
|
|
11
|
+
import { a as Ca, t as wa } from "./transformDataForAggregation-1BYVFqvF.js";
|
|
12
|
+
import { g as K } from "./getUniqValue-CttuU_wn.js";
|
|
13
13
|
import { GraphHeader as ba } from "./GraphHeader.js";
|
|
14
14
|
import { GraphFooter as xa } from "./GraphFooter.js";
|
|
15
|
-
import { f as Q } from "./filterData-
|
|
15
|
+
import { f as Q } from "./filterData-9nEcQ-Jp.js";
|
|
16
16
|
import { ColorLegend as va } from "./ColorLegend.js";
|
|
17
17
|
import { c as Ia } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
18
18
|
import { t as X } from "./transformDataForSelect-D8AuvYdf.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("./GriddedGraphs.cjs"),c=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("./GriddedGraphs.cjs"),c=require("./fetchAndParseData-Dcy7AS_0.cjs");function f(i){const{config:t}=i,[e,r]=n.useState(void 0);return n.useEffect(()=>{(async()=>{if(typeof t=="string"){const o=await c.fetchAndParseJSON(t);r(o)}else r(t)})()},[t]),e?a.jsxRuntimeExports.jsx(d.GriddedGraphs,{noOfColumns:e.noOfColumns,columnGridBy:e.columnGridBy,graphSettings:e.graphSettings,dataSettings:e.dataSettings,filters:e.filters,graphType:e.graphType,minGraphHeight:e.minGraphHeight,minGraphWidth:e.minGraphWidth,dataTransform:e.dataTransform,graphDataConfiguration:e.graphDataConfiguration,dataFilters:e.dataFilters,showCommonColorScale:e.showCommonColorScale,debugMode:e.debugMode,dataSelectionOptions:e.dataSelectionOptions,advancedDataSelectionOptions:e.advancedDataSelectionOptions,readableHeader:e.readableHeader,noOfFiltersPerRow:e.noOfFiltersPerRow,theme:e.theme}):a.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:a.jsxRuntimeExports.jsx(s.y,{})})}exports.GriddedGraphsFromConfig=f;
|
|
2
2
|
//# sourceMappingURL=GriddedGraphsFromConfig.cjs.map
|
|
@@ -27,6 +27,10 @@ declare interface AggregationSettingsDataType {
|
|
|
27
27
|
aggregationMethod?: 'sum' | 'average' | 'min' | 'max';
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
declare interface AmbientLightConfig extends BaseLightConfig {
|
|
31
|
+
type: 'ambient';
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
declare interface AnimateDataType {
|
|
31
35
|
duration: number;
|
|
32
36
|
once: boolean;
|
|
@@ -69,6 +73,12 @@ declare interface AxesStyleObject {
|
|
|
69
73
|
axis?: React.CSSProperties;
|
|
70
74
|
}
|
|
71
75
|
|
|
76
|
+
declare interface BaseLightConfig {
|
|
77
|
+
type: string;
|
|
78
|
+
color: number;
|
|
79
|
+
intensity: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
72
82
|
declare interface ClassNameObject {
|
|
73
83
|
title?: string;
|
|
74
84
|
footnote?: string;
|
|
@@ -181,6 +191,14 @@ declare interface DataTableColumnDataType {
|
|
|
181
191
|
columnWidth?: number;
|
|
182
192
|
}
|
|
183
193
|
|
|
194
|
+
declare interface DirectionalLightConfig extends BaseLightConfig {
|
|
195
|
+
type: 'directional';
|
|
196
|
+
target?: Position;
|
|
197
|
+
castShadow?: boolean;
|
|
198
|
+
shadow?: ShadowConfig;
|
|
199
|
+
position?: Position | 'camera';
|
|
200
|
+
}
|
|
201
|
+
|
|
184
202
|
declare interface FileSettingsDataType {
|
|
185
203
|
dataURL: string;
|
|
186
204
|
idColumnName: string;
|
|
@@ -456,9 +474,10 @@ declare interface GraphSettingsDataType {
|
|
|
456
474
|
polygonAltitude?: number;
|
|
457
475
|
atmosphereAltitude?: number;
|
|
458
476
|
globeCurvatureResolution?: number;
|
|
459
|
-
|
|
477
|
+
lights?: LightConfig[];
|
|
460
478
|
fogSetting?: FogDataType;
|
|
461
479
|
showAxisLabels?: boolean;
|
|
480
|
+
highlightedAltitude?: number;
|
|
462
481
|
}
|
|
463
482
|
|
|
464
483
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -485,6 +504,8 @@ declare interface HighlightAreaSettingsForScatterPlotDataType {
|
|
|
485
504
|
|
|
486
505
|
declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
|
|
487
506
|
|
|
507
|
+
declare type LightConfig = AmbientLightConfig | DirectionalLightConfig | PointLightConfig | SpotLightConfig;
|
|
508
|
+
|
|
488
509
|
declare interface MapLegendDataType {
|
|
489
510
|
mapStyleName: string;
|
|
490
511
|
legend: string | React.ReactNode;
|
|
@@ -492,6 +513,19 @@ declare interface MapLegendDataType {
|
|
|
492
513
|
|
|
493
514
|
declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
|
|
494
515
|
|
|
516
|
+
declare interface PointLightConfig extends BaseLightConfig {
|
|
517
|
+
type: 'point';
|
|
518
|
+
distance?: number;
|
|
519
|
+
decay?: number;
|
|
520
|
+
position?: Position | 'camera';
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
declare interface Position {
|
|
524
|
+
x: number;
|
|
525
|
+
y: number;
|
|
526
|
+
z: number;
|
|
527
|
+
}
|
|
528
|
+
|
|
495
529
|
declare interface Props {
|
|
496
530
|
config: string | ConfigObject;
|
|
497
531
|
}
|
|
@@ -512,11 +546,34 @@ declare interface ReferenceDataType {
|
|
|
512
546
|
|
|
513
547
|
declare type ScaleDataType = 'categorical' | 'linear' | 'threshold';
|
|
514
548
|
|
|
549
|
+
declare interface ShadowConfig {
|
|
550
|
+
mapSize: {
|
|
551
|
+
width: number;
|
|
552
|
+
height: number;
|
|
553
|
+
};
|
|
554
|
+
camera: {
|
|
555
|
+
near: number;
|
|
556
|
+
far: number;
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
|
|
515
560
|
declare interface SourcesDataType {
|
|
516
561
|
source: string;
|
|
517
562
|
link?: string;
|
|
518
563
|
}
|
|
519
564
|
|
|
565
|
+
declare interface SpotLightConfig extends BaseLightConfig {
|
|
566
|
+
type: 'spot';
|
|
567
|
+
target?: Position;
|
|
568
|
+
distance?: number;
|
|
569
|
+
angle?: number;
|
|
570
|
+
penumbra?: number;
|
|
571
|
+
decay?: number;
|
|
572
|
+
castShadow?: boolean;
|
|
573
|
+
shadow?: ShadowConfig;
|
|
574
|
+
position?: Position | 'camera';
|
|
575
|
+
}
|
|
576
|
+
|
|
520
577
|
declare interface StyleObject {
|
|
521
578
|
title?: React.CSSProperties;
|
|
522
579
|
footnote?: React.CSSProperties;
|
|
@@ -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 d } from "./Spinner-C85UF28E.js";
|
|
4
4
|
import { GriddedGraphs as f } from "./GriddedGraphs.js";
|
|
5
|
-
import { f as m } from "./fetchAndParseData-
|
|
5
|
+
import { f as m } from "./fetchAndParseData-DBOl1Icl.js";
|
|
6
6
|
function S(r) {
|
|
7
7
|
const { config: e } = r, [t, o] = n(void 0);
|
|
8
8
|
return s(() => {
|
package/dist/HeatMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),x=require("react"),ue=require("./index-BXns0-ng.cjs"),le=require("./index-CZbIGs8q.cjs"),ce=require("./Modal-tXZlLE5s.cjs"),xe=require("./numberFormattingFunction-02t-wJta.cjs"),he=require("./Tooltip-n8z5bfav.cjs"),de=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),re=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ge=require("./string2HTML-D2Avudmb.cjs"),me=require("./XAxesLabels-OjBNl_lS.cjs"),pe=require("./YAxesLabels-D8IydyZj.cjs"),ae=require("./band-CAApY4Pd.cjs"),fe=require("./ordinal-BOeNbyae.cjs"),je=require("./threshold-DNsSUf8Q.cjs"),Ce=require("./linear-BVckp9RD.cjs"),ye=require("./use-in-view-sQJZ_xDO.cjs"),se=require("./proxy-BHRoeZgd.cjs"),ve=require("./GraphHeader.cjs"),we=require("./GraphFooter.cjs"),be=require("./ColorLegendWithMouseOver.cjs"),Ee=require("./LinearColorLegend.cjs"),Re=require("./ThresholdColorLegendWithMouseOver.cjs"),i=require("./Colors.cjs"),qe=require("./EmptyState-d8_8SxeW.cjs");function $e(U){const{data:m,showColumnLabels:N,leftMargin:O,rightMargin:F,truncateBy:p,width:H,height:I,topMargin:z,bottomMargin:_,tooltip:q,onSeriesMouseOver:r,suffix:J,prefix:s,showValues:G,colorDomain:$,colors:S,noDataColor:f,scaleType:X,showRowLabels:K,selectedColor:Y,onSeriesMouseClick:V,resetSelectionOnDoubleClick:Q,detailsOnClick:y,styles:L,classNames:j,animate:v,precision:Z}=U,W=x.useRef(null),D=ye.useInView(W,{once:v.once,amount:v.amount}),l={top:z,bottom:_,left:O,right:F},[w,T]=x.useState(void 0),[a,M]=x.useState(void 0),[A,b]=x.useState(void 0),[o,B]=x.useState(void 0),ee=H-l.left-l.right,te=I-l.top-l.bottom,h=le.uniqBy(m,e=>e.column).map(e=>e.column),d=le.uniqBy(m,e=>e.row).map(e=>e.row),E=ae.band().domain(d).range([0,te]),k=E.bandwidth(),u=ae.band().domain(h).range([0,ee]),R=u.bandwidth(),P=X==="categorical"?fe.ordinal().domain($).range(S):X==="threshold"?je.threshold().domain($).range(S):Ce.linear().domain($).range(S);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(se.motion.svg,{width:`${H}px`,height:`${I}px`,viewBox:`0 0 ${H} ${I}`,style:{marginLeft:"auto",marginRight:"auto"},direction:"ltr",ref:W,children:[t.jsxRuntimeExports.jsx("g",{transform:`translate(${l.left},0)`,children:N?h.map((e,C)=>t.jsxRuntimeExports.jsx(me.XAxesLabels,{y:0,x:u(e),width:R,height:l.top-5,value:`${e}`.length<p?`${e}`:`${`${e}`.substring(0,p)}...`,style:L?.xAxis?.labels,className:j?.xAxis?.labels,alignment:"bottom",animate:{duration:0,once:!0,amount:0},isInView:D},C)):null}),t.jsxRuntimeExports.jsx("g",{transform:`translate(0,${l.top})`,children:K?d.map((e,C)=>t.jsxRuntimeExports.jsx(pe.YAxesLabels,{value:`${e}`.length<p?`${e}`:`${`${e}`.substring(0,p)}...`,y:E(e),x:0,width:l.left,height:k,alignment:"right",style:L?.yAxis?.labels,className:j?.yAxis?.labels,animate:{duration:0,once:!0,amount:0},isInView:D},C)):null}),t.jsxRuntimeExports.jsxs("g",{transform:`translate(${l.left},${l.top})`,children:[d.map((e,C)=>t.jsxRuntimeExports.jsx("g",{transform:`translate(0,${E(e)})`,children:h.map(g=>t.jsxRuntimeExports.jsx("rect",{x:u(g),y:0,width:R,height:k,style:{fill:f},className:"stroke-1 stroke-primary-white dark:stroke-primary-gray-700"},`${e}-${g}`))},C)),m.filter(e=>!re.checkIfNullOrUndefined(e.value)).map((e,C)=>{const g=re.checkIfNullOrUndefined(e.value)?f:P(e.value);return t.jsxRuntimeExports.jsxs("g",{transform:`translate(${u(e.column)},${E(e.row)})`,onMouseEnter:c=>{M(e),B(c.clientY),b(c.clientX),r?.(e)},onClick:()=>{(V||y)&&(ue.isEqual(w,e)&&Q?(T(void 0),V?.(void 0)):(T(e),V?.(e)))},onMouseMove:c=>{M(e),B(c.clientY),b(c.clientX)},onMouseLeave:()=>{M(void 0),b(void 0),B(void 0),r?.(void 0)},opacity:Y?Y===g?1:.3:1,children:[t.jsxRuntimeExports.jsx(se.motion.rect,{x:0,y:0,width:R,height:k,className:"stroke-1 stroke-primary-white dark:stroke-primary-gray-700",exit:{opacity:0,transition:{duration:v.duration}},variants:{initial:{fill:g,opacity:0},whileInView:{fill:g,opacity:1,transition:{duration:v.duration}}},initial:"initial",animate:D?"whileInView":"initial"}),G&&!re.checkIfNullOrUndefined(e.value)?t.jsxRuntimeExports.jsx(se.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:v.duration}}},initial:"initial",animate:D?"whileInView":"initial",exit:{opacity:0,transition:{duration:v.duration}},children:t.jsxRuntimeExports.jsx("foreignObject",{y:0,x:0,width:R,height:k,children:t.jsxRuntimeExports.jsx("div",{className:"flex flex-col justify-center items-center h-inherit p-1",children:t.jsxRuntimeExports.jsx("p",{className:t.mo("text-xs text-center m-0 leading-[1.25] graph-value",j?.graphObjectValues),style:{color:de.getTextColorBasedOnBgColor(g),...L?.graphObjectValues||{}},children:xe.numberFormattingFunction(e.value,"NA",Z,s,J)})})},C)}):null]},`${e.column}-${e.row}`)}),a?t.jsxRuntimeExports.jsx("rect",{x:u(a.column),y:E(a.row),width:R,height:k,style:{fill:"none",fillOpacity:0,strokeWidth:1.5},className:"stroke-primary-gray-700 dark:stroke-primary-gray-300"}):null]})]}),a&&q&&A&&o?t.jsxRuntimeExports.jsx(he.Tooltip,{data:a,body:q,xPos:A,yPos:o,backgroundStyle:L?.tooltip,className:j?.tooltip}):null,y&&w!==void 0?t.jsxRuntimeExports.jsx(ce.X,{open:w!==void 0,onClose:()=>{T(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof y=="string"?{__html:ge.string2HTML(y,w)}:void 0,children:typeof y=="function"?y(w):null})}):null]})}function Me(U){const{data:m,graphTitle:N,colors:O,sources:F,graphDescription:p,showColumnLabels:H=!0,leftMargin:I=100,rightMargin:z=10,truncateBy:_=999,height:q,width:r,scaleType:J,colorDomain:s,footNote:G,colorLegendTitle:$,padding:S,backgroundColor:f=!1,topMargin:X=30,bottomMargin:K=10,tooltip:Y,onSeriesMouseOver:V,suffix:Q="",prefix:y="",showRowLabels:L=!0,relativeHeight:j,showValues:v,graphID:Z,noDataColor:W=i.Colors.gray,showColorScale:D=!0,onSeriesMouseClick:l,graphDownload:w=!1,dataDownload:T=!1,fillContainer:a=!0,language:M="en",showNAColor:A=!0,minHeight:b=0,theme:o="light",ariaLabel:B,resetSelectionOnDoubleClick:ee=!0,detailsOnClick:te,styles:h,classNames:d,animate:E=!1,precision:k=2}=U,[u,R]=x.useState(0),[P,e]=x.useState(0),[C,g]=x.useState(void 0),c=x.useRef(null),ie=x.useRef(null);x.useEffect(()=>{const n=new ResizeObserver(ne=>{R(r||ne[0].target.clientWidth||620),e(q||ne[0].target.clientHeight||480)});return c.current&&(e(c.current.clientHeight||480),R(c.current.clientWidth||620),r||n.observe(c.current)),()=>n.disconnect()},[r,q]);const oe=J||(typeof s[0]=="string"?"categorical":s.length===2?"linear":"threshold");return t.jsxRuntimeExports.jsx("div",{className:`${o||"light"} flex ${r?"grow-0":"grow"} ${a?"w-full":"w-fit"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${f?f===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,a?"w-full":"w-fit",d?.graphContainer),style:{...h?.graphContainer||{},...f&&f!==!0?{backgroundColor:f}:{}},id:Z,ref:ie,"aria-label":B||`${N?`The graph shows ${N}. `:""}This is a heatmap. ${p?` ${p}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:f?S||"1rem":S||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[N||p||w||T?t.jsxRuntimeExports.jsx(ve.GraphHeader,{styles:{title:h?.title,description:h?.description},classNames:{title:d?.title,description:d?.description},graphTitle:N,graphDescription:p,width:r,graphDownload:w?ie.current:void 0,dataDownload:T?m.map(n=>n.data).filter(n=>n!==void 0).length>0?m.map(n=>n.data).filter(n=>n!==void 0):m.filter(n=>n!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:m.length===0?t.jsxRuntimeExports.jsx(qe.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[D?oe==="categorical"?t.jsxRuntimeExports.jsx(be.ColorLegendWithMouseOver,{width:a?void 0:r,colorLegendTitle:$,colors:O||(typeof s[0]=="string"?i.Colors[o].categoricalColors.colors:s.length===2?[i.Colors[o].sequentialColors.neutralColorsx09[0],i.Colors[o].sequentialColors.neutralColorsx09[8]]:i.Colors[o].sequentialColors[`neutralColorsx0${s.length+1}`]),colorDomain:s.map(n=>`${n}`),setSelectedColor:g,showNAColor:A}):oe==="threshold"?t.jsxRuntimeExports.jsx(Re.ThresholdColorLegendWithMouseOver,{width:a?void 0:r,colorLegendTitle:$,colors:O||(typeof s[0]=="string"?i.Colors[o].categoricalColors.colors:s.length===2?[i.Colors[o].sequentialColors.neutralColorsx09[0],i.Colors[o].sequentialColors.neutralColorsx09[8]]:i.Colors[o].sequentialColors[`neutralColorsx0${s.length+1}`]),colorDomain:s,setSelectedColor:g,naColor:W,showNAColor:A}):t.jsxRuntimeExports.jsx(Ee.LinearColorLegend,{width:a?void 0:r,colorLegendTitle:$,colors:O||[i.Colors[o].sequentialColors.neutralColorsx09[0],i.Colors[o].sequentialColors.neutralColorsx09[8]],colorDomain:s}):null,t.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center w-full leading-0",ref:c,"aria-label":"Graph area",children:(r||u)&&(q||P)?t.jsxRuntimeExports.jsx($e,{data:m,colorDomain:s,width:r||u,colors:O||(typeof s[0]=="string"?i.Colors[o].categoricalColors.colors:s.length===2?[i.Colors[o].sequentialColors.neutralColorsx09[0],i.Colors[o].sequentialColors.neutralColorsx09[8]]:i.Colors[o].sequentialColors[`neutralColorsx0${s.length+1}`]),noDataColor:W,scaleType:oe,height:Math.max(b,q||(j?b?(r||u)*j>b?(r||u)*j:b:(r||u)*j:P)),showColumnLabels:H,leftMargin:I,rightMargin:z,topMargin:X,bottomMargin:K,selectedColor:C,truncateBy:_,showRowLabels:L,tooltip:Y,onSeriesMouseOver:V,showValues:v,suffix:Q,prefix:y,onSeriesMouseClick:l,resetSelectionOnDoubleClick:ee,detailsOnClick:te,styles:h,classNames:d,animate:E===!0?{duration:.5,once:!0,amount:.5}:E||{duration:0,once:!0,amount:0},precision:k}):null})]})}),F||G?t.jsxRuntimeExports.jsx(we.GraphFooter,{styles:{footnote:h?.footnote,source:h?.source},classNames:{footnote:d?.footnote,source:d?.source},sources:F,footNote:G,width:r}):null]})})})})}exports.HeatMap=Me;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),x=require("react"),ue=require("./index-DQA8q5sC.cjs"),le=require("./index-BJOeaYTk.cjs"),ce=require("./Modal-tXZlLE5s.cjs"),xe=require("./numberFormattingFunction-02t-wJta.cjs"),he=require("./Tooltip-De16GWhY.cjs"),de=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),re=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ge=require("./string2HTML-z7CwHXcx.cjs"),me=require("./XAxesLabels-OjBNl_lS.cjs"),pe=require("./YAxesLabels-D8IydyZj.cjs"),ae=require("./band-CAApY4Pd.cjs"),fe=require("./ordinal-BOeNbyae.cjs"),je=require("./threshold-DNsSUf8Q.cjs"),Ce=require("./linear-BVckp9RD.cjs"),ye=require("./use-in-view-sQJZ_xDO.cjs"),se=require("./proxy-BHRoeZgd.cjs"),ve=require("./GraphHeader.cjs"),we=require("./GraphFooter.cjs"),be=require("./ColorLegendWithMouseOver.cjs"),Ee=require("./LinearColorLegend.cjs"),Re=require("./ThresholdColorLegendWithMouseOver.cjs"),i=require("./Colors.cjs"),qe=require("./EmptyState-d8_8SxeW.cjs");function $e(U){const{data:m,showColumnLabels:N,leftMargin:O,rightMargin:F,truncateBy:p,width:H,height:I,topMargin:z,bottomMargin:_,tooltip:q,onSeriesMouseOver:r,suffix:J,prefix:s,showValues:G,colorDomain:$,colors:S,noDataColor:f,scaleType:X,showRowLabels:K,selectedColor:Y,onSeriesMouseClick:V,resetSelectionOnDoubleClick:Q,detailsOnClick:y,styles:L,classNames:j,animate:v,precision:Z}=U,W=x.useRef(null),D=ye.useInView(W,{once:v.once,amount:v.amount}),l={top:z,bottom:_,left:O,right:F},[w,T]=x.useState(void 0),[a,M]=x.useState(void 0),[A,b]=x.useState(void 0),[o,B]=x.useState(void 0),ee=H-l.left-l.right,te=I-l.top-l.bottom,h=le.uniqBy(m,e=>e.column).map(e=>e.column),d=le.uniqBy(m,e=>e.row).map(e=>e.row),E=ae.band().domain(d).range([0,te]),k=E.bandwidth(),u=ae.band().domain(h).range([0,ee]),R=u.bandwidth(),P=X==="categorical"?fe.ordinal().domain($).range(S):X==="threshold"?je.threshold().domain($).range(S):Ce.linear().domain($).range(S);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(se.motion.svg,{width:`${H}px`,height:`${I}px`,viewBox:`0 0 ${H} ${I}`,style:{marginLeft:"auto",marginRight:"auto"},direction:"ltr",ref:W,children:[t.jsxRuntimeExports.jsx("g",{transform:`translate(${l.left},0)`,children:N?h.map((e,C)=>t.jsxRuntimeExports.jsx(me.XAxesLabels,{y:0,x:u(e),width:R,height:l.top-5,value:`${e}`.length<p?`${e}`:`${`${e}`.substring(0,p)}...`,style:L?.xAxis?.labels,className:j?.xAxis?.labels,alignment:"bottom",animate:{duration:0,once:!0,amount:0},isInView:D},C)):null}),t.jsxRuntimeExports.jsx("g",{transform:`translate(0,${l.top})`,children:K?d.map((e,C)=>t.jsxRuntimeExports.jsx(pe.YAxesLabels,{value:`${e}`.length<p?`${e}`:`${`${e}`.substring(0,p)}...`,y:E(e),x:0,width:l.left,height:k,alignment:"right",style:L?.yAxis?.labels,className:j?.yAxis?.labels,animate:{duration:0,once:!0,amount:0},isInView:D},C)):null}),t.jsxRuntimeExports.jsxs("g",{transform:`translate(${l.left},${l.top})`,children:[d.map((e,C)=>t.jsxRuntimeExports.jsx("g",{transform:`translate(0,${E(e)})`,children:h.map(g=>t.jsxRuntimeExports.jsx("rect",{x:u(g),y:0,width:R,height:k,style:{fill:f},className:"stroke-1 stroke-primary-white dark:stroke-primary-gray-700"},`${e}-${g}`))},C)),m.filter(e=>!re.checkIfNullOrUndefined(e.value)).map((e,C)=>{const g=re.checkIfNullOrUndefined(e.value)?f:P(e.value);return t.jsxRuntimeExports.jsxs("g",{transform:`translate(${u(e.column)},${E(e.row)})`,onMouseEnter:c=>{M(e),B(c.clientY),b(c.clientX),r?.(e)},onClick:()=>{(V||y)&&(ue.isEqual(w,e)&&Q?(T(void 0),V?.(void 0)):(T(e),V?.(e)))},onMouseMove:c=>{M(e),B(c.clientY),b(c.clientX)},onMouseLeave:()=>{M(void 0),b(void 0),B(void 0),r?.(void 0)},opacity:Y?Y===g?1:.3:1,children:[t.jsxRuntimeExports.jsx(se.motion.rect,{x:0,y:0,width:R,height:k,className:"stroke-1 stroke-primary-white dark:stroke-primary-gray-700",exit:{opacity:0,transition:{duration:v.duration}},variants:{initial:{fill:g,opacity:0},whileInView:{fill:g,opacity:1,transition:{duration:v.duration}}},initial:"initial",animate:D?"whileInView":"initial"}),G&&!re.checkIfNullOrUndefined(e.value)?t.jsxRuntimeExports.jsx(se.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:v.duration}}},initial:"initial",animate:D?"whileInView":"initial",exit:{opacity:0,transition:{duration:v.duration}},children:t.jsxRuntimeExports.jsx("foreignObject",{y:0,x:0,width:R,height:k,children:t.jsxRuntimeExports.jsx("div",{className:"flex flex-col justify-center items-center h-inherit p-1",children:t.jsxRuntimeExports.jsx("p",{className:t.mo("text-xs text-center m-0 leading-[1.25] graph-value",j?.graphObjectValues),style:{color:de.getTextColorBasedOnBgColor(g),...L?.graphObjectValues||{}},children:xe.numberFormattingFunction(e.value,"NA",Z,s,J)})})},C)}):null]},`${e.column}-${e.row}`)}),a?t.jsxRuntimeExports.jsx("rect",{x:u(a.column),y:E(a.row),width:R,height:k,style:{fill:"none",fillOpacity:0,strokeWidth:1.5},className:"stroke-primary-gray-700 dark:stroke-primary-gray-300"}):null]})]}),a&&q&&A&&o?t.jsxRuntimeExports.jsx(he.Tooltip,{data:a,body:q,xPos:A,yPos:o,backgroundStyle:L?.tooltip,className:j?.tooltip}):null,y&&w!==void 0?t.jsxRuntimeExports.jsx(ce.X,{open:w!==void 0,onClose:()=>{T(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof y=="string"?{__html:ge.string2HTML(y,w)}:void 0,children:typeof y=="function"?y(w):null})}):null]})}function Me(U){const{data:m,graphTitle:N,colors:O,sources:F,graphDescription:p,showColumnLabels:H=!0,leftMargin:I=100,rightMargin:z=10,truncateBy:_=999,height:q,width:r,scaleType:J,colorDomain:s,footNote:G,colorLegendTitle:$,padding:S,backgroundColor:f=!1,topMargin:X=30,bottomMargin:K=10,tooltip:Y,onSeriesMouseOver:V,suffix:Q="",prefix:y="",showRowLabels:L=!0,relativeHeight:j,showValues:v,graphID:Z,noDataColor:W=i.Colors.gray,showColorScale:D=!0,onSeriesMouseClick:l,graphDownload:w=!1,dataDownload:T=!1,fillContainer:a=!0,language:M="en",showNAColor:A=!0,minHeight:b=0,theme:o="light",ariaLabel:B,resetSelectionOnDoubleClick:ee=!0,detailsOnClick:te,styles:h,classNames:d,animate:E=!1,precision:k=2}=U,[u,R]=x.useState(0),[P,e]=x.useState(0),[C,g]=x.useState(void 0),c=x.useRef(null),ie=x.useRef(null);x.useEffect(()=>{const n=new ResizeObserver(ne=>{R(r||ne[0].target.clientWidth||620),e(q||ne[0].target.clientHeight||480)});return c.current&&(e(c.current.clientHeight||480),R(c.current.clientWidth||620),r||n.observe(c.current)),()=>n.disconnect()},[r,q]);const oe=J||(typeof s[0]=="string"?"categorical":s.length===2?"linear":"threshold");return t.jsxRuntimeExports.jsx("div",{className:`${o||"light"} flex ${r?"grow-0":"grow"} ${a?"w-full":"w-fit"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${f?f===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,a?"w-full":"w-fit",d?.graphContainer),style:{...h?.graphContainer||{},...f&&f!==!0?{backgroundColor:f}:{}},id:Z,ref:ie,"aria-label":B||`${N?`The graph shows ${N}. `:""}This is a heatmap. ${p?` ${p}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:f?S||"1rem":S||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[N||p||w||T?t.jsxRuntimeExports.jsx(ve.GraphHeader,{styles:{title:h?.title,description:h?.description},classNames:{title:d?.title,description:d?.description},graphTitle:N,graphDescription:p,width:r,graphDownload:w?ie.current:void 0,dataDownload:T?m.map(n=>n.data).filter(n=>n!==void 0).length>0?m.map(n=>n.data).filter(n=>n!==void 0):m.filter(n=>n!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:m.length===0?t.jsxRuntimeExports.jsx(qe.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[D?oe==="categorical"?t.jsxRuntimeExports.jsx(be.ColorLegendWithMouseOver,{width:a?void 0:r,colorLegendTitle:$,colors:O||(typeof s[0]=="string"?i.Colors[o].categoricalColors.colors:s.length===2?[i.Colors[o].sequentialColors.neutralColorsx09[0],i.Colors[o].sequentialColors.neutralColorsx09[8]]:i.Colors[o].sequentialColors[`neutralColorsx0${s.length+1}`]),colorDomain:s.map(n=>`${n}`),setSelectedColor:g,showNAColor:A}):oe==="threshold"?t.jsxRuntimeExports.jsx(Re.ThresholdColorLegendWithMouseOver,{width:a?void 0:r,colorLegendTitle:$,colors:O||(typeof s[0]=="string"?i.Colors[o].categoricalColors.colors:s.length===2?[i.Colors[o].sequentialColors.neutralColorsx09[0],i.Colors[o].sequentialColors.neutralColorsx09[8]]:i.Colors[o].sequentialColors[`neutralColorsx0${s.length+1}`]),colorDomain:s,setSelectedColor:g,naColor:W,showNAColor:A}):t.jsxRuntimeExports.jsx(Ee.LinearColorLegend,{width:a?void 0:r,colorLegendTitle:$,colors:O||[i.Colors[o].sequentialColors.neutralColorsx09[0],i.Colors[o].sequentialColors.neutralColorsx09[8]],colorDomain:s}):null,t.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center w-full leading-0",ref:c,"aria-label":"Graph area",children:(r||u)&&(q||P)?t.jsxRuntimeExports.jsx($e,{data:m,colorDomain:s,width:r||u,colors:O||(typeof s[0]=="string"?i.Colors[o].categoricalColors.colors:s.length===2?[i.Colors[o].sequentialColors.neutralColorsx09[0],i.Colors[o].sequentialColors.neutralColorsx09[8]]:i.Colors[o].sequentialColors[`neutralColorsx0${s.length+1}`]),noDataColor:W,scaleType:oe,height:Math.max(b,q||(j?b?(r||u)*j>b?(r||u)*j:b:(r||u)*j:P)),showColumnLabels:H,leftMargin:I,rightMargin:z,topMargin:X,bottomMargin:K,selectedColor:C,truncateBy:_,showRowLabels:L,tooltip:Y,onSeriesMouseOver:V,showValues:v,suffix:Q,prefix:y,onSeriesMouseClick:l,resetSelectionOnDoubleClick:ee,detailsOnClick:te,styles:h,classNames:d,animate:E===!0?{duration:.5,once:!0,amount:.5}:E||{duration:0,once:!0,amount:0},precision:k}):null})]})}),F||G?t.jsxRuntimeExports.jsx(we.GraphFooter,{styles:{footnote:h?.footnote,source:h?.source},classNames:{footnote:d?.footnote,source:d?.source},sources:F,footNote:G,width:r}):null]})})})})}exports.HeatMap=Me;
|
|
2
2
|
//# sourceMappingURL=HeatMap.cjs.map
|
package/dist/HeatMap.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { j as t, m as me } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
2
|
import { useRef as ae, useState as O, useEffect as ue } from "react";
|
|
3
|
-
import { i as he } from "./index-
|
|
4
|
-
import { u as ne } from "./index-
|
|
3
|
+
import { i as he } from "./index-Bwrro8-q.js";
|
|
4
|
+
import { u as ne } from "./index-AqnpA7_O.js";
|
|
5
5
|
import { X as ge } from "./Modal-DVVwpKhP.js";
|
|
6
6
|
import { n as de } from "./numberFormattingFunction-14YCbkN2.js";
|
|
7
|
-
import { T as pe } from "./Tooltip-
|
|
7
|
+
import { T as pe } from "./Tooltip-CVCGWyzw.js";
|
|
8
8
|
import { g as fe } from "./getTextColorBasedOnBgColor-B6Nk2WBf.js";
|
|
9
9
|
import { c as re } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
10
|
-
import { s as xe } from "./string2HTML-
|
|
10
|
+
import { s as xe } from "./string2HTML-oFCROsus.js";
|
|
11
11
|
import { X as we } from "./XAxesLabels-CaV2q-6H.js";
|
|
12
12
|
import { Y as ye } from "./YAxesLabels-CPGZjmZJ.js";
|
|
13
13
|
import { b as ce } from "./band-BEjh2CHI.js";
|
package/dist/Histogram.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("./index-CHPV5EwG-DDoeWRVt.cjs"),z=require("react"),_=require("./Spinner-DA6Z5E4n.cjs"),F=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("./index-CHPV5EwG-DDoeWRVt.cjs"),z=require("react"),_=require("./Spinner-DA6Z5E4n.cjs"),F=require("./index-Da2GUKrr.cjs"),ee=require("./TreeMapGraph.cjs"),re=require("./DonutChart.cjs"),te=require("./BarGraph.cjs"),B=require("./Colors.cjs"),ie=require("./init-DU0ybBc_.cjs"),H=require("./linear-BVckp9RD.cjs");function ne(o,s){let c=0;for(let a of o)a!=null&&(a=+a)>=a&&++c;return c}function oe(o){return o}var ae=Array.prototype,se=ae.slice;function N(o){return()=>o}function le(o,s,c){let a;for(;;){const e=H.tickIncrement(o,s,c);if(e===a||e===0||!isFinite(e))return[o,s];e>0?(o=Math.floor(o/e)*e,s=Math.ceil(s/e)*e):e<0&&(o=Math.ceil(o*e)/e,s=Math.floor(s*e)/e),a=e}}function ue(o){return Math.max(1,Math.ceil(Math.log(ne(o))/Math.LN2)+1)}function ce(){var o=oe,s=F.extent,c=ue;function a(e){Array.isArray(e)||(e=Array.from(e));var r,m=e.length,l,p,g=new Array(m);for(r=0;r<m;++r)g[r]=o(e[r],r,e);var f=s(g),t=f[0],i=f[1],n=c(g,t,i);if(!Array.isArray(n)){const C=i,y=+n;if(s===F.extent&&([t,i]=le(t,i,y)),n=H.ticks(t,i,y),n[0]<=t&&(p=H.tickIncrement(t,i,y)),n[n.length-1]>=i)if(C>=i&&s===F.extent){const h=H.tickIncrement(t,i,y);isFinite(h)&&(h>0?i=(Math.floor(i/h)+1)*h:h<0&&(i=(Math.ceil(i*-h)+1)/-h))}else n.pop()}for(var u=n.length,x=0,d=u;n[x]<=t;)++x;for(;n[d-1]>i;)--d;(x||d<u)&&(n=n.slice(x,d),u=d-x);var M=new Array(u+1),b;for(r=0;r<=u;++r)b=M[r]=[],b.x0=r>0?n[r-1]:t,b.x1=r<u?n[r]:i;if(isFinite(p)){if(p>0)for(r=0;r<m;++r)(l=g[r])!=null&&t<=l&&l<=i&&M[Math.min(u,Math.floor((l-t)/p))].push(e[r]);else if(p<0){for(r=0;r<m;++r)if((l=g[r])!=null&&t<=l&&l<=i){const C=Math.floor((t-l)*p);M[Math.min(u,C+(n[C]<=l))].push(e[r])}}}else for(r=0;r<m;++r)(l=g[r])!=null&&t<=l&&l<=i&&M[ie.bisectRight(n,l,0,u)].push(e[r]);return M}return a.value=function(e){return arguments.length?(o=typeof e=="function"?e:N(e),a):o},a.domain=function(e){return arguments.length?(s=typeof e=="function"?e:N([e[0],e[1]]),a):s},a.thresholds=function(e){return arguments.length?(c=typeof e=="function"?e:N(Array.isArray(e)?se.call(e):e),a):c},a}function he(o){const{data:s,graphTitle:c,sources:a,graphDescription:e,barPadding:r,showValues:m,showTicks:l,leftMargin:p,rightMargin:g,height:f,width:t,footNote:i,colors:n,padding:u,backgroundColor:x,topMargin:d,bottomMargin:M,showLabels:b,relativeHeight:C,tooltip:y,onSeriesMouseOver:h,refValues:W,graphID:S,maxValue:U,onSeriesMouseClick:q,graphDownload:A,dataDownload:E,numberOfBins:O,truncateBy:J,graphType:I,barGraphLayout:K,donutStrokeWidth:Q,sortData:V,language:D,minHeight:L,theme:w="light",maxBarThickness:X,ariaLabel:G,detailsOnClick:R,styles:T,classNames:P,precision:$}=o,[k,Y]=z.useState([]);return z.useEffect(()=>{const Z=ce().thresholds(O||10).value(v=>v.value)(s).map(v=>({label:`${v.x0}-${v.x1}`,size:v.length,data:{options:`${v.x0}-${v.x1}`,frequency:v.length}}));Y(Z)},[s,O]),k.length===0?j.jsxRuntimeExports.jsx("div",{style:{width:`${t}px`,height:`${f}px`,margin:"auto"},children:j.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:j.jsxRuntimeExports.jsx(_.y,{})})}):I==="circlePacking"?j.jsxRuntimeExports.jsx(F.CirclePackingGraph,{colors:n||B.Colors.graphMainColor,graphTitle:c,graphDescription:e,footNote:i,width:t,height:f,sources:a,leftMargin:p,rightMargin:g,backgroundColor:x,padding:u,topMargin:d,bottomMargin:M,relativeHeight:C,showLabels:b,tooltip:y,onSeriesMouseOver:h,showColorScale:!1,showValues:m,graphID:S,onSeriesMouseClick:q,graphDownload:A,dataDownload:E,data:k,language:D,minHeight:L,theme:w,ariaLabel:G,detailsOnClick:R,styles:T,classNames:P,precision:$}):I==="treeMap"?j.jsxRuntimeExports.jsx(ee.TreeMapGraph,{colors:n||B.Colors.graphMainColor,graphTitle:c,graphDescription:e,footNote:i,width:t,height:f,sources:a,leftMargin:p,rightMargin:g,backgroundColor:x,padding:u,topMargin:d,bottomMargin:M,relativeHeight:C,showLabels:b,tooltip:y,onSeriesMouseOver:h,showColorScale:!1,showValues:m,graphID:S,onSeriesMouseClick:q,graphDownload:A,dataDownload:E,data:k,language:D,minHeight:L,theme:w,ariaLabel:G,detailsOnClick:R,styles:T,classNames:P,precision:$}):I==="donutChart"?j.jsxRuntimeExports.jsx(re.DonutChart,{colors:n||B.Colors[w].categoricalColors.colors,graphTitle:c,graphDescription:e,footNote:i,radius:t&&f?t<f?t:f:t||f||void 0,sources:a,backgroundColor:x,padding:u,tooltip:y,onSeriesMouseOver:h,graphID:S,onSeriesMouseClick:q,graphDownload:A,dataDownload:E,data:k,strokeWidth:Q,showColorScale:!0,sortData:V,language:D,theme:w,ariaLabel:G,detailsOnClick:R,styles:T,classNames:P,precision:$}):j.jsxRuntimeExports.jsx(te.SimpleBarGraph,{colors:n||B.Colors.graphMainColor,graphTitle:c,graphDescription:e,footNote:i,width:t,height:f,sources:a,leftMargin:p,rightMargin:g,backgroundColor:x,padding:u,topMargin:d,bottomMargin:M,relativeHeight:C,showLabels:b,tooltip:y,onSeriesMouseOver:h,showColorScale:!1,showValues:m,graphID:S,onSeriesMouseClick:q,graphDownload:A,dataDownload:E,data:k,barPadding:r,refValues:W,truncateBy:J,maxValue:U,showTicks:l,sortData:V,language:D,minHeight:L,theme:w,maxBarThickness:X,ariaLabel:G,orientation:K,detailsOnClick:R,styles:T,classNames:P,precision:$})}exports.Histogram=he;
|
|
2
2
|
//# sourceMappingURL=Histogram.cjs.map
|
package/dist/Histogram.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as C } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
2
|
import { useState as Z, useEffect as _ } from "react";
|
|
3
3
|
import { y as rr } from "./Spinner-C85UF28E.js";
|
|
4
|
-
import { e as P, C as er } from "./index-
|
|
4
|
+
import { e as P, C as er } from "./index-BMgDMxKJ.js";
|
|
5
5
|
import { TreeMapGraph as tr } from "./TreeMapGraph.js";
|
|
6
6
|
import { DonutChart as or } from "./DonutChart.js";
|
|
7
7
|
import { SimpleBarGraph as ir } from "./BarGraph.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),p=require("react"),y=require("./parse-hMnG_lRV.cjs"),qt=require("./index-BzeLQvXk.cjs"),kt=require("./simple-statistics-xm8c0LQQ.cjs"),ot=require("./numberFormattingFunction-02t-wJta.cjs"),$t=require("./Tooltip-n8z5bfav.cjs"),v=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),bt=require("./customArea-CK768gCn.cjs"),Ft=require("./AxisTitle-CK9YeovX.cjs"),Tt=require("./Axis-DE7dSn1_.cjs"),Wt=require("./ReferenceLine-CFVBBN__.cjs"),Ht=require("./RegressionLine-xKdiJ8sw.cjs"),Pt=require("./YTicksAndGridLines-DBDuz6vb.cjs"),Ut=require("./index-DNj994Pv.cjs"),Yt=require("./time-Byw_jYQ7.cjs"),Gt=require("./linear-BVckp9RD.cjs"),lt=require("./line-DHV4JwCR.cjs"),ct=require("./step-BZ3C8QFW.cjs"),Xt=require("./area-D3Qx7k7K.cjs"),Bt=require("./select-Bnfk0lJx.cjs"),zt=require("./init-DU0ybBc_.cjs"),Jt=require("./pointer-Dkq5NV1q.cjs"),Kt=require("./use-in-view-sQJZ_xDO.cjs"),f=require("./proxy-BHRoeZgd.cjs"),Qt=require("./GraphFooter.cjs"),Zt=require("./GraphHeader.cjs"),xt=require("./Colors.cjs"),_t=require("./ColorLegend.cjs"),te=require("./EmptyState-d8_8SxeW.cjs");function ee(ut){const{data:A,width:M,height:$,lineColor:k,suffix:I,prefix:j,dateFormat:o,highlightAreaSettings:m,showValues:G,noOfXTicks:mt,rightMargin:ht,leftMargin:R,topMargin:C,bottomMargin:X,tooltip:B,onSeriesMouseOver:F,refValues:z,minValue:J,maxValue:K,animate:a,rtl:Q,strokeWidth:yt,showDots:D,annotations:pt,customHighlightAreaSettings:dt,regressionLine:T,showIntervalDots:gt,showIntervalValues:ft,intervalLineStrokeWidth:W,intervalLineColors:b,intervalAreaColor:jt,intervalAreaOpacity:wt,yAxisTitle:Z,noOfYTicks:vt,minDate:H,maxDate:P,curveType:L,styles:c,classNames:x,precision:N,customLayers:_}=ut,tt=p.useRef(null),l=Kt.useInView(tt,{once:a.once,amount:a.amount}),[u,Rt]=p.useState(!1);p.useEffect(()=>{if(l&&!u){const t=setTimeout(()=>{Rt(!0)},(a.duration+.5)*1e3);return()=>clearTimeout(t)}},[l,u,a.duration]);const S=L==="linear"?lt.curveLinear:L==="step"?ct.curveStep:L==="stepAfter"?ct.stepAfter:L==="stepBefore"?ct.stepBefore:ct.monotoneX,[V,et]=p.useState(void 0),[it,nt]=p.useState(void 0),[U,Y]=p.useState(void 0),d={top:C,bottom:X,left:Z?R+30:R,right:ht},E=p.useRef(null),n=qt.sortBy(A.filter(t=>!v.checkIfNullOrUndefined(t.y)).map(t=>({date:y.parse(`${t.date}`,o,new Date),y:t.y,yMin:v.checkIfNullOrUndefined(t.yMin)?t.y:t.yMin,yMax:v.checkIfNullOrUndefined(t.yMax)?t.y:t.yMax,data:t.data})),"date"),Et=m.map(t=>({...t,coordinates:[t.coordinates[0]===null?null:y.parse(`${t.coordinates[0]}`,o,new Date),t.coordinates[1]===null?null:y.parse(`${t.coordinates[1]}`,o,new Date)]})),Mt=dt.map(t=>({...t,coordinates:t.coordinates.map((g,O)=>O%2===0?y.parse(`${g}`,o,new Date):g)})),r=M-d.left-d.right,w=$-d.top-d.bottom,at=H?y.parse(`${H}`,o,new Date):n[0].date,st=P?y.parse(`${P}`,o,new Date):n[n.length-1].date,h=v.checkIfNullOrUndefined(J)?Math.min(...n.map(t=>Math.min(t.y,t.yMax,t.yMin)))?Math.min(...n.map(t=>Math.min(t.y,t.yMax,t.yMin)))>0?0:Math.min(...n.map(t=>Math.min(t.y,t.yMax,t.yMin))):0:J,q=Math.max(...n.map(t=>Math.max(t.y,t.yMax,t.yMin)))?Math.max(...n.map(t=>Math.max(t.y,t.yMax,t.yMin))):0,i=Yt.time().domain([at,st]).range([0,r]),s=Gt.linear().domain([h,v.checkIfNullOrUndefined(K)?q>0?q:0:K]).range([w,0]).nice(),Ot=lt.line().x(t=>i(t.date)).y(t=>s(t.y)).curve(S),At=lt.line().x(t=>i(t.date)).y(t=>s(t.yMin)).curve(S),It=lt.line().x(t=>i(t.date)).y(t=>s(t.yMax)).curve(S),Lt=Xt.area().x(t=>i(t.date)).y0(t=>s(t.yMin)).y1(t=>s(t.yMax)).curve(S),Nt=s.ticks(vt),Dt=i.ticks(mt);p.useEffect(()=>{const t=O=>{const rt=n[zt.bisectCenter(n.map(Ct=>Ct.date),i.invert(Jt.pointer(O)[0]),0)];et(rt||n[n.length-1]),F?.(rt||n[n.length-1]),Y(O.clientY),nt(O.clientX)},g=()=>{et(void 0),nt(void 0),Y(void 0),F?.(void 0)};Bt.select(E.current).on("mousemove",t).on("mouseout",g)},[i,n,F]);const St=kt.linearRegression(n.filter(t=>!v.checkIfNullOrUndefined(t.date)&&!v.checkIfNullOrUndefined(t.y)).map(t=>[i(t.date),s(t.y)])),Vt=kt.linearRegressionLine(St);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(f.motion.svg,{width:`${M}px`,height:`${$}px`,viewBox:`0 0 ${M} ${$}`,direction:"ltr",ref:tt,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${d.left},${d.top})`,children:[e.jsxRuntimeExports.jsx(Ut.HighlightArea,{areaSettings:Et,width:r,height:w,scale:i,animate:a,isInView:l}),e.jsxRuntimeExports.jsx(bt.CustomArea,{areaSettings:Mt,scaleX:i,scaleY:s,animate:a,isInView:l}),e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(Pt.YTicksAndGridLines,{values:Nt.filter(t=>t!==0),y:Nt.filter(t=>t!==0).map(t=>s(t)),x1:0-R,x2:r+d.right,styles:{gridLines:c?.yAxis?.gridLines,labels:c?.yAxis?.labels},classNames:{gridLines:x?.yAxis?.gridLines,labels:x?.yAxis?.labels},suffix:I,prefix:j,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:N}),e.jsxRuntimeExports.jsx(Tt.Axis,{y1:s(h<0?0:h),y2:s(h<0?0:h),x1:0-R,x2:r+d.right,label:ot.numberFormattingFunction(h<0?0:h,"NA",N,j,I),labelPos:{x:0-R,y:s(h<0?0:h),dx:0,dy:q<0?"1em":-5},classNames:{axis:x?.xAxis?.axis,label:x?.yAxis?.labels},styles:{axis:c?.xAxis?.axis,label:c?.yAxis?.labels}}),e.jsxRuntimeExports.jsx(Ft.AxisTitle,{x:0-R+15,y:w/2,style:c?.yAxis?.title,className:x?.yAxis?.title,text:Z,rotate90:!0})]}),e.jsxRuntimeExports.jsx("g",{children:Dt.map((t,g)=>e.jsxRuntimeExports.jsx("g",{children:e.jsxRuntimeExports.jsx("text",{y:w,x:i(t),style:{textAnchor:"middle"},className:"fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",dy:15,children:y.format(t,o)})},g))}),_.filter(t=>t.position==="before").map(t=>t.layer),e.jsxRuntimeExports.jsx(f.motion.path,{style:{fill:jt},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,d:Lt(n)||""},whileInView:{opacity:wt,d:Lt(n)||"",transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"}),W?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(f.motion.path,{style:{stroke:b[0],fill:"none",strokeWidth:W},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{pathLength:0,d:At(n)||"",opacity:1},whileInView:{pathLength:1,d:At(n)||"",opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"}),e.jsxRuntimeExports.jsx(f.motion.path,{style:{stroke:b[1],fill:"none",strokeWidth:W},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{pathLength:0,d:It(n)||"",opacity:1},whileInView:{pathLength:1,d:It(n)||"",opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"})]}):null,e.jsxRuntimeExports.jsx(f.motion.path,{style:{stroke:k,fill:"none",strokeWidth:yt},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{pathLength:0,d:Ot(n)||"",opacity:1},whileInView:{pathLength:1,d:Ot(n)||"",opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"}),V?e.jsxRuntimeExports.jsx("line",{y1:0,y2:w,x1:i(V.date),x2:i(V.date),className:e.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",x?.mouseOverLine),style:c?.mouseOverLine}):null,e.jsxRuntimeExports.jsx("g",{children:n.map((t,g)=>e.jsxRuntimeExports.jsx(f.motion.g,{children:v.checkIfNullOrUndefined(t.y)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[D?e.jsxRuntimeExports.jsx(f.motion.circle,{r:r/n.length<5?0:r/n.length<20?2:4,style:{fill:k},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,cx:i(t.date),cy:s(t.y)},whileInView:{opacity:1,transition:{duration:u?a.duration:.5,delay:u?0:a.duration},cx:i(t.date),cy:s(t.y)}},initial:"initial",animate:l?"whileInView":"initial"}):null,gt?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(f.motion.circle,{r:r/n.length<5?0:r/n.length<20?2:4,style:{fill:b[0]},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,cx:i(t.date),cy:s(t.yMin)},whileInView:{opacity:1,transition:{duration:u?a.duration:.5,delay:u?0:a.duration},cx:i(t.date),cy:s(t.yMin)}},initial:"initial",animate:l?"whileInView":"initial"}),e.jsxRuntimeExports.jsx(f.motion.circle,{r:r/n.length<5?0:r/n.length<20?2:4,style:{fill:b[1]},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,cx:i(t.date),cy:s(t.yMax)},whileInView:{opacity:1,transition:{duration:u?a.duration:.5,delay:u?0:a.duration},cx:i(t.date),cy:s(t.yMax)}},initial:"initial",animate:l?"whileInView":"initial"})]}):null,G?e.jsxRuntimeExports.jsx(f.motion.text,{dy:-8,style:{fill:k,textAnchor:"middle",...c?.graphObjectValues||{}},className:e.mo("graph-value text-xs font-bold",x?.graphObjectValues),exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,x:i(t.date),y:s(t.y)},whileInView:{opacity:1,x:i(t.date),y:s(t.y),transition:{duration:u?a.duration:.5,delay:u?0:a.duration}}},initial:"initial",animate:l?"whileInView":"initial",children:ot.numberFormattingFunction(t.y,"NA",N,j,I)}):null,ft?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(f.motion.text,{dy:"1em",style:{fill:b[0],textAnchor:"middle",...c?.graphObjectValues||{}},className:e.mo("text-xs font-bold",x?.graphObjectValues),exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,x:i(t.date),y:s(t.yMin)},whileInView:{opacity:1,x:i(t.date),y:s(t.yMin),transition:{duration:u?a.duration:.5,delay:u?0:a.duration}}},initial:"initial",animate:l?"whileInView":"initial",children:ot.numberFormattingFunction(t.yMin,"NA",N,j,I)}),e.jsxRuntimeExports.jsx(f.motion.text,{dy:-8,style:{fill:b[1],textAnchor:"middle",...c?.graphObjectValues||{}},className:e.mo("text-xs font-bold",x?.graphObjectValues),exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,x:i(t.date),y:s(t.yMax)},whileInView:{opacity:1,x:i(t.date),y:s(t.yMax),transition:{duration:u?a.duration:.5,delay:u?0:a.duration}}},initial:"initial",animate:l?"whileInView":"initial",children:ot.numberFormattingFunction(t.yMax,"NA",N,j,I)})]}):null]})},g))}),z?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:z.map((t,g)=>e.jsxRuntimeExports.jsx(Wt.RefLineY,{text:t.text,color:t.color,y:s(t.value),x1:0-R,x2:r+d.right,classNames:t.classNames,styles:t.styles,animate:a,isInView:l},g))}):null,e.jsxRuntimeExports.jsx("g",{children:pt.map((t,g)=>{const O=bt.getLineEndPoint({x:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),y:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0)-8:0+(t.yOffset||0)-8},{x:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date)):0,y:t.yCoordinate?s(t.yCoordinate):0},v.checkIfNullOrUndefined(t.connectorRadius)?3.5:t.connectorRadius),rt=t.showConnector?{y1:O.y,x1:O.x,y2:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0):0+(t.yOffset||0),x2:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),cy:t.yCoordinate?s(t.yCoordinate):0,cx:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date)):0,circleRadius:v.checkIfNullOrUndefined(t.connectorRadius)?3.5:t.connectorRadius,strokeWidth:t.showConnector===!0?2:Math.min(t.showConnector||0,1)}:void 0,Ct={y:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0)-8:0+(t.yOffset||0)-8,x:Q?0:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),width:Q?t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0):r+d.right-(t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0)),maxWidth:t.maxWidth,fontWeight:t.fontWeight,align:t.align};return e.jsxRuntimeExports.jsx(bt.Annotation,{color:t.color,connectorsSettings:rt,labelSettings:Ct,text:t.text,classNames:t.classNames,styles:t.styles,animate:a,isInView:l},g)})}),e.jsxRuntimeExports.jsx("g",{children:T?e.jsxRuntimeExports.jsx(Ht.RegressionLine,{x1:0,x2:r,y1:Vt(0),y2:Vt(r),graphHeight:w,graphWidth:r,className:x?.regLine,style:c?.regLine,color:typeof T=="string"?T:void 0,animate:a,isInView:l}):null}),_.filter(t=>t.position==="after").map(t=>t.layer),e.jsxRuntimeExports.jsx("rect",{ref:E,style:{fill:"none",pointerEvents:"all"},width:r,height:w})]})}),V&&B&&it&&U?e.jsxRuntimeExports.jsx($t.Tooltip,{data:V,body:B,xPos:it,yPos:U,backgroundStyle:c?.tooltip,className:x?.tooltip}):null]})}function ie(ut){const{data:A,graphTitle:M,suffix:$="",sources:k,prefix:I="",graphDescription:j,height:o,width:m,footNote:G,noOfXTicks:mt=10,dateFormat:ht="yyyy",showValues:R=!1,backgroundColor:C=!1,padding:X,lineColor:B,leftMargin:F=30,rightMargin:z=30,topMargin:J=20,bottomMargin:K=25,tooltip:a,refValues:Q=[],highlightAreaSettings:yt=[],relativeHeight:D,onSeriesMouseOver:pt,graphID:dt,minValue:T,maxValue:gt,regressionLine:ft=!1,showIntervalDots:W=!1,showIntervalValues:b=!1,intervalLineStrokeWidth:jt=0,intervalLineColors:wt=[xt.Colors.light.grays["gray-500"],xt.Colors.light.grays["gray-500"]],intervalAreaColor:Z=xt.Colors.primaryColors["blue-100"],intervalAreaOpacity:vt=.4,graphDownload:H=!1,dataDownload:P=!1,animate:L=!1,language:c="en",minHeight:x=0,strokeWidth:N=2,showDots:_=!0,annotations:tt=[],customHighlightAreaSettings:l=[],theme:u="light",ariaLabel:Rt,yAxisTitle:S,noOfYTicks:V=5,minDate:et,maxDate:it,colorLegendTitle:nt,colorLegendColors:U,colorLegendDomain:Y,curveType:d="curve",styles:E,classNames:n,precision:Et=2,customLayers:Mt=[]}=ut,[r,w]=p.useState(0),[at,st]=p.useState(0),h=p.useRef(null),q=p.useRef(null);return p.useEffect(()=>{const i=new ResizeObserver(s=>{w(m||s[0].target.clientWidth||620),st(o||s[0].target.clientHeight||480)});return h.current&&(st(h.current.clientHeight||480),w(h.current.clientWidth||620),m||i.observe(h.current)),()=>i.disconnect()},[m,o]),e.jsxRuntimeExports.jsx("div",{className:`${u||"light"} flex ${m?"w-fit grow-0":"w-full grow"}`,dir:c==="he"||c==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${C?C===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${c||"en"}`,m?"w-fit":"w-full",n?.graphContainer),style:{...E?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:dt,ref:q,"aria-label":Rt||`${M?`The graph shows ${M}. `:""}This is a line chart that highlights the difference between two datasets over time.${j?` ${j}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?X||"1rem":X||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[M||j||H||P?e.jsxRuntimeExports.jsx(Zt.GraphHeader,{styles:{title:E?.title,description:E?.description},classNames:{title:n?.title,description:n?.description},graphTitle:M,graphDescription:j,width:m,graphDownload:H?q.current:void 0,dataDownload:P?A.map(i=>i.data).filter(i=>i!==void 0).length>0?A.map(i=>i.data).filter(i=>i!==void 0):A.filter(i=>i!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:A.length===0?e.jsxRuntimeExports.jsx(te.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[U&&Y?e.jsxRuntimeExports.jsx(_t.ColorLegend,{width:m,colorLegendTitle:nt,colors:U,colorDomain:Y,showNAColor:!1}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:h,"aria-label":"Graph area",children:(m||r)&&(o||at)?e.jsxRuntimeExports.jsx(ee,{data:A,lineColor:B||xt.Colors.primaryColors["blue-600"],width:m||r,height:Math.max(x,o||(D?x?(m||r)*D>x?(m||r)*D:x:(m||r)*D:at)),suffix:$,prefix:I,dateFormat:ht,showValues:R,noOfXTicks:mt,leftMargin:F,rightMargin:z,topMargin:J,bottomMargin:K,tooltip:a,highlightAreaSettings:yt,onSeriesMouseOver:pt,refValues:Q,minValue:T,maxValue:gt,animate:L===!0?{duration:.5,once:!0,amount:.5}:L||{duration:0,once:!0,amount:0},rtl:c==="he"||c==="ar",strokeWidth:N,showDots:_,annotations:tt,customHighlightAreaSettings:l,regressionLine:ft,showIntervalDots:W,showIntervalValues:b,intervalLineStrokeWidth:jt,intervalLineColors:wt,intervalAreaColor:Z,intervalAreaOpacity:vt,yAxisTitle:S,noOfYTicks:V,minDate:et,maxDate:it,curveType:d,styles:E,classNames:n,precision:Et,customLayers:Mt}):null})]})}),k||G?e.jsxRuntimeExports.jsx(Qt.GraphFooter,{styles:{footnote:E?.footnote,source:E?.source},classNames:{footnote:n?.footnote,source:n?.source},sources:k,footNote:G,width:m}):null]})})})})}exports.LineChartWithConfidenceInterval=ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),p=require("react"),y=require("./parse-hMnG_lRV.cjs"),qt=require("./index-DYH8g9WA.cjs"),kt=require("./simple-statistics-xm8c0LQQ.cjs"),ot=require("./numberFormattingFunction-02t-wJta.cjs"),$t=require("./Tooltip-De16GWhY.cjs"),v=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),bt=require("./customArea-CK768gCn.cjs"),Ft=require("./AxisTitle-CK9YeovX.cjs"),Tt=require("./Axis-DE7dSn1_.cjs"),Wt=require("./ReferenceLine-CFVBBN__.cjs"),Ht=require("./RegressionLine-xKdiJ8sw.cjs"),Pt=require("./YTicksAndGridLines-DBDuz6vb.cjs"),Ut=require("./index-BYzIB5V6.cjs"),Yt=require("./time-Byw_jYQ7.cjs"),Gt=require("./linear-BVckp9RD.cjs"),lt=require("./line-DHV4JwCR.cjs"),ct=require("./step-BZ3C8QFW.cjs"),Xt=require("./area-D3Qx7k7K.cjs"),Bt=require("./select-Bnfk0lJx.cjs"),zt=require("./init-DU0ybBc_.cjs"),Jt=require("./pointer-Dkq5NV1q.cjs"),Kt=require("./use-in-view-sQJZ_xDO.cjs"),f=require("./proxy-BHRoeZgd.cjs"),Qt=require("./GraphFooter.cjs"),Zt=require("./GraphHeader.cjs"),xt=require("./Colors.cjs"),_t=require("./ColorLegend.cjs"),te=require("./EmptyState-d8_8SxeW.cjs");function ee(ut){const{data:A,width:M,height:$,lineColor:k,suffix:I,prefix:j,dateFormat:o,highlightAreaSettings:m,showValues:G,noOfXTicks:mt,rightMargin:ht,leftMargin:R,topMargin:C,bottomMargin:X,tooltip:B,onSeriesMouseOver:F,refValues:z,minValue:J,maxValue:K,animate:a,rtl:Q,strokeWidth:yt,showDots:D,annotations:pt,customHighlightAreaSettings:dt,regressionLine:T,showIntervalDots:gt,showIntervalValues:ft,intervalLineStrokeWidth:W,intervalLineColors:b,intervalAreaColor:jt,intervalAreaOpacity:wt,yAxisTitle:Z,noOfYTicks:vt,minDate:H,maxDate:P,curveType:L,styles:c,classNames:x,precision:N,customLayers:_}=ut,tt=p.useRef(null),l=Kt.useInView(tt,{once:a.once,amount:a.amount}),[u,Rt]=p.useState(!1);p.useEffect(()=>{if(l&&!u){const t=setTimeout(()=>{Rt(!0)},(a.duration+.5)*1e3);return()=>clearTimeout(t)}},[l,u,a.duration]);const S=L==="linear"?lt.curveLinear:L==="step"?ct.curveStep:L==="stepAfter"?ct.stepAfter:L==="stepBefore"?ct.stepBefore:ct.monotoneX,[V,et]=p.useState(void 0),[it,nt]=p.useState(void 0),[U,Y]=p.useState(void 0),d={top:C,bottom:X,left:Z?R+30:R,right:ht},E=p.useRef(null),n=qt.sortBy(A.filter(t=>!v.checkIfNullOrUndefined(t.y)).map(t=>({date:y.parse(`${t.date}`,o,new Date),y:t.y,yMin:v.checkIfNullOrUndefined(t.yMin)?t.y:t.yMin,yMax:v.checkIfNullOrUndefined(t.yMax)?t.y:t.yMax,data:t.data})),"date"),Et=m.map(t=>({...t,coordinates:[t.coordinates[0]===null?null:y.parse(`${t.coordinates[0]}`,o,new Date),t.coordinates[1]===null?null:y.parse(`${t.coordinates[1]}`,o,new Date)]})),Mt=dt.map(t=>({...t,coordinates:t.coordinates.map((g,O)=>O%2===0?y.parse(`${g}`,o,new Date):g)})),r=M-d.left-d.right,w=$-d.top-d.bottom,at=H?y.parse(`${H}`,o,new Date):n[0].date,st=P?y.parse(`${P}`,o,new Date):n[n.length-1].date,h=v.checkIfNullOrUndefined(J)?Math.min(...n.map(t=>Math.min(t.y,t.yMax,t.yMin)))?Math.min(...n.map(t=>Math.min(t.y,t.yMax,t.yMin)))>0?0:Math.min(...n.map(t=>Math.min(t.y,t.yMax,t.yMin))):0:J,q=Math.max(...n.map(t=>Math.max(t.y,t.yMax,t.yMin)))?Math.max(...n.map(t=>Math.max(t.y,t.yMax,t.yMin))):0,i=Yt.time().domain([at,st]).range([0,r]),s=Gt.linear().domain([h,v.checkIfNullOrUndefined(K)?q>0?q:0:K]).range([w,0]).nice(),Ot=lt.line().x(t=>i(t.date)).y(t=>s(t.y)).curve(S),At=lt.line().x(t=>i(t.date)).y(t=>s(t.yMin)).curve(S),It=lt.line().x(t=>i(t.date)).y(t=>s(t.yMax)).curve(S),Lt=Xt.area().x(t=>i(t.date)).y0(t=>s(t.yMin)).y1(t=>s(t.yMax)).curve(S),Nt=s.ticks(vt),Dt=i.ticks(mt);p.useEffect(()=>{const t=O=>{const rt=n[zt.bisectCenter(n.map(Ct=>Ct.date),i.invert(Jt.pointer(O)[0]),0)];et(rt||n[n.length-1]),F?.(rt||n[n.length-1]),Y(O.clientY),nt(O.clientX)},g=()=>{et(void 0),nt(void 0),Y(void 0),F?.(void 0)};Bt.select(E.current).on("mousemove",t).on("mouseout",g)},[i,n,F]);const St=kt.linearRegression(n.filter(t=>!v.checkIfNullOrUndefined(t.date)&&!v.checkIfNullOrUndefined(t.y)).map(t=>[i(t.date),s(t.y)])),Vt=kt.linearRegressionLine(St);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(f.motion.svg,{width:`${M}px`,height:`${$}px`,viewBox:`0 0 ${M} ${$}`,direction:"ltr",ref:tt,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${d.left},${d.top})`,children:[e.jsxRuntimeExports.jsx(Ut.HighlightArea,{areaSettings:Et,width:r,height:w,scale:i,animate:a,isInView:l}),e.jsxRuntimeExports.jsx(bt.CustomArea,{areaSettings:Mt,scaleX:i,scaleY:s,animate:a,isInView:l}),e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(Pt.YTicksAndGridLines,{values:Nt.filter(t=>t!==0),y:Nt.filter(t=>t!==0).map(t=>s(t)),x1:0-R,x2:r+d.right,styles:{gridLines:c?.yAxis?.gridLines,labels:c?.yAxis?.labels},classNames:{gridLines:x?.yAxis?.gridLines,labels:x?.yAxis?.labels},suffix:I,prefix:j,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:N}),e.jsxRuntimeExports.jsx(Tt.Axis,{y1:s(h<0?0:h),y2:s(h<0?0:h),x1:0-R,x2:r+d.right,label:ot.numberFormattingFunction(h<0?0:h,"NA",N,j,I),labelPos:{x:0-R,y:s(h<0?0:h),dx:0,dy:q<0?"1em":-5},classNames:{axis:x?.xAxis?.axis,label:x?.yAxis?.labels},styles:{axis:c?.xAxis?.axis,label:c?.yAxis?.labels}}),e.jsxRuntimeExports.jsx(Ft.AxisTitle,{x:0-R+15,y:w/2,style:c?.yAxis?.title,className:x?.yAxis?.title,text:Z,rotate90:!0})]}),e.jsxRuntimeExports.jsx("g",{children:Dt.map((t,g)=>e.jsxRuntimeExports.jsx("g",{children:e.jsxRuntimeExports.jsx("text",{y:w,x:i(t),style:{textAnchor:"middle"},className:"fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",dy:15,children:y.format(t,o)})},g))}),_.filter(t=>t.position==="before").map(t=>t.layer),e.jsxRuntimeExports.jsx(f.motion.path,{style:{fill:jt},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,d:Lt(n)||""},whileInView:{opacity:wt,d:Lt(n)||"",transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"}),W?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(f.motion.path,{style:{stroke:b[0],fill:"none",strokeWidth:W},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{pathLength:0,d:At(n)||"",opacity:1},whileInView:{pathLength:1,d:At(n)||"",opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"}),e.jsxRuntimeExports.jsx(f.motion.path,{style:{stroke:b[1],fill:"none",strokeWidth:W},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{pathLength:0,d:It(n)||"",opacity:1},whileInView:{pathLength:1,d:It(n)||"",opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"})]}):null,e.jsxRuntimeExports.jsx(f.motion.path,{style:{stroke:k,fill:"none",strokeWidth:yt},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{pathLength:0,d:Ot(n)||"",opacity:1},whileInView:{pathLength:1,d:Ot(n)||"",opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"}),V?e.jsxRuntimeExports.jsx("line",{y1:0,y2:w,x1:i(V.date),x2:i(V.date),className:e.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",x?.mouseOverLine),style:c?.mouseOverLine}):null,e.jsxRuntimeExports.jsx("g",{children:n.map((t,g)=>e.jsxRuntimeExports.jsx(f.motion.g,{children:v.checkIfNullOrUndefined(t.y)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[D?e.jsxRuntimeExports.jsx(f.motion.circle,{r:r/n.length<5?0:r/n.length<20?2:4,style:{fill:k},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,cx:i(t.date),cy:s(t.y)},whileInView:{opacity:1,transition:{duration:u?a.duration:.5,delay:u?0:a.duration},cx:i(t.date),cy:s(t.y)}},initial:"initial",animate:l?"whileInView":"initial"}):null,gt?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(f.motion.circle,{r:r/n.length<5?0:r/n.length<20?2:4,style:{fill:b[0]},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,cx:i(t.date),cy:s(t.yMin)},whileInView:{opacity:1,transition:{duration:u?a.duration:.5,delay:u?0:a.duration},cx:i(t.date),cy:s(t.yMin)}},initial:"initial",animate:l?"whileInView":"initial"}),e.jsxRuntimeExports.jsx(f.motion.circle,{r:r/n.length<5?0:r/n.length<20?2:4,style:{fill:b[1]},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,cx:i(t.date),cy:s(t.yMax)},whileInView:{opacity:1,transition:{duration:u?a.duration:.5,delay:u?0:a.duration},cx:i(t.date),cy:s(t.yMax)}},initial:"initial",animate:l?"whileInView":"initial"})]}):null,G?e.jsxRuntimeExports.jsx(f.motion.text,{dy:-8,style:{fill:k,textAnchor:"middle",...c?.graphObjectValues||{}},className:e.mo("graph-value text-xs font-bold",x?.graphObjectValues),exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,x:i(t.date),y:s(t.y)},whileInView:{opacity:1,x:i(t.date),y:s(t.y),transition:{duration:u?a.duration:.5,delay:u?0:a.duration}}},initial:"initial",animate:l?"whileInView":"initial",children:ot.numberFormattingFunction(t.y,"NA",N,j,I)}):null,ft?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(f.motion.text,{dy:"1em",style:{fill:b[0],textAnchor:"middle",...c?.graphObjectValues||{}},className:e.mo("text-xs font-bold",x?.graphObjectValues),exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,x:i(t.date),y:s(t.yMin)},whileInView:{opacity:1,x:i(t.date),y:s(t.yMin),transition:{duration:u?a.duration:.5,delay:u?0:a.duration}}},initial:"initial",animate:l?"whileInView":"initial",children:ot.numberFormattingFunction(t.yMin,"NA",N,j,I)}),e.jsxRuntimeExports.jsx(f.motion.text,{dy:-8,style:{fill:b[1],textAnchor:"middle",...c?.graphObjectValues||{}},className:e.mo("text-xs font-bold",x?.graphObjectValues),exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,x:i(t.date),y:s(t.yMax)},whileInView:{opacity:1,x:i(t.date),y:s(t.yMax),transition:{duration:u?a.duration:.5,delay:u?0:a.duration}}},initial:"initial",animate:l?"whileInView":"initial",children:ot.numberFormattingFunction(t.yMax,"NA",N,j,I)})]}):null]})},g))}),z?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:z.map((t,g)=>e.jsxRuntimeExports.jsx(Wt.RefLineY,{text:t.text,color:t.color,y:s(t.value),x1:0-R,x2:r+d.right,classNames:t.classNames,styles:t.styles,animate:a,isInView:l},g))}):null,e.jsxRuntimeExports.jsx("g",{children:pt.map((t,g)=>{const O=bt.getLineEndPoint({x:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),y:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0)-8:0+(t.yOffset||0)-8},{x:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date)):0,y:t.yCoordinate?s(t.yCoordinate):0},v.checkIfNullOrUndefined(t.connectorRadius)?3.5:t.connectorRadius),rt=t.showConnector?{y1:O.y,x1:O.x,y2:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0):0+(t.yOffset||0),x2:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),cy:t.yCoordinate?s(t.yCoordinate):0,cx:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date)):0,circleRadius:v.checkIfNullOrUndefined(t.connectorRadius)?3.5:t.connectorRadius,strokeWidth:t.showConnector===!0?2:Math.min(t.showConnector||0,1)}:void 0,Ct={y:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0)-8:0+(t.yOffset||0)-8,x:Q?0:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),width:Q?t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0):r+d.right-(t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0)),maxWidth:t.maxWidth,fontWeight:t.fontWeight,align:t.align};return e.jsxRuntimeExports.jsx(bt.Annotation,{color:t.color,connectorsSettings:rt,labelSettings:Ct,text:t.text,classNames:t.classNames,styles:t.styles,animate:a,isInView:l},g)})}),e.jsxRuntimeExports.jsx("g",{children:T?e.jsxRuntimeExports.jsx(Ht.RegressionLine,{x1:0,x2:r,y1:Vt(0),y2:Vt(r),graphHeight:w,graphWidth:r,className:x?.regLine,style:c?.regLine,color:typeof T=="string"?T:void 0,animate:a,isInView:l}):null}),_.filter(t=>t.position==="after").map(t=>t.layer),e.jsxRuntimeExports.jsx("rect",{ref:E,style:{fill:"none",pointerEvents:"all"},width:r,height:w})]})}),V&&B&&it&&U?e.jsxRuntimeExports.jsx($t.Tooltip,{data:V,body:B,xPos:it,yPos:U,backgroundStyle:c?.tooltip,className:x?.tooltip}):null]})}function ie(ut){const{data:A,graphTitle:M,suffix:$="",sources:k,prefix:I="",graphDescription:j,height:o,width:m,footNote:G,noOfXTicks:mt=10,dateFormat:ht="yyyy",showValues:R=!1,backgroundColor:C=!1,padding:X,lineColor:B,leftMargin:F=30,rightMargin:z=30,topMargin:J=20,bottomMargin:K=25,tooltip:a,refValues:Q=[],highlightAreaSettings:yt=[],relativeHeight:D,onSeriesMouseOver:pt,graphID:dt,minValue:T,maxValue:gt,regressionLine:ft=!1,showIntervalDots:W=!1,showIntervalValues:b=!1,intervalLineStrokeWidth:jt=0,intervalLineColors:wt=[xt.Colors.light.grays["gray-500"],xt.Colors.light.grays["gray-500"]],intervalAreaColor:Z=xt.Colors.primaryColors["blue-100"],intervalAreaOpacity:vt=.4,graphDownload:H=!1,dataDownload:P=!1,animate:L=!1,language:c="en",minHeight:x=0,strokeWidth:N=2,showDots:_=!0,annotations:tt=[],customHighlightAreaSettings:l=[],theme:u="light",ariaLabel:Rt,yAxisTitle:S,noOfYTicks:V=5,minDate:et,maxDate:it,colorLegendTitle:nt,colorLegendColors:U,colorLegendDomain:Y,curveType:d="curve",styles:E,classNames:n,precision:Et=2,customLayers:Mt=[]}=ut,[r,w]=p.useState(0),[at,st]=p.useState(0),h=p.useRef(null),q=p.useRef(null);return p.useEffect(()=>{const i=new ResizeObserver(s=>{w(m||s[0].target.clientWidth||620),st(o||s[0].target.clientHeight||480)});return h.current&&(st(h.current.clientHeight||480),w(h.current.clientWidth||620),m||i.observe(h.current)),()=>i.disconnect()},[m,o]),e.jsxRuntimeExports.jsx("div",{className:`${u||"light"} flex ${m?"w-fit grow-0":"w-full grow"}`,dir:c==="he"||c==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${C?C===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${c||"en"}`,m?"w-fit":"w-full",n?.graphContainer),style:{...E?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:dt,ref:q,"aria-label":Rt||`${M?`The graph shows ${M}. `:""}This is a line chart that highlights the difference between two datasets over time.${j?` ${j}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?X||"1rem":X||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[M||j||H||P?e.jsxRuntimeExports.jsx(Zt.GraphHeader,{styles:{title:E?.title,description:E?.description},classNames:{title:n?.title,description:n?.description},graphTitle:M,graphDescription:j,width:m,graphDownload:H?q.current:void 0,dataDownload:P?A.map(i=>i.data).filter(i=>i!==void 0).length>0?A.map(i=>i.data).filter(i=>i!==void 0):A.filter(i=>i!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:A.length===0?e.jsxRuntimeExports.jsx(te.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[U&&Y?e.jsxRuntimeExports.jsx(_t.ColorLegend,{width:m,colorLegendTitle:nt,colors:U,colorDomain:Y,showNAColor:!1}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:h,"aria-label":"Graph area",children:(m||r)&&(o||at)?e.jsxRuntimeExports.jsx(ee,{data:A,lineColor:B||xt.Colors.primaryColors["blue-600"],width:m||r,height:Math.max(x,o||(D?x?(m||r)*D>x?(m||r)*D:x:(m||r)*D:at)),suffix:$,prefix:I,dateFormat:ht,showValues:R,noOfXTicks:mt,leftMargin:F,rightMargin:z,topMargin:J,bottomMargin:K,tooltip:a,highlightAreaSettings:yt,onSeriesMouseOver:pt,refValues:Q,minValue:T,maxValue:gt,animate:L===!0?{duration:.5,once:!0,amount:.5}:L||{duration:0,once:!0,amount:0},rtl:c==="he"||c==="ar",strokeWidth:N,showDots:_,annotations:tt,customHighlightAreaSettings:l,regressionLine:ft,showIntervalDots:W,showIntervalValues:b,intervalLineStrokeWidth:jt,intervalLineColors:wt,intervalAreaColor:Z,intervalAreaOpacity:vt,yAxisTitle:S,noOfYTicks:V,minDate:et,maxDate:it,curveType:d,styles:E,classNames:n,precision:Et,customLayers:Mt}):null})]})}),k||G?e.jsxRuntimeExports.jsx(Qt.GraphFooter,{styles:{footnote:E?.footnote,source:E?.source},classNames:{footnote:n?.footnote,source:n?.source},sources:k,footNote:G,width:m}):null]})})})})}exports.LineChartWithConfidenceInterval=ie;
|
|
2
2
|
//# sourceMappingURL=LineChartWithConfidenceInterval.cjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as i, m as B } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
2
|
import { useRef as mt, useState as R, useEffect as Vt } from "react";
|
|
3
3
|
import { p as u, f as Rt } from "./parse-DlCRUFh_.js";
|
|
4
|
-
import { s as Wt } from "./index-
|
|
4
|
+
import { s as Wt } from "./index-fwdktvAS.js";
|
|
5
5
|
import { l as Ft, a as Ht } from "./simple-statistics-flVzqVtt.js";
|
|
6
6
|
import { n as lt } from "./numberFormattingFunction-14YCbkN2.js";
|
|
7
|
-
import { T as Yt } from "./Tooltip-
|
|
7
|
+
import { T as Yt } from "./Tooltip-CVCGWyzw.js";
|
|
8
8
|
import { c as v } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
9
9
|
import { C as Pt, g as Et, A as Xt } from "./customArea-B-dWU0zZ.js";
|
|
10
10
|
import { A as Gt } from "./AxisTitle-BmHLMRJZ.js";
|
|
@@ -12,7 +12,7 @@ import { A as Bt } from "./Axis-Ddg-seDi.js";
|
|
|
12
12
|
import { R as zt } from "./ReferenceLine-CfAW3vKJ.js";
|
|
13
13
|
import { R as Ut } from "./RegressionLine-mH7UKOPi.js";
|
|
14
14
|
import { Y as qt } from "./YTicksAndGridLines-B6ah7CRf.js";
|
|
15
|
-
import { H as Jt } from "./index-
|
|
15
|
+
import { H as Jt } from "./index-DKCxu1Gh.js";
|
|
16
16
|
import { t as Kt } from "./time-BzJP5SPC.js";
|
|
17
17
|
import { a as Qt } from "./linear-DUdu7l2G.js";
|
|
18
18
|
import { l as Ot, c as Zt } from "./line-CPfhohvF.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-DDoeWRVt.cjs"),o=require("react"),$=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-DDoeWRVt.cjs"),o=require("react"),$=require("./index-D72cOtq7.cjs"),v=require("./index-BS2TADPj.cjs"),g=require("./DropdownSelect-DBDM64B5.cjs"),N=require("./checkIfMultiple-BXbHUCWM.cjs"),P=require("./SingleGraphDashboard.cjs"),d=require("./fetchAndParseData-Dcy7AS_0.cjs"),U=require("./getUniqValue-CfuE_l9c.cjs"),I=require("./GraphHeader.cjs"),L=require("./filterData-BoYadk0l.cjs"),T=require("./transformDataForSelect-YmStusCI.cjs"),y=f=>f.map(a=>a.columnWidth||1).reduce((a,p)=>a+p,0),z=["barChart","choroplethMap","biVariateChoroplethMap","circlePacking","treeMap"];function Z(f){const{dashboardID:S,dashboardLayout:i,dataSettings:a,filters:p,debugMode:c,theme:j="light",readableHeader:V,dataFilters:k,noOfFiltersPerRow:x=4,filterPosition:w,uiMode:b="normal",graphStyles:A,graphClassNames:M}=f,[D,q]=o.useState(void 0),[h,O]=o.useState(void 0),[u,R]=o.useState([]),C=o.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),E=o.useMemo(()=>!h||u.length===0?h:h.filter(n=>u.every(e=>e.value&&v.flattenDeep([e.value]).length>0?$.intersection(v.flattenDeep([n[e.filter]]),v.flattenDeep([e.value]).map(r=>r.value)).length>0:!0)),[u,h]);o.useEffect(()=>{q(E)},[E]);const F=o.useCallback(async()=>{if(a)try{const n=await(a.dataURL?typeof a.dataURL=="string"?a.fileType==="json"?d.fetchAndParseJSON(a.dataURL,a.columnsToArray,a.dataTransformation,c):a.fileType==="api"?d.fetchAndTransformDataFromAPI(a.dataURL,a.apiHeaders,a.columnsToArray,a.dataTransformation,c):d.fetchAndParseCSV(a.dataURL,a.dataTransformation,a.columnsToArray,c,a.delimiter,!0):d.fetchAndParseMultipleDataSources(a.dataURL,a.idColumnTitle):d.transformColumnsToArray(a.data,a.columnsToArray));O(n);const e=(p||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,defaultValue:T.transformDefaultValue(r.defaultValue),value:T.transformDefaultValue(r.defaultValue),availableValues:U.getUniqValue(n,r.column).filter(s=>!r.excludeValues?.includes(`${s}`)).map(s=>({value:s,label:s})),allowSelectAll:r.allowSelectAll,width:r.width}));R(e)}catch(t){console.error("Data fetching error:",t)}},[a,p,c]);o.useEffect(()=>{F()},[F]);const m=o.useCallback((t,n)=>{R(e=>e.map(r=>r.filter===t?{...r,value:n}:r))},[]);return l.jsxRuntimeExports.jsx("div",{className:`${j||"light"} flex grow`,dir:i.language==="he"||i.language==="ar"?"rtl":void 0,children:l.jsxRuntimeExports.jsx("div",{className:`${i.backgroundColor?i.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto gap-4 flex flex-col w-full grow h-inherit ${i.language||"en"}`,style:{...i.backgroundColor&&i.backgroundColor!==!0?{backgroundColor:i.backgroundColor}:{}},id:S,children:l.jsxRuntimeExports.jsx("div",{style:{padding:i.backgroundColor?i.padding||"1rem":i.padding||0,flexGrow:1,display:"flex"},children:l.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[i.title||i.description?l.jsxRuntimeExports.jsx(I.GraphHeader,{graphTitle:i.title,graphDescription:i.description,isDashboard:!0}):null,l.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap"},children:[u.length!==0?l.jsxRuntimeExports.jsx("div",{style:{width:w==="side"?"280px":"100%",flexGrow:1,flexShrink:0},children:l.jsxRuntimeExports.jsx("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%",position:"sticky",top:"1rem"},children:u?.map((t,n)=>l.jsxRuntimeExports.jsxs("div",{style:{width:t.width||`calc(${100/x}% - ${(x-1)/x}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[l.jsxRuntimeExports.jsx(N.f,{className:"mb-2",children:t.label}),t.singleSelect?l.jsxRuntimeExports.jsx(g.Za,{options:t.availableValues,isClearable:t.clearable===void 0?!0:t.clearable,size:"sm",variant:b,isMulti:!1,isSearchable:!0,filterOption:g.Hu(C),onChange:e=>{m(t.filter,e)},defaultValue:t.defaultValue,value:t.value}):l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx(g.Za,{options:t.availableValues,isMulti:!0,size:"sm",isClearable:t.clearable===void 0?!0:t.clearable,variant:b,isSearchable:!0,controlShouldRenderValue:!0,closeMenuOnSelect:!1,hideSelectedOptions:!1,filterOption:g.Hu(C),onChange:e=>{m(t.filter,e)},value:t.value,defaultValue:t.defaultValue}),t.allowSelectAll?l.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(t.filter,t.availableValues)},children:"Select all options"}):null]})]},n))})}):null,l.jsxRuntimeExports.jsx("div",{style:{width:w==="side"?"calc(100% - 280px - 1rem)":"100%",minWidth:"280px",flexGrow:1,display:"flex",gap:"1rem",flexWrap:"wrap",flexShrink:"0"},children:i.rows.map((t,n)=>l.jsxRuntimeExports.jsx("div",{style:{display:"flex",gap:"1rem",alignItems:"stretch",minHeight:`${t.height||0}px`,height:"auto",width:"100%",flexWrap:"wrap"},children:t.columns.map((e,r)=>l.jsxRuntimeExports.jsx("div",{className:"flex bg-transparent h-inherit grow min-w-60",style:{width:`calc(${100*(e.columnWidth||1)/y(t.columns)}% - ${(y(t.columns)-(e.columnWidth||1))/y(t.columns)}rem)`,minHeight:"inherit"},children:l.jsxRuntimeExports.jsx(P.SingleGraphDashboard,{graphType:e.graphType,dataFilters:e.dataFilters,uiMode:b,graphSettings:{...e.settings||{},width:void 0,height:void 0,resetSelectionOnDoubleClick:e.attachedFilter?!1:e.settings?.resetSelectionOnDoubleClick,styles:e.settings?.styles||A,classNames:e.settings?.classNames||M,radius:e.graphType==="donutChart"?void 0:e.settings?.radius,size:e.graphType==="unitChart"?e.settings?.size:void 0,language:e.settings?.language||i.language,theme:e.settings?.theme||j},dataSettings:{data:D?L.filterData(D,k||[]):void 0},updateFilters:e.attachedFilter&&z.indexOf(e.graphType)!==-1&&u.findIndex(s=>s.filter===e.attachedFilter)!==-1?s=>{const W=u.findIndex(H=>H.filter===e.attachedFilter),G=s?u[W].singleSelect?{value:s,label:s}:[{value:s,label:s}]:void 0;m(e.attachedFilter,G)}:void 0,dataTransform:e.dataTransform,dataSelectionOptions:e.dataSelectionOptions,advancedDataSelectionOptions:e.advancedDataSelectionOptions,graphDataConfiguration:e.graphDataConfiguration,debugMode:c,readableHeader:V||[]})},r))},n))})]})]})})})})}exports.MultiGraphDashboard=Z;
|
|
2
2
|
//# sourceMappingURL=MultiGraphDashboard.cjs.map
|