@tsiky/components-r19 1.6.62 → 1.6.64
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 +2 -2
- package/dist/chart.js +57 -53
- package/dist/src/components/AreaChartV2/AreaChartV2.d.ts +1 -0
- package/dist/src/components/AreaChartV2/AreaChartV2.d.ts.map +1 -1
- package/dist/src/components/Charts/stacked-bar-v2/StackedBarChartV2.d.ts +1 -0
- package/dist/src/components/Charts/stacked-bar-v2/StackedBarChartV2.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/chart.cjs.js
CHANGED
|
@@ -962,9 +962,9 @@ object-assign
|
|
|
962
962
|
*/var Yi,vr;function ph(){if(vr)return Yi;vr=1;var s=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function i(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function a(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var n={},o=0;o<10;o++)n["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(n).map(function(h){return n[h]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(h){c[h]=h}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Yi=a()?Object.assign:function(r,n){for(var o,l=i(r),c,h=1;h<arguments.length;h++){o=Object(arguments[h]);for(var d in o)e.call(o,d)&&(l[d]=o[d]);if(s){c=s(o);for(var u=0;u<c.length;u++)t.call(o,c[u])&&(l[c[u]]=o[c[u]])}}return l},Yi}var _i,br;function Ea(){if(br)return _i;br=1;var s="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return _i=s,_i}var Ni,yr;function js(){return yr||(yr=1,Ni=Function.call.bind(Object.prototype.hasOwnProperty)),Ni}var Hi,wr;function xh(){if(wr)return Hi;wr=1;var s=function(){};if(process.env.NODE_ENV!=="production"){var e=Ea(),t={},i=js();s=function(r){var n="Warning: "+r;typeof console<"u"&&console.error(n);try{throw new Error(n)}catch{}}}function a(r,n,o,l,c){if(process.env.NODE_ENV!=="production"){for(var h in r)if(i(r,h)){var d;try{if(typeof r[h]!="function"){var u=Error((l||"React class")+": "+o+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}d=r[h](n,h,l,o,null,e)}catch(p){d=p}if(d&&!(d instanceof Error)&&s((l||"React class")+": type specification of "+o+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in t)){t[d.message]=!0;var g=c?c():"";s("Failed "+o+" type: "+d.message+(g??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},Hi=a,Hi}var Wi,kr;function mh(){if(kr)return Wi;kr=1;var s=Bs(),e=ph(),t=Ea(),i=js(),a=xh(),r=function(){};process.env.NODE_ENV!=="production"&&(r=function(o){var l="Warning: "+o;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function n(){return null}return Wi=function(o,l){var c=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function d(O){var D=O&&(c&&O[c]||O[h]);if(typeof D=="function")return D}var u="<<anonymous>>",g={array:m("array"),bigint:m("bigint"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:v(),arrayOf:w,element:y(),elementType:b(),instanceOf:A,node:L(),objectOf:S,oneOf:k,oneOfType:P,shape:E,exact:R};function p(O,D){return O===D?O!==0||1/O===1/D:O!==O&&D!==D}function f(O,D){this.message=O,this.data=D&&typeof D=="object"?D:{},this.stack=""}f.prototype=Error.prototype;function x(O){if(process.env.NODE_ENV!=="production")var D={},W=0;function V(ee,q,Z,Q,ae,te,le){if(Q=Q||u,te=te||Z,le!==t){if(l){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var de=Q+":"+Z;!D[de]&&W<3&&(r("You are manually calling a React.PropTypes validation function for the `"+te+"` prop on `"+Q+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),D[de]=!0,W++)}}return q[Z]==null?ee?q[Z]===null?new f("The "+ae+" `"+te+"` is marked as required "+("in `"+Q+"`, but its value is `null`.")):new f("The "+ae+" `"+te+"` is marked as required in "+("`"+Q+"`, but its value is `undefined`.")):null:O(q,Z,Q,ae,te)}var H=V.bind(null,!1);return H.isRequired=V.bind(null,!0),H}function m(O){function D(W,V,H,ee,q,Z){var Q=W[V],ae=Y(Q);if(ae!==O){var te=_(Q);return new f("Invalid "+ee+" `"+q+"` of type "+("`"+te+"` supplied to `"+H+"`, expected ")+("`"+O+"`."),{expectedType:O})}return null}return x(D)}function v(){return x(n)}function w(O){function D(W,V,H,ee,q){if(typeof O!="function")return new f("Property `"+q+"` of component `"+H+"` has invalid PropType notation inside arrayOf.");var Z=W[V];if(!Array.isArray(Z)){var Q=Y(Z);return new f("Invalid "+ee+" `"+q+"` of type "+("`"+Q+"` supplied to `"+H+"`, expected an array."))}for(var ae=0;ae<Z.length;ae++){var te=O(Z,ae,H,ee,q+"["+ae+"]",t);if(te instanceof Error)return te}return null}return x(D)}function y(){function O(D,W,V,H,ee){var q=D[W];if(!o(q)){var Z=Y(q);return new f("Invalid "+H+" `"+ee+"` of type "+("`"+Z+"` supplied to `"+V+"`, expected a single ReactElement."))}return null}return x(O)}function b(){function O(D,W,V,H,ee){var q=D[W];if(!s.isValidElementType(q)){var Z=Y(q);return new f("Invalid "+H+" `"+ee+"` of type "+("`"+Z+"` supplied to `"+V+"`, expected a single ReactElement type."))}return null}return x(O)}function A(O){function D(W,V,H,ee,q){if(!(W[V]instanceof O)){var Z=O.name||u,Q=U(W[V]);return new f("Invalid "+ee+" `"+q+"` of type "+("`"+Q+"` supplied to `"+H+"`, expected ")+("instance of `"+Z+"`."))}return null}return x(D)}function k(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&(arguments.length>1?r("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):r("Invalid argument supplied to oneOf, expected an array.")),n;function D(W,V,H,ee,q){for(var Z=W[V],Q=0;Q<O.length;Q++)if(p(Z,O[Q]))return null;var ae=JSON.stringify(O,function(le,$){var de=_($);return de==="symbol"?String($):$});return new f("Invalid "+ee+" `"+q+"` of value `"+String(Z)+"` "+("supplied to `"+H+"`, expected one of "+ae+"."))}return x(D)}function S(O){function D(W,V,H,ee,q){if(typeof O!="function")return new f("Property `"+q+"` of component `"+H+"` has invalid PropType notation inside objectOf.");var Z=W[V],Q=Y(Z);if(Q!=="object")return new f("Invalid "+ee+" `"+q+"` of type "+("`"+Q+"` supplied to `"+H+"`, expected an object."));for(var ae in Z)if(i(Z,ae)){var te=O(Z,ae,H,ee,q+"."+ae,t);if(te instanceof Error)return te}return null}return x(D)}function P(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&r("Invalid argument supplied to oneOfType, expected an instance of array."),n;for(var D=0;D<O.length;D++){var W=O[D];if(typeof W!="function")return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+B(W)+" at index "+D+"."),n}function V(H,ee,q,Z,Q){for(var ae=[],te=0;te<O.length;te++){var le=O[te],$=le(H,ee,q,Z,Q,t);if($==null)return null;$.data&&i($.data,"expectedType")&&ae.push($.data.expectedType)}var de=ae.length>0?", expected one of type ["+ae.join(", ")+"]":"";return new f("Invalid "+Z+" `"+Q+"` supplied to "+("`"+q+"`"+de+"."))}return x(V)}function L(){function O(D,W,V,H,ee){return z(D[W])?null:new f("Invalid "+H+" `"+ee+"` supplied to "+("`"+V+"`, expected a ReactNode."))}return x(O)}function I(O,D,W,V,H){return new f((O||"React class")+": "+D+" type `"+W+"."+V+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+H+"`.")}function E(O){function D(W,V,H,ee,q){var Z=W[V],Q=Y(Z);if(Q!=="object")return new f("Invalid "+ee+" `"+q+"` of type `"+Q+"` "+("supplied to `"+H+"`, expected `object`."));for(var ae in O){var te=O[ae];if(typeof te!="function")return I(H,ee,q,ae,_(te));var le=te(Z,ae,H,ee,q+"."+ae,t);if(le)return le}return null}return x(D)}function R(O){function D(W,V,H,ee,q){var Z=W[V],Q=Y(Z);if(Q!=="object")return new f("Invalid "+ee+" `"+q+"` of type `"+Q+"` "+("supplied to `"+H+"`, expected `object`."));var ae=e({},W[V],O);for(var te in ae){var le=O[te];if(i(O,te)&&typeof le!="function")return I(H,ee,q,te,_(le));if(!le)return new f("Invalid "+ee+" `"+q+"` key `"+te+"` supplied to `"+H+"`.\nBad object: "+JSON.stringify(W[V],null," ")+`
|
|
963
963
|
Valid keys: `+JSON.stringify(Object.keys(O),null," "));var $=le(Z,te,H,ee,q+"."+te,t);if($)return $}return null}return x(D)}function z(O){switch(typeof O){case"number":case"string":case"undefined":return!0;case"boolean":return!O;case"object":if(Array.isArray(O))return O.every(z);if(O===null||o(O))return!0;var D=d(O);if(D){var W=D.call(O),V;if(D!==O.entries){for(;!(V=W.next()).done;)if(!z(V.value))return!1}else for(;!(V=W.next()).done;){var H=V.value;if(H&&!z(H[1]))return!1}}else return!1;return!0;default:return!1}}function X(O,D){return O==="symbol"?!0:D?D["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&D instanceof Symbol:!1}function Y(O){var D=typeof O;return Array.isArray(O)?"array":O instanceof RegExp?"object":X(D,O)?"symbol":D}function _(O){if(typeof O>"u"||O===null)return""+O;var D=Y(O);if(D==="object"){if(O instanceof Date)return"date";if(O instanceof RegExp)return"regexp"}return D}function B(O){var D=_(O);switch(D){case"array":case"object":return"an "+D;case"boolean":case"date":case"regexp":return"a "+D;default:return D}}function U(O){return!O.constructor||!O.constructor.name?u:O.constructor.name}return g.checkPropTypes=a,g.resetWarningCache=a.resetWarningCache,g.PropTypes=g,g},Wi}var Bi,Ar;function vh(){if(Ar)return Bi;Ar=1;var s=Ea();function e(){}function t(){}return t.resetWarningCache=e,Bi=function(){function i(n,o,l,c,h,d){if(d!==s){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}i.isRequired=i;function a(){return i}var r={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:t,resetWarningCache:e};return r.PropTypes=r,r},Bi}var Sr;function bh(){if(Sr)return Gt.exports;if(Sr=1,process.env.NODE_ENV!=="production"){var s=Bs(),e=!0;Gt.exports=mh()(s.isElement,e)}else Gt.exports=vh()();return Gt.exports}var Cr;function yh(){return Cr||(Cr=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=w;var e=o(ne),t=r(uh),i=r(bh()),a=["type","width","height","series","options","chartRef"];function r(y){return y&&y.__esModule?y:{default:y}}function n(y){var b,A;return typeof WeakMap!="function"?null:(b=new WeakMap,A=new WeakMap,(n=function(k){return k?A:b})(y))}function o(y,b){if(!b&&y&&y.__esModule)return y;if(y===null||d(y)!="object"&&typeof y!="function")return{default:y};if(b=n(b),b&&b.has(y))return b.get(y);var A,k,S={__proto__:null},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(A in y)A!=="default"&&{}.hasOwnProperty.call(y,A)&&((k=P?Object.getOwnPropertyDescriptor(y,A):null)&&(k.get||k.set)?Object.defineProperty(S,A,k):S[A]=y[A]);return S.default=y,b&&b.set(y,S),S}function l(){return(l=Object.assign?Object.assign.bind():function(y){for(var b=1;b<arguments.length;b++){var A,k=arguments[b];for(A in k)!{}.hasOwnProperty.call(k,A)||(y[A]=k[A])}return y}).apply(null,arguments)}function c(y,b){if(y==null)return{};var A,k=h(y,b);if(Object.getOwnPropertySymbols)for(var S=Object.getOwnPropertySymbols(y),P=0;P<S.length;P++)A=S[P],b.includes(A)||{}.propertyIsEnumerable.call(y,A)&&(k[A]=y[A]);return k}function h(y,b){if(y==null)return{};var A,k={};for(A in y)if({}.hasOwnProperty.call(y,A)){if(b.includes(A))continue;k[A]=y[A]}return k}function d(y){return(d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b})(y)}function u(y,b){var A,k=Object.keys(y);return Object.getOwnPropertySymbols&&(A=Object.getOwnPropertySymbols(y),b&&(A=A.filter(function(S){return Object.getOwnPropertyDescriptor(y,S).enumerable})),k.push.apply(k,A)),k}function g(y){for(var b=1;b<arguments.length;b++){var A=arguments[b]!=null?arguments[b]:{};b%2?u(Object(A),!0).forEach(function(k){p(y,k,A[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(A)):u(Object(A)).forEach(function(k){Object.defineProperty(y,k,Object.getOwnPropertyDescriptor(A,k))})}return y}function p(y,b,A){return(b=f(b))in y?Object.defineProperty(y,b,{value:A,enumerable:!0,configurable:!0,writable:!0}):y[b]=A,y}function f(y){return y=x(y,"string"),d(y)=="symbol"?y:y+""}function x(y,b){if(d(y)!="object"||!y)return y;var A=y[Symbol.toPrimitive];if(A===void 0)return(b==="string"?String:Number)(y);if(A=A.call(y,b),d(A)!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}function m(y,b){var A=g({},y);return b.forEach(function(k){delete A[k]}),A}function v(y,b){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:new WeakSet;if(y!==b){if(d(y)!=="object"||y===null||d(b)!=="object"||b===null)return!1;if(!A.has(y)&&!A.has(b)){A.add(y),A.add(b);var k=Object.keys(y),S=Object.keys(b);if(k.length!==S.length)return!1;for(var P=0,L=k;P<L.length;P++){var I=L[P];if(!S.includes(I)||!v(y[I],b[I],A))return!1}}}return!0}function w(I){function b(B){return B&&d(B)==="object"&&!Array.isArray(B)}var _=I.type,A=_===void 0?"line":_,_=I.width,k=_===void 0?"100%":_,_=I.height,S=_===void 0?"auto":_,P=I.series,L=I.options,_=I.chartRef,I=c(I,a),E=(0,e.useRef)(null),R=_||(0,e.useRef)(null),z=(0,e.useRef)(),X=((0,e.useEffect)(function(){z.current=L;var B=E.current;return R.current=new t.default(B,X()),R.current.render(),function(){R.current&&typeof R.current.destroy=="function"&&R.current.destroy()}},[]),(0,e.useEffect)(function(){var B=!v(R.current.w.config.series,P),U=!v(z.current,L)||S!==R.current.opts.chart.height||k!==R.current.opts.chart.width;(B||U)&&(!B||U?R.current.updateOptions(X()):R.current.updateSeries(P)),z.current=L},[L,P,S,k]),function(){return Y(L,{chart:{type:A,height:S,width:k},series:P})}),Y=function(B,U){var O=g({},B);return b(B)&&b(U)&&Object.keys(U).forEach(function(D){b(U[D])&&D in B?O[D]=Y(B[D],U[D]):Object.assign(O,p({},D,U[D]))}),O},_=m(I,Object.keys(w.propTypes));return e.default.createElement("div",l({ref:E},_))}w.propTypes={type:i.default.string.isRequired,series:i.default.array.isRequired,options:i.default.object.isRequired,width:i.default.oneOfType([i.default.string,i.default.number]),height:i.default.oneOfType([i.default.string,i.default.number]),chartRef:i.default.shape({current:i.default.any})}}(bi)),bi}var wh=yh();const Oa=C.getDefaultExportFromCjs(wh),kh=["#e24b33","#e2b23a","#6feff0","#2f5be8"],Ah=({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:kh,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 F.jsxs("div",{style:{position:"relative",height:t,width:"100%",overflow:"hidden"},children:[F.jsx("div",{style:{opacity:a?0:1,transition:"opacity 0.2s ease-in-out"},children:F.jsx(Oa,{options:o,series:l,type:"area",height:t,width:"100%"})}),a&&F.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:F.jsx(C.Move,{size:38,strokeWidth:1.5,style:{opacity:.85}})})]})},Pr={color:"#4f9db5",sort:"desc",height:520,showGrid:!0,showLegend:!1},Sh=({data:s,config:e=Pr,draggable:t=!1})=>{const i={...Pr,...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 F.jsxs("div",{style:{position:"relative",height:i.height,width:"100%",overflow:"hidden"},children:[F.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.15s ease-in-out"},children:F.jsx(Oa,{options:d,series:h,type:"bar",height:i.height,width:"100%"})}),t&&F.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:F.jsx(C.Move,{size:36,strokeWidth:1.5,style:{opacity:.85}})})]})},Lr={colorUpper:"#2db85bff",colorLower:"#b3761bff",showOutliers:!0,tooltipFormatter:s=>String(s),height:420,responsive:!0,fontSize:"12px",fontWeight:"400",columnWidth:"70%"},Ch=({data:s,config:e=Lr})=>{const t={...Lr,...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:{columnWidth:t.columnWidth,colors:{upper:t.colorUpper,lower:t.colorLower}}},xaxis:{labels:{rotate:-45,rotateAlways:!0,style:{fontSize:t.fontSize,fontWeight:t.fontWeight}}},stroke:{show:!0,width:1,colors:[t.colorStroke??"var(--color-secondary)"]},markers:{size:0},tooltip:{shared:!1,theme:"dark",custom:function({seriesIndex:n,dataPointIndex:o,w:l}){const c=l.globals.initialSeries[n].data[o].y;return!c||c.length!==5?"":['<div style="padding:10px 14px;font-family:sans-serif;font-size:13px;line-height:1.9;">',`<div>max : <b>${c[4]}</b></div>`,`<div>q1 : <b>${c[3]}</b></div>`,`<div>median : <b>${c[2]}</b></div>`,`<div>q3 : <b>${c[1]}</b></div>`,`<div>min : <b>${c[0]}</b></div>`,"</div>"].join("")}},grid:{borderColor:"#e6e6e6"},dataLabels:{enabled:!1},legend:{show:!1,fontSize:t.fontSize,fontWeight:t.fontWeight},responsive:t.responsive?[]:void 0};return F.jsx(Oa,{options:r,series:a,type:"boxPlot",height:t.height})},Ph=({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?F.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:[F.jsx("div",{style:{fontWeight:600,marginBottom:6},children:t}),l.max!=null&&F.jsxs("div",{children:[o.max," : ",l.max]}),l.min!=null&&F.jsxs("div",{children:[o.min," : ",l.min]}),l.pred!=null&&F.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:6},children:[F.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:6}}),F.jsxs("span",{children:[o.predictions," : ",l.pred]})]}),l.anomaly&&F.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[F.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:l.anomaly==="Haute"?n:r,marginRight:6}}),F.jsx("span",{children:o.anomaly})]}),l.reel!=null&&!l.isPrediction&&F.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[F.jsx("span",{style:{width:10,height:10,backgroundColor:i,marginRight:6}}),F.jsxs("span",{children:[o.real," : ",l.reel]})]})]}):null},Lh=({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"}})=>F.jsxs("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap",gap:"20px",marginBottom:"15px",color:r,fontSize:n,fontWeight:o},children:[F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:15,height:10,backgroundColor:s,marginRight:"5px"}}),l.onGoing]}),F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:15,height:10,backgroundColor:e,marginRight:"5px"}}),l.real]}),F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:"5px"}}),l.predictions]}),F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:t,marginRight:"5px"}}),l.upperAnomaly]}),F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:i,marginRight:"5px"}}),l.lowerAnomaly]})]}),Ih=({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:w="#F4F4F4",predictionWindow:y=0,legendTexts:b,tooltipTexts:A,yAxisWidth:k=20,tickCount:S=7,padding:P})=>{const L=ne.useRef(null),[I,E]=ne.useState(50);if(ne.useLayoutEffect(()=>{const O=()=>{if(L.current){const D=L.current.getBoundingClientRect().width,W=s.labels?.length||1,q=(D-k-30-W*2)/W;E(Math.max(q,14))}};return O(),window.addEventListener("resize",O),()=>window.removeEventListener("resize",O)},[s.labels,k]),e?.displayCondition&&!e.displayCondition(s))return F.jsx("div",{style:{padding:12},children:"Chart hidden by displayCondition"});const R=s.labels||[];if(!R.length)return F.jsx("div",{style:{padding:12},children:"Pas de labels fournis"});const X=s[e?.histogramKey??"histogram"],Y=R.map((O,D)=>{const W=s.main[D];let V=s.upper[D],H=s.lower[D];(V==null&&H!=null||V!=null&&H==null)&&(V=V??0,H=H??0);const ee=i&&typeof s.onGoingIndex=="number"&&D>s.onGoingIndex&&D<s.onGoingIndex+y,q=ee?W??null:X?.[D]??null,Z=V,Q=H;let ae;!ee&&q!=null&&V!=null&&H!=null&&(q>V?ae="Haute":q<H&&(ae="Basse"));let te=null,le=null;if(y>0&&i&&typeof s.onGoingIndex=="number"&&D===s.onGoingIndex)if(q==null&&W==null)te=null,le=null;else{const $=q??0,de=W??0;$<=de?(te=$,le=de-$):(te=de,le=$-de)}else te=q??null,le=null;return{time:O,reel:q,pred:W,realPart:te,predPart:le,range:[H,V],max:Z,min:Q,anomaly:ae,isPrediction:ee}});function _(O,D){return i&&s.onGoingIndex==D?g:i&&typeof s.onGoingIndex=="number"&&D>s.onGoingIndex&&D<s.onGoingIndex+y?f:O.anomaly?O.anomaly==="Haute"?h:l:u}const B=typeof t=="string",U=F.jsxs(Zr,{data:Y,margin:{top:20,right:30,left:0,bottom:0},barGap:0,children:[F.jsx(C.CartesianGrid,{strokeDasharray:"0",vertical:!1,stroke:w}),F.jsx(C.XAxis,{dataKey:"time",stroke:x,axisLine:!1,tickLine:!1,tick:{fontSize:m,fontWeight:v}}),F.jsx(C.YAxis,{stroke:x,axisLine:!1,tickLine:!1,tickCount:S,tick:{fontSize:m,fontWeight:v},width:k}),r&&F.jsx(C.Tooltip,{content:F.jsx(Ph,{realColor:u,predictionColor:p,upperAnomalyColor:d,lowerAnomalyColor:c,texts:A}),cursor:{fill:"transparent"}}),F.jsx(pa,{type:"monotone",dataKey:"range",fill:"rgba(0, 143, 187, 1)",stroke:"none",fillOpacity:"16%",zIndex:999}),F.jsx(C.Bar,{dataKey:"realPart",stackId:"a",barSize:I,radius:2,children:Y.map((O,D)=>{let W;if(y>0&&i&&typeof s.onGoingIndex=="number"&&D===s.onGoingIndex){const V=O.reel??0,H=O.pred??0;W=V<=H?g:f}else W=_(O,D);return F.jsx(C.Cell,{fill:W},`cell-${D}`)})}),F.jsx(C.Bar,{dataKey:"predPart",stackId:"a",barSize:I,radius:2,children:Y.map((O,D)=>{if(!(y>0&&D===s.onGoingIndex))return F.jsx(C.Cell,{fill:"none"},`cell-pred-${D}`);const W=O.reel??0,V=O.pred??0;let H=W<=V?f:g;return F.jsx(C.Cell,{fill:H},`cell-pred-${D}`)})}),F.jsx(Fr,{type:"monotone",dataKey:"pred",stroke:p,strokeDasharray:"5 5",strokeWidth:2,dot:!1}),F.jsx(qi,{dataKey:"reel",shape:O=>{const{cx:D,cy:W,payload:V}=O;return D===void 0||W===void 0?F.jsx("g",{}):V?.reel==null?F.jsx("g",{}):i&&typeof s.onGoingIndex=="number"&&V&&s.labels.indexOf(V.time)===s.onGoingIndex?F.jsx("g",{}):V?.anomaly?F.jsx("circle",{cx:D-.5,cy:W,r:4,fill:p,stroke:"#fff",strokeWidth:"2"}):F.jsx("g",{})}}),F.jsx(qi,{dataKey:"reel",shape:O=>{const{cx:D,cy:W,payload:V}=O;if(i&&typeof s.onGoingIndex=="number"&&V&&s.labels.indexOf(V.time)===s.onGoingIndex)return F.jsx("g",{});if(!V?.anomaly||D===void 0||W===void 0)return F.jsx("g",{});if(V?.reel==null)return F.jsx("g",{});const H=V.anomaly==="Haute"?d:c;return F.jsx("svg",{x:D-5.5,y:W-5,width:10,height:10,viewBox:"0 0 100 100",children:F.jsx("path",{d:"M50 0 L100 50 L50 100 L0 50 Z",fill:H,stroke:"#fff",strokeWidth:"9"})})}})]});return F.jsxs("div",{ref:L,style:{width:"100%",padding:P,backgroundColor:o,borderRadius:"12px"},children:[B?F.jsx("div",{style:{height:t},children:F.jsx(C.ResponsiveContainer,{width:"100%",height:"100%",children:U})}):F.jsx(C.ResponsiveContainer,{width:"100%",height:t,children:U}),!n&&F.jsx(Lh,{onGoingColor:g,realColor:u,upperAnomalyColor:d,lowerAnomalyColor:c,predictionColor:p,textColor:x,fontSize:m,fontWeight:v,legendTexts:b})]})},Mh=s=>{const{x:e,y:t,payload:i,fontSize:a,fontWeight:r}=s,{value:n}=i;if(n&&n.includes(`
|
|
964
964
|
`)){const o=n.split(`
|
|
965
|
-
`);return F.jsx("g",{transform:`translate(${e},${t})`,children:F.jsxs("text",{x:0,y:0,dy:16,textAnchor:"middle",fill:"#6B7281",fontSize:a,fontWeight:r,children:[F.jsx("tspan",{x:0,dy:"0em",children:o[0]}),F.jsx("tspan",{x:0,dy:"1.2em",children:o[1]})]})})}return F.jsx("text",{x:e,y:t,dy:16,textAnchor:"middle",fill:"#6B7281",fontSize:a,fontWeight:r,children:n})},Eh=({data:s,height:e=320,tooltipEnabled:t=!0,legendEnabled:i=!0,backgroundColor:a="#ffffff",stacked:r=!0,fontSize:n="12px",fontWeight:o="400"})=>{const
|
|
965
|
+
`);return F.jsx("g",{transform:`translate(${e},${t})`,children:F.jsxs("text",{x:0,y:0,dy:16,textAnchor:"middle",fill:"#6B7281",fontSize:a,fontWeight:r,children:[F.jsx("tspan",{x:0,dy:"0em",children:o[0]}),F.jsx("tspan",{x:0,dy:"1.2em",children:o[1]})]})})}return F.jsx("text",{x:e,y:t,dy:16,textAnchor:"middle",fill:"#6B7281",fontSize:a,fontWeight:r,children:n})},Eh=({data:s,height:e=320,tooltipEnabled:t=!0,legendEnabled:i=!0,backgroundColor:a="#ffffff",stacked:r=!0,fontSize:n="12px",fontWeight:o="400",yDomain:l})=>{const c=s.labels.map((g,p)=>{const f={label:g};return s.series.forEach(x=>{f[x.key]=x.data[p]??0}),f}),h=new Map(s.series.map((g,p)=>[g.key,p])),d=g=>{const p=(g.payload??[]).map(f=>({...f}));return p.sort((f,x)=>{const m=h.get(f.dataKey)??999,v=h.get(x.dataKey)??999;return m-v}),F.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:8,gap:16,flexWrap:"wrap"},children:p.map(f=>F.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[F.jsx("div",{style:{width:12,height:12,backgroundColor:f.color,borderRadius:2}}),F.jsx("span",{style:{fontSize:n,fontWeight:o,color:"#374151"},children:f.value})]},f.value))})},u=ne.useMemo(()=>{const g=s.labels.length;if(g<=0)return[];if(g<=12)return s.labels;const p=5,f=(g-1)/(p-1),x=[];for(let m=0;m<p;m++)x.push(s.labels[Math.round(m*f)]);return Array.from(new Set(x))},[s.labels]);return F.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:a},children:F.jsx(C.ResponsiveContainer,{width:"100%",height:e,children:F.jsxs(Zr,{data:c,margin:{left:20,right:45,top:10,bottom:20},children:[F.jsx(C.CartesianGrid,{stroke:"#E5E7EB",vertical:!1}),F.jsx(C.XAxis,{fontSize:n,fontWeight:o,dataKey:"label",axisLine:!1,tickLine:!1,tickMargin:10,interval:0,ticks:u,scale:"point",height:45,tick:F.jsx(Mh,{fontSize:n,fontWeight:o})}),F.jsx(C.YAxis,{fontSize:n,fontWeight:o,axisLine:!1,tickLine:!1,width:30,domain:l}),t&&F.jsx(C.Tooltip,{itemSorter:g=>h.get(g.dataKey)??999}),i&&F.jsx(oi,{content:d}),s.series.map(g=>F.jsx(pa,{type:"monotone",dataKey:g.key,stackId:r?"1":void 0,fill:g.color,stroke:"none",fillOpacity:1,name:g.label},g.key))]})})})},Oh=s=>{const{x:e,y:t,width:i,height:a,index:r,payload:n,fontSize:o,fontWeight:l}=s;if(isNaN(e)||isNaN(t))return null;const c=e<200,h=95;return F.jsxs(C.Layer,{children:[F.jsx(C.Rectangle,{x:e,y:t,width:i,height:a,fill:n.fill}),F.jsx("foreignObject",{x:c?e-h-8:e+i+8,y:t+a/2-25,width:h,height:50,style:{overflow:"visible"},children:F.jsx("div",{style:{fontSize:o||"11px",fontWeight:l||"400",color:"#94a3b8",lineHeight:"1.2",wordBreak:"break-word",display:"flex",alignItems:"center",justifyContent:c?"flex-end":"flex-start",textAlign:c?"right":"left",height:"100%",pointerEvents:"none"},children:n.name})})]},`node-${r}`)},Th=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=`
|
|
966
966
|
M${e},${t}
|
|
967
967
|
C${(e+i)/2},${t}
|
|
968
968
|
${(e+i)/2},${a}
|
|
969
969
|
${i},${a}
|
|
970
|
-
`,h=o?.source?.fill??"#3b82f6",d=o?.target?.fill??"#ef4444",u=`sankey-gradient-${l}-${n}`;return F.jsxs(C.Layer,{children:[F.jsx("defs",{children:F.jsxs("linearGradient",{id:u,gradientUnits:"userSpaceOnUse",x1:e,x2:i,children:[F.jsx("stop",{offset:"0%",stopColor:h,stopOpacity:.2}),F.jsx("stop",{offset:"100%",stopColor:d,stopOpacity:.2})]})}),F.jsx("path",{d:c,fill:"none",stroke:`url(#${u})`,strokeWidth:Math.max(r,1),style:{transition:"all 0.4s ease"}})]})},Rh=({data:s,height:e=600,nodePadding:t=30,showTooltip:i=!0,backgroundColor:a="#ffffff",fontSize:r="12px",fontWeight:n="400"})=>{const o=ne.useId().replace(/:/g,""),l=ne.useMemo(()=>({nodes:s.nodes.map(c=>({...c})),links:s.links.map(c=>({...c}))}),[s]);return F.jsx("div",{style:{width:"100%",height:e,backgroundColor:a,display:"flex",justifyContent:"center",alignItems:"center"},children:F.jsx("div",{style:{width:"100%",maxWidth:1200,height:"100%"},children:F.jsx(C.ResponsiveContainer,{width:"100%",height:"100%",children:F.jsx($r,{data:l,node:F.jsx(Oh,{}),link:F.jsx(Th,{uid:o}),nodePadding:t,fontSize:r,fontWeight:n,margin:{left:100,right:100,top:20,bottom:20},children:i&&F.jsx(C.Tooltip,{})})})})})},zh=({data:s,colors:e,legendEnabled:t=!0,tooltipEnabled:i=!0,tooltipBackgroundColor:a="rgba(0, 0, 0, 0.8)",height:r=300,legendFontSize:n="12px",legendFontWeight:o="400",legendColor:l="#000"})=>{const[c,h]=ne.useState(null),d=new Map(s.map((g,p)=>[g.name,p])),u=g=>{const p=(g.payload??[]).map(f=>({...f}));return p.sort((f,x)=>{const m=d.get(f.value)??999,v=d.get(x.value)??999;return m-v}),F.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:8,gap:16,flexWrap:"wrap"},children:p.map(f=>F.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[F.jsx("div",{style:{width:12,height:12,backgroundColor:f.color,borderRadius:2}}),F.jsx("span",{style:{fontSize:n,fontWeight:o,color:l},children:f.value})]},Math.random()))})};return F.jsx(C.ResponsiveContainer,{width:"100%",height:r,children:F.jsxs(C.PieChart,{children:[F.jsx(C.Pie,{data:s,dataKey:"value",cx:"50%",cy:"45%",stroke:"none",outerRadius:100,innerRadius:0,paddingAngle:0,onMouseEnter:(g,p)=>h(p),onMouseLeave:()=>h(null),children:s.map((g,p)=>F.jsx(C.Cell,{fill:e[p%e.length],opacity:c===null||c===p?1:.5,style:{transition:"opacity 0.2s ease",cursor:"pointer"}},`cell-${p}`))}),i&&F.jsx(C.Tooltip,{contentStyle:{backgroundColor:a,border:"none",borderRadius:4,padding:"8px 12px"},formatter:g=>[g,"Patients"]}),t&&F.jsx(oi,{content:u})]})})},Dh=({data:s,series:e,height:t=350,tooltipEnabled:i=!0,legendEnabled:a=!0,barSize:r=15,radius:n=2,yAxisWidth:o=35})=>{const
|
|
970
|
+
`,h=o?.source?.fill??"#3b82f6",d=o?.target?.fill??"#ef4444",u=`sankey-gradient-${l}-${n}`;return F.jsxs(C.Layer,{children:[F.jsx("defs",{children:F.jsxs("linearGradient",{id:u,gradientUnits:"userSpaceOnUse",x1:e,x2:i,children:[F.jsx("stop",{offset:"0%",stopColor:h,stopOpacity:.2}),F.jsx("stop",{offset:"100%",stopColor:d,stopOpacity:.2})]})}),F.jsx("path",{d:c,fill:"none",stroke:`url(#${u})`,strokeWidth:Math.max(r,1),style:{transition:"all 0.4s ease"}})]})},Rh=({data:s,height:e=600,nodePadding:t=30,showTooltip:i=!0,backgroundColor:a="#ffffff",fontSize:r="12px",fontWeight:n="400"})=>{const o=ne.useId().replace(/:/g,""),l=ne.useMemo(()=>({nodes:s.nodes.map(c=>({...c})),links:s.links.map(c=>({...c}))}),[s]);return F.jsx("div",{style:{width:"100%",height:e,backgroundColor:a,display:"flex",justifyContent:"center",alignItems:"center"},children:F.jsx("div",{style:{width:"100%",maxWidth:1200,height:"100%"},children:F.jsx(C.ResponsiveContainer,{width:"100%",height:"100%",children:F.jsx($r,{data:l,node:F.jsx(Oh,{}),link:F.jsx(Th,{uid:o}),nodePadding:t,fontSize:r,fontWeight:n,margin:{left:100,right:100,top:20,bottom:20},children:i&&F.jsx(C.Tooltip,{})})})})})},zh=({data:s,colors:e,legendEnabled:t=!0,tooltipEnabled:i=!0,tooltipBackgroundColor:a="rgba(0, 0, 0, 0.8)",height:r=300,legendFontSize:n="12px",legendFontWeight:o="400",legendColor:l="#000"})=>{const[c,h]=ne.useState(null),d=new Map(s.map((g,p)=>[g.name,p])),u=g=>{const p=(g.payload??[]).map(f=>({...f}));return p.sort((f,x)=>{const m=d.get(f.value)??999,v=d.get(x.value)??999;return m-v}),F.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:8,gap:16,flexWrap:"wrap"},children:p.map(f=>F.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[F.jsx("div",{style:{width:12,height:12,backgroundColor:f.color,borderRadius:2}}),F.jsx("span",{style:{fontSize:n,fontWeight:o,color:l},children:f.value})]},Math.random()))})};return F.jsx(C.ResponsiveContainer,{width:"100%",height:r,children:F.jsxs(C.PieChart,{children:[F.jsx(C.Pie,{data:s,dataKey:"value",cx:"50%",cy:"45%",stroke:"none",outerRadius:100,innerRadius:0,paddingAngle:0,onMouseEnter:(g,p)=>h(p),onMouseLeave:()=>h(null),children:s.map((g,p)=>F.jsx(C.Cell,{fill:e[p%e.length],opacity:c===null||c===p?1:.5,style:{transition:"opacity 0.2s ease",cursor:"pointer"}},`cell-${p}`))}),i&&F.jsx(C.Tooltip,{contentStyle:{backgroundColor:a,border:"none",borderRadius:4,padding:"8px 12px"},formatter:g=>[g,"Patients"]}),t&&F.jsx(oi,{content:u})]})})},Dh=({data:s,series:e,height:t=350,tooltipEnabled:i=!0,legendEnabled:a=!0,barSize:r=15,radius:n=2,yAxisWidth:o=35,yDomain:l})=>{const c=h=>{const{payload:d}=h;if(!d||d.length===0)return null;const u=[...d].sort((g,p)=>{const f=e.findIndex(m=>m.name===g.value||m.key===g.dataKey),x=e.findIndex(m=>m.name===p.value||m.key===p.dataKey);return f-x});return F.jsx("div",{style:{display:"flex",justifyContent:"center",gap:"20px",marginTop:"20px",flexWrap:"wrap"},children:u.map((g,p)=>F.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[F.jsx("div",{style:{width:"12px",height:"12px",backgroundColor:g.color,borderRadius:"2px"}}),F.jsx("span",{style:{fontSize:"12px",color:"#666"},children:g.value})]},`item-${p}`))})};return F.jsx("div",{style:{width:"100%",height:t},children:F.jsx(C.ResponsiveContainer,{width:"100%",height:"100%",children:F.jsxs(C.BarChart,{data:s,margin:{top:20,right:0,left:0,bottom:0},children:[F.jsx(C.CartesianGrid,{strokeDasharray:"0",vertical:!1,stroke:"#f1f5f9"}),F.jsx(C.XAxis,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"#64748b"},dy:10}),F.jsx(C.YAxis,{axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"#64748b"},width:o,domain:l}),i&&F.jsx(C.Tooltip,{cursor:{fill:"#f1f5f9",opacity:.4},contentStyle:{backgroundColor:"#ffffff",border:"1px solid #f1f5f9",borderRadius:"8px",padding:"10px",boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1)"},labelStyle:{color:"#1e293b",fontWeight:"bold",marginBottom:"5px",fontSize:"14px"},itemStyle:{fontSize:"12px",padding:"2px 0"},itemSorter:h=>e.findIndex(u=>u.name===h.name)}),a&&F.jsx(oi,{content:c}),e.map((h,d)=>{const u=d===e.length-1;return F.jsx(C.Bar,{dataKey:h.key,name:h.name,stackId:"a",fill:h.color,barSize:r,radius:u?[n,n,0,0]:0},h.key)})]})})})};exports.PeriodRange=C.PeriodRange;exports.SimpleBarChart=C.SimpleBarChart;exports.Area=Ah;exports.AreaChartV2=Eh;exports.BoxPlotChart=Ch;exports.ChartV2=Ih;exports.HorizontalBarChart=Sh;exports.PieChartV2=zh;exports.SankeyChartV2=Rh;exports.StackedBarChartV2=Dh;
|
package/dist/chart.js
CHANGED
|
@@ -15583,18 +15583,19 @@ const Er = /* @__PURE__ */ Ua(zu), Du = ["#e24b33", "#e2b23a", "#6feff0", "#2f5b
|
|
|
15583
15583
|
backgroundColor: a = "#ffffff",
|
|
15584
15584
|
stacked: r = !0,
|
|
15585
15585
|
fontSize: n = "12px",
|
|
15586
|
-
fontWeight: o = "400"
|
|
15586
|
+
fontWeight: o = "400",
|
|
15587
|
+
yDomain: l
|
|
15587
15588
|
}) => {
|
|
15588
|
-
const
|
|
15589
|
-
const
|
|
15590
|
-
return s.series.forEach((
|
|
15591
|
-
|
|
15592
|
-
}),
|
|
15593
|
-
}),
|
|
15594
|
-
const
|
|
15595
|
-
return
|
|
15596
|
-
const
|
|
15597
|
-
return
|
|
15589
|
+
const c = s.labels.map((g, p) => {
|
|
15590
|
+
const f = { label: g };
|
|
15591
|
+
return s.series.forEach((x) => {
|
|
15592
|
+
f[x.key] = x.data[p] ?? 0;
|
|
15593
|
+
}), f;
|
|
15594
|
+
}), h = new Map(s.series.map((g, p) => [g.key, p])), d = (g) => {
|
|
15595
|
+
const p = (g.payload ?? []).map((f) => ({ ...f }));
|
|
15596
|
+
return p.sort((f, x) => {
|
|
15597
|
+
const m = h.get(f.dataKey) ?? 999, v = h.get(x.dataKey) ?? 999;
|
|
15598
|
+
return m - v;
|
|
15598
15599
|
}), /* @__PURE__ */ H(
|
|
15599
15600
|
"div",
|
|
15600
15601
|
{
|
|
@@ -15605,32 +15606,32 @@ const Er = /* @__PURE__ */ Ua(zu), Du = ["#e24b33", "#e2b23a", "#6feff0", "#2f5b
|
|
|
15605
15606
|
gap: 16,
|
|
15606
15607
|
flexWrap: "wrap"
|
|
15607
15608
|
},
|
|
15608
|
-
children:
|
|
15609
|
+
children: p.map((f) => /* @__PURE__ */ pe("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
15609
15610
|
/* @__PURE__ */ H(
|
|
15610
15611
|
"div",
|
|
15611
15612
|
{
|
|
15612
15613
|
style: {
|
|
15613
15614
|
width: 12,
|
|
15614
15615
|
height: 12,
|
|
15615
|
-
backgroundColor:
|
|
15616
|
+
backgroundColor: f.color,
|
|
15616
15617
|
borderRadius: 2
|
|
15617
15618
|
}
|
|
15618
15619
|
}
|
|
15619
15620
|
),
|
|
15620
|
-
/* @__PURE__ */ H("span", { style: { fontSize: n, fontWeight: o, color: "#374151" }, children:
|
|
15621
|
-
] },
|
|
15621
|
+
/* @__PURE__ */ H("span", { style: { fontSize: n, fontWeight: o, color: "#374151" }, children: f.value })
|
|
15622
|
+
] }, f.value))
|
|
15622
15623
|
}
|
|
15623
15624
|
);
|
|
15624
|
-
},
|
|
15625
|
-
const
|
|
15626
|
-
if (
|
|
15627
|
-
if (
|
|
15628
|
-
const
|
|
15629
|
-
for (let
|
|
15630
|
-
|
|
15631
|
-
return Array.from(new Set(
|
|
15625
|
+
}, u = ur.useMemo(() => {
|
|
15626
|
+
const g = s.labels.length;
|
|
15627
|
+
if (g <= 0) return [];
|
|
15628
|
+
if (g <= 12) return s.labels;
|
|
15629
|
+
const p = 5, f = (g - 1) / (p - 1), x = [];
|
|
15630
|
+
for (let m = 0; m < p; m++)
|
|
15631
|
+
x.push(s.labels[Math.round(m * f)]);
|
|
15632
|
+
return Array.from(new Set(x));
|
|
15632
15633
|
}, [s.labels]);
|
|
15633
|
-
return /* @__PURE__ */ H("div", { style: { width: "100%", height: "100%", backgroundColor: a }, children: /* @__PURE__ */ H(St, { width: "100%", height: e, children: /* @__PURE__ */ pe(bn, { data:
|
|
15634
|
+
return /* @__PURE__ */ H("div", { style: { width: "100%", height: "100%", backgroundColor: a }, children: /* @__PURE__ */ H(St, { width: "100%", height: e, children: /* @__PURE__ */ pe(bn, { data: c, margin: { left: 20, right: 45, top: 10, bottom: 20 }, children: [
|
|
15634
15635
|
/* @__PURE__ */ H(cr, { stroke: "#E5E7EB", vertical: !1 }),
|
|
15635
15636
|
/* @__PURE__ */ H(
|
|
15636
15637
|
hr,
|
|
@@ -15642,7 +15643,7 @@ const Er = /* @__PURE__ */ Ua(zu), Du = ["#e24b33", "#e2b23a", "#6feff0", "#2f5b
|
|
|
15642
15643
|
tickLine: !1,
|
|
15643
15644
|
tickMargin: 10,
|
|
15644
15645
|
interval: 0,
|
|
15645
|
-
ticks:
|
|
15646
|
+
ticks: u,
|
|
15646
15647
|
scale: "point",
|
|
15647
15648
|
height: 45,
|
|
15648
15649
|
tick: /* @__PURE__ */ H(_u, { fontSize: n, fontWeight: o })
|
|
@@ -15655,28 +15656,29 @@ const Er = /* @__PURE__ */ Ua(zu), Du = ["#e24b33", "#e2b23a", "#6feff0", "#2f5b
|
|
|
15655
15656
|
fontWeight: o,
|
|
15656
15657
|
axisLine: !1,
|
|
15657
15658
|
tickLine: !1,
|
|
15658
|
-
width: 30
|
|
15659
|
+
width: 30,
|
|
15660
|
+
domain: l
|
|
15659
15661
|
}
|
|
15660
15662
|
),
|
|
15661
15663
|
t && /* @__PURE__ */ H(
|
|
15662
15664
|
ni,
|
|
15663
15665
|
{
|
|
15664
|
-
itemSorter: (
|
|
15666
|
+
itemSorter: (g) => h.get(g.dataKey) ?? 999
|
|
15665
15667
|
}
|
|
15666
15668
|
),
|
|
15667
|
-
i && /* @__PURE__ */ H(_i, { content:
|
|
15668
|
-
s.series.map((
|
|
15669
|
+
i && /* @__PURE__ */ H(_i, { content: d }),
|
|
15670
|
+
s.series.map((g) => /* @__PURE__ */ H(
|
|
15669
15671
|
fr,
|
|
15670
15672
|
{
|
|
15671
15673
|
type: "monotone",
|
|
15672
|
-
dataKey:
|
|
15674
|
+
dataKey: g.key,
|
|
15673
15675
|
stackId: r ? "1" : void 0,
|
|
15674
|
-
fill:
|
|
15676
|
+
fill: g.color,
|
|
15675
15677
|
stroke: "none",
|
|
15676
15678
|
fillOpacity: 1,
|
|
15677
|
-
name:
|
|
15679
|
+
name: g.label
|
|
15678
15680
|
},
|
|
15679
|
-
|
|
15681
|
+
g.key
|
|
15680
15682
|
))
|
|
15681
15683
|
] }) }) });
|
|
15682
15684
|
}, Fu = (s) => {
|
|
@@ -15883,7 +15885,8 @@ const Er = /* @__PURE__ */ Ua(zu), Du = ["#e24b33", "#e2b23a", "#6feff0", "#2f5b
|
|
|
15883
15885
|
legendEnabled: a = !0,
|
|
15884
15886
|
barSize: r = 15,
|
|
15885
15887
|
radius: n = 2,
|
|
15886
|
-
yAxisWidth: o = 35
|
|
15888
|
+
yAxisWidth: o = 35,
|
|
15889
|
+
yDomain: l
|
|
15887
15890
|
}) => /* @__PURE__ */ H("div", { style: { width: "100%", height: t }, children: /* @__PURE__ */ H(St, { width: "100%", height: "100%", children: /* @__PURE__ */ pe(
|
|
15888
15891
|
il,
|
|
15889
15892
|
{
|
|
@@ -15912,7 +15915,8 @@ const Er = /* @__PURE__ */ Ua(zu), Du = ["#e24b33", "#e2b23a", "#6feff0", "#2f5b
|
|
|
15912
15915
|
axisLine: !1,
|
|
15913
15916
|
tickLine: !1,
|
|
15914
15917
|
tick: { fontSize: 12, fill: "#64748b" },
|
|
15915
|
-
width: o
|
|
15918
|
+
width: o,
|
|
15919
|
+
domain: l
|
|
15916
15920
|
}
|
|
15917
15921
|
),
|
|
15918
15922
|
i && /* @__PURE__ */ H(
|
|
@@ -15936,15 +15940,15 @@ const Er = /* @__PURE__ */ Ua(zu), Du = ["#e24b33", "#e2b23a", "#6feff0", "#2f5b
|
|
|
15936
15940
|
fontSize: "12px",
|
|
15937
15941
|
padding: "2px 0"
|
|
15938
15942
|
},
|
|
15939
|
-
itemSorter: (
|
|
15943
|
+
itemSorter: (h) => e.findIndex((u) => u.name === h.name)
|
|
15940
15944
|
}
|
|
15941
15945
|
),
|
|
15942
|
-
a && /* @__PURE__ */ H(_i, { content: (
|
|
15943
|
-
const { payload:
|
|
15944
|
-
if (!
|
|
15945
|
-
const
|
|
15946
|
-
const
|
|
15947
|
-
return
|
|
15946
|
+
a && /* @__PURE__ */ H(_i, { content: (h) => {
|
|
15947
|
+
const { payload: d } = h;
|
|
15948
|
+
if (!d || d.length === 0) return null;
|
|
15949
|
+
const u = [...d].sort((g, p) => {
|
|
15950
|
+
const f = e.findIndex((m) => m.name === g.value || m.key === g.dataKey), x = e.findIndex((m) => m.name === p.value || m.key === p.dataKey);
|
|
15951
|
+
return f - x;
|
|
15948
15952
|
});
|
|
15949
15953
|
return /* @__PURE__ */ H(
|
|
15950
15954
|
"div",
|
|
@@ -15956,36 +15960,36 @@ const Er = /* @__PURE__ */ Ua(zu), Du = ["#e24b33", "#e2b23a", "#6feff0", "#2f5b
|
|
|
15956
15960
|
marginTop: "20px",
|
|
15957
15961
|
flexWrap: "wrap"
|
|
15958
15962
|
},
|
|
15959
|
-
children:
|
|
15963
|
+
children: u.map((g, p) => /* @__PURE__ */ pe("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
15960
15964
|
/* @__PURE__ */ H(
|
|
15961
15965
|
"div",
|
|
15962
15966
|
{
|
|
15963
15967
|
style: {
|
|
15964
15968
|
width: "12px",
|
|
15965
15969
|
height: "12px",
|
|
15966
|
-
backgroundColor:
|
|
15970
|
+
backgroundColor: g.color,
|
|
15967
15971
|
borderRadius: "2px"
|
|
15968
15972
|
}
|
|
15969
15973
|
}
|
|
15970
15974
|
),
|
|
15971
|
-
/* @__PURE__ */ H("span", { style: { fontSize: "12px", color: "#666" }, children:
|
|
15972
|
-
] }, `item-${
|
|
15975
|
+
/* @__PURE__ */ H("span", { style: { fontSize: "12px", color: "#666" }, children: g.value })
|
|
15976
|
+
] }, `item-${p}`))
|
|
15973
15977
|
}
|
|
15974
15978
|
);
|
|
15975
15979
|
} }),
|
|
15976
|
-
e.map((
|
|
15977
|
-
const
|
|
15980
|
+
e.map((h, d) => {
|
|
15981
|
+
const u = d === e.length - 1;
|
|
15978
15982
|
return /* @__PURE__ */ H(
|
|
15979
15983
|
ka,
|
|
15980
15984
|
{
|
|
15981
|
-
dataKey:
|
|
15982
|
-
name:
|
|
15985
|
+
dataKey: h.key,
|
|
15986
|
+
name: h.name,
|
|
15983
15987
|
stackId: "a",
|
|
15984
|
-
fill:
|
|
15988
|
+
fill: h.color,
|
|
15985
15989
|
barSize: r,
|
|
15986
|
-
radius:
|
|
15990
|
+
radius: u ? [n, n, 0, 0] : 0
|
|
15987
15991
|
},
|
|
15988
|
-
|
|
15992
|
+
h.key
|
|
15989
15993
|
);
|
|
15990
15994
|
})
|
|
15991
15995
|
]
|
|
@@ -18,6 +18,7 @@ interface Props {
|
|
|
18
18
|
fontSize?: string;
|
|
19
19
|
fontWeight?: string;
|
|
20
20
|
legendEnabled?: boolean;
|
|
21
|
+
yDomain?: [number, number] | [string, string] | [(value: number) => number, (value: number) => number];
|
|
21
22
|
}
|
|
22
23
|
export declare const AreaChartV2: React.FC<Props>;
|
|
23
24
|
export default AreaChartV2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChartV2.d.ts","sourceRoot":"","sources":["../../../../src/components/AreaChartV2/AreaChartV2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,UAAU,KAAK;IACb,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AreaChartV2.d.ts","sourceRoot":"","sources":["../../../../src/components/AreaChartV2/AreaChartV2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,UAAU,KAAK;IACb,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EACJ,CAAC,MAAM,EAAE,MAAM,CAAC,GAChB,CAAC,MAAM,EAAE,MAAM,CAAC,GAChB,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;CAC5D;AA6CD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAsIvC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -17,6 +17,7 @@ export interface StackedBarChartV2Props {
|
|
|
17
17
|
barSize?: number;
|
|
18
18
|
radius?: number | [number, number, number, number];
|
|
19
19
|
yAxisWidth?: number;
|
|
20
|
+
yDomain?: [number, number] | [string, string] | [(value: number) => number, (value: number) => number];
|
|
20
21
|
}
|
|
21
22
|
export declare const StackedBarChartV2: React.FC<StackedBarChartV2Props>;
|
|
22
23
|
export default StackedBarChartV2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackedBarChartV2.d.ts","sourceRoot":"","sources":["../../../../../src/components/Charts/stacked-bar-v2/StackedBarChartV2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"StackedBarChartV2.d.ts","sourceRoot":"","sources":["../../../../../src/components/Charts/stacked-bar-v2/StackedBarChartV2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EACJ,CAAC,MAAM,EAAE,MAAM,CAAC,GAChB,CAAC,MAAM,EAAE,MAAM,CAAC,GAChB,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;CAC5D;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA4H9D,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|