@cleen/ui 0.1.121 → 0.1.123
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/charts/index.d.ts +22 -1
- package/dist/charts/index.js +3 -3
- package/package.json +1 -1
package/dist/charts/index.d.ts
CHANGED
|
@@ -168,7 +168,28 @@ interface SankeyChartProps {
|
|
|
168
168
|
}
|
|
169
169
|
declare function SankeyChart({ data, options, className, style, onNodeClick, }: SankeyChartProps): react_jsx_runtime.JSX.Element;
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
type TooltipPrimitive = string | number | null | undefined;
|
|
172
|
+
interface TreemapChartTooltipContent {
|
|
173
|
+
tooltipTitle?: TooltipPrimitive;
|
|
174
|
+
tooltipText?: TooltipPrimitive;
|
|
175
|
+
tooltipFooter?: TooltipPrimitive;
|
|
176
|
+
}
|
|
177
|
+
interface TreemapChartDataPoint extends TreemapChartTooltipContent {
|
|
178
|
+
x?: TooltipPrimitive;
|
|
179
|
+
y?: TooltipPrimitive;
|
|
180
|
+
[key: string]: unknown;
|
|
181
|
+
}
|
|
182
|
+
interface TreemapChartTooltipResolverContext {
|
|
183
|
+
point: TreemapChartDataPoint;
|
|
184
|
+
seriesName?: string;
|
|
185
|
+
seriesIndex: number;
|
|
186
|
+
dataPointIndex: number;
|
|
187
|
+
}
|
|
188
|
+
type TreemapChartTooltipResolver = (context: TreemapChartTooltipResolverContext) => TreemapChartTooltipContent | null | undefined;
|
|
189
|
+
interface TreemapChartProps extends Omit<ChartProps, 'type'> {
|
|
190
|
+
getTooltipContent?: TreemapChartTooltipResolver;
|
|
191
|
+
}
|
|
192
|
+
declare const TreemapChart: react.ForwardRefExoticComponent<TreemapChartProps & react.RefAttributes<ReactApexChart>>;
|
|
172
193
|
|
|
173
194
|
type SimpleChartProps = {
|
|
174
195
|
width?: number;
|
package/dist/charts/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cn as Ne}from"@cleen/ui-core";import{forwardRef as Te}from"react";import Re from"react-apexcharts";var K={chart:{toolbar:{show:!0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0}},animations:{enabled:!0}},dataLabels:{enabled:!1},stroke:{curve:"smooth",width:2},xaxis:{labels:{style:{fontSize:"12px"}}},yaxis:{labels:{style:{fontSize:"12px"}}},legend:{position:"top",horizontalAlign:"left"},tooltip:{enabled:!0,theme:"light"}};import{jsx as J}from"react/jsx-runtime";var Q=Te(function({type:t="line",series:r,options:o={},width:g="100%",height:m=350,className:p,style:y},d){let S={...K,...o,chart:{...K.chart,...o.chart,type:t}};return J("div",{className:Ne("cleen",p),style:y,children:J(Re,{options:S,series:r,type:t,width:g,height:m,ref:d})})}),P=Q;import{applyDefaults as z}from"@cleen/ui-core";import{forwardRef as Pe,useMemo as _}from"react";import{ColorHelpers as E}from"@cleen/ui-core";var ee={marker:{size:2,fillColor:"rgba(var(--cleen-gray), 0.8)",strokeColor:"rgba(var(--cleen-gray), 0.8)",offsetY:-16,shape:"triangle"},label:{borderWidth:0,offsetY:-20,style:{color:"rgba(var(--cleen-gray), 0.8)",background:"transparent",fontSize:"11px"}}},te={label:{borderColor:"transparent",style:{color:"rgba(var(--cleen-white))",background:"rgba(var(--cleen-primary))"}},fillColor:"rgba(var(--cleen-primary))"},re={label:{borderWidth:0,offsetY:-15,orientation:"horizontal",style:{color:"rgba(var(--cleen-primary))",background:"transparent",fontSize:"16px",fontWeight:700}},borderColor:"rgba(var(--cleen-primary))"},oe={marker:{size:8,fillColor:"rgba(var(--cleen-primary))",strokeColor:"rgba(var(--cleen-white))"}},ne={chart:{zoom:{enabled:!1},toolbar:{show:!1},animations:{enabled:!1}},stroke:{curve:"monotoneCubic",width:2.5},colors:[E.getComputedColor("var(--cleen-error)"),E.getComputedColor("var(--cleen-primary)"),E.getComputedColor("var(--cleen-success)")],fill:{type:"gradient",gradient:{shade:"light",type:"vertical",shadeIntensity:.6,gradientToColors:[E.getComputedColor("var(--cleen-error)")||"",E.getComputedColor("var(--cleen-primary)")||"",E.getComputedColor("var(--cleen-success)")||""],inverseColors:!1,opacityFrom:.95,opacityTo:.6}},yaxis:{show:!1},tooltip:{enabled:!0,x:{formatter:function(e){return`Score: ${typeof e=="string"?Number(e):e}`}},y:{formatter:function(e){return`${Number(e).toFixed(4)}`}}},grid:{show:!1},legend:{show:!1}};var ae=(e,t)=>({middle:e,leftSigma:e-t,left2Sigma:e-2*t,left:e-3*t,rightSigma:e+2*t,right2Sigma:e+2*t,right:e+3*t}),ie=(e,t,r,o)=>({middle:e,leftSigma:e-t,left2Sigma:e-2*t,left:r,rightSigma:e+t,right2Sigma:e+2*t,right:o}),se=(e,t)=>{let r={};switch(e.type){case"range":r={x:t[e.x],x2:t[e.x2]};break;case"offset":r={x:e.x-e.offset,x2:e.x+e.offset};break;case"region":e.x>=t.left&&e.x<t.left2Sigma?r={x:t.left,x2:t.left2Sigma}:e.x>=t.left2Sigma&&e.x<t.leftSigma?r={x:t.left2Sigma,x2:t.leftSigma}:e.x>=t.leftSigma&&e.x<t.middle?r={x:t.leftSigma,x2:t.middle}:e.x>=t.middle&&e.x<t.rightSigma?r={x:t.middle,x2:t.rightSigma}:e.x>=t.rightSigma&&e.x<t.right2Sigma?r={x:t.rightSigma,x2:t.right2Sigma}:e.x>=t.right2Sigma&&e.x<t.right&&(r={x:t.right2Sigma,x2:t.right});break;default:r={x:e.x,x2:e.x2};break}return r};import{jsx as Le}from"react/jsx-runtime";var we=Pe(function({serie:t,labels:r,sigma:o,pointAnnotations:g,rangeAnnotations:m,highlightAnnotations:p,options:y,height:d=360,...S},n){let b=_(()=>t.sort((u,h)=>u.x-h.x),[t]),k=_(()=>{let u=new Map;return t.forEach(h=>u.set(h.x,h.y)),u},[t]),c=b[Math.floor(b.length/2)],A=_(()=>{let{below:u,middle:h,above:C}=t.reduce((a,i)=>(i.x<c.x-2*o?a.below.push(i):i.x>=c.x+2*o?(i.x===c.x+2*o&&a.middle.push(i),a.above.push(i)):(i.x===c.x-2*o&&a.below.push(i),a.middle.push(i)),a),{below:[],middle:[],above:[]});return[{name:r?.below||"Below threshold",data:u},{name:r?.middle||"Middle grounds",data:h},{name:r?.above||"Above threshold",data:C}]},[o,t,r,c]),O=_(()=>{if(!g)return[];let u=ae(c.x,o);return Object.entries(g).map(([h,C])=>{let a=u[h];return{x:a,y:k.get(a)||0,...z(ee,C)}})},[g,o,k]),N=_(()=>{if(!m)return[];let u=ie(c.x,o,b[0].x,b[b.length-1].x);return m.map(h=>{let C=se(h,u);return{...z(te,h),...C}})},[m,o,b]),{highlightPointAnnotations:R,highlightLineAnnotations:T}=_(()=>{if(!p)return{highlightLineAnnotations:[],highlightPointAnnotations:[]};let u=[],h=[],C=({x:i,line:s})=>{h.push(z(re,{x:i,...s}))},a=({x:i,y:s,point:l})=>{u.push(z(oe,{x:i,y:s,...l}))};return p?.forEach(i=>{switch(i.show){case"line":C(i);break;case"point":a(i);break;case"both":C(i),a(i);break;default:break}}),{highlightPointAnnotations:u,highlightLineAnnotations:h}},[p]);return Le(P,{series:A,options:{...z(ne,y),annotations:{...y?.annotations,points:[...O,...R,...y?.annotations?.points||[]],xaxis:[...N,...T,...y?.annotations?.xaxis||[]]}},height:d,ref:n,type:"area",...S})});import{applyDefaults as He}from"@cleen/ui-core";import{forwardRef as Ie}from"react";var le={chart:{type:"radar",zoom:{enabled:!1},toolbar:{show:!1}},stroke:{width:2},fill:{opacity:.25},markers:{size:4,colors:"transparent",strokeColors:"transparent"},tooltip:{marker:{show:!1}},legend:{show:!1}};import{jsx as _e}from"react/jsx-runtime";var Ee=Ie(function({options:t,...r},o){return _e(P,{type:"radar",ref:o,options:He(le,t),...r})});import{applyDefaults as $e,cn as Be}from"@cleen/ui-core";import{forwardRef as ze}from"react";var ce={chart:{type:"scatter",zoom:{enabled:!1},toolbar:{show:!1}},markers:{shape:"square",size:8,strokeWidth:0},grid:{strokeDashArray:8},legend:{show:!0,horizontalAlign:"right",position:"top",labels:{colors:"rgba(var(--cleen-gray), 0.8)"}},yaxis:{axisBorder:{show:!0,color:"rgba(var(--cleen-gray), .2)"},labels:{style:{colors:"rgba(var(--cleen-gray), 0.8)"}}},xaxis:{axisBorder:{show:!0,color:"rgba(var(--cleen-gray), .2)"},labels:{style:{colors:"rgba(var(--cleen-gray), 0.8)"}}},title:{align:"left",floating:!0,style:{color:"rgba(var(--cleen-black))"}}},pe={chart:{type:"scatter",zoom:{enabled:!1},toolbar:{show:!1}},stroke:{width:0},fill:{opacity:1},markers:{shape:"circle",size:14,strokeWidth:2,hover:{sizeOffset:0}},grid:{strokeDashArray:0,borderColor:"rgba(var(--cleen-gray), 0.12)",padding:{left:0,right:12},xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},legend:{show:!1},xaxis:{min:0,max:210,tickAmount:4,axisBorder:{show:!1},axisTicks:{show:!1},decimalsInFloat:0,title:{text:"Estimated impact \u2192",style:{color:"rgba(var(--cleen-gray), 0.8)",fontSize:"14px",fontWeight:400}},labels:{style:{colors:"rgba(var(--cleen-gray), 0.8)",fontSize:"14px"},formatter(e){let t=Number(e);return Number.isNaN(t)?`${e}`:`$${Math.round(t)}k`}}},tooltip:{enabled:!0,theme:"light",x:{formatter(e){let t=Number(e);return Number.isNaN(t)?`${e}`:`$${Math.round(t)}k`}}}};import{jsx as M,jsxs as de}from"react/jsx-runtime";var Me=ze(function({options:t,variant:r="default",rows:o,className:g,style:m,...p},y){let S=$e(r==="matrix"?pe:ce,t);if(r==="matrix"&&o?.length){let n=Math.min(...o.map(c=>c.y)),b=Math.max(...o.map(c=>c.y)),k=Array.isArray(S.yaxis)?{}:S.yaxis??{};return de("div",{className:Be("cleen",g),style:{display:"grid",gridTemplateColumns:"156px minmax(0, 1fr)",alignItems:"stretch",gap:"12px",width:"100%",...m},children:[M("div",{style:{display:"grid",gridTemplateRows:`repeat(${o.length}, minmax(0, 1fr))`,padding:"18px 0 54px"},children:o.map(c=>de("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-end",gap:"4px",paddingRight:"8px"},children:[M("span",{style:{fontSize:"18px",fontWeight:700,lineHeight:1.1,color:"rgba(var(--cleen-black))"},children:c.label}),c.gapsLabel?M("span",{style:{fontSize:"14px",lineHeight:1.2,color:"rgba(var(--cleen-gray), 0.8)"},children:c.gapsLabel}):null]},`${c.label}-${c.y}`))}),M(P,{type:"scatter",ref:y,className:"cleen-w-full",style:{height:"100%"},options:{...S,yaxis:{...k,min:n-.5,max:b+.5,tickAmount:Math.max(b-n,1),axisBorder:{...k.axisBorder,show:!1},axisTicks:{...k.axisTicks,show:!1},labels:{...k.labels,show:!1}},annotations:{...S.annotations,yaxis:[...o.map(c=>({y:c.y,borderColor:c.lineColor||"rgba(var(--cleen-gray), 0.12)",strokeDashArray:0})),...S.annotations?.yaxis||[]]}},...p})]})}return M(P,{type:"scatter",ref:y,className:g,style:m,options:S,...p})});import{applyDefaults as De,cn as Fe}from"@cleen/ui-core";import{useId as Ge,useMemo as F,useRef as We,useState as Xe}from"react";import{Layer as Ce,Rectangle as ue,ResponsiveContainer as Ue,Sankey as Ke,Tooltip as je}from"recharts";var L={width:"100%",height:420,nodePadding:24,enableToolbar:!1,enableTooltip:!0,highlightOnHover:!0,dimOnHover:!0,dimOpacity:.2,edgeOpacity:.4,edgeGradientFill:!0,nodeWidth:20,nodeBorderWidth:0,nodeBorderColor:null,align:"justify",fontColor:"rgba(var(--cleen-neutral-800, 38, 38, 38))",tooltipBGColor:"rgba(var(--cleen-white))",tooltipBorderColor:"rgba(var(--cleen-gray), 0.2)"};import{jsx as x,jsxs as B}from"react/jsx-runtime";var Ve=typeof L.height=="number"?L.height:420,ge=40,fe=60,me=8,Ye=8;function qe(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let t=e.trim();if(!t.endsWith("%")&&t!=="auto"){let r=Number.parseFloat(t);if(Number.isFinite(r))return r}}return Ve}function he(e){return typeof e=="object"&&e!==null&&"id"in e&&"title"in e}function Ze(e){return typeof e=="object"&&e!==null&&"id"in e&&"title"in e&&"index"in e&&"name"in e}var ye=["rgba(var(--cleen-primary, 59, 130, 246))","rgba(var(--cleen-success, 34, 197, 94))","rgba(var(--cleen-warning, 245, 158, 11))","rgba(var(--cleen-error, 239, 68, 68))","rgba(var(--cleen-purple, 147, 51, 234))","rgba(var(--cleen-cyan, 6, 182, 212))","rgba(var(--cleen-orange, 249, 115, 22))","rgba(var(--cleen-pink, 236, 72, 153))","rgba(var(--cleen-teal, 20, 184, 166))","rgba(var(--cleen-indigo, 99, 102, 241))","rgba(var(--cleen-rose, 244, 63, 94))","rgba(var(--cleen-amber, 245, 158, 11))"];function ke(e){return e!=null}function Je(e,t){return[e.source,e.target,e.type??"",e.label??"",e.value,t].join("-").replace(/\s+/g,"_")}function W(e,t){return typeof e=="object"&&e!==null?e.id:t}function be(e,t){return typeof e=="object"&&e!==null?e.title:t}function j(e){return typeof e=="object"&&e!==null&&"edgeKey"in e&&"sourceId"in e&&"targetId"in e}function V(e){return typeof e=="object"&&e!==null&&"payload"in e}function ve(e){if(V(e))return ve(e.payload);if(j(e)||Ze(e))return e}function G(...e){return e.map(t=>typeof t=="number"?String(t):t?.trim()??"").find(t=>t.length>0)}function xe(e){let t=G(e);if(t)return/[\p{L}\p{N}]/u.test(t)?t:void 0}function Ae(e){return e.replace(/[^a-zA-Z0-9_-]/g,"_")}function $(e){let t=e.match(/^rgba\((var\(.+\)),\s*([0-9]*\.?[0-9]+)\)$/i);if(t)return{color:`rgb(${t[1]})`,opacity:Number.parseFloat(t[2])};let r=e.match(/^rgba\((var\(.+\))\)$/i);if(r)return{color:`rgb(${r[1]})`,opacity:1};let o=e.match(/^rgba\(\s*(\d+\s*,\s*\d+\s*,\s*\d+)\s*,\s*([0-9]*\.?[0-9]+)\s*\)$/i);return o?{color:`rgb(${o[1]})`,opacity:Number.parseFloat(o[2])}:{color:e,opacity:1}}function Y(e,t){return $(t??ye[e%ye.length])}function Se(e){return e.length*Ye}function Qe(e){let t=new Set,r=new Set([e.id]);for(let o of[...e.sourceLinks??[],...e.targetLinks??[]])t.add(o.edgeKey),r.add(W(o.source,o.sourceId)),r.add(W(o.target,o.targetId));return{activeLinkKeys:t,activeNodeIds:r}}function et(e){return{activeLinkKeys:new Set([e.edgeKey]),activeNodeIds:new Set([W(e.source,e.sourceId),W(e.target,e.targetId)])}}function tt(e,t,r,o,g){return!e||e.activeNodeIds.has(t)?1:o?g??L.dimOpacity??.2:r?.55:1}function rt(e,t,r,o,g,m){return e?e.activeLinkKeys.has(t)?o?Math.max(r,.9):r:g?m??L.dimOpacity??.2:o?Math.min(r,.3):r:r}var ot=({dimOnHover:e,dimOpacity:t,fontColor:r,x:o,y:g,width:m,height:p,highlightOnHover:y,hoverState:d,index:S,outgoingEdgesById:n,payload:b,stroke:k,strokeWidth:c})=>{if(b===void 0||o===void 0||g===void 0||m===void 0||p===void 0||S===void 0)return null;let A=n?.get(b.id)??[],O=A.length>0,N=Y(S,b.color),R=$(r),T=tt(d,b.id,y,e,t),u=new Set(A.map(s=>s.color).filter(ke)),h=Array.from(u)[0],C=O&&A.length>1&&u.size>1&&u.size===A.length,a=C?A:[],i=a.reduce((s,l)=>s+(l.value??0),0);return B(Ce,{children:[C&&i>0?a.map((s,l)=>{let f=a.slice(0,l).reduce((X,U)=>X+(U.value??0),0),v=g+f/i*p,w=(s.value??0)/i*p,D=$(s.color??N.color),H=l===0,I=l===a.length-1;return x(ue,{x:o,y:v,width:m,height:w,fill:D.color,fillOpacity:D.opacity*T,stroke:k,strokeWidth:c,radius:[H?2:0,H?2:0,I?2:0,I?2:0]},`${s.source}-${s.target}-${l}`)}):x(ue,{x:o,y:g,width:m,height:p,fill:O&&u.size===1?$(h??N.color).color:N.color,fillOpacity:(O&&u.size===1?$(h??N.color).opacity:N.opacity)*T,stroke:k,strokeWidth:c,radius:[2,2,2,2]}),x("text",{textAnchor:O?"end":"start",x:O?o-8:o+m+8,y:g+p/2,dy:"0.35em",fontSize:"14",fill:R.color,fillOpacity:R.opacity*T,fontWeight:600,children:b.name})]},`CustomNode${S}`)},nt=({sourceX:e,targetX:t,sourceY:r,targetY:o,sourceControlX:g,targetControlX:m,linkWidth:p,index:y,payload:d,opacity:S,chartId:n,dimOnHover:b,dimOpacity:k,edgeGradientFill:c,highlightOnHover:A,hoverState:O})=>{if(d===void 0||e===void 0||t===void 0||r===void 0||o===void 0||g===void 0||m===void 0||p===void 0)return null;let N=S??L.edgeOpacity??.4,R=rt(O,d.edgeKey,N,A,b,k),T=d.color?$(d.color):null,u=T??Y(typeof d.source=="object"?d.source.index:0,typeof d.source=="object"?d.source.color:void 0),h=T??Y(typeof d.target=="object"?d.target.index:1,typeof d.target=="object"?d.target.color:void 0),C=Ae(`linkGradient-${n}-${d.edgeKey}-${y??d.value}`),a=c!==!1&&T===null;return B(Ce,{children:[a?x("defs",{children:B("linearGradient",{id:C,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[x("stop",{offset:"0%",stopColor:u.color,stopOpacity:u.opacity*R}),x("stop",{offset:"100%",stopColor:h.color,stopOpacity:h.opacity*R})]})}):null,x("path",{d:`
|
|
1
|
+
import{cn as Ie}from"@cleen/ui-core";import{forwardRef as Le}from"react";import He from"react-apexcharts";var j={chart:{toolbar:{show:!0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0}},animations:{enabled:!0}},dataLabels:{enabled:!1},stroke:{curve:"smooth",width:2},xaxis:{labels:{style:{fontSize:"12px"}}},yaxis:{labels:{style:{fontSize:"12px"}}},legend:{position:"top",horizontalAlign:"left"},tooltip:{enabled:!0,theme:"light"}};import{jsx as ee}from"react/jsx-runtime";var te=Le(function({type:t="line",series:r,options:o={},width:d="100%",height:g=350,className:c,style:u},p){let y={...j,...o,chart:{...j.chart,...o.chart,type:t}};return ee("div",{className:Ie("cleen",c),style:u,children:ee(He,{options:y,series:r,type:t,width:d,height:g,ref:p})})}),R=te;import{applyDefaults as z}from"@cleen/ui-core";import{forwardRef as Ee,useMemo as $}from"react";import{ColorHelpers as E}from"@cleen/ui-core";var re={marker:{size:2,fillColor:"rgba(var(--cleen-gray), 0.8)",strokeColor:"rgba(var(--cleen-gray), 0.8)",offsetY:-16,shape:"triangle"},label:{borderWidth:0,offsetY:-20,style:{color:"rgba(var(--cleen-gray), 0.8)",background:"transparent",fontSize:"11px"}}},oe={label:{borderColor:"transparent",style:{color:"rgba(var(--cleen-white))",background:"rgba(var(--cleen-primary))"}},fillColor:"rgba(var(--cleen-primary))"},ne={label:{borderWidth:0,offsetY:-15,orientation:"horizontal",style:{color:"rgba(var(--cleen-primary))",background:"transparent",fontSize:"16px",fontWeight:700}},borderColor:"rgba(var(--cleen-primary))"},ie={marker:{size:8,fillColor:"rgba(var(--cleen-primary))",strokeColor:"rgba(var(--cleen-white))"}},ae={chart:{zoom:{enabled:!1},toolbar:{show:!1},animations:{enabled:!1}},stroke:{curve:"monotoneCubic",width:2.5},colors:[E.getComputedColor("var(--cleen-error)"),E.getComputedColor("var(--cleen-primary)"),E.getComputedColor("var(--cleen-success)")],fill:{type:"gradient",gradient:{shade:"light",type:"vertical",shadeIntensity:.6,gradientToColors:[E.getComputedColor("var(--cleen-error)")||"",E.getComputedColor("var(--cleen-primary)")||"",E.getComputedColor("var(--cleen-success)")||""],inverseColors:!1,opacityFrom:.95,opacityTo:.6}},yaxis:{show:!1},tooltip:{enabled:!0,x:{formatter:function(e){return`Score: ${typeof e=="string"?Number(e):e}`}},y:{formatter:function(e){return`${Number(e).toFixed(4)}`}}},grid:{show:!1},legend:{show:!1}};var se=(e,t)=>({middle:e,leftSigma:e-t,left2Sigma:e-2*t,left:e-3*t,rightSigma:e+2*t,right2Sigma:e+2*t,right:e+3*t}),le=(e,t,r,o)=>({middle:e,leftSigma:e-t,left2Sigma:e-2*t,left:r,rightSigma:e+t,right2Sigma:e+2*t,right:o}),pe=(e,t)=>{let r={};switch(e.type){case"range":r={x:t[e.x],x2:t[e.x2]};break;case"offset":r={x:e.x-e.offset,x2:e.x+e.offset};break;case"region":e.x>=t.left&&e.x<t.left2Sigma?r={x:t.left,x2:t.left2Sigma}:e.x>=t.left2Sigma&&e.x<t.leftSigma?r={x:t.left2Sigma,x2:t.leftSigma}:e.x>=t.leftSigma&&e.x<t.middle?r={x:t.leftSigma,x2:t.middle}:e.x>=t.middle&&e.x<t.rightSigma?r={x:t.middle,x2:t.rightSigma}:e.x>=t.rightSigma&&e.x<t.right2Sigma?r={x:t.rightSigma,x2:t.right2Sigma}:e.x>=t.right2Sigma&&e.x<t.right&&(r={x:t.right2Sigma,x2:t.right});break;default:r={x:e.x,x2:e.x2};break}return r};import{jsx as _e}from"react/jsx-runtime";var $e=Ee(function({serie:t,labels:r,sigma:o,pointAnnotations:d,rangeAnnotations:g,highlightAnnotations:c,options:u,height:p=360,...y},n){let x=$(()=>t.sort((f,b)=>f.x-b.x),[t]),S=$(()=>{let f=new Map;return t.forEach(b=>f.set(b.x,b.y)),f},[t]),m=x[Math.floor(x.length/2)],A=$(()=>{let{below:f,middle:b,above:v}=t.reduce((i,a)=>(a.x<m.x-2*o?i.below.push(a):a.x>=m.x+2*o?(a.x===m.x+2*o&&i.middle.push(a),i.above.push(a)):(a.x===m.x-2*o&&i.below.push(a),i.middle.push(a)),i),{below:[],middle:[],above:[]});return[{name:r?.below||"Below threshold",data:f},{name:r?.middle||"Middle grounds",data:b},{name:r?.above||"Above threshold",data:v}]},[o,t,r,m]),T=$(()=>{if(!d)return[];let f=se(m.x,o);return Object.entries(d).map(([b,v])=>{let i=f[b];return{x:i,y:S.get(i)||0,...z(re,v)}})},[d,o,S]),O=$(()=>{if(!g)return[];let f=le(m.x,o,x[0].x,x[x.length-1].x);return g.map(b=>{let v=pe(b,f);return{...z(oe,b),...v}})},[g,o,x]),{highlightPointAnnotations:P,highlightLineAnnotations:N}=$(()=>{if(!c)return{highlightLineAnnotations:[],highlightPointAnnotations:[]};let f=[],b=[],v=({x:a,line:s})=>{b.push(z(ne,{x:a,...s}))},i=({x:a,y:s,point:l})=>{f.push(z(ie,{x:a,y:s,...l}))};return c?.forEach(a=>{switch(a.show){case"line":v(a);break;case"point":i(a);break;case"both":v(a),i(a);break;default:break}}),{highlightPointAnnotations:f,highlightLineAnnotations:b}},[c]);return _e(R,{series:A,options:{...z(ae,u),annotations:{...u?.annotations,points:[...T,...P,...u?.annotations?.points||[]],xaxis:[...O,...N,...u?.annotations?.xaxis||[]]}},height:p,ref:n,type:"area",...y})});import{applyDefaults as Fe}from"@cleen/ui-core";import{forwardRef as ze}from"react";var ce={chart:{type:"radar",zoom:{enabled:!1},toolbar:{show:!1}},stroke:{width:2},fill:{opacity:.25},markers:{size:4,colors:"transparent",strokeColors:"transparent"},tooltip:{marker:{show:!1}},legend:{show:!1}};import{jsx as De}from"react/jsx-runtime";var Be=ze(function({options:t,...r},o){return De(R,{type:"radar",ref:o,options:Fe(ce,t),...r})});import{applyDefaults as Me,cn as We}from"@cleen/ui-core";import{forwardRef as Ge}from"react";var de={chart:{type:"scatter",zoom:{enabled:!1},toolbar:{show:!1}},markers:{shape:"square",size:8,strokeWidth:0},grid:{strokeDashArray:8},legend:{show:!0,horizontalAlign:"right",position:"top",labels:{colors:"rgba(var(--cleen-gray), 0.8)"}},yaxis:{axisBorder:{show:!0,color:"rgba(var(--cleen-gray), .2)"},labels:{style:{colors:"rgba(var(--cleen-gray), 0.8)"}}},xaxis:{axisBorder:{show:!0,color:"rgba(var(--cleen-gray), .2)"},labels:{style:{colors:"rgba(var(--cleen-gray), 0.8)"}}},title:{align:"left",floating:!0,style:{color:"rgba(var(--cleen-black))"}}},ue={chart:{type:"scatter",zoom:{enabled:!1},toolbar:{show:!1}},stroke:{width:0},fill:{opacity:1},markers:{shape:"circle",size:14,strokeWidth:2,hover:{sizeOffset:0}},grid:{strokeDashArray:0,borderColor:"rgba(var(--cleen-gray), 0.12)",padding:{left:0,right:12},xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},legend:{show:!1},xaxis:{min:0,max:210,tickAmount:4,axisBorder:{show:!1},axisTicks:{show:!1},decimalsInFloat:0,title:{text:"Estimated impact \u2192",style:{color:"rgba(var(--cleen-gray), 0.8)",fontSize:"14px",fontWeight:400}},labels:{style:{colors:"rgba(var(--cleen-gray), 0.8)",fontSize:"14px"},formatter(e){let t=Number(e);return Number.isNaN(t)?`${e}`:`$${Math.round(t)}k`}}},tooltip:{enabled:!0,theme:"light",x:{formatter(e){let t=Number(e);return Number.isNaN(t)?`${e}`:`$${Math.round(t)}k`}}}};import{jsx as B,jsxs as me}from"react/jsx-runtime";var Ue=Ge(function({options:t,variant:r="default",rows:o,className:d,style:g,...c},u){let y=Me(r==="matrix"?ue:de,t);if(r==="matrix"&&o?.length){let n=Math.min(...o.map(m=>m.y)),x=Math.max(...o.map(m=>m.y)),S=Array.isArray(y.yaxis)?{}:y.yaxis??{};return me("div",{className:We("cleen",d),style:{display:"grid",gridTemplateColumns:"156px minmax(0, 1fr)",alignItems:"stretch",gap:"12px",width:"100%",...g},children:[B("div",{style:{display:"grid",gridTemplateRows:`repeat(${o.length}, minmax(0, 1fr))`,padding:"18px 0 54px"},children:o.map(m=>me("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-end",gap:"4px",paddingRight:"8px"},children:[B("span",{style:{fontSize:"18px",fontWeight:700,lineHeight:1.1,color:"rgba(var(--cleen-black))"},children:m.label}),m.gapsLabel?B("span",{style:{fontSize:"14px",lineHeight:1.2,color:"rgba(var(--cleen-gray), 0.8)"},children:m.gapsLabel}):null]},`${m.label}-${m.y}`))}),B(R,{type:"scatter",ref:u,className:"cleen-w-full",style:{height:"100%"},options:{...y,yaxis:{...S,min:n-.5,max:x+.5,tickAmount:Math.max(x-n,1),axisBorder:{...S.axisBorder,show:!1},axisTicks:{...S.axisTicks,show:!1},labels:{...S.labels,show:!1}},annotations:{...y.annotations,yaxis:[...o.map(m=>({y:m.y,borderColor:m.lineColor||"rgba(var(--cleen-gray), 0.12)",strokeDashArray:0})),...y.annotations?.yaxis||[]]}},...c})]})}return B(R,{type:"scatter",ref:u,className:d,style:g,options:y,...c})});import{applyDefaults as Xe,cn as je}from"@cleen/ui-core";import{useId as Ke,useMemo as M,useRef as Ve,useState as Ye}from"react";import{Layer as ke,Rectangle as ge,ResponsiveContainer as qe,Sankey as Ze,Tooltip as Je}from"recharts";var I={width:"100%",height:420,nodePadding:24,enableToolbar:!1,enableTooltip:!0,highlightOnHover:!0,dimOnHover:!0,dimOpacity:.2,edgeOpacity:.4,edgeGradientFill:!0,nodeWidth:20,nodeBorderWidth:0,nodeBorderColor:null,align:"justify",fontColor:"rgba(var(--cleen-neutral-800, 38, 38, 38))",tooltipBGColor:"rgba(var(--cleen-white))",tooltipBorderColor:"rgba(var(--cleen-gray), 0.2)"};import{jsx as C,jsxs as F}from"react/jsx-runtime";var Qe=typeof I.height=="number"?I.height:420,fe=40,he=60,ye=8,et=8;function tt(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let t=e.trim();if(!t.endsWith("%")&&t!=="auto"){let r=Number.parseFloat(t);if(Number.isFinite(r))return r}}return Qe}function xe(e){return typeof e=="object"&&e!==null&&"id"in e&&"title"in e}function rt(e){return typeof e=="object"&&e!==null&&"id"in e&&"title"in e&&"index"in e&&"name"in e}var be=["rgba(var(--cleen-primary, 59, 130, 246))","rgba(var(--cleen-success, 34, 197, 94))","rgba(var(--cleen-warning, 245, 158, 11))","rgba(var(--cleen-error, 239, 68, 68))","rgba(var(--cleen-purple, 147, 51, 234))","rgba(var(--cleen-cyan, 6, 182, 212))","rgba(var(--cleen-orange, 249, 115, 22))","rgba(var(--cleen-pink, 236, 72, 153))","rgba(var(--cleen-teal, 20, 184, 166))","rgba(var(--cleen-indigo, 99, 102, 241))","rgba(var(--cleen-rose, 244, 63, 94))","rgba(var(--cleen-amber, 245, 158, 11))"];function Ae(e){return e!=null}function ot(e,t){return[e.source,e.target,e.type??"",e.label??"",e.value,t].join("-").replace(/\s+/g,"_")}function G(e,t){return typeof e=="object"&&e!==null?e.id:t}function Ce(e,t){return typeof e=="object"&&e!==null?e.title:t}function K(e){return typeof e=="object"&&e!==null&&"edgeKey"in e&&"sourceId"in e&&"targetId"in e}function V(e){return typeof e=="object"&&e!==null&&"payload"in e}function Te(e){if(V(e))return Te(e.payload);if(K(e)||rt(e))return e}function W(...e){return e.map(t=>typeof t=="number"?String(t):t?.trim()??"").find(t=>t.length>0)}function Se(e){let t=W(e);if(t)return/[\p{L}\p{N}]/u.test(t)?t:void 0}function Oe(e){return e.replace(/[^a-zA-Z0-9_-]/g,"_")}function _(e){let t=e.match(/^rgba\((var\(.+\)),\s*([0-9]*\.?[0-9]+)\)$/i);if(t)return{color:`rgb(${t[1]})`,opacity:Number.parseFloat(t[2])};let r=e.match(/^rgba\((var\(.+\))\)$/i);if(r)return{color:`rgb(${r[1]})`,opacity:1};let o=e.match(/^rgba\(\s*(\d+\s*,\s*\d+\s*,\s*\d+)\s*,\s*([0-9]*\.?[0-9]+)\s*\)$/i);return o?{color:`rgb(${o[1]})`,opacity:Number.parseFloat(o[2])}:{color:e,opacity:1}}function Y(e,t){return _(t??be[e%be.length])}function ve(e){return e.length*et}function nt(e){let t=new Set,r=new Set([e.id]);for(let o of[...e.sourceLinks??[],...e.targetLinks??[]])t.add(o.edgeKey),r.add(G(o.source,o.sourceId)),r.add(G(o.target,o.targetId));return{activeLinkKeys:t,activeNodeIds:r}}function it(e){return{activeLinkKeys:new Set([e.edgeKey]),activeNodeIds:new Set([G(e.source,e.sourceId),G(e.target,e.targetId)])}}function at(e,t,r,o,d){return!e||e.activeNodeIds.has(t)?1:o?d??I.dimOpacity??.2:r?.55:1}function st(e,t,r,o,d,g){return e?e.activeLinkKeys.has(t)?o?Math.max(r,.9):r:d?g??I.dimOpacity??.2:o?Math.min(r,.3):r:r}var lt=({dimOnHover:e,dimOpacity:t,fontColor:r,x:o,y:d,width:g,height:c,highlightOnHover:u,hoverState:p,index:y,outgoingEdgesById:n,payload:x,stroke:S,strokeWidth:m})=>{if(x===void 0||o===void 0||d===void 0||g===void 0||c===void 0||y===void 0)return null;let A=n?.get(x.id)??[],T=A.length>0,O=Y(y,x.color),P=_(r),N=at(p,x.id,u,e,t),f=new Set(A.map(s=>s.color).filter(Ae)),b=Array.from(f)[0],v=T&&A.length>1&&f.size>1&&f.size===A.length,i=v?A:[],a=i.reduce((s,l)=>s+(l.value??0),0);return F(ke,{children:[v&&a>0?i.map((s,l)=>{let h=i.slice(0,l).reduce((U,X)=>U+(X.value??0),0),k=d+h/a*c,w=(s.value??0)/a*c,D=_(s.color??O.color),L=l===0,H=l===i.length-1;return C(ge,{x:o,y:k,width:g,height:w,fill:D.color,fillOpacity:D.opacity*N,stroke:S,strokeWidth:m,radius:[L?2:0,L?2:0,H?2:0,H?2:0]},`${s.source}-${s.target}-${l}`)}):C(ge,{x:o,y:d,width:g,height:c,fill:T&&f.size===1?_(b??O.color).color:O.color,fillOpacity:(T&&f.size===1?_(b??O.color).opacity:O.opacity)*N,stroke:S,strokeWidth:m,radius:[2,2,2,2]}),C("text",{textAnchor:T?"end":"start",x:T?o-8:o+g+8,y:d+c/2,dy:"0.35em",fontSize:"14",fill:P.color,fillOpacity:P.opacity*N,fontWeight:600,children:x.name})]},`CustomNode${y}`)},pt=({sourceX:e,targetX:t,sourceY:r,targetY:o,sourceControlX:d,targetControlX:g,linkWidth:c,index:u,payload:p,opacity:y,chartId:n,dimOnHover:x,dimOpacity:S,edgeGradientFill:m,highlightOnHover:A,hoverState:T})=>{if(p===void 0||e===void 0||t===void 0||r===void 0||o===void 0||d===void 0||g===void 0||c===void 0)return null;let O=y??I.edgeOpacity??.4,P=st(T,p.edgeKey,O,A,x,S),N=p.color?_(p.color):null,f=N??Y(typeof p.source=="object"?p.source.index:0,typeof p.source=="object"?p.source.color:void 0),b=N??Y(typeof p.target=="object"?p.target.index:1,typeof p.target=="object"?p.target.color:void 0),v=Oe(`linkGradient-${n}-${p.edgeKey}-${u??p.value}`),i=m!==!1&&N===null;return F(ke,{children:[i?C("defs",{children:F("linearGradient",{id:v,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[C("stop",{offset:"0%",stopColor:f.color,stopOpacity:f.opacity*P}),C("stop",{offset:"100%",stopColor:b.color,stopOpacity:b.opacity*P})]})}):null,C("path",{d:`
|
|
2
2
|
M${e},${r}
|
|
3
|
-
C${
|
|
4
|
-
`,stroke:
|
|
3
|
+
C${d},${r} ${g},${o} ${t},${o}
|
|
4
|
+
`,stroke:i?`url(#${v})`:f.color,strokeWidth:Math.max(1,c),fill:"none",strokeOpacity:i?1:f.opacity*P,className:"cleen-transition-opacity cleen-duration-300 hover:cleen-opacity-100"})]},`CustomLink${p.edgeKey}`)};function ct({data:e,options:t,className:r,style:o,onNodeClick:d}){let g=Ve(null),[c,u]=Ye(null),p=Ke(),y=Oe(p),n=Xe(I,t),x=tt(n.height),S=n.highlightOnHover||n.dimOnHover,m=M(()=>{let i=e.nodes.map((s,l)=>({...s,index:l,name:s.title})),a=e.edges.map((s,l)=>{let h=e.nodes.findIndex(w=>w.id===s.source),k=e.nodes.findIndex(w=>w.id===s.target);return h<0||k<0?null:{...s,edgeKey:ot(s,l),originalEdge:s,source:h,sourceId:s.source,target:k,targetId:s.target,value:s.value}}).filter(Ae);return{nodes:i,links:a}},[e]),A=M(()=>{let i=new Map;for(let a of e.edges){let s=i.get(a.source)??[];s.push(a),i.set(a.source,s)}return i},[e]),T=M(()=>({backgroundColor:n.tooltipBGColor,border:`1px solid ${n.tooltipBorderColor}`,borderRadius:8,boxShadow:"0 12px 32px rgba(15, 23, 42, 0.12)",color:n.fontColor,padding:"10px 12px"}),[n.fontColor,n.tooltipBGColor,n.tooltipBorderColor]),O=M(()=>{let i=new Set(e.edges.map(h=>h.source)),a=new Set(e.edges.map(h=>h.target)),s=e.nodes.reduce((h,k)=>a.has(k.id)?h:Math.max(h,ve(k.title)),0),l=e.nodes.reduce((h,k)=>i.has(k.id)?h:Math.max(h,ve(k.title)),0);return{top:fe,right:Math.max(he,l+ye+16),bottom:fe,left:Math.max(he,s+ye+16)}},[e]),P=(i,a)=>{if(S){if(a==="node"&&xe(i.payload)){u(nt(i.payload));return}a==="link"&&K(i.payload)&&u(it(i.payload))}},N=()=>{S&&u(null)},f=()=>{if(typeof window>"u")return;let i=g.current?.querySelector("svg");if(!i)return;let a=new XMLSerializer().serializeToString(i),s=new Blob([a],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(s),h=document.createElement("a");h.href=l,h.download="sankey-chart.svg",h.click(),window.setTimeout(()=>URL.revokeObjectURL(l),0)},b=({active:i,payload:a})=>{if(!i||!a?.length)return null;let s=a[0]?.payload,l=Te(s);if(!l)return null;let h=K(l),k=V(s)?s.value:a[0]?.value,w=V(s)?s.name:void 0,D=n.valueFormatter?n.valueFormatter(Number(l.value??k??0),h?l.originalEdge:void 0):`${l.value??k??""}`,L=h?Ce(l.source,l.sourceId):"",H=h?Ce(l.target,l.targetId):"",U=W(L&&H?`${L} \u2192 ${H}`:void 0),X=h?W(l.title,l.label,l.name,l.originalEdge?.title,l.originalEdge?.label,l.originalEdge?.name,Se(w),U):W(l.title,Se(w)),Q=h?`${L} \u2192 ${H}`:"";return F("div",{style:T,children:[C("div",{style:{color:n.fontColor,fontWeight:600},children:X}),Q?C("div",{style:{color:n.fontColor,fontSize:13,marginTop:4,opacity:.72},children:Q}):null,C("div",{style:{color:n.fontColor,fontSize:13,marginTop:6},children:D})]})},v={display:"flex",flexDirection:"column",gap:n.enableToolbar?12:0,width:n.width??"100%",height:x,minHeight:x,...o};return F("div",{className:je("cleen cleen-w-full",r),ref:g,style:v,children:[n.enableToolbar?F("div",{className:"cleen-flex cleen-items-center cleen-justify-end cleen-gap-2",children:[C("button",{type:"button",onClick:()=>u(null),disabled:!c,style:{backgroundColor:"rgba(var(--cleen-white))",border:"1px solid rgba(var(--cleen-gray), 0.2)",borderRadius:8,color:n.fontColor,cursor:c?"pointer":"not-allowed",fontSize:13,fontWeight:600,opacity:c?1:.5,padding:"6px 10px"},children:"Reset focus"}),C("button",{type:"button",onClick:f,style:{backgroundColor:"rgba(var(--cleen-white))",border:"1px solid rgba(var(--cleen-gray), 0.2)",borderRadius:8,color:n.fontColor,cursor:"pointer",fontSize:13,fontWeight:600,padding:"6px 10px"},children:"Download SVG"})]}):null,C("div",{style:{flex:1,minHeight:0},children:C(qe,{width:"100%",height:"100%",children:C(Ze,{data:m,align:n.align,margin:O,node:C(lt,{dimOnHover:n.dimOnHover,dimOpacity:n.dimOpacity,fontColor:n.fontColor??I.fontColor??"rgba(var(--cleen-neutral-800, 38, 38, 38))",highlightOnHover:n.highlightOnHover,hoverState:c,outgoingEdgesById:A,stroke:n.nodeBorderColor??"transparent",strokeWidth:n.nodeBorderWidth}),nodePadding:n.nodePadding,nodeWidth:n.nodeWidth,link:C(pt,{chartId:y,dimOnHover:n.dimOnHover,dimOpacity:n.dimOpacity,edgeGradientFill:n.edgeGradientFill,highlightOnHover:n.highlightOnHover,hoverState:c,opacity:n.edgeOpacity}),onClick:(i,a)=>{a==="node"&&d&&xe(i.payload)&&d(i.payload)},onMouseEnter:P,onMouseLeave:N,children:n.enableTooltip?C(Je,{content:C(b,{}),cursor:!1}):null})})})]})}import{applyDefaults as dt}from"@cleen/ui-core";import{forwardRef as ut}from"react";var Ne={chart:{type:"treemap",zoom:{enabled:!1},toolbar:{show:!1}},legend:{show:!1},dataLabels:{enabled:!0,style:{fontSize:"12px",fontWeight:400}},plotOptions:{treemap:{enableShades:!0,distributed:!1}},title:{align:"left",style:{color:"rgba(var(--cleen-black))"}}};import{jsx as xt}from"react/jsx-runtime";var Pe="0 12px 16px -4px rgba(10, 13, 18, 0.08), 0 4px 6px -2px rgba(10, 13, 18, 0.03), 0 2px 2px -1px rgba(10, 13, 18, 0.04)",Re="#FFFFFF",q="1px solid rgba(var(--cleen-gray), 0.1)",mt=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),gt=e=>String(e??"").trim(),Z=e=>{let t=gt(e);return t?t.split(/\r?\n/).map(r=>mt(r)).join("<br />"):""},we=e=>typeof e=="object"&&e!==null,ft=e=>{let t=Array.isArray(e.w?.config?.series)?e.w.config.series:[],r=e.seriesIndex>=0?t[e.seriesIndex]:void 0,o=we(r)?r:void 0,d=o?.data,g=Array.isArray(d)?d:[],c=e.dataPointIndex>=0?g[e.dataPointIndex]:void 0,u=we(c)?c:{},p=o?.name;return{point:u,seriesName:typeof p=="string"?p:void 0}},ht=e=>{let t=Z(e.tooltipTitle),r=Z(e.tooltipText),o=Z(e.tooltipFooter);return!t&&!r&&!o?"":`<div style="position:relative;z-index:10;min-width:220px;max-width:min(360px, 90vw);"><div style="display:flex;flex-direction:column;gap:8px;border:${q};border-radius:8px;padding:12px;background-color:${Re};box-shadow:${Pe};"><div style="display:flex;flex-direction:column;gap:8px;">${t?`<p style="margin:0;font-size:12px;font-weight:600;line-height:18px;color:#181D27;overflow-wrap:anywhere;">${t}</p>`:""}${r?`<p style="margin:0;font-size:12px;font-weight:500;line-height:18px;color:#414651;overflow-wrap:anywhere;">${r}</p>`:""}</div>${o?`<p style="margin:0;font-size:12px;font-weight:500;line-height:18px;color:#9DA4AE;overflow-wrap:anywhere;">${o}</p>`:""}</div><div style="position:absolute;left:50%;top:100%;height:16px;width:16px;transform:translate(-50%, -8px) rotate(45deg);background-color:${Re};border-right:${q};border-bottom:${q};box-shadow:${Pe};"></div></div>`},yt=ut(function({options:t,getTooltipContent:r,...o},d){let c=!t?.tooltip?.custom||!!r?{...t,tooltip:{...t?.tooltip,custom:(u=>{let p=Number.isInteger(u.seriesIndex)&&u.seriesIndex>=0?u.seriesIndex:-1,y=Number.isInteger(u.dataPointIndex)&&u.dataPointIndex>=0?u.dataPointIndex:-1,{point:n,seriesName:x}=ft({...u,seriesIndex:p,dataPointIndex:y}),S=r?.({point:n,seriesName:x,seriesIndex:p,dataPointIndex:y})??{tooltipTitle:n.tooltipTitle??n.x,tooltipText:n.tooltipText,tooltipFooter:n.tooltipFooter??n.y};return ht(S)})}}:t??{};return xt(R,{type:"treemap",ref:d,options:dt(Ne,c),...o})});import"react";import{jsx as J,jsxs as Ct}from"react/jsx-runtime";var bt=({width:e=240,height:t=80,data:r=[12,28,18,30,24,36],className:o="",style:d})=>{let g=Math.max(...r,1),c=r.map((u,p)=>`${p/(r.length-1)*e},${t-u/g*t}`).join(" ");return Ct("svg",{width:e,height:t,viewBox:`0 0 ${e} ${t}`,className:o,style:d,role:"img","aria-label":"Simple line chart",children:[J("rect",{width:"100%",height:"100%",fill:"transparent"}),J("polyline",{fill:"none",stroke:"rgba(59,130,246,0.9)",strokeWidth:2,points:c,strokeLinecap:"round",strokeLinejoin:"round"}),J("polygon",{points:`${c} ${e},${t} 0,${t}`,fill:"rgba(59,130,246,0.08)"})]})};export{$e as BellCurve,te as Chart,Be as RadarChart,ct as SankeyChart,Ue as ScatterChart,bt as SimpleChart,yt as TreemapChart};
|