@devgateway/dvz-ui-react 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),h=require("react"),ue=require("semantic-ui-react"),Qa=require("../data/DataProvider.js"),Za=require("../data/DataConsumer.js"),Oa=require("../../utils/deviceType.js"),er=require("./Pie.js");require("immutable");const tr=require("./Radar.js"),ar=require("./Bar.js"),rr=require("./Line.js"),or=require("@devgateway/wp-react-lib"),Q=require("./data/index.js"),nr=require("./CSVDataFrame.js"),sr=require("./colors/ColorProvider.js"),ot=require("./Messages.js"),ir=require("react-redux"),lr=require("react-intl"),dr=y=>{console.log("manual colors...",y["data-manual-colors"]);let{parent:me,editing:i=!1,unique:Z,childContent:L,categories:X,injectedMeasures:l,"data-app":o="csv","data-dvz-proxy-dataset-id":pe,"data-group":he="default","data-height":S=500,"data-type":B="bar","data-dimension1":E,"data-dimension2":fe,"data-dimension3":pr,"data-color-by":q="index","data-scheme":O="system","data-group-mode":nt="grouped","data-left-legend":st="Left Legend","data-legend-label":it="","data-bottom-legend":lt="Bottom Legend","data-dualmode":dt,"data-legend-position":ge="right","data-show-legends":be="true","data-data-source-label":hr="Source","data-chart-data-source":fr="Data Source","data-toggle-info-label":gr="Info Graphic","data-toggle-chart-label":br="Chart","data-tick-rotation":m=0,"data-tick-color":ct="rgb(92,93,99)","data-measures":ut="{}","data-format":xr="{}","data-csv":mt="","data-margin-left":pt=50,"data-margin-top":ht=25,"data-margin-right":ft=25,"data-margin-bottom":gt=25,"data-start-angle":bt=0,"data-end-angle":xt=360,"data-view-mode":xe="info","data-filters":wt="[]","data-tooltip-html":vt="","data-layout":ee="vertical","data-reverse":we="false","data-offset-y":yt="-40","data-line-layer-enabled":ve="false","data-overlays":Lt="[]","data-max-value":kt="auto","data-value-scale":Tt="linear","data-swap":V="false","data-no-data-message":Ct="No data matches your selection","data-bar-color":Mt="rgb(0,0,0)","data-override-tick-color":ye="false","data-fixed-min-value":It=0,"data-fixed-max-value":At=0,"data-bar-padding":Rt=.15,"data-bar-label-position":Dt="middle","data-line-label-position":Ft="none","data-show-grid":Le="true","data-include-overall":ke="false","data-bar-inner-padding":Pt=.7,"data-x-label-color":Bt="#000","data-bar-label-color":Et="#000","data-legend-label-color":qt="#000","data-tooltip-enabled":Te="true","data-use-check-box-background":Ce="false","data-use-label-background":Me="true","data-highlight-xaxis-line":Ie="false","data-show-tick-line":Ae="true","data-show-right-axis":Re="true","data-manual-colors":Nt="{}","data-right-legend":zt="","data-offset-right":Xt="40","data-offset-bottom":St="40","data-hidden-bars":Vt=[],"data-confidence-intervals":Gt="[]","data-enable-area":De="false","data-area-shading-criteria":Ut="DEFAULT","data-area-lower-bound":$t="","data-area-upper-bound":Wt="","data-show-points":Fe="true","data-center-label":Ht="","data-show-arc-labels":Pe="true","data-show-arc-link-labels":Be="true","data-slice-padding":Yt=1,"data-center-label-font-weight":_t="normal","data-center-label-font-size":Jt="12","data-center-label-xoffset":jt=0,"data-center-label-yoffset":Kt=0,"data-group-total-measure":Qt="","data-show-group-total":Ee="true","data-group-total-label":Zt="","data-group-total-format":Ot="{}","data-group-total-label-offset":ea,"data-group-total-fixed-position":qe="false","data-tooltip-enable-markdown":G="false","data-y-axis-tick-values":Ne="10","data-x-axis-tick-values":ze="10","data-enable-grid-y":k="true","data-enable-grid-x":T="false","data-offset-text":ta=0,"data-overall-label":te="Overall","data-min-max-clamp":aa="false","data-reverse-legend":Xe="false","data-sort":Se="default","data-sort-reverse":U="false","data-sort-second-dimension":Ve="default","data-sort-reverse-second-dimension":$="false","data-radar-curve":ra="linearClosed","data-radar-fill-opacity":oa=.25,"data-radar-border-width":na=2,"data-radar-grid-levels":sa=3,"data-radar-grid-shape":ia="circular","data-radar-grid-label-offset":la=36,"data-radar-enable-dots":Ge="true","data-radar-dot-size":da=8,"data-radar-enable-dot-label":Ue="true","data-radar-dot-label-offset":ca=-12,"data-mobile-customization":$e="{}","data-show-percentage":We="false","data-preview-mode":f="Desktop","data-wait-for-filters":ua="false","data-line-curve":ma="linear","data-show-legends-in-columns":He="false","data-number-of-legend-columns":pa=4,"data-line-x-axis-tick-mode":ha="none","data-line-x-axis-tick-count":fa=10,"data-line-x-axis-tick-every":ga=1,pageModuleProps:g}=y;const ba=i,t=JSON.parse(decodeURIComponent($e)),[ae,xa]=h.useState(window.innerWidth<=1250),x=ae&&((t==null?void 0:t.showCustomization)??!1);g!=null&&g.previewMode&&(g!=null&&g.editing)&&(f=g.previewMode,i=g.editing);const wa=["Tablet"].includes(f)&&i,va=["Mobile"].includes(f)&&i,ya=["Desktop"].includes(f)&&i,c=x&&f!=="Desktop",u=x&&!i,re=()=>{const e=window.matchMedia("(min-width: 768px) and (max-width: 1250px)").matches,r=window.matchMedia("(max-width: 767px)").matches;switch(!0){case ya:return m;case wa:return x?(t==null?void 0:t.tabletXAxisTextRotation)??m:m;case va:return x?(t==null?void 0:t.mobileXAxisTextRotation)??m:m;case e:return x?(t==null?void 0:t.tabletXAxisTextRotation)??m:m;case r:return x?(t==null?void 0:t.mobileXAxisTextRotation)??m:m;default:return m}},La=re(),[ka,Ye]=h.useState(La),_e=y.intl.locale,W=h.useRef(null),Je=e=>{try{return ba?e:decodeURIComponent(e)}catch{return console.error(`error decoding value:${e}`),e}},C=e=>{try{return JSON.parse(Je(e))}catch{console.error(`error parsing value:${e}`)}return null},Ta=()=>{const e=C(Nt);if(!e)return null;const r=e[o];if(o==="csv"&&r&&O==="manual"){if(r[q]!==void 0)return r;if(typeof r=="object"&&r!==null&&!Array.isArray(r)&&Object.values(r).some(p=>typeof p=="string"&&(p.startsWith("#")||p.startsWith("rgb"))))return{[q]:r}}return r},Ca=()=>C(ut),je=()=>{var e;if(a!=null&&a[o]){let r=(e=a==null?void 0:a[o])==null?void 0:e.format;if(!r){const n=Object.keys(a==null?void 0:a[o]);for(let p=0;p<n.length;p++)if(a!=null&&a[o][n[p]].selected&&(a!=null&&a[o][n[p]].format)){r=a==null?void 0:a[o][n[p]].format;break}}return r}return a!=null&&a.csv?a.csv.format:null},Ma=()=>{let e=null;return a!=null&&a[o]?a[o].useCustomAxisFormat&&a[o].customFormat&&(e=a[o].customFormat):a!=null&&a.csv&&a.csv.useCustomAxisFormat&&a.csv.customFormat&&(e=a.csv.customFormat),e},Ia=()=>a!=null&&a[o]?Object.keys(a[o]).map(e=>({value:e,...a[o][e]})).filter(e=>e.selected).map(e=>e.value):[],Ke=()=>{const e={};return a!=null&&a[o]&&Object.keys(a[o]).map(n=>({value:n,...a[o][n]})).filter(n=>n.selected&&n.hasCustomLabel).forEach(n=>{e[n.value]=n.customLabel}),e},Aa=()=>a!=null&&a[o]?Object.keys(a[o]).filter(e=>a[o][e].allowSelection):[];let a=Ca(),w=Ia(),b=je();const Ra=Aa();let oe=st,ne=zt,se=Je(vt);if(l!=null&&l[o]){const e=Object.keys(l[o].measures).map(r=>({value:r,...l[o].measures[r]})).filter(r=>r.selected).map(r=>r.value);a=l,w=e,b=je(),oe=l.leftTitle,ne=l.rightTitle,l.customTooltip&&(se=l.customTooltip)}const Da=b?{style:b.style==="compacted"?"decimal":b.style,notation:b.style==="compacted"?"compact":"standard",currency:b.currency,minimumFractionDigits:parseInt(b.minimumFractionDigits),maximumFractionDigits:parseInt(b.maximumFractionDigits)}:{notation:"standard",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2},Fa=Ma(),s=C(Ot),Pa={style:(s==null?void 0:s.style)==="compacted"?"decimal":s==null?void 0:s.style,notation:(s==null?void 0:s.style)==="compacted"?"compact":"standard",currency:s==null?void 0:s.currency,minimumFractionDigits:parseInt(s==null?void 0:s.minimumFractionDigits),maximumFractionDigits:parseInt(s==null?void 0:s.maximumFractionDigits)},[Ba,wr]=h.useState(xe),Ea=i?xe:Ba,qa={scheme:O,colorBy:q},H=i?S-80:S,Na=()=>(c||u)&&!(t!=null&&t.showXAxisTitle)?"":lt,za=()=>c||u?t!=null&&t.showYAxisTitle?oe:"":oe,Xa=()=>c||u?t!=null&&t.showRightAxisTitle?ne:"":ne,Sa={left:za(),bottom:Na(),right:Xa()},Y=e=>{if(e==="true"||e===!0)return!0;if(e==="false"||e===!1)return!1},Qe=()=>{Y(T)&&!Y(k)?(T=!1,k=!0):!Y(T)&&Y(k)&&(T=!0,k=!1)},Va=()=>ee==="horizontal"?(Qe(),"vertical"):(Qe(),"horizontal"),Ga=()=>t!=null&&t.chartLayoutOverride?Va():ee,_=(e,r,n)=>e?Number.parseInt(r)??n:n,Ze=(e,r,n)=>e?r??n:n;h.useEffect(()=>{const e=()=>{xa(window.innerWidth<=1250);const r=re();Ye(r)};return window.addEventListener("resize",e),Ye(re()),()=>{window.removeEventListener("resize",e)}},[i,f,x,m,t==null?void 0:t.tabletXAxisTextRotation,t==null?void 0:t.mobileXAxisTextRotation]);const Ua=()=>{const e=["tablet","mobile","midTablet"].includes(Oa.default());return i&&f==="Desktop"?ge:e?"bottom":ge},Oe={app:o,editing:i,tickColor:decodeURIComponent(ct),tickRotation:ka,layout:c||u?Ga():ee,reverse:we==!0||we=="true",showLegends:be==!0||be=="true",legendLabel:it,swap:V==!0||V=="true",showGrid:Le==!0||Le=="true",showPercentage:We==!0||We=="true",marginLeft:_(c||u,Number.parseInt(t==null?void 0:t.marginLeft),parseInt(pt)),marginTop:_(c||u,Number.parseInt(t==null?void 0:t.marginTop),parseInt(ht)),marginRight:_(c||u,Number.parseInt(t==null?void 0:t.marginRight),Number.parseInt(ft)),marginBottom:_(c||u,Number.parseInt(t==null?void 0:t.marginBottom),Number.parseInt(gt)),height:`${H}px`,legendPosition:Ua(),legends:Sa,tooltip:G==!0||G=="true"?se:se.replace(/\r\n/g,"<hr/>").replace(/[\r\n]/g,"<hr/>"),colors:qa,groupMode:nt,format:Da,startAngle:bt,endAngle:xt,offsetY:yt,maxValue:kt,valueScale:Tt,categories:X,lineLayerEnabled:ve==!0||ve=="true",overlays:C(Lt)||[],barColor:decodeURIComponent(Mt),overrideTickColor:ye==!0||ye=="true",fixedMinValue:It,fixedMaxValue:At,barPadding:Ze(c||u,t==null?void 0:t.barPadding,Rt),barLabelPosition:Dt,lineLabelPosition:Ft,barInnerPadding:Ze(c||u,t==null?void 0:t.barInnerPadding,Pt),xLabelColor:decodeURIComponent(Bt),barLabelColor:decodeURIComponent(Et),legendLabelColor:decodeURIComponent(qt),tooltipEnabled:Te==!0||Te=="true",legendLabelBack:Me==!0||Me=="true",legendCheckBack:Ce==!0||Ce=="true",highlightXAxisLine:Ie==!0||Ie=="true",showTickLine:Ae==!0||Ae=="true",showRightAxis:Re==!0||Re=="true",offsetRight:Xt,offsetBottom:St,confidenceIntervals:C(Gt)||[],showPoints:Fe==!0||Fe=="true",enableArea:De==!0||De=="true",areaShadingCriteria:Ut,areaLowerBound:$t,areaUpperBound:Wt,showGroupTotal:Ee==!0||Ee=="true",groupTotalMeasure:Qt,groupTotalLabel:Zt,groupTotalFormat:Pa,groupTotalOffset:ea,groupTotalFixedPosition:qe==!0||qe=="true",centerLabel:Ht,showArcLabels:Pe==!0||Pe=="true",showArcLinkLabels:Be==!0||Be=="true",slicePadding:Yt,centerLabelFontWeight:_t,centerLabelFontSize:Jt,centerLabelXOffset:jt,centerLabelYOffset:Kt,userMeasures:Ra,tooltipEnableMarkdown:G==!0||G=="true",yAxisTickValues:c||u?t.yAxisTickValues??Ne:Ne,xAxisTickValues:c||u?t.xAxisTickValues??ze:ze,lineXAxisTickMode:ha,lineXAxisTickCount:parseInt(fa)||10,lineXAxisTickEvery:parseInt(ga)||1,enableGridY:k==!0||k=="true",enableGridX:T==!0||T=="true",offsetText:ta,selectedMeasures:w,overallLabel:te,minMaxClamp:aa,reverseLegend:Xe==!0||Xe=="true",customAxisFormat:Fa,sort:Se,sortReverse:U==!0||U=="true",sortReverseSecondDimension:$==!0||$=="true",radarCurve:ra,radarFillOpacity:oa,radarBorderWidth:na,radarGridLevels:sa,radarGridShape:ia,radarGridLabelOffset:la,radarEnableDots:Ge==!0||Ge=="true",radarDotSize:da,radarEnableDotLabel:Ue==!0||Ue=="true",radarDotLabelOffset:ca,sortSecondDimension:Ve,mobileCustomization:$e,dimension1:E,previewMode:f,lineCurve:ma,showLegendsInColumns:He==!0||He=="true",numberOfLegendColumns:parseInt(pa)||4},ie={},le=C(wt)||{};le&&le.forEach&&le.forEach(e=>{e.value!=null&&e.value.filter(r=>r!=null&&r.toString().trim()!="").length>0&&(ie[e.param]=e.value)}),pe&&(ie.dvzProxyDatasetId=pe);let M=null,I=null;if(o==="csv")M=nr.default;else switch(B){case"line":M=Q.default.LineDataFrame;break;case"pie":M=Q.default.PieDataFrame;break;case"radar":M=Q.default.BarDataFrame;break;default:M=Q.default.BarDataFrame;break}let A=!1;switch(B){case"bar":I=ar.default,A=o!="csv"&&E=="none"&&w.length==0;break;case"line":I=rr.default,A=o!=="csv"&&(w.length===0||E==="none");break;case"pie":A=o!="csv"&&w.length==0,I=er.default;break;case"radar":A=o!="csv"&&w.length==0,I=tr.default;break;default:I=d.jsx("div",{children:"No Chart"});break}const $a=dt==="true",N=[];E!="none"&&N.push(E),fe!="none"&&N.push(fe);const[et,Wa]=h.useState(0),[vr,Ha]=h.useState(tt());function tt(){var e;return((e=window.screen.orientation)==null?void 0:e.type)||(window.innerWidth>window.innerHeight?"landscape-primary":"portrait-primary")}return h.useEffect(()=>{const e=setTimeout(()=>{ae&&(()=>{const n=W.current.querySelector(".legends.container.has-standard-12-font-size.bottom")||W.current.querySelector(".legends.container.items-section:not(.legends.container.top .items-section)");if(!n||n.closest(".legends.container.top"))return;const{clientHeight:p}=n,z=window.getComputedStyle(n),Ya=parseInt(z.marginTop),at=parseInt(z.marginBottom),_a=parseInt(z.paddingTop),Ja=parseInt(z.paddingBottom),ja=p+Ya+at+_a+Ja,rt=n.closest(".ui.fluid.container.content");if(rt){const v=rt.querySelector(".data-source");if(v){const R=v.getBoundingClientRect(),D=n.getBoundingClientRect();if(D.bottom!==0&&R.top!==0){if(n.textContent.trim()==="")return;const J=at,j=D.bottom+J,ce=window.getComputedStyle(v),K=parseFloat(ce.marginTop)||0,F=R.top-K;if(j>F){let P=j-F;P<5&&(P+=1),v.style.marginTop=`${P+1}px`}}else setTimeout(()=>{R.top<D.bottom&&(v.style.marginTop=`${D.bottom-R.top+1}px`)},1e3)}}const de=n.closest(".chart.container");if(de){const v=de.getBoundingClientRect(),R=window.getComputedStyle(de),D=Number.parseFloat(R.marginBottom)||0,J=v.bottom+D,j=n.getBoundingClientRect(),ce=Number.parseFloat(z.marginTop)||0,K=j.top-ce;if(K<J){const F=J-K,P=200,Ka=Math.min(F+1,P);F>0&&F<P&&(n.style.marginTop=`${Ka}px`)}}Wa(ja)})()},100);return()=>{clearTimeout(e)}},[ae,W]),h.useEffect(()=>{const e=()=>{setTimeout(()=>{Ha(tt())},100)};return window.screen.orientation?window.screen.orientation.addEventListener("change",e):window.addEventListener("resize",e),()=>{window.screen.orientation?window.screen.orientation.removeEventListener("change",e):window.removeEventListener("resize",e)}},[]),d.jsx("div",{ref:W,children:d.jsxs(ue.Container,{className:"chart container",style:{minHeight:B==="pie"&&window.innerWidth<=480?`${parseInt(S)+parseInt(et)*.5}px`:`${parseInt(S)+parseInt(et)}px`},fluid:!0,children:[d.jsx(Qa.default,{editing:i,style:{height:`${H}px`},params:ie,waitForFilters:ua==="true",app:o,group:he,csv:mt,store:[o,Z,...N],source:N.join("/"),children:d.jsxs(ue.Container,{style:{height:`${H}px`},className:"body",fluid:!0,children:[A&&d.jsx(ot.default,{editing:i}),!A&&d.jsxs(Za.default,{children:[d.jsx(ot.default,{app:o,group:he,noDataMsg:Ct,children:" "}),d.jsx(M,{locale:_e,colorBy:q,hiddenBars:Vt,swap:V==="true"||V===!0,type:B,includeTotal:!0,includeOverall:ke===!0||ke==="true",overallLabel:te,measures:w,dimensions:[...N],sort:Se,sortReverse:U===!0||U==="true",sortSecondDimension:Ve,sortReverseSecondDimension:$===!0||$==="true",customLabels:Ke(),children:d.jsx(sr.default,{type:B,app:o,locale:_e,overallLabel:te,customLabels:Ke(),manualColors:Ta(),colorBy:q,scheme:O,barColor:Oe.barColor,children:d.jsx(I,{...Oe})})})]})]})}),d.jsx("br",{}),$a&&L&&Ea==="info"&&d.jsx(ue.Container,{fluid:!0,style:{height:H+"px"},className:"body",children:d.jsx(or.PostContent,{post:{content:{rendered:L}}})})]})})},cr=(y,me)=>{const{"data-app":i,"data-group":Z}=me,L=y.getIn(["data","measures",i,Z]),X=y.getIn(["data","pageModuleProps"]),l={};return L&&Object.keys(L).length>0&&(l.injectedMeasures=L??{}),X&&(l.pageModuleProps=X),l},ur={},mr=ir.connect(cr,ur)(lr.injectIntl(dr));exports.default=mr;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),h=require("react"),pe=require("semantic-ui-react"),Qa=require("../data/DataProvider.js"),Za=require("../data/DataConsumer.js"),Oa=require("../../utils/deviceType.js"),er=require("./Pie.js");require("immutable");const tr=require("./Radar.js"),ar=require("./Bar.js"),rr=require("./Line.js"),or=require("@devgateway/wp-react-lib"),O=require("./data/index.js"),nr=require("./CSVDataFrame.js"),sr=require("./colors/ColorProvider.js"),nt=require("./Messages.js"),ir=require("react-redux"),dr=require("react-intl"),lr=P=>{let{parent:he,editing:i=!1,unique:ee,childContent:k,categories:G,injectedMeasures:d,"data-app":r="csv","data-dvz-proxy-dataset-id":fe,"data-group":ge="default","data-height":V=500,"data-type":q="bar","data-dimension1":N,"data-dimension2":be,"data-dimension3":pr,"data-color-by":z="index","data-scheme":te="system","data-group-mode":st="grouped","data-left-legend":it="Left Legend","data-legend-label":dt="","data-bottom-legend":lt="Bottom Legend","data-dualmode":ct,"data-legend-position":xe="right","data-show-legends":we="true","data-data-source-label":hr="Source","data-chart-data-source":fr="Data Source","data-toggle-info-label":gr="Info Graphic","data-toggle-chart-label":br="Chart","data-tick-rotation":m=0,"data-tick-color":ut="rgb(92,93,99)","data-measures":mt="{}","data-format":xr="{}","data-csv":pt="","data-margin-left":ht=50,"data-margin-top":ft=25,"data-margin-right":gt=25,"data-margin-bottom":bt=25,"data-start-angle":xt=0,"data-end-angle":wt=360,"data-view-mode":ve="info","data-filters":vt="[]","data-tooltip-html":yt="","data-layout":ae="vertical","data-reverse":ye="false","data-offset-y":Lt="-40","data-line-layer-enabled":Le="false","data-overlays":kt="[]","data-max-value":Tt="auto","data-value-scale":Ct="linear","data-swap":U="false","data-no-data-message":Mt="No data matches your selection","data-bar-color":It="rgb(0,0,0)","data-override-tick-color":ke="false","data-fixed-min-value":Rt=0,"data-fixed-max-value":At=0,"data-bar-padding":Dt=.15,"data-bar-label-position":Ft="middle","data-line-label-position":Bt="none","data-show-grid":Te="true","data-include-overall":Ce="false","data-bar-inner-padding":Et=.7,"data-x-label-color":Pt="#000","data-bar-label-color":qt="#000","data-legend-label-color":Nt="#000","data-tooltip-enabled":Me="true","data-use-check-box-background":Ie="false","data-use-label-background":Re="true","data-highlight-xaxis-line":Ae="false","data-show-tick-line":De="true","data-show-right-axis":Fe="true","data-manual-colors":zt="{}","data-right-legend":Xt="","data-offset-right":St="40","data-offset-bottom":Gt="40","data-hidden-bars":Vt=[],"data-confidence-intervals":Ut="[]","data-enable-area":Be="false","data-area-shading-criteria":$t="DEFAULT","data-area-lower-bound":Ht="","data-area-upper-bound":Wt="","data-show-points":Ee="true","data-center-label":Yt="","data-show-arc-labels":Pe="true","data-show-arc-link-labels":qe="true","data-slice-padding":_t=1,"data-center-label-font-weight":Jt="normal","data-center-label-font-size":jt="12","data-center-label-xoffset":Kt=0,"data-center-label-yoffset":Qt=0,"data-group-total-measure":Zt="","data-show-group-total":Ne="true","data-group-total-label":Ot="","data-group-total-format":ea="{}","data-group-total-label-offset":ta,"data-group-total-fixed-position":ze="false","data-tooltip-enable-markdown":$="false","data-y-axis-tick-values":Xe="10","data-x-axis-tick-values":Se="10","data-enable-grid-y":T="true","data-enable-grid-x":C="false","data-offset-text":aa=0,"data-overall-label":re="Overall","data-min-max-clamp":ra="false","data-reverse-legend":Ge="false","data-sort":Ve="default","data-sort-reverse":H="false","data-sort-second-dimension":Ue="default","data-sort-reverse-second-dimension":W="false","data-radar-curve":oa="linearClosed","data-radar-fill-opacity":na=.25,"data-radar-border-width":sa=2,"data-radar-grid-levels":ia=3,"data-radar-grid-shape":da="circular","data-radar-grid-label-offset":la=36,"data-radar-enable-dots":$e="true","data-radar-dot-size":ca=8,"data-radar-enable-dot-label":He="true","data-radar-dot-label-offset":ua=-12,"data-mobile-customization":We="{}","data-show-percentage":Ye="false","data-preview-mode":f="Desktop","data-wait-for-filters":ma="false","data-line-curve":pa="linear","data-show-legends-in-columns":_e="false","data-number-of-legend-columns":ha=4,"data-line-x-axis-tick-mode":fa="none","data-line-x-axis-tick-count":ga=10,"data-line-x-axis-tick-every":ba=1,pageModuleProps:g}=P;const xa=i,t=JSON.parse(decodeURIComponent(We)),[oe,wa]=h.useState(window.innerWidth<=1250),w=oe&&((t==null?void 0:t.showCustomization)??!1);g!=null&&g.previewMode&&(g!=null&&g.editing)&&(f=g.previewMode,i=g.editing);const va=["Tablet"].includes(f)&&i,ya=["Mobile"].includes(f)&&i,La=["Desktop"].includes(f)&&i,c=w&&f!=="Desktop",u=w&&!i,ne=()=>{const e=window.matchMedia("(min-width: 768px) and (max-width: 1250px)").matches,n=window.matchMedia("(max-width: 767px)").matches;switch(!0){case La:return m;case va:return w?(t==null?void 0:t.tabletXAxisTextRotation)??m:m;case ya:return w?(t==null?void 0:t.mobileXAxisTextRotation)??m:m;case e:return w?(t==null?void 0:t.tabletXAxisTextRotation)??m:m;case n:return w?(t==null?void 0:t.mobileXAxisTextRotation)??m:m;default:return m}},ka=ne(),[Ta,Je]=h.useState(ka),je=P.intl.locale,Y=h.useRef(null),Ke=e=>{try{return xa?e:decodeURIComponent(e)}catch{return console.error(`error decoding value:${e}`),e}},M=e=>{try{return JSON.parse(Ke(e))}catch{console.error(`error parsing value:${e}`)}return null},Ca=()=>{const e=M(zt);if(!e)return null;const n=e[r];if(r==="csv"&&n&&te==="manual"){const o={},p={};Object.keys(n).forEach(S=>{const x=n[S];typeof x=="string"?o[S]=x:typeof x=="object"&&x!==null&&(p[S]=x)});const y=p[z]||{};return{[z]:{...o,...y}}}return n},Ma=()=>M(mt),Qe=()=>{var e;if(a!=null&&a[r]){let n=(e=a==null?void 0:a[r])==null?void 0:e.format;if(!n){const o=Object.keys(a==null?void 0:a[r]);for(let p=0;p<o.length;p++)if(a!=null&&a[r][o[p]].selected&&(a!=null&&a[r][o[p]].format)){n=a==null?void 0:a[r][o[p]].format;break}}return n}return a!=null&&a.csv?a.csv.format:null},Ia=()=>{let e=null;return a!=null&&a[r]?a[r].useCustomAxisFormat&&a[r].customFormat&&(e=a[r].customFormat):a!=null&&a.csv&&a.csv.useCustomAxisFormat&&a.csv.customFormat&&(e=a.csv.customFormat),e},Ra=()=>a!=null&&a[r]?Object.keys(a[r]).map(e=>({value:e,...a[r][e]})).filter(e=>e.selected).map(e=>e.value):[],Ze=()=>{const e={};return a!=null&&a[r]&&Object.keys(a[r]).map(o=>({value:o,...a[r][o]})).filter(o=>o.selected&&o.hasCustomLabel).forEach(o=>{e[o.value]=o.customLabel}),e},Aa=()=>a!=null&&a[r]?Object.keys(a[r]).filter(e=>a[r][e].allowSelection):[];let a=Ma(),v=Ra(),b=Qe();const Da=Aa();let se=it,ie=Xt,de=Ke(yt);if(d!=null&&d[r]){const e=Object.keys(d[r].measures).map(n=>({value:n,...d[r].measures[n]})).filter(n=>n.selected).map(n=>n.value);a=d,v=e,b=Qe(),se=d.leftTitle,ie=d.rightTitle,d.customTooltip&&(de=d.customTooltip)}const Fa=b?{style:b.style==="compacted"?"decimal":b.style,notation:b.style==="compacted"?"compact":"standard",currency:b.currency,minimumFractionDigits:parseInt(b.minimumFractionDigits),maximumFractionDigits:parseInt(b.maximumFractionDigits)}:{notation:"standard",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2},Ba=Ia(),s=M(ea),Ea={style:(s==null?void 0:s.style)==="compacted"?"decimal":s==null?void 0:s.style,notation:(s==null?void 0:s.style)==="compacted"?"compact":"standard",currency:s==null?void 0:s.currency,minimumFractionDigits:parseInt(s==null?void 0:s.minimumFractionDigits),maximumFractionDigits:parseInt(s==null?void 0:s.maximumFractionDigits)},[Pa,wr]=h.useState(ve),qa=i?ve:Pa,Na={scheme:te,colorBy:z},_=i?V-80:V,za=()=>(c||u)&&!(t!=null&&t.showXAxisTitle)?"":lt,Xa=()=>c||u?t!=null&&t.showYAxisTitle?se:"":se,Sa=()=>c||u?t!=null&&t.showRightAxisTitle?ie:"":ie,Ga={left:Xa(),bottom:za(),right:Sa()},J=e=>{if(e==="true"||e===!0)return!0;if(e==="false"||e===!1)return!1},Oe=()=>{J(C)&&!J(T)?(C=!1,T=!0):!J(C)&&J(T)&&(C=!0,T=!1)},Va=()=>ae==="horizontal"?(Oe(),"vertical"):(Oe(),"horizontal"),Ua=()=>t!=null&&t.chartLayoutOverride?Va():ae,j=(e,n,o)=>e?Number.parseInt(n)??o:o,et=(e,n,o)=>e?n??o:o;h.useEffect(()=>{const e=()=>{wa(window.innerWidth<=1250);const n=ne();Je(n)};return window.addEventListener("resize",e),Je(ne()),()=>{window.removeEventListener("resize",e)}},[i,f,w,m,t==null?void 0:t.tabletXAxisTextRotation,t==null?void 0:t.mobileXAxisTextRotation]);const $a=()=>{const e=["tablet","mobile","midTablet"].includes(Oa.default());return i&&f==="Desktop"?xe:e?"bottom":xe},tt={app:r,editing:i,tickColor:decodeURIComponent(ut),tickRotation:Ta,layout:c||u?Ua():ae,reverse:ye==!0||ye=="true",showLegends:we==!0||we=="true",legendLabel:dt,swap:U==!0||U=="true",showGrid:Te==!0||Te=="true",showPercentage:Ye==!0||Ye=="true",marginLeft:j(c||u,Number.parseInt(t==null?void 0:t.marginLeft),parseInt(ht)),marginTop:j(c||u,Number.parseInt(t==null?void 0:t.marginTop),parseInt(ft)),marginRight:j(c||u,Number.parseInt(t==null?void 0:t.marginRight),Number.parseInt(gt)),marginBottom:j(c||u,Number.parseInt(t==null?void 0:t.marginBottom),Number.parseInt(bt)),height:`${_}px`,legendPosition:$a(),legends:Ga,tooltip:$==!0||$=="true"?de:de.replace(/\r\n/g,"<hr/>").replace(/[\r\n]/g,"<hr/>"),colors:Na,groupMode:st,format:Fa,startAngle:xt,endAngle:wt,offsetY:Lt,maxValue:Tt,valueScale:Ct,categories:G,lineLayerEnabled:Le==!0||Le=="true",overlays:M(kt)||[],barColor:decodeURIComponent(It),overrideTickColor:ke==!0||ke=="true",fixedMinValue:Rt,fixedMaxValue:At,barPadding:et(c||u,t==null?void 0:t.barPadding,Dt),barLabelPosition:Ft,lineLabelPosition:Bt,barInnerPadding:et(c||u,t==null?void 0:t.barInnerPadding,Et),xLabelColor:decodeURIComponent(Pt),barLabelColor:decodeURIComponent(qt),legendLabelColor:decodeURIComponent(Nt),tooltipEnabled:Me==!0||Me=="true",legendLabelBack:Re==!0||Re=="true",legendCheckBack:Ie==!0||Ie=="true",highlightXAxisLine:Ae==!0||Ae=="true",showTickLine:De==!0||De=="true",showRightAxis:Fe==!0||Fe=="true",offsetRight:St,offsetBottom:Gt,confidenceIntervals:M(Ut)||[],showPoints:Ee==!0||Ee=="true",enableArea:Be==!0||Be=="true",areaShadingCriteria:$t,areaLowerBound:Ht,areaUpperBound:Wt,showGroupTotal:Ne==!0||Ne=="true",groupTotalMeasure:Zt,groupTotalLabel:Ot,groupTotalFormat:Ea,groupTotalOffset:ta,groupTotalFixedPosition:ze==!0||ze=="true",centerLabel:Yt,showArcLabels:Pe==!0||Pe=="true",showArcLinkLabels:qe==!0||qe=="true",slicePadding:_t,centerLabelFontWeight:Jt,centerLabelFontSize:jt,centerLabelXOffset:Kt,centerLabelYOffset:Qt,userMeasures:Da,tooltipEnableMarkdown:$==!0||$=="true",yAxisTickValues:c||u?t.yAxisTickValues??Xe:Xe,xAxisTickValues:c||u?t.xAxisTickValues??Se:Se,lineXAxisTickMode:fa,lineXAxisTickCount:parseInt(ga)||10,lineXAxisTickEvery:parseInt(ba)||1,enableGridY:T==!0||T=="true",enableGridX:C==!0||C=="true",offsetText:aa,selectedMeasures:v,overallLabel:re,minMaxClamp:ra,reverseLegend:Ge==!0||Ge=="true",customAxisFormat:Ba,sort:Ve,sortReverse:H==!0||H=="true",sortReverseSecondDimension:W==!0||W=="true",radarCurve:oa,radarFillOpacity:na,radarBorderWidth:sa,radarGridLevels:ia,radarGridShape:da,radarGridLabelOffset:la,radarEnableDots:$e==!0||$e=="true",radarDotSize:ca,radarEnableDotLabel:He==!0||He=="true",radarDotLabelOffset:ua,sortSecondDimension:Ue,mobileCustomization:We,dimension1:N,previewMode:f,lineCurve:pa,showLegendsInColumns:_e==!0||_e=="true",numberOfLegendColumns:parseInt(ha)||4},le={},ce=M(vt)||{};ce&&ce.forEach&&ce.forEach(e=>{e.value!=null&&e.value.filter(n=>n!=null&&n.toString().trim()!="").length>0&&(le[e.param]=e.value)}),fe&&(le.dvzProxyDatasetId=fe);let I=null,R=null;if(r==="csv")I=nr.default;else switch(q){case"line":I=O.default.LineDataFrame;break;case"pie":I=O.default.PieDataFrame;break;case"radar":I=O.default.BarDataFrame;break;default:I=O.default.BarDataFrame;break}let A=!1;switch(q){case"bar":R=ar.default,A=r!="csv"&&N=="none"&&v.length==0;break;case"line":R=rr.default,A=r!=="csv"&&(v.length===0||N==="none");break;case"pie":A=r!="csv"&&v.length==0,R=er.default;break;case"radar":A=r!="csv"&&v.length==0,R=tr.default;break;default:R=l.jsx("div",{children:"No Chart"});break}const Ha=ct==="true",X=[];N!="none"&&X.push(N),be!="none"&&X.push(be);const[at,Wa]=h.useState(0),[vr,Ya]=h.useState(rt());function rt(){var e;return((e=window.screen.orientation)==null?void 0:e.type)||(window.innerWidth>window.innerHeight?"landscape-primary":"portrait-primary")}return h.useEffect(()=>{const e=setTimeout(()=>{oe&&(()=>{const o=Y.current.querySelector(".legends.container.has-standard-12-font-size.bottom")||Y.current.querySelector(".legends.container.items-section:not(.legends.container.top .items-section)");if(!o||o.closest(".legends.container.top"))return;const{clientHeight:p}=o,y=window.getComputedStyle(o),S=parseInt(y.marginTop),x=parseInt(y.marginBottom),_a=parseInt(y.paddingTop),Ja=parseInt(y.paddingBottom),ja=p+S+x+_a+Ja,ot=o.closest(".ui.fluid.container.content");if(ot){const L=ot.querySelector(".data-source");if(L){const D=L.getBoundingClientRect(),F=o.getBoundingClientRect();if(F.bottom!==0&&D.top!==0){if(o.textContent.trim()==="")return;const K=x,Q=F.bottom+K,me=window.getComputedStyle(L),Z=parseFloat(me.marginTop)||0,B=D.top-Z;if(Q>B){let E=Q-B;E<5&&(E+=1),L.style.marginTop=`${E+1}px`}}else setTimeout(()=>{D.top<F.bottom&&(L.style.marginTop=`${F.bottom-D.top+1}px`)},1e3)}}const ue=o.closest(".chart.container");if(ue){const L=ue.getBoundingClientRect(),D=window.getComputedStyle(ue),F=Number.parseFloat(D.marginBottom)||0,K=L.bottom+F,Q=o.getBoundingClientRect(),me=Number.parseFloat(y.marginTop)||0,Z=Q.top-me;if(Z<K){const B=K-Z,E=200,Ka=Math.min(B+1,E);B>0&&B<E&&(o.style.marginTop=`${Ka}px`)}}Wa(ja)})()},100);return()=>{clearTimeout(e)}},[oe,Y]),h.useEffect(()=>{const e=()=>{setTimeout(()=>{Ya(rt())},100)};return window.screen.orientation?window.screen.orientation.addEventListener("change",e):window.addEventListener("resize",e),()=>{window.screen.orientation?window.screen.orientation.removeEventListener("change",e):window.removeEventListener("resize",e)}},[]),l.jsx("div",{ref:Y,children:l.jsxs(pe.Container,{className:"chart container",style:{minHeight:q==="pie"&&window.innerWidth<=480?`${parseInt(V)+parseInt(at)*.5}px`:`${parseInt(V)+parseInt(at)}px`},fluid:!0,children:[l.jsx(Qa.default,{editing:i,style:{height:`${_}px`},params:le,waitForFilters:ma==="true",app:r,group:ge,csv:pt,store:[r,ee,...X],source:X.join("/"),children:l.jsxs(pe.Container,{style:{height:`${_}px`},className:"body",fluid:!0,children:[A&&l.jsx(nt.default,{editing:i}),!A&&l.jsxs(Za.default,{children:[l.jsx(nt.default,{app:r,group:ge,noDataMsg:Mt,children:" "}),l.jsx(I,{locale:je,colorBy:z,hiddenBars:Vt,swap:U==="true"||U===!0,type:q,includeTotal:!0,includeOverall:Ce===!0||Ce==="true",overallLabel:re,measures:v,dimensions:[...X],sort:Ve,sortReverse:H===!0||H==="true",sortSecondDimension:Ue,sortReverseSecondDimension:W===!0||W==="true",customLabels:Ze(),children:l.jsx(sr.default,{type:q,app:r,locale:je,overallLabel:re,customLabels:Ze(),manualColors:Ca(),colorBy:z,scheme:te,barColor:tt.barColor,children:l.jsx(R,{...tt})})})]})]})}),l.jsx("br",{}),Ha&&k&&qa==="info"&&l.jsx(pe.Container,{fluid:!0,style:{height:_+"px"},className:"body",children:l.jsx(or.PostContent,{post:{content:{rendered:k}}})})]})})},cr=(P,he)=>{const{"data-app":i,"data-group":ee}=he,k=P.getIn(["data","measures",i,ee]),G=P.getIn(["data","pageModuleProps"]),d={};return k&&Object.keys(k).length>0&&(d.injectedMeasures=k??{}),G&&(d.pageModuleProps=G),d},ur={},mr=ir.connect(cr,ur)(dr.injectIntl(lr));exports.default=mr;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Container as
|
|
1
|
+
import { jsx as m, jsxs as pe } from "react/jsx-runtime";
|
|
2
|
+
import { useState as V, useRef as ja, useEffect as he } from "react";
|
|
3
|
+
import { Container as fe } from "semantic-ui-react";
|
|
4
4
|
import er from "../data/DataProvider.js";
|
|
5
5
|
import tr from "../data/DataConsumer.js";
|
|
6
6
|
import ar from "../../utils/deviceType.js";
|
|
@@ -10,246 +10,246 @@ import or from "./Radar.js";
|
|
|
10
10
|
import nr from "./Bar.js";
|
|
11
11
|
import ir from "./Line.js";
|
|
12
12
|
import { PostContent as sr } from "@devgateway/wp-react-lib";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
13
|
+
import j from "./data/index.js";
|
|
14
|
+
import dr from "./CSVDataFrame.js";
|
|
15
|
+
import lr from "./colors/ColorProvider.js";
|
|
16
|
+
import st from "./Messages.js";
|
|
17
17
|
import { connect as cr } from "react-redux";
|
|
18
18
|
import { injectIntl as ur } from "react-intl";
|
|
19
|
-
const mr = (
|
|
20
|
-
console.log("manual colors...", v["data-manual-colors"]);
|
|
19
|
+
const mr = (P) => {
|
|
21
20
|
let {
|
|
22
|
-
parent:
|
|
21
|
+
parent: ge,
|
|
23
22
|
editing: s = !1,
|
|
24
|
-
unique:
|
|
25
|
-
childContent:
|
|
26
|
-
categories:
|
|
27
|
-
injectedMeasures:
|
|
28
|
-
"data-app":
|
|
29
|
-
"data-dvz-proxy-dataset-id":
|
|
30
|
-
"data-group":
|
|
31
|
-
"data-height":
|
|
32
|
-
"data-type":
|
|
23
|
+
unique: ee,
|
|
24
|
+
childContent: L,
|
|
25
|
+
categories: U,
|
|
26
|
+
injectedMeasures: d,
|
|
27
|
+
"data-app": r = "csv",
|
|
28
|
+
"data-dvz-proxy-dataset-id": be,
|
|
29
|
+
"data-group": we = "default",
|
|
30
|
+
"data-height": S = 500,
|
|
31
|
+
"data-type": E = "bar",
|
|
33
32
|
//'data-source': source = 'gender/smoke',f
|
|
34
|
-
"data-dimension1":
|
|
35
|
-
"data-dimension2":
|
|
36
|
-
"data-dimension3":
|
|
37
|
-
"data-color-by":
|
|
38
|
-
"data-scheme":
|
|
39
|
-
"data-group-mode":
|
|
33
|
+
"data-dimension1": N,
|
|
34
|
+
"data-dimension2": xe,
|
|
35
|
+
"data-dimension3": fr,
|
|
36
|
+
"data-color-by": z = "index",
|
|
37
|
+
"data-scheme": te = "system",
|
|
38
|
+
"data-group-mode": dt = "grouped",
|
|
40
39
|
"data-left-legend": lt = "Left Legend",
|
|
41
|
-
"data-legend-label":
|
|
42
|
-
"data-bottom-legend":
|
|
43
|
-
"data-dualmode":
|
|
44
|
-
"data-legend-position":
|
|
45
|
-
"data-show-legends":
|
|
46
|
-
"data-data-source-label":
|
|
40
|
+
"data-legend-label": ct = "",
|
|
41
|
+
"data-bottom-legend": ut = "Bottom Legend",
|
|
42
|
+
"data-dualmode": mt,
|
|
43
|
+
"data-legend-position": ve = "right",
|
|
44
|
+
"data-show-legends": ye = "true",
|
|
45
|
+
"data-data-source-label": gr = "Source",
|
|
47
46
|
"data-chart-data-source": br = "Data Source",
|
|
48
47
|
"data-toggle-info-label": wr = "Info Graphic",
|
|
49
48
|
"data-toggle-chart-label": xr = "Chart",
|
|
50
49
|
//'data-number-format': format = '{"style":"percent", "minimumFractionDigits": 1, "maximumFractionDigits": 1}',
|
|
51
50
|
"data-tick-rotation": u = 0,
|
|
52
|
-
"data-tick-color":
|
|
53
|
-
"data-measures":
|
|
51
|
+
"data-tick-color": pt = "rgb(92,93,99)",
|
|
52
|
+
"data-measures": ht = "{}",
|
|
54
53
|
"data-format": vr = "{}",
|
|
55
|
-
"data-csv":
|
|
54
|
+
"data-csv": ft = "",
|
|
56
55
|
"data-margin-left": gt = 50,
|
|
57
|
-
"data-margin-top":
|
|
58
|
-
"data-margin-right":
|
|
59
|
-
"data-margin-bottom":
|
|
60
|
-
"data-start-angle":
|
|
61
|
-
"data-end-angle":
|
|
62
|
-
"data-view-mode":
|
|
63
|
-
"data-filters":
|
|
56
|
+
"data-margin-top": bt = 25,
|
|
57
|
+
"data-margin-right": wt = 25,
|
|
58
|
+
"data-margin-bottom": xt = 25,
|
|
59
|
+
"data-start-angle": vt = 0,
|
|
60
|
+
"data-end-angle": yt = 360,
|
|
61
|
+
"data-view-mode": Le = "info",
|
|
62
|
+
"data-filters": Lt = "[]",
|
|
64
63
|
//filters
|
|
65
|
-
"data-tooltip-html":
|
|
66
|
-
"data-layout":
|
|
67
|
-
"data-reverse":
|
|
68
|
-
"data-offset-y":
|
|
69
|
-
"data-line-layer-enabled":
|
|
64
|
+
"data-tooltip-html": kt = "",
|
|
65
|
+
"data-layout": ae = "vertical",
|
|
66
|
+
"data-reverse": ke = "false",
|
|
67
|
+
"data-offset-y": Tt = "-40",
|
|
68
|
+
"data-line-layer-enabled": Te = "false",
|
|
70
69
|
//"data-csv-line-layer-data": csvLineLayerData = "",
|
|
71
70
|
//"data-csv-line-color": lineColor = "#000000",
|
|
72
71
|
//"data-csv-line-tooltip": lineTooltip = "",
|
|
73
72
|
//"data-csv-line-title": lineTitle = "",
|
|
74
|
-
"data-overlays":
|
|
75
|
-
"data-max-value":
|
|
76
|
-
"data-value-scale":
|
|
77
|
-
"data-swap":
|
|
78
|
-
"data-no-data-message":
|
|
79
|
-
"data-bar-color":
|
|
80
|
-
"data-override-tick-color":
|
|
81
|
-
"data-fixed-min-value":
|
|
82
|
-
"data-fixed-max-value":
|
|
83
|
-
"data-bar-padding":
|
|
84
|
-
"data-bar-label-position":
|
|
85
|
-
"data-line-label-position":
|
|
86
|
-
"data-show-grid":
|
|
87
|
-
"data-include-overall":
|
|
88
|
-
"data-bar-inner-padding":
|
|
89
|
-
"data-x-label-color":
|
|
90
|
-
"data-bar-label-color":
|
|
91
|
-
"data-legend-label-color":
|
|
73
|
+
"data-overlays": Ct = "[]",
|
|
74
|
+
"data-max-value": It = "auto",
|
|
75
|
+
"data-value-scale": Mt = "linear",
|
|
76
|
+
"data-swap": $ = "false",
|
|
77
|
+
"data-no-data-message": At = "No data matches your selection",
|
|
78
|
+
"data-bar-color": Dt = "rgb(0,0,0)",
|
|
79
|
+
"data-override-tick-color": Ce = "false",
|
|
80
|
+
"data-fixed-min-value": Rt = 0,
|
|
81
|
+
"data-fixed-max-value": Ft = 0,
|
|
82
|
+
"data-bar-padding": Bt = 0.15,
|
|
83
|
+
"data-bar-label-position": Pt = "middle",
|
|
84
|
+
"data-line-label-position": Et = "none",
|
|
85
|
+
"data-show-grid": Ie = "true",
|
|
86
|
+
"data-include-overall": Me = "false",
|
|
87
|
+
"data-bar-inner-padding": Nt = 0.7,
|
|
88
|
+
"data-x-label-color": zt = "#000",
|
|
89
|
+
"data-bar-label-color": Xt = "#000",
|
|
90
|
+
"data-legend-label-color": Gt = "#000",
|
|
92
91
|
"data-tooltip-enabled": Ae = "true",
|
|
93
|
-
"data-use-check-box-background":
|
|
94
|
-
"data-use-label-background":
|
|
95
|
-
"data-highlight-xaxis-line":
|
|
96
|
-
"data-show-tick-line":
|
|
97
|
-
"data-show-right-axis":
|
|
92
|
+
"data-use-check-box-background": De = "false",
|
|
93
|
+
"data-use-label-background": Re = "true",
|
|
94
|
+
"data-highlight-xaxis-line": Fe = "false",
|
|
95
|
+
"data-show-tick-line": Be = "true",
|
|
96
|
+
"data-show-right-axis": Pe = "true",
|
|
98
97
|
"data-manual-colors": Vt = "{}",
|
|
99
|
-
"data-right-legend":
|
|
100
|
-
"data-offset-right":
|
|
98
|
+
"data-right-legend": Ut = "",
|
|
99
|
+
"data-offset-right": St = "40",
|
|
101
100
|
"data-offset-bottom": $t = "40",
|
|
102
|
-
"data-hidden-bars":
|
|
103
|
-
"data-confidence-intervals":
|
|
104
|
-
"data-enable-area":
|
|
105
|
-
"data-area-shading-criteria":
|
|
106
|
-
"data-area-lower-bound":
|
|
107
|
-
"data-area-upper-bound":
|
|
108
|
-
"data-show-points":
|
|
109
|
-
"data-center-label":
|
|
110
|
-
"data-show-arc-labels":
|
|
111
|
-
"data-show-arc-link-labels":
|
|
112
|
-
"data-slice-padding":
|
|
113
|
-
"data-center-label-font-weight":
|
|
114
|
-
"data-center-label-font-size":
|
|
115
|
-
"data-center-label-xoffset":
|
|
116
|
-
"data-center-label-yoffset":
|
|
117
|
-
"data-group-total-measure":
|
|
118
|
-
"data-show-group-total":
|
|
119
|
-
"data-group-total-label":
|
|
120
|
-
"data-group-total-format":
|
|
121
|
-
"data-group-total-label-offset":
|
|
122
|
-
"data-group-total-fixed-position":
|
|
123
|
-
"data-tooltip-enable-markdown":
|
|
124
|
-
"data-y-axis-tick-values":
|
|
125
|
-
"data-x-axis-tick-values":
|
|
126
|
-
"data-enable-grid-y":
|
|
127
|
-
"data-enable-grid-x":
|
|
128
|
-
"data-offset-text":
|
|
129
|
-
"data-overall-label":
|
|
130
|
-
"data-min-max-clamp":
|
|
131
|
-
"data-reverse-legend":
|
|
132
|
-
"data-sort":
|
|
133
|
-
"data-sort-reverse":
|
|
134
|
-
"data-sort-second-dimension":
|
|
135
|
-
"data-sort-reverse-second-dimension":
|
|
136
|
-
"data-radar-curve":
|
|
137
|
-
"data-radar-fill-opacity":
|
|
138
|
-
"data-radar-border-width":
|
|
101
|
+
"data-hidden-bars": Ht = [],
|
|
102
|
+
"data-confidence-intervals": Wt = "[]",
|
|
103
|
+
"data-enable-area": Ee = "false",
|
|
104
|
+
"data-area-shading-criteria": Yt = "DEFAULT",
|
|
105
|
+
"data-area-lower-bound": qt = "",
|
|
106
|
+
"data-area-upper-bound": Jt = "",
|
|
107
|
+
"data-show-points": Ne = "true",
|
|
108
|
+
"data-center-label": _t = "",
|
|
109
|
+
"data-show-arc-labels": ze = "true",
|
|
110
|
+
"data-show-arc-link-labels": Xe = "true",
|
|
111
|
+
"data-slice-padding": Kt = 1,
|
|
112
|
+
"data-center-label-font-weight": Qt = "normal",
|
|
113
|
+
"data-center-label-font-size": Zt = "12",
|
|
114
|
+
"data-center-label-xoffset": Ot = 0,
|
|
115
|
+
"data-center-label-yoffset": jt = 0,
|
|
116
|
+
"data-group-total-measure": ea = "",
|
|
117
|
+
"data-show-group-total": Ge = "true",
|
|
118
|
+
"data-group-total-label": ta = "",
|
|
119
|
+
"data-group-total-format": aa = "{}",
|
|
120
|
+
"data-group-total-label-offset": ra,
|
|
121
|
+
"data-group-total-fixed-position": Ve = "false",
|
|
122
|
+
"data-tooltip-enable-markdown": H = "false",
|
|
123
|
+
"data-y-axis-tick-values": Ue = "10",
|
|
124
|
+
"data-x-axis-tick-values": Se = "10",
|
|
125
|
+
"data-enable-grid-y": k = "true",
|
|
126
|
+
"data-enable-grid-x": T = "false",
|
|
127
|
+
"data-offset-text": oa = 0,
|
|
128
|
+
"data-overall-label": re = "Overall",
|
|
129
|
+
"data-min-max-clamp": na = "false",
|
|
130
|
+
"data-reverse-legend": $e = "false",
|
|
131
|
+
"data-sort": He = "default",
|
|
132
|
+
"data-sort-reverse": W = "false",
|
|
133
|
+
"data-sort-second-dimension": We = "default",
|
|
134
|
+
"data-sort-reverse-second-dimension": Y = "false",
|
|
135
|
+
"data-radar-curve": ia = "linearClosed",
|
|
136
|
+
"data-radar-fill-opacity": sa = 0.25,
|
|
137
|
+
"data-radar-border-width": da = 2,
|
|
139
138
|
"data-radar-grid-levels": la = 3,
|
|
140
|
-
"data-radar-grid-shape":
|
|
141
|
-
"data-radar-grid-label-offset":
|
|
142
|
-
"data-radar-enable-dots":
|
|
143
|
-
"data-radar-dot-size":
|
|
144
|
-
"data-radar-enable-dot-label":
|
|
145
|
-
"data-radar-dot-label-offset":
|
|
146
|
-
"data-mobile-customization":
|
|
147
|
-
"data-show-percentage":
|
|
139
|
+
"data-radar-grid-shape": ca = "circular",
|
|
140
|
+
"data-radar-grid-label-offset": ua = 36,
|
|
141
|
+
"data-radar-enable-dots": Ye = "true",
|
|
142
|
+
"data-radar-dot-size": ma = 8,
|
|
143
|
+
"data-radar-enable-dot-label": qe = "true",
|
|
144
|
+
"data-radar-dot-label-offset": pa = -12,
|
|
145
|
+
"data-mobile-customization": Je = "{}",
|
|
146
|
+
"data-show-percentage": _e = "false",
|
|
148
147
|
"data-preview-mode": h = "Desktop",
|
|
149
|
-
"data-wait-for-filters":
|
|
150
|
-
"data-line-curve":
|
|
151
|
-
"data-show-legends-in-columns":
|
|
148
|
+
"data-wait-for-filters": ha = "false",
|
|
149
|
+
"data-line-curve": fa = "linear",
|
|
150
|
+
"data-show-legends-in-columns": Ke = "false",
|
|
152
151
|
"data-number-of-legend-columns": ga = 4,
|
|
153
|
-
"data-line-x-axis-tick-mode":
|
|
154
|
-
"data-line-x-axis-tick-count":
|
|
155
|
-
"data-line-x-axis-tick-every":
|
|
156
|
-
pageModuleProps:
|
|
157
|
-
} =
|
|
158
|
-
const
|
|
159
|
-
decodeURIComponent(
|
|
160
|
-
), [
|
|
152
|
+
"data-line-x-axis-tick-mode": ba = "none",
|
|
153
|
+
"data-line-x-axis-tick-count": wa = 10,
|
|
154
|
+
"data-line-x-axis-tick-every": xa = 1,
|
|
155
|
+
pageModuleProps: f
|
|
156
|
+
} = P;
|
|
157
|
+
const va = s, t = JSON.parse(
|
|
158
|
+
decodeURIComponent(Je)
|
|
159
|
+
), [oe, ya] = V(
|
|
161
160
|
window.innerWidth <= 1250
|
|
162
|
-
),
|
|
163
|
-
|
|
164
|
-
const
|
|
161
|
+
), w = oe && ((t == null ? void 0 : t.showCustomization) ?? !1);
|
|
162
|
+
f != null && f.previewMode && (f != null && f.editing) && (h = f.previewMode, s = f.editing);
|
|
163
|
+
const La = ["Tablet"].includes(h) && s, ka = ["Mobile"].includes(h) && s, Ta = ["Desktop"].includes(h) && s, l = w && h !== "Desktop", c = w && !s, ne = () => {
|
|
165
164
|
const e = window.matchMedia(
|
|
166
165
|
"(min-width: 768px) and (max-width: 1250px)"
|
|
167
|
-
).matches,
|
|
166
|
+
).matches, n = window.matchMedia("(max-width: 767px)").matches;
|
|
168
167
|
switch (!0) {
|
|
169
|
-
case
|
|
168
|
+
case Ta:
|
|
170
169
|
return u;
|
|
171
|
-
case ya:
|
|
172
|
-
return b ? (t == null ? void 0 : t.tabletXAxisTextRotation) ?? u : u;
|
|
173
170
|
case La:
|
|
174
|
-
return
|
|
171
|
+
return w ? (t == null ? void 0 : t.tabletXAxisTextRotation) ?? u : u;
|
|
172
|
+
case ka:
|
|
173
|
+
return w ? (t == null ? void 0 : t.mobileXAxisTextRotation) ?? u : u;
|
|
175
174
|
case e:
|
|
176
|
-
return
|
|
177
|
-
case
|
|
178
|
-
return
|
|
175
|
+
return w ? (t == null ? void 0 : t.tabletXAxisTextRotation) ?? u : u;
|
|
176
|
+
case n:
|
|
177
|
+
return w ? (t == null ? void 0 : t.mobileXAxisTextRotation) ?? u : u;
|
|
179
178
|
default:
|
|
180
179
|
return u;
|
|
181
180
|
}
|
|
182
|
-
},
|
|
181
|
+
}, Ca = ne(), [Ia, Qe] = V(Ca), Ze = P.intl.locale, q = ja(null), Oe = (e) => {
|
|
183
182
|
try {
|
|
184
|
-
return
|
|
183
|
+
return va ? e : decodeURIComponent(e);
|
|
185
184
|
} catch {
|
|
186
185
|
return console.error(`error decoding value:${e}`), e;
|
|
187
186
|
}
|
|
188
|
-
},
|
|
187
|
+
}, C = (e) => {
|
|
189
188
|
try {
|
|
190
|
-
return JSON.parse(
|
|
189
|
+
return JSON.parse(Oe(e));
|
|
191
190
|
} catch {
|
|
192
191
|
console.error(`error parsing value:${e}`);
|
|
193
192
|
}
|
|
194
193
|
return null;
|
|
195
|
-
},
|
|
196
|
-
const e =
|
|
194
|
+
}, Ma = () => {
|
|
195
|
+
const e = C(Vt);
|
|
197
196
|
if (!e) return null;
|
|
198
|
-
const
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
)
|
|
205
|
-
|
|
197
|
+
const n = e[r];
|
|
198
|
+
if (r === "csv" && n && te === "manual") {
|
|
199
|
+
const o = {}, p = {};
|
|
200
|
+
Object.keys(n).forEach((G) => {
|
|
201
|
+
const b = n[G];
|
|
202
|
+
typeof b == "string" ? o[G] = b : typeof b == "object" && b !== null && (p[G] = b);
|
|
203
|
+
});
|
|
204
|
+
const v = p[z] || {};
|
|
205
|
+
return { [z]: { ...o, ...v } };
|
|
206
206
|
}
|
|
207
|
-
return
|
|
208
|
-
},
|
|
207
|
+
return n;
|
|
208
|
+
}, Aa = () => C(ht), je = () => {
|
|
209
209
|
var e;
|
|
210
|
-
if (a != null && a[
|
|
211
|
-
let
|
|
212
|
-
if (!
|
|
213
|
-
const
|
|
214
|
-
for (let
|
|
215
|
-
if (a != null && a[
|
|
216
|
-
|
|
210
|
+
if (a != null && a[r]) {
|
|
211
|
+
let n = (e = a == null ? void 0 : a[r]) == null ? void 0 : e.format;
|
|
212
|
+
if (!n) {
|
|
213
|
+
const o = Object.keys(a == null ? void 0 : a[r]);
|
|
214
|
+
for (let p = 0; p < o.length; p++)
|
|
215
|
+
if (a != null && a[r][o[p]].selected && (a != null && a[r][o[p]].format)) {
|
|
216
|
+
n = a == null ? void 0 : a[r][o[p]].format;
|
|
217
217
|
break;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
return
|
|
220
|
+
return n;
|
|
221
221
|
}
|
|
222
222
|
return a != null && a.csv ? a.csv.format : null;
|
|
223
|
-
},
|
|
223
|
+
}, Da = () => {
|
|
224
224
|
let e = null;
|
|
225
|
-
return a != null && a[
|
|
226
|
-
},
|
|
225
|
+
return a != null && a[r] ? a[r].useCustomAxisFormat && a[r].customFormat && (e = a[r].customFormat) : a != null && a.csv && a.csv.useCustomAxisFormat && a.csv.customFormat && (e = a.csv.customFormat), e;
|
|
226
|
+
}, Ra = () => a != null && a[r] ? Object.keys(a[r]).map((e) => ({ value: e, ...a[r][e] })).filter((e) => e.selected).map((e) => e.value) : [], et = () => {
|
|
227
227
|
const e = {};
|
|
228
|
-
return a != null && a[
|
|
229
|
-
e[
|
|
228
|
+
return a != null && a[r] && Object.keys(a[r]).map((o) => ({ value: o, ...a[r][o] })).filter((o) => o.selected && o.hasCustomLabel).forEach((o) => {
|
|
229
|
+
e[o.value] = o.customLabel;
|
|
230
230
|
}), e;
|
|
231
|
-
},
|
|
232
|
-
(e) => a[
|
|
231
|
+
}, Fa = () => a != null && a[r] ? Object.keys(a[r]).filter(
|
|
232
|
+
(e) => a[r][e].allowSelection
|
|
233
233
|
) : [];
|
|
234
|
-
let a =
|
|
235
|
-
const
|
|
236
|
-
let
|
|
237
|
-
if (
|
|
238
|
-
const e = Object.keys(
|
|
239
|
-
a =
|
|
234
|
+
let a = Aa(), x = Ra(), g = je();
|
|
235
|
+
const Ba = Fa();
|
|
236
|
+
let ie = lt, se = Ut, de = Oe(kt);
|
|
237
|
+
if (d != null && d[r]) {
|
|
238
|
+
const e = Object.keys(d[r].measures).map((n) => ({ value: n, ...d[r].measures[n] })).filter((n) => n.selected).map((n) => n.value);
|
|
239
|
+
a = d, x = e, g = je(), ie = d.leftTitle, se = d.rightTitle, d.customTooltip && (de = d.customTooltip);
|
|
240
240
|
}
|
|
241
|
-
const
|
|
242
|
-
style:
|
|
243
|
-
notation:
|
|
244
|
-
currency:
|
|
245
|
-
minimumFractionDigits: parseInt(
|
|
246
|
-
maximumFractionDigits: parseInt(
|
|
241
|
+
const Pa = g ? {
|
|
242
|
+
style: g.style === "compacted" ? "decimal" : g.style,
|
|
243
|
+
notation: g.style === "compacted" ? "compact" : "standard",
|
|
244
|
+
currency: g.currency,
|
|
245
|
+
minimumFractionDigits: parseInt(g.minimumFractionDigits),
|
|
246
|
+
maximumFractionDigits: parseInt(g.maximumFractionDigits)
|
|
247
247
|
} : {
|
|
248
248
|
notation: "standard",
|
|
249
249
|
currency: "USD",
|
|
250
250
|
minimumFractionDigits: 2,
|
|
251
251
|
maximumFractionDigits: 2
|
|
252
|
-
},
|
|
252
|
+
}, Ea = Da(), i = C(aa), Na = {
|
|
253
253
|
style: (i == null ? void 0 : i.style) === "compacted" ? "decimal" : i == null ? void 0 : i.style,
|
|
254
254
|
notation: (i == null ? void 0 : i.style) === "compacted" ? "compact" : "standard",
|
|
255
255
|
currency: i == null ? void 0 : i.currency,
|
|
@@ -259,337 +259,337 @@ const mr = (v) => {
|
|
|
259
259
|
maximumFractionDigits: parseInt(
|
|
260
260
|
i == null ? void 0 : i.maximumFractionDigits
|
|
261
261
|
)
|
|
262
|
-
}, [
|
|
263
|
-
scheme:
|
|
264
|
-
colorBy:
|
|
265
|
-
},
|
|
266
|
-
left:
|
|
262
|
+
}, [za, yr] = V(Le), Xa = s ? Le : za, Ga = {
|
|
263
|
+
scheme: te,
|
|
264
|
+
colorBy: z
|
|
265
|
+
}, J = s ? S - 80 : S, Va = () => (l || c) && !(t != null && t.showXAxisTitle) ? "" : ut, Ua = () => l || c ? t != null && t.showYAxisTitle ? ie : "" : ie, Sa = () => l || c ? t != null && t.showRightAxisTitle ? se : "" : se, $a = {
|
|
266
|
+
left: Ua(),
|
|
267
267
|
bottom: Va(),
|
|
268
|
-
right:
|
|
269
|
-
},
|
|
268
|
+
right: Sa()
|
|
269
|
+
}, _ = (e) => {
|
|
270
270
|
if (e === "true" || e === !0)
|
|
271
271
|
return !0;
|
|
272
272
|
if (e === "false" || e === !1)
|
|
273
273
|
return !1;
|
|
274
|
-
},
|
|
275
|
-
|
|
276
|
-
},
|
|
277
|
-
|
|
274
|
+
}, tt = () => {
|
|
275
|
+
_(T) && !_(k) ? (T = !1, k = !0) : !_(T) && _(k) && (T = !0, k = !1);
|
|
276
|
+
}, Ha = () => ae === "horizontal" ? (tt(), "vertical") : (tt(), "horizontal"), Wa = () => t != null && t.chartLayoutOverride ? Ha() : ae, K = (e, n, o) => e ? Number.parseInt(n) ?? o : o, at = (e, n, o) => e ? n ?? o : o;
|
|
277
|
+
he(() => {
|
|
278
278
|
const e = () => {
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
|
|
279
|
+
ya(window.innerWidth <= 1250);
|
|
280
|
+
const n = ne();
|
|
281
|
+
Qe(n);
|
|
282
282
|
};
|
|
283
|
-
return window.addEventListener("resize", e),
|
|
283
|
+
return window.addEventListener("resize", e), Qe(ne()), () => {
|
|
284
284
|
window.removeEventListener("resize", e);
|
|
285
285
|
};
|
|
286
286
|
}, [
|
|
287
287
|
s,
|
|
288
288
|
h,
|
|
289
|
-
|
|
289
|
+
w,
|
|
290
290
|
u,
|
|
291
291
|
t == null ? void 0 : t.tabletXAxisTextRotation,
|
|
292
292
|
t == null ? void 0 : t.mobileXAxisTextRotation
|
|
293
293
|
]);
|
|
294
|
-
const
|
|
294
|
+
const Ya = () => {
|
|
295
295
|
const e = ["tablet", "mobile", "midTablet"].includes(
|
|
296
296
|
ar()
|
|
297
297
|
);
|
|
298
|
-
return s && h === "Desktop" ?
|
|
299
|
-
},
|
|
300
|
-
app:
|
|
298
|
+
return s && h === "Desktop" ? ve : e ? "bottom" : ve;
|
|
299
|
+
}, rt = {
|
|
300
|
+
app: r,
|
|
301
301
|
editing: s,
|
|
302
|
-
tickColor: decodeURIComponent(
|
|
303
|
-
tickRotation:
|
|
304
|
-
layout:
|
|
305
|
-
reverse:
|
|
306
|
-
showLegends:
|
|
307
|
-
legendLabel:
|
|
308
|
-
swap:
|
|
309
|
-
showGrid:
|
|
310
|
-
showPercentage:
|
|
311
|
-
marginLeft:
|
|
312
|
-
|
|
302
|
+
tickColor: decodeURIComponent(pt),
|
|
303
|
+
tickRotation: Ia,
|
|
304
|
+
layout: l || c ? Wa() : ae,
|
|
305
|
+
reverse: ke == !0 || ke == "true",
|
|
306
|
+
showLegends: ye == !0 || ye == "true",
|
|
307
|
+
legendLabel: ct,
|
|
308
|
+
swap: $ == !0 || $ == "true",
|
|
309
|
+
showGrid: Ie == !0 || Ie == "true",
|
|
310
|
+
showPercentage: _e == !0 || _e == "true",
|
|
311
|
+
marginLeft: K(
|
|
312
|
+
l || c,
|
|
313
313
|
Number.parseInt(t == null ? void 0 : t.marginLeft),
|
|
314
314
|
parseInt(gt)
|
|
315
315
|
),
|
|
316
|
-
marginTop:
|
|
317
|
-
|
|
316
|
+
marginTop: K(
|
|
317
|
+
l || c,
|
|
318
318
|
Number.parseInt(t == null ? void 0 : t.marginTop),
|
|
319
|
-
parseInt(
|
|
319
|
+
parseInt(bt)
|
|
320
320
|
),
|
|
321
|
-
marginRight:
|
|
322
|
-
|
|
321
|
+
marginRight: K(
|
|
322
|
+
l || c,
|
|
323
323
|
Number.parseInt(t == null ? void 0 : t.marginRight),
|
|
324
|
-
Number.parseInt(
|
|
324
|
+
Number.parseInt(wt)
|
|
325
325
|
),
|
|
326
|
-
marginBottom:
|
|
327
|
-
|
|
326
|
+
marginBottom: K(
|
|
327
|
+
l || c,
|
|
328
328
|
Number.parseInt(t == null ? void 0 : t.marginBottom),
|
|
329
|
-
Number.parseInt(
|
|
329
|
+
Number.parseInt(xt)
|
|
330
330
|
),
|
|
331
|
-
height: `${
|
|
332
|
-
legendPosition:
|
|
331
|
+
height: `${J}px`,
|
|
332
|
+
legendPosition: Ya(),
|
|
333
333
|
legends: $a,
|
|
334
|
-
tooltip:
|
|
335
|
-
colors:
|
|
336
|
-
groupMode:
|
|
337
|
-
format:
|
|
338
|
-
startAngle:
|
|
339
|
-
endAngle:
|
|
340
|
-
offsetY:
|
|
334
|
+
tooltip: H == !0 || H == "true" ? de : de.replace(/\r\n/g, "<hr/>").replace(/[\r\n]/g, "<hr/>"),
|
|
335
|
+
colors: Ga,
|
|
336
|
+
groupMode: dt,
|
|
337
|
+
format: Pa,
|
|
338
|
+
startAngle: vt,
|
|
339
|
+
endAngle: yt,
|
|
340
|
+
offsetY: Tt,
|
|
341
341
|
// csvLineLayerData,
|
|
342
342
|
// lineColor: decodeURIComponent(lineColor),
|
|
343
343
|
// lineTooltip,
|
|
344
344
|
// lineTitle,
|
|
345
|
-
maxValue:
|
|
346
|
-
valueScale:
|
|
347
|
-
categories:
|
|
348
|
-
lineLayerEnabled:
|
|
349
|
-
overlays:
|
|
350
|
-
barColor: decodeURIComponent(
|
|
351
|
-
overrideTickColor:
|
|
352
|
-
fixedMinValue:
|
|
353
|
-
fixedMaxValue:
|
|
354
|
-
barPadding:
|
|
355
|
-
|
|
345
|
+
maxValue: It,
|
|
346
|
+
valueScale: Mt,
|
|
347
|
+
categories: U,
|
|
348
|
+
lineLayerEnabled: Te == !0 || Te == "true",
|
|
349
|
+
overlays: C(Ct) || [],
|
|
350
|
+
barColor: decodeURIComponent(Dt),
|
|
351
|
+
overrideTickColor: Ce == !0 || Ce == "true",
|
|
352
|
+
fixedMinValue: Rt,
|
|
353
|
+
fixedMaxValue: Ft,
|
|
354
|
+
barPadding: at(
|
|
355
|
+
l || c,
|
|
356
356
|
t == null ? void 0 : t.barPadding,
|
|
357
|
-
|
|
357
|
+
Bt
|
|
358
358
|
),
|
|
359
|
-
barLabelPosition:
|
|
360
|
-
lineLabelPosition:
|
|
361
|
-
barInnerPadding:
|
|
362
|
-
|
|
359
|
+
barLabelPosition: Pt,
|
|
360
|
+
lineLabelPosition: Et,
|
|
361
|
+
barInnerPadding: at(
|
|
362
|
+
l || c,
|
|
363
363
|
t == null ? void 0 : t.barInnerPadding,
|
|
364
|
-
|
|
364
|
+
Nt
|
|
365
365
|
),
|
|
366
|
-
xLabelColor: decodeURIComponent(
|
|
367
|
-
barLabelColor: decodeURIComponent(
|
|
368
|
-
legendLabelColor: decodeURIComponent(
|
|
366
|
+
xLabelColor: decodeURIComponent(zt),
|
|
367
|
+
barLabelColor: decodeURIComponent(Xt),
|
|
368
|
+
legendLabelColor: decodeURIComponent(Gt),
|
|
369
369
|
tooltipEnabled: Ae == !0 || Ae == "true",
|
|
370
|
-
legendLabelBack:
|
|
371
|
-
legendCheckBack:
|
|
372
|
-
highlightXAxisLine:
|
|
373
|
-
showTickLine:
|
|
374
|
-
showRightAxis:
|
|
375
|
-
offsetRight:
|
|
370
|
+
legendLabelBack: Re == !0 || Re == "true",
|
|
371
|
+
legendCheckBack: De == !0 || De == "true",
|
|
372
|
+
highlightXAxisLine: Fe == !0 || Fe == "true",
|
|
373
|
+
showTickLine: Be == !0 || Be == "true",
|
|
374
|
+
showRightAxis: Pe == !0 || Pe == "true",
|
|
375
|
+
offsetRight: St,
|
|
376
376
|
offsetBottom: $t,
|
|
377
|
-
confidenceIntervals:
|
|
378
|
-
showPoints:
|
|
379
|
-
enableArea:
|
|
380
|
-
areaShadingCriteria:
|
|
381
|
-
areaLowerBound:
|
|
382
|
-
areaUpperBound:
|
|
383
|
-
showGroupTotal:
|
|
384
|
-
groupTotalMeasure:
|
|
385
|
-
groupTotalLabel:
|
|
386
|
-
groupTotalFormat:
|
|
387
|
-
groupTotalOffset:
|
|
388
|
-
groupTotalFixedPosition:
|
|
389
|
-
centerLabel:
|
|
390
|
-
showArcLabels:
|
|
391
|
-
showArcLinkLabels:
|
|
392
|
-
slicePadding:
|
|
393
|
-
centerLabelFontWeight:
|
|
394
|
-
centerLabelFontSize:
|
|
395
|
-
centerLabelXOffset:
|
|
396
|
-
centerLabelYOffset:
|
|
397
|
-
userMeasures:
|
|
398
|
-
tooltipEnableMarkdown:
|
|
399
|
-
yAxisTickValues:
|
|
400
|
-
xAxisTickValues:
|
|
401
|
-
lineXAxisTickMode:
|
|
402
|
-
lineXAxisTickCount: parseInt(
|
|
403
|
-
lineXAxisTickEvery: parseInt(
|
|
404
|
-
enableGridY:
|
|
405
|
-
enableGridX:
|
|
406
|
-
offsetText:
|
|
407
|
-
selectedMeasures:
|
|
408
|
-
overallLabel:
|
|
409
|
-
minMaxClamp:
|
|
410
|
-
reverseLegend:
|
|
411
|
-
customAxisFormat:
|
|
412
|
-
sort:
|
|
413
|
-
sortReverse:
|
|
414
|
-
sortReverseSecondDimension:
|
|
415
|
-
radarCurve:
|
|
416
|
-
radarFillOpacity:
|
|
417
|
-
radarBorderWidth:
|
|
377
|
+
confidenceIntervals: C(Wt) || [],
|
|
378
|
+
showPoints: Ne == !0 || Ne == "true",
|
|
379
|
+
enableArea: Ee == !0 || Ee == "true",
|
|
380
|
+
areaShadingCriteria: Yt,
|
|
381
|
+
areaLowerBound: qt,
|
|
382
|
+
areaUpperBound: Jt,
|
|
383
|
+
showGroupTotal: Ge == !0 || Ge == "true",
|
|
384
|
+
groupTotalMeasure: ea,
|
|
385
|
+
groupTotalLabel: ta,
|
|
386
|
+
groupTotalFormat: Na,
|
|
387
|
+
groupTotalOffset: ra,
|
|
388
|
+
groupTotalFixedPosition: Ve == !0 || Ve == "true",
|
|
389
|
+
centerLabel: _t,
|
|
390
|
+
showArcLabels: ze == !0 || ze == "true",
|
|
391
|
+
showArcLinkLabels: Xe == !0 || Xe == "true",
|
|
392
|
+
slicePadding: Kt,
|
|
393
|
+
centerLabelFontWeight: Qt,
|
|
394
|
+
centerLabelFontSize: Zt,
|
|
395
|
+
centerLabelXOffset: Ot,
|
|
396
|
+
centerLabelYOffset: jt,
|
|
397
|
+
userMeasures: Ba,
|
|
398
|
+
tooltipEnableMarkdown: H == !0 || H == "true",
|
|
399
|
+
yAxisTickValues: l || c ? t.yAxisTickValues ?? Ue : Ue,
|
|
400
|
+
xAxisTickValues: l || c ? t.xAxisTickValues ?? Se : Se,
|
|
401
|
+
lineXAxisTickMode: ba,
|
|
402
|
+
lineXAxisTickCount: parseInt(wa) || 10,
|
|
403
|
+
lineXAxisTickEvery: parseInt(xa) || 1,
|
|
404
|
+
enableGridY: k == !0 || k == "true",
|
|
405
|
+
enableGridX: T == !0 || T == "true",
|
|
406
|
+
offsetText: oa,
|
|
407
|
+
selectedMeasures: x,
|
|
408
|
+
overallLabel: re,
|
|
409
|
+
minMaxClamp: na,
|
|
410
|
+
reverseLegend: $e == !0 || $e == "true",
|
|
411
|
+
customAxisFormat: Ea,
|
|
412
|
+
sort: He,
|
|
413
|
+
sortReverse: W == !0 || W == "true",
|
|
414
|
+
sortReverseSecondDimension: Y == !0 || Y == "true",
|
|
415
|
+
radarCurve: ia,
|
|
416
|
+
radarFillOpacity: sa,
|
|
417
|
+
radarBorderWidth: da,
|
|
418
418
|
radarGridLevels: la,
|
|
419
|
-
radarGridShape:
|
|
420
|
-
radarGridLabelOffset:
|
|
421
|
-
radarEnableDots:
|
|
422
|
-
radarDotSize:
|
|
423
|
-
radarEnableDotLabel:
|
|
424
|
-
radarDotLabelOffset:
|
|
425
|
-
sortSecondDimension:
|
|
426
|
-
mobileCustomization:
|
|
427
|
-
dimension1:
|
|
419
|
+
radarGridShape: ca,
|
|
420
|
+
radarGridLabelOffset: ua,
|
|
421
|
+
radarEnableDots: Ye == !0 || Ye == "true",
|
|
422
|
+
radarDotSize: ma,
|
|
423
|
+
radarEnableDotLabel: qe == !0 || qe == "true",
|
|
424
|
+
radarDotLabelOffset: pa,
|
|
425
|
+
sortSecondDimension: We,
|
|
426
|
+
mobileCustomization: Je,
|
|
427
|
+
dimension1: N,
|
|
428
428
|
previewMode: h,
|
|
429
|
-
lineCurve:
|
|
430
|
-
showLegendsInColumns:
|
|
429
|
+
lineCurve: fa,
|
|
430
|
+
showLegendsInColumns: Ke == !0 || Ke == "true",
|
|
431
431
|
numberOfLegendColumns: parseInt(ga) || 4
|
|
432
|
-
},
|
|
433
|
-
|
|
434
|
-
e.value != null && e.value.filter((
|
|
435
|
-
}),
|
|
436
|
-
let
|
|
437
|
-
if (
|
|
438
|
-
|
|
432
|
+
}, le = {}, ce = C(Lt) || {};
|
|
433
|
+
ce && ce.forEach && ce.forEach((e) => {
|
|
434
|
+
e.value != null && e.value.filter((n) => n != null && n.toString().trim() != "").length > 0 && (le[e.param] = e.value);
|
|
435
|
+
}), be && (le.dvzProxyDatasetId = be);
|
|
436
|
+
let I = null, M = null;
|
|
437
|
+
if (r === "csv")
|
|
438
|
+
I = dr;
|
|
439
439
|
else
|
|
440
|
-
switch (
|
|
440
|
+
switch (E) {
|
|
441
441
|
case "line":
|
|
442
|
-
|
|
442
|
+
I = j.LineDataFrame;
|
|
443
443
|
break;
|
|
444
444
|
case "pie":
|
|
445
|
-
|
|
445
|
+
I = j.PieDataFrame;
|
|
446
446
|
break;
|
|
447
447
|
case "radar":
|
|
448
|
-
|
|
448
|
+
I = j.BarDataFrame;
|
|
449
449
|
break;
|
|
450
450
|
default:
|
|
451
|
-
|
|
451
|
+
I = j.BarDataFrame;
|
|
452
452
|
break;
|
|
453
453
|
}
|
|
454
|
-
let
|
|
455
|
-
switch (
|
|
454
|
+
let A = !1;
|
|
455
|
+
switch (E) {
|
|
456
456
|
case "bar":
|
|
457
|
-
|
|
457
|
+
M = nr, A = r != "csv" && N == "none" && x.length == 0;
|
|
458
458
|
break;
|
|
459
459
|
case "line":
|
|
460
|
-
|
|
460
|
+
M = ir, A = r !== "csv" && (x.length === 0 || N === "none");
|
|
461
461
|
break;
|
|
462
462
|
case "pie":
|
|
463
|
-
|
|
463
|
+
A = r != "csv" && x.length == 0, M = rr;
|
|
464
464
|
break;
|
|
465
465
|
case "radar":
|
|
466
|
-
|
|
466
|
+
A = r != "csv" && x.length == 0, M = or;
|
|
467
467
|
break;
|
|
468
468
|
default:
|
|
469
|
-
|
|
469
|
+
M = /* @__PURE__ */ m("div", { children: "No Chart" });
|
|
470
470
|
break;
|
|
471
471
|
}
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
const [
|
|
475
|
-
function
|
|
472
|
+
const qa = mt === "true", X = [];
|
|
473
|
+
N != "none" && X.push(N), xe != "none" && X.push(xe);
|
|
474
|
+
const [ot, Ja] = V(0), [Lr, _a] = V(nt());
|
|
475
|
+
function nt() {
|
|
476
476
|
var e;
|
|
477
477
|
return ((e = window.screen.orientation) == null ? void 0 : e.type) || (window.innerWidth > window.innerHeight ? "landscape-primary" : "portrait-primary");
|
|
478
478
|
}
|
|
479
|
-
return
|
|
479
|
+
return he(() => {
|
|
480
480
|
const e = setTimeout(() => {
|
|
481
|
-
|
|
482
|
-
const
|
|
481
|
+
oe && (() => {
|
|
482
|
+
const o = q.current.querySelector(
|
|
483
483
|
".legends.container.has-standard-12-font-size.bottom"
|
|
484
|
-
) ||
|
|
484
|
+
) || q.current.querySelector(
|
|
485
485
|
".legends.container.items-section:not(.legends.container.top .items-section)"
|
|
486
486
|
);
|
|
487
|
-
if (!
|
|
488
|
-
const { clientHeight:
|
|
487
|
+
if (!o || o.closest(".legends.container.top")) return;
|
|
488
|
+
const { clientHeight: p } = o, v = window.getComputedStyle(o), G = parseInt(v.marginTop), b = parseInt(v.marginBottom), Ka = parseInt(v.paddingTop), Qa = parseInt(v.paddingBottom), Za = p + G + b + Ka + Qa, it = o.closest(
|
|
489
489
|
".ui.fluid.container.content"
|
|
490
490
|
);
|
|
491
|
-
if (
|
|
492
|
-
const
|
|
493
|
-
if (
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
496
|
-
if (
|
|
497
|
-
const
|
|
498
|
-
if (
|
|
499
|
-
let
|
|
500
|
-
|
|
491
|
+
if (it) {
|
|
492
|
+
const y = it.querySelector(".data-source");
|
|
493
|
+
if (y) {
|
|
494
|
+
const D = y.getBoundingClientRect(), R = o.getBoundingClientRect();
|
|
495
|
+
if (R.bottom !== 0 && D.top !== 0) {
|
|
496
|
+
if (o.textContent.trim() === "") return;
|
|
497
|
+
const Q = b, Z = R.bottom + Q, me = window.getComputedStyle(y), O = parseFloat(me.marginTop) || 0, F = D.top - O;
|
|
498
|
+
if (Z > F) {
|
|
499
|
+
let B = Z - F;
|
|
500
|
+
B < 5 && (B += 1), y.style.marginTop = `${B + 1}px`;
|
|
501
501
|
}
|
|
502
502
|
} else
|
|
503
503
|
setTimeout(() => {
|
|
504
|
-
|
|
504
|
+
D.top < R.bottom && (y.style.marginTop = `${R.bottom - D.top + 1}px`);
|
|
505
505
|
}, 1e3);
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
|
-
const
|
|
509
|
-
if (
|
|
510
|
-
const
|
|
511
|
-
if (
|
|
512
|
-
const
|
|
513
|
-
|
|
508
|
+
const ue = o.closest(".chart.container");
|
|
509
|
+
if (ue) {
|
|
510
|
+
const y = ue.getBoundingClientRect(), D = window.getComputedStyle(ue), R = Number.parseFloat(D.marginBottom) || 0, Q = y.bottom + R, Z = o.getBoundingClientRect(), me = Number.parseFloat(v.marginTop) || 0, O = Z.top - me;
|
|
511
|
+
if (O < Q) {
|
|
512
|
+
const F = Q - O, B = 200, Oa = Math.min(F + 1, B);
|
|
513
|
+
F > 0 && F < B && (o.style.marginTop = `${Oa}px`);
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
|
|
516
|
+
Ja(Za);
|
|
517
517
|
})();
|
|
518
518
|
}, 100);
|
|
519
519
|
return () => {
|
|
520
520
|
clearTimeout(e);
|
|
521
521
|
};
|
|
522
|
-
}, [
|
|
522
|
+
}, [oe, q]), he(() => {
|
|
523
523
|
const e = () => {
|
|
524
524
|
setTimeout(() => {
|
|
525
|
-
|
|
525
|
+
_a(nt());
|
|
526
526
|
}, 100);
|
|
527
527
|
};
|
|
528
528
|
return window.screen.orientation ? window.screen.orientation.addEventListener("change", e) : window.addEventListener("resize", e), () => {
|
|
529
529
|
window.screen.orientation ? window.screen.orientation.removeEventListener("change", e) : window.removeEventListener("resize", e);
|
|
530
530
|
};
|
|
531
|
-
}, []), /* @__PURE__ */
|
|
532
|
-
|
|
531
|
+
}, []), /* @__PURE__ */ m("div", { ref: q, children: /* @__PURE__ */ pe(
|
|
532
|
+
fe,
|
|
533
533
|
{
|
|
534
534
|
className: "chart container",
|
|
535
535
|
style: {
|
|
536
|
-
minHeight:
|
|
536
|
+
minHeight: E === "pie" && window.innerWidth <= 480 ? `${parseInt(S) + parseInt(ot) * 0.5}px` : `${parseInt(S) + parseInt(ot)}px`
|
|
537
537
|
},
|
|
538
538
|
fluid: !0,
|
|
539
539
|
children: [
|
|
540
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ m(
|
|
541
541
|
er,
|
|
542
542
|
{
|
|
543
543
|
editing: s,
|
|
544
|
-
style: { height: `${
|
|
545
|
-
params:
|
|
546
|
-
waitForFilters:
|
|
547
|
-
app:
|
|
548
|
-
group:
|
|
549
|
-
csv:
|
|
550
|
-
store: [
|
|
551
|
-
source:
|
|
552
|
-
children: /* @__PURE__ */
|
|
553
|
-
|
|
544
|
+
style: { height: `${J}px` },
|
|
545
|
+
params: le,
|
|
546
|
+
waitForFilters: ha === "true",
|
|
547
|
+
app: r,
|
|
548
|
+
group: we,
|
|
549
|
+
csv: ft,
|
|
550
|
+
store: [r, ee, ...X],
|
|
551
|
+
source: X.join("/"),
|
|
552
|
+
children: /* @__PURE__ */ pe(
|
|
553
|
+
fe,
|
|
554
554
|
{
|
|
555
|
-
style: { height: `${
|
|
555
|
+
style: { height: `${J}px` },
|
|
556
556
|
className: "body",
|
|
557
557
|
fluid: !0,
|
|
558
558
|
children: [
|
|
559
|
-
|
|
560
|
-
!
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
/* @__PURE__ */
|
|
563
|
-
|
|
559
|
+
A && /* @__PURE__ */ m(st, { editing: s }),
|
|
560
|
+
!A && /* @__PURE__ */ pe(tr, { children: [
|
|
561
|
+
/* @__PURE__ */ m(st, { app: r, group: we, noDataMsg: At, children: " " }),
|
|
562
|
+
/* @__PURE__ */ m(
|
|
563
|
+
I,
|
|
564
564
|
{
|
|
565
|
-
locale:
|
|
566
|
-
colorBy:
|
|
567
|
-
hiddenBars:
|
|
568
|
-
swap:
|
|
569
|
-
type:
|
|
565
|
+
locale: Ze,
|
|
566
|
+
colorBy: z,
|
|
567
|
+
hiddenBars: Ht,
|
|
568
|
+
swap: $ === "true" || $ === !0,
|
|
569
|
+
type: E,
|
|
570
570
|
includeTotal: !0,
|
|
571
|
-
includeOverall:
|
|
572
|
-
overallLabel:
|
|
573
|
-
measures:
|
|
574
|
-
dimensions: [...
|
|
575
|
-
sort:
|
|
576
|
-
sortReverse:
|
|
577
|
-
sortSecondDimension:
|
|
578
|
-
sortReverseSecondDimension:
|
|
579
|
-
customLabels:
|
|
580
|
-
children: /* @__PURE__ */
|
|
581
|
-
|
|
571
|
+
includeOverall: Me === !0 || Me === "true",
|
|
572
|
+
overallLabel: re,
|
|
573
|
+
measures: x,
|
|
574
|
+
dimensions: [...X],
|
|
575
|
+
sort: He,
|
|
576
|
+
sortReverse: W === !0 || W === "true",
|
|
577
|
+
sortSecondDimension: We,
|
|
578
|
+
sortReverseSecondDimension: Y === !0 || Y === "true",
|
|
579
|
+
customLabels: et(),
|
|
580
|
+
children: /* @__PURE__ */ m(
|
|
581
|
+
lr,
|
|
582
582
|
{
|
|
583
|
-
type:
|
|
584
|
-
app:
|
|
585
|
-
locale:
|
|
586
|
-
overallLabel:
|
|
587
|
-
customLabels:
|
|
588
|
-
manualColors:
|
|
589
|
-
colorBy:
|
|
590
|
-
scheme:
|
|
591
|
-
barColor:
|
|
592
|
-
children: /* @__PURE__ */
|
|
583
|
+
type: E,
|
|
584
|
+
app: r,
|
|
585
|
+
locale: Ze,
|
|
586
|
+
overallLabel: re,
|
|
587
|
+
customLabels: et(),
|
|
588
|
+
manualColors: Ma(),
|
|
589
|
+
colorBy: z,
|
|
590
|
+
scheme: te,
|
|
591
|
+
barColor: rt.barColor,
|
|
592
|
+
children: /* @__PURE__ */ m(M, { ...rt })
|
|
593
593
|
}
|
|
594
594
|
)
|
|
595
595
|
}
|
|
@@ -600,23 +600,23 @@ const mr = (v) => {
|
|
|
600
600
|
)
|
|
601
601
|
}
|
|
602
602
|
),
|
|
603
|
-
/* @__PURE__ */
|
|
604
|
-
|
|
605
|
-
|
|
603
|
+
/* @__PURE__ */ m("br", {}),
|
|
604
|
+
qa && L && Xa === "info" && /* @__PURE__ */ m(
|
|
605
|
+
fe,
|
|
606
606
|
{
|
|
607
607
|
fluid: !0,
|
|
608
|
-
style: { height:
|
|
608
|
+
style: { height: J + "px" },
|
|
609
609
|
className: "body",
|
|
610
|
-
children: /* @__PURE__ */
|
|
610
|
+
children: /* @__PURE__ */ m(sr, { post: { content: { rendered: L } } })
|
|
611
611
|
}
|
|
612
612
|
)
|
|
613
613
|
]
|
|
614
614
|
}
|
|
615
615
|
) });
|
|
616
|
-
}, pr = (
|
|
617
|
-
const { "data-app": s, "data-group":
|
|
618
|
-
return
|
|
619
|
-
}, hr = {},
|
|
616
|
+
}, pr = (P, ge) => {
|
|
617
|
+
const { "data-app": s, "data-group": ee } = ge, L = P.getIn(["data", "measures", s, ee]), U = P.getIn(["data", "pageModuleProps"]), d = {};
|
|
618
|
+
return L && Object.keys(L).length > 0 && (d.injectedMeasures = L ?? {}), U && (d.pageModuleProps = U), d;
|
|
619
|
+
}, hr = {}, Sr = cr(pr, hr)(ur(mr));
|
|
620
620
|
export {
|
|
621
|
-
|
|
621
|
+
Sr as default
|
|
622
622
|
};
|