@undp/data-viz 2.3.1 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +2 -2
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +15 -15
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +2 -2
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +202 -202
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +2 -2
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +2 -2
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +33 -33
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +2 -2
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +7 -7
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +1 -1
- package/dist/CopyTextButton.cjs +1 -1
- package/dist/CopyTextButton.js +1 -1
- package/dist/CsvDownloadButton.cjs +2 -2
- package/dist/CsvDownloadButton.js +1 -1
- package/dist/DataCards.cjs +1 -1
- package/dist/DataCards.js +3 -3
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +2 -2
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +20 -20
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +46 -46
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +2 -2
- package/dist/{EmptyState-CGeBqbmR.cjs → EmptyState-DX0t62iF.cjs} +2 -2
- package/dist/{EmptyState-CGeBqbmR.cjs.map → EmptyState-DX0t62iF.cjs.map} +1 -1
- package/dist/{EmptyState-tZBErBKF.js → EmptyState-Pj-emXt5.js} +3 -3
- package/dist/{EmptyState-tZBErBKF.js.map → EmptyState-Pj-emXt5.js.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.js +7 -7
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +1 -1
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.js +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.js +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +2 -2
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +1 -1
- package/dist/{GraphEl-ic8C5Ksc.cjs → GraphEl-CWjTuiYd.cjs} +2 -2
- package/dist/{GraphEl-ic8C5Ksc.cjs.map → GraphEl-CWjTuiYd.cjs.map} +1 -1
- package/dist/{GraphEl-L5hNe7wJ.js → GraphEl-DDXkYObU.js} +7 -7
- package/dist/{GraphEl-L5hNe7wJ.js.map → GraphEl-DDXkYObU.js.map} +1 -1
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +1 -1
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +1 -1
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +1 -1
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +42 -42
- package/dist/HybridMap.js.map +1 -1
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +1 -1
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +1 -1
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.js +1 -1
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +8 -8
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +80 -80
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.js +2 -2
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.js +10 -10
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +1 -1
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.js +1 -1
- package/dist/{Source-B5AoSlsi.cjs → Source-B3i0Bx2R.cjs} +2 -2
- package/dist/{Source-B5AoSlsi.cjs.map → Source-B3i0Bx2R.cjs.map} +1 -1
- package/dist/{Source-F8EYCYkV.js → Source-_STIejqs.js} +14 -14
- package/dist/{Source-F8EYCYkV.js.map → Source-_STIejqs.js.map} +1 -1
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +2 -2
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +12 -12
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.js +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.js +2 -2
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +10 -10
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +29 -29
- package/dist/Typography-DrJ7IOdw.cjs +2 -0
- package/dist/Typography-DrJ7IOdw.cjs.map +1 -0
- package/dist/Typography-iR8PEgdt.js +263 -0
- package/dist/Typography-iR8PEgdt.js.map +1 -0
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +25 -25
- package/dist/WaterfallChart.cjs +1 -1
- package/dist/WaterfallChart.js +1 -1
- package/dist/{index-BQYOuXdl.js → index-B-4y_iGB.js} +19 -17
- package/dist/index-B-4y_iGB.js.map +1 -0
- package/dist/{index-D5ihtaJJ.js → index-BE-lvE4c.js} +3 -3
- package/dist/{index-D5ihtaJJ.js.map → index-BE-lvE4c.js.map} +1 -1
- package/dist/{index-Dgjq6aZ2.cjs → index-DlrGwLQA.cjs} +2 -2
- package/dist/{index-Dgjq6aZ2.cjs.map → index-DlrGwLQA.cjs.map} +1 -1
- package/dist/index-sbKVyHS2.cjs +2 -0
- package/dist/index-sbKVyHS2.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/Typography-hWfh3H0J.js +0 -142
- package/dist/Typography-hWfh3H0J.js.map +0 -1
- package/dist/Typography-sa1UE0oF.cjs +0 -2
- package/dist/Typography-sa1UE0oF.cjs.map +0 -1
- package/dist/index-BQYOuXdl.js.map +0 -1
- package/dist/index-C6er0ety.cjs +0 -2
- package/dist/index-C6er0ety.cjs.map +0 -1
package/dist/GraphFooter.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-CHPV5EwG-6v2a2njQ.cjs"),m=require("./FootNote.cjs"),p=require("./Source-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-CHPV5EwG-6v2a2njQ.cjs"),m=require("./FootNote.cjs"),p=require("./Source-B3i0Bx2R.cjs");function d(x){const e=u.compilerRuntimeExports.c(14),{sources:t,footNote:c,width:f,styles:o,classNames:s}=x;if((t===void 0||(t||[]).length===0)&&c===void 0)return null;const a=f?`${f}px`:"none";let r;e[0]!==a?(r={maxWidth:a},e[0]=a,e[1]=r):r=e[1];let l;e[2]!==s?.source||e[3]!==t||e[4]!==o?.source?(l=t?u.jsxRuntimeExports.jsx(p.Source,{sources:t,style:o?.source,className:s?.source}):null,e[2]=s?.source,e[3]=t,e[4]=o?.source,e[5]=l):l=e[5];let n;e[6]!==s?.footnote||e[7]!==c||e[8]!==o?.footnote?(n=c?u.jsxRuntimeExports.jsx(m.FootNote,{text:c,style:o?.footnote,className:s?.footnote}):null,e[6]=s?.footnote,e[7]=c,e[8]=o?.footnote,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==l||e[12]!==n?(i=u.jsxRuntimeExports.jsxs("div",{className:"flex flex-col pt-4",style:r,"aria-label":"Graph footer",children:[l,n]}),e[10]=r,e[11]=l,e[12]=n,e[13]=i):i=e[13],i}exports.GraphFooter=d;
|
|
2
2
|
//# sourceMappingURL=GraphFooter.cjs.map
|
package/dist/GraphFooter.js
CHANGED
package/dist/GraphTitle.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-6v2a2njQ.cjs"),m=require("./Typography-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-6v2a2njQ.cjs"),m=require("./Typography-DrJ7IOdw.cjs"),u=require("react");function x(c){const e=s.compilerRuntimeExports.c(16),{text:t,isDashboard:p,style:i,className:l}=c;if(typeof t=="string"){if(t.trim()==="")return null;if(p){let a;e[0]!==l?(a=s.mo("font-bold pb-3 text-primary-black dark:text-primary-gray-100",l),e[0]=l,e[1]=a):a=e[1];let o;return e[2]!==i||e[3]!==a||e[4]!==t?(o=s.jsxRuntimeExports.jsx(m.P,{marginBottom:"base",className:a,"aria-label":"Dashboard title",style:i,children:t}),e[2]=i,e[3]=a,e[4]=t,e[5]=o):o=e[5],o}let r;e[6]!==l?(r=s.mo("text-primary-black dark:text-primary-gray-100",l),e[6]=l,e[7]=r):r=e[7];let n;return e[8]!==i||e[9]!==r||e[10]!==t?(n=s.jsxRuntimeExports.jsx(m._,{marginBottom:"none",className:r,"aria-label":"Graph title",style:i,children:t}),e[8]=i,e[9]=r,e[10]=t,e[11]=n):n=e[11],n}if(u.isValidElement(t)){let r;return e[12]!==l||e[13]!==i||e[14]!==t?(r=s.jsxRuntimeExports.jsx("div",{className:l,style:i,children:t}),e[12]=l,e[13]=i,e[14]=t,e[15]=r):r=e[15],r}return console.error("GraphTitle: Invalid text type. Expected string or React element."),null}exports.GraphTitle=x;
|
|
2
2
|
//# sourceMappingURL=GraphTitle.cjs.map
|
package/dist/GraphTitle.js
CHANGED
package/dist/GriddedGraphs.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),i=require("react"),ae=require("./index-CyZ1lmi_.cjs"),G=require("./index-BS2TADPj.cjs"),u=require("./checkIfMultiple-DxnGtm3t.cjs"),te=require("./Spinner-jTMOLuw_.cjs"),m=require("./DropdownSelect-NNpOs7DX.cjs"),le=require("./GraphContainer-B1EDxJ0S.cjs"),oe=require("./GraphEl-ic8C5Ksc.cjs"),S=require("./fetchAndParseData-QTF6tjij.cjs"),re=require("./Colors.cjs"),H=require("./transformDataForAggregation-BFdha9Dx.cjs"),W=require("./getUniqValue-NX8DgwND.cjs"),ne=require("./GraphHeader.cjs"),ie=require("./GraphFooter.cjs"),z=require("./filterData-T5DQBE9b.cjs"),se=require("./ColorLegend.cjs"),ue=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),B=require("./transformDataForSelect-YmStusCI.cjs");function ce(J){const{graphSettings:t,dataSettings:n,filters:T,graphType:$,dataTransform:D,graphDataConfiguration:s,noOfColumns:y,columnGridBy:E,dataFilters:q,showCommonColorScale:A,minGraphHeight:K,minGraphWidth:F,debugMode:w,dataSelectionOptions:O,advancedDataSelectionOptions:k,readableHeader:Q,noOfFiltersPerRow:f=4,uiMode:d="normal",theme:X="light"}=J,[v,Y]=i.useState(void 0),[g,Z]=i.useState(void 0),[b,_]=i.useState([]),M=i.useRef(null),[x,C]=i.useState(s),[j,L]=i.useState([]),[h,R]=i.useState({}),N=i.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),P=i.useMemo(()=>!g||j.length===0?g:g.filter(r=>j.every(a=>a.value&&G.flattenDeep([a.value]).length>0?ae.intersection(G.flattenDeep([r[a.filter]]),G.flattenDeep([a.value]).map(l=>l.value)).length>0:!0)),[j,g]);i.useEffect(()=>{Y(P)},[P]);const U=i.useEffectEvent(()=>{const e=(T||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,ui:r.ui,defaultValue:B.transformDefaultValue(r.defaultValue),value:B.transformDefaultValue(r.defaultValue),availableValues:W.getUniqValue(g,r.column).filter(a=>!r.excludeValues?.includes(`${a}`)).map(a=>({value:a,label:a})),allowSelectAll:r.allowSelectAll,width:r.width}));L(e)});i.useEffect(()=>{(async()=>{try{const r=n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?await S.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,w):n.fileType==="api"?await S.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,w):await S.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,w,n.delimiter,!0):await S.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):await S.transformColumnsToArray(n.data,n.columnsToArray);Z(r)}catch(r){console.error("Data fetching error:",r)}})(),U()},[n,w]),i.useEffect(()=>{U()},[T,g]);const ee=i.useEffectEvent(()=>{const e=W.getUniqValue(g,E);_(e)});i.useEffect(()=>{ee()},[E,g]),i.useEffect(()=>{C(s)},[s]);const I=i.useCallback((e,r)=>{L(a=>a.map(l=>l.filter===e?{...l,value:r}:l))},[]);return o.jsxRuntimeExports.jsxs(le.GraphContainer,{className:t?.classNames?.graphContainer,style:t?.styles?.graphContainer,id:t?.graphID,ref:M,"aria-label":t?.ariaLabel||"This is a gridded graph",backgroundColor:t?.backgroundColor??!1,theme:t?.theme||"light",language:t?.language||"en",width:t?.width,height:t?.height,padding:t?.padding,children:[h?.graphTitle||h?.graphDescription||t?.graphTitle||t?.graphDescription||t?.graphDownload||t?.dataDownload?o.jsxRuntimeExports.jsx(ne.GraphHeader,{styles:{title:h?.styles?.title||t?.styles?.title,description:h?.styles?.description||t?.styles?.description},classNames:{title:h?.classNames?.title||t?.classNames?.title,description:h?.classNames?.description||t?.classNames?.description},graphTitle:h?.graphTitle||t?.graphTitle,graphDescription:h?.graphDescription||t?.graphDescription,width:h?.width||t?.width,graphDownload:t?.graphDownload?M:void 0,dataDownload:t?.dataDownload&&v&&v.length>0?v:null}):null,v&&b.length>0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[j.length!==0||(O||[]).length!==0||(k||[]).length!==0?o.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-0 w-full",children:[k?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.options.map(a=>({...a,value:a.label})),isClearable:!1,isSearchable:!0,variant:d,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{R(a?.graphSettings||{}),C(a?.dataConfiguration)}}):o.jsxRuntimeExports.jsx(u.ye,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:d,onValueChange:a=>{const l=e.options[e.options.findIndex(p=>p.label===a)];R(l.graphSettings||{}),C(l.dataConfiguration)},children:e.options.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),O?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),u.checkIfMultiple(e.chartConfigId,x||[])?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isMulti:!0,variant:d,isSearchable:!0,controlShouldRenderValue:!0,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]):void 0,filterOption:m.Du(N),onChange:a=>{const l={columnId:a.map(c=>c.value),chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},isRtl:t?.language==="ar"||t?.language==="he"}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]).map(a=>a.value):[],onValueChange:a=>{const l={columnId:a||[],chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:a.label,value:a.label},l))}):e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isClearable:!1,isSearchable:!0,variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)]:void 0,controlShouldRenderValue:!0,onChange:a=>{const l={columnId:a?.value,chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);R(a?.graphSettings||{}),C(p)}}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const l=e.allowedColumnIds[e.allowedColumnIds.findIndex(V=>V.label===a)],p={columnId:l.value,chartConfigId:e.chartConfigId},c=x?.map(V=>V.chartConfigId===p.chartConfigId?p:V);R(l.graphSettings||{}),C(c)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),j?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,flexWrap:"wrap"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label}),e.singleSelect?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:e.defaultValue.value,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>l.value===a))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:`${a.label}`,value:`${a.value}`},l))}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>a.indexOf(`${l.value}`)!==-1))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:`${a.label}`,value:`${a.value}`},l))}),e.allowSelectAll?o.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:()=>{I(e.filter,e.availableValues)},children:"Select all options"}):null]})]},r))]}):null,A!==!1&&t?.showColorScale!==!1?o.jsxRuntimeExports.jsx(se.ColorLegend,{width:t?.width,colorLegendTitle:t?.colorLegendTitle,colors:t?.colors||t?.lineColors||re.Colors[t?.theme||"light"].categoricalColors.colors,colorDomain:t?.colorDomain||t?.labels||[],showNAColor:t?.showNAColor===void 0||t?.showNAColor===null?!0:t?.showNAColor}):null,o.jsxRuntimeExports.jsx("div",{className:`flex flex-wrap gap-4 justify-center ${t?.language==="ar"||t?.language==="he"?"flex-row-reverse":"flex-row"}`,children:b.map((e,r)=>o.jsxRuntimeExports.jsx("div",{style:{width:`calc(${100/(y||Math.min(4,b.length||0))}% - ${((y||Math.min(4,b.length||0))-1)/(y||Math.min(4,b.length||0))}rem)`,minWidth:ue.checkIfNullOrUndefined(F)?"280px":`${F}px`},children:o.jsxRuntimeExports.jsx(oe.GraphEl,{graph:$,graphDataConfiguration:x,graphData:H.transformDataForGraph(D?H.transformDataForAggregation(z.filterData(v,q||[]).filter(a=>a[E]===e),D.keyColumn,D.aggregationColumnsSetting):z.filterData(v,q||[]).filter(a=>a[E]===e),$,x)||[],debugMode:w,settings:{...t||{},...h,theme:t?.theme||X,width:void 0,height:void 0,relativeHeight:t?.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:t?.showColorScale===!1?!1:A===!1},readableHeader:Q||[]})},r))})]}):o.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:o.jsxRuntimeExports.jsx(te.w,{})}),t?.sources||t?.footNote?o.jsxRuntimeExports.jsx(ie.GraphFooter,{styles:{footnote:t?.styles?.footnote,source:t?.styles?.source},classNames:{footnote:t?.classNames?.footnote,source:t?.classNames?.source},sources:t?.sources,footNote:t?.footNote,width:t?.width}):null]})}exports.GriddedGraphs=ce;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),i=require("react"),ae=require("./index-CyZ1lmi_.cjs"),G=require("./index-BS2TADPj.cjs"),u=require("./checkIfMultiple-DxnGtm3t.cjs"),te=require("./Spinner-jTMOLuw_.cjs"),m=require("./DropdownSelect-NNpOs7DX.cjs"),le=require("./GraphContainer-B1EDxJ0S.cjs"),oe=require("./GraphEl-CWjTuiYd.cjs"),S=require("./fetchAndParseData-QTF6tjij.cjs"),re=require("./Colors.cjs"),H=require("./transformDataForAggregation-BFdha9Dx.cjs"),W=require("./getUniqValue-NX8DgwND.cjs"),ne=require("./GraphHeader.cjs"),ie=require("./GraphFooter.cjs"),z=require("./filterData-T5DQBE9b.cjs"),se=require("./ColorLegend.cjs"),ue=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),B=require("./transformDataForSelect-YmStusCI.cjs");function ce(J){const{graphSettings:t,dataSettings:n,filters:T,graphType:$,dataTransform:D,graphDataConfiguration:s,noOfColumns:y,columnGridBy:E,dataFilters:q,showCommonColorScale:A,minGraphHeight:K,minGraphWidth:F,debugMode:w,dataSelectionOptions:O,advancedDataSelectionOptions:k,readableHeader:Q,noOfFiltersPerRow:f=4,uiMode:d="normal",theme:X="light"}=J,[v,Y]=i.useState(void 0),[g,Z]=i.useState(void 0),[b,_]=i.useState([]),M=i.useRef(null),[x,C]=i.useState(s),[j,L]=i.useState([]),[h,R]=i.useState({}),N=i.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),P=i.useMemo(()=>!g||j.length===0?g:g.filter(r=>j.every(a=>a.value&&G.flattenDeep([a.value]).length>0?ae.intersection(G.flattenDeep([r[a.filter]]),G.flattenDeep([a.value]).map(l=>l.value)).length>0:!0)),[j,g]);i.useEffect(()=>{Y(P)},[P]);const U=i.useEffectEvent(()=>{const e=(T||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,ui:r.ui,defaultValue:B.transformDefaultValue(r.defaultValue),value:B.transformDefaultValue(r.defaultValue),availableValues:W.getUniqValue(g,r.column).filter(a=>!r.excludeValues?.includes(`${a}`)).map(a=>({value:a,label:a})),allowSelectAll:r.allowSelectAll,width:r.width}));L(e)});i.useEffect(()=>{(async()=>{try{const r=n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?await S.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,w):n.fileType==="api"?await S.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,w):await S.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,w,n.delimiter,!0):await S.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):await S.transformColumnsToArray(n.data,n.columnsToArray);Z(r)}catch(r){console.error("Data fetching error:",r)}})(),U()},[n,w]),i.useEffect(()=>{U()},[T,g]);const ee=i.useEffectEvent(()=>{const e=W.getUniqValue(g,E);_(e)});i.useEffect(()=>{ee()},[E,g]),i.useEffect(()=>{C(s)},[s]);const I=i.useCallback((e,r)=>{L(a=>a.map(l=>l.filter===e?{...l,value:r}:l))},[]);return o.jsxRuntimeExports.jsxs(le.GraphContainer,{className:t?.classNames?.graphContainer,style:t?.styles?.graphContainer,id:t?.graphID,ref:M,"aria-label":t?.ariaLabel||"This is a gridded graph",backgroundColor:t?.backgroundColor??!1,theme:t?.theme||"light",language:t?.language||"en",width:t?.width,height:t?.height,padding:t?.padding,children:[h?.graphTitle||h?.graphDescription||t?.graphTitle||t?.graphDescription||t?.graphDownload||t?.dataDownload?o.jsxRuntimeExports.jsx(ne.GraphHeader,{styles:{title:h?.styles?.title||t?.styles?.title,description:h?.styles?.description||t?.styles?.description},classNames:{title:h?.classNames?.title||t?.classNames?.title,description:h?.classNames?.description||t?.classNames?.description},graphTitle:h?.graphTitle||t?.graphTitle,graphDescription:h?.graphDescription||t?.graphDescription,width:h?.width||t?.width,graphDownload:t?.graphDownload?M:void 0,dataDownload:t?.dataDownload&&v&&v.length>0?v:null}):null,v&&b.length>0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[j.length!==0||(O||[]).length!==0||(k||[]).length!==0?o.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-0 w-full",children:[k?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.options.map(a=>({...a,value:a.label})),isClearable:!1,isSearchable:!0,variant:d,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{R(a?.graphSettings||{}),C(a?.dataConfiguration)}}):o.jsxRuntimeExports.jsx(u.ye,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:d,onValueChange:a=>{const l=e.options[e.options.findIndex(p=>p.label===a)];R(l.graphSettings||{}),C(l.dataConfiguration)},children:e.options.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),O?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),u.checkIfMultiple(e.chartConfigId,x||[])?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isMulti:!0,variant:d,isSearchable:!0,controlShouldRenderValue:!0,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]):void 0,filterOption:m.Du(N),onChange:a=>{const l={columnId:a.map(c=>c.value),chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},isRtl:t?.language==="ar"||t?.language==="he"}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]).map(a=>a.value):[],onValueChange:a=>{const l={columnId:a||[],chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:a.label,value:a.label},l))}):e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isClearable:!1,isSearchable:!0,variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)]:void 0,controlShouldRenderValue:!0,onChange:a=>{const l={columnId:a?.value,chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);R(a?.graphSettings||{}),C(p)}}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const l=e.allowedColumnIds[e.allowedColumnIds.findIndex(V=>V.label===a)],p={columnId:l.value,chartConfigId:e.chartConfigId},c=x?.map(V=>V.chartConfigId===p.chartConfigId?p:V);R(l.graphSettings||{}),C(c)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),j?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,flexWrap:"wrap"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label}),e.singleSelect?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:e.defaultValue.value,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>l.value===a))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:`${a.label}`,value:`${a.value}`},l))}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>a.indexOf(`${l.value}`)!==-1))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:`${a.label}`,value:`${a.value}`},l))}),e.allowSelectAll?o.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:()=>{I(e.filter,e.availableValues)},children:"Select all options"}):null]})]},r))]}):null,A!==!1&&t?.showColorScale!==!1?o.jsxRuntimeExports.jsx(se.ColorLegend,{width:t?.width,colorLegendTitle:t?.colorLegendTitle,colors:t?.colors||t?.lineColors||re.Colors[t?.theme||"light"].categoricalColors.colors,colorDomain:t?.colorDomain||t?.labels||[],showNAColor:t?.showNAColor===void 0||t?.showNAColor===null?!0:t?.showNAColor}):null,o.jsxRuntimeExports.jsx("div",{className:`flex flex-wrap gap-4 justify-center ${t?.language==="ar"||t?.language==="he"?"flex-row-reverse":"flex-row"}`,children:b.map((e,r)=>o.jsxRuntimeExports.jsx("div",{style:{width:`calc(${100/(y||Math.min(4,b.length||0))}% - ${((y||Math.min(4,b.length||0))-1)/(y||Math.min(4,b.length||0))}rem)`,minWidth:ue.checkIfNullOrUndefined(F)?"280px":`${F}px`},children:o.jsxRuntimeExports.jsx(oe.GraphEl,{graph:$,graphDataConfiguration:x,graphData:H.transformDataForGraph(D?H.transformDataForAggregation(z.filterData(v,q||[]).filter(a=>a[E]===e),D.keyColumn,D.aggregationColumnsSetting):z.filterData(v,q||[]).filter(a=>a[E]===e),$,x)||[],debugMode:w,settings:{...t||{},...h,theme:t?.theme||X,width:void 0,height:void 0,relativeHeight:t?.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:t?.showColorScale===!1?!1:A===!1},readableHeader:Q||[]})},r))})]}):o.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:o.jsxRuntimeExports.jsx(te.w,{})}),t?.sources||t?.footNote?o.jsxRuntimeExports.jsx(ie.GraphFooter,{styles:{footnote:t?.styles?.footnote,source:t?.styles?.source},classNames:{footnote:t?.classNames?.footnote,source:t?.classNames?.source},sources:t?.sources,footNote:t?.footNote,width:t?.width}):null]})}exports.GriddedGraphs=ce;
|
|
2
2
|
//# sourceMappingURL=GriddedGraphs.cjs.map
|
package/dist/GriddedGraphs.js
CHANGED
|
@@ -6,7 +6,7 @@ import { b as $, y as A, h as F, c as ca, $ as K, P as Q } from "./checkIfMultip
|
|
|
6
6
|
import { w as da } from "./Spinner--r2RrJV8.js";
|
|
7
7
|
import { j as V, D as O } from "./DropdownSelect-D8rFbygC.js";
|
|
8
8
|
import { G as ha } from "./GraphContainer-CF6ws3pd.js";
|
|
9
|
-
import { G as fa } from "./GraphEl-
|
|
9
|
+
import { G as fa } from "./GraphEl-DDXkYObU.js";
|
|
10
10
|
import { f as pa, a as ga, b as ma, c as Ca, t as va } from "./fetchAndParseData-BAXhgTDM.js";
|
|
11
11
|
import { Colors as wa } from "./Colors.js";
|
|
12
12
|
import { a as ba, t as xa } from "./transformDataForAggregation-wdPf8bNt.js";
|
package/dist/HeatMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-6v2a2njQ.cjs"),q=require("react"),Ye=require("./index-DQA8q5sC.cjs"),Pe=require("./numberFormattingFunction-02t-wJta.cjs"),Ue=require("./Tooltip-BLa2EfMs.cjs"),ze=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),He=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Je=require("./XAxesLabels-C6o9jJal.cjs"),Ke=require("./YAxesLabels-BQ2aCazV.cjs"),Ge=require("./uniqBy-O05lp2S5.cjs"),Qe=require("./DetailsModal-DHttOA80.cjs"),Fe=require("./band-VYfcZeJ2.cjs"),Ze=require("./ordinal-CrsysVE-.cjs"),_e=require("./threshold-DNsSUf8Q.cjs"),et=require("./linear-CgUCbw9F.cjs"),Ve=require("./proxy-C4-uo6nS.cjs"),tt=require("./use-in-view-C3o_ntMv.cjs"),ot=require("./GraphHeader.cjs"),st=require("./GraphFooter.cjs"),it=require("./ColorLegendWithMouseOver.cjs"),rt=require("./LinearColorLegend.cjs"),nt=require("./ThresholdColorLegendWithMouseOver.cjs"),p=require("./Colors.cjs"),lt=require("./EmptyState-CGeBqbmR.cjs"),Xe=require("./GraphContainer-B1EDxJ0S.cjs");function at(u){const e=t.compilerRuntimeExports.c(86),{data:l,showColumnLabels:z,leftMargin:f,rightMargin:J,truncateBy:y,width:K,height:Q,topMargin:ge,bottomMargin:pe,tooltip:Z,onSeriesMouseOver:n,suffix:$e,prefix:r,showValues:_,colorDomain:j,colors:B,noDataColor:ie,scaleType:re,showRowLabels:fe,selectedColor:ee,onSeriesMouseClick:W,resetSelectionOnDoubleClick:Ce,detailsOnClick:R,styles:m,classNames:c,animate:h,precision:ne}=u,Me=q.useRef(null);let le;e[0]!==h.amount||e[1]!==h.once?(le={once:h.once,amount:h.amount},e[0]=h.amount,e[1]=h.once,e[2]=le):le=e[2];const E=tt.useInView(Me,le);let ae;e[3]!==pe||e[4]!==f||e[5]!==J||e[6]!==ge?(ae={top:ge,bottom:pe,left:f,right:J},e[3]=pe,e[4]=f,e[5]=J,e[6]=ge,e[7]=ae):ae=e[7];const d=ae,[$,ve]=q.useState(void 0),[C,ye]=q.useState(void 0),[ce,ue]=q.useState(void 0),[de,he]=q.useState(void 0),a=K-d.left-d.right,i=Q-d.top-d.bottom;let G,F,M,O,k,S,D,L,N,A,V,H,g;if(e[8]!==h.duration||e[9]!==c?.graphObjectValues||e[10]!==c?.xAxis?.labels||e[11]!==c?.yAxis?.labels||e[12]!==j||e[13]!==B||e[14]!==l||e[15]!==R||e[16]!==i||e[17]!==a||e[18]!==Q||e[19]!==E||e[20]!==d.left||e[21]!==d.top||e[22]!==$||e[23]!==C||e[24]!==ie||e[25]!==W||e[26]!==n||e[27]!==ne||e[28]!==r||e[29]!==Ce||e[30]!==re||e[31]!==ee||e[32]!==z||e[33]!==fe||e[34]!==_||e[35]!==m?.graphObjectValues||e[36]!==m?.xAxis?.labels||e[37]!==m?.yAxis?.labels||e[38]!==$e||e[39]!==y||e[40]!==K){const oe=Ge.uniqBy(l,"column",!0),xe=Ge.uniqBy(l,"row",!0),s=Fe.band().domain(xe).range([0,i]),X=s.bandwidth(),I=Fe.band().domain(oe).range([0,a]),Y=I.bandwidth(),se=re==="categorical"?Ze.ordinal().domain(j).range(B):re==="threshold"?_e.threshold().domain(j).range(B):et.linear().domain(j).range(B);G=Ve.motion.svg,A=`${K}px`,V=`${Q}px`,H=`0 0 ${K} ${Q}`,e[54]===Symbol.for("react.memo_cache_sentinel")?(g={marginLeft:"auto",marginRight:"auto"},e[54]=g):g=e[54],F="ltr",M=Me,O=t.jsxRuntimeExports.jsx("g",{transform:`translate(${d.left},0)`,children:z?oe.map((o,v)=>t.jsxRuntimeExports.jsx(Je.XAxesLabels,{y:0,x:I(o),width:Y,height:d.top-5,value:`${o}`.length<y?`${o}`:`${`${o}`.substring(0,y)}...`,style:m?.xAxis?.labels,className:c?.xAxis?.labels,alignment:"bottom",animate:{duration:0,once:!0,amount:0},isInView:E},v)):null}),k=t.jsxRuntimeExports.jsx("g",{transform:`translate(0,${d.top})`,children:fe?xe.map((o,v)=>t.jsxRuntimeExports.jsx(Ke.YAxesLabels,{value:`${o}`.length<y?`${o}`:`${`${o}`.substring(0,y)}...`,y:s(o),x:0,width:d.left,height:X,alignment:"right",style:m?.yAxis?.labels,className:c?.yAxis?.labels,animate:{duration:0,once:!0,amount:0},isInView:E},v)):null}),S=`translate(${d.left},${d.top})`,D=xe.map((o,v)=>t.jsxRuntimeExports.jsx("g",{transform:`translate(0,${s(o)})`,children:oe.map(P=>t.jsxRuntimeExports.jsx("rect",{x:I(P),y:0,width:Y,height:X,style:{fill:ie},className:"stroke-1 stroke-primary-white dark:stroke-primary-gray-700"},`${o}-${P}`))},v)),L=l.filter(ct).map((o,v)=>{const P=He.checkIfNullOrUndefined(o.value)?ie:se(o.value);return t.jsxRuntimeExports.jsxs("g",{transform:`translate(${I(o.column)},${s(o.row)})`,onMouseEnter:U=>{ye(o),he(U.clientY),ue(U.clientX),n?.(o)},onClick:()=>{(W||R)&&(Ye.isEqual($,o)&&Ce?(ve(void 0),W?.(void 0)):(ve(o),W?.(o)))},onMouseMove:U=>{ye(o),he(U.clientY),ue(U.clientX)},onMouseLeave:()=>{ye(void 0),ue(void 0),he(void 0),n?.(void 0)},opacity:ee?ee===P?1:.3:1,children:[t.jsxRuntimeExports.jsx(Ve.motion.rect,{x:0,y:0,width:Y,height:X,className:"stroke-1 stroke-primary-white dark:stroke-primary-gray-700",exit:{opacity:0,transition:{duration:h.duration}},variants:{initial:{fill:P,opacity:0},whileInView:{fill:P,opacity:1,transition:{duration:h.duration}}},initial:"initial",animate:E?"whileInView":"initial"}),_&&!He.checkIfNullOrUndefined(o.value)?t.jsxRuntimeExports.jsx(Ve.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:h.duration}}},initial:"initial",animate:E?"whileInView":"initial",exit:{opacity:0,transition:{duration:h.duration}},children:t.jsxRuntimeExports.jsx("foreignObject",{y:0,x:0,width:Y,height:X,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",c?.graphObjectValues),style:{color:ze.getTextColorBasedOnBgColor(P),...m?.graphObjectValues||{}},children:Pe.numberFormattingFunction(o.value,"NA",ne,r,$e)})})},v)}):null]},`${o.column}-${o.row}`)}),N=C?t.jsxRuntimeExports.jsx("rect",{x:I(C.column),y:s(C.row),width:Y,height:X,style:{fill:"none",fillOpacity:0,strokeWidth:1.5},className:"stroke-primary-gray-700 dark:stroke-primary-gray-300"}):null,e[8]=h.duration,e[9]=c?.graphObjectValues,e[10]=c?.xAxis?.labels,e[11]=c?.yAxis?.labels,e[12]=j,e[13]=B,e[14]=l,e[15]=R,e[16]=i,e[17]=a,e[18]=Q,e[19]=E,e[20]=d.left,e[21]=d.top,e[22]=$,e[23]=C,e[24]=ie,e[25]=W,e[26]=n,e[27]=ne,e[28]=r,e[29]=Ce,e[30]=re,e[31]=ee,e[32]=z,e[33]=fe,e[34]=_,e[35]=m?.graphObjectValues,e[36]=m?.xAxis?.labels,e[37]=m?.yAxis?.labels,e[38]=$e,e[39]=y,e[40]=K,e[41]=G,e[42]=F,e[43]=M,e[44]=O,e[45]=k,e[46]=S,e[47]=D,e[48]=L,e[49]=N,e[50]=A,e[51]=V,e[52]=H,e[53]=g}else G=e[41],F=e[42],M=e[43],O=e[44],k=e[45],S=e[46],D=e[47],L=e[48],N=e[49],A=e[50],V=e[51],H=e[52],g=e[53];let T;e[55]!==S||e[56]!==D||e[57]!==L||e[58]!==N?(T=t.jsxRuntimeExports.jsxs("g",{transform:S,children:[D,L,N]}),e[55]=S,e[56]=D,e[57]=L,e[58]=N,e[59]=T):T=e[59];let b;e[60]!==G||e[61]!==F||e[62]!==M||e[63]!==O||e[64]!==k||e[65]!==T||e[66]!==A||e[67]!==V||e[68]!==H||e[69]!==g?(b=t.jsxRuntimeExports.jsxs(G,{width:A,height:V,viewBox:H,style:g,direction:F,ref:M,children:[O,k,T]}),e[60]=G,e[61]=F,e[62]=M,e[63]=O,e[64]=k,e[65]=T,e[66]=A,e[67]=V,e[68]=H,e[69]=g,e[70]=b):b=e[70];let w;e[71]!==c?.tooltip||e[72]!==ce||e[73]!==de||e[74]!==C||e[75]!==m?.tooltip||e[76]!==Z?(w=C&&Z&&ce&&de?t.jsxRuntimeExports.jsx(Ue.Tooltip,{data:C,body:Z,xPos:ce,yPos:de,backgroundStyle:m?.tooltip,className:c?.tooltip}):null,e[71]=c?.tooltip,e[72]=ce,e[73]=de,e[74]=C,e[75]=m?.tooltip,e[76]=Z,e[77]=w):w=e[77];let x;e[78]!==c?.modal||e[79]!==R||e[80]!==$?(x=R&&$!==void 0?t.jsxRuntimeExports.jsx(Qe.DetailsModal,{body:R,data:$,setData:ve,className:c?.modal}):null,e[78]=c?.modal,e[79]=R,e[80]=$,e[81]=x):x=e[81];let te;return e[82]!==b||e[83]!==w||e[84]!==x?(te=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[b,w,x]}),e[82]=b,e[83]=w,e[84]=x,e[85]=te):te=e[85],te}function ct(u){return!He.checkIfNullOrUndefined(u.value)}function ut(u){const e=t.compilerRuntimeExports.c(87),{data:l,graphTitle:z,colors:f,sources:J,graphDescription:y,showColumnLabels:K,leftMargin:Q,rightMargin:ge,truncateBy:pe,height:Z,width:n,scaleType:$e,colorDomain:r,footNote:_,colorLegendTitle:j,padding:B,backgroundColor:ie,topMargin:re,bottomMargin:fe,tooltip:ee,onSeriesMouseOver:W,suffix:Ce,prefix:R,showRowLabels:m,relativeHeight:c,showValues:h,graphID:ne,noDataColor:Me,showColorScale:le,onSeriesMouseClick:E,graphDownload:ae,dataDownload:d,fillContainer:$,language:ve,showNAColor:C,minHeight:ye,theme:ce,ariaLabel:ue,resetSelectionOnDoubleClick:de,detailsOnClick:he,styles:a,classNames:i,animate:G,precision:F}=u,M=K===void 0?!0:K,O=Q===void 0?100:Q,k=ge===void 0?10:ge,S=pe===void 0?999:pe,D=ie===void 0?!1:ie,L=re===void 0?30:re,N=fe===void 0?10:fe,A=Ce===void 0?"":Ce,V=R===void 0?"":R,H=m===void 0?!0:m,g=Me===void 0?p.Colors.gray:Me,T=le===void 0?!0:le,b=ae===void 0?!1:ae,w=d===void 0?!1:d,x=$===void 0?!0:$,te=ve===void 0?"en":ve,oe=C===void 0?!0:C,xe=ye===void 0?0:ye,s=ce===void 0?"light":ce,X=de===void 0?!0:de,I=G===void 0?!1:G,Y=F===void 0?2:F,[se,o]=q.useState(0),[v,P]=q.useState(0),[U,Te]=q.useState(void 0),De=q.useRef(null),Ie=q.useRef(null);let Oe,ke;e[0]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>{const Be=new ResizeObserver(We=>{o(We[0].target.clientWidth||620),P(We[0].target.clientHeight||480)});return De.current&&Be.observe(De.current),()=>Be.disconnect()},ke=[],e[0]=Oe,e[1]=ke):(Oe=e[0],ke=e[1]),q.useEffect(Oe,ke);const me=$e||(typeof r[0]=="string"?"categorical":r.length===2?"linear":"threshold"),Le=i?.graphContainer,Ne=a?.graphContainer,Ae=x?void 0:n;let je;e[2]!==i?.description||e[3]!==i?.title||e[4]!==l||e[5]!==w||e[6]!==y||e[7]!==b||e[8]!==z||e[9]!==a?.description||e[10]!==a?.title||e[11]!==n?(je=z||y||b||w?t.jsxRuntimeExports.jsx(ot.GraphHeader,{styles:{title:a?.title,description:a?.description},classNames:{title:i?.title,description:i?.description},graphTitle:z,graphDescription:y,width:n,graphDownload:b?Ie:void 0,dataDownload:w?l.map(pt).filter(gt).length>0?l.map(mt).filter(xt):l.filter(ht):null}):null,e[2]=i?.description,e[3]=i?.title,e[4]=l,e[5]=w,e[6]=y,e[7]=b,e[8]=z,e[9]=a?.description,e[10]=a?.title,e[11]=n,e[12]=je):je=e[12];let be;e[13]!==i?.colorLegend||e[14]!==r||e[15]!==j||e[16]!==f||e[17]!==l.length||e[18]!==x||e[19]!==g||e[20]!==me||e[21]!==T||e[22]!==oe||e[23]!==s||e[24]!==n?(be=T&&l.length>0?me==="categorical"?t.jsxRuntimeExports.jsx(it.ColorLegendWithMouseOver,{width:x?void 0:n,colorLegendTitle:j,colors:f||(typeof r[0]=="string"?p.Colors[s].categoricalColors.colors:r.length===2?[p.Colors[s].sequentialColors.neutralColorsx09[0],p.Colors[s].sequentialColors.neutralColorsx09[8]]:p.Colors[s].sequentialColors[`neutralColorsx0${r.length+1}`]),colorDomain:r.map(dt),setSelectedColor:Te,showNAColor:oe,className:i?.colorLegend}):me==="threshold"?t.jsxRuntimeExports.jsx(nt.ThresholdColorLegendWithMouseOver,{width:x?void 0:n,colorLegendTitle:j,colors:f||(typeof r[0]=="string"?p.Colors[s].categoricalColors.colors:r.length===2?[p.Colors[s].sequentialColors.neutralColorsx09[0],p.Colors[s].sequentialColors.neutralColorsx09[8]]:p.Colors[s].sequentialColors[`neutralColorsx0${r.length+1}`]),colorDomain:r,setSelectedColor:Te,naColor:g,showNAColor:oe}):t.jsxRuntimeExports.jsx(rt.LinearColorLegend,{width:x?void 0:n,colorLegendTitle:j,colors:f||[p.Colors[s].sequentialColors.neutralColorsx09[0],p.Colors[s].sequentialColors.neutralColorsx09[8]],colorDomain:r,className:i?.colorLegend}):null,e[13]=i?.colorLegend,e[14]=r,e[15]=j,e[16]=f,e[17]=l.length,e[18]=x,e[19]=g,e[20]=me,e[21]=T,e[22]=oe,e[23]=s,e[24]=n,e[25]=be):be=e[25];let we;e[26]!==l.length?(we=l.length===0&&t.jsxRuntimeExports.jsx(lt.EmptyState,{}),e[26]=l.length,e[27]=we):we=e[27];let qe;e[28]!==I||e[29]!==N||e[30]!==i||e[31]!==r||e[32]!==f||e[33]!==l||e[34]!==he||e[35]!==x||e[36]!==O||e[37]!==g||e[38]!==E||e[39]!==W||e[40]!==Y||e[41]!==V||e[42]!==X||e[43]!==k||e[44]!==me||e[45]!==U||e[46]!==M||e[47]!==H||e[48]!==h||e[49]!==a||e[50]!==A||e[51]!==v||e[52]!==se||e[53]!==s||e[54]!==ee||e[55]!==L||e[56]!==S||e[57]!==n?(qe=se&&v&&l.length>0?t.jsxRuntimeExports.jsx(at,{data:l,colorDomain:r,width:x||!n||se<n?se:n,height:v,colors:f||(typeof r[0]=="string"?p.Colors[s].categoricalColors.colors:r.length===2?[p.Colors[s].sequentialColors.neutralColorsx09[0],p.Colors[s].sequentialColors.neutralColorsx09[8]]:p.Colors[s].sequentialColors[`neutralColorsx0${r.length+1}`]),noDataColor:g,scaleType:me,showColumnLabels:M,leftMargin:O,rightMargin:k,topMargin:L,bottomMargin:N,selectedColor:U,truncateBy:S,showRowLabels:H,tooltip:ee,onSeriesMouseOver:W,showValues:h,suffix:A,prefix:V,onSeriesMouseClick:E,resetSelectionOnDoubleClick:X,detailsOnClick:he,styles:a,classNames:i,animate:I===!0?{duration:.5,once:!0,amount:.5}:I||{duration:0,once:!0,amount:0},precision:Y}):null,e[28]=I,e[29]=N,e[30]=i,e[31]=r,e[32]=f,e[33]=l,e[34]=he,e[35]=x,e[36]=O,e[37]=g,e[38]=E,e[39]=W,e[40]=Y,e[41]=V,e[42]=X,e[43]=k,e[44]=me,e[45]=U,e[46]=M,e[47]=H,e[48]=h,e[49]=a,e[50]=A,e[51]=v,e[52]=se,e[53]=s,e[54]=ee,e[55]=L,e[56]=S,e[57]=n,e[58]=qe):qe=e[58];let Re;e[59]!==we||e[60]!==qe?(Re=t.jsxRuntimeExports.jsxs(Xe.GraphArea,{ref:De,children:[we,qe]}),e[59]=we,e[60]=qe,e[61]=Re):Re=e[61];let Ee;e[62]!==i?.footnote||e[63]!==i?.source||e[64]!==_||e[65]!==J||e[66]!==a?.footnote||e[67]!==a?.source||e[68]!==n?(Ee=J||_?t.jsxRuntimeExports.jsx(st.GraphFooter,{styles:{footnote:a?.footnote,source:a?.source},classNames:{footnote:i?.footnote,source:i?.source},sources:J,footNote:_,width:n}):null,e[62]=i?.footnote,e[63]=i?.source,e[64]=_,e[65]=J,e[66]=a?.footnote,e[67]=a?.source,e[68]=n,e[69]=Ee):Ee=e[69];let Se;return e[70]!==ue||e[71]!==D||e[72]!==ne||e[73]!==Z||e[74]!==te||e[75]!==xe||e[76]!==B||e[77]!==c||e[78]!==Le||e[79]!==Ne||e[80]!==Ae||e[81]!==je||e[82]!==be||e[83]!==Re||e[84]!==Ee||e[85]!==s?(Se=t.jsxRuntimeExports.jsxs(Xe.GraphContainer,{className:Le,style:Ne,id:ne,ref:Ie,"aria-label":ue,backgroundColor:D,theme:s,language:te,minHeight:xe,width:Ae,height:Z,relativeHeight:c,padding:B,children:[je,be,Re,Ee]}),e[70]=ue,e[71]=D,e[72]=ne,e[73]=Z,e[74]=te,e[75]=xe,e[76]=B,e[77]=c,e[78]=Le,e[79]=Ne,e[80]=Ae,e[81]=je,e[82]=be,e[83]=Re,e[84]=Ee,e[85]=s,e[86]=Se):Se=e[86],Se}function dt(u){return`${u}`}function ht(u){return u!==void 0}function xt(u){return u!==void 0}function mt(u){return u.data}function gt(u){return u!==void 0}function pt(u){return u.data}exports.HeatMap=ut;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-6v2a2njQ.cjs"),q=require("react"),Ye=require("./index-DQA8q5sC.cjs"),Pe=require("./numberFormattingFunction-02t-wJta.cjs"),Ue=require("./Tooltip-BLa2EfMs.cjs"),ze=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),He=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Je=require("./XAxesLabels-C6o9jJal.cjs"),Ke=require("./YAxesLabels-BQ2aCazV.cjs"),Ge=require("./uniqBy-O05lp2S5.cjs"),Qe=require("./DetailsModal-DHttOA80.cjs"),Fe=require("./band-VYfcZeJ2.cjs"),Ze=require("./ordinal-CrsysVE-.cjs"),_e=require("./threshold-DNsSUf8Q.cjs"),et=require("./linear-CgUCbw9F.cjs"),Ve=require("./proxy-C4-uo6nS.cjs"),tt=require("./use-in-view-C3o_ntMv.cjs"),ot=require("./GraphHeader.cjs"),st=require("./GraphFooter.cjs"),it=require("./ColorLegendWithMouseOver.cjs"),rt=require("./LinearColorLegend.cjs"),nt=require("./ThresholdColorLegendWithMouseOver.cjs"),p=require("./Colors.cjs"),lt=require("./EmptyState-DX0t62iF.cjs"),Xe=require("./GraphContainer-B1EDxJ0S.cjs");function at(u){const e=t.compilerRuntimeExports.c(86),{data:l,showColumnLabels:z,leftMargin:f,rightMargin:J,truncateBy:y,width:K,height:Q,topMargin:ge,bottomMargin:pe,tooltip:Z,onSeriesMouseOver:n,suffix:$e,prefix:r,showValues:_,colorDomain:j,colors:B,noDataColor:ie,scaleType:re,showRowLabels:fe,selectedColor:ee,onSeriesMouseClick:W,resetSelectionOnDoubleClick:Ce,detailsOnClick:R,styles:m,classNames:c,animate:h,precision:ne}=u,Me=q.useRef(null);let le;e[0]!==h.amount||e[1]!==h.once?(le={once:h.once,amount:h.amount},e[0]=h.amount,e[1]=h.once,e[2]=le):le=e[2];const E=tt.useInView(Me,le);let ae;e[3]!==pe||e[4]!==f||e[5]!==J||e[6]!==ge?(ae={top:ge,bottom:pe,left:f,right:J},e[3]=pe,e[4]=f,e[5]=J,e[6]=ge,e[7]=ae):ae=e[7];const d=ae,[$,ve]=q.useState(void 0),[C,ye]=q.useState(void 0),[ce,ue]=q.useState(void 0),[de,he]=q.useState(void 0),a=K-d.left-d.right,i=Q-d.top-d.bottom;let G,F,M,O,k,S,D,L,N,A,V,H,g;if(e[8]!==h.duration||e[9]!==c?.graphObjectValues||e[10]!==c?.xAxis?.labels||e[11]!==c?.yAxis?.labels||e[12]!==j||e[13]!==B||e[14]!==l||e[15]!==R||e[16]!==i||e[17]!==a||e[18]!==Q||e[19]!==E||e[20]!==d.left||e[21]!==d.top||e[22]!==$||e[23]!==C||e[24]!==ie||e[25]!==W||e[26]!==n||e[27]!==ne||e[28]!==r||e[29]!==Ce||e[30]!==re||e[31]!==ee||e[32]!==z||e[33]!==fe||e[34]!==_||e[35]!==m?.graphObjectValues||e[36]!==m?.xAxis?.labels||e[37]!==m?.yAxis?.labels||e[38]!==$e||e[39]!==y||e[40]!==K){const oe=Ge.uniqBy(l,"column",!0),xe=Ge.uniqBy(l,"row",!0),s=Fe.band().domain(xe).range([0,i]),X=s.bandwidth(),I=Fe.band().domain(oe).range([0,a]),Y=I.bandwidth(),se=re==="categorical"?Ze.ordinal().domain(j).range(B):re==="threshold"?_e.threshold().domain(j).range(B):et.linear().domain(j).range(B);G=Ve.motion.svg,A=`${K}px`,V=`${Q}px`,H=`0 0 ${K} ${Q}`,e[54]===Symbol.for("react.memo_cache_sentinel")?(g={marginLeft:"auto",marginRight:"auto"},e[54]=g):g=e[54],F="ltr",M=Me,O=t.jsxRuntimeExports.jsx("g",{transform:`translate(${d.left},0)`,children:z?oe.map((o,v)=>t.jsxRuntimeExports.jsx(Je.XAxesLabels,{y:0,x:I(o),width:Y,height:d.top-5,value:`${o}`.length<y?`${o}`:`${`${o}`.substring(0,y)}...`,style:m?.xAxis?.labels,className:c?.xAxis?.labels,alignment:"bottom",animate:{duration:0,once:!0,amount:0},isInView:E},v)):null}),k=t.jsxRuntimeExports.jsx("g",{transform:`translate(0,${d.top})`,children:fe?xe.map((o,v)=>t.jsxRuntimeExports.jsx(Ke.YAxesLabels,{value:`${o}`.length<y?`${o}`:`${`${o}`.substring(0,y)}...`,y:s(o),x:0,width:d.left,height:X,alignment:"right",style:m?.yAxis?.labels,className:c?.yAxis?.labels,animate:{duration:0,once:!0,amount:0},isInView:E},v)):null}),S=`translate(${d.left},${d.top})`,D=xe.map((o,v)=>t.jsxRuntimeExports.jsx("g",{transform:`translate(0,${s(o)})`,children:oe.map(P=>t.jsxRuntimeExports.jsx("rect",{x:I(P),y:0,width:Y,height:X,style:{fill:ie},className:"stroke-1 stroke-primary-white dark:stroke-primary-gray-700"},`${o}-${P}`))},v)),L=l.filter(ct).map((o,v)=>{const P=He.checkIfNullOrUndefined(o.value)?ie:se(o.value);return t.jsxRuntimeExports.jsxs("g",{transform:`translate(${I(o.column)},${s(o.row)})`,onMouseEnter:U=>{ye(o),he(U.clientY),ue(U.clientX),n?.(o)},onClick:()=>{(W||R)&&(Ye.isEqual($,o)&&Ce?(ve(void 0),W?.(void 0)):(ve(o),W?.(o)))},onMouseMove:U=>{ye(o),he(U.clientY),ue(U.clientX)},onMouseLeave:()=>{ye(void 0),ue(void 0),he(void 0),n?.(void 0)},opacity:ee?ee===P?1:.3:1,children:[t.jsxRuntimeExports.jsx(Ve.motion.rect,{x:0,y:0,width:Y,height:X,className:"stroke-1 stroke-primary-white dark:stroke-primary-gray-700",exit:{opacity:0,transition:{duration:h.duration}},variants:{initial:{fill:P,opacity:0},whileInView:{fill:P,opacity:1,transition:{duration:h.duration}}},initial:"initial",animate:E?"whileInView":"initial"}),_&&!He.checkIfNullOrUndefined(o.value)?t.jsxRuntimeExports.jsx(Ve.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:h.duration}}},initial:"initial",animate:E?"whileInView":"initial",exit:{opacity:0,transition:{duration:h.duration}},children:t.jsxRuntimeExports.jsx("foreignObject",{y:0,x:0,width:Y,height:X,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",c?.graphObjectValues),style:{color:ze.getTextColorBasedOnBgColor(P),...m?.graphObjectValues||{}},children:Pe.numberFormattingFunction(o.value,"NA",ne,r,$e)})})},v)}):null]},`${o.column}-${o.row}`)}),N=C?t.jsxRuntimeExports.jsx("rect",{x:I(C.column),y:s(C.row),width:Y,height:X,style:{fill:"none",fillOpacity:0,strokeWidth:1.5},className:"stroke-primary-gray-700 dark:stroke-primary-gray-300"}):null,e[8]=h.duration,e[9]=c?.graphObjectValues,e[10]=c?.xAxis?.labels,e[11]=c?.yAxis?.labels,e[12]=j,e[13]=B,e[14]=l,e[15]=R,e[16]=i,e[17]=a,e[18]=Q,e[19]=E,e[20]=d.left,e[21]=d.top,e[22]=$,e[23]=C,e[24]=ie,e[25]=W,e[26]=n,e[27]=ne,e[28]=r,e[29]=Ce,e[30]=re,e[31]=ee,e[32]=z,e[33]=fe,e[34]=_,e[35]=m?.graphObjectValues,e[36]=m?.xAxis?.labels,e[37]=m?.yAxis?.labels,e[38]=$e,e[39]=y,e[40]=K,e[41]=G,e[42]=F,e[43]=M,e[44]=O,e[45]=k,e[46]=S,e[47]=D,e[48]=L,e[49]=N,e[50]=A,e[51]=V,e[52]=H,e[53]=g}else G=e[41],F=e[42],M=e[43],O=e[44],k=e[45],S=e[46],D=e[47],L=e[48],N=e[49],A=e[50],V=e[51],H=e[52],g=e[53];let T;e[55]!==S||e[56]!==D||e[57]!==L||e[58]!==N?(T=t.jsxRuntimeExports.jsxs("g",{transform:S,children:[D,L,N]}),e[55]=S,e[56]=D,e[57]=L,e[58]=N,e[59]=T):T=e[59];let b;e[60]!==G||e[61]!==F||e[62]!==M||e[63]!==O||e[64]!==k||e[65]!==T||e[66]!==A||e[67]!==V||e[68]!==H||e[69]!==g?(b=t.jsxRuntimeExports.jsxs(G,{width:A,height:V,viewBox:H,style:g,direction:F,ref:M,children:[O,k,T]}),e[60]=G,e[61]=F,e[62]=M,e[63]=O,e[64]=k,e[65]=T,e[66]=A,e[67]=V,e[68]=H,e[69]=g,e[70]=b):b=e[70];let w;e[71]!==c?.tooltip||e[72]!==ce||e[73]!==de||e[74]!==C||e[75]!==m?.tooltip||e[76]!==Z?(w=C&&Z&&ce&&de?t.jsxRuntimeExports.jsx(Ue.Tooltip,{data:C,body:Z,xPos:ce,yPos:de,backgroundStyle:m?.tooltip,className:c?.tooltip}):null,e[71]=c?.tooltip,e[72]=ce,e[73]=de,e[74]=C,e[75]=m?.tooltip,e[76]=Z,e[77]=w):w=e[77];let x;e[78]!==c?.modal||e[79]!==R||e[80]!==$?(x=R&&$!==void 0?t.jsxRuntimeExports.jsx(Qe.DetailsModal,{body:R,data:$,setData:ve,className:c?.modal}):null,e[78]=c?.modal,e[79]=R,e[80]=$,e[81]=x):x=e[81];let te;return e[82]!==b||e[83]!==w||e[84]!==x?(te=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[b,w,x]}),e[82]=b,e[83]=w,e[84]=x,e[85]=te):te=e[85],te}function ct(u){return!He.checkIfNullOrUndefined(u.value)}function ut(u){const e=t.compilerRuntimeExports.c(87),{data:l,graphTitle:z,colors:f,sources:J,graphDescription:y,showColumnLabels:K,leftMargin:Q,rightMargin:ge,truncateBy:pe,height:Z,width:n,scaleType:$e,colorDomain:r,footNote:_,colorLegendTitle:j,padding:B,backgroundColor:ie,topMargin:re,bottomMargin:fe,tooltip:ee,onSeriesMouseOver:W,suffix:Ce,prefix:R,showRowLabels:m,relativeHeight:c,showValues:h,graphID:ne,noDataColor:Me,showColorScale:le,onSeriesMouseClick:E,graphDownload:ae,dataDownload:d,fillContainer:$,language:ve,showNAColor:C,minHeight:ye,theme:ce,ariaLabel:ue,resetSelectionOnDoubleClick:de,detailsOnClick:he,styles:a,classNames:i,animate:G,precision:F}=u,M=K===void 0?!0:K,O=Q===void 0?100:Q,k=ge===void 0?10:ge,S=pe===void 0?999:pe,D=ie===void 0?!1:ie,L=re===void 0?30:re,N=fe===void 0?10:fe,A=Ce===void 0?"":Ce,V=R===void 0?"":R,H=m===void 0?!0:m,g=Me===void 0?p.Colors.gray:Me,T=le===void 0?!0:le,b=ae===void 0?!1:ae,w=d===void 0?!1:d,x=$===void 0?!0:$,te=ve===void 0?"en":ve,oe=C===void 0?!0:C,xe=ye===void 0?0:ye,s=ce===void 0?"light":ce,X=de===void 0?!0:de,I=G===void 0?!1:G,Y=F===void 0?2:F,[se,o]=q.useState(0),[v,P]=q.useState(0),[U,Te]=q.useState(void 0),De=q.useRef(null),Ie=q.useRef(null);let Oe,ke;e[0]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>{const Be=new ResizeObserver(We=>{o(We[0].target.clientWidth||620),P(We[0].target.clientHeight||480)});return De.current&&Be.observe(De.current),()=>Be.disconnect()},ke=[],e[0]=Oe,e[1]=ke):(Oe=e[0],ke=e[1]),q.useEffect(Oe,ke);const me=$e||(typeof r[0]=="string"?"categorical":r.length===2?"linear":"threshold"),Le=i?.graphContainer,Ne=a?.graphContainer,Ae=x?void 0:n;let je;e[2]!==i?.description||e[3]!==i?.title||e[4]!==l||e[5]!==w||e[6]!==y||e[7]!==b||e[8]!==z||e[9]!==a?.description||e[10]!==a?.title||e[11]!==n?(je=z||y||b||w?t.jsxRuntimeExports.jsx(ot.GraphHeader,{styles:{title:a?.title,description:a?.description},classNames:{title:i?.title,description:i?.description},graphTitle:z,graphDescription:y,width:n,graphDownload:b?Ie:void 0,dataDownload:w?l.map(pt).filter(gt).length>0?l.map(mt).filter(xt):l.filter(ht):null}):null,e[2]=i?.description,e[3]=i?.title,e[4]=l,e[5]=w,e[6]=y,e[7]=b,e[8]=z,e[9]=a?.description,e[10]=a?.title,e[11]=n,e[12]=je):je=e[12];let be;e[13]!==i?.colorLegend||e[14]!==r||e[15]!==j||e[16]!==f||e[17]!==l.length||e[18]!==x||e[19]!==g||e[20]!==me||e[21]!==T||e[22]!==oe||e[23]!==s||e[24]!==n?(be=T&&l.length>0?me==="categorical"?t.jsxRuntimeExports.jsx(it.ColorLegendWithMouseOver,{width:x?void 0:n,colorLegendTitle:j,colors:f||(typeof r[0]=="string"?p.Colors[s].categoricalColors.colors:r.length===2?[p.Colors[s].sequentialColors.neutralColorsx09[0],p.Colors[s].sequentialColors.neutralColorsx09[8]]:p.Colors[s].sequentialColors[`neutralColorsx0${r.length+1}`]),colorDomain:r.map(dt),setSelectedColor:Te,showNAColor:oe,className:i?.colorLegend}):me==="threshold"?t.jsxRuntimeExports.jsx(nt.ThresholdColorLegendWithMouseOver,{width:x?void 0:n,colorLegendTitle:j,colors:f||(typeof r[0]=="string"?p.Colors[s].categoricalColors.colors:r.length===2?[p.Colors[s].sequentialColors.neutralColorsx09[0],p.Colors[s].sequentialColors.neutralColorsx09[8]]:p.Colors[s].sequentialColors[`neutralColorsx0${r.length+1}`]),colorDomain:r,setSelectedColor:Te,naColor:g,showNAColor:oe}):t.jsxRuntimeExports.jsx(rt.LinearColorLegend,{width:x?void 0:n,colorLegendTitle:j,colors:f||[p.Colors[s].sequentialColors.neutralColorsx09[0],p.Colors[s].sequentialColors.neutralColorsx09[8]],colorDomain:r,className:i?.colorLegend}):null,e[13]=i?.colorLegend,e[14]=r,e[15]=j,e[16]=f,e[17]=l.length,e[18]=x,e[19]=g,e[20]=me,e[21]=T,e[22]=oe,e[23]=s,e[24]=n,e[25]=be):be=e[25];let we;e[26]!==l.length?(we=l.length===0&&t.jsxRuntimeExports.jsx(lt.EmptyState,{}),e[26]=l.length,e[27]=we):we=e[27];let qe;e[28]!==I||e[29]!==N||e[30]!==i||e[31]!==r||e[32]!==f||e[33]!==l||e[34]!==he||e[35]!==x||e[36]!==O||e[37]!==g||e[38]!==E||e[39]!==W||e[40]!==Y||e[41]!==V||e[42]!==X||e[43]!==k||e[44]!==me||e[45]!==U||e[46]!==M||e[47]!==H||e[48]!==h||e[49]!==a||e[50]!==A||e[51]!==v||e[52]!==se||e[53]!==s||e[54]!==ee||e[55]!==L||e[56]!==S||e[57]!==n?(qe=se&&v&&l.length>0?t.jsxRuntimeExports.jsx(at,{data:l,colorDomain:r,width:x||!n||se<n?se:n,height:v,colors:f||(typeof r[0]=="string"?p.Colors[s].categoricalColors.colors:r.length===2?[p.Colors[s].sequentialColors.neutralColorsx09[0],p.Colors[s].sequentialColors.neutralColorsx09[8]]:p.Colors[s].sequentialColors[`neutralColorsx0${r.length+1}`]),noDataColor:g,scaleType:me,showColumnLabels:M,leftMargin:O,rightMargin:k,topMargin:L,bottomMargin:N,selectedColor:U,truncateBy:S,showRowLabels:H,tooltip:ee,onSeriesMouseOver:W,showValues:h,suffix:A,prefix:V,onSeriesMouseClick:E,resetSelectionOnDoubleClick:X,detailsOnClick:he,styles:a,classNames:i,animate:I===!0?{duration:.5,once:!0,amount:.5}:I||{duration:0,once:!0,amount:0},precision:Y}):null,e[28]=I,e[29]=N,e[30]=i,e[31]=r,e[32]=f,e[33]=l,e[34]=he,e[35]=x,e[36]=O,e[37]=g,e[38]=E,e[39]=W,e[40]=Y,e[41]=V,e[42]=X,e[43]=k,e[44]=me,e[45]=U,e[46]=M,e[47]=H,e[48]=h,e[49]=a,e[50]=A,e[51]=v,e[52]=se,e[53]=s,e[54]=ee,e[55]=L,e[56]=S,e[57]=n,e[58]=qe):qe=e[58];let Re;e[59]!==we||e[60]!==qe?(Re=t.jsxRuntimeExports.jsxs(Xe.GraphArea,{ref:De,children:[we,qe]}),e[59]=we,e[60]=qe,e[61]=Re):Re=e[61];let Ee;e[62]!==i?.footnote||e[63]!==i?.source||e[64]!==_||e[65]!==J||e[66]!==a?.footnote||e[67]!==a?.source||e[68]!==n?(Ee=J||_?t.jsxRuntimeExports.jsx(st.GraphFooter,{styles:{footnote:a?.footnote,source:a?.source},classNames:{footnote:i?.footnote,source:i?.source},sources:J,footNote:_,width:n}):null,e[62]=i?.footnote,e[63]=i?.source,e[64]=_,e[65]=J,e[66]=a?.footnote,e[67]=a?.source,e[68]=n,e[69]=Ee):Ee=e[69];let Se;return e[70]!==ue||e[71]!==D||e[72]!==ne||e[73]!==Z||e[74]!==te||e[75]!==xe||e[76]!==B||e[77]!==c||e[78]!==Le||e[79]!==Ne||e[80]!==Ae||e[81]!==je||e[82]!==be||e[83]!==Re||e[84]!==Ee||e[85]!==s?(Se=t.jsxRuntimeExports.jsxs(Xe.GraphContainer,{className:Le,style:Ne,id:ne,ref:Ie,"aria-label":ue,backgroundColor:D,theme:s,language:te,minHeight:xe,width:Ae,height:Z,relativeHeight:c,padding:B,children:[je,be,Re,Ee]}),e[70]=ue,e[71]=D,e[72]=ne,e[73]=Z,e[74]=te,e[75]=xe,e[76]=B,e[77]=c,e[78]=Le,e[79]=Ne,e[80]=Ae,e[81]=je,e[82]=be,e[83]=Re,e[84]=Ee,e[85]=s,e[86]=Se):Se=e[86],Se}function dt(u){return`${u}`}function ht(u){return u!==void 0}function xt(u){return u!==void 0}function mt(u){return u.data}function gt(u){return u!==void 0}function pt(u){return u.data}exports.HeatMap=ut;
|
|
2
2
|
//# sourceMappingURL=HeatMap.cjs.map
|
package/dist/HeatMap.js
CHANGED
|
@@ -21,7 +21,7 @@ import { ColorLegendWithMouseOver as ae } from "./ColorLegendWithMouseOver.js";
|
|
|
21
21
|
import { LinearColorLegend as ne } from "./LinearColorLegend.js";
|
|
22
22
|
import { ThresholdColorLegendWithMouseOver as ce } from "./ThresholdColorLegendWithMouseOver.js";
|
|
23
23
|
import { Colors as f } from "./Colors.js";
|
|
24
|
-
import { E as ue } from "./EmptyState-
|
|
24
|
+
import { E as ue } from "./EmptyState-Pj-emXt5.js";
|
|
25
25
|
import { a as me, G as he } from "./GraphContainer-CF6ws3pd.js";
|
|
26
26
|
function de(u) {
|
|
27
27
|
const t = Ft.c(86), {
|
package/dist/Histogram.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./index-CHPV5EwG-6v2a2njQ.cjs"),le=require("./Spinner-jTMOLuw_.cjs"),J=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./index-CHPV5EwG-6v2a2njQ.cjs"),le=require("./Spinner-jTMOLuw_.cjs"),J=require("./index-DlrGwLQA.cjs"),ae=require("./TreeMapGraph.cjs"),ce=require("./DonutChart.cjs"),ue=require("./BarGraph.cjs"),W=require("./Colors.cjs"),he=require("./init-DU0ybBc_.cjs"),K=require("./linear-CgUCbw9F.cjs");function fe(n,e){let C=0;for(let l of n)l!=null&&(l=+l)>=l&&++C;return C}function pe(n){return n}var ge=Array.prototype,me=ge.slice;function ne(n){return()=>n}function xe(n,e,C){let l;for(;;){const t=K.tickIncrement(n,e,C);if(t===l||t===0||!isFinite(t))return[n,e];t>0?(n=Math.floor(n/t)*t,e=Math.ceil(e/t)*t):t<0&&(n=Math.ceil(n*t)/t,e=Math.floor(e*t)/t),l=t}}function de(n){return Math.max(1,Math.ceil(Math.log(fe(n))/Math.LN2)+1)}function Me(){var n=pe,e=J.extent,C=de;function l(t){Array.isArray(t)||(t=Array.from(t));var r,B=t.length,a,L,p=new Array(B);for(r=0;r<B;++r)p[r]=n(t[r],r,t);var b=e(p),o=b[0],i=b[1],s=C(p,o,i);if(!Array.isArray(s)){const d=i,M=+s;if(e===J.extent&&([o,i]=xe(o,i,M)),s=K.ticks(o,i,M),s[0]<=o&&(L=K.tickIncrement(o,i,M)),s[s.length-1]>=i)if(d>=i&&e===J.extent){const c=K.tickIncrement(o,i,M);isFinite(c)&&(c>0?i=(Math.floor(i/c)+1)*c:c<0&&(i=(Math.ceil(i*-c)+1)/-c))}else s.pop()}for(var x=s.length,u=0,h=x;s[u]<=o;)++u;for(;s[h-1]>i;)--h;(u||h<x)&&(s=s.slice(u,h),x=h-u);var m=new Array(x+1),y;for(r=0;r<=x;++r)y=m[r]=[],y.x0=r>0?s[r-1]:o,y.x1=r<x?s[r]:i;if(isFinite(L)){if(L>0)for(r=0;r<B;++r)(a=p[r])!=null&&o<=a&&a<=i&&m[Math.min(x,Math.floor((a-o)/L))].push(t[r]);else if(L<0){for(r=0;r<B;++r)if((a=p[r])!=null&&o<=a&&a<=i){const d=Math.floor((o-a)*L);m[Math.min(x,d+(s[d]<=a))].push(t[r])}}}else for(r=0;r<B;++r)(a=p[r])!=null&&o<=a&&a<=i&&m[he.bisectRight(s,a,0,x)].push(t[r]);return m}return l.value=function(t){return arguments.length?(n=typeof t=="function"?t:ne(t),l):n},l.domain=function(t){return arguments.length?(e=typeof t=="function"?t:ne([t[0],t[1]]),l):e},l.thresholds=function(t){return arguments.length?(C=typeof t=="function"?t:ne(Array.isArray(t)?me.call(t):t),l):C},l}function ye(n){const e=I.compilerRuntimeExports.c(139),{data:C,graphTitle:l,sources:t,graphDescription:r,barPadding:B,showValues:a,showTicks:L,leftMargin:p,rightMargin:b,height:o,width:i,footNote:s,colors:x,padding:u,backgroundColor:h,topMargin:m,bottomMargin:y,showLabels:d,relativeHeight:M,tooltip:c,onSeriesMouseOver:w,refValues:Q,graphID:j,maxValue:U,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,numberOfBins:X,truncateBy:Y,graphType:Z,barGraphLayout:_,donutStrokeWidth:ee,sortData:N,language:q,minHeight:H,theme:oe,maxBarThickness:te,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T,hideAxisLine:se}=n,v=oe===void 0?"light":oe,re=se===void 0?!1:se;let O;e[0]!==C||e[1]!==X?(O=Me().thresholds(X||10).value(Ce)(C).map(ve),e[0]=C,e[1]=X,e[2]=O):O=e[2];const $=O;if($.length===0){const g=`${i}px`,f=`${o}px`;let P;e[3]!==g||e[4]!==f?(P={width:g,height:f,margin:"auto"},e[3]=g,e[4]=f,e[5]=P):P=e[5];let F;e[6]===Symbol.for("react.memo_cache_sentinel")?(F=I.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:I.jsxRuntimeExports.jsx(le.w,{})}),e[6]=F):F=e[6];let z;return e[7]!==P?(z=I.jsxRuntimeExports.jsx("div",{style:P,children:F}),e[7]=P,e[8]=z):z=e[8],z}if(Z==="circlePacking"){const g=x||W.Colors.graphMainColor;let f;return e[9]!==E||e[10]!==h||e[11]!==y||e[12]!==D||e[13]!==A||e[14]!==$||e[15]!==R||e[16]!==s||e[17]!==r||e[18]!==S||e[19]!==j||e[20]!==l||e[21]!==o||e[22]!==q||e[23]!==p||e[24]!==H||e[25]!==k||e[26]!==w||e[27]!==u||e[28]!==T||e[29]!==M||e[30]!==b||e[31]!==d||e[32]!==a||e[33]!==t||e[34]!==G||e[35]!==g||e[36]!==v||e[37]!==c||e[38]!==m||e[39]!==i?(f=I.jsxRuntimeExports.jsx(J.CirclePackingGraph,{colors:g,graphTitle:l,graphDescription:r,footNote:s,width:i,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:$,language:q,minHeight:H,theme:v,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T}),e[9]=E,e[10]=h,e[11]=y,e[12]=D,e[13]=A,e[14]=$,e[15]=R,e[16]=s,e[17]=r,e[18]=S,e[19]=j,e[20]=l,e[21]=o,e[22]=q,e[23]=p,e[24]=H,e[25]=k,e[26]=w,e[27]=u,e[28]=T,e[29]=M,e[30]=b,e[31]=d,e[32]=a,e[33]=t,e[34]=G,e[35]=g,e[36]=v,e[37]=c,e[38]=m,e[39]=i,e[40]=f):f=e[40],f}if(Z==="treeMap"){const g=x||W.Colors.graphMainColor;let f;return e[41]!==E||e[42]!==h||e[43]!==y||e[44]!==D||e[45]!==A||e[46]!==$||e[47]!==R||e[48]!==s||e[49]!==r||e[50]!==S||e[51]!==j||e[52]!==l||e[53]!==o||e[54]!==q||e[55]!==p||e[56]!==H||e[57]!==k||e[58]!==w||e[59]!==u||e[60]!==T||e[61]!==M||e[62]!==b||e[63]!==d||e[64]!==a||e[65]!==t||e[66]!==G||e[67]!==g||e[68]!==v||e[69]!==c||e[70]!==m||e[71]!==i?(f=I.jsxRuntimeExports.jsx(ae.TreeMapGraph,{colors:g,graphTitle:l,graphDescription:r,footNote:s,width:i,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:$,language:q,minHeight:H,theme:v,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T}),e[41]=E,e[42]=h,e[43]=y,e[44]=D,e[45]=A,e[46]=$,e[47]=R,e[48]=s,e[49]=r,e[50]=S,e[51]=j,e[52]=l,e[53]=o,e[54]=q,e[55]=p,e[56]=H,e[57]=k,e[58]=w,e[59]=u,e[60]=T,e[61]=M,e[62]=b,e[63]=d,e[64]=a,e[65]=t,e[66]=G,e[67]=g,e[68]=v,e[69]=c,e[70]=m,e[71]=i,e[72]=f):f=e[72],f}if(Z==="donutChart"){const g=x||W.Colors[v].categoricalColors.colors,f=i&&o?i<o?i:o:i||o||void 0,P=$;let F;return e[73]!==E||e[74]!==h||e[75]!==D||e[76]!==A||e[77]!==R||e[78]!==ee||e[79]!==s||e[80]!==r||e[81]!==S||e[82]!==j||e[83]!==l||e[84]!==q||e[85]!==k||e[86]!==w||e[87]!==u||e[88]!==T||e[89]!==N||e[90]!==t||e[91]!==G||e[92]!==g||e[93]!==f||e[94]!==P||e[95]!==v||e[96]!==c?(F=I.jsxRuntimeExports.jsx(ce.DonutChart,{colors:g,graphTitle:l,graphDescription:r,footNote:s,radius:f,sources:t,backgroundColor:h,padding:u,tooltip:c,onSeriesMouseOver:w,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:P,strokeWidth:ee,showColorScale:!0,sortData:N,language:q,theme:v,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T}),e[73]=E,e[74]=h,e[75]=D,e[76]=A,e[77]=R,e[78]=ee,e[79]=s,e[80]=r,e[81]=S,e[82]=j,e[83]=l,e[84]=q,e[85]=k,e[86]=w,e[87]=u,e[88]=T,e[89]=N,e[90]=t,e[91]=G,e[92]=g,e[93]=f,e[94]=P,e[95]=v,e[96]=c,e[97]=F):F=e[97],F}const ie=x||W.Colors.graphMainColor;let V;return e[98]!==E||e[99]!==h||e[100]!==_||e[101]!==B||e[102]!==y||e[103]!==D||e[104]!==A||e[105]!==$||e[106]!==R||e[107]!==s||e[108]!==r||e[109]!==S||e[110]!==j||e[111]!==l||e[112]!==o||e[113]!==re||e[114]!==q||e[115]!==p||e[116]!==te||e[117]!==U||e[118]!==H||e[119]!==k||e[120]!==w||e[121]!==u||e[122]!==T||e[123]!==Q||e[124]!==M||e[125]!==b||e[126]!==d||e[127]!==L||e[128]!==a||e[129]!==N||e[130]!==t||e[131]!==G||e[132]!==ie||e[133]!==v||e[134]!==c||e[135]!==m||e[136]!==Y||e[137]!==i?(V=I.jsxRuntimeExports.jsx(ue.SimpleBarGraph,{colors:ie,graphTitle:l,graphDescription:r,footNote:s,width:i,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:$,barPadding:B,refValues:Q,truncateBy:Y,maxValue:U,showTicks:L,sortData:N,language:q,minHeight:H,theme:v,maxBarThickness:te,ariaLabel:E,orientation:_,detailsOnClick:R,styles:G,classNames:D,precision:T,hideAxisLine:re}),e[98]=E,e[99]=h,e[100]=_,e[101]=B,e[102]=y,e[103]=D,e[104]=A,e[105]=$,e[106]=R,e[107]=s,e[108]=r,e[109]=S,e[110]=j,e[111]=l,e[112]=o,e[113]=re,e[114]=q,e[115]=p,e[116]=te,e[117]=U,e[118]=H,e[119]=k,e[120]=w,e[121]=u,e[122]=T,e[123]=Q,e[124]=M,e[125]=b,e[126]=d,e[127]=L,e[128]=a,e[129]=N,e[130]=t,e[131]=G,e[132]=ie,e[133]=v,e[134]=c,e[135]=m,e[136]=Y,e[137]=i,e[138]=V):V=e[138],V}function ve(n){return{label:`${n.x0}-${n.x1}`,size:n.length,data:{options:`${n.x0}-${n.x1}`,frequency:n.length}}}function Ce(n){return n.value}exports.Histogram=ye;
|
|
2
2
|
//# sourceMappingURL=Histogram.cjs.map
|
package/dist/Histogram.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as le, j as R } from "./index-CHPV5EwG-DecW7_qr.js";
|
|
2
2
|
import { w as se } from "./Spinner--r2RrJV8.js";
|
|
3
|
-
import { e as re, C as ce } from "./index-
|
|
3
|
+
import { e as re, C as ce } from "./index-BE-lvE4c.js";
|
|
4
4
|
import { TreeMapGraph as fe } from "./TreeMapGraph.js";
|
|
5
5
|
import { DonutChart as he } from "./DonutChart.js";
|
|
6
6
|
import { SimpleBarGraph as ue } from "./BarGraph.js";
|
package/dist/HybridMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-6v2a2njQ.cjs"),d=require("react"),qt=require("./parse-xYI9yrvL.cjs"),It=require("./getSliderMarks-CIuSoedo.cjs"),Ut=require("./Spinner-jTMOLuw_.cjs"),Pt=require("./index-DQA8q5sC.cjs"),U=require("./index-DLFt97gy.cjs"),St=require("./Typography-sa1UE0oF.cjs"),Gt=require("./index-C5K--w8d.cjs"),zt=require("./Source-B5AoSlsi.cjs"),Ht=require("./index-Dzc_aaI9-C3DbPpy3.cjs"),Xt=require("./Tooltip-BLa2EfMs.cjs"),Ot=require("./index-C6er0ety.cjs"),Yt=require("./DetailsModal-DHttOA80.cjs"),Jt=require("./pow-BnyPO-NX.cjs"),Kt=require("./ordinal-CrsysVE-.cjs"),Zt=require("./threshold-DNsSUf8Q.cjs"),Nt=require("./select-Bnfk0lJx.cjs"),le=require("./proxy-C4-uo6nS.cjs"),dt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Qt=require("./numberFormattingFunction-02t-wJta.cjs"),eo=require("./use-in-view-C3o_ntMv.cjs"),to=require("./index-CoobIWNj.cjs"),oo=require("./GraphFooter.cjs"),ro=require("./GraphHeader.cjs"),we=require("./Colors.cjs"),io=require("./fetchAndParseData-QTF6tjij.cjs"),Lt=require("./GraphContainer-B1EDxJ0S.cjs"),ao=require("./getUniqValue-NX8DgwND.cjs"),no=require("./getJenks-BzJvhy_H.cjs");function so(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const g=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,g.get?g:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const lo=so(d);var co="Separator",Vt="horizontal",uo=["horizontal","vertical"],_t=lo.forwardRef((i,e)=>{const{decorative:t,orientation:g=Vt,...f}=i,n=mo(g)?g:Vt,y=t?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return r.ae.jsx(Ht.w.div,{"data-orientation":n,...y,...f,ref:e})});_t.displayName=co;function mo(i){return uo.includes(i)}var $t=_t;const Bt=d.forwardRef((i,e)=>{const t=r._.c(14);let g,f,n,y;t[0]!==i?({className:g,variant:n,orientation:y,...f}=i,t[0]=i,t[1]=g,t[2]=f,t[3]=n,t[4]=y):(g=t[1],f=t[2],n=t[3],y=t[4]);const v=n===void 0?"dark":n,s=y===void 0?"horizontal":y,x=s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",k=v==="dark"?"bg-primary-gray-600 dark:bg-primary-gray-200":"bg-primary-gray-400 dark:bg-primary-gray-550";let E;t[5]!==g||t[6]!==x||t[7]!==k?(E=r.mo(x,k,g),t[5]=g,t[6]=x,t[7]=k,t[8]=E):E=t[8];let S;return t[9]!==s||t[10]!==f||t[11]!==e||t[12]!==E?(S=r.ae.jsx($t,{...f,ref:e,orientation:s,className:E}),t[9]=s,t[10]=f,t[11]=e,t[12]=E,t[13]=S):S=t[13],S});Bt.displayName=$t.displayName;function po(i){const{data:e,colors:t,mapData:g,mapColorLegendTitle:f,colorDomain:n,radius:y,height:v,width:s,scale:x,centerPoint:k,tooltip:E,showLabels:S,mapBorderWidth:ke,mapBorderColor:Re,mapNoDataColor:Ce,onSeriesMouseOver:G,showColorScale:De,zoomScaleExtend:We,zoomTranslateExtend:Ue,highlightedDataPoints:Se,onSeriesMouseClick:I,resetSelectionOnDoubleClick:Ne,detailsOnClick:H,styles:R,classNames:X,mapProjection:ee,zoomInteraction:Y,animate:j,dimmedOpacity:P,customLayers:ce,maxRadiusValue:de,categorical:te,dotColor:J,collapseColorScaleByDefault:Oe,highlightedIds:oe,mapProperty:ue,dotLegendTitle:me,dotBorderColor:Me,labelColor:qe,projectionRotate:K,rewindCoordinatesInMapData:pe}=i,u=d.useMemo(()=>pe?U.index_default(g,{reverse:!0}):g,[g,pe]),[l,z]=d.useState(void 0),[Ge,Ie]=d.useState(Oe===void 0?!(s<680):!Oe),xe=d.useRef(null),[L,N]=d.useState(void 0),[re,O]=d.useState(void 0),[Pe,C]=d.useState(void 0),[ze,M]=d.useState(void 0),V=d.useRef(null),Z=eo.useInView(V,{once:j.once,amount:j.amount}),ie=d.useRef(null),_=e.filter(o=>o.radius===void 0||o.radius===null).length!==e.length?Jt.sqrt().domain([0,de]).range([.25,y]).nice():void 0,q=te?Kt.ordinal().domain(n).range(t):Zt.threshold().domain(n).range(t);d.useEffect(()=>{const o=Nt.select(ie.current),a=Nt.select(V.current),b=m=>{if(Y==="noZoom")return!1;if(Y==="button")return!m.type.includes("wheel");const ge=m.type==="wheel",fe=m.type.startsWith("touch"),Be=m.type==="mousedown"||m.type==="mousemove";return fe?!0:ge?Y==="scroll"?!0:m.ctrlKey:Be&&!m.button&&!m.ctrlKey},D=U.zoom().scaleExtent(We).translateExtent(Ue||[[-20,-20],[s+20,v+20]]).filter(b).on("zoom",({transform:m})=>{o.attr("transform",m)});a.call(D),xe.current=D},[v,s,Y]);const $=U.index_default$1(u),w=Gt.index_default(u),Le=$[2]-$[0],Ve=$[3]-$[1],_e=s*190/960*360/Le,$e=v*190/678*180/Ve,B=x*Math.min(_e,$e),Q=ee==="mercator"?U.geoMercator().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="equalEarth"?U.geoEqualEarth().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="naturalEarth"?U.geoNaturalEarth1().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="orthographic"?U.geoOrthographic().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):U.geoAlbersUsa().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B),he=U.geoPath().projection(Q),ae=o=>{if(!V.current||!xe.current)return;Nt.select(V.current).call(xe.current.scaleBy,o==="in"?1.2:1/1.2)};return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r.jsxRuntimeExports.jsx(le.motion.svg,{width:`${s}px`,height:`${v}px`,viewBox:`0 0 ${s} ${v}`,ref:V,direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{ref:ie,children:[ce.filter(o=>o.position==="before").map(o=>o.layer),u.features.map((o,a)=>{if(!o.properties?.[ue])return null;const b=he(o);return b?r.jsxRuntimeExports.jsx(le.motion.g,{opacity:l?P:oe.length!==0?oe.indexOf(o.properties[ue])!==-1?1:P:1,children:r.jsxRuntimeExports.jsx("path",{d:b,style:{stroke:Re,strokeWidth:ke,fill:Ce}})},a):null}),r.jsxRuntimeExports.jsxs(to.AnimatePresence,{children:[e.filter(o=>o.id).map(o=>{const a=u.features.findIndex(m=>o.id===m.properties[ue]);if(a===-1)return null;const b=he(u.features[a]);if(!b)return null;const D=dt.checkIfNullOrUndefined(o.x)?Ce:q(o.x);return r.jsxRuntimeExports.jsx(le.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:l?l===D?1:P:oe.length!==0?oe.indexOf(o.id)!==-1?1:P:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:m=>{O(o),M(m.clientY),C(m.clientX),G?.(o)},onMouseMove:m=>{O(o),M(m.clientY),C(m.clientX)},onMouseLeave:()=>{O(void 0),C(void 0),M(void 0),G?.(void 0)},onClick:()=>{(I||H)&&(Pt.isEqual(L,o)&&Ne?(N(void 0),I?.(void 0)):(N(o),I?.(o)))},children:r.jsxRuntimeExports.jsx(le.motion.path,{d:b,variants:{initial:{fill:D,opacity:0},whileInView:{fill:D,opacity:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},style:{stroke:Re,strokeWidth:ke}},`${o.id}`)},o.id)}),e.filter(o=>!dt.checkIfNullOrUndefined(o.lat)&&!dt.checkIfNullOrUndefined(o.long)).map(o=>{const a=Q([o.long,o.lat])[0]>.6*s?-1:1;return r.jsxRuntimeExports.jsxs(le.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:Se.length!==0?Se.indexOf(o.label||"")!==-1?1:P:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:b=>{O(o),M(b.clientY),C(b.clientX),G?.(o)},onMouseMove:b=>{O(o),M(b.clientY),C(b.clientX)},onMouseLeave:()=>{O(void 0),C(void 0),M(void 0),G?.(void 0)},onClick:()=>{(I||H)&&(Pt.isEqual(L,o)&&Ne?(N(void 0),I?.(void 0)):(N(o),I?.(o)))},transform:`translate(${Q([o.long,o.lat])[0]},${Q([o.long,o.lat])[1]})`,children:[r.jsxRuntimeExports.jsx(le.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:J,stroke:Me||J},whileInView:{r:_?_(o.radius||0):y,fill:J,stroke:Me||J,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{r:0,transition:{duration:j.duration}},style:{fillOpacity:.8}}),S&&o.label?r.jsxRuntimeExports.jsx(le.motion.text,{variants:{initial:{opacity:0,x:a*(_?_(o.radius||0):y)},whileInView:{opacity:1,x:a*(_?_(o.radius||0):y),transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},y:0,className:r.mo("text-sm",X?.graphObjectValues),style:{textAnchor:a===-1?"end":"start",fill:qe||"#000",...R?.graphObjectValues||{}},dx:a*4,dy:5,children:o.label}):null]},o.label||`${o.lat}-${o.long}`)})]}),ce.filter(o=>o.position==="after").map(o=>o.layer)]})}),De===!1?null:r.jsxRuntimeExports.jsx("div",{className:r.mo("absolute left-4 bottom-4 map-color-legend",X?.colorLegend),children:Ge?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{Ie(!1)},children:r.jsxRuntimeExports.jsx(Ot.X,{})}),r.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:te?void 0:"340px"},children:[me&&me!==""?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:J}}),r.jsxRuntimeExports.jsx(St.j,{size:"xs",marginBottom:"none",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:me})]}),r.jsxRuntimeExports.jsx(zt.n,{size:"xl"}),r.jsxRuntimeExports.jsx(Bt,{}),r.jsxRuntimeExports.jsx(zt.n,{size:"xl"})]}):null,f&&f!==""?r.jsxRuntimeExports.jsx(St.j,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:f}):null,te?r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:n.map((o,a)=>r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{z(t[a%t.length])},onMouseLeave:()=>{z(void 0)},children:[r.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t[a%t.length]}}),r.jsxRuntimeExports.jsx(St.j,{size:"sm",marginBottom:"none",leading:"none",children:o})]},a))}):r.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{children:[n.map((o,a)=>r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{z(t[a])},onMouseLeave:()=>{z(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:a*320/t.length+1,y:1,width:320/t.length-2,height:8,className:l===t[a]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:t[a],...l===t[a]?{}:{stroke:t[a]}}}),r.jsxRuntimeExports.jsx("text",{x:(a+1)*320/t.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Qt.numberFormattingFunction(o,"NA")})]},a)),r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{z(t[n.length])},onMouseLeave:()=>{z(void 0)},x:n.length*320/t.length+1,y:1,width:320/t.length-2,height:8,className:`cursor-pointer ${l===t[n.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:t[n.length],...l===t[n.length]?{}:{stroke:t[n.length]}}})})]})})]})]}):r.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{Ie(!0)},children:r.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),Y==="button"&&r.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[r.jsxRuntimeExports.jsx("button",{onClick:()=>ae("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),r.jsxRuntimeExports.jsx("button",{onClick:()=>ae("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),H&&L!==void 0?r.jsxRuntimeExports.jsx(Yt.DetailsModal,{body:H,data:L,setData:N,className:X?.modal}):null,re&&E&&Pe&&ze?r.jsxRuntimeExports.jsx(Xt.Tooltip,{data:re,body:E,xPos:Pe,yPos:ze,backgroundStyle:R?.tooltip,className:X?.tooltip}):null]})}function xo(i){const e=r.compilerRuntimeExports.c(135),{data:t,mapData:g,graphTitle:f,colors:n,sources:y,graphDescription:v,height:s,width:x,footNote:k,mapColorLegendTitle:E,colorDomain:S,choroplethScaleType:ke,radius:Re,scale:Ce,centerPoint:G,padding:De,mapBorderWidth:We,mapNoDataColor:Ue,backgroundColor:Se,showLabels:I,mapBorderColor:Ne,tooltip:H,relativeHeight:R,onSeriesMouseOver:X,isWorldMap:ee,showColorScale:Y,zoomScaleExtend:j,zoomTranslateExtend:P,graphID:ce,highlightedDataPoints:de,onSeriesMouseClick:te,graphDownload:J,dataDownload:Oe,showAntarctica:oe,language:ue,minHeight:me,theme:Me,ariaLabel:qe,resetSelectionOnDoubleClick:K,detailsOnClick:pe,styles:u,classNames:l,mapProjection:z,zoomInteraction:Ge,animate:Ie,dimmedOpacity:xe,customLayers:L,maxRadiusValue:N,timeline:re,collapseColorScaleByDefault:O,dotColor:Pe,highlightedIds:C,mapProperty:ze,dotLegendTitle:M,dotBorderColor:V,labelColor:Z,projectionRotate:ie,rewindCoordinatesInMapData:_}=i,q=g===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":g,$=k===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":k,w=ke===void 0?"threshold":ke,Le=Re===void 0?5:Re,Ve=Ce===void 0?.95:Ce,_e=We===void 0?.5:We,$e=Ue===void 0?we.Colors.light.graphNoData:Ue,B=Se===void 0?!1:Se,Q=I===void 0?!1:I,he=Ne===void 0?we.Colors.light.grays["gray-500"]:Ne,ae=ee===void 0?!0:ee,o=Y===void 0?!0:Y;let a;e[0]!==j?(a=j===void 0?[.8,6]:j,e[0]=j,e[1]=a):a=e[1];const b=a;let D;e[2]!==de?(D=de===void 0?[]:de,e[2]=de,e[3]=D):D=e[3];const m=D,ge=J===void 0?!1:J,fe=Oe===void 0?!1:Oe,Be=oe===void 0?!1:oe,ut=ue===void 0?"en":ue,F=me===void 0?0:me,ne=Me===void 0?"light":Me,mt=K===void 0?!0:K,pt=z===void 0?"naturalEarth":z,xt=Ge===void 0?"button":Ge,He=Ie===void 0?!1:Ie,ht=xe===void 0?.3:xe;let Xe;e[4]!==L?(Xe=L===void 0?[]:L,e[4]=L,e[5]=Xe):Xe=e[5];const gt=Xe;let Ye;e[6]!==re?(Ye=re===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:re,e[6]=re,e[7]=Ye):Ye=e[7];const c=Ye,ft=Pe===void 0?we.Colors.primaryColors["blue-600"]:Pe;let Je;e[8]!==C?(Je=C===void 0?[]:C,e[8]=C,e[9]=Je):Je=e[9];const yt=Je,vt=ze===void 0?"ISO3":ze,jt=Z===void 0?we.Colors.primaryColors["blue-600"]:Z;let Ke;e[10]!==ie?(Ke=ie===void 0?[0,0]:ie,e[10]=ie,e[11]=Ke):Ke=e[11];const bt=Ke,Et=_===void 0?!0:_,[se,Ft]=d.useState(0),[Fe,Tt]=d.useState(0),[T,At]=d.useState(c.autoplay);let Te;if(e[12]!==t||e[13]!==c.dateFormat){let h;e[15]!==c.dateFormat?(h=W=>qt.parse(`${W.date}`,c.dateFormat||"yyyy",new Date).getTime(),e[15]=c.dateFormat,e[16]=h):h=e[16],Te=[...new Set(t.filter(Ro).map(h))],Te.sort(ko),e[12]=t,e[13]=c.dateFormat,e[14]=Te}else Te=e[14];const p=Te,[A,wt]=d.useState(c.autoplay?0:p.length-1),[ye,Wt]=d.useState(void 0),kt=d.useRef(null),Mt=d.useRef(null);let Ze;e[17]!==w||e[18]!==S||e[19]!==n?.length||e[20]!==t?(Ze=S||(w==="categorical"?ao.getUniqValue(t,"x"):no.getJenks(t.map(wo),n?.length||4)),e[17]=w,e[18]=S,e[19]=n?.length,e[20]=t,e[21]=Ze):Ze=e[21];const Ae=Ze;let Qe,et;e[22]===Symbol.for("react.memo_cache_sentinel")?(Qe=()=>{const h=new ResizeObserver(W=>{Ft(W[0].target.clientWidth||620),Tt(W[0].target.clientHeight||480)});return kt.current&&h.observe(kt.current),()=>h.disconnect()},et=[],e[22]=Qe,e[23]=et):(Qe=e[22],et=e[23]),d.useEffect(Qe,et);let tt;e[24]===Symbol.for("react.memo_cache_sentinel")?(tt=h=>{Wt(h)},e[24]=tt):tt=e[24];const ot=d.useEffectEvent(tt);let rt;e[25]!==q||e[26]!==ot?(rt=()=>{typeof q=="string"?io.fetchAndParseJSON(q).then(W=>{ot(W)}):ot(q)},e[25]=q,e[26]=ot,e[27]=rt):rt=e[27];let it;e[28]!==q?(it=[q],e[28]=q,e[29]=it):it=e[29],d.useEffect(rt,it);let at,nt;e[30]!==T||e[31]!==c.speed||e[32]!==p?(at=()=>{const h=setInterval(()=>{wt(W=>W<p.length-1?W+1:0)},(c.speed||2)*1e3);return T||clearInterval(h),()=>clearInterval(h)},nt=[p,T,c.speed],e[30]=T,e[31]=c.speed,e[32]=p,e[33]=at,e[34]=nt):(at=e[33],nt=e[34]),d.useEffect(at,nt);const Rt=c.dateFormat||"yyyy";let st;e[35]!==A||e[36]!==Rt||e[37]!==c.showOnlyActiveDate||e[38]!==p?(st=It.getSliderMarks(p,A,c.showOnlyActiveDate,Rt),e[35]=A,e[36]=Rt,e[37]=c.showOnlyActiveDate,e[38]=p,e[39]=st):st=e[39];const lt=st,Ct=l?.graphContainer,Dt=u?.graphContainer;let ve;e[40]!==l?.description||e[41]!==l?.title||e[42]!==t||e[43]!==fe||e[44]!==v||e[45]!==ge||e[46]!==f||e[47]!==u?.description||e[48]!==u?.title||e[49]!==x?(ve=f||v||ge||fe?r.jsxRuntimeExports.jsx(ro.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:l?.title,description:l?.description},graphTitle:f,graphDescription:v,width:x,graphDownload:ge?Mt:void 0,dataDownload:fe?t.map(Eo).filter(bo).length>0?t.map(jo).filter(vo):t.filter(yo):null}):null,e[40]=l?.description,e[41]=l?.title,e[42]=t,e[43]=fe,e[44]=v,e[45]=ge,e[46]=f,e[47]=u?.description,e[48]=u?.title,e[49]=x,e[50]=ve):ve=e[50];let je;e[51]!==A||e[52]!==lt||e[53]!==T||e[54]!==c.enabled||e[55]!==p?(je=c.enabled&&p.length>0&<?r.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[r.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{At(!T)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":T?"Click to pause animation":"Click to play animation",children:T?r.jsxRuntimeExports.jsx(Ot.Pause,{}):r.jsxRuntimeExports.jsx(Ot.Play,{})}),r.jsxRuntimeExports.jsx(It.Nr,{min:p[0],max:p[p.length-1],marks:lt,step:null,defaultValue:p[p.length-1],value:p[A],onChangeComplete:h=>{wt(p.indexOf(h))},onChange:h=>{wt(p.indexOf(h))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[51]=A,e[52]=lt,e[53]=T,e[54]=c.enabled,e[55]=p,e[56]=je):je=e[56];let be;e[57]!==He||e[58]!==G||e[59]!==w||e[60]!==l||e[61]!==O||e[62]!==n||e[63]!==gt||e[64]!==t||e[65]!==pe||e[66]!==ht||e[67]!==Ae||e[68]!==V||e[69]!==ft||e[70]!==M||e[71]!==s||e[72]!==m||e[73]!==yt||e[74]!==A||e[75]!==ae||e[76]!==jt||e[77]!==he||e[78]!==_e||e[79]!==E||e[80]!==$e||e[81]!==pt||e[82]!==vt||e[83]!==ye||e[84]!==N||e[85]!==F||e[86]!==te||e[87]!==X||e[88]!==bt||e[89]!==Le||e[90]!==R||e[91]!==mt||e[92]!==Et||e[93]!==Ve||e[94]!==Be||e[95]!==o||e[96]!==Q||e[97]!==u||e[98]!==Fe||e[99]!==se||e[100]!==ne||e[101]!==c.dateFormat||e[102]!==c.enabled||e[103]!==H||e[104]!==p||e[105]!==x||e[106]!==xt||e[107]!==b||e[108]!==P?(be=r.jsxRuntimeExports.jsx(Lt.GraphArea,{ref:kt,children:se&&Fe&&ye?r.jsxRuntimeExports.jsx(po,{dotColor:ft,data:t.filter(h=>c.enabled?h.date===qt.format(new Date(p[A]),c.dateFormat||"yyyy"):h),mapData:Be?ye:{...ye,features:ye.features.filter(fo)},colorDomain:Ae,width:se,height:Fe,scale:Ve,centerPoint:G,colors:n||(w==="categorical"?we.Colors[ne].sequentialColors[`neutralColorsx0${Ae.length}`]:we.Colors[ne].sequentialColors[`neutralColorsx0${Ae.length+1}`]),mapColorLegendTitle:E,radius:Le,categorical:w==="categorical",mapBorderWidth:_e,mapNoDataColor:$e,mapBorderColor:he,tooltip:H,onSeriesMouseOver:X,showLabels:Q,isWorldMap:ae,showColorScale:o,zoomScaleExtend:b,zoomTranslateExtend:P,onSeriesMouseClick:te,highlightedDataPoints:m,resetSelectionOnDoubleClick:mt,styles:u,classNames:l,zoomInteraction:xt,detailsOnClick:pe,mapProjection:pt||(ae?"naturalEarth":"mercator"),animate:He===!0?{duration:.5,once:!0,amount:.5}:He||{duration:0,once:!0,amount:0},dimmedOpacity:ht,customLayers:gt,maxRadiusValue:dt.checkIfNullOrUndefined(N)?Math.max(...t.map(go).filter(ho)):N,collapseColorScaleByDefault:O,highlightedIds:yt,mapProperty:vt,dotLegendTitle:M,dotBorderColor:V,labelColor:jt,projectionRotate:bt,rewindCoordinatesInMapData:Et}):r.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(F,s||(R?F?(x||se)*R>F?(x||se)*R:F:(x||se)*R:Fe))}px`},className:"flex items-center justify-center",children:r.jsxRuntimeExports.jsx(Ut.w,{"aria-label":"Loading graph"})})}),e[57]=He,e[58]=G,e[59]=w,e[60]=l,e[61]=O,e[62]=n,e[63]=gt,e[64]=t,e[65]=pe,e[66]=ht,e[67]=Ae,e[68]=V,e[69]=ft,e[70]=M,e[71]=s,e[72]=m,e[73]=yt,e[74]=A,e[75]=ae,e[76]=jt,e[77]=he,e[78]=_e,e[79]=E,e[80]=$e,e[81]=pt,e[82]=vt,e[83]=ye,e[84]=N,e[85]=F,e[86]=te,e[87]=X,e[88]=bt,e[89]=Le,e[90]=R,e[91]=mt,e[92]=Et,e[93]=Ve,e[94]=Be,e[95]=o,e[96]=Q,e[97]=u,e[98]=Fe,e[99]=se,e[100]=ne,e[101]=c.dateFormat,e[102]=c.enabled,e[103]=H,e[104]=p,e[105]=x,e[106]=xt,e[107]=b,e[108]=P,e[109]=be):be=e[109];let Ee;e[110]!==l?.footnote||e[111]!==l?.source||e[112]!==$||e[113]!==y||e[114]!==u?.footnote||e[115]!==u?.source||e[116]!==x?(Ee=y||$?r.jsxRuntimeExports.jsx(oo.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:l?.footnote,source:l?.source},sources:y,footNote:$,width:x}):null,e[110]=l?.footnote,e[111]=l?.source,e[112]=$,e[113]=y,e[114]=u?.footnote,e[115]=u?.source,e[116]=x,e[117]=Ee):Ee=e[117];let ct;return e[118]!==qe||e[119]!==B||e[120]!==ce||e[121]!==s||e[122]!==ut||e[123]!==F||e[124]!==De||e[125]!==R||e[126]!==Ct||e[127]!==Dt||e[128]!==ve||e[129]!==je||e[130]!==be||e[131]!==Ee||e[132]!==ne||e[133]!==x?(ct=r.jsxRuntimeExports.jsxs(Lt.GraphContainer,{className:Ct,style:Dt,id:ce,ref:Mt,"aria-label":qe,backgroundColor:B,theme:ne,language:ut,minHeight:F,width:x,height:s,relativeHeight:R,padding:De,children:[ve,je,be,Ee]}),e[118]=qe,e[119]=B,e[120]=ce,e[121]=s,e[122]=ut,e[123]=F,e[124]=De,e[125]=R,e[126]=Ct,e[127]=Dt,e[128]=ve,e[129]=je,e[130]=be,e[131]=Ee,e[132]=ne,e[133]=x,e[134]=ct):ct=e[134],ct}function ho(i){return i!=null}function go(i){return i.radius}function fo(i){return i.properties.NAME!=="Antarctica"}function yo(i){return i!==void 0}function vo(i){return i!==void 0}function jo(i){return i.data}function bo(i){return i!==void 0}function Eo(i){return i.data}function wo(i){return i.x}function ko(i,e){return i-e}function Ro(i){return i.date}exports.HybridMap=xo;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-6v2a2njQ.cjs"),d=require("react"),qt=require("./parse-xYI9yrvL.cjs"),It=require("./getSliderMarks-CIuSoedo.cjs"),Ut=require("./Spinner-jTMOLuw_.cjs"),Pt=require("./index-DQA8q5sC.cjs"),U=require("./index-DLFt97gy.cjs"),St=require("./Typography-DrJ7IOdw.cjs"),Gt=require("./index-C5K--w8d.cjs"),zt=require("./Source-B3i0Bx2R.cjs"),Ht=require("./index-Dzc_aaI9-C3DbPpy3.cjs"),Xt=require("./Tooltip-BLa2EfMs.cjs"),Ot=require("./index-sbKVyHS2.cjs"),Yt=require("./DetailsModal-DHttOA80.cjs"),Jt=require("./pow-BnyPO-NX.cjs"),Kt=require("./ordinal-CrsysVE-.cjs"),Zt=require("./threshold-DNsSUf8Q.cjs"),Nt=require("./select-Bnfk0lJx.cjs"),le=require("./proxy-C4-uo6nS.cjs"),dt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Qt=require("./numberFormattingFunction-02t-wJta.cjs"),eo=require("./use-in-view-C3o_ntMv.cjs"),to=require("./index-CoobIWNj.cjs"),oo=require("./GraphFooter.cjs"),ro=require("./GraphHeader.cjs"),we=require("./Colors.cjs"),ao=require("./fetchAndParseData-QTF6tjij.cjs"),_t=require("./GraphContainer-B1EDxJ0S.cjs"),io=require("./getUniqValue-NX8DgwND.cjs"),no=require("./getJenks-BzJvhy_H.cjs");function so(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const g=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,g.get?g:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const lo=so(d);var co="Separator",Lt="horizontal",uo=["horizontal","vertical"],Vt=lo.forwardRef((a,e)=>{const{decorative:t,orientation:g=Lt,...f}=a,n=mo(g)?g:Lt,y=t?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return r.ae.jsx(Ht.w.div,{"data-orientation":n,...y,...f,ref:e})});Vt.displayName=co;function mo(a){return uo.includes(a)}var $t=Vt;const Bt=d.forwardRef((a,e)=>{const t=r._.c(14);let g,f,n,y;t[0]!==a?({className:g,variant:n,orientation:y,...f}=a,t[0]=a,t[1]=g,t[2]=f,t[3]=n,t[4]=y):(g=t[1],f=t[2],n=t[3],y=t[4]);const v=n===void 0?"dark":n,s=y===void 0?"horizontal":y,x=s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",k=v==="dark"?"bg-primary-gray-600 dark:bg-primary-gray-200":"bg-primary-gray-400 dark:bg-primary-gray-550";let E;t[5]!==g||t[6]!==x||t[7]!==k?(E=r.mo(x,k,g),t[5]=g,t[6]=x,t[7]=k,t[8]=E):E=t[8];let S;return t[9]!==s||t[10]!==f||t[11]!==e||t[12]!==E?(S=r.ae.jsx($t,{...f,ref:e,orientation:s,className:E}),t[9]=s,t[10]=f,t[11]=e,t[12]=E,t[13]=S):S=t[13],S});Bt.displayName=$t.displayName;function po(a){const{data:e,colors:t,mapData:g,mapColorLegendTitle:f,colorDomain:n,radius:y,height:v,width:s,scale:x,centerPoint:k,tooltip:E,showLabels:S,mapBorderWidth:ke,mapBorderColor:Re,mapNoDataColor:Ce,onSeriesMouseOver:G,showColorScale:De,zoomScaleExtend:We,zoomTranslateExtend:Ue,highlightedDataPoints:Se,onSeriesMouseClick:I,resetSelectionOnDoubleClick:Ne,detailsOnClick:H,styles:R,classNames:X,mapProjection:ee,zoomInteraction:Y,animate:j,dimmedOpacity:P,customLayers:ce,maxRadiusValue:de,categorical:te,dotColor:J,collapseColorScaleByDefault:Oe,highlightedIds:oe,mapProperty:ue,dotLegendTitle:me,dotBorderColor:Me,labelColor:qe,projectionRotate:K,rewindCoordinatesInMapData:pe}=a,u=d.useMemo(()=>pe?U.index_default(g,{reverse:!0}):g,[g,pe]),[l,z]=d.useState(void 0),[Ge,Ie]=d.useState(Oe===void 0?!(s<680):!Oe),xe=d.useRef(null),[_,N]=d.useState(void 0),[re,O]=d.useState(void 0),[Pe,C]=d.useState(void 0),[ze,M]=d.useState(void 0),L=d.useRef(null),Z=eo.useInView(L,{once:j.once,amount:j.amount}),ae=d.useRef(null),V=e.filter(o=>o.radius===void 0||o.radius===null).length!==e.length?Jt.sqrt().domain([0,de]).range([.25,y]).nice():void 0,q=te?Kt.ordinal().domain(n).range(t):Zt.threshold().domain(n).range(t);d.useEffect(()=>{const o=Nt.select(ae.current),i=Nt.select(L.current),b=m=>{if(Y==="noZoom")return!1;if(Y==="button")return!m.type.includes("wheel");const ge=m.type==="wheel",fe=m.type.startsWith("touch"),Be=m.type==="mousedown"||m.type==="mousemove";return fe?!0:ge?Y==="scroll"?!0:m.ctrlKey:Be&&!m.button&&!m.ctrlKey},D=U.zoom().scaleExtent(We).translateExtent(Ue||[[-20,-20],[s+20,v+20]]).filter(b).on("zoom",({transform:m})=>{o.attr("transform",m)});i.call(D),xe.current=D},[v,s,Y]);const $=U.index_default$1(u),w=Gt.index_default(u),_e=($[2]-$[0])*1.15,Le=($[3]-$[1])*1.15,Ve=s*190/960*360/_e,$e=v*190/678*180/Le,B=x*Math.min(Ve,$e),Q=ee==="mercator"?U.geoMercator().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="equalEarth"?U.geoEqualEarth().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="naturalEarth"?U.geoNaturalEarth1().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="orthographic"?U.geoOrthographic().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):U.geoAlbersUsa().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B),he=U.geoPath().projection(Q),ie=o=>{if(!L.current||!xe.current)return;Nt.select(L.current).call(xe.current.scaleBy,o==="in"?1.2:1/1.2)};return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r.jsxRuntimeExports.jsx(le.motion.svg,{width:`${s}px`,height:`${v}px`,viewBox:`0 0 ${s} ${v}`,ref:L,direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{ref:ae,children:[ce.filter(o=>o.position==="before").map(o=>o.layer),u.features.map((o,i)=>{if(!o.properties?.[ue])return null;const b=he(o);return b?r.jsxRuntimeExports.jsx(le.motion.g,{opacity:l?P:oe.length!==0?oe.indexOf(o.properties[ue])!==-1?1:P:1,children:r.jsxRuntimeExports.jsx("path",{d:b,style:{stroke:Re,strokeWidth:ke,fill:Ce}})},i):null}),r.jsxRuntimeExports.jsxs(to.AnimatePresence,{children:[e.filter(o=>o.id).map(o=>{const i=u.features.findIndex(m=>o.id===m.properties[ue]);if(i===-1)return null;const b=he(u.features[i]);if(!b)return null;const D=dt.checkIfNullOrUndefined(o.x)?Ce:q(o.x);return r.jsxRuntimeExports.jsx(le.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:l?l===D?1:P:oe.length!==0?oe.indexOf(o.id)!==-1?1:P:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:m=>{O(o),M(m.clientY),C(m.clientX),G?.(o)},onMouseMove:m=>{O(o),M(m.clientY),C(m.clientX)},onMouseLeave:()=>{O(void 0),C(void 0),M(void 0),G?.(void 0)},onClick:()=>{(I||H)&&(Pt.isEqual(_,o)&&Ne?(N(void 0),I?.(void 0)):(N(o),I?.(o)))},children:r.jsxRuntimeExports.jsx(le.motion.path,{d:b,variants:{initial:{fill:D,opacity:0},whileInView:{fill:D,opacity:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},style:{stroke:Re,strokeWidth:ke}},`${o.id}`)},o.id)}),e.filter(o=>!dt.checkIfNullOrUndefined(o.lat)&&!dt.checkIfNullOrUndefined(o.long)).map(o=>{const i=Q([o.long,o.lat])[0]>.8*s?-1:1;return r.jsxRuntimeExports.jsxs(le.motion.g,{className:"undp-map-dots",variants:{initial:{opacity:0},whileInView:{opacity:Se.length!==0?Se.indexOf(o.label||"")!==-1?1:P:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:b=>{O(o),M(b.clientY),C(b.clientX),G?.(o)},onMouseMove:b=>{O(o),M(b.clientY),C(b.clientX)},onMouseLeave:()=>{O(void 0),C(void 0),M(void 0),G?.(void 0)},onClick:()=>{(I||H)&&(Pt.isEqual(_,o)&&Ne?(N(void 0),I?.(void 0)):(N(o),I?.(o)))},transform:`translate(${Q([o.long,o.lat])[0]},${Q([o.long,o.lat])[1]})`,children:[r.jsxRuntimeExports.jsx(le.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:J,stroke:Me||J},whileInView:{r:V?V(o.radius||0):y,fill:J,stroke:Me||J,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{r:0,transition:{duration:j.duration}},style:{fillOpacity:.8}}),S&&o.label?r.jsxRuntimeExports.jsx(le.motion.text,{variants:{initial:{opacity:0,x:i*(V?V(o.radius||0):y)},whileInView:{opacity:1,x:i*(V?V(o.radius||0):y),transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},y:0,className:r.mo("text-sm",X?.graphObjectValues),style:{textAnchor:i===-1?"end":"start",fill:qe||"#000",...R?.graphObjectValues||{}},dx:i*4,dy:5,children:o.label}):null]},o.label||`${o.lat}-${o.long}`)})]}),ce.filter(o=>o.position==="after").map(o=>o.layer)]})}),De===!1?null:r.jsxRuntimeExports.jsx("div",{className:r.mo("absolute left-4 bottom-4 map-color-legend",X?.colorLegend),children:Ge?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{Ie(!1)},children:r.jsxRuntimeExports.jsx(Ot.X,{})}),r.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:te?void 0:"340px"},children:[me&&me!==""?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:J}}),r.jsxRuntimeExports.jsx(St._,{size:"xs",marginBottom:"none",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:me})]}),r.jsxRuntimeExports.jsx(zt.n,{size:"xl"}),r.jsxRuntimeExports.jsx(Bt,{}),r.jsxRuntimeExports.jsx(zt.n,{size:"xl"})]}):null,f&&f!==""?r.jsxRuntimeExports.jsx(St._,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:f}):null,te?r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:n.map((o,i)=>r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{z(t[i%t.length])},onMouseLeave:()=>{z(void 0)},children:[r.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t[i%t.length]}}),r.jsxRuntimeExports.jsx(St._,{size:"sm",marginBottom:"none",leading:"none",children:o})]},i))}):r.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{children:[n.map((o,i)=>r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{z(t[i])},onMouseLeave:()=>{z(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:i*320/t.length+1,y:1,width:320/t.length-2,height:8,className:l===t[i]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:t[i],...l===t[i]?{}:{stroke:t[i]}}}),r.jsxRuntimeExports.jsx("text",{x:(i+1)*320/t.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Qt.numberFormattingFunction(o,"NA")})]},i)),r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{z(t[n.length])},onMouseLeave:()=>{z(void 0)},x:n.length*320/t.length+1,y:1,width:320/t.length-2,height:8,className:`cursor-pointer ${l===t[n.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:t[n.length],...l===t[n.length]?{}:{stroke:t[n.length]}}})})]})})]})]}):r.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{Ie(!0)},children:r.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),Y==="button"&&r.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[r.jsxRuntimeExports.jsx("button",{onClick:()=>ie("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),r.jsxRuntimeExports.jsx("button",{onClick:()=>ie("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),H&&_!==void 0?r.jsxRuntimeExports.jsx(Yt.DetailsModal,{body:H,data:_,setData:N,className:X?.modal}):null,re&&E&&Pe&&ze?r.jsxRuntimeExports.jsx(Xt.Tooltip,{data:re,body:E,xPos:Pe,yPos:ze,backgroundStyle:R?.tooltip,className:X?.tooltip}):null]})}function xo(a){const e=r.compilerRuntimeExports.c(135),{data:t,mapData:g,graphTitle:f,colors:n,sources:y,graphDescription:v,height:s,width:x,footNote:k,mapColorLegendTitle:E,colorDomain:S,choroplethScaleType:ke,radius:Re,scale:Ce,centerPoint:G,padding:De,mapBorderWidth:We,mapNoDataColor:Ue,backgroundColor:Se,showLabels:I,mapBorderColor:Ne,tooltip:H,relativeHeight:R,onSeriesMouseOver:X,isWorldMap:ee,showColorScale:Y,zoomScaleExtend:j,zoomTranslateExtend:P,graphID:ce,highlightedDataPoints:de,onSeriesMouseClick:te,graphDownload:J,dataDownload:Oe,showAntarctica:oe,language:ue,minHeight:me,theme:Me,ariaLabel:qe,resetSelectionOnDoubleClick:K,detailsOnClick:pe,styles:u,classNames:l,mapProjection:z,zoomInteraction:Ge,animate:Ie,dimmedOpacity:xe,customLayers:_,maxRadiusValue:N,timeline:re,collapseColorScaleByDefault:O,dotColor:Pe,highlightedIds:C,mapProperty:ze,dotLegendTitle:M,dotBorderColor:L,labelColor:Z,projectionRotate:ae,rewindCoordinatesInMapData:V}=a,q=g===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":g,$=k===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":k,w=ke===void 0?"threshold":ke,_e=Re===void 0?5:Re,Le=Ce===void 0?.95:Ce,Ve=We===void 0?.5:We,$e=Ue===void 0?we.Colors.light.graphNoData:Ue,B=Se===void 0?!1:Se,Q=I===void 0?!1:I,he=Ne===void 0?we.Colors.light.grays["gray-500"]:Ne,ie=ee===void 0?!0:ee,o=Y===void 0?!0:Y;let i;e[0]!==j?(i=j===void 0?[.8,6]:j,e[0]=j,e[1]=i):i=e[1];const b=i;let D;e[2]!==de?(D=de===void 0?[]:de,e[2]=de,e[3]=D):D=e[3];const m=D,ge=J===void 0?!1:J,fe=Oe===void 0?!1:Oe,Be=oe===void 0?!1:oe,ut=ue===void 0?"en":ue,F=me===void 0?0:me,ne=Me===void 0?"light":Me,mt=K===void 0?!0:K,pt=z===void 0?"naturalEarth":z,xt=Ge===void 0?"button":Ge,He=Ie===void 0?!1:Ie,ht=xe===void 0?.3:xe;let Xe;e[4]!==_?(Xe=_===void 0?[]:_,e[4]=_,e[5]=Xe):Xe=e[5];const gt=Xe;let Ye;e[6]!==re?(Ye=re===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:re,e[6]=re,e[7]=Ye):Ye=e[7];const c=Ye,ft=Pe===void 0?we.Colors.primaryColors["blue-600"]:Pe;let Je;e[8]!==C?(Je=C===void 0?[]:C,e[8]=C,e[9]=Je):Je=e[9];const yt=Je,vt=ze===void 0?"ISO3":ze,jt=Z===void 0?we.Colors.primaryColors["blue-600"]:Z;let Ke;e[10]!==ae?(Ke=ae===void 0?[0,0]:ae,e[10]=ae,e[11]=Ke):Ke=e[11];const bt=Ke,Et=V===void 0?!0:V,[se,Ft]=d.useState(0),[Fe,Tt]=d.useState(0),[T,At]=d.useState(c.autoplay);let Te;if(e[12]!==t||e[13]!==c.dateFormat){let h;e[15]!==c.dateFormat?(h=W=>qt.parse(`${W.date}`,c.dateFormat||"yyyy",new Date).getTime(),e[15]=c.dateFormat,e[16]=h):h=e[16],Te=[...new Set(t.filter(Ro).map(h))],Te.sort(ko),e[12]=t,e[13]=c.dateFormat,e[14]=Te}else Te=e[14];const p=Te,[A,wt]=d.useState(c.autoplay?0:p.length-1),[ye,Wt]=d.useState(void 0),kt=d.useRef(null),Mt=d.useRef(null);let Ze;e[17]!==w||e[18]!==S||e[19]!==n?.length||e[20]!==t?(Ze=S||(w==="categorical"?io.getUniqValue(t,"x"):no.getJenks(t.map(wo),n?.length||4)),e[17]=w,e[18]=S,e[19]=n?.length,e[20]=t,e[21]=Ze):Ze=e[21];const Ae=Ze;let Qe,et;e[22]===Symbol.for("react.memo_cache_sentinel")?(Qe=()=>{const h=new ResizeObserver(W=>{Ft(W[0].target.clientWidth||620),Tt(W[0].target.clientHeight||480)});return kt.current&&h.observe(kt.current),()=>h.disconnect()},et=[],e[22]=Qe,e[23]=et):(Qe=e[22],et=e[23]),d.useEffect(Qe,et);let tt;e[24]===Symbol.for("react.memo_cache_sentinel")?(tt=h=>{Wt(h)},e[24]=tt):tt=e[24];const ot=d.useEffectEvent(tt);let rt;e[25]!==q||e[26]!==ot?(rt=()=>{typeof q=="string"?ao.fetchAndParseJSON(q).then(W=>{ot(W)}):ot(q)},e[25]=q,e[26]=ot,e[27]=rt):rt=e[27];let at;e[28]!==q?(at=[q],e[28]=q,e[29]=at):at=e[29],d.useEffect(rt,at);let it,nt;e[30]!==T||e[31]!==c.speed||e[32]!==p?(it=()=>{const h=setInterval(()=>{wt(W=>W<p.length-1?W+1:0)},(c.speed||2)*1e3);return T||clearInterval(h),()=>clearInterval(h)},nt=[p,T,c.speed],e[30]=T,e[31]=c.speed,e[32]=p,e[33]=it,e[34]=nt):(it=e[33],nt=e[34]),d.useEffect(it,nt);const Rt=c.dateFormat||"yyyy";let st;e[35]!==A||e[36]!==Rt||e[37]!==c.showOnlyActiveDate||e[38]!==p?(st=It.getSliderMarks(p,A,c.showOnlyActiveDate,Rt),e[35]=A,e[36]=Rt,e[37]=c.showOnlyActiveDate,e[38]=p,e[39]=st):st=e[39];const lt=st,Ct=l?.graphContainer,Dt=u?.graphContainer;let ve;e[40]!==l?.description||e[41]!==l?.title||e[42]!==t||e[43]!==fe||e[44]!==v||e[45]!==ge||e[46]!==f||e[47]!==u?.description||e[48]!==u?.title||e[49]!==x?(ve=f||v||ge||fe?r.jsxRuntimeExports.jsx(ro.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:l?.title,description:l?.description},graphTitle:f,graphDescription:v,width:x,graphDownload:ge?Mt:void 0,dataDownload:fe?t.map(Eo).filter(bo).length>0?t.map(jo).filter(vo):t.filter(yo):null}):null,e[40]=l?.description,e[41]=l?.title,e[42]=t,e[43]=fe,e[44]=v,e[45]=ge,e[46]=f,e[47]=u?.description,e[48]=u?.title,e[49]=x,e[50]=ve):ve=e[50];let je;e[51]!==A||e[52]!==lt||e[53]!==T||e[54]!==c.enabled||e[55]!==p?(je=c.enabled&&p.length>0&<?r.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[r.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{At(!T)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":T?"Click to pause animation":"Click to play animation",children:T?r.jsxRuntimeExports.jsx(Ot.Pause,{}):r.jsxRuntimeExports.jsx(Ot.Play,{})}),r.jsxRuntimeExports.jsx(It.Nr,{min:p[0],max:p[p.length-1],marks:lt,step:null,defaultValue:p[p.length-1],value:p[A],onChangeComplete:h=>{wt(p.indexOf(h))},onChange:h=>{wt(p.indexOf(h))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[51]=A,e[52]=lt,e[53]=T,e[54]=c.enabled,e[55]=p,e[56]=je):je=e[56];let be;e[57]!==He||e[58]!==G||e[59]!==w||e[60]!==l||e[61]!==O||e[62]!==n||e[63]!==gt||e[64]!==t||e[65]!==pe||e[66]!==ht||e[67]!==Ae||e[68]!==L||e[69]!==ft||e[70]!==M||e[71]!==s||e[72]!==m||e[73]!==yt||e[74]!==A||e[75]!==ie||e[76]!==jt||e[77]!==he||e[78]!==Ve||e[79]!==E||e[80]!==$e||e[81]!==pt||e[82]!==vt||e[83]!==ye||e[84]!==N||e[85]!==F||e[86]!==te||e[87]!==X||e[88]!==bt||e[89]!==_e||e[90]!==R||e[91]!==mt||e[92]!==Et||e[93]!==Le||e[94]!==Be||e[95]!==o||e[96]!==Q||e[97]!==u||e[98]!==Fe||e[99]!==se||e[100]!==ne||e[101]!==c.dateFormat||e[102]!==c.enabled||e[103]!==H||e[104]!==p||e[105]!==x||e[106]!==xt||e[107]!==b||e[108]!==P?(be=r.jsxRuntimeExports.jsx(_t.GraphArea,{ref:kt,children:se&&Fe&&ye?r.jsxRuntimeExports.jsx(po,{dotColor:ft,data:t.filter(h=>c.enabled?h.date===qt.format(new Date(p[A]),c.dateFormat||"yyyy"):h),mapData:Be?ye:{...ye,features:ye.features.filter(fo)},colorDomain:Ae,width:se,height:Fe,scale:Le,centerPoint:G,colors:n||(w==="categorical"?we.Colors[ne].sequentialColors[`neutralColorsx0${Ae.length}`]:we.Colors[ne].sequentialColors[`neutralColorsx0${Ae.length+1}`]),mapColorLegendTitle:E,radius:_e,categorical:w==="categorical",mapBorderWidth:Ve,mapNoDataColor:$e,mapBorderColor:he,tooltip:H,onSeriesMouseOver:X,showLabels:Q,isWorldMap:ie,showColorScale:o,zoomScaleExtend:b,zoomTranslateExtend:P,onSeriesMouseClick:te,highlightedDataPoints:m,resetSelectionOnDoubleClick:mt,styles:u,classNames:l,zoomInteraction:xt,detailsOnClick:pe,mapProjection:pt||(ie?"naturalEarth":"mercator"),animate:He===!0?{duration:.5,once:!0,amount:.5}:He||{duration:0,once:!0,amount:0},dimmedOpacity:ht,customLayers:gt,maxRadiusValue:dt.checkIfNullOrUndefined(N)?Math.max(...t.map(go).filter(ho)):N,collapseColorScaleByDefault:O,highlightedIds:yt,mapProperty:vt,dotLegendTitle:M,dotBorderColor:L,labelColor:jt,projectionRotate:bt,rewindCoordinatesInMapData:Et}):r.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(F,s||(R?F?(x||se)*R>F?(x||se)*R:F:(x||se)*R:Fe))}px`},className:"flex items-center justify-center",children:r.jsxRuntimeExports.jsx(Ut.w,{"aria-label":"Loading graph"})})}),e[57]=He,e[58]=G,e[59]=w,e[60]=l,e[61]=O,e[62]=n,e[63]=gt,e[64]=t,e[65]=pe,e[66]=ht,e[67]=Ae,e[68]=L,e[69]=ft,e[70]=M,e[71]=s,e[72]=m,e[73]=yt,e[74]=A,e[75]=ie,e[76]=jt,e[77]=he,e[78]=Ve,e[79]=E,e[80]=$e,e[81]=pt,e[82]=vt,e[83]=ye,e[84]=N,e[85]=F,e[86]=te,e[87]=X,e[88]=bt,e[89]=_e,e[90]=R,e[91]=mt,e[92]=Et,e[93]=Le,e[94]=Be,e[95]=o,e[96]=Q,e[97]=u,e[98]=Fe,e[99]=se,e[100]=ne,e[101]=c.dateFormat,e[102]=c.enabled,e[103]=H,e[104]=p,e[105]=x,e[106]=xt,e[107]=b,e[108]=P,e[109]=be):be=e[109];let Ee;e[110]!==l?.footnote||e[111]!==l?.source||e[112]!==$||e[113]!==y||e[114]!==u?.footnote||e[115]!==u?.source||e[116]!==x?(Ee=y||$?r.jsxRuntimeExports.jsx(oo.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:l?.footnote,source:l?.source},sources:y,footNote:$,width:x}):null,e[110]=l?.footnote,e[111]=l?.source,e[112]=$,e[113]=y,e[114]=u?.footnote,e[115]=u?.source,e[116]=x,e[117]=Ee):Ee=e[117];let ct;return e[118]!==qe||e[119]!==B||e[120]!==ce||e[121]!==s||e[122]!==ut||e[123]!==F||e[124]!==De||e[125]!==R||e[126]!==Ct||e[127]!==Dt||e[128]!==ve||e[129]!==je||e[130]!==be||e[131]!==Ee||e[132]!==ne||e[133]!==x?(ct=r.jsxRuntimeExports.jsxs(_t.GraphContainer,{className:Ct,style:Dt,id:ce,ref:Mt,"aria-label":qe,backgroundColor:B,theme:ne,language:ut,minHeight:F,width:x,height:s,relativeHeight:R,padding:De,children:[ve,je,be,Ee]}),e[118]=qe,e[119]=B,e[120]=ce,e[121]=s,e[122]=ut,e[123]=F,e[124]=De,e[125]=R,e[126]=Ct,e[127]=Dt,e[128]=ve,e[129]=je,e[130]=be,e[131]=Ee,e[132]=ne,e[133]=x,e[134]=ct):ct=e[134],ct}function ho(a){return a!=null}function go(a){return a.radius}function fo(a){return a.properties.NAME!=="Antarctica"}function yo(a){return a!==void 0}function vo(a){return a!==void 0}function jo(a){return a.data}function bo(a){return a!==void 0}function Eo(a){return a.data}function wo(a){return a.x}function ko(a,e){return a-e}function Ro(a){return a.date}exports.HybridMap=xo;
|
|
2
2
|
//# sourceMappingURL=HybridMap.cjs.map
|