@undp/data-viz 2.3.12 → 2.3.13
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/Data/department.json +530 -0
- package/dist/{GraphEl-CXK-LPsj.js → GraphEl-Bb5oGHoa.js} +2 -1
- package/dist/GraphEl-Bb5oGHoa.js.map +1 -0
- package/dist/{GraphEl-Bgf8w82K.cjs → GraphEl-BerZfJ3j.cjs} +2 -2
- package/dist/{GraphEl-Bgf8w82K.cjs.map → GraphEl-BerZfJ3j.cjs.map} +1 -1
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.d.ts +2 -0
- package/dist/StripChart.js +592 -481
- package/dist/StripChart.js.map +1 -1
- package/dist/Types.d.ts +1 -0
- package/dist/index.d.ts +3 -0
- package/package.json +1 -1
- package/dist/GraphEl-CXK-LPsj.js.map +0 -1
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-TOaaUwS7.cjs"),te=require("./Spinner-jTMOLuw_.cjs"),m=require("./DropdownSelect-NNpOs7DX.cjs"),le=require("./GraphContainer-B1EDxJ0S.cjs"),oe=require("./GraphEl-Bgf8w82K.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-TOaaUwS7.cjs"),te=require("./Spinner-jTMOLuw_.cjs"),m=require("./DropdownSelect-NNpOs7DX.cjs"),le=require("./GraphContainer-B1EDxJ0S.cjs"),oe=require("./GraphEl-BerZfJ3j.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.d.ts
CHANGED
|
@@ -466,6 +466,7 @@ declare interface GraphSettingsDataType {
|
|
|
466
466
|
projectionRotate?: [number, number] | [number, number, number];
|
|
467
467
|
rewindCoordinatesInMapData?: boolean;
|
|
468
468
|
circularBoundary?: boolean;
|
|
469
|
+
showDataMinMax?: boolean;
|
|
469
470
|
}
|
|
470
471
|
|
|
471
472
|
declare type GraphType = GraphTypeForGriddedGraph;
|
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-CtJETd5V.js";
|
|
7
7
|
import { j as V, D as O } from "./DropdownSelect-B2WTeedJ.js";
|
|
8
8
|
import { G as ha } from "./GraphContainer-DwMxWRCi.js";
|
|
9
|
-
import { G as fa } from "./GraphEl-
|
|
9
|
+
import { G as fa } from "./GraphEl-Bb5oGHoa.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";
|
|
@@ -493,6 +493,7 @@ declare interface GraphSettingsDataType {
|
|
|
493
493
|
projectionRotate?: [number, number] | [number, number, number];
|
|
494
494
|
rewindCoordinatesInMapData?: boolean;
|
|
495
495
|
circularBoundary?: boolean;
|
|
496
|
+
showDataMinMax?: boolean;
|
|
496
497
|
}
|
|
497
498
|
|
|
498
499
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -499,6 +499,7 @@ declare interface GraphSettingsDataType {
|
|
|
499
499
|
projectionRotate?: [number, number] | [number, number, number];
|
|
500
500
|
rewindCoordinatesInMapData?: boolean;
|
|
501
501
|
circularBoundary?: boolean;
|
|
502
|
+
showDataMinMax?: boolean;
|
|
502
503
|
}
|
|
503
504
|
|
|
504
505
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -518,6 +518,7 @@ declare interface GraphSettingsDataType {
|
|
|
518
518
|
projectionRotate?: [number, number] | [number, number, number];
|
|
519
519
|
rewindCoordinatesInMapData?: boolean;
|
|
520
520
|
circularBoundary?: boolean;
|
|
521
|
+
showDataMinMax?: boolean;
|
|
521
522
|
}
|
|
522
523
|
|
|
523
524
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -490,6 +490,7 @@ declare interface GraphSettingsDataType {
|
|
|
490
490
|
projectionRotate?: [number, number] | [number, number, number];
|
|
491
491
|
rewindCoordinatesInMapData?: boolean;
|
|
492
492
|
circularBoundary?: boolean;
|
|
493
|
+
showDataMinMax?: boolean;
|
|
493
494
|
}
|
|
494
495
|
|
|
495
496
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -509,6 +509,7 @@ declare interface GraphSettingsDataType {
|
|
|
509
509
|
projectionRotate?: [number, number] | [number, number, number];
|
|
510
510
|
rewindCoordinatesInMapData?: boolean;
|
|
511
511
|
circularBoundary?: boolean;
|
|
512
|
+
showDataMinMax?: boolean;
|
|
512
513
|
}
|
|
513
514
|
|
|
514
515
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -411,6 +411,7 @@ declare interface GraphSettingsDataType {
|
|
|
411
411
|
projectionRotate?: [number, number] | [number, number, number];
|
|
412
412
|
rewindCoordinatesInMapData?: boolean;
|
|
413
413
|
circularBoundary?: boolean;
|
|
414
|
+
showDataMinMax?: boolean;
|
|
414
415
|
}
|
|
415
416
|
|
|
416
417
|
declare type GraphType = GraphTypeForGriddedGraph;
|
package/dist/ScrollStory.d.ts
CHANGED
|
@@ -417,6 +417,7 @@ declare interface GraphSettingsDataType {
|
|
|
417
417
|
projectionRotate?: [number, number] | [number, number, number];
|
|
418
418
|
rewindCoordinatesInMapData?: boolean;
|
|
419
419
|
circularBoundary?: boolean;
|
|
420
|
+
showDataMinMax?: boolean;
|
|
420
421
|
}
|
|
421
422
|
|
|
422
423
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-6v2a2njQ.cjs"),o=require("react"),te=require("./index-CyZ1lmi_.cjs"),q=require("./index-BS2TADPj.cjs"),le=require("./index-DQA8q5sC.cjs"),C=require("./DropdownSelect-NNpOs7DX.cjs"),d=require("./checkIfMultiple-TOaaUwS7.cjs"),ne=require("./Spinner-jTMOLuw_.cjs"),ie=require("./GraphContainer-B1EDxJ0S.cjs"),re=require("./GraphEl-Bgf8w82K.cjs"),$=require("./fetchAndParseData-QTF6tjij.cjs"),U=require("./transformDataForAggregation-BFdha9Dx.cjs"),z=require("./getUniqValue-NX8DgwND.cjs"),se=require("./GraphHeader.cjs"),W=require("./filterData-T5DQBE9b.cjs"),oe=require("./getGraphList-DQ24IzAn.cjs"),J=require("./transformDataForSelect-YmStusCI.cjs"),ue=u=>{if(u.findIndex(n=>n.chartConfigId==="yMin")!==-1&&u.findIndex(n=>n.chartConfigId==="yMax")!==-1)return u;const i=[...u];return u.findIndex(n=>n.chartConfigId==="yMin")===-1&&i.push({chartConfigId:"yMin",columnId:`${u[u.findIndex(n=>n.chartConfigId==="y")].columnId}Min`}),u.findIndex(n=>n.chartConfigId==="yMax")===-1&&i.push({chartConfigId:"yMax",columnId:`${u[u.findIndex(n=>n.chartConfigId==="y")].columnId}Max`}),i},M=(u,i)=>{const n=i?.map(D=>{const b=u?.findIndex(s=>s.chartConfigId===D.chartConfigId);if(b===-1)return{};const w=u[b]?.allowedColumnIds?.findIndex(s=>s.value===D.columnId);return w===-1?{}:u[b].allowedColumnIds[w].graphSettings||{}})||[];return Object.assign({},...n)};function de(u){const{graphSettings:i,dataSettings:n,filters:D,graphType:b,dataTransform:w,graphDataConfiguration:s,dataFilters:A,debugMode:S,dataSelectionOptions:I,advancedDataSelectionOptions:N,readableHeader:B,noOfFiltersPerRow:p=4,updateFilters:K,uiMode:f="normal",highlightDataPointSettings:m}=u,[P,F]=o.useState(void 0),[c,Q]=o.useState(void 0),[v,j]=o.useState(s),[x,V]=o.useState({}),[E,X]=o.useState(void 0),[Y,Z]=o.useState([]),H=o.useRef(null),O=o.useRef(s),[R,k]=o.useState([]),G={ignoreCase:!0,ignoreAccents:!0,trim:!0},L=o.useEffectEvent(()=>{const e=(D||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,ui:r.ui,defaultValue:J.transformDefaultValue(r.defaultValue),value:J.transformDefaultValue(r.defaultValue),availableValues:z.getUniqValue(c,r.column).filter(a=>!r.excludeValues?.includes(`${a}`)).map(a=>({value:a,label:a})),allowSelectAll:r.allowSelectAll,width:r.width}));k(e)});o.useEffect(()=>{(async()=>{try{const r=n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?await $.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,S):n.fileType==="api"?await $.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,S):await $.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,S,n.delimiter,!0):await $.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):await $.transformColumnsToArray(n.data,n.columnsToArray);Q(r)}catch(r){console.error("Data fetching error:",r)}})(),L()},[n,S]),o.useEffect(()=>{L()},[D,c]);const _=o.useEffectEvent(()=>{if(!c||R.length===0)F(c);else{const e=c.filter(r=>R.every(a=>a.value&&q.flattenDeep([a.value]).length>0?te.intersection(q.flattenDeep([r[a.filter]]),q.flattenDeep([a.value]).map(t=>t.value)).length>0:!0));F(e)}});o.useEffect(()=>{_()},[R,c]),o.useEffect(()=>{I&&V(M(I,s))},[I,s]);const ee=o.useEffectEvent(()=>{m?.column&&P&&Z(z.getUniqValue(P,m.column).filter(e=>!m?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))});o.useEffect(()=>{ee()},[m]),o.useEffect(()=>{le.isEqual(O.current,s)||(j(s),O.current=s)},[s]);const y=(e,r)=>{k(a=>a.map(t=>t.filter===e?{...t,value:r}:t))},ae=c?U.transformDataForGraph(w?U.transformDataForAggregation(W.filterData(c,A||[]),w.keyColumn,w.aggregationColumnsSetting):W.filterData(c,A||[]),b,b==="lineChartWithConfidenceInterval"&&v?ue(v):v):void 0;return l.jsxRuntimeExports.jsx(ie.GraphContainer,{className:i?.classNames?.graphContainer,style:i?.styles?.graphContainer,id:i?.graphID,ref:H,"aria-label":i?.ariaLabel,backgroundColor:i?.backgroundColor??!1,theme:i?.theme||"light",language:i?.language||"en",width:i?.width,height:i?.height,padding:i?.padding,minHeight:i?.minHeight,relativeHeight:i?.relativeHeight,children:c||oe.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(b)!==-1?l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[x?.graphTitle||x?.graphDescription||i?.graphTitle||i?.graphDescription||i?.graphDownload||i?.dataDownload?l.jsxRuntimeExports.jsx(se.GraphHeader,{styles:{title:x?.styles?.title||i?.styles?.title,description:x?.styles?.description||i?.styles?.description},classNames:{title:x?.classNames?.title||i?.classNames?.title,description:x?.classNames?.description||i?.classNames?.description},graphTitle:x?.graphTitle||i?.graphTitle,graphDescription:x?.graphDescription||i?.graphDescription,width:x?.width||i?.width,graphDownload:i?.graphDownload?H:void 0,dataDownload:i?.dataDownload&&c&&c.length>0?c:null}):null,R.length!==0||(I||[]).length!==0||(N||[]).length!==0||m?l.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-0 w-full",children:[N?.map((e,r)=>l.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.options.map(a=>({...a,value:a.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{V(a?.graphSettings||{}),j(a?.dataConfiguration)}}):l.jsxRuntimeExports.jsx(d.ye,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:f,onValueChange:a=>{const t=e.options[e.options.findIndex(g=>g.label===a)];V(t.graphSettings||{}),j(t.dataConfiguration)},children:e.options.map((a,t)=>l.jsxRuntimeExports.jsx(d.he,{label:a.label,value:a.label},t))})]},r)),I?.map((e,r)=>l.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),d.checkIfMultiple(e.chartConfigId,v||[])?e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]):void 0,filterOption:C.Du(G),onChange:a=>{const t={columnId:(a||[]).map(h=>h.value),chartConfigId:e.chartConfigId},g=v?.map(h=>h.chartConfigId===t.chartConfigId?t:h);j(g)}}):l.jsxRuntimeExports.jsx(d.$,{variant:f,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]).map(a=>a.value):[],onValueChange:a=>{const t={columnId:a||[],chartConfigId:e.chartConfigId},g=v?.map(h=>h.chartConfigId===t.chartConfigId?t:h);j(g)},children:e.allowedColumnIds.map((a,t)=>l.jsxRuntimeExports.jsx(d.P,{label:a.label,value:a.label},t))}):e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:a=>{const t={columnId:a?.value,chartConfigId:e.chartConfigId},g=v?.map(h=>h.chartConfigId===t.chartConfigId?t:h);V(M(I,g)),j(g)}}):l.jsxRuntimeExports.jsx(d.ye,{variant:f,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const g={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(T=>T.label===a)].value,chartConfigId:e.chartConfigId},h=v?.map(T=>T.chartConfigId===g.chartConfigId?g:T);V(M(I,h)),j(h)},children:e.allowedColumnIds.map((a,t)=>l.jsxRuntimeExports.jsx(d.he,{label:a.label,value:a.label},t))})]},r)),R?.map((e,r)=>l.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:e.width?0:1,flexShrink:0,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:e.label}),e.singleSelect?e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.availableValues,variant:f,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Du(G),onChange:a=>{y(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):l.jsxRuntimeExports.jsx(d.ye,{variant:f,defaultValue:e.defaultValue.value,onValueChange:a=>{y(e.filter,e.availableValues.filter(t=>t.value===a))},children:e.availableValues.map((a,t)=>l.jsxRuntimeExports.jsx(d.he,{label:`${a.label}`,value:`${a.value}`},t))}):l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.availableValues,variant:f,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Du(G),onChange:a=>{y(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):l.jsxRuntimeExports.jsx(d.$,{variant:f,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{y(e.filter,e.availableValues.filter(t=>a.indexOf(`${t.value}`)!==-1))},children:e.availableValues.map((a,t)=>l.jsxRuntimeExports.jsx(d.P,{label:`${a.label}`,value:`${a.value}`},t))}),e.allowSelectAll?l.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{y(e.filter,e.availableValues)},children:"Select all options"}):null]})]},r)),m?l.jsxRuntimeExports.jsxs("div",{style:{width:m.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:m.width?0:1,flexShrink:0,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:m.label||"Highlight data"}),l.jsxRuntimeExports.jsx(C.ja,{options:Y,variant:f,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Du(G),onChange:e=>{X(e?.map(r=>r.value))},value:E?.map(e=>({label:e,value:e})),defaultValue:m.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,l.jsxRuntimeExports.jsx(re.GraphEl,{graph:b,graphData:ae,graphDataConfiguration:v,debugMode:S,readableHeader:B||[],updateFilters:K,settings:{...i||{},...x,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,width:void 0,height:void 0,relativeHeight:void 0,minHeight:void 0,padding:"0",theme:i?.theme,...E?{highlightedDataPoints:E,highlightedIds:E?.map(e=>`${e}`),highlightedLines:E?.map(e=>e)}:{}}})]}):l.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:l.jsxRuntimeExports.jsx(ne.w,{})})})}exports.SingleGraphDashboard=de;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-6v2a2njQ.cjs"),o=require("react"),te=require("./index-CyZ1lmi_.cjs"),q=require("./index-BS2TADPj.cjs"),le=require("./index-DQA8q5sC.cjs"),C=require("./DropdownSelect-NNpOs7DX.cjs"),d=require("./checkIfMultiple-TOaaUwS7.cjs"),ne=require("./Spinner-jTMOLuw_.cjs"),ie=require("./GraphContainer-B1EDxJ0S.cjs"),re=require("./GraphEl-BerZfJ3j.cjs"),$=require("./fetchAndParseData-QTF6tjij.cjs"),U=require("./transformDataForAggregation-BFdha9Dx.cjs"),z=require("./getUniqValue-NX8DgwND.cjs"),se=require("./GraphHeader.cjs"),W=require("./filterData-T5DQBE9b.cjs"),oe=require("./getGraphList-DQ24IzAn.cjs"),J=require("./transformDataForSelect-YmStusCI.cjs"),ue=u=>{if(u.findIndex(n=>n.chartConfigId==="yMin")!==-1&&u.findIndex(n=>n.chartConfigId==="yMax")!==-1)return u;const i=[...u];return u.findIndex(n=>n.chartConfigId==="yMin")===-1&&i.push({chartConfigId:"yMin",columnId:`${u[u.findIndex(n=>n.chartConfigId==="y")].columnId}Min`}),u.findIndex(n=>n.chartConfigId==="yMax")===-1&&i.push({chartConfigId:"yMax",columnId:`${u[u.findIndex(n=>n.chartConfigId==="y")].columnId}Max`}),i},M=(u,i)=>{const n=i?.map(D=>{const b=u?.findIndex(s=>s.chartConfigId===D.chartConfigId);if(b===-1)return{};const w=u[b]?.allowedColumnIds?.findIndex(s=>s.value===D.columnId);return w===-1?{}:u[b].allowedColumnIds[w].graphSettings||{}})||[];return Object.assign({},...n)};function de(u){const{graphSettings:i,dataSettings:n,filters:D,graphType:b,dataTransform:w,graphDataConfiguration:s,dataFilters:A,debugMode:S,dataSelectionOptions:I,advancedDataSelectionOptions:N,readableHeader:B,noOfFiltersPerRow:p=4,updateFilters:K,uiMode:f="normal",highlightDataPointSettings:m}=u,[P,F]=o.useState(void 0),[c,Q]=o.useState(void 0),[v,j]=o.useState(s),[x,V]=o.useState({}),[E,X]=o.useState(void 0),[Y,Z]=o.useState([]),H=o.useRef(null),O=o.useRef(s),[R,k]=o.useState([]),G={ignoreCase:!0,ignoreAccents:!0,trim:!0},L=o.useEffectEvent(()=>{const e=(D||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,ui:r.ui,defaultValue:J.transformDefaultValue(r.defaultValue),value:J.transformDefaultValue(r.defaultValue),availableValues:z.getUniqValue(c,r.column).filter(a=>!r.excludeValues?.includes(`${a}`)).map(a=>({value:a,label:a})),allowSelectAll:r.allowSelectAll,width:r.width}));k(e)});o.useEffect(()=>{(async()=>{try{const r=n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?await $.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,S):n.fileType==="api"?await $.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,S):await $.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,S,n.delimiter,!0):await $.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):await $.transformColumnsToArray(n.data,n.columnsToArray);Q(r)}catch(r){console.error("Data fetching error:",r)}})(),L()},[n,S]),o.useEffect(()=>{L()},[D,c]);const _=o.useEffectEvent(()=>{if(!c||R.length===0)F(c);else{const e=c.filter(r=>R.every(a=>a.value&&q.flattenDeep([a.value]).length>0?te.intersection(q.flattenDeep([r[a.filter]]),q.flattenDeep([a.value]).map(t=>t.value)).length>0:!0));F(e)}});o.useEffect(()=>{_()},[R,c]),o.useEffect(()=>{I&&V(M(I,s))},[I,s]);const ee=o.useEffectEvent(()=>{m?.column&&P&&Z(z.getUniqValue(P,m.column).filter(e=>!m?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))});o.useEffect(()=>{ee()},[m]),o.useEffect(()=>{le.isEqual(O.current,s)||(j(s),O.current=s)},[s]);const y=(e,r)=>{k(a=>a.map(t=>t.filter===e?{...t,value:r}:t))},ae=c?U.transformDataForGraph(w?U.transformDataForAggregation(W.filterData(c,A||[]),w.keyColumn,w.aggregationColumnsSetting):W.filterData(c,A||[]),b,b==="lineChartWithConfidenceInterval"&&v?ue(v):v):void 0;return l.jsxRuntimeExports.jsx(ie.GraphContainer,{className:i?.classNames?.graphContainer,style:i?.styles?.graphContainer,id:i?.graphID,ref:H,"aria-label":i?.ariaLabel,backgroundColor:i?.backgroundColor??!1,theme:i?.theme||"light",language:i?.language||"en",width:i?.width,height:i?.height,padding:i?.padding,minHeight:i?.minHeight,relativeHeight:i?.relativeHeight,children:c||oe.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(b)!==-1?l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[x?.graphTitle||x?.graphDescription||i?.graphTitle||i?.graphDescription||i?.graphDownload||i?.dataDownload?l.jsxRuntimeExports.jsx(se.GraphHeader,{styles:{title:x?.styles?.title||i?.styles?.title,description:x?.styles?.description||i?.styles?.description},classNames:{title:x?.classNames?.title||i?.classNames?.title,description:x?.classNames?.description||i?.classNames?.description},graphTitle:x?.graphTitle||i?.graphTitle,graphDescription:x?.graphDescription||i?.graphDescription,width:x?.width||i?.width,graphDownload:i?.graphDownload?H:void 0,dataDownload:i?.dataDownload&&c&&c.length>0?c:null}):null,R.length!==0||(I||[]).length!==0||(N||[]).length!==0||m?l.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-0 w-full",children:[N?.map((e,r)=>l.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.options.map(a=>({...a,value:a.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{V(a?.graphSettings||{}),j(a?.dataConfiguration)}}):l.jsxRuntimeExports.jsx(d.ye,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:f,onValueChange:a=>{const t=e.options[e.options.findIndex(g=>g.label===a)];V(t.graphSettings||{}),j(t.dataConfiguration)},children:e.options.map((a,t)=>l.jsxRuntimeExports.jsx(d.he,{label:a.label,value:a.label},t))})]},r)),I?.map((e,r)=>l.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),d.checkIfMultiple(e.chartConfigId,v||[])?e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]):void 0,filterOption:C.Du(G),onChange:a=>{const t={columnId:(a||[]).map(h=>h.value),chartConfigId:e.chartConfigId},g=v?.map(h=>h.chartConfigId===t.chartConfigId?t:h);j(g)}}):l.jsxRuntimeExports.jsx(d.$,{variant:f,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]).map(a=>a.value):[],onValueChange:a=>{const t={columnId:a||[],chartConfigId:e.chartConfigId},g=v?.map(h=>h.chartConfigId===t.chartConfigId?t:h);j(g)},children:e.allowedColumnIds.map((a,t)=>l.jsxRuntimeExports.jsx(d.P,{label:a.label,value:a.label},t))}):e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:a=>{const t={columnId:a?.value,chartConfigId:e.chartConfigId},g=v?.map(h=>h.chartConfigId===t.chartConfigId?t:h);V(M(I,g)),j(g)}}):l.jsxRuntimeExports.jsx(d.ye,{variant:f,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const g={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(T=>T.label===a)].value,chartConfigId:e.chartConfigId},h=v?.map(T=>T.chartConfigId===g.chartConfigId?g:T);V(M(I,h)),j(h)},children:e.allowedColumnIds.map((a,t)=>l.jsxRuntimeExports.jsx(d.he,{label:a.label,value:a.label},t))})]},r)),R?.map((e,r)=>l.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:e.width?0:1,flexShrink:0,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:e.label}),e.singleSelect?e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.availableValues,variant:f,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Du(G),onChange:a=>{y(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):l.jsxRuntimeExports.jsx(d.ye,{variant:f,defaultValue:e.defaultValue.value,onValueChange:a=>{y(e.filter,e.availableValues.filter(t=>t.value===a))},children:e.availableValues.map((a,t)=>l.jsxRuntimeExports.jsx(d.he,{label:`${a.label}`,value:`${a.value}`},t))}):l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.availableValues,variant:f,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Du(G),onChange:a=>{y(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):l.jsxRuntimeExports.jsx(d.$,{variant:f,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{y(e.filter,e.availableValues.filter(t=>a.indexOf(`${t.value}`)!==-1))},children:e.availableValues.map((a,t)=>l.jsxRuntimeExports.jsx(d.P,{label:`${a.label}`,value:`${a.value}`},t))}),e.allowSelectAll?l.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{y(e.filter,e.availableValues)},children:"Select all options"}):null]})]},r)),m?l.jsxRuntimeExports.jsxs("div",{style:{width:m.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:m.width?0:1,flexShrink:0,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:m.label||"Highlight data"}),l.jsxRuntimeExports.jsx(C.ja,{options:Y,variant:f,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Du(G),onChange:e=>{X(e?.map(r=>r.value))},value:E?.map(e=>({label:e,value:e})),defaultValue:m.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,l.jsxRuntimeExports.jsx(re.GraphEl,{graph:b,graphData:ae,graphDataConfiguration:v,debugMode:S,readableHeader:B||[],updateFilters:K,settings:{...i||{},...x,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,width:void 0,height:void 0,relativeHeight:void 0,minHeight:void 0,padding:"0",theme:i?.theme,...E?{highlightedDataPoints:E,highlightedIds:E?.map(e=>`${e}`),highlightedLines:E?.map(e=>e)}:{}}})]}):l.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:l.jsxRuntimeExports.jsx(ne.w,{})})})}exports.SingleGraphDashboard=de;
|
|
2
2
|
//# sourceMappingURL=SingleGraphDashboard.cjs.map
|
|
@@ -466,6 +466,7 @@ declare interface GraphSettingsDataType {
|
|
|
466
466
|
projectionRotate?: [number, number] | [number, number, number];
|
|
467
467
|
rewindCoordinatesInMapData?: boolean;
|
|
468
468
|
circularBoundary?: boolean;
|
|
469
|
+
showDataMinMax?: boolean;
|
|
469
470
|
}
|
|
470
471
|
|
|
471
472
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -7,7 +7,7 @@ import { j as V, D as M } from "./DropdownSelect-B2WTeedJ.js";
|
|
|
7
7
|
import { b as A, y as H, h as O, c as da, $ as K, P as Q } from "./checkIfMultiple-B97uOUVq.js";
|
|
8
8
|
import { w as ha } from "./Spinner-CtJETd5V.js";
|
|
9
9
|
import { G as ca } from "./GraphContainer-DwMxWRCi.js";
|
|
10
|
-
import { G as fa } from "./GraphEl-
|
|
10
|
+
import { G as fa } from "./GraphEl-Bb5oGHoa.js";
|
|
11
11
|
import { f as ga, a as pa, b as ma, c as Ca, t as va } from "./fetchAndParseData-BAXhgTDM.js";
|
|
12
12
|
import { a as Ia, t as ba } from "./transformDataForAggregation-wdPf8bNt.js";
|
|
13
13
|
import { g as X } from "./getUniqValue-DsqSii6M.js";
|
|
@@ -489,6 +489,7 @@ declare interface GraphSettingsDataType {
|
|
|
489
489
|
projectionRotate?: [number, number] | [number, number, number];
|
|
490
490
|
rewindCoordinatesInMapData?: boolean;
|
|
491
491
|
circularBoundary?: boolean;
|
|
492
|
+
showDataMinMax?: boolean;
|
|
492
493
|
}
|
|
493
494
|
|
|
494
495
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -380,6 +380,7 @@ declare interface GraphSettingsDataType {
|
|
|
380
380
|
projectionRotate?: [number, number] | [number, number, number];
|
|
381
381
|
rewindCoordinatesInMapData?: boolean;
|
|
382
382
|
circularBoundary?: boolean;
|
|
383
|
+
showDataMinMax?: boolean;
|
|
383
384
|
}
|
|
384
385
|
|
|
385
386
|
declare interface HighlightAreaSettingsDataType {
|
|
@@ -387,6 +387,7 @@ declare interface GraphSettingsDataType {
|
|
|
387
387
|
projectionRotate?: [number, number] | [number, number, number];
|
|
388
388
|
rewindCoordinatesInMapData?: boolean;
|
|
389
389
|
circularBoundary?: boolean;
|
|
390
|
+
showDataMinMax?: boolean;
|
|
390
391
|
}
|
|
391
392
|
|
|
392
393
|
declare interface HighlightAreaSettingsDataType {
|
|
@@ -466,6 +466,7 @@ declare interface GraphSettingsDataType {
|
|
|
466
466
|
projectionRotate?: [number, number] | [number, number, number];
|
|
467
467
|
rewindCoordinatesInMapData?: boolean;
|
|
468
468
|
circularBoundary?: boolean;
|
|
469
|
+
showDataMinMax?: boolean;
|
|
469
470
|
}
|
|
470
471
|
|
|
471
472
|
declare interface HighlightAreaSettingsDataType {
|
|
@@ -489,6 +489,7 @@ declare interface GraphSettingsDataType {
|
|
|
489
489
|
projectionRotate?: [number, number] | [number, number, number];
|
|
490
490
|
rewindCoordinatesInMapData?: boolean;
|
|
491
491
|
circularBoundary?: boolean;
|
|
492
|
+
showDataMinMax?: boolean;
|
|
492
493
|
}
|
|
493
494
|
|
|
494
495
|
declare interface HighlightAreaSettingsDataType {
|
package/dist/StripChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-6v2a2njQ.cjs"),X=require("react"),Kt=require("./index-DQA8q5sC.cjs"),Qt=require("./index-Cno4Q0YE.cjs"),Zt=require("./Tooltip-BLa2EfMs.cjs"),mt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ht=require("./numberFormattingFunction-02t-wJta.cjs"),u=require("./Colors.cjs"),_t=require("./DetailsModal-DIRTulvr.cjs"),te=require("./linear-CgUCbw9F.cjs"),wt=require("./proxy-C4-uo6nS.cjs"),ee=require("./use-in-view-C3o_ntMv.cjs"),oe=require("./index-CoobIWNj.cjs"),zt=require("./uniqBy-O05lp2S5.cjs"),Jt=require("./GraphContainer-B1EDxJ0S.cjs"),ne=require("./EmptyState-B4c-CrXs.cjs"),re=require("./ColorLegendWithMouseOver.cjs"),le=require("./GraphFooter.cjs"),se=require("./GraphHeader.cjs");function ie(e,t){if(e<2)return[];const i=t/(e-1);return Array.from({length:e},(D,v)=>v*i)}function ae(e){const t=l.compilerRuntimeExports.c(98),{data:i,width:D,height:v,colors:n,colorDomain:s,radius:d,leftMargin:E,rightMargin:gt,topMargin:rt,bottomMargin:Mt,tooltip:lt,onSeriesMouseOver:_,highlightedDataPoints:r,selectedColor:tt,minValue:N,maxValue:S,onSeriesMouseClick:Y,noOfTicks:st,prefix:et,suffix:at,stripType:O,highlightColor:h,dotOpacity:dt,resetSelectionOnDoubleClick:B,detailsOnClick:b,styles:f,classNames:C,valueColor:x,animate:g,dimmedOpacity:J,precision:ct,customLayers:w}=e,yt=E===void 0?20:E,xt=gt===void 0?20:gt,vt=rt===void 0?10:rt,Ot=Mt===void 0?10:Mt,Vt=X.useRef(null);let ut;t[0]!==g.amount||t[1]!==g.once?(ut={once:g.once,amount:g.amount},t[0]=g.amount,t[1]=g.once,t[2]=ut):ut=t[2];const $=ee.useInView(Vt,ut),[ot,bt]=X.useState(void 0),[M,jt]=X.useState(void 0),[p,a]=X.useState(void 0),[ft,Ct]=X.useState(void 0);let pt;t[3]!==Ot||t[4]!==yt||t[5]!==xt||t[6]!==vt?(pt={top:vt,bottom:Ot,left:yt,right:xt},t[3]=Ot,t[4]=yt,t[5]=xt,t[6]=vt,t[7]=pt):pt=t[7];const m=pt,K=D-m.left-m.right,Q=v-m.top-m.bottom;let A,V,q,T,R,k,F,P,L,U,j;if(t[8]!==g.duration||t[9]!==C?.graphObjectValues||t[10]!==C?.yAxis?.labels||t[11]!==s||t[12]!==n||t[13]!==w||t[14]!==i||t[15]!==b||t[16]!==J||t[17]!==dt||t[18]!==Q||t[19]!==K||t[20]!==v||t[21]!==h||t[22]!==r||t[23]!==$||t[24]!==m.left||t[25]!==m.top||t[26]!==S||t[27]!==N||t[28]!==M||t[29]!==st||t[30]!==Y||t[31]!==_||t[32]!==ct||t[33]!==et||t[34]!==d||t[35]!==B||t[36]!==tt||t[37]!==O||t[38]!==f?.graphObjectValues||t[39]!==f?.yAxis?.labels||t[40]!==at||t[41]!==x||t[42]!==D){const Dt=i.map(Se);let Z;t[54]!==r?(Z=o=>{const c=(r||[]).indexOf(o.label);return c===-1?1/0:c},t[54]=r,t[55]=Z):Z=t[55];const Nt=Qt.orderBy(Dt,[Z],["desc"]);let nt;t[56]!==i||t[57]!==S?(nt=mt.checkIfNullOrUndefined(S)?Math.max(...i.filter(Ne).map(De))<0?0:Math.max(...i.filter(Ie).map(ke)):S,t[56]=i,t[57]=S,t[58]=nt):nt=t[58];const Rt=nt;let ht;t[59]!==i||t[60]!==N?(ht=mt.checkIfNullOrUndefined(N)?Math.min(...i.filter(Re).map(Ve))>=0?0:Math.min(...i.filter(Ee).map(Me)):N,t[59]=i,t[60]=N,t[61]=ht):ht=t[61];const kt=ht,Et=te.linear().domain([kt,Rt]).range([Q,0]).nice(),It=ie(st,Q);V=wt.motion.svg,q=`${D}px`,T=`${v}px`,R=`0 0 ${D} ${v}`,k="ltr",F=Vt,U=`translate(${m.left},${m.top})`,t[62]!==w?(j=w.filter(we).map(Ce),t[62]=w,t[63]=j):j=t[63],A=oe.AnimatePresence,P=Nt.map(o=>l.jsxRuntimeExports.jsxs(wt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:K/2,y:Et(0)},whileInView:{x:K/2,y:Et(o.position),opacity:tt?o.color&&n[s.indexOf(o.color)]===tt?.95:J:r.length!==0?r.indexOf(o.label)!==-1?.95:J:dt,transition:{duration:g.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:g.duration}},onMouseEnter:c=>{bt(o),Ct(c.clientY),a(c.clientX),_?.(o)},onClick:()=>{(Y||b)&&(Kt.isEqual(M,o)&&B?(jt(void 0),Y?.(void 0)):(jt(o),Y?.(o)))},onMouseMove:c=>{bt(o),Ct(c.clientY),a(c.clientX)},onMouseLeave:()=>{bt(void 0),a(void 0),Ct(void 0),_?.(void 0)},children:[O==="dot"?l.jsxRuntimeExports.jsx(wt.motion.circle,{cy:0,cx:0,variants:{initial:{fill:h&&r?r.indexOf(o.label)!==-1?h:i.filter(je).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray:i.filter(be).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray},whileInView:{fill:h&&r?r.indexOf(o.label)!==-1?h:i.filter(Oe).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray:i.filter(ve).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray,transition:{duration:g.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:g.duration}},r:d}):l.jsxRuntimeExports.jsx(wt.motion.rect,{y:-1,height:2,variants:{initial:{x:0-d,width:d*2,fill:h&&r?r.indexOf(o.label)!==-1?h:i.filter(ye).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray:i.filter(ge).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray},whileInView:{x:0-d,width:d*2,fill:h&&r?r.indexOf(o.label)!==-1?h:i.filter(he).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray:i.filter(xe).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray,transition:{duration:g.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:g.duration}}}),r.length!==0&&r.indexOf(o.label)!==-1?l.jsxRuntimeExports.jsx(wt.motion.text,{y:0,dy:"0.33em",variants:{initial:{opacity:0,x:0+d+3,fill:x||(h&&r?r.indexOf(o.label)!==-1?h:i.filter(de).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray:i.filter(me).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray)},whileInView:{opacity:1,x:0+d+3,fill:x||(h&&r?r.indexOf(o.label)!==-1?h:i.filter(pe).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray:i.filter(fe).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray),transition:{duration:g.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:g.duration}},style:{textAnchor:"start",...f?.graphObjectValues||{}},className:l.mo("graph-value text-sm font-bold",C?.graphObjectValues),children:Ht.numberFormattingFunction(o.position,"NA",ct,et,at)}):null]},o.label)),L=It.map((o,c)=>l.jsxRuntimeExports.jsx("text",{y:o,x:K/2+d+5,style:{textAnchor:"start",...f?.yAxis?.labels||{}},className:l.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",C?.yAxis?.labels),children:Ht.numberFormattingFunction(Et.invert(o),"NA",ct,et,at)},c)),t[8]=g.duration,t[9]=C?.graphObjectValues,t[10]=C?.yAxis?.labels,t[11]=s,t[12]=n,t[13]=w,t[14]=i,t[15]=b,t[16]=J,t[17]=dt,t[18]=Q,t[19]=K,t[20]=v,t[21]=h,t[22]=r,t[23]=$,t[24]=m.left,t[25]=m.top,t[26]=S,t[27]=N,t[28]=M,t[29]=st,t[30]=Y,t[31]=_,t[32]=ct,t[33]=et,t[34]=d,t[35]=B,t[36]=tt,t[37]=O,t[38]=f?.graphObjectValues,t[39]=f?.yAxis?.labels,t[40]=at,t[41]=x,t[42]=D,t[43]=A,t[44]=V,t[45]=q,t[46]=T,t[47]=R,t[48]=k,t[49]=F,t[50]=P,t[51]=L,t[52]=U,t[53]=j}else A=t[43],V=t[44],q=t[45],T=t[46],R=t[47],k=t[48],F=t[49],P=t[50],L=t[51],U=t[52],j=t[53];let H;t[64]!==A||t[65]!==P||t[66]!==L?(H=l.jsxRuntimeExports.jsxs(A,{children:[P,L]}),t[64]=A,t[65]=P,t[66]=L,t[67]=H):H=t[67];let G;t[68]!==w?(G=w.filter(ue).map(ce),t[68]=w,t[69]=G):G=t[69];let y;t[70]!==H||t[71]!==G||t[72]!==U||t[73]!==j?(y=l.jsxRuntimeExports.jsxs("g",{transform:U,children:[j,H,G]}),t[70]=H,t[71]=G,t[72]=U,t[73]=j,t[74]=y):y=t[74];let W;t[75]!==V||t[76]!==q||t[77]!==T||t[78]!==R||t[79]!==k||t[80]!==F||t[81]!==y?(W=l.jsxRuntimeExports.jsx(V,{width:q,height:T,viewBox:R,direction:k,ref:F,children:y}),t[75]=V,t[76]=q,t[77]=T,t[78]=R,t[79]=k,t[80]=F,t[81]=y,t[82]=W):W=t[82];let z;t[83]!==C?.tooltip||t[84]!==p||t[85]!==ft||t[86]!==ot||t[87]!==f?.tooltip||t[88]!==lt?(z=ot&<&&p&&ft?l.jsxRuntimeExports.jsx(Zt.Tooltip,{data:ot,body:lt,xPos:p,yPos:ft,backgroundStyle:f?.tooltip,className:C?.tooltip}):null,t[83]=C?.tooltip,t[84]=p,t[85]=ft,t[86]=ot,t[87]=f?.tooltip,t[88]=lt,t[89]=z):z=t[89];let I;t[90]!==C?.modal||t[91]!==b||t[92]!==M?(I=b&&M!==void 0?l.jsxRuntimeExports.jsx(_t.DetailsModal,{body:b,data:M,setData:jt,className:C?.modal}):null,t[90]=C?.modal,t[91]=b,t[92]=M,t[93]=I):I=t[93];let it;return t[94]!==W||t[95]!==z||t[96]!==I?(it=l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[W,z,I]}),t[94]=W,t[95]=z,t[96]=I,t[97]=it):it=t[97],it}function ce(e){return e.layer}function ue(e){return e.position==="after"}function fe(e){return e.color}function pe(e){return e.color}function me(e){return e.color}function de(e){return e.color}function xe(e){return e.color}function he(e){return e.color}function ge(e){return e.color}function ye(e){return e.color}function ve(e){return e.color}function Oe(e){return e.color}function be(e){return e.color}function je(e){return e.color}function Ce(e){return e.layer}function we(e){return e.position==="before"}function Me(e){return e.position}function Ee(e){return!mt.checkIfNullOrUndefined(e.position)}function Ve(e){return e.position}function Re(e){return!mt.checkIfNullOrUndefined(e.position)}function ke(e){return e.position}function Ie(e){return!mt.checkIfNullOrUndefined(e.position)}function De(e){return e.position}function Ne(e){return!mt.checkIfNullOrUndefined(e.position)}function Se(e,t){return{...e,id:`${t}`}}function $e(e){const t=l.compilerRuntimeExports.c(98),{data:i,width:D,height:v,colors:n,colorDomain:s,radius:d,leftMargin:E,rightMargin:gt,topMargin:rt,bottomMargin:Mt,tooltip:lt,onSeriesMouseOver:_,highlightedDataPoints:r,selectedColor:tt,minValue:N,maxValue:S,onSeriesMouseClick:Y,prefix:st,suffix:et,stripType:at,highlightColor:O,dotOpacity:h,resetSelectionOnDoubleClick:dt,detailsOnClick:B,styles:b,classNames:f,valueColor:C,animate:x,noOfTicks:g,dimmedOpacity:J,precision:ct,customLayers:w}=e,yt=E===void 0?5:E,xt=gt===void 0?5:gt,vt=rt===void 0?10:rt,Ot=Mt===void 0?10:Mt,Vt=X.useRef(null);let ut;t[0]!==x.amount||t[1]!==x.once?(ut={once:x.once,amount:x.amount},t[0]=x.amount,t[1]=x.once,t[2]=ut):ut=t[2];const $=ee.useInView(Vt,ut),[ot,bt]=X.useState(void 0),[M,jt]=X.useState(void 0),[p,a]=X.useState(void 0),[ft,Ct]=X.useState(void 0);let pt;t[3]!==Ot||t[4]!==yt||t[5]!==xt||t[6]!==vt?(pt={top:vt,bottom:Ot,left:yt,right:xt},t[3]=Ot,t[4]=yt,t[5]=xt,t[6]=vt,t[7]=pt):pt=t[7];const m=pt,K=D-m.left-m.right,Q=v-m.top-m.bottom;let A,V,q,T,R,k,F,P,L,U,j;if(t[8]!==x.duration||t[9]!==f?.graphObjectValues||t[10]!==f?.xAxis?.labels||t[11]!==s||t[12]!==n||t[13]!==w||t[14]!==i||t[15]!==B||t[16]!==J||t[17]!==h||t[18]!==Q||t[19]!==K||t[20]!==v||t[21]!==O||t[22]!==r||t[23]!==$||t[24]!==m.left||t[25]!==m.top||t[26]!==S||t[27]!==N||t[28]!==M||t[29]!==g||t[30]!==Y||t[31]!==_||t[32]!==ct||t[33]!==st||t[34]!==d||t[35]!==dt||t[36]!==tt||t[37]!==at||t[38]!==b?.graphObjectValues||t[39]!==b?.xAxis?.labels||t[40]!==et||t[41]!==C||t[42]!==D){const Dt=i.map(ro);let Z;t[54]!==r?(Z=o=>{const c=(r||[]).indexOf(o.label);return c===-1?1/0:c},t[54]=r,t[55]=Z):Z=t[55];const Nt=Qt.orderBy(Dt,[Z],["desc"]);let nt;t[56]!==i||t[57]!==S?(nt=mt.checkIfNullOrUndefined(S)?Math.max(...i.filter(no).map(io))<0?0:Math.max(...i.filter(oo).map(eo)):S,t[56]=i,t[57]=S,t[58]=nt):nt=t[58];const Rt=nt;let ht;t[59]!==i||t[60]!==N?(ht=mt.checkIfNullOrUndefined(N)?Math.min(...i.filter(to).map(_e))>=0?0:Math.min(...i.filter(Ze).map(Qe)):N,t[59]=i,t[60]=N,t[61]=ht):ht=t[61];const kt=ht,Et=te.linear().domain([kt,Rt]).range([0,K]).nice(),It=ie(g,K);V=wt.motion.svg,q=`${D}px`,T=`${v}px`,R=`0 0 ${D} ${v}`,k="ltr",F=Vt,U=`translate(${m.left},${m.top})`,t[62]!==w?(j=w.filter(Ke).map(Je),t[62]=w,t[63]=j):j=t[63],A=oe.AnimatePresence,P=Nt.map(o=>l.jsxRuntimeExports.jsxs(wt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:Et(0),y:Q/2},whileInView:{x:Et(o.position),y:Q/2,opacity:tt?o.color&&n[s.indexOf(o.color)]===tt?.95:J:r.length!==0?r.indexOf(o.label)!==-1?.95:J:h,transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},onMouseEnter:c=>{bt(o),Ct(c.clientY),a(c.clientX),_?.(o)},onClick:()=>{(Y||B)&&(Kt.isEqual(M,o)&&dt?(jt(void 0),Y?.(void 0)):(jt(o),Y?.(o)))},onMouseMove:c=>{bt(o),Ct(c.clientY),a(c.clientX)},onMouseLeave:()=>{bt(void 0),a(void 0),Ct(void 0),_?.(void 0)},children:[at==="dot"?l.jsxRuntimeExports.jsx(wt.motion.circle,{cy:0,cx:0,variants:{initial:{fill:O&&r?r.indexOf(o.label)!==-1?O:i.filter(ze).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray:i.filter(Be).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray},whileInView:{fill:O&&r?r.indexOf(o.label)!==-1?O:i.filter(Ye).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray:i.filter(Xe).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray,transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},r:d}):l.jsxRuntimeExports.jsx(wt.motion.rect,{x:-1,width:2,variants:{initial:{y:0-d,height:d*2,fill:O&&r?r.indexOf(o.label)!==-1?O:i.filter(We).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray:i.filter(Ge).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray},whileInView:{y:0-d,height:d*2,fill:O&&r?r.indexOf(o.label)!==-1?O:i.filter(He).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray:i.filter(Ue).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray,transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}}}),r.length!==0&&r.indexOf(o.label)!==-1?l.jsxRuntimeExports.jsx(wt.motion.text,{x:0,variants:{initial:{opacity:0,y:0-d-5,fill:C||(O&&r?r.indexOf(o.label)!==-1?O:i.filter(Le).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray:i.filter(Pe).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray)},whileInView:{opacity:1,y:0-d-5,fill:C||(O&&r?r.indexOf(o.label)!==-1?O:i.filter(Fe).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray:i.filter(Te).length===0?n[0]:o.color?n[s.indexOf(o.color)]:u.Colors.gray),transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},style:{textAnchor:"middle",...b?.graphObjectValues||{}},className:l.mo("graph-value text-sm font-bold",f?.graphObjectValues),children:Ht.numberFormattingFunction(o.position,"NA",ct,st,et)}):null]},o.label)),L=It.map((o,c)=>l.jsxRuntimeExports.jsx("text",{x:o,y:Q/2+d,style:{textAnchor:c===0?"start":c===It.length-1?"end":"middle",...b?.xAxis?.labels||{}},className:l.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",f?.xAxis?.labels),dy:"1em",children:Ht.numberFormattingFunction(Et.invert(o),"NA",ct,st,et)},c)),t[8]=x.duration,t[9]=f?.graphObjectValues,t[10]=f?.xAxis?.labels,t[11]=s,t[12]=n,t[13]=w,t[14]=i,t[15]=B,t[16]=J,t[17]=h,t[18]=Q,t[19]=K,t[20]=v,t[21]=O,t[22]=r,t[23]=$,t[24]=m.left,t[25]=m.top,t[26]=S,t[27]=N,t[28]=M,t[29]=g,t[30]=Y,t[31]=_,t[32]=ct,t[33]=st,t[34]=d,t[35]=dt,t[36]=tt,t[37]=at,t[38]=b?.graphObjectValues,t[39]=b?.xAxis?.labels,t[40]=et,t[41]=C,t[42]=D,t[43]=A,t[44]=V,t[45]=q,t[46]=T,t[47]=R,t[48]=k,t[49]=F,t[50]=P,t[51]=L,t[52]=U,t[53]=j}else A=t[43],V=t[44],q=t[45],T=t[46],R=t[47],k=t[48],F=t[49],P=t[50],L=t[51],U=t[52],j=t[53];let H;t[64]!==A||t[65]!==P||t[66]!==L?(H=l.jsxRuntimeExports.jsxs(A,{children:[P,L]}),t[64]=A,t[65]=P,t[66]=L,t[67]=H):H=t[67];let G;t[68]!==w?(G=w.filter(qe).map(Ae),t[68]=w,t[69]=G):G=t[69];let y;t[70]!==H||t[71]!==G||t[72]!==U||t[73]!==j?(y=l.jsxRuntimeExports.jsxs("g",{transform:U,children:[j,H,G]}),t[70]=H,t[71]=G,t[72]=U,t[73]=j,t[74]=y):y=t[74];let W;t[75]!==V||t[76]!==q||t[77]!==T||t[78]!==R||t[79]!==k||t[80]!==F||t[81]!==y?(W=l.jsxRuntimeExports.jsx(V,{width:q,height:T,viewBox:R,direction:k,ref:F,children:y}),t[75]=V,t[76]=q,t[77]=T,t[78]=R,t[79]=k,t[80]=F,t[81]=y,t[82]=W):W=t[82];let z;t[83]!==f?.tooltip||t[84]!==p||t[85]!==ft||t[86]!==ot||t[87]!==b?.tooltip||t[88]!==lt?(z=ot&<&&p&&ft?l.jsxRuntimeExports.jsx(Zt.Tooltip,{data:ot,body:lt,xPos:p,yPos:ft,backgroundStyle:b?.tooltip,className:f?.tooltip}):null,t[83]=f?.tooltip,t[84]=p,t[85]=ft,t[86]=ot,t[87]=b?.tooltip,t[88]=lt,t[89]=z):z=t[89];let I;t[90]!==f?.modal||t[91]!==B||t[92]!==M?(I=B&&M!==void 0?l.jsxRuntimeExports.jsx(_t.DetailsModal,{body:B,data:M,setData:jt,className:f?.modal}):null,t[90]=f?.modal,t[91]=B,t[92]=M,t[93]=I):I=t[93];let it;return t[94]!==W||t[95]!==z||t[96]!==I?(it=l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[W,z,I]}),t[94]=W,t[95]=z,t[96]=I,t[97]=it):it=t[97],it}function Ae(e){return e.layer}function qe(e){return e.position==="after"}function Te(e){return e.color}function Fe(e){return e.color}function Pe(e){return e.color}function Le(e){return e.color}function Ue(e){return e.color}function He(e){return e.color}function Ge(e){return e.color}function We(e){return e.color}function Xe(e){return e.color}function Ye(e){return e.color}function Be(e){return e.color}function ze(e){return e.color}function Je(e){return e.layer}function Ke(e){return e.position==="before"}function Qe(e){return e.position}function Ze(e){return!mt.checkIfNullOrUndefined(e.position)}function _e(e){return e.position}function to(e){return!mt.checkIfNullOrUndefined(e.position)}function eo(e){return e.position}function oo(e){return!mt.checkIfNullOrUndefined(e.position)}function io(e){return e.position}function no(e){return!mt.checkIfNullOrUndefined(e.position)}function ro(e,t){return{...e,id:`${t}`}}function lo(e){const t=l.compilerRuntimeExports.c(92),{data:i,graphTitle:D,colors:v,sources:n,graphDescription:s,height:d,width:E,footNote:gt,colorDomain:rt,colorLegendTitle:Mt,radius:lt,padding:_,backgroundColor:r,leftMargin:tt,rightMargin:N,topMargin:S,bottomMargin:Y,tooltip:st,relativeHeight:et,onSeriesMouseOver:at,showColorScale:O,highlightedDataPoints:h,graphID:dt,minValue:B,maxValue:b,onSeriesMouseClick:f,noOfTicks:C,graphDownload:x,dataDownload:g,prefix:J,suffix:ct,stripType:w,language:yt,highlightColor:xt,dotOpacity:vt,showNAColor:Ot,minHeight:Vt,theme:ut,ariaLabel:$,valueColor:ot,resetSelectionOnDoubleClick:bt,detailsOnClick:M,orientation:jt,styles:p,classNames:a,animate:ft,dimmedOpacity:Ct,precision:pt,customLayers:m}=e,K=lt===void 0?5:lt,Q=r===void 0?!1:r,A=O===void 0?!0:O;let V;t[0]!==h?(V=h===void 0?[]:h,t[0]=h,t[1]=V):V=t[1];const q=V,T=C===void 0?2:C,R=x===void 0?!1:x,k=g===void 0?!1:g,F=J===void 0?"":J,P=ct===void 0?"":ct,L=w===void 0?"dot":w,U=yt===void 0?"en":yt,j=vt===void 0?.3:vt,H=Ot===void 0?!0:Ot,G=Vt===void 0?0:Vt,y=ut===void 0?"light":ut,W=bt===void 0?!0:bt,z=jt===void 0?"vertical":jt,I=ft===void 0?!1:ft,it=Ct===void 0?.3:Ct,Dt=pt===void 0?2:pt;let Z;t[2]!==m?(Z=m===void 0?[]:m,t[2]=m,t[3]=Z):Z=t[3];const Nt=Z,nt=z==="horizontal"?$e:ae,[Rt,ht]=X.useState(0),[kt,Et]=X.useState(0),[It,o]=X.useState(void 0),c=X.useRef(null),Xt=X.useRef(null);let Pt,Lt;t[4]===Symbol.for("react.memo_cache_sentinel")?(Pt=()=>{const Yt=new ResizeObserver(Bt=>{ht(Bt[0].target.clientWidth||620),Et(Bt[0].target.clientHeight||480)});return c.current&&Yt.observe(c.current),()=>Yt.disconnect()},Lt=[],t[4]=Pt,t[5]=Lt):(Pt=t[4],Lt=t[5]),X.useEffect(Pt,Lt);const Gt=a?.graphContainer,Wt=p?.graphContainer;let St;t[6]!==a?.description||t[7]!==a?.title||t[8]!==i||t[9]!==k||t[10]!==s||t[11]!==R||t[12]!==D||t[13]!==p?.description||t[14]!==p?.title||t[15]!==E?(St=D||s||R||k?l.jsxRuntimeExports.jsx(se.GraphHeader,{styles:{title:p?.title,description:p?.description},classNames:{title:a?.title,description:a?.description},graphTitle:D,graphDescription:s,width:E,graphDownload:R?Xt:void 0,dataDownload:k?i.map(xo).filter(mo).length>0?i.map(po).filter(fo):i.filter(uo):null}):null,t[6]=a?.description,t[7]=a?.title,t[8]=i,t[9]=k,t[10]=s,t[11]=R,t[12]=D,t[13]=p?.description,t[14]=p?.title,t[15]=E,t[16]=St):St=t[16];let $t;t[17]!==a?.colorLegend||t[18]!==rt||t[19]!==Mt||t[20]!==v||t[21]!==i||t[22]!==A||t[23]!==H||t[24]!==y||t[25]!==E?($t=A!==!1&&i.filter(co).length!==0&&i.length>0?l.jsxRuntimeExports.jsx(re.ColorLegendWithMouseOver,{width:E,colorLegendTitle:Mt,colors:v||u.Colors[y].categoricalColors.colors,colorDomain:rt||zt.uniqBy(i,"color",!0),setSelectedColor:o,showNAColor:H,className:a?.colorLegend}):null,t[17]=a?.colorLegend,t[18]=rt,t[19]=Mt,t[20]=v,t[21]=i,t[22]=A,t[23]=H,t[24]=y,t[25]=E,t[26]=$t):$t=t[26];let At;t[27]!==i.length?(At=i.length===0&&l.jsxRuntimeExports.jsx(ne.EmptyState,{}),t[27]=i.length,t[28]=At):At=t[28];let qt;t[29]!==nt||t[30]!==I||t[31]!==Y||t[32]!==a||t[33]!==rt||t[34]!==v||t[35]!==Nt||t[36]!==i||t[37]!==M||t[38]!==it||t[39]!==j||t[40]!==xt||t[41]!==q||t[42]!==tt||t[43]!==b||t[44]!==B||t[45]!==T||t[46]!==f||t[47]!==at||t[48]!==Dt||t[49]!==F||t[50]!==K||t[51]!==W||t[52]!==N||t[53]!==It||t[54]!==L||t[55]!==p||t[56]!==P||t[57]!==kt||t[58]!==Rt||t[59]!==y||t[60]!==st||t[61]!==S||t[62]!==ot?(qt=Rt&&kt&&i.length>0?l.jsxRuntimeExports.jsx(nt,{data:i,width:Rt,height:kt,colorDomain:i.filter(ao).length===0?[]:rt||zt.uniqBy(i,"color",!0),colors:i.filter(so).length===0?v?[v]:[u.Colors.primaryColors["blue-600"]]:v||u.Colors[y].categoricalColors.colors,selectedColor:It,radius:K,leftMargin:tt,rightMargin:N,topMargin:S,bottomMargin:Y,tooltip:st,onSeriesMouseOver:at,highlightedDataPoints:q,minValue:B,maxValue:b,onSeriesMouseClick:f,prefix:F,suffix:P,stripType:L,highlightColor:xt,dotOpacity:j,resetSelectionOnDoubleClick:W,detailsOnClick:M,styles:p,classNames:a,valueColor:ot,animate:I===!0?{duration:.5,once:!0,amount:.5}:I||{duration:0,once:!0,amount:0},noOfTicks:T,dimmedOpacity:it,precision:Dt,customLayers:Nt}):null,t[29]=nt,t[30]=I,t[31]=Y,t[32]=a,t[33]=rt,t[34]=v,t[35]=Nt,t[36]=i,t[37]=M,t[38]=it,t[39]=j,t[40]=xt,t[41]=q,t[42]=tt,t[43]=b,t[44]=B,t[45]=T,t[46]=f,t[47]=at,t[48]=Dt,t[49]=F,t[50]=K,t[51]=W,t[52]=N,t[53]=It,t[54]=L,t[55]=p,t[56]=P,t[57]=kt,t[58]=Rt,t[59]=y,t[60]=st,t[61]=S,t[62]=ot,t[63]=qt):qt=t[63];let Tt;t[64]!==At||t[65]!==qt?(Tt=l.jsxRuntimeExports.jsxs(Jt.GraphArea,{ref:c,children:[At,qt]}),t[64]=At,t[65]=qt,t[66]=Tt):Tt=t[66];let Ft;t[67]!==a?.footnote||t[68]!==a?.source||t[69]!==gt||t[70]!==n||t[71]!==p?.footnote||t[72]!==p?.source||t[73]!==E?(Ft=n||gt?l.jsxRuntimeExports.jsx(le.GraphFooter,{styles:{footnote:p?.footnote,source:p?.source},classNames:{footnote:a?.footnote,source:a?.source},sources:n,footNote:gt,width:E}):null,t[67]=a?.footnote,t[68]=a?.source,t[69]=gt,t[70]=n,t[71]=p?.footnote,t[72]=p?.source,t[73]=E,t[74]=Ft):Ft=t[74];let Ut;return t[75]!==$||t[76]!==Q||t[77]!==dt||t[78]!==d||t[79]!==U||t[80]!==G||t[81]!==_||t[82]!==et||t[83]!==Gt||t[84]!==Wt||t[85]!==St||t[86]!==$t||t[87]!==Tt||t[88]!==Ft||t[89]!==y||t[90]!==E?(Ut=l.jsxRuntimeExports.jsxs(Jt.GraphContainer,{className:Gt,style:Wt,id:dt,ref:Xt,"aria-label":$,backgroundColor:Q,theme:y,language:U,minHeight:G,width:E,height:d,relativeHeight:et,padding:_,children:[St,$t,Tt,Ft]}),t[75]=$,t[76]=Q,t[77]=dt,t[78]=d,t[79]=U,t[80]=G,t[81]=_,t[82]=et,t[83]=Gt,t[84]=Wt,t[85]=St,t[86]=$t,t[87]=Tt,t[88]=Ft,t[89]=y,t[90]=E,t[91]=Ut):Ut=t[91],Ut}function so(e){return e.color}function ao(e){return e.color}function co(e){return e.color}function uo(e){return e!==void 0}function fo(e){return e!==void 0}function po(e){return e.data}function mo(e){return e!==void 0}function xo(e){return e.data}exports.StripChart=lo;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-6v2a2njQ.cjs"),z=require("react"),Zt=require("./index-DQA8q5sC.cjs"),_t=require("./index-Cno4Q0YE.cjs"),te=require("./Tooltip-BLa2EfMs.cjs"),gt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ut=require("./numberFormattingFunction-02t-wJta.cjs"),s=require("./Colors.cjs"),ee=require("./DetailsModal-DIRTulvr.cjs"),ie=require("./linear-CgUCbw9F.cjs"),it=require("./proxy-C4-uo6nS.cjs"),oe=require("./use-in-view-C3o_ntMv.cjs"),ne=require("./index-CoobIWNj.cjs"),Kt=require("./uniqBy-O05lp2S5.cjs"),Qt=require("./GraphContainer-B1EDxJ0S.cjs"),le=require("./EmptyState-B4c-CrXs.cjs"),ae=require("./ColorLegendWithMouseOver.cjs"),se=require("./GraphFooter.cjs"),ce=require("./GraphHeader.cjs");function re(e,t){if(e<2)return[];const o=t/(e-1);return Array.from({length:e},(k,b)=>b*o)}function ue(e){const t=a.compilerRuntimeExports.c(101),{data:o,width:k,height:b,colors:n,colorDomain:l,radius:f,leftMargin:V,rightMargin:jt,topMargin:mt,bottomMargin:Rt,tooltip:xt,onSeriesMouseOver:ot,highlightedDataPoints:r,selectedColor:nt,minValue:S,maxValue:A,onSeriesMouseClick:J,noOfTicks:rt,prefix:K,suffix:lt,stripType:d,highlightColor:x,dotOpacity:yt,resetSelectionOnDoubleClick:Q,detailsOnClick:j,styles:m,classNames:v,valueColor:u,animate:h,dimmedOpacity:_,precision:tt,customLayers:M,showDataMinMax:wt}=e,vt=V===void 0?20:V,Ct=jt===void 0?20:jt,Mt=mt===void 0?10:mt,Vt=Rt===void 0?10:Rt,Dt=z.useRef(null);let at;t[0]!==h.amount||t[1]!==h.once?(at={once:h.once,amount:h.amount},t[0]=h.amount,t[1]=h.once,t[2]=at):at=t[2];const w=oe.useInView(Dt,at),[ht,Ot]=z.useState(void 0),[E,g]=z.useState(void 0),[p,Et]=z.useState(void 0),[dt,It]=z.useState(void 0);let et;t[3]!==Vt||t[4]!==vt||t[5]!==Ct||t[6]!==Mt?(et={top:Mt,bottom:Vt,left:vt,right:Ct},t[3]=Vt,t[4]=vt,t[5]=Ct,t[6]=Mt,t[7]=et):et=t[7];const y=et,Y=k-y.left-y.right,B=b-y.top-y.bottom;let $,I,C,q,R,D,T,F,P,L,U,H;if(t[8]!==h.duration||t[9]!==v?.graphObjectValues||t[10]!==v?.yAxis?.labels||t[11]!==l||t[12]!==n||t[13]!==M||t[14]!==o||t[15]!==j||t[16]!==_||t[17]!==yt||t[18]!==B||t[19]!==Y||t[20]!==b||t[21]!==x||t[22]!==r||t[23]!==w||t[24]!==y.left||t[25]!==y.top||t[26]!==A||t[27]!==S||t[28]!==E||t[29]!==rt||t[30]!==J||t[31]!==ot||t[32]!==tt||t[33]!==K||t[34]!==f||t[35]!==Q||t[36]!==nt||t[37]!==wt||t[38]!==d||t[39]!==m?.graphObjectValues||t[40]!==m?.yAxis?.labels||t[41]!==lt||t[42]!==u||t[43]!==k){const Nt=o.map(Pe);let ct;t[56]!==r?(ct=i=>{const c=(r||[]).indexOf(i.label);return c===-1?1/0:c},t[56]=r,t[57]=ct):ct=t[57];const ut=_t.orderBy(Nt,[ct],["desc"]);let ft;t[58]!==o||t[59]!==A?(ft=gt.checkIfNullOrUndefined(A)?Math.max(...o.filter(Fe).map(Te))<0?0:Math.max(...o.filter(qe).map($e)):A,t[58]=o,t[59]=A,t[60]=ft):ft=t[60];const kt=ft;let bt;t[61]!==o||t[62]!==S?(bt=gt.checkIfNullOrUndefined(S)?Math.min(...o.filter(Ae).map(Se))>=0?0:Math.min(...o.filter(ke).map(Ne)):S,t[61]=o,t[62]=S,t[63]=bt):bt=t[63];const St=bt,pt=ie.linear().domain([St,kt]).range([B,0]).nice(),At=re(rt,B);I=it.motion.svg,q=`${k}px`,R=`${b}px`,D=`0 0 ${k} ${b}`,T="ltr",F=Dt,H=`translate(${y.left},${y.top})`,t[64]!==M?(C=M.filter(De).map(Re),t[64]=M,t[65]=C):C=t[65],$=ne.AnimatePresence,P=ut.map(i=>a.jsxRuntimeExports.jsxs(it.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:Y/2,y:pt(0)},whileInView:{x:Y/2,y:pt(i.position),opacity:nt?i.color&&n[l.indexOf(i.color)]===nt?.95:_:r.length!==0?r.indexOf(i.label)!==-1?.95:_:yt,transition:{duration:h.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:h.duration}},onMouseEnter:c=>{Ot(i),It(c.clientY),Et(c.clientX),ot?.(i)},onClick:()=>{(J||j)&&(Zt.isEqual(E,i)&&Q?(g(void 0),J?.(void 0)):(g(i),J?.(i)))},onMouseMove:c=>{Ot(i),It(c.clientY),Et(c.clientX)},onMouseLeave:()=>{Ot(void 0),Et(void 0),It(void 0),ot?.(void 0)},children:[d==="dot"?a.jsxRuntimeExports.jsx(it.motion.circle,{cy:0,cx:0,variants:{initial:{fill:x&&r?r.indexOf(i.label)!==-1?x:o.filter(Ie).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(Ee).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray},whileInView:{fill:x&&r?r.indexOf(i.label)!==-1?x:o.filter(Ve).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(Me).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray,transition:{duration:h.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:h.duration}},r:f}):a.jsxRuntimeExports.jsx(it.motion.rect,{y:-1,height:2,variants:{initial:{x:0-f,width:f*2,fill:x&&r?r.indexOf(i.label)!==-1?x:o.filter(Ce).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(we).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray},whileInView:{x:0-f,width:f*2,fill:x&&r?r.indexOf(i.label)!==-1?x:o.filter(je).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(be).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray,transition:{duration:h.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:h.duration}}}),r.length!==0&&r.indexOf(i.label)!==-1?a.jsxRuntimeExports.jsx(it.motion.text,{y:0,dy:"0.33em",variants:{initial:{opacity:0,x:0+f+3,fill:u||(x&&r?r.indexOf(i.label)!==-1?x:o.filter(Oe).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(ve).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray)},whileInView:{opacity:1,x:0+f+3,fill:u||(x&&r?r.indexOf(i.label)!==-1?x:o.filter(ye).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(ge).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray),transition:{duration:h.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:h.duration}},style:{textAnchor:"start",...m?.graphObjectValues||{}},className:a.mo("graph-value text-sm font-bold",v?.graphObjectValues),children:Ut.numberFormattingFunction(i.position,"NA",tt,K,lt)}):null]},i.label)),L=wt?[ut[0],ut[ut.length-1]].map((i,c)=>a.jsxRuntimeExports.jsx(it.motion.g,{variants:{initial:{opacity:0,x:Y/2,y:pt(0)},whileInView:{x:Y/2,y:pt(i.position),opacity:1,transition:{duration:h.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:h.duration}},children:a.jsxRuntimeExports.jsx(it.motion.text,{y:0,dy:"0.33em",variants:{initial:{opacity:0,x:0+f+3,fill:u||(x&&r?r.indexOf(i.label)!==-1?x:o.filter(de).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(he).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray)},whileInView:{opacity:1,x:0+f+3,fill:u||(x&&r?r.indexOf(i.label)!==-1?x:o.filter(xe).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(me).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray),transition:{duration:h.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:h.duration}},style:{textAnchor:"start",...m?.graphObjectValues||{}},className:a.mo("graph-value text-sm",v?.graphObjectValues),children:Ut.numberFormattingFunction(i.position,"NA",tt,K,lt)},c)},c)):null,U=At.map((i,c)=>a.jsxRuntimeExports.jsx("text",{y:i,x:Y/2+f+5,style:{textAnchor:"start",...m?.yAxis?.labels||{}},className:a.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",v?.yAxis?.labels),children:Ut.numberFormattingFunction(pt.invert(i),"NA",tt,K,lt)},c)),t[8]=h.duration,t[9]=v?.graphObjectValues,t[10]=v?.yAxis?.labels,t[11]=l,t[12]=n,t[13]=M,t[14]=o,t[15]=j,t[16]=_,t[17]=yt,t[18]=B,t[19]=Y,t[20]=b,t[21]=x,t[22]=r,t[23]=w,t[24]=y.left,t[25]=y.top,t[26]=A,t[27]=S,t[28]=E,t[29]=rt,t[30]=J,t[31]=ot,t[32]=tt,t[33]=K,t[34]=f,t[35]=Q,t[36]=nt,t[37]=wt,t[38]=d,t[39]=m?.graphObjectValues,t[40]=m?.yAxis?.labels,t[41]=lt,t[42]=u,t[43]=k,t[44]=$,t[45]=I,t[46]=C,t[47]=q,t[48]=R,t[49]=D,t[50]=T,t[51]=F,t[52]=P,t[53]=L,t[54]=U,t[55]=H}else $=t[44],I=t[45],C=t[46],q=t[47],R=t[48],D=t[49],T=t[50],F=t[51],P=t[52],L=t[53],U=t[54],H=t[55];let G;t[66]!==$||t[67]!==P||t[68]!==L||t[69]!==U?(G=a.jsxRuntimeExports.jsxs($,{children:[P,L,U]}),t[66]=$,t[67]=P,t[68]=L,t[69]=U,t[70]=G):G=t[70];let O;t[71]!==M?(O=M.filter(pe).map(fe),t[71]=M,t[72]=O):O=t[72];let W;t[73]!==C||t[74]!==G||t[75]!==O||t[76]!==H?(W=a.jsxRuntimeExports.jsxs("g",{transform:H,children:[C,G,O]}),t[73]=C,t[74]=G,t[75]=O,t[76]=H,t[77]=W):W=t[77];let Z;t[78]!==I||t[79]!==q||t[80]!==R||t[81]!==D||t[82]!==T||t[83]!==F||t[84]!==W?(Z=a.jsxRuntimeExports.jsx(I,{width:q,height:R,viewBox:D,direction:T,ref:F,children:W}),t[78]=I,t[79]=q,t[80]=R,t[81]=D,t[82]=T,t[83]=F,t[84]=W,t[85]=Z):Z=t[85];let N;t[86]!==v?.tooltip||t[87]!==p||t[88]!==dt||t[89]!==ht||t[90]!==m?.tooltip||t[91]!==xt?(N=ht&&xt&&p&&dt?a.jsxRuntimeExports.jsx(te.Tooltip,{data:ht,body:xt,xPos:p,yPos:dt,backgroundStyle:m?.tooltip,className:v?.tooltip}):null,t[86]=v?.tooltip,t[87]=p,t[88]=dt,t[89]=ht,t[90]=m?.tooltip,t[91]=xt,t[92]=N):N=t[92];let X;t[93]!==v?.modal||t[94]!==j||t[95]!==E?(X=j&&E!==void 0?a.jsxRuntimeExports.jsx(ee.DetailsModal,{body:j,data:E,setData:g,className:v?.modal}):null,t[93]=v?.modal,t[94]=j,t[95]=E,t[96]=X):X=t[96];let st;return t[97]!==Z||t[98]!==N||t[99]!==X?(st=a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[Z,N,X]}),t[97]=Z,t[98]=N,t[99]=X,t[100]=st):st=t[100],st}function fe(e){return e.layer}function pe(e){return e.position==="after"}function me(e){return e.color}function xe(e){return e.color}function he(e){return e.color}function de(e){return e.color}function ge(e){return e.color}function ye(e){return e.color}function ve(e){return e.color}function Oe(e){return e.color}function be(e){return e.color}function je(e){return e.color}function we(e){return e.color}function Ce(e){return e.color}function Me(e){return e.color}function Ve(e){return e.color}function Ee(e){return e.color}function Ie(e){return e.color}function Re(e){return e.layer}function De(e){return e.position==="before"}function Ne(e){return e.position}function ke(e){return!gt.checkIfNullOrUndefined(e.position)}function Se(e){return e.position}function Ae(e){return!gt.checkIfNullOrUndefined(e.position)}function $e(e){return e.position}function qe(e){return!gt.checkIfNullOrUndefined(e.position)}function Te(e){return e.position}function Fe(e){return!gt.checkIfNullOrUndefined(e.position)}function Pe(e,t){return{...e,id:`${t}`}}function Le(e){const t=a.compilerRuntimeExports.c(101),{data:o,width:k,height:b,colors:n,colorDomain:l,radius:f,leftMargin:V,rightMargin:jt,topMargin:mt,bottomMargin:Rt,tooltip:xt,onSeriesMouseOver:ot,highlightedDataPoints:r,selectedColor:nt,minValue:S,maxValue:A,onSeriesMouseClick:J,prefix:rt,suffix:K,stripType:lt,highlightColor:d,dotOpacity:x,resetSelectionOnDoubleClick:yt,detailsOnClick:Q,styles:j,classNames:m,valueColor:v,animate:u,noOfTicks:h,dimmedOpacity:_,precision:tt,customLayers:M,showDataMinMax:wt}=e,vt=V===void 0?5:V,Ct=jt===void 0?5:jt,Mt=mt===void 0?10:mt,Vt=Rt===void 0?10:Rt,Dt=z.useRef(null);let at;t[0]!==u.amount||t[1]!==u.once?(at={once:u.once,amount:u.amount},t[0]=u.amount,t[1]=u.once,t[2]=at):at=t[2];const w=oe.useInView(Dt,at),[ht,Ot]=z.useState(void 0),[E,g]=z.useState(void 0),[p,Et]=z.useState(void 0),[dt,It]=z.useState(void 0);let et;t[3]!==Vt||t[4]!==vt||t[5]!==Ct||t[6]!==Mt?(et={top:Mt,bottom:Vt,left:vt,right:Ct},t[3]=Vt,t[4]=vt,t[5]=Ct,t[6]=Mt,t[7]=et):et=t[7];const y=et,Y=k-y.left-y.right,B=b-y.top-y.bottom;let $,I,C,q,R,D,T,F,P,L,U,H;if(t[8]!==u.duration||t[9]!==m?.graphObjectValues||t[10]!==m?.xAxis?.labels||t[11]!==l||t[12]!==n||t[13]!==M||t[14]!==o||t[15]!==Q||t[16]!==_||t[17]!==x||t[18]!==B||t[19]!==Y||t[20]!==b||t[21]!==d||t[22]!==r||t[23]!==w||t[24]!==y.left||t[25]!==y.top||t[26]!==A||t[27]!==S||t[28]!==E||t[29]!==h||t[30]!==J||t[31]!==ot||t[32]!==tt||t[33]!==rt||t[34]!==f||t[35]!==yt||t[36]!==nt||t[37]!==wt||t[38]!==lt||t[39]!==j?.graphObjectValues||t[40]!==j?.xAxis?.labels||t[41]!==K||t[42]!==v||t[43]!==k){const Nt=o.map(hi);let ct;t[56]!==r?(ct=i=>{const c=(r||[]).indexOf(i.label);return c===-1?1/0:c},t[56]=r,t[57]=ct):ct=t[57];const ut=_t.orderBy(Nt,[ct],["desc"]);let ft;t[58]!==o||t[59]!==A?(ft=gt.checkIfNullOrUndefined(A)?Math.max(...o.filter(xi).map(mi))<0?0:Math.max(...o.filter(pi).map(fi)):A,t[58]=o,t[59]=A,t[60]=ft):ft=t[60];const kt=ft;let bt;t[61]!==o||t[62]!==S?(bt=gt.checkIfNullOrUndefined(S)?Math.min(...o.filter(ui).map(ci))>=0?0:Math.min(...o.filter(si).map(ai)):S,t[61]=o,t[62]=S,t[63]=bt):bt=t[63];const St=bt,pt=ie.linear().domain([St,kt]).range([0,Y]).nice(),At=re(h,Y);I=it.motion.svg,q=`${k}px`,R=`${b}px`,D=`0 0 ${k} ${b}`,T="ltr",F=Dt,H=`translate(${y.left},${y.top})`,t[64]!==M?(C=M.filter(li).map(ri),t[64]=M,t[65]=C):C=t[65],$=ne.AnimatePresence,P=ut.map(i=>a.jsxRuntimeExports.jsxs(it.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:pt(0),y:B/2},whileInView:{x:pt(i.position),y:B/2,opacity:nt?i.color&&n[l.indexOf(i.color)]===nt?.95:_:r.length!==0?r.indexOf(i.label)!==-1?.95:_:x,transition:{duration:u.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},onMouseEnter:c=>{Ot(i),It(c.clientY),Et(c.clientX),ot?.(i)},onClick:()=>{(J||Q)&&(Zt.isEqual(E,i)&&yt?(g(void 0),J?.(void 0)):(g(i),J?.(i)))},onMouseMove:c=>{Ot(i),It(c.clientY),Et(c.clientX)},onMouseLeave:()=>{Ot(void 0),Et(void 0),It(void 0),ot?.(void 0)},children:[lt==="dot"?a.jsxRuntimeExports.jsx(it.motion.circle,{cy:0,cx:0,variants:{initial:{fill:d&&r?r.indexOf(i.label)!==-1?d:o.filter(ni).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(oi).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray},whileInView:{fill:d&&r?r.indexOf(i.label)!==-1?d:o.filter(ii).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(ei).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray,transition:{duration:u.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},r:f}):a.jsxRuntimeExports.jsx(it.motion.rect,{x:-1,width:2,variants:{initial:{y:0-f,height:f*2,fill:d&&r?r.indexOf(i.label)!==-1?d:o.filter(ti).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(_e).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray},whileInView:{y:0-f,height:f*2,fill:d&&r?r.indexOf(i.label)!==-1?d:o.filter(Ze).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(Qe).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray,transition:{duration:u.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}}}),r.length!==0&&r.indexOf(i.label)!==-1?a.jsxRuntimeExports.jsx(it.motion.text,{x:0,variants:{initial:{opacity:0,y:0-f-5,fill:v||(d&&r?r.indexOf(i.label)!==-1?d:o.filter(Ke).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(Je).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray)},whileInView:{opacity:1,y:0-f-5,fill:v||(d&&r?r.indexOf(i.label)!==-1?d:o.filter(ze).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(Be).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray),transition:{duration:u.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},style:{textAnchor:"middle",...j?.graphObjectValues||{}},className:a.mo("graph-value text-sm font-bold",m?.graphObjectValues),children:Ut.numberFormattingFunction(i.position,"NA",tt,rt,K)}):null]},i.label)),L=wt?[ut[0],ut[ut.length-1]].map((i,c)=>a.jsxRuntimeExports.jsx(it.motion.g,{variants:{initial:{opacity:0,x:pt(0),y:B/2},whileInView:{x:pt(i.position),y:B/2,opacity:1,transition:{duration:u.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},children:a.jsxRuntimeExports.jsx(it.motion.text,{x:0,variants:{initial:{opacity:0,y:0-f-5,fill:v||(d&&r?r.indexOf(i.label)!==-1?d:o.filter(Ye).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(Xe).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray)},whileInView:{opacity:1,y:0-f-5,fill:v||(d&&r?r.indexOf(i.label)!==-1?d:o.filter(We).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray:o.filter(Ge).length===0?n[0]:i.color?n[l.indexOf(i.color)]:s.Colors.gray),transition:{duration:u.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},style:{textAnchor:"middle",...j?.graphObjectValues||{}},className:a.mo("graph-value text-sm",m?.graphObjectValues),children:Ut.numberFormattingFunction(i.position,"NA",tt,rt,K)})},c)):null,U=At.map((i,c)=>a.jsxRuntimeExports.jsx("text",{x:i,y:B/2+f,style:{textAnchor:c===0?"start":c===At.length-1?"end":"middle",...j?.xAxis?.labels||{}},className:a.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",m?.xAxis?.labels),dy:"1em",children:Ut.numberFormattingFunction(pt.invert(i),"NA",tt,rt,K)},c)),t[8]=u.duration,t[9]=m?.graphObjectValues,t[10]=m?.xAxis?.labels,t[11]=l,t[12]=n,t[13]=M,t[14]=o,t[15]=Q,t[16]=_,t[17]=x,t[18]=B,t[19]=Y,t[20]=b,t[21]=d,t[22]=r,t[23]=w,t[24]=y.left,t[25]=y.top,t[26]=A,t[27]=S,t[28]=E,t[29]=h,t[30]=J,t[31]=ot,t[32]=tt,t[33]=rt,t[34]=f,t[35]=yt,t[36]=nt,t[37]=wt,t[38]=lt,t[39]=j?.graphObjectValues,t[40]=j?.xAxis?.labels,t[41]=K,t[42]=v,t[43]=k,t[44]=$,t[45]=I,t[46]=C,t[47]=q,t[48]=R,t[49]=D,t[50]=T,t[51]=F,t[52]=P,t[53]=L,t[54]=U,t[55]=H}else $=t[44],I=t[45],C=t[46],q=t[47],R=t[48],D=t[49],T=t[50],F=t[51],P=t[52],L=t[53],U=t[54],H=t[55];let G;t[66]!==$||t[67]!==P||t[68]!==L||t[69]!==U?(G=a.jsxRuntimeExports.jsxs($,{children:[P,L,U]}),t[66]=$,t[67]=P,t[68]=L,t[69]=U,t[70]=G):G=t[70];let O;t[71]!==M?(O=M.filter(He).map(Ue),t[71]=M,t[72]=O):O=t[72];let W;t[73]!==C||t[74]!==G||t[75]!==O||t[76]!==H?(W=a.jsxRuntimeExports.jsxs("g",{transform:H,children:[C,G,O]}),t[73]=C,t[74]=G,t[75]=O,t[76]=H,t[77]=W):W=t[77];let Z;t[78]!==I||t[79]!==q||t[80]!==R||t[81]!==D||t[82]!==T||t[83]!==F||t[84]!==W?(Z=a.jsxRuntimeExports.jsx(I,{width:q,height:R,viewBox:D,direction:T,ref:F,children:W}),t[78]=I,t[79]=q,t[80]=R,t[81]=D,t[82]=T,t[83]=F,t[84]=W,t[85]=Z):Z=t[85];let N;t[86]!==m?.tooltip||t[87]!==p||t[88]!==dt||t[89]!==ht||t[90]!==j?.tooltip||t[91]!==xt?(N=ht&&xt&&p&&dt?a.jsxRuntimeExports.jsx(te.Tooltip,{data:ht,body:xt,xPos:p,yPos:dt,backgroundStyle:j?.tooltip,className:m?.tooltip}):null,t[86]=m?.tooltip,t[87]=p,t[88]=dt,t[89]=ht,t[90]=j?.tooltip,t[91]=xt,t[92]=N):N=t[92];let X;t[93]!==m?.modal||t[94]!==Q||t[95]!==E?(X=Q&&E!==void 0?a.jsxRuntimeExports.jsx(ee.DetailsModal,{body:Q,data:E,setData:g,className:m?.modal}):null,t[93]=m?.modal,t[94]=Q,t[95]=E,t[96]=X):X=t[96];let st;return t[97]!==Z||t[98]!==N||t[99]!==X?(st=a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[Z,N,X]}),t[97]=Z,t[98]=N,t[99]=X,t[100]=st):st=t[100],st}function Ue(e){return e.layer}function He(e){return e.position==="after"}function Ge(e){return e.color}function We(e){return e.color}function Xe(e){return e.color}function Ye(e){return e.color}function Be(e){return e.color}function ze(e){return e.color}function Je(e){return e.color}function Ke(e){return e.color}function Qe(e){return e.color}function Ze(e){return e.color}function _e(e){return e.color}function ti(e){return e.color}function ei(e){return e.color}function ii(e){return e.color}function oi(e){return e.color}function ni(e){return e.color}function ri(e){return e.layer}function li(e){return e.position==="before"}function ai(e){return e.position}function si(e){return!gt.checkIfNullOrUndefined(e.position)}function ci(e){return e.position}function ui(e){return!gt.checkIfNullOrUndefined(e.position)}function fi(e){return e.position}function pi(e){return!gt.checkIfNullOrUndefined(e.position)}function mi(e){return e.position}function xi(e){return!gt.checkIfNullOrUndefined(e.position)}function hi(e,t){return{...e,id:`${t}`}}function di(e){const t=a.compilerRuntimeExports.c(93),{data:o,graphTitle:k,colors:b,sources:n,graphDescription:l,height:f,width:V,footNote:jt,colorDomain:mt,colorLegendTitle:Rt,radius:xt,padding:ot,backgroundColor:r,leftMargin:nt,rightMargin:S,topMargin:A,bottomMargin:J,tooltip:rt,relativeHeight:K,onSeriesMouseOver:lt,showColorScale:d,highlightedDataPoints:x,graphID:yt,minValue:Q,maxValue:j,onSeriesMouseClick:m,noOfTicks:v,graphDownload:u,dataDownload:h,prefix:_,suffix:tt,stripType:M,language:wt,highlightColor:vt,dotOpacity:Ct,showNAColor:Mt,minHeight:Vt,theme:Dt,ariaLabel:at,valueColor:w,resetSelectionOnDoubleClick:ht,detailsOnClick:Ot,orientation:E,styles:g,classNames:p,animate:Et,dimmedOpacity:dt,precision:It,customLayers:et,showDataMinMax:y}=e,Y=xt===void 0?5:xt,B=r===void 0?!1:r,$=d===void 0?!0:d;let I;t[0]!==x?(I=x===void 0?[]:x,t[0]=x,t[1]=I):I=t[1];const C=I,q=v===void 0?2:v,R=u===void 0?!1:u,D=h===void 0?!1:h,T=_===void 0?"":_,F=tt===void 0?"":tt,P=M===void 0?"dot":M,L=wt===void 0?"en":wt,U=Ct===void 0?.3:Ct,H=Mt===void 0?!0:Mt,G=Vt===void 0?0:Vt,O=Dt===void 0?"light":Dt,W=ht===void 0?!0:ht,Z=E===void 0?"vertical":E,N=Et===void 0?!1:Et,X=dt===void 0?.3:dt,st=It===void 0?2:It;let Nt;t[2]!==et?(Nt=et===void 0?[]:et,t[2]=et,t[3]=Nt):Nt=t[3];const ct=Nt,ut=y===void 0?!1:y,ft=Z==="horizontal"?Le:ue,[kt,bt]=z.useState(0),[St,pt]=z.useState(0),[At,i]=z.useState(void 0),c=z.useRef(null),Bt=z.useRef(null);let Ht,Gt;t[4]===Symbol.for("react.memo_cache_sentinel")?(Ht=()=>{const zt=new ResizeObserver(Jt=>{bt(Jt[0].target.clientWidth||620),pt(Jt[0].target.clientHeight||480)});return c.current&&zt.observe(c.current),()=>zt.disconnect()},Gt=[],t[4]=Ht,t[5]=Gt):(Ht=t[4],Gt=t[5]),z.useEffect(Ht,Gt);const Xt=p?.graphContainer,Yt=g?.graphContainer;let $t;t[6]!==p?.description||t[7]!==p?.title||t[8]!==o||t[9]!==D||t[10]!==l||t[11]!==R||t[12]!==k||t[13]!==g?.description||t[14]!==g?.title||t[15]!==V?($t=k||l||R||D?a.jsxRuntimeExports.jsx(ce.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:p?.title,description:p?.description},graphTitle:k,graphDescription:l,width:V,graphDownload:R?Bt:void 0,dataDownload:D?o.map(Ci).filter(wi).length>0?o.map(ji).filter(bi):o.filter(Oi):null}):null,t[6]=p?.description,t[7]=p?.title,t[8]=o,t[9]=D,t[10]=l,t[11]=R,t[12]=k,t[13]=g?.description,t[14]=g?.title,t[15]=V,t[16]=$t):$t=t[16];let qt;t[17]!==p?.colorLegend||t[18]!==mt||t[19]!==Rt||t[20]!==b||t[21]!==o||t[22]!==$||t[23]!==H||t[24]!==O||t[25]!==V?(qt=$!==!1&&o.filter(vi).length!==0&&o.length>0?a.jsxRuntimeExports.jsx(ae.ColorLegendWithMouseOver,{width:V,colorLegendTitle:Rt,colors:b||s.Colors[O].categoricalColors.colors,colorDomain:mt||Kt.uniqBy(o,"color",!0),setSelectedColor:i,showNAColor:H,className:p?.colorLegend}):null,t[17]=p?.colorLegend,t[18]=mt,t[19]=Rt,t[20]=b,t[21]=o,t[22]=$,t[23]=H,t[24]=O,t[25]=V,t[26]=qt):qt=t[26];let Tt;t[27]!==o.length?(Tt=o.length===0&&a.jsxRuntimeExports.jsx(le.EmptyState,{}),t[27]=o.length,t[28]=Tt):Tt=t[28];let Ft;t[29]!==ft||t[30]!==N||t[31]!==J||t[32]!==p||t[33]!==mt||t[34]!==b||t[35]!==ct||t[36]!==o||t[37]!==Ot||t[38]!==X||t[39]!==U||t[40]!==vt||t[41]!==C||t[42]!==nt||t[43]!==j||t[44]!==Q||t[45]!==q||t[46]!==m||t[47]!==lt||t[48]!==st||t[49]!==T||t[50]!==Y||t[51]!==W||t[52]!==S||t[53]!==At||t[54]!==ut||t[55]!==P||t[56]!==g||t[57]!==F||t[58]!==St||t[59]!==kt||t[60]!==O||t[61]!==rt||t[62]!==A||t[63]!==w?(Ft=kt&&St&&o.length>0?a.jsxRuntimeExports.jsx(ft,{data:o,width:kt,showDataMinMax:ut,height:St,colorDomain:o.filter(yi).length===0?[]:mt||Kt.uniqBy(o,"color",!0),colors:o.filter(gi).length===0?b?[b]:[s.Colors.primaryColors["blue-600"]]:b||s.Colors[O].categoricalColors.colors,selectedColor:At,radius:Y,leftMargin:nt,rightMargin:S,topMargin:A,bottomMargin:J,tooltip:rt,onSeriesMouseOver:lt,highlightedDataPoints:C,minValue:Q,maxValue:j,onSeriesMouseClick:m,prefix:T,suffix:F,stripType:P,highlightColor:vt,dotOpacity:U,resetSelectionOnDoubleClick:W,detailsOnClick:Ot,styles:g,classNames:p,valueColor:w,animate:N===!0?{duration:.5,once:!0,amount:.5}:N||{duration:0,once:!0,amount:0},noOfTicks:q,dimmedOpacity:X,precision:st,customLayers:ct}):null,t[29]=ft,t[30]=N,t[31]=J,t[32]=p,t[33]=mt,t[34]=b,t[35]=ct,t[36]=o,t[37]=Ot,t[38]=X,t[39]=U,t[40]=vt,t[41]=C,t[42]=nt,t[43]=j,t[44]=Q,t[45]=q,t[46]=m,t[47]=lt,t[48]=st,t[49]=T,t[50]=Y,t[51]=W,t[52]=S,t[53]=At,t[54]=ut,t[55]=P,t[56]=g,t[57]=F,t[58]=St,t[59]=kt,t[60]=O,t[61]=rt,t[62]=A,t[63]=w,t[64]=Ft):Ft=t[64];let Pt;t[65]!==Tt||t[66]!==Ft?(Pt=a.jsxRuntimeExports.jsxs(Qt.GraphArea,{ref:c,children:[Tt,Ft]}),t[65]=Tt,t[66]=Ft,t[67]=Pt):Pt=t[67];let Lt;t[68]!==p?.footnote||t[69]!==p?.source||t[70]!==jt||t[71]!==n||t[72]!==g?.footnote||t[73]!==g?.source||t[74]!==V?(Lt=n||jt?a.jsxRuntimeExports.jsx(se.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:n,footNote:jt,width:V}):null,t[68]=p?.footnote,t[69]=p?.source,t[70]=jt,t[71]=n,t[72]=g?.footnote,t[73]=g?.source,t[74]=V,t[75]=Lt):Lt=t[75];let Wt;return t[76]!==at||t[77]!==B||t[78]!==yt||t[79]!==f||t[80]!==L||t[81]!==G||t[82]!==ot||t[83]!==K||t[84]!==Xt||t[85]!==Yt||t[86]!==$t||t[87]!==qt||t[88]!==Pt||t[89]!==Lt||t[90]!==O||t[91]!==V?(Wt=a.jsxRuntimeExports.jsxs(Qt.GraphContainer,{className:Xt,style:Yt,id:yt,ref:Bt,"aria-label":at,backgroundColor:B,theme:O,language:L,minHeight:G,width:V,height:f,relativeHeight:K,padding:ot,children:[$t,qt,Pt,Lt]}),t[76]=at,t[77]=B,t[78]=yt,t[79]=f,t[80]=L,t[81]=G,t[82]=ot,t[83]=K,t[84]=Xt,t[85]=Yt,t[86]=$t,t[87]=qt,t[88]=Pt,t[89]=Lt,t[90]=O,t[91]=V,t[92]=Wt):Wt=t[92],Wt}function gi(e){return e.color}function yi(e){return e.color}function vi(e){return e.color}function Oi(e){return e!==void 0}function bi(e){return e!==void 0}function ji(e){return e.data}function wi(e){return e!==void 0}function Ci(e){return e.data}exports.StripChart=di;
|
|
2
2
|
//# sourceMappingURL=StripChart.cjs.map
|