@acronis-platform/ui-react 0.58.0 → 0.61.0
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/README.md +5 -5
- package/dist/components/ui/app-shell/app-shell.js.map +1 -1
- package/dist/components/ui/area-chart/area-chart.js +210 -119
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js +26 -23
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +595 -149
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/calendar/calendar.js +17 -15
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/carousel-dialog/carousel-dialog.js +87 -0
- package/dist/components/ui/carousel-dialog/carousel-dialog.js.map +1 -0
- package/dist/components/ui/category-bar/category-bar.js +147 -0
- package/dist/components/ui/category-bar/category-bar.js.map +1 -0
- package/dist/components/ui/chart/chart-format.js +170 -0
- package/dist/components/ui/chart/chart-format.js.map +1 -0
- package/dist/components/ui/chart/chart.js +204 -150
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/composed-chart/composed-chart.js +423 -98
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
- package/dist/components/ui/confidence-cone/confidence-cone.js +306 -172
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js +29 -29
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js +57 -0
- package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js.map +1 -0
- package/dist/components/ui/dialog-footer-default/dialog-footer-default.js +1 -1
- package/dist/components/ui/dialog-footer-default/dialog-footer-default.js.map +1 -1
- package/dist/components/ui/dialog-welcome/dialog-welcome.js +272 -0
- package/dist/components/ui/dialog-welcome/dialog-welcome.js.map +1 -0
- package/dist/components/ui/funnel-chart/funnel-chart.js +245 -51
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/histogram/histogram.js +96 -64
- package/dist/components/ui/histogram/histogram.js.map +1 -1
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +230 -159
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/metric/metric.js +88 -70
- package/dist/components/ui/metric/metric.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.js +234 -80
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +210 -57
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +358 -50
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
- package/dist/components/ui/sankey-chart/sankey-chart.js +199 -0
- package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -0
- package/dist/components/ui/scatter-chart/scatter-chart.js +86 -50
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/timeline/timeline.js +206 -142
- package/dist/components/ui/timeline/timeline.js.map +1 -1
- package/dist/components/ui/toolbar/toolbar.js +82 -92
- package/dist/components/ui/toolbar/toolbar.js.map +1 -1
- package/dist/components/ui/treemap/treemap.js +183 -59
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/index.js +481 -439
- package/dist/index.js.map +1 -1
- package/dist/lib/breakpoints.js +9 -6
- package/dist/lib/breakpoints.js.map +1 -1
- package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +25 -0
- package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js.map +1 -0
- package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +36 -0
- package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js.map +1 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js +1205 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js.map +1 -0
- package/dist/react.js +481 -439
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/area-chart/area-chart.d.ts +52 -17
- package/dist/src/components/ui/area-chart/index.d.ts +1 -1
- package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +152 -29
- package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/button/button.d.ts +1 -1
- package/dist/src/components/ui/button-menu/button-menu.d.ts +1 -1
- package/dist/src/components/ui/carousel-dialog/carousel-dialog.d.ts +28 -0
- package/dist/src/components/ui/carousel-dialog/index.d.ts +1 -0
- package/dist/src/components/ui/category-bar/category-bar.d.ts +51 -0
- package/dist/src/components/ui/category-bar/index.d.ts +1 -0
- package/dist/src/components/ui/chart/__tests__/chart-format.test.d.ts +1 -0
- package/dist/src/components/ui/chart/__tests__/chart-layout.d.ts +63 -0
- package/dist/src/components/ui/chart/__tests__/chart-layout.test.d.ts +1 -0
- package/dist/src/components/ui/chart/chart-format.d.ts +526 -0
- package/dist/src/components/ui/chart/chart.d.ts +11 -3
- package/dist/src/components/ui/chart/index.d.ts +3 -1
- package/dist/src/components/ui/composed-chart/composed-chart.d.ts +154 -20
- package/dist/src/components/ui/composed-chart/index.d.ts +1 -1
- package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +138 -37
- package/dist/src/components/ui/confidence-cone/index.d.ts +1 -1
- package/dist/src/components/ui/dialog-footer-carousel/dialog-footer-carousel.d.ts +9 -0
- package/dist/src/components/ui/dialog-footer-carousel/index.d.ts +1 -0
- package/dist/src/components/ui/dialog-welcome/dialog-welcome.d.ts +54 -0
- package/dist/src/components/ui/dialog-welcome/dialog-welcome.docs.d.ts +55 -0
- package/dist/src/components/ui/dialog-welcome/index.d.ts +1 -0
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +201 -3
- package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
- package/dist/src/components/ui/histogram/histogram.d.ts +2 -17
- package/dist/src/components/ui/line-chart/index.d.ts +1 -1
- package/dist/src/components/ui/line-chart/line-chart.d.ts +50 -17
- package/dist/src/components/ui/pie-chart/index.d.ts +1 -1
- package/dist/src/components/ui/pie-chart/pie-chart.d.ts +145 -4
- package/dist/src/components/ui/radar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +219 -6
- package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +215 -9
- package/dist/src/components/ui/sankey-chart/index.d.ts +2 -0
- package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +69 -0
- package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +2 -17
- package/dist/src/components/ui/timeline/index.d.ts +1 -1
- package/dist/src/components/ui/timeline/timeline.d.ts +79 -20
- package/dist/src/components/ui/treemap/index.d.ts +1 -1
- package/dist/src/components/ui/treemap/treemap.d.ts +68 -8
- package/dist/src/index.d.ts +5 -1
- package/dist/ui-react.css +1 -1
- package/package.json +5 -4
- package/dist/components/ui/search-global/search-global.js +0 -60
- package/dist/components/ui/search-global/search-global.js.map +0 -1
- package/dist/src/components/ui/search-global/index.d.ts +0 -1
- package/dist/src/components/ui/search-global/search-global.d.ts +0 -7
|
@@ -1,83 +1,207 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import { Treemap as
|
|
4
|
-
import { cn as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as N, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as I from "react";
|
|
3
|
+
import { Treemap as W } from "recharts";
|
|
4
|
+
import { cn as H } from "../../../lib/utils.js";
|
|
5
|
+
import { resolveAnimation as Y, CHART_LABEL_FONT_SIZE as k } from "../chart/chart-format.js";
|
|
6
|
+
import { ChartContainer as w, ChartTooltip as z, ChartTooltipContent as Z, ChartStyle as F, ChartLegendContent as P } from "../chart/chart.js";
|
|
7
|
+
const E = 2, U = 6, X = 12, S = 4 / 3, q = 11, J = Math.ceil(k * S), Q = Math.ceil(
|
|
8
|
+
q * S
|
|
9
|
+
), V = 64, g = X * 2 + J, y = g + Q;
|
|
10
|
+
function K(h) {
|
|
11
|
+
const { row: n, keys: l, separator: f, formatter: t } = h, s = l.flatMap((i, d) => {
|
|
12
|
+
const e = n[i];
|
|
13
|
+
if (e == null || e === "") return [];
|
|
14
|
+
const o = t ? t(e, d) : String(e);
|
|
15
|
+
return o === "" ? [] : [o];
|
|
16
|
+
});
|
|
17
|
+
return s.length ? s.join(f) : void 0;
|
|
18
|
+
}
|
|
19
|
+
const tt = {
|
|
20
|
+
"bottom-start": "justify-end text-start",
|
|
21
|
+
"top-start": "justify-start text-start",
|
|
22
|
+
center: "justify-center text-center"
|
|
23
|
+
};
|
|
24
|
+
function et({
|
|
25
|
+
x: h = 0,
|
|
26
|
+
y: n = 0,
|
|
27
|
+
width: l = 0,
|
|
28
|
+
height: f = 0,
|
|
29
|
+
name: t,
|
|
30
|
+
primaryLabel: s,
|
|
31
|
+
secondaryLabel: i,
|
|
32
|
+
showLabels: d = !0,
|
|
33
|
+
labelAlign: e = "bottom-start"
|
|
13
34
|
}) {
|
|
14
|
-
if (!
|
|
15
|
-
const
|
|
16
|
-
return /* @__PURE__ */
|
|
35
|
+
if (!t) return /* @__PURE__ */ r("g", {});
|
|
36
|
+
const o = h + E, x = n + E, L = Math.max(0, l - E * 2), a = Math.max(0, f - E * 2), c = d && L > V && a >= g, _ = c && i && a >= y ? i : void 0;
|
|
37
|
+
return /* @__PURE__ */ N("g", { children: [
|
|
17
38
|
/* @__PURE__ */ r(
|
|
18
39
|
"rect",
|
|
19
40
|
{
|
|
20
41
|
x: o,
|
|
21
|
-
y:
|
|
22
|
-
width:
|
|
42
|
+
y: x,
|
|
43
|
+
width: L,
|
|
23
44
|
height: a,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
style: { fill: `var(--color-${e})` }
|
|
45
|
+
rx: U,
|
|
46
|
+
style: { fill: `var(--color-${t})` }
|
|
27
47
|
}
|
|
28
48
|
),
|
|
29
|
-
|
|
30
|
-
|
|
49
|
+
c && // Decorative: the hover that opens the tooltip belongs to the tile, so the
|
|
50
|
+
// label must not swallow it.
|
|
51
|
+
/* @__PURE__ */ r(
|
|
52
|
+
"foreignObject",
|
|
31
53
|
{
|
|
32
|
-
x: o
|
|
33
|
-
y:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
className: "
|
|
37
|
-
children:
|
|
54
|
+
x: o,
|
|
55
|
+
y: x,
|
|
56
|
+
width: L,
|
|
57
|
+
height: a,
|
|
58
|
+
className: "pointer-events-none",
|
|
59
|
+
children: /* @__PURE__ */ N(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: H(
|
|
63
|
+
// Each line truncates with a real ellipsis — CSS measures the text,
|
|
64
|
+
// so nothing has to estimate how much of it fits.
|
|
65
|
+
"flex size-full flex-col overflow-hidden p-3",
|
|
66
|
+
// The design system's "text on a strong colored surface" token
|
|
67
|
+
// (constant white in both themes) — reads over the saturated series
|
|
68
|
+
// colors without hardcoding a color. The weight, not a second color,
|
|
69
|
+
// carries the hierarchy over the second line: the on-strong
|
|
70
|
+
// *secondary* text token resolves to a dark grey in dark mode, which
|
|
71
|
+
// a cell's fill stays saturated behind.
|
|
72
|
+
"text-[var(--ui-text-on-status-strong-neutral)]",
|
|
73
|
+
tt[e]
|
|
74
|
+
),
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ r("span", { className: "truncate text-xs font-semibold", children: s ?? t }),
|
|
77
|
+
_ && /* @__PURE__ */ r("span", { className: "truncate text-[11px]", children: _ })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
)
|
|
38
81
|
}
|
|
39
82
|
)
|
|
40
83
|
] });
|
|
41
84
|
}
|
|
42
|
-
const
|
|
85
|
+
const rt = I.forwardRef(
|
|
43
86
|
({
|
|
44
|
-
className:
|
|
45
|
-
config:
|
|
46
|
-
data:
|
|
47
|
-
dataKey:
|
|
48
|
-
nameKey:
|
|
87
|
+
className: h,
|
|
88
|
+
config: n,
|
|
89
|
+
data: l,
|
|
90
|
+
dataKey: f,
|
|
91
|
+
nameKey: t,
|
|
49
92
|
aspectRatio: s = 4 / 3,
|
|
50
93
|
showLabels: i = !0,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
94
|
+
labelAlign: d = "bottom-start",
|
|
95
|
+
secondaryKeys: e,
|
|
96
|
+
secondaryFormatter: o,
|
|
97
|
+
secondarySeparator: x = " · ",
|
|
98
|
+
showTooltip: L = !0,
|
|
99
|
+
showLegend: a = !1,
|
|
100
|
+
legendPos: c = "bottom",
|
|
101
|
+
tooltipContent: _,
|
|
102
|
+
animate: M,
|
|
103
|
+
animationDuration: G,
|
|
104
|
+
animationBegin: R,
|
|
105
|
+
animationEasing: j,
|
|
106
|
+
...D
|
|
107
|
+
}, O) => {
|
|
108
|
+
const B = Y({
|
|
109
|
+
animate: M,
|
|
110
|
+
animationDuration: G,
|
|
111
|
+
animationBegin: R,
|
|
112
|
+
animationEasing: j
|
|
113
|
+
}), T = I.useMemo(
|
|
114
|
+
() => l.map((p) => {
|
|
115
|
+
var b;
|
|
116
|
+
const m = String(p[t]), u = e != null && e.length ? K({
|
|
117
|
+
row: p,
|
|
118
|
+
keys: e,
|
|
119
|
+
separator: x,
|
|
120
|
+
formatter: o
|
|
121
|
+
}) : void 0, A = (b = n[m]) == null ? void 0 : b.label;
|
|
122
|
+
return {
|
|
123
|
+
...p,
|
|
124
|
+
fill: `var(--color-${m})`,
|
|
125
|
+
...typeof A == "string" ? { primaryLabel: A } : {},
|
|
126
|
+
...u ? { secondaryLabel: u } : {}
|
|
127
|
+
};
|
|
128
|
+
}),
|
|
129
|
+
[
|
|
130
|
+
n,
|
|
131
|
+
l,
|
|
132
|
+
t,
|
|
133
|
+
o,
|
|
134
|
+
e,
|
|
135
|
+
x
|
|
136
|
+
]
|
|
137
|
+
), $ = I.useMemo(() => {
|
|
138
|
+
const p = /* @__PURE__ */ new Set();
|
|
139
|
+
return T.flatMap((m) => {
|
|
140
|
+
const u = String(m[t]);
|
|
141
|
+
return p.has(u) ? [] : (p.add(u), [
|
|
70
142
|
{
|
|
71
|
-
|
|
143
|
+
value: u,
|
|
144
|
+
dataKey: t,
|
|
145
|
+
type: "rect",
|
|
146
|
+
color: String(m.fill),
|
|
147
|
+
payload: m
|
|
72
148
|
}
|
|
73
|
-
)
|
|
149
|
+
]);
|
|
150
|
+
});
|
|
151
|
+
}, [t, T]), C = `chart-${I.useId().replace(/:/g, "")}`, v = a ? /* @__PURE__ */ N("div", { "data-chart": C, className: "text-xs", children: [
|
|
152
|
+
/* @__PURE__ */ r(F, { id: C, config: n }),
|
|
153
|
+
/* @__PURE__ */ r(
|
|
154
|
+
P,
|
|
155
|
+
{
|
|
156
|
+
config: n,
|
|
157
|
+
payload: $,
|
|
158
|
+
verticalAlign: c,
|
|
159
|
+
nameKey: t
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
] }) : null;
|
|
163
|
+
return /* @__PURE__ */ N(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
ref: O,
|
|
167
|
+
className: H(a && "flex flex-col", h),
|
|
168
|
+
...D,
|
|
169
|
+
children: [
|
|
170
|
+
c === "top" && v,
|
|
171
|
+
/* @__PURE__ */ r(
|
|
172
|
+
w,
|
|
173
|
+
{
|
|
174
|
+
config: n,
|
|
175
|
+
className: a ? "min-h-0 w-full flex-1" : "size-full",
|
|
176
|
+
children: /* @__PURE__ */ r(
|
|
177
|
+
W,
|
|
178
|
+
{
|
|
179
|
+
data: T,
|
|
180
|
+
dataKey: f,
|
|
181
|
+
nameKey: t,
|
|
182
|
+
aspectRatio: s,
|
|
183
|
+
...B,
|
|
184
|
+
content: /* @__PURE__ */ r(et, { showLabels: i, labelAlign: d }),
|
|
185
|
+
children: L && /* @__PURE__ */ r(
|
|
186
|
+
z,
|
|
187
|
+
{
|
|
188
|
+
content: _ ?? /* @__PURE__ */ r(Z, { nameKey: t, hideLabel: !0 })
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
c === "bottom" && v
|
|
196
|
+
]
|
|
74
197
|
}
|
|
75
|
-
)
|
|
198
|
+
);
|
|
76
199
|
}
|
|
77
200
|
);
|
|
78
|
-
|
|
201
|
+
rt.displayName = "Treemap";
|
|
79
202
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
203
|
+
rt as Treemap,
|
|
204
|
+
et as TreemapCell,
|
|
205
|
+
K as treemapSecondaryLabel
|
|
82
206
|
};
|
|
83
207
|
//# sourceMappingURL=treemap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treemap.js","sources":["../../../../src/components/ui/treemap/treemap.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Treemap as RechartsTreemap } from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. A treemap is\n// the odd one out: a single `Treemap` element with no axes/grid/legend, themed\n// through a custom `content` cell renderer (recharts' default paints every cell\n// the same fill and has no token hooks). Like Scatter/Composed/RadialBar there's\n// no CVA variant — a treemap's knobs are geometry (`aspectRatio`) and the data,\n// not a visual \"mode\". v1 is a flat treemap (a list of leaves).\n\ninterface TreemapCellProps {\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n // recharts injects the node's resolved `name` (from nameKey) + value.\n name?: string;\n showLabels?: boolean;\n}\n\n// Cell renderer: fill each rect from its `--color-<name>` var, separate cells\n// with the surface color, and center a white label (readable over the saturated\n// series colors) when the cell is big enough. Passed to `Treemap.content`;\n// recharts clones it with each node's geometry + `name`.\nexport function TreemapCell({\n x = 0,\n y = 0,\n width = 0,\n height = 0,\n name,\n showLabels = true,\n}: TreemapCellProps) {\n // recharts invokes `content` for the synthetic root node too (full chart\n // dimensions, empty name). Skip any name-less node — otherwise its rect has no\n // `--color-<name>` fill and paints the SVG-default black behind everything\n // (invisible when leaves cover it, a black box on empty data).\n if (!name) return <g />;\n const canLabel = showLabels && width > 64 && height > 28;\n return (\n <g>\n <rect\n x={x}\n y={y}\n width={width}\n height={height}\n strokeWidth={2}\n className=\"stroke-background\"\n style={{ fill: `var(--color-${name})` }}\n />\n {canLabel && (\n <text\n x={x + width / 2}\n y={y + height / 2}\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n // The design system's \"text on a strong colored surface\" token\n // (constant white in both themes) — reads over the saturated series\n // colors without hardcoding a color.\n className=\"fill-[var(--ui-text-on-status-strong-neutral)] text-xs\"\n >\n {name}\n </text>\n )}\n </g>\n );\n}\n\nexport interface TreemapProps\n extends Omit<React.ComponentProps<'div'>, 'children'> {\n /** Row-per-leaf data. Each object holds the leaf's `nameKey` label + its `dataKey` numeric size. */\n data: ReadonlyArray<Record<string, string | number>>;\n /**\n * Per-leaf map of `label` / `color`, keyed by the leaf's `nameKey` value\n * (imported from the shared `Chart` primitives). Turned into `--color-<name>`\n * custom properties. Colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Numeric field that sizes each leaf's rectangle. */\n dataKey: string;\n /**\n * Label field that names each leaf (drives the on-cell label, tooltip, and\n * `--color-<name>` lookup). Values should be unique and CSS-safe (they become\n * part of a custom-property name).\n */\n nameKey: string;\n /** Width-to-height ratio the tiling targets. */\n aspectRatio?: number;\n /** Render each leaf's name inside its cell (when it fits). */\n showLabels?: boolean;\n showTooltip?: boolean;\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` —\n * to customize formatting, per-cell rows, or extra fields without composing\n * recharts yourself. Ignored when `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n}\n\nconst Treemap = React.forwardRef<HTMLDivElement, TreemapProps>(\n (\n {\n className,\n config,\n data,\n dataKey,\n nameKey,\n aspectRatio = 4 / 3,\n showLabels = true,\n showTooltip = true,\n tooltipContent,\n ...props\n },\n ref\n ) => {\n // Stamp each row with its `fill` (the shadcn data-driven pattern) so a real\n // hover resolves the cell color in the tooltip — recharts' Treemap carries no\n // per-cell color on the tooltip payload item.\n const seriesData: Record<string, string | number>[] = data.map((row) => ({\n ...row,\n fill: `var(--color-${row[nameKey]})`,\n }));\n\n return (\n <div ref={ref} className={cn(className)} {...props}>\n <ChartContainer config={config} className=\"size-full\">\n <RechartsTreemap\n data={seriesData}\n dataKey={dataKey}\n nameKey={nameKey}\n aspectRatio={aspectRatio}\n isAnimationActive={false}\n content={<TreemapCell showLabels={showLabels} />}\n >\n {showTooltip && (\n <ChartTooltip\n content={\n tooltipContent ?? (\n <ChartTooltipContent nameKey={nameKey} hideLabel />\n )\n }\n />\n )}\n </RechartsTreemap>\n </ChartContainer>\n </div>\n );\n }\n);\nTreemap.displayName = 'Treemap';\n\nexport { Treemap };\n"],"names":["TreemapCell","x","y","width","height","name","showLabels","jsx","canLabel","Treemap","React","className","config","data","dataKey","nameKey","aspectRatio","showTooltip","tooltipContent","props","ref","seriesData","row","cn","ChartContainer","RechartsTreemap","ChartTooltip","ChartTooltipContent"],"mappings":";;;;;AAkCO,SAASA,EAAY;AAAA,EAC1B,GAAAC,IAAI;AAAA,EACJ,GAAAC,IAAI;AAAA,EACJ,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,MAAAC;AAAA,EACA,YAAAC,IAAa;AACf,GAAqB;AAKnB,MAAI,CAACD,EAAM,QAAO,gBAAAE,EAAC,KAAA,CAAA,CAAE;AACrB,QAAMC,IAAWF,KAAcH,IAAQ,MAAMC,IAAS;AACtD,2BACG,KAAA,EACC,UAAA;AAAA,IAAA,gBAAAG;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAAN;AAAA,QACA,GAAAC;AAAA,QACA,OAAAC;AAAA,QACA,QAAAC;AAAA,QACA,aAAa;AAAA,QACb,WAAU;AAAA,QACV,OAAO,EAAE,MAAM,eAAeC,CAAI,IAAA;AAAA,MAAI;AAAA,IAAA;AAAA,IAEvCG,KACC,gBAAAD;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAGN,IAAIE,IAAQ;AAAA,QACf,GAAGD,IAAIE,IAAS;AAAA,QAChB,YAAW;AAAA,QACX,kBAAiB;AAAA,QAIjB,WAAU;AAAA,QAET,UAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GAEJ;AAEJ;AAmCA,MAAMI,IAAUC,EAAM;AAAA,EACpB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,aAAAC,IAAc,IAAI;AAAA,IAClB,YAAAV,IAAa;AAAA,IACb,aAAAW,IAAc;AAAA,IACd,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AAIH,UAAMC,IAAgDR,EAAK,IAAI,CAACS,OAAS;AAAA,MACvE,GAAGA;AAAA,MACH,MAAM,eAAeA,EAAIP,CAAO,CAAC;AAAA,IAAA,EACjC;AAEF,WACE,gBAAAR,EAAC,OAAA,EAAI,KAAAa,GAAU,WAAWG,EAAGZ,CAAS,GAAI,GAAGQ,GAC3C,UAAA,gBAAAZ,EAACiB,GAAA,EAAe,QAAAZ,GAAgB,WAAU,aACxC,UAAA,gBAAAL;AAAA,MAACkB;AAAAA,MAAA;AAAA,QACC,MAAMJ;AAAA,QACN,SAAAP;AAAA,QACA,SAAAC;AAAA,QACA,aAAAC;AAAA,QACA,mBAAmB;AAAA,QACnB,SAAS,gBAAAT,EAACP,GAAA,EAAY,YAAAM,EAAA,CAAwB;AAAA,QAE7C,UAAAW,KACC,gBAAAV;AAAA,UAACmB;AAAA,UAAA;AAAA,YACC,SACER,KACE,gBAAAX,EAACoB,GAAA,EAAoB,SAAAZ,GAAkB,WAAS,GAAA,CAAC;AAAA,UAAA;AAAA,QAAA;AAAA,MAGvD;AAAA,IAAA,GAGN,EAAA,CACF;AAAA,EAEJ;AACF;AACAN,EAAQ,cAAc;"}
|
|
1
|
+
{"version":3,"file":"treemap.js","sources":["../../../../src/components/ui/treemap/treemap.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Treemap as RechartsTreemap } from 'recharts';\nimport type { LegendPayload } from 'recharts/types/component/DefaultLegendContent';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegendContent,\n ChartStyle,\n ChartTooltip,\n ChartTooltipContent,\n resolveAnimation,\n CHART_LABEL_FONT_SIZE,\n type ChartConfig,\n type ChartAnimationProps,\n type TickFormatter,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. A treemap is\n// the odd one out: a single `Treemap` element with no axes/grid, themed through a\n// custom `content` cell renderer (recharts' default paints every cell the same\n// fill and has no token hooks) — and that renderer, not a `LabelList`, owns the\n// on-cell labels, so the fit/clamp logic lives here. Like Scatter/Composed/\n// RadialBar there's no CVA variant — a treemap's knobs are geometry\n// (`aspectRatio`) and the data, not a visual \"mode\". v1 is a flat treemap (a list\n// of leaves).\n\n/**\n * Where a cell's label block sits inside its rectangle. Named logically, not\n * physically: the corner variants anchor to the tile's *start* edge, so they\n * mirror under `dir=\"rtl\"`. `bottom-start` is the design's placement; `center`\n * is what the chart drew before the block had a second line.\n */\nexport type TreemapLabelAlign = 'bottom-start' | 'top-start' | 'center';\n\n// Cell shape: each tile is inset by the gap on every side, so neighbouring tiles\n// are separated by the surface showing through rather than by a stroke, and the\n// corners are rounded.\nconst CELL_GAP = 2;\nconst CELL_RADIUS = 6;\n\n// Label geometry, in px. The block's own layout is CSS (see the renderer); these\n// are the heights the tile has to clear for a label to fit *without being\n// clipped* — one line, or two.\n//\n// Line boxes, not font sizes: Tailwind's `--text-xs--line-height` is 4/3, so the\n// `text-xs` title renders a 16px line box, and the second line inherits that same\n// ratio (an arbitrary `text-[11px]` sets font-size only) for ~14.7px. Measuring by\n// font size instead would let a tile pass the threshold and still have the block's\n// `overflow-hidden` eat the top of the first line.\nconst CELL_PADDING = 12;\nconst LINE_HEIGHT_RATIO = 4 / 3;\nconst SECONDARY_FONT_SIZE = 11;\nconst TITLE_LINE_HEIGHT = Math.ceil(CHART_LABEL_FONT_SIZE * LINE_HEIGHT_RATIO);\nconst SECONDARY_LINE_HEIGHT = Math.ceil(\n SECONDARY_FONT_SIZE * LINE_HEIGHT_RATIO\n);\n\n// The smallest tile that gets a label at all, and the height a second line\n// additionally needs. Below the first threshold a cell stays blank rather than\n// showing a stub — the label would be wider than the tile it names.\nconst MIN_LABEL_WIDTH = 64;\nconst MIN_LABEL_HEIGHT = CELL_PADDING * 2 + TITLE_LINE_HEIGHT;\nconst MIN_TWO_LINE_HEIGHT = MIN_LABEL_HEIGHT + SECONDARY_LINE_HEIGHT;\n\n/**\n * Compose a cell's second line out of the caller's `secondaryKeys`. Empty and\n * missing fields are skipped rather than printed as a gap, so one row without\n * the field doesn't leave a dangling separator.\n */\nexport function treemapSecondaryLabel(options: {\n row: Record<string, string | number>;\n keys: readonly string[];\n separator: string;\n formatter?: TickFormatter;\n}): string | undefined {\n const { row, keys, separator, formatter } = options;\n const parts = keys.flatMap((key, index) => {\n const value = row[key];\n if (value == null || value === '') return [];\n // Emptiness is re-checked *after* formatting, not just on the raw value: a\n // formatter that blanks a field it doesn't want to show (a zero, a sentinel)\n // would otherwise contribute an empty part and put back the dangling\n // separator this function exists to avoid.\n const part = formatter ? formatter(value, index) : String(value);\n return part === '' ? [] : [part];\n });\n return parts.length ? parts.join(separator) : undefined;\n}\n\ninterface TreemapCellProps {\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n // recharts injects the node's resolved `name` (from nameKey) + value, plus\n // every other field on the row — which is how the two stamped labels arrive.\n name?: string;\n /** The leaf's display name — its `config` label, stamped onto the row by `Treemap`. */\n primaryLabel?: string;\n /** The label's precomputed second line, stamped onto each row by `Treemap`. */\n secondaryLabel?: string;\n showLabels?: boolean;\n labelAlign?: TreemapLabelAlign;\n}\n\n// How the label block sits in its tile. `text-start`/`text-center` and the\n// block-axis `justify-*` are what make the corner-anchored variants mirror under\n// `dir=\"rtl\"` — the same logical utilities every other component uses, which is\n// why the label is HTML in a `foreignObject` rather than SVG `<text>`:\n// `x`/`text-anchor` are physical, so a mirrored label would need the direction\n// read in JS and applied by hand.\n//\n// Every variant leaves the cross axis on the default `items-stretch`, including\n// `center`. Centering the line is `text-center`'s job, not `items-center`'s:\n// `items-center` would size each line to its own text instead of to the tile, and\n// a `truncate` line only ellipsizes when it is the *tile* that constrains it — a\n// shrink-to-fit line is never narrower than its text, so it would silently\n// overflow and be hard-clipped on both edges instead.\nconst LABEL_ALIGN_CLASS: Record<TreemapLabelAlign, string> = {\n 'bottom-start': 'justify-end text-start',\n 'top-start': 'justify-start text-start',\n center: 'justify-center text-center',\n};\n\n// Cell renderer: fill each rounded rect from its `--color-<name>` var, inset it so\n// the surface shows through between tiles, and lay the label block over it — the\n// leaf's name, plus the stamped second line when the tile is tall enough. Passed to\n// `Treemap.content`; recharts clones it with each node's geometry + row fields.\nexport function TreemapCell({\n x = 0,\n y = 0,\n width = 0,\n height = 0,\n name,\n primaryLabel,\n secondaryLabel,\n showLabels = true,\n labelAlign = 'bottom-start',\n}: TreemapCellProps) {\n // recharts invokes `content` for the synthetic root node too (full chart\n // dimensions, empty name). Skip any name-less node — otherwise its rect has no\n // `--color-<name>` fill and paints the SVG-default black behind everything\n // (invisible when leaves cover it, a black box on empty data).\n if (!name) return <g />;\n // The tile, not the node: the label sits inside the inset rect, so the gutter\n // never eats into its padding.\n const tileX = x + CELL_GAP;\n const tileY = y + CELL_GAP;\n const tileWidth = Math.max(0, width - CELL_GAP * 2);\n const tileHeight = Math.max(0, height - CELL_GAP * 2);\n\n // `>=` on the heights: they are exact fits (padding + line boxes), so a tile\n // that measures one of them exactly has room for that label. The width is a\n // judgement call about how narrow a label is still worth reading, not a fit, so\n // it stays a strict `>`.\n const canLabel =\n showLabels && tileWidth > MIN_LABEL_WIDTH && tileHeight >= MIN_LABEL_HEIGHT;\n const secondary =\n canLabel && secondaryLabel && tileHeight >= MIN_TWO_LINE_HEIGHT\n ? secondaryLabel\n : undefined;\n\n return (\n <g>\n <rect\n x={tileX}\n y={tileY}\n width={tileWidth}\n height={tileHeight}\n rx={CELL_RADIUS}\n style={{ fill: `var(--color-${name})` }}\n />\n {canLabel && (\n // Decorative: the hover that opens the tooltip belongs to the tile, so the\n // label must not swallow it.\n <foreignObject\n x={tileX}\n y={tileY}\n width={tileWidth}\n height={tileHeight}\n className=\"pointer-events-none\"\n >\n <div\n className={cn(\n // Each line truncates with a real ellipsis — CSS measures the text,\n // so nothing has to estimate how much of it fits.\n 'flex size-full flex-col overflow-hidden p-3',\n // The design system's \"text on a strong colored surface\" token\n // (constant white in both themes) — reads over the saturated series\n // colors without hardcoding a color. The weight, not a second color,\n // carries the hierarchy over the second line: the on-strong\n // *secondary* text token resolves to a dark grey in dark mode, which\n // a cell's fill stays saturated behind.\n 'text-[var(--ui-text-on-status-strong-neutral)]',\n LABEL_ALIGN_CLASS[labelAlign]\n )}\n >\n <span className=\"truncate text-xs font-semibold\">\n {primaryLabel ?? name}\n </span>\n {secondary && (\n <span className=\"truncate text-[11px]\">{secondary}</span>\n )}\n </div>\n </foreignObject>\n )}\n </g>\n );\n}\n\nexport interface TreemapProps\n extends Omit<React.ComponentProps<'div'>, 'children'>, ChartAnimationProps {\n /**\n * Row-per-leaf data. Each object holds the leaf's `nameKey` label + its\n * `dataKey` numeric size.\n *\n * `fill`, `primaryLabel` and `secondaryLabel` are reserved: the chart stamps\n * them onto a copy of each row to carry the cell color and the two label lines\n * through to the renderer (recharts hands the whole row to `content`, so\n * anything the cell needs has to be on it). A row of your own carrying one of\n * those names may end up driving what the tile paints.\n */\n data: ReadonlyArray<Record<string, string | number>>;\n /**\n * Per-leaf map of `label` / `color`, keyed by the leaf's `nameKey` value\n * (imported from the shared `Chart` primitives). Turned into `--color-<name>`\n * custom properties. Colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Numeric field that sizes each leaf's rectangle. */\n dataKey: string;\n /**\n * Label field that names each leaf (drives the on-cell label, legend, tooltip,\n * and `--color-<name>` lookup). Values should be unique and CSS-safe (they\n * become part of a custom-property name).\n */\n nameKey: string;\n /** Width-to-height ratio the tiling targets. */\n aspectRatio?: number;\n /** Render each leaf's label inside its cell (when it fits). */\n showLabels?: boolean;\n /**\n * Where a cell's label sits. Defaults to `bottom-start` — the design's\n * placement, which keeps the label anchored to a tile corner as the tiling\n * reflows. `top-start` anchors it to the opposite corner; `center` centers the\n * block in the tile. The corner variants are named for the tile's *start* edge\n * because they mirror under `dir=\"rtl\"`.\n */\n labelAlign?: TreemapLabelAlign;\n /**\n * Fields whose values make up a second label line under the leaf's name — e.g.\n * `[dataKey]` for the size, or `['size', 'count']` for a value and a count. The\n * line is dropped on cells too short to hold it.\n */\n secondaryKeys?: readonly string[];\n /**\n * Format each secondary value. Receives the field's index in `secondaryKeys`\n * as its second argument, so one formatter can cover fields of different kinds.\n */\n secondaryFormatter?: TickFormatter;\n /** Separator drawn between multiple secondary values. */\n secondarySeparator?: string;\n showTooltip?: boolean;\n /**\n * Render the legend — one entry per leaf. Off by default: a treemap labels its\n * cells, so the legend is for the case where the tiles are too small to.\n */\n showLegend?: boolean;\n /** Which edge the legend sits on. */\n legendPos?: 'top' | 'bottom';\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` —\n * to customize formatting, per-cell rows, or extra fields without composing\n * recharts yourself. Ignored when `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n}\n\nconst Treemap = React.forwardRef<HTMLDivElement, TreemapProps>(\n (\n {\n className,\n config,\n data,\n dataKey,\n nameKey,\n aspectRatio = 4 / 3,\n showLabels = true,\n labelAlign = 'bottom-start',\n secondaryKeys,\n secondaryFormatter,\n secondarySeparator = ' · ',\n showTooltip = true,\n showLegend = false,\n legendPos = 'bottom',\n tooltipContent,\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n ...props\n },\n ref\n ) => {\n const animation = resolveAnimation({\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n });\n // Stamp each row with its `fill` (the shadcn data-driven pattern) so a real\n // hover resolves the cell color in the tooltip — recharts' Treemap carries no\n // per-cell color on the tooltip payload item — and with its `secondaryLabel`,\n // which reaches the cell renderer the same way: recharts hands the whole row\n // to `content`, so a composed label has to be on the row before it gets there.\n const seriesData: Record<string, string | number>[] = React.useMemo(\n () =>\n data.map((row) => {\n const name = String(row[nameKey]);\n const secondaryLabel = secondaryKeys?.length\n ? treemapSecondaryLabel({\n row,\n keys: secondaryKeys,\n separator: secondarySeparator,\n formatter: secondaryFormatter,\n })\n : undefined;\n // The on-cell name is the leaf's `config` label, so a cell reads like its\n // legend entry and tooltip row do. It matters more here than elsewhere:\n // the raw `nameKey` value has to be CSS-safe (it becomes part of\n // `--color-<name>`), so a leaf whose display name has a space in it is\n // keyed by a slug — and the slug is not what belongs on the tile. Only a\n // string label can go in SVG text; a `ReactNode` one falls back to the key.\n const label = config[name]?.label;\n return {\n ...row,\n fill: `var(--color-${name})`,\n ...(typeof label === 'string' ? { primaryLabel: label } : {}),\n ...(secondaryLabel ? { secondaryLabel } : {}),\n };\n }),\n [\n config,\n data,\n nameKey,\n secondaryFormatter,\n secondaryKeys,\n secondarySeparator,\n ]\n );\n\n // recharts 3 builds the legend payload from the graphical item, and `Treemap`\n // — unlike Bar/Line/Area/Pie/Radar/RadialBar/Scatter — never registers one,\n // so a `<Legend>` inside a `Treemap` renders empty. The payload is synthesized\n // from the leaves instead and handed to the shared `ChartLegendContent`, which\n // keeps the treemap on the same legend markers, labels and `config` lookup as\n // every other chart. `payload` carries the row so each entry resolves its own\n // `config` entry via `nameKey`.\n //\n // One entry per *distinct* leaf name: same-named leaves deliberately share a\n // `--color-<name>`/`config` entry, so a second entry would repeat the first\n // verbatim — and `ChartLegendContent` keys its entries on `value`, so it would\n // also be a duplicate React key.\n const legendPayload = React.useMemo<LegendPayload[]>(() => {\n const seen = new Set<string>();\n return seriesData.flatMap((row) => {\n const value = String(row[nameKey]);\n if (seen.has(value)) return [];\n seen.add(value);\n return [\n {\n value,\n dataKey: nameKey,\n type: 'rect' as const,\n color: String(row.fill),\n payload: row,\n },\n ];\n });\n }, [nameKey, seriesData]);\n\n // Every other chart type lets recharts shrink the plot area by the legend's\n // measured size, but recharts' `Treemap` tiles the *full* chart surface and\n // ignores the legend entirely — a `<Legend>` inside one paints over the tiles.\n // So the legend is not a `<Legend>` at all: the shared `ChartLegendContent` is\n // rendered straight into a row of its own beside the plot, on the same markers,\n // labels and `config` lookup as every other chart's legend, and normal flow\n // gives it the height it needs (one row, or several once it wraps) and takes\n // that height off the tiled surface.\n //\n // Rendering it here rather than inside the plot is also what keeps the tiling\n // correct: recharts' `Treemap` reads its container **once** (it opts out of the\n // responsive path, because its own stroke-width rounding makes that loop), and a\n // `<Legend>` can only render after the chart has a size — so the box it read\n // would always be the one from before its own legend existed, a legend-row too\n // tall, and the bottom row of tiles would be laid out under the clip. The row is\n // its final height on the first render instead, so that one read is the right one.\n //\n // The row sits outside `ChartContainer`, so it takes `config` as a prop (the\n // container's context doesn't reach it) and re-emits the `--color-<name>`\n // properties its swatches resolve against under its own `data-chart` id.\n const legendChartId = `chart-${React.useId().replace(/:/g, '')}`;\n const legendRow = showLegend ? (\n <div data-chart={legendChartId} className=\"text-xs\">\n <ChartStyle id={legendChartId} config={config} />\n <ChartLegendContent\n config={config}\n payload={legendPayload}\n verticalAlign={legendPos}\n nameKey={nameKey}\n />\n </div>\n ) : null;\n\n return (\n <div\n ref={ref}\n className={cn(showLegend && 'flex flex-col', className)}\n {...props}\n >\n {legendPos === 'top' && legendRow}\n <ChartContainer\n config={config}\n // `size-full` fills the caller's box; with a legend row beside it the\n // height comes from the flex line instead, so the tiles give up exactly\n // the room the legend takes.\n className={showLegend ? 'min-h-0 w-full flex-1' : 'size-full'}\n >\n <RechartsTreemap\n data={seriesData}\n dataKey={dataKey}\n nameKey={nameKey}\n aspectRatio={aspectRatio}\n {...animation}\n content={\n <TreemapCell showLabels={showLabels} labelAlign={labelAlign} />\n }\n >\n {showTooltip && (\n <ChartTooltip\n content={\n tooltipContent ?? (\n <ChartTooltipContent nameKey={nameKey} hideLabel />\n )\n }\n />\n )}\n </RechartsTreemap>\n </ChartContainer>\n {legendPos === 'bottom' && legendRow}\n </div>\n );\n }\n);\nTreemap.displayName = 'Treemap';\n\nexport { Treemap };\n"],"names":["CELL_GAP","CELL_RADIUS","CELL_PADDING","LINE_HEIGHT_RATIO","SECONDARY_FONT_SIZE","TITLE_LINE_HEIGHT","CHART_LABEL_FONT_SIZE","SECONDARY_LINE_HEIGHT","MIN_LABEL_WIDTH","MIN_LABEL_HEIGHT","MIN_TWO_LINE_HEIGHT","treemapSecondaryLabel","options","row","keys","separator","formatter","parts","key","index","value","part","LABEL_ALIGN_CLASS","TreemapCell","x","y","width","height","name","primaryLabel","secondaryLabel","showLabels","labelAlign","jsx","tileX","tileY","tileWidth","tileHeight","canLabel","secondary","jsxs","cn","Treemap","React","className","config","data","dataKey","nameKey","aspectRatio","secondaryKeys","secondaryFormatter","secondarySeparator","showTooltip","showLegend","legendPos","tooltipContent","animate","animationDuration","animationBegin","animationEasing","props","ref","animation","resolveAnimation","seriesData","label","_a","legendPayload","seen","legendChartId","legendRow","ChartStyle","ChartLegendContent","ChartContainer","RechartsTreemap","ChartTooltip","ChartTooltipContent"],"mappings":";;;;;;AAwCA,MAAMA,IAAW,GACXC,IAAc,GAWdC,IAAe,IACfC,IAAoB,IAAI,GACxBC,IAAsB,IACtBC,IAAoB,KAAK,KAAKC,IAAwBH,CAAiB,GACvEI,IAAwB,KAAK;AAAA,EACjCH,IAAsBD;AACxB,GAKMK,IAAkB,IAClBC,IAAmBP,IAAe,IAAIG,GACtCK,IAAsBD,IAAmBF;AAOxC,SAASI,EAAsBC,GAKf;AACrB,QAAM,EAAE,KAAAC,GAAK,MAAAC,GAAM,WAAAC,GAAW,WAAAC,MAAcJ,GACtCK,IAAQH,EAAK,QAAQ,CAACI,GAAKC,MAAU;AACzC,UAAMC,IAAQP,EAAIK,CAAG;AACrB,QAAIE,KAAS,QAAQA,MAAU,WAAW,CAAA;AAK1C,UAAMC,IAAOL,IAAYA,EAAUI,GAAOD,CAAK,IAAI,OAAOC,CAAK;AAC/D,WAAOC,MAAS,KAAK,CAAA,IAAK,CAACA,CAAI;AAAA,EACjC,CAAC;AACD,SAAOJ,EAAM,SAASA,EAAM,KAAKF,CAAS,IAAI;AAChD;AA+BA,MAAMO,KAAuD;AAAA,EAC3D,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,QAAQ;AACV;AAMO,SAASC,GAAY;AAAA,EAC1B,GAAAC,IAAI;AAA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