1(self.webpackChunk=self.webpackChunk||[]).push([[9342],{9694:()=>{!function(t){"use strict";t.fn.visualize=function(e){var i=e.type||"pie";this.each((function(a,n){var h,r=e.width||300,o=e.height||e.width||300,s=t("<canvas width="+r+" height="+o+"></canvas>").html(n.innerHTML),l=getData(n);"pie"===i?h=new Pie(l,r):"bar"===i&&(h=new Bar(l,r,o)),t(n).html(s),h.plot(s[0]),e.legend&&h.legend(n,r)}))};var Chart=function(){};Chart.prototype.legend=function(e,i){var a=t("<div></div>").css("width",i);t.each(this.items,(function(e,i){var n=t("<span></span>").css({background:i.color,width:"10px",height:"10px",display:"inline-block",margin:"0 5px"});a.append(n).append(i.label)})),t(e).append(a)};var Pie=function(t,e){Chart.call(this),this.radius=e/2,this.items=t};Pie.prototype=Object.create(Chart.prototype),Pie.prototype.getTotal=function(){var e=0;return t.each(this.items,(function(t,i){e+=i.data})),e},Pie.prototype.plot=function(t){var e=0,i=this.radius,a=this.radius,n=t.getContext("2d"),h=this.getTotal();n.clearRect(0,0,t.width,t.height);for(var r=0;r<this.items.length;r++){var o=this.items[r];n.fillStyle=o.color,n.beginPath(),n.moveTo(i,a),n.arc(i,a,a,e,e+2*Math.PI*(o.data/h),!1),n.lineTo(i,a),n.fill(),e+=2*Math.PI*(o.data/h)}};var Bar=function(t,e,i){this.items=t,this.width=e,this.height=i};Bar.prototype=Object.create(Chart.prototype),Bar.prototype.getWidth=function(){return this.width/this.items.length},Bar.prototype.getMax=function(){var t=this.items.map((function(t){return t.data}));return Math.max.apply(Math,t)},Bar.prototype.plot=function(t){var e=this.getWidth(),i=this.height,a=this.getMax(),n=t.getContext("2d");n.clearRect(0,0,t.width,t.height);for(var h=0;h<this.items.length;h++){var r=this.items[h],o=r.data/a*i,s=e*h,l=i-o;n.beginPath(),n.rect(s,l,e-1,o),n.fillStyle=r.color,n.fill()}};var randomColor=function(){for(var t="0123456789ABCDEF".split(""),e="#",i=0;i<6;i++)e+=t[Math.round(15*Math.random())];return e},getData=function(e){var i=[];return t.each(t(e).find(".visualize"),(function(e,a){i.push({data:t(a).data("value"),color:t(a).data("color")||randomColor(),label:a.textContent})})),i}}(jQuery)},9342:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>a});i(9694);const a=class PieChart{constructor(t){this.$element=$(t),this.init()}init(){this.$element.visualize({width:230,type:"pie",legend:!1})}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.