@tectra-ng/charts 0.0.1 → 0.1.9

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.
@@ -0,0 +1,1083 @@
1
+ import { TxChartAxes, TxChartFrame, TxChartLegendTemplate, TxChartTooltipTemplate, cartesianLayout, chartNumberFormatter, chartSummary, chartTable, cycleIndex, extent, hasChartData, initialChartSize, injectChartEntrance, normalizeSeries, readTokenNumber, seriesColor, stackExtent, stackValues, stepIndex, textWidth, toggleKey } from "@tectra-ng/charts/core";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, ElementRef, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, inject, input, linkedSignal, output, signal, viewChild } from "@angular/core";
4
+ import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
5
+ import { TxLocaleService, formatMessage, injectTranslations } from "@tectra-ng/core/i18n";
6
+ import { optionalBoolean } from "@tectra-ng/core/utils";
7
+ import { toStyleObject } from "@tectra-ng/themes";
8
+ function columnBars(input) {
9
+ const { band, value, horizontal, stacked, visible } = input;
10
+ const group = band.bandwidth * Math.min(1, Math.max(.05, input.widthRatio));
11
+ const slots = stacked ? 1 : Math.max(1, visible.length);
12
+ const slotSize = (group - input.groupGap * (slots - 1)) / slots;
13
+ const bars = [];
14
+ const outermost = /* @__PURE__ */ new Map();
15
+ if (stacked) for (const seriesIndex of visible) input.stackedValues[seriesIndex]?.forEach((entry, index) => {
16
+ if (!entry || entry[0] === entry[1]) return;
17
+ const sign = entry[1] > entry[0] ? 1 : -1;
18
+ outermost.set(`${index}:${sign}`, seriesIndex);
19
+ });
20
+ visible.forEach((seriesIndex, slot) => {
21
+ (input.values[seriesIndex] ?? []).forEach((rawValue, index) => {
22
+ if (rawValue === null || rawValue === void 0) return;
23
+ const base = value.domain[0] > 0 ? value.domain[0] : value.domain[1] < 0 ? value.domain[1] : 0;
24
+ const [from, to] = stacked ? input.stackedValues[seriesIndex]?.[index] ?? [0, 0] : [base, rawValue];
25
+ if (from === to) return;
26
+ const start = band.center(index) - group / 2 + (stacked ? 0 : slot * (slotSize + input.groupGap));
27
+ const a = value.map(from);
28
+ const b = value.map(to);
29
+ const positive = to >= from;
30
+ const end = !(stacked ? outermost.get(`${index}:${positive ? 1 : -1}`) === seriesIndex : true) || from === to ? null : horizontal ? positive ? "right" : "left" : positive ? "top" : "bottom";
31
+ const rect = horizontal ? {
32
+ x: Math.min(a, b),
33
+ y: start,
34
+ width: Math.abs(b - a),
35
+ height: slotSize
36
+ } : {
37
+ x: start,
38
+ y: Math.min(a, b),
39
+ width: slotSize,
40
+ height: Math.abs(b - a)
41
+ };
42
+ const text = input.labels ? input.labels(rawValue, seriesIndex, index) : null;
43
+ const textSize = text ? textWidth(text, input.labelFontSize) : 0;
44
+ const inside = !!text && (horizontal ? rect.width >= textSize + 8 && rect.height >= input.labelFontSize + 2 : rect.height >= input.labelFontSize + 6 && rect.width >= textSize + 4);
45
+ const showLabel = !!text && (inside || !stacked);
46
+ bars.push({
47
+ key: `${seriesIndex}:${index}`,
48
+ series: seriesIndex,
49
+ index,
50
+ ...rect,
51
+ color: seriesColor(input.colors[seriesIndex], seriesIndex),
52
+ end,
53
+ dir: horizontal ? positive ? "right" : "left" : positive ? "up" : "down",
54
+ label: showLabel ? text : null,
55
+ labelX: horizontal ? inside ? rect.x + rect.width / 2 : positive ? rect.x + rect.width + 4 : rect.x - 4 : rect.x + rect.width / 2,
56
+ labelY: horizontal ? rect.y + rect.height / 2 : inside ? rect.y + rect.height / 2 : positive ? rect.y - 4 : rect.y + rect.height + 4,
57
+ inside
58
+ });
59
+ });
60
+ });
61
+ return bars;
62
+ }
63
+ const DEFAULT_WIDTH = .56;
64
+ const DEFAULT_HORIZONTAL_WIDTH = .64;
65
+ const DEFAULT_GROUP_GAP = 3;
66
+ const LABEL_FONT_SIZE = 11;
67
+ const HIT_SLACK = 4;
68
+ const MIN_HIT = 16;
69
+ var TxColumnChart = class TxColumnChart {
70
+ locale = inject(TxLocaleService);
71
+ host = inject(ElementRef);
72
+ translations = injectTranslations();
73
+ series = input([], ...ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []);
74
+ categories = input([], ...ngDevMode ? [{ debugName: "categories" }] : /* istanbul ignore next */ []);
75
+ stacked = input(true, {
76
+ ...ngDevMode ? { debugName: "stacked" } : /* istanbul ignore next */ {},
77
+ transform: booleanAttribute
78
+ });
79
+ stackType = input("normal", ...ngDevMode ? [{ debugName: "stackType" }] : /* istanbul ignore next */ []);
80
+ height = input(350, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
81
+ horizontal = input(false, {
82
+ ...ngDevMode ? { debugName: "horizontal" } : /* istanbul ignore next */ {},
83
+ transform: booleanAttribute
84
+ });
85
+ dataLabels = input(false, {
86
+ ...ngDevMode ? { debugName: "dataLabels" } : /* istanbul ignore next */ {},
87
+ transform: booleanAttribute
88
+ });
89
+ showLegend = input(true, {
90
+ ...ngDevMode ? { debugName: "showLegend" } : /* istanbul ignore next */ {},
91
+ transform: booleanAttribute
92
+ });
93
+ legendPosition = input("top", ...ngDevMode ? [{ debugName: "legendPosition" }] : /* istanbul ignore next */ []);
94
+ legendAlign = input("start", ...ngDevMode ? [{ debugName: "legendAlign" }] : /* istanbul ignore next */ []);
95
+ legendVariant = input("dot", ...ngDevMode ? [{ debugName: "legendVariant" }] : /* istanbul ignore next */ []);
96
+ showTooltip = input(true, {
97
+ ...ngDevMode ? { debugName: "showTooltip" } : /* istanbul ignore next */ {},
98
+ transform: booleanAttribute
99
+ });
100
+ tooltipMode = input("shared", ...ngDevMode ? [{ debugName: "tooltipMode" }] : /* istanbul ignore next */ []);
101
+ tooltipFormatter = input(null, ...ngDevMode ? [{ debugName: "tooltipFormatter" }] : /* istanbul ignore next */ []);
102
+ valueFormat = input("number", ...ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []);
103
+ yScale = input("linear", ...ngDevMode ? [{ debugName: "yScale" }] : /* istanbul ignore next */ []);
104
+ yMin = input(void 0, ...ngDevMode ? [{ debugName: "yMin" }] : /* istanbul ignore next */ []);
105
+ yMax = input(void 0, ...ngDevMode ? [{ debugName: "yMax" }] : /* istanbul ignore next */ []);
106
+ xAxisTitle = input("", ...ngDevMode ? [{ debugName: "xAxisTitle" }] : /* istanbul ignore next */ []);
107
+ yAxisTitle = input("", ...ngDevMode ? [{ debugName: "yAxisTitle" }] : /* istanbul ignore next */ []);
108
+ grid = input(void 0, ...ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []);
109
+ xAxisPosition = input("bottom", ...ngDevMode ? [{ debugName: "xAxisPosition" }] : /* istanbul ignore next */ []);
110
+ yAxisPosition = input("left", ...ngDevMode ? [{ debugName: "yAxisPosition" }] : /* istanbul ignore next */ []);
111
+ labelMode = input("auto", ...ngDevMode ? [{ debugName: "labelMode" }] : /* istanbul ignore next */ []);
112
+ maxLabelWidth = input(220, ...ngDevMode ? [{ debugName: "maxLabelWidth" }] : /* istanbul ignore next */ []);
113
+ loading = input(false, {
114
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
115
+ transform: booleanAttribute
116
+ });
117
+ ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
118
+ dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
119
+ pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
120
+ ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
121
+ unstyled = input(void 0, {
122
+ ...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
123
+ transform: optionalBoolean
124
+ });
125
+ seriesToggle = output();
126
+ barClick = output();
127
+ legendTemplate = contentChild(TxChartLegendTemplate, ...ngDevMode ? [{ debugName: "legendTemplate" }] : /* istanbul ignore next */ []);
128
+ tooltipTemplate = contentChild(TxChartTooltipTemplate, ...ngDevMode ? [{ debugName: "tooltipTemplate" }] : /* istanbul ignore next */ []);
129
+ frame = viewChild(TxChartFrame, ...ngDevMode ? [{ debugName: "frame" }] : /* istanbul ignore next */ []);
130
+ isUnstyled = injectUnstyled(this.unstyled);
131
+ passThrough = injectPassThrough("columnChart", this, this.pt, this.ptOptions);
132
+ tokenStyle = computed(() => toStyleObject(this.dt(), "--tx-chart"), ...ngDevMode ? [{ debugName: "tokenStyle" }] : /* istanbul ignore next */ []);
133
+ hostStyle = computed(() => ({
134
+ ...this.tokenStyle(),
135
+ ...this.passThrough().root?.style
136
+ }), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
137
+ entrance = injectChartEntrance();
138
+ morph = signal(false, ...ngDevMode ? [{ debugName: "morph" }] : /* istanbul ignore next */ []);
139
+ hidden = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "hidden" }] : /* istanbul ignore next */ []);
140
+ focusedSeries = signal(null, ...ngDevMode ? [{ debugName: "focusedSeries" }] : /* istanbul ignore next */ []);
141
+ active = signal(null, ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
142
+ geometry = signal({
143
+ width: DEFAULT_WIDTH,
144
+ horizontalWidth: DEFAULT_HORIZONTAL_WIDTH,
145
+ gap: DEFAULT_GROUP_GAP
146
+ }, ...ngDevMode ? [{ debugName: "geometry" }] : /* istanbul ignore next */ []);
147
+ intl = computed(() => this.locale.locale().intl, ...ngDevMode ? [{ debugName: "intl" }] : /* istanbul ignore next */ []);
148
+ list = computed(() => this.series() ?? [], ...ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []);
149
+ table = computed(() => normalizeSeries(this.list(), this.categories() ?? [], "category"), ...ngDevMode ? [{ debugName: "table" }] : /* istanbul ignore next */ []);
150
+ keys = computed(() => this.list().map((item, index) => `${index}:${item.name}`), ...ngDevMode ? [{ debugName: "keys" }] : /* istanbul ignore next */ []);
151
+ visibleIndexes = computed(() => this.keys().flatMap((key, index) => this.hidden().has(key) ? [] : [index]), ...ngDevMode ? [{ debugName: "visibleIndexes" }] : /* istanbul ignore next */ []);
152
+ isEmpty = computed(() => !this.list().length || !hasChartData(this.table().values), ...ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []);
153
+ isStacked = computed(() => this.stacked() || this.stackType() === "100%", ...ngDevMode ? [{ debugName: "isStacked" }] : /* istanbul ignore next */ []);
154
+ legendShown = computed(() => this.showLegend() && this.list().length > 1, ...ngDevMode ? [{ debugName: "legendShown" }] : /* istanbul ignore next */ []);
155
+ size = linkedSignal(() => initialChartSize(this.height(), this.legendShown() ? this.legendPosition() : null), ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
156
+ stackedValues = computed(() => {
157
+ const visible = new Set(this.visibleIndexes());
158
+ return stackValues(this.table().values.map((row, index) => visible.has(index) ? row : row.map(() => null)), this.stackType());
159
+ }, ...ngDevMode ? [{ debugName: "stackedValues" }] : /* istanbul ignore next */ []);
160
+ valueExtent = computed(() => {
161
+ if (this.isStacked()) return stackExtent(this.stackedValues());
162
+ return extent(this.visibleIndexes().flatMap((index) => this.table().values[index])) ?? [0, 1];
163
+ }, ...ngDevMode ? [{ debugName: "valueExtent" }] : /* istanbul ignore next */ []);
164
+ percentStack = computed(() => this.isStacked() && this.stackType() === "100%", ...ngDevMode ? [{ debugName: "percentStack" }] : /* istanbul ignore next */ []);
165
+ axisFormat = computed(() => this.percentStack() && this.valueFormat() === "number" ? "percent" : this.valueFormat(), ...ngDevMode ? [{ debugName: "axisFormat" }] : /* istanbul ignore next */ []);
166
+ layout = computed(() => {
167
+ const { width, height } = this.size();
168
+ const horizontal = this.horizontal();
169
+ return cartesianLayout({
170
+ width,
171
+ height,
172
+ intl: this.intl(),
173
+ horizontal,
174
+ category: {
175
+ kind: "band",
176
+ labels: this.table().labels,
177
+ count: this.table().labels.length,
178
+ labelMode: this.labelMode(),
179
+ maxLabelWidth: this.maxLabelWidth(),
180
+ title: this.xAxisTitle() || void 0
181
+ },
182
+ value: {
183
+ extent: this.valueExtent(),
184
+ scale: this.yScale(),
185
+ format: this.axisFormat(),
186
+ includeZero: true,
187
+ min: this.percentStack() ? 0 : this.yMin(),
188
+ max: this.percentStack() ? 100 : this.yMax(),
189
+ title: this.yAxisTitle() || void 0
190
+ },
191
+ grid: this.grid() ?? "value",
192
+ xAxisPosition: this.xAxisPosition(),
193
+ yAxisPosition: this.yAxisPosition()
194
+ });
195
+ }, ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
196
+ band = computed(() => this.layout().category, ...ngDevMode ? [{ debugName: "band" }] : /* istanbul ignore next */ []);
197
+ valueFormatter = computed(() => chartNumberFormatter(this.intl(), this.valueFormat()), ...ngDevMode ? [{ debugName: "valueFormatter" }] : /* istanbul ignore next */ []);
198
+ formatValue = computed(() => {
199
+ const custom = this.tooltipFormatter();
200
+ const format = this.valueFormatter();
201
+ return (value, seriesIndex, dataPointIndex) => custom ? custom(value, {
202
+ seriesIndex,
203
+ dataPointIndex
204
+ }) : format(value);
205
+ }, ...ngDevMode ? [{ debugName: "formatValue" }] : /* istanbul ignore next */ []);
206
+ bars = computed(() => {
207
+ const layout = this.layout();
208
+ const geometry = this.geometry();
209
+ const format = this.formatValue();
210
+ const percent = this.percentStack();
211
+ const stacked = this.stackedValues();
212
+ return columnBars({
213
+ band: this.band(),
214
+ value: layout.value,
215
+ horizontal: this.horizontal(),
216
+ stacked: this.isStacked(),
217
+ widthRatio: this.horizontal() ? geometry.horizontalWidth : geometry.width,
218
+ groupGap: geometry.gap,
219
+ values: this.table().values,
220
+ stackedValues: stacked,
221
+ visible: this.visibleIndexes(),
222
+ colors: this.list().map((item) => item.color),
223
+ labels: this.dataLabels() ? (value, series, index) => {
224
+ if (percent) {
225
+ const entry = stacked[series]?.[index];
226
+ return entry ? chartNumberFormatter(this.intl(), "percent")(entry[1] - entry[0]) : "";
227
+ }
228
+ return format(value, series, index);
229
+ } : null,
230
+ labelFontSize: LABEL_FONT_SIZE
231
+ });
232
+ }, ...ngDevMode ? [{ debugName: "bars" }] : /* istanbul ignore next */ []);
233
+ columns = computed(() => {
234
+ const boxes = /* @__PURE__ */ new Map();
235
+ for (const bar of this.bars()) {
236
+ const box = boxes.get(bar.index);
237
+ const negative = bar.end === "bottom" || bar.end === "left";
238
+ if (!box) boxes.set(bar.index, {
239
+ x1: bar.x,
240
+ y1: bar.y,
241
+ x2: bar.x + bar.width,
242
+ y2: bar.y + bar.height,
243
+ negative
244
+ });
245
+ else {
246
+ box.x1 = Math.min(box.x1, bar.x);
247
+ box.y1 = Math.min(box.y1, bar.y);
248
+ box.x2 = Math.max(box.x2, bar.x + bar.width);
249
+ box.y2 = Math.max(box.y2, bar.y + bar.height);
250
+ box.negative = box.negative && negative;
251
+ }
252
+ }
253
+ return boxes;
254
+ }, ...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
255
+ legendItems = computed(() => {
256
+ const stat = this.legendVariant() === "stat";
257
+ const active = this.active();
258
+ const format = this.valueFormatter();
259
+ return this.list().map((item, index) => {
260
+ const values = this.table().values[index] ?? [];
261
+ const raw = active ? values[active.index] : values.reduce((sum, value) => sum + (value ?? 0), 0);
262
+ return {
263
+ key: this.keys()[index],
264
+ label: item.name,
265
+ color: seriesColor(item.color, index),
266
+ hidden: this.hidden().has(this.keys()[index]),
267
+ ...stat ? {
268
+ value: raw === null || raw === void 0 ? "—" : format(raw),
269
+ caption: active ? this.table().labels[active.index] : this.translations().chartTotal
270
+ } : {}
271
+ };
272
+ });
273
+ }, ...ngDevMode ? [{ debugName: "legendItems" }] : /* istanbul ignore next */ []);
274
+ tooltip = computed(() => {
275
+ const active = this.active();
276
+ if (!active || !this.showTooltip() || this.isEmpty() || this.legendVariant() === "stat") return null;
277
+ const format = this.formatValue();
278
+ const rows = this.visibleIndexes().filter((seriesIndex) => this.tooltipMode() === "shared" || seriesIndex === active.series).flatMap((seriesIndex) => {
279
+ const raw = this.table().values[seriesIndex][active.index];
280
+ if (raw === null) return [];
281
+ return [{
282
+ label: this.list()[seriesIndex].name,
283
+ value: format(raw, seriesIndex, active.index),
284
+ color: seriesColor(this.list()[seriesIndex].color, seriesIndex),
285
+ raw,
286
+ seriesIndex,
287
+ active: seriesIndex === active.series
288
+ }];
289
+ });
290
+ if (!rows.length) return null;
291
+ const box = this.columns().get(active.index);
292
+ if (!box) return null;
293
+ const bar = this.tooltipMode() === "single" ? this.bars().find((item) => item.index === active.index && item.series === active.series) : null;
294
+ const area = bar ? {
295
+ x1: bar.x,
296
+ y1: bar.y,
297
+ x2: bar.x + bar.width,
298
+ y2: bar.y + bar.height,
299
+ negative: bar.end === "bottom" || bar.end === "left"
300
+ } : box;
301
+ const total = this.isStacked() && rows.length > 1 ? this.valueFormatter()(rows.reduce((sum, row) => sum + (row.raw ?? 0), 0)) : void 0;
302
+ const title = this.table().labels[active.index] ?? "";
303
+ if (this.horizontal()) return area.negative ? {
304
+ title,
305
+ rows,
306
+ total,
307
+ index: active.index,
308
+ x: area.x1,
309
+ y: (area.y1 + area.y2) / 2,
310
+ placement: "left"
311
+ } : {
312
+ title,
313
+ rows,
314
+ total,
315
+ index: active.index,
316
+ x: area.x2,
317
+ y: (area.y1 + area.y2) / 2,
318
+ placement: "right"
319
+ };
320
+ return area.negative ? {
321
+ title,
322
+ rows,
323
+ total,
324
+ index: active.index,
325
+ x: (area.x1 + area.x2) / 2,
326
+ y: area.y2,
327
+ placement: "bottom"
328
+ } : {
329
+ title,
330
+ rows,
331
+ total,
332
+ index: active.index,
333
+ x: (area.x1 + area.x2) / 2,
334
+ y: area.y1,
335
+ placement: "top"
336
+ };
337
+ }, ...ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []);
338
+ summary = computed(() => {
339
+ const t = this.translations();
340
+ const values = this.table().values.flat().filter((value) => value !== null);
341
+ const range = extent(values);
342
+ const format = this.valueFormatter();
343
+ const text = chartSummary(t, this.intl(), this.horizontal() ? t.chartBar : t.chartColumn, this.list().length, this.table().labels.length, range ? [format(range[0]), format(range[1])] : null);
344
+ return this.ariaLabel() ? `${this.ariaLabel()}. ${text}` : text;
345
+ }, ...ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []);
346
+ dataTable = computed(() => chartTable(this.table().labels, this.list().map((item, index) => ({
347
+ name: item.name,
348
+ values: this.table().values[index]
349
+ })), this.valueFormatter()), ...ngDevMode ? [{ debugName: "dataTable" }] : /* istanbul ignore next */ []);
350
+ constructor() {
351
+ afterNextRender(() => setTimeout(() => this.morph.set(true), 120));
352
+ afterRenderEffect(() => {
353
+ this.dt();
354
+ this.readGeometry();
355
+ });
356
+ }
357
+ isActive(index, series) {
358
+ const active = this.active();
359
+ return !!active && active.index === index && (this.tooltipMode() === "shared" || active.series === series);
360
+ }
361
+ onPointer(event) {
362
+ if (event.type === "leave") {
363
+ this.active.set(null);
364
+ return;
365
+ }
366
+ const index = this.columnAt(event.x, event.y);
367
+ if (index < 0) {
368
+ this.active.set(null);
369
+ return;
370
+ }
371
+ const series = this.seriesAt(index, event.x, event.y);
372
+ this.active.set({
373
+ index,
374
+ series,
375
+ pointerY: null,
376
+ keyboard: false
377
+ });
378
+ if (event.type === "click" && series >= 0) this.barClick.emit({
379
+ seriesIndex: series,
380
+ dataPointIndex: index,
381
+ value: this.table().values[series][index],
382
+ category: this.table().labels[index] ?? ""
383
+ });
384
+ }
385
+ columnAt(x, y) {
386
+ const slack = HIT_SLACK;
387
+ for (const [index, box] of this.columns()) {
388
+ const minSize = this.horizontal() ? box.x2 - box.x1 : box.y2 - box.y1;
389
+ const grow = Math.max(0, MIN_HIT - minSize) / 2;
390
+ const x1 = box.x1 - slack - (this.horizontal() ? grow : 0);
391
+ const x2 = box.x2 + slack + (this.horizontal() ? grow : 0);
392
+ const y1 = box.y1 - slack - (this.horizontal() ? 0 : grow);
393
+ const y2 = box.y2 + slack + (this.horizontal() ? 0 : grow);
394
+ if (x >= x1 && x <= x2 && y >= y1 && y <= y2) return index;
395
+ }
396
+ return -1;
397
+ }
398
+ onNavigate(event) {
399
+ if (event.key === "Escape") {
400
+ this.active.set(null);
401
+ return;
402
+ }
403
+ const count = this.table().labels.length;
404
+ const current = this.active();
405
+ const visible = this.visibleIndexes();
406
+ const horizontal = this.horizontal();
407
+ let index = current?.index ?? -1;
408
+ let series = current?.series ?? visible[0] ?? -1;
409
+ const seriesKeys = horizontal ? ["ArrowLeft", "ArrowRight"] : ["ArrowUp", "ArrowDown"];
410
+ if (seriesKeys.includes(event.key)) {
411
+ series = cycleIndex(series, event.key === seriesKeys[1] ? 1 : -1, visible);
412
+ index = Math.max(0, index);
413
+ } else index = horizontal ? stepIndex(event.key, index, count, "ArrowDown", "ArrowUp") : stepIndex(event.key, index, count);
414
+ if (index < 0 || series < 0) return;
415
+ this.active.set({
416
+ index,
417
+ series,
418
+ pointerY: null,
419
+ keyboard: true
420
+ });
421
+ const value = this.table().values[series][index];
422
+ this.frame()?.announce(formatMessage(this.translations().chartPoint, {
423
+ series: this.list()[series].name,
424
+ category: this.table().labels[index] ?? "",
425
+ value: value === null ? "—" : this.formatValue()(value, series, index)
426
+ }));
427
+ }
428
+ onLegendToggle(key) {
429
+ const index = this.keys().indexOf(key);
430
+ this.hidden.update((keys) => toggleKey(keys, key));
431
+ this.seriesToggle.emit({
432
+ seriesIndex: index,
433
+ name: this.list()[index]?.name ?? "",
434
+ hidden: this.hidden().has(key)
435
+ });
436
+ }
437
+ onLegendHover(key) {
438
+ const index = key === null ? -1 : this.keys().indexOf(key);
439
+ this.focusedSeries.set(index >= 0 && !this.hidden().has(key ?? "") ? index : null);
440
+ }
441
+ seriesAt(index, x, y) {
442
+ const hit = this.bars().find((bar) => bar.index === index && x >= bar.x && x <= bar.x + bar.width && y >= bar.y && y <= bar.y + bar.height);
443
+ if (hit) return hit.series;
444
+ const candidates = this.bars().filter((bar) => bar.index === index);
445
+ return candidates[candidates.length - 1]?.series ?? this.visibleIndexes()[0] ?? -1;
446
+ }
447
+ readGeometry() {
448
+ const element = this.host.nativeElement;
449
+ const next = {
450
+ width: readTokenNumber(element, "--tx-chart-bar-width", DEFAULT_WIDTH),
451
+ horizontalWidth: readTokenNumber(element, "--tx-chart-bar-horizontal-width", DEFAULT_HORIZONTAL_WIDTH),
452
+ gap: readTokenNumber(element, "--tx-chart-bar-group-gap", DEFAULT_GROUP_GAP)
453
+ };
454
+ const current = this.geometry();
455
+ if (current.width !== next.width || current.horizontalWidth !== next.horizontalWidth || current.gap !== next.gap) this.geometry.set(next);
456
+ }
457
+ static ɵfac = i0.ɵɵngDeclareFactory({
458
+ minVersion: "12.0.0",
459
+ version: "22.2.3",
460
+ ngImport: i0,
461
+ type: TxColumnChart,
462
+ deps: [],
463
+ target: i0.ɵɵFactoryTarget.Component
464
+ });
465
+ static ɵcmp = i0.ɵɵngDeclareComponent({
466
+ minVersion: "17.0.0",
467
+ version: "22.2.3",
468
+ type: TxColumnChart,
469
+ isStandalone: true,
470
+ selector: "tx-column-chart",
471
+ inputs: {
472
+ series: {
473
+ classPropertyName: "series",
474
+ publicName: "series",
475
+ isSignal: true,
476
+ isRequired: false,
477
+ transformFunction: null
478
+ },
479
+ categories: {
480
+ classPropertyName: "categories",
481
+ publicName: "categories",
482
+ isSignal: true,
483
+ isRequired: false,
484
+ transformFunction: null
485
+ },
486
+ stacked: {
487
+ classPropertyName: "stacked",
488
+ publicName: "stacked",
489
+ isSignal: true,
490
+ isRequired: false,
491
+ transformFunction: null
492
+ },
493
+ stackType: {
494
+ classPropertyName: "stackType",
495
+ publicName: "stackType",
496
+ isSignal: true,
497
+ isRequired: false,
498
+ transformFunction: null
499
+ },
500
+ height: {
501
+ classPropertyName: "height",
502
+ publicName: "height",
503
+ isSignal: true,
504
+ isRequired: false,
505
+ transformFunction: null
506
+ },
507
+ horizontal: {
508
+ classPropertyName: "horizontal",
509
+ publicName: "horizontal",
510
+ isSignal: true,
511
+ isRequired: false,
512
+ transformFunction: null
513
+ },
514
+ dataLabels: {
515
+ classPropertyName: "dataLabels",
516
+ publicName: "dataLabels",
517
+ isSignal: true,
518
+ isRequired: false,
519
+ transformFunction: null
520
+ },
521
+ showLegend: {
522
+ classPropertyName: "showLegend",
523
+ publicName: "showLegend",
524
+ isSignal: true,
525
+ isRequired: false,
526
+ transformFunction: null
527
+ },
528
+ legendPosition: {
529
+ classPropertyName: "legendPosition",
530
+ publicName: "legendPosition",
531
+ isSignal: true,
532
+ isRequired: false,
533
+ transformFunction: null
534
+ },
535
+ legendAlign: {
536
+ classPropertyName: "legendAlign",
537
+ publicName: "legendAlign",
538
+ isSignal: true,
539
+ isRequired: false,
540
+ transformFunction: null
541
+ },
542
+ legendVariant: {
543
+ classPropertyName: "legendVariant",
544
+ publicName: "legendVariant",
545
+ isSignal: true,
546
+ isRequired: false,
547
+ transformFunction: null
548
+ },
549
+ showTooltip: {
550
+ classPropertyName: "showTooltip",
551
+ publicName: "showTooltip",
552
+ isSignal: true,
553
+ isRequired: false,
554
+ transformFunction: null
555
+ },
556
+ tooltipMode: {
557
+ classPropertyName: "tooltipMode",
558
+ publicName: "tooltipMode",
559
+ isSignal: true,
560
+ isRequired: false,
561
+ transformFunction: null
562
+ },
563
+ tooltipFormatter: {
564
+ classPropertyName: "tooltipFormatter",
565
+ publicName: "tooltipFormatter",
566
+ isSignal: true,
567
+ isRequired: false,
568
+ transformFunction: null
569
+ },
570
+ valueFormat: {
571
+ classPropertyName: "valueFormat",
572
+ publicName: "valueFormat",
573
+ isSignal: true,
574
+ isRequired: false,
575
+ transformFunction: null
576
+ },
577
+ yScale: {
578
+ classPropertyName: "yScale",
579
+ publicName: "yScale",
580
+ isSignal: true,
581
+ isRequired: false,
582
+ transformFunction: null
583
+ },
584
+ yMin: {
585
+ classPropertyName: "yMin",
586
+ publicName: "yMin",
587
+ isSignal: true,
588
+ isRequired: false,
589
+ transformFunction: null
590
+ },
591
+ yMax: {
592
+ classPropertyName: "yMax",
593
+ publicName: "yMax",
594
+ isSignal: true,
595
+ isRequired: false,
596
+ transformFunction: null
597
+ },
598
+ xAxisTitle: {
599
+ classPropertyName: "xAxisTitle",
600
+ publicName: "xAxisTitle",
601
+ isSignal: true,
602
+ isRequired: false,
603
+ transformFunction: null
604
+ },
605
+ yAxisTitle: {
606
+ classPropertyName: "yAxisTitle",
607
+ publicName: "yAxisTitle",
608
+ isSignal: true,
609
+ isRequired: false,
610
+ transformFunction: null
611
+ },
612
+ grid: {
613
+ classPropertyName: "grid",
614
+ publicName: "grid",
615
+ isSignal: true,
616
+ isRequired: false,
617
+ transformFunction: null
618
+ },
619
+ xAxisPosition: {
620
+ classPropertyName: "xAxisPosition",
621
+ publicName: "xAxisPosition",
622
+ isSignal: true,
623
+ isRequired: false,
624
+ transformFunction: null
625
+ },
626
+ yAxisPosition: {
627
+ classPropertyName: "yAxisPosition",
628
+ publicName: "yAxisPosition",
629
+ isSignal: true,
630
+ isRequired: false,
631
+ transformFunction: null
632
+ },
633
+ labelMode: {
634
+ classPropertyName: "labelMode",
635
+ publicName: "labelMode",
636
+ isSignal: true,
637
+ isRequired: false,
638
+ transformFunction: null
639
+ },
640
+ maxLabelWidth: {
641
+ classPropertyName: "maxLabelWidth",
642
+ publicName: "maxLabelWidth",
643
+ isSignal: true,
644
+ isRequired: false,
645
+ transformFunction: null
646
+ },
647
+ loading: {
648
+ classPropertyName: "loading",
649
+ publicName: "loading",
650
+ isSignal: true,
651
+ isRequired: false,
652
+ transformFunction: null
653
+ },
654
+ ariaLabel: {
655
+ classPropertyName: "ariaLabel",
656
+ publicName: "ariaLabel",
657
+ isSignal: true,
658
+ isRequired: false,
659
+ transformFunction: null
660
+ },
661
+ dt: {
662
+ classPropertyName: "dt",
663
+ publicName: "dt",
664
+ isSignal: true,
665
+ isRequired: false,
666
+ transformFunction: null
667
+ },
668
+ pt: {
669
+ classPropertyName: "pt",
670
+ publicName: "pt",
671
+ isSignal: true,
672
+ isRequired: false,
673
+ transformFunction: null
674
+ },
675
+ ptOptions: {
676
+ classPropertyName: "ptOptions",
677
+ publicName: "ptOptions",
678
+ isSignal: true,
679
+ isRequired: false,
680
+ transformFunction: null
681
+ },
682
+ unstyled: {
683
+ classPropertyName: "unstyled",
684
+ publicName: "unstyled",
685
+ isSignal: true,
686
+ isRequired: false,
687
+ transformFunction: null
688
+ }
689
+ },
690
+ outputs: {
691
+ seriesToggle: "seriesToggle",
692
+ barClick: "barClick"
693
+ },
694
+ host: {
695
+ properties: {
696
+ "class": "passThrough().root?.class",
697
+ "style": "hostStyle()",
698
+ "attr.data-styled": "!isUnstyled() || null",
699
+ "attr.data-orientation": "horizontal() ? \"horizontal\" : \"vertical\"",
700
+ "class.tx-column-chart--fill": "typeof height() === \"string\"",
701
+ "class.tx-column-chart--entering": "entrance.active()",
702
+ "class.tx-column-chart--morph": "morph()",
703
+ "class.tx-column-chart--focused": "focusedSeries() !== null",
704
+ "class.tx-column-chart--stacked": "isStacked()",
705
+ "class.tx-column-chart--active": "active() !== null"
706
+ },
707
+ classAttribute: "tx-column-chart"
708
+ },
709
+ queries: [{
710
+ propertyName: "legendTemplate",
711
+ first: true,
712
+ predicate: TxChartLegendTemplate,
713
+ descendants: true,
714
+ isSignal: true
715
+ }, {
716
+ propertyName: "tooltipTemplate",
717
+ first: true,
718
+ predicate: TxChartTooltipTemplate,
719
+ descendants: true,
720
+ isSignal: true
721
+ }],
722
+ viewQueries: [{
723
+ propertyName: "frame",
724
+ first: true,
725
+ predicate: TxChartFrame,
726
+ descendants: true,
727
+ isSignal: true
728
+ }],
729
+ ngImport: i0,
730
+ template: "<tx-chart-frame\n [height]=\"height()\"\n [(size)]=\"size\"\n [legendItems]=\"legendItems()\"\n [showLegend]=\"legendShown()\"\n [legendPosition]=\"legendPosition()\"\n [legendAlign]=\"legendAlign()\"\n [legendVariant]=\"legendVariant()\"\n [legendTemplate]=\"legendTemplate()?.template\"\n [empty]=\"isEmpty()\"\n [loading]=\"loading()\"\n emptyIcon=\"chart-bar\"\n [summary]=\"summary()\"\n [table]=\"dataTable()\"\n [tooltip]=\"tooltip()\"\n [tooltipTemplate]=\"tooltipTemplate()?.template\"\n [panelStyle]=\"tokenStyle()\"\n [parts]=\"passThrough()\"\n [styled]=\"!isUnstyled()\"\n (pointer)=\"onPointer($event)\"\n (navigate)=\"onNavigate($event)\"\n (legendToggled)=\"onLegendToggle($event)\"\n (legendHovered)=\"onLegendHover($event)\"\n (tooltipClosed)=\"active.set(null)\"\n>\n <svg:g [tx-chart-axes]=\"layout().axes\" [gridPart]=\"passThrough().grid\" [axisPart]=\"passThrough().axis\" />\n <svg:g class=\"tx-column-chart__bars\">\n @for (bar of bars(); track bar.key) {\n <svg:rect\n class=\"tx-column-chart__bar\"\n [class.tx-column-chart__bar--focused]=\"focusedSeries() === bar.series\"\n [class.tx-column-chart__bar--active]=\"isActive(bar.index, bar.series)\"\n [class]=\"passThrough().bar?.class\"\n [style]=\"passThrough().bar?.style\"\n [attr.data-series]=\"bar.series\"\n [attr.data-index]=\"bar.index\"\n [attr.data-end]=\"bar.end\"\n [attr.data-dir]=\"bar.dir\"\n [style.--tx-column-chart-order]=\"bar.index\"\n [attr.x]=\"bar.x\"\n [attr.y]=\"bar.y\"\n [attr.width]=\"bar.width\"\n [attr.height]=\"bar.height\"\n [style.--tx-column-chart-color]=\"bar.color\"\n />\n }\n </svg:g>\n @if (dataLabels()) {\n <svg:g class=\"tx-column-chart__labels\">\n @for (bar of bars(); track bar.key) {\n @if (bar.label) {\n <svg:text\n class=\"tx-column-chart__label\"\n [class.tx-column-chart__label--outside]=\"!bar.inside\"\n [class]=\"passThrough().dataLabel?.class\"\n [style]=\"passThrough().dataLabel?.style\"\n [attr.x]=\"bar.labelX\"\n [attr.y]=\"bar.labelY\"\n [attr.text-anchor]=\"horizontal() && !bar.inside ? (bar.labelX >= bar.x ? 'start' : 'end') : 'middle'\"\n [attr.dominant-baseline]=\"horizontal() || bar.inside ? 'central' : bar.labelY < bar.y ? 'auto' : 'hanging'\"\n >\n {{ bar.label }}\n </svg:text>\n }\n }\n </svg:g>\n }\n</tx-chart-frame>\n",
731
+ styles: [":host{display:block;min-width:0}:host(.tx-column-chart--fill){height:100%}.tx-column-chart__bar{fill:var(--tx-column-chart-color);transform-box:fill-box}.tx-column-chart__bar[data-dir=up]{transform-origin:50% 100%}.tx-column-chart__bar[data-dir=down]{transform-origin:50% 0}.tx-column-chart__bar[data-dir=right]{transform-origin:0 50%}.tx-column-chart__bar[data-dir=left]{transform-origin:100% 50%}.tx-column-chart__label{pointer-events:none}:host([data-styled]) .tx-column-chart__bar{transition:fill var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-column-chart__bar[data-end=top]{clip-path:inset(0 round var(--tx-chart-bar-radius) var(--tx-chart-bar-radius) 0 0)}:host([data-styled]) .tx-column-chart__bar[data-end=bottom]{clip-path:inset(0 round 0 0 var(--tx-chart-bar-radius) var(--tx-chart-bar-radius))}:host([data-styled]) .tx-column-chart__bar[data-end=right]{clip-path:inset(0 round 0 var(--tx-chart-bar-radius) var(--tx-chart-bar-radius) 0)}:host([data-styled]) .tx-column-chart__bar[data-end=left]{clip-path:inset(0 round var(--tx-chart-bar-radius) 0 0 var(--tx-chart-bar-radius))}:host([data-styled]) .tx-column-chart__label{fill:var(--tx-chart-bar-label-color);font-size:var(--tx-chart-bar-label-font-size);font-weight:var(--tx-chart-bar-label-font-weight);font-variant-numeric:tabular-nums;transition:opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-column-chart__label--outside{fill:var(--tx-chart-bar-outside-label-color)}:host([data-styled].tx-column-chart--stacked) .tx-column-chart__bar{stroke:var(--tx-chart-bar-segment-gap-color);stroke-width:var(--tx-chart-bar-segment-gap)}:host([data-styled].tx-column-chart--active) .tx-column-chart__bar:not(.tx-column-chart__bar--active),:host([data-styled].tx-column-chart--focused) .tx-column-chart__bar:not(.tx-column-chart__bar--focused){fill:color-mix(in oklab,var(--tx-column-chart-color) var(--tx-chart-bar-dimmed-strength),var(--tx-chart-bar-dimmed-base))}:host([data-styled].tx-column-chart--morph) .tx-column-chart__bar{transition:fill var(--tx-chart-motion-hover-duration) ease,x var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),y var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),height var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing)}:host([data-styled].tx-column-chart--entering) .tx-column-chart__bar{animation:tx-column-chart-grow-y var(--tx-chart-motion-enter-duration) var(--tx-chart-motion-easing) both;animation-delay:calc(var(--tx-column-chart-order, 0) * var(--tx-chart-motion-stagger))}:host([data-styled].tx-column-chart--entering) .tx-column-chart__bar:is([data-dir=left],[data-dir=right]){animation-name:tx-column-chart-grow-x}:host([data-styled].tx-column-chart--entering) .tx-column-chart__labels{animation:tx-column-chart-fade var(--tx-chart-motion-enter-duration) ease both}@keyframes tx-column-chart-grow-y{0%{transform:scaleY(0)}to{transform:scaleY(1)}}@keyframes tx-column-chart-grow-x{0%{transform:scaleX(0)}to{transform:scaleX(1)}}@keyframes tx-column-chart-fade{0%,60%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-column-chart__bar,:host([data-styled]) .tx-column-chart__labels,:host([data-styled]) .tx-column-chart__label{transition:none;animation:none}}\n"],
732
+ dependencies: [{
733
+ kind: "component",
734
+ type: TxChartFrame,
735
+ selector: "tx-chart-frame",
736
+ inputs: [
737
+ "height",
738
+ "size",
739
+ "legendItems",
740
+ "showLegend",
741
+ "legendPosition",
742
+ "legendAlign",
743
+ "legendVariant",
744
+ "legendToggle",
745
+ "legendTemplate",
746
+ "empty",
747
+ "loading",
748
+ "emptyIcon",
749
+ "summary",
750
+ "table",
751
+ "tooltip",
752
+ "tooltipTemplate",
753
+ "tooltipPlacement",
754
+ "panelStyle",
755
+ "parts",
756
+ "styled",
757
+ "interactive",
758
+ "plotHeight"
759
+ ],
760
+ outputs: [
761
+ "sizeChange",
762
+ "pointer",
763
+ "navigate",
764
+ "legendToggled",
765
+ "legendHovered",
766
+ "tooltipClosed"
767
+ ]
768
+ }, {
769
+ kind: "component",
770
+ type: TxChartAxes,
771
+ selector: "g[tx-chart-axes]",
772
+ inputs: [
773
+ "tx-chart-axes",
774
+ "gridPart",
775
+ "axisPart"
776
+ ]
777
+ }],
778
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
779
+ });
780
+ };
781
+ i0.ɵɵngDeclareClassMetadata({
782
+ minVersion: "12.0.0",
783
+ version: "22.2.3",
784
+ ngImport: i0,
785
+ type: TxColumnChart,
786
+ decorators: [{
787
+ type: Component,
788
+ args: [{
789
+ selector: "tx-column-chart",
790
+ imports: [TxChartFrame, TxChartAxes],
791
+ changeDetection: ChangeDetectionStrategy.OnPush,
792
+ host: {
793
+ class: "tx-column-chart",
794
+ "[class]": "passThrough().root?.class",
795
+ "[style]": "hostStyle()",
796
+ "[attr.data-styled]": "!isUnstyled() || null",
797
+ "[attr.data-orientation]": "horizontal() ? \"horizontal\" : \"vertical\"",
798
+ "[class.tx-column-chart--fill]": "typeof height() === \"string\"",
799
+ "[class.tx-column-chart--entering]": "entrance.active()",
800
+ "[class.tx-column-chart--morph]": "morph()",
801
+ "[class.tx-column-chart--focused]": "focusedSeries() !== null",
802
+ "[class.tx-column-chart--stacked]": "isStacked()",
803
+ "[class.tx-column-chart--active]": "active() !== null"
804
+ },
805
+ template: "<tx-chart-frame\n [height]=\"height()\"\n [(size)]=\"size\"\n [legendItems]=\"legendItems()\"\n [showLegend]=\"legendShown()\"\n [legendPosition]=\"legendPosition()\"\n [legendAlign]=\"legendAlign()\"\n [legendVariant]=\"legendVariant()\"\n [legendTemplate]=\"legendTemplate()?.template\"\n [empty]=\"isEmpty()\"\n [loading]=\"loading()\"\n emptyIcon=\"chart-bar\"\n [summary]=\"summary()\"\n [table]=\"dataTable()\"\n [tooltip]=\"tooltip()\"\n [tooltipTemplate]=\"tooltipTemplate()?.template\"\n [panelStyle]=\"tokenStyle()\"\n [parts]=\"passThrough()\"\n [styled]=\"!isUnstyled()\"\n (pointer)=\"onPointer($event)\"\n (navigate)=\"onNavigate($event)\"\n (legendToggled)=\"onLegendToggle($event)\"\n (legendHovered)=\"onLegendHover($event)\"\n (tooltipClosed)=\"active.set(null)\"\n>\n <svg:g [tx-chart-axes]=\"layout().axes\" [gridPart]=\"passThrough().grid\" [axisPart]=\"passThrough().axis\" />\n <svg:g class=\"tx-column-chart__bars\">\n @for (bar of bars(); track bar.key) {\n <svg:rect\n class=\"tx-column-chart__bar\"\n [class.tx-column-chart__bar--focused]=\"focusedSeries() === bar.series\"\n [class.tx-column-chart__bar--active]=\"isActive(bar.index, bar.series)\"\n [class]=\"passThrough().bar?.class\"\n [style]=\"passThrough().bar?.style\"\n [attr.data-series]=\"bar.series\"\n [attr.data-index]=\"bar.index\"\n [attr.data-end]=\"bar.end\"\n [attr.data-dir]=\"bar.dir\"\n [style.--tx-column-chart-order]=\"bar.index\"\n [attr.x]=\"bar.x\"\n [attr.y]=\"bar.y\"\n [attr.width]=\"bar.width\"\n [attr.height]=\"bar.height\"\n [style.--tx-column-chart-color]=\"bar.color\"\n />\n }\n </svg:g>\n @if (dataLabels()) {\n <svg:g class=\"tx-column-chart__labels\">\n @for (bar of bars(); track bar.key) {\n @if (bar.label) {\n <svg:text\n class=\"tx-column-chart__label\"\n [class.tx-column-chart__label--outside]=\"!bar.inside\"\n [class]=\"passThrough().dataLabel?.class\"\n [style]=\"passThrough().dataLabel?.style\"\n [attr.x]=\"bar.labelX\"\n [attr.y]=\"bar.labelY\"\n [attr.text-anchor]=\"horizontal() && !bar.inside ? (bar.labelX >= bar.x ? 'start' : 'end') : 'middle'\"\n [attr.dominant-baseline]=\"horizontal() || bar.inside ? 'central' : bar.labelY < bar.y ? 'auto' : 'hanging'\"\n >\n {{ bar.label }}\n </svg:text>\n }\n }\n </svg:g>\n }\n</tx-chart-frame>\n",
806
+ styles: [":host{display:block;min-width:0}:host(.tx-column-chart--fill){height:100%}.tx-column-chart__bar{fill:var(--tx-column-chart-color);transform-box:fill-box}.tx-column-chart__bar[data-dir=up]{transform-origin:50% 100%}.tx-column-chart__bar[data-dir=down]{transform-origin:50% 0}.tx-column-chart__bar[data-dir=right]{transform-origin:0 50%}.tx-column-chart__bar[data-dir=left]{transform-origin:100% 50%}.tx-column-chart__label{pointer-events:none}:host([data-styled]) .tx-column-chart__bar{transition:fill var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-column-chart__bar[data-end=top]{clip-path:inset(0 round var(--tx-chart-bar-radius) var(--tx-chart-bar-radius) 0 0)}:host([data-styled]) .tx-column-chart__bar[data-end=bottom]{clip-path:inset(0 round 0 0 var(--tx-chart-bar-radius) var(--tx-chart-bar-radius))}:host([data-styled]) .tx-column-chart__bar[data-end=right]{clip-path:inset(0 round 0 var(--tx-chart-bar-radius) var(--tx-chart-bar-radius) 0)}:host([data-styled]) .tx-column-chart__bar[data-end=left]{clip-path:inset(0 round var(--tx-chart-bar-radius) 0 0 var(--tx-chart-bar-radius))}:host([data-styled]) .tx-column-chart__label{fill:var(--tx-chart-bar-label-color);font-size:var(--tx-chart-bar-label-font-size);font-weight:var(--tx-chart-bar-label-font-weight);font-variant-numeric:tabular-nums;transition:opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-column-chart__label--outside{fill:var(--tx-chart-bar-outside-label-color)}:host([data-styled].tx-column-chart--stacked) .tx-column-chart__bar{stroke:var(--tx-chart-bar-segment-gap-color);stroke-width:var(--tx-chart-bar-segment-gap)}:host([data-styled].tx-column-chart--active) .tx-column-chart__bar:not(.tx-column-chart__bar--active),:host([data-styled].tx-column-chart--focused) .tx-column-chart__bar:not(.tx-column-chart__bar--focused){fill:color-mix(in oklab,var(--tx-column-chart-color) var(--tx-chart-bar-dimmed-strength),var(--tx-chart-bar-dimmed-base))}:host([data-styled].tx-column-chart--morph) .tx-column-chart__bar{transition:fill var(--tx-chart-motion-hover-duration) ease,x var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),y var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),height var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing)}:host([data-styled].tx-column-chart--entering) .tx-column-chart__bar{animation:tx-column-chart-grow-y var(--tx-chart-motion-enter-duration) var(--tx-chart-motion-easing) both;animation-delay:calc(var(--tx-column-chart-order, 0) * var(--tx-chart-motion-stagger))}:host([data-styled].tx-column-chart--entering) .tx-column-chart__bar:is([data-dir=left],[data-dir=right]){animation-name:tx-column-chart-grow-x}:host([data-styled].tx-column-chart--entering) .tx-column-chart__labels{animation:tx-column-chart-fade var(--tx-chart-motion-enter-duration) ease both}@keyframes tx-column-chart-grow-y{0%{transform:scaleY(0)}to{transform:scaleY(1)}}@keyframes tx-column-chart-grow-x{0%{transform:scaleX(0)}to{transform:scaleX(1)}}@keyframes tx-column-chart-fade{0%,60%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-column-chart__bar,:host([data-styled]) .tx-column-chart__labels,:host([data-styled]) .tx-column-chart__label{transition:none;animation:none}}\n"]
807
+ }]
808
+ }],
809
+ ctorParameters: () => [],
810
+ propDecorators: {
811
+ series: [{
812
+ type: i0.Input,
813
+ args: [{
814
+ isSignal: true,
815
+ alias: "series",
816
+ required: false
817
+ }]
818
+ }],
819
+ categories: [{
820
+ type: i0.Input,
821
+ args: [{
822
+ isSignal: true,
823
+ alias: "categories",
824
+ required: false
825
+ }]
826
+ }],
827
+ stacked: [{
828
+ type: i0.Input,
829
+ args: [{
830
+ isSignal: true,
831
+ alias: "stacked",
832
+ required: false
833
+ }]
834
+ }],
835
+ stackType: [{
836
+ type: i0.Input,
837
+ args: [{
838
+ isSignal: true,
839
+ alias: "stackType",
840
+ required: false
841
+ }]
842
+ }],
843
+ height: [{
844
+ type: i0.Input,
845
+ args: [{
846
+ isSignal: true,
847
+ alias: "height",
848
+ required: false
849
+ }]
850
+ }],
851
+ horizontal: [{
852
+ type: i0.Input,
853
+ args: [{
854
+ isSignal: true,
855
+ alias: "horizontal",
856
+ required: false
857
+ }]
858
+ }],
859
+ dataLabels: [{
860
+ type: i0.Input,
861
+ args: [{
862
+ isSignal: true,
863
+ alias: "dataLabels",
864
+ required: false
865
+ }]
866
+ }],
867
+ showLegend: [{
868
+ type: i0.Input,
869
+ args: [{
870
+ isSignal: true,
871
+ alias: "showLegend",
872
+ required: false
873
+ }]
874
+ }],
875
+ legendPosition: [{
876
+ type: i0.Input,
877
+ args: [{
878
+ isSignal: true,
879
+ alias: "legendPosition",
880
+ required: false
881
+ }]
882
+ }],
883
+ legendAlign: [{
884
+ type: i0.Input,
885
+ args: [{
886
+ isSignal: true,
887
+ alias: "legendAlign",
888
+ required: false
889
+ }]
890
+ }],
891
+ legendVariant: [{
892
+ type: i0.Input,
893
+ args: [{
894
+ isSignal: true,
895
+ alias: "legendVariant",
896
+ required: false
897
+ }]
898
+ }],
899
+ showTooltip: [{
900
+ type: i0.Input,
901
+ args: [{
902
+ isSignal: true,
903
+ alias: "showTooltip",
904
+ required: false
905
+ }]
906
+ }],
907
+ tooltipMode: [{
908
+ type: i0.Input,
909
+ args: [{
910
+ isSignal: true,
911
+ alias: "tooltipMode",
912
+ required: false
913
+ }]
914
+ }],
915
+ tooltipFormatter: [{
916
+ type: i0.Input,
917
+ args: [{
918
+ isSignal: true,
919
+ alias: "tooltipFormatter",
920
+ required: false
921
+ }]
922
+ }],
923
+ valueFormat: [{
924
+ type: i0.Input,
925
+ args: [{
926
+ isSignal: true,
927
+ alias: "valueFormat",
928
+ required: false
929
+ }]
930
+ }],
931
+ yScale: [{
932
+ type: i0.Input,
933
+ args: [{
934
+ isSignal: true,
935
+ alias: "yScale",
936
+ required: false
937
+ }]
938
+ }],
939
+ yMin: [{
940
+ type: i0.Input,
941
+ args: [{
942
+ isSignal: true,
943
+ alias: "yMin",
944
+ required: false
945
+ }]
946
+ }],
947
+ yMax: [{
948
+ type: i0.Input,
949
+ args: [{
950
+ isSignal: true,
951
+ alias: "yMax",
952
+ required: false
953
+ }]
954
+ }],
955
+ xAxisTitle: [{
956
+ type: i0.Input,
957
+ args: [{
958
+ isSignal: true,
959
+ alias: "xAxisTitle",
960
+ required: false
961
+ }]
962
+ }],
963
+ yAxisTitle: [{
964
+ type: i0.Input,
965
+ args: [{
966
+ isSignal: true,
967
+ alias: "yAxisTitle",
968
+ required: false
969
+ }]
970
+ }],
971
+ grid: [{
972
+ type: i0.Input,
973
+ args: [{
974
+ isSignal: true,
975
+ alias: "grid",
976
+ required: false
977
+ }]
978
+ }],
979
+ xAxisPosition: [{
980
+ type: i0.Input,
981
+ args: [{
982
+ isSignal: true,
983
+ alias: "xAxisPosition",
984
+ required: false
985
+ }]
986
+ }],
987
+ yAxisPosition: [{
988
+ type: i0.Input,
989
+ args: [{
990
+ isSignal: true,
991
+ alias: "yAxisPosition",
992
+ required: false
993
+ }]
994
+ }],
995
+ labelMode: [{
996
+ type: i0.Input,
997
+ args: [{
998
+ isSignal: true,
999
+ alias: "labelMode",
1000
+ required: false
1001
+ }]
1002
+ }],
1003
+ maxLabelWidth: [{
1004
+ type: i0.Input,
1005
+ args: [{
1006
+ isSignal: true,
1007
+ alias: "maxLabelWidth",
1008
+ required: false
1009
+ }]
1010
+ }],
1011
+ loading: [{
1012
+ type: i0.Input,
1013
+ args: [{
1014
+ isSignal: true,
1015
+ alias: "loading",
1016
+ required: false
1017
+ }]
1018
+ }],
1019
+ ariaLabel: [{
1020
+ type: i0.Input,
1021
+ args: [{
1022
+ isSignal: true,
1023
+ alias: "ariaLabel",
1024
+ required: false
1025
+ }]
1026
+ }],
1027
+ dt: [{
1028
+ type: i0.Input,
1029
+ args: [{
1030
+ isSignal: true,
1031
+ alias: "dt",
1032
+ required: false
1033
+ }]
1034
+ }],
1035
+ pt: [{
1036
+ type: i0.Input,
1037
+ args: [{
1038
+ isSignal: true,
1039
+ alias: "pt",
1040
+ required: false
1041
+ }]
1042
+ }],
1043
+ ptOptions: [{
1044
+ type: i0.Input,
1045
+ args: [{
1046
+ isSignal: true,
1047
+ alias: "ptOptions",
1048
+ required: false
1049
+ }]
1050
+ }],
1051
+ unstyled: [{
1052
+ type: i0.Input,
1053
+ args: [{
1054
+ isSignal: true,
1055
+ alias: "unstyled",
1056
+ required: false
1057
+ }]
1058
+ }],
1059
+ seriesToggle: [{
1060
+ type: i0.Output,
1061
+ args: ["seriesToggle"]
1062
+ }],
1063
+ barClick: [{
1064
+ type: i0.Output,
1065
+ args: ["barClick"]
1066
+ }],
1067
+ legendTemplate: [{
1068
+ type: i0.ContentChild,
1069
+ args: [i0.forwardRef(() => TxChartLegendTemplate), { isSignal: true }]
1070
+ }],
1071
+ tooltipTemplate: [{
1072
+ type: i0.ContentChild,
1073
+ args: [i0.forwardRef(() => TxChartTooltipTemplate), { isSignal: true }]
1074
+ }],
1075
+ frame: [{
1076
+ type: i0.ViewChild,
1077
+ args: [i0.forwardRef(() => TxChartFrame), { isSignal: true }]
1078
+ }]
1079
+ }
1080
+ });
1081
+ export { TxColumnChart, columnBars };
1082
+
1083
+ //# sourceMappingURL=tectra-ng-charts-column.mjs.map