@pulzr/perses-figure-panel 0.2.0 → 0.3.0
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/README.md +21 -0
- package/__mf/js/{PulzrFigurePanel.222ed57f17.js → PulzrFigurePanel.b29c14b507.js} +2 -2
- package/__mf/js/async/{0.73358ef06f.js → 0.ee9b9a050d.js} +2 -2
- package/__mf/js/async/{0p.a434b768a9.js → 0p.810fbfea5e.js} +2 -2
- package/__mf/js/async/{2.eb2d03fe10.js → 2.e0e77c51ac.js} +2 -2
- package/__mf/js/async/{6.bf1ee74593.js → 6.1033156971.js} +1 -1
- package/__mf/js/async/{9.dc16e89090.js → 9.f20ad249a8.js} +1 -1
- package/__mf/js/async/__federation_expose_PulzrFigurePanel.9472172973.js +1 -0
- package/__mf/js/async/{f.6ef0146b6f.js → f.9b147c6255.js} +2 -2
- package/__mf/js/async/k.39678d65e5.js +1 -0
- package/__mf/js/async/kk.62383e2b13.js +1 -0
- package/__mf/js/async/kx.899711f01e.js +83 -0
- package/__mf/js/async/kx.899711f01e.js.LICENSE.txt +55 -0
- package/__mf/js/async/mt.918f7f9b24.js +92 -0
- package/__mf/js/async/{b.09e9dadd98.js.LICENSE.txt → mt.918f7f9b24.js.LICENSE.txt} +0 -25
- package/__mf/js/async/{o.d3ab28c6c2.js → o.ec154e6ff6.js} +1 -1
- package/__mf/js/async/{os.61448719cf.js → os.e5e40daae1.js} +2 -2
- package/__mf/js/async/{p.f145ba64f8.js → p.4a73008e86.js} +2 -2
- package/__mf/js/async/{s.c517b47b4d.js → s.658d6a4164.js} +1 -1
- package/__mf/js/{main.fb996ef195.js → main.386bdfecce.js} +2 -2
- package/lib/panels/pulzr-figure-panel/PulzrFigurePanelComponent.d.ts +4 -1
- package/lib/panels/pulzr-figure-panel/PulzrFigurePanelComponent.d.ts.map +1 -1
- package/lib/panels/pulzr-figure-panel/PulzrFigurePanelComponent.js +499 -101
- package/lib/panels/pulzr-figure-panel/PulzrFigurePanelComponent.js.map +1 -1
- package/lib/panels/pulzr-figure-panel/PulzrFigurePanelSettingsEditor.d.ts.map +1 -1
- package/lib/panels/pulzr-figure-panel/PulzrFigurePanelSettingsEditor.js +128 -51
- package/lib/panels/pulzr-figure-panel/PulzrFigurePanelSettingsEditor.js.map +1 -1
- package/lib/panels/pulzr-figure-panel/figure.d.ts +25 -6
- package/lib/panels/pulzr-figure-panel/figure.d.ts.map +1 -1
- package/lib/panels/pulzr-figure-panel/figure.js +43 -11
- package/lib/panels/pulzr-figure-panel/figure.js.map +1 -1
- package/lib/panels/pulzr-figure-panel/pulzr-figure-panel-types.d.ts +22 -2
- package/lib/panels/pulzr-figure-panel/pulzr-figure-panel-types.d.ts.map +1 -1
- package/lib/panels/pulzr-figure-panel/pulzr-figure-panel-types.js.map +1 -1
- package/mf-manifest.json +19 -19
- package/mf-stats.json +19 -19
- package/package.json +1 -1
- package/__mf/js/async/5.b8898f130f.js +0 -83
- package/__mf/js/async/5.b8898f130f.js.LICENSE.txt +0 -30
- package/__mf/js/async/__federation_expose_PulzrFigurePanel.1c3d39adbe.js +0 -1
- package/__mf/js/async/b.09e9dadd98.js +0 -92
- package/__mf/js/async/k.d692a3f373.js +0 -1
- package/__mf/js/async/kk.50088d6550.js +0 -1
- /package/__mf/css/async/{b.7481ca0159.css → mt.7481ca0159.css} +0 -0
- /package/__mf/js/async/{0.73358ef06f.js.LICENSE.txt → 0.ee9b9a050d.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{0p.a434b768a9.js.LICENSE.txt → 0p.810fbfea5e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2.eb2d03fe10.js.LICENSE.txt → 2.e0e77c51ac.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{f.6ef0146b6f.js.LICENSE.txt → f.9b147c6255.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{os.61448719cf.js.LICENSE.txt → os.e5e40daae1.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{p.f145ba64f8.js.LICENSE.txt → p.4a73008e86.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.chunk_PulzrFigurePanel_0_2_0=self.chunk_PulzrFigurePanel_0_2_0||[]).push([["2k"],{RK(e,t,l){function o(e){let t=e?.values??[];for(let e=t.length-1;e>=0;e--){let l=t[e][1];if(null!==l&&Number.isFinite(l))return l}}function n(e,t){let l=e.flatMap(e=>e.data?.series??[]),n=e=>!!e.labels?.compare,r=e=>void 0!==t&&(e.formattedName??e.name)===t;return{now:o(l.find(e=>!n(e)&&!r(e))),before:o(l.find(e=>n(e)&&!(void 0!==t&&(e.formattedName??e.name).startsWith(t)))),total:void 0===t?void 0:o(l.find(e=>!n(e)&&r(e)))}}l.r(t),l.d(t,{PulzrFigurePanel:()=>y,PulzrFigurePanelComponent:()=>C,PulzrFigurePanelSettingsEditor:()=>$,changeOf:()=>a,changeText:()=>d,figureOf:()=>n,fill:()=>u,lastValue:()=>o,sizeChange:()=>f,timeInParts:()=>i,valuesOf:()=>c});let r={seconds:1/60,minutes:1,hours:60};function i(e,t){let l=t?r[t]:void 0;if(void 0===l)return;let o=Math.round(e*l);if(o<60)return`${o}m`;if(o<2880){let e=Math.floor(o/60),t=o%60;return t?`${e}h ${t}m`:`${e}h`}let n=Math.floor(o/1440),i=Math.round(o%1440/60);return i?`${n}d ${i}h`:`${n}d`}function a(e,t){if(void 0===e||void 0===t||t<=0)return;let l=(e-t)/t*100,o="flat";return l>.5?o="up":l<-.5&&(o="down"),{percent:l,direction:o}}let s={up:"↑",down:"↓",flat:"→"};function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"vs the period before",l=e.percent>0?"+":"";return`${s[e.direction]} ${l}${e.percent.toFixed(1)}% ${t}`}function c(e){let t=new Map;for(let l of e.flatMap(e=>e.data?.series??[])){if(l.labels?.compare)continue;let e=o(l);void 0!==e&&t.set(l.formattedName??l.name,e)}return t}function u(e,t){return e.replace(/\{\{\s*([^}|]+?)\s*(\|\s*%\s*)?\}\}/g,(e,l,o)=>{let n=t.get(l);return void 0===n?"—":o?`${n.toFixed(1)}%`:n.toLocaleString(void 0,{maximumFractionDigits:1})})}function f(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0===e||void 0===t||0===t)return;let o=(e-t)/Math.abs(t)*100;if(.05>Math.abs(o))return{text:"0%",tone:"flat"};let n=Math.abs(o)>=100?String(Math.round(Math.abs(o))):Math.abs(o).toFixed(1);return{text:`${o>0?"↑":"↓"} ${n}%`,tone:(l?o<0:o>0)?"good":"bad"}}var h=l("P2"),p=l("K2"),m=l("X3"),x=l("ZQ"),g=l("Q6");let v={fontFeatureSettings:"'tnum' 1",fontVariantNumeric:"tabular-nums"},b={good:"success.main",bad:"error.main",flat:"text.disabled"};function C(e){let t,l=(0,p.c)(20),{queryResults:o,spec:r}=e;if(l[0]!==o||l[1]!==r){let e,s,p,C,S,w,{now:j,before:A,total:z}=n(o,r.of?.series),$=r.subtitle||r.detail?c(o):void 0,{line:y,lineColor:F}=function(e,t,l){let o=l.comparedLabel??"vs the period before";if("size"===l.changeStyle){let n=f(e,t,l.lowerIsBetter);return n?{line:`${n.text} ${o}`,lineColor:b[n.tone]}:{line:l.caption,lineColor:"text.secondary"}}let n=a(e,t);if(!n)return{line:l.caption,lineColor:"text.secondary"};if("flat"===n.direction)return{line:d(n,o),lineColor:b.flat};let r=n.direction===(l.lowerIsBetter?"down":"up");return{line:d(n,o),lineColor:r?b.good:b.bad}}(j,A,r);l[3]===Symbol.for("react.memo_cache_sentinel")?(e={px:"10px",pt:"2px",pb:"7px",minWidth:0,overflow:"hidden"},l[3]=e):e=l[3];let M=r.color??"text.primary";if(l[4]!==M?(s={...v,fontSize:22,fontWeight:300,lineHeight:1.05,letterSpacing:"-0.02em",mb:"4px",color:M},l[4]=M,l[5]=s):s=l[5],l[6]!==j||l[7]!==r)p=void 0===j?"—":r.timeInParts&&i(j,r.format?.unit)||(0,g.formatValue)(j,r.format),l[6]=j,l[7]=r,l[8]=p;else p=l[8];l[9]!==j||l[10]!==r.of||l[11]!==z?(C=r.of&&void 0!==z&&void 0!==j&&(0,h.jsx)(m.A,{component:"span",sx:{...v,fontSize:13,fontWeight:400,letterSpacing:"0.02em",color:"text.secondary",ml:"8px",whiteSpace:"nowrap"},children:`${Math.round(j*z)}/${z}${r.of.label?` ${r.of.label}`:""}`}),l[9]=j,l[10]=r.of,l[11]=z,l[12]=C):C=l[12],l[13]!==s||l[14]!==p||l[15]!==C?(S=(0,h.jsxs)(m.A,{component:"div",sx:s,children:[p,C]}),l[13]=s,l[14]=p,l[15]=C,l[16]=S):S=l[16],l[17]!==y||l[18]!==F?(w=y&&(0,h.jsx)(m.A,{component:"div",sx:{...v,fontSize:10,fontWeight:500,lineHeight:1.4,letterSpacing:"0.02em",textTransform:"uppercase",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:F},children:y}),l[17]=y,l[18]=F,l[19]=w):w=l[19],t=(0,h.jsxs)(x.A,{sx:e,children:[r.subtitle&&$&&(0,h.jsx)(m.A,{component:"div",sx:{fontSize:9,letterSpacing:"0.04em",textTransform:"uppercase",color:"text.secondary",mt:"-4px",mb:"6px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:u(r.subtitle,$)}),S,w,r.detail&&$&&(0,h.jsx)(m.A,{component:"div",sx:{...v,display:"inline-block",fontSize:9,fontWeight:500,lineHeight:1.4,letterSpacing:"0.04em",textTransform:"uppercase",color:"text.secondary",mt:"5px",px:"6px",py:"2px",bgcolor:"action.hover",border:1,borderColor:"divider"},children:u(r.detail,$)})]}),l[0]=o,l[1]=r,l[2]=t}else t=l[2];return t}var S=l("AI"),w=l("FA"),j=l("Ct"),A=l("hA");let z=e=>e.trim()?e:void 0;function $(e){let t,l,o,n,r,i,a,s,d,c,u,f,m,x,v,b,C,$,y,F,M,P=(0,p.c)(63),{value:O,onChange:_}=e;P[0]!==O.format?(t=O.format??{unit:"decimal"},P[0]=O.format,P[1]=t):t=P[1],P[2]!==_||P[3]!==O?(l=e=>_({...O,format:e}),P[2]=_,P[3]=O,P[4]=l):l=P[4],P[5]!==t||P[6]!==l?(o=(0,h.jsx)(g.OptionsEditorColumn,{children:(0,h.jsx)(g.OptionsEditorGroup,{title:"Format",children:(0,h.jsx)(g.FormatControls,{value:t,onChange:l})})}),P[5]=t,P[6]=l,P[7]=o):o=P[7];let T=O.color??"";P[8]!==_||P[9]!==O?(n=e=>_({...O,color:z(e.target.value)}),P[8]=_,P[9]=O,P[10]=n):n=P[10],P[11]!==T||P[12]!==n?(r=(0,h.jsx)(S.A,{size:"small",label:"Color",helperText:"Any CSS color. Empty: the text color.",value:T,onChange:n}),P[11]=T,P[12]=n,P[13]=r):r=P[13];let E=O.comparedLabel??"";P[14]!==_||P[15]!==O?(i=e=>_({...O,comparedLabel:z(e.target.value)}),P[14]=_,P[15]=O,P[16]=i):i=P[16],P[17]!==E||P[18]!==i?(a=(0,h.jsx)(S.A,{size:"small",label:"Compared label",helperText:"After the change: vs last week.",value:E,onChange:i}),P[17]=E,P[18]=i,P[19]=a):a=P[19];let I=O.caption??"";P[20]!==_||P[21]!==O?(s=e=>_({...O,caption:z(e.target.value)}),P[20]=_,P[21]=O,P[22]=s):s=P[22],P[23]!==I||P[24]!==s?(d=(0,h.jsx)(S.A,{size:"small",label:"Caption",helperText:"When there is nothing to compare with.",value:I,onChange:s}),P[23]=I,P[24]=s,P[25]=d):d=P[25];let k=O.subtitle??"";P[26]!==_||P[27]!==O?(c=e=>_({...O,subtitle:z(e.target.value)}),P[26]=_,P[27]=O,P[28]=c):c=P[28],P[29]!==k||P[30]!==c?(u=(0,h.jsx)(S.A,{size:"small",label:"Subtitle",helperText:"Under the title. {{series}}, {{series|%}}.",value:k,onChange:c}),P[29]=k,P[30]=c,P[31]=u):u=P[31];let W=O.detail??"";P[32]!==_||P[33]!==O?(f=e=>_({...O,detail:z(e.target.value)}),P[32]=_,P[33]=O,P[34]=f):f=P[34],P[35]!==W||P[36]!==f?(m=(0,h.jsx)(S.A,{size:"small",label:"Detail",helperText:"A box under the figure, as the subtitle.",value:W,onChange:f}),P[35]=W,P[36]=f,P[37]=m):m=P[37];let L=O.changeStyle??"signed";P[38]!==_||P[39]!==O?(x=e=>_({...O,changeStyle:"size"===e.target.value?"size":void 0}),P[38]=_,P[39]=O,P[40]=x):x=P[40],P[41]===Symbol.for("react.memo_cache_sentinel")?(v=(0,h.jsx)(w.A,{value:"signed",children:"↑ +0.7%"}),b=(0,h.jsx)(w.A,{value:"size",children:"↑ 0.7%"}),P[41]=v,P[42]=b):(v=P[41],b=P[42]),P[43]!==L||P[44]!==x?(C=(0,h.jsxs)(S.A,{select:!0,size:"small",label:"Change reads",value:L,onChange:x,children:[v,b]}),P[43]=L,P[44]=x,P[45]=C):C=P[45];let N=!!O.lowerIsBetter;return P[46]!==_||P[47]!==O?($=e=>_({...O,lowerIsBetter:e.target.checked||void 0}),P[46]=_,P[47]=O,P[48]=$):$=P[48],P[49]!==N||P[50]!==$?(y=(0,h.jsx)(j.A,{control:(0,h.jsx)(A.A,{checked:N,onChange:$}),label:"Lower is better"}),P[49]=N,P[50]=$,P[51]=y):y=P[51],P[52]!==d||P[53]!==u||P[54]!==m||P[55]!==C||P[56]!==y||P[57]!==r||P[58]!==a?(F=(0,h.jsx)(g.OptionsEditorColumn,{children:(0,h.jsxs)(g.OptionsEditorGroup,{title:"Figure",children:[r,a,d,u,m,C,y]})}),P[52]=d,P[53]=u,P[54]=m,P[55]=C,P[56]=y,P[57]=r,P[58]=a,P[59]=F):F=P[59],P[60]!==F||P[61]!==o?(M=(0,h.jsxs)(g.OptionsEditorGrid,{children:[o,F]}),P[60]=F,P[61]=o,P[62]=M):M=P[62],M}let y={PanelComponent:C,panelOptionsEditorComponents:[{label:"Settings",content:$}],supportedQueryTypes:["TimeSeriesQuery"],createInitialOptions:()=>({})}}}]);
|