@tsiky/components-r19 1.6.2 → 1.6.3
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/dist/chart.cjs.js +1 -1
- package/dist/chart.js +8 -7
- package/dist/components-r19.css +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.js +1890 -1813
- package/dist/src/components/ChartV2/ChartV2.d.ts.map +1 -1
- package/dist/src/components/DataBoard/DataBoard.d.ts +4 -0
- package/dist/src/components/DataBoard/DataBoard.d.ts.map +1 -1
- package/dist/src/components/DataFourBoards/DataFourBoards.d.ts +4 -0
- package/dist/src/components/DataFourBoards/DataFourBoards.d.ts.map +1 -1
- package/dist/src/components/DayStatCardV2/DayStatCardV2.d.ts +8 -0
- package/dist/src/components/DayStatCardV2/DayStatCardV2.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/chart.cjs.js
CHANGED
|
@@ -972,7 +972,7 @@ Valid keys: `+JSON.stringify(Object.keys(z),null," "));var B=ne(V,Q,$,ie,X+"."+
|
|
|
972
972
|
<div style="min-width:200px;background:var(--color-content-background);border-radius:6px;box-shadow:0 6px 24px rgba(0,0,0,0.12);overflow:hidden;">
|
|
973
973
|
${ne}
|
|
974
974
|
</div>
|
|
975
|
-
`}},xaxis:{type:"category",categories:g,tickPlacement:"on",tickAmount:Math.min(12,g.length)},yaxis:{min:0,tickAmount:6,labels:{formatter:X=>X==null?"0":X.toFixed(0)}},dataLabels:{enabled:!1},legend:{show:!n,position:"top",onItemClick:{toggleDataSeries:!n},onItemHover:{highlightDataSeries:!n}},grid:{borderColor:"var(--color-border)"},responsive:u.responsive?[]:void 0};return H.jsx("div",{style:{position:"relative",width:"100%",height:t},children:a&&!c?H.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:H.jsx(S.Move,{size:48,strokeWidth:1.5,style:{opacity:.8}})}):H.jsx(gi,{options:ie,series:x,type:"line",height:t},o)})},Oh=["#e24b33","#e2b23a","#6feff0","#2f5be8"],Th=({categories:s,series:e,height:t=350,title:i="Admissions",draggable:a=!1})=>{const r=Math.max(...s.map((c,h)=>e.reduce((d,u)=>d+(u.data[h]??0),0))),n=Math.max(100,Math.ceil(r/50)*50),o={chart:{foreColor:"var(--color-text)",type:"area",stacked:!0,stackType:"normal",toolbar:{show:!1},zoom:{enabled:!1},animations:{enabled:!0},fontFamily:"Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial"},title:{text:i,align:"center",style:{fontSize:"36px",fontWeight:700,color:"#555"}},colors:Oh,dataLabels:{enabled:!1},stroke:{curve:"smooth",width:1.5},fill:{type:"solid",opacity:.95},markers:{size:0},legend:{show:!0,position:"top",horizontalAlign:"center",itemMargin:{horizontal:8,vertical:0}},xaxis:{categories:s,labels:{rotate:-45,rotateAlways:!0,style:{fontSize:"12px"}},tickPlacement:"on"},yaxis:{min:0,max:n,tickAmount:7,labels:{formatter:c=>String(Math.round(Number(c)))}},grid:{borderColor:"#e9e9e9",strokeDashArray:0},tooltip:{shared:!0,intersect:!1,y:{formatter:c=>String(c)}},responsive:[{breakpoint:768,options:{chart:{height:Math.max(240,Math.round(t*.7))},legend:{position:"top"},xaxis:{labels:{rotate:-45}}}}]},l=e.map(c=>({name:c.name,type:"area",data:c.data}));return H.jsxs("div",{style:{position:"relative",height:t,width:"100%",overflow:"hidden"},children:[H.jsx("div",{style:{opacity:a?0:1,transition:"opacity 0.2s ease-in-out"},children:H.jsx(gi,{options:o,series:l,type:"area",height:t,width:"100%"})}),a&&H.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.6)",borderRadius:12,backdropFilter:"blur(3px)",pointerEvents:"none",transition:"opacity 0.2s ease-in-out"},children:H.jsx(S.Move,{size:38,strokeWidth:1.5,style:{opacity:.85}})})]})},Tr={color:"#4f9db5",sort:"desc",height:520,showGrid:!0,showLegend:!1},Rh=({data:s,config:e=Tr,draggable:t=!1})=>{const i={...Tr,...e},a=s.labels??[],r=s.values??[],n=Math.min(a.length,r.length),o=[];for(let u=0;u<n;u++)o.push({label:a[u],value:r[u]});i.sort==="desc"?o.sort((u,g)=>g.value-u.value):i.sort==="asc"&&o.sort((u,g)=>u.value-g.value);const l=o.map(u=>u.label),h=[{name:"Valeur",data:o.map(u=>u.value)}],d={chart:{foreColor:"var(--color-text)",type:"bar",toolbar:{show:!1},height:i.height},plotOptions:{bar:{horizontal:!0,barHeight:"60%",distributed:!1,borderRadius:6,borderRadiusApplication:"end"}},dataLabels:{enabled:!1,formatter:u=>String(u),style:{fontSize:"12px"},offsetX:0},yaxis:{labels:{style:{fontSize:"12px"}}},grid:{show:!!i.showGrid,borderColor:"#e6e6e6"},tooltip:{shared:!1,y:{formatter:u=>String(u)}},legend:{show:!!i.showLegend},colors:[i.color],xaxis:{min:0,tickAmount:5,categories:l,labels:{formatter:u=>String(u)}},responsive:[]};return H.jsxs("div",{style:{position:"relative",height:i.height,width:"100%",overflow:"hidden"},children:[H.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.15s ease-in-out"},children:H.jsx(gi,{options:d,series:h,type:"bar",height:i.height,width:"100%"})}),t&&H.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.5)",borderRadius:12,backdropFilter:"blur(3px)",pointerEvents:"none",transition:"opacity 0.15s ease-in-out"},children:H.jsx(S.Move,{size:36,strokeWidth:1.5,style:{opacity:.85}})})]})},Rr={colorUpper:"#2db85bff",colorLower:"#b3761bff",showOutliers:!0,tooltipFormatter:s=>String(s),height:420,responsive:!0,fontSize:"12px",fontWeight:"400"},zh=({data:s,config:e=Rr})=>{const t={...Rr,...e},a=[{name:"Distribution",data:(Array.isArray(s?.series)?s.series:[]).map(n=>({x:n.x,y:n.y}))}],r={chart:{foreColor:"var(--color-text)",type:"boxPlot",toolbar:{show:!1},height:t.height},yaxis:{tickAmount:10,labels:{formatter:function(n){return n.toFixed(0)}}},plotOptions:{boxPlot:{colors:{upper:t.colorUpper,lower:t.colorLower}}},stroke:{show:!0,width:1,colors:[t.colorStroke??"var(--color-secondary)"]},markers:{size:0},tooltip:{shared:!1,y:{formatter:n=>typeof n=="number"?t.tooltipFormatter(n):String(n)}},grid:{borderColor:"#e6e6e6"},dataLabels:{enabled:!1},legend:{show:!1,fontSize:t.fontSize,fontWeight:t.fontWeight},responsive:t.responsive?[]:void 0};return H.jsx(gi,{options:r,series:a,type:"boxPlot",height:t.height})},Dh=({active:s,payload:e,label:t,realColor:i="#D9D9D9",predictionColor:a="#22D3EE",upperAnomalyColor:r="#A855F7",lowerAnomalyColor:n="#D8B4FE"})=>{if(!s||!e||!e.length)return null;const o=e[0].payload;return o?H.jsxs("div",{style:{backgroundColor:"#0B1220",color:"#FFFFFF",padding:"10px 12px",borderRadius:8,fontSize:12,lineHeight:1.4,minWidth:150,boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:[H.jsx("div",{style:{fontWeight:600,marginBottom:6},children:t}),H.jsxs("div",{children:["Max : ",o.max]}),H.jsxs("div",{children:["Min : ",o.min]}),H.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:6},children:[H.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:6}}),H.jsxs("span",{children:["Prédictions : ",o.pred]})]}),o.anomaly&&H.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[H.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:o.anomaly==="Haute"?r:n,marginRight:6}}),H.jsx("span",{children:"Anomalie"})]}),o.reel!==void 0&&H.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[H.jsx("span",{style:{width:10,height:10,backgroundColor:i,marginRight:6}}),H.jsxs("span",{children:["Réel : ",o.reel]})]})]}):null},Xh=({onGoingColor:s,realColor:e,upperAnomalyColor:t,lowerAnomalyColor:i,predictionColor:a,fontSize:r="12px",fontWeight:n="400"})=>H.jsxs("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap",gap:"20px",marginTop:"20px",color:"#9CA3AF",fontSize:r,fontWeight:n},children:[H.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[H.jsx("span",{style:{width:15,height:10,backgroundColor:s,marginRight:"5px"}}),"En cours"]}),H.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[H.jsx("span",{style:{width:15,height:10,backgroundColor:e,marginRight:"5px"}}),"Réel"]}),H.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[H.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:"5px"}}),"Prédictions Correctes"]}),H.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[H.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:t,marginRight:"5px"}}),"Anomalie Haute"]}),H.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[H.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:i,marginRight:"5px"}}),"Anomalie Basse"]})]}),Yh=({data:s,config:e,height:t=350,useOnGoing:i,draggable:a=!1,tooltipEnabled:r=!0,disableLegendFilter:n=!1,backgroundColor:o="#ffffff",lowerAnomalyColor:l="#D8B4FE",upperAnomalyColor:c="#A855F7",realColor:h="#D9D9D9",onGoingColor:d="#727688",predictionColor:u="#22D3EE",predictionBarColor:g="#22D3EE",fontSize:p="12px",fontWeight:f="400",predictionWindow:x=0})=>{if(e?.displayCondition&&!e.displayCondition(s))return H.jsx("div",{style:{padding:12},children:"Chart hidden by displayCondition"});const m=s.labels||[];if(!m.length)return H.jsx("div",{style:{padding:12},children:"Pas de labels fournis"});const w=s[e?.histogramKey??"histogram"],y=m.map((A,k)=>{const C=s.main[k]??0,P=s.upper[k]??C,L=s.lower[k]??C,E=i&&typeof s.onGoingIndex=="number"&&k>s.onGoingIndex&&k<s.onGoingIndex+x?C:w?.[k]??void 0,T=Math.max(...s.upper,...s.main,...w??[]),R=Math.min(...s.lower,...s.main,...w??[]);let D;E!=null&&(E>P?D="Haute":E<L&&(D="Basse"));let F=0,N=0;return x>0&&i&&typeof s.onGoingIndex=="number"&&k===s.onGoingIndex&&E!==void 0&&C!==void 0?E<=C?(F=E,N=C-E):(F=E-C,N=C):(F=E??0,N=0),{time:A,reel:E,pred:C,realPart:F,predPart:N,range:[L,P],max:T,min:R,anomaly:D}});function v(A,k){return i&&s.onGoingIndex==k?d:i&&typeof s.onGoingIndex=="number"&&k>s.onGoingIndex&&k<s.onGoingIndex+x?g:A.anomaly?A.anomaly==="Haute"?c:l:h}return H.jsxs("div",{style:{width:"100%",padding:"20px",backgroundColor:o,borderRadius:"12px"},children:[H.jsx(S.ResponsiveContainer,{width:"100%",height:t,children:H.jsxs(as,{data:y,margin:{top:20,right:30,left:0,bottom:0},children:[H.jsx(S.CartesianGrid,{strokeDasharray:"0",vertical:!1,stroke:"#374151"}),H.jsx(S.XAxis,{dataKey:"time",stroke:"#9CA3AF",axisLine:!1,tickLine:!1,tick:{fontSize:p,fontWeight:f}}),H.jsx(S.YAxis,{stroke:"#9CA3AF",axisLine:!1,tickLine:!1,tick:{fontSize:p,fontWeight:f}}),r&&H.jsx(S.Tooltip,{content:H.jsx(Dh,{realColor:h,predictionColor:u,upperAnomalyColor:c,lowerAnomalyColor:l}),cursor:{fill:"transparent"}}),H.jsx(ba,{type:"monotone",dataKey:"range",fill:u,stroke:"none",fillOpacity:.1}),H.jsx(S.Bar,{dataKey:"realPart",stackId:"a",barSize:18,children:y.map((A,k)=>H.jsx(S.Cell,{fill:v(A,k)},`cell-${k}`))}),H.jsx(S.Bar,{dataKey:"predPart",stackId:"a",barSize:18,children:y.map((A,k)=>x>0&&k==s.onGoingIndex?H.jsx(S.Cell,{fill:g},`cell-pred-${k}`):H.jsx(S.Cell,{fill:"none"},`cell-pred-${k}`))}),H.jsx(jr,{type:"monotone",dataKey:"pred",stroke:u,strokeDasharray:"5 5",strokeWidth:2,dot:!1}),H.jsx(Ji,{dataKey:"reel",shape:A=>{const{cx:k,cy:C,payload:P}=A;return k===void 0||C===void 0?H.jsx("g",{}):P?.reel===void 0||P?.reel===0?H.jsx("g",{}):P?.anomaly?H.jsx("g",{}):H.jsx("circle",{cx:k,cy:C,r:4,fill:u,stroke:"none"})}}),H.jsx(Ji,{dataKey:"reel",shape:A=>{const{cx:k,cy:C,payload:P}=A;if(i&&typeof s.onGoingIndex=="number"&&P&&s.labels.indexOf(P.time)===s.onGoingIndex)return H.jsx("g",{});if(!P?.anomaly||k===void 0||C===void 0)return H.jsx("g",{});if(P?.reel===0)return H.jsx("g",{});const L=P.anomaly==="Haute"?c:l;return H.jsx("svg",{x:k-8,y:C-22,width:16,height:16,viewBox:"0 0 100 100",children:H.jsx("path",{d:"M50 0 L100 50 L50 100 L0 50 Z",fill:L,stroke:"#fff",strokeWidth:"4"})})}})]})}),H.jsx(Xh,{onGoingColor:d,realColor:h,upperAnomalyColor:c,lowerAnomalyColor:l,predictionColor:u,fontSize:p,fontWeight:f})]})},Fh=({data:s,height:e=320,tooltipEnabled:t=!0,backgroundColor:i="#ffffff",stacked:a=!0,fontSize:r="12px",fontWeight:n="400"})=>{const o=s.series.map(h=>({...h,data:[...h.data]})),l=s.labels.map((h,d)=>{const u={label:h};return o.forEach(g=>{u[g.key]=g.data[d]??0}),u}),c=h=>{const d=(h.payload??[]).map(u=>({...u}));return H.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:8,gap:16},children:d.map(u=>H.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[H.jsx("div",{style:{width:12,height:12,backgroundColor:u.color,borderRadius:2}}),H.jsx("span",{style:{fontSize:r,fontWeight:n,color:"#374151"},children:u.value})]},u.value))})};return H.jsx("div",{style:{height:"100%",backgroundColor:i,padding:16,borderRadius:12},children:H.jsx(S.ResponsiveContainer,{width:"100%",height:e,children:H.jsxs(as,{data:l,children:[H.jsx(S.CartesianGrid,{stroke:"#E5E7EB",vertical:!1}),H.jsx(S.XAxis,{fontSize:r,fontWeight:n,dataKey:"label",axisLine:!1,tickLine:!1}),H.jsx(S.YAxis,{fontSize:r,fontWeight:n,axisLine:!1,tickLine:!1}),t&&H.jsx(S.Tooltip,{}),H.jsx(zr,{content:c}),o.map(h=>H.jsx(ba,{type:"monotone",dataKey:h.key,stackId:a?"1":void 0,fill:h.color,stroke:"none",fillOpacity:1,name:h.label},h.key))]})})})},Nh=s=>{const{x:e,y:t,width:i,height:a,index:r,payload:n}=s;if(isNaN(e)||isNaN(t))return null;const o=e<200;return H.jsxs(S.Layer,{children:[H.jsx(S.Rectangle,{x:e,y:t,width:i,height:a,fill:n.fill}),H.jsx("text",{x:o?e-15:e+i+15,y:t+a/2,textAnchor:o?"end":"start",dominantBaseline:"middle",fontSize:13,fill:"#94a3b8",children:n.name})]},`node-${r}`)},_h=s=>{const{sourceX:e,sourceY:t,targetX:i,targetY:a,linkWidth:r,index:n,payload:o}=s;if(e==null||t==null||i==null||a==null||r==null)return null;const l=`
|
|
975
|
+
`}},xaxis:{type:"category",categories:g,tickPlacement:"on",tickAmount:Math.min(12,g.length)},yaxis:{min:0,tickAmount:6,labels:{formatter:X=>X==null?"0":X.toFixed(0)}},dataLabels:{enabled:!1},legend:{show:!n,position:"top",onItemClick:{toggleDataSeries:!n},onItemHover:{highlightDataSeries:!n}},grid:{borderColor:"var(--color-border)"},responsive:u.responsive?[]:void 0};return H.jsx("div",{style:{position:"relative",width:"100%",height:t},children:a&&!c?H.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:H.jsx(S.Move,{size:48,strokeWidth:1.5,style:{opacity:.8}})}):H.jsx(gi,{options:ie,series:x,type:"line",height:t},o)})},Oh=["#e24b33","#e2b23a","#6feff0","#2f5be8"],Th=({categories:s,series:e,height:t=350,title:i="Admissions",draggable:a=!1})=>{const r=Math.max(...s.map((c,h)=>e.reduce((d,u)=>d+(u.data[h]??0),0))),n=Math.max(100,Math.ceil(r/50)*50),o={chart:{foreColor:"var(--color-text)",type:"area",stacked:!0,stackType:"normal",toolbar:{show:!1},zoom:{enabled:!1},animations:{enabled:!0},fontFamily:"Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial"},title:{text:i,align:"center",style:{fontSize:"36px",fontWeight:700,color:"#555"}},colors:Oh,dataLabels:{enabled:!1},stroke:{curve:"smooth",width:1.5},fill:{type:"solid",opacity:.95},markers:{size:0},legend:{show:!0,position:"top",horizontalAlign:"center",itemMargin:{horizontal:8,vertical:0}},xaxis:{categories:s,labels:{rotate:-45,rotateAlways:!0,style:{fontSize:"12px"}},tickPlacement:"on"},yaxis:{min:0,max:n,tickAmount:7,labels:{formatter:c=>String(Math.round(Number(c)))}},grid:{borderColor:"#e9e9e9",strokeDashArray:0},tooltip:{shared:!0,intersect:!1,y:{formatter:c=>String(c)}},responsive:[{breakpoint:768,options:{chart:{height:Math.max(240,Math.round(t*.7))},legend:{position:"top"},xaxis:{labels:{rotate:-45}}}}]},l=e.map(c=>({name:c.name,type:"area",data:c.data}));return H.jsxs("div",{style:{position:"relative",height:t,width:"100%",overflow:"hidden"},children:[H.jsx("div",{style:{opacity:a?0:1,transition:"opacity 0.2s ease-in-out"},children:H.jsx(gi,{options:o,series:l,type:"area",height:t,width:"100%"})}),a&&H.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.6)",borderRadius:12,backdropFilter:"blur(3px)",pointerEvents:"none",transition:"opacity 0.2s ease-in-out"},children:H.jsx(S.Move,{size:38,strokeWidth:1.5,style:{opacity:.85}})})]})},Tr={color:"#4f9db5",sort:"desc",height:520,showGrid:!0,showLegend:!1},Rh=({data:s,config:e=Tr,draggable:t=!1})=>{const i={...Tr,...e},a=s.labels??[],r=s.values??[],n=Math.min(a.length,r.length),o=[];for(let u=0;u<n;u++)o.push({label:a[u],value:r[u]});i.sort==="desc"?o.sort((u,g)=>g.value-u.value):i.sort==="asc"&&o.sort((u,g)=>u.value-g.value);const l=o.map(u=>u.label),h=[{name:"Valeur",data:o.map(u=>u.value)}],d={chart:{foreColor:"var(--color-text)",type:"bar",toolbar:{show:!1},height:i.height},plotOptions:{bar:{horizontal:!0,barHeight:"60%",distributed:!1,borderRadius:6,borderRadiusApplication:"end"}},dataLabels:{enabled:!1,formatter:u=>String(u),style:{fontSize:"12px"},offsetX:0},yaxis:{labels:{style:{fontSize:"12px"}}},grid:{show:!!i.showGrid,borderColor:"#e6e6e6"},tooltip:{shared:!1,y:{formatter:u=>String(u)}},legend:{show:!!i.showLegend},colors:[i.color],xaxis:{min:0,tickAmount:5,categories:l,labels:{formatter:u=>String(u)}},responsive:[]};return H.jsxs("div",{style:{position:"relative",height:i.height,width:"100%",overflow:"hidden"},children:[H.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.15s ease-in-out"},children:H.jsx(gi,{options:d,series:h,type:"bar",height:i.height,width:"100%"})}),t&&H.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.5)",borderRadius:12,backdropFilter:"blur(3px)",pointerEvents:"none",transition:"opacity 0.15s ease-in-out"},children:H.jsx(S.Move,{size:36,strokeWidth:1.5,style:{opacity:.85}})})]})},Rr={colorUpper:"#2db85bff",colorLower:"#b3761bff",showOutliers:!0,tooltipFormatter:s=>String(s),height:420,responsive:!0,fontSize:"12px",fontWeight:"400"},zh=({data:s,config:e=Rr})=>{const t={...Rr,...e},a=[{name:"Distribution",data:(Array.isArray(s?.series)?s.series:[]).map(n=>({x:n.x,y:n.y}))}],r={chart:{foreColor:"var(--color-text)",type:"boxPlot",toolbar:{show:!1},height:t.height},yaxis:{tickAmount:10,labels:{formatter:function(n){return n.toFixed(0)}}},plotOptions:{boxPlot:{colors:{upper:t.colorUpper,lower:t.colorLower}}},stroke:{show:!0,width:1,colors:[t.colorStroke??"var(--color-secondary)"]},markers:{size:0},tooltip:{shared:!1,y:{formatter:n=>typeof n=="number"?t.tooltipFormatter(n):String(n)}},grid:{borderColor:"#e6e6e6"},dataLabels:{enabled:!1},legend:{show:!1,fontSize:t.fontSize,fontWeight:t.fontWeight},responsive:t.responsive?[]:void 0};return H.jsx(gi,{options:r,series:a,type:"boxPlot",height:t.height})},Dh=({active:s,payload:e,label:t,realColor:i="#D9D9D9",predictionColor:a="#22D3EE",upperAnomalyColor:r="#A855F7",lowerAnomalyColor:n="#D8B4FE"})=>{if(!s||!e||!e.length)return null;const o=e[0].payload;return o?H.jsxs("div",{style:{backgroundColor:"#0B1220",color:"#FFFFFF",padding:"10px 12px",borderRadius:8,fontSize:12,lineHeight:1.4,minWidth:150,boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:[H.jsx("div",{style:{fontWeight:600,marginBottom:6},children:t}),H.jsxs("div",{children:["Max : ",o.max]}),H.jsxs("div",{children:["Min : ",o.min]}),H.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:6},children:[H.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:6}}),H.jsxs("span",{children:["Prédictions : ",o.pred]})]}),o.anomaly&&H.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[H.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:o.anomaly==="Haute"?r:n,marginRight:6}}),H.jsx("span",{children:"Anomalie"})]}),o.reel!==void 0&&H.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[H.jsx("span",{style:{width:10,height:10,backgroundColor:i,marginRight:6}}),H.jsxs("span",{children:["Réel : ",o.reel]})]})]}):null},Xh=({onGoingColor:s,realColor:e,upperAnomalyColor:t,lowerAnomalyColor:i,predictionColor:a,fontSize:r="12px",fontWeight:n="400"})=>H.jsxs("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap",gap:"20px",marginTop:"20px",color:"#9CA3AF",fontSize:r,fontWeight:n},children:[H.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[H.jsx("span",{style:{width:15,height:10,backgroundColor:s,marginRight:"5px"}}),"En cours"]}),H.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[H.jsx("span",{style:{width:15,height:10,backgroundColor:e,marginRight:"5px"}}),"Réel"]}),H.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[H.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:"5px"}}),"Prédictions Correctes"]}),H.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[H.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:t,marginRight:"5px"}}),"Anomalie Haute"]}),H.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[H.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:i,marginRight:"5px"}}),"Anomalie Basse"]})]}),Yh=({data:s,config:e,height:t=350,useOnGoing:i,draggable:a=!1,tooltipEnabled:r=!0,disableLegendFilter:n=!1,backgroundColor:o="#ffffff",lowerAnomalyColor:l="#D8B4FE",upperAnomalyColor:c="#A855F7",realColor:h="#D9D9D9",onGoingColor:d="#727688",predictionColor:u="#22D3EE",predictionBarColor:g="#22D3EE",fontSize:p="12px",fontWeight:f="400",predictionWindow:x=0})=>{if(e?.displayCondition&&!e.displayCondition(s))return H.jsx("div",{style:{padding:12},children:"Chart hidden by displayCondition"});const m=s.labels||[];if(!m.length)return H.jsx("div",{style:{padding:12},children:"Pas de labels fournis"});const w=s[e?.histogramKey??"histogram"],y=m.map((A,k)=>{const C=s.main[k]??0,P=s.upper[k]??C,L=s.lower[k]??C,E=i&&typeof s.onGoingIndex=="number"&&k>s.onGoingIndex&&k<s.onGoingIndex+x?C:w?.[k]??void 0,T=Math.max(...s.upper,...s.main,...w??[]),R=Math.min(...s.lower,...s.main,...w??[]);let D;E!=null&&(E>P?D="Haute":E<L&&(D="Basse"));let F=0,N=0;return x>0&&i&&typeof s.onGoingIndex=="number"&&k===s.onGoingIndex&&E!==void 0&&C!==void 0?E<=C?(F=E,N=C-E):(F=E-C,N=C):(F=E??0,N=0),{time:A,reel:E,pred:C,realPart:F,predPart:N,range:[L,P],max:T,min:R,anomaly:D}});function v(A,k){return i&&s.onGoingIndex==k?d:i&&typeof s.onGoingIndex=="number"&&k>s.onGoingIndex&&k<s.onGoingIndex+x?g:A.anomaly?A.anomaly==="Haute"?c:l:h}return H.jsxs("div",{style:{width:"100%",backgroundColor:o,borderRadius:"12px"},children:[H.jsx(S.ResponsiveContainer,{width:"100%",height:t,children:H.jsxs(as,{data:y,margin:{top:20,right:30,left:0,bottom:0},children:[H.jsx(S.CartesianGrid,{strokeDasharray:"0",vertical:!1,stroke:"#374151"}),H.jsx(S.XAxis,{dataKey:"time",stroke:"#9CA3AF",axisLine:!1,tickLine:!1,tick:{fontSize:p,fontWeight:f}}),H.jsx(S.YAxis,{stroke:"#9CA3AF",axisLine:!1,tickLine:!1,tick:{fontSize:p,fontWeight:f},width:20}),r&&H.jsx(S.Tooltip,{content:H.jsx(Dh,{realColor:h,predictionColor:u,upperAnomalyColor:c,lowerAnomalyColor:l}),cursor:{fill:"transparent"}}),H.jsx(ba,{type:"monotone",dataKey:"range",fill:u,stroke:"none",fillOpacity:.1}),H.jsx(S.Bar,{dataKey:"realPart",stackId:"a",barSize:19,children:y.map((A,k)=>H.jsx(S.Cell,{fill:v(A,k)},`cell-${k}`))}),H.jsx(S.Bar,{dataKey:"predPart",stackId:"a",barSize:19,children:y.map((A,k)=>x>0&&k==s.onGoingIndex?H.jsx(S.Cell,{fill:g},`cell-pred-${k}`):H.jsx(S.Cell,{fill:"none"},`cell-pred-${k}`))}),H.jsx(jr,{type:"monotone",dataKey:"pred",stroke:u,strokeDasharray:"5 5",strokeWidth:2,dot:!1}),H.jsx(Ji,{dataKey:"reel",shape:A=>{const{cx:k,cy:C,payload:P}=A;return k===void 0||C===void 0?H.jsx("g",{}):P?.reel===void 0||P?.reel===0?H.jsx("g",{}):P?.anomaly?H.jsx("g",{}):H.jsx("circle",{cx:k,cy:C,r:4,fill:u,stroke:"#fff",strokeWidth:"2"})}}),H.jsx(Ji,{dataKey:"reel",shape:A=>{const{cx:k,cy:C,payload:P}=A;if(i&&typeof s.onGoingIndex=="number"&&P&&s.labels.indexOf(P.time)===s.onGoingIndex)return H.jsx("g",{});if(!P?.anomaly||k===void 0||C===void 0)return H.jsx("g",{});if(P?.reel===0)return H.jsx("g",{});const L=P.anomaly==="Haute"?c:l;return H.jsx("svg",{x:k-8,y:C-8,width:16,height:16,viewBox:"0 0 100 100",children:H.jsx("path",{d:"M50 0 L100 50 L50 100 L0 50 Z",fill:L,stroke:"#fff",strokeWidth:"9"})})}})]})}),H.jsx(Xh,{onGoingColor:d,realColor:h,upperAnomalyColor:c,lowerAnomalyColor:l,predictionColor:u,fontSize:p,fontWeight:f})]})},Fh=({data:s,height:e=320,tooltipEnabled:t=!0,backgroundColor:i="#ffffff",stacked:a=!0,fontSize:r="12px",fontWeight:n="400"})=>{const o=s.series.map(h=>({...h,data:[...h.data]})),l=s.labels.map((h,d)=>{const u={label:h};return o.forEach(g=>{u[g.key]=g.data[d]??0}),u}),c=h=>{const d=(h.payload??[]).map(u=>({...u}));return H.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:8,gap:16},children:d.map(u=>H.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[H.jsx("div",{style:{width:12,height:12,backgroundColor:u.color,borderRadius:2}}),H.jsx("span",{style:{fontSize:r,fontWeight:n,color:"#374151"},children:u.value})]},u.value))})};return H.jsx("div",{style:{height:"100%",backgroundColor:i,padding:16,borderRadius:12},children:H.jsx(S.ResponsiveContainer,{width:"100%",height:e,children:H.jsxs(as,{data:l,children:[H.jsx(S.CartesianGrid,{stroke:"#E5E7EB",vertical:!1}),H.jsx(S.XAxis,{fontSize:r,fontWeight:n,dataKey:"label",axisLine:!1,tickLine:!1}),H.jsx(S.YAxis,{fontSize:r,fontWeight:n,axisLine:!1,tickLine:!1}),t&&H.jsx(S.Tooltip,{}),H.jsx(zr,{content:c}),o.map(h=>H.jsx(ba,{type:"monotone",dataKey:h.key,stackId:a?"1":void 0,fill:h.color,stroke:"none",fillOpacity:1,name:h.label},h.key))]})})})},Nh=s=>{const{x:e,y:t,width:i,height:a,index:r,payload:n}=s;if(isNaN(e)||isNaN(t))return null;const o=e<200;return H.jsxs(S.Layer,{children:[H.jsx(S.Rectangle,{x:e,y:t,width:i,height:a,fill:n.fill}),H.jsx("text",{x:o?e-15:e+i+15,y:t+a/2,textAnchor:o?"end":"start",dominantBaseline:"middle",fontSize:13,fill:"#94a3b8",children:n.name})]},`node-${r}`)},_h=s=>{const{sourceX:e,sourceY:t,targetX:i,targetY:a,linkWidth:r,index:n,payload:o}=s;if(e==null||t==null||i==null||a==null||r==null)return null;const l=`
|
|
976
976
|
M${e},${t}
|
|
977
977
|
C${e+100},${t}
|
|
978
978
|
${i-100},${a}
|
package/dist/chart.js
CHANGED
|
@@ -15616,7 +15616,7 @@ const Wi = /* @__PURE__ */ $a(Fu), Es = {
|
|
|
15616
15616
|
function v(A, k) {
|
|
15617
15617
|
return i && s.onGoingIndex == k ? d : i && typeof s.onGoingIndex == "number" && k > s.onGoingIndex && k < s.onGoingIndex + x ? g : A.anomaly ? A.anomaly === "Haute" ? c : l : h;
|
|
15618
15618
|
}
|
|
15619
|
-
return /* @__PURE__ */ ve("div", { style: { width: "100%",
|
|
15619
|
+
return /* @__PURE__ */ ve("div", { style: { width: "100%", backgroundColor: o, borderRadius: "12px" }, children: [
|
|
15620
15620
|
/* @__PURE__ */ $(ur, { width: "100%", height: t, children: /* @__PURE__ */ ve(Cn, { data: y, margin: { top: 20, right: 30, left: 0, bottom: 0 }, children: [
|
|
15621
15621
|
/* @__PURE__ */ $(Js, { strokeDasharray: "0", vertical: !1, stroke: "#374151" }),
|
|
15622
15622
|
/* @__PURE__ */ $(
|
|
@@ -15635,7 +15635,8 @@ const Wi = /* @__PURE__ */ $a(Fu), Es = {
|
|
|
15635
15635
|
stroke: "#9CA3AF",
|
|
15636
15636
|
axisLine: !1,
|
|
15637
15637
|
tickLine: !1,
|
|
15638
|
-
tick: { fontSize: p, fontWeight: f }
|
|
15638
|
+
tick: { fontSize: p, fontWeight: f },
|
|
15639
|
+
width: 20
|
|
15639
15640
|
}
|
|
15640
15641
|
),
|
|
15641
15642
|
r && /* @__PURE__ */ $(
|
|
@@ -15663,8 +15664,8 @@ const Wi = /* @__PURE__ */ $a(Fu), Es = {
|
|
|
15663
15664
|
fillOpacity: 0.1
|
|
15664
15665
|
}
|
|
15665
15666
|
),
|
|
15666
|
-
/* @__PURE__ */ $(Dr, { dataKey: "realPart", stackId: "a", barSize:
|
|
15667
|
-
/* @__PURE__ */ $(Dr, { dataKey: "predPart", stackId: "a", barSize:
|
|
15667
|
+
/* @__PURE__ */ $(Dr, { dataKey: "realPart", stackId: "a", barSize: 19, children: y.map((A, k) => /* @__PURE__ */ $(bi, { fill: v(A, k) }, `cell-${k}`)) }),
|
|
15668
|
+
/* @__PURE__ */ $(Dr, { dataKey: "predPart", stackId: "a", barSize: 19, children: y.map(
|
|
15668
15669
|
(A, k) => x > 0 && k == s.onGoingIndex ? /* @__PURE__ */ $(bi, { fill: g }, `cell-pred-${k}`) : /* @__PURE__ */ $(bi, { fill: "none" }, `cell-pred-${k}`)
|
|
15669
15670
|
) }),
|
|
15670
15671
|
/* @__PURE__ */ $(
|
|
@@ -15684,7 +15685,7 @@ const Wi = /* @__PURE__ */ $a(Fu), Es = {
|
|
|
15684
15685
|
dataKey: "reel",
|
|
15685
15686
|
shape: (A) => {
|
|
15686
15687
|
const { cx: k, cy: S, payload: C } = A;
|
|
15687
|
-
return k === void 0 || S === void 0 ? /* @__PURE__ */ $("g", {}) : C?.reel === void 0 || C?.reel === 0 ? /* @__PURE__ */ $("g", {}) : C?.anomaly ? /* @__PURE__ */ $("g", {}) : /* @__PURE__ */ $("circle", { cx: k, cy: S, r: 4, fill: u, stroke: "
|
|
15688
|
+
return k === void 0 || S === void 0 ? /* @__PURE__ */ $("g", {}) : C?.reel === void 0 || C?.reel === 0 ? /* @__PURE__ */ $("g", {}) : C?.anomaly ? /* @__PURE__ */ $("g", {}) : /* @__PURE__ */ $("circle", { cx: k, cy: S, r: 4, fill: u, stroke: "#fff", strokeWidth: "2" });
|
|
15688
15689
|
}
|
|
15689
15690
|
}
|
|
15690
15691
|
),
|
|
@@ -15699,13 +15700,13 @@ const Wi = /* @__PURE__ */ $a(Fu), Es = {
|
|
|
15699
15700
|
if (!C?.anomaly || k === void 0 || S === void 0) return /* @__PURE__ */ $("g", {});
|
|
15700
15701
|
if (C?.reel === 0) return /* @__PURE__ */ $("g", {});
|
|
15701
15702
|
const P = C.anomaly === "Haute" ? c : l;
|
|
15702
|
-
return /* @__PURE__ */ $("svg", { x: k - 8, y: S -
|
|
15703
|
+
return /* @__PURE__ */ $("svg", { x: k - 8, y: S - 8, width: 16, height: 16, viewBox: "0 0 100 100", children: /* @__PURE__ */ $(
|
|
15703
15704
|
"path",
|
|
15704
15705
|
{
|
|
15705
15706
|
d: "M50 0 L100 50 L50 100 L0 50 Z",
|
|
15706
15707
|
fill: P,
|
|
15707
15708
|
stroke: "#fff",
|
|
15708
|
-
strokeWidth: "
|
|
15709
|
+
strokeWidth: "9"
|
|
15709
15710
|
}
|
|
15710
15711
|
) });
|
|
15711
15712
|
}
|