@perses-dev/gauge-chart-plugin 0.13.0-beta.2 → 0.13.0-rc.1
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/__mf/js/GaugeChart.ac26e4f3.js +7 -0
- package/__mf/js/async/187.ba6fd686.js +7 -0
- package/__mf/js/async/546.9670f97a.js +24 -0
- package/__mf/js/async/700.1be812d5.js +30 -0
- package/__mf/js/async/__federation_expose_GaugeChart.938eb098.js +1 -0
- package/__mf/js/{main.2beb3b7a.js → main.378e6f17.js} +2 -2
- package/mf-manifest.json +13 -13
- package/mf-stats.json +13 -13
- package/package.json +4 -4
- package/__mf/js/GaugeChart.407cd6a2.js +0 -7
- package/__mf/js/async/122.c6397243.js +0 -7
- package/__mf/js/async/421.60fa6c0e.js +0 -30
- package/__mf/js/async/570.6b39cd2c.js +0 -24
- package/__mf/js/async/__federation_expose_GaugeChart.bdaa3397.js +0 -1
- /package/__mf/css/async/{122.85c2cbf6.css → 187.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{122.c6397243.js.LICENSE.txt → 187.ba6fd686.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{570.6b39cd2c.js.LICENSE.txt → 546.9670f97a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{421.60fa6c0e.js.LICENSE.txt → 700.1be812d5.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.chunk_GaugeChart=self.chunk_GaugeChart||[]).push([["204"],{44272(e){e.exports=function(e,t){for(var n=-1,l=null==e?0:e.length,o=Array(l);++n<l;)o[n]=t(e[n],n,e);return o}},93305(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},25814(e,t,n){var l=n(61414),o=n(44272),r=n(93305),a=n(36204),i=n(75569),h=Math.max;e.exports=function(e){if(!(e&&e.length))return[];var t=0;return e=l(e,function(e){if(i(e))return t=h(e.length,t),!0}),a(t,function(t){return o(e,r(t))})}},10007(e,t,n){e.exports=n(71506)(n(25814))},23470(e,t,n){"use strict";n.r(t),n.d(t,{GaugeChart:()=>O});let l={unit:"percent-decimal"};var o=n(62540),r=n(93648),a=n(68003),i=n(4239),h=n(57085),s=n(43945),u=n(25632),d=n.n(u),c=n(315),p=n(74628),g=n(33313),m=n(70451),f=n(10007),x=n.n(f);let v={steps:[{value:0}]};var w=n(74653),C=n(49828),M=n(59738),j=n(72106),S=n(55875),b=n(37573);function y(e){let{width:t,height:n,data:l,format:r,axisLine:a,max:h,valueFontSize:s,progressWidth:u,titleFontSize:d}=e,c=(0,i.useChartsTheme)(),p=(0,i.useDeepMemo)(()=>{var e;if(void 0===l.value)return c.noDataOption;let n={type:"gauge",center:["50%","65%"],startAngle:200,endAngle:-20,min:0,max:h,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},data:[{value:l.value}]};return{title:{show:!1},tooltip:{show:!1},series:[{...n,radius:"90%",silent:!0,progress:{show:!0,width:u,itemStyle:{color:"auto"}},axisLine:{lineStyle:{color:[[1,"rgba(127,127,127,0.35)"]],width:u}},pointer:{show:!1},anchor:{show:!1},title:{show:!1},detail:{show:!1}},{...n,radius:"100%",pointer:{show:!0,icon:t>170?"path://M12.8,0.7l12,40.1H0.7L12.8,0.7z":"none",length:10,width:5,offsetCenter:[0,"-49%"],itemStyle:{color:"auto"}},axisLine:a,detail:{show:!0,width:"60%",borderRadius:8,offsetCenter:[0,"-9%"],color:"inherit",fontSize:s,formatter:null===l.value?()=>"null":e=>(0,i.formatValue)(e,r)},data:[{value:l.value,name:l.label,title:{show:!0,color:(null==(e=c.echartsTheme.textStyle)?void 0:e.color)??"inherit",offsetCenter:[0,"55%"],overflow:"truncate",fontSize:d,width:.8*t}}]}]}},[l,t,n,c,r,a,h,s,u,d]);return(0,o.jsx)(i.EChart,{style:{width:t,height:n},sx:{padding:`${c.container.padding.default}px`},option:p,theme:c.echartsTheme})}(0,w.Y)([C.a,M.a,j.a,S.a,b.a]);let A={label:"",value:void 0};function L(e,t){return Math.max(10,Math.min(48,Math.round(.1*Math.min(e,t))))}function E(e,t,n,l){let o=Math.max(("number"==typeof e?(0,i.formatValue)(e,t):`${e}`).length,6),r=Math.min(n,l);return`clamp(8px, ${r/o}px, 64px)`}function T(e,t){return Math.max(10,Math.min(16,Math.round(.06*Math.min(e,t))))}let O={PanelComponent:function(e){let{spec:t,contentDimensions:n,queryResults:r}=e,{calculation:a,max:s,legend:u}=t,{thresholds:g}=(0,i.useChartsTheme)(),f=(null==u?void 0:u.show)??!0,w=d()({},l,t.format),C=t.thresholds??v,M=(0,m.useMemo)(()=>{let e=[];h.CalculationsMap[a]||console.warn(`Invalid GaugeChart panel calculation ${a}, fallback to ${h.DEFAULT_CALCULATION}`);let t=h.CalculationsMap[a]??h.CalculationsMap[h.DEFAULT_CALCULATION];for(let n of r)for(let l of n.data.series)e.push({value:t(l.values),label:f?l.formattedName??"":""});return e},[r,a,f]);if(!n)return null;let j=s;void 0===j&&(j="percent"===w.unit?100:1);let S=function(e,t,n){let l=e.defaultColor??n.defaultColor,o=[[0,l]];if(void 0===e.steps)return o;{let o=e.steps.map(n=>"percent"===e.mode?n.value/100:n.value/t);o.push(1);let r=e.steps.map((e,t)=>e.color??n.palette[t]);return r.unshift(l),x()(o,r).map(e=>[e[0]??1,e[1]??l])}}(C,j,g),b=n.width/M.length-20;b<90&&M.length>1&&(b=90);let O=L(b,n.height),z=Math.round(.2*O),F=T(b,n.height),G={show:!0,lineStyle:{width:z,color:S}};if(!M.length){let e=E(null,w,n.width,n.height),t=L(n.width,n.height),l=T(n.width,n.height);return(0,o.jsx)(y,{width:n.width,height:n.height,data:A,format:w,axisLine:G,max:j,valueFontSize:e,progressWidth:t,titleFontSize:l})}let $=M.length>1;return(0,o.jsx)(c.A,{direction:"row",spacing:2*!!$,justifyContent:$?"left":"center",alignItems:"center",sx:{overflowX:M.length>1?"scroll":"auto"},children:M.map((e,t)=>{let l=E(e.value??null,w,b,n.height);return(0,o.jsx)(p.A,{children:(0,o.jsx)(y,{width:b,height:n.height,data:e,format:w,axisLine:G,max:j,valueFontSize:l,progressWidth:O,titleFontSize:F})},`gauge-series-${t}`)})})},LoadingComponent:function(e){let{contentDimensions:t}=e;return t?(0,o.jsx)(g.A,{sx:{margin:"0 auto"},variant:"circular",width:t.width>t.height?t.height:t.width,height:t.height}):null},supportedQueryTypes:["TimeSeriesQuery"],panelOptionsEditorComponents:[{label:"Settings",content:function(e){var t;let{onChange:n,value:u}=e,c=(null==u||null==(t=u.legend)?void 0:t.show)??!0,p=d()({},l,u.format),g="Enter value";return"percent"===p.unit?g="100":"percent-decimal"===p.unit&&(g="1"),(0,o.jsxs)(i.OptionsEditorGrid,{children:[(0,o.jsx)(i.OptionsEditorColumn,{children:(0,o.jsxs)(i.OptionsEditorGroup,{title:"Misc",children:[(0,o.jsx)(i.FormatControls,{value:p,onChange:e=>{n((0,s.produce)(u,t=>{t.format=e}))}}),(0,o.jsx)(h.CalculationSelector,{value:u.calculation,onChange:e=>{n((0,s.produce)(u,t=>{t.calculation=e}))}}),(0,o.jsx)(i.OptionsEditorControl,{label:"Max",control:(0,o.jsx)(r.A,{type:"number",value:u.max??"",onChange:e=>{let t=e.target.value?Number(e.target.value):void 0;n((0,s.produce)(u,e=>{e.max=t}))},placeholder:g})})]})}),(0,o.jsxs)(i.OptionsEditorColumn,{children:[(0,o.jsx)(i.ThresholdsEditor,{thresholds:u.thresholds,onChange:e=>{n((0,s.produce)(u,t=>{t.thresholds=e}))}}),(0,o.jsx)(i.OptionsEditorControl,{label:"Show legend",control:(0,o.jsx)(a.A,{onChange:()=>{n((0,s.produce)(u,e=>{e.legend={...e.legend,show:!c}}))},checked:c})})]})]})}}],createInitialOptions:function(){return{calculation:"last-number",format:l,thresholds:{steps:[{value:.8},{value:.9}]}}}}}}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|