harshapitla/stackoverflow
0
1"use strict";(self.webpackChunkreact_template=self.webpackChunkreact_template||[]).push([[165],{15:(e,t,r)=>{r.d(t,{A:()=>s});r(5043);var a=r(579);function s(e){let{title:t,subtitle:r,children:s,actions:n,footer:i}=e;return(0,a.jsxs)("section",{className:"card chart-card",children:[(t||r||n)&&(0,a.jsxs)("div",{className:"chart-card-header",children:[(0,a.jsxs)("div",{children:[t&&(0,a.jsx)("h3",{className:"chart-card-title",children:t}),r&&(0,a.jsx)("p",{className:"chart-card-subtitle",children:r})]}),n&&(0,a.jsx)("div",{className:"chart-card-actions",children:n})]}),(0,a.jsx)("div",{className:"chart-card-body",children:s}),i&&(0,a.jsx)("div",{className:"chart-card-footer",children:i})]})}},3165:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var a=r(5043),s=r(379),n=r(1180),i=r(7734),l=r(8676),c=r(2185),d=r(6026),o=r(5748),h=r(15),u=r(579);function m(e){let{active:t,payload:r,label:a}=e;return t&&r&&r.length?(0,u.jsxs)("div",{style:{background:"#ffffff",padding:"8px 12px",borderRadius:6,border:"1px solid #cbd5e1"},children:[(0,u.jsx)("strong",{children:a}),(0,u.jsxs)("div",{style:{marginTop:4},children:["Products Launched: ",r[0].value]})]}):null}function x(e){let{rows:t=[]}=e;const r=(0,a.useMemo)(()=>{if(!Array.isArray(t))return[];const e={};return t.forEach(t=>{const r=function(e){if(!e)return null;const t=new Date(e);return isNaN(t)?null:t.toLocaleString("en-US",{month:"short",year:"numeric"})}(t.launch_date);r&&(e[r]=(e[r]||0)+1)}),Object.entries(e).map(e=>{let[t,r]=e;return{month:t,value:r,sortKey:new Date("01 ".concat(t))}}).sort((e,t)=>e.sortKey-t.sortKey).map(e=>{let{month:t,value:r}=e;return{month:t,value:r}})},[t]);return r.length?(0,u.jsxs)(h.A,{title:"Products Launched Over Time",subtitle:"Monthly product launch trends across the market",children:[(0,u.jsx)(n.u,{width:"100%",height:450,children:(0,u.jsxs)(o.b,{data:r,margin:{top:30,right:30,left:20,bottom:90},children:[(0,u.jsx)(i.d,{strokeDasharray:"3 3"}),(0,u.jsx)(c.W,{dataKey:"month",angle:-25,textAnchor:"end",interval:"preserveStartEnd",height:90,tick:{fontSize:12}}),(0,u.jsx)(d.h,{allowDecimals:!1}),(0,u.jsx)(s.m,{content:(0,u.jsx)(m,{})}),(0,u.jsx)(l.N,{type:"monotone",dataKey:"value",stroke:"#4f46e5",strokeWidth:3,dot:{r:4},activeDot:{r:6}})]})}),(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:"There is a significant spike in product launches around April 2022, indicating a period of unusually high activity."}),(0,u.jsx)("li",{children:"From April 2022 to September 2023, the number of products launched increases gradually, showing steady growth over time."}),(0,u.jsx)("li",{children:"After September 2023, product launches begin to decline, suggesting a slowdown in overall market activity."})]})]})]}):(0,u.jsx)(h.A,{title:"Products Launched Over Time",subtitle:"Launch activity trend",children:(0,u.jsx)("p",{className:"small",children:"No valid launch date data available."})})}}}]);2//# sourceMappingURL=165.fd4f455c.chunk.js.map