@tectra-ng/charts 0.1.9 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -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 +4 -2
- package/combo/README.md +83 -0
- package/core/README.md +3 -1
- 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 +149 -66
- package/fesm2022/tectra-ng-charts-column.mjs.map +1 -1
- 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 +1334 -49
- package/fesm2022/tectra-ng-charts-core.mjs.map +1 -1
- 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 +527 -67
- package/fesm2022/tectra-ng-charts-line.mjs.map +1 -1
- 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 +47 -86
- package/fesm2022/tectra-ng-charts-pie.mjs.map +1 -1
- 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/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 +13 -2
- package/org-chart/README.md +57 -0
- package/package.json +114 -6
- package/pie/README.md +1 -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 +486 -3
- package/types/tectra-ng-charts-column.d.ts.map +1 -1
- 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 +266 -5
- package/types/tectra-ng-charts-core.d.ts.map +1 -1
- 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 +556 -2
- package/types/tectra-ng-charts-line.d.ts.map +1 -1
- 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 +477 -14
- package/types/tectra-ng-charts-pie.d.ts.map +1 -1
- 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/waterfall/README.md +60 -0
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, Directive, ElementRef, Injector, PLATFORM_ID, TemplateRef, ViewContainerRef, afterNextRender, booleanAttribute, computed, effect, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, Directive, ElementRef, Injector, PLATFORM_ID, TemplateRef, ViewContainerRef, afterNextRender, booleanAttribute, computed, effect, inject, input, linkedSignal, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
3
3
|
import { NgTemplateOutlet, isPlatformBrowser } from "@angular/common";
|
|
4
4
|
import { formatMessage, injectTranslations } from "@tectra-ng/core/i18n";
|
|
5
|
-
import { TxAnnouncer, uniqueId } from "@tectra-ng/core/a11y";
|
|
5
|
+
import { TxAnnouncer, nextListIndex, uniqueId } from "@tectra-ng/core/a11y";
|
|
6
6
|
import { TxOverlay, parsePlacement, txArrowOffset } from "@tectra-ng/core/overlay";
|
|
7
7
|
import { TxIcon } from "@tectra-ng/icons";
|
|
8
8
|
import { TxSkeleton } from "@tectra-ng/ui/skeleton";
|
|
9
|
+
import { TxButton } from "@tectra-ng/ui/button";
|
|
10
|
+
import { TxPopover, TxPopoverTrigger } from "@tectra-ng/ui/popover";
|
|
11
|
+
import { injectUnstyled } from "@tectra-ng/core/config";
|
|
12
|
+
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
9
13
|
const E10 = Math.sqrt(50);
|
|
10
14
|
const E5 = Math.sqrt(10);
|
|
11
15
|
const E2 = Math.sqrt(2);
|
|
@@ -433,8 +437,8 @@ function truncateText(text, maxWidth, fontSize = 12) {
|
|
|
433
437
|
while (chars.length > 1 && textWidth(`${chars.join("")}…`, fontSize) > maxWidth) chars.pop();
|
|
434
438
|
return `${chars.join("").trimEnd()}…`;
|
|
435
439
|
}
|
|
436
|
-
const round = (value) => Math.round(value * 100) / 100;
|
|
437
|
-
const pair = (point) => `${round(point.x)},${round(point.y)}`;
|
|
440
|
+
const round$1 = (value) => Math.round(value * 100) / 100;
|
|
441
|
+
const pair = (point) => `${round$1(point.x)},${round$1(point.y)}`;
|
|
438
442
|
function slope(a, b) {
|
|
439
443
|
const dx = b.x - a.x;
|
|
440
444
|
return dx ? (b.y - a.y) / dx : 0;
|
|
@@ -470,7 +474,7 @@ function segment(points, curve, move) {
|
|
|
470
474
|
if (curve === "straight") return start + points.slice(1).map((point) => `L${pair(point)}`).join("");
|
|
471
475
|
if (curve === "step") return start + points.slice(1).map((point, index) => {
|
|
472
476
|
const middle = (points[index].x + point.x) / 2;
|
|
473
|
-
return `H${round(middle)}V${round(point.y)}H${round(point.x)}`;
|
|
477
|
+
return `H${round$1(middle)}V${round$1(point.y)}H${round$1(point.x)}`;
|
|
474
478
|
}).join("");
|
|
475
479
|
const tangents = monotoneTangents(points);
|
|
476
480
|
return start + points.slice(1).map((point, index) => {
|
|
@@ -521,6 +525,114 @@ function areaPath(top, bottom, curve = "smooth") {
|
|
|
521
525
|
if (current) runs.push(current);
|
|
522
526
|
return runs.filter((run) => run.top.length > 1).map((run) => `${segment(run.top, curve, true)}${segment([...run.bottom].reverse(), curve, false)}Z`).join("");
|
|
523
527
|
}
|
|
528
|
+
const round = (value) => Math.round(value * 100) / 100;
|
|
529
|
+
const TX_FULL_CIRCLE = Math.PI * 2;
|
|
530
|
+
function toRadians(degrees) {
|
|
531
|
+
return degrees * Math.PI / 180;
|
|
532
|
+
}
|
|
533
|
+
function polar(cx, cy, radius, angle) {
|
|
534
|
+
return {
|
|
535
|
+
x: cx + radius * Math.sin(angle),
|
|
536
|
+
y: cy - radius * Math.cos(angle)
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
function maxCornerRadius(inner, outer, sweep) {
|
|
540
|
+
const half = Math.min(Math.PI / 2, sweep / 2);
|
|
541
|
+
const sin = Math.sin(half);
|
|
542
|
+
const byThickness = inner > 0 ? (outer - inner) / 2 : outer / 2;
|
|
543
|
+
const byOuter = outer * sin / (1 + sin);
|
|
544
|
+
const byInner = inner > 0 && sin < 1 ? inner * sin / (1 - sin) : Infinity;
|
|
545
|
+
return Math.max(0, Math.min(byThickness, byOuter, byInner));
|
|
546
|
+
}
|
|
547
|
+
function arcPath(cx, cy, inner, outer, start, end, corner = 0) {
|
|
548
|
+
const sweep = end - start;
|
|
549
|
+
if (sweep <= 0 || outer <= 0) return "";
|
|
550
|
+
if (sweep >= TX_FULL_CIRCLE - 1e-6) {
|
|
551
|
+
const middle = start + Math.PI;
|
|
552
|
+
return arcPath(cx, cy, inner, outer, start, middle) + arcPath(cx, cy, inner, outer, middle, start + TX_FULL_CIRCLE);
|
|
553
|
+
}
|
|
554
|
+
const radius = Math.min(Math.max(0, corner), maxCornerRadius(inner, outer, sweep));
|
|
555
|
+
if (radius < .5) {
|
|
556
|
+
const large = sweep > Math.PI ? 1 : 0;
|
|
557
|
+
const a = polar(cx, cy, outer, start);
|
|
558
|
+
const b = polar(cx, cy, outer, end);
|
|
559
|
+
const head = `M${round(a.x)},${round(a.y)}A${round(outer)},${round(outer)} 0 ${large} 1 ${round(b.x)},${round(b.y)}`;
|
|
560
|
+
if (inner <= 0) return `${head}L${round(cx)},${round(cy)}Z`;
|
|
561
|
+
const c = polar(cx, cy, inner, end);
|
|
562
|
+
const d = polar(cx, cy, inner, start);
|
|
563
|
+
return `${head}L${round(c.x)},${round(c.y)}A${round(inner)},${round(inner)} 0 ${large} 0 ${round(d.x)},${round(d.y)}Z`;
|
|
564
|
+
}
|
|
565
|
+
const r = round(radius);
|
|
566
|
+
const outerShift = Math.asin(radius / (outer - radius));
|
|
567
|
+
const outerReach = Math.sqrt((outer - radius) ** 2 - radius ** 2);
|
|
568
|
+
const p1 = polar(cx, cy, outerReach, start);
|
|
569
|
+
const p2 = polar(cx, cy, outer, start + outerShift);
|
|
570
|
+
const p3 = polar(cx, cy, outer, end - outerShift);
|
|
571
|
+
const p4 = polar(cx, cy, outerReach, end);
|
|
572
|
+
const outerLarge = end - start - outerShift * 2 > Math.PI ? 1 : 0;
|
|
573
|
+
const head = `M${round(p1.x)},${round(p1.y)}A${r},${r} 0 0 1 ${round(p2.x)},${round(p2.y)}A${round(outer)},${round(outer)} 0 ${outerLarge} 1 ${round(p3.x)},${round(p3.y)}A${r},${r} 0 0 1 ${round(p4.x)},${round(p4.y)}`;
|
|
574
|
+
if (inner <= 0) return `${head}L${round(cx)},${round(cy)}Z`;
|
|
575
|
+
const innerShift = Math.asin(radius / (inner + radius));
|
|
576
|
+
const innerReach = Math.sqrt((inner + radius) ** 2 - radius ** 2);
|
|
577
|
+
const p5 = polar(cx, cy, innerReach, end);
|
|
578
|
+
const p6 = polar(cx, cy, inner, end - innerShift);
|
|
579
|
+
const p7 = polar(cx, cy, inner, start + innerShift);
|
|
580
|
+
const p8 = polar(cx, cy, innerReach, start);
|
|
581
|
+
const innerLarge = end - start - innerShift * 2 > Math.PI ? 1 : 0;
|
|
582
|
+
return `${head}L${round(p5.x)},${round(p5.y)}A${r},${r} 0 0 1 ${round(p6.x)},${round(p6.y)}A${round(inner)},${round(inner)} 0 ${innerLarge} 0 ${round(p7.x)},${round(p7.y)}A${r},${r} 0 0 1 ${round(p8.x)},${round(p8.y)}Z`;
|
|
583
|
+
}
|
|
584
|
+
function arcBounds(start, end) {
|
|
585
|
+
const points = [
|
|
586
|
+
polar(0, 0, 1, start),
|
|
587
|
+
polar(0, 0, 1, end),
|
|
588
|
+
{
|
|
589
|
+
x: 0,
|
|
590
|
+
y: 0
|
|
591
|
+
}
|
|
592
|
+
];
|
|
593
|
+
for (let quarter = Math.ceil(start / (Math.PI / 2)); quarter * (Math.PI / 2) <= end; quarter++) points.push(polar(0, 0, 1, quarter * (Math.PI / 2)));
|
|
594
|
+
return {
|
|
595
|
+
minX: Math.min(...points.map((point) => point.x)),
|
|
596
|
+
maxX: Math.max(...points.map((point) => point.x)),
|
|
597
|
+
minY: Math.min(...points.map((point) => point.y)),
|
|
598
|
+
maxY: Math.max(...points.map((point) => point.y))
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
function arcSpan(startAngle, endAngle) {
|
|
602
|
+
return [toRadians(startAngle), toRadians(Math.max(startAngle, Math.min(startAngle + 360, endAngle)))];
|
|
603
|
+
}
|
|
604
|
+
function fitArc(width, height, startAngle, endAngle, padding) {
|
|
605
|
+
const [start, end] = arcSpan(startAngle, endAngle);
|
|
606
|
+
const bounds = arcBounds(start, end);
|
|
607
|
+
const boxWidth = bounds.maxX - bounds.minX || 1;
|
|
608
|
+
const boxHeight = bounds.maxY - bounds.minY || 1;
|
|
609
|
+
const radius = Math.max(1, Math.min((width - padding * 2) / boxWidth, (height - padding * 2) / boxHeight));
|
|
610
|
+
return {
|
|
611
|
+
cx: width / 2 - (bounds.minX + bounds.maxX) / 2 * radius,
|
|
612
|
+
cy: height / 2 - (bounds.minY + bounds.maxY) / 2 * radius,
|
|
613
|
+
radius
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
function strokeArc(cx, cy, radius, start, end) {
|
|
617
|
+
const sweep = end - start;
|
|
618
|
+
if (sweep <= 0 || radius <= 0) return "";
|
|
619
|
+
if (sweep >= TX_FULL_CIRCLE - 1e-6) {
|
|
620
|
+
const a = polar(cx, cy, radius, start);
|
|
621
|
+
const b = polar(cx, cy, radius, start + Math.PI);
|
|
622
|
+
const r = round(radius);
|
|
623
|
+
return `M${round(a.x)},${round(a.y)}A${r},${r} 0 1 1 ${round(b.x)},${round(b.y)}A${r},${r} 0 1 1 ${round(a.x)},${round(a.y)}`;
|
|
624
|
+
}
|
|
625
|
+
const a = polar(cx, cy, radius, start);
|
|
626
|
+
const b = polar(cx, cy, radius, end);
|
|
627
|
+
const r = round(radius);
|
|
628
|
+
return `M${round(a.x)},${round(a.y)}A${r},${r} 0 ${sweep > Math.PI ? 1 : 0} 1 ${round(b.x)},${round(b.y)}`;
|
|
629
|
+
}
|
|
630
|
+
function angleFrom(x, y, cx, cy, start) {
|
|
631
|
+
let angle = Math.atan2(x - cx, -(y - cy));
|
|
632
|
+
while (angle < start) angle += TX_FULL_CIRCLE;
|
|
633
|
+
while (angle >= start + TX_FULL_CIRCLE) angle -= TX_FULL_CIRCLE;
|
|
634
|
+
return angle;
|
|
635
|
+
}
|
|
524
636
|
function stackValues(series, type = "normal") {
|
|
525
637
|
const length = Math.max(0, ...series.map((values) => values.length));
|
|
526
638
|
const totals = Array.from({ length }, (_, index) => series.reduce((sum, values) => sum + Math.abs(values[index] ?? 0), 0));
|
|
@@ -631,7 +743,7 @@ function seriesColor(color, index) {
|
|
|
631
743
|
return color || chartColor(index);
|
|
632
744
|
}
|
|
633
745
|
const GAP = 8;
|
|
634
|
-
const LABEL_PAD = 10;
|
|
746
|
+
const LABEL_PAD$1 = 10;
|
|
635
747
|
const ROTATE = -45;
|
|
636
748
|
function valueDomain(options, count) {
|
|
637
749
|
const [rawMin, rawMax] = options.extent ?? [0, 1];
|
|
@@ -643,6 +755,44 @@ function valueDomain(options, count) {
|
|
|
643
755
|
const nice = niceDomain(options.min ?? (includeZero ? Math.min(0, rawMin) : rawMin), options.max ?? (includeZero ? Math.max(0, rawMax) : rawMax), count);
|
|
644
756
|
return [options.min ?? nice[0], options.max ?? nice[1]];
|
|
645
757
|
}
|
|
758
|
+
const NICE_STEPS = [
|
|
759
|
+
1,
|
|
760
|
+
2,
|
|
761
|
+
2.5,
|
|
762
|
+
5,
|
|
763
|
+
10
|
|
764
|
+
];
|
|
765
|
+
function niceStepAtLeast(raw) {
|
|
766
|
+
if (!(raw > 0) || !Number.isFinite(raw)) return 1;
|
|
767
|
+
const base = 10 ** Math.floor(Math.log10(raw));
|
|
768
|
+
return (NICE_STEPS.find((step) => step * base >= raw * (1 - 1e-9)) ?? 10) * base;
|
|
769
|
+
}
|
|
770
|
+
function alignedDomain(options, intervals, zeroAt = null) {
|
|
771
|
+
if (intervals < 1 || options.scale === "log" || options.min !== void 0 || options.max !== void 0) return null;
|
|
772
|
+
const [rawMin, rawMax] = options.extent ?? [0, 1];
|
|
773
|
+
const includeZero = options.includeZero ?? true;
|
|
774
|
+
let min = includeZero ? Math.min(0, rawMin) : rawMin;
|
|
775
|
+
let max = includeZero ? Math.max(0, rawMax) : rawMax;
|
|
776
|
+
if (min === max) {
|
|
777
|
+
min = min > 0 ? 0 : min - 1;
|
|
778
|
+
max = max < 0 ? 0 : max + 1;
|
|
779
|
+
}
|
|
780
|
+
const below = zeroAt !== null && zeroAt > 0 && zeroAt < intervals ? zeroAt : null;
|
|
781
|
+
let step = below !== null ? niceStepAtLeast(Math.max(max / (intervals - below), -min / below)) : niceStepAtLeast((max - min) / intervals);
|
|
782
|
+
for (let round = 0; round < 12; round++) {
|
|
783
|
+
const start = below !== null ? -below * step : Math.floor(min / step + 1e-9) * step;
|
|
784
|
+
if (start + intervals * step >= max - 1e-9 && start <= min + 1e-9) {
|
|
785
|
+
const decimals = Math.max(0, -Math.floor(Math.log10(step) + 1e-9) + 1);
|
|
786
|
+
const ticks = Array.from({ length: intervals + 1 }, (_, index) => Number((start + index * step).toFixed(decimals)) || 0);
|
|
787
|
+
return {
|
|
788
|
+
domain: [ticks[0], ticks[intervals]],
|
|
789
|
+
ticks
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
step = niceStepAtLeast(step * 1.0001);
|
|
793
|
+
}
|
|
794
|
+
return null;
|
|
795
|
+
}
|
|
646
796
|
function pickEvery(ticks, every) {
|
|
647
797
|
if (every <= 1) return [...ticks];
|
|
648
798
|
return ticks.filter((_, position) => position % every === 0);
|
|
@@ -661,6 +811,15 @@ function cartesianLayout(options) {
|
|
|
661
811
|
const valueFormat = tickFormatter(options.intl, valueTicks, options.value.format);
|
|
662
812
|
const valueLabels = valueTicks.map((tick) => valueFormat(tick));
|
|
663
813
|
const valueLabelWidth = showValueAxis ? Math.max(0, ...valueLabels.map((label) => textWidth(label, fontSize))) : 0;
|
|
814
|
+
const second = horizontal ? void 0 : options.secondaryValue;
|
|
815
|
+
const evenTicks = valueTicks.length > 1 && valueTicks[0] === domain[0] && valueTicks[valueTicks.length - 1] === domain[1] && options.value.scale !== "log";
|
|
816
|
+
const primaryZero = evenTicks ? valueTicks.indexOf(0) : -1;
|
|
817
|
+
const aligned = second && evenTicks ? alignedDomain(second, valueTicks.length - 1, primaryZero > 0 ? primaryZero : null) : null;
|
|
818
|
+
const secondDomain = second ? aligned?.domain ?? valueDomain(second, tickCount) : null;
|
|
819
|
+
const secondTicks = second && secondDomain ? aligned?.ticks ?? (second.scale === "log" ? logScale(secondDomain, [0, 1]) : linearScale(secondDomain, [0, 1])).ticks(tickCount) : [];
|
|
820
|
+
const secondFormat = tickFormatter(options.intl, secondTicks, second?.format);
|
|
821
|
+
const secondLabels = secondTicks.map((tick) => secondFormat(tick));
|
|
822
|
+
const secondLabelWidth = second ? Math.max(0, ...secondLabels.map((label) => textWidth(label, fontSize))) : 0;
|
|
664
823
|
const cat = options.category;
|
|
665
824
|
const count = cat.count ?? cat.labels?.length ?? 0;
|
|
666
825
|
const maxLabelWidth = cat.maxLabelWidth ?? 220;
|
|
@@ -674,21 +833,22 @@ function cartesianLayout(options) {
|
|
|
674
833
|
let edgeX;
|
|
675
834
|
if (horizontal) {
|
|
676
835
|
const labelWidth = showCategoryAxis ? Math.min(maxLabelWidth, Math.max(0, ...categoryLabelTexts.map((label) => textWidth(label, fontSize)))) : 0;
|
|
677
|
-
ySpace = showCategoryAxis ? labelWidth + LABEL_PAD + 2 : 4;
|
|
836
|
+
ySpace = showCategoryAxis ? labelWidth + LABEL_PAD$1 + 2 : 4;
|
|
678
837
|
xSpace = showValueAxis ? lineHeight + GAP : GAP;
|
|
679
838
|
edgeX = Math.max(12, (showValueAxis ? textWidth(valueLabels[valueLabels.length - 1] ?? "", fontSize) / 2 : 0) + 2);
|
|
680
839
|
if (cat.title && showCategoryAxis) ySpace += titleSpace;
|
|
681
840
|
if (options.value.title && showValueAxis) xSpace += titleSpace;
|
|
682
841
|
} else {
|
|
683
|
-
ySpace = showValueAxis ? valueLabelWidth + LABEL_PAD + 4 : 4;
|
|
842
|
+
ySpace = showValueAxis ? valueLabelWidth + LABEL_PAD$1 + 4 : 4;
|
|
684
843
|
xSpace = showCategoryAxis ? lineHeight + GAP : GAP;
|
|
685
844
|
edgeX = 12;
|
|
686
845
|
if (cat.title && showCategoryAxis) xSpace += titleSpace;
|
|
687
846
|
if (options.value.title && showValueAxis) ySpace += titleSpace;
|
|
688
847
|
}
|
|
689
848
|
const edgeY = horizontal ? 4 : fontSize / 2 + 4;
|
|
690
|
-
|
|
691
|
-
let
|
|
849
|
+
const secondSpace = second ? secondLabelWidth + LABEL_PAD$1 + 4 + (second.title ? titleSpace : 0) : 0;
|
|
850
|
+
let left = yRight ? second ? secondSpace : horizontal ? edgeX : 4 : ySpace;
|
|
851
|
+
let right = yRight ? ySpace : second ? secondSpace : edgeX;
|
|
692
852
|
let top = xTop ? xSpace : edgeY;
|
|
693
853
|
let bottom = xTop ? edgeY : xSpace;
|
|
694
854
|
const plotFor = (b, l, r) => ({
|
|
@@ -768,6 +928,7 @@ function cartesianLayout(options) {
|
|
|
768
928
|
}
|
|
769
929
|
const valueRange = horizontal ? [plot.left, plot.left + plot.width] : [plot.top + plot.height, plot.top];
|
|
770
930
|
const value = options.value.scale === "log" ? logScale(domain, valueRange) : linearScale(domain, valueRange);
|
|
931
|
+
const secondaryValue = second && secondDomain ? second.scale === "log" ? logScale(secondDomain, valueRange) : linearScale(secondDomain, valueRange) : null;
|
|
771
932
|
const grid = [];
|
|
772
933
|
const gridMode = options.grid ?? "value";
|
|
773
934
|
const axes = [];
|
|
@@ -784,7 +945,7 @@ function cartesianLayout(options) {
|
|
|
784
945
|
rotate: 0
|
|
785
946
|
} : {
|
|
786
947
|
text: valueLabels[index],
|
|
787
|
-
x: yRight ? right2 + LABEL_PAD : plot.left - LABEL_PAD,
|
|
948
|
+
x: yRight ? right2 + LABEL_PAD$1 : plot.left - LABEL_PAD$1,
|
|
788
949
|
y: at,
|
|
789
950
|
anchor: yRight ? "start" : "end",
|
|
790
951
|
baseline: "middle",
|
|
@@ -825,11 +986,11 @@ function cartesianLayout(options) {
|
|
|
825
986
|
y: xTop ? lineHeight - 2 : height - 4,
|
|
826
987
|
rotate: 0
|
|
827
988
|
});
|
|
828
|
-
const yTitle = (text) => ({
|
|
989
|
+
const yTitle = (text, onRight = yRight) => ({
|
|
829
990
|
text,
|
|
830
|
-
x:
|
|
991
|
+
x: onRight ? width - lineHeight / 2 - 2 : lineHeight / 2 + 2,
|
|
831
992
|
y: plot.top + plot.height / 2,
|
|
832
|
-
rotate:
|
|
993
|
+
rotate: onRight ? 90 : -90
|
|
833
994
|
});
|
|
834
995
|
if (showValueAxis) axes.push({
|
|
835
996
|
position: horizontal ? xTop ? "top" : "bottom" : yRight ? "right" : "left",
|
|
@@ -837,6 +998,22 @@ function cartesianLayout(options) {
|
|
|
837
998
|
line: null,
|
|
838
999
|
title: options.value.title ? horizontal ? xTitle(options.value.title) : yTitle(options.value.title) : void 0
|
|
839
1000
|
});
|
|
1001
|
+
if (second && secondaryValue) {
|
|
1002
|
+
const onRight = !yRight;
|
|
1003
|
+
axes.push({
|
|
1004
|
+
position: onRight ? "right" : "left",
|
|
1005
|
+
labels: secondTicks.map((tick, index) => ({
|
|
1006
|
+
text: secondLabels[index],
|
|
1007
|
+
x: onRight ? right2 + LABEL_PAD$1 : plot.left - LABEL_PAD$1,
|
|
1008
|
+
y: secondaryValue.map(tick),
|
|
1009
|
+
anchor: onRight ? "start" : "end",
|
|
1010
|
+
baseline: "middle",
|
|
1011
|
+
rotate: 0
|
|
1012
|
+
})),
|
|
1013
|
+
line: null,
|
|
1014
|
+
title: second.title ? yTitle(second.title, onRight) : void 0
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
840
1017
|
if (showCategoryAxis) {
|
|
841
1018
|
const labels = categoryTicks.map((tick) => {
|
|
842
1019
|
const at = position(scale, tick);
|
|
@@ -844,7 +1021,7 @@ function cartesianLayout(options) {
|
|
|
844
1021
|
const text = truncateText(tick.label, maxLabelWidth, fontSize);
|
|
845
1022
|
return {
|
|
846
1023
|
text,
|
|
847
|
-
x: yRight ? right2 + LABEL_PAD : plot.left - LABEL_PAD,
|
|
1024
|
+
x: yRight ? right2 + LABEL_PAD$1 : plot.left - LABEL_PAD$1,
|
|
848
1025
|
y: at,
|
|
849
1026
|
anchor: yRight ? "start" : "end",
|
|
850
1027
|
baseline: "middle",
|
|
@@ -919,8 +1096,10 @@ function cartesianLayout(options) {
|
|
|
919
1096
|
return {
|
|
920
1097
|
plot,
|
|
921
1098
|
value,
|
|
1099
|
+
secondaryValue,
|
|
922
1100
|
category: scale,
|
|
923
1101
|
valueTicks,
|
|
1102
|
+
secondaryValueTicks: secondTicks,
|
|
924
1103
|
axes: {
|
|
925
1104
|
axes,
|
|
926
1105
|
grid,
|
|
@@ -940,14 +1119,14 @@ function chartHeightValue(height, fallback = 350) {
|
|
|
940
1119
|
const pixels = /^(\d+(?:\.\d+)?)px$/.exec(height.trim());
|
|
941
1120
|
return pixels ? Number(pixels[1]) : fallback;
|
|
942
1121
|
}
|
|
943
|
-
function chartBoxHeight(height, legend) {
|
|
1122
|
+
function chartBoxHeight(height, legend, toolbar = false) {
|
|
944
1123
|
const total = chartHeightValue(height);
|
|
945
|
-
return legend === "top" || legend === "bottom" ?
|
|
1124
|
+
return Math.max(1, total - ((legend === "top" || legend === "bottom" ? 1 : 0) + (toolbar && legend !== "top" ? 1 : 0)) * 31);
|
|
946
1125
|
}
|
|
947
|
-
function initialChartSize(height, legend, width = 640) {
|
|
1126
|
+
function initialChartSize(height, legend, width = 640, toolbar = false) {
|
|
948
1127
|
return {
|
|
949
1128
|
width: legend === "left" || legend === "right" ? width - 175 : width,
|
|
950
|
-
height: chartBoxHeight(height, legend)
|
|
1129
|
+
height: chartBoxHeight(height, legend, toolbar)
|
|
951
1130
|
};
|
|
952
1131
|
}
|
|
953
1132
|
const TX_CHART_ENTER_MS = 1100;
|
|
@@ -1158,6 +1337,7 @@ var TxChartLegend = class TxChartLegend {
|
|
|
1158
1337
|
[style.--tx-chart-legend-item-color]="item.color"
|
|
1159
1338
|
[attr.aria-pressed]="!item.hidden"
|
|
1160
1339
|
[attr.data-key]="item.key"
|
|
1340
|
+
[attr.data-marker]="item.marker"
|
|
1161
1341
|
[tabindex]="index === 0 ? 0 : -1"
|
|
1162
1342
|
(click)="toggled.emit(item.key)"
|
|
1163
1343
|
(pointerenter)="hovered.emit(item.key)"
|
|
@@ -1177,6 +1357,7 @@ var TxChartLegend = class TxChartLegend {
|
|
|
1177
1357
|
[style]="itemPart()?.style"
|
|
1178
1358
|
[style.--tx-chart-legend-item-color]="item.color"
|
|
1179
1359
|
[attr.data-key]="item.key"
|
|
1360
|
+
[attr.data-marker]="item.marker"
|
|
1180
1361
|
(pointerenter)="hovered.emit(item.key)"
|
|
1181
1362
|
(pointerleave)="hovered.emit(null)"
|
|
1182
1363
|
>
|
|
@@ -1207,7 +1388,7 @@ var TxChartLegend = class TxChartLegend {
|
|
|
1207
1388
|
</ng-template>
|
|
1208
1389
|
`,
|
|
1209
1390
|
isInline: true,
|
|
1210
|
-
styles: [":host{display:flex;flex-wrap:wrap;align-items:center;min-width:0}:host([data-align=center]){justify-content:center}:host([data-align=end]){justify-content:flex-end}:host([data-position=left]),:host([data-position=right]),:host(.tx-chart-legend--values){flex-direction:column;flex-wrap:nowrap;align-items:stretch}.tx-chart-legend__item{display:inline-flex;align-items:center;min-width:0;margin:0;border:0;background:none;color:inherit;font:inherit;text-align:start;text-transform:inherit;letter-spacing:inherit}button.tx-chart-legend__item{cursor:pointer}.tx-chart-legend__marker{flex-shrink:0;background:var(--tx-chart-legend-item-color)}.tx-chart-legend__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.tx-chart-legend--values) .tx-chart-legend__item{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto}.tx-chart-legend__value,.tx-chart-legend__percent,.tx-chart-legend__stat{font-variant-numeric:tabular-nums;white-space:nowrap}.tx-chart-legend__value,.tx-chart-legend__percent{text-align:end}:host([data-variant=stat]) .tx-chart-legend__item{flex-direction:column;align-items:flex-start}.tx-chart-legend__head{display:inline-flex;align-items:center;max-width:100%}:host([data-styled]){gap:var(--tx-chart-legend-item-gap);color:var(--tx-chart-legend-color);font-size:var(--tx-chart-legend-font-size);font-weight:var(--tx-chart-legend-font-weight);line-height:1.35}:host([data-styled]) .tx-chart-legend__item{gap:var(--tx-chart-legend-marker-gap);padding:var(--tx-chart-legend-padding-y) var(--tx-chart-legend-padding-x);border-radius:var(--tx-chart-legend-border-radius);transition:color var(--tx-chart-motion-hover-duration) ease,opacity var(--tx-chart-motion-hover-duration) ease,background-color var(--tx-chart-motion-hover-duration) ease,box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) button.tx-chart-legend__item:hover{background:var(--tx-chart-legend-hover-background)}:host([data-styled]) button.tx-chart-legend__item:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:0}:host([data-styled]) .tx-chart-legend__marker{width:var(--tx-chart-legend-marker-size);height:var(--tx-chart-legend-marker-size);border-radius:var(--tx-chart-legend-marker-radius);transition:background-color var(--tx-chart-motion-hover-duration) ease,box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-chart-legend__item--hidden{color:var(--tx-chart-legend-muted-color)}:host([data-styled]) .tx-chart-legend__item--hidden .tx-chart-legend__marker{background:transparent;box-shadow:inset 0 0 0 1.5px var(--tx-chart-legend-item-color)}:host([data-styled]) .tx-chart-legend__item--hidden .tx-chart-legend__label{text-decoration:line-through;text-decoration-color:color-mix(in srgb,currentColor 45%,transparent)}:host([data-styled]) .tx-chart-legend__value,:host([data-styled]) .tx-chart-legend__percent{color:var(--tx-chart-legend-value-color);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-chart-legend__value{padding-inline-start:var(--tx-chart-legend-value-gap);color:inherit;font-weight:var(--tx-chart-legend-font-weight)}:host([data-styled]) .tx-chart-legend__percent{min-width:4.5ch;padding-inline-start:var(--tx-chart-legend-percent-gap)}:host([data-styled].tx-chart-legend--values),:host([data-styled][data-position=left]),:host([data-styled][data-position=right]){gap:var(--tx-chart-legend-list-gap)}:host([data-styled][data-variant=line]) .tx-chart-legend__marker{width:var(--tx-chart-legend-line-width);height:var(--tx-chart-legend-line-height);border-radius:var(--tx-radius-full)}:host([data-styled][data-variant=line]) .tx-chart-legend__item--hidden .tx-chart-legend__marker{background:repeating-linear-gradient(90deg,var(--tx-chart-legend-item-color) 0 3px,transparent 3px 5px);box-shadow:none}:host([data-styled][data-variant=pill]){gap:calc(var(--tx-chart-legend-item-gap) + 2px)}:host([data-styled][data-variant=pill]) .tx-chart-legend__item{padding:var(--tx-chart-legend-pill-padding-y) var(--tx-chart-legend-pill-padding-x);border-radius:var(--tx-chart-legend-pill-radius);background:color-mix(in srgb,var(--tx-chart-legend-item-color) var(--tx-chart-legend-pill-tint),transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tx-chart-legend-item-color) 28%,transparent)}:host([data-styled][data-variant=pill]) button.tx-chart-legend__item:hover{background:color-mix(in srgb,var(--tx-chart-legend-item-color) calc(var(--tx-chart-legend-pill-tint) + 8%),transparent)}:host([data-styled][data-variant=pill]) .tx-chart-legend__item--hidden,:host([data-styled][data-variant=pill]) button.tx-chart-legend__item--hidden:hover{background:transparent;box-shadow:inset 0 0 0 1px var(--tx-chart-legend-pill-border-color)}:host([data-styled][data-variant=stat]){gap:var(--tx-chart-legend-item-gap);align-items:stretch}:host([data-styled][data-variant=stat]) .tx-chart-legend__item{gap:2px;min-width:var(--tx-chart-legend-stat-min-width);padding:var(--tx-chart-legend-stat-padding-y) var(--tx-chart-legend-stat-padding-x);border-radius:var(--tx-chart-legend-stat-radius)}:host([data-styled][data-variant=stat]) .tx-chart-legend__head{gap:var(--tx-chart-legend-marker-gap);color:var(--tx-chart-legend-muted-color);font-size:var(--tx-chart-legend-stat-label-font-size)}:host([data-styled][data-variant=stat]) .tx-chart-legend__stat{font-size:var(--tx-chart-legend-stat-value-font-size);font-weight:var(--tx-chart-legend-stat-value-font-weight);line-height:1.2}:host([data-styled][data-variant=stat]) .tx-chart-legend__caption{color:var(--tx-chart-legend-muted-color);font-size:var(--tx-chart-legend-stat-label-font-size);font-weight:var(--tx-font-weight-regular)}:host([data-styled][data-variant=stat]) .tx-chart-legend__item--hidden{opacity:var(--tx-chart-legend-hidden-opacity)}:host([data-styled][data-variant=stat]) .tx-chart-legend__item--hidden .tx-chart-legend__label{text-decoration:none}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-chart-legend__item,:host([data-styled]) .tx-chart-legend__marker{transition:none}}\n"],
|
|
1391
|
+
styles: [":host{display:flex;flex-wrap:wrap;align-items:center;min-width:0}:host([data-align=center]){justify-content:center}:host([data-align=end]){justify-content:flex-end}:host([data-position=left]),:host([data-position=right]),:host(.tx-chart-legend--values){flex-direction:column;flex-wrap:nowrap;align-items:stretch}.tx-chart-legend__item{display:inline-flex;align-items:center;min-width:0;margin:0;border:0;background:none;color:inherit;font:inherit;text-align:start;text-transform:inherit;letter-spacing:inherit}button.tx-chart-legend__item{cursor:pointer}.tx-chart-legend__marker{flex-shrink:0;background:var(--tx-chart-legend-item-color)}.tx-chart-legend__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.tx-chart-legend--values) .tx-chart-legend__item{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto}.tx-chart-legend__value,.tx-chart-legend__percent,.tx-chart-legend__stat{font-variant-numeric:tabular-nums;white-space:nowrap}.tx-chart-legend__value,.tx-chart-legend__percent{text-align:end}:host([data-variant=stat]) .tx-chart-legend__item{flex-direction:column;align-items:flex-start}.tx-chart-legend__head{display:inline-flex;align-items:center;max-width:100%}:host([data-styled]){gap:var(--tx-chart-legend-item-gap);color:var(--tx-chart-legend-color);font-size:var(--tx-chart-legend-font-size);font-weight:var(--tx-chart-legend-font-weight);line-height:1.35}:host([data-styled]) .tx-chart-legend__item{gap:var(--tx-chart-legend-marker-gap);padding:var(--tx-chart-legend-padding-y) var(--tx-chart-legend-padding-x);border-radius:var(--tx-chart-legend-border-radius);transition:color var(--tx-chart-motion-hover-duration) ease,opacity var(--tx-chart-motion-hover-duration) ease,background-color var(--tx-chart-motion-hover-duration) ease,box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) button.tx-chart-legend__item:hover{background:var(--tx-chart-legend-hover-background)}:host([data-styled]) button.tx-chart-legend__item:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:0}:host([data-styled]) .tx-chart-legend__marker{width:var(--tx-chart-legend-marker-size);height:var(--tx-chart-legend-marker-size);border-radius:var(--tx-chart-legend-marker-radius);transition:background-color var(--tx-chart-motion-hover-duration) ease,box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-chart-legend__item--hidden{color:var(--tx-chart-legend-muted-color)}:host([data-styled]) .tx-chart-legend__item--hidden .tx-chart-legend__marker{background:transparent;box-shadow:inset 0 0 0 1.5px var(--tx-chart-legend-item-color)}:host([data-styled]) .tx-chart-legend__item--hidden .tx-chart-legend__label{text-decoration:line-through;text-decoration-color:color-mix(in srgb,currentColor 45%,transparent)}:host([data-styled]) .tx-chart-legend__value,:host([data-styled]) .tx-chart-legend__percent{color:var(--tx-chart-legend-value-color);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-chart-legend__value{padding-inline-start:var(--tx-chart-legend-value-gap);color:inherit;font-weight:var(--tx-chart-legend-font-weight)}:host([data-styled]) .tx-chart-legend__percent{min-width:4.5ch;padding-inline-start:var(--tx-chart-legend-percent-gap)}:host([data-styled].tx-chart-legend--values),:host([data-styled][data-position=left]),:host([data-styled][data-position=right]){gap:var(--tx-chart-legend-list-gap)}:host([data-styled][data-variant=line]) .tx-chart-legend__marker,:host([data-styled]:not([data-variant=stat])) .tx-chart-legend__item[data-marker=line] .tx-chart-legend__marker{width:var(--tx-chart-legend-line-width);height:var(--tx-chart-legend-line-height);border-radius:var(--tx-radius-full)}:host([data-styled][data-variant=line]) .tx-chart-legend__item--hidden .tx-chart-legend__marker,:host([data-styled]:not([data-variant=stat])) .tx-chart-legend__item--hidden[data-marker=line] .tx-chart-legend__marker{background:repeating-linear-gradient(90deg,var(--tx-chart-legend-item-color) 0 3px,transparent 3px 5px);box-shadow:none}:host([data-styled][data-variant=pill]){gap:calc(var(--tx-chart-legend-item-gap) + 2px)}:host([data-styled][data-variant=pill]) .tx-chart-legend__item{padding:var(--tx-chart-legend-pill-padding-y) var(--tx-chart-legend-pill-padding-x);border-radius:var(--tx-chart-legend-pill-radius);background:color-mix(in srgb,var(--tx-chart-legend-item-color) var(--tx-chart-legend-pill-tint),transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tx-chart-legend-item-color) 28%,transparent)}:host([data-styled][data-variant=pill]) button.tx-chart-legend__item:hover{background:color-mix(in srgb,var(--tx-chart-legend-item-color) calc(var(--tx-chart-legend-pill-tint) + 8%),transparent)}:host([data-styled][data-variant=pill]) .tx-chart-legend__item--hidden,:host([data-styled][data-variant=pill]) button.tx-chart-legend__item--hidden:hover{background:transparent;box-shadow:inset 0 0 0 1px var(--tx-chart-legend-pill-border-color)}:host([data-styled][data-variant=stat]){gap:var(--tx-chart-legend-item-gap);align-items:stretch}:host([data-styled][data-variant=stat]) .tx-chart-legend__item{gap:2px;min-width:var(--tx-chart-legend-stat-min-width);padding:var(--tx-chart-legend-stat-padding-y) var(--tx-chart-legend-stat-padding-x);border-radius:var(--tx-chart-legend-stat-radius)}:host([data-styled][data-variant=stat]) .tx-chart-legend__head{gap:var(--tx-chart-legend-marker-gap);color:var(--tx-chart-legend-muted-color);font-size:var(--tx-chart-legend-stat-label-font-size)}:host([data-styled][data-variant=stat]) .tx-chart-legend__stat{font-size:var(--tx-chart-legend-stat-value-font-size);font-weight:var(--tx-chart-legend-stat-value-font-weight);line-height:1.2}:host([data-styled][data-variant=stat]) .tx-chart-legend__caption{color:var(--tx-chart-legend-muted-color);font-size:var(--tx-chart-legend-stat-label-font-size);font-weight:var(--tx-font-weight-regular)}:host([data-styled][data-variant=stat]) .tx-chart-legend__item--hidden{opacity:var(--tx-chart-legend-hidden-opacity)}:host([data-styled][data-variant=stat]) .tx-chart-legend__item--hidden .tx-chart-legend__label{text-decoration:none}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-chart-legend__item,:host([data-styled]) .tx-chart-legend__marker{transition:none}}\n"],
|
|
1211
1392
|
dependencies: [{
|
|
1212
1393
|
kind: "directive",
|
|
1213
1394
|
type: NgTemplateOutlet,
|
|
@@ -1243,6 +1424,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1243
1424
|
[style.--tx-chart-legend-item-color]="item.color"
|
|
1244
1425
|
[attr.aria-pressed]="!item.hidden"
|
|
1245
1426
|
[attr.data-key]="item.key"
|
|
1427
|
+
[attr.data-marker]="item.marker"
|
|
1246
1428
|
[tabindex]="index === 0 ? 0 : -1"
|
|
1247
1429
|
(click)="toggled.emit(item.key)"
|
|
1248
1430
|
(pointerenter)="hovered.emit(item.key)"
|
|
@@ -1262,6 +1444,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1262
1444
|
[style]="itemPart()?.style"
|
|
1263
1445
|
[style.--tx-chart-legend-item-color]="item.color"
|
|
1264
1446
|
[attr.data-key]="item.key"
|
|
1447
|
+
[attr.data-marker]="item.marker"
|
|
1265
1448
|
(pointerenter)="hovered.emit(item.key)"
|
|
1266
1449
|
(pointerleave)="hovered.emit(null)"
|
|
1267
1450
|
>
|
|
@@ -1301,7 +1484,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1301
1484
|
"[attr.data-variant]": "variant()",
|
|
1302
1485
|
"[class.tx-chart-legend--values]": "hasValues()"
|
|
1303
1486
|
},
|
|
1304
|
-
styles: [":host{display:flex;flex-wrap:wrap;align-items:center;min-width:0}:host([data-align=center]){justify-content:center}:host([data-align=end]){justify-content:flex-end}:host([data-position=left]),:host([data-position=right]),:host(.tx-chart-legend--values){flex-direction:column;flex-wrap:nowrap;align-items:stretch}.tx-chart-legend__item{display:inline-flex;align-items:center;min-width:0;margin:0;border:0;background:none;color:inherit;font:inherit;text-align:start;text-transform:inherit;letter-spacing:inherit}button.tx-chart-legend__item{cursor:pointer}.tx-chart-legend__marker{flex-shrink:0;background:var(--tx-chart-legend-item-color)}.tx-chart-legend__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.tx-chart-legend--values) .tx-chart-legend__item{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto}.tx-chart-legend__value,.tx-chart-legend__percent,.tx-chart-legend__stat{font-variant-numeric:tabular-nums;white-space:nowrap}.tx-chart-legend__value,.tx-chart-legend__percent{text-align:end}:host([data-variant=stat]) .tx-chart-legend__item{flex-direction:column;align-items:flex-start}.tx-chart-legend__head{display:inline-flex;align-items:center;max-width:100%}:host([data-styled]){gap:var(--tx-chart-legend-item-gap);color:var(--tx-chart-legend-color);font-size:var(--tx-chart-legend-font-size);font-weight:var(--tx-chart-legend-font-weight);line-height:1.35}:host([data-styled]) .tx-chart-legend__item{gap:var(--tx-chart-legend-marker-gap);padding:var(--tx-chart-legend-padding-y) var(--tx-chart-legend-padding-x);border-radius:var(--tx-chart-legend-border-radius);transition:color var(--tx-chart-motion-hover-duration) ease,opacity var(--tx-chart-motion-hover-duration) ease,background-color var(--tx-chart-motion-hover-duration) ease,box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) button.tx-chart-legend__item:hover{background:var(--tx-chart-legend-hover-background)}:host([data-styled]) button.tx-chart-legend__item:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:0}:host([data-styled]) .tx-chart-legend__marker{width:var(--tx-chart-legend-marker-size);height:var(--tx-chart-legend-marker-size);border-radius:var(--tx-chart-legend-marker-radius);transition:background-color var(--tx-chart-motion-hover-duration) ease,box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-chart-legend__item--hidden{color:var(--tx-chart-legend-muted-color)}:host([data-styled]) .tx-chart-legend__item--hidden .tx-chart-legend__marker{background:transparent;box-shadow:inset 0 0 0 1.5px var(--tx-chart-legend-item-color)}:host([data-styled]) .tx-chart-legend__item--hidden .tx-chart-legend__label{text-decoration:line-through;text-decoration-color:color-mix(in srgb,currentColor 45%,transparent)}:host([data-styled]) .tx-chart-legend__value,:host([data-styled]) .tx-chart-legend__percent{color:var(--tx-chart-legend-value-color);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-chart-legend__value{padding-inline-start:var(--tx-chart-legend-value-gap);color:inherit;font-weight:var(--tx-chart-legend-font-weight)}:host([data-styled]) .tx-chart-legend__percent{min-width:4.5ch;padding-inline-start:var(--tx-chart-legend-percent-gap)}:host([data-styled].tx-chart-legend--values),:host([data-styled][data-position=left]),:host([data-styled][data-position=right]){gap:var(--tx-chart-legend-list-gap)}:host([data-styled][data-variant=line]) .tx-chart-legend__marker{width:var(--tx-chart-legend-line-width);height:var(--tx-chart-legend-line-height);border-radius:var(--tx-radius-full)}:host([data-styled][data-variant=line]) .tx-chart-legend__item--hidden .tx-chart-legend__marker{background:repeating-linear-gradient(90deg,var(--tx-chart-legend-item-color) 0 3px,transparent 3px 5px);box-shadow:none}:host([data-styled][data-variant=pill]){gap:calc(var(--tx-chart-legend-item-gap) + 2px)}:host([data-styled][data-variant=pill]) .tx-chart-legend__item{padding:var(--tx-chart-legend-pill-padding-y) var(--tx-chart-legend-pill-padding-x);border-radius:var(--tx-chart-legend-pill-radius);background:color-mix(in srgb,var(--tx-chart-legend-item-color) var(--tx-chart-legend-pill-tint),transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tx-chart-legend-item-color) 28%,transparent)}:host([data-styled][data-variant=pill]) button.tx-chart-legend__item:hover{background:color-mix(in srgb,var(--tx-chart-legend-item-color) calc(var(--tx-chart-legend-pill-tint) + 8%),transparent)}:host([data-styled][data-variant=pill]) .tx-chart-legend__item--hidden,:host([data-styled][data-variant=pill]) button.tx-chart-legend__item--hidden:hover{background:transparent;box-shadow:inset 0 0 0 1px var(--tx-chart-legend-pill-border-color)}:host([data-styled][data-variant=stat]){gap:var(--tx-chart-legend-item-gap);align-items:stretch}:host([data-styled][data-variant=stat]) .tx-chart-legend__item{gap:2px;min-width:var(--tx-chart-legend-stat-min-width);padding:var(--tx-chart-legend-stat-padding-y) var(--tx-chart-legend-stat-padding-x);border-radius:var(--tx-chart-legend-stat-radius)}:host([data-styled][data-variant=stat]) .tx-chart-legend__head{gap:var(--tx-chart-legend-marker-gap);color:var(--tx-chart-legend-muted-color);font-size:var(--tx-chart-legend-stat-label-font-size)}:host([data-styled][data-variant=stat]) .tx-chart-legend__stat{font-size:var(--tx-chart-legend-stat-value-font-size);font-weight:var(--tx-chart-legend-stat-value-font-weight);line-height:1.2}:host([data-styled][data-variant=stat]) .tx-chart-legend__caption{color:var(--tx-chart-legend-muted-color);font-size:var(--tx-chart-legend-stat-label-font-size);font-weight:var(--tx-font-weight-regular)}:host([data-styled][data-variant=stat]) .tx-chart-legend__item--hidden{opacity:var(--tx-chart-legend-hidden-opacity)}:host([data-styled][data-variant=stat]) .tx-chart-legend__item--hidden .tx-chart-legend__label{text-decoration:none}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-chart-legend__item,:host([data-styled]) .tx-chart-legend__marker{transition:none}}\n"]
|
|
1487
|
+
styles: [":host{display:flex;flex-wrap:wrap;align-items:center;min-width:0}:host([data-align=center]){justify-content:center}:host([data-align=end]){justify-content:flex-end}:host([data-position=left]),:host([data-position=right]),:host(.tx-chart-legend--values){flex-direction:column;flex-wrap:nowrap;align-items:stretch}.tx-chart-legend__item{display:inline-flex;align-items:center;min-width:0;margin:0;border:0;background:none;color:inherit;font:inherit;text-align:start;text-transform:inherit;letter-spacing:inherit}button.tx-chart-legend__item{cursor:pointer}.tx-chart-legend__marker{flex-shrink:0;background:var(--tx-chart-legend-item-color)}.tx-chart-legend__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.tx-chart-legend--values) .tx-chart-legend__item{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto}.tx-chart-legend__value,.tx-chart-legend__percent,.tx-chart-legend__stat{font-variant-numeric:tabular-nums;white-space:nowrap}.tx-chart-legend__value,.tx-chart-legend__percent{text-align:end}:host([data-variant=stat]) .tx-chart-legend__item{flex-direction:column;align-items:flex-start}.tx-chart-legend__head{display:inline-flex;align-items:center;max-width:100%}:host([data-styled]){gap:var(--tx-chart-legend-item-gap);color:var(--tx-chart-legend-color);font-size:var(--tx-chart-legend-font-size);font-weight:var(--tx-chart-legend-font-weight);line-height:1.35}:host([data-styled]) .tx-chart-legend__item{gap:var(--tx-chart-legend-marker-gap);padding:var(--tx-chart-legend-padding-y) var(--tx-chart-legend-padding-x);border-radius:var(--tx-chart-legend-border-radius);transition:color var(--tx-chart-motion-hover-duration) ease,opacity var(--tx-chart-motion-hover-duration) ease,background-color var(--tx-chart-motion-hover-duration) ease,box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) button.tx-chart-legend__item:hover{background:var(--tx-chart-legend-hover-background)}:host([data-styled]) button.tx-chart-legend__item:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:0}:host([data-styled]) .tx-chart-legend__marker{width:var(--tx-chart-legend-marker-size);height:var(--tx-chart-legend-marker-size);border-radius:var(--tx-chart-legend-marker-radius);transition:background-color var(--tx-chart-motion-hover-duration) ease,box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-chart-legend__item--hidden{color:var(--tx-chart-legend-muted-color)}:host([data-styled]) .tx-chart-legend__item--hidden .tx-chart-legend__marker{background:transparent;box-shadow:inset 0 0 0 1.5px var(--tx-chart-legend-item-color)}:host([data-styled]) .tx-chart-legend__item--hidden .tx-chart-legend__label{text-decoration:line-through;text-decoration-color:color-mix(in srgb,currentColor 45%,transparent)}:host([data-styled]) .tx-chart-legend__value,:host([data-styled]) .tx-chart-legend__percent{color:var(--tx-chart-legend-value-color);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-chart-legend__value{padding-inline-start:var(--tx-chart-legend-value-gap);color:inherit;font-weight:var(--tx-chart-legend-font-weight)}:host([data-styled]) .tx-chart-legend__percent{min-width:4.5ch;padding-inline-start:var(--tx-chart-legend-percent-gap)}:host([data-styled].tx-chart-legend--values),:host([data-styled][data-position=left]),:host([data-styled][data-position=right]){gap:var(--tx-chart-legend-list-gap)}:host([data-styled][data-variant=line]) .tx-chart-legend__marker,:host([data-styled]:not([data-variant=stat])) .tx-chart-legend__item[data-marker=line] .tx-chart-legend__marker{width:var(--tx-chart-legend-line-width);height:var(--tx-chart-legend-line-height);border-radius:var(--tx-radius-full)}:host([data-styled][data-variant=line]) .tx-chart-legend__item--hidden .tx-chart-legend__marker,:host([data-styled]:not([data-variant=stat])) .tx-chart-legend__item--hidden[data-marker=line] .tx-chart-legend__marker{background:repeating-linear-gradient(90deg,var(--tx-chart-legend-item-color) 0 3px,transparent 3px 5px);box-shadow:none}:host([data-styled][data-variant=pill]){gap:calc(var(--tx-chart-legend-item-gap) + 2px)}:host([data-styled][data-variant=pill]) .tx-chart-legend__item{padding:var(--tx-chart-legend-pill-padding-y) var(--tx-chart-legend-pill-padding-x);border-radius:var(--tx-chart-legend-pill-radius);background:color-mix(in srgb,var(--tx-chart-legend-item-color) var(--tx-chart-legend-pill-tint),transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tx-chart-legend-item-color) 28%,transparent)}:host([data-styled][data-variant=pill]) button.tx-chart-legend__item:hover{background:color-mix(in srgb,var(--tx-chart-legend-item-color) calc(var(--tx-chart-legend-pill-tint) + 8%),transparent)}:host([data-styled][data-variant=pill]) .tx-chart-legend__item--hidden,:host([data-styled][data-variant=pill]) button.tx-chart-legend__item--hidden:hover{background:transparent;box-shadow:inset 0 0 0 1px var(--tx-chart-legend-pill-border-color)}:host([data-styled][data-variant=stat]){gap:var(--tx-chart-legend-item-gap);align-items:stretch}:host([data-styled][data-variant=stat]) .tx-chart-legend__item{gap:2px;min-width:var(--tx-chart-legend-stat-min-width);padding:var(--tx-chart-legend-stat-padding-y) var(--tx-chart-legend-stat-padding-x);border-radius:var(--tx-chart-legend-stat-radius)}:host([data-styled][data-variant=stat]) .tx-chart-legend__head{gap:var(--tx-chart-legend-marker-gap);color:var(--tx-chart-legend-muted-color);font-size:var(--tx-chart-legend-stat-label-font-size)}:host([data-styled][data-variant=stat]) .tx-chart-legend__stat{font-size:var(--tx-chart-legend-stat-value-font-size);font-weight:var(--tx-chart-legend-stat-value-font-weight);line-height:1.2}:host([data-styled][data-variant=stat]) .tx-chart-legend__caption{color:var(--tx-chart-legend-muted-color);font-size:var(--tx-chart-legend-stat-label-font-size);font-weight:var(--tx-font-weight-regular)}:host([data-styled][data-variant=stat]) .tx-chart-legend__item--hidden{opacity:var(--tx-chart-legend-hidden-opacity)}:host([data-styled][data-variant=stat]) .tx-chart-legend__item--hidden .tx-chart-legend__label{text-decoration:none}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-chart-legend__item,:host([data-styled]) .tx-chart-legend__marker{transition:none}}\n"]
|
|
1305
1488
|
}]
|
|
1306
1489
|
}],
|
|
1307
1490
|
propDecorators: {
|
|
@@ -1555,7 +1738,763 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1555
1738
|
}]
|
|
1556
1739
|
}
|
|
1557
1740
|
});
|
|
1741
|
+
function chartBandRect(band, index, plot, horizontal = false, inset = 2) {
|
|
1742
|
+
const gap = Math.min(inset, band.step * .08);
|
|
1743
|
+
const start = band.start(index) - (band.step - band.bandwidth) / 2 + gap;
|
|
1744
|
+
const size = Math.max(1, band.step - gap * 2);
|
|
1745
|
+
return horizontal ? {
|
|
1746
|
+
x: plot.left,
|
|
1747
|
+
y: start,
|
|
1748
|
+
width: plot.width,
|
|
1749
|
+
height: size
|
|
1750
|
+
} : {
|
|
1751
|
+
x: start,
|
|
1752
|
+
y: plot.top,
|
|
1753
|
+
width: size,
|
|
1754
|
+
height: plot.height
|
|
1755
|
+
};
|
|
1756
|
+
}
|
|
1757
|
+
var TxChartHoverBand = class TxChartHoverBand {
|
|
1758
|
+
rect = input(null, {
|
|
1759
|
+
...ngDevMode ? { debugName: "rect" } : /* istanbul ignore next */ {},
|
|
1760
|
+
alias: "tx-chart-hover-band"
|
|
1761
|
+
});
|
|
1762
|
+
part = input(void 0, ...ngDevMode ? [{ debugName: "part" }] : /* istanbul ignore next */ []);
|
|
1763
|
+
state = linkedSignal({
|
|
1764
|
+
...ngDevMode ? { debugName: "state" } : /* istanbul ignore next */ {},
|
|
1765
|
+
source: this.rect,
|
|
1766
|
+
computation: (next, previous) => ({
|
|
1767
|
+
rect: next ?? previous?.value.rect ?? null,
|
|
1768
|
+
slide: !!next && !!previous?.source
|
|
1769
|
+
})
|
|
1770
|
+
});
|
|
1771
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1772
|
+
minVersion: "12.0.0",
|
|
1773
|
+
version: "22.2.3",
|
|
1774
|
+
ngImport: i0,
|
|
1775
|
+
type: TxChartHoverBand,
|
|
1776
|
+
deps: [],
|
|
1777
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1778
|
+
});
|
|
1779
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1780
|
+
minVersion: "17.0.0",
|
|
1781
|
+
version: "22.2.3",
|
|
1782
|
+
type: TxChartHoverBand,
|
|
1783
|
+
isStandalone: true,
|
|
1784
|
+
selector: "g[tx-chart-hover-band]",
|
|
1785
|
+
inputs: {
|
|
1786
|
+
rect: {
|
|
1787
|
+
classPropertyName: "rect",
|
|
1788
|
+
publicName: "tx-chart-hover-band",
|
|
1789
|
+
isSignal: true,
|
|
1790
|
+
isRequired: false,
|
|
1791
|
+
transformFunction: null
|
|
1792
|
+
},
|
|
1793
|
+
part: {
|
|
1794
|
+
classPropertyName: "part",
|
|
1795
|
+
publicName: "part",
|
|
1796
|
+
isSignal: true,
|
|
1797
|
+
isRequired: false,
|
|
1798
|
+
transformFunction: null
|
|
1799
|
+
}
|
|
1800
|
+
},
|
|
1801
|
+
host: {
|
|
1802
|
+
attributes: { "aria-hidden": "true" },
|
|
1803
|
+
classAttribute: "tx-chart-hover-band-layer"
|
|
1804
|
+
},
|
|
1805
|
+
ngImport: i0,
|
|
1806
|
+
template: `
|
|
1807
|
+
@if (state().rect; as box) {
|
|
1808
|
+
<svg:rect
|
|
1809
|
+
class="tx-chart-hover-band"
|
|
1810
|
+
[class.tx-chart-hover-band--on]="!!rect()"
|
|
1811
|
+
[class.tx-chart-hover-band--slide]="state().slide"
|
|
1812
|
+
[class]="part()?.class"
|
|
1813
|
+
[style]="part()?.style"
|
|
1814
|
+
[attr.x]="box.x"
|
|
1815
|
+
[attr.y]="box.y"
|
|
1816
|
+
[attr.width]="box.width"
|
|
1817
|
+
[attr.height]="box.height"
|
|
1818
|
+
/>
|
|
1819
|
+
}
|
|
1820
|
+
`,
|
|
1821
|
+
isInline: true,
|
|
1822
|
+
styles: [".tx-chart-hover-band{fill:currentColor;opacity:0;pointer-events:none}.tx-chart-hover-band--on{opacity:.08}:host-context([data-styled]) .tx-chart-hover-band{fill:var(--tx-chart-hover-band-color);rx:var(--tx-chart-hover-band-radius);transition:opacity var(--tx-chart-motion-hover-duration) ease}:host-context([data-styled]) .tx-chart-hover-band--on{opacity:1}:host-context([data-styled]) .tx-chart-hover-band--slide{transition:opacity var(--tx-chart-motion-hover-duration) ease,x var(--tx-chart-motion-hover-duration) var(--tx-chart-motion-easing),y var(--tx-chart-motion-hover-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-hover-duration) var(--tx-chart-motion-easing),height var(--tx-chart-motion-hover-duration) var(--tx-chart-motion-easing)}@media(prefers-reduced-motion:reduce){:host-context([data-styled]) .tx-chart-hover-band{transition:none}}\n"],
|
|
1823
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1824
|
+
});
|
|
1825
|
+
};
|
|
1826
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1827
|
+
minVersion: "12.0.0",
|
|
1828
|
+
version: "22.2.3",
|
|
1829
|
+
ngImport: i0,
|
|
1830
|
+
type: TxChartHoverBand,
|
|
1831
|
+
decorators: [{
|
|
1832
|
+
type: Component,
|
|
1833
|
+
args: [{
|
|
1834
|
+
selector: "g[tx-chart-hover-band]",
|
|
1835
|
+
template: `
|
|
1836
|
+
@if (state().rect; as box) {
|
|
1837
|
+
<svg:rect
|
|
1838
|
+
class="tx-chart-hover-band"
|
|
1839
|
+
[class.tx-chart-hover-band--on]="!!rect()"
|
|
1840
|
+
[class.tx-chart-hover-band--slide]="state().slide"
|
|
1841
|
+
[class]="part()?.class"
|
|
1842
|
+
[style]="part()?.style"
|
|
1843
|
+
[attr.x]="box.x"
|
|
1844
|
+
[attr.y]="box.y"
|
|
1845
|
+
[attr.width]="box.width"
|
|
1846
|
+
[attr.height]="box.height"
|
|
1847
|
+
/>
|
|
1848
|
+
}
|
|
1849
|
+
`,
|
|
1850
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1851
|
+
host: {
|
|
1852
|
+
class: "tx-chart-hover-band-layer",
|
|
1853
|
+
"aria-hidden": "true"
|
|
1854
|
+
},
|
|
1855
|
+
styles: [".tx-chart-hover-band{fill:currentColor;opacity:0;pointer-events:none}.tx-chart-hover-band--on{opacity:.08}:host-context([data-styled]) .tx-chart-hover-band{fill:var(--tx-chart-hover-band-color);rx:var(--tx-chart-hover-band-radius);transition:opacity var(--tx-chart-motion-hover-duration) ease}:host-context([data-styled]) .tx-chart-hover-band--on{opacity:1}:host-context([data-styled]) .tx-chart-hover-band--slide{transition:opacity var(--tx-chart-motion-hover-duration) ease,x var(--tx-chart-motion-hover-duration) var(--tx-chart-motion-easing),y var(--tx-chart-motion-hover-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-hover-duration) var(--tx-chart-motion-easing),height var(--tx-chart-motion-hover-duration) var(--tx-chart-motion-easing)}@media(prefers-reduced-motion:reduce){:host-context([data-styled]) .tx-chart-hover-band{transition:none}}\n"]
|
|
1856
|
+
}]
|
|
1857
|
+
}],
|
|
1858
|
+
propDecorators: {
|
|
1859
|
+
rect: [{
|
|
1860
|
+
type: i0.Input,
|
|
1861
|
+
args: [{
|
|
1862
|
+
isSignal: true,
|
|
1863
|
+
alias: "tx-chart-hover-band",
|
|
1864
|
+
required: false
|
|
1865
|
+
}]
|
|
1866
|
+
}],
|
|
1867
|
+
part: [{
|
|
1868
|
+
type: i0.Input,
|
|
1869
|
+
args: [{
|
|
1870
|
+
isSignal: true,
|
|
1871
|
+
alias: "part",
|
|
1872
|
+
required: false
|
|
1873
|
+
}]
|
|
1874
|
+
}]
|
|
1875
|
+
}
|
|
1876
|
+
});
|
|
1877
|
+
const LABEL_FONT = 11;
|
|
1878
|
+
const LABEL_HEIGHT = 18;
|
|
1879
|
+
const LABEL_GAP = 4;
|
|
1880
|
+
function chartCategoryIndex(value, labels) {
|
|
1881
|
+
if (typeof value === "number") return Number.isInteger(value) && value >= 0 && value < labels.length ? value : -1;
|
|
1882
|
+
return labels.indexOf(value instanceof Date ? value.toISOString() : String(value));
|
|
1883
|
+
}
|
|
1884
|
+
function colorOf(item) {
|
|
1885
|
+
return item.color ?? `var(--tx-chart-annotation-${item.tone ?? "neutral"}-color)`;
|
|
1886
|
+
}
|
|
1887
|
+
function clamp(value, min, max) {
|
|
1888
|
+
return Math.max(min, Math.min(max, value));
|
|
1889
|
+
}
|
|
1890
|
+
function chartAnnotationShapes(list, mapping) {
|
|
1891
|
+
const { plot } = mapping;
|
|
1892
|
+
const left = plot.left;
|
|
1893
|
+
const right = plot.left + plot.width;
|
|
1894
|
+
const top = plot.top;
|
|
1895
|
+
const bottom = plot.top + plot.height;
|
|
1896
|
+
const pill = (text, x, y, anchor) => {
|
|
1897
|
+
if (!text) return null;
|
|
1898
|
+
const width = textWidth(text, LABEL_FONT) + 12;
|
|
1899
|
+
return {
|
|
1900
|
+
text,
|
|
1901
|
+
x: clamp(anchor === "start" ? x : anchor === "end" ? x - width : x - width / 2, left, Math.max(left, right - width)),
|
|
1902
|
+
y: clamp(y, top, Math.max(top, bottom - LABEL_HEIGHT)),
|
|
1903
|
+
width,
|
|
1904
|
+
height: LABEL_HEIGHT,
|
|
1905
|
+
anchor
|
|
1906
|
+
};
|
|
1907
|
+
};
|
|
1908
|
+
const along = (value) => mapping.x(value);
|
|
1909
|
+
const across = (value, axis = "primary") => mapping.y(value, axis);
|
|
1910
|
+
const shapes = [];
|
|
1911
|
+
(list ?? []).forEach((item, index) => {
|
|
1912
|
+
const color = colorOf(item);
|
|
1913
|
+
const key = `${index}:${item.type}`;
|
|
1914
|
+
if (item.type === "x-line" || item.type === "y-line") {
|
|
1915
|
+
const value = item.type === "x-line" ? along(item.x) : across(item.y, item.axis);
|
|
1916
|
+
if (value === null) return;
|
|
1917
|
+
if (item.type === "x-line" !== !!mapping.horizontal) {
|
|
1918
|
+
if (value < left - .5 || value > right + .5) return;
|
|
1919
|
+
shapes.push({
|
|
1920
|
+
key,
|
|
1921
|
+
kind: "line",
|
|
1922
|
+
color,
|
|
1923
|
+
x1: value,
|
|
1924
|
+
y1: top,
|
|
1925
|
+
x2: value,
|
|
1926
|
+
y2: bottom,
|
|
1927
|
+
label: pill(item.label, value + LABEL_GAP, top + LABEL_GAP, "start")
|
|
1928
|
+
});
|
|
1929
|
+
} else {
|
|
1930
|
+
if (value < top - .5 || value > bottom + .5) return;
|
|
1931
|
+
shapes.push({
|
|
1932
|
+
key,
|
|
1933
|
+
kind: "line",
|
|
1934
|
+
color,
|
|
1935
|
+
x1: left,
|
|
1936
|
+
y1: value,
|
|
1937
|
+
x2: right,
|
|
1938
|
+
y2: value,
|
|
1939
|
+
label: pill(item.label, right - LABEL_GAP, value - LABEL_HEIGHT - LABEL_GAP, "end")
|
|
1940
|
+
});
|
|
1941
|
+
}
|
|
1942
|
+
return;
|
|
1943
|
+
}
|
|
1944
|
+
if (item.type === "x-band" || item.type === "y-band") {
|
|
1945
|
+
let a;
|
|
1946
|
+
let b;
|
|
1947
|
+
if (item.type === "x-band") {
|
|
1948
|
+
const from = mapping.xSpan ? mapping.xSpan(item.from) : null;
|
|
1949
|
+
const to = mapping.xSpan ? mapping.xSpan(item.to) : null;
|
|
1950
|
+
a = from ? Math.min(from[0], from[1]) : along(item.from);
|
|
1951
|
+
b = to ? Math.max(to[0], to[1]) : along(item.to);
|
|
1952
|
+
} else {
|
|
1953
|
+
a = across(item.from, item.axis);
|
|
1954
|
+
b = across(item.to, item.axis);
|
|
1955
|
+
}
|
|
1956
|
+
if (a === null || b === null) return;
|
|
1957
|
+
if (item.type === "x-band" !== !!mapping.horizontal) {
|
|
1958
|
+
const x1 = clamp(Math.min(a, b), left, right);
|
|
1959
|
+
const x2 = clamp(Math.max(a, b), left, right);
|
|
1960
|
+
if (x2 - x1 < .5) return;
|
|
1961
|
+
shapes.push({
|
|
1962
|
+
key,
|
|
1963
|
+
kind: "band",
|
|
1964
|
+
color,
|
|
1965
|
+
x1,
|
|
1966
|
+
y1: top,
|
|
1967
|
+
x2,
|
|
1968
|
+
y2: bottom,
|
|
1969
|
+
label: pill(item.label, x1 + LABEL_GAP, top + LABEL_GAP, "start")
|
|
1970
|
+
});
|
|
1971
|
+
} else {
|
|
1972
|
+
const y1 = clamp(Math.min(a, b), top, bottom);
|
|
1973
|
+
const y2 = clamp(Math.max(a, b), top, bottom);
|
|
1974
|
+
if (y2 - y1 < .5) return;
|
|
1975
|
+
shapes.push({
|
|
1976
|
+
key,
|
|
1977
|
+
kind: "band",
|
|
1978
|
+
color,
|
|
1979
|
+
x1: left,
|
|
1980
|
+
y1,
|
|
1981
|
+
x2: right,
|
|
1982
|
+
y2,
|
|
1983
|
+
label: pill(item.label, left + LABEL_GAP, y1 + LABEL_GAP, "start")
|
|
1984
|
+
});
|
|
1985
|
+
}
|
|
1986
|
+
return;
|
|
1987
|
+
}
|
|
1988
|
+
const x = along(item.x);
|
|
1989
|
+
const y = across(item.y, item.axis);
|
|
1990
|
+
if (x === null || y === null) return;
|
|
1991
|
+
const [px, py] = mapping.horizontal ? [y, x] : [x, y];
|
|
1992
|
+
if (px < left - .5 || px > right + .5 || py < top - .5 || py > bottom + .5) return;
|
|
1993
|
+
shapes.push({
|
|
1994
|
+
key,
|
|
1995
|
+
kind: "point",
|
|
1996
|
+
color,
|
|
1997
|
+
x1: px,
|
|
1998
|
+
y1: py,
|
|
1999
|
+
x2: px,
|
|
2000
|
+
y2: py,
|
|
2001
|
+
label: pill(item.label, px, py - LABEL_HEIGHT - 8, "middle")
|
|
2002
|
+
});
|
|
2003
|
+
});
|
|
2004
|
+
return shapes;
|
|
2005
|
+
}
|
|
2006
|
+
var TxChartAnnotations = class TxChartAnnotations {
|
|
2007
|
+
shapes = input.required({
|
|
2008
|
+
...ngDevMode ? { debugName: "shapes" } : /* istanbul ignore next */ {},
|
|
2009
|
+
alias: "tx-chart-annotations"
|
|
2010
|
+
});
|
|
2011
|
+
part = input(void 0, ...ngDevMode ? [{ debugName: "part" }] : /* istanbul ignore next */ []);
|
|
2012
|
+
layer = input("all", ...ngDevMode ? [{ debugName: "layer" }] : /* istanbul ignore next */ []);
|
|
2013
|
+
shown = computed(() => {
|
|
2014
|
+
const layer = this.layer();
|
|
2015
|
+
return layer === "back" ? this.shapes().filter((shape) => shape.kind === "band") : layer === "front" ? this.shapes().filter((shape) => shape.kind !== "band" || shape.label) : this.shapes();
|
|
2016
|
+
}, ...ngDevMode ? [{ debugName: "shown" }] : /* istanbul ignore next */ []);
|
|
2017
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2018
|
+
minVersion: "12.0.0",
|
|
2019
|
+
version: "22.2.3",
|
|
2020
|
+
ngImport: i0,
|
|
2021
|
+
type: TxChartAnnotations,
|
|
2022
|
+
deps: [],
|
|
2023
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2024
|
+
});
|
|
2025
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2026
|
+
minVersion: "17.0.0",
|
|
2027
|
+
version: "22.2.3",
|
|
2028
|
+
type: TxChartAnnotations,
|
|
2029
|
+
isStandalone: true,
|
|
2030
|
+
selector: "g[tx-chart-annotations]",
|
|
2031
|
+
inputs: {
|
|
2032
|
+
shapes: {
|
|
2033
|
+
classPropertyName: "shapes",
|
|
2034
|
+
publicName: "tx-chart-annotations",
|
|
2035
|
+
isSignal: true,
|
|
2036
|
+
isRequired: true,
|
|
2037
|
+
transformFunction: null
|
|
2038
|
+
},
|
|
2039
|
+
part: {
|
|
2040
|
+
classPropertyName: "part",
|
|
2041
|
+
publicName: "part",
|
|
2042
|
+
isSignal: true,
|
|
2043
|
+
isRequired: false,
|
|
2044
|
+
transformFunction: null
|
|
2045
|
+
},
|
|
2046
|
+
layer: {
|
|
2047
|
+
classPropertyName: "layer",
|
|
2048
|
+
publicName: "layer",
|
|
2049
|
+
isSignal: true,
|
|
2050
|
+
isRequired: false,
|
|
2051
|
+
transformFunction: null
|
|
2052
|
+
}
|
|
2053
|
+
},
|
|
2054
|
+
host: {
|
|
2055
|
+
attributes: { "aria-hidden": "true" },
|
|
2056
|
+
classAttribute: "tx-chart-annotations"
|
|
2057
|
+
},
|
|
2058
|
+
ngImport: i0,
|
|
2059
|
+
template: `
|
|
2060
|
+
@for (shape of shown(); track shape.key) {
|
|
2061
|
+
<svg:g class="tx-chart-annotation" [class]="part()?.class" [style]="part()?.style" [attr.data-kind]="shape.kind" [style.--tx-chart-annotation-color]="shape.color">
|
|
2062
|
+
@if (shape.kind === 'band') {
|
|
2063
|
+
@if (layer() !== 'front') {
|
|
2064
|
+
<svg:rect class="tx-chart-annotation__band" [attr.x]="shape.x1" [attr.y]="shape.y1" [attr.width]="shape.x2 - shape.x1" [attr.height]="shape.y2 - shape.y1" />
|
|
2065
|
+
}
|
|
2066
|
+
} @else if (layer() !== 'back') {
|
|
2067
|
+
@if (shape.kind === 'line') {
|
|
2068
|
+
<svg:line class="tx-chart-annotation__line" [attr.x1]="shape.x1" [attr.y1]="shape.y1" [attr.x2]="shape.x2" [attr.y2]="shape.y2" />
|
|
2069
|
+
} @else {
|
|
2070
|
+
<svg:circle class="tx-chart-annotation__point" [attr.cx]="shape.x1" [attr.cy]="shape.y1" />
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
@if (layer() !== 'back' && shape.label; as label) {
|
|
2074
|
+
<svg:rect class="tx-chart-annotation__pill" [attr.x]="label.x" [attr.y]="label.y" [attr.width]="label.width" [attr.height]="label.height" />
|
|
2075
|
+
<svg:text class="tx-chart-annotation__label" [attr.x]="label.x + label.width / 2" [attr.y]="label.y + label.height / 2" text-anchor="middle" dominant-baseline="central">
|
|
2076
|
+
{{ label.text }}
|
|
2077
|
+
</svg:text>
|
|
2078
|
+
}
|
|
2079
|
+
</svg:g>
|
|
2080
|
+
}
|
|
2081
|
+
`,
|
|
2082
|
+
isInline: true,
|
|
2083
|
+
styles: [".tx-chart-annotation{pointer-events:none}.tx-chart-annotation__band{fill:var(--tx-chart-annotation-color);fill-opacity:.1}.tx-chart-annotation__line{stroke:var(--tx-chart-annotation-color);stroke-dasharray:4 4;shape-rendering:crispEdges}.tx-chart-annotation__point{r:5px;fill:var(--tx-chart-annotation-color)}.tx-chart-annotation__pill{fill:var(--tx-chart-annotation-color);fill-opacity:.15}.tx-chart-annotation__label{font-size:11px}:host-context([data-styled]) .tx-chart-annotation__band{fill:color-mix(in srgb,var(--tx-chart-annotation-color) var(--tx-chart-annotation-band-strength),transparent);fill-opacity:1}:host-context([data-styled]) .tx-chart-annotation__line{stroke-width:var(--tx-chart-annotation-line-width);stroke-dasharray:var(--tx-chart-annotation-line-dash)}:host-context([data-styled]) .tx-chart-annotation__point{r:var(--tx-chart-annotation-point-radius);stroke:var(--tx-chart-marker-stroke-color);stroke-width:var(--tx-chart-marker-stroke-width)}:host-context([data-styled]) .tx-chart-annotation__pill{rx:var(--tx-chart-annotation-label-radius);fill:color-mix(in srgb,var(--tx-chart-annotation-color) var(--tx-chart-annotation-label-strength),var(--tx-chart-annotation-label-base));fill-opacity:1;stroke:var(--tx-chart-annotation-color);stroke-width:var(--tx-chart-annotation-label-border-width)}:host-context([data-styled]) .tx-chart-annotation__label{fill:var(--tx-chart-annotation-label-color);font-size:var(--tx-chart-annotation-label-font-size);font-weight:var(--tx-chart-annotation-label-font-weight)}\n"],
|
|
2084
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
2085
|
+
});
|
|
2086
|
+
};
|
|
2087
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2088
|
+
minVersion: "12.0.0",
|
|
2089
|
+
version: "22.2.3",
|
|
2090
|
+
ngImport: i0,
|
|
2091
|
+
type: TxChartAnnotations,
|
|
2092
|
+
decorators: [{
|
|
2093
|
+
type: Component,
|
|
2094
|
+
args: [{
|
|
2095
|
+
selector: "g[tx-chart-annotations]",
|
|
2096
|
+
template: `
|
|
2097
|
+
@for (shape of shown(); track shape.key) {
|
|
2098
|
+
<svg:g class="tx-chart-annotation" [class]="part()?.class" [style]="part()?.style" [attr.data-kind]="shape.kind" [style.--tx-chart-annotation-color]="shape.color">
|
|
2099
|
+
@if (shape.kind === 'band') {
|
|
2100
|
+
@if (layer() !== 'front') {
|
|
2101
|
+
<svg:rect class="tx-chart-annotation__band" [attr.x]="shape.x1" [attr.y]="shape.y1" [attr.width]="shape.x2 - shape.x1" [attr.height]="shape.y2 - shape.y1" />
|
|
2102
|
+
}
|
|
2103
|
+
} @else if (layer() !== 'back') {
|
|
2104
|
+
@if (shape.kind === 'line') {
|
|
2105
|
+
<svg:line class="tx-chart-annotation__line" [attr.x1]="shape.x1" [attr.y1]="shape.y1" [attr.x2]="shape.x2" [attr.y2]="shape.y2" />
|
|
2106
|
+
} @else {
|
|
2107
|
+
<svg:circle class="tx-chart-annotation__point" [attr.cx]="shape.x1" [attr.cy]="shape.y1" />
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
@if (layer() !== 'back' && shape.label; as label) {
|
|
2111
|
+
<svg:rect class="tx-chart-annotation__pill" [attr.x]="label.x" [attr.y]="label.y" [attr.width]="label.width" [attr.height]="label.height" />
|
|
2112
|
+
<svg:text class="tx-chart-annotation__label" [attr.x]="label.x + label.width / 2" [attr.y]="label.y + label.height / 2" text-anchor="middle" dominant-baseline="central">
|
|
2113
|
+
{{ label.text }}
|
|
2114
|
+
</svg:text>
|
|
2115
|
+
}
|
|
2116
|
+
</svg:g>
|
|
2117
|
+
}
|
|
2118
|
+
`,
|
|
2119
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2120
|
+
host: {
|
|
2121
|
+
class: "tx-chart-annotations",
|
|
2122
|
+
"aria-hidden": "true"
|
|
2123
|
+
},
|
|
2124
|
+
styles: [".tx-chart-annotation{pointer-events:none}.tx-chart-annotation__band{fill:var(--tx-chart-annotation-color);fill-opacity:.1}.tx-chart-annotation__line{stroke:var(--tx-chart-annotation-color);stroke-dasharray:4 4;shape-rendering:crispEdges}.tx-chart-annotation__point{r:5px;fill:var(--tx-chart-annotation-color)}.tx-chart-annotation__pill{fill:var(--tx-chart-annotation-color);fill-opacity:.15}.tx-chart-annotation__label{font-size:11px}:host-context([data-styled]) .tx-chart-annotation__band{fill:color-mix(in srgb,var(--tx-chart-annotation-color) var(--tx-chart-annotation-band-strength),transparent);fill-opacity:1}:host-context([data-styled]) .tx-chart-annotation__line{stroke-width:var(--tx-chart-annotation-line-width);stroke-dasharray:var(--tx-chart-annotation-line-dash)}:host-context([data-styled]) .tx-chart-annotation__point{r:var(--tx-chart-annotation-point-radius);stroke:var(--tx-chart-marker-stroke-color);stroke-width:var(--tx-chart-marker-stroke-width)}:host-context([data-styled]) .tx-chart-annotation__pill{rx:var(--tx-chart-annotation-label-radius);fill:color-mix(in srgb,var(--tx-chart-annotation-color) var(--tx-chart-annotation-label-strength),var(--tx-chart-annotation-label-base));fill-opacity:1;stroke:var(--tx-chart-annotation-color);stroke-width:var(--tx-chart-annotation-label-border-width)}:host-context([data-styled]) .tx-chart-annotation__label{fill:var(--tx-chart-annotation-label-color);font-size:var(--tx-chart-annotation-label-font-size);font-weight:var(--tx-chart-annotation-label-font-weight)}\n"]
|
|
2125
|
+
}]
|
|
2126
|
+
}],
|
|
2127
|
+
propDecorators: {
|
|
2128
|
+
shapes: [{
|
|
2129
|
+
type: i0.Input,
|
|
2130
|
+
args: [{
|
|
2131
|
+
isSignal: true,
|
|
2132
|
+
alias: "tx-chart-annotations",
|
|
2133
|
+
required: true
|
|
2134
|
+
}]
|
|
2135
|
+
}],
|
|
2136
|
+
part: [{
|
|
2137
|
+
type: i0.Input,
|
|
2138
|
+
args: [{
|
|
2139
|
+
isSignal: true,
|
|
2140
|
+
alias: "part",
|
|
2141
|
+
required: false
|
|
2142
|
+
}]
|
|
2143
|
+
}],
|
|
2144
|
+
layer: [{
|
|
2145
|
+
type: i0.Input,
|
|
2146
|
+
args: [{
|
|
2147
|
+
isSignal: true,
|
|
2148
|
+
alias: "layer",
|
|
2149
|
+
required: false
|
|
2150
|
+
}]
|
|
2151
|
+
}]
|
|
2152
|
+
}
|
|
2153
|
+
});
|
|
2154
|
+
const SVG_NS = "http://www.w3.org/2000/svg";
|
|
2155
|
+
const BOM = String.fromCharCode(65279);
|
|
2156
|
+
const LEGEND_ROW = 28;
|
|
2157
|
+
const LEGEND_FONT = 12;
|
|
2158
|
+
const SKIPPED_VALUES = /* @__PURE__ */ new Set([
|
|
2159
|
+
"none",
|
|
2160
|
+
"normal",
|
|
2161
|
+
"auto"
|
|
2162
|
+
]);
|
|
2163
|
+
const STYLE_PROPERTIES = [
|
|
2164
|
+
"fill",
|
|
2165
|
+
"fill-opacity",
|
|
2166
|
+
"stroke",
|
|
2167
|
+
"stroke-width",
|
|
2168
|
+
"stroke-opacity",
|
|
2169
|
+
"stroke-dasharray",
|
|
2170
|
+
"stroke-linecap",
|
|
2171
|
+
"stroke-linejoin",
|
|
2172
|
+
"stop-color",
|
|
2173
|
+
"stop-opacity",
|
|
2174
|
+
"opacity",
|
|
2175
|
+
"visibility",
|
|
2176
|
+
"display",
|
|
2177
|
+
"transform",
|
|
2178
|
+
"transform-origin",
|
|
2179
|
+
"transform-box",
|
|
2180
|
+
"filter",
|
|
2181
|
+
"font-family",
|
|
2182
|
+
"font-size",
|
|
2183
|
+
"font-weight",
|
|
2184
|
+
"letter-spacing",
|
|
2185
|
+
"text-anchor",
|
|
2186
|
+
"dominant-baseline",
|
|
2187
|
+
"r",
|
|
2188
|
+
"rx",
|
|
2189
|
+
"ry"
|
|
2190
|
+
];
|
|
2191
|
+
function escapeCsv(value) {
|
|
2192
|
+
return /[",\n\r]/.test(value) ? `"${value.replace(/"/g, "\"\"")}"` : value;
|
|
2193
|
+
}
|
|
2194
|
+
function chartCsv(table, categoryLabel = "") {
|
|
2195
|
+
const rows = [[categoryLabel, ...table.columns.map((column) => column.label)], ...table.rows.map((row) => [row.label, ...row.cells])];
|
|
2196
|
+
return `${BOM}${rows.map((row) => row.map((cell) => escapeCsv(cell ?? "")).join(",")).join("\r\n")}`;
|
|
2197
|
+
}
|
|
2198
|
+
function chartFileName(name, format) {
|
|
2199
|
+
return `${name.normalize("NFKD").toLowerCase().replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").slice(0, 60) || "chart"}.${format}`;
|
|
2200
|
+
}
|
|
2201
|
+
function inlineStyles(source, target, view) {
|
|
2202
|
+
const sources = [source, ...source.querySelectorAll("*")];
|
|
2203
|
+
const targets = [target, ...target.querySelectorAll("*")];
|
|
2204
|
+
sources.forEach((element, index) => {
|
|
2205
|
+
const clone = targets[index];
|
|
2206
|
+
if (!clone) return;
|
|
2207
|
+
if (element.localName === "foreignObject") {
|
|
2208
|
+
clone.remove();
|
|
2209
|
+
return;
|
|
2210
|
+
}
|
|
2211
|
+
const computed = view.getComputedStyle(element);
|
|
2212
|
+
const declarations = STYLE_PROPERTIES.flatMap((property) => {
|
|
2213
|
+
const value = computed.getPropertyValue(property).trim();
|
|
2214
|
+
return property === "fill" || property === "stroke" || !!value && !SKIPPED_VALUES.has(value) ? [`${property}:${value || "none"}`] : [];
|
|
2215
|
+
});
|
|
2216
|
+
clone.removeAttribute("class");
|
|
2217
|
+
clone.setAttribute("style", declarations.join(";"));
|
|
2218
|
+
});
|
|
2219
|
+
}
|
|
2220
|
+
function chartSvgString(svg, options = {}) {
|
|
2221
|
+
const document = svg.ownerDocument;
|
|
2222
|
+
const view = document.defaultView;
|
|
2223
|
+
const [, , width, height] = (svg.getAttribute("viewBox") ?? "0 0 0 0").split(/\s+/).map(Number);
|
|
2224
|
+
const legend = (options.legend ?? []).filter((item) => !item.hidden);
|
|
2225
|
+
const top = legend.length ? LEGEND_ROW : 0;
|
|
2226
|
+
const clone = svg.cloneNode(true);
|
|
2227
|
+
if (view) inlineStyles(svg, clone, view);
|
|
2228
|
+
const root = document.createElementNS(SVG_NS, "svg");
|
|
2229
|
+
root.setAttribute("xmlns", SVG_NS);
|
|
2230
|
+
root.setAttribute("width", String(width));
|
|
2231
|
+
root.setAttribute("height", String(height + top));
|
|
2232
|
+
root.setAttribute("viewBox", `0 0 ${width} ${height + top}`);
|
|
2233
|
+
root.setAttribute("font-family", options.fontFamily ?? "sans-serif");
|
|
2234
|
+
if (options.background) {
|
|
2235
|
+
const background = document.createElementNS(SVG_NS, "rect");
|
|
2236
|
+
background.setAttribute("width", "100%");
|
|
2237
|
+
background.setAttribute("height", "100%");
|
|
2238
|
+
background.setAttribute("fill", options.background);
|
|
2239
|
+
root.appendChild(background);
|
|
2240
|
+
}
|
|
2241
|
+
let x = 0;
|
|
2242
|
+
for (const item of legend) {
|
|
2243
|
+
const marker = document.createElementNS(SVG_NS, "circle");
|
|
2244
|
+
marker.setAttribute("cx", String(x + 5));
|
|
2245
|
+
marker.setAttribute("cy", String(LEGEND_ROW / 2));
|
|
2246
|
+
marker.setAttribute("r", "4");
|
|
2247
|
+
marker.setAttribute("fill", item.color);
|
|
2248
|
+
const label = document.createElementNS(SVG_NS, "text");
|
|
2249
|
+
label.setAttribute("x", String(x + 14));
|
|
2250
|
+
label.setAttribute("y", String(LEGEND_ROW / 2));
|
|
2251
|
+
label.setAttribute("dominant-baseline", "central");
|
|
2252
|
+
label.setAttribute("font-size", String(LEGEND_FONT));
|
|
2253
|
+
label.setAttribute("fill", options.textColor ?? "currentColor");
|
|
2254
|
+
label.textContent = item.label;
|
|
2255
|
+
root.appendChild(marker);
|
|
2256
|
+
root.appendChild(label);
|
|
2257
|
+
x += 14 + textWidth(item.label, LEGEND_FONT) + 16;
|
|
2258
|
+
}
|
|
2259
|
+
const chart = document.createElementNS(SVG_NS, "g");
|
|
2260
|
+
chart.setAttribute("transform", `translate(0 ${top})`);
|
|
2261
|
+
while (clone.firstChild) chart.appendChild(clone.firstChild);
|
|
2262
|
+
root.appendChild(chart);
|
|
2263
|
+
const Serializer = view?.XMLSerializer;
|
|
2264
|
+
return Serializer ? new Serializer().serializeToString(root) : root.outerHTML;
|
|
2265
|
+
}
|
|
2266
|
+
function chartSvgSize(markup) {
|
|
2267
|
+
const match = /viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(markup);
|
|
2268
|
+
return {
|
|
2269
|
+
width: Number(match?.[1] ?? 0),
|
|
2270
|
+
height: Number(match?.[2] ?? 0)
|
|
2271
|
+
};
|
|
2272
|
+
}
|
|
2273
|
+
function chartPngBlob(document, markup, scale = 2) {
|
|
2274
|
+
const view = document.defaultView;
|
|
2275
|
+
const { width, height } = chartSvgSize(markup);
|
|
2276
|
+
return new Promise((resolve, reject) => {
|
|
2277
|
+
if (!view) {
|
|
2278
|
+
reject(/* @__PURE__ */ new Error("no window"));
|
|
2279
|
+
return;
|
|
2280
|
+
}
|
|
2281
|
+
const image = new view.Image();
|
|
2282
|
+
image.onload = () => {
|
|
2283
|
+
const canvas = document.createElement("canvas");
|
|
2284
|
+
canvas.width = Math.max(1, Math.round(width * scale));
|
|
2285
|
+
canvas.height = Math.max(1, Math.round(height * scale));
|
|
2286
|
+
const context = canvas.getContext("2d");
|
|
2287
|
+
if (!context) {
|
|
2288
|
+
reject(/* @__PURE__ */ new Error("no canvas"));
|
|
2289
|
+
return;
|
|
2290
|
+
}
|
|
2291
|
+
context.scale(scale, scale);
|
|
2292
|
+
context.drawImage(image, 0, 0, width, height);
|
|
2293
|
+
canvas.toBlob((blob) => blob ? resolve(blob) : reject(/* @__PURE__ */ new Error("no blob")), "image/png");
|
|
2294
|
+
};
|
|
2295
|
+
image.onerror = () => reject(/* @__PURE__ */ new Error("image"));
|
|
2296
|
+
image.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(markup)}`;
|
|
2297
|
+
});
|
|
2298
|
+
}
|
|
2299
|
+
function downloadChartFile(document, data, filename) {
|
|
2300
|
+
const view = document.defaultView;
|
|
2301
|
+
if (!view) return;
|
|
2302
|
+
const url = view.URL.createObjectURL(data);
|
|
2303
|
+
const link = document.createElement("a");
|
|
2304
|
+
link.href = url;
|
|
2305
|
+
link.download = filename;
|
|
2306
|
+
link.rel = "noopener";
|
|
2307
|
+
link.style.display = "none";
|
|
2308
|
+
document.body.appendChild(link);
|
|
2309
|
+
link.click();
|
|
2310
|
+
link.remove();
|
|
2311
|
+
view.setTimeout(() => view.URL.revokeObjectURL(url), 1e3);
|
|
2312
|
+
}
|
|
2313
|
+
const MENU_KEYS = /* @__PURE__ */ new Set([
|
|
2314
|
+
"ArrowDown",
|
|
2315
|
+
"ArrowUp",
|
|
2316
|
+
"Home",
|
|
2317
|
+
"End"
|
|
2318
|
+
]);
|
|
2319
|
+
var TxChartMenu = class TxChartMenu {
|
|
2320
|
+
items = input([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
2321
|
+
ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
2322
|
+
unstyled = input(void 0, {
|
|
2323
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
2324
|
+
transform: optionalBoolean
|
|
2325
|
+
});
|
|
2326
|
+
selected = output();
|
|
2327
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
2328
|
+
list = viewChild("list", ...ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []);
|
|
2329
|
+
onKeydown(event) {
|
|
2330
|
+
if (!MENU_KEYS.has(event.key)) return;
|
|
2331
|
+
const items = Array.from(this.list()?.nativeElement.querySelectorAll("[role=\"menuitem\"]:not(:disabled)") ?? []);
|
|
2332
|
+
const next = nextListIndex(event.key, {
|
|
2333
|
+
count: items.length,
|
|
2334
|
+
current: items.indexOf(event.target)
|
|
2335
|
+
});
|
|
2336
|
+
if (next === null) return;
|
|
2337
|
+
event.preventDefault();
|
|
2338
|
+
items[next]?.focus();
|
|
2339
|
+
}
|
|
2340
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2341
|
+
minVersion: "12.0.0",
|
|
2342
|
+
version: "22.2.3",
|
|
2343
|
+
ngImport: i0,
|
|
2344
|
+
type: TxChartMenu,
|
|
2345
|
+
deps: [],
|
|
2346
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2347
|
+
});
|
|
2348
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2349
|
+
minVersion: "17.0.0",
|
|
2350
|
+
version: "22.2.3",
|
|
2351
|
+
type: TxChartMenu,
|
|
2352
|
+
isStandalone: true,
|
|
2353
|
+
selector: "tx-chart-menu",
|
|
2354
|
+
inputs: {
|
|
2355
|
+
items: {
|
|
2356
|
+
classPropertyName: "items",
|
|
2357
|
+
publicName: "items",
|
|
2358
|
+
isSignal: true,
|
|
2359
|
+
isRequired: false,
|
|
2360
|
+
transformFunction: null
|
|
2361
|
+
},
|
|
2362
|
+
ariaLabel: {
|
|
2363
|
+
classPropertyName: "ariaLabel",
|
|
2364
|
+
publicName: "ariaLabel",
|
|
2365
|
+
isSignal: true,
|
|
2366
|
+
isRequired: false,
|
|
2367
|
+
transformFunction: null
|
|
2368
|
+
},
|
|
2369
|
+
unstyled: {
|
|
2370
|
+
classPropertyName: "unstyled",
|
|
2371
|
+
publicName: "unstyled",
|
|
2372
|
+
isSignal: true,
|
|
2373
|
+
isRequired: false,
|
|
2374
|
+
transformFunction: null
|
|
2375
|
+
}
|
|
2376
|
+
},
|
|
2377
|
+
outputs: { selected: "selected" },
|
|
2378
|
+
host: { classAttribute: "tx-chart-menu" },
|
|
2379
|
+
viewQueries: [{
|
|
2380
|
+
propertyName: "list",
|
|
2381
|
+
first: true,
|
|
2382
|
+
predicate: ["list"],
|
|
2383
|
+
descendants: true,
|
|
2384
|
+
isSignal: true
|
|
2385
|
+
}],
|
|
2386
|
+
ngImport: i0,
|
|
2387
|
+
template: `
|
|
2388
|
+
<div #list class="tx-chart-menu__list" role="menu" tabindex="-1" [attr.aria-label]="ariaLabel() || null" [attr.data-styled]="!isUnstyled() || null" (keydown)="onKeydown($event)">
|
|
2389
|
+
@for (item of items(); track item.id) {
|
|
2390
|
+
<button type="button" role="menuitem" class="tx-chart-menu__item" [disabled]="item.disabled" (click)="selected.emit(item.id)">
|
|
2391
|
+
@if (item.icon) {
|
|
2392
|
+
<tx-icon class="tx-chart-menu__icon" aria-hidden="true" [name]="item.icon" />
|
|
2393
|
+
}
|
|
2394
|
+
<span class="tx-chart-menu__label">{{ item.label }}</span>
|
|
2395
|
+
</button>
|
|
2396
|
+
}
|
|
2397
|
+
</div>
|
|
2398
|
+
`,
|
|
2399
|
+
isInline: true,
|
|
2400
|
+
styles: [":host{display:block}.tx-chart-menu__list{display:flex;flex-direction:column;outline:none}.tx-chart-menu__item{display:flex;align-items:center;width:100%;margin:0;border:0;background:transparent;color:inherit;font:inherit;text-align:start;white-space:nowrap;cursor:pointer}.tx-chart-menu__item:disabled{cursor:default}.tx-chart-menu__icon{flex-shrink:0}.tx-chart-menu__list[data-styled]{gap:var(--tx-actions-menu-list-gap);min-width:var(--tx-actions-menu-list-min-width);padding:var(--tx-actions-menu-list-padding)}.tx-chart-menu__list[data-styled] .tx-chart-menu__item{gap:var(--tx-actions-menu-item-gap);padding:var(--tx-actions-menu-item-padding-y) var(--tx-actions-menu-item-padding-x);border-radius:var(--tx-actions-menu-item-border-radius);color:var(--tx-actions-menu-item-color);font-family:var(--tx-font-family);font-size:var(--tx-actions-menu-item-font-size);font-weight:var(--tx-actions-menu-item-font-weight);line-height:var(--tx-actions-menu-item-line-height);transition:background-color var(--tx-actions-menu-item-transition-duration)}.tx-chart-menu__list[data-styled] .tx-chart-menu__item:hover:not(:disabled){background:var(--tx-actions-menu-item-hover-background)}.tx-chart-menu__list[data-styled] .tx-chart-menu__item:active:not(:disabled){background:var(--tx-actions-menu-item-active-background)}.tx-chart-menu__list[data-styled] .tx-chart-menu__item:focus-visible{outline:2px solid var(--tx-actions-menu-item-focus-ring-color);outline-offset:-2px}.tx-chart-menu__list[data-styled] .tx-chart-menu__item:disabled{opacity:var(--tx-chart-toolbar-disabled-opacity)}@media(prefers-reduced-motion:reduce){.tx-chart-menu__list[data-styled] .tx-chart-menu__item{transition:none}}\n"],
|
|
2401
|
+
dependencies: [{
|
|
2402
|
+
kind: "component",
|
|
2403
|
+
type: TxIcon,
|
|
2404
|
+
selector: "tx-icon",
|
|
2405
|
+
inputs: ["name"]
|
|
2406
|
+
}],
|
|
2407
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
2408
|
+
});
|
|
2409
|
+
};
|
|
2410
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2411
|
+
minVersion: "12.0.0",
|
|
2412
|
+
version: "22.2.3",
|
|
2413
|
+
ngImport: i0,
|
|
2414
|
+
type: TxChartMenu,
|
|
2415
|
+
decorators: [{
|
|
2416
|
+
type: Component,
|
|
2417
|
+
args: [{
|
|
2418
|
+
selector: "tx-chart-menu",
|
|
2419
|
+
imports: [TxIcon],
|
|
2420
|
+
template: `
|
|
2421
|
+
<div #list class="tx-chart-menu__list" role="menu" tabindex="-1" [attr.aria-label]="ariaLabel() || null" [attr.data-styled]="!isUnstyled() || null" (keydown)="onKeydown($event)">
|
|
2422
|
+
@for (item of items(); track item.id) {
|
|
2423
|
+
<button type="button" role="menuitem" class="tx-chart-menu__item" [disabled]="item.disabled" (click)="selected.emit(item.id)">
|
|
2424
|
+
@if (item.icon) {
|
|
2425
|
+
<tx-icon class="tx-chart-menu__icon" aria-hidden="true" [name]="item.icon" />
|
|
2426
|
+
}
|
|
2427
|
+
<span class="tx-chart-menu__label">{{ item.label }}</span>
|
|
2428
|
+
</button>
|
|
2429
|
+
}
|
|
2430
|
+
</div>
|
|
2431
|
+
`,
|
|
2432
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2433
|
+
host: { class: "tx-chart-menu" },
|
|
2434
|
+
styles: [":host{display:block}.tx-chart-menu__list{display:flex;flex-direction:column;outline:none}.tx-chart-menu__item{display:flex;align-items:center;width:100%;margin:0;border:0;background:transparent;color:inherit;font:inherit;text-align:start;white-space:nowrap;cursor:pointer}.tx-chart-menu__item:disabled{cursor:default}.tx-chart-menu__icon{flex-shrink:0}.tx-chart-menu__list[data-styled]{gap:var(--tx-actions-menu-list-gap);min-width:var(--tx-actions-menu-list-min-width);padding:var(--tx-actions-menu-list-padding)}.tx-chart-menu__list[data-styled] .tx-chart-menu__item{gap:var(--tx-actions-menu-item-gap);padding:var(--tx-actions-menu-item-padding-y) var(--tx-actions-menu-item-padding-x);border-radius:var(--tx-actions-menu-item-border-radius);color:var(--tx-actions-menu-item-color);font-family:var(--tx-font-family);font-size:var(--tx-actions-menu-item-font-size);font-weight:var(--tx-actions-menu-item-font-weight);line-height:var(--tx-actions-menu-item-line-height);transition:background-color var(--tx-actions-menu-item-transition-duration)}.tx-chart-menu__list[data-styled] .tx-chart-menu__item:hover:not(:disabled){background:var(--tx-actions-menu-item-hover-background)}.tx-chart-menu__list[data-styled] .tx-chart-menu__item:active:not(:disabled){background:var(--tx-actions-menu-item-active-background)}.tx-chart-menu__list[data-styled] .tx-chart-menu__item:focus-visible{outline:2px solid var(--tx-actions-menu-item-focus-ring-color);outline-offset:-2px}.tx-chart-menu__list[data-styled] .tx-chart-menu__item:disabled{opacity:var(--tx-chart-toolbar-disabled-opacity)}@media(prefers-reduced-motion:reduce){.tx-chart-menu__list[data-styled] .tx-chart-menu__item{transition:none}}\n"]
|
|
2435
|
+
}]
|
|
2436
|
+
}],
|
|
2437
|
+
propDecorators: {
|
|
2438
|
+
items: [{
|
|
2439
|
+
type: i0.Input,
|
|
2440
|
+
args: [{
|
|
2441
|
+
isSignal: true,
|
|
2442
|
+
alias: "items",
|
|
2443
|
+
required: false
|
|
2444
|
+
}]
|
|
2445
|
+
}],
|
|
2446
|
+
ariaLabel: [{
|
|
2447
|
+
type: i0.Input,
|
|
2448
|
+
args: [{
|
|
2449
|
+
isSignal: true,
|
|
2450
|
+
alias: "ariaLabel",
|
|
2451
|
+
required: false
|
|
2452
|
+
}]
|
|
2453
|
+
}],
|
|
2454
|
+
unstyled: [{
|
|
2455
|
+
type: i0.Input,
|
|
2456
|
+
args: [{
|
|
2457
|
+
isSignal: true,
|
|
2458
|
+
alias: "unstyled",
|
|
2459
|
+
required: false
|
|
2460
|
+
}]
|
|
2461
|
+
}],
|
|
2462
|
+
selected: [{
|
|
2463
|
+
type: i0.Output,
|
|
2464
|
+
args: ["selected"]
|
|
2465
|
+
}],
|
|
2466
|
+
list: [{
|
|
2467
|
+
type: i0.ViewChild,
|
|
2468
|
+
args: ["list", { isSignal: true }]
|
|
2469
|
+
}]
|
|
2470
|
+
}
|
|
2471
|
+
});
|
|
1558
2472
|
const TOOLTIP_OFFSET = 10;
|
|
2473
|
+
const ARROW_ROOM = 16;
|
|
2474
|
+
const NAVIGATION_KEYS = [
|
|
2475
|
+
"ArrowLeft",
|
|
2476
|
+
"ArrowRight",
|
|
2477
|
+
"ArrowUp",
|
|
2478
|
+
"ArrowDown",
|
|
2479
|
+
"Home",
|
|
2480
|
+
"End",
|
|
2481
|
+
"Escape"
|
|
2482
|
+
];
|
|
2483
|
+
const ACTION_KEYS = [
|
|
2484
|
+
"Enter",
|
|
2485
|
+
" ",
|
|
2486
|
+
"Backspace"
|
|
2487
|
+
];
|
|
2488
|
+
const ZOOM_KEYS = [
|
|
2489
|
+
"+",
|
|
2490
|
+
"=",
|
|
2491
|
+
"-",
|
|
2492
|
+
"_",
|
|
2493
|
+
"0"
|
|
2494
|
+
];
|
|
2495
|
+
const WHEEL_ZOOM = .0025;
|
|
2496
|
+
const FOLLOW_PLACEMENT = "right";
|
|
2497
|
+
const FOLLOW_OFFSET = 14;
|
|
1559
2498
|
var TxChartFrame = class TxChartFrame {
|
|
1560
2499
|
host = inject(ElementRef);
|
|
1561
2500
|
overlay = inject(TxOverlay);
|
|
@@ -1605,25 +2544,49 @@ var TxChartFrame = class TxChartFrame {
|
|
|
1605
2544
|
...ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {},
|
|
1606
2545
|
transform: booleanAttribute
|
|
1607
2546
|
});
|
|
2547
|
+
actionKeys = input(false, {
|
|
2548
|
+
...ngDevMode ? { debugName: "actionKeys" } : /* istanbul ignore next */ {},
|
|
2549
|
+
transform: booleanAttribute
|
|
2550
|
+
});
|
|
2551
|
+
zoomable = input(false, {
|
|
2552
|
+
...ngDevMode ? { debugName: "zoomable" } : /* istanbul ignore next */ {},
|
|
2553
|
+
transform: booleanAttribute
|
|
2554
|
+
});
|
|
2555
|
+
zoomedIn = input(false, {
|
|
2556
|
+
...ngDevMode ? { debugName: "zoomedIn" } : /* istanbul ignore next */ {},
|
|
2557
|
+
transform: booleanAttribute
|
|
2558
|
+
});
|
|
1608
2559
|
plotHeight = input(null, ...ngDevMode ? [{ debugName: "plotHeight" }] : /* istanbul ignore next */ []);
|
|
2560
|
+
toolbar = input(false, {
|
|
2561
|
+
...ngDevMode ? { debugName: "toolbar" } : /* istanbul ignore next */ {},
|
|
2562
|
+
transform: booleanAttribute
|
|
2563
|
+
});
|
|
2564
|
+
exportName = input("", ...ngDevMode ? [{ debugName: "exportName" }] : /* istanbul ignore next */ []);
|
|
1609
2565
|
pointer = output();
|
|
1610
2566
|
navigate = output();
|
|
1611
2567
|
legendToggled = output();
|
|
1612
2568
|
legendHovered = output();
|
|
1613
2569
|
tooltipClosed = output();
|
|
2570
|
+
zoomed = output();
|
|
2571
|
+
panned = output();
|
|
2572
|
+
zoomReset = output();
|
|
1614
2573
|
plotRef = viewChild("plot", ...ngDevMode ? [{ debugName: "plotRef" }] : /* istanbul ignore next */ []);
|
|
1615
2574
|
anchorRef = viewChild("anchor", ...ngDevMode ? [{ debugName: "anchorRef" }] : /* istanbul ignore next */ []);
|
|
2575
|
+
svgRef = viewChild("chartSvg", ...ngDevMode ? [{ debugName: "svgRef" }] : /* istanbul ignore next */ []);
|
|
1616
2576
|
tooltipPanel = viewChild("tooltipPanel", ...ngDevMode ? [{ debugName: "tooltipPanel" }] : /* istanbul ignore next */ []);
|
|
1617
2577
|
hintId = uniqueId("tx-chart-hint");
|
|
1618
2578
|
shown = signal(null, ...ngDevMode ? [{ debugName: "shown" }] : /* istanbul ignore next */ []);
|
|
2579
|
+
following = signal(false, ...ngDevMode ? [{ debugName: "following" }] : /* istanbul ignore next */ []);
|
|
2580
|
+
cursor = null;
|
|
2581
|
+
touches = /* @__PURE__ */ new Map();
|
|
1619
2582
|
measured = signal(false, ...ngDevMode ? [{ debugName: "measured" }] : /* istanbul ignore next */ []);
|
|
1620
2583
|
ref = null;
|
|
1621
2584
|
openPlacement = null;
|
|
1622
2585
|
activeRef = signal(null, ...ngDevMode ? [{ debugName: "activeRef" }] : /* istanbul ignore next */ []);
|
|
1623
2586
|
side = computed(() => parsePlacement(this.activeRef()?.placement() ?? this.openPlacement ?? this.tooltipPlacement()).side, ...ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []);
|
|
1624
2587
|
arrowOffset = computed(() => txArrowOffset(this.activeRef()?.placement() ?? "top", {
|
|
1625
|
-
width:
|
|
1626
|
-
height:
|
|
2588
|
+
width: 32,
|
|
2589
|
+
height: 32
|
|
1627
2590
|
}), ...ngDevMode ? [{ debugName: "arrowOffset" }] : /* istanbul ignore next */ []);
|
|
1628
2591
|
fills = computed(() => typeof this.height() === "string", ...ngDevMode ? [{ debugName: "fills" }] : /* istanbul ignore next */ []);
|
|
1629
2592
|
cssHeight = computed(() => {
|
|
@@ -1632,7 +2595,30 @@ var TxChartFrame = class TxChartFrame {
|
|
|
1632
2595
|
}, ...ngDevMode ? [{ debugName: "cssHeight" }] : /* istanbul ignore next */ []);
|
|
1633
2596
|
legendVisible = computed(() => this.showLegend() && !this.empty() && !this.loading() && this.legendItems().length > 0, ...ngDevMode ? [{ debugName: "legendVisible" }] : /* istanbul ignore next */ []);
|
|
1634
2597
|
viewBox = computed(() => `0 0 ${this.size().width} ${this.size().height}`, ...ngDevMode ? [{ debugName: "viewBox" }] : /* istanbul ignore next */ []);
|
|
1635
|
-
placeholderHeight = computed(() => chartBoxHeight(this.height(), this.legendVisible() ? this.legendPosition() : null), ...ngDevMode ? [{ debugName: "placeholderHeight" }] : /* istanbul ignore next */ []);
|
|
2598
|
+
placeholderHeight = computed(() => chartBoxHeight(this.height(), this.legendVisible() ? this.legendPosition() : null, this.toolbar()), ...ngDevMode ? [{ debugName: "placeholderHeight" }] : /* istanbul ignore next */ []);
|
|
2599
|
+
toolbarRow = computed(() => !this.toolbar() ? null : this.legendVisible() && this.legendPosition() === "top" ? "legend" : "own", ...ngDevMode ? [{ debugName: "toolbarRow" }] : /* istanbul ignore next */ []);
|
|
2600
|
+
canExport = computed(() => !this.empty() && !this.loading(), ...ngDevMode ? [{ debugName: "canExport" }] : /* istanbul ignore next */ []);
|
|
2601
|
+
popoverTokens = { content: { padding: "0" } };
|
|
2602
|
+
exportItems = computed(() => {
|
|
2603
|
+
const t = this.translations();
|
|
2604
|
+
return [
|
|
2605
|
+
{
|
|
2606
|
+
id: "svg",
|
|
2607
|
+
label: t.chartDownloadSvg,
|
|
2608
|
+
icon: "image"
|
|
2609
|
+
},
|
|
2610
|
+
{
|
|
2611
|
+
id: "png",
|
|
2612
|
+
label: t.chartDownloadPng,
|
|
2613
|
+
icon: "image"
|
|
2614
|
+
},
|
|
2615
|
+
...this.table() ? [{
|
|
2616
|
+
id: "csv",
|
|
2617
|
+
label: t.chartDownloadCsv,
|
|
2618
|
+
icon: "file"
|
|
2619
|
+
}] : []
|
|
2620
|
+
];
|
|
2621
|
+
}, ...ngDevMode ? [{ debugName: "exportItems" }] : /* istanbul ignore next */ []);
|
|
1636
2622
|
constructor() {
|
|
1637
2623
|
afterNextRender(() => this.observe());
|
|
1638
2624
|
effect(() => {
|
|
@@ -1648,28 +2634,84 @@ var TxChartFrame = class TxChartFrame {
|
|
|
1648
2634
|
const plot = this.plotRef()?.nativeElement;
|
|
1649
2635
|
if (!plot || !this.interactive()) return;
|
|
1650
2636
|
const box = plot.getBoundingClientRect();
|
|
2637
|
+
const x = event.clientX - box.left;
|
|
2638
|
+
const y = event.clientY - box.top;
|
|
2639
|
+
if (this.zoomable() && this.pinch(event, type, x, y)) return;
|
|
2640
|
+
this.cursor = type !== "leave" && followsPointer(event) ? {
|
|
2641
|
+
x,
|
|
2642
|
+
y
|
|
2643
|
+
} : null;
|
|
1651
2644
|
this.pointer.emit({
|
|
1652
|
-
x
|
|
1653
|
-
y
|
|
2645
|
+
x,
|
|
2646
|
+
y,
|
|
1654
2647
|
type,
|
|
1655
|
-
target: event.target
|
|
2648
|
+
target: event.target,
|
|
2649
|
+
buttons: event.buttons,
|
|
2650
|
+
pointerType: "pointerType" in event ? event.pointerType : "mouse"
|
|
1656
2651
|
});
|
|
2652
|
+
if (this.cursor && this.ref && this.following()) {
|
|
2653
|
+
this.placeAnchor(this.cursor.x, this.cursor.y - ARROW_ROOM, 0, 32);
|
|
2654
|
+
this.ref.updatePosition();
|
|
2655
|
+
}
|
|
1657
2656
|
}
|
|
1658
2657
|
onKeydown(event) {
|
|
1659
2658
|
if (!this.interactive()) return;
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
"ArrowRight",
|
|
1663
|
-
"ArrowUp",
|
|
1664
|
-
"ArrowDown",
|
|
1665
|
-
"Home",
|
|
1666
|
-
"End",
|
|
1667
|
-
"Escape"
|
|
1668
|
-
].includes(event.key)) {
|
|
2659
|
+
this.cursor = null;
|
|
2660
|
+
if (NAVIGATION_KEYS.includes(event.key) || this.actionKeys() && ACTION_KEYS.includes(event.key) || this.zoomable() && ZOOM_KEYS.includes(event.key)) {
|
|
1669
2661
|
event.preventDefault();
|
|
1670
2662
|
this.navigate.emit(event);
|
|
1671
2663
|
}
|
|
1672
2664
|
}
|
|
2665
|
+
onWheel(event) {
|
|
2666
|
+
const plot = this.plotRef()?.nativeElement;
|
|
2667
|
+
if (!plot || !this.zoomable() || !this.interactive()) return;
|
|
2668
|
+
const box = plot.getBoundingClientRect();
|
|
2669
|
+
if (event.ctrlKey || event.metaKey) {
|
|
2670
|
+
event.preventDefault();
|
|
2671
|
+
this.zoomed.emit({
|
|
2672
|
+
x: event.clientX - box.left,
|
|
2673
|
+
factor: Math.exp(event.deltaY * WHEEL_ZOOM)
|
|
2674
|
+
});
|
|
2675
|
+
} else if (this.zoomedIn() && Math.abs(event.deltaX) > Math.abs(event.deltaY)) {
|
|
2676
|
+
event.preventDefault();
|
|
2677
|
+
this.panned.emit({ dx: -event.deltaX });
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
onDoubleClick() {
|
|
2681
|
+
if (this.zoomable() && this.zoomedIn()) this.zoomReset.emit();
|
|
2682
|
+
}
|
|
2683
|
+
pinch(event, type, x, y) {
|
|
2684
|
+
if (!("pointerType" in event) || event.pointerType !== "touch") return false;
|
|
2685
|
+
const before = [...this.touches.values()];
|
|
2686
|
+
if (type === "up" || type === "leave") {
|
|
2687
|
+
this.touches.delete(event.pointerId);
|
|
2688
|
+
return before.length > 1;
|
|
2689
|
+
}
|
|
2690
|
+
if (type === "down" || this.touches.has(event.pointerId)) this.touches.set(event.pointerId, {
|
|
2691
|
+
x,
|
|
2692
|
+
y
|
|
2693
|
+
});
|
|
2694
|
+
const after = [...this.touches.values()];
|
|
2695
|
+
if (after.length < 2) return false;
|
|
2696
|
+
if (before.length >= 2 && type === "move") {
|
|
2697
|
+
const spread = (points) => Math.hypot(points[0].x - points[1].x, points[0].y - points[1].y);
|
|
2698
|
+
const middle = (points) => (points[0].x + points[1].x) / 2;
|
|
2699
|
+
const factor = spread(before) / Math.max(1, spread(after));
|
|
2700
|
+
if (Math.abs(factor - 1) > .002) this.zoomed.emit({
|
|
2701
|
+
x: middle(after),
|
|
2702
|
+
factor
|
|
2703
|
+
});
|
|
2704
|
+
const dx = middle(after) - middle(before);
|
|
2705
|
+
if (dx) this.panned.emit({ dx });
|
|
2706
|
+
}
|
|
2707
|
+
this.pointer.emit({
|
|
2708
|
+
x: 0,
|
|
2709
|
+
y: 0,
|
|
2710
|
+
type: "leave",
|
|
2711
|
+
target: null
|
|
2712
|
+
});
|
|
2713
|
+
return true;
|
|
2714
|
+
}
|
|
1673
2715
|
observe() {
|
|
1674
2716
|
const plot = this.plotRef()?.nativeElement;
|
|
1675
2717
|
if (!plot) return;
|
|
@@ -1701,9 +2743,17 @@ var TxChartFrame = class TxChartFrame {
|
|
|
1701
2743
|
return;
|
|
1702
2744
|
}
|
|
1703
2745
|
if (!anchor || !template) return;
|
|
1704
|
-
const
|
|
1705
|
-
|
|
1706
|
-
if (this.
|
|
2746
|
+
const cursor = this.cursor;
|
|
2747
|
+
const placement = cursor ? FOLLOW_PLACEMENT : data.placement ?? this.tooltipPlacement();
|
|
2748
|
+
if (cursor) this.placeAnchor(cursor.x, cursor.y - ARROW_ROOM, 0, 32);
|
|
2749
|
+
else {
|
|
2750
|
+
const vertical = parsePlacement(placement).side === "top" || parsePlacement(placement).side === "bottom";
|
|
2751
|
+
const width = vertical ? 32 : 0;
|
|
2752
|
+
const height = vertical ? 0 : 32;
|
|
2753
|
+
this.placeAnchor(data.x - width / 2, data.y - height / 2, width, height);
|
|
2754
|
+
}
|
|
2755
|
+
if (this.ref && (this.openPlacement !== placement || this.following() !== !!cursor)) this.closeTooltip();
|
|
2756
|
+
this.following.set(!!cursor);
|
|
1707
2757
|
this.shown.set(data);
|
|
1708
2758
|
if (this.ref) {
|
|
1709
2759
|
this.ref.updatePosition();
|
|
@@ -1713,7 +2763,7 @@ var TxChartFrame = class TxChartFrame {
|
|
|
1713
2763
|
origin: anchor,
|
|
1714
2764
|
viewContainerRef: this.viewContainerRef,
|
|
1715
2765
|
placement,
|
|
1716
|
-
offset: TOOLTIP_OFFSET,
|
|
2766
|
+
offset: cursor ? FOLLOW_OFFSET : TOOLTIP_OFFSET,
|
|
1717
2767
|
layer: "tooltip",
|
|
1718
2768
|
closeOnOutsideClick: false,
|
|
1719
2769
|
restoreFocus: false,
|
|
@@ -1731,6 +2781,53 @@ var TxChartFrame = class TxChartFrame {
|
|
|
1731
2781
|
this.openPlacement = placement;
|
|
1732
2782
|
this.activeRef.set(ref);
|
|
1733
2783
|
}
|
|
2784
|
+
onExport(id) {
|
|
2785
|
+
if (id === "svg" || id === "png" || id === "csv") this.download(id);
|
|
2786
|
+
}
|
|
2787
|
+
download(format) {
|
|
2788
|
+
const document = this.host.nativeElement.ownerDocument;
|
|
2789
|
+
const name = chartFileName(this.exportName() || this.translations().chartDataTable, format);
|
|
2790
|
+
if (format === "csv") {
|
|
2791
|
+
const table = this.table();
|
|
2792
|
+
if (table) downloadChartFile(document, new Blob([chartCsv(table, this.translations().chartCategory)], { type: "text/csv;charset=utf-8" }), name);
|
|
2793
|
+
return;
|
|
2794
|
+
}
|
|
2795
|
+
const svg = this.svgRef()?.nativeElement;
|
|
2796
|
+
if (!svg) return;
|
|
2797
|
+
const style = document.defaultView?.getComputedStyle(this.host.nativeElement);
|
|
2798
|
+
const markup = chartSvgString(svg, {
|
|
2799
|
+
legend: this.showLegend() ? this.legendItems().map((item) => ({
|
|
2800
|
+
...item,
|
|
2801
|
+
color: this.resolveColor(item.color)
|
|
2802
|
+
})) : [],
|
|
2803
|
+
background: style?.getPropertyValue("--tx-surface-card").trim() || "#ffffff",
|
|
2804
|
+
textColor: style?.color,
|
|
2805
|
+
fontFamily: style?.fontFamily
|
|
2806
|
+
});
|
|
2807
|
+
if (format === "svg") {
|
|
2808
|
+
downloadChartFile(document, new Blob([markup], { type: "image/svg+xml;charset=utf-8" }), name);
|
|
2809
|
+
return;
|
|
2810
|
+
}
|
|
2811
|
+
chartPngBlob(document, markup).then((blob) => downloadChartFile(document, blob, name)).catch(() => void 0);
|
|
2812
|
+
}
|
|
2813
|
+
resolveColor(color) {
|
|
2814
|
+
const host = this.host.nativeElement;
|
|
2815
|
+
const view = host.ownerDocument.defaultView;
|
|
2816
|
+
if (!view || !color.includes("var(")) return color;
|
|
2817
|
+
const probe = host.ownerDocument.createElement("span");
|
|
2818
|
+
probe.style.color = color;
|
|
2819
|
+
host.appendChild(probe);
|
|
2820
|
+
const resolved = view.getComputedStyle(probe).color;
|
|
2821
|
+
probe.remove();
|
|
2822
|
+
return resolved || color;
|
|
2823
|
+
}
|
|
2824
|
+
placeAnchor(x, y, width, height) {
|
|
2825
|
+
const anchor = this.anchorRef()?.nativeElement;
|
|
2826
|
+
if (!anchor) return;
|
|
2827
|
+
anchor.style.width = `${width}px`;
|
|
2828
|
+
anchor.style.height = `${height}px`;
|
|
2829
|
+
anchor.style.transform = `translate(${Math.round(x)}px, ${Math.round(y)}px)`;
|
|
2830
|
+
}
|
|
1734
2831
|
closeTooltip() {
|
|
1735
2832
|
if (this.ref) {
|
|
1736
2833
|
const ref = this.ref;
|
|
@@ -1901,12 +2998,47 @@ var TxChartFrame = class TxChartFrame {
|
|
|
1901
2998
|
isRequired: false,
|
|
1902
2999
|
transformFunction: null
|
|
1903
3000
|
},
|
|
3001
|
+
actionKeys: {
|
|
3002
|
+
classPropertyName: "actionKeys",
|
|
3003
|
+
publicName: "actionKeys",
|
|
3004
|
+
isSignal: true,
|
|
3005
|
+
isRequired: false,
|
|
3006
|
+
transformFunction: null
|
|
3007
|
+
},
|
|
3008
|
+
zoomable: {
|
|
3009
|
+
classPropertyName: "zoomable",
|
|
3010
|
+
publicName: "zoomable",
|
|
3011
|
+
isSignal: true,
|
|
3012
|
+
isRequired: false,
|
|
3013
|
+
transformFunction: null
|
|
3014
|
+
},
|
|
3015
|
+
zoomedIn: {
|
|
3016
|
+
classPropertyName: "zoomedIn",
|
|
3017
|
+
publicName: "zoomedIn",
|
|
3018
|
+
isSignal: true,
|
|
3019
|
+
isRequired: false,
|
|
3020
|
+
transformFunction: null
|
|
3021
|
+
},
|
|
1904
3022
|
plotHeight: {
|
|
1905
3023
|
classPropertyName: "plotHeight",
|
|
1906
3024
|
publicName: "plotHeight",
|
|
1907
3025
|
isSignal: true,
|
|
1908
3026
|
isRequired: false,
|
|
1909
3027
|
transformFunction: null
|
|
3028
|
+
},
|
|
3029
|
+
toolbar: {
|
|
3030
|
+
classPropertyName: "toolbar",
|
|
3031
|
+
publicName: "toolbar",
|
|
3032
|
+
isSignal: true,
|
|
3033
|
+
isRequired: false,
|
|
3034
|
+
transformFunction: null
|
|
3035
|
+
},
|
|
3036
|
+
exportName: {
|
|
3037
|
+
classPropertyName: "exportName",
|
|
3038
|
+
publicName: "exportName",
|
|
3039
|
+
isSignal: true,
|
|
3040
|
+
isRequired: false,
|
|
3041
|
+
transformFunction: null
|
|
1910
3042
|
}
|
|
1911
3043
|
},
|
|
1912
3044
|
outputs: {
|
|
@@ -1915,11 +3047,15 @@ var TxChartFrame = class TxChartFrame {
|
|
|
1915
3047
|
navigate: "navigate",
|
|
1916
3048
|
legendToggled: "legendToggled",
|
|
1917
3049
|
legendHovered: "legendHovered",
|
|
1918
|
-
tooltipClosed: "tooltipClosed"
|
|
3050
|
+
tooltipClosed: "tooltipClosed",
|
|
3051
|
+
zoomed: "zoomed",
|
|
3052
|
+
panned: "panned",
|
|
3053
|
+
zoomReset: "zoomReset"
|
|
1919
3054
|
},
|
|
1920
3055
|
host: {
|
|
1921
3056
|
properties: {
|
|
1922
3057
|
"attr.data-legend": "legendVisible() ? legendPosition() : null",
|
|
3058
|
+
"attr.data-toolbar": "toolbarRow()",
|
|
1923
3059
|
"attr.data-styled": "styled() || null",
|
|
1924
3060
|
"class.tx-chart-frame--fill": "fills()",
|
|
1925
3061
|
"class.tx-chart-frame--interactive": "interactive()",
|
|
@@ -1942,6 +3078,13 @@ var TxChartFrame = class TxChartFrame {
|
|
|
1942
3078
|
descendants: true,
|
|
1943
3079
|
isSignal: true
|
|
1944
3080
|
},
|
|
3081
|
+
{
|
|
3082
|
+
propertyName: "svgRef",
|
|
3083
|
+
first: true,
|
|
3084
|
+
predicate: ["chartSvg"],
|
|
3085
|
+
descendants: true,
|
|
3086
|
+
isSignal: true
|
|
3087
|
+
},
|
|
1945
3088
|
{
|
|
1946
3089
|
propertyName: "tooltipPanel",
|
|
1947
3090
|
first: true,
|
|
@@ -1951,8 +3094,8 @@ var TxChartFrame = class TxChartFrame {
|
|
|
1951
3094
|
}
|
|
1952
3095
|
],
|
|
1953
3096
|
ngImport: i0,
|
|
1954
|
-
template: "@if (legendVisible()) {\n <tx-chart-legend\n class=\"tx-chart-frame__legend\"\n [class]=\"parts().legend?.class\"\n [style]=\"parts().legend?.style\"\n [attr.data-styled]=\"styled() || null\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [align]=\"legendAlign()\"\n [variant]=\"legendVariant()\"\n [toggle]=\"legendToggle()\"\n [template]=\"legendTemplate()\"\n [itemPart]=\"parts().legendItem\"\n (toggled)=\"legendToggled.emit($event)\"\n (hovered)=\"legendHovered.emit($event)\"\n />\n}\n<div\n #plot\n class=\"tx-chart-frame__plot\"\n [class]=\"parts().plot?.class\"\n [style]=\"parts().plot?.style\"\n [style.height.px]=\"plotHeight()\"\n [class.tx-chart-frame__plot--fixed]=\"plotHeight() !== null\"\n [attr.role]=\"empty() || loading() ? null : 'img'\"\n [attr.aria-label]=\"empty() || loading() ? null : summary()\"\n [attr.aria-describedby]=\"interactive() && !empty() && !loading() ? hintId : null\"\n [attr.tabindex]=\"interactive() && !empty() && !loading() ? 0 : null\"\n (pointermove)=\"onPointer($event, 'move')\"\n (pointerdown)=\"onPointer($event, '
|
|
1955
|
-
styles: [":host{position:relative;display:flex;flex-direction:column;min-width:0;box-sizing:border-box}:host([data-legend=bottom]){flex-direction:column-reverse}:host([data-legend=left]){flex-direction:row}:host([data-legend=right]){flex-direction:row-reverse}:host([data-legend=left]) .tx-chart-frame__legend,:host([data-legend=right]) .tx-chart-frame__legend{flex:0 0 auto;align-self:center;max-height:100%;overflow:auto}.tx-chart-frame__plot{position:relative;flex:1 1 auto;min-width:0;min-height:0;outline:none}.tx-chart-frame__plot--fixed{flex:0 0 auto}:host([data-legend=left]) .tx-chart-frame__plot--fixed,:host([data-legend=right]) .tx-chart-frame__plot--fixed{flex:1 1 auto;align-self:center}.tx-chart-frame__svg{position:absolute;inset:0;display:block;width:100%;height:100%;overflow:visible}.tx-chart-frame__anchor{position:absolute;top:0;left:0;width:0;height:0;pointer-events:none}.tx-chart-frame__skeleton{position:absolute;inset:0}.tx-chart-frame__empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.tx-chart-frame__empty-icon{display:inline-flex;align-items:center;justify-content:center}.tx-chart-frame__tooltip{display:flex;flex-direction:column;white-space:nowrap;pointer-events:none}.tx-chart-frame__tooltip-row{display:flex;align-items:center}:host([data-styled]){gap:var(--tx-chart-legend-gap);color:var(--tx-chart-color);font-family:var(--tx-chart-font-family);background:var(--tx-chart-background)}:host([data-styled]) .tx-chart-frame__plot:focus-visible{border-radius:var(--tx-radius-sm);outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-chart-frame__empty{gap:var(--tx-chart-empty-gap);color:var(--tx-chart-empty-color);font-size:var(--tx-chart-empty-font-size)}:host([data-styled]) .tx-chart-frame__empty-icon{width:var(--tx-chart-empty-icon-size);height:var(--tx-chart-empty-icon-size);border-radius:var(--tx-radius-full);background:var(--tx-chart-empty-icon-background);color:var(--tx-chart-empty-icon-color);font-size:var(--tx-chart-empty-icon-font-size)}:host([data-styled][data-legend=left]),:host([data-styled][data-legend=right]){gap:var(--tx-chart-legend-item-gap)}:host([data-styled][data-legend=left]) .tx-chart-frame__legend,:host([data-styled][data-legend=right]) .tx-chart-frame__legend{max-width:var(--tx-chart-legend-side-width)}.tx-chart-frame__tooltip[data-styled]{position:relative;gap:var(--tx-chart-tooltip-row-gap);min-width:var(--tx-chart-tooltip-min-width);padding:var(--tx-chart-tooltip-padding);border:var(--tx-chart-tooltip-border-width) solid var(--tx-chart-tooltip-border-color);border-radius:var(--tx-chart-tooltip-border-radius);background:var(--tx-chart-tooltip-background);
|
|
3097
|
+
template: "@if (toolbar() || zoomedIn()) {\n <div class=\"tx-chart-frame__toolbar\">\n @if (zoomedIn()) {\n <button\n txButton\n type=\"button\"\n class=\"tx-chart-frame__reset\"\n icon=\"search-minus\"\n size=\"small\"\n severity=\"secondary\"\n text\n [label]=\"translations().chartResetZoom\"\n (click)=\"zoomReset.emit()\"\n ></button>\n }\n @if (toolbar() && canExport()) {\n <button\n txButton\n type=\"button\"\n class=\"tx-chart-frame__menu-button\"\n icon=\"bars\"\n size=\"small\"\n severity=\"secondary\"\n text\n aria-haspopup=\"menu\"\n [attr.aria-label]=\"translations().chartMenu\"\n [txPopoverTrigger]=\"exportPopover\"\n ></button>\n <tx-popover #exportPopover placement=\"bottom-end\" [dt]=\"popoverTokens\" [ariaLabel]=\"translations().chartMenu\" [unstyled]=\"!styled()\">\n <tx-chart-menu\n [items]=\"exportItems()\"\n [ariaLabel]=\"translations().chartMenu\"\n [unstyled]=\"!styled()\"\n (selected)=\"exportPopover.hide(); onExport($event)\"\n />\n </tx-popover>\n }\n </div>\n}\n@if (legendVisible()) {\n <tx-chart-legend\n class=\"tx-chart-frame__legend\"\n [class]=\"parts().legend?.class\"\n [style]=\"parts().legend?.style\"\n [attr.data-styled]=\"styled() || null\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [align]=\"legendAlign()\"\n [variant]=\"legendVariant()\"\n [toggle]=\"legendToggle()\"\n [template]=\"legendTemplate()\"\n [itemPart]=\"parts().legendItem\"\n (toggled)=\"legendToggled.emit($event)\"\n (hovered)=\"legendHovered.emit($event)\"\n />\n}\n<div\n #plot\n class=\"tx-chart-frame__plot\"\n [class]=\"parts().plot?.class\"\n [style]=\"parts().plot?.style\"\n [style.height.px]=\"plotHeight()\"\n [class.tx-chart-frame__plot--fixed]=\"plotHeight() !== null\"\n [attr.role]=\"empty() || loading() ? null : 'img'\"\n [attr.aria-label]=\"empty() || loading() ? null : summary()\"\n [attr.aria-describedby]=\"interactive() && !empty() && !loading() ? hintId : null\"\n [attr.tabindex]=\"interactive() && !empty() && !loading() ? 0 : null\"\n [class.tx-chart-frame__plot--zoomable]=\"zoomable()\"\n [class.tx-chart-frame__plot--zoomed]=\"zoomedIn()\"\n (pointermove)=\"onPointer($event, 'move')\"\n (pointerdown)=\"onPointer($event, 'down')\"\n (pointerup)=\"onPointer($event, 'up')\"\n (pointercancel)=\"onPointer($event, 'up')\"\n (pointerleave)=\"onPointer($event, 'leave')\"\n (click)=\"onPointer($event, 'click')\"\n (wheel)=\"onWheel($event)\"\n (dblclick)=\"onDoubleClick()\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"pointer.emit({ x: 0, y: 0, type: 'leave', target: null })\"\n>\n @if (loading()) {\n <tx-skeleton\n class=\"tx-chart-frame__skeleton\"\n [class]=\"parts().skeleton?.class\"\n [style]=\"parts().skeleton?.style\"\n width=\"100%\"\n height=\"100%\"\n [unstyled]=\"!styled()\"\n [attr.aria-label]=\"translations().chartLoading\"\n role=\"status\"\n />\n } @else if (empty()) {\n <div class=\"tx-chart-frame__empty\" role=\"status\" [class]=\"parts().empty?.class\" [style]=\"parts().empty?.style\">\n <span class=\"tx-chart-frame__empty-icon\" aria-hidden=\"true\"><tx-icon [name]=\"emptyIcon()\" /></span>\n <span class=\"tx-chart-frame__empty-text\">{{ translations().chartNoData }}</span>\n </div>\n } @else {\n <svg\n #chartSvg\n class=\"tx-chart-frame__svg\"\n [class]=\"parts().svg?.class\"\n [style]=\"parts().svg?.style\"\n xmlns=\"http://www.w3.org/2000/svg\"\n focusable=\"false\"\n aria-hidden=\"true\"\n preserveAspectRatio=\"xMinYMin meet\"\n [attr.viewBox]=\"viewBox()\"\n >\n <ng-content />\n </svg>\n <span #anchor class=\"tx-chart-frame__anchor\" aria-hidden=\"true\"></span>\n }\n</div>\n@if (interactive() && !empty() && !loading()) {\n <span class=\"cdk-visually-hidden\" [id]=\"hintId\">{{ translations().chartNavigateHint }}{{ zoomable() ? '. ' + translations().chartZoomHint : '' }}</span>\n}\n@if (table(); as data) {\n @if (!empty() && !loading()) {\n <table class=\"cdk-visually-hidden\">\n <caption>\n {{ summary() || translations().chartDataTable }}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">{{ translations().chartCategory }}</th>\n @for (column of data.columns; track column.key) {\n <th scope=\"col\">{{ column.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of data.rows; track $index) {\n <tr>\n <th scope=\"row\">{{ row.label }}</th>\n @for (cell of row.cells; track $index) {\n <td>{{ cell }}</td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n}\n\n<ng-template #tooltipPanel>\n @if (shown(); as data) {\n <div\n class=\"tx-chart-frame__tooltip\"\n role=\"presentation\"\n [class]=\"parts().tooltip?.class\"\n [style]=\"panelStyle()\"\n [style.--tx-chart-tooltip-arrow-offset]=\"arrowOffset()\"\n [attr.data-side]=\"side()\"\n [attr.data-follow]=\"following() || null\"\n [attr.data-styled]=\"styled() || null\"\n >\n @if (styled()) {\n <svg class=\"tx-chart-frame__tooltip-arrow\" aria-hidden=\"true\" viewBox=\"0 0 12 6\" preserveAspectRatio=\"none\">\n <path class=\"tx-chart-frame__tooltip-arrow-fill\" d=\"M0 6 L6 0 L12 6 Z\" />\n <path class=\"tx-chart-frame__tooltip-arrow-line\" d=\"M0 6 L6 0 L12 6\" />\n </svg>\n }\n @if (tooltipTemplate(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom\" [ngTemplateOutletContext]=\"{ $implicit: data }\" />\n } @else {\n @if (data.title) {\n <div class=\"tx-chart-frame__tooltip-title\">{{ data.title }}</div>\n }\n @for (row of data.rows; track $index) {\n <div class=\"tx-chart-frame__tooltip-row\" [class.tx-chart-frame__tooltip-row--active]=\"row.active && data.rows.length > 1\">\n <span class=\"tx-chart-frame__tooltip-marker\" [style.background]=\"row.color\"></span>\n <span class=\"tx-chart-frame__tooltip-label\">{{ row.label }}</span>\n <span class=\"tx-chart-frame__tooltip-value\">{{ row.value }}</span>\n @if (row.share) {\n <span class=\"tx-chart-frame__tooltip-share\">{{ row.share }}</span>\n }\n </div>\n }\n @if (data.total) {\n <div class=\"tx-chart-frame__tooltip-row tx-chart-frame__tooltip-total\">\n <span class=\"tx-chart-frame__tooltip-label\">{{ translations().chartTotal }}</span>\n <span class=\"tx-chart-frame__tooltip-value\">{{ data.total }}</span>\n </div>\n }\n @if (data.note) {\n <div class=\"tx-chart-frame__tooltip-note\">{{ data.note }}</div>\n }\n }\n </div>\n }\n</ng-template>\n",
|
|
3098
|
+
styles: [":host{position:relative;display:flex;flex-direction:column;min-width:0;box-sizing:border-box}:host([data-legend=bottom]){flex-direction:column-reverse}:host([data-legend=left]){flex-direction:row}:host([data-legend=right]){flex-direction:row-reverse}:host([data-legend=left]) .tx-chart-frame__legend,:host([data-legend=right]) .tx-chart-frame__legend{flex:0 0 auto;align-self:center;max-height:100%;overflow:auto}.tx-chart-frame__toolbar{position:absolute;top:0;right:0;z-index:1;display:flex;align-items:center;justify-content:flex-end}:host([data-toolbar=own]){padding-top:var(--tx-chart-toolbar-row-height)}:host([data-toolbar=legend]) .tx-chart-frame__legend{padding-inline-end:var(--tx-chart-toolbar-reserve)}.tx-chart-frame__plot{position:relative;flex:1 1 auto;min-width:0;min-height:0;outline:none}.tx-chart-frame__plot--zoomable{touch-action:pan-y}.tx-chart-frame__plot--zoomed{cursor:grab}.tx-chart-frame__plot--zoomed:active{cursor:grabbing}.tx-chart-frame__plot--fixed{flex:0 0 auto}:host([data-legend=left]) .tx-chart-frame__plot--fixed,:host([data-legend=right]) .tx-chart-frame__plot--fixed{flex:1 1 auto;align-self:center}.tx-chart-frame__svg{position:absolute;inset:0;display:block;width:100%;height:100%;overflow:visible}.tx-chart-frame__anchor{position:absolute;top:0;left:0;width:0;height:0;pointer-events:none}.tx-chart-frame__skeleton{position:absolute;inset:0}.tx-chart-frame__empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.tx-chart-frame__empty-icon{display:inline-flex;align-items:center;justify-content:center}.tx-chart-frame__tooltip{display:flex;flex-direction:column;white-space:nowrap;pointer-events:none}.tx-chart-frame__tooltip-row{display:flex;align-items:center}:host([data-styled]){gap:var(--tx-chart-legend-gap);color:var(--tx-chart-color);font-family:var(--tx-chart-font-family);background:var(--tx-chart-background)}:host([data-styled]) .tx-chart-frame__plot:focus-visible{border-radius:var(--tx-radius-sm);outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-chart-frame__empty{gap:var(--tx-chart-empty-gap);color:var(--tx-chart-empty-color);font-size:var(--tx-chart-empty-font-size)}:host([data-styled]) .tx-chart-frame__empty-icon{width:var(--tx-chart-empty-icon-size);height:var(--tx-chart-empty-icon-size);border-radius:var(--tx-radius-full);background:var(--tx-chart-empty-icon-background);color:var(--tx-chart-empty-icon-color);font-size:var(--tx-chart-empty-icon-font-size)}:host([data-styled][data-legend=left]),:host([data-styled][data-legend=right]){gap:var(--tx-chart-legend-item-gap)}:host([data-styled][data-legend=left]) .tx-chart-frame__legend,:host([data-styled][data-legend=right]) .tx-chart-frame__legend{max-width:var(--tx-chart-legend-side-width)}.tx-chart-frame__tooltip[data-styled]{position:relative;gap:var(--tx-chart-tooltip-row-gap);min-width:var(--tx-chart-tooltip-min-width);padding:var(--tx-chart-tooltip-padding);border:var(--tx-chart-tooltip-border-width) solid var(--tx-chart-tooltip-border-color);border-radius:var(--tx-chart-tooltip-border-radius);background:var(--tx-chart-tooltip-background);filter:var(--tx-chart-tooltip-shadow);color:var(--tx-chart-tooltip-color);font-family:var(--tx-chart-font-family);font-size:var(--tx-chart-tooltip-font-size);line-height:1.35}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-arrow{position:absolute;display:block;width:calc(var(--tx-chart-tooltip-arrow-size) * 2);height:var(--tx-chart-tooltip-arrow-size);overflow:visible}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-arrow-fill{fill:var(--tx-chart-tooltip-background)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-arrow-line{fill:none;stroke:var(--tx-chart-tooltip-border-color);stroke-width:var(--tx-chart-tooltip-border-width);stroke-linejoin:round;vector-effect:non-scaling-stroke}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-title{margin-bottom:2px;color:var(--tx-chart-tooltip-muted-color);font-size:var(--tx-chart-tooltip-title-font-size);font-weight:var(--tx-chart-tooltip-title-font-weight)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-row{gap:var(--tx-chart-tooltip-marker-gap)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-note{margin-top:2px;color:var(--tx-chart-tooltip-note-color);font-size:var(--tx-chart-tooltip-title-font-size)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-marker{flex-shrink:0;width:var(--tx-chart-tooltip-marker-size);height:var(--tx-chart-tooltip-marker-size);border-radius:var(--tx-radius-full)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-label{color:var(--tx-chart-tooltip-muted-color)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-row--active .tx-chart-frame__tooltip-label{color:var(--tx-chart-tooltip-color)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-share{min-width:4ch;color:var(--tx-chart-tooltip-muted-color);font-variant-numeric:tabular-nums;text-align:end}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-value{margin-inline-start:auto;padding-inline-start:var(--tx-chart-tooltip-value-gap);font-weight:var(--tx-chart-tooltip-value-font-weight);font-variant-numeric:tabular-nums}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-total{margin-top:2px;padding-top:calc(var(--tx-chart-tooltip-row-gap) + 2px);border-top:1px solid var(--tx-chart-tooltip-total-border-color)}.tx-chart-frame__tooltip[data-styled][data-side=top] .tx-chart-frame__tooltip-arrow,.tx-chart-frame__tooltip[data-styled][data-side=bottom] .tx-chart-frame__tooltip-arrow{left:clamp(var(--tx-chart-tooltip-border-radius) + var(--tx-chart-tooltip-arrow-size),var(--tx-chart-tooltip-arrow-offset),100% - var(--tx-chart-tooltip-border-radius) - var(--tx-chart-tooltip-arrow-size));margin-left:calc(var(--tx-chart-tooltip-arrow-size) * -1)}.tx-chart-frame__tooltip[data-styled][data-side=left] .tx-chart-frame__tooltip-arrow,.tx-chart-frame__tooltip[data-styled][data-side=right] .tx-chart-frame__tooltip-arrow{top:clamp(var(--tx-chart-tooltip-border-radius) + var(--tx-chart-tooltip-arrow-size) / 2,var(--tx-chart-tooltip-arrow-offset),100% - var(--tx-chart-tooltip-border-radius) - var(--tx-chart-tooltip-arrow-size) / 2);margin-top:calc(var(--tx-chart-tooltip-arrow-size) / -2)}.tx-chart-frame__tooltip[data-styled][data-side=bottom] .tx-chart-frame__tooltip-arrow{top:calc(var(--tx-chart-tooltip-arrow-size) * -1)}.tx-chart-frame__tooltip[data-styled][data-side=top] .tx-chart-frame__tooltip-arrow{bottom:calc(var(--tx-chart-tooltip-arrow-size) * -1);transform:rotate(180deg)}.tx-chart-frame__tooltip[data-styled][data-side=left] .tx-chart-frame__tooltip-arrow{right:calc(var(--tx-chart-tooltip-arrow-size) * -1.5);transform:rotate(90deg)}.tx-chart-frame__tooltip[data-styled][data-side=right] .tx-chart-frame__tooltip-arrow{left:calc(var(--tx-chart-tooltip-arrow-size) * -1.5);transform:rotate(-90deg)}\n"],
|
|
1956
3099
|
dependencies: [
|
|
1957
3100
|
{
|
|
1958
3101
|
kind: "directive",
|
|
@@ -2002,6 +3145,84 @@ var TxChartFrame = class TxChartFrame {
|
|
|
2002
3145
|
"ptOptions",
|
|
2003
3146
|
"unstyled"
|
|
2004
3147
|
]
|
|
3148
|
+
},
|
|
3149
|
+
{
|
|
3150
|
+
kind: "component",
|
|
3151
|
+
type: TxButton,
|
|
3152
|
+
selector: "button[txButton], a[txButton]",
|
|
3153
|
+
inputs: [
|
|
3154
|
+
"label",
|
|
3155
|
+
"severity",
|
|
3156
|
+
"size",
|
|
3157
|
+
"variant",
|
|
3158
|
+
"outlined",
|
|
3159
|
+
"text",
|
|
3160
|
+
"link",
|
|
3161
|
+
"rounded",
|
|
3162
|
+
"raised",
|
|
3163
|
+
"plain",
|
|
3164
|
+
"fluid",
|
|
3165
|
+
"disabled",
|
|
3166
|
+
"tabindex",
|
|
3167
|
+
"icon",
|
|
3168
|
+
"iconPos",
|
|
3169
|
+
"iconOnly",
|
|
3170
|
+
"loading",
|
|
3171
|
+
"loadingIcon",
|
|
3172
|
+
"badge",
|
|
3173
|
+
"badgeSeverity",
|
|
3174
|
+
"dt",
|
|
3175
|
+
"pt",
|
|
3176
|
+
"ptOptions",
|
|
3177
|
+
"unstyled"
|
|
3178
|
+
]
|
|
3179
|
+
},
|
|
3180
|
+
{
|
|
3181
|
+
kind: "component",
|
|
3182
|
+
type: TxPopover,
|
|
3183
|
+
selector: "tx-popover",
|
|
3184
|
+
inputs: [
|
|
3185
|
+
"placement",
|
|
3186
|
+
"offset",
|
|
3187
|
+
"arrow",
|
|
3188
|
+
"header",
|
|
3189
|
+
"closeButton",
|
|
3190
|
+
"dismissable",
|
|
3191
|
+
"closeOnEscape",
|
|
3192
|
+
"autoFocus",
|
|
3193
|
+
"restoreFocus",
|
|
3194
|
+
"scroll",
|
|
3195
|
+
"ariaLabel",
|
|
3196
|
+
"ariaLabelledBy",
|
|
3197
|
+
"panelClass",
|
|
3198
|
+
"open",
|
|
3199
|
+
"dt",
|
|
3200
|
+
"pt",
|
|
3201
|
+
"ptOptions",
|
|
3202
|
+
"unstyled"
|
|
3203
|
+
],
|
|
3204
|
+
outputs: [
|
|
3205
|
+
"openChange",
|
|
3206
|
+
"opened",
|
|
3207
|
+
"closed"
|
|
3208
|
+
]
|
|
3209
|
+
},
|
|
3210
|
+
{
|
|
3211
|
+
kind: "directive",
|
|
3212
|
+
type: TxPopoverTrigger,
|
|
3213
|
+
selector: "[txPopoverTrigger]",
|
|
3214
|
+
inputs: ["txPopoverTrigger"]
|
|
3215
|
+
},
|
|
3216
|
+
{
|
|
3217
|
+
kind: "component",
|
|
3218
|
+
type: TxChartMenu,
|
|
3219
|
+
selector: "tx-chart-menu",
|
|
3220
|
+
inputs: [
|
|
3221
|
+
"items",
|
|
3222
|
+
"ariaLabel",
|
|
3223
|
+
"unstyled"
|
|
3224
|
+
],
|
|
3225
|
+
outputs: ["selected"]
|
|
2005
3226
|
}
|
|
2006
3227
|
],
|
|
2007
3228
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
@@ -2020,19 +3241,24 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2020
3241
|
NgTemplateOutlet,
|
|
2021
3242
|
TxChartLegend,
|
|
2022
3243
|
TxIcon,
|
|
2023
|
-
TxSkeleton
|
|
3244
|
+
TxSkeleton,
|
|
3245
|
+
TxButton,
|
|
3246
|
+
TxPopover,
|
|
3247
|
+
TxPopoverTrigger,
|
|
3248
|
+
TxChartMenu
|
|
2024
3249
|
],
|
|
2025
3250
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2026
3251
|
host: {
|
|
2027
3252
|
class: "tx-chart-frame",
|
|
2028
3253
|
"[attr.data-legend]": "legendVisible() ? legendPosition() : null",
|
|
3254
|
+
"[attr.data-toolbar]": "toolbarRow()",
|
|
2029
3255
|
"[attr.data-styled]": "styled() || null",
|
|
2030
3256
|
"[class.tx-chart-frame--fill]": "fills()",
|
|
2031
3257
|
"[class.tx-chart-frame--interactive]": "interactive()",
|
|
2032
3258
|
"[style.height]": "cssHeight()"
|
|
2033
3259
|
},
|
|
2034
|
-
template: "@if (legendVisible()) {\n <tx-chart-legend\n class=\"tx-chart-frame__legend\"\n [class]=\"parts().legend?.class\"\n [style]=\"parts().legend?.style\"\n [attr.data-styled]=\"styled() || null\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [align]=\"legendAlign()\"\n [variant]=\"legendVariant()\"\n [toggle]=\"legendToggle()\"\n [template]=\"legendTemplate()\"\n [itemPart]=\"parts().legendItem\"\n (toggled)=\"legendToggled.emit($event)\"\n (hovered)=\"legendHovered.emit($event)\"\n />\n}\n<div\n #plot\n class=\"tx-chart-frame__plot\"\n [class]=\"parts().plot?.class\"\n [style]=\"parts().plot?.style\"\n [style.height.px]=\"plotHeight()\"\n [class.tx-chart-frame__plot--fixed]=\"plotHeight() !== null\"\n [attr.role]=\"empty() || loading() ? null : 'img'\"\n [attr.aria-label]=\"empty() || loading() ? null : summary()\"\n [attr.aria-describedby]=\"interactive() && !empty() && !loading() ? hintId : null\"\n [attr.tabindex]=\"interactive() && !empty() && !loading() ? 0 : null\"\n (pointermove)=\"onPointer($event, 'move')\"\n (pointerdown)=\"onPointer($event, '
|
|
2035
|
-
styles: [":host{position:relative;display:flex;flex-direction:column;min-width:0;box-sizing:border-box}:host([data-legend=bottom]){flex-direction:column-reverse}:host([data-legend=left]){flex-direction:row}:host([data-legend=right]){flex-direction:row-reverse}:host([data-legend=left]) .tx-chart-frame__legend,:host([data-legend=right]) .tx-chart-frame__legend{flex:0 0 auto;align-self:center;max-height:100%;overflow:auto}.tx-chart-frame__plot{position:relative;flex:1 1 auto;min-width:0;min-height:0;outline:none}.tx-chart-frame__plot--fixed{flex:0 0 auto}:host([data-legend=left]) .tx-chart-frame__plot--fixed,:host([data-legend=right]) .tx-chart-frame__plot--fixed{flex:1 1 auto;align-self:center}.tx-chart-frame__svg{position:absolute;inset:0;display:block;width:100%;height:100%;overflow:visible}.tx-chart-frame__anchor{position:absolute;top:0;left:0;width:0;height:0;pointer-events:none}.tx-chart-frame__skeleton{position:absolute;inset:0}.tx-chart-frame__empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.tx-chart-frame__empty-icon{display:inline-flex;align-items:center;justify-content:center}.tx-chart-frame__tooltip{display:flex;flex-direction:column;white-space:nowrap;pointer-events:none}.tx-chart-frame__tooltip-row{display:flex;align-items:center}:host([data-styled]){gap:var(--tx-chart-legend-gap);color:var(--tx-chart-color);font-family:var(--tx-chart-font-family);background:var(--tx-chart-background)}:host([data-styled]) .tx-chart-frame__plot:focus-visible{border-radius:var(--tx-radius-sm);outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-chart-frame__empty{gap:var(--tx-chart-empty-gap);color:var(--tx-chart-empty-color);font-size:var(--tx-chart-empty-font-size)}:host([data-styled]) .tx-chart-frame__empty-icon{width:var(--tx-chart-empty-icon-size);height:var(--tx-chart-empty-icon-size);border-radius:var(--tx-radius-full);background:var(--tx-chart-empty-icon-background);color:var(--tx-chart-empty-icon-color);font-size:var(--tx-chart-empty-icon-font-size)}:host([data-styled][data-legend=left]),:host([data-styled][data-legend=right]){gap:var(--tx-chart-legend-item-gap)}:host([data-styled][data-legend=left]) .tx-chart-frame__legend,:host([data-styled][data-legend=right]) .tx-chart-frame__legend{max-width:var(--tx-chart-legend-side-width)}.tx-chart-frame__tooltip[data-styled]{position:relative;gap:var(--tx-chart-tooltip-row-gap);min-width:var(--tx-chart-tooltip-min-width);padding:var(--tx-chart-tooltip-padding);border:var(--tx-chart-tooltip-border-width) solid var(--tx-chart-tooltip-border-color);border-radius:var(--tx-chart-tooltip-border-radius);background:var(--tx-chart-tooltip-background);
|
|
3260
|
+
template: "@if (toolbar() || zoomedIn()) {\n <div class=\"tx-chart-frame__toolbar\">\n @if (zoomedIn()) {\n <button\n txButton\n type=\"button\"\n class=\"tx-chart-frame__reset\"\n icon=\"search-minus\"\n size=\"small\"\n severity=\"secondary\"\n text\n [label]=\"translations().chartResetZoom\"\n (click)=\"zoomReset.emit()\"\n ></button>\n }\n @if (toolbar() && canExport()) {\n <button\n txButton\n type=\"button\"\n class=\"tx-chart-frame__menu-button\"\n icon=\"bars\"\n size=\"small\"\n severity=\"secondary\"\n text\n aria-haspopup=\"menu\"\n [attr.aria-label]=\"translations().chartMenu\"\n [txPopoverTrigger]=\"exportPopover\"\n ></button>\n <tx-popover #exportPopover placement=\"bottom-end\" [dt]=\"popoverTokens\" [ariaLabel]=\"translations().chartMenu\" [unstyled]=\"!styled()\">\n <tx-chart-menu\n [items]=\"exportItems()\"\n [ariaLabel]=\"translations().chartMenu\"\n [unstyled]=\"!styled()\"\n (selected)=\"exportPopover.hide(); onExport($event)\"\n />\n </tx-popover>\n }\n </div>\n}\n@if (legendVisible()) {\n <tx-chart-legend\n class=\"tx-chart-frame__legend\"\n [class]=\"parts().legend?.class\"\n [style]=\"parts().legend?.style\"\n [attr.data-styled]=\"styled() || null\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [align]=\"legendAlign()\"\n [variant]=\"legendVariant()\"\n [toggle]=\"legendToggle()\"\n [template]=\"legendTemplate()\"\n [itemPart]=\"parts().legendItem\"\n (toggled)=\"legendToggled.emit($event)\"\n (hovered)=\"legendHovered.emit($event)\"\n />\n}\n<div\n #plot\n class=\"tx-chart-frame__plot\"\n [class]=\"parts().plot?.class\"\n [style]=\"parts().plot?.style\"\n [style.height.px]=\"plotHeight()\"\n [class.tx-chart-frame__plot--fixed]=\"plotHeight() !== null\"\n [attr.role]=\"empty() || loading() ? null : 'img'\"\n [attr.aria-label]=\"empty() || loading() ? null : summary()\"\n [attr.aria-describedby]=\"interactive() && !empty() && !loading() ? hintId : null\"\n [attr.tabindex]=\"interactive() && !empty() && !loading() ? 0 : null\"\n [class.tx-chart-frame__plot--zoomable]=\"zoomable()\"\n [class.tx-chart-frame__plot--zoomed]=\"zoomedIn()\"\n (pointermove)=\"onPointer($event, 'move')\"\n (pointerdown)=\"onPointer($event, 'down')\"\n (pointerup)=\"onPointer($event, 'up')\"\n (pointercancel)=\"onPointer($event, 'up')\"\n (pointerleave)=\"onPointer($event, 'leave')\"\n (click)=\"onPointer($event, 'click')\"\n (wheel)=\"onWheel($event)\"\n (dblclick)=\"onDoubleClick()\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"pointer.emit({ x: 0, y: 0, type: 'leave', target: null })\"\n>\n @if (loading()) {\n <tx-skeleton\n class=\"tx-chart-frame__skeleton\"\n [class]=\"parts().skeleton?.class\"\n [style]=\"parts().skeleton?.style\"\n width=\"100%\"\n height=\"100%\"\n [unstyled]=\"!styled()\"\n [attr.aria-label]=\"translations().chartLoading\"\n role=\"status\"\n />\n } @else if (empty()) {\n <div class=\"tx-chart-frame__empty\" role=\"status\" [class]=\"parts().empty?.class\" [style]=\"parts().empty?.style\">\n <span class=\"tx-chart-frame__empty-icon\" aria-hidden=\"true\"><tx-icon [name]=\"emptyIcon()\" /></span>\n <span class=\"tx-chart-frame__empty-text\">{{ translations().chartNoData }}</span>\n </div>\n } @else {\n <svg\n #chartSvg\n class=\"tx-chart-frame__svg\"\n [class]=\"parts().svg?.class\"\n [style]=\"parts().svg?.style\"\n xmlns=\"http://www.w3.org/2000/svg\"\n focusable=\"false\"\n aria-hidden=\"true\"\n preserveAspectRatio=\"xMinYMin meet\"\n [attr.viewBox]=\"viewBox()\"\n >\n <ng-content />\n </svg>\n <span #anchor class=\"tx-chart-frame__anchor\" aria-hidden=\"true\"></span>\n }\n</div>\n@if (interactive() && !empty() && !loading()) {\n <span class=\"cdk-visually-hidden\" [id]=\"hintId\">{{ translations().chartNavigateHint }}{{ zoomable() ? '. ' + translations().chartZoomHint : '' }}</span>\n}\n@if (table(); as data) {\n @if (!empty() && !loading()) {\n <table class=\"cdk-visually-hidden\">\n <caption>\n {{ summary() || translations().chartDataTable }}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">{{ translations().chartCategory }}</th>\n @for (column of data.columns; track column.key) {\n <th scope=\"col\">{{ column.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of data.rows; track $index) {\n <tr>\n <th scope=\"row\">{{ row.label }}</th>\n @for (cell of row.cells; track $index) {\n <td>{{ cell }}</td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n}\n\n<ng-template #tooltipPanel>\n @if (shown(); as data) {\n <div\n class=\"tx-chart-frame__tooltip\"\n role=\"presentation\"\n [class]=\"parts().tooltip?.class\"\n [style]=\"panelStyle()\"\n [style.--tx-chart-tooltip-arrow-offset]=\"arrowOffset()\"\n [attr.data-side]=\"side()\"\n [attr.data-follow]=\"following() || null\"\n [attr.data-styled]=\"styled() || null\"\n >\n @if (styled()) {\n <svg class=\"tx-chart-frame__tooltip-arrow\" aria-hidden=\"true\" viewBox=\"0 0 12 6\" preserveAspectRatio=\"none\">\n <path class=\"tx-chart-frame__tooltip-arrow-fill\" d=\"M0 6 L6 0 L12 6 Z\" />\n <path class=\"tx-chart-frame__tooltip-arrow-line\" d=\"M0 6 L6 0 L12 6\" />\n </svg>\n }\n @if (tooltipTemplate(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom\" [ngTemplateOutletContext]=\"{ $implicit: data }\" />\n } @else {\n @if (data.title) {\n <div class=\"tx-chart-frame__tooltip-title\">{{ data.title }}</div>\n }\n @for (row of data.rows; track $index) {\n <div class=\"tx-chart-frame__tooltip-row\" [class.tx-chart-frame__tooltip-row--active]=\"row.active && data.rows.length > 1\">\n <span class=\"tx-chart-frame__tooltip-marker\" [style.background]=\"row.color\"></span>\n <span class=\"tx-chart-frame__tooltip-label\">{{ row.label }}</span>\n <span class=\"tx-chart-frame__tooltip-value\">{{ row.value }}</span>\n @if (row.share) {\n <span class=\"tx-chart-frame__tooltip-share\">{{ row.share }}</span>\n }\n </div>\n }\n @if (data.total) {\n <div class=\"tx-chart-frame__tooltip-row tx-chart-frame__tooltip-total\">\n <span class=\"tx-chart-frame__tooltip-label\">{{ translations().chartTotal }}</span>\n <span class=\"tx-chart-frame__tooltip-value\">{{ data.total }}</span>\n </div>\n }\n @if (data.note) {\n <div class=\"tx-chart-frame__tooltip-note\">{{ data.note }}</div>\n }\n }\n </div>\n }\n</ng-template>\n",
|
|
3261
|
+
styles: [":host{position:relative;display:flex;flex-direction:column;min-width:0;box-sizing:border-box}:host([data-legend=bottom]){flex-direction:column-reverse}:host([data-legend=left]){flex-direction:row}:host([data-legend=right]){flex-direction:row-reverse}:host([data-legend=left]) .tx-chart-frame__legend,:host([data-legend=right]) .tx-chart-frame__legend{flex:0 0 auto;align-self:center;max-height:100%;overflow:auto}.tx-chart-frame__toolbar{position:absolute;top:0;right:0;z-index:1;display:flex;align-items:center;justify-content:flex-end}:host([data-toolbar=own]){padding-top:var(--tx-chart-toolbar-row-height)}:host([data-toolbar=legend]) .tx-chart-frame__legend{padding-inline-end:var(--tx-chart-toolbar-reserve)}.tx-chart-frame__plot{position:relative;flex:1 1 auto;min-width:0;min-height:0;outline:none}.tx-chart-frame__plot--zoomable{touch-action:pan-y}.tx-chart-frame__plot--zoomed{cursor:grab}.tx-chart-frame__plot--zoomed:active{cursor:grabbing}.tx-chart-frame__plot--fixed{flex:0 0 auto}:host([data-legend=left]) .tx-chart-frame__plot--fixed,:host([data-legend=right]) .tx-chart-frame__plot--fixed{flex:1 1 auto;align-self:center}.tx-chart-frame__svg{position:absolute;inset:0;display:block;width:100%;height:100%;overflow:visible}.tx-chart-frame__anchor{position:absolute;top:0;left:0;width:0;height:0;pointer-events:none}.tx-chart-frame__skeleton{position:absolute;inset:0}.tx-chart-frame__empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.tx-chart-frame__empty-icon{display:inline-flex;align-items:center;justify-content:center}.tx-chart-frame__tooltip{display:flex;flex-direction:column;white-space:nowrap;pointer-events:none}.tx-chart-frame__tooltip-row{display:flex;align-items:center}:host([data-styled]){gap:var(--tx-chart-legend-gap);color:var(--tx-chart-color);font-family:var(--tx-chart-font-family);background:var(--tx-chart-background)}:host([data-styled]) .tx-chart-frame__plot:focus-visible{border-radius:var(--tx-radius-sm);outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-chart-frame__empty{gap:var(--tx-chart-empty-gap);color:var(--tx-chart-empty-color);font-size:var(--tx-chart-empty-font-size)}:host([data-styled]) .tx-chart-frame__empty-icon{width:var(--tx-chart-empty-icon-size);height:var(--tx-chart-empty-icon-size);border-radius:var(--tx-radius-full);background:var(--tx-chart-empty-icon-background);color:var(--tx-chart-empty-icon-color);font-size:var(--tx-chart-empty-icon-font-size)}:host([data-styled][data-legend=left]),:host([data-styled][data-legend=right]){gap:var(--tx-chart-legend-item-gap)}:host([data-styled][data-legend=left]) .tx-chart-frame__legend,:host([data-styled][data-legend=right]) .tx-chart-frame__legend{max-width:var(--tx-chart-legend-side-width)}.tx-chart-frame__tooltip[data-styled]{position:relative;gap:var(--tx-chart-tooltip-row-gap);min-width:var(--tx-chart-tooltip-min-width);padding:var(--tx-chart-tooltip-padding);border:var(--tx-chart-tooltip-border-width) solid var(--tx-chart-tooltip-border-color);border-radius:var(--tx-chart-tooltip-border-radius);background:var(--tx-chart-tooltip-background);filter:var(--tx-chart-tooltip-shadow);color:var(--tx-chart-tooltip-color);font-family:var(--tx-chart-font-family);font-size:var(--tx-chart-tooltip-font-size);line-height:1.35}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-arrow{position:absolute;display:block;width:calc(var(--tx-chart-tooltip-arrow-size) * 2);height:var(--tx-chart-tooltip-arrow-size);overflow:visible}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-arrow-fill{fill:var(--tx-chart-tooltip-background)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-arrow-line{fill:none;stroke:var(--tx-chart-tooltip-border-color);stroke-width:var(--tx-chart-tooltip-border-width);stroke-linejoin:round;vector-effect:non-scaling-stroke}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-title{margin-bottom:2px;color:var(--tx-chart-tooltip-muted-color);font-size:var(--tx-chart-tooltip-title-font-size);font-weight:var(--tx-chart-tooltip-title-font-weight)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-row{gap:var(--tx-chart-tooltip-marker-gap)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-note{margin-top:2px;color:var(--tx-chart-tooltip-note-color);font-size:var(--tx-chart-tooltip-title-font-size)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-marker{flex-shrink:0;width:var(--tx-chart-tooltip-marker-size);height:var(--tx-chart-tooltip-marker-size);border-radius:var(--tx-radius-full)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-label{color:var(--tx-chart-tooltip-muted-color)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-row--active .tx-chart-frame__tooltip-label{color:var(--tx-chart-tooltip-color)}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-share{min-width:4ch;color:var(--tx-chart-tooltip-muted-color);font-variant-numeric:tabular-nums;text-align:end}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-value{margin-inline-start:auto;padding-inline-start:var(--tx-chart-tooltip-value-gap);font-weight:var(--tx-chart-tooltip-value-font-weight);font-variant-numeric:tabular-nums}.tx-chart-frame__tooltip[data-styled] .tx-chart-frame__tooltip-total{margin-top:2px;padding-top:calc(var(--tx-chart-tooltip-row-gap) + 2px);border-top:1px solid var(--tx-chart-tooltip-total-border-color)}.tx-chart-frame__tooltip[data-styled][data-side=top] .tx-chart-frame__tooltip-arrow,.tx-chart-frame__tooltip[data-styled][data-side=bottom] .tx-chart-frame__tooltip-arrow{left:clamp(var(--tx-chart-tooltip-border-radius) + var(--tx-chart-tooltip-arrow-size),var(--tx-chart-tooltip-arrow-offset),100% - var(--tx-chart-tooltip-border-radius) - var(--tx-chart-tooltip-arrow-size));margin-left:calc(var(--tx-chart-tooltip-arrow-size) * -1)}.tx-chart-frame__tooltip[data-styled][data-side=left] .tx-chart-frame__tooltip-arrow,.tx-chart-frame__tooltip[data-styled][data-side=right] .tx-chart-frame__tooltip-arrow{top:clamp(var(--tx-chart-tooltip-border-radius) + var(--tx-chart-tooltip-arrow-size) / 2,var(--tx-chart-tooltip-arrow-offset),100% - var(--tx-chart-tooltip-border-radius) - var(--tx-chart-tooltip-arrow-size) / 2);margin-top:calc(var(--tx-chart-tooltip-arrow-size) / -2)}.tx-chart-frame__tooltip[data-styled][data-side=bottom] .tx-chart-frame__tooltip-arrow{top:calc(var(--tx-chart-tooltip-arrow-size) * -1)}.tx-chart-frame__tooltip[data-styled][data-side=top] .tx-chart-frame__tooltip-arrow{bottom:calc(var(--tx-chart-tooltip-arrow-size) * -1);transform:rotate(180deg)}.tx-chart-frame__tooltip[data-styled][data-side=left] .tx-chart-frame__tooltip-arrow{right:calc(var(--tx-chart-tooltip-arrow-size) * -1.5);transform:rotate(90deg)}.tx-chart-frame__tooltip[data-styled][data-side=right] .tx-chart-frame__tooltip-arrow{left:calc(var(--tx-chart-tooltip-arrow-size) * -1.5);transform:rotate(-90deg)}\n"]
|
|
2036
3262
|
}]
|
|
2037
3263
|
}],
|
|
2038
3264
|
ctorParameters: () => [],
|
|
@@ -2208,6 +3434,30 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2208
3434
|
required: false
|
|
2209
3435
|
}]
|
|
2210
3436
|
}],
|
|
3437
|
+
actionKeys: [{
|
|
3438
|
+
type: i0.Input,
|
|
3439
|
+
args: [{
|
|
3440
|
+
isSignal: true,
|
|
3441
|
+
alias: "actionKeys",
|
|
3442
|
+
required: false
|
|
3443
|
+
}]
|
|
3444
|
+
}],
|
|
3445
|
+
zoomable: [{
|
|
3446
|
+
type: i0.Input,
|
|
3447
|
+
args: [{
|
|
3448
|
+
isSignal: true,
|
|
3449
|
+
alias: "zoomable",
|
|
3450
|
+
required: false
|
|
3451
|
+
}]
|
|
3452
|
+
}],
|
|
3453
|
+
zoomedIn: [{
|
|
3454
|
+
type: i0.Input,
|
|
3455
|
+
args: [{
|
|
3456
|
+
isSignal: true,
|
|
3457
|
+
alias: "zoomedIn",
|
|
3458
|
+
required: false
|
|
3459
|
+
}]
|
|
3460
|
+
}],
|
|
2211
3461
|
plotHeight: [{
|
|
2212
3462
|
type: i0.Input,
|
|
2213
3463
|
args: [{
|
|
@@ -2216,6 +3466,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2216
3466
|
required: false
|
|
2217
3467
|
}]
|
|
2218
3468
|
}],
|
|
3469
|
+
toolbar: [{
|
|
3470
|
+
type: i0.Input,
|
|
3471
|
+
args: [{
|
|
3472
|
+
isSignal: true,
|
|
3473
|
+
alias: "toolbar",
|
|
3474
|
+
required: false
|
|
3475
|
+
}]
|
|
3476
|
+
}],
|
|
3477
|
+
exportName: [{
|
|
3478
|
+
type: i0.Input,
|
|
3479
|
+
args: [{
|
|
3480
|
+
isSignal: true,
|
|
3481
|
+
alias: "exportName",
|
|
3482
|
+
required: false
|
|
3483
|
+
}]
|
|
3484
|
+
}],
|
|
2219
3485
|
pointer: [{
|
|
2220
3486
|
type: i0.Output,
|
|
2221
3487
|
args: ["pointer"]
|
|
@@ -2236,6 +3502,18 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2236
3502
|
type: i0.Output,
|
|
2237
3503
|
args: ["tooltipClosed"]
|
|
2238
3504
|
}],
|
|
3505
|
+
zoomed: [{
|
|
3506
|
+
type: i0.Output,
|
|
3507
|
+
args: ["zoomed"]
|
|
3508
|
+
}],
|
|
3509
|
+
panned: [{
|
|
3510
|
+
type: i0.Output,
|
|
3511
|
+
args: ["panned"]
|
|
3512
|
+
}],
|
|
3513
|
+
zoomReset: [{
|
|
3514
|
+
type: i0.Output,
|
|
3515
|
+
args: ["zoomReset"]
|
|
3516
|
+
}],
|
|
2239
3517
|
plotRef: [{
|
|
2240
3518
|
type: i0.ViewChild,
|
|
2241
3519
|
args: ["plot", { isSignal: true }]
|
|
@@ -2244,12 +3522,19 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2244
3522
|
type: i0.ViewChild,
|
|
2245
3523
|
args: ["anchor", { isSignal: true }]
|
|
2246
3524
|
}],
|
|
3525
|
+
svgRef: [{
|
|
3526
|
+
type: i0.ViewChild,
|
|
3527
|
+
args: ["chartSvg", { isSignal: true }]
|
|
3528
|
+
}],
|
|
2247
3529
|
tooltipPanel: [{
|
|
2248
3530
|
type: i0.ViewChild,
|
|
2249
3531
|
args: ["tooltipPanel", { isSignal: true }]
|
|
2250
3532
|
}]
|
|
2251
3533
|
}
|
|
2252
3534
|
});
|
|
3535
|
+
function followsPointer(event) {
|
|
3536
|
+
return "pointerType" in event && (event.pointerType === "mouse" || event.pointerType === "pen");
|
|
3537
|
+
}
|
|
2253
3538
|
function isPointList(data) {
|
|
2254
3539
|
return data.length > 0 && typeof data[0] === "object" && data[0] !== null;
|
|
2255
3540
|
}
|
|
@@ -2349,9 +3634,9 @@ function chartTable(labels, series, format, limit = 250) {
|
|
|
2349
3634
|
})),
|
|
2350
3635
|
rows: tableRows(labels.length, limit).map((index) => ({
|
|
2351
3636
|
label: labels[index],
|
|
2352
|
-
cells: series.map((item) => {
|
|
3637
|
+
cells: series.map((item, seriesIndex) => {
|
|
2353
3638
|
const value = item.values[index];
|
|
2354
|
-
return value === null || value === void 0 ? "—" : format(value);
|
|
3639
|
+
return value === null || value === void 0 ? "—" : format(value, seriesIndex);
|
|
2355
3640
|
})
|
|
2356
3641
|
}))
|
|
2357
3642
|
};
|
|
@@ -2389,6 +3674,6 @@ function parseRatio(raw, fallback) {
|
|
|
2389
3674
|
if (!Number.isFinite(value)) return fallback;
|
|
2390
3675
|
return raw.trim().endsWith("%") ? value / 100 : value;
|
|
2391
3676
|
}
|
|
2392
|
-
export { TX_CHART_ENTER_MS, TX_CHART_FALLBACK_HEIGHT, TX_CHART_FALLBACK_WIDTH, TX_CHART_LEGEND_ROW, TX_CHART_LEGEND_SIDE, TX_CHART_PALETTE_SIZE, TX_CHART_TABLE_ROWS, TX_TIME_INTERVALS, TxChartAxes, TxChartFrame, TxChartLegend, TxChartLegendTemplate, TxChartTooltipTemplate, addTime, areaPath, bandScale, cartesianLayout, chartBoxHeight, chartColor, chartHeightValue, chartMonthNames, chartNumberFormatter, chartPalette, chartSummary, chartTable, compactNumber, cycleIndex, dateFormat, decimalsOf, decimateSeries, extent, floorTime, hasChartData, initialChartSize, injectChartEntrance, largestTriangleThreeBuckets, linePath, linearScale, linearTicks, logDomain, logScale, logTicks, monotoneTangents, niceDomain, normalizeSeries, numberFormat, parseRatio, pointScale, prefersReducedMotion, readTokenNumber, seriesColor, splitGaps, stackExtent, stackValues, stepIndex, tableRows, textWidth, tickFormatter, tickStep, timeInterval, timeScale, timeTickFormatter, timeTickOptions, timeTicks, timeTooltipFormatter, toTime, toggleKey, topOfStack, truncateText };
|
|
3677
|
+
export { TX_CHART_ENTER_MS, TX_CHART_FALLBACK_HEIGHT, TX_CHART_FALLBACK_WIDTH, TX_CHART_LEGEND_ROW, TX_CHART_LEGEND_SIDE, TX_CHART_PALETTE_SIZE, TX_CHART_TABLE_ROWS, TX_FULL_CIRCLE, TX_TIME_INTERVALS, TxChartAnnotations, TxChartAxes, TxChartFrame, TxChartHoverBand, TxChartLegend, TxChartLegendTemplate, TxChartMenu, TxChartTooltipTemplate, addTime, alignedDomain, angleFrom, arcBounds, arcPath, arcSpan, areaPath, bandScale, cartesianLayout, chartAnnotationShapes, chartBandRect, chartBoxHeight, chartCategoryIndex, chartColor, chartCsv, chartFileName, chartHeightValue, chartMonthNames, chartNumberFormatter, chartPalette, chartPngBlob, chartSummary, chartSvgSize, chartSvgString, chartTable, compactNumber, cycleIndex, dateFormat, decimalsOf, decimateSeries, downloadChartFile, extent, fitArc, floorTime, hasChartData, initialChartSize, injectChartEntrance, largestTriangleThreeBuckets, linePath, linearScale, linearTicks, logDomain, logScale, logTicks, maxCornerRadius, monotoneTangents, niceDomain, normalizeSeries, numberFormat, parseRatio, pointScale, polar, prefersReducedMotion, readTokenNumber, seriesColor, splitGaps, stackExtent, stackValues, stepIndex, strokeArc, tableRows, textWidth, tickFormatter, tickStep, timeInterval, timeScale, timeTickFormatter, timeTickOptions, timeTicks, timeTooltipFormatter, toRadians, toTime, toggleKey, topOfStack, truncateText };
|
|
2393
3678
|
|
|
2394
3679
|
//# sourceMappingURL=tectra-ng-charts-core.mjs.map
|