@schemavaults/ui 0.109.1 → 0.110.1
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/components/ui/index.d.ts +2 -0
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/index.js.map +1 -1
- package/dist/components/ui/treemap/index.d.ts +3 -0
- package/dist/components/ui/treemap/index.js +3 -0
- package/dist/components/ui/treemap/index.js.map +1 -0
- package/dist/components/ui/treemap/treemap.d.ts +162 -0
- package/dist/components/ui/treemap/treemap.js +382 -0
- package/dist/components/ui/treemap/treemap.js.map +1 -0
- package/package.json +1 -1
|
@@ -206,6 +206,8 @@ export * from "./histogram";
|
|
|
206
206
|
export type * from "./histogram";
|
|
207
207
|
export * from "./bar-list";
|
|
208
208
|
export type * from "./bar-list";
|
|
209
|
+
export * from "./treemap";
|
|
210
|
+
export type * from "./treemap";
|
|
209
211
|
export * from "./comparison-slider";
|
|
210
212
|
export type * from "./comparison-slider";
|
|
211
213
|
export * from "./theme-selector";
|
|
@@ -102,6 +102,7 @@ export * from "./funnel-chart";
|
|
|
102
102
|
export * from "./scatter-plot";
|
|
103
103
|
export * from "./histogram";
|
|
104
104
|
export * from "./bar-list";
|
|
105
|
+
export * from "./treemap";
|
|
105
106
|
export * from "./comparison-slider";
|
|
106
107
|
export * from "./theme-selector";
|
|
107
108
|
export * from "./tree-view";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAGzB,cAAc,uBAAuB,CAAC;AAGtC,cAAc,aAAa,CAAC;AAG5B,cAAc,eAAe,CAAC;AAG9B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,mBAAmB,CAAC;AAGlC,cAAc,0BAA0B,CAAC;AAGzC,cA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Ac,eAAe,CAAC;AAG9B,cAAc,QAAQ,CAAC;AAGvB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,eAAe,CAAC;AAG9B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,UAAU,CAAC;AAGzB,cAAc,WAAW,CAAC;AAG1B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ui/treemap/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,eAAe,EACf,cAAc,EACd,eAAe,EACf,iBAAiB,GAClB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { HTMLAttributes, KeyboardEvent, MouseEvent, ReactElement, ReactNode, Ref } from "react";
|
|
3
|
+
export declare const treeMapSizeIds: ["sm", "md", "lg", "xl"];
|
|
4
|
+
export type TreeMapSizeId = (typeof treeMapSizeIds)[number];
|
|
5
|
+
export declare const treeMapColorIds: ["default", "primary", "positive", "warning", "destructive", "muted"];
|
|
6
|
+
export type TreeMapColorId = (typeof treeMapColorIds)[number];
|
|
7
|
+
/**
|
|
8
|
+
* How a tile is painted.
|
|
9
|
+
*
|
|
10
|
+
* - `"soft"` — translucent fill behind a solid border. The default; labels sit
|
|
11
|
+
* on a near-background surface, so they keep full `foreground` contrast.
|
|
12
|
+
* - `"solid"` — full-strength fill. Labels get a `background`-colored halo
|
|
13
|
+
* (`paint-order: stroke`) so they stay legible on top of saturated brand
|
|
14
|
+
* colors in both light and dark mode.
|
|
15
|
+
* - `"outline"` — border only, no fill. Useful when the treemap is layered
|
|
16
|
+
* over an existing surface, or when the tiles are annotations rather than
|
|
17
|
+
* the primary subject of the chart.
|
|
18
|
+
*/
|
|
19
|
+
export declare const treeMapVariantIds: ["soft", "solid", "outline"];
|
|
20
|
+
export type TreeMapVariantId = (typeof treeMapVariantIds)[number];
|
|
21
|
+
export declare const treeMapVariants: (props?: ({
|
|
22
|
+
size?: "sm" | "lg" | "xl" | "md" | null | undefined;
|
|
23
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
24
|
+
export interface TreeMapNode {
|
|
25
|
+
/** Stable identifier. Used as the React key and in the click payload. */
|
|
26
|
+
id: string;
|
|
27
|
+
/** Human-readable name rendered inside the tile, when it fits. */
|
|
28
|
+
label?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Magnitude of this node. Ignored when `children` is non-empty — a branch is
|
|
31
|
+
* always worth the sum of its children. Negative and non-finite values are
|
|
32
|
+
* treated as `0`, and zero-valued nodes are omitted from the layout.
|
|
33
|
+
*/
|
|
34
|
+
value?: number;
|
|
35
|
+
/** Child nodes, laid out inside this node's tile. */
|
|
36
|
+
children?: ReadonlyArray<TreeMapNode>;
|
|
37
|
+
/**
|
|
38
|
+
* Preset color id from the chart palette. Inherited by descendants that
|
|
39
|
+
* don't set their own. Ignored if `fill` is provided.
|
|
40
|
+
*/
|
|
41
|
+
color?: TreeMapColorId;
|
|
42
|
+
/**
|
|
43
|
+
* Override the fill and border with a raw CSS color (e.g. `"#ff0080"` or
|
|
44
|
+
* `"hsl(var(--chart-1))"`). Takes precedence over `color`, and is *not*
|
|
45
|
+
* inherited by descendants.
|
|
46
|
+
*/
|
|
47
|
+
fill?: string;
|
|
48
|
+
/** Extra classes applied to this node's `<rect>`. */
|
|
49
|
+
className?: string;
|
|
50
|
+
/** Fired when this tile is clicked or activated via keyboard. */
|
|
51
|
+
onClick?: (node: TreeMapNode, event: MouseEvent<SVGRectElement> | KeyboardEvent<SVGRectElement>) => void;
|
|
52
|
+
}
|
|
53
|
+
export interface TreeMapTileContext {
|
|
54
|
+
node: TreeMapNode;
|
|
55
|
+
/** The node's own value, or the sum of its subtree for a branch. */
|
|
56
|
+
value: number;
|
|
57
|
+
/** Share of the chart total, in the range 0–1. */
|
|
58
|
+
fraction: number;
|
|
59
|
+
/** Nesting level; top-level nodes are `0`. */
|
|
60
|
+
depth: number;
|
|
61
|
+
/** Ancestor ids, root-first, ending with this node's own id. */
|
|
62
|
+
path: ReadonlyArray<string>;
|
|
63
|
+
/** `true` when this node has rendered children inside it. */
|
|
64
|
+
isBranch: boolean;
|
|
65
|
+
/** Tile width in SVG user units. */
|
|
66
|
+
width: number;
|
|
67
|
+
/** Tile height in SVG user units. */
|
|
68
|
+
height: number;
|
|
69
|
+
}
|
|
70
|
+
export interface TreeMapProps extends Omit<HTMLAttributes<HTMLDivElement>, "onClick">, VariantProps<typeof treeMapVariants> {
|
|
71
|
+
/** Nodes to render. Nest via each node's `children`. */
|
|
72
|
+
nodes: ReadonlyArray<TreeMapNode>;
|
|
73
|
+
/** Accessible label describing what the treemap represents. */
|
|
74
|
+
label: string;
|
|
75
|
+
/** Tile paint style. Defaults to `"soft"`. */
|
|
76
|
+
variant?: TreeMapVariantId;
|
|
77
|
+
/** Override the rendered canvas width in pixels (defaults are size-aware). */
|
|
78
|
+
width?: number;
|
|
79
|
+
/** Override the rendered canvas height in pixels (defaults are size-aware). */
|
|
80
|
+
height?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Denominator for every tile's `fraction`. Defaults to the sum of all node
|
|
83
|
+
* values. Useful for pinning several treemaps to a shared scale, or for
|
|
84
|
+
* showing a subset as a share of some known whole.
|
|
85
|
+
*/
|
|
86
|
+
total?: number;
|
|
87
|
+
/**
|
|
88
|
+
* Deepest nesting level to render, 0-based. Nodes below it are collapsed
|
|
89
|
+
* into their deepest rendered ancestor, which keeps its aggregate value.
|
|
90
|
+
* Defaults to rendering the whole tree.
|
|
91
|
+
*/
|
|
92
|
+
maxDepth?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Sort siblings by descending value before laying them out. Defaults to
|
|
95
|
+
* `true`, which is what makes the squarified layout produce compact,
|
|
96
|
+
* near-square tiles. Set to `false` to preserve the input order.
|
|
97
|
+
*/
|
|
98
|
+
sort?: boolean;
|
|
99
|
+
/** Gap between sibling tiles, in pixels. Defaults to `2`. */
|
|
100
|
+
tileGap?: number;
|
|
101
|
+
/** Inner padding between a branch tile and its children. Defaults to `4`. */
|
|
102
|
+
groupPadding?: number;
|
|
103
|
+
/**
|
|
104
|
+
* Height of the band reserved at the top of a labelled branch for its own
|
|
105
|
+
* name. Defaults to `16`. The band is dropped when the branch is too short
|
|
106
|
+
* to spare it.
|
|
107
|
+
*/
|
|
108
|
+
groupHeaderHeight?: number;
|
|
109
|
+
/** Corner radius of every tile, in pixels. Defaults to `3`. */
|
|
110
|
+
cornerRadius?: number;
|
|
111
|
+
/** Render each tile's `label` when it fits. Defaults to `true`. */
|
|
112
|
+
showLabels?: boolean;
|
|
113
|
+
/** Render each tile's value under its label when it fits. Defaults to `true`. */
|
|
114
|
+
showValues?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Smallest tile width, in SVG units, that may carry a label. Narrower tiles
|
|
117
|
+
* render unlabelled rather than overflowing. Defaults to `48`.
|
|
118
|
+
*/
|
|
119
|
+
minLabelWidth?: number;
|
|
120
|
+
/**
|
|
121
|
+
* Smallest *leaf* tile height, in SVG units, that may carry a label. Shorter
|
|
122
|
+
* leaves render unlabelled. Defaults to `18`. A branch's name lives in its
|
|
123
|
+
* header band instead, which is governed by `groupHeaderHeight`.
|
|
124
|
+
*/
|
|
125
|
+
minLabelHeight?: number;
|
|
126
|
+
/**
|
|
127
|
+
* Fill opacity of a top-level tile, overriding the variant default
|
|
128
|
+
* (`0.18` for `"soft"`, `0.9` for `"solid"`, `0` for `"outline"`).
|
|
129
|
+
*/
|
|
130
|
+
tileFillOpacity?: number;
|
|
131
|
+
/**
|
|
132
|
+
* How much of the parent's fill opacity each nesting level keeps, so nested
|
|
133
|
+
* tiles read as shades of one family. Defaults to `0.55`.
|
|
134
|
+
*/
|
|
135
|
+
depthFillFalloff?: number;
|
|
136
|
+
/** Customize the tile-label text. Return `null` to skip a tile's label. */
|
|
137
|
+
labelFormatter?: (context: TreeMapTileContext) => string | null;
|
|
138
|
+
/**
|
|
139
|
+
* Customize the value text. Return `null` to skip it. Defaults to the
|
|
140
|
+
* locale-formatted value.
|
|
141
|
+
*/
|
|
142
|
+
valueFormatter?: (context: TreeMapTileContext) => string | null;
|
|
143
|
+
/**
|
|
144
|
+
* Fallback handler invoked for any tile that doesn't have its own `onClick`.
|
|
145
|
+
*/
|
|
146
|
+
onNodeClick?: (node: TreeMapNode, event: MouseEvent<SVGRectElement> | KeyboardEvent<SVGRectElement>) => void;
|
|
147
|
+
/** Optional content overlaid on top of the plot area. */
|
|
148
|
+
children?: ReactNode;
|
|
149
|
+
/** Extra classes for the overlay content wrapper. */
|
|
150
|
+
overlayClassName?: string;
|
|
151
|
+
/** Extra classes applied to every tile-label `<text>` element. */
|
|
152
|
+
labelClassName?: string;
|
|
153
|
+
/** Extra classes applied to every value-label `<text>` element. */
|
|
154
|
+
valueClassName?: string;
|
|
155
|
+
/** Optional ref forwarded to the wrapper element. */
|
|
156
|
+
ref?: Ref<HTMLDivElement>;
|
|
157
|
+
}
|
|
158
|
+
declare function TreeMap({ nodes, label, variant, size, width, height, total, maxDepth, sort, tileGap, groupPadding, groupHeaderHeight, cornerRadius, showLabels, showValues, minLabelWidth, minLabelHeight, tileFillOpacity, depthFillFalloff, labelFormatter, valueFormatter, onNodeClick, children, className, overlayClassName, labelClassName, valueClassName, ref, ...props }: TreeMapProps): ReactElement;
|
|
159
|
+
declare namespace TreeMap {
|
|
160
|
+
var displayName: string;
|
|
161
|
+
}
|
|
162
|
+
export { TreeMap };
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { useId } from "react";
|
|
5
|
+
import { cn } from "../../../lib/utils";
|
|
6
|
+
export const treeMapSizeIds = [
|
|
7
|
+
"sm",
|
|
8
|
+
"md",
|
|
9
|
+
"lg",
|
|
10
|
+
"xl",
|
|
11
|
+
];
|
|
12
|
+
export const treeMapColorIds = [
|
|
13
|
+
"default",
|
|
14
|
+
"primary",
|
|
15
|
+
"positive",
|
|
16
|
+
"warning",
|
|
17
|
+
"destructive",
|
|
18
|
+
"muted",
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* How a tile is painted.
|
|
22
|
+
*
|
|
23
|
+
* - `"soft"` — translucent fill behind a solid border. The default; labels sit
|
|
24
|
+
* on a near-background surface, so they keep full `foreground` contrast.
|
|
25
|
+
* - `"solid"` — full-strength fill. Labels get a `background`-colored halo
|
|
26
|
+
* (`paint-order: stroke`) so they stay legible on top of saturated brand
|
|
27
|
+
* colors in both light and dark mode.
|
|
28
|
+
* - `"outline"` — border only, no fill. Useful when the treemap is layered
|
|
29
|
+
* over an existing surface, or when the tiles are annotations rather than
|
|
30
|
+
* the primary subject of the chart.
|
|
31
|
+
*/
|
|
32
|
+
export const treeMapVariantIds = [
|
|
33
|
+
"soft",
|
|
34
|
+
"solid",
|
|
35
|
+
"outline",
|
|
36
|
+
];
|
|
37
|
+
/** Default canvas dimensions per size. Either axis can be overridden via the
|
|
38
|
+
* `width` / `height` props. */
|
|
39
|
+
const SIZE_TO_CANVAS = {
|
|
40
|
+
sm: { width: 260, height: 180 },
|
|
41
|
+
md: { width: 380, height: 260 },
|
|
42
|
+
lg: { width: 520, height: 340 },
|
|
43
|
+
xl: { width: 680, height: 440 },
|
|
44
|
+
};
|
|
45
|
+
const FILL_CLASSES = {
|
|
46
|
+
default: "fill-schemavaults-brand-blue",
|
|
47
|
+
primary: "fill-primary",
|
|
48
|
+
positive: "fill-emerald-500 dark:fill-emerald-400",
|
|
49
|
+
warning: "fill-warning",
|
|
50
|
+
destructive: "fill-destructive",
|
|
51
|
+
muted: "fill-muted-foreground",
|
|
52
|
+
};
|
|
53
|
+
const STROKE_CLASSES = {
|
|
54
|
+
default: "stroke-schemavaults-brand-blue",
|
|
55
|
+
primary: "stroke-primary",
|
|
56
|
+
positive: "stroke-emerald-500 dark:stroke-emerald-400",
|
|
57
|
+
warning: "stroke-warning",
|
|
58
|
+
destructive: "stroke-destructive",
|
|
59
|
+
muted: "stroke-muted-foreground",
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Fallback color rotation when a top-level node doesn't specify its own color.
|
|
63
|
+
* Index is the node's position among its siblings, modulo the palette length.
|
|
64
|
+
* Descendants inherit their ancestor's color unless they override it, so each
|
|
65
|
+
* branch of the tree reads as one family.
|
|
66
|
+
*/
|
|
67
|
+
const DEFAULT_COLOR_ROTATION = [
|
|
68
|
+
"default",
|
|
69
|
+
"positive",
|
|
70
|
+
"warning",
|
|
71
|
+
"destructive",
|
|
72
|
+
"primary",
|
|
73
|
+
"muted",
|
|
74
|
+
];
|
|
75
|
+
/** Base fill opacity per variant, before the per-depth falloff is applied. */
|
|
76
|
+
const VARIANT_BASE_FILL_OPACITY = {
|
|
77
|
+
soft: 0.18,
|
|
78
|
+
solid: 0.9,
|
|
79
|
+
outline: 0,
|
|
80
|
+
};
|
|
81
|
+
export const treeMapVariants = cva("relative inline-flex shrink-0 items-center justify-center", {
|
|
82
|
+
variants: {
|
|
83
|
+
size: {
|
|
84
|
+
sm: "text-[10px]",
|
|
85
|
+
md: "text-[11px]",
|
|
86
|
+
lg: "text-xs",
|
|
87
|
+
xl: "text-sm",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
defaultVariants: {
|
|
91
|
+
size: "md",
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
function sanitizeValue(value) {
|
|
95
|
+
if (!Number.isFinite(value) || value < 0)
|
|
96
|
+
return 0;
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
/** Aggregate value of a subtree, used when `maxDepth` collapses a branch. */
|
|
100
|
+
function subtreeValue(node) {
|
|
101
|
+
const children = node.children ?? [];
|
|
102
|
+
if (children.length === 0)
|
|
103
|
+
return sanitizeValue(node.value ?? 0);
|
|
104
|
+
let sum = 0;
|
|
105
|
+
for (const child of children)
|
|
106
|
+
sum += subtreeValue(child);
|
|
107
|
+
return sum;
|
|
108
|
+
}
|
|
109
|
+
function measure(node, depth, maxDepth) {
|
|
110
|
+
const children = node.children ?? [];
|
|
111
|
+
if (children.length === 0 || depth >= maxDepth) {
|
|
112
|
+
return { node, value: subtreeValue(node), children: [] };
|
|
113
|
+
}
|
|
114
|
+
const measured = children
|
|
115
|
+
.map((child) => measure(child, depth + 1, maxDepth))
|
|
116
|
+
.filter((child) => child.value > 0);
|
|
117
|
+
let sum = 0;
|
|
118
|
+
for (const child of measured)
|
|
119
|
+
sum += child.value;
|
|
120
|
+
return { node, value: sum, children: measured };
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Worst (largest) aspect ratio produced by laying `values[start..end]` out as
|
|
124
|
+
* one row of thickness `rowArea / side` across a side of length `side`.
|
|
125
|
+
*/
|
|
126
|
+
function worstAspect(values, start, end, scale, side) {
|
|
127
|
+
let rowValue = 0;
|
|
128
|
+
for (let i = start; i <= end; i++)
|
|
129
|
+
rowValue += values[i];
|
|
130
|
+
const rowArea = rowValue * scale;
|
|
131
|
+
if (rowArea <= 0 || side <= 0)
|
|
132
|
+
return Number.POSITIVE_INFINITY;
|
|
133
|
+
const thickness = rowArea / side;
|
|
134
|
+
let worst = 0;
|
|
135
|
+
for (let i = start; i <= end; i++) {
|
|
136
|
+
const length = (values[i] * scale) / thickness;
|
|
137
|
+
if (length <= 0)
|
|
138
|
+
return Number.POSITIVE_INFINITY;
|
|
139
|
+
worst = Math.max(worst, thickness / length, length / thickness);
|
|
140
|
+
}
|
|
141
|
+
return worst;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Squarified treemap layout (Bruls, Huizing & van Wijk, 2000).
|
|
145
|
+
*
|
|
146
|
+
* Fills `rect` with one rectangle per entry in `values`, each with an area
|
|
147
|
+
* proportional to its value. Rows are grown greedily while they keep improving
|
|
148
|
+
* the worst aspect ratio, which is what keeps the tiles close to square and
|
|
149
|
+
* therefore comparable by eye. `values` is expected to be sorted descending
|
|
150
|
+
* (the caller does that unless `sort` is off); an unsorted input still lays out
|
|
151
|
+
* correctly, just with less square tiles.
|
|
152
|
+
*/
|
|
153
|
+
function squarify(values, rect) {
|
|
154
|
+
const out = values.map(() => ({
|
|
155
|
+
x: rect.x,
|
|
156
|
+
y: rect.y,
|
|
157
|
+
w: 0,
|
|
158
|
+
h: 0,
|
|
159
|
+
}));
|
|
160
|
+
const live = values
|
|
161
|
+
.map((_, index) => index)
|
|
162
|
+
.filter((index) => values[index] > 0);
|
|
163
|
+
if (live.length === 0)
|
|
164
|
+
return out;
|
|
165
|
+
const liveValues = live.map((index) => values[index]);
|
|
166
|
+
let remaining = 0;
|
|
167
|
+
for (const value of liveValues)
|
|
168
|
+
remaining += value;
|
|
169
|
+
let free = { ...rect };
|
|
170
|
+
let cursor = 0;
|
|
171
|
+
while (cursor < liveValues.length && remaining > 0) {
|
|
172
|
+
if (free.w <= 0 || free.h <= 0)
|
|
173
|
+
break;
|
|
174
|
+
// Rows run along the shorter side of the free rectangle; that is the
|
|
175
|
+
// choice that keeps the aspect ratios low.
|
|
176
|
+
const stacked = free.w >= free.h;
|
|
177
|
+
const side = stacked ? free.h : free.w;
|
|
178
|
+
const scale = (free.w * free.h) / remaining;
|
|
179
|
+
let count = 1;
|
|
180
|
+
let best = worstAspect(liveValues, cursor, cursor, scale, side);
|
|
181
|
+
while (cursor + count < liveValues.length) {
|
|
182
|
+
const next = worstAspect(liveValues, cursor, cursor + count, scale, side);
|
|
183
|
+
if (next > best)
|
|
184
|
+
break;
|
|
185
|
+
best = next;
|
|
186
|
+
count += 1;
|
|
187
|
+
}
|
|
188
|
+
let rowValue = 0;
|
|
189
|
+
for (let i = cursor; i < cursor + count; i++)
|
|
190
|
+
rowValue += liveValues[i];
|
|
191
|
+
// Clamp against the long side so floating-point drift can't push the last
|
|
192
|
+
// row past the edge of the free rectangle.
|
|
193
|
+
const thickness = Math.min(stacked ? free.w : free.h, (rowValue * scale) / side);
|
|
194
|
+
let offset = 0;
|
|
195
|
+
for (let i = cursor; i < cursor + count; i++) {
|
|
196
|
+
const area = liveValues[i] * scale;
|
|
197
|
+
const length = thickness > 0 ? Math.min(side - offset, area / thickness) : 0;
|
|
198
|
+
out[live[i]] = stacked
|
|
199
|
+
? { x: free.x, y: free.y + offset, w: thickness, h: length }
|
|
200
|
+
: { x: free.x + offset, y: free.y, w: length, h: thickness };
|
|
201
|
+
offset += length;
|
|
202
|
+
}
|
|
203
|
+
free = stacked
|
|
204
|
+
? { x: free.x + thickness, y: free.y, w: free.w - thickness, h: free.h }
|
|
205
|
+
: { x: free.x, y: free.y + thickness, w: free.w, h: free.h - thickness };
|
|
206
|
+
remaining -= rowValue;
|
|
207
|
+
cursor += count;
|
|
208
|
+
}
|
|
209
|
+
return out;
|
|
210
|
+
}
|
|
211
|
+
/** Shrink a rectangle by `inset` on every side, never past zero. */
|
|
212
|
+
function deflate(rect, inset) {
|
|
213
|
+
const w = Math.max(0, rect.w - inset * 2);
|
|
214
|
+
const h = Math.max(0, rect.h - inset * 2);
|
|
215
|
+
return {
|
|
216
|
+
x: rect.x + (rect.w - w) / 2,
|
|
217
|
+
y: rect.y + (rect.h - h) / 2,
|
|
218
|
+
w,
|
|
219
|
+
h,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
function layoutInto(siblings, rect, depth, parentPath, parentKey, inheritedColor, options, out) {
|
|
223
|
+
if (siblings.length === 0 || rect.w <= 0 || rect.h <= 0)
|
|
224
|
+
return;
|
|
225
|
+
const ordered = options.sort
|
|
226
|
+
? [...siblings].sort((a, b) => b.value - a.value)
|
|
227
|
+
: siblings;
|
|
228
|
+
const rects = squarify(ordered.map((child) => child.value), rect);
|
|
229
|
+
ordered.forEach((measured, index) => {
|
|
230
|
+
const raw = rects[index];
|
|
231
|
+
const tileRect = deflate(raw, options.tileGap / 2);
|
|
232
|
+
if (tileRect.w <= 0 || tileRect.h <= 0)
|
|
233
|
+
return;
|
|
234
|
+
const color = measured.node.color ??
|
|
235
|
+
inheritedColor ??
|
|
236
|
+
DEFAULT_COLOR_ROTATION[index % DEFAULT_COLOR_ROTATION.length];
|
|
237
|
+
const isBranch = measured.children.length > 0;
|
|
238
|
+
const path = [...parentPath, measured.node.id];
|
|
239
|
+
const key = `${parentKey}/${measured.node.id}:${index}`;
|
|
240
|
+
// A branch only earns a header band if it is labelled and tall enough to
|
|
241
|
+
// give one up without squashing its children.
|
|
242
|
+
const wantsHeader = isBranch &&
|
|
243
|
+
Boolean(measured.node.label) &&
|
|
244
|
+
tileRect.h > options.groupHeaderHeight * 2.2;
|
|
245
|
+
const headerHeight = wantsHeader ? options.groupHeaderHeight : 0;
|
|
246
|
+
out.push({
|
|
247
|
+
node: measured.node,
|
|
248
|
+
key,
|
|
249
|
+
index: out.length,
|
|
250
|
+
path,
|
|
251
|
+
depth,
|
|
252
|
+
value: measured.value,
|
|
253
|
+
fraction: options.total > 0 ? measured.value / options.total : 0,
|
|
254
|
+
rect: tileRect,
|
|
255
|
+
isBranch,
|
|
256
|
+
headerHeight,
|
|
257
|
+
color,
|
|
258
|
+
fill: measured.node.fill,
|
|
259
|
+
fillOpacity: options.variantFillOpacity *
|
|
260
|
+
Math.pow(options.depthFillFalloff, depth) *
|
|
261
|
+
(isBranch ? 0.6 : 1),
|
|
262
|
+
});
|
|
263
|
+
if (!isBranch)
|
|
264
|
+
return;
|
|
265
|
+
const inner = deflate({
|
|
266
|
+
x: tileRect.x,
|
|
267
|
+
y: tileRect.y + headerHeight,
|
|
268
|
+
w: tileRect.w,
|
|
269
|
+
h: Math.max(0, tileRect.h - headerHeight),
|
|
270
|
+
}, options.groupPadding);
|
|
271
|
+
layoutInto(measured.children, inner, depth + 1, path, key, measured.node.fill ? undefined : color, options, out);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
function defaultValueText({ value }) {
|
|
275
|
+
return value.toLocaleString();
|
|
276
|
+
}
|
|
277
|
+
function TreeMap({ nodes, label, variant = "soft", size, width, height, total, maxDepth = Number.POSITIVE_INFINITY, sort = true, tileGap = 2, groupPadding = 4, groupHeaderHeight = 16, cornerRadius = 3, showLabels = true, showValues = true, minLabelWidth = 48, minLabelHeight = 18, tileFillOpacity, depthFillFalloff = 0.55, labelFormatter, valueFormatter, onNodeClick, children, className, overlayClassName, labelClassName, valueClassName, ref, ...props }) {
|
|
278
|
+
const resolvedSize = size ?? "md";
|
|
279
|
+
const canvas = SIZE_TO_CANVAS[resolvedSize];
|
|
280
|
+
const W = width ?? canvas.width;
|
|
281
|
+
const H = height ?? canvas.height;
|
|
282
|
+
const titleId = useId();
|
|
283
|
+
const clipIdPrefix = useId();
|
|
284
|
+
const measured = nodes
|
|
285
|
+
.map((node) => measure(node, 0, maxDepth))
|
|
286
|
+
.filter((node) => node.value > 0);
|
|
287
|
+
let measuredTotal = 0;
|
|
288
|
+
for (const node of measured)
|
|
289
|
+
measuredTotal += node.value;
|
|
290
|
+
const scaleTotal = total ?? measuredTotal;
|
|
291
|
+
const tiles = [];
|
|
292
|
+
layoutInto(measured, { x: 0, y: 0, w: W, h: H }, 0, [], "root", undefined, {
|
|
293
|
+
total: scaleTotal,
|
|
294
|
+
sort,
|
|
295
|
+
tileGap: Math.max(0, tileGap),
|
|
296
|
+
groupPadding: Math.max(0, groupPadding),
|
|
297
|
+
groupHeaderHeight: Math.max(0, groupHeaderHeight),
|
|
298
|
+
variantFillOpacity: tileFillOpacity ?? VARIANT_BASE_FILL_OPACITY[variant],
|
|
299
|
+
depthFillFalloff: Math.max(0, Math.min(1, depthFillFalloff)),
|
|
300
|
+
}, tiles);
|
|
301
|
+
// Labels sitting on a saturated fill need a halo to stay readable in both
|
|
302
|
+
// brightness themes; `soft` and `outline` tiles are close enough to the page
|
|
303
|
+
// background that plain foreground text is already high-contrast.
|
|
304
|
+
const haloed = variant === "solid";
|
|
305
|
+
function contextFor(tile) {
|
|
306
|
+
return {
|
|
307
|
+
node: tile.node,
|
|
308
|
+
value: tile.value,
|
|
309
|
+
fraction: tile.fraction,
|
|
310
|
+
depth: tile.depth,
|
|
311
|
+
path: tile.path,
|
|
312
|
+
isBranch: tile.isBranch,
|
|
313
|
+
width: tile.rect.w,
|
|
314
|
+
height: tile.rect.h,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
return (_jsxs("div", { ref: ref, role: "img", "aria-labelledby": titleId, "data-slot": "treemap", "data-variant": variant, className: cn(treeMapVariants({ size }), className), style: { width: W, height: H }, ...props, children: [_jsxs("svg", { width: W, height: H, viewBox: `0 0 ${W} ${H}`, "aria-hidden": children ? "true" : undefined, className: "h-full w-full", children: [_jsx("title", { id: titleId, children: label }), tiles.length === 0 ? (_jsx("text", { x: W / 2, y: H / 2, textAnchor: "middle", dominantBaseline: "central", className: "fill-muted-foreground", children: "No data" })) : null, tiles.length > 0 ? (_jsx("defs", { children: tiles.map((tile) => (_jsx("clipPath", { id: `${clipIdPrefix}-${tile.index}`, children: _jsx("rect", { x: tile.rect.x, y: tile.rect.y, width: tile.rect.w, height: tile.rect.h, rx: cornerRadius }) }, tile.key))) })) : null, tiles.map((tile) => {
|
|
318
|
+
const handler = tile.node.onClick ?? onNodeClick;
|
|
319
|
+
const isInteractive = typeof handler === "function";
|
|
320
|
+
const name = tile.node.label ?? tile.node.id;
|
|
321
|
+
return (_jsx("rect", { x: tile.rect.x, y: tile.rect.y, width: tile.rect.w, height: tile.rect.h, rx: cornerRadius, "data-slot": tile.isBranch ? "treemap-group" : "treemap-tile", "data-node-id": tile.node.id, "data-depth": tile.depth, fill: tile.fill, fillOpacity: tile.fillOpacity, stroke: tile.fill, strokeWidth: variant === "outline" ? 1.5 : 1, strokeOpacity: variant === "solid" && !tile.isBranch ? 0 : 1, role: isInteractive ? "button" : undefined, tabIndex: isInteractive ? 0 : undefined, "aria-label": `${name}: ${tile.value}`, onClick: isInteractive
|
|
322
|
+
? (event) => {
|
|
323
|
+
handler(tile.node, event);
|
|
324
|
+
}
|
|
325
|
+
: undefined, onKeyDown: isInteractive
|
|
326
|
+
? (event) => {
|
|
327
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
328
|
+
event.preventDefault();
|
|
329
|
+
handler(tile.node, event);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
: undefined, className: cn("transition-opacity", tile.fill === undefined && FILL_CLASSES[tile.color], tile.fill === undefined && STROKE_CLASSES[tile.color], isInteractive &&
|
|
333
|
+
"cursor-pointer hover:opacity-80 focus:outline-none focus-visible:opacity-80", tile.node.className) }, tile.key));
|
|
334
|
+
}), showLabels || showValues ? (_jsx("g", { "aria-hidden": "true", "data-slot": "treemap-labels", className: "pointer-events-none select-none", children: tiles.map((tile) => {
|
|
335
|
+
const context = contextFor(tile);
|
|
336
|
+
const name = showLabels
|
|
337
|
+
? labelFormatter
|
|
338
|
+
? labelFormatter(context)
|
|
339
|
+
: (tile.node.label ?? tile.node.id)
|
|
340
|
+
: null;
|
|
341
|
+
const value = showValues
|
|
342
|
+
? (valueFormatter ?? defaultValueText)(context)
|
|
343
|
+
: null;
|
|
344
|
+
if (!name && !value)
|
|
345
|
+
return null;
|
|
346
|
+
// A branch prints its name in its header band; a leaf centers
|
|
347
|
+
// its name (and value) in the middle of the tile.
|
|
348
|
+
const band = tile.isBranch
|
|
349
|
+
? tile.headerHeight
|
|
350
|
+
: tile.rect.h;
|
|
351
|
+
if (band <= 0)
|
|
352
|
+
return null;
|
|
353
|
+
if (tile.rect.w < minLabelWidth)
|
|
354
|
+
return null;
|
|
355
|
+
// `minLabelHeight` is about a leaf having room for centered
|
|
356
|
+
// text. A branch's band is already sized by `groupHeaderHeight`
|
|
357
|
+
// and only exists when the branch was tall enough to spare it,
|
|
358
|
+
// so applying the leaf threshold here would silently drop every
|
|
359
|
+
// group name whenever `groupHeaderHeight < minLabelHeight`.
|
|
360
|
+
if (!tile.isBranch && band < minLabelHeight)
|
|
361
|
+
return null;
|
|
362
|
+
const showBoth = Boolean(name) &&
|
|
363
|
+
Boolean(value) &&
|
|
364
|
+
!tile.isBranch &&
|
|
365
|
+
band >= minLabelHeight * 2;
|
|
366
|
+
const centerX = tile.rect.x + tile.rect.w / 2;
|
|
367
|
+
const centerY = tile.isBranch
|
|
368
|
+
? tile.rect.y + tile.headerHeight / 2
|
|
369
|
+
: tile.rect.y + tile.rect.h / 2;
|
|
370
|
+
const anchorX = tile.isBranch
|
|
371
|
+
? tile.rect.x + 6
|
|
372
|
+
: centerX;
|
|
373
|
+
const textAnchor = tile.isBranch
|
|
374
|
+
? "start"
|
|
375
|
+
: "middle";
|
|
376
|
+
const haloClasses = haloed && "[paint-order:stroke] stroke-background stroke-[3px]";
|
|
377
|
+
return (_jsxs("g", { clipPath: `url(#${clipIdPrefix}-${tile.index})`, children: [name ? (_jsx("text", { x: anchorX, y: centerY, dy: showBoth ? "-0.25em" : 0, textAnchor: textAnchor, dominantBaseline: "central", className: cn("fill-foreground font-medium", haloClasses, labelClassName), children: name })) : null, value && (showBoth || !name) ? (_jsx("text", { x: anchorX, y: centerY, dy: showBoth ? "1.1em" : 0, textAnchor: textAnchor, dominantBaseline: "central", className: cn("fill-muted-foreground tabular-nums", haloClasses, valueClassName), children: value })) : null] }, `${tile.key}-label`));
|
|
378
|
+
}) })) : null] }), children ? (_jsx("div", { className: cn("pointer-events-none absolute inset-0 flex items-center justify-center text-center", overlayClassName), children: children })) : null] }));
|
|
379
|
+
}
|
|
380
|
+
TreeMap.displayName = "TreeMap";
|
|
381
|
+
export { TreeMap };
|
|
382
|
+
//# sourceMappingURL=treemap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"treemap.js","sourceRoot":"","sources":["../../../../src/components/ui/treemap/treemap.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAA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