@undp/data-viz 2.1.4 → 2.1.6
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/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.js +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.js +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.cjs.map +1 -1
- package/dist/DonutChart.js +92 -92
- package/dist/DonutChart.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.js +1 -1
- package/dist/{GraphEl-C2Fgg8PA.cjs → GraphEl-BixTEyKW.cjs} +2 -2
- package/dist/{GraphEl-C2Fgg8PA.cjs.map → GraphEl-BixTEyKW.cjs.map} +1 -1
- package/dist/{GraphEl-oZwZiTHI.js → GraphEl-Dyu_EIQb.js} +2 -2
- package/dist/{GraphEl-oZwZiTHI.js.map → GraphEl-Dyu_EIQb.js.map} +1 -1
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +2 -2
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.js +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +2 -2
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.js +1 -1
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.js +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.js +2 -2
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.js +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
- package/dist/Spinner-CQZcjzwd.cjs +2 -0
- package/dist/Spinner-CQZcjzwd.cjs.map +1 -0
- package/dist/{Spinner-D7rnnwnA.js → Spinner-DVBnY6Vg.js} +5 -5
- package/dist/Spinner-DVBnY6Vg.js.map +1 -0
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.js +1 -1
- package/dist/{index-D1RrKgK6.js → index-R1gTfap5.js} +2 -2
- package/dist/{index-D1RrKgK6.js.map → index-R1gTfap5.js.map} +1 -1
- package/dist/{index-Blvf-Q3U.cjs → index-WML2dCZ0.cjs} +2 -2
- package/dist/{index-Blvf-Q3U.cjs.map → index-WML2dCZ0.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +4 -4
- package/dist/Spinner-D7rnnwnA.js.map +0 -1
- package/dist/Spinner-DRMBUsX7.cjs +0 -2
- package/dist/Spinner-DRMBUsX7.cjs.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-CTPQjnHt.cjs"),i=require("react"),ae=require("./index-CyZ1lmi_.cjs"),G=require("./index-BS2TADPj.cjs"),u=require("./checkIfMultiple-wg6hJLXy.cjs"),te=require("./Spinner-DRMBUsX7.cjs"),m=require("./DropdownSelect-Doz3mCrM.cjs"),le=require("./GraphContainer-d8A46BK2.cjs"),oe=require("./GraphEl-C2Fgg8PA.cjs"),S=require("./fetchAndParseData-l5HGMAEs.cjs"),re=require("./Colors.cjs"),H=require("./transformDataForAggregation-CYoB5Xsk.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-CTPQjnHt.cjs"),i=require("react"),ae=require("./index-CyZ1lmi_.cjs"),G=require("./index-BS2TADPj.cjs"),u=require("./checkIfMultiple-wg6hJLXy.cjs"),te=require("./Spinner-CQZcjzwd.cjs"),m=require("./DropdownSelect-Doz3mCrM.cjs"),le=require("./GraphContainer-d8A46BK2.cjs"),oe=require("./GraphEl-BixTEyKW.cjs"),S=require("./fetchAndParseData-l5HGMAEs.cjs"),re=require("./Colors.cjs"),H=require("./transformDataForAggregation-CYoB5Xsk.cjs"),W=require("./getUniqValue-NX8DgwND.cjs"),ne=require("./GraphHeader.cjs"),ie=require("./GraphFooter.cjs"),z=require("./filterData-T5DQBE9b.cjs"),se=require("./ColorLegend.cjs"),ue=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),B=require("./transformDataForSelect-YmStusCI.cjs");function ce(J){const{graphSettings:t,dataSettings:n,filters:T,graphType:$,dataTransform:D,graphDataConfiguration:s,noOfColumns:y,columnGridBy:E,dataFilters:q,showCommonColorScale:A,minGraphHeight:K,minGraphWidth:F,debugMode:w,dataSelectionOptions:O,advancedDataSelectionOptions:k,readableHeader:Q,noOfFiltersPerRow:f=4,uiMode:d="normal",theme:X="light"}=J,[v,Y]=i.useState(void 0),[g,Z]=i.useState(void 0),[b,_]=i.useState([]),M=i.useRef(null),[x,C]=i.useState(s),[j,L]=i.useState([]),[h,R]=i.useState({}),N=i.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),P=i.useMemo(()=>!g||j.length===0?g:g.filter(r=>j.every(a=>a.value&&G.flattenDeep([a.value]).length>0?ae.intersection(G.flattenDeep([r[a.filter]]),G.flattenDeep([a.value]).map(l=>l.value)).length>0:!0)),[j,g]);i.useEffect(()=>{Y(P)},[P]);const U=i.useEffectEvent(()=>{const e=(T||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,ui:r.ui,defaultValue:B.transformDefaultValue(r.defaultValue),value:B.transformDefaultValue(r.defaultValue),availableValues:W.getUniqValue(g,r.column).filter(a=>!r.excludeValues?.includes(`${a}`)).map(a=>({value:a,label:a})),allowSelectAll:r.allowSelectAll,width:r.width}));L(e)});i.useEffect(()=>{(async()=>{try{const r=n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?await S.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,w):n.fileType==="api"?await S.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,w):await S.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,w,n.delimiter,!0):await S.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):await S.transformColumnsToArray(n.data,n.columnsToArray);Z(r)}catch(r){console.error("Data fetching error:",r)}})(),U()},[n,w]),i.useEffect(()=>{U()},[T,g]);const ee=i.useEffectEvent(()=>{const e=W.getUniqValue(g,E);_(e)});i.useEffect(()=>{ee()},[E,g]),i.useEffect(()=>{C(s)},[s]);const I=i.useCallback((e,r)=>{L(a=>a.map(l=>l.filter===e?{...l,value:r}:l))},[]);return o.jsxRuntimeExports.jsxs(le.GraphContainer,{className:t?.classNames?.graphContainer,style:t?.styles?.graphContainer,id:t?.graphID,ref:M,"aria-label":t?.ariaLabel||"This is a gridded graph",backgroundColor:t?.backgroundColor??!1,theme:t?.theme||"light",language:t?.language||"en",width:t?.width,height:t?.height,padding:t?.padding,children:[h?.graphTitle||h?.graphDescription||t?.graphTitle||t?.graphDescription||t?.graphDownload||t?.dataDownload?o.jsxRuntimeExports.jsx(ne.GraphHeader,{styles:{title:h?.styles?.title||t?.styles?.title,description:h?.styles?.description||t?.styles?.description},classNames:{title:h?.classNames?.title||t?.classNames?.title,description:h?.classNames?.description||t?.classNames?.description},graphTitle:h?.graphTitle||t?.graphTitle,graphDescription:h?.graphDescription||t?.graphDescription,width:h?.width||t?.width,graphDownload:t?.graphDownload?M:void 0,dataDownload:t?.dataDownload&&v&&v.length>0?v:null}):null,v&&b.length>0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[j.length!==0||(O||[]).length!==0||(k||[]).length!==0?o.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-0 w-full",children:[k?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.options.map(a=>({...a,value:a.label})),isClearable:!1,isSearchable:!0,variant:d,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{R(a?.graphSettings||{}),C(a?.dataConfiguration)}}):o.jsxRuntimeExports.jsx(u.ye,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:d,onValueChange:a=>{const l=e.options[e.options.findIndex(p=>p.label===a)];R(l.graphSettings||{}),C(l.dataConfiguration)},children:e.options.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),O?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),u.checkIfMultiple(e.chartConfigId,x||[])?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isMulti:!0,variant:d,isSearchable:!0,controlShouldRenderValue:!0,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]):void 0,filterOption:m.Du(N),onChange:a=>{const l={columnId:a.map(c=>c.value),chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},isRtl:t?.language==="ar"||t?.language==="he"}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]).map(a=>a.value):[],onValueChange:a=>{const l={columnId:a||[],chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:a.label,value:a.label},l))}):e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isClearable:!1,isSearchable:!0,variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)]:void 0,controlShouldRenderValue:!0,onChange:a=>{const l={columnId:a?.value,chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);R(a?.graphSettings||{}),C(p)}}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const l=e.allowedColumnIds[e.allowedColumnIds.findIndex(V=>V.label===a)],p={columnId:l.value,chartConfigId:e.chartConfigId},c=x?.map(V=>V.chartConfigId===p.chartConfigId?p:V);R(l.graphSettings||{}),C(c)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),j?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,flexWrap:"wrap"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label}),e.singleSelect?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:e.defaultValue.value,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>l.value===a))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:`${a.label}`,value:`${a.value}`},l))}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>a.indexOf(`${l.value}`)!==-1))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:`${a.label}`,value:`${a.value}`},l))}),e.allowSelectAll?o.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{I(e.filter,e.availableValues)},children:"Select all options"}):null]})]},r))]}):null,A!==!1&&t?.showColorScale!==!1?o.jsxRuntimeExports.jsx(se.ColorLegend,{width:t?.width,colorLegendTitle:t?.colorLegendTitle,colors:t?.colors||t?.lineColors||re.Colors[t?.theme||"light"].categoricalColors.colors,colorDomain:t?.colorDomain||t?.labels||[],showNAColor:t?.showNAColor===void 0||t?.showNAColor===null?!0:t?.showNAColor}):null,o.jsxRuntimeExports.jsx("div",{className:`flex flex-wrap gap-4 justify-center ${t?.language==="ar"||t?.language==="he"?"flex-row-reverse":"flex-row"}`,children:b.map((e,r)=>o.jsxRuntimeExports.jsx("div",{style:{width:`calc(${100/(y||Math.min(4,b.length||0))}% - ${((y||Math.min(4,b.length||0))-1)/(y||Math.min(4,b.length||0))}rem)`,minWidth:ue.checkIfNullOrUndefined(F)?"280px":`${F}px`},children:o.jsxRuntimeExports.jsx(oe.GraphEl,{graph:$,graphDataConfiguration:x,graphData:H.transformDataForGraph(D?H.transformDataForAggregation(z.filterData(v,q||[]).filter(a=>a[E]===e),D.keyColumn,D.aggregationColumnsSetting):z.filterData(v,q||[]).filter(a=>a[E]===e),$,x)||[],debugMode:w,settings:{...t||{},...h,theme:t?.theme||X,width:void 0,height:void 0,relativeHeight:t?.relativeHeight||.67,minHeight:K,graphTitle:`${e}`,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",footNote:void 0,sources:void 0,showColorScale:t?.showColorScale===!1?!1:A===!1},readableHeader:Q||[]})},r))})]}):o.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:o.jsxRuntimeExports.jsx(te.w,{})}),t?.sources||t?.footNote?o.jsxRuntimeExports.jsx(ie.GraphFooter,{styles:{footnote:t?.styles?.footnote,source:t?.styles?.source},classNames:{footnote:t?.classNames?.footnote,source:t?.classNames?.source},sources:t?.sources,footNote:t?.footNote,width:t?.width}):null]})}exports.GriddedGraphs=ce;
|
|
2
2
|
//# sourceMappingURL=GriddedGraphs.cjs.map
|
package/dist/GriddedGraphs.js
CHANGED
|
@@ -3,10 +3,10 @@ import { useState as C, useRef as na, useMemo as B, useEffect as I, useEffectEve
|
|
|
3
3
|
import { i as ua } from "./index-BuwmuDFJ.js";
|
|
4
4
|
import { f as T } from "./index-EArKRVKg.js";
|
|
5
5
|
import { b as $, y as A, h as F, c as ca, $ as K, P as Q } from "./checkIfMultiple-CIRtG0KE.js";
|
|
6
|
-
import { w as da } from "./Spinner-
|
|
6
|
+
import { w as da } from "./Spinner-DVBnY6Vg.js";
|
|
7
7
|
import { j as V, D as O } from "./DropdownSelect-BbdPQa2k.js";
|
|
8
8
|
import { G as ha } from "./GraphContainer-CRqzdKu2.js";
|
|
9
|
-
import { G as fa } from "./GraphEl-
|
|
9
|
+
import { G as fa } from "./GraphEl-Dyu_EIQb.js";
|
|
10
10
|
import { f as pa, a as ga, b as ma, c as Ca, t as va } from "./fetchAndParseData-BpqkBPQL.js";
|
|
11
11
|
import { Colors as wa } from "./Colors.js";
|
|
12
12
|
import { a as ba, t as xa } from "./transformDataForAggregation-j34UL73s.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-CTPQjnHt.cjs"),l=require("react"),p=require("./Spinner-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-CTPQjnHt.cjs"),l=require("react"),p=require("./Spinner-CQZcjzwd.cjs"),m=require("./GriddedGraphs.cjs"),f=require("./fetchAndParseData-l5HGMAEs.cjs");function g(c){const t=s.compilerRuntimeExports.c(23),{config:a}=c,[e,d]=l.useState(void 0);let r,o;if(t[0]!==a?(r=()=>{(async()=>{if(typeof a=="string"){const h=await f.fetchAndParseJSON(a);d(h)}else d(a)})()},o=[a],t[0]=a,t[1]=r,t[2]=o):(r=t[1],o=t[2]),l.useEffect(r,o),!e){let n;return t[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:s.jsxRuntimeExports.jsx(p.w,{})}),t[3]=n):n=t[3],n}let i;return t[4]!==e.advancedDataSelectionOptions||t[5]!==e.columnGridBy||t[6]!==e.dataFilters||t[7]!==e.dataSelectionOptions||t[8]!==e.dataSettings||t[9]!==e.dataTransform||t[10]!==e.debugMode||t[11]!==e.filters||t[12]!==e.graphDataConfiguration||t[13]!==e.graphSettings||t[14]!==e.graphType||t[15]!==e.minGraphHeight||t[16]!==e.minGraphWidth||t[17]!==e.noOfColumns||t[18]!==e.noOfFiltersPerRow||t[19]!==e.readableHeader||t[20]!==e.showCommonColorScale||t[21]!==e.theme?(i=s.jsxRuntimeExports.jsx(m.GriddedGraphs,{noOfColumns:e.noOfColumns,columnGridBy:e.columnGridBy,graphSettings:e.graphSettings,dataSettings:e.dataSettings,filters:e.filters,graphType:e.graphType,minGraphHeight:e.minGraphHeight,minGraphWidth:e.minGraphWidth,dataTransform:e.dataTransform,graphDataConfiguration:e.graphDataConfiguration,dataFilters:e.dataFilters,showCommonColorScale:e.showCommonColorScale,debugMode:e.debugMode,dataSelectionOptions:e.dataSelectionOptions,advancedDataSelectionOptions:e.advancedDataSelectionOptions,readableHeader:e.readableHeader,noOfFiltersPerRow:e.noOfFiltersPerRow,theme:e.theme}),t[4]=e.advancedDataSelectionOptions,t[5]=e.columnGridBy,t[6]=e.dataFilters,t[7]=e.dataSelectionOptions,t[8]=e.dataSettings,t[9]=e.dataTransform,t[10]=e.debugMode,t[11]=e.filters,t[12]=e.graphDataConfiguration,t[13]=e.graphSettings,t[14]=e.graphType,t[15]=e.minGraphHeight,t[16]=e.minGraphWidth,t[17]=e.noOfColumns,t[18]=e.noOfFiltersPerRow,t[19]=e.readableHeader,t[20]=e.showCommonColorScale,t[21]=e.theme,t[22]=i):i=t[22],i}exports.GriddedGraphsFromConfig=g;
|
|
2
2
|
//# sourceMappingURL=GriddedGraphsFromConfig.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as f, j as s } from "./index-CHPV5EwG-Curnpaqc.js";
|
|
2
2
|
import { useState as p, useEffect as h } from "react";
|
|
3
|
-
import { w as c } from "./Spinner-
|
|
3
|
+
import { w as c } from "./Spinner-DVBnY6Vg.js";
|
|
4
4
|
import { GriddedGraphs as g } from "./GriddedGraphs.js";
|
|
5
5
|
import { f as u } from "./fetchAndParseData-BpqkBPQL.js";
|
|
6
6
|
function w(l) {
|
package/dist/Histogram.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("./index-CHPV5EwG-CTPQjnHt.cjs"),oe=require("./Spinner-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("./index-CHPV5EwG-CTPQjnHt.cjs"),oe=require("./Spinner-CQZcjzwd.cjs"),J=require("./index-WML2dCZ0.cjs"),se=require("./TreeMapGraph.cjs"),le=require("./DonutChart.cjs"),ae=require("./BarGraph.cjs"),W=require("./Colors.cjs"),ce=require("./init-DU0ybBc_.cjs"),K=require("./linear-BwPAspcq.cjs");function ue(i,e){let v=0;for(let l of i)l!=null&&(l=+l)>=l&&++v;return v}function he(i){return i}var fe=Array.prototype,pe=fe.slice;function ne(i){return()=>i}function ge(i,e,v){let l;for(;;){const t=K.tickIncrement(i,e,v);if(t===l||t===0||!isFinite(t))return[i,e];t>0?(i=Math.floor(i/t)*t,e=Math.ceil(e/t)*t):t<0&&(i=Math.ceil(i*t)/t,e=Math.floor(e*t)/t),l=t}}function me(i){return Math.max(1,Math.ceil(Math.log(ue(i))/Math.LN2)+1)}function xe(){var i=he,e=J.extent,v=me;function l(t){Array.isArray(t)||(t=Array.from(t));var r,H=t.length,a,P,p=new Array(H);for(r=0;r<H;++r)p[r]=i(t[r],r,t);var b=e(p),o=b[0],n=b[1],s=v(p,o,n);if(!Array.isArray(s)){const d=n,M=+s;if(e===J.extent&&([o,n]=ge(o,n,M)),s=K.ticks(o,n,M),s[0]<=o&&(P=K.tickIncrement(o,n,M)),s[s.length-1]>=n)if(d>=n&&e===J.extent){const c=K.tickIncrement(o,n,M);isFinite(c)&&(c>0?n=(Math.floor(n/c)+1)*c:c<0&&(n=(Math.ceil(n*-c)+1)/-c))}else s.pop()}for(var x=s.length,u=0,h=x;s[u]<=o;)++u;for(;s[h-1]>n;)--h;(u||h<x)&&(s=s.slice(u,h),x=h-u);var m=new Array(x+1),y;for(r=0;r<=x;++r)y=m[r]=[],y.x0=r>0?s[r-1]:o,y.x1=r<x?s[r]:n;if(isFinite(P)){if(P>0)for(r=0;r<H;++r)(a=p[r])!=null&&o<=a&&a<=n&&m[Math.min(x,Math.floor((a-o)/P))].push(t[r]);else if(P<0){for(r=0;r<H;++r)if((a=p[r])!=null&&o<=a&&a<=n){const d=Math.floor((o-a)*P);m[Math.min(x,d+(s[d]<=a))].push(t[r])}}}else for(r=0;r<H;++r)(a=p[r])!=null&&o<=a&&a<=n&&m[ce.bisectRight(s,a,0,x)].push(t[r]);return m}return l.value=function(t){return arguments.length?(i=typeof t=="function"?t:ne(t),l):i},l.domain=function(t){return arguments.length?(e=typeof t=="function"?t:ne([t[0],t[1]]),l):e},l.thresholds=function(t){return arguments.length?(v=typeof t=="function"?t:ne(Array.isArray(t)?pe.call(t):t),l):v},l}function de(i){const e=L.compilerRuntimeExports.c(138),{data:v,graphTitle:l,sources:t,graphDescription:r,barPadding:H,showValues:a,showTicks:P,leftMargin:p,rightMargin:b,height:o,width:n,footNote:s,colors:x,padding:u,backgroundColor:h,topMargin:m,bottomMargin:y,showLabels:d,relativeHeight:M,tooltip:c,onSeriesMouseOver:w,refValues:Q,graphID:j,maxValue:U,onSeriesMouseClick:k,graphDownload:S,dataDownload:q,numberOfBins:X,truncateBy:Y,graphType:Z,barGraphLayout:_,donutStrokeWidth:ee,sortData:N,language:A,minHeight:F,theme:ie,maxBarThickness:te,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T}=i,C=ie===void 0?"light":ie;let O;e[0]!==v||e[1]!==X?(O=xe().thresholds(X||10).value(ye)(v).map(Me),e[0]=v,e[1]=X,e[2]=O):O=e[2];const $=O;if($.length===0){const g=`${n}px`,f=`${o}px`;let B;e[3]!==g||e[4]!==f?(B={width:g,height:f,margin:"auto"},e[3]=g,e[4]=f,e[5]=B):B=e[5];let I;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=L.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:L.jsxRuntimeExports.jsx(oe.w,{})}),e[6]=I):I=e[6];let z;return e[7]!==B?(z=L.jsxRuntimeExports.jsx("div",{style:B,children:I}),e[7]=B,e[8]=z):z=e[8],z}if(Z==="circlePacking"){const g=x||W.Colors.graphMainColor;let f;return e[9]!==E||e[10]!==h||e[11]!==y||e[12]!==D||e[13]!==q||e[14]!==$||e[15]!==R||e[16]!==s||e[17]!==r||e[18]!==S||e[19]!==j||e[20]!==l||e[21]!==o||e[22]!==A||e[23]!==p||e[24]!==F||e[25]!==k||e[26]!==w||e[27]!==u||e[28]!==T||e[29]!==M||e[30]!==b||e[31]!==d||e[32]!==a||e[33]!==t||e[34]!==G||e[35]!==g||e[36]!==C||e[37]!==c||e[38]!==m||e[39]!==n?(f=L.jsxRuntimeExports.jsx(J.CirclePackingGraph,{colors:g,graphTitle:l,graphDescription:r,footNote:s,width:n,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:q,data:$,language:A,minHeight:F,theme:C,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T}),e[9]=E,e[10]=h,e[11]=y,e[12]=D,e[13]=q,e[14]=$,e[15]=R,e[16]=s,e[17]=r,e[18]=S,e[19]=j,e[20]=l,e[21]=o,e[22]=A,e[23]=p,e[24]=F,e[25]=k,e[26]=w,e[27]=u,e[28]=T,e[29]=M,e[30]=b,e[31]=d,e[32]=a,e[33]=t,e[34]=G,e[35]=g,e[36]=C,e[37]=c,e[38]=m,e[39]=n,e[40]=f):f=e[40],f}if(Z==="treeMap"){const g=x||W.Colors.graphMainColor;let f;return e[41]!==E||e[42]!==h||e[43]!==y||e[44]!==D||e[45]!==q||e[46]!==$||e[47]!==R||e[48]!==s||e[49]!==r||e[50]!==S||e[51]!==j||e[52]!==l||e[53]!==o||e[54]!==A||e[55]!==p||e[56]!==F||e[57]!==k||e[58]!==w||e[59]!==u||e[60]!==T||e[61]!==M||e[62]!==b||e[63]!==d||e[64]!==a||e[65]!==t||e[66]!==G||e[67]!==g||e[68]!==C||e[69]!==c||e[70]!==m||e[71]!==n?(f=L.jsxRuntimeExports.jsx(se.TreeMapGraph,{colors:g,graphTitle:l,graphDescription:r,footNote:s,width:n,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:q,data:$,language:A,minHeight:F,theme:C,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T}),e[41]=E,e[42]=h,e[43]=y,e[44]=D,e[45]=q,e[46]=$,e[47]=R,e[48]=s,e[49]=r,e[50]=S,e[51]=j,e[52]=l,e[53]=o,e[54]=A,e[55]=p,e[56]=F,e[57]=k,e[58]=w,e[59]=u,e[60]=T,e[61]=M,e[62]=b,e[63]=d,e[64]=a,e[65]=t,e[66]=G,e[67]=g,e[68]=C,e[69]=c,e[70]=m,e[71]=n,e[72]=f):f=e[72],f}if(Z==="donutChart"){const g=x||W.Colors[C].categoricalColors.colors,f=n&&o?n<o?n:o:n||o||void 0,B=$;let I;return e[73]!==E||e[74]!==h||e[75]!==D||e[76]!==q||e[77]!==R||e[78]!==ee||e[79]!==s||e[80]!==r||e[81]!==S||e[82]!==j||e[83]!==l||e[84]!==A||e[85]!==k||e[86]!==w||e[87]!==u||e[88]!==T||e[89]!==N||e[90]!==t||e[91]!==G||e[92]!==g||e[93]!==f||e[94]!==B||e[95]!==C||e[96]!==c?(I=L.jsxRuntimeExports.jsx(le.DonutChart,{colors:g,graphTitle:l,graphDescription:r,footNote:s,radius:f,sources:t,backgroundColor:h,padding:u,tooltip:c,onSeriesMouseOver:w,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:q,data:B,strokeWidth:ee,showColorScale:!0,sortData:N,language:A,theme:C,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T}),e[73]=E,e[74]=h,e[75]=D,e[76]=q,e[77]=R,e[78]=ee,e[79]=s,e[80]=r,e[81]=S,e[82]=j,e[83]=l,e[84]=A,e[85]=k,e[86]=w,e[87]=u,e[88]=T,e[89]=N,e[90]=t,e[91]=G,e[92]=g,e[93]=f,e[94]=B,e[95]=C,e[96]=c,e[97]=I):I=e[97],I}const re=x||W.Colors.graphMainColor;let V;return e[98]!==E||e[99]!==h||e[100]!==_||e[101]!==H||e[102]!==y||e[103]!==D||e[104]!==q||e[105]!==$||e[106]!==R||e[107]!==s||e[108]!==r||e[109]!==S||e[110]!==j||e[111]!==l||e[112]!==o||e[113]!==A||e[114]!==p||e[115]!==te||e[116]!==U||e[117]!==F||e[118]!==k||e[119]!==w||e[120]!==u||e[121]!==T||e[122]!==Q||e[123]!==M||e[124]!==b||e[125]!==d||e[126]!==P||e[127]!==a||e[128]!==N||e[129]!==t||e[130]!==G||e[131]!==re||e[132]!==C||e[133]!==c||e[134]!==m||e[135]!==Y||e[136]!==n?(V=L.jsxRuntimeExports.jsx(ae.SimpleBarGraph,{colors:re,graphTitle:l,graphDescription:r,footNote:s,width:n,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:q,data:$,barPadding:H,refValues:Q,truncateBy:Y,maxValue:U,showTicks:P,sortData:N,language:A,minHeight:F,theme:C,maxBarThickness:te,ariaLabel:E,orientation:_,detailsOnClick:R,styles:G,classNames:D,precision:T}),e[98]=E,e[99]=h,e[100]=_,e[101]=H,e[102]=y,e[103]=D,e[104]=q,e[105]=$,e[106]=R,e[107]=s,e[108]=r,e[109]=S,e[110]=j,e[111]=l,e[112]=o,e[113]=A,e[114]=p,e[115]=te,e[116]=U,e[117]=F,e[118]=k,e[119]=w,e[120]=u,e[121]=T,e[122]=Q,e[123]=M,e[124]=b,e[125]=d,e[126]=P,e[127]=a,e[128]=N,e[129]=t,e[130]=G,e[131]=re,e[132]=C,e[133]=c,e[134]=m,e[135]=Y,e[136]=n,e[137]=V):V=e[137],V}function Me(i){return{label:`${i.x0}-${i.x1}`,size:i.length,data:{options:`${i.x0}-${i.x1}`,frequency:i.length}}}function ye(i){return i.value}exports.Histogram=de;
|
|
2
2
|
//# sourceMappingURL=Histogram.cjs.map
|
package/dist/Histogram.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as ne, j as R } from "./index-CHPV5EwG-Curnpaqc.js";
|
|
2
|
-
import { w as ae } from "./Spinner-
|
|
3
|
-
import { e as te, C as le } from "./index-
|
|
2
|
+
import { w as ae } from "./Spinner-DVBnY6Vg.js";
|
|
3
|
+
import { e as te, C as le } from "./index-R1gTfap5.js";
|
|
4
4
|
import { TreeMapGraph as se } from "./TreeMapGraph.js";
|
|
5
5
|
import { DonutChart as ce } from "./DonutChart.js";
|
|
6
6
|
import { SimpleBarGraph as fe } from "./BarGraph.js";
|
package/dist/HybridMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-CTPQjnHt.cjs"),m=require("react"),Ct=require("./parse-hMnG_lRV.cjs"),St=require("./getSliderMarks-BmADcPQt.cjs"),Vt=require("./Spinner-DRMBUsX7.cjs"),Nt=require("./index-DQA8q5sC.cjs"),xe=require("./zoom-DPw8bba-.cjs"),Et=require("./Typography-DX7PlgQU.cjs"),Bt=require("./index-DxXnJ8Ti.cjs"),Dt=require("./Source-DYMJRrsq.cjs"),Ft=require("./index-Dzc_aaI9-BmkfPMyc.cjs"),Tt=require("./Tooltip-uUdw6wJL.cjs"),kt=require("./index-DRXx7m-C.cjs"),Wt=require("./DetailsModal-BN0HDFlV.cjs"),At=require("./pow-DgrUorRi.cjs"),Ut=require("./ordinal-CrsysVE-.cjs"),Gt=require("./threshold-DNsSUf8Q.cjs"),wt=require("./select-Bnfk0lJx.cjs"),lt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ht=require("./numberFormattingFunction-02t-wJta.cjs"),Xt=require("./use-in-view-QcfiW0w3.cjs"),he=require("./proxy-BxvUI_9l.cjs"),Yt=require("./index-DG2bgAva.cjs"),Jt=require("./GraphFooter.cjs"),Kt=require("./GraphHeader.cjs"),De=require("./Colors.cjs"),Zt=require("./fetchAndParseData-l5HGMAEs.cjs"),$t=require("./GraphContainer-d8A46BK2.cjs"),Qt=require("./getUniqValue-NX8DgwND.cjs"),eo=require("./getJenks-GYmdwBqm.cjs");function to(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const d=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,d.get?d:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const oo=to(m);var ro="Separator",Ot="horizontal",io=["horizontal","vertical"],Mt=oo.forwardRef((i,e)=>{const{decorative:t,orientation:d=Ot,...E}=i,n=ao(d)?d:Ot,w=t?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return r.ae.jsx(Ft.w.div,{"data-orientation":n,...w,...E,ref:e})});Mt.displayName=ro;function ao(i){return io.includes(i)}var qt=Mt;const It=m.forwardRef((i,e)=>{const t=r._.c(14);let d,E,n,w;t[0]!==i?({className:d,variant:n,orientation:w,...E}=i,t[0]=i,t[1]=d,t[2]=E,t[3]=n,t[4]=w):(d=t[1],E=t[2],n=t[3],w=t[4]);const k=n===void 0?"dark":n,u=w===void 0?"horizontal":w,g=u==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",D=k==="dark"?"bg-primary-gray-600 dark:bg-primary-gray-200":"bg-primary-gray-400 dark:bg-primary-gray-550";let C;t[5]!==d||t[6]!==g||t[7]!==D?(C=r.mo(g,D,d),t[5]=d,t[6]=g,t[7]=D,t[8]=C):C=t[8];let I;return t[9]!==u||t[10]!==E||t[11]!==e||t[12]!==C?(I=r.ae.jsx(qt,{...E,ref:e,orientation:u,className:C}),t[9]=u,t[10]=E,t[11]=e,t[12]=C,t[13]=I):I=t[13],I});It.displayName=qt.displayName;function no(i){const{data:e,colors:t,mapData:d,mapColorLegendTitle:E,colorDomain:n,radius:w,height:k,width:u,scale:g,centerPoint:D,tooltip:C,showLabels:I,mapBorderWidth:oe,mapBorderColor:re,mapNoDataColor:ge,onSeriesMouseOver:K,showColorScale:$e,zoomScaleExtend:We,zoomTranslateExtend:Ae,highlightedDataPoints:Oe,onSeriesMouseClick:F,resetSelectionOnDoubleClick:Me,detailsOnClick:Z,styles:O,classNames:ie,mapProjection:ae,zoomInteraction:Q,animate:v,dimmedOpacity:T,customLayers:fe,maxRadiusValue:ye,categorical:ne,dotColor:ee,collapseColorScaleByDefault:qe,highlightedIds:se,mapProperty:ve,dotLegendTitle:je,dotBorderColor:Ie,labelColor:Pe}=i,[P,z]=m.useState(void 0),[b,j]=m.useState(qe===void 0?!(u<680):!qe),le=m.useRef(null),[ce,te]=m.useState(void 0),[ze,M]=m.useState(void 0),[de,q]=m.useState(void 0),[be,W]=m.useState(void 0),L=m.useRef(null),A=Xt.useInView(L,{once:v.once,amount:v.amount}),Ee=m.useRef(null),_=e.filter(o=>o.radius===void 0||o.radius===null).length!==e.length?At.sqrt().domain([0,ye]).range([.25,w]).nice():void 0,Ue=ne?Ut.ordinal().domain(n).range(t):Gt.threshold().domain(n).range(t);m.useEffect(()=>{const o=wt.select(Ee.current),a=wt.select(L.current),$=p=>{if(Q==="noZoom")return!1;if(Q==="button")return!p.type.includes("wheel");const l=p.type==="wheel",R=p.type.startsWith("touch"),x=p.type==="mousedown"||p.type==="mousemove";return R?!0:l?Q==="scroll"?!0:p.ctrlKey:x&&!p.button&&!p.ctrlKey},s=xe.zoom().scaleExtent(We).translateExtent(Ae||[[-20,-20],[u+20,k+20]]).filter($).on("zoom",({transform:p})=>{o.attr("transform",p)});a.call(s),le.current=s},[k,u,Q]);const S=xe.turf_bbox_default(d),V=Bt.turf_center_of_mass_default(d),U=S[2]-S[0],Le=S[3]-S[1],_e=u*190/960*360/U,Ve=k*190/678*180/Le,G=g*Math.min(_e,Ve),B=ae==="mercator"?xe.geoMercator().rotate([0,0]).center(D||V.geometry.coordinates).translate([u/2,k/2]).scale(G):ae==="equalEarth"?xe.geoEqualEarth().rotate([0,0]).center(D||V.geometry.coordinates).translate([u/2,k/2]).scale(G):ae==="naturalEarth"?xe.geoNaturalEarth1().rotate([0,0]).center(D||V.geometry.coordinates).translate([u/2,k/2]).scale(G):ae==="orthographic"?xe.geoOrthographic().rotate([0,0]).center(D||V.geometry.coordinates).translate([u/2,k/2]).scale(G):xe.geoAlbersUsa().rotate([0,0]).center(D||V.geometry.coordinates).translate([u/2,k/2]).scale(G),we=o=>{if(!L.current||!le.current)return;wt.select(L.current).call(le.current.scaleBy,o==="in"?1.2:1/1.2)};return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r.jsxRuntimeExports.jsx(he.motion.svg,{width:`${u}px`,height:`${k}px`,viewBox:`0 0 ${u} ${k}`,ref:L,direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{ref:Ee,children:[fe.filter(o=>o.position==="before").map(o=>o.layer),d.features.map((o,a)=>e.findIndex(s=>s.id===o.properties[ve])!==-1?null:r.jsxRuntimeExports.jsx("g",{opacity:P?T:se.length!==0?se.indexOf(o.properties[ve])!==-1?1:T:1,children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((s,p)=>{let l="";return s.forEach(R=>{let x=" M";R.forEach((f,ue)=>{const N=B([f[0],f[1]]);ue!==R.length-1?x=`${x}${N[0]} ${N[1]}L`:x=`${x}${N[0]} ${N[1]}`}),l+=x}),r.jsxRuntimeExports.jsx("path",{d:l,style:{stroke:re,strokeWidth:oe,fill:ge}},p)}):o.geometry.coordinates.map((s,p)=>{let l="M";return s.forEach((R,x)=>{const f=B([R[0],R[1]]);x!==s.length-1?l=`${l}${f[0]} ${f[1]}L`:l=`${l}${f[0]} ${f[1]}`}),r.jsxRuntimeExports.jsx("path",{d:l,style:{stroke:re,strokeWidth:oe,fill:ge}},p)})},a)),r.jsxRuntimeExports.jsxs(Yt.AnimatePresence,{children:[e.filter(o=>o.id).map(o=>{const a=d.features.findIndex(s=>o.id===s.properties[ve]),$=lt.checkIfNullOrUndefined(o.x)?ge:Ue(o.x);return r.jsxRuntimeExports.jsx(he.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:P?P===$?1:T:se.length!==0?se.indexOf(o.id)!==-1?1:T:1,transition:{duration:v.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{opacity:0,transition:{duration:v.duration}},onMouseEnter:s=>{M(o),W(s.clientY),q(s.clientX),K?.(o)},onMouseMove:s=>{M(o),W(s.clientY),q(s.clientX)},onMouseLeave:()=>{M(void 0),q(void 0),W(void 0),K?.(void 0)},onClick:()=>{(F||Z)&&(Nt.isEqual(ce,o)&&Me?(te(void 0),F?.(void 0)):(te(o),F?.(o)))},children:a===-1?null:d.features[a].geometry.type==="MultiPolygon"?d.features[a].geometry.coordinates.map((s,p)=>{let l="";return s.forEach(R=>{let x=" M";R.forEach((f,ue)=>{const N=B([f[0],f[1]]);ue!==R.length-1?x=`${x}${N[0]} ${N[1]}L`:x=`${x}${N[0]} ${N[1]}`}),l+=x}),r.jsxRuntimeExports.jsx(he.motion.path,{d:l,variants:{initial:{fill:$,opacity:0},whileInView:{fill:$,opacity:1,transition:{duration:v.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{opacity:0,transition:{duration:v.duration}},style:{stroke:re,strokeWidth:oe}},`${o.id}-${p}`)}):d.features[a].geometry.coordinates.map((s,p)=>{let l="M";return s.forEach((R,x)=>{const f=B([R[0],R[1]]);x!==s.length-1?l=`${l}${f[0]} ${f[1]}L`:l=`${l}${f[0]} ${f[1]}`}),r.jsxRuntimeExports.jsx(he.motion.path,{d:l,variants:{initial:{fill:$,opacity:0},whileInView:{fill:$,opacity:1,transition:{duration:v.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{opacity:0,transition:{duration:v.duration}},style:{stroke:re,strokeWidth:oe}},`${o.id}-${p}`)})},o.id)}),e.filter(o=>!lt.checkIfNullOrUndefined(o.lat)&&!lt.checkIfNullOrUndefined(o.long)).map(o=>r.jsxRuntimeExports.jsxs(he.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:Oe.length!==0?Oe.indexOf(o.label||"")!==-1?1:T:1,transition:{duration:v.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{opacity:0,transition:{duration:v.duration}},onMouseEnter:a=>{M(o),W(a.clientY),q(a.clientX),K?.(o)},onMouseMove:a=>{M(o),W(a.clientY),q(a.clientX)},onMouseLeave:()=>{M(void 0),q(void 0),W(void 0),K?.(void 0)},onClick:()=>{(F||Z)&&(Nt.isEqual(ce,o)&&Me?(te(void 0),F?.(void 0)):(te(o),F?.(o)))},transform:`translate(${B([o.long,o.lat])[0]},${B([o.long,o.lat])[1]})`,children:[r.jsxRuntimeExports.jsx(he.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:ee,stroke:Ie||ee},whileInView:{r:_?_(o.radius||0):w,fill:ee,stroke:Ie||ee,transition:{duration:v.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{r:0,transition:{duration:v.duration}},style:{fillOpacity:.8}}),I&&o.label?r.jsxRuntimeExports.jsx(he.motion.text,{variants:{initial:{opacity:0,x:_?_(o.radius||0):w},whileInView:{opacity:1,x:_?_(o.radius||0):w,transition:{duration:v.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{opacity:0,transition:{duration:v.duration}},y:0,className:"text-sm",style:{textAnchor:"start",fill:Pe||"#000"},dx:4,dy:5,children:o.label}):null]},o.label||`${o.lat}-${o.long}`))]}),fe.filter(o=>o.position==="after").map(o=>o.layer)]})}),$e===!1?null:r.jsxRuntimeExports.jsx("div",{className:r.mo("absolute left-4 bottom-4 map-color-legend",ie?.colorLegend),children:b?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{j(!1)},children:r.jsxRuntimeExports.jsx(kt.X,{})}),r.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:ne?void 0:"340px"},children:[je&&je!==""?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:ee}}),r.jsxRuntimeExports.jsx(Et.j,{size:"xs",marginBottom:"none",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:je})]}),r.jsxRuntimeExports.jsx(Dt.n,{size:"xl"}),r.jsxRuntimeExports.jsx(It,{}),r.jsxRuntimeExports.jsx(Dt.n,{size:"xl"})]}):null,E&&E!==""?r.jsxRuntimeExports.jsx(Et.j,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:E}):null,ne?r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:n.map((o,a)=>r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{z(t[a%t.length])},onMouseLeave:()=>{z(void 0)},children:[r.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t[a%t.length]}}),r.jsxRuntimeExports.jsx(Et.j,{size:"sm",marginBottom:"none",leading:"none",children:o})]},a))}):r.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{children:[n.map((o,a)=>r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{z(t[a])},onMouseLeave:()=>{z(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:a*320/t.length+1,y:1,width:320/t.length-2,height:8,className:P===t[a]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:t[a],...P===t[a]?{}:{stroke:t[a]}}}),r.jsxRuntimeExports.jsx("text",{x:(a+1)*320/t.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Ht.numberFormattingFunction(o,"NA")})]},a)),r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{z(t[n.length])},onMouseLeave:()=>{z(void 0)},x:n.length*320/t.length+1,y:1,width:320/t.length-2,height:8,className:`cursor-pointer ${P===t[n.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:t[n.length],...P===t[n.length]?{}:{stroke:t[n.length]}}})})]})})]})]}):r.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{j(!0)},children:r.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),Q==="button"&&r.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[r.jsxRuntimeExports.jsx("button",{onClick:()=>we("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),r.jsxRuntimeExports.jsx("button",{onClick:()=>we("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),Z&&ce!==void 0?r.jsxRuntimeExports.jsx(Wt.DetailsModal,{body:Z,data:ce,setData:te,className:ie?.modal}):null,ze&&C&&de&&be?r.jsxRuntimeExports.jsx(Tt.Tooltip,{data:ze,body:C,xPos:de,yPos:be,backgroundStyle:O?.tooltip,className:ie?.tooltip}):null]})}function so(i){const e=r.compilerRuntimeExports.c(131),{data:t,mapData:d,graphTitle:E,colors:n,sources:w,graphDescription:k,height:u,width:g,footNote:D,mapColorLegendTitle:C,colorDomain:I,choroplethScaleType:oe,radius:re,scale:ge,centerPoint:K,padding:$e,mapBorderWidth:We,mapNoDataColor:Ae,backgroundColor:Oe,showLabels:F,mapBorderColor:Me,tooltip:Z,relativeHeight:O,onSeriesMouseOver:ie,isWorldMap:ae,showColorScale:Q,zoomScaleExtend:v,zoomTranslateExtend:T,graphID:fe,highlightedDataPoints:ye,onSeriesMouseClick:ne,graphDownload:ee,dataDownload:qe,showAntarctica:se,language:ve,minHeight:je,theme:Ie,ariaLabel:Pe,resetSelectionOnDoubleClick:P,detailsOnClick:z,styles:b,classNames:j,mapProjection:le,zoomInteraction:ce,animate:te,dimmedOpacity:ze,customLayers:M,maxRadiusValue:de,timeline:q,collapseColorScaleByDefault:be,dotColor:W,highlightedIds:L,mapProperty:A,dotLegendTitle:Ee,dotBorderColor:_,labelColor:Ue}=i,S=d===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json":d,V=D===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":D,U=oe===void 0?"threshold":oe,Le=re===void 0?5:re,_e=ge===void 0?.95:ge,Ve=We===void 0?.5:We,G=Ae===void 0?De.Colors.light.graphNoData:Ae,B=Oe===void 0?!1:Oe,we=F===void 0?!1:F,o=Me===void 0?De.Colors.light.grays["gray-500"]:Me,a=ae===void 0?!0:ae,$=Q===void 0?!0:Q;let s;e[0]!==v?(s=v===void 0?[.8,6]:v,e[0]=v,e[1]=s):s=e[1];const p=s;let l;e[2]!==ye?(l=ye===void 0?[]:ye,e[2]=ye,e[3]=l):l=e[3];const R=l,x=ee===void 0?!1:ee,f=qe===void 0?!1:qe,ue=se===void 0?!1:se,N=ve===void 0?"en":ve,H=je===void 0?0:je,me=Ie===void 0?"light":Ie,ct=P===void 0?!0:P,dt=ce===void 0?"button":ce,Ge=te===void 0?!1:te,ut=ze===void 0?.3:ze;let He;e[4]!==M?(He=M===void 0?[]:M,e[4]=M,e[5]=He):He=e[5];const mt=He;let Xe;e[6]!==q?(Xe=q===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:q,e[6]=q,e[7]=Xe):Xe=e[7];const c=Xe,pt=W===void 0?De.Colors.primaryColors["blue-600"]:W;let Ye;e[8]!==L?(Ye=L===void 0?[]:L,e[8]=L,e[9]=Ye):Ye=e[9];const xt=Ye,ht=A===void 0?"ISO3":A,gt=Ue===void 0?De.Colors.primaryColors["blue-600"]:Ue,[pe,Pt]=m.useState(0),[Be,zt]=m.useState(0),[X,Lt]=m.useState(c.autoplay);let Fe;if(e[10]!==t||e[11]!==c.dateFormat){let y;e[13]!==c.dateFormat?(y=J=>Ct.parse(`${J.date}`,c.dateFormat||"yyyy",new Date).getTime(),e[13]=c.dateFormat,e[14]=y):y=e[14],Fe=[...new Set(t.filter(vo).map(y))],Fe.sort(yo),e[10]=t,e[11]=c.dateFormat,e[12]=Fe}else Fe=e[12];const h=Fe,[Y,ft]=m.useState(c.autoplay?0:h.length-1),[ke,_t]=m.useState(void 0),yt=m.useRef(null),Rt=m.useRef(null);let Je;e[15]!==U||e[16]!==I||e[17]!==n?.length||e[18]!==t?(Je=I||(U==="categorical"?Qt.getUniqValue(t,"x"):eo.getJenks(t.map(fo),n?.length||4)),e[15]=U,e[16]=I,e[17]=n?.length,e[18]=t,e[19]=Je):Je=e[19];const Te=Je;let Ke,Ze;e[20]===Symbol.for("react.memo_cache_sentinel")?(Ke=()=>{const y=new ResizeObserver(J=>{Pt(J[0].target.clientWidth||620),zt(J[0].target.clientHeight||480)});return yt.current&&y.observe(yt.current),()=>y.disconnect()},Ze=[],e[20]=Ke,e[21]=Ze):(Ke=e[20],Ze=e[21]),m.useEffect(Ke,Ze);let Qe;e[22]===Symbol.for("react.memo_cache_sentinel")?(Qe=y=>{_t(y)},e[22]=Qe):Qe=e[22];const et=m.useEffectEvent(Qe);let tt;e[23]!==S||e[24]!==et?(tt=()=>{typeof S=="string"?Zt.fetchAndParseJSON(S).then(J=>{et(J)}):et(S)},e[23]=S,e[24]=et,e[25]=tt):tt=e[25];let ot;e[26]!==S?(ot=[S],e[26]=S,e[27]=ot):ot=e[27],m.useEffect(tt,ot);let rt,it;e[28]!==X||e[29]!==c.speed||e[30]!==h?(rt=()=>{const y=setInterval(()=>{ft(J=>J<h.length-1?J+1:0)},(c.speed||2)*1e3);return X||clearInterval(y),()=>clearInterval(y)},it=[h,X,c.speed],e[28]=X,e[29]=c.speed,e[30]=h,e[31]=rt,e[32]=it):(rt=e[31],it=e[32]),m.useEffect(rt,it);const vt=c.dateFormat||"yyyy";let at;e[33]!==Y||e[34]!==vt||e[35]!==c.showOnlyActiveDate||e[36]!==h?(at=St.getSliderMarks(h,Y,c.showOnlyActiveDate,vt),e[33]=Y,e[34]=vt,e[35]=c.showOnlyActiveDate,e[36]=h,e[37]=at):at=e[37];const nt=at,jt=j?.graphContainer,bt=b?.graphContainer;let Re;e[38]!==j?.description||e[39]!==j?.title||e[40]!==t||e[41]!==f||e[42]!==k||e[43]!==x||e[44]!==E||e[45]!==b?.description||e[46]!==b?.title||e[47]!==g?(Re=E||k||x||f?r.jsxRuntimeExports.jsx(Kt.GraphHeader,{styles:{title:b?.title,description:b?.description},classNames:{title:j?.title,description:j?.description},graphTitle:E,graphDescription:k,width:g,graphDownload:x?Rt:void 0,dataDownload:f?t.map(go).filter(ho).length>0?t.map(xo).filter(po):t.filter(mo):null}):null,e[38]=j?.description,e[39]=j?.title,e[40]=t,e[41]=f,e[42]=k,e[43]=x,e[44]=E,e[45]=b?.description,e[46]=b?.title,e[47]=g,e[48]=Re):Re=e[48];let Ce;e[49]!==Y||e[50]!==nt||e[51]!==X||e[52]!==c.enabled||e[53]!==h?(Ce=c.enabled&&h.length>0&&nt?r.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[r.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Lt(!X)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":X?"Click to pause animation":"Click to play animation",children:X?r.jsxRuntimeExports.jsx(kt.Pause,{}):r.jsxRuntimeExports.jsx(kt.Play,{})}),r.jsxRuntimeExports.jsx(St.Nr,{min:h[0],max:h[h.length-1],marks:nt,step:null,defaultValue:h[h.length-1],value:h[Y],onChangeComplete:y=>{ft(h.indexOf(y))},onChange:y=>{ft(h.indexOf(y))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[49]=Y,e[50]=nt,e[51]=X,e[52]=c.enabled,e[53]=h,e[54]=Ce):Ce=e[54];let Se;e[55]!==Ge||e[56]!==K||e[57]!==U||e[58]!==j||e[59]!==be||e[60]!==n||e[61]!==mt||e[62]!==t||e[63]!==z||e[64]!==ut||e[65]!==Te||e[66]!==_||e[67]!==pt||e[68]!==Ee||e[69]!==u||e[70]!==R||e[71]!==xt||e[72]!==Y||e[73]!==a||e[74]!==gt||e[75]!==o||e[76]!==Ve||e[77]!==C||e[78]!==G||e[79]!==le||e[80]!==ht||e[81]!==ke||e[82]!==de||e[83]!==H||e[84]!==ne||e[85]!==ie||e[86]!==Le||e[87]!==O||e[88]!==ct||e[89]!==_e||e[90]!==ue||e[91]!==$||e[92]!==we||e[93]!==b||e[94]!==Be||e[95]!==pe||e[96]!==me||e[97]!==c.dateFormat||e[98]!==c.enabled||e[99]!==Z||e[100]!==h||e[101]!==g||e[102]!==dt||e[103]!==p||e[104]!==T?(Se=r.jsxRuntimeExports.jsx($t.GraphArea,{ref:yt,children:pe&&Be&&ke?r.jsxRuntimeExports.jsx(no,{dotColor:pt,data:t.filter(y=>c.enabled?y.date===Ct.format(new Date(h[Y]),c.dateFormat||"yyyy"):y),mapData:ue?ke:{...ke,features:ke.features.filter(uo)},colorDomain:Te,width:pe,height:Be,scale:_e,centerPoint:K,colors:n||(U==="categorical"?De.Colors[me].sequentialColors[`neutralColorsx0${Te.length}`]:De.Colors[me].sequentialColors[`neutralColorsx0${Te.length+1}`]),mapColorLegendTitle:C,radius:Le,categorical:U==="categorical",mapBorderWidth:Ve,mapNoDataColor:G,mapBorderColor:o,tooltip:Z,onSeriesMouseOver:ie,showLabels:we,isWorldMap:a,showColorScale:$,zoomScaleExtend:p,zoomTranslateExtend:T,onSeriesMouseClick:ne,highlightedDataPoints:R,resetSelectionOnDoubleClick:ct,styles:b,classNames:j,zoomInteraction:dt,detailsOnClick:z,mapProjection:le||(a?"naturalEarth":"mercator"),animate:Ge===!0?{duration:.5,once:!0,amount:.5}:Ge||{duration:0,once:!0,amount:0},dimmedOpacity:ut,customLayers:mt,maxRadiusValue:lt.checkIfNullOrUndefined(de)?Math.max(...t.map(co).filter(lo)):de,collapseColorScaleByDefault:be,highlightedIds:xt,mapProperty:ht,dotLegendTitle:Ee,dotBorderColor:_,labelColor:gt}):r.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(H,u||(O?H?(g||pe)*O>H?(g||pe)*O:H:(g||pe)*O:Be))}px`},className:"flex items-center justify-center",children:r.jsxRuntimeExports.jsx(Vt.w,{"aria-label":"Loading graph"})})}),e[55]=Ge,e[56]=K,e[57]=U,e[58]=j,e[59]=be,e[60]=n,e[61]=mt,e[62]=t,e[63]=z,e[64]=ut,e[65]=Te,e[66]=_,e[67]=pt,e[68]=Ee,e[69]=u,e[70]=R,e[71]=xt,e[72]=Y,e[73]=a,e[74]=gt,e[75]=o,e[76]=Ve,e[77]=C,e[78]=G,e[79]=le,e[80]=ht,e[81]=ke,e[82]=de,e[83]=H,e[84]=ne,e[85]=ie,e[86]=Le,e[87]=O,e[88]=ct,e[89]=_e,e[90]=ue,e[91]=$,e[92]=we,e[93]=b,e[94]=Be,e[95]=pe,e[96]=me,e[97]=c.dateFormat,e[98]=c.enabled,e[99]=Z,e[100]=h,e[101]=g,e[102]=dt,e[103]=p,e[104]=T,e[105]=Se):Se=e[105];let Ne;e[106]!==j?.footnote||e[107]!==j?.source||e[108]!==V||e[109]!==w||e[110]!==b?.footnote||e[111]!==b?.source||e[112]!==g?(Ne=w||V?r.jsxRuntimeExports.jsx(Jt.GraphFooter,{styles:{footnote:b?.footnote,source:b?.source},classNames:{footnote:j?.footnote,source:j?.source},sources:w,footNote:V,width:g}):null,e[106]=j?.footnote,e[107]=j?.source,e[108]=V,e[109]=w,e[110]=b?.footnote,e[111]=b?.source,e[112]=g,e[113]=Ne):Ne=e[113];let st;return e[114]!==Pe||e[115]!==B||e[116]!==fe||e[117]!==u||e[118]!==N||e[119]!==H||e[120]!==$e||e[121]!==O||e[122]!==jt||e[123]!==bt||e[124]!==Re||e[125]!==Ce||e[126]!==Se||e[127]!==Ne||e[128]!==me||e[129]!==g?(st=r.jsxRuntimeExports.jsxs($t.GraphContainer,{className:jt,style:bt,id:fe,ref:Rt,"aria-label":Pe,backgroundColor:B,theme:me,language:N,minHeight:H,width:g,height:u,relativeHeight:O,padding:$e,children:[Re,Ce,Se,Ne]}),e[114]=Pe,e[115]=B,e[116]=fe,e[117]=u,e[118]=N,e[119]=H,e[120]=$e,e[121]=O,e[122]=jt,e[123]=bt,e[124]=Re,e[125]=Ce,e[126]=Se,e[127]=Ne,e[128]=me,e[129]=g,e[130]=st):st=e[130],st}function lo(i){return i!=null}function co(i){return i.radius}function uo(i){return i.properties.NAME!=="Antarctica"}function mo(i){return i!==void 0}function po(i){return i!==void 0}function xo(i){return i.data}function ho(i){return i!==void 0}function go(i){return i.data}function fo(i){return i.x}function yo(i,e){return i-e}function vo(i){return i.date}exports.HybridMap=so;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-CTPQjnHt.cjs"),m=require("react"),Ct=require("./parse-hMnG_lRV.cjs"),St=require("./getSliderMarks-BmADcPQt.cjs"),Vt=require("./Spinner-CQZcjzwd.cjs"),Nt=require("./index-DQA8q5sC.cjs"),xe=require("./zoom-DPw8bba-.cjs"),Et=require("./Typography-DX7PlgQU.cjs"),Bt=require("./index-DxXnJ8Ti.cjs"),Dt=require("./Source-DYMJRrsq.cjs"),Ft=require("./index-Dzc_aaI9-BmkfPMyc.cjs"),Tt=require("./Tooltip-uUdw6wJL.cjs"),kt=require("./index-DRXx7m-C.cjs"),Wt=require("./DetailsModal-BN0HDFlV.cjs"),At=require("./pow-DgrUorRi.cjs"),Ut=require("./ordinal-CrsysVE-.cjs"),Gt=require("./threshold-DNsSUf8Q.cjs"),wt=require("./select-Bnfk0lJx.cjs"),lt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ht=require("./numberFormattingFunction-02t-wJta.cjs"),Xt=require("./use-in-view-QcfiW0w3.cjs"),he=require("./proxy-BxvUI_9l.cjs"),Yt=require("./index-DG2bgAva.cjs"),Jt=require("./GraphFooter.cjs"),Kt=require("./GraphHeader.cjs"),De=require("./Colors.cjs"),Zt=require("./fetchAndParseData-l5HGMAEs.cjs"),$t=require("./GraphContainer-d8A46BK2.cjs"),Qt=require("./getUniqValue-NX8DgwND.cjs"),eo=require("./getJenks-GYmdwBqm.cjs");function to(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const d=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,d.get?d:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const oo=to(m);var ro="Separator",Ot="horizontal",io=["horizontal","vertical"],Mt=oo.forwardRef((i,e)=>{const{decorative:t,orientation:d=Ot,...E}=i,n=ao(d)?d:Ot,w=t?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return r.ae.jsx(Ft.w.div,{"data-orientation":n,...w,...E,ref:e})});Mt.displayName=ro;function ao(i){return io.includes(i)}var qt=Mt;const It=m.forwardRef((i,e)=>{const t=r._.c(14);let d,E,n,w;t[0]!==i?({className:d,variant:n,orientation:w,...E}=i,t[0]=i,t[1]=d,t[2]=E,t[3]=n,t[4]=w):(d=t[1],E=t[2],n=t[3],w=t[4]);const k=n===void 0?"dark":n,u=w===void 0?"horizontal":w,g=u==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",D=k==="dark"?"bg-primary-gray-600 dark:bg-primary-gray-200":"bg-primary-gray-400 dark:bg-primary-gray-550";let C;t[5]!==d||t[6]!==g||t[7]!==D?(C=r.mo(g,D,d),t[5]=d,t[6]=g,t[7]=D,t[8]=C):C=t[8];let I;return t[9]!==u||t[10]!==E||t[11]!==e||t[12]!==C?(I=r.ae.jsx(qt,{...E,ref:e,orientation:u,className:C}),t[9]=u,t[10]=E,t[11]=e,t[12]=C,t[13]=I):I=t[13],I});It.displayName=qt.displayName;function no(i){const{data:e,colors:t,mapData:d,mapColorLegendTitle:E,colorDomain:n,radius:w,height:k,width:u,scale:g,centerPoint:D,tooltip:C,showLabels:I,mapBorderWidth:oe,mapBorderColor:re,mapNoDataColor:ge,onSeriesMouseOver:K,showColorScale:$e,zoomScaleExtend:We,zoomTranslateExtend:Ae,highlightedDataPoints:Oe,onSeriesMouseClick:F,resetSelectionOnDoubleClick:Me,detailsOnClick:Z,styles:O,classNames:ie,mapProjection:ae,zoomInteraction:Q,animate:v,dimmedOpacity:T,customLayers:fe,maxRadiusValue:ye,categorical:ne,dotColor:ee,collapseColorScaleByDefault:qe,highlightedIds:se,mapProperty:ve,dotLegendTitle:je,dotBorderColor:Ie,labelColor:Pe}=i,[P,z]=m.useState(void 0),[b,j]=m.useState(qe===void 0?!(u<680):!qe),le=m.useRef(null),[ce,te]=m.useState(void 0),[ze,M]=m.useState(void 0),[de,q]=m.useState(void 0),[be,W]=m.useState(void 0),L=m.useRef(null),A=Xt.useInView(L,{once:v.once,amount:v.amount}),Ee=m.useRef(null),_=e.filter(o=>o.radius===void 0||o.radius===null).length!==e.length?At.sqrt().domain([0,ye]).range([.25,w]).nice():void 0,Ue=ne?Ut.ordinal().domain(n).range(t):Gt.threshold().domain(n).range(t);m.useEffect(()=>{const o=wt.select(Ee.current),a=wt.select(L.current),$=p=>{if(Q==="noZoom")return!1;if(Q==="button")return!p.type.includes("wheel");const l=p.type==="wheel",R=p.type.startsWith("touch"),x=p.type==="mousedown"||p.type==="mousemove";return R?!0:l?Q==="scroll"?!0:p.ctrlKey:x&&!p.button&&!p.ctrlKey},s=xe.zoom().scaleExtent(We).translateExtent(Ae||[[-20,-20],[u+20,k+20]]).filter($).on("zoom",({transform:p})=>{o.attr("transform",p)});a.call(s),le.current=s},[k,u,Q]);const S=xe.turf_bbox_default(d),V=Bt.turf_center_of_mass_default(d),U=S[2]-S[0],Le=S[3]-S[1],_e=u*190/960*360/U,Ve=k*190/678*180/Le,G=g*Math.min(_e,Ve),B=ae==="mercator"?xe.geoMercator().rotate([0,0]).center(D||V.geometry.coordinates).translate([u/2,k/2]).scale(G):ae==="equalEarth"?xe.geoEqualEarth().rotate([0,0]).center(D||V.geometry.coordinates).translate([u/2,k/2]).scale(G):ae==="naturalEarth"?xe.geoNaturalEarth1().rotate([0,0]).center(D||V.geometry.coordinates).translate([u/2,k/2]).scale(G):ae==="orthographic"?xe.geoOrthographic().rotate([0,0]).center(D||V.geometry.coordinates).translate([u/2,k/2]).scale(G):xe.geoAlbersUsa().rotate([0,0]).center(D||V.geometry.coordinates).translate([u/2,k/2]).scale(G),we=o=>{if(!L.current||!le.current)return;wt.select(L.current).call(le.current.scaleBy,o==="in"?1.2:1/1.2)};return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r.jsxRuntimeExports.jsx(he.motion.svg,{width:`${u}px`,height:`${k}px`,viewBox:`0 0 ${u} ${k}`,ref:L,direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{ref:Ee,children:[fe.filter(o=>o.position==="before").map(o=>o.layer),d.features.map((o,a)=>e.findIndex(s=>s.id===o.properties[ve])!==-1?null:r.jsxRuntimeExports.jsx("g",{opacity:P?T:se.length!==0?se.indexOf(o.properties[ve])!==-1?1:T:1,children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((s,p)=>{let l="";return s.forEach(R=>{let x=" M";R.forEach((f,ue)=>{const N=B([f[0],f[1]]);ue!==R.length-1?x=`${x}${N[0]} ${N[1]}L`:x=`${x}${N[0]} ${N[1]}`}),l+=x}),r.jsxRuntimeExports.jsx("path",{d:l,style:{stroke:re,strokeWidth:oe,fill:ge}},p)}):o.geometry.coordinates.map((s,p)=>{let l="M";return s.forEach((R,x)=>{const f=B([R[0],R[1]]);x!==s.length-1?l=`${l}${f[0]} ${f[1]}L`:l=`${l}${f[0]} ${f[1]}`}),r.jsxRuntimeExports.jsx("path",{d:l,style:{stroke:re,strokeWidth:oe,fill:ge}},p)})},a)),r.jsxRuntimeExports.jsxs(Yt.AnimatePresence,{children:[e.filter(o=>o.id).map(o=>{const a=d.features.findIndex(s=>o.id===s.properties[ve]),$=lt.checkIfNullOrUndefined(o.x)?ge:Ue(o.x);return r.jsxRuntimeExports.jsx(he.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:P?P===$?1:T:se.length!==0?se.indexOf(o.id)!==-1?1:T:1,transition:{duration:v.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{opacity:0,transition:{duration:v.duration}},onMouseEnter:s=>{M(o),W(s.clientY),q(s.clientX),K?.(o)},onMouseMove:s=>{M(o),W(s.clientY),q(s.clientX)},onMouseLeave:()=>{M(void 0),q(void 0),W(void 0),K?.(void 0)},onClick:()=>{(F||Z)&&(Nt.isEqual(ce,o)&&Me?(te(void 0),F?.(void 0)):(te(o),F?.(o)))},children:a===-1?null:d.features[a].geometry.type==="MultiPolygon"?d.features[a].geometry.coordinates.map((s,p)=>{let l="";return s.forEach(R=>{let x=" M";R.forEach((f,ue)=>{const N=B([f[0],f[1]]);ue!==R.length-1?x=`${x}${N[0]} ${N[1]}L`:x=`${x}${N[0]} ${N[1]}`}),l+=x}),r.jsxRuntimeExports.jsx(he.motion.path,{d:l,variants:{initial:{fill:$,opacity:0},whileInView:{fill:$,opacity:1,transition:{duration:v.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{opacity:0,transition:{duration:v.duration}},style:{stroke:re,strokeWidth:oe}},`${o.id}-${p}`)}):d.features[a].geometry.coordinates.map((s,p)=>{let l="M";return s.forEach((R,x)=>{const f=B([R[0],R[1]]);x!==s.length-1?l=`${l}${f[0]} ${f[1]}L`:l=`${l}${f[0]} ${f[1]}`}),r.jsxRuntimeExports.jsx(he.motion.path,{d:l,variants:{initial:{fill:$,opacity:0},whileInView:{fill:$,opacity:1,transition:{duration:v.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{opacity:0,transition:{duration:v.duration}},style:{stroke:re,strokeWidth:oe}},`${o.id}-${p}`)})},o.id)}),e.filter(o=>!lt.checkIfNullOrUndefined(o.lat)&&!lt.checkIfNullOrUndefined(o.long)).map(o=>r.jsxRuntimeExports.jsxs(he.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:Oe.length!==0?Oe.indexOf(o.label||"")!==-1?1:T:1,transition:{duration:v.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{opacity:0,transition:{duration:v.duration}},onMouseEnter:a=>{M(o),W(a.clientY),q(a.clientX),K?.(o)},onMouseMove:a=>{M(o),W(a.clientY),q(a.clientX)},onMouseLeave:()=>{M(void 0),q(void 0),W(void 0),K?.(void 0)},onClick:()=>{(F||Z)&&(Nt.isEqual(ce,o)&&Me?(te(void 0),F?.(void 0)):(te(o),F?.(o)))},transform:`translate(${B([o.long,o.lat])[0]},${B([o.long,o.lat])[1]})`,children:[r.jsxRuntimeExports.jsx(he.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:ee,stroke:Ie||ee},whileInView:{r:_?_(o.radius||0):w,fill:ee,stroke:Ie||ee,transition:{duration:v.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{r:0,transition:{duration:v.duration}},style:{fillOpacity:.8}}),I&&o.label?r.jsxRuntimeExports.jsx(he.motion.text,{variants:{initial:{opacity:0,x:_?_(o.radius||0):w},whileInView:{opacity:1,x:_?_(o.radius||0):w,transition:{duration:v.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{opacity:0,transition:{duration:v.duration}},y:0,className:"text-sm",style:{textAnchor:"start",fill:Pe||"#000"},dx:4,dy:5,children:o.label}):null]},o.label||`${o.lat}-${o.long}`))]}),fe.filter(o=>o.position==="after").map(o=>o.layer)]})}),$e===!1?null:r.jsxRuntimeExports.jsx("div",{className:r.mo("absolute left-4 bottom-4 map-color-legend",ie?.colorLegend),children:b?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{j(!1)},children:r.jsxRuntimeExports.jsx(kt.X,{})}),r.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:ne?void 0:"340px"},children:[je&&je!==""?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:ee}}),r.jsxRuntimeExports.jsx(Et.j,{size:"xs",marginBottom:"none",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:je})]}),r.jsxRuntimeExports.jsx(Dt.n,{size:"xl"}),r.jsxRuntimeExports.jsx(It,{}),r.jsxRuntimeExports.jsx(Dt.n,{size:"xl"})]}):null,E&&E!==""?r.jsxRuntimeExports.jsx(Et.j,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:E}):null,ne?r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:n.map((o,a)=>r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{z(t[a%t.length])},onMouseLeave:()=>{z(void 0)},children:[r.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t[a%t.length]}}),r.jsxRuntimeExports.jsx(Et.j,{size:"sm",marginBottom:"none",leading:"none",children:o})]},a))}):r.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{children:[n.map((o,a)=>r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{z(t[a])},onMouseLeave:()=>{z(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:a*320/t.length+1,y:1,width:320/t.length-2,height:8,className:P===t[a]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:t[a],...P===t[a]?{}:{stroke:t[a]}}}),r.jsxRuntimeExports.jsx("text",{x:(a+1)*320/t.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Ht.numberFormattingFunction(o,"NA")})]},a)),r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{z(t[n.length])},onMouseLeave:()=>{z(void 0)},x:n.length*320/t.length+1,y:1,width:320/t.length-2,height:8,className:`cursor-pointer ${P===t[n.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:t[n.length],...P===t[n.length]?{}:{stroke:t[n.length]}}})})]})})]})]}):r.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{j(!0)},children:r.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),Q==="button"&&r.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[r.jsxRuntimeExports.jsx("button",{onClick:()=>we("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),r.jsxRuntimeExports.jsx("button",{onClick:()=>we("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),Z&&ce!==void 0?r.jsxRuntimeExports.jsx(Wt.DetailsModal,{body:Z,data:ce,setData:te,className:ie?.modal}):null,ze&&C&&de&&be?r.jsxRuntimeExports.jsx(Tt.Tooltip,{data:ze,body:C,xPos:de,yPos:be,backgroundStyle:O?.tooltip,className:ie?.tooltip}):null]})}function so(i){const e=r.compilerRuntimeExports.c(131),{data:t,mapData:d,graphTitle:E,colors:n,sources:w,graphDescription:k,height:u,width:g,footNote:D,mapColorLegendTitle:C,colorDomain:I,choroplethScaleType:oe,radius:re,scale:ge,centerPoint:K,padding:$e,mapBorderWidth:We,mapNoDataColor:Ae,backgroundColor:Oe,showLabels:F,mapBorderColor:Me,tooltip:Z,relativeHeight:O,onSeriesMouseOver:ie,isWorldMap:ae,showColorScale:Q,zoomScaleExtend:v,zoomTranslateExtend:T,graphID:fe,highlightedDataPoints:ye,onSeriesMouseClick:ne,graphDownload:ee,dataDownload:qe,showAntarctica:se,language:ve,minHeight:je,theme:Ie,ariaLabel:Pe,resetSelectionOnDoubleClick:P,detailsOnClick:z,styles:b,classNames:j,mapProjection:le,zoomInteraction:ce,animate:te,dimmedOpacity:ze,customLayers:M,maxRadiusValue:de,timeline:q,collapseColorScaleByDefault:be,dotColor:W,highlightedIds:L,mapProperty:A,dotLegendTitle:Ee,dotBorderColor:_,labelColor:Ue}=i,S=d===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json":d,V=D===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":D,U=oe===void 0?"threshold":oe,Le=re===void 0?5:re,_e=ge===void 0?.95:ge,Ve=We===void 0?.5:We,G=Ae===void 0?De.Colors.light.graphNoData:Ae,B=Oe===void 0?!1:Oe,we=F===void 0?!1:F,o=Me===void 0?De.Colors.light.grays["gray-500"]:Me,a=ae===void 0?!0:ae,$=Q===void 0?!0:Q;let s;e[0]!==v?(s=v===void 0?[.8,6]:v,e[0]=v,e[1]=s):s=e[1];const p=s;let l;e[2]!==ye?(l=ye===void 0?[]:ye,e[2]=ye,e[3]=l):l=e[3];const R=l,x=ee===void 0?!1:ee,f=qe===void 0?!1:qe,ue=se===void 0?!1:se,N=ve===void 0?"en":ve,H=je===void 0?0:je,me=Ie===void 0?"light":Ie,ct=P===void 0?!0:P,dt=ce===void 0?"button":ce,Ge=te===void 0?!1:te,ut=ze===void 0?.3:ze;let He;e[4]!==M?(He=M===void 0?[]:M,e[4]=M,e[5]=He):He=e[5];const mt=He;let Xe;e[6]!==q?(Xe=q===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:q,e[6]=q,e[7]=Xe):Xe=e[7];const c=Xe,pt=W===void 0?De.Colors.primaryColors["blue-600"]:W;let Ye;e[8]!==L?(Ye=L===void 0?[]:L,e[8]=L,e[9]=Ye):Ye=e[9];const xt=Ye,ht=A===void 0?"ISO3":A,gt=Ue===void 0?De.Colors.primaryColors["blue-600"]:Ue,[pe,Pt]=m.useState(0),[Be,zt]=m.useState(0),[X,Lt]=m.useState(c.autoplay);let Fe;if(e[10]!==t||e[11]!==c.dateFormat){let y;e[13]!==c.dateFormat?(y=J=>Ct.parse(`${J.date}`,c.dateFormat||"yyyy",new Date).getTime(),e[13]=c.dateFormat,e[14]=y):y=e[14],Fe=[...new Set(t.filter(vo).map(y))],Fe.sort(yo),e[10]=t,e[11]=c.dateFormat,e[12]=Fe}else Fe=e[12];const h=Fe,[Y,ft]=m.useState(c.autoplay?0:h.length-1),[ke,_t]=m.useState(void 0),yt=m.useRef(null),Rt=m.useRef(null);let Je;e[15]!==U||e[16]!==I||e[17]!==n?.length||e[18]!==t?(Je=I||(U==="categorical"?Qt.getUniqValue(t,"x"):eo.getJenks(t.map(fo),n?.length||4)),e[15]=U,e[16]=I,e[17]=n?.length,e[18]=t,e[19]=Je):Je=e[19];const Te=Je;let Ke,Ze;e[20]===Symbol.for("react.memo_cache_sentinel")?(Ke=()=>{const y=new ResizeObserver(J=>{Pt(J[0].target.clientWidth||620),zt(J[0].target.clientHeight||480)});return yt.current&&y.observe(yt.current),()=>y.disconnect()},Ze=[],e[20]=Ke,e[21]=Ze):(Ke=e[20],Ze=e[21]),m.useEffect(Ke,Ze);let Qe;e[22]===Symbol.for("react.memo_cache_sentinel")?(Qe=y=>{_t(y)},e[22]=Qe):Qe=e[22];const et=m.useEffectEvent(Qe);let tt;e[23]!==S||e[24]!==et?(tt=()=>{typeof S=="string"?Zt.fetchAndParseJSON(S).then(J=>{et(J)}):et(S)},e[23]=S,e[24]=et,e[25]=tt):tt=e[25];let ot;e[26]!==S?(ot=[S],e[26]=S,e[27]=ot):ot=e[27],m.useEffect(tt,ot);let rt,it;e[28]!==X||e[29]!==c.speed||e[30]!==h?(rt=()=>{const y=setInterval(()=>{ft(J=>J<h.length-1?J+1:0)},(c.speed||2)*1e3);return X||clearInterval(y),()=>clearInterval(y)},it=[h,X,c.speed],e[28]=X,e[29]=c.speed,e[30]=h,e[31]=rt,e[32]=it):(rt=e[31],it=e[32]),m.useEffect(rt,it);const vt=c.dateFormat||"yyyy";let at;e[33]!==Y||e[34]!==vt||e[35]!==c.showOnlyActiveDate||e[36]!==h?(at=St.getSliderMarks(h,Y,c.showOnlyActiveDate,vt),e[33]=Y,e[34]=vt,e[35]=c.showOnlyActiveDate,e[36]=h,e[37]=at):at=e[37];const nt=at,jt=j?.graphContainer,bt=b?.graphContainer;let Re;e[38]!==j?.description||e[39]!==j?.title||e[40]!==t||e[41]!==f||e[42]!==k||e[43]!==x||e[44]!==E||e[45]!==b?.description||e[46]!==b?.title||e[47]!==g?(Re=E||k||x||f?r.jsxRuntimeExports.jsx(Kt.GraphHeader,{styles:{title:b?.title,description:b?.description},classNames:{title:j?.title,description:j?.description},graphTitle:E,graphDescription:k,width:g,graphDownload:x?Rt:void 0,dataDownload:f?t.map(go).filter(ho).length>0?t.map(xo).filter(po):t.filter(mo):null}):null,e[38]=j?.description,e[39]=j?.title,e[40]=t,e[41]=f,e[42]=k,e[43]=x,e[44]=E,e[45]=b?.description,e[46]=b?.title,e[47]=g,e[48]=Re):Re=e[48];let Ce;e[49]!==Y||e[50]!==nt||e[51]!==X||e[52]!==c.enabled||e[53]!==h?(Ce=c.enabled&&h.length>0&&nt?r.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[r.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Lt(!X)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":X?"Click to pause animation":"Click to play animation",children:X?r.jsxRuntimeExports.jsx(kt.Pause,{}):r.jsxRuntimeExports.jsx(kt.Play,{})}),r.jsxRuntimeExports.jsx(St.Nr,{min:h[0],max:h[h.length-1],marks:nt,step:null,defaultValue:h[h.length-1],value:h[Y],onChangeComplete:y=>{ft(h.indexOf(y))},onChange:y=>{ft(h.indexOf(y))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[49]=Y,e[50]=nt,e[51]=X,e[52]=c.enabled,e[53]=h,e[54]=Ce):Ce=e[54];let Se;e[55]!==Ge||e[56]!==K||e[57]!==U||e[58]!==j||e[59]!==be||e[60]!==n||e[61]!==mt||e[62]!==t||e[63]!==z||e[64]!==ut||e[65]!==Te||e[66]!==_||e[67]!==pt||e[68]!==Ee||e[69]!==u||e[70]!==R||e[71]!==xt||e[72]!==Y||e[73]!==a||e[74]!==gt||e[75]!==o||e[76]!==Ve||e[77]!==C||e[78]!==G||e[79]!==le||e[80]!==ht||e[81]!==ke||e[82]!==de||e[83]!==H||e[84]!==ne||e[85]!==ie||e[86]!==Le||e[87]!==O||e[88]!==ct||e[89]!==_e||e[90]!==ue||e[91]!==$||e[92]!==we||e[93]!==b||e[94]!==Be||e[95]!==pe||e[96]!==me||e[97]!==c.dateFormat||e[98]!==c.enabled||e[99]!==Z||e[100]!==h||e[101]!==g||e[102]!==dt||e[103]!==p||e[104]!==T?(Se=r.jsxRuntimeExports.jsx($t.GraphArea,{ref:yt,children:pe&&Be&&ke?r.jsxRuntimeExports.jsx(no,{dotColor:pt,data:t.filter(y=>c.enabled?y.date===Ct.format(new Date(h[Y]),c.dateFormat||"yyyy"):y),mapData:ue?ke:{...ke,features:ke.features.filter(uo)},colorDomain:Te,width:pe,height:Be,scale:_e,centerPoint:K,colors:n||(U==="categorical"?De.Colors[me].sequentialColors[`neutralColorsx0${Te.length}`]:De.Colors[me].sequentialColors[`neutralColorsx0${Te.length+1}`]),mapColorLegendTitle:C,radius:Le,categorical:U==="categorical",mapBorderWidth:Ve,mapNoDataColor:G,mapBorderColor:o,tooltip:Z,onSeriesMouseOver:ie,showLabels:we,isWorldMap:a,showColorScale:$,zoomScaleExtend:p,zoomTranslateExtend:T,onSeriesMouseClick:ne,highlightedDataPoints:R,resetSelectionOnDoubleClick:ct,styles:b,classNames:j,zoomInteraction:dt,detailsOnClick:z,mapProjection:le||(a?"naturalEarth":"mercator"),animate:Ge===!0?{duration:.5,once:!0,amount:.5}:Ge||{duration:0,once:!0,amount:0},dimmedOpacity:ut,customLayers:mt,maxRadiusValue:lt.checkIfNullOrUndefined(de)?Math.max(...t.map(co).filter(lo)):de,collapseColorScaleByDefault:be,highlightedIds:xt,mapProperty:ht,dotLegendTitle:Ee,dotBorderColor:_,labelColor:gt}):r.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(H,u||(O?H?(g||pe)*O>H?(g||pe)*O:H:(g||pe)*O:Be))}px`},className:"flex items-center justify-center",children:r.jsxRuntimeExports.jsx(Vt.w,{"aria-label":"Loading graph"})})}),e[55]=Ge,e[56]=K,e[57]=U,e[58]=j,e[59]=be,e[60]=n,e[61]=mt,e[62]=t,e[63]=z,e[64]=ut,e[65]=Te,e[66]=_,e[67]=pt,e[68]=Ee,e[69]=u,e[70]=R,e[71]=xt,e[72]=Y,e[73]=a,e[74]=gt,e[75]=o,e[76]=Ve,e[77]=C,e[78]=G,e[79]=le,e[80]=ht,e[81]=ke,e[82]=de,e[83]=H,e[84]=ne,e[85]=ie,e[86]=Le,e[87]=O,e[88]=ct,e[89]=_e,e[90]=ue,e[91]=$,e[92]=we,e[93]=b,e[94]=Be,e[95]=pe,e[96]=me,e[97]=c.dateFormat,e[98]=c.enabled,e[99]=Z,e[100]=h,e[101]=g,e[102]=dt,e[103]=p,e[104]=T,e[105]=Se):Se=e[105];let Ne;e[106]!==j?.footnote||e[107]!==j?.source||e[108]!==V||e[109]!==w||e[110]!==b?.footnote||e[111]!==b?.source||e[112]!==g?(Ne=w||V?r.jsxRuntimeExports.jsx(Jt.GraphFooter,{styles:{footnote:b?.footnote,source:b?.source},classNames:{footnote:j?.footnote,source:j?.source},sources:w,footNote:V,width:g}):null,e[106]=j?.footnote,e[107]=j?.source,e[108]=V,e[109]=w,e[110]=b?.footnote,e[111]=b?.source,e[112]=g,e[113]=Ne):Ne=e[113];let st;return e[114]!==Pe||e[115]!==B||e[116]!==fe||e[117]!==u||e[118]!==N||e[119]!==H||e[120]!==$e||e[121]!==O||e[122]!==jt||e[123]!==bt||e[124]!==Re||e[125]!==Ce||e[126]!==Se||e[127]!==Ne||e[128]!==me||e[129]!==g?(st=r.jsxRuntimeExports.jsxs($t.GraphContainer,{className:jt,style:bt,id:fe,ref:Rt,"aria-label":Pe,backgroundColor:B,theme:me,language:N,minHeight:H,width:g,height:u,relativeHeight:O,padding:$e,children:[Re,Ce,Se,Ne]}),e[114]=Pe,e[115]=B,e[116]=fe,e[117]=u,e[118]=N,e[119]=H,e[120]=$e,e[121]=O,e[122]=jt,e[123]=bt,e[124]=Re,e[125]=Ce,e[126]=Se,e[127]=Ne,e[128]=me,e[129]=g,e[130]=st):st=e[130],st}function lo(i){return i!=null}function co(i){return i.radius}function uo(i){return i.properties.NAME!=="Antarctica"}function mo(i){return i!==void 0}function po(i){return i!==void 0}function xo(i){return i.data}function ho(i){return i!==void 0}function go(i){return i.data}function fo(i){return i.x}function yo(i,e){return i-e}function vo(i){return i.date}exports.HybridMap=so;
|
|
2
2
|
//# sourceMappingURL=HybridMap.cjs.map
|
package/dist/HybridMap.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as Ae from "react";
|
|
|
3
3
|
import Fe, { useState as z, useRef as Tt, useEffect as se, useEffectEvent as Te } from "react";
|
|
4
4
|
import { f as Re, p as qe } from "./parse-DlCRUFh_.js";
|
|
5
5
|
import { g as Ge, N as He } from "./getSliderMarks-HIDJ0_Cd.js";
|
|
6
|
-
import { w as Ue } from "./Spinner-
|
|
6
|
+
import { w as Ue } from "./Spinner-DVBnY6Vg.js";
|
|
7
7
|
import { i as De } from "./index-Bwrro8-q.js";
|
|
8
8
|
import { z as Xe, t as Ye, g as Je, a as Ke, b as Ze, c as Qe, d as to } from "./zoom-C9MFjAaV.js";
|
|
9
9
|
import { j as je } from "./Typography-PxtFcnJb.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-CHPV5EwG-CTPQjnHt.cjs"),n=require("react"),h=require("./Spinner-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-CHPV5EwG-CTPQjnHt.cjs"),n=require("react"),h=require("./Spinner-CQZcjzwd.cjs"),c=require("./MultiGraphDashboard.cjs"),g=require("./fetchAndParseData-l5HGMAEs.cjs");function b(f){const t=d.compilerRuntimeExports.c(18),{config:a}=f,[e,l]=n.useState(void 0);let r,o;if(t[0]!==a?(r=()=>{(async()=>{if(typeof a=="string"){const u=await g.fetchAndParseJSON(a);l(u)}else l(a)})()},o=[a],t[0]=a,t[1]=r,t[2]=o):(r=t[1],o=t[2]),n.useEffect(r,o),!e){let s;return t[3]===Symbol.for("react.memo_cache_sentinel")?(s=d.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:d.jsxRuntimeExports.jsx(h.w,{})}),t[3]=s):s=t[3],s}let i;return t[4]!==e.dashboardID||t[5]!==e.dashboardLayout||t[6]!==e.dataFilters||t[7]!==e.dataSettings||t[8]!==e.debugMode||t[9]!==e.filterPosition||t[10]!==e.filters||t[11]!==e.graphClassNames||t[12]!==e.graphStyles||t[13]!==e.noOfFiltersPerRow||t[14]!==e.readableHeader||t[15]!==e.theme||t[16]!==e.uiMode?(i=d.jsxRuntimeExports.jsx(c.MultiGraphDashboard,{dashboardID:e.dashboardID,dashboardLayout:e.dashboardLayout,dataSettings:e.dataSettings,filters:e.filters,debugMode:e.debugMode,theme:e.theme,readableHeader:e.readableHeader,dataFilters:e.dataFilters,noOfFiltersPerRow:e.noOfFiltersPerRow,filterPosition:e.filterPosition,uiMode:e.uiMode,graphStyles:e.graphStyles,graphClassNames:e.graphClassNames}),t[4]=e.dashboardID,t[5]=e.dashboardLayout,t[6]=e.dataFilters,t[7]=e.dataSettings,t[8]=e.debugMode,t[9]=e.filterPosition,t[10]=e.filters,t[11]=e.graphClassNames,t[12]=e.graphStyles,t[13]=e.noOfFiltersPerRow,t[14]=e.readableHeader,t[15]=e.theme,t[16]=e.uiMode,t[17]=i):i=t[17],i}exports.MultiGraphDashboardFromConfig=b;
|
|
2
2
|
//# sourceMappingURL=MultiGraphDashboardFromConfig.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as h, j as d } from "./index-CHPV5EwG-Curnpaqc.js";
|
|
2
2
|
import { useState as m, useEffect as g } from "react";
|
|
3
|
-
import { w as u } from "./Spinner-
|
|
3
|
+
import { w as u } from "./Spinner-DVBnY6Vg.js";
|
|
4
4
|
import { MultiGraphDashboard as c } from "./MultiGraphDashboard.js";
|
|
5
5
|
import { f as p } from "./fetchAndParseData-BpqkBPQL.js";
|
|
6
6
|
function P(f) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),n=require("react"),D=require("./DropdownSelect-Doz3mCrM.cjs"),W=require("./checkIfMultiple-wg6hJLXy.cjs"),k=require("./Spinner-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),n=require("react"),D=require("./DropdownSelect-Doz3mCrM.cjs"),W=require("./checkIfMultiple-wg6hJLXy.cjs"),k=require("./Spinner-CQZcjzwd.cjs"),q=require("./SingleGraphDashboard.cjs"),m=require("./fetchAndParseData-l5HGMAEs.cjs"),A=require("./GraphHeader.cjs"),V=require("./filterData-T5DQBE9b.cjs");function G(u,d,e,t){const s=[];return u.forEach(c=>{Object.entries(c).forEach(([l,p])=>{if(l!==d){const g={indicator:e.findIndex(h=>h.value===l)!==-1?e[e.findIndex(h=>h.value===l)].label:l,value:p};g[d]=c[d],s.push(g)}})}),t&&console.log(s),s}const x=u=>u.map(t=>t.columnWidth||1).reduce((t,s)=>t+s,0);function H(u){const{dashboardID:d,dashboardLayout:e,dataSettings:t,debugMode:s,theme:c="light",readableHeader:l,dataFilters:p,uiMode:g="normal",graphStyles:h,graphClassNames:w}=u,C={ignoreCase:!0,ignoreAccents:!0,trim:!0},[v,E]=n.useState(void 0),[R,S]=n.useState([]),[f,j]=n.useState(void 0),[b,T]=n.useState(void 0),[F,I]=n.useState(void 0),y=n.useEffectEvent(()=>{const r=V.filterData(F,p||[]);S(r.map(a=>a[t.keyColumn])),j(r[0][t.keyColumn]);const o=G(r,t.keyColumn,l||[],s);T(o)}),L=n.useEffectEvent(()=>{if(b){const r=b.filter(o=>o[t.keyColumn]===f);E(r)}});return n.useEffect(()=>{L()},[f,t.keyColumn]),n.useEffect(()=>{(async()=>{try{const o=t.dataURL?typeof t.dataURL=="string"?t.fileType==="json"?await m.fetchAndParseJSON(t.dataURL,void 0,t.dataTransformation,s):t.fileType==="api"?await m.fetchAndTransformDataFromAPI(t.dataURL,t.apiHeaders,void 0,t.dataTransformation,s):await m.fetchAndParseCSV(t.dataURL,t.dataTransformation,void 0,s,t.delimiter,!0):await m.fetchAndParseMultipleDataSources(t.dataURL,t.idColumnTitle):await m.transformColumnsToArray(t.data,void 0);I(o),y()}catch(o){console.error("Data fetching error:",o)}})()},[t,s]),n.useEffect(()=>{y()},[p,l]),i.jsxRuntimeExports.jsx("div",{className:`${c||"light"} flex grow`,dir:e.language==="he"||e.language==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:`${e?.backgroundColor?e?.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}flex flex-col w-full ml-auto mr-auto grow gap-4 ${e?.language||"en"}`,style:{...e?.backgroundColor&&e?.backgroundColor!==!0?{backgroundColor:e?.backgroundColor}:{}},id:d,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:e.backgroundColor?e.padding||"1rem":e.padding||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[e.title||e.description?i.jsxRuntimeExports.jsx(A.GraphHeader,{graphTitle:e.title,graphDescription:e.description,isDashboard:!0}):null,v?i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:i.jsxRuntimeExports.jsxs("div",{style:{width:"100%",flexGrow:1,flexShrink:0,minWidth:"240px"},children:[e.dropdownLabel?i.jsxRuntimeExports.jsx(W.b,{className:"mb-2",children:e.dropdownLabel}):null,i.jsxRuntimeExports.jsx(D.ja,{options:R.map(r=>({value:r,label:r})),size:"sm",variant:g,isClearable:!1,isSearchable:!0,controlShouldRenderValue:!0,filterOption:D.Du(C),onChange:r=>{j(r?.value)},defaultValue:{value:f,label:f}})]})}),e.rows.map((r,o)=>i.jsxRuntimeExports.jsx("div",{style:{display:"flex",gap:"1rem",alignItems:"stretch",minHeight:`${r.height||0}px`,height:"auto",width:"100%",flexWrap:"wrap"},children:r.columns.map((a,N)=>i.jsxRuntimeExports.jsx("div",{className:"flex bg-transparent grow min-w-60",style:{width:`calc(${100*(a.columnWidth||1)/x(r.columns)}% - ${(x(r.columns)-(a.columnWidth||1))/x(r.columns)}rem)`,minHeight:"inherit"},children:i.jsxRuntimeExports.jsx(q.SingleGraphDashboard,{graphType:a.graphType,dataFilters:a.dataFilters,uiMode:g,graphSettings:{...a.settings||{},width:void 0,height:void 0,minHeight:void 0,relativeHeight:void 0,radius:a.graphType==="donutChart"?void 0:a.settings?.radius,size:a.graphType==="unitChart"?a.settings.size:void 0,language:a.settings?.language||e.language,theme:a.settings?.theme||c,styles:a.settings?.styles||h,classNames:a.settings?.classNames||w},dataSettings:{data:v},graphDataConfiguration:a.graphDataConfiguration?a.graphDataConfiguration:a.graphType==="unitChart"?[{columnId:"indicator",chartConfigId:"label"},{columnId:"value",chartConfigId:"value"}]:[{columnId:"indicator",chartConfigId:"label"},{columnId:"value",chartConfigId:"size"}],debugMode:s,readableHeader:l||[]})},N))},o))]}):i.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:i.jsxRuntimeExports.jsx(k.w,{})})]})})})})}exports.MultiGraphDashboardWideToLongFormat=H;
|
|
2
2
|
//# sourceMappingURL=MultiGraphDashboardWideToLongFormat.cjs.map
|
|
@@ -2,7 +2,7 @@ import { j as i } from "./index-CHPV5EwG-Curnpaqc.js";
|
|
|
2
2
|
import { useState as g, useEffectEvent as w, useEffect as p } from "react";
|
|
3
3
|
import { j as A, D as E } from "./DropdownSelect-BbdPQa2k.js";
|
|
4
4
|
import { b as R } from "./checkIfMultiple-CIRtG0KE.js";
|
|
5
|
-
import { w as V } from "./Spinner-
|
|
5
|
+
import { w as V } from "./Spinner-DVBnY6Vg.js";
|
|
6
6
|
import { SingleGraphDashboard as U } from "./SingleGraphDashboard.js";
|
|
7
7
|
import { f as H, a as $, b as z, c as G, t as M } from "./fetchAndParseData-BpqkBPQL.js";
|
|
8
8
|
import { GraphHeader as P } from "./GraphHeader.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),l=require("react"),g=require("./Spinner-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),l=require("react"),g=require("./Spinner-CQZcjzwd.cjs"),c=require("./MultiGraphDashboardWideToLongFormat.cjs"),m=require("./fetchAndParseData-l5HGMAEs.cjs");function b(u){const e=i.compilerRuntimeExports.c(15),{config:t}=u,[a,n]=l.useState(void 0);let r,o;if(e[0]!==t?(r=()=>{(async()=>{if(typeof t=="string"){const h=await m.fetchAndParseJSON(t);n(h)}else n(t)})()},o=[t],e[0]=t,e[1]=r,e[2]=o):(r=e[1],o=e[2]),l.useEffect(r,o),!a){let s;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:i.jsxRuntimeExports.jsx(g.w,{})}),e[3]=s):s=e[3],s}let d;return e[4]!==a.dashboardID||e[5]!==a.dashboardLayout||e[6]!==a.dataFilters||e[7]!==a.dataSettings||e[8]!==a.debugMode||e[9]!==a.graphClassNames||e[10]!==a.graphStyles||e[11]!==a.readableHeader||e[12]!==a.theme||e[13]!==a.uiMode?(d=i.jsxRuntimeExports.jsx(c.MultiGraphDashboardWideToLongFormat,{dashboardID:a.dashboardID,dashboardLayout:a.dashboardLayout,dataSettings:a.dataSettings,debugMode:a.debugMode,theme:a.theme,readableHeader:a.readableHeader,dataFilters:a.dataFilters,uiMode:a.uiMode,graphStyles:a.graphStyles,graphClassNames:a.graphClassNames}),e[4]=a.dashboardID,e[5]=a.dashboardLayout,e[6]=a.dataFilters,e[7]=a.dataSettings,e[8]=a.debugMode,e[9]=a.graphClassNames,e[10]=a.graphStyles,e[11]=a.readableHeader,e[12]=a.theme,e[13]=a.uiMode,e[14]=d):d=e[14],d}exports.MultiGraphDashboardWideToLongFormatFromConfig=b;
|
|
2
2
|
//# sourceMappingURL=MultiGraphDashboardWideToLongFormatFromConfig.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as m, j as i } from "./index-CHPV5EwG-Curnpaqc.js";
|
|
2
2
|
import { useState as f, useEffect as g } from "react";
|
|
3
|
-
import { w as u } from "./Spinner-
|
|
3
|
+
import { w as u } from "./Spinner-DVBnY6Vg.js";
|
|
4
4
|
import { MultiGraphDashboardWideToLongFormat as c } from "./MultiGraphDashboardWideToLongFormat.js";
|
|
5
5
|
import { f as p } from "./fetchAndParseData-BpqkBPQL.js";
|
|
6
6
|
function D(n) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-CTPQjnHt.cjs"),l=require("react"),h=require("./Spinner-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-CTPQjnHt.cjs"),l=require("react"),h=require("./Spinner-CQZcjzwd.cjs"),c=require("./PerformanceIntensiveMultiGraphDashboard.cjs"),g=require("./fetchAndParseData-l5HGMAEs.cjs");function m(f){const t=n.compilerRuntimeExports.c(18),{config:a}=f,[e,d]=l.useState(void 0);let s,o;if(t[0]!==a?(s=()=>{(async()=>{if(typeof a=="string"){const u=await g.fetchAndParseJSON(a);d(u)}else d(a)})()},o=[a],t[0]=a,t[1]=s,t[2]=o):(s=t[1],o=t[2]),l.useEffect(s,o),!e){let r;return t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:n.jsxRuntimeExports.jsx(h.w,{})}),t[3]=r):r=t[3],r}let i;return t[4]!==e.dashboardID||t[5]!==e.dashboardLayout||t[6]!==e.dataFilters||t[7]!==e.dataSettings||t[8]!==e.debugMode||t[9]!==e.filterPosition||t[10]!==e.filters||t[11]!==e.graphClassNames||t[12]!==e.graphStyles||t[13]!==e.noOfFiltersPerRow||t[14]!==e.readableHeader||t[15]!==e.theme||t[16]!==e.uiMode?(i=n.jsxRuntimeExports.jsx(c.PerformanceIntensiveMultiGraphDashboard,{dashboardID:e.dashboardID,dashboardLayout:e.dashboardLayout,dataSettings:e.dataSettings,filters:e.filters,debugMode:e.debugMode,theme:e.theme,readableHeader:e.readableHeader,dataFilters:e.dataFilters,noOfFiltersPerRow:e.noOfFiltersPerRow,filterPosition:e.filterPosition,uiMode:e.uiMode,graphStyles:e.graphStyles,graphClassNames:e.graphClassNames}),t[4]=e.dashboardID,t[5]=e.dashboardLayout,t[6]=e.dataFilters,t[7]=e.dataSettings,t[8]=e.debugMode,t[9]=e.filterPosition,t[10]=e.filters,t[11]=e.graphClassNames,t[12]=e.graphStyles,t[13]=e.noOfFiltersPerRow,t[14]=e.readableHeader,t[15]=e.theme,t[16]=e.uiMode,t[17]=i):i=t[17],i}exports.PerformanceIntensiveMultiGraphDashboardFromConfig=m;
|
|
2
2
|
//# sourceMappingURL=PerformanceIntensiveMultiGraphDashboardFromConfig.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as h, j as d } from "./index-CHPV5EwG-Curnpaqc.js";
|
|
2
2
|
import { useState as m, useEffect as c } from "react";
|
|
3
|
-
import { w as g } from "./Spinner-
|
|
3
|
+
import { w as g } from "./Spinner-DVBnY6Vg.js";
|
|
4
4
|
import { PerformanceIntensiveMultiGraphDashboard as u } from "./PerformanceIntensiveMultiGraphDashboard.js";
|
|
5
5
|
import { f as p } from "./fetchAndParseData-BpqkBPQL.js";
|
|
6
6
|
function F(n) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-CTPQjnHt.cjs"),o=require("react"),te=require("./index-CyZ1lmi_.cjs"),q=require("./index-BS2TADPj.cjs"),le=require("./index-DQA8q5sC.cjs"),C=require("./DropdownSelect-Doz3mCrM.cjs"),d=require("./checkIfMultiple-wg6hJLXy.cjs"),ne=require("./Spinner-DRMBUsX7.cjs"),ie=require("./GraphContainer-d8A46BK2.cjs"),re=require("./GraphEl-C2Fgg8PA.cjs"),$=require("./fetchAndParseData-l5HGMAEs.cjs"),U=require("./transformDataForAggregation-CYoB5Xsk.cjs"),z=require("./getUniqValue-NX8DgwND.cjs"),se=require("./GraphHeader.cjs"),W=require("./filterData-T5DQBE9b.cjs"),oe=require("./getGraphList-CA17dvFB.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-CTPQjnHt.cjs"),o=require("react"),te=require("./index-CyZ1lmi_.cjs"),q=require("./index-BS2TADPj.cjs"),le=require("./index-DQA8q5sC.cjs"),C=require("./DropdownSelect-Doz3mCrM.cjs"),d=require("./checkIfMultiple-wg6hJLXy.cjs"),ne=require("./Spinner-CQZcjzwd.cjs"),ie=require("./GraphContainer-d8A46BK2.cjs"),re=require("./GraphEl-BixTEyKW.cjs"),$=require("./fetchAndParseData-l5HGMAEs.cjs"),U=require("./transformDataForAggregation-CYoB5Xsk.cjs"),z=require("./getUniqValue-NX8DgwND.cjs"),se=require("./GraphHeader.cjs"),W=require("./filterData-T5DQBE9b.cjs"),oe=require("./getGraphList-CA17dvFB.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
|
|
@@ -5,9 +5,9 @@ import { f as F } from "./index-EArKRVKg.js";
|
|
|
5
5
|
import { i as ua } from "./index-Bwrro8-q.js";
|
|
6
6
|
import { j as V, D as M } from "./DropdownSelect-BbdPQa2k.js";
|
|
7
7
|
import { b as A, y as H, h as O, c as da, $ as K, P as Q } from "./checkIfMultiple-CIRtG0KE.js";
|
|
8
|
-
import { w as ha } from "./Spinner-
|
|
8
|
+
import { w as ha } from "./Spinner-DVBnY6Vg.js";
|
|
9
9
|
import { G as ca } from "./GraphContainer-CRqzdKu2.js";
|
|
10
|
-
import { G as fa } from "./GraphEl-
|
|
10
|
+
import { G as fa } from "./GraphEl-Dyu_EIQb.js";
|
|
11
11
|
import { f as ga, a as pa, b as ma, c as Ca, t as va } from "./fetchAndParseData-BpqkBPQL.js";
|
|
12
12
|
import { a as Ia, t as ba } from "./transformDataForAggregation-j34UL73s.js";
|
|
13
13
|
import { g as X } from "./getUniqValue-DsqSii6M.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-CTPQjnHt.cjs"),g=require("react"),f=require("./Spinner-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-CTPQjnHt.cjs"),g=require("react"),f=require("./Spinner-CQZcjzwd.cjs"),h=require("./SingleGraphDashboard.cjs"),p=require("./fetchAndParseData-l5HGMAEs.cjs");function S(l){const e=s.compilerRuntimeExports.c(19),{config:a}=l,[t,d]=g.useState(void 0);let n,r;if(e[0]!==a?(n=()=>{(async()=>{if(typeof a=="string"){const c=await p.fetchAndParseJSON(a);d(c)}else d(a)})()},r=[a],e[0]=a,e[1]=n,e[2]=r):(n=e[1],r=e[2]),g.useEffect(n,r),!t){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:s.jsxRuntimeExports.jsx(f.w,{})}),e[3]=i):i=e[3],i}let o;return e[4]!==t.advancedDataSelectionOptions||e[5]!==t.dataFilters||e[6]!==t.dataSelectionOptions||e[7]!==t.dataSettings||e[8]!==t.dataTransform||e[9]!==t.debugMode||e[10]!==t.filters||e[11]!==t.graphDataConfiguration||e[12]!==t.graphSettings||e[13]!==t.graphType||e[14]!==t.highlightDataPointSettings||e[15]!==t.noOfFiltersPerRow||e[16]!==t.readableHeader||e[17]!==t.uiMode?(o=s.jsxRuntimeExports.jsx(h.SingleGraphDashboard,{graphSettings:t.graphSettings,dataSettings:t.dataSettings,filters:t.filters,graphType:t.graphType,dataTransform:t.dataTransform,graphDataConfiguration:t.graphDataConfiguration,dataFilters:t.dataFilters,debugMode:t.debugMode,dataSelectionOptions:t.dataSelectionOptions,advancedDataSelectionOptions:t.advancedDataSelectionOptions,readableHeader:t.readableHeader,noOfFiltersPerRow:t.noOfFiltersPerRow,uiMode:t.uiMode,highlightDataPointSettings:t.highlightDataPointSettings}),e[4]=t.advancedDataSelectionOptions,e[5]=t.dataFilters,e[6]=t.dataSelectionOptions,e[7]=t.dataSettings,e[8]=t.dataTransform,e[9]=t.debugMode,e[10]=t.filters,e[11]=t.graphDataConfiguration,e[12]=t.graphSettings,e[13]=t.graphType,e[14]=t.highlightDataPointSettings,e[15]=t.noOfFiltersPerRow,e[16]=t.readableHeader,e[17]=t.uiMode,e[18]=o):o=e[18],o}exports.SingleGraphDashboardFromConfig=S;
|
|
2
2
|
//# sourceMappingURL=SingleGraphDashboardFromConfig.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as f, j as s } from "./index-CHPV5EwG-Curnpaqc.js";
|
|
2
2
|
import { useState as p, useEffect as c } from "react";
|
|
3
|
-
import { w as h } from "./Spinner-
|
|
3
|
+
import { w as h } from "./Spinner-DVBnY6Vg.js";
|
|
4
4
|
import { SingleGraphDashboard as S } from "./SingleGraphDashboard.js";
|
|
5
5
|
import { f as m } from "./fetchAndParseData-BpqkBPQL.js";
|
|
6
6
|
function P(g) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-CTPQjnHt.cjs"),g=require("react"),d=require("./Spinner-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-CTPQjnHt.cjs"),g=require("react"),d=require("./Spinner-CQZcjzwd.cjs"),l=require("./SingleGraphDashboardGeoHubMaps.cjs"),f=require("./fetchAndParseData-l5HGMAEs.cjs");function h(c){const e=a.compilerRuntimeExports.c(9),{config:s}=c,[t,u]=g.useState(void 0);let o,i;if(e[0]!==s?(o=()=>{(async()=>{if(typeof s=="string"){const p=await f.fetchAndParseJSON(s);u(p)}else u(s)})()},i=[s],e[0]=s,e[1]=o,e[2]=i):(o=e[1],i=e[2]),g.useEffect(o,i),!t){let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:a.jsxRuntimeExports.jsx(d.w,{})}),e[3]=r):r=e[3],r}let n;return e[4]!==t.debugMode||e[5]!==t.graphSettings||e[6]!==t.graphType||e[7]!==t.uiMode?(n=a.jsxRuntimeExports.jsx(l.SingleGraphDashboardGeoHubMaps,{graphSettings:t.graphSettings,graphType:t.graphType,debugMode:t.debugMode,uiMode:t.uiMode}),e[4]=t.debugMode,e[5]=t.graphSettings,e[6]=t.graphType,e[7]=t.uiMode,e[8]=n):n=e[8],n}exports.SingleGraphDashboardGeoHubMapsFromConfig=h;
|
|
2
2
|
//# sourceMappingURL=SingleGraphDashboardGeoHubMapsFromConfig.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c, j as n } from "./index-CHPV5EwG-Curnpaqc.js";
|
|
2
2
|
import { useState as d, useEffect as u } from "react";
|
|
3
|
-
import { w as l } from "./Spinner-
|
|
3
|
+
import { w as l } from "./Spinner-DVBnY6Vg.js";
|
|
4
4
|
import { SingleGraphDashboardGeoHubMaps as m } from "./SingleGraphDashboardGeoHubMaps.js";
|
|
5
5
|
import { f as h } from "./fetchAndParseData-BpqkBPQL.js";
|
|
6
6
|
function j(f) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),u=require("react"),le=require("./index-CyZ1lmi_.cjs"),F=require("./index-BS2TADPj.cjs"),ie=require("./index-DQA8q5sC.cjs"),D=require("./DropdownSelect-Doz3mCrM.cjs"),g=require("./checkIfMultiple-wg6hJLXy.cjs"),oe=require("./Spinner-DRMBUsX7.cjs"),W=require("./Typography-DX7PlgQU.cjs"),ne=require("./ThreeDGlobe.cjs"),A=require("./fetchAndParseData-l5HGMAEs.cjs"),Z=require("./transformDataForAggregation-CYoB5Xsk.cjs"),J=require("./getUniqValue-NX8DgwND.cjs"),re=require("./GraphHeader.cjs"),K=require("./filterData-T5DQBE9b.cjs"),se=require("./getGraphList-CA17dvFB.cjs"),Q=require("./transformDataForSelect-YmStusCI.cjs"),ue=require("./GraphContainer-d8A46BK2.cjs");function ce(y){const t=i.compilerRuntimeExports.c(24),{settings:a,graph:m,graphData:d,debugMode:S,graphDataConfiguration:n,readableHeader:E,updateFilters:I}=y;if(S&&(console.log(`Graph: ${m}`),console.log("Transformed data:",d),console.log("Settings:",a)),typeof d=="string"){const b=`flex my-0 mx-auto grow flex-col justify-center ${a?.width?"w-fit":"w-full"}`;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x={height:"inherit"},t[0]=x):x=t[0];let c;t[1]!==d?(c=i.jsxRuntimeExports.jsx(W.j,{size:"sm",marginBottom:"none",className:"p-2 text-center text-accent-dark-red dark:text-accent-red",children:d}),t[1]=d,t[2]=c):c=t[2];let w;return t[3]!==b||t[4]!==c?(w=i.jsxRuntimeExports.jsx("div",{className:b,style:x,children:c}),t[3]=b,t[4]=c,t[5]=w):w=t[5],w}let v;t[6]===Symbol.for("react.memo_cache_sentinel")?(v={threeDGlobe:ne.ThreeDGlobe},t[6]=v):v=t[6];const O=v;let V;t[7]!==d||t[8]!==n||t[9]!==E||t[10]!==a||t[11]!==I?(V=b=>{switch(b){case"threeDGlobe":return{globeOffset:a?.globeOffset,collapseColorScaleByDefault:a?.collapseColorScaleByDefault,polygonAltitude:a?.polygonAltitude,highlightedIds:a?.highlightedIds,scale:a?.scale,theme:a?.theme,resetSelectionOnDoubleClick:a?.resetSelectionOnDoubleClick,graphTitle:a?.graphTitle,mapData:a?.mapData,graphDescription:a?.graphDescription,footNote:a?.footNote,width:a?.width,height:a?.height,sources:a?.sources,colorDomain:a?.colorDomain,colors:a?.colors,colorLegendTitle:Object.keys(a||{}).indexOf("colorLegendTitle")!==-1?a?.colorLegendTitle:g.getValues("x",n||[],E||[]),scaleType:a?.scaleType,data:d,centerPoint:a?.centerPoint,backgroundColor:a?.backgroundColor,mapNoDataColor:a?.mapNoDataColor,mapBorderColor:a?.mapBorderColor,relativeHeight:a?.relativeHeight,padding:a?.padding,tooltip:a?.tooltip,showColorScale:a?.showColorScale,graphID:a?.graphID,dataDownload:a?.dataDownload,mapProperty:a?.mapProperty,language:a?.language,minHeight:a?.minHeight,ariaLabel:a?.ariaLabel,onSeriesMouseClick:x=>{I?.(x.id)},detailsOnClick:a?.detailsOnClick,styles:a?.styles,classNames:a?.classNames,autoRotate:a?.autoRotate,globeMaterial:a?.globeMaterial,atmosphereColor:a?.atmosphereColor,enableZoom:a?.enableZoom,atmosphereAltitude:a?.atmosphereAltitude,globeCurvatureResolution:a?.globeCurvatureResolution,fogSettings:a?.fogSetting,lights:a?.lights,highlightedAltitude:a?.highlightedAltitude,selectedId:a?.selectedId};default:return{}}},t[7]=d,t[8]=n,t[9]=E,t[10]=a,t[11]=I,t[12]=V):V=t[12];const h=V,T=O[m];let p;t[13]!==h||t[14]!==m?(p=h(m),t[13]=h,t[14]=m,t[15]=p):p=t[15];const f=p,G=`grow my-0 mx-auto flex flex-col w-full justify-center ${a?.theme||"light"}`;let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R={minHeight:"inherit"},t[16]=R):R=t[16];let s;t[17]!==T||t[18]!==m||t[19]!==f?(s=T?i.jsxRuntimeExports.jsx(T,{...f}):i.jsxRuntimeExports.jsx(W.j,{size:"sm",marginBottom:"none",className:"p-2 text-center text-accent-dark-red dark:text-accent-red",children:`Invalid chart type: ${m}`}),t[17]=T,t[18]=m,t[19]=f,t[20]=s):s=t[20];let N;return t[21]!==G||t[22]!==s?(N=i.jsxRuntimeExports.jsx("div",{className:G,style:R,children:s}),t[21]=G,t[22]=s,t[23]=N):N=t[23],N}const L=(y,t)=>{const a=t?.map(m=>{const d=y?.findIndex(n=>n.chartConfigId===m.chartConfigId);if(d===-1)return{};const S=y[d]?.allowedColumnIds?.findIndex(n=>n.value===m.columnId);return S===-1?{}:y[d].allowedColumnIds[S].graphSettings||{}})||[];return Object.assign({},...a)};function de(y){const{graphSettings:t,dataSettings:a,filters:m,graphType:d,dataTransform:S,graphDataConfiguration:n,dataFilters:E,debugMode:I,dataSelectionOptions:v,advancedDataSelectionOptions:O,readableHeader:V,noOfFiltersPerRow:h=4,updateFilters:T,uiMode:p="normal",highlightDataPointSettings:f}=y,[G,R]=u.useState(void 0),[s,N]=u.useState(void 0),[b,x]=u.useState(n),[c,w]=u.useState({}),[$,X]=u.useState(void 0),[Y,_]=u.useState([]),M=u.useRef(null),U=u.useRef(n),[P,z]=u.useState([]),H={ignoreCase:!0,ignoreAccents:!0,trim:!0},B=u.useEffectEvent(()=>{const e=(m||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,defaultValue:Q.transformDefaultValue(r.defaultValue),value:Q.transformDefaultValue(r.defaultValue),availableValues:J.getUniqValue(s,r.column).filter(l=>!r.excludeValues?.includes(`${l}`)).map(l=>({value:l,label:l})),allowSelectAll:r.allowSelectAll,width:r.width}));z(e)});u.useEffect(()=>{(async()=>{try{const r=a.dataURL?typeof a.dataURL=="string"?a.fileType==="json"?await A.fetchAndParseJSON(a.dataURL,a.columnsToArray,a.dataTransformation,I):a.fileType==="api"?await A.fetchAndTransformDataFromAPI(a.dataURL,a.apiHeaders,a.columnsToArray,a.dataTransformation,I):await A.fetchAndParseCSV(a.dataURL,a.dataTransformation,a.columnsToArray,I,a.delimiter,!0):await A.fetchAndParseMultipleDataSources(a.dataURL,a.idColumnTitle):await A.transformColumnsToArray(a.data,a.columnsToArray);N(r)}catch(r){console.error("Data fetching error:",r)}})(),B()},[a,I]),u.useEffect(()=>{B()},[m,s]);const ee=u.useEffectEvent(()=>{if(!s||P.length===0)R(s);else{const e=s.filter(r=>P.every(l=>l.value&&F.flattenDeep([l.value]).length>0?le.intersection(F.flattenDeep([r[l.filter]]),F.flattenDeep([l.value]).map(o=>o.value)).length>0:!0));R(e)}});u.useEffect(()=>{ee()},[P,s]),u.useEffect(()=>{v&&w(L(v,n))},[v,n]);const te=u.useEffectEvent(()=>{f?.column&&G&&_(J.getUniqValue(G,f.column).filter(e=>!f?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))});u.useEffect(()=>{te()},[f]),u.useEffect(()=>{ie.isEqual(U.current,n)||(x(n),U.current=n)},[n]);const k=(e,r)=>{z(l=>l.map(o=>o.filter===e?{...o,value:r}:o))},ae=s?Z.transformDataForGraph(S?Z.transformDataForAggregation(K.filterData(s,E||[]),S.keyColumn,S.aggregationColumnsSetting):K.filterData(s,E||[]),d,b):void 0;return i.jsxRuntimeExports.jsx(ue.GraphContainer,{className:t?.classNames?.graphContainer,style:t?.styles?.graphContainer,id:t?.graphID,ref:M,"aria-label":t?.ariaLabel,backgroundColor:t?.backgroundColor??!1,theme:t?.theme||"light",language:t?.language||"en",width:t?.width,height:t?.height,padding:t?.padding,minHeight:t?.minHeight,relativeHeight:t?.relativeHeight,children:s||se.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(d)!==-1?i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[c?.graphTitle||c?.graphDescription||t?.graphTitle||t?.graphDescription||t?.graphDownload||t?.dataDownload?i.jsxRuntimeExports.jsx(re.GraphHeader,{styles:{title:c?.styles?.title||t?.styles?.title,description:c?.styles?.description||t?.styles?.description},classNames:{title:c?.classNames?.title||t?.classNames?.title,description:c?.classNames?.description||t?.classNames?.description},graphTitle:c?.graphTitle||t?.graphTitle,graphDescription:c?.graphDescription||t?.graphDescription,width:c?.width||t?.width,graphDownload:t?.graphDownload?M:void 0,dataDownload:t?.dataDownload&&s&&s.length>0?s:null}):null,P.length!==0||(v||[]).length!==0||(O||[]).length!==0||f?i.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-0 w-full",children:[O?.map((e,r)=>i.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/h}% - ${(h-1)/h}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[i.jsxRuntimeExports.jsx(g.b,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?i.jsxRuntimeExports.jsx(D.ja,{options:e.options.map(l=>({...l,value:l.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:p,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:l=>{w(l?.graphSettings||{}),x(l?.dataConfiguration)}}):i.jsxRuntimeExports.jsx(g.ye,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:p,onValueChange:l=>{const o=e.options[e.options.findIndex(j=>j.label===l)];w(o.graphSettings||{}),x(o.dataConfiguration)},children:e.options.map((l,o)=>i.jsxRuntimeExports.jsx(g.he,{label:l.label,value:l.label},o))})]},r)),v?.map((e,r)=>i.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/h}% - ${(h-1)/h}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[i.jsxRuntimeExports.jsx(g.b,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),g.checkIfMultiple(e.chartConfigId,b||[])?e.ui!=="radio"?i.jsxRuntimeExports.jsx(D.ja,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:p,controlShouldRenderValue:!0,defaultValue:n?n[n.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId.map(l=>e.allowedColumnIds[e.allowedColumnIds.findIndex(o=>o.value===l)]):void 0,filterOption:D.Du(H),onChange:l=>{const o={columnId:(l||[]).map(C=>C.value),chartConfigId:e.chartConfigId},j=b?.map(C=>C.chartConfigId===o.chartConfigId?o:C);x(j)}}):i.jsxRuntimeExports.jsx(g.$,{variant:p,defaultValue:n?n[n.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId.map(l=>e.allowedColumnIds[e.allowedColumnIds.findIndex(o=>o.value===l)]).map(l=>l.value):[],onValueChange:l=>{const o={columnId:l||[],chartConfigId:e.chartConfigId},j=b?.map(C=>C.chartConfigId===o.chartConfigId?o:C);x(j)},children:e.allowedColumnIds.map((l,o)=>i.jsxRuntimeExports.jsx(g.P,{label:l.label,value:l.label},o))}):e.ui!=="radio"?i.jsxRuntimeExports.jsx(D.ja,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:p,controlShouldRenderValue:!0,defaultValue:n?e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===n[n.findIndex(o=>o.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:l=>{const o={columnId:l?.value,chartConfigId:e.chartConfigId},j=b?.map(C=>C.chartConfigId===o.chartConfigId?o:C);w(L(v,j)),x(j)}}):i.jsxRuntimeExports.jsx(g.ye,{variant:p,defaultValue:n?e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===n[n.findIndex(o=>o.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:l=>{const j={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(q=>q.label===l)].value,chartConfigId:e.chartConfigId},C=b?.map(q=>q.chartConfigId===j.chartConfigId?j:q);w(L(v,C)),x(C)},children:e.allowedColumnIds.map((l,o)=>i.jsxRuntimeExports.jsx(g.he,{label:l.label,value:l.label},o))})]},r)),P?.map((e,r)=>i.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/h}% - ${(h-1)/h}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[i.jsxRuntimeExports.jsx(g.b,{className:"mb-2",children:e.label}),e.singleSelect?e.ui!=="radio"?i.jsxRuntimeExports.jsx(D.ja,{options:e.availableValues,variant:p,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:D.Du(H),onChange:l=>{k(e.filter,l)},value:e.value,defaultValue:e.defaultValue}):i.jsxRuntimeExports.jsx(g.ye,{variant:p,defaultValue:e.defaultValue.value,onValueChange:l=>{k(e.filter,e.availableValues.filter(o=>o.value===l))},children:e.availableValues.map((l,o)=>i.jsxRuntimeExports.jsx(g.he,{label:`${l.label}`,value:`${l.value}`},o))}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?i.jsxRuntimeExports.jsx(D.ja,{options:e.availableValues,variant:p,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:D.Du(H),onChange:l=>{k(e.filter,l)},value:e.value,defaultValue:e.defaultValue}):i.jsxRuntimeExports.jsx(g.$,{variant:p,defaultValue:e.defaultValue?e.defaultValue.map(l=>`${l.value}`):[],value:e.value?e.value.map(l=>`${l.value}`):void 0,onValueChange:l=>{k(e.filter,e.availableValues.filter(o=>l.indexOf(`${o.value}`)!==-1))},children:e.availableValues.map((l,o)=>i.jsxRuntimeExports.jsx(g.P,{label:`${l.label}`,value:`${l.value}`},o))}),e.allowSelectAll?i.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:()=>{k(e.filter,e.availableValues)},children:"Select all options"}):null]})]},r)),f?i.jsxRuntimeExports.jsxs("div",{style:{width:f.width||`calc(${100/h}% - ${(h-1)/h}rem)`,flexGrow:f.width?0:1,flexShrink:0,minWidth:"240px"},className:"pb-4",children:[i.jsxRuntimeExports.jsx(g.b,{className:"mb-2",children:f.label||"Highlight data"}),i.jsxRuntimeExports.jsx(D.ja,{options:Y,variant:p,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:D.Du(H),onChange:e=>{X(e?.map(r=>r.value))},value:$?.map(e=>({label:e,value:e})),defaultValue:f.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,i.jsxRuntimeExports.jsx(ce,{graph:d,graphData:ae,graphDataConfiguration:b,debugMode:I,readableHeader:V||[],updateFilters:T,settings:{...t||{},...c,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",width:void 0,height:void 0,relativeHeight:void 0,minHeight:void 0,theme:t?.theme,...$?{highlightedDataPoints:$,highlightedIds:$?.map(e=>`${e}`),highlightedLines:$?.map(e=>e)}:{}}})]}):i.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:i.jsxRuntimeExports.jsx(oe.w,{})})})}exports.SingleGraphDashboardThreeDGraphs=de;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),u=require("react"),le=require("./index-CyZ1lmi_.cjs"),F=require("./index-BS2TADPj.cjs"),ie=require("./index-DQA8q5sC.cjs"),D=require("./DropdownSelect-Doz3mCrM.cjs"),g=require("./checkIfMultiple-wg6hJLXy.cjs"),oe=require("./Spinner-CQZcjzwd.cjs"),W=require("./Typography-DX7PlgQU.cjs"),ne=require("./ThreeDGlobe.cjs"),A=require("./fetchAndParseData-l5HGMAEs.cjs"),Z=require("./transformDataForAggregation-CYoB5Xsk.cjs"),J=require("./getUniqValue-NX8DgwND.cjs"),re=require("./GraphHeader.cjs"),K=require("./filterData-T5DQBE9b.cjs"),se=require("./getGraphList-CA17dvFB.cjs"),Q=require("./transformDataForSelect-YmStusCI.cjs"),ue=require("./GraphContainer-d8A46BK2.cjs");function ce(y){const t=i.compilerRuntimeExports.c(24),{settings:a,graph:m,graphData:d,debugMode:S,graphDataConfiguration:n,readableHeader:E,updateFilters:I}=y;if(S&&(console.log(`Graph: ${m}`),console.log("Transformed data:",d),console.log("Settings:",a)),typeof d=="string"){const b=`flex my-0 mx-auto grow flex-col justify-center ${a?.width?"w-fit":"w-full"}`;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x={height:"inherit"},t[0]=x):x=t[0];let c;t[1]!==d?(c=i.jsxRuntimeExports.jsx(W.j,{size:"sm",marginBottom:"none",className:"p-2 text-center text-accent-dark-red dark:text-accent-red",children:d}),t[1]=d,t[2]=c):c=t[2];let w;return t[3]!==b||t[4]!==c?(w=i.jsxRuntimeExports.jsx("div",{className:b,style:x,children:c}),t[3]=b,t[4]=c,t[5]=w):w=t[5],w}let v;t[6]===Symbol.for("react.memo_cache_sentinel")?(v={threeDGlobe:ne.ThreeDGlobe},t[6]=v):v=t[6];const O=v;let V;t[7]!==d||t[8]!==n||t[9]!==E||t[10]!==a||t[11]!==I?(V=b=>{switch(b){case"threeDGlobe":return{globeOffset:a?.globeOffset,collapseColorScaleByDefault:a?.collapseColorScaleByDefault,polygonAltitude:a?.polygonAltitude,highlightedIds:a?.highlightedIds,scale:a?.scale,theme:a?.theme,resetSelectionOnDoubleClick:a?.resetSelectionOnDoubleClick,graphTitle:a?.graphTitle,mapData:a?.mapData,graphDescription:a?.graphDescription,footNote:a?.footNote,width:a?.width,height:a?.height,sources:a?.sources,colorDomain:a?.colorDomain,colors:a?.colors,colorLegendTitle:Object.keys(a||{}).indexOf("colorLegendTitle")!==-1?a?.colorLegendTitle:g.getValues("x",n||[],E||[]),scaleType:a?.scaleType,data:d,centerPoint:a?.centerPoint,backgroundColor:a?.backgroundColor,mapNoDataColor:a?.mapNoDataColor,mapBorderColor:a?.mapBorderColor,relativeHeight:a?.relativeHeight,padding:a?.padding,tooltip:a?.tooltip,showColorScale:a?.showColorScale,graphID:a?.graphID,dataDownload:a?.dataDownload,mapProperty:a?.mapProperty,language:a?.language,minHeight:a?.minHeight,ariaLabel:a?.ariaLabel,onSeriesMouseClick:x=>{I?.(x.id)},detailsOnClick:a?.detailsOnClick,styles:a?.styles,classNames:a?.classNames,autoRotate:a?.autoRotate,globeMaterial:a?.globeMaterial,atmosphereColor:a?.atmosphereColor,enableZoom:a?.enableZoom,atmosphereAltitude:a?.atmosphereAltitude,globeCurvatureResolution:a?.globeCurvatureResolution,fogSettings:a?.fogSetting,lights:a?.lights,highlightedAltitude:a?.highlightedAltitude,selectedId:a?.selectedId};default:return{}}},t[7]=d,t[8]=n,t[9]=E,t[10]=a,t[11]=I,t[12]=V):V=t[12];const h=V,T=O[m];let p;t[13]!==h||t[14]!==m?(p=h(m),t[13]=h,t[14]=m,t[15]=p):p=t[15];const f=p,G=`grow my-0 mx-auto flex flex-col w-full justify-center ${a?.theme||"light"}`;let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R={minHeight:"inherit"},t[16]=R):R=t[16];let s;t[17]!==T||t[18]!==m||t[19]!==f?(s=T?i.jsxRuntimeExports.jsx(T,{...f}):i.jsxRuntimeExports.jsx(W.j,{size:"sm",marginBottom:"none",className:"p-2 text-center text-accent-dark-red dark:text-accent-red",children:`Invalid chart type: ${m}`}),t[17]=T,t[18]=m,t[19]=f,t[20]=s):s=t[20];let N;return t[21]!==G||t[22]!==s?(N=i.jsxRuntimeExports.jsx("div",{className:G,style:R,children:s}),t[21]=G,t[22]=s,t[23]=N):N=t[23],N}const L=(y,t)=>{const a=t?.map(m=>{const d=y?.findIndex(n=>n.chartConfigId===m.chartConfigId);if(d===-1)return{};const S=y[d]?.allowedColumnIds?.findIndex(n=>n.value===m.columnId);return S===-1?{}:y[d].allowedColumnIds[S].graphSettings||{}})||[];return Object.assign({},...a)};function de(y){const{graphSettings:t,dataSettings:a,filters:m,graphType:d,dataTransform:S,graphDataConfiguration:n,dataFilters:E,debugMode:I,dataSelectionOptions:v,advancedDataSelectionOptions:O,readableHeader:V,noOfFiltersPerRow:h=4,updateFilters:T,uiMode:p="normal",highlightDataPointSettings:f}=y,[G,R]=u.useState(void 0),[s,N]=u.useState(void 0),[b,x]=u.useState(n),[c,w]=u.useState({}),[$,X]=u.useState(void 0),[Y,_]=u.useState([]),M=u.useRef(null),U=u.useRef(n),[P,z]=u.useState([]),H={ignoreCase:!0,ignoreAccents:!0,trim:!0},B=u.useEffectEvent(()=>{const e=(m||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,defaultValue:Q.transformDefaultValue(r.defaultValue),value:Q.transformDefaultValue(r.defaultValue),availableValues:J.getUniqValue(s,r.column).filter(l=>!r.excludeValues?.includes(`${l}`)).map(l=>({value:l,label:l})),allowSelectAll:r.allowSelectAll,width:r.width}));z(e)});u.useEffect(()=>{(async()=>{try{const r=a.dataURL?typeof a.dataURL=="string"?a.fileType==="json"?await A.fetchAndParseJSON(a.dataURL,a.columnsToArray,a.dataTransformation,I):a.fileType==="api"?await A.fetchAndTransformDataFromAPI(a.dataURL,a.apiHeaders,a.columnsToArray,a.dataTransformation,I):await A.fetchAndParseCSV(a.dataURL,a.dataTransformation,a.columnsToArray,I,a.delimiter,!0):await A.fetchAndParseMultipleDataSources(a.dataURL,a.idColumnTitle):await A.transformColumnsToArray(a.data,a.columnsToArray);N(r)}catch(r){console.error("Data fetching error:",r)}})(),B()},[a,I]),u.useEffect(()=>{B()},[m,s]);const ee=u.useEffectEvent(()=>{if(!s||P.length===0)R(s);else{const e=s.filter(r=>P.every(l=>l.value&&F.flattenDeep([l.value]).length>0?le.intersection(F.flattenDeep([r[l.filter]]),F.flattenDeep([l.value]).map(o=>o.value)).length>0:!0));R(e)}});u.useEffect(()=>{ee()},[P,s]),u.useEffect(()=>{v&&w(L(v,n))},[v,n]);const te=u.useEffectEvent(()=>{f?.column&&G&&_(J.getUniqValue(G,f.column).filter(e=>!f?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))});u.useEffect(()=>{te()},[f]),u.useEffect(()=>{ie.isEqual(U.current,n)||(x(n),U.current=n)},[n]);const k=(e,r)=>{z(l=>l.map(o=>o.filter===e?{...o,value:r}:o))},ae=s?Z.transformDataForGraph(S?Z.transformDataForAggregation(K.filterData(s,E||[]),S.keyColumn,S.aggregationColumnsSetting):K.filterData(s,E||[]),d,b):void 0;return i.jsxRuntimeExports.jsx(ue.GraphContainer,{className:t?.classNames?.graphContainer,style:t?.styles?.graphContainer,id:t?.graphID,ref:M,"aria-label":t?.ariaLabel,backgroundColor:t?.backgroundColor??!1,theme:t?.theme||"light",language:t?.language||"en",width:t?.width,height:t?.height,padding:t?.padding,minHeight:t?.minHeight,relativeHeight:t?.relativeHeight,children:s||se.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(d)!==-1?i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[c?.graphTitle||c?.graphDescription||t?.graphTitle||t?.graphDescription||t?.graphDownload||t?.dataDownload?i.jsxRuntimeExports.jsx(re.GraphHeader,{styles:{title:c?.styles?.title||t?.styles?.title,description:c?.styles?.description||t?.styles?.description},classNames:{title:c?.classNames?.title||t?.classNames?.title,description:c?.classNames?.description||t?.classNames?.description},graphTitle:c?.graphTitle||t?.graphTitle,graphDescription:c?.graphDescription||t?.graphDescription,width:c?.width||t?.width,graphDownload:t?.graphDownload?M:void 0,dataDownload:t?.dataDownload&&s&&s.length>0?s:null}):null,P.length!==0||(v||[]).length!==0||(O||[]).length!==0||f?i.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-0 w-full",children:[O?.map((e,r)=>i.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/h}% - ${(h-1)/h}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[i.jsxRuntimeExports.jsx(g.b,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?i.jsxRuntimeExports.jsx(D.ja,{options:e.options.map(l=>({...l,value:l.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:p,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:l=>{w(l?.graphSettings||{}),x(l?.dataConfiguration)}}):i.jsxRuntimeExports.jsx(g.ye,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:p,onValueChange:l=>{const o=e.options[e.options.findIndex(j=>j.label===l)];w(o.graphSettings||{}),x(o.dataConfiguration)},children:e.options.map((l,o)=>i.jsxRuntimeExports.jsx(g.he,{label:l.label,value:l.label},o))})]},r)),v?.map((e,r)=>i.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/h}% - ${(h-1)/h}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[i.jsxRuntimeExports.jsx(g.b,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),g.checkIfMultiple(e.chartConfigId,b||[])?e.ui!=="radio"?i.jsxRuntimeExports.jsx(D.ja,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:p,controlShouldRenderValue:!0,defaultValue:n?n[n.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId.map(l=>e.allowedColumnIds[e.allowedColumnIds.findIndex(o=>o.value===l)]):void 0,filterOption:D.Du(H),onChange:l=>{const o={columnId:(l||[]).map(C=>C.value),chartConfigId:e.chartConfigId},j=b?.map(C=>C.chartConfigId===o.chartConfigId?o:C);x(j)}}):i.jsxRuntimeExports.jsx(g.$,{variant:p,defaultValue:n?n[n.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId.map(l=>e.allowedColumnIds[e.allowedColumnIds.findIndex(o=>o.value===l)]).map(l=>l.value):[],onValueChange:l=>{const o={columnId:l||[],chartConfigId:e.chartConfigId},j=b?.map(C=>C.chartConfigId===o.chartConfigId?o:C);x(j)},children:e.allowedColumnIds.map((l,o)=>i.jsxRuntimeExports.jsx(g.P,{label:l.label,value:l.label},o))}):e.ui!=="radio"?i.jsxRuntimeExports.jsx(D.ja,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:p,controlShouldRenderValue:!0,defaultValue:n?e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===n[n.findIndex(o=>o.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:l=>{const o={columnId:l?.value,chartConfigId:e.chartConfigId},j=b?.map(C=>C.chartConfigId===o.chartConfigId?o:C);w(L(v,j)),x(j)}}):i.jsxRuntimeExports.jsx(g.ye,{variant:p,defaultValue:n?e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===n[n.findIndex(o=>o.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:l=>{const j={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(q=>q.label===l)].value,chartConfigId:e.chartConfigId},C=b?.map(q=>q.chartConfigId===j.chartConfigId?j:q);w(L(v,C)),x(C)},children:e.allowedColumnIds.map((l,o)=>i.jsxRuntimeExports.jsx(g.he,{label:l.label,value:l.label},o))})]},r)),P?.map((e,r)=>i.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/h}% - ${(h-1)/h}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[i.jsxRuntimeExports.jsx(g.b,{className:"mb-2",children:e.label}),e.singleSelect?e.ui!=="radio"?i.jsxRuntimeExports.jsx(D.ja,{options:e.availableValues,variant:p,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:D.Du(H),onChange:l=>{k(e.filter,l)},value:e.value,defaultValue:e.defaultValue}):i.jsxRuntimeExports.jsx(g.ye,{variant:p,defaultValue:e.defaultValue.value,onValueChange:l=>{k(e.filter,e.availableValues.filter(o=>o.value===l))},children:e.availableValues.map((l,o)=>i.jsxRuntimeExports.jsx(g.he,{label:`${l.label}`,value:`${l.value}`},o))}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?i.jsxRuntimeExports.jsx(D.ja,{options:e.availableValues,variant:p,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:D.Du(H),onChange:l=>{k(e.filter,l)},value:e.value,defaultValue:e.defaultValue}):i.jsxRuntimeExports.jsx(g.$,{variant:p,defaultValue:e.defaultValue?e.defaultValue.map(l=>`${l.value}`):[],value:e.value?e.value.map(l=>`${l.value}`):void 0,onValueChange:l=>{k(e.filter,e.availableValues.filter(o=>l.indexOf(`${o.value}`)!==-1))},children:e.availableValues.map((l,o)=>i.jsxRuntimeExports.jsx(g.P,{label:`${l.label}`,value:`${l.value}`},o))}),e.allowSelectAll?i.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:()=>{k(e.filter,e.availableValues)},children:"Select all options"}):null]})]},r)),f?i.jsxRuntimeExports.jsxs("div",{style:{width:f.width||`calc(${100/h}% - ${(h-1)/h}rem)`,flexGrow:f.width?0:1,flexShrink:0,minWidth:"240px"},className:"pb-4",children:[i.jsxRuntimeExports.jsx(g.b,{className:"mb-2",children:f.label||"Highlight data"}),i.jsxRuntimeExports.jsx(D.ja,{options:Y,variant:p,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:D.Du(H),onChange:e=>{X(e?.map(r=>r.value))},value:$?.map(e=>({label:e,value:e})),defaultValue:f.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,i.jsxRuntimeExports.jsx(ce,{graph:d,graphData:ae,graphDataConfiguration:b,debugMode:I,readableHeader:V||[],updateFilters:T,settings:{...t||{},...c,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",width:void 0,height:void 0,relativeHeight:void 0,minHeight:void 0,theme:t?.theme,...$?{highlightedDataPoints:$,highlightedIds:$?.map(e=>`${e}`),highlightedLines:$?.map(e=>e)}:{}}})]}):i.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:i.jsxRuntimeExports.jsx(oe.w,{})})})}exports.SingleGraphDashboardThreeDGraphs=de;
|
|
2
2
|
//# sourceMappingURL=SingleGraphDashboardThreeDGraphs.cjs.map
|