CoolFace
Apppublic

harshapitla/stackoverflow

sourceHugging Facemitupdated 9mo agoView on Hugging Face
0likes
892.734ab844.chunk.js2 linesDownload Raw Back to js
1"use strict";(self.webpackChunkreact_template=self.webpackChunkreact_template||[]).push([[892],{15:(e,a,t)=>{t.d(a,{A:()=>n});t(5043);var r=t(579);function n(e){let{title:a,subtitle:t,children:n,actions:i,footer:c}=e;return(0,r.jsxs)("section",{className:"card chart-card",children:[(a||t||i)&&(0,r.jsxs)("div",{className:"chart-card-header",children:[(0,r.jsxs)("div",{children:[a&&(0,r.jsx)("h3",{className:"chart-card-title",children:a}),t&&(0,r.jsx)("p",{className:"chart-card-subtitle",children:t})]}),i&&(0,r.jsx)("div",{className:"chart-card-actions",children:i})]}),(0,r.jsx)("div",{className:"chart-card-body",children:n}),c&&(0,r.jsx)("div",{className:"chart-card-footer",children:c})]})}},4892:(e,a,t)=>{t.r(a),t.d(a,{default:()=>m});var r=t(5043),n=t(95),i=t(379),c=t(1180),l=t(7869),s=t(6102),o=t(6992),d=t(15),u=t(579);const g=["#4f46e5","#22c55e","#f97316","#06b6d4","#a855f7","#84cc16","#facc15","#ec4899","#14b8a6","#fb7185"];function h(e){let{active:a,payload:t}=e;if(a&&t&&t.length){const e=t[0];return(0,u.jsxs)("div",{style:{background:"#ffffff",padding:"10px 14px",borderRadius:6,border:"1px solid #cbd5e1",color:"#0f172a"},children:[(0,u.jsx)("strong",{children:e.name}),(0,u.jsxs)("div",{style:{marginTop:6},children:["Products: ",e.value]}),(0,u.jsxs)("div",{children:["Avg Rating: ",e.payload.avgRating.toFixed(2)]})]})}return null}function m(e){let{rows:a=[]}=e;const t=(0,r.useMemo)(()=>{if(!Array.isArray(a))return[];const e={};return a.forEach(a=>{if(!a.categories)return;const t=function(e){const a=Number(e);return isNaN(a)?null:a}(a.rating_average);(Array.isArray(a.categories)?a.categories:String(a.categories).split(",").map(e=>{return(a=e)?String(a).replace(/^\[+|\]+$/g,"").replace(/^"+|"+$/g,"").replace(/^['']+|['']+$/g,"").replace(/['"]/g,"").trim():"";var a}).filter(Boolean)).forEach(a=>{e[a]||(e[a]={name:a,count:0,ratingSum:0,ratingCount:0}),e[a].count+=1,null!==t&&(e[a].ratingSum+=t,e[a].ratingCount+=1)})}),Object.values(e).map(e=>({name:e.name,value:e.count,avgRating:e.ratingCount>0?e.ratingSum/e.ratingCount:0})).sort((e,a)=>a.value-e.value).slice(0,10)},[a]);return t.length?(0,u.jsxs)(d.A,{title:"Category Dominance",subtitle:"Product distribution by category (Top 10)",children:[(0,u.jsx)(c.u,{width:"100%",height:420,children:(0,u.jsxs)(o.r,{children:[(0,u.jsx)(s.F,{data:t,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:140,label:e=>{let{name:a,percent:t}=e;return"".concat(a," (").concat((100*t).toFixed(1),"%)")},children:t.map((e,a)=>(0,u.jsx)(l.f,{fill:g[a%g.length]},"cell-".concat(a)))}),(0,u.jsx)(i.m,{content:(0,u.jsx)(h,{})}),(0,u.jsx)(n.s,{verticalAlign:"bottom",height:40,wrapperStyle:{fontSize:12}})]})}),(0,u.jsxs)("div",{style:{marginTop:18},children:[(0,u.jsx)("strong",{children:"Key Insights"}),(0,u.jsxs)("ul",{style:{marginTop:8,paddingLeft:18},children:[(0,u.jsx)("li",{children:"All major categories fall within a narrow range of approximately 8%\u201314%, indicating an evenly distributed product landscape. AI Chatbots and Productivity slightly lead this range, showing marginally higher concentration compared to other categories."}),(0,u.jsx)("li",{children:"Categories with unclear or malformed names were intentionally excluded, ensuring that analysis focuses only on meaningful and valid product categories."})]})]})]}):(0,u.jsx)(d.A,{title:"Category Dominance",subtitle:"Product distribution by category",children:(0,u.jsx)("p",{className:"small",children:"No category data available."})})}}}]);2//# sourceMappingURL=892.734ab844.chunk.js.map