@undp/data-viz 2.3.4 → 2.3.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/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.d.ts +2 -0
- package/dist/CirclePackingGraph.js +1 -1
- package/dist/{GraphEl-C2xExzzY.js → GraphEl-Bw-9MUym.js} +7 -6
- package/dist/GraphEl-Bw-9MUym.js.map +1 -0
- package/dist/{GraphEl-B-XEJeRt.cjs → GraphEl-DjElfY07.cjs} +2 -2
- package/dist/GraphEl-DjElfY07.cjs.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/Types.d.ts +1 -0
- package/dist/index-BzNfurbO.js +378 -0
- package/dist/index-BzNfurbO.js.map +1 -0
- package/dist/index-CXobQn-E.cjs +2 -0
- package/dist/index-CXobQn-E.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -2
- package/dist/GraphEl-B-XEJeRt.cjs.map +0 -1
- package/dist/GraphEl-C2xExzzY.js.map +0 -1
- package/dist/index-CH8RndC2.js +0 -337
- package/dist/index-CH8RndC2.js.map +0 -1
- package/dist/index-DNmkwfX8.cjs +0 -2
- package/dist/index-DNmkwfX8.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-6v2a2njQ.cjs"),i=require("react"),ae=require("./index-CyZ1lmi_.cjs"),G=require("./index-BS2TADPj.cjs"),u=require("./checkIfMultiple-DxnGtm3t.cjs"),te=require("./Spinner-jTMOLuw_.cjs"),m=require("./DropdownSelect-NNpOs7DX.cjs"),le=require("./GraphContainer-B1EDxJ0S.cjs"),oe=require("./GraphEl-B-XEJeRt.cjs"),S=require("./fetchAndParseData-QTF6tjij.cjs"),re=require("./Colors.cjs"),H=require("./transformDataForAggregation-BFdha9Dx.cjs"),W=require("./getUniqValue-NX8DgwND.cjs"),ne=require("./GraphHeader.cjs"),ie=require("./GraphFooter.cjs"),z=require("./filterData-T5DQBE9b.cjs"),se=require("./ColorLegend.cjs"),ue=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),B=require("./transformDataForSelect-YmStusCI.cjs");function ce(J){const{graphSettings:t,dataSettings:n,filters:T,graphType:$,dataTransform:D,graphDataConfiguration:s,noOfColumns:y,columnGridBy:E,dataFilters:q,showCommonColorScale:A,minGraphHeight:K,minGraphWidth:F,debugMode:w,dataSelectionOptions:O,advancedDataSelectionOptions:k,readableHeader:Q,noOfFiltersPerRow:f=4,uiMode:d="normal",theme:X="light"}=J,[v,Y]=i.useState(void 0),[g,Z]=i.useState(void 0),[b,_]=i.useState([]),M=i.useRef(null),[x,C]=i.useState(s),[j,L]=i.useState([]),[h,R]=i.useState({}),N=i.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),P=i.useMemo(()=>!g||j.length===0?g:g.filter(r=>j.every(a=>a.value&&G.flattenDeep([a.value]).length>0?ae.intersection(G.flattenDeep([r[a.filter]]),G.flattenDeep([a.value]).map(l=>l.value)).length>0:!0)),[j,g]);i.useEffect(()=>{Y(P)},[P]);const U=i.useEffectEvent(()=>{const e=(T||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,ui:r.ui,defaultValue:B.transformDefaultValue(r.defaultValue),value:B.transformDefaultValue(r.defaultValue),availableValues:W.getUniqValue(g,r.column).filter(a=>!r.excludeValues?.includes(`${a}`)).map(a=>({value:a,label:a})),allowSelectAll:r.allowSelectAll,width:r.width}));L(e)});i.useEffect(()=>{(async()=>{try{const r=n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?await S.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,w):n.fileType==="api"?await S.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,w):await S.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,w,n.delimiter,!0):await S.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):await S.transformColumnsToArray(n.data,n.columnsToArray);Z(r)}catch(r){console.error("Data fetching error:",r)}})(),U()},[n,w]),i.useEffect(()=>{U()},[T,g]);const ee=i.useEffectEvent(()=>{const e=W.getUniqValue(g,E);_(e)});i.useEffect(()=>{ee()},[E,g]),i.useEffect(()=>{C(s)},[s]);const I=i.useCallback((e,r)=>{L(a=>a.map(l=>l.filter===e?{...l,value:r}:l))},[]);return o.jsxRuntimeExports.jsxs(le.GraphContainer,{className:t?.classNames?.graphContainer,style:t?.styles?.graphContainer,id:t?.graphID,ref:M,"aria-label":t?.ariaLabel||"This is a gridded graph",backgroundColor:t?.backgroundColor??!1,theme:t?.theme||"light",language:t?.language||"en",width:t?.width,height:t?.height,padding:t?.padding,children:[h?.graphTitle||h?.graphDescription||t?.graphTitle||t?.graphDescription||t?.graphDownload||t?.dataDownload?o.jsxRuntimeExports.jsx(ne.GraphHeader,{styles:{title:h?.styles?.title||t?.styles?.title,description:h?.styles?.description||t?.styles?.description},classNames:{title:h?.classNames?.title||t?.classNames?.title,description:h?.classNames?.description||t?.classNames?.description},graphTitle:h?.graphTitle||t?.graphTitle,graphDescription:h?.graphDescription||t?.graphDescription,width:h?.width||t?.width,graphDownload:t?.graphDownload?M:void 0,dataDownload:t?.dataDownload&&v&&v.length>0?v:null}):null,v&&b.length>0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[j.length!==0||(O||[]).length!==0||(k||[]).length!==0?o.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-0 w-full",children:[k?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.options.map(a=>({...a,value:a.label})),isClearable:!1,isSearchable:!0,variant:d,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{R(a?.graphSettings||{}),C(a?.dataConfiguration)}}):o.jsxRuntimeExports.jsx(u.ye,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:d,onValueChange:a=>{const l=e.options[e.options.findIndex(p=>p.label===a)];R(l.graphSettings||{}),C(l.dataConfiguration)},children:e.options.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),O?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),u.checkIfMultiple(e.chartConfigId,x||[])?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isMulti:!0,variant:d,isSearchable:!0,controlShouldRenderValue:!0,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]):void 0,filterOption:m.Du(N),onChange:a=>{const l={columnId:a.map(c=>c.value),chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},isRtl:t?.language==="ar"||t?.language==="he"}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]).map(a=>a.value):[],onValueChange:a=>{const l={columnId:a||[],chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:a.label,value:a.label},l))}):e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isClearable:!1,isSearchable:!0,variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)]:void 0,controlShouldRenderValue:!0,onChange:a=>{const l={columnId:a?.value,chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);R(a?.graphSettings||{}),C(p)}}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const l=e.allowedColumnIds[e.allowedColumnIds.findIndex(V=>V.label===a)],p={columnId:l.value,chartConfigId:e.chartConfigId},c=x?.map(V=>V.chartConfigId===p.chartConfigId?p:V);R(l.graphSettings||{}),C(c)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),j?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,flexWrap:"wrap"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label}),e.singleSelect?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:e.defaultValue.value,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>l.value===a))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:`${a.label}`,value:`${a.value}`},l))}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>a.indexOf(`${l.value}`)!==-1))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:`${a.label}`,value:`${a.value}`},l))}),e.allowSelectAll?o.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{I(e.filter,e.availableValues)},children:"Select all options"}):null]})]},r))]}):null,A!==!1&&t?.showColorScale!==!1?o.jsxRuntimeExports.jsx(se.ColorLegend,{width:t?.width,colorLegendTitle:t?.colorLegendTitle,colors:t?.colors||t?.lineColors||re.Colors[t?.theme||"light"].categoricalColors.colors,colorDomain:t?.colorDomain||t?.labels||[],showNAColor:t?.showNAColor===void 0||t?.showNAColor===null?!0:t?.showNAColor}):null,o.jsxRuntimeExports.jsx("div",{className:`flex flex-wrap gap-4 justify-center ${t?.language==="ar"||t?.language==="he"?"flex-row-reverse":"flex-row"}`,children:b.map((e,r)=>o.jsxRuntimeExports.jsx("div",{style:{width:`calc(${100/(y||Math.min(4,b.length||0))}% - ${((y||Math.min(4,b.length||0))-1)/(y||Math.min(4,b.length||0))}rem)`,minWidth:ue.checkIfNullOrUndefined(F)?"280px":`${F}px`},children:o.jsxRuntimeExports.jsx(oe.GraphEl,{graph:$,graphDataConfiguration:x,graphData:H.transformDataForGraph(D?H.transformDataForAggregation(z.filterData(v,q||[]).filter(a=>a[E]===e),D.keyColumn,D.aggregationColumnsSetting):z.filterData(v,q||[]).filter(a=>a[E]===e),$,x)||[],debugMode:w,settings:{...t||{},...h,theme:t?.theme||X,width:void 0,height:void 0,relativeHeight:t?.relativeHeight||.67,minHeight:K,graphTitle:`${e}`,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",footNote:void 0,sources:void 0,showColorScale:t?.showColorScale===!1?!1:A===!1},readableHeader:Q||[]})},r))})]}):o.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:o.jsxRuntimeExports.jsx(te.w,{})}),t?.sources||t?.footNote?o.jsxRuntimeExports.jsx(ie.GraphFooter,{styles:{footnote:t?.styles?.footnote,source:t?.styles?.source},classNames:{footnote:t?.classNames?.footnote,source:t?.classNames?.source},sources:t?.sources,footNote:t?.footNote,width:t?.width}):null]})}exports.GriddedGraphs=ce;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),i=require("react"),ae=require("./index-CyZ1lmi_.cjs"),G=require("./index-BS2TADPj.cjs"),u=require("./checkIfMultiple-DxnGtm3t.cjs"),te=require("./Spinner-jTMOLuw_.cjs"),m=require("./DropdownSelect-NNpOs7DX.cjs"),le=require("./GraphContainer-B1EDxJ0S.cjs"),oe=require("./GraphEl-DjElfY07.cjs"),S=require("./fetchAndParseData-QTF6tjij.cjs"),re=require("./Colors.cjs"),H=require("./transformDataForAggregation-BFdha9Dx.cjs"),W=require("./getUniqValue-NX8DgwND.cjs"),ne=require("./GraphHeader.cjs"),ie=require("./GraphFooter.cjs"),z=require("./filterData-T5DQBE9b.cjs"),se=require("./ColorLegend.cjs"),ue=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),B=require("./transformDataForSelect-YmStusCI.cjs");function ce(J){const{graphSettings:t,dataSettings:n,filters:T,graphType:$,dataTransform:D,graphDataConfiguration:s,noOfColumns:y,columnGridBy:E,dataFilters:q,showCommonColorScale:A,minGraphHeight:K,minGraphWidth:F,debugMode:w,dataSelectionOptions:O,advancedDataSelectionOptions:k,readableHeader:Q,noOfFiltersPerRow:f=4,uiMode:d="normal",theme:X="light"}=J,[v,Y]=i.useState(void 0),[g,Z]=i.useState(void 0),[b,_]=i.useState([]),M=i.useRef(null),[x,C]=i.useState(s),[j,L]=i.useState([]),[h,R]=i.useState({}),N=i.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),P=i.useMemo(()=>!g||j.length===0?g:g.filter(r=>j.every(a=>a.value&&G.flattenDeep([a.value]).length>0?ae.intersection(G.flattenDeep([r[a.filter]]),G.flattenDeep([a.value]).map(l=>l.value)).length>0:!0)),[j,g]);i.useEffect(()=>{Y(P)},[P]);const U=i.useEffectEvent(()=>{const e=(T||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,ui:r.ui,defaultValue:B.transformDefaultValue(r.defaultValue),value:B.transformDefaultValue(r.defaultValue),availableValues:W.getUniqValue(g,r.column).filter(a=>!r.excludeValues?.includes(`${a}`)).map(a=>({value:a,label:a})),allowSelectAll:r.allowSelectAll,width:r.width}));L(e)});i.useEffect(()=>{(async()=>{try{const r=n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?await S.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,w):n.fileType==="api"?await S.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,w):await S.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,w,n.delimiter,!0):await S.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):await S.transformColumnsToArray(n.data,n.columnsToArray);Z(r)}catch(r){console.error("Data fetching error:",r)}})(),U()},[n,w]),i.useEffect(()=>{U()},[T,g]);const ee=i.useEffectEvent(()=>{const e=W.getUniqValue(g,E);_(e)});i.useEffect(()=>{ee()},[E,g]),i.useEffect(()=>{C(s)},[s]);const I=i.useCallback((e,r)=>{L(a=>a.map(l=>l.filter===e?{...l,value:r}:l))},[]);return o.jsxRuntimeExports.jsxs(le.GraphContainer,{className:t?.classNames?.graphContainer,style:t?.styles?.graphContainer,id:t?.graphID,ref:M,"aria-label":t?.ariaLabel||"This is a gridded graph",backgroundColor:t?.backgroundColor??!1,theme:t?.theme||"light",language:t?.language||"en",width:t?.width,height:t?.height,padding:t?.padding,children:[h?.graphTitle||h?.graphDescription||t?.graphTitle||t?.graphDescription||t?.graphDownload||t?.dataDownload?o.jsxRuntimeExports.jsx(ne.GraphHeader,{styles:{title:h?.styles?.title||t?.styles?.title,description:h?.styles?.description||t?.styles?.description},classNames:{title:h?.classNames?.title||t?.classNames?.title,description:h?.classNames?.description||t?.classNames?.description},graphTitle:h?.graphTitle||t?.graphTitle,graphDescription:h?.graphDescription||t?.graphDescription,width:h?.width||t?.width,graphDownload:t?.graphDownload?M:void 0,dataDownload:t?.dataDownload&&v&&v.length>0?v:null}):null,v&&b.length>0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[j.length!==0||(O||[]).length!==0||(k||[]).length!==0?o.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-0 w-full",children:[k?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.options.map(a=>({...a,value:a.label})),isClearable:!1,isSearchable:!0,variant:d,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{R(a?.graphSettings||{}),C(a?.dataConfiguration)}}):o.jsxRuntimeExports.jsx(u.ye,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:d,onValueChange:a=>{const l=e.options[e.options.findIndex(p=>p.label===a)];R(l.graphSettings||{}),C(l.dataConfiguration)},children:e.options.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),O?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),u.checkIfMultiple(e.chartConfigId,x||[])?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isMulti:!0,variant:d,isSearchable:!0,controlShouldRenderValue:!0,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]):void 0,filterOption:m.Du(N),onChange:a=>{const l={columnId:a.map(c=>c.value),chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},isRtl:t?.language==="ar"||t?.language==="he"}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]).map(a=>a.value):[],onValueChange:a=>{const l={columnId:a||[],chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:a.label,value:a.label},l))}):e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isClearable:!1,isSearchable:!0,variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)]:void 0,controlShouldRenderValue:!0,onChange:a=>{const l={columnId:a?.value,chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);R(a?.graphSettings||{}),C(p)}}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const l=e.allowedColumnIds[e.allowedColumnIds.findIndex(V=>V.label===a)],p={columnId:l.value,chartConfigId:e.chartConfigId},c=x?.map(V=>V.chartConfigId===p.chartConfigId?p:V);R(l.graphSettings||{}),C(c)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),j?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,flexWrap:"wrap"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label}),e.singleSelect?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:e.defaultValue.value,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>l.value===a))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:`${a.label}`,value:`${a.value}`},l))}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>a.indexOf(`${l.value}`)!==-1))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:`${a.label}`,value:`${a.value}`},l))}),e.allowSelectAll?o.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{I(e.filter,e.availableValues)},children:"Select all options"}):null]})]},r))]}):null,A!==!1&&t?.showColorScale!==!1?o.jsxRuntimeExports.jsx(se.ColorLegend,{width:t?.width,colorLegendTitle:t?.colorLegendTitle,colors:t?.colors||t?.lineColors||re.Colors[t?.theme||"light"].categoricalColors.colors,colorDomain:t?.colorDomain||t?.labels||[],showNAColor:t?.showNAColor===void 0||t?.showNAColor===null?!0:t?.showNAColor}):null,o.jsxRuntimeExports.jsx("div",{className:`flex flex-wrap gap-4 justify-center ${t?.language==="ar"||t?.language==="he"?"flex-row-reverse":"flex-row"}`,children:b.map((e,r)=>o.jsxRuntimeExports.jsx("div",{style:{width:`calc(${100/(y||Math.min(4,b.length||0))}% - ${((y||Math.min(4,b.length||0))-1)/(y||Math.min(4,b.length||0))}rem)`,minWidth:ue.checkIfNullOrUndefined(F)?"280px":`${F}px`},children:o.jsxRuntimeExports.jsx(oe.GraphEl,{graph:$,graphDataConfiguration:x,graphData:H.transformDataForGraph(D?H.transformDataForAggregation(z.filterData(v,q||[]).filter(a=>a[E]===e),D.keyColumn,D.aggregationColumnsSetting):z.filterData(v,q||[]).filter(a=>a[E]===e),$,x)||[],debugMode:w,settings:{...t||{},...h,theme:t?.theme||X,width:void 0,height:void 0,relativeHeight:t?.relativeHeight||.67,minHeight:K,graphTitle:`${e}`,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",footNote:void 0,sources:void 0,showColorScale:t?.showColorScale===!1?!1:A===!1},readableHeader:Q||[]})},r))})]}):o.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:o.jsxRuntimeExports.jsx(te.w,{})}),t?.sources||t?.footNote?o.jsxRuntimeExports.jsx(ie.GraphFooter,{styles:{footnote:t?.styles?.footnote,source:t?.styles?.source},classNames:{footnote:t?.classNames?.footnote,source:t?.classNames?.source},sources:t?.sources,footNote:t?.footNote,width:t?.width}):null]})}exports.GriddedGraphs=ce;
|
|
2
2
|
//# sourceMappingURL=GriddedGraphs.cjs.map
|
package/dist/GriddedGraphs.d.ts
CHANGED
|
@@ -465,6 +465,7 @@ declare interface GraphSettingsDataType {
|
|
|
465
465
|
hideAxisLine?: boolean;
|
|
466
466
|
projectionRotate?: [number, number] | [number, number, number];
|
|
467
467
|
rewindCoordinatesInMapData?: boolean;
|
|
468
|
+
circularBoundary?: boolean;
|
|
468
469
|
}
|
|
469
470
|
|
|
470
471
|
declare type GraphType = GraphTypeForGriddedGraph;
|
package/dist/GriddedGraphs.js
CHANGED
|
@@ -6,7 +6,7 @@ import { b as $, y as A, h as F, c as ca, $ as K, P as Q } from "./checkIfMultip
|
|
|
6
6
|
import { w as da } from "./Spinner--r2RrJV8.js";
|
|
7
7
|
import { j as V, D as O } from "./DropdownSelect-D8rFbygC.js";
|
|
8
8
|
import { G as ha } from "./GraphContainer-CF6ws3pd.js";
|
|
9
|
-
import { G as fa } from "./GraphEl-
|
|
9
|
+
import { G as fa } from "./GraphEl-Bw-9MUym.js";
|
|
10
10
|
import { f as pa, a as ga, b as ma, c as Ca, t as va } from "./fetchAndParseData-BAXhgTDM.js";
|
|
11
11
|
import { Colors as wa } from "./Colors.js";
|
|
12
12
|
import { a as ba, t as xa } from "./transformDataForAggregation-wdPf8bNt.js";
|
|
@@ -492,6 +492,7 @@ declare interface GraphSettingsDataType {
|
|
|
492
492
|
hideAxisLine?: boolean;
|
|
493
493
|
projectionRotate?: [number, number] | [number, number, number];
|
|
494
494
|
rewindCoordinatesInMapData?: boolean;
|
|
495
|
+
circularBoundary?: boolean;
|
|
495
496
|
}
|
|
496
497
|
|
|
497
498
|
declare type GraphType = GraphTypeForGriddedGraph;
|
package/dist/Histogram.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./index-CHPV5EwG-6v2a2njQ.cjs"),le=require("./Spinner-jTMOLuw_.cjs"),J=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./index-CHPV5EwG-6v2a2njQ.cjs"),le=require("./Spinner-jTMOLuw_.cjs"),J=require("./index-CXobQn-E.cjs"),ae=require("./TreeMapGraph.cjs"),ce=require("./DonutChart.cjs"),ue=require("./BarGraph.cjs"),W=require("./Colors.cjs"),he=require("./init-DU0ybBc_.cjs"),K=require("./linear-CgUCbw9F.cjs");function fe(n,e){let C=0;for(let l of n)l!=null&&(l=+l)>=l&&++C;return C}function pe(n){return n}var ge=Array.prototype,me=ge.slice;function ne(n){return()=>n}function xe(n,e,C){let l;for(;;){const t=K.tickIncrement(n,e,C);if(t===l||t===0||!isFinite(t))return[n,e];t>0?(n=Math.floor(n/t)*t,e=Math.ceil(e/t)*t):t<0&&(n=Math.ceil(n*t)/t,e=Math.floor(e*t)/t),l=t}}function de(n){return Math.max(1,Math.ceil(Math.log(fe(n))/Math.LN2)+1)}function Me(){var n=pe,e=J.extent,C=de;function l(t){Array.isArray(t)||(t=Array.from(t));var r,B=t.length,a,L,p=new Array(B);for(r=0;r<B;++r)p[r]=n(t[r],r,t);var b=e(p),o=b[0],i=b[1],s=C(p,o,i);if(!Array.isArray(s)){const d=i,M=+s;if(e===J.extent&&([o,i]=xe(o,i,M)),s=K.ticks(o,i,M),s[0]<=o&&(L=K.tickIncrement(o,i,M)),s[s.length-1]>=i)if(d>=i&&e===J.extent){const c=K.tickIncrement(o,i,M);isFinite(c)&&(c>0?i=(Math.floor(i/c)+1)*c:c<0&&(i=(Math.ceil(i*-c)+1)/-c))}else s.pop()}for(var x=s.length,u=0,h=x;s[u]<=o;)++u;for(;s[h-1]>i;)--h;(u||h<x)&&(s=s.slice(u,h),x=h-u);var m=new Array(x+1),y;for(r=0;r<=x;++r)y=m[r]=[],y.x0=r>0?s[r-1]:o,y.x1=r<x?s[r]:i;if(isFinite(L)){if(L>0)for(r=0;r<B;++r)(a=p[r])!=null&&o<=a&&a<=i&&m[Math.min(x,Math.floor((a-o)/L))].push(t[r]);else if(L<0){for(r=0;r<B;++r)if((a=p[r])!=null&&o<=a&&a<=i){const d=Math.floor((o-a)*L);m[Math.min(x,d+(s[d]<=a))].push(t[r])}}}else for(r=0;r<B;++r)(a=p[r])!=null&&o<=a&&a<=i&&m[he.bisectRight(s,a,0,x)].push(t[r]);return m}return l.value=function(t){return arguments.length?(n=typeof t=="function"?t:ne(t),l):n},l.domain=function(t){return arguments.length?(e=typeof t=="function"?t:ne([t[0],t[1]]),l):e},l.thresholds=function(t){return arguments.length?(C=typeof t=="function"?t:ne(Array.isArray(t)?me.call(t):t),l):C},l}function ye(n){const e=I.compilerRuntimeExports.c(139),{data:C,graphTitle:l,sources:t,graphDescription:r,barPadding:B,showValues:a,showTicks:L,leftMargin:p,rightMargin:b,height:o,width:i,footNote:s,colors:x,padding:u,backgroundColor:h,topMargin:m,bottomMargin:y,showLabels:d,relativeHeight:M,tooltip:c,onSeriesMouseOver:w,refValues:Q,graphID:j,maxValue:U,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,numberOfBins:X,truncateBy:Y,graphType:Z,barGraphLayout:_,donutStrokeWidth:ee,sortData:N,language:q,minHeight:H,theme:oe,maxBarThickness:te,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T,hideAxisLine:se}=n,v=oe===void 0?"light":oe,re=se===void 0?!1:se;let O;e[0]!==C||e[1]!==X?(O=Me().thresholds(X||10).value(Ce)(C).map(ve),e[0]=C,e[1]=X,e[2]=O):O=e[2];const $=O;if($.length===0){const g=`${i}px`,f=`${o}px`;let P;e[3]!==g||e[4]!==f?(P={width:g,height:f,margin:"auto"},e[3]=g,e[4]=f,e[5]=P):P=e[5];let F;e[6]===Symbol.for("react.memo_cache_sentinel")?(F=I.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:I.jsxRuntimeExports.jsx(le.w,{})}),e[6]=F):F=e[6];let z;return e[7]!==P?(z=I.jsxRuntimeExports.jsx("div",{style:P,children:F}),e[7]=P,e[8]=z):z=e[8],z}if(Z==="circlePacking"){const g=x||W.Colors.graphMainColor;let f;return e[9]!==E||e[10]!==h||e[11]!==y||e[12]!==D||e[13]!==A||e[14]!==$||e[15]!==R||e[16]!==s||e[17]!==r||e[18]!==S||e[19]!==j||e[20]!==l||e[21]!==o||e[22]!==q||e[23]!==p||e[24]!==H||e[25]!==k||e[26]!==w||e[27]!==u||e[28]!==T||e[29]!==M||e[30]!==b||e[31]!==d||e[32]!==a||e[33]!==t||e[34]!==G||e[35]!==g||e[36]!==v||e[37]!==c||e[38]!==m||e[39]!==i?(f=I.jsxRuntimeExports.jsx(J.CirclePackingGraph,{colors:g,graphTitle:l,graphDescription:r,footNote:s,width:i,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:$,language:q,minHeight:H,theme:v,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T}),e[9]=E,e[10]=h,e[11]=y,e[12]=D,e[13]=A,e[14]=$,e[15]=R,e[16]=s,e[17]=r,e[18]=S,e[19]=j,e[20]=l,e[21]=o,e[22]=q,e[23]=p,e[24]=H,e[25]=k,e[26]=w,e[27]=u,e[28]=T,e[29]=M,e[30]=b,e[31]=d,e[32]=a,e[33]=t,e[34]=G,e[35]=g,e[36]=v,e[37]=c,e[38]=m,e[39]=i,e[40]=f):f=e[40],f}if(Z==="treeMap"){const g=x||W.Colors.graphMainColor;let f;return e[41]!==E||e[42]!==h||e[43]!==y||e[44]!==D||e[45]!==A||e[46]!==$||e[47]!==R||e[48]!==s||e[49]!==r||e[50]!==S||e[51]!==j||e[52]!==l||e[53]!==o||e[54]!==q||e[55]!==p||e[56]!==H||e[57]!==k||e[58]!==w||e[59]!==u||e[60]!==T||e[61]!==M||e[62]!==b||e[63]!==d||e[64]!==a||e[65]!==t||e[66]!==G||e[67]!==g||e[68]!==v||e[69]!==c||e[70]!==m||e[71]!==i?(f=I.jsxRuntimeExports.jsx(ae.TreeMapGraph,{colors:g,graphTitle:l,graphDescription:r,footNote:s,width:i,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:$,language:q,minHeight:H,theme:v,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T}),e[41]=E,e[42]=h,e[43]=y,e[44]=D,e[45]=A,e[46]=$,e[47]=R,e[48]=s,e[49]=r,e[50]=S,e[51]=j,e[52]=l,e[53]=o,e[54]=q,e[55]=p,e[56]=H,e[57]=k,e[58]=w,e[59]=u,e[60]=T,e[61]=M,e[62]=b,e[63]=d,e[64]=a,e[65]=t,e[66]=G,e[67]=g,e[68]=v,e[69]=c,e[70]=m,e[71]=i,e[72]=f):f=e[72],f}if(Z==="donutChart"){const g=x||W.Colors[v].categoricalColors.colors,f=i&&o?i<o?i:o:i||o||void 0,P=$;let F;return e[73]!==E||e[74]!==h||e[75]!==D||e[76]!==A||e[77]!==R||e[78]!==ee||e[79]!==s||e[80]!==r||e[81]!==S||e[82]!==j||e[83]!==l||e[84]!==q||e[85]!==k||e[86]!==w||e[87]!==u||e[88]!==T||e[89]!==N||e[90]!==t||e[91]!==G||e[92]!==g||e[93]!==f||e[94]!==P||e[95]!==v||e[96]!==c?(F=I.jsxRuntimeExports.jsx(ce.DonutChart,{colors:g,graphTitle:l,graphDescription:r,footNote:s,radius:f,sources:t,backgroundColor:h,padding:u,tooltip:c,onSeriesMouseOver:w,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:P,strokeWidth:ee,showColorScale:!0,sortData:N,language:q,theme:v,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T}),e[73]=E,e[74]=h,e[75]=D,e[76]=A,e[77]=R,e[78]=ee,e[79]=s,e[80]=r,e[81]=S,e[82]=j,e[83]=l,e[84]=q,e[85]=k,e[86]=w,e[87]=u,e[88]=T,e[89]=N,e[90]=t,e[91]=G,e[92]=g,e[93]=f,e[94]=P,e[95]=v,e[96]=c,e[97]=F):F=e[97],F}const ie=x||W.Colors.graphMainColor;let V;return e[98]!==E||e[99]!==h||e[100]!==_||e[101]!==B||e[102]!==y||e[103]!==D||e[104]!==A||e[105]!==$||e[106]!==R||e[107]!==s||e[108]!==r||e[109]!==S||e[110]!==j||e[111]!==l||e[112]!==o||e[113]!==re||e[114]!==q||e[115]!==p||e[116]!==te||e[117]!==U||e[118]!==H||e[119]!==k||e[120]!==w||e[121]!==u||e[122]!==T||e[123]!==Q||e[124]!==M||e[125]!==b||e[126]!==d||e[127]!==L||e[128]!==a||e[129]!==N||e[130]!==t||e[131]!==G||e[132]!==ie||e[133]!==v||e[134]!==c||e[135]!==m||e[136]!==Y||e[137]!==i?(V=I.jsxRuntimeExports.jsx(ue.SimpleBarGraph,{colors:ie,graphTitle:l,graphDescription:r,footNote:s,width:i,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:$,barPadding:B,refValues:Q,truncateBy:Y,maxValue:U,showTicks:L,sortData:N,language:q,minHeight:H,theme:v,maxBarThickness:te,ariaLabel:E,orientation:_,detailsOnClick:R,styles:G,classNames:D,precision:T,hideAxisLine:re}),e[98]=E,e[99]=h,e[100]=_,e[101]=B,e[102]=y,e[103]=D,e[104]=A,e[105]=$,e[106]=R,e[107]=s,e[108]=r,e[109]=S,e[110]=j,e[111]=l,e[112]=o,e[113]=re,e[114]=q,e[115]=p,e[116]=te,e[117]=U,e[118]=H,e[119]=k,e[120]=w,e[121]=u,e[122]=T,e[123]=Q,e[124]=M,e[125]=b,e[126]=d,e[127]=L,e[128]=a,e[129]=N,e[130]=t,e[131]=G,e[132]=ie,e[133]=v,e[134]=c,e[135]=m,e[136]=Y,e[137]=i,e[138]=V):V=e[138],V}function ve(n){return{label:`${n.x0}-${n.x1}`,size:n.length,data:{options:`${n.x0}-${n.x1}`,frequency:n.length}}}function Ce(n){return n.value}exports.Histogram=ye;
|
|
2
2
|
//# sourceMappingURL=Histogram.cjs.map
|
package/dist/Histogram.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as le, j as R } from "./index-CHPV5EwG-DecW7_qr.js";
|
|
2
2
|
import { w as se } from "./Spinner--r2RrJV8.js";
|
|
3
|
-
import { e as re, C as ce } from "./index-
|
|
3
|
+
import { e as re, C as ce } from "./index-BzNfurbO.js";
|
|
4
4
|
import { TreeMapGraph as fe } from "./TreeMapGraph.js";
|
|
5
5
|
import { DonutChart as he } from "./DonutChart.js";
|
|
6
6
|
import { SimpleBarGraph as ue } from "./BarGraph.js";
|
|
@@ -498,6 +498,7 @@ declare interface GraphSettingsDataType {
|
|
|
498
498
|
hideAxisLine?: boolean;
|
|
499
499
|
projectionRotate?: [number, number] | [number, number, number];
|
|
500
500
|
rewindCoordinatesInMapData?: boolean;
|
|
501
|
+
circularBoundary?: boolean;
|
|
501
502
|
}
|
|
502
503
|
|
|
503
504
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -517,6 +517,7 @@ declare interface GraphSettingsDataType {
|
|
|
517
517
|
hideAxisLine?: boolean;
|
|
518
518
|
projectionRotate?: [number, number] | [number, number, number];
|
|
519
519
|
rewindCoordinatesInMapData?: boolean;
|
|
520
|
+
circularBoundary?: boolean;
|
|
520
521
|
}
|
|
521
522
|
|
|
522
523
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -489,6 +489,7 @@ declare interface GraphSettingsDataType {
|
|
|
489
489
|
hideAxisLine?: boolean;
|
|
490
490
|
projectionRotate?: [number, number] | [number, number, number];
|
|
491
491
|
rewindCoordinatesInMapData?: boolean;
|
|
492
|
+
circularBoundary?: boolean;
|
|
492
493
|
}
|
|
493
494
|
|
|
494
495
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -508,6 +508,7 @@ declare interface GraphSettingsDataType {
|
|
|
508
508
|
hideAxisLine?: boolean;
|
|
509
509
|
projectionRotate?: [number, number] | [number, number, number];
|
|
510
510
|
rewindCoordinatesInMapData?: boolean;
|
|
511
|
+
circularBoundary?: boolean;
|
|
511
512
|
}
|
|
512
513
|
|
|
513
514
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -410,6 +410,7 @@ declare interface GraphSettingsDataType {
|
|
|
410
410
|
hideAxisLine?: boolean;
|
|
411
411
|
projectionRotate?: [number, number] | [number, number, number];
|
|
412
412
|
rewindCoordinatesInMapData?: boolean;
|
|
413
|
+
circularBoundary?: boolean;
|
|
413
414
|
}
|
|
414
415
|
|
|
415
416
|
declare type GraphType = GraphTypeForGriddedGraph;
|
package/dist/ScrollStory.d.ts
CHANGED
|
@@ -416,6 +416,7 @@ declare interface GraphSettingsDataType {
|
|
|
416
416
|
hideAxisLine?: boolean;
|
|
417
417
|
projectionRotate?: [number, number] | [number, number, number];
|
|
418
418
|
rewindCoordinatesInMapData?: boolean;
|
|
419
|
+
circularBoundary?: boolean;
|
|
419
420
|
}
|
|
420
421
|
|
|
421
422
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-6v2a2njQ.cjs"),o=require("react"),te=require("./index-CyZ1lmi_.cjs"),q=require("./index-BS2TADPj.cjs"),le=require("./index-DQA8q5sC.cjs"),C=require("./DropdownSelect-NNpOs7DX.cjs"),d=require("./checkIfMultiple-DxnGtm3t.cjs"),ne=require("./Spinner-jTMOLuw_.cjs"),ie=require("./GraphContainer-B1EDxJ0S.cjs"),re=require("./GraphEl-B-XEJeRt.cjs"),$=require("./fetchAndParseData-QTF6tjij.cjs"),U=require("./transformDataForAggregation-BFdha9Dx.cjs"),z=require("./getUniqValue-NX8DgwND.cjs"),se=require("./GraphHeader.cjs"),W=require("./filterData-T5DQBE9b.cjs"),oe=require("./getGraphList-DQ24IzAn.cjs"),J=require("./transformDataForSelect-YmStusCI.cjs"),ue=u=>{if(u.findIndex(n=>n.chartConfigId==="yMin")!==-1&&u.findIndex(n=>n.chartConfigId==="yMax")!==-1)return u;const i=[...u];return u.findIndex(n=>n.chartConfigId==="yMin")===-1&&i.push({chartConfigId:"yMin",columnId:`${u[u.findIndex(n=>n.chartConfigId==="y")].columnId}Min`}),u.findIndex(n=>n.chartConfigId==="yMax")===-1&&i.push({chartConfigId:"yMax",columnId:`${u[u.findIndex(n=>n.chartConfigId==="y")].columnId}Max`}),i},M=(u,i)=>{const n=i?.map(D=>{const b=u?.findIndex(s=>s.chartConfigId===D.chartConfigId);if(b===-1)return{};const w=u[b]?.allowedColumnIds?.findIndex(s=>s.value===D.columnId);return w===-1?{}:u[b].allowedColumnIds[w].graphSettings||{}})||[];return Object.assign({},...n)};function de(u){const{graphSettings:i,dataSettings:n,filters:D,graphType:b,dataTransform:w,graphDataConfiguration:s,dataFilters:A,debugMode:S,dataSelectionOptions:I,advancedDataSelectionOptions:N,readableHeader:B,noOfFiltersPerRow:p=4,updateFilters:K,uiMode:f="normal",highlightDataPointSettings:m}=u,[P,F]=o.useState(void 0),[c,Q]=o.useState(void 0),[v,j]=o.useState(s),[x,V]=o.useState({}),[E,X]=o.useState(void 0),[Y,Z]=o.useState([]),H=o.useRef(null),O=o.useRef(s),[R,k]=o.useState([]),G={ignoreCase:!0,ignoreAccents:!0,trim:!0},L=o.useEffectEvent(()=>{const e=(D||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,ui:r.ui,defaultValue:J.transformDefaultValue(r.defaultValue),value:J.transformDefaultValue(r.defaultValue),availableValues:z.getUniqValue(c,r.column).filter(a=>!r.excludeValues?.includes(`${a}`)).map(a=>({value:a,label:a})),allowSelectAll:r.allowSelectAll,width:r.width}));k(e)});o.useEffect(()=>{(async()=>{try{const r=n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?await $.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,S):n.fileType==="api"?await $.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,S):await $.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,S,n.delimiter,!0):await $.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):await $.transformColumnsToArray(n.data,n.columnsToArray);Q(r)}catch(r){console.error("Data fetching error:",r)}})(),L()},[n,S]),o.useEffect(()=>{L()},[D,c]);const _=o.useEffectEvent(()=>{if(!c||R.length===0)F(c);else{const e=c.filter(r=>R.every(a=>a.value&&q.flattenDeep([a.value]).length>0?te.intersection(q.flattenDeep([r[a.filter]]),q.flattenDeep([a.value]).map(t=>t.value)).length>0:!0));F(e)}});o.useEffect(()=>{_()},[R,c]),o.useEffect(()=>{I&&V(M(I,s))},[I,s]);const ee=o.useEffectEvent(()=>{m?.column&&P&&Z(z.getUniqValue(P,m.column).filter(e=>!m?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))});o.useEffect(()=>{ee()},[m]),o.useEffect(()=>{le.isEqual(O.current,s)||(j(s),O.current=s)},[s]);const y=(e,r)=>{k(a=>a.map(t=>t.filter===e?{...t,value:r}:t))},ae=c?U.transformDataForGraph(w?U.transformDataForAggregation(W.filterData(c,A||[]),w.keyColumn,w.aggregationColumnsSetting):W.filterData(c,A||[]),b,b==="lineChartWithConfidenceInterval"&&v?ue(v):v):void 0;return l.jsxRuntimeExports.jsx(ie.GraphContainer,{className:i?.classNames?.graphContainer,style:i?.styles?.graphContainer,id:i?.graphID,ref:H,"aria-label":i?.ariaLabel,backgroundColor:i?.backgroundColor??!1,theme:i?.theme||"light",language:i?.language||"en",width:i?.width,height:i?.height,padding:i?.padding,minHeight:i?.minHeight,relativeHeight:i?.relativeHeight,children:c||oe.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(b)!==-1?l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[x?.graphTitle||x?.graphDescription||i?.graphTitle||i?.graphDescription||i?.graphDownload||i?.dataDownload?l.jsxRuntimeExports.jsx(se.GraphHeader,{styles:{title:x?.styles?.title||i?.styles?.title,description:x?.styles?.description||i?.styles?.description},classNames:{title:x?.classNames?.title||i?.classNames?.title,description:x?.classNames?.description||i?.classNames?.description},graphTitle:x?.graphTitle||i?.graphTitle,graphDescription:x?.graphDescription||i?.graphDescription,width:x?.width||i?.width,graphDownload:i?.graphDownload?H:void 0,dataDownload:i?.dataDownload&&c&&c.length>0?c:null}):null,R.length!==0||(I||[]).length!==0||(N||[]).length!==0||m?l.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-0 w-full",children:[N?.map((e,r)=>l.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.options.map(a=>({...a,value:a.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{V(a?.graphSettings||{}),j(a?.dataConfiguration)}}):l.jsxRuntimeExports.jsx(d.ye,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:f,onValueChange:a=>{const t=e.options[e.options.findIndex(g=>g.label===a)];V(t.graphSettings||{}),j(t.dataConfiguration)},children:e.options.map((a,t)=>l.jsxRuntimeExports.jsx(d.he,{label:a.label,value:a.label},t))})]},r)),I?.map((e,r)=>l.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),d.checkIfMultiple(e.chartConfigId,v||[])?e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]):void 0,filterOption:C.Du(G),onChange:a=>{const t={columnId:(a||[]).map(h=>h.value),chartConfigId:e.chartConfigId},g=v?.map(h=>h.chartConfigId===t.chartConfigId?t:h);j(g)}}):l.jsxRuntimeExports.jsx(d.$,{variant:f,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]).map(a=>a.value):[],onValueChange:a=>{const t={columnId:a||[],chartConfigId:e.chartConfigId},g=v?.map(h=>h.chartConfigId===t.chartConfigId?t:h);j(g)},children:e.allowedColumnIds.map((a,t)=>l.jsxRuntimeExports.jsx(d.P,{label:a.label,value:a.label},t))}):e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:a=>{const t={columnId:a?.value,chartConfigId:e.chartConfigId},g=v?.map(h=>h.chartConfigId===t.chartConfigId?t:h);V(M(I,g)),j(g)}}):l.jsxRuntimeExports.jsx(d.ye,{variant:f,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const g={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(T=>T.label===a)].value,chartConfigId:e.chartConfigId},h=v?.map(T=>T.chartConfigId===g.chartConfigId?g:T);V(M(I,h)),j(h)},children:e.allowedColumnIds.map((a,t)=>l.jsxRuntimeExports.jsx(d.he,{label:a.label,value:a.label},t))})]},r)),R?.map((e,r)=>l.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:e.width?0:1,flexShrink:0,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:e.label}),e.singleSelect?e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.availableValues,variant:f,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Du(G),onChange:a=>{y(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):l.jsxRuntimeExports.jsx(d.ye,{variant:f,defaultValue:e.defaultValue.value,onValueChange:a=>{y(e.filter,e.availableValues.filter(t=>t.value===a))},children:e.availableValues.map((a,t)=>l.jsxRuntimeExports.jsx(d.he,{label:`${a.label}`,value:`${a.value}`},t))}):l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.availableValues,variant:f,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Du(G),onChange:a=>{y(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):l.jsxRuntimeExports.jsx(d.$,{variant:f,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{y(e.filter,e.availableValues.filter(t=>a.indexOf(`${t.value}`)!==-1))},children:e.availableValues.map((a,t)=>l.jsxRuntimeExports.jsx(d.P,{label:`${a.label}`,value:`${a.value}`},t))}),e.allowSelectAll?l.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{y(e.filter,e.availableValues)},children:"Select all options"}):null]})]},r)),m?l.jsxRuntimeExports.jsxs("div",{style:{width:m.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:m.width?0:1,flexShrink:0,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:m.label||"Highlight data"}),l.jsxRuntimeExports.jsx(C.ja,{options:Y,variant:f,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Du(G),onChange:e=>{X(e?.map(r=>r.value))},value:E?.map(e=>({label:e,value:e})),defaultValue:m.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,l.jsxRuntimeExports.jsx(re.GraphEl,{graph:b,graphData:ae,graphDataConfiguration:v,debugMode:S,readableHeader:B||[],updateFilters:K,settings:{...i||{},...x,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,width:void 0,height:void 0,relativeHeight:void 0,minHeight:void 0,padding:"0",theme:i?.theme,...E?{highlightedDataPoints:E,highlightedIds:E?.map(e=>`${e}`),highlightedLines:E?.map(e=>e)}:{}}})]}):l.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:l.jsxRuntimeExports.jsx(ne.w,{})})})}exports.SingleGraphDashboard=de;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-6v2a2njQ.cjs"),o=require("react"),te=require("./index-CyZ1lmi_.cjs"),q=require("./index-BS2TADPj.cjs"),le=require("./index-DQA8q5sC.cjs"),C=require("./DropdownSelect-NNpOs7DX.cjs"),d=require("./checkIfMultiple-DxnGtm3t.cjs"),ne=require("./Spinner-jTMOLuw_.cjs"),ie=require("./GraphContainer-B1EDxJ0S.cjs"),re=require("./GraphEl-DjElfY07.cjs"),$=require("./fetchAndParseData-QTF6tjij.cjs"),U=require("./transformDataForAggregation-BFdha9Dx.cjs"),z=require("./getUniqValue-NX8DgwND.cjs"),se=require("./GraphHeader.cjs"),W=require("./filterData-T5DQBE9b.cjs"),oe=require("./getGraphList-DQ24IzAn.cjs"),J=require("./transformDataForSelect-YmStusCI.cjs"),ue=u=>{if(u.findIndex(n=>n.chartConfigId==="yMin")!==-1&&u.findIndex(n=>n.chartConfigId==="yMax")!==-1)return u;const i=[...u];return u.findIndex(n=>n.chartConfigId==="yMin")===-1&&i.push({chartConfigId:"yMin",columnId:`${u[u.findIndex(n=>n.chartConfigId==="y")].columnId}Min`}),u.findIndex(n=>n.chartConfigId==="yMax")===-1&&i.push({chartConfigId:"yMax",columnId:`${u[u.findIndex(n=>n.chartConfigId==="y")].columnId}Max`}),i},M=(u,i)=>{const n=i?.map(D=>{const b=u?.findIndex(s=>s.chartConfigId===D.chartConfigId);if(b===-1)return{};const w=u[b]?.allowedColumnIds?.findIndex(s=>s.value===D.columnId);return w===-1?{}:u[b].allowedColumnIds[w].graphSettings||{}})||[];return Object.assign({},...n)};function de(u){const{graphSettings:i,dataSettings:n,filters:D,graphType:b,dataTransform:w,graphDataConfiguration:s,dataFilters:A,debugMode:S,dataSelectionOptions:I,advancedDataSelectionOptions:N,readableHeader:B,noOfFiltersPerRow:p=4,updateFilters:K,uiMode:f="normal",highlightDataPointSettings:m}=u,[P,F]=o.useState(void 0),[c,Q]=o.useState(void 0),[v,j]=o.useState(s),[x,V]=o.useState({}),[E,X]=o.useState(void 0),[Y,Z]=o.useState([]),H=o.useRef(null),O=o.useRef(s),[R,k]=o.useState([]),G={ignoreCase:!0,ignoreAccents:!0,trim:!0},L=o.useEffectEvent(()=>{const e=(D||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,ui:r.ui,defaultValue:J.transformDefaultValue(r.defaultValue),value:J.transformDefaultValue(r.defaultValue),availableValues:z.getUniqValue(c,r.column).filter(a=>!r.excludeValues?.includes(`${a}`)).map(a=>({value:a,label:a})),allowSelectAll:r.allowSelectAll,width:r.width}));k(e)});o.useEffect(()=>{(async()=>{try{const r=n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?await $.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,S):n.fileType==="api"?await $.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,S):await $.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,S,n.delimiter,!0):await $.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):await $.transformColumnsToArray(n.data,n.columnsToArray);Q(r)}catch(r){console.error("Data fetching error:",r)}})(),L()},[n,S]),o.useEffect(()=>{L()},[D,c]);const _=o.useEffectEvent(()=>{if(!c||R.length===0)F(c);else{const e=c.filter(r=>R.every(a=>a.value&&q.flattenDeep([a.value]).length>0?te.intersection(q.flattenDeep([r[a.filter]]),q.flattenDeep([a.value]).map(t=>t.value)).length>0:!0));F(e)}});o.useEffect(()=>{_()},[R,c]),o.useEffect(()=>{I&&V(M(I,s))},[I,s]);const ee=o.useEffectEvent(()=>{m?.column&&P&&Z(z.getUniqValue(P,m.column).filter(e=>!m?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))});o.useEffect(()=>{ee()},[m]),o.useEffect(()=>{le.isEqual(O.current,s)||(j(s),O.current=s)},[s]);const y=(e,r)=>{k(a=>a.map(t=>t.filter===e?{...t,value:r}:t))},ae=c?U.transformDataForGraph(w?U.transformDataForAggregation(W.filterData(c,A||[]),w.keyColumn,w.aggregationColumnsSetting):W.filterData(c,A||[]),b,b==="lineChartWithConfidenceInterval"&&v?ue(v):v):void 0;return l.jsxRuntimeExports.jsx(ie.GraphContainer,{className:i?.classNames?.graphContainer,style:i?.styles?.graphContainer,id:i?.graphID,ref:H,"aria-label":i?.ariaLabel,backgroundColor:i?.backgroundColor??!1,theme:i?.theme||"light",language:i?.language||"en",width:i?.width,height:i?.height,padding:i?.padding,minHeight:i?.minHeight,relativeHeight:i?.relativeHeight,children:c||oe.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(b)!==-1?l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[x?.graphTitle||x?.graphDescription||i?.graphTitle||i?.graphDescription||i?.graphDownload||i?.dataDownload?l.jsxRuntimeExports.jsx(se.GraphHeader,{styles:{title:x?.styles?.title||i?.styles?.title,description:x?.styles?.description||i?.styles?.description},classNames:{title:x?.classNames?.title||i?.classNames?.title,description:x?.classNames?.description||i?.classNames?.description},graphTitle:x?.graphTitle||i?.graphTitle,graphDescription:x?.graphDescription||i?.graphDescription,width:x?.width||i?.width,graphDownload:i?.graphDownload?H:void 0,dataDownload:i?.dataDownload&&c&&c.length>0?c:null}):null,R.length!==0||(I||[]).length!==0||(N||[]).length!==0||m?l.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-0 w-full",children:[N?.map((e,r)=>l.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.options.map(a=>({...a,value:a.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{V(a?.graphSettings||{}),j(a?.dataConfiguration)}}):l.jsxRuntimeExports.jsx(d.ye,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:f,onValueChange:a=>{const t=e.options[e.options.findIndex(g=>g.label===a)];V(t.graphSettings||{}),j(t.dataConfiguration)},children:e.options.map((a,t)=>l.jsxRuntimeExports.jsx(d.he,{label:a.label,value:a.label},t))})]},r)),I?.map((e,r)=>l.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),d.checkIfMultiple(e.chartConfigId,v||[])?e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]):void 0,filterOption:C.Du(G),onChange:a=>{const t={columnId:(a||[]).map(h=>h.value),chartConfigId:e.chartConfigId},g=v?.map(h=>h.chartConfigId===t.chartConfigId?t:h);j(g)}}):l.jsxRuntimeExports.jsx(d.$,{variant:f,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]).map(a=>a.value):[],onValueChange:a=>{const t={columnId:a||[],chartConfigId:e.chartConfigId},g=v?.map(h=>h.chartConfigId===t.chartConfigId?t:h);j(g)},children:e.allowedColumnIds.map((a,t)=>l.jsxRuntimeExports.jsx(d.P,{label:a.label,value:a.label},t))}):e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:f,controlShouldRenderValue:!0,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:a=>{const t={columnId:a?.value,chartConfigId:e.chartConfigId},g=v?.map(h=>h.chartConfigId===t.chartConfigId?t:h);V(M(I,g)),j(g)}}):l.jsxRuntimeExports.jsx(d.ye,{variant:f,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const g={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(T=>T.label===a)].value,chartConfigId:e.chartConfigId},h=v?.map(T=>T.chartConfigId===g.chartConfigId?g:T);V(M(I,h)),j(h)},children:e.allowedColumnIds.map((a,t)=>l.jsxRuntimeExports.jsx(d.he,{label:a.label,value:a.label},t))})]},r)),R?.map((e,r)=>l.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:e.width?0:1,flexShrink:0,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:e.label}),e.singleSelect?e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.availableValues,variant:f,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Du(G),onChange:a=>{y(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):l.jsxRuntimeExports.jsx(d.ye,{variant:f,defaultValue:e.defaultValue.value,onValueChange:a=>{y(e.filter,e.availableValues.filter(t=>t.value===a))},children:e.availableValues.map((a,t)=>l.jsxRuntimeExports.jsx(d.he,{label:`${a.label}`,value:`${a.value}`},t))}):l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?l.jsxRuntimeExports.jsx(C.ja,{options:e.availableValues,variant:f,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Du(G),onChange:a=>{y(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):l.jsxRuntimeExports.jsx(d.$,{variant:f,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{y(e.filter,e.availableValues.filter(t=>a.indexOf(`${t.value}`)!==-1))},children:e.availableValues.map((a,t)=>l.jsxRuntimeExports.jsx(d.P,{label:`${a.label}`,value:`${a.value}`},t))}),e.allowSelectAll?l.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{y(e.filter,e.availableValues)},children:"Select all options"}):null]})]},r)),m?l.jsxRuntimeExports.jsxs("div",{style:{width:m.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:m.width?0:1,flexShrink:0,minWidth:"240px"},className:"pb-4",children:[l.jsxRuntimeExports.jsx(d.b,{className:"mb-2",children:m.label||"Highlight data"}),l.jsxRuntimeExports.jsx(C.ja,{options:Y,variant:f,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Du(G),onChange:e=>{X(e?.map(r=>r.value))},value:E?.map(e=>({label:e,value:e})),defaultValue:m.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,l.jsxRuntimeExports.jsx(re.GraphEl,{graph:b,graphData:ae,graphDataConfiguration:v,debugMode:S,readableHeader:B||[],updateFilters:K,settings:{...i||{},...x,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,width:void 0,height:void 0,relativeHeight:void 0,minHeight:void 0,padding:"0",theme:i?.theme,...E?{highlightedDataPoints:E,highlightedIds:E?.map(e=>`${e}`),highlightedLines:E?.map(e=>e)}:{}}})]}):l.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:l.jsxRuntimeExports.jsx(ne.w,{})})})}exports.SingleGraphDashboard=de;
|
|
2
2
|
//# sourceMappingURL=SingleGraphDashboard.cjs.map
|
|
@@ -465,6 +465,7 @@ declare interface GraphSettingsDataType {
|
|
|
465
465
|
hideAxisLine?: boolean;
|
|
466
466
|
projectionRotate?: [number, number] | [number, number, number];
|
|
467
467
|
rewindCoordinatesInMapData?: boolean;
|
|
468
|
+
circularBoundary?: boolean;
|
|
468
469
|
}
|
|
469
470
|
|
|
470
471
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -7,7 +7,7 @@ import { j as V, D as M } from "./DropdownSelect-D8rFbygC.js";
|
|
|
7
7
|
import { b as A, y as H, h as O, c as da, $ as K, P as Q } from "./checkIfMultiple-D9fVkeOq.js";
|
|
8
8
|
import { w as ha } from "./Spinner--r2RrJV8.js";
|
|
9
9
|
import { G as ca } from "./GraphContainer-CF6ws3pd.js";
|
|
10
|
-
import { G as fa } from "./GraphEl-
|
|
10
|
+
import { G as fa } from "./GraphEl-Bw-9MUym.js";
|
|
11
11
|
import { f as ga, a as pa, b as ma, c as Ca, t as va } from "./fetchAndParseData-BAXhgTDM.js";
|
|
12
12
|
import { a as Ia, t as ba } from "./transformDataForAggregation-wdPf8bNt.js";
|
|
13
13
|
import { g as X } from "./getUniqValue-DsqSii6M.js";
|
|
@@ -488,6 +488,7 @@ declare interface GraphSettingsDataType {
|
|
|
488
488
|
hideAxisLine?: boolean;
|
|
489
489
|
projectionRotate?: [number, number] | [number, number, number];
|
|
490
490
|
rewindCoordinatesInMapData?: boolean;
|
|
491
|
+
circularBoundary?: boolean;
|
|
491
492
|
}
|
|
492
493
|
|
|
493
494
|
declare type GraphType = GraphTypeForGriddedGraph;
|
|
@@ -379,6 +379,7 @@ declare interface GraphSettingsDataType {
|
|
|
379
379
|
hideAxisLine?: boolean;
|
|
380
380
|
projectionRotate?: [number, number] | [number, number, number];
|
|
381
381
|
rewindCoordinatesInMapData?: boolean;
|
|
382
|
+
circularBoundary?: boolean;
|
|
382
383
|
}
|
|
383
384
|
|
|
384
385
|
declare interface HighlightAreaSettingsDataType {
|
|
@@ -386,6 +386,7 @@ declare interface GraphSettingsDataType {
|
|
|
386
386
|
hideAxisLine?: boolean;
|
|
387
387
|
projectionRotate?: [number, number] | [number, number, number];
|
|
388
388
|
rewindCoordinatesInMapData?: boolean;
|
|
389
|
+
circularBoundary?: boolean;
|
|
389
390
|
}
|
|
390
391
|
|
|
391
392
|
declare interface HighlightAreaSettingsDataType {
|
|
@@ -465,6 +465,7 @@ declare interface GraphSettingsDataType {
|
|
|
465
465
|
hideAxisLine?: boolean;
|
|
466
466
|
projectionRotate?: [number, number] | [number, number, number];
|
|
467
467
|
rewindCoordinatesInMapData?: boolean;
|
|
468
|
+
circularBoundary?: boolean;
|
|
468
469
|
}
|
|
469
470
|
|
|
470
471
|
declare interface HighlightAreaSettingsDataType {
|
|
@@ -488,6 +488,7 @@ declare interface GraphSettingsDataType {
|
|
|
488
488
|
hideAxisLine?: boolean;
|
|
489
489
|
projectionRotate?: [number, number] | [number, number, number];
|
|
490
490
|
rewindCoordinatesInMapData?: boolean;
|
|
491
|
+
circularBoundary?: boolean;
|
|
491
492
|
}
|
|
492
493
|
|
|
493
494
|
declare interface HighlightAreaSettingsDataType {
|
package/dist/Types.d.ts
CHANGED
|
@@ -672,6 +672,7 @@ export declare interface GraphSettingsDataType {
|
|
|
672
672
|
hideAxisLine?: boolean;
|
|
673
673
|
projectionRotate?: [number, number] | [number, number, number];
|
|
674
674
|
rewindCoordinatesInMapData?: boolean;
|
|
675
|
+
circularBoundary?: boolean;
|
|
675
676
|
}
|
|
676
677
|
|
|
677
678
|
export declare type GraphType = GraphTypeForGriddedGraph;
|