@tsiky/components-r19 1.6.13 → 1.6.14
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 +1 -1
- package/dist/components-r19.css +1 -1
- package/dist/index.cjs.js +491 -491
- package/dist/index.js +8400 -8379
- package/dist/src/components/AnnouncementForm/AnnouncementForm.d.ts +13 -0
- package/dist/src/components/AnnouncementForm/AnnouncementForm.d.ts.map +1 -1
- package/dist/src/components/ChartV2/ChartV2.d.ts.map +1 -1
- package/dist/src/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/src/components/FiltreEtiquette/FiltreEtiquette.d.ts +1 -0
- package/dist/src/components/FiltreEtiquette/FiltreEtiquette.d.ts.map +1 -1
- package/dist/src/components/IndicatorItemV2/IndicatorItemV2.d.ts +1 -0
- package/dist/src/components/IndicatorItemV2/IndicatorItemV2.d.ts.map +1 -1
- package/dist/src/components/Select/Select.d.ts +2 -0
- package/dist/src/components/Select/Select.d.ts.map +1 -1
- package/dist/src/components/SummaryAvailable/SummaryAvailable.d.ts +5 -5
- package/dist/src/components/SummaryAvailable/SummaryAvailable.d.ts.map +1 -1
- package/package.json +99 -99
package/dist/chart.cjs.js
CHANGED
|
@@ -972,7 +972,7 @@ Valid keys: `+JSON.stringify(Object.keys(R),null," "));var U=oe(V,ee,G,ie,_+"."
|
|
|
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
|
${oe}
|
|
974
974
|
</div>
|
|
975
|
-
`}},xaxis:{type:"category",categories:g,tickPlacement:"on",tickAmount:Math.min(12,g.length)},yaxis:{min:0,tickAmount:6,labels:{formatter:_=>_==null?"0":_.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 B.jsx("div",{style:{position:"relative",width:"100%",height:t},children:a&&!c?B.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:B.jsx(w.Move,{size:48,strokeWidth:1.5,style:{opacity:.8}})}):B.jsx(vi,{options:ie,series:x,type:"line",height:t},o)})},Vd=["#e24b33","#e2b23a","#6feff0","#2f5be8"],Ud=({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:Vd,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 B.jsxs("div",{style:{position:"relative",height:t,width:"100%",overflow:"hidden"},children:[B.jsx("div",{style:{opacity:a?0:1,transition:"opacity 0.2s ease-in-out"},children:B.jsx(vi,{options:o,series:l,type:"area",height:t,width:"100%"})}),a&&B.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:B.jsx(w.Move,{size:38,strokeWidth:1.5,style:{opacity:.85}})})]})},Ur={color:"#4f9db5",sort:"desc",height:520,showGrid:!0,showLegend:!1},$d=({data:s,config:e=Ur,draggable:t=!1})=>{const i={...Ur,...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 B.jsxs("div",{style:{position:"relative",height:i.height,width:"100%",overflow:"hidden"},children:[B.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.15s ease-in-out"},children:B.jsx(vi,{options:d,series:h,type:"bar",height:i.height,width:"100%"})}),t&&B.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:B.jsx(w.Move,{size:36,strokeWidth:1.5,style:{opacity:.85}})})]})},$r={colorUpper:"#2db85bff",colorLower:"#b3761bff",showOutliers:!0,tooltipFormatter:s=>String(s),height:420,responsive:!0,fontSize:"12px",fontWeight:"400"},qd=({data:s,config:e=$r})=>{const t={...$r,...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 B.jsx(vi,{options:r,series:a,type:"boxPlot",height:t.height})},Kd=({active:s,payload:e,label:t,realColor:i="#D9D9D9",predictionColor:a="#22D3EE",lowerAnomalyColor:r="#C497FF80",upperAnomalyColor:n="#A27DD5",texts:o={max:"Max",min:"Min",predictions:"Prédictions",anomaly:"Anomalie",real:"Réel"}})=>{if(!s||!e||!e.length)return null;const l=e[0].payload;return l?B.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:[B.jsx("div",{style:{fontWeight:600,marginBottom:6},children:t}),B.jsxs("div",{children:[o.max," : ",l.max]}),B.jsxs("div",{children:[o.min," : ",l.min]}),B.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:6},children:[B.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:6}}),B.jsxs("span",{children:[o.predictions," : ",l.pred]})]}),l.anomaly&&B.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[B.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:l.anomaly==="Haute"?n:r,marginRight:6}}),B.jsx("span",{children:o.anomaly})]}),l.reel!==void 0&&B.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[B.jsx("span",{style:{width:10,height:10,backgroundColor:i,marginRight:6}}),B.jsxs("span",{children:[o.real," : ",l.reel]})]})]}):null},Zd=({onGoingColor:s,realColor:e,upperAnomalyColor:t,lowerAnomalyColor:i,predictionColor:a,textColor:r="#9CA3AF",fontSize:n="12px",fontWeight:o="400",legendTexts:l={onGoing:"En cours",real:"Réel",predictions:"Prédictions Correctes",upperAnomaly:"Anomalie Haute",lowerAnomaly:"Anomalie Basse"}})=>B.jsxs("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap",gap:"20px",marginBottom:"15px",color:r,fontSize:n,fontWeight:o},children:[B.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[B.jsx("span",{style:{width:15,height:10,backgroundColor:s,marginRight:"5px"}}),l.onGoing]}),B.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[B.jsx("span",{style:{width:15,height:10,backgroundColor:e,marginRight:"5px"}}),l.real]}),B.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[B.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:"5px"}}),l.predictions]}),B.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[B.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:t,marginRight:"5px"}}),l.upperAnomaly]}),B.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[B.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:i,marginRight:"5px"}}),l.lowerAnomaly]})]}),Jd=({data:s,config:e,height:t=220,useOnGoing:i,draggable:a=!1,tooltipEnabled:r=!0,disableLegendFilter:n=!1,backgroundColor:o="#ffffff",lowerAnomalyColor:l="#D8B4FE",lowerAnomalyScatterColor:c="#C497FF",upperAnomalyColor:h="#A855F7",upperAnomalyScatterColor:d="#7C46C3",realColor:u="#D9D9D9",onGoingColor:g="#727688",predictionColor:p="#22D3EE",predictionBarColor:f="#22D3EE",textColor:x="#9CA3AF",fontSize:m="8px",fontWeight:v="400",lineColor:A="#F4F4F4",predictionWindow:y=0,legendTexts:b,tooltipTexts:S,yAxisWidth:k=20,tickCount:C=7,padding:P})=>{const I=re.useRef(null),[L,O]=re.useState(50);if(re.useLayoutEffect(()=>{const H=()=>{if(I.current){const Y=I.current.getBoundingClientRect().width,R=s.labels?.length||1,G=(Y-k-30-R*2)/R;O(Math.max(G,14))}};return H(),window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[s.labels,k]),e?.displayCondition&&!e.displayCondition(s))return B.jsx("div",{style:{padding:12},children:"Chart hidden by displayCondition"});const T=s.labels||[];if(!T.length)return B.jsx("div",{style:{padding:12},children:"Pas de labels fournis"});const D=s[e?.histogramKey??"histogram"],F=T.map((H,Y)=>{const R=s.main[Y]??0,N=s.upper[Y]??R,K=s.lower[Y]??R,G=i&&typeof s.onGoingIndex=="number"&&Y>s.onGoingIndex&&Y<s.onGoingIndex+y?R:D?.[Y]??void 0,ie=Math.max(...s.upper,...s.main,...D??[]),_=Math.min(...s.lower,...s.main,...D??[]);let V;G!=null&&(G>N?V="Haute":G<K&&(V="Basse"));let $=0,Z=0;return y>0&&i&&typeof s.onGoingIndex=="number"&&Y===s.onGoingIndex&&G!==void 0&&R!==void 0?G<=R?($=G,Z=R-G):($=G-R,Z=R):($=G??0,Z=0),{time:H,reel:G,pred:R,realPart:$,predPart:Z,range:[K,N],max:ie,min:_,anomaly:V}});function X(H,Y){return i&&s.onGoingIndex==Y?g:i&&typeof s.onGoingIndex=="number"&&Y>s.onGoingIndex&&Y<s.onGoingIndex+y?f:H.anomaly?H.anomaly==="Haute"?h:l:u}return B.jsxs("div",{ref:I,style:{width:"100%",padding:P,backgroundColor:o,borderRadius:"12px"},children:[B.jsx(w.ResponsiveContainer,{width:"100%",height:t,children:B.jsxs(As,{data:F,margin:{top:20,right:30,left:0,bottom:0},barGap:0,children:[B.jsx(w.CartesianGrid,{strokeDasharray:"0",vertical:!1,stroke:A}),B.jsx(w.XAxis,{dataKey:"time",stroke:x,axisLine:!1,tickLine:!1,tick:{fontSize:m,fontWeight:v}}),B.jsx(w.YAxis,{stroke:x,axisLine:!1,tickLine:!1,tickCount:C,tick:{fontSize:m,fontWeight:v},width:k}),r&&B.jsx(w.Tooltip,{content:B.jsx(Kd,{realColor:u,predictionColor:p,upperAnomalyColor:d,lowerAnomalyColor:c,texts:S}),cursor:{fill:"transparent"}}),B.jsx(La,{type:"monotone",dataKey:"range",fill:"rgba(0, 143, 187, 1)",stroke:"none",fillOpacity:"16%",zIndex:999}),B.jsx(w.Bar,{dataKey:"realPart",stackId:"a",barSize:L,radius:2,children:F.map((H,Y)=>B.jsx(w.Cell,{fill:X(H,Y)},`cell-${Y}`))}),B.jsx(w.Bar,{dataKey:"predPart",stackId:"a",barSize:L,radius:2,children:F.map((H,Y)=>y>0&&Y==s.onGoingIndex?B.jsx(w.Cell,{fill:f},`cell-pred-${Y}`):B.jsx(w.Cell,{fill:"none"},`cell-pred-${Y}`))}),B.jsx(ls,{type:"monotone",dataKey:"pred",stroke:p,strokeDasharray:"5 5",strokeWidth:2,dot:!1}),B.jsx(aa,{dataKey:"reel",shape:H=>{const{cx:Y,cy:R,payload:N}=H;return Y===void 0||R===void 0?B.jsx("g",{}):N?.reel===void 0||N?.reel===0?B.jsx("g",{}):N?.anomaly?B.jsx("g",{}):B.jsx("circle",{cx:Y-.5,cy:R,r:4,fill:p,stroke:"#fff",strokeWidth:"2"})}}),B.jsx(aa,{dataKey:"reel",shape:H=>{const{cx:Y,cy:R,payload:N}=H;if(i&&typeof s.onGoingIndex=="number"&&N&&s.labels.indexOf(N.time)===s.onGoingIndex)return B.jsx("g",{});if(!N?.anomaly||Y===void 0||R===void 0)return B.jsx("g",{});if(N?.reel===0)return B.jsx("g",{});const K=N.anomaly==="Haute"?d:c;return B.jsx("svg",{x:Y-5.5,y:R-5,width:10,height:10,viewBox:"0 0 100 100",children:B.jsx("path",{d:"M50 0 L100 50 L50 100 L0 50 Z",fill:K,stroke:"#fff",strokeWidth:"9"})})}})]})}),B.jsx(Zd,{onGoingColor:g,realColor:u,upperAnomalyColor:d,lowerAnomalyColor:c,predictionColor:p,textColor:x,fontSize:m,fontWeight:v,legendTexts:b})]})},Qd=({data:s,height:e=320,tooltipEnabled:t=!0,legendEnabled:i=!0,backgroundColor:a="#ffffff",stacked:r=!0,fontSize:n="12px",fontWeight:o="400"})=>{const l=s.labels.map((d,u)=>{const g={label:d};return s.series.forEach(p=>{g[p.key]=p.data[u]??0}),g}),c=new Map(s.series.map((d,u)=>[d.key,u])),h=d=>{const u=(d.payload??[]).map(g=>({...g}));return u.sort((g,p)=>{const f=c.get(g.dataKey)??999,x=c.get(p.dataKey)??999;return f-x}),B.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:8,gap:16,flexWrap:"wrap"},children:u.map(g=>B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[B.jsx("div",{style:{width:12,height:12,backgroundColor:g.color,borderRadius:2}}),B.jsx("span",{style:{fontSize:n,fontWeight:o,color:"#374151"},children:g.value})]},g.value))})};return B.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:a},children:B.jsx(w.ResponsiveContainer,{width:"100%",height:e,children:B.jsxs(As,{data:l,children:[B.jsx(w.CartesianGrid,{stroke:"#E5E7EB",vertical:!1}),B.jsx(w.XAxis,{fontSize:n,fontWeight:o,dataKey:"label",axisLine:!1,tickLine:!1,tickMargin:10}),B.jsx(w.YAxis,{fontSize:n,fontWeight:o,axisLine:!1,tickLine:!1,width:30}),t&&B.jsx(w.Tooltip,{}),i&&B.jsx(Sa,{content:h}),s.series.map(d=>B.jsx(La,{type:"monotone",dataKey:d.key,stackId:r?"1":void 0,fill:d.color,stroke:"none",fillOpacity:1,name:d.label},d.key))]})})})},eu=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,c=(d=>{if(d.length<16)return[d];const u=d.lastIndexOf(" (");if(u!==-1&&u>8)return[d.substring(0,u),d.substring(u+1)];const g=d.indexOf(" ",12);return g!==-1?[d.substring(0,g),d.substring(g+1)]:[d]})(n.name),h=14;return B.jsxs(w.Layer,{children:[B.jsx(w.Rectangle,{x:e,y:t,width:i,height:a,fill:n.fill}),c.map((d,u)=>B.jsx("text",{x:o?e-8:e+i+8,y:t+a/2+(u-(c.length-1)/2)*h,textAnchor:o?"end":"start",dominantBaseline:"middle",fontSize:11,fill:"#94a3b8",style:{pointerEvents:"none"},children:d},u))]},`node-${r}`)},tu=s=>{const{sourceX:e,sourceY:t,targetX:i,targetY:a,linkWidth:r,index:n,payload:o,uid:l}=s;if(e==null||t==null||i==null||a==null||r==null)return null;const c=`
|
|
975
|
+
`}},xaxis:{type:"category",categories:g,tickPlacement:"on",tickAmount:Math.min(12,g.length)},yaxis:{min:0,tickAmount:6,labels:{formatter:_=>_==null?"0":_.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 B.jsx("div",{style:{position:"relative",width:"100%",height:t},children:a&&!c?B.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:B.jsx(w.Move,{size:48,strokeWidth:1.5,style:{opacity:.8}})}):B.jsx(vi,{options:ie,series:x,type:"line",height:t},o)})},Vd=["#e24b33","#e2b23a","#6feff0","#2f5be8"],Ud=({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:Vd,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 B.jsxs("div",{style:{position:"relative",height:t,width:"100%",overflow:"hidden"},children:[B.jsx("div",{style:{opacity:a?0:1,transition:"opacity 0.2s ease-in-out"},children:B.jsx(vi,{options:o,series:l,type:"area",height:t,width:"100%"})}),a&&B.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:B.jsx(w.Move,{size:38,strokeWidth:1.5,style:{opacity:.85}})})]})},Ur={color:"#4f9db5",sort:"desc",height:520,showGrid:!0,showLegend:!1},$d=({data:s,config:e=Ur,draggable:t=!1})=>{const i={...Ur,...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 B.jsxs("div",{style:{position:"relative",height:i.height,width:"100%",overflow:"hidden"},children:[B.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.15s ease-in-out"},children:B.jsx(vi,{options:d,series:h,type:"bar",height:i.height,width:"100%"})}),t&&B.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:B.jsx(w.Move,{size:36,strokeWidth:1.5,style:{opacity:.85}})})]})},$r={colorUpper:"#2db85bff",colorLower:"#b3761bff",showOutliers:!0,tooltipFormatter:s=>String(s),height:420,responsive:!0,fontSize:"12px",fontWeight:"400"},qd=({data:s,config:e=$r})=>{const t={...$r,...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 B.jsx(vi,{options:r,series:a,type:"boxPlot",height:t.height})},Kd=({active:s,payload:e,label:t,realColor:i="#D9D9D9",predictionColor:a="#22D3EE",lowerAnomalyColor:r="#C497FF80",upperAnomalyColor:n="#A27DD5",texts:o={max:"Max",min:"Min",predictions:"Prédictions",anomaly:"Anomalie",real:"Réel"}})=>{if(!s||!e||!e.length)return null;const l=e[0].payload;return l?B.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:[B.jsx("div",{style:{fontWeight:600,marginBottom:6},children:t}),B.jsxs("div",{children:[o.max," : ",l.max]}),B.jsxs("div",{children:[o.min," : ",l.min]}),B.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:6},children:[B.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:6}}),B.jsxs("span",{children:[o.predictions," : ",l.pred]})]}),l.anomaly&&B.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[B.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:l.anomaly==="Haute"?n:r,marginRight:6}}),B.jsx("span",{children:o.anomaly})]}),l.reel!==void 0&&B.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[B.jsx("span",{style:{width:10,height:10,backgroundColor:i,marginRight:6}}),B.jsxs("span",{children:[o.real," : ",l.reel]})]})]}):null},Zd=({onGoingColor:s,realColor:e,upperAnomalyColor:t,lowerAnomalyColor:i,predictionColor:a,textColor:r="#9CA3AF",fontSize:n="12px",fontWeight:o="400",legendTexts:l={onGoing:"En cours",real:"Réel",predictions:"Prédictions Correctes",upperAnomaly:"Anomalie Haute",lowerAnomaly:"Anomalie Basse"}})=>B.jsxs("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap",gap:"20px",marginBottom:"15px",color:r,fontSize:n,fontWeight:o},children:[B.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[B.jsx("span",{style:{width:15,height:10,backgroundColor:s,marginRight:"5px"}}),l.onGoing]}),B.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[B.jsx("span",{style:{width:15,height:10,backgroundColor:e,marginRight:"5px"}}),l.real]}),B.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[B.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:"5px"}}),l.predictions]}),B.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[B.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:t,marginRight:"5px"}}),l.upperAnomaly]}),B.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[B.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:i,marginRight:"5px"}}),l.lowerAnomaly]})]}),Jd=({data:s,config:e,height:t=220,useOnGoing:i,draggable:a=!1,tooltipEnabled:r=!0,disableLegendFilter:n=!1,backgroundColor:o="#ffffff",lowerAnomalyColor:l="#D8B4FE",lowerAnomalyScatterColor:c="#C497FF",upperAnomalyColor:h="#A855F7",upperAnomalyScatterColor:d="#7C46C3",realColor:u="#D9D9D9",onGoingColor:g="#727688",predictionColor:p="#22D3EE",predictionBarColor:f="#22D3EE",textColor:x="#9CA3AF",fontSize:m="8px",fontWeight:v="400",lineColor:A="#F4F4F4",predictionWindow:y=0,legendTexts:b,tooltipTexts:S,yAxisWidth:k=20,tickCount:C=7,padding:P})=>{const I=re.useRef(null),[L,O]=re.useState(50);if(re.useLayoutEffect(()=>{const H=()=>{if(I.current){const Y=I.current.getBoundingClientRect().width,R=s.labels?.length||1,G=(Y-k-30-R*2)/R;O(Math.max(G,14))}};return H(),window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[s.labels,k]),e?.displayCondition&&!e.displayCondition(s))return B.jsx("div",{style:{padding:12},children:"Chart hidden by displayCondition"});const T=s.labels||[];if(!T.length)return B.jsx("div",{style:{padding:12},children:"Pas de labels fournis"});const D=s[e?.histogramKey??"histogram"],F=T.map((H,Y)=>{const R=s.main[Y]??0,N=s.upper[Y]??R,K=s.lower[Y]??R,G=i&&typeof s.onGoingIndex=="number"&&Y>s.onGoingIndex&&Y<s.onGoingIndex+y?R:D?.[Y]??void 0,ie=Math.max(...s.upper,...s.main,...D??[]),_=Math.min(...s.lower,...s.main,...D??[]);let V;G!=null&&(G>N?V="Haute":G<K&&(V="Basse"));let $=0,Z=0;return y>0&&i&&typeof s.onGoingIndex=="number"&&Y===s.onGoingIndex&&G!==void 0&&R!==void 0?G<=R?($=G,Z=R-G):($=G-R,Z=R):($=G??0,Z=0),{time:H,reel:G,pred:R,realPart:$,predPart:Z,range:[K,N],max:ie,min:_,anomaly:V}});function X(H,Y){return i&&s.onGoingIndex==Y?g:i&&typeof s.onGoingIndex=="number"&&Y>s.onGoingIndex&&Y<s.onGoingIndex+y?f:H.anomaly?H.anomaly==="Haute"?h:l:u}return B.jsxs("div",{ref:I,style:{width:"100%",padding:P,backgroundColor:o,borderRadius:"12px"},children:[B.jsx(w.ResponsiveContainer,{width:"100%",height:t,children:B.jsxs(As,{data:F,margin:{top:20,right:30,left:0,bottom:0},barGap:0,children:[B.jsx(w.CartesianGrid,{strokeDasharray:"0",vertical:!1,stroke:A}),B.jsx(w.XAxis,{dataKey:"time",stroke:x,axisLine:!1,tickLine:!1,tick:{fontSize:m,fontWeight:v}}),B.jsx(w.YAxis,{stroke:x,axisLine:!1,tickLine:!1,tickCount:C,tick:{fontSize:m,fontWeight:v},width:k}),r&&B.jsx(w.Tooltip,{content:B.jsx(Kd,{realColor:u,predictionColor:p,upperAnomalyColor:d,lowerAnomalyColor:c,texts:S}),cursor:{fill:"transparent"}}),B.jsx(La,{type:"monotone",dataKey:"range",fill:"rgba(0, 143, 187, 1)",stroke:"none",fillOpacity:"16%",zIndex:999}),B.jsx(w.Bar,{dataKey:"realPart",stackId:"a",barSize:L,radius:2,children:F.map((H,Y)=>B.jsx(w.Cell,{fill:X(H,Y)},`cell-${Y}`))}),B.jsx(w.Bar,{dataKey:"predPart",stackId:"a",barSize:L,radius:2,children:F.map((H,Y)=>y>0&&Y==s.onGoingIndex?B.jsx(w.Cell,{fill:f},`cell-pred-${Y}`):B.jsx(w.Cell,{fill:"none"},`cell-pred-${Y}`))}),B.jsx(ls,{type:"monotone",dataKey:"pred",stroke:p,strokeDasharray:"5 5",strokeWidth:2,dot:!1}),B.jsx(aa,{dataKey:"reel",shape:H=>{const{cx:Y,cy:R,payload:N}=H;return Y===void 0||R===void 0?B.jsx("g",{}):N?.reel===void 0||N?.reel===0?B.jsx("g",{}):N?.anomaly?B.jsx("g",{}):B.jsx("circle",{cx:Y-.5,cy:R,r:4,fill:p,stroke:"#fff",strokeWidth:"2"})}}),B.jsx(aa,{dataKey:"reel",shape:H=>{const{cx:Y,cy:R,payload:N}=H;if(i&&typeof s.onGoingIndex=="number"&&N&&s.labels.indexOf(N.time)===s.onGoingIndex)return B.jsx("g",{});if(!N?.anomaly||Y===void 0||R===void 0)return B.jsx("g",{});if(N?.reel===0)return B.jsx("g",{});const K=N.anomaly==="Haute"?d:c;return B.jsx("svg",{x:Y-5.5,y:R-5,width:10,height:10,viewBox:"0 0 100 100",children:B.jsx("path",{d:"M50 0 L100 50 L50 100 L0 50 Z",fill:K,stroke:"#fff",strokeWidth:"9"})})}})]})}),!n&&B.jsx(Zd,{onGoingColor:g,realColor:u,upperAnomalyColor:d,lowerAnomalyColor:c,predictionColor:p,textColor:x,fontSize:m,fontWeight:v,legendTexts:b})]})},Qd=({data:s,height:e=320,tooltipEnabled:t=!0,legendEnabled:i=!0,backgroundColor:a="#ffffff",stacked:r=!0,fontSize:n="12px",fontWeight:o="400"})=>{const l=s.labels.map((d,u)=>{const g={label:d};return s.series.forEach(p=>{g[p.key]=p.data[u]??0}),g}),c=new Map(s.series.map((d,u)=>[d.key,u])),h=d=>{const u=(d.payload??[]).map(g=>({...g}));return u.sort((g,p)=>{const f=c.get(g.dataKey)??999,x=c.get(p.dataKey)??999;return f-x}),B.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:8,gap:16,flexWrap:"wrap"},children:u.map(g=>B.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[B.jsx("div",{style:{width:12,height:12,backgroundColor:g.color,borderRadius:2}}),B.jsx("span",{style:{fontSize:n,fontWeight:o,color:"#374151"},children:g.value})]},g.value))})};return B.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:a},children:B.jsx(w.ResponsiveContainer,{width:"100%",height:e,children:B.jsxs(As,{data:l,children:[B.jsx(w.CartesianGrid,{stroke:"#E5E7EB",vertical:!1}),B.jsx(w.XAxis,{fontSize:n,fontWeight:o,dataKey:"label",axisLine:!1,tickLine:!1,tickMargin:10}),B.jsx(w.YAxis,{fontSize:n,fontWeight:o,axisLine:!1,tickLine:!1,width:30}),t&&B.jsx(w.Tooltip,{}),i&&B.jsx(Sa,{content:h}),s.series.map(d=>B.jsx(La,{type:"monotone",dataKey:d.key,stackId:r?"1":void 0,fill:d.color,stroke:"none",fillOpacity:1,name:d.label},d.key))]})})})},eu=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,c=(d=>{if(d.length<16)return[d];const u=d.lastIndexOf(" (");if(u!==-1&&u>8)return[d.substring(0,u),d.substring(u+1)];const g=d.indexOf(" ",12);return g!==-1?[d.substring(0,g),d.substring(g+1)]:[d]})(n.name),h=14;return B.jsxs(w.Layer,{children:[B.jsx(w.Rectangle,{x:e,y:t,width:i,height:a,fill:n.fill}),c.map((d,u)=>B.jsx("text",{x:o?e-8:e+i+8,y:t+a/2+(u-(c.length-1)/2)*h,textAnchor:o?"end":"start",dominantBaseline:"middle",fontSize:11,fill:"#94a3b8",style:{pointerEvents:"none"},children:d},u))]},`node-${r}`)},tu=s=>{const{sourceX:e,sourceY:t,targetX:i,targetY:a,linkWidth:r,index:n,payload:o,uid:l}=s;if(e==null||t==null||i==null||a==null||r==null)return null;const c=`
|
|
976
976
|
M${e},${t}
|
|
977
977
|
C${(e+i)/2},${t}
|
|
978
978
|
${(e+i)/2},${a}
|
package/dist/chart.js
CHANGED
|
@@ -16493,7 +16493,7 @@ const ri = /* @__PURE__ */ gr(Nf), en = {
|
|
|
16493
16493
|
]
|
|
16494
16494
|
}
|
|
16495
16495
|
) }),
|
|
16496
|
-
/* @__PURE__ */ U(
|
|
16496
|
+
!n && /* @__PURE__ */ U(
|
|
16497
16497
|
Bf,
|
|
16498
16498
|
{
|
|
16499
16499
|
onGoingColor: g,
|