tekivex-ui 2.5.3 → 2.5.4
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.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("recharts"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("recharts"),g=require("./index-BINBzXuY.cjs"),L=require("react");function C(i){return[i.primary,i.secondary,i.info,i.success,i.warning,i.danger,"#a855f7","#f97316","#14b8a6","#e879f9"]}const A={top:10,right:30,bottom:10,left:0};function T(i){return{contentStyle:{backgroundColor:i.surface,border:`1px solid ${i.border}`,borderRadius:8,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",color:i.text,fontSize:13},labelStyle:{color:i.textMuted,fontWeight:600,marginBottom:4},itemStyle:{color:i.text},cursor:{fill:`${i.primary}15`}}}function z({data:i,series:m,xKey:y,height:S=300,margin:d=A,showGrid:h=!0,showLegend:f=!0,showTooltip:p=!0,smooth:l=!0,xTickFormatter:u,yTickFormatter:o,yDomain:n,ariaLabel:x="Area chart"}){const r=g.useTheme(),c=C(r),a=T(r),j={fill:r.textMuted,fontSize:12};return e.jsx("div",{role:"img","aria-label":x,style:{width:"100%",height:S},children:e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",children:e.jsxs(t.AreaChart,{data:i,margin:d,children:[h&&e.jsx(t.CartesianGrid,{strokeDasharray:"3 3",stroke:r.border,vertical:!1}),e.jsx(t.XAxis,{dataKey:y,tick:j,axisLine:{stroke:r.border},tickLine:!1,tickFormatter:u}),e.jsx(t.YAxis,{tick:j,axisLine:!1,tickLine:!1,tickFormatter:o,domain:n}),p&&e.jsx(t.Tooltip,{contentStyle:a.contentStyle,labelStyle:a.labelStyle,itemStyle:a.itemStyle,cursor:a.cursor}),f&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:r.textMuted,paddingTop:8}}),m.map((k,b)=>{const s=k.color??c[b%c.length];return e.jsx(t.Area,{type:l?"monotone":"linear",dataKey:k.key,name:k.label??k.key,stroke:s,strokeWidth:2,fill:s,fillOpacity:k.fillOpacity??.2,stackId:k.stacked?"stack":void 0,dot:!1,activeDot:{r:5,strokeWidth:0}},k.key)})]})})})}function M({data:i,series:m,xKey:y,height:S=300,margin:d=A,showGrid:h=!0,showLegend:f=!0,showTooltip:p=!0,layout:l="horizontal",barSize:u,xTickFormatter:o,yTickFormatter:n,ariaLabel:x="Bar chart"}){const r=g.useTheme(),c=C(r),a=T(r),j={fill:r.textMuted,fontSize:12},k=l==="vertical";return e.jsx("div",{role:"img","aria-label":x,style:{width:"100%",height:S},children:e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",children:e.jsxs(t.BarChart,{data:i,margin:d,layout:l,children:[h&&e.jsx(t.CartesianGrid,{strokeDasharray:"3 3",stroke:r.border,vertical:k,horizontal:!k}),k?e.jsxs(e.Fragment,{children:[e.jsx(t.YAxis,{dataKey:y,type:"category",tick:j,axisLine:!1,tickLine:!1,tickFormatter:o,width:100}),e.jsx(t.XAxis,{type:"number",tick:j,axisLine:{stroke:r.border},tickLine:!1,tickFormatter:n})]}):e.jsxs(e.Fragment,{children:[e.jsx(t.XAxis,{dataKey:y,tick:j,axisLine:{stroke:r.border},tickLine:!1,tickFormatter:o}),e.jsx(t.YAxis,{tick:j,axisLine:!1,tickLine:!1,tickFormatter:n})]}),p&&e.jsx(t.Tooltip,{contentStyle:a.contentStyle,labelStyle:a.labelStyle,itemStyle:a.itemStyle,cursor:{fill:`${r.surfaceAlt}`}}),f&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:r.textMuted,paddingTop:8}}),m.map((b,s)=>{const v=b.color??c[s%c.length];return e.jsx(t.Bar,{dataKey:b.key,name:b.label??b.key,fill:v,stackId:b.stackId,maxBarSize:u??40,radius:b.radius??[4,4,0,0]},b.key)})]})})})}function R({data:i,series:m,xKey:y,height:S=300,margin:d=A,showGrid:h=!0,showLegend:f=!0,showTooltip:p=!0,smooth:l=!0,referenceLines:u=[],xTickFormatter:o,yTickFormatter:n,yDomain:x,connectNulls:r=!1,ariaLabel:c="Line chart"}){const a=g.useTheme(),j=C(a),k=T(a),b={fill:a.textMuted,fontSize:12};return e.jsx("div",{role:"img","aria-label":c,style:{width:"100%",height:S},children:e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",children:e.jsxs(t.LineChart,{data:i,margin:d,children:[h&&e.jsx(t.CartesianGrid,{strokeDasharray:"3 3",stroke:a.border,vertical:!1}),e.jsx(t.XAxis,{dataKey:y,tick:b,axisLine:{stroke:a.border},tickLine:!1,tickFormatter:o}),e.jsx(t.YAxis,{tick:b,axisLine:!1,tickLine:!1,tickFormatter:n,domain:x}),p&&e.jsx(t.Tooltip,{contentStyle:k.contentStyle,labelStyle:k.labelStyle,itemStyle:k.itemStyle,cursor:{stroke:a.border,strokeWidth:1}}),f&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:a.textMuted,paddingTop:8}}),u.map((s,v)=>e.jsx(t.ReferenceLine,{y:s.y,x:s.x,label:s.label?{value:s.label,fill:a.textMuted,fontSize:11}:void 0,stroke:s.color??a.border,strokeDasharray:s.dashed?"4 4":void 0},v)),m.map((s,v)=>{const w=s.color??j[v%j.length];return e.jsx(t.Line,{type:l?"monotone":"linear",dataKey:s.key,name:s.label??s.key,stroke:w,strokeWidth:s.strokeWidth??2,strokeDasharray:s.dashed?"6 3":void 0,dot:s.dot??!1,activeDot:{r:5,strokeWidth:0,fill:w},connectNulls:r},s.key)})]})})})}function F({data:i,height:m=300,showLegend:y=!0,showTooltip:S=!0,showLabels:d=!1,outerRadius:h="70%",startAngle:f=90,ariaLabel:p="Pie chart"}){const l=g.useTheme(),u=C(l),o=T(l),[n,x]=L.useState(!1);return L.useEffect(()=>{const r=requestAnimationFrame(()=>x(!0));return()=>cancelAnimationFrame(r)},[]),e.jsx("div",{role:"img","aria-label":p,style:{width:"100%",minWidth:240,height:m,position:"relative"},children:n&&e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",debounce:50,children:e.jsxs(t.PieChart,{children:[S&&e.jsx(t.Tooltip,{contentStyle:o.contentStyle,labelStyle:o.labelStyle,itemStyle:o.itemStyle}),y&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:l.textMuted}}),e.jsx(t.Pie,{data:i,dataKey:"value",nameKey:"name",outerRadius:h,startAngle:f,endAngle:f-360,label:d?({name:r,percent:c})=>`${r} (${(c*100).toFixed(0)}%)`:void 0,labelLine:d,strokeWidth:2,stroke:l.bg,children:i.map((r,c)=>e.jsx(t.Cell,{fill:r.color??u[c%u.length]},r.name))})]})})})}function D({data:i,height:m=300,showLegend:y=!0,showTooltip:S=!0,centerLabel:d,centerSublabel:h,innerRadius:f="55%",outerRadius:p="75%",startAngle:l=90,ariaLabel:u="Donut chart"}){const o=g.useTheme(),n=C(o),x=T(o),[r,c]=L.useState(!1);return L.useEffect(()=>{const a=requestAnimationFrame(()=>c(!0));return()=>cancelAnimationFrame(a)},[]),e.jsxs("div",{role:"img","aria-label":u,style:{width:"100%",minWidth:240,height:m,position:"relative"},children:[r&&e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",debounce:50,children:e.jsxs(t.PieChart,{children:[S&&e.jsx(t.Tooltip,{contentStyle:x.contentStyle,labelStyle:x.labelStyle,itemStyle:x.itemStyle}),y&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:o.textMuted}}),e.jsx(t.Pie,{data:i,dataKey:"value",nameKey:"name",innerRadius:f,outerRadius:p,startAngle:l,endAngle:l-360,strokeWidth:3,stroke:o.bg,label:!1,labelLine:!1,children:i.map((a,j)=>e.jsx(t.Cell,{fill:a.color??n[j%n.length]},a.name))}),(d||h)&&e.jsx("text",{})]})}),(d||h)&&e.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",pointerEvents:"none",marginTop:y?-24:0},children:[d&&e.jsx("span",{style:{fontSize:22,fontWeight:700,color:o.text,lineHeight:1},children:d}),h&&e.jsx("span",{style:{fontSize:13,color:o.textMuted,marginTop:4},children:h})]})]})}function K({series:i,height:m=300,margin:y=A,showGrid:S=!0,showLegend:d=!0,showTooltip:h=!0,xTickFormatter:f,yTickFormatter:p,zRange:l=[20,400],ariaLabel:u="Scatter chart"}){const o=g.useTheme(),n=C(o),x=T(o),r={fill:o.textMuted,fontSize:12};return e.jsx("div",{role:"img","aria-label":u,style:{width:"100%",height:m},children:e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",children:e.jsxs(t.ScatterChart,{margin:y,children:[S&&e.jsx(t.CartesianGrid,{strokeDasharray:"3 3",stroke:o.border}),e.jsx(t.XAxis,{type:"number",dataKey:"x",tick:r,axisLine:{stroke:o.border},tickLine:!1,tickFormatter:f}),e.jsx(t.YAxis,{type:"number",dataKey:"y",tick:r,axisLine:!1,tickLine:!1,tickFormatter:p}),e.jsx(t.ZAxis,{type:"number",dataKey:"z",range:l}),h&&e.jsx(t.Tooltip,{contentStyle:x.contentStyle,labelStyle:x.labelStyle,itemStyle:x.itemStyle,cursor:{strokeDasharray:"3 3"}}),d&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:o.textMuted,paddingTop:8}}),i.map((c,a)=>e.jsx(t.Scatter,{name:c.name,data:c.data,fill:c.color??n[a%n.length],fillOpacity:.8},c.name??a))]})})})}function W({data:i,series:m,angleKey:y,height:S=300,showLegend:d=!0,showTooltip:h=!0,outerRadius:f="70%",ariaLabel:p="Radar chart"}){const l=g.useTheme(),u=C(l),o=T(l);return e.jsx("div",{role:"img","aria-label":p,style:{width:"100%",height:S},children:e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",children:e.jsxs(t.RadarChart,{data:i,outerRadius:f,children:[e.jsx(t.PolarGrid,{stroke:l.border}),e.jsx(t.PolarAngleAxis,{dataKey:y,tick:{fill:l.textMuted,fontSize:12}}),e.jsx(t.PolarRadiusAxis,{tick:{fill:l.textMuted,fontSize:10},axisLine:!1,tickLine:!1}),h&&e.jsx(t.Tooltip,{contentStyle:o.contentStyle,labelStyle:o.labelStyle,itemStyle:o.itemStyle}),d&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:l.textMuted}}),m.map((n,x)=>{const r=n.color??u[x%u.length];return e.jsx(t.Radar,{name:n.label??n.key,dataKey:n.key,stroke:r,fill:r,fillOpacity:n.fillOpacity??.2,strokeWidth:2},n.key)})]})})})}exports.TkxAreaChart=z;exports.TkxBarChart=M;exports.TkxDonutChart=D;exports.TkxLineChart=R;exports.TkxPieChart=F;exports.TkxRadarChart=W;exports.TkxScatterChart=K;
|
package/dist/charts.js
CHANGED
|
@@ -1,235 +1,236 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { ResponsiveContainer as
|
|
1
|
+
import { jsx as t, jsxs as g, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { ResponsiveContainer as v, AreaChart as j, CartesianGrid as D, XAxis as F, YAxis as K, Tooltip as L, Legend as w, Area as E, BarChart as G, Bar as q, LineChart as H, ReferenceLine as N, Line as U, PieChart as P, Pie as B, Cell as I, ScatterChart as V, ZAxis as X, Scatter as Y, RadarChart as Z, PolarGrid as _, PolarAngleAxis as J, PolarRadiusAxis as Q, Radar as tt } from "recharts";
|
|
3
3
|
import { u as z } from "./index-eT_U4qB2.js";
|
|
4
|
-
|
|
4
|
+
import { useState as O, useEffect as $ } from "react";
|
|
5
|
+
function C(r) {
|
|
5
6
|
return [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
r.primary,
|
|
8
|
+
r.secondary,
|
|
9
|
+
r.info,
|
|
10
|
+
r.success,
|
|
11
|
+
r.warning,
|
|
12
|
+
r.danger,
|
|
12
13
|
"#a855f7",
|
|
13
14
|
"#f97316",
|
|
14
15
|
"#14b8a6",
|
|
15
16
|
"#e879f9"
|
|
16
17
|
];
|
|
17
18
|
}
|
|
18
|
-
const
|
|
19
|
-
function M(
|
|
19
|
+
const T = { top: 10, right: 30, bottom: 10, left: 0 };
|
|
20
|
+
function M(r) {
|
|
20
21
|
return {
|
|
21
22
|
contentStyle: {
|
|
22
|
-
backgroundColor:
|
|
23
|
-
border: `1px solid ${
|
|
23
|
+
backgroundColor: r.surface,
|
|
24
|
+
border: `1px solid ${r.border}`,
|
|
24
25
|
borderRadius: 8,
|
|
25
26
|
boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
|
|
26
|
-
color:
|
|
27
|
+
color: r.text,
|
|
27
28
|
fontSize: 13
|
|
28
29
|
},
|
|
29
|
-
labelStyle: { color:
|
|
30
|
-
itemStyle: { color:
|
|
31
|
-
cursor: { fill: `${
|
|
30
|
+
labelStyle: { color: r.textMuted, fontWeight: 600, marginBottom: 4 },
|
|
31
|
+
itemStyle: { color: r.text },
|
|
32
|
+
cursor: { fill: `${r.primary}15` }
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
data:
|
|
36
|
-
series:
|
|
37
|
-
xKey:
|
|
38
|
-
height:
|
|
39
|
-
margin: d =
|
|
40
|
-
showGrid:
|
|
41
|
-
showLegend:
|
|
35
|
+
function ot({
|
|
36
|
+
data: r,
|
|
37
|
+
series: m,
|
|
38
|
+
xKey: h,
|
|
39
|
+
height: S = 300,
|
|
40
|
+
margin: d = T,
|
|
41
|
+
showGrid: y = !0,
|
|
42
|
+
showLegend: k = !0,
|
|
42
43
|
showTooltip: p = !0,
|
|
43
44
|
smooth: o = !0,
|
|
44
|
-
xTickFormatter:
|
|
45
|
-
yTickFormatter:
|
|
46
|
-
yDomain:
|
|
47
|
-
ariaLabel:
|
|
45
|
+
xTickFormatter: u,
|
|
46
|
+
yTickFormatter: i,
|
|
47
|
+
yDomain: a,
|
|
48
|
+
ariaLabel: s = "Area chart"
|
|
48
49
|
}) {
|
|
49
|
-
const
|
|
50
|
-
return /* @__PURE__ */ t("div", { role: "img", "aria-label":
|
|
51
|
-
|
|
50
|
+
const e = z(), c = C(e), l = M(e), x = { fill: e.textMuted, fontSize: 12 };
|
|
51
|
+
return /* @__PURE__ */ t("div", { role: "img", "aria-label": s, style: { width: "100%", height: S }, children: /* @__PURE__ */ t(v, { width: "100%", height: "100%", children: /* @__PURE__ */ g(j, { data: r, margin: d, children: [
|
|
52
|
+
y && /* @__PURE__ */ t(D, { strokeDasharray: "3 3", stroke: e.border, vertical: !1 }),
|
|
52
53
|
/* @__PURE__ */ t(
|
|
53
|
-
|
|
54
|
+
F,
|
|
54
55
|
{
|
|
55
|
-
dataKey:
|
|
56
|
-
tick:
|
|
57
|
-
axisLine: { stroke:
|
|
56
|
+
dataKey: h,
|
|
57
|
+
tick: x,
|
|
58
|
+
axisLine: { stroke: e.border },
|
|
58
59
|
tickLine: !1,
|
|
59
|
-
tickFormatter:
|
|
60
|
+
tickFormatter: u
|
|
60
61
|
}
|
|
61
62
|
),
|
|
62
63
|
/* @__PURE__ */ t(
|
|
63
|
-
|
|
64
|
+
K,
|
|
64
65
|
{
|
|
65
|
-
tick:
|
|
66
|
+
tick: x,
|
|
66
67
|
axisLine: !1,
|
|
67
68
|
tickLine: !1,
|
|
68
|
-
tickFormatter:
|
|
69
|
-
domain:
|
|
69
|
+
tickFormatter: i,
|
|
70
|
+
domain: a
|
|
70
71
|
}
|
|
71
72
|
),
|
|
72
73
|
p && /* @__PURE__ */ t(
|
|
73
|
-
|
|
74
|
+
L,
|
|
74
75
|
{
|
|
75
|
-
contentStyle:
|
|
76
|
-
labelStyle:
|
|
77
|
-
itemStyle:
|
|
78
|
-
cursor:
|
|
76
|
+
contentStyle: l.contentStyle,
|
|
77
|
+
labelStyle: l.labelStyle,
|
|
78
|
+
itemStyle: l.itemStyle,
|
|
79
|
+
cursor: l.cursor
|
|
79
80
|
}
|
|
80
81
|
),
|
|
81
|
-
|
|
82
|
+
k && /* @__PURE__ */ t(
|
|
82
83
|
w,
|
|
83
84
|
{
|
|
84
|
-
wrapperStyle: { fontSize: 13, color:
|
|
85
|
+
wrapperStyle: { fontSize: 13, color: e.textMuted, paddingTop: 8 }
|
|
85
86
|
}
|
|
86
87
|
),
|
|
87
|
-
|
|
88
|
-
const n =
|
|
88
|
+
m.map((f, b) => {
|
|
89
|
+
const n = f.color ?? c[b % c.length];
|
|
89
90
|
return /* @__PURE__ */ t(
|
|
90
|
-
|
|
91
|
+
E,
|
|
91
92
|
{
|
|
92
93
|
type: o ? "monotone" : "linear",
|
|
93
|
-
dataKey:
|
|
94
|
-
name:
|
|
94
|
+
dataKey: f.key,
|
|
95
|
+
name: f.label ?? f.key,
|
|
95
96
|
stroke: n,
|
|
96
97
|
strokeWidth: 2,
|
|
97
98
|
fill: n,
|
|
98
|
-
fillOpacity:
|
|
99
|
-
stackId:
|
|
99
|
+
fillOpacity: f.fillOpacity ?? 0.2,
|
|
100
|
+
stackId: f.stacked ? "stack" : void 0,
|
|
100
101
|
dot: !1,
|
|
101
102
|
activeDot: { r: 5, strokeWidth: 0 }
|
|
102
103
|
},
|
|
103
|
-
|
|
104
|
+
f.key
|
|
104
105
|
);
|
|
105
106
|
})
|
|
106
107
|
] }) }) });
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
-
data:
|
|
110
|
-
series:
|
|
111
|
-
xKey:
|
|
112
|
-
height:
|
|
113
|
-
margin: d =
|
|
114
|
-
showGrid:
|
|
115
|
-
showLegend:
|
|
109
|
+
function at({
|
|
110
|
+
data: r,
|
|
111
|
+
series: m,
|
|
112
|
+
xKey: h,
|
|
113
|
+
height: S = 300,
|
|
114
|
+
margin: d = T,
|
|
115
|
+
showGrid: y = !0,
|
|
116
|
+
showLegend: k = !0,
|
|
116
117
|
showTooltip: p = !0,
|
|
117
118
|
layout: o = "horizontal",
|
|
118
|
-
barSize:
|
|
119
|
-
xTickFormatter:
|
|
120
|
-
yTickFormatter:
|
|
121
|
-
ariaLabel:
|
|
119
|
+
barSize: u,
|
|
120
|
+
xTickFormatter: i,
|
|
121
|
+
yTickFormatter: a,
|
|
122
|
+
ariaLabel: s = "Bar chart"
|
|
122
123
|
}) {
|
|
123
|
-
const
|
|
124
|
-
return /* @__PURE__ */ t("div", { role: "img", "aria-label":
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
const e = z(), c = C(e), l = M(e), x = { fill: e.textMuted, fontSize: 12 }, f = o === "vertical";
|
|
125
|
+
return /* @__PURE__ */ t("div", { role: "img", "aria-label": s, style: { width: "100%", height: S }, children: /* @__PURE__ */ t(v, { width: "100%", height: "100%", children: /* @__PURE__ */ g(G, { data: r, margin: d, layout: o, children: [
|
|
126
|
+
y && /* @__PURE__ */ t(
|
|
127
|
+
D,
|
|
127
128
|
{
|
|
128
129
|
strokeDasharray: "3 3",
|
|
129
|
-
stroke:
|
|
130
|
-
vertical:
|
|
131
|
-
horizontal: !
|
|
130
|
+
stroke: e.border,
|
|
131
|
+
vertical: f,
|
|
132
|
+
horizontal: !f
|
|
132
133
|
}
|
|
133
134
|
),
|
|
134
|
-
|
|
135
|
-
/* @__PURE__ */ t(
|
|
136
|
-
/* @__PURE__ */ t(
|
|
137
|
-
] }) : /* @__PURE__ */
|
|
138
|
-
/* @__PURE__ */ t(
|
|
139
|
-
/* @__PURE__ */ t(
|
|
135
|
+
f ? /* @__PURE__ */ g(R, { children: [
|
|
136
|
+
/* @__PURE__ */ t(K, { dataKey: h, type: "category", tick: x, axisLine: !1, tickLine: !1, tickFormatter: i, width: 100 }),
|
|
137
|
+
/* @__PURE__ */ t(F, { type: "number", tick: x, axisLine: { stroke: e.border }, tickLine: !1, tickFormatter: a })
|
|
138
|
+
] }) : /* @__PURE__ */ g(R, { children: [
|
|
139
|
+
/* @__PURE__ */ t(F, { dataKey: h, tick: x, axisLine: { stroke: e.border }, tickLine: !1, tickFormatter: i }),
|
|
140
|
+
/* @__PURE__ */ t(K, { tick: x, axisLine: !1, tickLine: !1, tickFormatter: a })
|
|
140
141
|
] }),
|
|
141
142
|
p && /* @__PURE__ */ t(
|
|
142
|
-
|
|
143
|
+
L,
|
|
143
144
|
{
|
|
144
|
-
contentStyle:
|
|
145
|
-
labelStyle:
|
|
146
|
-
itemStyle:
|
|
147
|
-
cursor: { fill: `${
|
|
145
|
+
contentStyle: l.contentStyle,
|
|
146
|
+
labelStyle: l.labelStyle,
|
|
147
|
+
itemStyle: l.itemStyle,
|
|
148
|
+
cursor: { fill: `${e.surfaceAlt}` }
|
|
148
149
|
}
|
|
149
150
|
),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const
|
|
151
|
+
k && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: e.textMuted, paddingTop: 8 } }),
|
|
152
|
+
m.map((b, n) => {
|
|
153
|
+
const A = b.color ?? c[n % c.length];
|
|
153
154
|
return /* @__PURE__ */ t(
|
|
154
|
-
|
|
155
|
+
q,
|
|
155
156
|
{
|
|
156
|
-
dataKey:
|
|
157
|
-
name:
|
|
158
|
-
fill:
|
|
159
|
-
stackId:
|
|
160
|
-
maxBarSize:
|
|
161
|
-
radius:
|
|
157
|
+
dataKey: b.key,
|
|
158
|
+
name: b.label ?? b.key,
|
|
159
|
+
fill: A,
|
|
160
|
+
stackId: b.stackId,
|
|
161
|
+
maxBarSize: u ?? 40,
|
|
162
|
+
radius: b.radius ?? [4, 4, 0, 0]
|
|
162
163
|
},
|
|
163
|
-
|
|
164
|
+
b.key
|
|
164
165
|
);
|
|
165
166
|
})
|
|
166
167
|
] }) }) });
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
-
data:
|
|
170
|
-
series:
|
|
171
|
-
xKey:
|
|
172
|
-
height:
|
|
173
|
-
margin: d =
|
|
174
|
-
showGrid:
|
|
175
|
-
showLegend:
|
|
169
|
+
function nt({
|
|
170
|
+
data: r,
|
|
171
|
+
series: m,
|
|
172
|
+
xKey: h,
|
|
173
|
+
height: S = 300,
|
|
174
|
+
margin: d = T,
|
|
175
|
+
showGrid: y = !0,
|
|
176
|
+
showLegend: k = !0,
|
|
176
177
|
showTooltip: p = !0,
|
|
177
178
|
smooth: o = !0,
|
|
178
|
-
referenceLines:
|
|
179
|
-
xTickFormatter:
|
|
180
|
-
yTickFormatter:
|
|
181
|
-
yDomain:
|
|
182
|
-
connectNulls:
|
|
183
|
-
ariaLabel:
|
|
179
|
+
referenceLines: u = [],
|
|
180
|
+
xTickFormatter: i,
|
|
181
|
+
yTickFormatter: a,
|
|
182
|
+
yDomain: s,
|
|
183
|
+
connectNulls: e = !1,
|
|
184
|
+
ariaLabel: c = "Line chart"
|
|
184
185
|
}) {
|
|
185
|
-
const
|
|
186
|
-
return /* @__PURE__ */ t("div", { role: "img", "aria-label":
|
|
187
|
-
|
|
186
|
+
const l = z(), x = C(l), f = M(l), b = { fill: l.textMuted, fontSize: 12 };
|
|
187
|
+
return /* @__PURE__ */ t("div", { role: "img", "aria-label": c, style: { width: "100%", height: S }, children: /* @__PURE__ */ t(v, { width: "100%", height: "100%", children: /* @__PURE__ */ g(H, { data: r, margin: d, children: [
|
|
188
|
+
y && /* @__PURE__ */ t(D, { strokeDasharray: "3 3", stroke: l.border, vertical: !1 }),
|
|
188
189
|
/* @__PURE__ */ t(
|
|
189
|
-
|
|
190
|
+
F,
|
|
190
191
|
{
|
|
191
|
-
dataKey:
|
|
192
|
-
tick:
|
|
193
|
-
axisLine: { stroke:
|
|
192
|
+
dataKey: h,
|
|
193
|
+
tick: b,
|
|
194
|
+
axisLine: { stroke: l.border },
|
|
194
195
|
tickLine: !1,
|
|
195
|
-
tickFormatter:
|
|
196
|
+
tickFormatter: i
|
|
196
197
|
}
|
|
197
198
|
),
|
|
198
199
|
/* @__PURE__ */ t(
|
|
199
|
-
|
|
200
|
+
K,
|
|
200
201
|
{
|
|
201
|
-
tick:
|
|
202
|
+
tick: b,
|
|
202
203
|
axisLine: !1,
|
|
203
204
|
tickLine: !1,
|
|
204
|
-
tickFormatter:
|
|
205
|
-
domain:
|
|
205
|
+
tickFormatter: a,
|
|
206
|
+
domain: s
|
|
206
207
|
}
|
|
207
208
|
),
|
|
208
209
|
p && /* @__PURE__ */ t(
|
|
209
|
-
|
|
210
|
+
L,
|
|
210
211
|
{
|
|
211
|
-
contentStyle:
|
|
212
|
-
labelStyle:
|
|
213
|
-
itemStyle:
|
|
214
|
-
cursor: { stroke:
|
|
212
|
+
contentStyle: f.contentStyle,
|
|
213
|
+
labelStyle: f.labelStyle,
|
|
214
|
+
itemStyle: f.itemStyle,
|
|
215
|
+
cursor: { stroke: l.border, strokeWidth: 1 }
|
|
215
216
|
}
|
|
216
217
|
),
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
k && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: l.textMuted, paddingTop: 8 } }),
|
|
219
|
+
u.map((n, A) => /* @__PURE__ */ t(
|
|
220
|
+
N,
|
|
220
221
|
{
|
|
221
222
|
y: n.y,
|
|
222
223
|
x: n.x,
|
|
223
|
-
label: n.label ? { value: n.label, fill:
|
|
224
|
-
stroke: n.color ??
|
|
224
|
+
label: n.label ? { value: n.label, fill: l.textMuted, fontSize: 11 } : void 0,
|
|
225
|
+
stroke: n.color ?? l.border,
|
|
225
226
|
strokeDasharray: n.dashed ? "4 4" : void 0
|
|
226
227
|
},
|
|
227
|
-
|
|
228
|
+
A
|
|
228
229
|
)),
|
|
229
|
-
|
|
230
|
-
const W = n.color ??
|
|
230
|
+
m.map((n, A) => {
|
|
231
|
+
const W = n.color ?? x[A % x.length];
|
|
231
232
|
return /* @__PURE__ */ t(
|
|
232
|
-
|
|
233
|
+
U,
|
|
233
234
|
{
|
|
234
235
|
type: o ? "monotone" : "linear",
|
|
235
236
|
dataKey: n.key,
|
|
@@ -239,242 +240,264 @@ function lt({
|
|
|
239
240
|
strokeDasharray: n.dashed ? "6 3" : void 0,
|
|
240
241
|
dot: n.dot ?? !1,
|
|
241
242
|
activeDot: { r: 5, strokeWidth: 0, fill: W },
|
|
242
|
-
connectNulls:
|
|
243
|
+
connectNulls: e
|
|
243
244
|
},
|
|
244
245
|
n.key
|
|
245
246
|
);
|
|
246
247
|
})
|
|
247
248
|
] }) }) });
|
|
248
249
|
}
|
|
249
|
-
function
|
|
250
|
-
data:
|
|
251
|
-
height:
|
|
252
|
-
showLegend:
|
|
253
|
-
showTooltip:
|
|
250
|
+
function ct({
|
|
251
|
+
data: r,
|
|
252
|
+
height: m = 300,
|
|
253
|
+
showLegend: h = !0,
|
|
254
|
+
showTooltip: S = !0,
|
|
254
255
|
showLabels: d = !1,
|
|
255
|
-
outerRadius:
|
|
256
|
-
startAngle:
|
|
256
|
+
outerRadius: y = "70%",
|
|
257
|
+
startAngle: k = 90,
|
|
257
258
|
ariaLabel: p = "Pie chart"
|
|
258
259
|
}) {
|
|
259
|
-
const o = z(),
|
|
260
|
-
return
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
{
|
|
273
|
-
data: e,
|
|
274
|
-
dataKey: "value",
|
|
275
|
-
nameKey: "name",
|
|
276
|
-
outerRadius: s,
|
|
277
|
-
startAngle: f,
|
|
278
|
-
endAngle: f - 360,
|
|
279
|
-
label: d ? ({ name: l, percent: c }) => `${l} (${(c * 100).toFixed(0)}%)` : void 0,
|
|
280
|
-
labelLine: d,
|
|
281
|
-
strokeWidth: 2,
|
|
282
|
-
stroke: o.bg,
|
|
283
|
-
children: e.map((l, c) => /* @__PURE__ */ t(
|
|
284
|
-
I,
|
|
260
|
+
const o = z(), u = C(o), i = M(o), [a, s] = O(!1);
|
|
261
|
+
return $(() => {
|
|
262
|
+
const e = requestAnimationFrame(() => s(!0));
|
|
263
|
+
return () => cancelAnimationFrame(e);
|
|
264
|
+
}, []), /* @__PURE__ */ t(
|
|
265
|
+
"div",
|
|
266
|
+
{
|
|
267
|
+
role: "img",
|
|
268
|
+
"aria-label": p,
|
|
269
|
+
style: { width: "100%", minWidth: 240, height: m, position: "relative" },
|
|
270
|
+
children: a && /* @__PURE__ */ t(v, { width: "100%", height: "100%", debounce: 50, children: /* @__PURE__ */ g(P, { children: [
|
|
271
|
+
S && /* @__PURE__ */ t(
|
|
272
|
+
L,
|
|
285
273
|
{
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
274
|
+
contentStyle: i.contentStyle,
|
|
275
|
+
labelStyle: i.labelStyle,
|
|
276
|
+
itemStyle: i.itemStyle
|
|
277
|
+
}
|
|
278
|
+
),
|
|
279
|
+
h && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: o.textMuted } }),
|
|
280
|
+
/* @__PURE__ */ t(
|
|
281
|
+
B,
|
|
282
|
+
{
|
|
283
|
+
data: r,
|
|
284
|
+
dataKey: "value",
|
|
285
|
+
nameKey: "name",
|
|
286
|
+
outerRadius: y,
|
|
287
|
+
startAngle: k,
|
|
288
|
+
endAngle: k - 360,
|
|
289
|
+
label: d ? ({ name: e, percent: c }) => `${e} (${(c * 100).toFixed(0)}%)` : void 0,
|
|
290
|
+
labelLine: d,
|
|
291
|
+
strokeWidth: 2,
|
|
292
|
+
stroke: o.bg,
|
|
293
|
+
children: r.map((e, c) => /* @__PURE__ */ t(
|
|
294
|
+
I,
|
|
295
|
+
{
|
|
296
|
+
fill: e.color ?? u[c % u.length]
|
|
297
|
+
},
|
|
298
|
+
e.name
|
|
299
|
+
))
|
|
300
|
+
}
|
|
301
|
+
)
|
|
302
|
+
] }) })
|
|
303
|
+
}
|
|
304
|
+
);
|
|
293
305
|
}
|
|
294
|
-
function
|
|
295
|
-
data:
|
|
296
|
-
height:
|
|
297
|
-
showLegend:
|
|
298
|
-
showTooltip:
|
|
306
|
+
function dt({
|
|
307
|
+
data: r,
|
|
308
|
+
height: m = 300,
|
|
309
|
+
showLegend: h = !0,
|
|
310
|
+
showTooltip: S = !0,
|
|
299
311
|
centerLabel: d,
|
|
300
|
-
centerSublabel:
|
|
301
|
-
innerRadius:
|
|
312
|
+
centerSublabel: y,
|
|
313
|
+
innerRadius: k = "55%",
|
|
302
314
|
outerRadius: p = "75%",
|
|
303
315
|
startAngle: o = 90,
|
|
304
|
-
ariaLabel:
|
|
316
|
+
ariaLabel: u = "Donut chart"
|
|
305
317
|
}) {
|
|
306
|
-
const
|
|
307
|
-
return
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
318
|
+
const i = z(), a = C(i), s = M(i), [e, c] = O(!1);
|
|
319
|
+
return $(() => {
|
|
320
|
+
const l = requestAnimationFrame(() => c(!0));
|
|
321
|
+
return () => cancelAnimationFrame(l);
|
|
322
|
+
}, []), /* @__PURE__ */ g(
|
|
323
|
+
"div",
|
|
324
|
+
{
|
|
325
|
+
role: "img",
|
|
326
|
+
"aria-label": u,
|
|
327
|
+
style: { width: "100%", minWidth: 240, height: m, position: "relative" },
|
|
328
|
+
children: [
|
|
329
|
+
e && /* @__PURE__ */ t(v, { width: "100%", height: "100%", debounce: 50, children: /* @__PURE__ */ g(P, { children: [
|
|
330
|
+
S && /* @__PURE__ */ t(
|
|
331
|
+
L,
|
|
332
|
+
{
|
|
333
|
+
contentStyle: s.contentStyle,
|
|
334
|
+
labelStyle: s.labelStyle,
|
|
335
|
+
itemStyle: s.itemStyle
|
|
336
|
+
}
|
|
337
|
+
),
|
|
338
|
+
h && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: i.textMuted } }),
|
|
339
|
+
/* @__PURE__ */ t(
|
|
340
|
+
B,
|
|
341
|
+
{
|
|
342
|
+
data: r,
|
|
343
|
+
dataKey: "value",
|
|
344
|
+
nameKey: "name",
|
|
345
|
+
innerRadius: k,
|
|
346
|
+
outerRadius: p,
|
|
347
|
+
startAngle: o,
|
|
348
|
+
endAngle: o - 360,
|
|
349
|
+
strokeWidth: 3,
|
|
350
|
+
stroke: i.bg,
|
|
351
|
+
label: !1,
|
|
352
|
+
labelLine: !1,
|
|
353
|
+
children: r.map((l, x) => /* @__PURE__ */ t(I, { fill: l.color ?? a[x % a.length] }, l.name))
|
|
354
|
+
}
|
|
355
|
+
),
|
|
356
|
+
(d || y) && /* @__PURE__ */ t("text", {})
|
|
357
|
+
] }) }),
|
|
358
|
+
(d || y) && /* @__PURE__ */ g(
|
|
359
|
+
"div",
|
|
360
|
+
{
|
|
361
|
+
style: {
|
|
362
|
+
position: "absolute",
|
|
363
|
+
inset: 0,
|
|
364
|
+
display: "flex",
|
|
365
|
+
flexDirection: "column",
|
|
366
|
+
alignItems: "center",
|
|
367
|
+
justifyContent: "center",
|
|
368
|
+
pointerEvents: "none",
|
|
369
|
+
marginTop: h ? -24 : 0
|
|
370
|
+
},
|
|
371
|
+
children: [
|
|
372
|
+
d && /* @__PURE__ */ t("span", { style: { fontSize: 22, fontWeight: 700, color: i.text, lineHeight: 1 }, children: d }),
|
|
373
|
+
y && /* @__PURE__ */ t("span", { style: { fontSize: 13, color: i.textMuted, marginTop: 4 }, children: y })
|
|
374
|
+
]
|
|
375
|
+
}
|
|
376
|
+
)
|
|
377
|
+
]
|
|
378
|
+
}
|
|
379
|
+
);
|
|
357
380
|
}
|
|
358
|
-
function
|
|
359
|
-
series:
|
|
360
|
-
height:
|
|
361
|
-
margin:
|
|
362
|
-
showGrid:
|
|
381
|
+
function st({
|
|
382
|
+
series: r,
|
|
383
|
+
height: m = 300,
|
|
384
|
+
margin: h = T,
|
|
385
|
+
showGrid: S = !0,
|
|
363
386
|
showLegend: d = !0,
|
|
364
|
-
showTooltip:
|
|
365
|
-
xTickFormatter:
|
|
387
|
+
showTooltip: y = !0,
|
|
388
|
+
xTickFormatter: k,
|
|
366
389
|
yTickFormatter: p,
|
|
367
390
|
zRange: o = [20, 400],
|
|
368
|
-
ariaLabel:
|
|
391
|
+
ariaLabel: u = "Scatter chart"
|
|
369
392
|
}) {
|
|
370
|
-
const
|
|
371
|
-
return /* @__PURE__ */ t("div", { role: "img", "aria-label":
|
|
372
|
-
|
|
393
|
+
const i = z(), a = C(i), s = M(i), e = { fill: i.textMuted, fontSize: 12 };
|
|
394
|
+
return /* @__PURE__ */ t("div", { role: "img", "aria-label": u, style: { width: "100%", height: m }, children: /* @__PURE__ */ t(v, { width: "100%", height: "100%", children: /* @__PURE__ */ g(V, { margin: h, children: [
|
|
395
|
+
S && /* @__PURE__ */ t(D, { strokeDasharray: "3 3", stroke: i.border }),
|
|
373
396
|
/* @__PURE__ */ t(
|
|
374
|
-
|
|
397
|
+
F,
|
|
375
398
|
{
|
|
376
399
|
type: "number",
|
|
377
400
|
dataKey: "x",
|
|
378
|
-
tick:
|
|
379
|
-
axisLine: { stroke:
|
|
401
|
+
tick: e,
|
|
402
|
+
axisLine: { stroke: i.border },
|
|
380
403
|
tickLine: !1,
|
|
381
|
-
tickFormatter:
|
|
404
|
+
tickFormatter: k
|
|
382
405
|
}
|
|
383
406
|
),
|
|
384
407
|
/* @__PURE__ */ t(
|
|
385
|
-
|
|
408
|
+
K,
|
|
386
409
|
{
|
|
387
410
|
type: "number",
|
|
388
411
|
dataKey: "y",
|
|
389
|
-
tick:
|
|
412
|
+
tick: e,
|
|
390
413
|
axisLine: !1,
|
|
391
414
|
tickLine: !1,
|
|
392
415
|
tickFormatter: p
|
|
393
416
|
}
|
|
394
417
|
),
|
|
395
|
-
/* @__PURE__ */ t(
|
|
396
|
-
|
|
397
|
-
|
|
418
|
+
/* @__PURE__ */ t(X, { type: "number", dataKey: "z", range: o }),
|
|
419
|
+
y && /* @__PURE__ */ t(
|
|
420
|
+
L,
|
|
398
421
|
{
|
|
399
|
-
contentStyle:
|
|
400
|
-
labelStyle:
|
|
401
|
-
itemStyle:
|
|
422
|
+
contentStyle: s.contentStyle,
|
|
423
|
+
labelStyle: s.labelStyle,
|
|
424
|
+
itemStyle: s.itemStyle,
|
|
402
425
|
cursor: { strokeDasharray: "3 3" }
|
|
403
426
|
}
|
|
404
427
|
),
|
|
405
|
-
d && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color:
|
|
406
|
-
|
|
407
|
-
|
|
428
|
+
d && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: i.textMuted, paddingTop: 8 } }),
|
|
429
|
+
r.map((c, l) => /* @__PURE__ */ t(
|
|
430
|
+
Y,
|
|
408
431
|
{
|
|
409
|
-
name:
|
|
410
|
-
data:
|
|
411
|
-
fill:
|
|
432
|
+
name: c.name,
|
|
433
|
+
data: c.data,
|
|
434
|
+
fill: c.color ?? a[l % a.length],
|
|
412
435
|
fillOpacity: 0.8
|
|
413
436
|
},
|
|
414
|
-
|
|
437
|
+
c.name ?? l
|
|
415
438
|
))
|
|
416
439
|
] }) }) });
|
|
417
440
|
}
|
|
418
|
-
function
|
|
419
|
-
data:
|
|
420
|
-
series:
|
|
421
|
-
angleKey:
|
|
422
|
-
height:
|
|
441
|
+
function yt({
|
|
442
|
+
data: r,
|
|
443
|
+
series: m,
|
|
444
|
+
angleKey: h,
|
|
445
|
+
height: S = 300,
|
|
423
446
|
showLegend: d = !0,
|
|
424
|
-
showTooltip:
|
|
425
|
-
outerRadius:
|
|
447
|
+
showTooltip: y = !0,
|
|
448
|
+
outerRadius: k = "70%",
|
|
426
449
|
ariaLabel: p = "Radar chart"
|
|
427
450
|
}) {
|
|
428
|
-
const o = z(),
|
|
429
|
-
return /* @__PURE__ */ t("div", { role: "img", "aria-label": p, style: { width: "100%", height:
|
|
430
|
-
/* @__PURE__ */ t(
|
|
451
|
+
const o = z(), u = C(o), i = M(o);
|
|
452
|
+
return /* @__PURE__ */ t("div", { role: "img", "aria-label": p, style: { width: "100%", height: S }, children: /* @__PURE__ */ t(v, { width: "100%", height: "100%", children: /* @__PURE__ */ g(Z, { data: r, outerRadius: k, children: [
|
|
453
|
+
/* @__PURE__ */ t(_, { stroke: o.border }),
|
|
431
454
|
/* @__PURE__ */ t(
|
|
432
|
-
|
|
455
|
+
J,
|
|
433
456
|
{
|
|
434
|
-
dataKey:
|
|
457
|
+
dataKey: h,
|
|
435
458
|
tick: { fill: o.textMuted, fontSize: 12 }
|
|
436
459
|
}
|
|
437
460
|
),
|
|
438
461
|
/* @__PURE__ */ t(
|
|
439
|
-
|
|
462
|
+
Q,
|
|
440
463
|
{
|
|
441
464
|
tick: { fill: o.textMuted, fontSize: 10 },
|
|
442
465
|
axisLine: !1,
|
|
443
466
|
tickLine: !1
|
|
444
467
|
}
|
|
445
468
|
),
|
|
446
|
-
|
|
447
|
-
|
|
469
|
+
y && /* @__PURE__ */ t(
|
|
470
|
+
L,
|
|
448
471
|
{
|
|
449
|
-
contentStyle:
|
|
450
|
-
labelStyle:
|
|
451
|
-
itemStyle:
|
|
472
|
+
contentStyle: i.contentStyle,
|
|
473
|
+
labelStyle: i.labelStyle,
|
|
474
|
+
itemStyle: i.itemStyle
|
|
452
475
|
}
|
|
453
476
|
),
|
|
454
477
|
d && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: o.textMuted } }),
|
|
455
|
-
|
|
456
|
-
const
|
|
478
|
+
m.map((a, s) => {
|
|
479
|
+
const e = a.color ?? u[s % u.length];
|
|
457
480
|
return /* @__PURE__ */ t(
|
|
458
|
-
|
|
481
|
+
tt,
|
|
459
482
|
{
|
|
460
|
-
name:
|
|
461
|
-
dataKey:
|
|
462
|
-
stroke:
|
|
463
|
-
fill:
|
|
464
|
-
fillOpacity:
|
|
483
|
+
name: a.label ?? a.key,
|
|
484
|
+
dataKey: a.key,
|
|
485
|
+
stroke: e,
|
|
486
|
+
fill: e,
|
|
487
|
+
fillOpacity: a.fillOpacity ?? 0.2,
|
|
465
488
|
strokeWidth: 2
|
|
466
489
|
},
|
|
467
|
-
|
|
490
|
+
a.key
|
|
468
491
|
);
|
|
469
492
|
})
|
|
470
493
|
] }) }) });
|
|
471
494
|
}
|
|
472
495
|
export {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
496
|
+
ot as TkxAreaChart,
|
|
497
|
+
at as TkxBarChart,
|
|
498
|
+
dt as TkxDonutChart,
|
|
499
|
+
nt as TkxLineChart,
|
|
500
|
+
ct as TkxPieChart,
|
|
501
|
+
yt as TkxRadarChart,
|
|
502
|
+
st as TkxScatterChart
|
|
480
503
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TkxDonutChart.d.ts","sourceRoot":"","sources":["../../../src/charts/TkxDonutChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TkxDonutChart.d.ts","sourceRoot":"","sources":["../../../src/charts/TkxDonutChart.tsx"],"names":[],"mappings":"AAYA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA4BD,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,MAAY,EACZ,UAAiB,EACjB,WAAkB,EAClB,WAAW,EACX,cAAc,EACd,WAAmB,EACnB,WAAmB,EACnB,UAAe,EACf,SAAyB,GAC1B,EAAE,kBAAkB,2CAqFpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TkxPieChart.d.ts","sourceRoot":"","sources":["../../../src/charts/TkxPieChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TkxPieChart.d.ts","sourceRoot":"","sources":["../../../src/charts/TkxPieChart.tsx"],"names":[],"mappings":"AAYA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,MAAY,EACZ,UAAiB,EACjB,WAAkB,EAClB,UAAkB,EAClB,WAAmB,EACnB,UAAe,EACf,SAAuB,GACxB,EAAE,gBAAgB,2CAwDlB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tekivex-ui",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.4",
|
|
4
4
|
"description": "Production-grade React component library — 70+ components, WCAG 2.1 AAA, WAI-ARIA 1.2, built-in charts, headless primitives, zero-runtime CSS engine, TypeScript-first.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
ResponsiveContainer,
|
|
3
4
|
PieChart,
|
|
@@ -73,10 +74,21 @@ export function TkxDonutChart({
|
|
|
73
74
|
const theme = useTheme();
|
|
74
75
|
const colors = getDefaultColors(theme);
|
|
75
76
|
const tt = tooltipStyle(theme);
|
|
77
|
+
// Force ResponsiveContainer to re-measure after the parent layout settles.
|
|
78
|
+
const [mounted, setMounted] = useState(false);
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
const id = requestAnimationFrame(() => setMounted(true));
|
|
81
|
+
return () => cancelAnimationFrame(id);
|
|
82
|
+
}, []);
|
|
76
83
|
|
|
77
84
|
return (
|
|
78
|
-
<div
|
|
79
|
-
|
|
85
|
+
<div
|
|
86
|
+
role="img"
|
|
87
|
+
aria-label={ariaLabel}
|
|
88
|
+
style={{ width: '100%', minWidth: 240, height, position: 'relative' }}
|
|
89
|
+
>
|
|
90
|
+
{mounted && (
|
|
91
|
+
<ResponsiveContainer width="100%" height="100%" debounce={50}>
|
|
80
92
|
<PieChart>
|
|
81
93
|
{showTooltip && (
|
|
82
94
|
<Tooltip
|
|
@@ -114,6 +126,7 @@ export function TkxDonutChart({
|
|
|
114
126
|
)}
|
|
115
127
|
</PieChart>
|
|
116
128
|
</ResponsiveContainer>
|
|
129
|
+
)}
|
|
117
130
|
{/* Overlay center label using absolute positioning */}
|
|
118
131
|
{(centerLabel || centerSublabel) && (
|
|
119
132
|
<div
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
ResponsiveContainer,
|
|
3
4
|
PieChart,
|
|
@@ -41,10 +42,23 @@ export function TkxPieChart({
|
|
|
41
42
|
const theme = useTheme();
|
|
42
43
|
const colors = getDefaultColors(theme);
|
|
43
44
|
const tt = tooltipStyle(theme);
|
|
45
|
+
// Force ResponsiveContainer to re-measure after the parent layout settles.
|
|
46
|
+
// Without this, recharts can compute 0×0 on first paint inside CSS grids/flex
|
|
47
|
+
// and the chart silently disappears.
|
|
48
|
+
const [mounted, setMounted] = useState(false);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const id = requestAnimationFrame(() => setMounted(true));
|
|
51
|
+
return () => cancelAnimationFrame(id);
|
|
52
|
+
}, []);
|
|
44
53
|
|
|
45
54
|
return (
|
|
46
|
-
<div
|
|
47
|
-
|
|
55
|
+
<div
|
|
56
|
+
role="img"
|
|
57
|
+
aria-label={ariaLabel}
|
|
58
|
+
style={{ width: '100%', minWidth: 240, height, position: 'relative' }}
|
|
59
|
+
>
|
|
60
|
+
{mounted && (
|
|
61
|
+
<ResponsiveContainer width="100%" height="100%" debounce={50}>
|
|
48
62
|
<PieChart>
|
|
49
63
|
{showTooltip && (
|
|
50
64
|
<Tooltip
|
|
@@ -77,6 +91,7 @@ export function TkxPieChart({
|
|
|
77
91
|
</Pie>
|
|
78
92
|
</PieChart>
|
|
79
93
|
</ResponsiveContainer>
|
|
94
|
+
)}
|
|
80
95
|
</div>
|
|
81
96
|
);
|
|
82
97
|
}
|