@perses-dev/stat-chart-plugin 0.15.0-beta.1 → 0.15.0-beta.2
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/{StatChart.cfc077f0.js → StatChart.bb7e0ece.js} +2 -2
- package/__mf/js/async/{121.dd7133cb.js → 121.f7e8e4a7.js} +2 -2
- package/__mf/js/async/{192.6939be34.js → 192.9808d269.js} +1 -1
- package/__mf/js/async/{2.8caf67bd.js → 2.a13c5048.js} +1 -1
- package/__mf/js/async/{235.c6d2c4f5.js → 235.7bcd2051.js} +1 -1
- package/__mf/js/async/{274.7345c704.js → 274.8d8be5c9.js} +2 -2
- package/__mf/js/async/{345.242802c4.js → 345.f2a95d9c.js} +3 -3
- package/__mf/js/async/{356.b00937de.js → 356.defde8e9.js} +1 -1
- package/__mf/js/async/{392.559f0a15.js → 392.cb707a93.js} +2 -2
- package/__mf/js/async/407.07aba336.js +4 -0
- package/__mf/js/async/450.3a0b1ae3.js +1 -0
- package/__mf/js/async/465.0b7086ef.js +2 -0
- package/__mf/js/async/{470.16a500aa.js → 470.26952ddf.js} +2 -2
- package/__mf/js/async/496.b9973ffe.js +1 -0
- package/__mf/js/async/{570.34dc9996.js → 570.36d078cd.js} +2 -2
- package/__mf/js/async/{587.7eb542f2.js → 587.528aba30.js} +1 -1
- package/__mf/js/async/588.29eb8c38.js +1 -0
- package/__mf/js/async/{616.6b72e257.js → 616.42a14f39.js} +1 -1
- package/__mf/js/async/71.7f97cf3a.js +1 -0
- package/__mf/js/async/721.9ed0b42d.js +1 -0
- package/__mf/js/async/77.048fc50c.js +1 -0
- package/__mf/js/async/788.d3786b94.js +43 -0
- package/__mf/js/async/{866.d7ad9e7a.js → 866.180c7c1d.js} +6 -6
- package/__mf/js/async/873.d6bb2952.js +1 -0
- package/__mf/js/async/{941.1589eeae.js → 941.bf04fa66.js} +2 -2
- package/__mf/js/async/{968.ebdf1f2d.js → 968.0754c6b9.js} +1 -1
- package/__mf/js/async/978.6043d74f.js +1 -0
- package/__mf/js/async/__federation_expose_StatChart.ea6bcd68.js +1 -0
- package/__mf/js/async/{lib-router.73f6cef1.js → lib-router.a0b2cd64.js} +2 -2
- package/__mf/js/{main.cd844a8c.js → main.ca1383be.js} +3 -3
- package/mf-manifest.json +74 -29
- package/mf-stats.json +82 -29
- package/package.json +3 -3
- package/__mf/js/async/354.6ea77f69.js +0 -4
- package/__mf/js/async/449.6d8fc8b3.js +0 -43
- package/__mf/js/async/663.2de74425.js +0 -1
- package/__mf/js/async/970.f5882828.js +0 -2
- package/__mf/js/async/__federation_expose_StatChart.7973125b.js +0 -1
- /package/__mf/css/async/{449.85c2cbf6.css → 788.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{121.dd7133cb.js.LICENSE.txt → 121.f7e8e4a7.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{274.7345c704.js.LICENSE.txt → 274.8d8be5c9.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.559f0a15.js.LICENSE.txt → 392.cb707a93.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{354.6ea77f69.js.LICENSE.txt → 407.07aba336.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{970.f5882828.js.LICENSE.txt → 465.0b7086ef.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{470.16a500aa.js.LICENSE.txt → 470.26952ddf.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{570.34dc9996.js.LICENSE.txt → 570.36d078cd.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{449.6d8fc8b3.js.LICENSE.txt → 788.d3786b94.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{866.d7ad9e7a.js.LICENSE.txt → 866.180c7c1d.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.1589eeae.js.LICENSE.txt → 941.bf04fa66.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.73f6cef1.js.LICENSE.txt → lib-router.a0b2cd64.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.chunk_StatChart_0_15_0_beta_1=self.chunk_StatChart_0_15_0_beta_1||[]).push([["903"],{82372(e,t,l){let n;l.r(t),l.d(t,{StatChart:()=>N});let o=[{id:"none",label:"None"},{id:"value",label:"Text"},{id:"background_solid",label:"Background"}],i=[{id:"auto",label:"Auto",description:"Show legend for multi-series, hide legend for single series"},{id:"on",label:"On",description:"Always show legend"},{id:"off",label:"Off",description:"Always hide legend"}];var a=l(62540),r=l(68003),s=l(56875),d=l(9222),u=l(38662),c=l(25632),h=l.n(c),p=l(70451);let f={unit:"percent-decimal"};var g=l(315),m=l(88091),x=l(56599),v=l(74628),C=l(77308),b=l(2849),M=l(91247),S=l(59738),j=l(90652),w=l(72106),y=l(55875),A=l(74653),k=l(37573);function O(e){let{text:t,fontWeight:l,width:o,height:i,lineHeight:a,maxSize:r,fontSizeOverride:d}=e,u=function(){if(!n&&null===(n=document.createElement("canvas").getContext("2d")))throw Error("Canvas context is null.");return n}(),{echartsTheme:c}=(0,s.useChartsTheme)();if(void 0!==d)return Number(d);let h=c.textStyle,p=Number((null==h?void 0:h.fontSize)??12),f=(null==h?void 0:h.fontFamily)??"Lato";u.font=`${l} ${p}px ${f}`;let g=Math.min(i/a,o/u.measureText(t).width*p);return r?Math.min(g,r):g}(0,A.Y)([M.a,S.a,j.a,w.a,y.a,k.a]);let _="#FFFFFF",F="#000000",E=e=>{var t,l,n,o;let{width:i,height:r,data:d,data:{color:u},sparkline:c,showSeriesName:f,format:g,valueFontSize:m,colorMode:C}=e,{palette:{mode:M,text:{secondary:S}}}=(0,x.A)(),j=(0,s.useChartsTheme)(),w=(n=d.calculatedValue,o=g,null===n?"null":"number"==typeof n?(0,s.formatValue)(n,o):void 0===n?"":n),y=j.container.padding.default,A=O({text:(null==d||null==(t=d.seriesData)?void 0:t.name)??"",fontWeight:400,width:i,height:.125*r,lineHeight:1.2,maxSize:30}),k=f?1.2*A+y:0,E=i-2*y,L=r-k,$=O({text:w,fontSizeOverride:m,fontWeight:700,width:c?E:.5*E,height:c?.25*L:.9*L,lineHeight:1.2}),D=1.2*$;A=Math.min(.7*$,A);let N=(0,p.useMemo)(()=>{if(!d.seriesData)return j.noDataOption;let e=d.seriesData,t=[];if(c){let l={type:"line",name:e.name,data:e.values,zlevel:1,symbol:"none",animation:!1,silent:!0},n={...c};"background_solid"===C&&(n.areaStyle={color:_,opacity:.4},n.lineStyle={color:_,opacity:1});let o=h()(l,n);t.push(o)}return{title:{show:!1},grid:{show:!1,top:"35%",right:0,bottom:0,left:0,containLabel:!1},xAxis:{type:"time",show:!1,boundaryGap:!1},yAxis:{type:"value",show:!1,min:e=>e.min>=0&&e.min<=1?0:e.min},tooltip:{show:!1},series:t}},[d,j,c,C]),I=c?"auto":"center",V=(0,p.useMemo)(()=>{let e="";switch(C){case"background_solid":e=b.Ay.contrast(u,_)>b.Ay.contrast(u,F)?_:F;break;case"none":e="dark"===M?_:F;break;default:e=u}return(0,a.jsx)(T,{variant:"h3",color:e,fontSize:$,padding:y,children:w})},[C,y,$,w,u,M]),G=(0,p.useMemo)(()=>{var e;if(!f)return null;let t="";return t="background_solid"===C?b.Ay.contrast(u,_)>b.Ay.contrast(u,F)?_:F:S,(0,a.jsx)(z,{padding:y,fontSize:A,color:t,children:null==(e=d.seriesData)?void 0:e.name})},[C,f,S,u,y,A,null==d||null==(l=d.seriesData)?void 0:l.name]);return(0,a.jsxs)(v.A,{sx:{height:"100%",width:"100%",backgroundColor:"background_solid"===C?u:"transparent",display:"flex",flexDirection:"column",justifyContent:I,alignItems:I},children:[G,V,c&&(0,a.jsx)(s.EChart,{sx:{width:"100%"},style:{height:Math.floor(r-k-D)},option:N,theme:j.echartsTheme,renderer:"svg"})]})},z=(0,C.A)(m.A,{shouldForwardProp:e=>"padding"!==e&&"fontSize"!==e})(e=>{let{padding:t,fontSize:l,color:n}=e;return{color:n,padding:`${t}px`,fontSize:`${l}px`,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),T=(0,C.A)(m.A,{shouldForwardProp:e=>"color"!==e&&"padding"!==e&&"fontSize"!==e&&"sparkline"!==e})(e=>{let{theme:t,color:l,padding:n,fontSize:o,sparkline:i}=e;return{color:l??t.palette.text.primary,fontSize:`${o}px`,padding:i?`${n}px ${n}px 0 ${n}px`:` 0 ${n}px`,whiteSpace:"nowrap",lineHeight:1.2}}),L=(e,t)=>(void 0===d.CalculationsMap[e]&&console.warn(`Invalid StatChart panel calculation ${e}, fallback to ${d.DEFAULT_CALCULATION}`),(d.CalculationsMap[e]??d.CalculationsMap[d.DEFAULT_CALCULATION])(t.values)),$=(e,t,l)=>l||((null==t?void 0:t.length)&&null!=e?(0,s.applyValueMapping)(e,t).value:e),D=(e,t)=>{if(t&&e){for(let[l,n]of Object.entries(t))if((0,s.createRegexFromString)(e).test(l))return n}},N={PanelComponent:e=>{let t,l,n,{spec:o,contentDimensions:i,queryResults:r}=e,{format:d,sparkline:u,valueFontSize:c,colorMode:h}=o,f=(0,s.useChartsTheme)(),x=(t=r,l=o,n=f,(0,p.useMemo)(()=>{let{calculation:e,mappings:o,metricLabel:i}=l,a=[];for(let r of t)for(let t of r.data.series){let r=L(e,t),d=$(r,o,D(i,t.labels)),u=function(e,t,l){let{mappings:n,thresholds:o}=t??{},i=(null==o?void 0:o.defaultColor)??e.thresholds.defaultColor;if(null==l||""===l||!(null==o?void 0:o.steps)&&!n)return i;if(null==n?void 0:n.length){let e=function(e,t){if((null==t?void 0:t.length)&&null!=e){let{color:l}=(0,s.applyValueMapping)(e,t);return l||null}return null}(l,n);if(e)return e}if(o){let t=function(e,t,l,n){if((null==t?void 0:t.steps)&&"number"==typeof e){let o=t.steps.map((t,o)=>e>=t.value?t.color??l.thresholds.palette[o]??n:null).filter(e=>null!==e);return o[o.length-1]??null}return null}(l,o,e,i);if(t)return t}return i}(n,l,r),c={name:t.formattedName??"",values:t.values};a.push({calculatedValue:d,seriesData:c,color:u})}return a},[t,l,n])),v=x.length>1,C=v;if("on"===o.legendMode?C=!0:"off"===o.legendMode&&(C=!1),!i)return null;let b=2*(x.length-1),M=(i.width-b)/x.length;v&&M<100&&(M=100);let S=f.noDataOption.title.textStyle;return(0,a.jsx)(g.A,{height:i.height,width:i.width,spacing:"2px",direction:"row",justifyContent:v?"left":"center",alignItems:"center",sx:{overflowX:v?"scroll":"auto"},children:x.length?x.map((e,t)=>{let l=function(e,t,l){if(void 0!==l)return{lineStyle:{width:l.width??e.sparkline.width,color:t,opacity:1},areaStyle:{color:t,opacity:.4}}}(f,e.color,u);return(0,a.jsx)(E,{width:M,height:i.height,data:e,format:d,sparkline:l,showSeriesName:C,valueFontSize:c,colorMode:h},t)}):(0,a.jsx)(m.A,{sx:{...S},children:"No data"})})},supportedQueryTypes:["TimeSeriesQuery"],panelOptionsEditorComponents:[{label:"Settings",content:function(e){let{onChange:t,value:l}=e,n=h()({},f,l.format),c=(0,p.useCallback)((e,n)=>{t((0,u.jM)(l,e=>{e.legendMode=n.id}))},[t,l]),g=(0,p.useCallback)((e,n)=>{t((0,u.jM)(l,e=>{e.colorMode=n.id}))},[t,l]),m=(0,p.useMemo)(()=>(0,a.jsx)(s.OptionsEditorControl,{label:"Show",control:(0,a.jsx)(s.SettingsAutocomplete,{onChange:c,options:i,disableClearable:!0,value:i.find(e=>e.id===l.legendMode)??i.find(e=>"auto"===e.id)})}),[l.legendMode,c]),x=(0,p.useMemo)(()=>(0,a.jsx)(s.OptionsEditorControl,{label:"Color mode",control:(0,a.jsx)(s.SettingsAutocomplete,{onChange:g,options:o.map(e=>{let{id:t,label:l}=e;return{id:t,label:l}}),disableClearable:!0,value:o.find(e=>e.id===l.colorMode)??o.find(e=>"value"===e.id)})}),[l.colorMode,g]);return(0,a.jsxs)(s.OptionsEditorGrid,{children:[(0,a.jsxs)(s.OptionsEditorColumn,{children:[(0,a.jsx)(s.OptionsEditorGroup,{title:"Legend",children:m}),(0,a.jsxs)(s.OptionsEditorGroup,{title:"Misc",children:[(0,a.jsx)(s.OptionsEditorControl,{label:"Sparkline",control:(0,a.jsx)(r.A,{checked:!!l.sparkline,onChange:(e,n)=>{t((0,u.jM)(l,e=>{e.sparkline=n?{}:void 0}))}})}),(0,a.jsx)(s.FormatControls,{value:n,onChange:e=>{t((0,u.jM)(l,t=>{t.format=e}))}}),(0,a.jsx)(d.CalculationSelector,{value:l.calculation,onChange:e=>{t((0,u.jM)(l,t=>{t.calculation=e}))}}),(0,a.jsx)(d.MetricLabelInput,{value:l.metricLabel,onChange:e=>{t((0,u.jM)(l,t=>{t.metricLabel=e}))}}),(0,a.jsx)(s.FontSizeSelector,{value:l.valueFontSize,onChange:e=>{t((0,u.jM)(l,t=>{t.valueFontSize=e}))}}),x]})]}),(0,a.jsx)(s.OptionsEditorColumn,{children:(0,a.jsx)(s.ThresholdsEditor,{disablePercentMode:!0,thresholds:l.thresholds,onChange:e=>{t((0,u.jM)(l,t=>{t.thresholds=e}))}})})]})}},{label:"Value mapping",content:e=>{let{onChange:t,value:l}=e;return(0,a.jsx)(s.ValueMappingsEditor,{mappings:l.mappings??[],onChange:function(e){t({...l,mappings:e})}})}}],createInitialOptions:function(){return{calculation:"last-number",format:{unit:"decimal"},sparkline:{},legendMode:"auto"}}}}}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/__mf/js/async/{lib-router.73f6cef1.js.LICENSE.txt → lib-router.a0b2cd64.js.LICENSE.txt}
RENAMED
|
File without changes
|