@perses-dev/pie-chart-plugin 0.8.0 → 0.8.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/{693.dd90febc.js → 693.bc1093ac.js} +1 -1
- package/__mf/js/{PieChart.0b41af27.js → PieChart.a1d90662.js} +2 -2
- package/__mf/js/async/{503.0a6ecbad.js → 503.28e7e4f1.js} +1 -1
- package/__mf/js/async/__federation_expose_PieChart.869001bb.js +1 -0
- package/__mf/js/{main.18852314.js → main.d6c64ff1.js} +1 -1
- package/lib/PieChartBase.d.ts.map +1 -1
- package/lib/PieChartBase.js +1 -2
- package/lib/PieChartBase.js.map +1 -1
- package/lib/cjs/PieChartBase.js +1 -2
- package/mf-manifest.json +6 -6
- package/mf-stats.json +6 -6
- package/package.json +9 -1
- package/__mf/js/async/__federation_expose_PieChart.0efb7a4c.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkPieChart=self.webpackChunkPieChart||[]).push([["703"],{37931:function(e,t,l){l.r(t),l.d(t,{PieChart:()=>$});var n=l(14046);let r={unit:"decimal",shortValues:!0},i="desc";var a=l(24246),o=l(15409),s=l.n(o),u=l(58891),d=l(75586),h=l(72629),c=l(74664),m=l(48565),g=l(94776),p=l(36372),v=l(8193),f=l(54538),x=l(83915);let C=new x.Z({hue:{min:20,max:360}}),y=new x.Z({hue:{min:0,max:20}}),w={};var S=l(36232),j=l(85731),b=l(65201),O=l(99635),P=l(23709),E=l(67745),N=l(50378);function T(e){let{width:t,height:l,data:n}=e,r=(0,h.useChartsTheme)(),i={title:{text:"Referer of a Website",subtext:"Fake Data",left:"center"},tooltip:{trigger:"item",formatter:"{b} : {c} ({d}%)"},axisLabel:{overflow:"truncate",width:t/3},series:[{type:"pie",radius:"55%",label:!1,center:["40%","50%"],data:n,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],itemStyle:{borderRadius:2,color:r.echartsTheme[0]}};return(0,a.jsx)(p.Z,{style:{width:t,height:l},sx:{overflow:"auto"},children:(0,a.jsx)(h.EChart,{sx:{minHeight:l,height:n?16*n.length:"100%"},option:i,theme:r.echartsTheme})})}(0,S.D)([j.N,b.N,O.N,P.N,E.N,N.N]);let $={PanelComponent:function(e){let{spec:{calculation:t,sort:l,mode:r},contentDimensions:o,queryResults:d}=e,c=(0,h.useChartsTheme)(),m=(0,g.Z)(),x=c.container.padding.default,S=(0,h.useId)("time-series-panel"),j=c.echartsTheme.color,{pieChartData:b,legendItems:O}=(0,f.useMemo)(()=>{let e=n.c7[t],a=[],o=[];for(let t=0;t<d.length;t++){let l=d[t],n=0;for(let t of(null==l?void 0:l.data.series)??[]){let l=function(e){let{categoricalPalette:t,muiPrimaryColor:l,seriesName:n}=e;return function(e,t){var l;return function(e,t){let l=`${e}_____${t}`,n=w[l];return n||(n=function(e,t){let[l,n,r]=t?y.hsl(e):C.hsl(e),i=`${(100*n).toFixed(0)}%`,a=`${(100*r).toFixed(0)}%`;return`hsla(${l.toFixed(2)},${i},${a},0.9)`}(e,t),w[l]=n),n}(l=e,l.toLowerCase().includes("error"))??t}(n,Array.isArray(t)&&t[0]?t[0]:l)}({categoricalPalette:j,muiPrimaryColor:m.palette.primary.main,seriesName:t.name}),r={value:e(t.values)??null,name:t.formattedName??"",itemStyle:{color:l}};a.push(r);let i=S+t.name+n;o.push({id:i,label:r.name,color:l}),n++}}let s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return"asc"===t?e.sort((e,t)=>null===e.value?1:null===t.value?-1:e.value===t.value?0:e.value<t.value?1:-1):e.sort((e,t)=>null===e.value?-1:null===t.value?1:e.value===t.value?0:e.value<t.value?-1:1)}(a,l);return"percentage"===r?{pieChartData:function(e){let t=e.reduce((e,t)=>{let{value:l}=t;return e+(l??0)},0);return e.map(e=>{let l=(e.value??0)/t*100;return{...e,value:l}})}(s),legendItems:o}:{pieChartData:s,legendItems:o}},[t,l,r,d,j,m.palette.primary.main,S]),P=c.container.padding.default,E=o?{width:o.width-2*P,height:o.height-2*P}:void 0,N=(0,f.useMemo)(()=>e.spec.legend&&(0,u.validateLegendSpec)(e.spec.legend)?s()({},v.zx,e.spec.legend):void 0,[e.spec.legend]),[$,L]=(0,f.useState)("ALL"),[M,Z]=(0,f.useState)(),k=(0,f.useRef)(null);return void 0===o?null:(0,a.jsx)(p.Z,{sx:{padding:`${x}px`},children:(0,a.jsx)(h.ContentWithLegend,{width:(null==E?void 0:E.width)??400,height:(null==E?void 0:E.height)??1e3,minChildrenHeight:50,legendSize:null==N?void 0:N.size,legendProps:N&&{options:N,data:O,selectedItems:$,onSelectedItemsChange:L,tableProps:{columns:[],sorting:M,onSortingChange:Z},onItemMouseOver:(e,t)=>{var l;let{id:n}=t;null===(l=k.current)||void 0===l||l.highlightSeries({name:n})},onItemMouseOut:()=>{var e;null===(e=k.current)||void 0===e||e.clearHighlightedSeries()}},children:e=>{let{height:t,width:l}=e;return(0,a.jsx)(p.Z,{style:{height:t,width:l},children:(0,a.jsx)(T,{data:b,width:o.width-2*x,height:o.height-2*x})})}})})},panelOptionsEditorComponents:[{label:"Settings",content:function(e){let{onChange:t,value:l}=e,n=s()({},r,l.format);return(0,a.jsxs)(h.OptionsEditorGrid,{children:[(0,a.jsxs)(h.OptionsEditorColumn,{children:[(0,a.jsx)(u.LegendOptionsEditor,{value:l.legend,onChange:e=>{t((0,d.Uy)(l,t=>{t.legend=e}))}}),(0,a.jsxs)(h.OptionsEditorGroup,{title:"Misc",children:[(0,a.jsx)(h.FormatControls,{value:n,onChange:e=>{t((0,d.Uy)(l,t=>{t.format=e}))},disabled:"percentage"===l.mode}),(0,a.jsx)(u.CalculationSelector,{value:l.calculation,onChange:e=>{t((0,d.Uy)(l,t=>{t.calculation=e}))}}),(0,a.jsx)(h.SortSelector,{value:l.sort,onChange:e=>{t((0,d.Uy)(l,t=>{t.sort=e}))}}),(0,a.jsx)(h.ModeSelector,{value:l.mode,onChange:e=>{t((0,d.Uy)(l,t=>{t.mode=e}))},disablePercentageMode:(0,c.PX)(n)})]})]}),(0,a.jsx)(h.OptionsEditorColumn,{children:(0,a.jsx)(h.OptionsEditorGroup,{title:"Reset Settings",children:(0,a.jsx)(m.Z,{variant:"outlined",color:"secondary",onClick:()=>{t((0,d.Uy)(l,e=>{e.legend=void 0}))},children:"Reset To Defaults"})})})]})}}],supportedQueryTypes:["TimeSeriesQuery"],createInitialOptions:function(){return{calculation:n.K2,format:r,radius:50,sort:i,mode:"value"}}}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={5311:function(e,r,t){Promise.all([t.e("677"),t.e("179"),t.e("620")]).then(t.bind(t,29161))}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var a=r[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}t.m=e,t.c=r,t.federation||(t.federation={chunkMatcher:function(e){return!/^(1(57|61|79)|242|263|494|677|759|946)$/.test(e)}}),t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((r,n)=>(t.f[n](e,r),r),[])),t.u=e=>"__mf/js/async/"+("118"===e?"lib-router":e)+"."+({105:"7a85ee04",118:"d29f3ef0",173:"ee70b493",214:"df2e7807",224:"dbeed4db",238:"5287310b",292:"f278784e",331:"067ac3da",470:"be19e17e",503:"
|
|
1
|
+
(()=>{var e={5311:function(e,r,t){Promise.all([t.e("677"),t.e("179"),t.e("620")]).then(t.bind(t,29161))}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var a=r[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}t.m=e,t.c=r,t.federation||(t.federation={chunkMatcher:function(e){return!/^(1(57|61|79)|242|263|494|677|759|946)$/.test(e)}}),t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((r,n)=>(t.f[n](e,r),r),[])),t.u=e=>"__mf/js/async/"+("118"===e?"lib-router":e)+"."+({105:"7a85ee04",118:"d29f3ef0",173:"ee70b493",214:"df2e7807",224:"dbeed4db",238:"5287310b",292:"f278784e",331:"067ac3da",470:"be19e17e",503:"28e7e4f1",530:"f071fc6b",620:"9a73a66b",651:"a1042e18",656:"5efccb26",694:"b227b636",738:"4ac98841",740:"b86dfa00",75:"905151a5",770:"93415255",845:"1b2e72ed",925:"92a059f1",960:"208437e1",964:"6df60c3e",973:"74031340",981:"3ecbf5ea"})[e]+".js",t.miniCssF=e=>"__mf/css/async/"+e+"."+({263:"80005a4a",759:"80005a4a"})[e]+".css",t.h=()=>"4937d9d32f60b1c1",(()=>{t.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})()})(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={},r="PieChart:";t.l=function(n,o,a,i){if(e[n]){e[n].push(o);return}if(void 0!==a)for(var s,l,c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==r+a){s=u;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,t.nc&&s.setAttribute("nonce",t.nc),s.setAttribute("data-webpack",r+a),s.src=n),e[n]=[o];var f=function(r,t){s.onerror=s.onload=null,clearTimeout(h);var o=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach(function(e){return e(t)}),r)return r(t)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),l&&document.head.appendChild(s)}})(),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t.nc=void 0,(()=>{var e=[];t.O=(r,n,o,a)=>{if(n){a=a||0;for(var i=e.length;i>0&&e[i-1][2]>a;i--)e[i]=e[i-1];e[i]=[n,o,a];return}for(var s=1/0,i=0;i<e.length;i++){for(var[n,o,a]=e[i],l=!0,c=0;c<n.length;c++)(!1&a||s>=a)&&Object.keys(t.O).every(e=>t.O[e](n[c]))?n.splice(c--,1):(l=!1,a<s&&(s=a));if(l){e.splice(i--,1);var d=o();void 0!==d&&(r=d)}}return r}})(),t.p="/plugins/PieChart/",t.rv=()=>"1.2.8",t.j="909",t.S={},t.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@emotion/react",version:"11.14.0",factory:()=>Promise.all([t.e("960"),t.e("677"),t.e("651")]).then(()=>()=>t(96434)),eager:0,singleton:1,requiredVersion:"^11.11.3"},{name:"@emotion/styled",version:"11.14.0",factory:()=>Promise.all([t.e("677"),t.e("157"),t.e("694")]).then(()=>()=>t(51958)),eager:0,singleton:1},{name:"@hookform/resolvers",version:"3.10.0",factory:()=>Promise.all([t.e("292"),t.e("677"),t.e("214")]).then(()=>()=>t(81228)),eager:0,singleton:1},{name:"@perses-dev/components",version:"0.51.0-rc.1",factory:()=>Promise.all([t.e("238"),t.e("224"),t.e("292"),t.e("470"),t.e("925"),t.e("105"),t.e("530"),t.e("973"),t.e("331"),t.e("677"),t.e("179"),t.e("161"),t.e("157"),t.e("946"),t.e("759")]).then(()=>()=>t(25451)),eager:0,singleton:1},{name:"@perses-dev/plugin-system",version:"0.51.0-rc.1",factory:()=>Promise.all([t.e("118"),t.e("292"),t.e("925"),t.e("973"),t.e("845"),t.e("677"),t.e("179"),t.e("161"),t.e("157"),t.e("946"),t.e("242"),t.e("656")]).then(()=>()=>t(3090)),eager:0,singleton:1},{name:"date-fns",version:"4.1.0",factory:()=>Promise.all([t.e("238"),t.e("224"),t.e("75")]).then(()=>()=>t(99657)),eager:0,singleton:1},{name:"echarts",version:"5.5.0",factory:()=>Promise.all([t.e("470"),t.e("105"),t.e("503")]).then(()=>()=>t(28919)),eager:0,singleton:1},{name:"lodash",version:"4.17.21",factory:()=>t.e("981").then(()=>()=>t(98784)),eager:0,singleton:1},{name:"react-dom",version:"18.3.1",factory:()=>Promise.all([t.e("173"),t.e("677")]).then(()=>()=>t(31542)),eager:0,singleton:1,requiredVersion:"18.2.0"},{name:"react",version:"18.3.1",factory:()=>t.e("964").then(()=>()=>t(27378)),eager:0,singleton:1,requiredVersion:"18.2.0"}]},uniqueName:"PieChart"},t.I=t.I||function(){throw Error("should have __webpack_require__.I")},t.consumesLoadingData={chunkMapping:{161:["4665","20461"],494:["57871"],946:["45913"],179:["6085"],242:["20370","74614","30156","57751","55922","71141","84275"],157:["72116"],677:["54538"]},moduleIdToConsumeDataMapping:{45913:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"^11.3.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("770").then(()=>()=>t(51958))},57751:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>()=>t(3090)},71141:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"0.51.0-rc.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>()=>t(3090)},30156:{shareScope:"default",shareKey:"echarts",import:"echarts",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("470"),t.e("105"),t.e("503")]).then(()=>()=>t(28919))},6085:{shareScope:"default",shareKey:"react-dom",import:"react-dom",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("173").then(()=>()=>t(31542))},72116:{shareScope:"default",shareKey:"@emotion/react",import:"@emotion/react",requiredVersion:"^11.11.3",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("960").then(()=>()=>t(96434))},57871:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^3.0.0 || ^4.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("238"),t.e("75")]).then(()=>()=>t(99657))},20370:{shareScope:"default",shareKey:"@perses-dev/components",import:"@perses-dev/components",requiredVersion:"0.51.0-rc.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("238"),t.e("224"),t.e("470"),t.e("105"),t.e("530"),t.e("331"),t.e("263")]).then(()=>()=>t(25451))},74614:{shareScope:"default",shareKey:"lodash",import:"lodash",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("981").then(()=>()=>t(98784))},4665:{shareScope:"default",shareKey:"date-fns-tz",import:"date-fns-tz",requiredVersion:"^3.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("224"),t.e("740"),t.e("494")]).then(()=>()=>t(48872))},54538:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("964").then(()=>()=>t(27378))},55922:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("770").then(()=>()=>t(51958))},84275:{shareScope:"default",shareKey:"@hookform/resolvers",import:"@hookform/resolvers",requiredVersion:"^2.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("738").then(()=>()=>t(81228))},20461:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^4.1.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("238"),t.e("224"),t.e("75")]).then(()=>()=>t(99657))}},initialConsumes:[]},t.f.consumes=t.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")},(()=>{if("undefined"!=typeof document){var e=function(e,r,n,o,a){var i=document.createElement("link");return i.rel="stylesheet",i.type="text/css",t.nc&&(i.nonce=t.nc),i.onerror=i.onload=function(t){if(i.onerror=i.onload=null,"load"===t.type)o();else{var n=t&&("load"===t.type?"missing":t.type),s=t&&t.target&&t.target.href||r,l=Error("Loading CSS chunk "+e+" failed.\\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=n,l.request=s,i.parentNode&&i.parentNode.removeChild(i),a(l)}},i.href=r,n?n.parentNode.insertBefore(i,n.nextSibling):document.head.appendChild(i),i},r=function(e,r){for(var t=document.getElementsByTagName("link"),n=0;n<t.length;n++){var o=t[n],a=o.getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(a===e||a===r))return o}for(var i=document.getElementsByTagName("style"),n=0;n<i.length;n++){var o=i[n],a=o.getAttribute("data-href");if(a===e||a===r)return o}},n={909:0};t.f.miniCss=function(o,a){if(n[o])a.push(n[o]);else if(0!==n[o]&&({263:1,759:1})[o])a.push(n[o]=new Promise(function(n,a){var i=t.miniCssF(o),s=t.p+i;if(r(i,s))return n();e(o,s,null,n,a)}).then(function(){n[o]=0},function(e){throw delete n[o],e}))}}})(),(()=>{var e={909:0};t.f.j=function(r,n){var o=t.o(e,r)?e[r]:void 0;if(0!==o){if(o)n.push(o[2]);else if(/^(1(57|61|79)|242|263|494|677|759|946)$/.test(r))e[r]=0;else{var a=new Promise((t,n)=>o=e[r]=[t,n]);n.push(o[2]=a);var i=t.p+t.u(r),s=Error();t.l(i,function(n){if(t.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+r+" failed.\n("+a+": "+i+")",s.name="ChunkLoadError",s.type=a,s.request=i,o[1](s)}},"chunk-"+r,r)}}},t.O.j=r=>0===e[r];var r=(r,n)=>{var o,a,[i,s,l]=n,c=0;if(i.some(r=>0!==e[r])){for(o in s)t.o(s,o)&&(t.m[o]=s[o]);if(l)var d=l(t)}for(r&&r(n);c<i.length;c++)a=i[c],t.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return t.O(d)},n=self.webpackChunkPieChart=self.webpackChunkPieChart||[];n.forEach(r.bind(null,0)),n.push=r.bind(null,n.push.bind(n))})(),t.ruid="bundler=rspack@1.2.8",t.O(void 0,["693"],function(){return t(18955)});var n=t.O(void 0,["693"],function(){return t(5311)});n=t.O(n)})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PieChartBase.d.ts","sourceRoot":"","sources":["../../src/PieChartBase.tsx"],"names":[],"mappings":"AAeA,OAAO,EAKL,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAOrC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"PieChartBase.d.ts","sourceRoot":"","sources":["../../src/PieChartBase.tsx"],"names":[],"mappings":"AAeA,OAAO,EAKL,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAOrC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CA0DnE"}
|
package/lib/PieChartBase.js
CHANGED
|
@@ -38,7 +38,7 @@ export function PieChartBase(props) {
|
|
|
38
38
|
},
|
|
39
39
|
tooltip: {
|
|
40
40
|
trigger: 'item',
|
|
41
|
-
formatter: '{
|
|
41
|
+
formatter: '{b} : {c} ({d}%)'
|
|
42
42
|
},
|
|
43
43
|
axisLabel: {
|
|
44
44
|
overflow: 'truncate',
|
|
@@ -46,7 +46,6 @@ export function PieChartBase(props) {
|
|
|
46
46
|
},
|
|
47
47
|
series: [
|
|
48
48
|
{
|
|
49
|
-
name: 'Access From',
|
|
50
49
|
type: 'pie',
|
|
51
50
|
radius: '55%',
|
|
52
51
|
label: false,
|
package/lib/PieChartBase.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/PieChartBase.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { use } from 'echarts/core';\nimport { PieChart as EChartsPieChart } from 'echarts/charts';\nimport {\n GridComponent,\n DatasetComponent,\n TitleComponent,\n TooltipComponent,\n LegendComponentOption,\n} from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { Box } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { EChart, useChartsTheme } from '@perses-dev/components';\n\nuse([EChartsPieChart, GridComponent, DatasetComponent, TitleComponent, TooltipComponent, CanvasRenderer]);\n\nconst PIE_WIN_WIDTH = 12;\nconst PIE_GAP = 4;\nexport interface PieChartData {\n name: string;\n value: number | null;\n}\n\nexport interface PieChartBaseProps {\n width: number;\n height: number;\n data: PieChartData[] | null;\n legend?: LegendComponentOption;\n}\n\nexport function PieChartBase(props: PieChartBaseProps): ReactElement {\n const { width, height, data } = props;\n const chartsTheme = useChartsTheme();\n\n const option = {\n title: {\n text: 'Referer of a Website',\n subtext: 'Fake Data',\n left: 'center',\n },\n tooltip: {\n trigger: 'item',\n formatter: '{
|
|
1
|
+
{"version":3,"sources":["../../src/PieChartBase.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { use } from 'echarts/core';\nimport { PieChart as EChartsPieChart } from 'echarts/charts';\nimport {\n GridComponent,\n DatasetComponent,\n TitleComponent,\n TooltipComponent,\n LegendComponentOption,\n} from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { Box } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { EChart, useChartsTheme } from '@perses-dev/components';\n\nuse([EChartsPieChart, GridComponent, DatasetComponent, TitleComponent, TooltipComponent, CanvasRenderer]);\n\nconst PIE_WIN_WIDTH = 12;\nconst PIE_GAP = 4;\nexport interface PieChartData {\n name: string;\n value: number | null;\n}\n\nexport interface PieChartBaseProps {\n width: number;\n height: number;\n data: PieChartData[] | null;\n legend?: LegendComponentOption;\n}\n\nexport function PieChartBase(props: PieChartBaseProps): ReactElement {\n const { width, height, data } = props;\n const chartsTheme = useChartsTheme();\n\n const option = {\n title: {\n text: 'Referer of a Website',\n subtext: 'Fake Data',\n left: 'center',\n },\n tooltip: {\n trigger: 'item',\n formatter: '{b} : {c} ({d}%)',\n },\n axisLabel: {\n overflow: 'truncate',\n width: width / 3,\n },\n series: [\n {\n type: 'pie',\n radius: '55%',\n label: false,\n center: ['40%', '50%'],\n data: data,\n emphasis: {\n itemStyle: {\n shadowBlur: 10,\n shadowOffsetX: 0,\n shadowColor: 'rgba(0, 0, 0, 0.5)',\n },\n },\n },\n ],\n itemStyle: {\n borderRadius: 2,\n color: chartsTheme.echartsTheme[0],\n },\n };\n\n return (\n <Box\n style={{\n width: width,\n height: height,\n }}\n sx={{ overflow: 'auto' }}\n >\n <EChart\n sx={{\n minHeight: height,\n height: data ? data.length * (PIE_WIN_WIDTH + PIE_GAP) : '100%',\n }}\n option={option}\n theme={chartsTheme.echartsTheme}\n />\n </Box>\n );\n}\n"],"names":["use","PieChart","EChartsPieChart","GridComponent","DatasetComponent","TitleComponent","TooltipComponent","CanvasRenderer","Box","EChart","useChartsTheme","PIE_WIN_WIDTH","PIE_GAP","PieChartBase","props","width","height","data","chartsTheme","option","title","text","subtext","left","tooltip","trigger","formatter","axisLabel","overflow","series","type","radius","label","center","emphasis","itemStyle","shadowBlur","shadowOffsetX","shadowColor","borderRadius","color","echartsTheme","style","sx","minHeight","length","theme"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAQ,eAAe;AACnC,SAASC,YAAYC,eAAe,QAAQ,iBAAiB;AAC7D,SACEC,aAAa,EACbC,gBAAgB,EAChBC,cAAc,EACdC,gBAAgB,QAEX,qBAAqB;AAC5B,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,GAAG,QAAQ,gBAAgB;AAEpC,SAASC,MAAM,EAAEC,cAAc,QAAQ,yBAAyB;AAEhEV,IAAI;IAACE;IAAiBC;IAAeC;IAAkBC;IAAgBC;IAAkBC;CAAe;AAExG,MAAMI,gBAAgB;AACtB,MAAMC,UAAU;AAahB,OAAO,SAASC,aAAaC,KAAwB;IACnD,MAAM,EAAEC,KAAK,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAGH;IAChC,MAAMI,cAAcR;IAEpB,MAAMS,SAAS;QACbC,OAAO;YACLC,MAAM;YACNC,SAAS;YACTC,MAAM;QACR;QACAC,SAAS;YACPC,SAAS;YACTC,WAAW;QACb;QACAC,WAAW;YACTC,UAAU;YACVb,OAAOA,QAAQ;QACjB;QACAc,QAAQ;YACN;gBACEC,MAAM;gBACNC,QAAQ;gBACRC,OAAO;gBACPC,QAAQ;oBAAC;oBAAO;iBAAM;gBACtBhB,MAAMA;gBACNiB,UAAU;oBACRC,WAAW;wBACTC,YAAY;wBACZC,eAAe;wBACfC,aAAa;oBACf;gBACF;YACF;SACD;QACDH,WAAW;YACTI,cAAc;YACdC,OAAOtB,YAAYuB,YAAY,CAAC,EAAE;QACpC;IACF;IAEA,qBACE,KAACjC;QACCkC,OAAO;YACL3B,OAAOA;YACPC,QAAQA;QACV;QACA2B,IAAI;YAAEf,UAAU;QAAO;kBAEvB,cAAA,KAACnB;YACCkC,IAAI;gBACFC,WAAW5B;gBACXA,QAAQC,OAAOA,KAAK4B,MAAM,GAAIlC,CAAAA,gBAAgBC,OAAM,IAAK;YAC3D;YACAO,QAAQA;YACR2B,OAAO5B,YAAYuB,YAAY;;;AAIvC"}
|
package/lib/cjs/PieChartBase.js
CHANGED
|
@@ -48,7 +48,7 @@ function PieChartBase(props) {
|
|
|
48
48
|
},
|
|
49
49
|
tooltip: {
|
|
50
50
|
trigger: 'item',
|
|
51
|
-
formatter: '{
|
|
51
|
+
formatter: '{b} : {c} ({d}%)'
|
|
52
52
|
},
|
|
53
53
|
axisLabel: {
|
|
54
54
|
overflow: 'truncate',
|
|
@@ -56,7 +56,6 @@ function PieChartBase(props) {
|
|
|
56
56
|
},
|
|
57
57
|
series: [
|
|
58
58
|
{
|
|
59
|
-
name: 'Access From',
|
|
60
59
|
type: 'pie',
|
|
61
60
|
radius: '55%',
|
|
62
61
|
label: false,
|
package/mf-manifest.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "PieChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.8.
|
|
8
|
+
"buildVersion": "0.8.1",
|
|
9
9
|
"buildName": "@perses-dev/pie-chart-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/PieChart.
|
|
12
|
+
"name": "__mf/js/PieChart.a1d90662.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"__mf/js/async/530.f071fc6b.js",
|
|
140
140
|
"__mf/js/async/331.067ac3da.js",
|
|
141
141
|
"__mf/js/async/738.4ac98841.js",
|
|
142
|
-
"__mf/js/async/503.
|
|
142
|
+
"__mf/js/async/503.28e7e4f1.js",
|
|
143
143
|
"__mf/js/async/981.3ecbf5ea.js"
|
|
144
144
|
],
|
|
145
145
|
"sync": [
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
"js": {
|
|
184
184
|
"async": [],
|
|
185
185
|
"sync": [
|
|
186
|
-
"__mf/js/async/503.
|
|
186
|
+
"__mf/js/async/503.28e7e4f1.js"
|
|
187
187
|
]
|
|
188
188
|
},
|
|
189
189
|
"css": {
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
"__mf/js/async/973.74031340.js",
|
|
287
287
|
"__mf/js/async/331.067ac3da.js",
|
|
288
288
|
"__mf/js/async/707.55fda5d1.js",
|
|
289
|
-
"__mf/js/async/__federation_expose_PieChart.
|
|
289
|
+
"__mf/js/async/__federation_expose_PieChart.869001bb.js"
|
|
290
290
|
],
|
|
291
291
|
"async": [
|
|
292
292
|
"__mf/js/async/964.6df60c3e.js",
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
"__mf/js/async/738.4ac98841.js",
|
|
305
305
|
"__mf/js/async/173.ee70b493.js",
|
|
306
306
|
"__mf/js/async/75.905151a5.js",
|
|
307
|
-
"__mf/js/async/503.
|
|
307
|
+
"__mf/js/async/503.28e7e4f1.js",
|
|
308
308
|
"__mf/js/async/740.b86dfa00.js",
|
|
309
309
|
"__mf/js/async/981.3ecbf5ea.js"
|
|
310
310
|
]
|
package/mf-stats.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "PieChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.8.
|
|
8
|
+
"buildVersion": "0.8.1",
|
|
9
9
|
"buildName": "@perses-dev/pie-chart-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/PieChart.
|
|
12
|
+
"name": "__mf/js/PieChart.a1d90662.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"__mf/js/async/530.f071fc6b.js",
|
|
156
156
|
"__mf/js/async/331.067ac3da.js",
|
|
157
157
|
"__mf/js/async/738.4ac98841.js",
|
|
158
|
-
"__mf/js/async/503.
|
|
158
|
+
"__mf/js/async/503.28e7e4f1.js",
|
|
159
159
|
"__mf/js/async/981.3ecbf5ea.js"
|
|
160
160
|
],
|
|
161
161
|
"sync": [
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
"js": {
|
|
208
208
|
"async": [],
|
|
209
209
|
"sync": [
|
|
210
|
-
"__mf/js/async/503.
|
|
210
|
+
"__mf/js/async/503.28e7e4f1.js"
|
|
211
211
|
]
|
|
212
212
|
},
|
|
213
213
|
"css": {
|
|
@@ -332,7 +332,7 @@
|
|
|
332
332
|
"__mf/js/async/973.74031340.js",
|
|
333
333
|
"__mf/js/async/331.067ac3da.js",
|
|
334
334
|
"__mf/js/async/707.55fda5d1.js",
|
|
335
|
-
"__mf/js/async/__federation_expose_PieChart.
|
|
335
|
+
"__mf/js/async/__federation_expose_PieChart.869001bb.js"
|
|
336
336
|
],
|
|
337
337
|
"async": [
|
|
338
338
|
"__mf/js/async/964.6df60c3e.js",
|
|
@@ -350,7 +350,7 @@
|
|
|
350
350
|
"__mf/js/async/738.4ac98841.js",
|
|
351
351
|
"__mf/js/async/173.ee70b493.js",
|
|
352
352
|
"__mf/js/async/75.905151a5.js",
|
|
353
|
-
"__mf/js/async/503.
|
|
353
|
+
"__mf/js/async/503.28e7e4f1.js",
|
|
354
354
|
"__mf/js/async/740.b86dfa00.js",
|
|
355
355
|
"__mf/js/async/981.3ecbf5ea.js"
|
|
356
356
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/pie-chart-plugin",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
|
+
"homepage": "https://github.com/perses/plugins/blob/main/README.md",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/perses/plugins.git"
|
|
8
|
+
},
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/perses/plugins/issues"
|
|
11
|
+
},
|
|
4
12
|
"scripts": {
|
|
5
13
|
"dev": "rsbuild dev",
|
|
6
14
|
"build": "npm run build-mf && concurrently \"npm:build:*\"",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkPieChart=self.webpackChunkPieChart||[]).push([["703"],{37931:function(e,t,l){l.r(t),l.d(t,{PieChart:()=>$});var n=l(14046);let r={unit:"decimal",shortValues:!0},a="desc";var i=l(24246),o=l(15409),s=l.n(o),u=l(58891),d=l(75586),h=l(72629),c=l(74664),m=l(48565),g=l(94776),p=l(36372),v=l(8193),f=l(54538),x=l(83915);let C=new x.Z({hue:{min:20,max:360}}),y=new x.Z({hue:{min:0,max:20}}),w={};var S=l(36232),j=l(85731),b=l(65201),O=l(99635),P=l(23709),E=l(67745),N=l(50378);function T(e){let{width:t,height:l,data:n}=e,r=(0,h.useChartsTheme)(),a={title:{text:"Referer of a Website",subtext:"Fake Data",left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},axisLabel:{overflow:"truncate",width:t/3},series:[{name:"Access From",type:"pie",radius:"55%",label:!1,center:["40%","50%"],data:n,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],itemStyle:{borderRadius:2,color:r.echartsTheme[0]}};return(0,i.jsx)(p.Z,{style:{width:t,height:l},sx:{overflow:"auto"},children:(0,i.jsx)(h.EChart,{sx:{minHeight:l,height:n?16*n.length:"100%"},option:a,theme:r.echartsTheme})})}(0,S.D)([j.N,b.N,O.N,P.N,E.N,N.N]);let $={PanelComponent:function(e){let{spec:{calculation:t,sort:l,mode:r},contentDimensions:o,queryResults:d}=e,c=(0,h.useChartsTheme)(),m=(0,g.Z)(),x=c.container.padding.default,S=(0,h.useId)("time-series-panel"),j=c.echartsTheme.color,{pieChartData:b,legendItems:O}=(0,f.useMemo)(()=>{let e=n.c7[t],i=[],o=[];for(let t=0;t<d.length;t++){let l=d[t],n=0;for(let t of(null==l?void 0:l.data.series)??[]){let l=function(e){let{categoricalPalette:t,muiPrimaryColor:l,seriesName:n}=e;return function(e,t){var l;return function(e,t){let l=`${e}_____${t}`,n=w[l];return n||(n=function(e,t){let[l,n,r]=t?y.hsl(e):C.hsl(e),a=`${(100*n).toFixed(0)}%`,i=`${(100*r).toFixed(0)}%`;return`hsla(${l.toFixed(2)},${a},${i},0.9)`}(e,t),w[l]=n),n}(l=e,l.toLowerCase().includes("error"))??t}(n,Array.isArray(t)&&t[0]?t[0]:l)}({categoricalPalette:j,muiPrimaryColor:m.palette.primary.main,seriesName:t.name}),r={value:e(t.values)??null,name:t.formattedName??"",itemStyle:{color:l}};i.push(r);let a=S+t.name+n;o.push({id:a,label:r.name,color:l}),n++}}let s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return"asc"===t?e.sort((e,t)=>null===e.value?1:null===t.value?-1:e.value===t.value?0:e.value<t.value?1:-1):e.sort((e,t)=>null===e.value?-1:null===t.value?1:e.value===t.value?0:e.value<t.value?-1:1)}(i,l);return"percentage"===r?{pieChartData:function(e){let t=e.reduce((e,t)=>{let{value:l}=t;return e+(l??0)},0);return e.map(e=>{let l=(e.value??0)/t*100;return{...e,value:l}})}(s),legendItems:o}:{pieChartData:s,legendItems:o}},[t,l,r,d,j,m.palette.primary.main,S]),P=c.container.padding.default,E=o?{width:o.width-2*P,height:o.height-2*P}:void 0,N=(0,f.useMemo)(()=>e.spec.legend&&(0,u.validateLegendSpec)(e.spec.legend)?s()({},v.zx,e.spec.legend):void 0,[e.spec.legend]),[$,L]=(0,f.useState)("ALL"),[M,Z]=(0,f.useState)(),k=(0,f.useRef)(null);return void 0===o?null:(0,i.jsx)(p.Z,{sx:{padding:`${x}px`},children:(0,i.jsx)(h.ContentWithLegend,{width:(null==E?void 0:E.width)??400,height:(null==E?void 0:E.height)??1e3,minChildrenHeight:50,legendSize:null==N?void 0:N.size,legendProps:N&&{options:N,data:O,selectedItems:$,onSelectedItemsChange:L,tableProps:{columns:[],sorting:M,onSortingChange:Z},onItemMouseOver:(e,t)=>{var l;let{id:n}=t;null===(l=k.current)||void 0===l||l.highlightSeries({name:n})},onItemMouseOut:()=>{var e;null===(e=k.current)||void 0===e||e.clearHighlightedSeries()}},children:e=>{let{height:t,width:l}=e;return(0,i.jsx)(p.Z,{style:{height:t,width:l},children:(0,i.jsx)(T,{data:b,width:o.width-2*x,height:o.height-2*x})})}})})},panelOptionsEditorComponents:[{label:"Settings",content:function(e){let{onChange:t,value:l}=e,n=s()({},r,l.format);return(0,i.jsxs)(h.OptionsEditorGrid,{children:[(0,i.jsxs)(h.OptionsEditorColumn,{children:[(0,i.jsx)(u.LegendOptionsEditor,{value:l.legend,onChange:e=>{t((0,d.Uy)(l,t=>{t.legend=e}))}}),(0,i.jsxs)(h.OptionsEditorGroup,{title:"Misc",children:[(0,i.jsx)(h.FormatControls,{value:n,onChange:e=>{t((0,d.Uy)(l,t=>{t.format=e}))},disabled:"percentage"===l.mode}),(0,i.jsx)(u.CalculationSelector,{value:l.calculation,onChange:e=>{t((0,d.Uy)(l,t=>{t.calculation=e}))}}),(0,i.jsx)(h.SortSelector,{value:l.sort,onChange:e=>{t((0,d.Uy)(l,t=>{t.sort=e}))}}),(0,i.jsx)(h.ModeSelector,{value:l.mode,onChange:e=>{t((0,d.Uy)(l,t=>{t.mode=e}))},disablePercentageMode:(0,c.PX)(n)})]})]}),(0,i.jsx)(h.OptionsEditorColumn,{children:(0,i.jsx)(h.OptionsEditorGroup,{title:"Reset Settings",children:(0,i.jsx)(m.Z,{variant:"outlined",color:"secondary",onClick:()=>{t((0,d.Uy)(l,e=>{e.legend=void 0}))},children:"Reset To Defaults"})})})]})}}],supportedQueryTypes:["TimeSeriesQuery"],createInitialOptions:function(){return{calculation:n.K2,format:r,radius:50,sort:a,mode:"value"}}}}}]);
|