@tectra-ng/charts 0.0.1 → 0.2.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/LICENSE +21 -0
- package/README.md +44 -1
- package/bar-list/README.md +30 -0
- package/boxplot/README.md +62 -0
- package/bullet/README.md +53 -0
- package/candlestick/README.md +57 -0
- package/column/README.md +73 -0
- package/combo/README.md +83 -0
- package/core/README.md +62 -0
- package/fesm2022/tectra-ng-charts-bar-list.mjs +299 -0
- package/fesm2022/tectra-ng-charts-bar-list.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-boxplot.mjs +887 -0
- package/fesm2022/tectra-ng-charts-boxplot.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-bullet.mjs +666 -0
- package/fesm2022/tectra-ng-charts-bullet.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-candlestick.mjs +778 -0
- package/fesm2022/tectra-ng-charts-candlestick.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-column.mjs +1166 -0
- package/fesm2022/tectra-ng-charts-column.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-combo.mjs +1218 -0
- package/fesm2022/tectra-ng-charts-combo.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-core.mjs +3679 -0
- package/fesm2022/tectra-ng-charts-core.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-funnel.mjs +694 -0
- package/fesm2022/tectra-ng-charts-funnel.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-gantt.mjs +947 -0
- package/fesm2022/tectra-ng-charts-gantt.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-gauge.mjs +693 -0
- package/fesm2022/tectra-ng-charts-gauge.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-heatmap.mjs +935 -0
- package/fesm2022/tectra-ng-charts-heatmap.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-line.mjs +1541 -0
- package/fesm2022/tectra-ng-charts-line.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-org-chart.mjs +2341 -0
- package/fesm2022/tectra-ng-charts-org-chart.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-pie.mjs +1059 -0
- package/fesm2022/tectra-ng-charts-pie.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-radar.mjs +924 -0
- package/fesm2022/tectra-ng-charts-radar.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-radial-bar.mjs +802 -0
- package/fesm2022/tectra-ng-charts-radial-bar.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-range-area.mjs +933 -0
- package/fesm2022/tectra-ng-charts-range-area.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-rank-line.mjs +660 -0
- package/fesm2022/tectra-ng-charts-rank-line.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-sankey.mjs +837 -0
- package/fesm2022/tectra-ng-charts-sankey.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-scatter.mjs +1174 -0
- package/fesm2022/tectra-ng-charts-scatter.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-segmented-bar.mjs +328 -0
- package/fesm2022/tectra-ng-charts-segmented-bar.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-sunburst.mjs +733 -0
- package/fesm2022/tectra-ng-charts-sunburst.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-treemap.mjs +674 -0
- package/fesm2022/tectra-ng-charts-treemap.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-waterfall.mjs +809 -0
- package/fesm2022/tectra-ng-charts-waterfall.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts.mjs +4 -0
- package/fesm2022/tectra-ng-charts.mjs.map +1 -0
- package/funnel/README.md +53 -0
- package/gantt/README.md +53 -0
- package/gauge/README.md +41 -0
- package/heatmap/README.md +47 -0
- package/line/README.md +86 -0
- package/org-chart/README.md +57 -0
- package/package.json +173 -4
- package/pie/README.md +66 -0
- package/radar/README.md +64 -0
- package/radial-bar/README.md +62 -0
- package/range-area/README.md +66 -0
- package/rank-line/README.md +51 -0
- package/sankey/README.md +52 -0
- package/scatter/README.md +71 -0
- package/segmented-bar/README.md +35 -0
- package/sunburst/README.md +55 -0
- package/treemap/README.md +47 -0
- package/types/tectra-ng-charts-bar-list.d.ts +724 -0
- package/types/tectra-ng-charts-bar-list.d.ts.map +1 -0
- package/types/tectra-ng-charts-boxplot.d.ts +882 -0
- package/types/tectra-ng-charts-boxplot.d.ts.map +1 -0
- package/types/tectra-ng-charts-bullet.d.ts +833 -0
- package/types/tectra-ng-charts-bullet.d.ts.map +1 -0
- package/types/tectra-ng-charts-candlestick.d.ts +854 -0
- package/types/tectra-ng-charts-candlestick.d.ts.map +1 -0
- package/types/tectra-ng-charts-column.d.ts +951 -0
- package/types/tectra-ng-charts-column.d.ts.map +1 -0
- package/types/tectra-ng-charts-combo.d.ts +987 -0
- package/types/tectra-ng-charts-combo.d.ts.map +1 -0
- package/types/tectra-ng-charts-core.d.ts +859 -0
- package/types/tectra-ng-charts-core.d.ts.map +1 -0
- package/types/tectra-ng-charts-funnel.d.ts +857 -0
- package/types/tectra-ng-charts-funnel.d.ts.map +1 -0
- package/types/tectra-ng-charts-gantt.d.ts +884 -0
- package/types/tectra-ng-charts-gantt.d.ts.map +1 -0
- package/types/tectra-ng-charts-gauge.d.ts +859 -0
- package/types/tectra-ng-charts-gauge.d.ts.map +1 -0
- package/types/tectra-ng-charts-heatmap.d.ts +914 -0
- package/types/tectra-ng-charts-heatmap.d.ts.map +1 -0
- package/types/tectra-ng-charts-line.d.ts +1023 -0
- package/types/tectra-ng-charts-line.d.ts.map +1 -0
- package/types/tectra-ng-charts-org-chart.d.ts +1017 -0
- package/types/tectra-ng-charts-org-chart.d.ts.map +1 -0
- package/types/tectra-ng-charts-pie.d.ts +983 -0
- package/types/tectra-ng-charts-pie.d.ts.map +1 -0
- package/types/tectra-ng-charts-radar.d.ts +903 -0
- package/types/tectra-ng-charts-radar.d.ts.map +1 -0
- package/types/tectra-ng-charts-radial-bar.d.ts +886 -0
- package/types/tectra-ng-charts-radial-bar.d.ts.map +1 -0
- package/types/tectra-ng-charts-range-area.d.ts +897 -0
- package/types/tectra-ng-charts-range-area.d.ts.map +1 -0
- package/types/tectra-ng-charts-rank-line.d.ts +839 -0
- package/types/tectra-ng-charts-rank-line.d.ts.map +1 -0
- package/types/tectra-ng-charts-sankey.d.ts +866 -0
- package/types/tectra-ng-charts-sankey.d.ts.map +1 -0
- package/types/tectra-ng-charts-scatter.d.ts +987 -0
- package/types/tectra-ng-charts-scatter.d.ts.map +1 -0
- package/types/tectra-ng-charts-segmented-bar.d.ts +751 -0
- package/types/tectra-ng-charts-segmented-bar.d.ts.map +1 -0
- package/types/tectra-ng-charts-sunburst.d.ts +864 -0
- package/types/tectra-ng-charts-sunburst.d.ts.map +1 -0
- package/types/tectra-ng-charts-treemap.d.ts +847 -0
- package/types/tectra-ng-charts-treemap.d.ts.map +1 -0
- package/types/tectra-ng-charts-waterfall.d.ts +869 -0
- package/types/tectra-ng-charts-waterfall.d.ts.map +1 -0
- package/types/tectra-ng-charts.d.ts +2 -0
- package/types/tectra-ng-charts.d.ts.map +1 -0
- package/waterfall/README.md +60 -0
|
@@ -0,0 +1,674 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Directive, TemplateRef, booleanAttribute, computed, contentChild, inject, input, linkedSignal, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
4
|
+
import { TxChartFrame, TxChartTooltipTemplate, chartNumberFormatter, chartSummary, initialChartSize, injectChartEntrance, seriesColor } from "@tectra-ng/charts/core";
|
|
5
|
+
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
6
|
+
import { TxLocaleService, injectTranslations } from "@tectra-ng/core/i18n";
|
|
7
|
+
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
8
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
9
|
+
function worst(row, side) {
|
|
10
|
+
const sum = row.reduce((total, value) => total + value, 0);
|
|
11
|
+
if (!sum || !side) return Infinity;
|
|
12
|
+
const max = Math.max(...row);
|
|
13
|
+
const min = Math.min(...row);
|
|
14
|
+
const side2 = side * side;
|
|
15
|
+
const sum2 = sum * sum;
|
|
16
|
+
return Math.max(side2 * max / sum2, sum2 / (side2 * min));
|
|
17
|
+
}
|
|
18
|
+
function squarify(items, rect) {
|
|
19
|
+
const indexed = items.map((entry, index) => ({
|
|
20
|
+
...entry,
|
|
21
|
+
index
|
|
22
|
+
})).filter((entry) => Number.isFinite(entry.value) && entry.value > 0).sort((a, b) => b.value - a.value);
|
|
23
|
+
const total = indexed.reduce((sum, entry) => sum + entry.value, 0);
|
|
24
|
+
const nodes = [];
|
|
25
|
+
if (!total || rect.width <= 0 || rect.height <= 0) return nodes;
|
|
26
|
+
const scale = rect.width * rect.height / total;
|
|
27
|
+
const areas = indexed.map((entry) => entry.value * scale);
|
|
28
|
+
let { x, y, width, height } = rect;
|
|
29
|
+
let start = 0;
|
|
30
|
+
while (start < areas.length) {
|
|
31
|
+
const side = Math.min(width, height);
|
|
32
|
+
let end = start + 1;
|
|
33
|
+
while (end < areas.length && worst(areas.slice(start, end + 1), side) <= worst(areas.slice(start, end), side)) end += 1;
|
|
34
|
+
const row = areas.slice(start, end);
|
|
35
|
+
const sum = row.reduce((total, area) => total + area, 0);
|
|
36
|
+
const horizontal = width >= height;
|
|
37
|
+
const thickness = horizontal ? sum / height : sum / width;
|
|
38
|
+
let offset = 0;
|
|
39
|
+
row.forEach((area, position) => {
|
|
40
|
+
const entry = indexed[start + position];
|
|
41
|
+
const length = area / thickness;
|
|
42
|
+
nodes.push({
|
|
43
|
+
index: entry.index,
|
|
44
|
+
value: entry.value,
|
|
45
|
+
item: entry.item,
|
|
46
|
+
x: horizontal ? x : x + offset,
|
|
47
|
+
y: horizontal ? y + offset : y,
|
|
48
|
+
width: horizontal ? thickness : length,
|
|
49
|
+
height: horizontal ? length : thickness
|
|
50
|
+
});
|
|
51
|
+
offset += length;
|
|
52
|
+
});
|
|
53
|
+
if (horizontal) {
|
|
54
|
+
x += thickness;
|
|
55
|
+
width -= thickness;
|
|
56
|
+
} else {
|
|
57
|
+
y += thickness;
|
|
58
|
+
height -= thickness;
|
|
59
|
+
}
|
|
60
|
+
start = end;
|
|
61
|
+
}
|
|
62
|
+
return nodes;
|
|
63
|
+
}
|
|
64
|
+
function treemapValue(item) {
|
|
65
|
+
if (item.children?.length) return item.children.reduce((sum, child) => sum + Math.max(0, treemapValue(child)), 0);
|
|
66
|
+
return Number.isFinite(item.value) ? Math.max(0, item.value ?? 0) : 0;
|
|
67
|
+
}
|
|
68
|
+
function insetRect(rect, inset) {
|
|
69
|
+
const half = inset / 2;
|
|
70
|
+
return {
|
|
71
|
+
x: rect.x + half,
|
|
72
|
+
y: rect.y + half,
|
|
73
|
+
width: Math.max(0, rect.width - inset),
|
|
74
|
+
height: Math.max(0, rect.height - inset)
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
var TxTreemapTileTemplate = class TxTreemapTileTemplate {
|
|
78
|
+
template = inject(TemplateRef);
|
|
79
|
+
static ngTemplateContextGuard(_directive, context) {
|
|
80
|
+
return !!context;
|
|
81
|
+
}
|
|
82
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
83
|
+
minVersion: "12.0.0",
|
|
84
|
+
version: "22.2.3",
|
|
85
|
+
ngImport: i0,
|
|
86
|
+
type: TxTreemapTileTemplate,
|
|
87
|
+
deps: [],
|
|
88
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
89
|
+
});
|
|
90
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
91
|
+
minVersion: "14.0.0",
|
|
92
|
+
version: "22.2.3",
|
|
93
|
+
type: TxTreemapTileTemplate,
|
|
94
|
+
isStandalone: true,
|
|
95
|
+
selector: "ng-template[txTreemapTile]",
|
|
96
|
+
ngImport: i0
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
100
|
+
minVersion: "12.0.0",
|
|
101
|
+
version: "22.2.3",
|
|
102
|
+
ngImport: i0,
|
|
103
|
+
type: TxTreemapTileTemplate,
|
|
104
|
+
decorators: [{
|
|
105
|
+
type: Directive,
|
|
106
|
+
args: [{ selector: "ng-template[txTreemapTile]" }]
|
|
107
|
+
}]
|
|
108
|
+
});
|
|
109
|
+
const MIN_LABEL_WIDTH = 36;
|
|
110
|
+
const GROUP_HEADER = 22;
|
|
111
|
+
var TxTreemap = class TxTreemap {
|
|
112
|
+
locale = inject(TxLocaleService);
|
|
113
|
+
translations = injectTranslations();
|
|
114
|
+
items = input([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
115
|
+
height = input(350, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
|
|
116
|
+
showDataLabels = input(true, {
|
|
117
|
+
...ngDevMode ? { debugName: "showDataLabels" } : /* istanbul ignore next */ {},
|
|
118
|
+
transform: booleanAttribute
|
|
119
|
+
});
|
|
120
|
+
showValues = input(true, {
|
|
121
|
+
...ngDevMode ? { debugName: "showValues" } : /* istanbul ignore next */ {},
|
|
122
|
+
transform: booleanAttribute
|
|
123
|
+
});
|
|
124
|
+
showTooltip = input(true, {
|
|
125
|
+
...ngDevMode ? { debugName: "showTooltip" } : /* istanbul ignore next */ {},
|
|
126
|
+
transform: booleanAttribute
|
|
127
|
+
});
|
|
128
|
+
tooltipFormatter = input(null, ...ngDevMode ? [{ debugName: "tooltipFormatter" }] : /* istanbul ignore next */ []);
|
|
129
|
+
valueFormat = input("number", ...ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []);
|
|
130
|
+
loading = input(false, {
|
|
131
|
+
...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
|
|
132
|
+
transform: booleanAttribute
|
|
133
|
+
});
|
|
134
|
+
ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
135
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
136
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
137
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
138
|
+
unstyled = input(void 0, {
|
|
139
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
140
|
+
transform: optionalBoolean
|
|
141
|
+
});
|
|
142
|
+
tileClick = output();
|
|
143
|
+
tooltipTemplate = contentChild(TxChartTooltipTemplate, ...ngDevMode ? [{ debugName: "tooltipTemplate" }] : /* istanbul ignore next */ []);
|
|
144
|
+
tileTemplate = contentChild(TxTreemapTileTemplate, ...ngDevMode ? [{ debugName: "tileTemplate" }] : /* istanbul ignore next */ []);
|
|
145
|
+
frame = viewChild(TxChartFrame, ...ngDevMode ? [{ debugName: "frame" }] : /* istanbul ignore next */ []);
|
|
146
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
147
|
+
passThrough = injectPassThrough("treemap", this, this.pt, this.ptOptions);
|
|
148
|
+
tokenStyle = computed(() => toStyleObject(this.dt(), "--tx-chart"), ...ngDevMode ? [{ debugName: "tokenStyle" }] : /* istanbul ignore next */ []);
|
|
149
|
+
hostStyle = computed(() => ({
|
|
150
|
+
...this.tokenStyle(),
|
|
151
|
+
...this.passThrough().root?.style
|
|
152
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
153
|
+
entrance = injectChartEntrance();
|
|
154
|
+
size = linkedSignal(() => initialChartSize(this.height(), null), ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
155
|
+
hovered = signal(null, ...ngDevMode ? [{ debugName: "hovered" }] : /* istanbul ignore next */ []);
|
|
156
|
+
intl = computed(() => this.locale.locale().intl, ...ngDevMode ? [{ debugName: "intl" }] : /* istanbul ignore next */ []);
|
|
157
|
+
valueFormatter = computed(() => chartNumberFormatter(this.intl(), this.valueFormat()), ...ngDevMode ? [{ debugName: "valueFormatter" }] : /* istanbul ignore next */ []);
|
|
158
|
+
percentFormatter = computed(() => chartNumberFormatter(this.intl(), "percent"), ...ngDevMode ? [{ debugName: "percentFormatter" }] : /* istanbul ignore next */ []);
|
|
159
|
+
roots = computed(() => (this.items() ?? []).filter((item) => treemapValue(item) > 0), ...ngDevMode ? [{ debugName: "roots" }] : /* istanbul ignore next */ []);
|
|
160
|
+
total = computed(() => this.roots().reduce((sum, item) => sum + treemapValue(item), 0), ...ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []);
|
|
161
|
+
isEmpty = computed(() => this.total() <= 0, ...ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []);
|
|
162
|
+
layout = computed(() => {
|
|
163
|
+
const { width, height } = this.size();
|
|
164
|
+
const total = this.total();
|
|
165
|
+
const tiles = [];
|
|
166
|
+
const groups = [];
|
|
167
|
+
const nodes = squarify(this.roots().map((item) => ({
|
|
168
|
+
value: treemapValue(item),
|
|
169
|
+
item
|
|
170
|
+
})), {
|
|
171
|
+
x: 0,
|
|
172
|
+
y: 0,
|
|
173
|
+
width,
|
|
174
|
+
height
|
|
175
|
+
});
|
|
176
|
+
for (const node of nodes) {
|
|
177
|
+
const color = seriesColor(node.item.color, node.index);
|
|
178
|
+
const children = (node.item.children ?? []).filter((child) => treemapValue(child) > 0);
|
|
179
|
+
if (!children.length) {
|
|
180
|
+
tiles.push(this.tile(node, [node.index], node.item.label, null, color, total));
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
groups.push({
|
|
184
|
+
key: `g${node.index}`,
|
|
185
|
+
label: node.item.label,
|
|
186
|
+
value: node.value,
|
|
187
|
+
color,
|
|
188
|
+
x: node.x,
|
|
189
|
+
y: node.y,
|
|
190
|
+
width: node.width,
|
|
191
|
+
height: node.height
|
|
192
|
+
});
|
|
193
|
+
const inner = insetRect({
|
|
194
|
+
x: node.x,
|
|
195
|
+
y: node.y + GROUP_HEADER,
|
|
196
|
+
width: node.width,
|
|
197
|
+
height: Math.max(0, node.height - GROUP_HEADER)
|
|
198
|
+
}, 6);
|
|
199
|
+
for (const child of squarify(children.map((item) => ({
|
|
200
|
+
value: treemapValue(item),
|
|
201
|
+
item
|
|
202
|
+
})), inner)) tiles.push(this.tile(child, [node.index, child.index], child.item.label, node.item.label, child.item.color ?? color, total));
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
tiles: tiles.map((tile, index) => ({
|
|
206
|
+
...tile,
|
|
207
|
+
index
|
|
208
|
+
})),
|
|
209
|
+
groups
|
|
210
|
+
};
|
|
211
|
+
}, ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
|
|
212
|
+
tooltip = computed(() => {
|
|
213
|
+
const index = this.hovered();
|
|
214
|
+
const tile = index === null ? void 0 : this.layout().tiles[index];
|
|
215
|
+
if (!tile || !this.showTooltip()) return null;
|
|
216
|
+
const custom = this.tooltipFormatter();
|
|
217
|
+
const value = custom ? custom(tile.value, {
|
|
218
|
+
seriesIndex: tile.path[0],
|
|
219
|
+
dataPointIndex: index ?? 0
|
|
220
|
+
}) : this.valueFormatter()(tile.value);
|
|
221
|
+
return {
|
|
222
|
+
title: tile.group ?? "",
|
|
223
|
+
rows: [{
|
|
224
|
+
label: tile.label,
|
|
225
|
+
value,
|
|
226
|
+
share: this.percentFormatter()(Number(tile.share.toFixed(1))),
|
|
227
|
+
color: tile.color,
|
|
228
|
+
raw: tile.value,
|
|
229
|
+
seriesIndex: tile.path[0],
|
|
230
|
+
active: true
|
|
231
|
+
}],
|
|
232
|
+
index: index ?? 0,
|
|
233
|
+
x: tile.x + tile.width / 2,
|
|
234
|
+
y: tile.y,
|
|
235
|
+
placement: "top"
|
|
236
|
+
};
|
|
237
|
+
}, ...ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []);
|
|
238
|
+
summary = computed(() => {
|
|
239
|
+
const t = this.translations();
|
|
240
|
+
const text = `${chartSummary(t, this.intl(), t.chartTreemap, 1, this.layout().tiles.length, null)}, ${t.chartTotal.toLocaleLowerCase(this.intl())} ${this.valueFormatter()(this.total())}`;
|
|
241
|
+
return this.ariaLabel() ? `${this.ariaLabel()}. ${text}` : text;
|
|
242
|
+
}, ...ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []);
|
|
243
|
+
dataTable = computed(() => {
|
|
244
|
+
const t = this.translations();
|
|
245
|
+
const format = this.valueFormatter();
|
|
246
|
+
const percent = this.percentFormatter();
|
|
247
|
+
return {
|
|
248
|
+
columns: [{
|
|
249
|
+
key: "value",
|
|
250
|
+
label: t.chartValue
|
|
251
|
+
}, {
|
|
252
|
+
key: "share",
|
|
253
|
+
label: t.chartShare
|
|
254
|
+
}],
|
|
255
|
+
rows: this.layout().tiles.map((tile) => ({
|
|
256
|
+
label: tile.group ? `${tile.group} / ${tile.label}` : tile.label,
|
|
257
|
+
cells: [format(tile.value), percent(Number(tile.share.toFixed(1)))]
|
|
258
|
+
}))
|
|
259
|
+
};
|
|
260
|
+
}, ...ngDevMode ? [{ debugName: "dataTable" }] : /* istanbul ignore next */ []);
|
|
261
|
+
tileContext(tile) {
|
|
262
|
+
return {
|
|
263
|
+
$implicit: tile,
|
|
264
|
+
tile,
|
|
265
|
+
label: tile.label,
|
|
266
|
+
value: tile.valueText,
|
|
267
|
+
share: this.percentFormatter()(Number(tile.share.toFixed(1))),
|
|
268
|
+
color: tile.color,
|
|
269
|
+
width: tile.width,
|
|
270
|
+
height: tile.height
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
onPointer(event) {
|
|
274
|
+
if (event.type === "leave") {
|
|
275
|
+
this.hovered.set(null);
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
const index = this.layout().tiles.findIndex((tile) => event.x >= tile.x && event.x <= tile.x + tile.width && event.y >= tile.y && event.y <= tile.y + tile.height);
|
|
279
|
+
this.hovered.set(index >= 0 ? index : null);
|
|
280
|
+
if (event.type === "click" && index >= 0) {
|
|
281
|
+
const tile = this.layout().tiles[index];
|
|
282
|
+
this.tileClick.emit({
|
|
283
|
+
index,
|
|
284
|
+
path: tile.path,
|
|
285
|
+
label: tile.label,
|
|
286
|
+
group: tile.group,
|
|
287
|
+
value: tile.value,
|
|
288
|
+
share: tile.share
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
onNavigate(event) {
|
|
293
|
+
if (event.key === "Escape") {
|
|
294
|
+
this.hovered.set(null);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const count = this.layout().tiles.length;
|
|
298
|
+
if (!count) return;
|
|
299
|
+
const current = this.hovered();
|
|
300
|
+
const forward = event.key === "ArrowRight" || event.key === "ArrowDown";
|
|
301
|
+
const next = event.key === "Home" ? 0 : event.key === "End" ? count - 1 : current === null ? forward ? 0 : count - 1 : (current + (forward ? 1 : -1) + count) % count;
|
|
302
|
+
this.hovered.set(next);
|
|
303
|
+
const tile = this.layout().tiles[next];
|
|
304
|
+
this.frame()?.announce(`${tile.group ? `${tile.group}, ` : ""}${tile.label}: ${this.valueFormatter()(tile.value)}, ${this.percentFormatter()(Number(tile.share.toFixed(1)))}`);
|
|
305
|
+
}
|
|
306
|
+
tile(node, path, label, group, color, total) {
|
|
307
|
+
const nameFits = this.showDataLabels() && node.width >= MIN_LABEL_WIDTH && node.height >= 29;
|
|
308
|
+
const value = this.valueFormatter()(node.value);
|
|
309
|
+
const valueFits = nameFits && this.showValues() && node.height >= 45;
|
|
310
|
+
return {
|
|
311
|
+
key: path.join("."),
|
|
312
|
+
index: 0,
|
|
313
|
+
path,
|
|
314
|
+
label,
|
|
315
|
+
group,
|
|
316
|
+
value: node.value,
|
|
317
|
+
share: total ? node.value / total * 100 : 0,
|
|
318
|
+
color,
|
|
319
|
+
x: node.x,
|
|
320
|
+
y: node.y,
|
|
321
|
+
width: node.width,
|
|
322
|
+
height: node.height,
|
|
323
|
+
nameFits,
|
|
324
|
+
valueFits,
|
|
325
|
+
valueText: value
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
329
|
+
minVersion: "12.0.0",
|
|
330
|
+
version: "22.2.3",
|
|
331
|
+
ngImport: i0,
|
|
332
|
+
type: TxTreemap,
|
|
333
|
+
deps: [],
|
|
334
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
335
|
+
});
|
|
336
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
337
|
+
minVersion: "17.0.0",
|
|
338
|
+
version: "22.2.3",
|
|
339
|
+
type: TxTreemap,
|
|
340
|
+
isStandalone: true,
|
|
341
|
+
selector: "tx-treemap",
|
|
342
|
+
inputs: {
|
|
343
|
+
items: {
|
|
344
|
+
classPropertyName: "items",
|
|
345
|
+
publicName: "items",
|
|
346
|
+
isSignal: true,
|
|
347
|
+
isRequired: false,
|
|
348
|
+
transformFunction: null
|
|
349
|
+
},
|
|
350
|
+
height: {
|
|
351
|
+
classPropertyName: "height",
|
|
352
|
+
publicName: "height",
|
|
353
|
+
isSignal: true,
|
|
354
|
+
isRequired: false,
|
|
355
|
+
transformFunction: null
|
|
356
|
+
},
|
|
357
|
+
showDataLabels: {
|
|
358
|
+
classPropertyName: "showDataLabels",
|
|
359
|
+
publicName: "showDataLabels",
|
|
360
|
+
isSignal: true,
|
|
361
|
+
isRequired: false,
|
|
362
|
+
transformFunction: null
|
|
363
|
+
},
|
|
364
|
+
showValues: {
|
|
365
|
+
classPropertyName: "showValues",
|
|
366
|
+
publicName: "showValues",
|
|
367
|
+
isSignal: true,
|
|
368
|
+
isRequired: false,
|
|
369
|
+
transformFunction: null
|
|
370
|
+
},
|
|
371
|
+
showTooltip: {
|
|
372
|
+
classPropertyName: "showTooltip",
|
|
373
|
+
publicName: "showTooltip",
|
|
374
|
+
isSignal: true,
|
|
375
|
+
isRequired: false,
|
|
376
|
+
transformFunction: null
|
|
377
|
+
},
|
|
378
|
+
tooltipFormatter: {
|
|
379
|
+
classPropertyName: "tooltipFormatter",
|
|
380
|
+
publicName: "tooltipFormatter",
|
|
381
|
+
isSignal: true,
|
|
382
|
+
isRequired: false,
|
|
383
|
+
transformFunction: null
|
|
384
|
+
},
|
|
385
|
+
valueFormat: {
|
|
386
|
+
classPropertyName: "valueFormat",
|
|
387
|
+
publicName: "valueFormat",
|
|
388
|
+
isSignal: true,
|
|
389
|
+
isRequired: false,
|
|
390
|
+
transformFunction: null
|
|
391
|
+
},
|
|
392
|
+
loading: {
|
|
393
|
+
classPropertyName: "loading",
|
|
394
|
+
publicName: "loading",
|
|
395
|
+
isSignal: true,
|
|
396
|
+
isRequired: false,
|
|
397
|
+
transformFunction: null
|
|
398
|
+
},
|
|
399
|
+
ariaLabel: {
|
|
400
|
+
classPropertyName: "ariaLabel",
|
|
401
|
+
publicName: "ariaLabel",
|
|
402
|
+
isSignal: true,
|
|
403
|
+
isRequired: false,
|
|
404
|
+
transformFunction: null
|
|
405
|
+
},
|
|
406
|
+
dt: {
|
|
407
|
+
classPropertyName: "dt",
|
|
408
|
+
publicName: "dt",
|
|
409
|
+
isSignal: true,
|
|
410
|
+
isRequired: false,
|
|
411
|
+
transformFunction: null
|
|
412
|
+
},
|
|
413
|
+
pt: {
|
|
414
|
+
classPropertyName: "pt",
|
|
415
|
+
publicName: "pt",
|
|
416
|
+
isSignal: true,
|
|
417
|
+
isRequired: false,
|
|
418
|
+
transformFunction: null
|
|
419
|
+
},
|
|
420
|
+
ptOptions: {
|
|
421
|
+
classPropertyName: "ptOptions",
|
|
422
|
+
publicName: "ptOptions",
|
|
423
|
+
isSignal: true,
|
|
424
|
+
isRequired: false,
|
|
425
|
+
transformFunction: null
|
|
426
|
+
},
|
|
427
|
+
unstyled: {
|
|
428
|
+
classPropertyName: "unstyled",
|
|
429
|
+
publicName: "unstyled",
|
|
430
|
+
isSignal: true,
|
|
431
|
+
isRequired: false,
|
|
432
|
+
transformFunction: null
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
outputs: { tileClick: "tileClick" },
|
|
436
|
+
host: {
|
|
437
|
+
properties: {
|
|
438
|
+
"class": "passThrough().root?.class",
|
|
439
|
+
"style": "hostStyle()",
|
|
440
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
441
|
+
"class.tx-treemap--entering": "entrance.active()",
|
|
442
|
+
"class.tx-treemap--hovering": "hovered() !== null"
|
|
443
|
+
},
|
|
444
|
+
classAttribute: "tx-treemap"
|
|
445
|
+
},
|
|
446
|
+
queries: [{
|
|
447
|
+
propertyName: "tooltipTemplate",
|
|
448
|
+
first: true,
|
|
449
|
+
predicate: TxChartTooltipTemplate,
|
|
450
|
+
descendants: true,
|
|
451
|
+
isSignal: true
|
|
452
|
+
}, {
|
|
453
|
+
propertyName: "tileTemplate",
|
|
454
|
+
first: true,
|
|
455
|
+
predicate: TxTreemapTileTemplate,
|
|
456
|
+
descendants: true,
|
|
457
|
+
isSignal: true
|
|
458
|
+
}],
|
|
459
|
+
viewQueries: [{
|
|
460
|
+
propertyName: "frame",
|
|
461
|
+
first: true,
|
|
462
|
+
predicate: TxChartFrame,
|
|
463
|
+
descendants: true,
|
|
464
|
+
isSignal: true
|
|
465
|
+
}],
|
|
466
|
+
ngImport: i0,
|
|
467
|
+
template: "@let parts = passThrough();\n<tx-chart-frame\n [height]=\"height()\"\n [(size)]=\"size\"\n [showLegend]=\"false\"\n [empty]=\"isEmpty()\"\n [loading]=\"loading()\"\n emptyIcon=\"th-large\"\n [summary]=\"summary()\"\n [table]=\"dataTable()\"\n [tooltip]=\"tooltip()\"\n [tooltipTemplate]=\"tooltipTemplate()?.template\"\n [panelStyle]=\"tokenStyle()\"\n [parts]=\"parts\"\n [styled]=\"!isUnstyled()\"\n (pointer)=\"onPointer($event)\"\n (navigate)=\"onNavigate($event)\"\n (tooltipClosed)=\"hovered.set(null)\"\n>\n @for (group of layout().groups; track group.key) {\n <svg:g class=\"tx-treemap__group\" [class]=\"parts.group?.class\" [style]=\"parts.group?.style\">\n <svg:rect class=\"tx-treemap__group-box\" [attr.x]=\"group.x\" [attr.y]=\"group.y\" [attr.width]=\"group.width\" [attr.height]=\"group.height\" />\n @if (group.width > 40) {\n <svg:text\n class=\"tx-treemap__group-label\"\n [class]=\"parts.groupLabel?.class\"\n [style]=\"parts.groupLabel?.style\"\n [attr.x]=\"group.x + 8\"\n [attr.y]=\"group.y + 11\"\n dominant-baseline=\"central\"\n >\n {{ group.label }}\n </svg:text>\n }\n </svg:g>\n }\n <svg:g class=\"tx-treemap__tiles\">\n @for (tile of layout().tiles; track tile.key) {\n <svg:g class=\"tx-treemap__tile-group\" [class.tx-treemap__tile-group--hovered]=\"hovered() === tile.index\">\n <svg:rect\n class=\"tx-treemap__tile\"\n [class]=\"parts.tile?.class\"\n [style]=\"parts.tile?.style\"\n [style.--tx-treemap-color]=\"tile.color\"\n [attr.data-index]=\"tile.index\"\n [attr.x]=\"tile.x\"\n [attr.y]=\"tile.y\"\n [attr.width]=\"tile.width\"\n [attr.height]=\"tile.height\"\n />\n @if (tileTemplate(); as custom) {\n <svg:foreignObject class=\"tx-treemap__tile-box\" [attr.x]=\"tile.x\" [attr.y]=\"tile.y\" [attr.width]=\"tile.width\" [attr.height]=\"tile.height\">\n <xhtml:div class=\"tx-treemap__tile-content\" [class]=\"parts.tileContent?.class\" [style]=\"parts.tileContent?.style\">\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"tileContext(tile)\" />\n </xhtml:div>\n </svg:foreignObject>\n } @else if (tile.nameFits) {\n <svg:foreignObject class=\"tx-treemap__tile-box\" [attr.x]=\"tile.x\" [attr.y]=\"tile.y\" [attr.width]=\"tile.width\" [attr.height]=\"tile.height\">\n <xhtml:div class=\"tx-treemap__tile-content\" [class]=\"parts.tileContent?.class\" [style]=\"parts.tileContent?.style\">\n <xhtml:span class=\"tx-treemap__tile-label\" [class]=\"parts.tileLabel?.class\" [style]=\"parts.tileLabel?.style\">{{ tile.label }}</xhtml:span>\n @if (tile.valueFits) {\n <xhtml:span class=\"tx-treemap__tile-value\" [class]=\"parts.tileValue?.class\" [style]=\"parts.tileValue?.style\">{{ tile.valueText }}</xhtml:span>\n }\n </xhtml:div>\n </svg:foreignObject>\n }\n </svg:g>\n }\n </svg:g>\n</tx-chart-frame>\n",
|
|
468
|
+
styles: [":host{display:block;max-width:100%;min-width:0}.tx-treemap__tile{fill:var(--tx-treemap-color)}.tx-treemap__tile-box,.tx-treemap__group-label{pointer-events:none}.tx-treemap__tile-content{display:flex;flex-direction:column;box-sizing:border-box;width:100%;height:100%;overflow:hidden}.tx-treemap__tile-label,.tx-treemap__tile-value{display:block;overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap}:host([data-styled]) .tx-treemap__tile{rx:var(--tx-chart-treemap-radius);stroke:var(--tx-chart-treemap-gap-color);stroke-width:var(--tx-chart-treemap-gap);transition:fill var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-treemap__group-box{fill:var(--tx-chart-treemap-group-background);stroke:var(--tx-chart-treemap-gap-color);stroke-width:var(--tx-chart-treemap-gap);rx:var(--tx-chart-treemap-radius)}:host([data-styled]) .tx-treemap__group-label{fill:var(--tx-chart-treemap-group-label-color);font-size:var(--tx-chart-treemap-group-label-font-size);font-weight:var(--tx-chart-treemap-group-label-font-weight)}:host([data-styled]) .tx-treemap__tile-content{gap:var(--tx-chart-treemap-label-gap);padding:var(--tx-chart-treemap-label-padding);color:var(--tx-chart-treemap-label-color);line-height:1.2;transition:opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-treemap__tile-label,:host([data-styled]) .tx-treemap__tile-value{filter:var(--tx-chart-treemap-label-shadow)}:host([data-styled]) .tx-treemap__tile-label{font-size:var(--tx-chart-treemap-label-font-size);font-weight:var(--tx-chart-treemap-label-font-weight)}:host([data-styled]) .tx-treemap__tile-value{font-size:var(--tx-chart-treemap-value-font-size);font-weight:var(--tx-chart-treemap-value-font-weight);font-variant-numeric:tabular-nums}:host([data-styled].tx-treemap--hovering) .tx-treemap__tile-group:not(.tx-treemap__tile-group--hovered) .tx-treemap__tile{fill:color-mix(in oklab,var(--tx-treemap-color) var(--tx-chart-treemap-dimmed-strength),var(--tx-chart-treemap-dimmed-base))}:host([data-styled].tx-treemap--hovering) .tx-treemap__tile-group:not(.tx-treemap__tile-group--hovered) .tx-treemap__tile-content{opacity:.6}:host([data-styled].tx-treemap--entering) .tx-treemap__tiles{animation:tx-treemap-enter var(--tx-chart-motion-enter-duration) var(--tx-chart-motion-easing) both}@keyframes tx-treemap-enter{0%{opacity:0}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-treemap__tile,:host([data-styled]) .tx-treemap__tile-content,:host([data-styled]) .tx-treemap__tiles{transition:none;animation:none}}\n"],
|
|
469
|
+
dependencies: [{
|
|
470
|
+
kind: "component",
|
|
471
|
+
type: TxChartFrame,
|
|
472
|
+
selector: "tx-chart-frame",
|
|
473
|
+
inputs: [
|
|
474
|
+
"height",
|
|
475
|
+
"size",
|
|
476
|
+
"legendItems",
|
|
477
|
+
"showLegend",
|
|
478
|
+
"legendPosition",
|
|
479
|
+
"legendAlign",
|
|
480
|
+
"legendVariant",
|
|
481
|
+
"legendToggle",
|
|
482
|
+
"legendTemplate",
|
|
483
|
+
"empty",
|
|
484
|
+
"loading",
|
|
485
|
+
"emptyIcon",
|
|
486
|
+
"summary",
|
|
487
|
+
"table",
|
|
488
|
+
"tooltip",
|
|
489
|
+
"tooltipTemplate",
|
|
490
|
+
"tooltipPlacement",
|
|
491
|
+
"panelStyle",
|
|
492
|
+
"parts",
|
|
493
|
+
"styled",
|
|
494
|
+
"interactive",
|
|
495
|
+
"actionKeys",
|
|
496
|
+
"zoomable",
|
|
497
|
+
"zoomedIn",
|
|
498
|
+
"plotHeight",
|
|
499
|
+
"toolbar",
|
|
500
|
+
"exportName"
|
|
501
|
+
],
|
|
502
|
+
outputs: [
|
|
503
|
+
"sizeChange",
|
|
504
|
+
"pointer",
|
|
505
|
+
"navigate",
|
|
506
|
+
"legendToggled",
|
|
507
|
+
"legendHovered",
|
|
508
|
+
"tooltipClosed",
|
|
509
|
+
"zoomed",
|
|
510
|
+
"panned",
|
|
511
|
+
"zoomReset"
|
|
512
|
+
]
|
|
513
|
+
}, {
|
|
514
|
+
kind: "directive",
|
|
515
|
+
type: NgTemplateOutlet,
|
|
516
|
+
selector: "[ngTemplateOutlet]",
|
|
517
|
+
inputs: [
|
|
518
|
+
"ngTemplateOutletContext",
|
|
519
|
+
"ngTemplateOutlet",
|
|
520
|
+
"ngTemplateOutletInjector"
|
|
521
|
+
]
|
|
522
|
+
}],
|
|
523
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
524
|
+
});
|
|
525
|
+
};
|
|
526
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
527
|
+
minVersion: "12.0.0",
|
|
528
|
+
version: "22.2.3",
|
|
529
|
+
ngImport: i0,
|
|
530
|
+
type: TxTreemap,
|
|
531
|
+
decorators: [{
|
|
532
|
+
type: Component,
|
|
533
|
+
args: [{
|
|
534
|
+
selector: "tx-treemap",
|
|
535
|
+
imports: [TxChartFrame, NgTemplateOutlet],
|
|
536
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
537
|
+
host: {
|
|
538
|
+
class: "tx-treemap",
|
|
539
|
+
"[class]": "passThrough().root?.class",
|
|
540
|
+
"[style]": "hostStyle()",
|
|
541
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
542
|
+
"[class.tx-treemap--entering]": "entrance.active()",
|
|
543
|
+
"[class.tx-treemap--hovering]": "hovered() !== null"
|
|
544
|
+
},
|
|
545
|
+
template: "@let parts = passThrough();\n<tx-chart-frame\n [height]=\"height()\"\n [(size)]=\"size\"\n [showLegend]=\"false\"\n [empty]=\"isEmpty()\"\n [loading]=\"loading()\"\n emptyIcon=\"th-large\"\n [summary]=\"summary()\"\n [table]=\"dataTable()\"\n [tooltip]=\"tooltip()\"\n [tooltipTemplate]=\"tooltipTemplate()?.template\"\n [panelStyle]=\"tokenStyle()\"\n [parts]=\"parts\"\n [styled]=\"!isUnstyled()\"\n (pointer)=\"onPointer($event)\"\n (navigate)=\"onNavigate($event)\"\n (tooltipClosed)=\"hovered.set(null)\"\n>\n @for (group of layout().groups; track group.key) {\n <svg:g class=\"tx-treemap__group\" [class]=\"parts.group?.class\" [style]=\"parts.group?.style\">\n <svg:rect class=\"tx-treemap__group-box\" [attr.x]=\"group.x\" [attr.y]=\"group.y\" [attr.width]=\"group.width\" [attr.height]=\"group.height\" />\n @if (group.width > 40) {\n <svg:text\n class=\"tx-treemap__group-label\"\n [class]=\"parts.groupLabel?.class\"\n [style]=\"parts.groupLabel?.style\"\n [attr.x]=\"group.x + 8\"\n [attr.y]=\"group.y + 11\"\n dominant-baseline=\"central\"\n >\n {{ group.label }}\n </svg:text>\n }\n </svg:g>\n }\n <svg:g class=\"tx-treemap__tiles\">\n @for (tile of layout().tiles; track tile.key) {\n <svg:g class=\"tx-treemap__tile-group\" [class.tx-treemap__tile-group--hovered]=\"hovered() === tile.index\">\n <svg:rect\n class=\"tx-treemap__tile\"\n [class]=\"parts.tile?.class\"\n [style]=\"parts.tile?.style\"\n [style.--tx-treemap-color]=\"tile.color\"\n [attr.data-index]=\"tile.index\"\n [attr.x]=\"tile.x\"\n [attr.y]=\"tile.y\"\n [attr.width]=\"tile.width\"\n [attr.height]=\"tile.height\"\n />\n @if (tileTemplate(); as custom) {\n <svg:foreignObject class=\"tx-treemap__tile-box\" [attr.x]=\"tile.x\" [attr.y]=\"tile.y\" [attr.width]=\"tile.width\" [attr.height]=\"tile.height\">\n <xhtml:div class=\"tx-treemap__tile-content\" [class]=\"parts.tileContent?.class\" [style]=\"parts.tileContent?.style\">\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"tileContext(tile)\" />\n </xhtml:div>\n </svg:foreignObject>\n } @else if (tile.nameFits) {\n <svg:foreignObject class=\"tx-treemap__tile-box\" [attr.x]=\"tile.x\" [attr.y]=\"tile.y\" [attr.width]=\"tile.width\" [attr.height]=\"tile.height\">\n <xhtml:div class=\"tx-treemap__tile-content\" [class]=\"parts.tileContent?.class\" [style]=\"parts.tileContent?.style\">\n <xhtml:span class=\"tx-treemap__tile-label\" [class]=\"parts.tileLabel?.class\" [style]=\"parts.tileLabel?.style\">{{ tile.label }}</xhtml:span>\n @if (tile.valueFits) {\n <xhtml:span class=\"tx-treemap__tile-value\" [class]=\"parts.tileValue?.class\" [style]=\"parts.tileValue?.style\">{{ tile.valueText }}</xhtml:span>\n }\n </xhtml:div>\n </svg:foreignObject>\n }\n </svg:g>\n }\n </svg:g>\n</tx-chart-frame>\n",
|
|
546
|
+
styles: [":host{display:block;max-width:100%;min-width:0}.tx-treemap__tile{fill:var(--tx-treemap-color)}.tx-treemap__tile-box,.tx-treemap__group-label{pointer-events:none}.tx-treemap__tile-content{display:flex;flex-direction:column;box-sizing:border-box;width:100%;height:100%;overflow:hidden}.tx-treemap__tile-label,.tx-treemap__tile-value{display:block;overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap}:host([data-styled]) .tx-treemap__tile{rx:var(--tx-chart-treemap-radius);stroke:var(--tx-chart-treemap-gap-color);stroke-width:var(--tx-chart-treemap-gap);transition:fill var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-treemap__group-box{fill:var(--tx-chart-treemap-group-background);stroke:var(--tx-chart-treemap-gap-color);stroke-width:var(--tx-chart-treemap-gap);rx:var(--tx-chart-treemap-radius)}:host([data-styled]) .tx-treemap__group-label{fill:var(--tx-chart-treemap-group-label-color);font-size:var(--tx-chart-treemap-group-label-font-size);font-weight:var(--tx-chart-treemap-group-label-font-weight)}:host([data-styled]) .tx-treemap__tile-content{gap:var(--tx-chart-treemap-label-gap);padding:var(--tx-chart-treemap-label-padding);color:var(--tx-chart-treemap-label-color);line-height:1.2;transition:opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-treemap__tile-label,:host([data-styled]) .tx-treemap__tile-value{filter:var(--tx-chart-treemap-label-shadow)}:host([data-styled]) .tx-treemap__tile-label{font-size:var(--tx-chart-treemap-label-font-size);font-weight:var(--tx-chart-treemap-label-font-weight)}:host([data-styled]) .tx-treemap__tile-value{font-size:var(--tx-chart-treemap-value-font-size);font-weight:var(--tx-chart-treemap-value-font-weight);font-variant-numeric:tabular-nums}:host([data-styled].tx-treemap--hovering) .tx-treemap__tile-group:not(.tx-treemap__tile-group--hovered) .tx-treemap__tile{fill:color-mix(in oklab,var(--tx-treemap-color) var(--tx-chart-treemap-dimmed-strength),var(--tx-chart-treemap-dimmed-base))}:host([data-styled].tx-treemap--hovering) .tx-treemap__tile-group:not(.tx-treemap__tile-group--hovered) .tx-treemap__tile-content{opacity:.6}:host([data-styled].tx-treemap--entering) .tx-treemap__tiles{animation:tx-treemap-enter var(--tx-chart-motion-enter-duration) var(--tx-chart-motion-easing) both}@keyframes tx-treemap-enter{0%{opacity:0}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-treemap__tile,:host([data-styled]) .tx-treemap__tile-content,:host([data-styled]) .tx-treemap__tiles{transition:none;animation:none}}\n"]
|
|
547
|
+
}]
|
|
548
|
+
}],
|
|
549
|
+
propDecorators: {
|
|
550
|
+
items: [{
|
|
551
|
+
type: i0.Input,
|
|
552
|
+
args: [{
|
|
553
|
+
isSignal: true,
|
|
554
|
+
alias: "items",
|
|
555
|
+
required: false
|
|
556
|
+
}]
|
|
557
|
+
}],
|
|
558
|
+
height: [{
|
|
559
|
+
type: i0.Input,
|
|
560
|
+
args: [{
|
|
561
|
+
isSignal: true,
|
|
562
|
+
alias: "height",
|
|
563
|
+
required: false
|
|
564
|
+
}]
|
|
565
|
+
}],
|
|
566
|
+
showDataLabels: [{
|
|
567
|
+
type: i0.Input,
|
|
568
|
+
args: [{
|
|
569
|
+
isSignal: true,
|
|
570
|
+
alias: "showDataLabels",
|
|
571
|
+
required: false
|
|
572
|
+
}]
|
|
573
|
+
}],
|
|
574
|
+
showValues: [{
|
|
575
|
+
type: i0.Input,
|
|
576
|
+
args: [{
|
|
577
|
+
isSignal: true,
|
|
578
|
+
alias: "showValues",
|
|
579
|
+
required: false
|
|
580
|
+
}]
|
|
581
|
+
}],
|
|
582
|
+
showTooltip: [{
|
|
583
|
+
type: i0.Input,
|
|
584
|
+
args: [{
|
|
585
|
+
isSignal: true,
|
|
586
|
+
alias: "showTooltip",
|
|
587
|
+
required: false
|
|
588
|
+
}]
|
|
589
|
+
}],
|
|
590
|
+
tooltipFormatter: [{
|
|
591
|
+
type: i0.Input,
|
|
592
|
+
args: [{
|
|
593
|
+
isSignal: true,
|
|
594
|
+
alias: "tooltipFormatter",
|
|
595
|
+
required: false
|
|
596
|
+
}]
|
|
597
|
+
}],
|
|
598
|
+
valueFormat: [{
|
|
599
|
+
type: i0.Input,
|
|
600
|
+
args: [{
|
|
601
|
+
isSignal: true,
|
|
602
|
+
alias: "valueFormat",
|
|
603
|
+
required: false
|
|
604
|
+
}]
|
|
605
|
+
}],
|
|
606
|
+
loading: [{
|
|
607
|
+
type: i0.Input,
|
|
608
|
+
args: [{
|
|
609
|
+
isSignal: true,
|
|
610
|
+
alias: "loading",
|
|
611
|
+
required: false
|
|
612
|
+
}]
|
|
613
|
+
}],
|
|
614
|
+
ariaLabel: [{
|
|
615
|
+
type: i0.Input,
|
|
616
|
+
args: [{
|
|
617
|
+
isSignal: true,
|
|
618
|
+
alias: "ariaLabel",
|
|
619
|
+
required: false
|
|
620
|
+
}]
|
|
621
|
+
}],
|
|
622
|
+
dt: [{
|
|
623
|
+
type: i0.Input,
|
|
624
|
+
args: [{
|
|
625
|
+
isSignal: true,
|
|
626
|
+
alias: "dt",
|
|
627
|
+
required: false
|
|
628
|
+
}]
|
|
629
|
+
}],
|
|
630
|
+
pt: [{
|
|
631
|
+
type: i0.Input,
|
|
632
|
+
args: [{
|
|
633
|
+
isSignal: true,
|
|
634
|
+
alias: "pt",
|
|
635
|
+
required: false
|
|
636
|
+
}]
|
|
637
|
+
}],
|
|
638
|
+
ptOptions: [{
|
|
639
|
+
type: i0.Input,
|
|
640
|
+
args: [{
|
|
641
|
+
isSignal: true,
|
|
642
|
+
alias: "ptOptions",
|
|
643
|
+
required: false
|
|
644
|
+
}]
|
|
645
|
+
}],
|
|
646
|
+
unstyled: [{
|
|
647
|
+
type: i0.Input,
|
|
648
|
+
args: [{
|
|
649
|
+
isSignal: true,
|
|
650
|
+
alias: "unstyled",
|
|
651
|
+
required: false
|
|
652
|
+
}]
|
|
653
|
+
}],
|
|
654
|
+
tileClick: [{
|
|
655
|
+
type: i0.Output,
|
|
656
|
+
args: ["tileClick"]
|
|
657
|
+
}],
|
|
658
|
+
tooltipTemplate: [{
|
|
659
|
+
type: i0.ContentChild,
|
|
660
|
+
args: [i0.forwardRef(() => TxChartTooltipTemplate), { isSignal: true }]
|
|
661
|
+
}],
|
|
662
|
+
tileTemplate: [{
|
|
663
|
+
type: i0.ContentChild,
|
|
664
|
+
args: [i0.forwardRef(() => TxTreemapTileTemplate), { isSignal: true }]
|
|
665
|
+
}],
|
|
666
|
+
frame: [{
|
|
667
|
+
type: i0.ViewChild,
|
|
668
|
+
args: [i0.forwardRef(() => TxChartFrame), { isSignal: true }]
|
|
669
|
+
}]
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
export { TxTreemap, TxTreemapTileTemplate, insetRect, squarify, treemapValue };
|
|
673
|
+
|
|
674
|
+
//# sourceMappingURL=tectra-ng-charts-treemap.mjs.map
|