@eagami/ui 5.51.0 → 5.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/eagami-ui.mjs +669 -93
- package/fesm2022/eagami-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/eagami-ui.d.ts +193 -11
package/fesm2022/eagami-ui.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { CSP_NONCE, ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, HostBinding, HostListener, Injectable, InjectionToken, Injector, PLATFORM_ID, Renderer2, RendererStyleFlags2, TemplateRef, ViewContainerRef, ViewEncapsulation, afterNextRender, afterRenderEffect, computed, contentChild, effect, forwardRef, inject, input, makeEnvironmentProviders, model, output, provideEnvironmentInitializer, signal, untracked, viewChild, viewChildren } from "@angular/core";
|
|
2
|
+
import { CSP_NONCE, ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, HostBinding, HostListener, Injectable, InjectionToken, Injector, PLATFORM_ID, Renderer2, RendererStyleFlags2, TemplateRef, ViewContainerRef, ViewEncapsulation, afterNextRender, afterRenderEffect, computed, contentChild, effect, forwardRef, inject, input, linkedSignal, makeEnvironmentProviders, model, output, provideEnvironmentInitializer, signal, untracked, viewChild, viewChildren } from "@angular/core";
|
|
3
3
|
import { NgClass, NgComponentOutlet, NgTemplateOutlet, isPlatformBrowser } from "@angular/common";
|
|
4
4
|
import { NG_VALUE_ACCESSOR, NgControl, TouchedChangeEvent } from "@angular/forms";
|
|
5
5
|
const EAGAMI_I18N_CONFIG = new InjectionToken("EAGAMI_I18N_CONFIG");
|
|
@@ -3918,6 +3918,7 @@ var AccordionItemComponent = class AccordionItemComponent {
|
|
|
3918
3918
|
accordion = inject(AccordionComponent);
|
|
3919
3919
|
value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
3920
3920
|
label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
3921
|
+
icon = input(void 0, ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
|
|
3921
3922
|
disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
3922
3923
|
id = input(uniqueId("ea-accordion-item"), ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
3923
3924
|
isExpanded = computed(() => this.accordion.isExpanded(this.value()), ...ngDevMode ? [{ debugName: "isExpanded" }] : /* istanbul ignore next */ []);
|
|
@@ -3962,6 +3963,13 @@ var AccordionItemComponent = class AccordionItemComponent {
|
|
|
3962
3963
|
isRequired: true,
|
|
3963
3964
|
transformFunction: null
|
|
3964
3965
|
},
|
|
3966
|
+
icon: {
|
|
3967
|
+
classPropertyName: "icon",
|
|
3968
|
+
publicName: "icon",
|
|
3969
|
+
isSignal: true,
|
|
3970
|
+
isRequired: false,
|
|
3971
|
+
transformFunction: null
|
|
3972
|
+
},
|
|
3965
3973
|
disabled: {
|
|
3966
3974
|
classPropertyName: "disabled",
|
|
3967
3975
|
publicName: "disabled",
|
|
@@ -3978,12 +3986,25 @@ var AccordionItemComponent = class AccordionItemComponent {
|
|
|
3978
3986
|
}
|
|
3979
3987
|
},
|
|
3980
3988
|
ngImport: i0,
|
|
3981
|
-
template: "<div\n class=\"ea-accordion-item ea-accordion-item--{{ size() }}\"\n [class.ea-accordion-item--expanded]=\"isExpanded()\"\n [class.ea-accordion-item--disabled]=\"disabled()\">\n <div\n class=\"ea-accordion-item__header\"\n role=\"heading\"\n [attr.aria-level]=\"headingLevel()\">\n <button\n class=\"ea-accordion-item__trigger\"\n type=\"button\"\n [id]=\"id() + '-trigger'\"\n [attr.aria-expanded]=\"isExpanded()\"\n [attr.aria-controls]=\"id() + '-content'\"\n [disabled]=\"disabled()\"\n (click)=\"toggle()\">\n <span class=\"ea-accordion-item__label\">{{ label() }}</span>\n <ea-icon-chevron-down\n class=\"ea-accordion-item__chevron\"\n aria-hidden=\"true\" />\n </button>\n </div>\n @if (isExpanded()) {\n <div\n class=\"ea-accordion-item__content\"\n role=\"region\"\n [id]=\"id() + '-content'\"\n [attr.aria-labelledby]=\"id() + '-trigger'\">\n <ng-content />\n </div>\n }\n</div>\n",
|
|
3982
|
-
styles: [".ea-accordion-item{border-bottom:var(--border-width-thin) solid var(--color-border-default)}.ea-accordion-item:last-child{border-bottom:none}.ea-accordion-item--2xs{font-size:var(--font-size-2xs)}.ea-accordion-item--xs{font-size:var(--font-size-xs)}.ea-accordion-item--sm{font-size:var(--font-size-sm)}.ea-accordion-item--md{font-size:var(--font-size-md)}.ea-accordion-item--lg{font-size:var(--font-size-lg)}.ea-accordion-item--xl{font-size:var(--font-size-xl)}.ea-accordion-item__trigger{display:flex;align-items:center;justify-content:space-between;gap:.75em;width:100%;padding:.75em 1em;font-size:inherit;font-weight:var(--font-weight-medium);font-family:var(--font-family-sans);line-height:var(--line-height-normal);text-align:start;background:none;border:none;color:var(--color-text-primary);cursor:pointer;transition:var(--transition-colors)}.ea-accordion-item__trigger:hover:not(:disabled){background-color:var(--color-state-hover)}.ea-accordion-item__trigger:focus-visible{outline:none;box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-accordion-item__trigger:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-accordion-item__trigger:disabled{opacity:.5;cursor:default}.ea-accordion-item__chevron{flex-shrink:0;width:1em;height:1em;color:var(--color-text-secondary);transition:transform var(--duration-normal) var(--ease-out)}.ea-accordion-item--expanded .ea-accordion-item__chevron{transform:rotate(180deg)}.ea-accordion-item__content{padding:.5em 1em 1em;line-height:var(--line-height-normal);color:var(--color-text-secondary)}.ea-accordion-item--disabled{opacity:.5}\n"],
|
|
3989
|
+
template: "<div\n class=\"ea-accordion-item ea-accordion-item--{{ size() }}\"\n [class.ea-accordion-item--expanded]=\"isExpanded()\"\n [class.ea-accordion-item--disabled]=\"disabled()\">\n <div\n class=\"ea-accordion-item__header\"\n role=\"heading\"\n [attr.aria-level]=\"headingLevel()\">\n <button\n class=\"ea-accordion-item__trigger\"\n type=\"button\"\n [id]=\"id() + '-trigger'\"\n [attr.aria-expanded]=\"isExpanded()\"\n [attr.aria-controls]=\"id() + '-content'\"\n [disabled]=\"disabled()\"\n (click)=\"toggle()\">\n @if (icon(); as leadingIcon) {\n <span\n class=\"ea-accordion-item__icon\"\n aria-hidden=\"true\">\n <ng-container *ngComponentOutlet=\"leadingIcon\" />\n </span>\n }\n <span class=\"ea-accordion-item__label\">{{ label() }}</span>\n <ea-icon-chevron-down\n class=\"ea-accordion-item__chevron\"\n aria-hidden=\"true\" />\n </button>\n </div>\n @if (isExpanded()) {\n <div\n class=\"ea-accordion-item__content\"\n role=\"region\"\n [id]=\"id() + '-content'\"\n [attr.aria-labelledby]=\"id() + '-trigger'\">\n <ng-content />\n </div>\n }\n</div>\n",
|
|
3990
|
+
styles: [".ea-accordion-item{border-bottom:var(--border-width-thin) solid var(--color-border-default)}.ea-accordion-item:last-child{border-bottom:none}.ea-accordion-item--2xs{font-size:var(--font-size-2xs)}.ea-accordion-item--xs{font-size:var(--font-size-xs)}.ea-accordion-item--sm{font-size:var(--font-size-sm)}.ea-accordion-item--md{font-size:var(--font-size-md)}.ea-accordion-item--lg{font-size:var(--font-size-lg)}.ea-accordion-item--xl{font-size:var(--font-size-xl)}.ea-accordion-item__trigger{display:flex;align-items:center;justify-content:space-between;gap:.75em;width:100%;padding:.75em 1em;font-size:inherit;font-weight:var(--font-weight-medium);font-family:var(--font-family-sans);line-height:var(--line-height-normal);text-align:start;background:none;border:none;color:var(--color-text-primary);cursor:pointer;transition:var(--transition-colors)}.ea-accordion-item__trigger:hover:not(:disabled){background-color:var(--color-state-hover)}.ea-accordion-item__trigger:focus-visible{outline:none;box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-accordion-item__trigger:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-accordion-item__trigger:disabled{opacity:.5;cursor:default}.ea-accordion-item__icon{display:inline-flex;flex-shrink:0;color:var(--color-text-secondary)}.ea-accordion-item__icon+.ea-accordion-item__label{flex-grow:1}.ea-accordion-item__chevron{flex-shrink:0;width:1em;height:1em;color:var(--color-text-secondary);transition:transform var(--duration-normal) var(--ease-out)}.ea-accordion-item--expanded .ea-accordion-item__chevron{transform:rotate(180deg)}.ea-accordion-item__content{padding:.5em 1em 1em;line-height:var(--line-height-normal);color:var(--color-text-secondary)}.ea-accordion-item--disabled{opacity:.5}\n"],
|
|
3983
3991
|
dependencies: [{
|
|
3984
3992
|
kind: "component",
|
|
3985
3993
|
type: ChevronDownIconComponent,
|
|
3986
3994
|
selector: "ea-icon-chevron-down"
|
|
3995
|
+
}, {
|
|
3996
|
+
kind: "directive",
|
|
3997
|
+
type: NgComponentOutlet,
|
|
3998
|
+
selector: "[ngComponentOutlet]",
|
|
3999
|
+
inputs: [
|
|
4000
|
+
"ngComponentOutlet",
|
|
4001
|
+
"ngComponentOutletInputs",
|
|
4002
|
+
"ngComponentOutletInjector",
|
|
4003
|
+
"ngComponentOutletEnvironmentInjector",
|
|
4004
|
+
"ngComponentOutletContent",
|
|
4005
|
+
"ngComponentOutletNgModule"
|
|
4006
|
+
],
|
|
4007
|
+
exportAs: ["ngComponentOutlet"]
|
|
3987
4008
|
}],
|
|
3988
4009
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
3989
4010
|
});
|
|
@@ -3997,10 +4018,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3997
4018
|
type: Component,
|
|
3998
4019
|
args: [{
|
|
3999
4020
|
selector: "ea-accordion-item",
|
|
4000
|
-
imports: [ChevronDownIconComponent],
|
|
4021
|
+
imports: [ChevronDownIconComponent, NgComponentOutlet],
|
|
4001
4022
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4002
|
-
template: "<div\n class=\"ea-accordion-item ea-accordion-item--{{ size() }}\"\n [class.ea-accordion-item--expanded]=\"isExpanded()\"\n [class.ea-accordion-item--disabled]=\"disabled()\">\n <div\n class=\"ea-accordion-item__header\"\n role=\"heading\"\n [attr.aria-level]=\"headingLevel()\">\n <button\n class=\"ea-accordion-item__trigger\"\n type=\"button\"\n [id]=\"id() + '-trigger'\"\n [attr.aria-expanded]=\"isExpanded()\"\n [attr.aria-controls]=\"id() + '-content'\"\n [disabled]=\"disabled()\"\n (click)=\"toggle()\">\n <span class=\"ea-accordion-item__label\">{{ label() }}</span>\n <ea-icon-chevron-down\n class=\"ea-accordion-item__chevron\"\n aria-hidden=\"true\" />\n </button>\n </div>\n @if (isExpanded()) {\n <div\n class=\"ea-accordion-item__content\"\n role=\"region\"\n [id]=\"id() + '-content'\"\n [attr.aria-labelledby]=\"id() + '-trigger'\">\n <ng-content />\n </div>\n }\n</div>\n",
|
|
4003
|
-
styles: [".ea-accordion-item{border-bottom:var(--border-width-thin) solid var(--color-border-default)}.ea-accordion-item:last-child{border-bottom:none}.ea-accordion-item--2xs{font-size:var(--font-size-2xs)}.ea-accordion-item--xs{font-size:var(--font-size-xs)}.ea-accordion-item--sm{font-size:var(--font-size-sm)}.ea-accordion-item--md{font-size:var(--font-size-md)}.ea-accordion-item--lg{font-size:var(--font-size-lg)}.ea-accordion-item--xl{font-size:var(--font-size-xl)}.ea-accordion-item__trigger{display:flex;align-items:center;justify-content:space-between;gap:.75em;width:100%;padding:.75em 1em;font-size:inherit;font-weight:var(--font-weight-medium);font-family:var(--font-family-sans);line-height:var(--line-height-normal);text-align:start;background:none;border:none;color:var(--color-text-primary);cursor:pointer;transition:var(--transition-colors)}.ea-accordion-item__trigger:hover:not(:disabled){background-color:var(--color-state-hover)}.ea-accordion-item__trigger:focus-visible{outline:none;box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-accordion-item__trigger:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-accordion-item__trigger:disabled{opacity:.5;cursor:default}.ea-accordion-item__chevron{flex-shrink:0;width:1em;height:1em;color:var(--color-text-secondary);transition:transform var(--duration-normal) var(--ease-out)}.ea-accordion-item--expanded .ea-accordion-item__chevron{transform:rotate(180deg)}.ea-accordion-item__content{padding:.5em 1em 1em;line-height:var(--line-height-normal);color:var(--color-text-secondary)}.ea-accordion-item--disabled{opacity:.5}\n"]
|
|
4023
|
+
template: "<div\n class=\"ea-accordion-item ea-accordion-item--{{ size() }}\"\n [class.ea-accordion-item--expanded]=\"isExpanded()\"\n [class.ea-accordion-item--disabled]=\"disabled()\">\n <div\n class=\"ea-accordion-item__header\"\n role=\"heading\"\n [attr.aria-level]=\"headingLevel()\">\n <button\n class=\"ea-accordion-item__trigger\"\n type=\"button\"\n [id]=\"id() + '-trigger'\"\n [attr.aria-expanded]=\"isExpanded()\"\n [attr.aria-controls]=\"id() + '-content'\"\n [disabled]=\"disabled()\"\n (click)=\"toggle()\">\n @if (icon(); as leadingIcon) {\n <span\n class=\"ea-accordion-item__icon\"\n aria-hidden=\"true\">\n <ng-container *ngComponentOutlet=\"leadingIcon\" />\n </span>\n }\n <span class=\"ea-accordion-item__label\">{{ label() }}</span>\n <ea-icon-chevron-down\n class=\"ea-accordion-item__chevron\"\n aria-hidden=\"true\" />\n </button>\n </div>\n @if (isExpanded()) {\n <div\n class=\"ea-accordion-item__content\"\n role=\"region\"\n [id]=\"id() + '-content'\"\n [attr.aria-labelledby]=\"id() + '-trigger'\">\n <ng-content />\n </div>\n }\n</div>\n",
|
|
4024
|
+
styles: [".ea-accordion-item{border-bottom:var(--border-width-thin) solid var(--color-border-default)}.ea-accordion-item:last-child{border-bottom:none}.ea-accordion-item--2xs{font-size:var(--font-size-2xs)}.ea-accordion-item--xs{font-size:var(--font-size-xs)}.ea-accordion-item--sm{font-size:var(--font-size-sm)}.ea-accordion-item--md{font-size:var(--font-size-md)}.ea-accordion-item--lg{font-size:var(--font-size-lg)}.ea-accordion-item--xl{font-size:var(--font-size-xl)}.ea-accordion-item__trigger{display:flex;align-items:center;justify-content:space-between;gap:.75em;width:100%;padding:.75em 1em;font-size:inherit;font-weight:var(--font-weight-medium);font-family:var(--font-family-sans);line-height:var(--line-height-normal);text-align:start;background:none;border:none;color:var(--color-text-primary);cursor:pointer;transition:var(--transition-colors)}.ea-accordion-item__trigger:hover:not(:disabled){background-color:var(--color-state-hover)}.ea-accordion-item__trigger:focus-visible{outline:none;box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-accordion-item__trigger:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-accordion-item__trigger:disabled{opacity:.5;cursor:default}.ea-accordion-item__icon{display:inline-flex;flex-shrink:0;color:var(--color-text-secondary)}.ea-accordion-item__icon+.ea-accordion-item__label{flex-grow:1}.ea-accordion-item__chevron{flex-shrink:0;width:1em;height:1em;color:var(--color-text-secondary);transition:transform var(--duration-normal) var(--ease-out)}.ea-accordion-item--expanded .ea-accordion-item__chevron{transform:rotate(180deg)}.ea-accordion-item__content{padding:.5em 1em 1em;line-height:var(--line-height-normal);color:var(--color-text-secondary)}.ea-accordion-item--disabled{opacity:.5}\n"]
|
|
4004
4025
|
}]
|
|
4005
4026
|
}],
|
|
4006
4027
|
propDecorators: {
|
|
@@ -4020,6 +4041,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4020
4041
|
required: true
|
|
4021
4042
|
}]
|
|
4022
4043
|
}],
|
|
4044
|
+
icon: [{
|
|
4045
|
+
type: i0.Input,
|
|
4046
|
+
args: [{
|
|
4047
|
+
isSignal: true,
|
|
4048
|
+
alias: "icon",
|
|
4049
|
+
required: false
|
|
4050
|
+
}]
|
|
4051
|
+
}],
|
|
4023
4052
|
disabled: [{
|
|
4024
4053
|
type: i0.Input,
|
|
4025
4054
|
args: [{
|
|
@@ -8520,6 +8549,41 @@ function injectChartFormatter(formatValue) {
|
|
|
8520
8549
|
function clamp$1(value, min, max) {
|
|
8521
8550
|
return Math.min(max, Math.max(min, value));
|
|
8522
8551
|
}
|
|
8552
|
+
const CHART_LABEL_ANGLES = {
|
|
8553
|
+
horizontal: 0,
|
|
8554
|
+
diagonal: 45,
|
|
8555
|
+
vertical: 90
|
|
8556
|
+
};
|
|
8557
|
+
const BREAK_HEIGHT = 2.5;
|
|
8558
|
+
function tickLength(axisPx) {
|
|
8559
|
+
return axisPx * .4 + 2;
|
|
8560
|
+
}
|
|
8561
|
+
function labelRoom(text, angle, axisPx) {
|
|
8562
|
+
if (angle === 0) return estimateTextWidth(text, axisPx) + axisPx;
|
|
8563
|
+
return axisPx * 1.15 / Math.sin(angle * Math.PI / 180);
|
|
8564
|
+
}
|
|
8565
|
+
function labelBand(widest, angle, axisPx, height) {
|
|
8566
|
+
if (!angle) return axisPx * 2.5 + 2 + 2;
|
|
8567
|
+
const radians = angle * Math.PI / 180;
|
|
8568
|
+
return Math.min(height / 2, axisPx * .8 + 2 + 2 + widest * Math.sin(radians) + axisPx * Math.cos(radians) + axisPx * .5);
|
|
8569
|
+
}
|
|
8570
|
+
function labelLine(axisY, angle, axisPx) {
|
|
8571
|
+
return angle ? axisY + tickLength(axisPx) + 2 + axisPx * .4 : axisY + axisPx * 1.5 + 2 + 2;
|
|
8572
|
+
}
|
|
8573
|
+
function axisBreak(x, top, bottom, y, axisPx) {
|
|
8574
|
+
const half = axisPx * .8;
|
|
8575
|
+
const gap = axisPx * .35;
|
|
8576
|
+
return {
|
|
8577
|
+
axis: `M${x},${top}L${x},${y - gap}M${x},${y + gap}L${x},${bottom}`,
|
|
8578
|
+
gap: {
|
|
8579
|
+
x: x - half,
|
|
8580
|
+
y: y - gap,
|
|
8581
|
+
width: 2 * half,
|
|
8582
|
+
height: 2 * gap
|
|
8583
|
+
},
|
|
8584
|
+
slashes: [-gap, gap].map((offset) => `M${x - half},${y + offset + half / 2}L${x + half},${y + offset - half / 2}`).join("")
|
|
8585
|
+
};
|
|
8586
|
+
}
|
|
8523
8587
|
const BAR_GAP = 2;
|
|
8524
8588
|
const BAR_RADIUS = 4;
|
|
8525
8589
|
function barPath(x, y, w, h, side) {
|
|
@@ -8547,6 +8611,8 @@ var BarChartComponent = class BarChartComponent {
|
|
|
8547
8611
|
showGrid = input(true, ...ngDevMode ? [{ debugName: "showGrid" }] : /* istanbul ignore next */ []);
|
|
8548
8612
|
showLegend = input(true, ...ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []);
|
|
8549
8613
|
showValues = input(false, ...ngDevMode ? [{ debugName: "showValues" }] : /* istanbul ignore next */ []);
|
|
8614
|
+
xLabelOrientation = input("horizontal", ...ngDevMode ? [{ debugName: "xLabelOrientation" }] : /* istanbul ignore next */ []);
|
|
8615
|
+
showAxisBreak = input(false, ...ngDevMode ? [{ debugName: "showAxisBreak" }] : /* istanbul ignore next */ []);
|
|
8550
8616
|
height = input(240, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
|
|
8551
8617
|
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
8552
8618
|
animation = input("grow", ...ngDevMode ? [{ debugName: "animation" }] : /* istanbul ignore next */ []);
|
|
@@ -8594,6 +8660,7 @@ var BarChartComponent = class BarChartComponent {
|
|
|
8594
8660
|
};
|
|
8595
8661
|
let lo = 0;
|
|
8596
8662
|
let hi = 0;
|
|
8663
|
+
let lowestTop = Infinity;
|
|
8597
8664
|
for (let i = 0; i < count; i++) {
|
|
8598
8665
|
let up = 0;
|
|
8599
8666
|
let down = 0;
|
|
@@ -8609,22 +8676,36 @@ var BarChartComponent = class BarChartComponent {
|
|
|
8609
8676
|
});
|
|
8610
8677
|
hi = Math.max(hi, up);
|
|
8611
8678
|
lo = Math.min(lo, down);
|
|
8679
|
+
if (stacked && up > 0) lowestTop = Math.min(lowestTop, up);
|
|
8680
|
+
}
|
|
8681
|
+
if (!stacked) {
|
|
8682
|
+
for (const s of series) for (const value of s.data) if (value != null && isFinite(value) && value > 0) lowestTop = Math.min(lowestTop, value);
|
|
8612
8683
|
}
|
|
8684
|
+
const breakable = vertical && this.showAxisBreak() && lo >= 0 && isFinite(lowestTop);
|
|
8685
|
+
const scaleLo = breakable ? lowestTop : lo;
|
|
8613
8686
|
const labelTexts = Array.from({ length: count }, (_, i) => this.labels()[i] ?? "");
|
|
8614
8687
|
const valueRoom = this.showValues() ? axisPx * 1.5 : 0;
|
|
8615
|
-
const provisionalTicks = niceScale(
|
|
8688
|
+
const provisionalTicks = niceScale(scaleLo, hi).ticks.map(format);
|
|
8616
8689
|
const widestTick = Math.max(0, ...provisionalTicks.map((t) => estimateTextWidth(t, axisPx)));
|
|
8617
8690
|
let left;
|
|
8618
8691
|
let right;
|
|
8619
8692
|
let top;
|
|
8620
8693
|
let bottom;
|
|
8621
8694
|
let categoryText;
|
|
8695
|
+
let angle = 0;
|
|
8622
8696
|
if (vertical) {
|
|
8623
8697
|
left = widestTick + axisPx;
|
|
8624
8698
|
right = axisPx / 2;
|
|
8625
8699
|
top = axisPx + valueRoom;
|
|
8626
|
-
bottom = axisPx * 2.5;
|
|
8627
8700
|
categoryText = labelTexts;
|
|
8701
|
+
const orientation = this.xLabelOrientation();
|
|
8702
|
+
const band = Math.max(1, width - left - right) / count;
|
|
8703
|
+
angle = orientation === "auto" ? [
|
|
8704
|
+
0,
|
|
8705
|
+
45,
|
|
8706
|
+
90
|
|
8707
|
+
].find((a) => labelTexts.every((t) => labelRoom(t, a, axisPx) <= band)) ?? 90 : CHART_LABEL_ANGLES[orientation];
|
|
8708
|
+
bottom = labelBand(Math.max(0, ...labelTexts.map((t) => estimateTextWidth(t, axisPx))), angle, axisPx, height);
|
|
8628
8709
|
} else {
|
|
8629
8710
|
const maxLabel = width * .3;
|
|
8630
8711
|
categoryText = labelTexts.map((t) => truncate(t, maxLabel, axisPx));
|
|
@@ -8635,8 +8716,21 @@ var BarChartComponent = class BarChartComponent {
|
|
|
8635
8716
|
}
|
|
8636
8717
|
const plotWidth = Math.max(1, width - left - right);
|
|
8637
8718
|
const plotHeight = Math.max(1, height - top - bottom);
|
|
8638
|
-
const scale = niceScale(
|
|
8639
|
-
|
|
8719
|
+
const scale = niceScale(scaleLo, hi, Math.max(2, Math.floor((vertical ? plotHeight : plotWidth) / (vertical ? axisPx * 3 : widestTick + axisPx * 2))));
|
|
8720
|
+
let { min } = scale;
|
|
8721
|
+
const { max } = scale;
|
|
8722
|
+
const scaleTicks = [...scale.ticks];
|
|
8723
|
+
if (breakable && min > 0) {
|
|
8724
|
+
const step = scaleTicks[1] - scaleTicks[0];
|
|
8725
|
+
const clearance = axisPx * 6;
|
|
8726
|
+
const px = (value) => value / (max - min || 1) * plotHeight;
|
|
8727
|
+
for (let steps = 0; steps < 6 && min > 0 && px(lowestTop - min) < clearance; steps++) {
|
|
8728
|
+
min = Number((min - step).toPrecision(12));
|
|
8729
|
+
scaleTicks.unshift(min);
|
|
8730
|
+
}
|
|
8731
|
+
}
|
|
8732
|
+
const axisY = top + plotHeight;
|
|
8733
|
+
const breakY = breakable && min > 0 ? axisY - axisPx * BREAK_HEIGHT : null;
|
|
8640
8734
|
const valuePos = (v) => {
|
|
8641
8735
|
const t = (clamp$1(v, min, max) - min) / (max - min || 1);
|
|
8642
8736
|
return vertical ? top + (1 - t) * plotHeight : left + t * plotWidth;
|
|
@@ -8725,13 +8819,13 @@ var BarChartComponent = class BarChartComponent {
|
|
|
8725
8819
|
});
|
|
8726
8820
|
});
|
|
8727
8821
|
}
|
|
8728
|
-
const ticks =
|
|
8822
|
+
const ticks = scaleTicks.filter((value) => value >= min).map((value) => ({
|
|
8729
8823
|
value,
|
|
8730
8824
|
text: format(value),
|
|
8731
8825
|
pos: valuePos(value)
|
|
8732
|
-
}));
|
|
8733
|
-
const
|
|
8734
|
-
const labelStep = vertical ? Math.max(1, Math.ceil(
|
|
8826
|
+
})).filter((tick) => breakY == null || tick.pos < breakY - axisPx);
|
|
8827
|
+
const widestRoom = Math.max(0, ...categoryText.map((t) => labelRoom(t, angle, axisPx)));
|
|
8828
|
+
const labelStep = vertical ? Math.max(1, Math.ceil(widestRoom / band)) : 1;
|
|
8735
8829
|
const categories = categoryText.map((text, index) => ({
|
|
8736
8830
|
text,
|
|
8737
8831
|
index,
|
|
@@ -8755,7 +8849,12 @@ var BarChartComponent = class BarChartComponent {
|
|
|
8755
8849
|
categories,
|
|
8756
8850
|
bars,
|
|
8757
8851
|
valueLabels,
|
|
8758
|
-
valuePos
|
|
8852
|
+
valuePos,
|
|
8853
|
+
axisY,
|
|
8854
|
+
tickEndY: axisY + tickLength(axisPx),
|
|
8855
|
+
labelAngle: angle,
|
|
8856
|
+
labelY: labelLine(axisY, angle, axisPx),
|
|
8857
|
+
axisBreak: breakY == null ? null : axisBreak(left, top, axisY, breakY, axisPx)
|
|
8759
8858
|
};
|
|
8760
8859
|
}, ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
|
|
8761
8860
|
tooltip = computed(() => {
|
|
@@ -9010,6 +9109,20 @@ var BarChartComponent = class BarChartComponent {
|
|
|
9010
9109
|
isRequired: false,
|
|
9011
9110
|
transformFunction: null
|
|
9012
9111
|
},
|
|
9112
|
+
xLabelOrientation: {
|
|
9113
|
+
classPropertyName: "xLabelOrientation",
|
|
9114
|
+
publicName: "xLabelOrientation",
|
|
9115
|
+
isSignal: true,
|
|
9116
|
+
isRequired: false,
|
|
9117
|
+
transformFunction: null
|
|
9118
|
+
},
|
|
9119
|
+
showAxisBreak: {
|
|
9120
|
+
classPropertyName: "showAxisBreak",
|
|
9121
|
+
publicName: "showAxisBreak",
|
|
9122
|
+
isSignal: true,
|
|
9123
|
+
isRequired: false,
|
|
9124
|
+
transformFunction: null
|
|
9125
|
+
},
|
|
9013
9126
|
height: {
|
|
9014
9127
|
classPropertyName: "height",
|
|
9015
9128
|
publicName: "height",
|
|
@@ -9058,8 +9171,8 @@ var BarChartComponent = class BarChartComponent {
|
|
|
9058
9171
|
activePointChange: "activePointChange"
|
|
9059
9172
|
},
|
|
9060
9173
|
ngImport: i0,
|
|
9061
|
-
template: "<div\n class=\"ea-bar-chart\"\n [ngClass]=\"hostClasses()\"\n [style.--ea-chart-duration]=\"animationDuration() + 'ms'\">\n @if (hasData()) {\n <div\n class=\"ea-bar-chart__plot\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-roledescription]=\"i18n.messages().chart.roleDescription\"\n [attr.aria-label]=\"label()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\">\n @for (pass of renderPass(); track pass) {\n <svg\n class=\"ea-bar-chart__svg\"\n aria-hidden=\"true\"\n [attr.width]=\"layout().width\"\n [attr.height]=\"layout().height\"\n [attr.viewBox]=\"'0 0 ' + layout().width + ' ' + layout().height\"\n [style.--ea-bar-chart-baseline]=\"layout().baseline + 'px'\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerdown)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave()\"\n (click)=\"onClick()\">\n <rect\n class=\"ea-bar-chart__hit\"\n [attr.x]=\"layout().left\"\n [attr.y]=\"layout().top\"\n [attr.width]=\"layout().plotWidth\"\n [attr.height]=\"layout().plotHeight\" />\n @for (tick of layout().ticks; track tick.value) {\n @if (layout().vertical) {\n @if (showGrid()) {\n <line\n class=\"ea-bar-chart__grid\"\n [attr.x1]=\"layout().left\"\n [attr.x2]=\"layout().left + layout().plotWidth\"\n [attr.y1]=\"tick.pos\"\n [attr.y2]=\"tick.pos\" />\n }\n <text\n class=\"ea-bar-chart__axis\"\n text-anchor=\"end\"\n dominant-baseline=\"middle\"\n [attr.x]=\"layout().left - layout().axisPx / 2\"\n [attr.y]=\"tick.pos\">\n {{ tick.text }}\n </text>\n } @else {\n @if (showGrid()) {\n <line\n class=\"ea-bar-chart__grid\"\n [attr.x1]=\"tick.pos\"\n [attr.x2]=\"tick.pos\"\n [attr.y1]=\"layout().top\"\n [attr.y2]=\"layout().top + layout().plotHeight\" />\n }\n <text\n class=\"ea-bar-chart__axis\"\n text-anchor=\"middle\"\n [attr.x]=\"tick.pos\"\n [attr.y]=\"layout().top + layout().plotHeight + layout().axisPx * 1.5\">\n {{ tick.text }}\n </text>\n }\n }\n @for (category of layout().categories; track category.index) {\n @if (layout().vertical) {\n <text\n class=\"ea-bar-chart__axis\"\n text-anchor=\"middle\"\n [attr.
|
|
9062
|
-
styles: ["@keyframes ea-chart-fade{0%{opacity:0}}@keyframes ea-chart-draw{0%{stroke-dashoffset:1}}@keyframes ea-chart-grow-y{0%{transform:scaleY(0)}}@keyframes ea-chart-grow-x{0%{transform:scaleX(0)}}@keyframes ea-chart-grow{0%{transform:scale(0)}}ea-bar-chart{display:block}.ea-bar-chart{position:relative;display:flex;flex-direction:column;gap:.75em;font-family:var(--font-family-sans);color:var(--color-text-primary)}.ea-bar-chart--2xs{font-size:var(--font-size-2xs)}.ea-bar-chart--xs{font-size:var(--font-size-xs)}.ea-bar-chart--sm{font-size:var(--font-size-sm)}.ea-bar-chart--md{font-size:var(--font-size-md)}.ea-bar-chart--lg{font-size:var(--font-size-lg)}.ea-bar-chart--xl{font-size:var(--font-size-xl)}.ea-bar-chart__plot{position:relative;border-radius:var(--radius-md);outline:none}.ea-bar-chart__plot:focus-visible{box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-bar-chart__plot:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-bar-chart__plot svg{display:block;overflow:visible}.ea-bar-chart__svg{direction:ltr;touch-action:pan-y}.ea-bar-chart__hit{fill:transparent}.ea-bar-chart__grid{stroke:var(--color-divider);stroke-width:1px;shape-rendering:crispEdges}.ea-bar-chart__baseline{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges;pointer-events:none}.ea-bar-chart__axis{font-size:.75em;fill:var(--color-text-secondary)}.ea-bar-chart__value{font-size:.75em;fill:var(--color-text-secondary);font-variant-numeric:tabular-nums;fill:var(--color-text-primary);pointer-events:none}.ea-bar-chart__bar{fill:var(--ea-chart-color);pointer-events:none;transition:opacity var(--duration-fast) var(--ease-out);transform-box:view-box}.ea-bar-chart__bar--dimmed{opacity:.35}.ea-bar-chart--vertical .ea-bar-chart__bar{transform-origin:0 var(--ea-bar-chart-baseline)}.ea-bar-chart--horizontal .ea-bar-chart__bar{transform-origin:var(--ea-bar-chart-baseline) 0}.ea-bar-chart__tooltip{display:flex;flex-direction:column;gap:var(--space-1)}.ea-bar-chart__anchor{fill:transparent}.ea-bar-chart__tooltip-title{font-weight:var(--font-weight-medium)}.ea-bar-chart__tooltip-row{display:flex;align-items:center;gap:.5em}.ea-bar-chart__tooltip-row--active{font-weight:var(--font-weight-medium)}.ea-bar-chart__tooltip-value{
|
|
9174
|
+
template: "<div\n class=\"ea-bar-chart\"\n [ngClass]=\"hostClasses()\"\n [style.--ea-chart-duration]=\"animationDuration() + 'ms'\">\n @if (hasData()) {\n <div\n class=\"ea-bar-chart__plot\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-roledescription]=\"i18n.messages().chart.roleDescription\"\n [attr.aria-label]=\"label()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\">\n @for (pass of renderPass(); track pass) {\n <svg\n class=\"ea-bar-chart__svg\"\n aria-hidden=\"true\"\n [attr.width]=\"layout().width\"\n [attr.height]=\"layout().height\"\n [attr.viewBox]=\"'0 0 ' + layout().width + ' ' + layout().height\"\n [style.--ea-bar-chart-baseline]=\"layout().baseline + 'px'\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerdown)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave()\"\n (click)=\"onClick()\">\n <rect\n class=\"ea-bar-chart__hit\"\n [attr.x]=\"layout().left\"\n [attr.y]=\"layout().top\"\n [attr.width]=\"layout().plotWidth\"\n [attr.height]=\"layout().plotHeight\" />\n @for (tick of layout().ticks; track tick.value) {\n @if (layout().vertical) {\n @if (showGrid()) {\n <line\n class=\"ea-bar-chart__grid\"\n [attr.x1]=\"layout().left\"\n [attr.x2]=\"layout().left + layout().plotWidth\"\n [attr.y1]=\"tick.pos\"\n [attr.y2]=\"tick.pos\" />\n }\n <text\n class=\"ea-bar-chart__axis\"\n text-anchor=\"end\"\n dominant-baseline=\"middle\"\n [attr.x]=\"layout().left - layout().axisPx / 2\"\n [attr.y]=\"tick.pos\">\n {{ tick.text }}\n </text>\n } @else {\n @if (showGrid()) {\n <line\n class=\"ea-bar-chart__grid\"\n [attr.x1]=\"tick.pos\"\n [attr.x2]=\"tick.pos\"\n [attr.y1]=\"layout().top\"\n [attr.y2]=\"layout().top + layout().plotHeight\" />\n }\n <text\n class=\"ea-bar-chart__axis\"\n text-anchor=\"middle\"\n [attr.x]=\"tick.pos\"\n [attr.y]=\"layout().top + layout().plotHeight + layout().axisPx * 1.5\">\n {{ tick.text }}\n </text>\n }\n }\n @for (category of layout().categories; track category.index) {\n @if (layout().vertical) {\n <line\n class=\"ea-bar-chart__x-tick\"\n [attr.x1]=\"category.pos\"\n [attr.x2]=\"category.pos\"\n [attr.y1]=\"layout().axisY\"\n [attr.y2]=\"layout().tickEndY\" />\n <text\n class=\"ea-bar-chart__axis\"\n [attr.text-anchor]=\"layout().labelAngle ? 'end' : 'middle'\"\n [attr.dominant-baseline]=\"layout().labelAngle ? 'central' : null\"\n [attr.transform]=\"\n layout().labelAngle\n ? 'rotate(' +\n -layout().labelAngle +\n ' ' +\n category.pos +\n ' ' +\n layout().labelY +\n ')'\n : null\n \"\n [attr.x]=\"category.pos\"\n [attr.y]=\"layout().labelY\">\n {{ category.text }}\n </text>\n } @else {\n <text\n class=\"ea-bar-chart__axis\"\n text-anchor=\"end\"\n dominant-baseline=\"middle\"\n [attr.x]=\"layout().left - layout().axisPx / 2\"\n [attr.y]=\"category.pos\">\n {{ category.text }}\n </text>\n }\n }\n @for (bar of layout().bars; track $index) {\n <path\n class=\"ea-bar-chart__bar\"\n [class.ea-bar-chart__bar--dimmed]=\"isDimmed(bar)\"\n [style.--ea-chart-color]=\"bar.color\"\n [style.--ea-chart-delay]=\"bar.delay + 'ms'\"\n [attr.d]=\"bar.path\" />\n }\n @if (layout().axisBreak; as axisBreak) {\n <path\n class=\"ea-bar-chart__y-axis\"\n [attr.d]=\"axisBreak.axis\" />\n <path\n class=\"ea-bar-chart__axis-break\"\n [attr.d]=\"axisBreak.slashes\" />\n }\n @if (layout().vertical) {\n <line\n class=\"ea-bar-chart__baseline\"\n [attr.x1]=\"layout().left\"\n [attr.x2]=\"layout().left + layout().plotWidth\"\n [attr.y1]=\"layout().baseline\"\n [attr.y2]=\"layout().baseline\" />\n } @else {\n <line\n class=\"ea-bar-chart__baseline\"\n [attr.x1]=\"layout().baseline\"\n [attr.x2]=\"layout().baseline\"\n [attr.y1]=\"layout().top\"\n [attr.y2]=\"layout().top + layout().plotHeight\" />\n }\n @for (valueLabel of layout().valueLabels; track valueLabel.key) {\n <text\n class=\"ea-bar-chart__value\"\n [attr.text-anchor]=\"valueLabel.anchor\"\n [attr.dominant-baseline]=\"layout().vertical ? null : 'middle'\"\n [attr.x]=\"valueLabel.x\"\n [attr.y]=\"valueLabel.y\">\n {{ valueLabel.text }}\n </text>\n }\n @for (tip of tooltips(); track tip.key) {\n <rect\n class=\"ea-bar-chart__anchor\"\n width=\"2\"\n height=\"2\"\n [attr.x]=\"tip.x - 1\"\n [attr.y]=\"tip.y - 1\"\n [eaTooltip]=\"tooltipContent\"\n [tooltipOpen]=\"true\"\n [maxWidth]=\"undefined\" />\n }\n </svg>\n }\n <ng-template #tooltipContent>\n @if (tooltip(); as tip) {\n <div class=\"ea-bar-chart__tooltip\">\n <span class=\"ea-bar-chart__tooltip-title\">{{ tip.title }}</span>\n @for (row of tip.rows; track $index) {\n <span\n class=\"ea-bar-chart__tooltip-row\"\n [class.ea-bar-chart__tooltip-row--active]=\"row.active\">\n <span\n class=\"ea-bar-chart__swatch\"\n [style.--ea-chart-color]=\"row.color\">\n </span>\n <span class=\"ea-bar-chart__tooltip-name\">{{ row.name }}</span>\n <span class=\"ea-bar-chart__tooltip-value\">{{ row.value }}</span>\n </span>\n }\n </div>\n }\n </ng-template>\n <!-- Hidden through a block, since a table ignores the 1px size and keeps its full height -->\n <div class=\"ea-bar-chart__table\">\n <table>\n <caption>\n {{ label() }}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">{{ i18n.messages().chart.category }}</th>\n @for (s of series(); track $index) {\n <th scope=\"col\">{{ s.name }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of labels(); track $index; let i = $index) {\n <tr>\n <th scope=\"row\">{{ row }}</th>\n @for (s of series(); track $index) {\n <td>{{ tableValue(s.data[i]) }}</td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n </div>\n <div\n class=\"ea-bar-chart__live\"\n aria-live=\"polite\">\n {{ announcement() }}\n </div>\n } @else {\n <div\n class=\"ea-bar-chart__empty\"\n role=\"img\"\n [attr.aria-label]=\"label()\"\n [style.height.px]=\"height()\">\n {{ i18n.messages().chart.noData }}\n </div>\n }\n @if (showsLegend()) {\n <ul\n class=\"ea-bar-chart__legend\"\n aria-hidden=\"true\">\n @for (s of series(); track $index; let i = $index) {\n <li class=\"ea-bar-chart__legend-item\">\n <span\n class=\"ea-bar-chart__swatch\"\n [style.--ea-chart-color]=\"seriesColor(i)\">\n </span>\n {{ s.name }}\n </li>\n }\n </ul>\n }\n</div>\n",
|
|
9175
|
+
styles: ["@keyframes ea-chart-fade{0%{opacity:0}}@keyframes ea-chart-draw{0%{stroke-dashoffset:1}}@keyframes ea-chart-grow-y{0%{transform:scaleY(0)}}@keyframes ea-chart-grow-x{0%{transform:scaleX(0)}}@keyframes ea-chart-grow{0%{transform:scale(0)}}ea-bar-chart{display:block}.ea-bar-chart{position:relative;display:flex;flex-direction:column;gap:.75em;font-family:var(--font-family-sans);color:var(--color-text-primary)}.ea-bar-chart--2xs{font-size:var(--font-size-2xs)}.ea-bar-chart--xs{font-size:var(--font-size-xs)}.ea-bar-chart--sm{font-size:var(--font-size-sm)}.ea-bar-chart--md{font-size:var(--font-size-md)}.ea-bar-chart--lg{font-size:var(--font-size-lg)}.ea-bar-chart--xl{font-size:var(--font-size-xl)}.ea-bar-chart__plot{position:relative;border-radius:var(--radius-md);outline:none}.ea-bar-chart__plot:focus-visible{box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-bar-chart__plot:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-bar-chart__plot svg{display:block;overflow:visible}.ea-bar-chart__svg{direction:ltr;touch-action:pan-y}.ea-bar-chart__hit{fill:transparent}.ea-bar-chart__grid{stroke:var(--color-divider);stroke-width:1px;shape-rendering:crispEdges}.ea-bar-chart__baseline{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges;pointer-events:none}.ea-bar-chart__axis{font-size:.75em;fill:var(--color-text-secondary)}.ea-bar-chart__x-tick{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges}.ea-bar-chart__y-axis{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges;fill:none}.ea-bar-chart__axis-break{fill:none;stroke:var(--color-border-strong);stroke-width:1.5px;stroke-linecap:round}.ea-bar-chart__value{font-size:.75em;fill:var(--color-text-secondary);font-variant-numeric:tabular-nums;fill:var(--color-text-primary);pointer-events:none}.ea-bar-chart__bar{fill:var(--ea-chart-color);pointer-events:none;transition:opacity var(--duration-fast) var(--ease-out);transform-box:view-box}.ea-bar-chart__bar--dimmed{opacity:.35}.ea-bar-chart--vertical .ea-bar-chart__bar{transform-origin:0 var(--ea-bar-chart-baseline)}.ea-bar-chart--horizontal .ea-bar-chart__bar{transform-origin:var(--ea-bar-chart-baseline) 0}.ea-bar-chart__tooltip{display:flex;flex-direction:column;gap:var(--space-1)}.ea-bar-chart__anchor{fill:transparent}.ea-bar-chart__tooltip-title{font-weight:var(--font-weight-medium)}.ea-bar-chart__tooltip-row{display:flex;align-items:center;gap:.5em}.ea-bar-chart__tooltip-row--active{font-weight:var(--font-weight-medium)}.ea-bar-chart__tooltip-value{font-weight:var(--font-weight-semibold);font-variant-numeric:tabular-nums}.ea-bar-chart__swatch{flex-shrink:0;width:.75em;height:.75em;border-radius:var(--radius-sm);background-color:var(--ea-chart-color)}.ea-bar-chart__legend{display:flex;flex-wrap:wrap;justify-content:center;gap:.375em 1em;padding:0;margin:0;font-size:.875em;list-style:none;color:var(--color-text-secondary)}.ea-bar-chart__legend-item{display:flex;align-items:center;gap:.375em}.ea-bar-chart__table,.ea-bar-chart__live{position:absolute;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);width:1px;height:1px;padding:0;margin:-1px;white-space:nowrap;border:0}.ea-bar-chart__empty{display:flex;align-items:center;justify-content:center;font-size:.875em;color:var(--color-text-tertiary)}.ea-bar-chart--animate-grow.ea-bar-chart--vertical .ea-bar-chart__bar,.ea-bar-chart--animate-cascade.ea-bar-chart--vertical .ea-bar-chart__bar{animation-name:ea-chart-grow-y}.ea-bar-chart--animate-grow.ea-bar-chart--horizontal .ea-bar-chart__bar,.ea-bar-chart--animate-cascade.ea-bar-chart--horizontal .ea-bar-chart__bar{animation-name:ea-chart-grow-x}.ea-bar-chart--animate-grow .ea-bar-chart__bar,.ea-bar-chart--animate-cascade .ea-bar-chart__bar{animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-bar-chart--animate-grow .ea-bar-chart__bar,.ea-bar-chart--animate-cascade .ea-bar-chart__bar{animation:none}}.ea-bar-chart--animate-grow .ea-bar-chart__value,.ea-bar-chart--animate-cascade .ea-bar-chart__value{animation-name:ea-chart-fade;animation-delay:calc(var(--ea-chart-duration, .6s) * .8);animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-bar-chart--animate-grow .ea-bar-chart__value,.ea-bar-chart--animate-cascade .ea-bar-chart__value{animation:none}}.ea-bar-chart--animate-cascade .ea-bar-chart__bar{animation-delay:var(--ea-chart-delay, 0ms)}.ea-bar-chart--animate-cascade .ea-bar-chart__value{animation-delay:calc(var(--ea-chart-duration, .6s) * 1.3)}.ea-bar-chart--animate-fade .ea-bar-chart__bar,.ea-bar-chart--animate-fade .ea-bar-chart__value{animation-name:ea-chart-fade;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-bar-chart--animate-fade .ea-bar-chart__bar,.ea-bar-chart--animate-fade .ea-bar-chart__value{animation:none}}\n"],
|
|
9063
9176
|
dependencies: [{
|
|
9064
9177
|
kind: "directive",
|
|
9065
9178
|
type: NgClass,
|
|
@@ -9095,8 +9208,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
9095
9208
|
imports: [NgClass, TooltipDirective],
|
|
9096
9209
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9097
9210
|
encapsulation: ViewEncapsulation.None,
|
|
9098
|
-
template: "<div\n class=\"ea-bar-chart\"\n [ngClass]=\"hostClasses()\"\n [style.--ea-chart-duration]=\"animationDuration() + 'ms'\">\n @if (hasData()) {\n <div\n class=\"ea-bar-chart__plot\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-roledescription]=\"i18n.messages().chart.roleDescription\"\n [attr.aria-label]=\"label()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\">\n @for (pass of renderPass(); track pass) {\n <svg\n class=\"ea-bar-chart__svg\"\n aria-hidden=\"true\"\n [attr.width]=\"layout().width\"\n [attr.height]=\"layout().height\"\n [attr.viewBox]=\"'0 0 ' + layout().width + ' ' + layout().height\"\n [style.--ea-bar-chart-baseline]=\"layout().baseline + 'px'\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerdown)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave()\"\n (click)=\"onClick()\">\n <rect\n class=\"ea-bar-chart__hit\"\n [attr.x]=\"layout().left\"\n [attr.y]=\"layout().top\"\n [attr.width]=\"layout().plotWidth\"\n [attr.height]=\"layout().plotHeight\" />\n @for (tick of layout().ticks; track tick.value) {\n @if (layout().vertical) {\n @if (showGrid()) {\n <line\n class=\"ea-bar-chart__grid\"\n [attr.x1]=\"layout().left\"\n [attr.x2]=\"layout().left + layout().plotWidth\"\n [attr.y1]=\"tick.pos\"\n [attr.y2]=\"tick.pos\" />\n }\n <text\n class=\"ea-bar-chart__axis\"\n text-anchor=\"end\"\n dominant-baseline=\"middle\"\n [attr.x]=\"layout().left - layout().axisPx / 2\"\n [attr.y]=\"tick.pos\">\n {{ tick.text }}\n </text>\n } @else {\n @if (showGrid()) {\n <line\n class=\"ea-bar-chart__grid\"\n [attr.x1]=\"tick.pos\"\n [attr.x2]=\"tick.pos\"\n [attr.y1]=\"layout().top\"\n [attr.y2]=\"layout().top + layout().plotHeight\" />\n }\n <text\n class=\"ea-bar-chart__axis\"\n text-anchor=\"middle\"\n [attr.x]=\"tick.pos\"\n [attr.y]=\"layout().top + layout().plotHeight + layout().axisPx * 1.5\">\n {{ tick.text }}\n </text>\n }\n }\n @for (category of layout().categories; track category.index) {\n @if (layout().vertical) {\n <text\n class=\"ea-bar-chart__axis\"\n text-anchor=\"middle\"\n [attr.
|
|
9099
|
-
styles: ["@keyframes ea-chart-fade{0%{opacity:0}}@keyframes ea-chart-draw{0%{stroke-dashoffset:1}}@keyframes ea-chart-grow-y{0%{transform:scaleY(0)}}@keyframes ea-chart-grow-x{0%{transform:scaleX(0)}}@keyframes ea-chart-grow{0%{transform:scale(0)}}ea-bar-chart{display:block}.ea-bar-chart{position:relative;display:flex;flex-direction:column;gap:.75em;font-family:var(--font-family-sans);color:var(--color-text-primary)}.ea-bar-chart--2xs{font-size:var(--font-size-2xs)}.ea-bar-chart--xs{font-size:var(--font-size-xs)}.ea-bar-chart--sm{font-size:var(--font-size-sm)}.ea-bar-chart--md{font-size:var(--font-size-md)}.ea-bar-chart--lg{font-size:var(--font-size-lg)}.ea-bar-chart--xl{font-size:var(--font-size-xl)}.ea-bar-chart__plot{position:relative;border-radius:var(--radius-md);outline:none}.ea-bar-chart__plot:focus-visible{box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-bar-chart__plot:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-bar-chart__plot svg{display:block;overflow:visible}.ea-bar-chart__svg{direction:ltr;touch-action:pan-y}.ea-bar-chart__hit{fill:transparent}.ea-bar-chart__grid{stroke:var(--color-divider);stroke-width:1px;shape-rendering:crispEdges}.ea-bar-chart__baseline{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges;pointer-events:none}.ea-bar-chart__axis{font-size:.75em;fill:var(--color-text-secondary)}.ea-bar-chart__value{font-size:.75em;fill:var(--color-text-secondary);font-variant-numeric:tabular-nums;fill:var(--color-text-primary);pointer-events:none}.ea-bar-chart__bar{fill:var(--ea-chart-color);pointer-events:none;transition:opacity var(--duration-fast) var(--ease-out);transform-box:view-box}.ea-bar-chart__bar--dimmed{opacity:.35}.ea-bar-chart--vertical .ea-bar-chart__bar{transform-origin:0 var(--ea-bar-chart-baseline)}.ea-bar-chart--horizontal .ea-bar-chart__bar{transform-origin:var(--ea-bar-chart-baseline) 0}.ea-bar-chart__tooltip{display:flex;flex-direction:column;gap:var(--space-1)}.ea-bar-chart__anchor{fill:transparent}.ea-bar-chart__tooltip-title{font-weight:var(--font-weight-medium)}.ea-bar-chart__tooltip-row{display:flex;align-items:center;gap:.5em}.ea-bar-chart__tooltip-row--active{font-weight:var(--font-weight-medium)}.ea-bar-chart__tooltip-value{
|
|
9211
|
+
template: "<div\n class=\"ea-bar-chart\"\n [ngClass]=\"hostClasses()\"\n [style.--ea-chart-duration]=\"animationDuration() + 'ms'\">\n @if (hasData()) {\n <div\n class=\"ea-bar-chart__plot\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-roledescription]=\"i18n.messages().chart.roleDescription\"\n [attr.aria-label]=\"label()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\">\n @for (pass of renderPass(); track pass) {\n <svg\n class=\"ea-bar-chart__svg\"\n aria-hidden=\"true\"\n [attr.width]=\"layout().width\"\n [attr.height]=\"layout().height\"\n [attr.viewBox]=\"'0 0 ' + layout().width + ' ' + layout().height\"\n [style.--ea-bar-chart-baseline]=\"layout().baseline + 'px'\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerdown)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave()\"\n (click)=\"onClick()\">\n <rect\n class=\"ea-bar-chart__hit\"\n [attr.x]=\"layout().left\"\n [attr.y]=\"layout().top\"\n [attr.width]=\"layout().plotWidth\"\n [attr.height]=\"layout().plotHeight\" />\n @for (tick of layout().ticks; track tick.value) {\n @if (layout().vertical) {\n @if (showGrid()) {\n <line\n class=\"ea-bar-chart__grid\"\n [attr.x1]=\"layout().left\"\n [attr.x2]=\"layout().left + layout().plotWidth\"\n [attr.y1]=\"tick.pos\"\n [attr.y2]=\"tick.pos\" />\n }\n <text\n class=\"ea-bar-chart__axis\"\n text-anchor=\"end\"\n dominant-baseline=\"middle\"\n [attr.x]=\"layout().left - layout().axisPx / 2\"\n [attr.y]=\"tick.pos\">\n {{ tick.text }}\n </text>\n } @else {\n @if (showGrid()) {\n <line\n class=\"ea-bar-chart__grid\"\n [attr.x1]=\"tick.pos\"\n [attr.x2]=\"tick.pos\"\n [attr.y1]=\"layout().top\"\n [attr.y2]=\"layout().top + layout().plotHeight\" />\n }\n <text\n class=\"ea-bar-chart__axis\"\n text-anchor=\"middle\"\n [attr.x]=\"tick.pos\"\n [attr.y]=\"layout().top + layout().plotHeight + layout().axisPx * 1.5\">\n {{ tick.text }}\n </text>\n }\n }\n @for (category of layout().categories; track category.index) {\n @if (layout().vertical) {\n <line\n class=\"ea-bar-chart__x-tick\"\n [attr.x1]=\"category.pos\"\n [attr.x2]=\"category.pos\"\n [attr.y1]=\"layout().axisY\"\n [attr.y2]=\"layout().tickEndY\" />\n <text\n class=\"ea-bar-chart__axis\"\n [attr.text-anchor]=\"layout().labelAngle ? 'end' : 'middle'\"\n [attr.dominant-baseline]=\"layout().labelAngle ? 'central' : null\"\n [attr.transform]=\"\n layout().labelAngle\n ? 'rotate(' +\n -layout().labelAngle +\n ' ' +\n category.pos +\n ' ' +\n layout().labelY +\n ')'\n : null\n \"\n [attr.x]=\"category.pos\"\n [attr.y]=\"layout().labelY\">\n {{ category.text }}\n </text>\n } @else {\n <text\n class=\"ea-bar-chart__axis\"\n text-anchor=\"end\"\n dominant-baseline=\"middle\"\n [attr.x]=\"layout().left - layout().axisPx / 2\"\n [attr.y]=\"category.pos\">\n {{ category.text }}\n </text>\n }\n }\n @for (bar of layout().bars; track $index) {\n <path\n class=\"ea-bar-chart__bar\"\n [class.ea-bar-chart__bar--dimmed]=\"isDimmed(bar)\"\n [style.--ea-chart-color]=\"bar.color\"\n [style.--ea-chart-delay]=\"bar.delay + 'ms'\"\n [attr.d]=\"bar.path\" />\n }\n @if (layout().axisBreak; as axisBreak) {\n <path\n class=\"ea-bar-chart__y-axis\"\n [attr.d]=\"axisBreak.axis\" />\n <path\n class=\"ea-bar-chart__axis-break\"\n [attr.d]=\"axisBreak.slashes\" />\n }\n @if (layout().vertical) {\n <line\n class=\"ea-bar-chart__baseline\"\n [attr.x1]=\"layout().left\"\n [attr.x2]=\"layout().left + layout().plotWidth\"\n [attr.y1]=\"layout().baseline\"\n [attr.y2]=\"layout().baseline\" />\n } @else {\n <line\n class=\"ea-bar-chart__baseline\"\n [attr.x1]=\"layout().baseline\"\n [attr.x2]=\"layout().baseline\"\n [attr.y1]=\"layout().top\"\n [attr.y2]=\"layout().top + layout().plotHeight\" />\n }\n @for (valueLabel of layout().valueLabels; track valueLabel.key) {\n <text\n class=\"ea-bar-chart__value\"\n [attr.text-anchor]=\"valueLabel.anchor\"\n [attr.dominant-baseline]=\"layout().vertical ? null : 'middle'\"\n [attr.x]=\"valueLabel.x\"\n [attr.y]=\"valueLabel.y\">\n {{ valueLabel.text }}\n </text>\n }\n @for (tip of tooltips(); track tip.key) {\n <rect\n class=\"ea-bar-chart__anchor\"\n width=\"2\"\n height=\"2\"\n [attr.x]=\"tip.x - 1\"\n [attr.y]=\"tip.y - 1\"\n [eaTooltip]=\"tooltipContent\"\n [tooltipOpen]=\"true\"\n [maxWidth]=\"undefined\" />\n }\n </svg>\n }\n <ng-template #tooltipContent>\n @if (tooltip(); as tip) {\n <div class=\"ea-bar-chart__tooltip\">\n <span class=\"ea-bar-chart__tooltip-title\">{{ tip.title }}</span>\n @for (row of tip.rows; track $index) {\n <span\n class=\"ea-bar-chart__tooltip-row\"\n [class.ea-bar-chart__tooltip-row--active]=\"row.active\">\n <span\n class=\"ea-bar-chart__swatch\"\n [style.--ea-chart-color]=\"row.color\">\n </span>\n <span class=\"ea-bar-chart__tooltip-name\">{{ row.name }}</span>\n <span class=\"ea-bar-chart__tooltip-value\">{{ row.value }}</span>\n </span>\n }\n </div>\n }\n </ng-template>\n <!-- Hidden through a block, since a table ignores the 1px size and keeps its full height -->\n <div class=\"ea-bar-chart__table\">\n <table>\n <caption>\n {{ label() }}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">{{ i18n.messages().chart.category }}</th>\n @for (s of series(); track $index) {\n <th scope=\"col\">{{ s.name }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of labels(); track $index; let i = $index) {\n <tr>\n <th scope=\"row\">{{ row }}</th>\n @for (s of series(); track $index) {\n <td>{{ tableValue(s.data[i]) }}</td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n </div>\n <div\n class=\"ea-bar-chart__live\"\n aria-live=\"polite\">\n {{ announcement() }}\n </div>\n } @else {\n <div\n class=\"ea-bar-chart__empty\"\n role=\"img\"\n [attr.aria-label]=\"label()\"\n [style.height.px]=\"height()\">\n {{ i18n.messages().chart.noData }}\n </div>\n }\n @if (showsLegend()) {\n <ul\n class=\"ea-bar-chart__legend\"\n aria-hidden=\"true\">\n @for (s of series(); track $index; let i = $index) {\n <li class=\"ea-bar-chart__legend-item\">\n <span\n class=\"ea-bar-chart__swatch\"\n [style.--ea-chart-color]=\"seriesColor(i)\">\n </span>\n {{ s.name }}\n </li>\n }\n </ul>\n }\n</div>\n",
|
|
9212
|
+
styles: ["@keyframes ea-chart-fade{0%{opacity:0}}@keyframes ea-chart-draw{0%{stroke-dashoffset:1}}@keyframes ea-chart-grow-y{0%{transform:scaleY(0)}}@keyframes ea-chart-grow-x{0%{transform:scaleX(0)}}@keyframes ea-chart-grow{0%{transform:scale(0)}}ea-bar-chart{display:block}.ea-bar-chart{position:relative;display:flex;flex-direction:column;gap:.75em;font-family:var(--font-family-sans);color:var(--color-text-primary)}.ea-bar-chart--2xs{font-size:var(--font-size-2xs)}.ea-bar-chart--xs{font-size:var(--font-size-xs)}.ea-bar-chart--sm{font-size:var(--font-size-sm)}.ea-bar-chart--md{font-size:var(--font-size-md)}.ea-bar-chart--lg{font-size:var(--font-size-lg)}.ea-bar-chart--xl{font-size:var(--font-size-xl)}.ea-bar-chart__plot{position:relative;border-radius:var(--radius-md);outline:none}.ea-bar-chart__plot:focus-visible{box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-bar-chart__plot:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-bar-chart__plot svg{display:block;overflow:visible}.ea-bar-chart__svg{direction:ltr;touch-action:pan-y}.ea-bar-chart__hit{fill:transparent}.ea-bar-chart__grid{stroke:var(--color-divider);stroke-width:1px;shape-rendering:crispEdges}.ea-bar-chart__baseline{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges;pointer-events:none}.ea-bar-chart__axis{font-size:.75em;fill:var(--color-text-secondary)}.ea-bar-chart__x-tick{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges}.ea-bar-chart__y-axis{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges;fill:none}.ea-bar-chart__axis-break{fill:none;stroke:var(--color-border-strong);stroke-width:1.5px;stroke-linecap:round}.ea-bar-chart__value{font-size:.75em;fill:var(--color-text-secondary);font-variant-numeric:tabular-nums;fill:var(--color-text-primary);pointer-events:none}.ea-bar-chart__bar{fill:var(--ea-chart-color);pointer-events:none;transition:opacity var(--duration-fast) var(--ease-out);transform-box:view-box}.ea-bar-chart__bar--dimmed{opacity:.35}.ea-bar-chart--vertical .ea-bar-chart__bar{transform-origin:0 var(--ea-bar-chart-baseline)}.ea-bar-chart--horizontal .ea-bar-chart__bar{transform-origin:var(--ea-bar-chart-baseline) 0}.ea-bar-chart__tooltip{display:flex;flex-direction:column;gap:var(--space-1)}.ea-bar-chart__anchor{fill:transparent}.ea-bar-chart__tooltip-title{font-weight:var(--font-weight-medium)}.ea-bar-chart__tooltip-row{display:flex;align-items:center;gap:.5em}.ea-bar-chart__tooltip-row--active{font-weight:var(--font-weight-medium)}.ea-bar-chart__tooltip-value{font-weight:var(--font-weight-semibold);font-variant-numeric:tabular-nums}.ea-bar-chart__swatch{flex-shrink:0;width:.75em;height:.75em;border-radius:var(--radius-sm);background-color:var(--ea-chart-color)}.ea-bar-chart__legend{display:flex;flex-wrap:wrap;justify-content:center;gap:.375em 1em;padding:0;margin:0;font-size:.875em;list-style:none;color:var(--color-text-secondary)}.ea-bar-chart__legend-item{display:flex;align-items:center;gap:.375em}.ea-bar-chart__table,.ea-bar-chart__live{position:absolute;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);width:1px;height:1px;padding:0;margin:-1px;white-space:nowrap;border:0}.ea-bar-chart__empty{display:flex;align-items:center;justify-content:center;font-size:.875em;color:var(--color-text-tertiary)}.ea-bar-chart--animate-grow.ea-bar-chart--vertical .ea-bar-chart__bar,.ea-bar-chart--animate-cascade.ea-bar-chart--vertical .ea-bar-chart__bar{animation-name:ea-chart-grow-y}.ea-bar-chart--animate-grow.ea-bar-chart--horizontal .ea-bar-chart__bar,.ea-bar-chart--animate-cascade.ea-bar-chart--horizontal .ea-bar-chart__bar{animation-name:ea-chart-grow-x}.ea-bar-chart--animate-grow .ea-bar-chart__bar,.ea-bar-chart--animate-cascade .ea-bar-chart__bar{animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-bar-chart--animate-grow .ea-bar-chart__bar,.ea-bar-chart--animate-cascade .ea-bar-chart__bar{animation:none}}.ea-bar-chart--animate-grow .ea-bar-chart__value,.ea-bar-chart--animate-cascade .ea-bar-chart__value{animation-name:ea-chart-fade;animation-delay:calc(var(--ea-chart-duration, .6s) * .8);animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-bar-chart--animate-grow .ea-bar-chart__value,.ea-bar-chart--animate-cascade .ea-bar-chart__value{animation:none}}.ea-bar-chart--animate-cascade .ea-bar-chart__bar{animation-delay:var(--ea-chart-delay, 0ms)}.ea-bar-chart--animate-cascade .ea-bar-chart__value{animation-delay:calc(var(--ea-chart-duration, .6s) * 1.3)}.ea-bar-chart--animate-fade .ea-bar-chart__bar,.ea-bar-chart--animate-fade .ea-bar-chart__value{animation-name:ea-chart-fade;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-bar-chart--animate-fade .ea-bar-chart__bar,.ea-bar-chart--animate-fade .ea-bar-chart__value{animation:none}}\n"]
|
|
9100
9213
|
}]
|
|
9101
9214
|
}],
|
|
9102
9215
|
propDecorators: {
|
|
@@ -9156,6 +9269,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
9156
9269
|
required: false
|
|
9157
9270
|
}]
|
|
9158
9271
|
}],
|
|
9272
|
+
xLabelOrientation: [{
|
|
9273
|
+
type: i0.Input,
|
|
9274
|
+
args: [{
|
|
9275
|
+
isSignal: true,
|
|
9276
|
+
alias: "xLabelOrientation",
|
|
9277
|
+
required: false
|
|
9278
|
+
}]
|
|
9279
|
+
}],
|
|
9280
|
+
showAxisBreak: [{
|
|
9281
|
+
type: i0.Input,
|
|
9282
|
+
args: [{
|
|
9283
|
+
isSignal: true,
|
|
9284
|
+
alias: "showAxisBreak",
|
|
9285
|
+
required: false
|
|
9286
|
+
}]
|
|
9287
|
+
}],
|
|
9159
9288
|
height: [{
|
|
9160
9289
|
type: i0.Input,
|
|
9161
9290
|
args: [{
|
|
@@ -19091,6 +19220,14 @@ function roundTo(value, digits) {
|
|
|
19091
19220
|
const factor = 10 ** digits;
|
|
19092
19221
|
return (Math.round(value * factor) / factor).toString();
|
|
19093
19222
|
}
|
|
19223
|
+
const EDGE_INSET = 8;
|
|
19224
|
+
const DRAG_THRESHOLD = 4;
|
|
19225
|
+
const WHEEL_LINE_PX = 16;
|
|
19226
|
+
const ZOOM_RATE = .01;
|
|
19227
|
+
function valueBetween(a, b, position, curve) {
|
|
19228
|
+
if (curve === "step") return position < (a.position + b.position) / 2 ? a.value : b.value;
|
|
19229
|
+
return a.value + (b.value - a.value) * (position - a.position) / (b.position - a.position);
|
|
19230
|
+
}
|
|
19094
19231
|
function linearPath(points) {
|
|
19095
19232
|
return points.map((p, i) => `${i ? "L" : "M"}${p.x},${p.y}`).join("");
|
|
19096
19233
|
}
|
|
@@ -19139,10 +19276,14 @@ const CURVES = {
|
|
|
19139
19276
|
smooth: smoothPath,
|
|
19140
19277
|
step: stepPath
|
|
19141
19278
|
};
|
|
19279
|
+
let nextId = 0;
|
|
19142
19280
|
var LineChartComponent = class LineChartComponent {
|
|
19143
19281
|
i18n = inject(EagamiI18nService);
|
|
19144
19282
|
labels = input([], ...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
|
|
19145
19283
|
series = input([], ...ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []);
|
|
19284
|
+
xValues = input(null, ...ngDevMode ? [{ debugName: "xValues" }] : /* istanbul ignore next */ []);
|
|
19285
|
+
xTicks = input(null, ...ngDevMode ? [{ debugName: "xTicks" }] : /* istanbul ignore next */ []);
|
|
19286
|
+
visibleXSpan = input(null, ...ngDevMode ? [{ debugName: "visibleXSpan" }] : /* istanbul ignore next */ []);
|
|
19146
19287
|
curve = input("linear", ...ngDevMode ? [{ debugName: "curve" }] : /* istanbul ignore next */ []);
|
|
19147
19288
|
showArea = input(false, ...ngDevMode ? [{ debugName: "showArea" }] : /* istanbul ignore next */ []);
|
|
19148
19289
|
showPoints = input(true, ...ngDevMode ? [{ debugName: "showPoints" }] : /* istanbul ignore next */ []);
|
|
@@ -19150,6 +19291,8 @@ var LineChartComponent = class LineChartComponent {
|
|
|
19150
19291
|
showLegend = input(true, ...ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []);
|
|
19151
19292
|
yMin = input(void 0, ...ngDevMode ? [{ debugName: "yMin" }] : /* istanbul ignore next */ []);
|
|
19152
19293
|
yMax = input(void 0, ...ngDevMode ? [{ debugName: "yMax" }] : /* istanbul ignore next */ []);
|
|
19294
|
+
xLabelOrientation = input("horizontal", ...ngDevMode ? [{ debugName: "xLabelOrientation" }] : /* istanbul ignore next */ []);
|
|
19295
|
+
showAxisBreak = input(false, ...ngDevMode ? [{ debugName: "showAxisBreak" }] : /* istanbul ignore next */ []);
|
|
19153
19296
|
height = input(240, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
|
|
19154
19297
|
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
19155
19298
|
animation = input("draw", ...ngDevMode ? [{ debugName: "animation" }] : /* istanbul ignore next */ []);
|
|
@@ -19161,85 +19304,133 @@ var LineChartComponent = class LineChartComponent {
|
|
|
19161
19304
|
});
|
|
19162
19305
|
pointClick = output();
|
|
19163
19306
|
activePointChange = output();
|
|
19307
|
+
visibleRangeChange = output();
|
|
19164
19308
|
viewport = injectChartViewport(this.size);
|
|
19165
19309
|
format = injectChartFormatter(this.formatValue);
|
|
19166
19310
|
active = signal(null, ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
19311
|
+
clipId = `ea-line-chart-clip-${nextId++}`;
|
|
19312
|
+
breakMaskId = `${this.clipId}-break`;
|
|
19313
|
+
panEnd = linkedSignal(() => {
|
|
19314
|
+
this.xValues();
|
|
19315
|
+
this.series();
|
|
19316
|
+
this.visibleXSpan();
|
|
19317
|
+
return null;
|
|
19318
|
+
}, ...ngDevMode ? [{ debugName: "panEnd" }] : /* istanbul ignore next */ []);
|
|
19319
|
+
zoomSpan = linkedSignal(() => this.visibleXSpan(), ...ngDevMode ? [{ debugName: "zoomSpan" }] : /* istanbul ignore next */ []);
|
|
19320
|
+
gestureSpan = null;
|
|
19321
|
+
panning = signal(false, ...ngDevMode ? [{ debugName: "panning" }] : /* istanbul ignore next */ []);
|
|
19322
|
+
drag = null;
|
|
19323
|
+
suppressClick = false;
|
|
19167
19324
|
label = computed(() => this.ariaLabel() || this.i18n.messages().chart.lineChart, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
19168
19325
|
count = computed(() => Math.max(this.labels().length, ...this.series().map((s) => s.data.length), 0), ...ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []);
|
|
19169
|
-
hasData = computed(() => this.series().some((s) => s.data.some((v) =>
|
|
19326
|
+
hasData = computed(() => this.series().some((s) => s.data.some((v) => this.isValue(v))), ...ngDevMode ? [{ debugName: "hasData" }] : /* istanbul ignore next */ []);
|
|
19327
|
+
positions = computed(() => {
|
|
19328
|
+
const xValues = this.xValues();
|
|
19329
|
+
return Array.from({ length: this.count() }, (_, i) => xValues ? xValues[i] ?? NaN : i);
|
|
19330
|
+
}, ...ngDevMode ? [{ debugName: "positions" }] : /* istanbul ignore next */ []);
|
|
19331
|
+
domain = computed(() => {
|
|
19332
|
+
const known = [...this.positions(), ...this.xTicks()?.map((t) => t.value) ?? []].filter((p) => isFinite(p));
|
|
19333
|
+
const first = known.length ? Math.min(...known) : 0;
|
|
19334
|
+
const last = known.length ? Math.max(...known) : 0;
|
|
19335
|
+
const span = this.zoomSpan();
|
|
19336
|
+
if (span == null || !(span > 0) || last - first <= span) return {
|
|
19337
|
+
first,
|
|
19338
|
+
last,
|
|
19339
|
+
start: first,
|
|
19340
|
+
end: last,
|
|
19341
|
+
span: null
|
|
19342
|
+
};
|
|
19343
|
+
const end = clamp$1(this.panEnd() ?? last, first + span, last);
|
|
19344
|
+
return {
|
|
19345
|
+
first,
|
|
19346
|
+
last,
|
|
19347
|
+
start: end - span,
|
|
19348
|
+
end,
|
|
19349
|
+
span
|
|
19350
|
+
};
|
|
19351
|
+
}, ...ngDevMode ? [{ debugName: "domain" }] : /* istanbul ignore next */ []);
|
|
19352
|
+
windowed = computed(() => this.domain().span != null, ...ngDevMode ? [{ debugName: "windowed" }] : /* istanbul ignore next */ []);
|
|
19170
19353
|
renderPass = computed(() => {
|
|
19171
19354
|
this.labels();
|
|
19172
19355
|
this.series();
|
|
19356
|
+
this.xValues();
|
|
19173
19357
|
this.animation();
|
|
19174
19358
|
this.animationDuration();
|
|
19175
19359
|
return [{}];
|
|
19176
19360
|
}, ...ngDevMode ? [{ debugName: "renderPass" }] : /* istanbul ignore next */ []);
|
|
19177
19361
|
hostClasses = computed(() => ({
|
|
19178
19362
|
[`ea-line-chart--${this.size()}`]: true,
|
|
19179
|
-
[`ea-line-chart--animate-${this.animation()}`]: true
|
|
19363
|
+
[`ea-line-chart--animate-${this.animation()}`]: true,
|
|
19364
|
+
"ea-line-chart--pannable": this.windowed(),
|
|
19365
|
+
"ea-line-chart--panning": this.panning()
|
|
19180
19366
|
}), ...ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []);
|
|
19367
|
+
runs = computed(() => {
|
|
19368
|
+
const positions = this.positions();
|
|
19369
|
+
return this.series().map((s) => {
|
|
19370
|
+
const runs = [];
|
|
19371
|
+
let run = [];
|
|
19372
|
+
positions.forEach((position, index) => {
|
|
19373
|
+
const value = s.data[index];
|
|
19374
|
+
if (!this.isValue(value) || !isFinite(position)) {
|
|
19375
|
+
if (run.length) runs.push(run);
|
|
19376
|
+
run = [];
|
|
19377
|
+
return;
|
|
19378
|
+
}
|
|
19379
|
+
run.push({
|
|
19380
|
+
index,
|
|
19381
|
+
position,
|
|
19382
|
+
value
|
|
19383
|
+
});
|
|
19384
|
+
});
|
|
19385
|
+
if (run.length) runs.push(run);
|
|
19386
|
+
return runs;
|
|
19387
|
+
});
|
|
19388
|
+
}, ...ngDevMode ? [{ debugName: "runs" }] : /* istanbul ignore next */ []);
|
|
19389
|
+
visibleValues = computed(() => {
|
|
19390
|
+
const runs = this.runs().flat();
|
|
19391
|
+
const domain = this.domain();
|
|
19392
|
+
if (domain.span == null) return runs.flatMap((run) => run.map((p) => p.value));
|
|
19393
|
+
const curve = this.curve();
|
|
19394
|
+
const values = [];
|
|
19395
|
+
for (const run of runs) run.forEach((point, i) => {
|
|
19396
|
+
if (point.position >= domain.start && point.position <= domain.end) values.push(point.value);
|
|
19397
|
+
const next = run[i + 1];
|
|
19398
|
+
for (const edge of next ? [domain.start, domain.end] : []) if (point.position < edge && next.position > edge) values.push(valueBetween(point, next, edge, curve));
|
|
19399
|
+
});
|
|
19400
|
+
return values;
|
|
19401
|
+
}, ...ngDevMode ? [{ debugName: "visibleValues" }] : /* istanbul ignore next */ []);
|
|
19181
19402
|
layout = computed(() => {
|
|
19182
|
-
const count = this.count();
|
|
19183
19403
|
const width = this.viewport.width();
|
|
19184
19404
|
const height = this.height();
|
|
19185
19405
|
const axisPx = this.viewport.fontSize() * .75;
|
|
19186
|
-
const
|
|
19187
|
-
const
|
|
19406
|
+
const orientation = this.xLabelOrientation();
|
|
19407
|
+
const fixedAngle = orientation === "auto" ? 0 : CHART_LABEL_ANGLES[orientation];
|
|
19408
|
+
const plot = this.plotArea(width, height, axisPx, fixedAngle);
|
|
19409
|
+
const angle = orientation === "auto" ? [
|
|
19410
|
+
0,
|
|
19411
|
+
45,
|
|
19412
|
+
90
|
|
19413
|
+
].find((a) => this.labelsFit(plot.candidates, a, axisPx)) ?? 90 : fixedAngle;
|
|
19414
|
+
const { plotHeight, min, max, tickTexts, left, plotWidth, x, xLabels } = angle === fixedAngle ? plot : this.plotArea(width, height, axisPx, angle);
|
|
19188
19415
|
const top = axisPx;
|
|
19189
|
-
const bottom = axisPx * 2.5;
|
|
19190
|
-
const plotHeight = Math.max(1, height - top - bottom);
|
|
19191
|
-
let lo = this.yMin() ?? Math.min(...values);
|
|
19192
|
-
let hi = this.yMax() ?? Math.max(...values);
|
|
19193
|
-
if (this.showArea() && this.yMin() === void 0) lo = Math.min(lo, 0);
|
|
19194
|
-
if (lo > hi) [lo, hi] = [hi, lo];
|
|
19195
|
-
const scale = niceScale(lo, hi, Math.max(2, Math.floor(plotHeight / (axisPx * 3))));
|
|
19196
|
-
let min = this.yMin() ?? scale.min;
|
|
19197
|
-
let max = this.yMax() ?? scale.max;
|
|
19198
|
-
if (min > max) [min, max] = [max, min];
|
|
19199
|
-
const ticks = scale.ticks.filter((t) => t >= min && t <= max).map((value) => ({
|
|
19200
|
-
value,
|
|
19201
|
-
text: format(value)
|
|
19202
|
-
}));
|
|
19203
|
-
const labelTexts = Array.from({ length: count }, (_, i) => this.labels()[i] ?? "");
|
|
19204
|
-
const widestLabel = Math.max(0, ...labelTexts.map((t) => estimateTextWidth(t, axisPx)));
|
|
19205
|
-
const left = Math.max(0, ...ticks.map((t) => estimateTextWidth(t.text, axisPx))) + axisPx;
|
|
19206
|
-
const right = Math.min(widestLabel / 2, width * .1) + axisPx / 2;
|
|
19207
|
-
const plotWidth = Math.max(1, width - left - right);
|
|
19208
|
-
const spacing = count > 1 ? plotWidth / (count - 1) : plotWidth;
|
|
19209
|
-
const x = (i) => count > 1 ? left + i * spacing : left + plotWidth / 2;
|
|
19210
19416
|
const y = (v) => top + (1 - (clamp$1(v, min, max) - min) / (max - min || 1)) * plotHeight;
|
|
19211
19417
|
const baselineY = y(clamp$1(0, min, max));
|
|
19212
|
-
const
|
|
19213
|
-
const
|
|
19214
|
-
text,
|
|
19215
|
-
index,
|
|
19216
|
-
x: x(index)
|
|
19217
|
-
})).filter((l) => l.index % labelStep === 0);
|
|
19418
|
+
const breakY = this.showAxisBreak() && min > 0 ? top + plotHeight - axisPx * BREAK_HEIGHT : null;
|
|
19419
|
+
const axisY = top + plotHeight;
|
|
19218
19420
|
const curve = CURVES[this.curve()];
|
|
19219
19421
|
const series = this.series().map((s, seriesIndex) => {
|
|
19220
|
-
const
|
|
19221
|
-
|
|
19222
|
-
|
|
19223
|
-
|
|
19224
|
-
|
|
19225
|
-
|
|
19226
|
-
run = [];
|
|
19227
|
-
continue;
|
|
19228
|
-
}
|
|
19229
|
-
run.push({
|
|
19230
|
-
x: x(index),
|
|
19231
|
-
y: y(value),
|
|
19232
|
-
index,
|
|
19233
|
-
value
|
|
19234
|
-
});
|
|
19235
|
-
}
|
|
19236
|
-
if (run.length) segments.push(run);
|
|
19422
|
+
const runs = this.runs()[seriesIndex].map((run) => run.map((p) => ({
|
|
19423
|
+
x: x(p.index),
|
|
19424
|
+
y: y(p.value),
|
|
19425
|
+
index: p.index,
|
|
19426
|
+
value: p.value
|
|
19427
|
+
})));
|
|
19237
19428
|
return {
|
|
19238
19429
|
name: s.name,
|
|
19239
19430
|
color: chartColor(seriesIndex, s.color),
|
|
19240
|
-
paths:
|
|
19241
|
-
areas:
|
|
19242
|
-
points:
|
|
19431
|
+
paths: runs.map(curve),
|
|
19432
|
+
areas: runs.map((seg) => `${curve(seg)}L${seg[seg.length - 1].x},${baselineY}L${seg[0].x},${baselineY}Z`),
|
|
19433
|
+
points: runs.flat()
|
|
19243
19434
|
};
|
|
19244
19435
|
});
|
|
19245
19436
|
return {
|
|
@@ -19250,18 +19441,72 @@ var LineChartComponent = class LineChartComponent {
|
|
|
19250
19441
|
plotWidth,
|
|
19251
19442
|
plotHeight,
|
|
19252
19443
|
baselineY,
|
|
19253
|
-
|
|
19444
|
+
windowed: this.domain().span != null,
|
|
19445
|
+
axisBreak: breakY == null ? null : axisBreak(left, top, axisY, breakY, axisPx),
|
|
19446
|
+
axisY,
|
|
19447
|
+
tickEndY: axisY + tickLength(axisPx),
|
|
19448
|
+
labelAngle: angle,
|
|
19449
|
+
labelY: labelLine(axisY, angle, axisPx),
|
|
19254
19450
|
tickX: left - axisPx / 2,
|
|
19255
|
-
ticks:
|
|
19451
|
+
ticks: tickTexts.map((t) => ({
|
|
19256
19452
|
...t,
|
|
19257
19453
|
y: y(t.value)
|
|
19258
|
-
})),
|
|
19454
|
+
})).filter((t) => breakY == null || t.y < breakY - axisPx),
|
|
19259
19455
|
xLabels,
|
|
19260
19456
|
series,
|
|
19261
19457
|
x,
|
|
19262
19458
|
y
|
|
19263
19459
|
};
|
|
19264
19460
|
}, ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
|
|
19461
|
+
plotArea(width, height, axisPx, angle) {
|
|
19462
|
+
const format = this.format();
|
|
19463
|
+
const domain = this.domain();
|
|
19464
|
+
const windowed = domain.span != null;
|
|
19465
|
+
const top = axisPx;
|
|
19466
|
+
const bottom = labelBand(this.widestXLabel(axisPx), angle, axisPx, height);
|
|
19467
|
+
const plotHeight = Math.max(1, height - top - bottom);
|
|
19468
|
+
const maxTicks = Math.max(2, Math.floor(plotHeight / (axisPx * 3)));
|
|
19469
|
+
const { min, max, ticks } = this.yScale(this.visibleValues(), plotHeight, axisPx, maxTicks);
|
|
19470
|
+
const tickTexts = ticks.map((value) => ({
|
|
19471
|
+
value,
|
|
19472
|
+
text: format(value)
|
|
19473
|
+
}));
|
|
19474
|
+
const gutterTexts = [...tickTexts.map((t) => t.text), ...windowed ? this.yScale(this.runs().flatMap((runs) => runs.flat().map((p) => p.value)), plotHeight, axisPx, maxTicks).ticks.map(format) : []];
|
|
19475
|
+
const left = Math.max(0, ...gutterTexts.map((t) => estimateTextWidth(t, axisPx))) + axisPx;
|
|
19476
|
+
const positions = this.positions();
|
|
19477
|
+
const xAxis = (right) => {
|
|
19478
|
+
const plotWidth = Math.max(1, width - left - right);
|
|
19479
|
+
const at = this.atPosition(domain, left, plotWidth);
|
|
19480
|
+
const x = (i) => at(positions[i]);
|
|
19481
|
+
return {
|
|
19482
|
+
plotWidth,
|
|
19483
|
+
x,
|
|
19484
|
+
xLabels: this.xLabels(domain, at, x, plotWidth, axisPx, angle),
|
|
19485
|
+
candidates: this.xLabelCandidates(domain, at, x)
|
|
19486
|
+
};
|
|
19487
|
+
};
|
|
19488
|
+
const axis = xAxis(axisPx / 2);
|
|
19489
|
+
const xLabels = axis.xLabels.map((label) => {
|
|
19490
|
+
if (angle) return {
|
|
19491
|
+
...label,
|
|
19492
|
+
textX: label.x
|
|
19493
|
+
};
|
|
19494
|
+
const half = estimateTextWidth(label.text, axisPx) / 2;
|
|
19495
|
+
return {
|
|
19496
|
+
...label,
|
|
19497
|
+
textX: clamp$1(label.x, half, width - half)
|
|
19498
|
+
};
|
|
19499
|
+
});
|
|
19500
|
+
return {
|
|
19501
|
+
plotHeight,
|
|
19502
|
+
min,
|
|
19503
|
+
max,
|
|
19504
|
+
tickTexts,
|
|
19505
|
+
left,
|
|
19506
|
+
...axis,
|
|
19507
|
+
xLabels
|
|
19508
|
+
};
|
|
19509
|
+
}
|
|
19265
19510
|
tooltip = computed(() => {
|
|
19266
19511
|
const active = this.active();
|
|
19267
19512
|
if (!active) return null;
|
|
@@ -19273,13 +19518,13 @@ var LineChartComponent = class LineChartComponent {
|
|
|
19273
19518
|
return {
|
|
19274
19519
|
name: s.name,
|
|
19275
19520
|
color: chartColor(i, s.color),
|
|
19276
|
-
value:
|
|
19521
|
+
value: this.tableValue(value),
|
|
19277
19522
|
active: i === active.series
|
|
19278
19523
|
};
|
|
19279
19524
|
});
|
|
19280
19525
|
return {
|
|
19281
19526
|
x,
|
|
19282
|
-
y:
|
|
19527
|
+
y: this.isValue(activeValue) ? layout.y(activeValue) : layout.top,
|
|
19283
19528
|
title: this.labels()[active.index] ?? "",
|
|
19284
19529
|
rows,
|
|
19285
19530
|
key: `${active.series}-${active.index}`
|
|
@@ -19306,20 +19551,44 @@ var LineChartComponent = class LineChartComponent {
|
|
|
19306
19551
|
return !!active && active.series === seriesIndex && active.index === index;
|
|
19307
19552
|
}
|
|
19308
19553
|
tableValue(value) {
|
|
19309
|
-
return
|
|
19554
|
+
return this.isValue(value) ? this.format()(value) : "–";
|
|
19555
|
+
}
|
|
19556
|
+
onPointerDown(event) {
|
|
19557
|
+
this.suppressClick = false;
|
|
19558
|
+
const domain = this.domain();
|
|
19559
|
+
if (domain.span != null && event.button === 0) this.drag = {
|
|
19560
|
+
pointerId: event.pointerId,
|
|
19561
|
+
x: event.clientX,
|
|
19562
|
+
end: domain.end,
|
|
19563
|
+
moved: false
|
|
19564
|
+
};
|
|
19565
|
+
this.onPointerMove(event);
|
|
19310
19566
|
}
|
|
19311
19567
|
onPointerMove(event) {
|
|
19568
|
+
if (this.drag && event.buttons === 0) this.endDrag();
|
|
19569
|
+
const drag = this.drag;
|
|
19570
|
+
if (drag && drag.pointerId === event.pointerId) {
|
|
19571
|
+
const dx = event.clientX - drag.x;
|
|
19572
|
+
if (drag.moved || Math.abs(dx) >= DRAG_THRESHOLD) {
|
|
19573
|
+
if (!drag.moved) {
|
|
19574
|
+
drag.moved = true;
|
|
19575
|
+
this.panning.set(true);
|
|
19576
|
+
this.setActive(null);
|
|
19577
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
19578
|
+
}
|
|
19579
|
+
this.panTo(drag.end - dx * this.unitsPerPx());
|
|
19580
|
+
return;
|
|
19581
|
+
}
|
|
19582
|
+
}
|
|
19312
19583
|
const rect = event.currentTarget.getBoundingClientRect();
|
|
19313
|
-
const
|
|
19314
|
-
const count = this.count();
|
|
19315
|
-
const px = event.clientX - rect.left;
|
|
19584
|
+
const index = this.indexAt(event.clientX - rect.left);
|
|
19316
19585
|
const py = event.clientY - rect.top;
|
|
19317
|
-
const
|
|
19586
|
+
const layout = this.layout();
|
|
19318
19587
|
let series = -1;
|
|
19319
19588
|
let nearest = Infinity;
|
|
19320
|
-
this.series().forEach((
|
|
19321
|
-
const value =
|
|
19322
|
-
if (value == null
|
|
19589
|
+
this.series().forEach((_, i) => {
|
|
19590
|
+
const value = this.valueAt(i, index);
|
|
19591
|
+
if (value == null) return;
|
|
19323
19592
|
const distance = Math.abs(layout.y(value) - py);
|
|
19324
19593
|
if (distance < nearest) {
|
|
19325
19594
|
nearest = distance;
|
|
@@ -19331,10 +19600,39 @@ var LineChartComponent = class LineChartComponent {
|
|
|
19331
19600
|
index
|
|
19332
19601
|
});
|
|
19333
19602
|
}
|
|
19603
|
+
onPointerUp(event) {
|
|
19604
|
+
if (this.drag?.pointerId === event.pointerId) {
|
|
19605
|
+
this.suppressClick = this.drag.moved;
|
|
19606
|
+
this.endDrag();
|
|
19607
|
+
}
|
|
19608
|
+
}
|
|
19334
19609
|
onPointerLeave() {
|
|
19610
|
+
if (!this.drag?.moved) this.setActive(null);
|
|
19611
|
+
}
|
|
19612
|
+
onWheel(event) {
|
|
19613
|
+
if (event.ctrlKey && event.deltaY && this.visibleXSpan() != null) {
|
|
19614
|
+
event.preventDefault();
|
|
19615
|
+
const { start, end } = this.domain();
|
|
19616
|
+
this.zoomTo((end - start) * Math.exp(event.deltaY * ZOOM_RATE), {
|
|
19617
|
+
clientX: event.clientX,
|
|
19618
|
+
currentTarget: event.currentTarget
|
|
19619
|
+
});
|
|
19620
|
+
return;
|
|
19621
|
+
}
|
|
19622
|
+
const domain = this.domain();
|
|
19623
|
+
if (domain.span == null) return;
|
|
19624
|
+
const delta = Math.abs(event.deltaX) > Math.abs(event.deltaY) ? event.deltaX : event.shiftKey ? event.deltaY : 0;
|
|
19625
|
+
if (!delta) return;
|
|
19626
|
+
event.preventDefault();
|
|
19627
|
+
const unit = event.deltaMode === WheelEvent.DOM_DELTA_LINE ? WHEEL_LINE_PX : event.deltaMode === WheelEvent.DOM_DELTA_PAGE ? this.layout().plotWidth : 1;
|
|
19335
19628
|
this.setActive(null);
|
|
19629
|
+
this.panTo(domain.end + delta * unit * this.unitsPerPx());
|
|
19336
19630
|
}
|
|
19337
19631
|
onClick() {
|
|
19632
|
+
if (this.suppressClick) {
|
|
19633
|
+
this.suppressClick = false;
|
|
19634
|
+
return;
|
|
19635
|
+
}
|
|
19338
19636
|
const event = this.eventFor(this.active());
|
|
19339
19637
|
if (event) this.pointClick.emit(event);
|
|
19340
19638
|
}
|
|
@@ -19393,14 +19691,212 @@ var LineChartComponent = class LineChartComponent {
|
|
|
19393
19691
|
default: return;
|
|
19394
19692
|
}
|
|
19395
19693
|
event.preventDefault();
|
|
19396
|
-
|
|
19694
|
+
const target = next ?? (event.key === "Escape" ? null : active);
|
|
19695
|
+
if (target) this.reveal(target.index);
|
|
19696
|
+
this.setActive(target);
|
|
19697
|
+
}
|
|
19698
|
+
isValue(value) {
|
|
19699
|
+
return value != null && isFinite(value);
|
|
19700
|
+
}
|
|
19701
|
+
yScale(values, plotHeight, axisPx, maxTicks) {
|
|
19702
|
+
const yMin = this.yMin();
|
|
19703
|
+
const yMax = this.yMax();
|
|
19704
|
+
const dataMin = Math.min(...values);
|
|
19705
|
+
const dataMax = Math.max(...values);
|
|
19706
|
+
let lo = yMin ?? dataMin;
|
|
19707
|
+
let hi = yMax ?? dataMax;
|
|
19708
|
+
const zeroFloor = this.showArea() && yMin === void 0 && !(dataMin < 0);
|
|
19709
|
+
if (zeroFloor) lo = Math.min(lo, 0);
|
|
19710
|
+
if (lo > hi) [lo, hi] = [hi, lo];
|
|
19711
|
+
const clearance = axisPx;
|
|
19712
|
+
const breakClearance = axisPx * 6;
|
|
19713
|
+
const derivedFloor = yMin === void 0 && !zeroFloor && dataMin > 0;
|
|
19714
|
+
if (this.windowed() && isFinite(lo) && isFinite(hi)) {
|
|
19715
|
+
const spread = hi - lo || Math.abs(hi) || 1;
|
|
19716
|
+
const pad = clearance * spread / Math.max(1, plotHeight - 2 * clearance);
|
|
19717
|
+
const breakPad = breakClearance * spread / Math.max(1, plotHeight - clearance - breakClearance);
|
|
19718
|
+
const min = yMin ?? (zeroFloor ? lo : derivedFloor ? Math.max(0, lo - breakPad) : lo - pad);
|
|
19719
|
+
const max = yMax ?? hi + pad;
|
|
19720
|
+
return {
|
|
19721
|
+
min,
|
|
19722
|
+
max,
|
|
19723
|
+
ticks: niceScale(min, max, maxTicks).ticks.filter((t) => t >= min && t <= max)
|
|
19724
|
+
};
|
|
19725
|
+
}
|
|
19726
|
+
const scale = niceScale(lo, hi, maxTicks);
|
|
19727
|
+
const step = scale.ticks[1] - scale.ticks[0];
|
|
19728
|
+
const ticks = [...scale.ticks];
|
|
19729
|
+
let min = yMin ?? scale.min;
|
|
19730
|
+
let max = yMax ?? scale.max;
|
|
19731
|
+
if (min > max) [min, max] = [max, min];
|
|
19732
|
+
const px = (value) => value / (max - min || 1) * plotHeight;
|
|
19733
|
+
const lowTight = () => yMin === void 0 && !zeroFloor && px(dataMin - min) < (derivedFloor && min > 0 ? breakClearance : clearance);
|
|
19734
|
+
const highTight = yMax === void 0 && px(max - dataMax) < clearance;
|
|
19735
|
+
for (let steps = 0; steps < 6 && lowTight() && !(derivedFloor && min <= 0); steps++) {
|
|
19736
|
+
min = Number((min - step).toPrecision(12));
|
|
19737
|
+
ticks.unshift(min);
|
|
19738
|
+
}
|
|
19739
|
+
if (highTight) {
|
|
19740
|
+
max = Number((max + step).toPrecision(12));
|
|
19741
|
+
ticks.push(max);
|
|
19742
|
+
}
|
|
19743
|
+
return {
|
|
19744
|
+
min,
|
|
19745
|
+
max,
|
|
19746
|
+
ticks: ticks.filter((t) => t >= min && t <= max)
|
|
19747
|
+
};
|
|
19748
|
+
}
|
|
19749
|
+
atPosition(domain, left, plotWidth) {
|
|
19750
|
+
const inset = domain.span != null ? EDGE_INSET : 0;
|
|
19751
|
+
const inner = Math.max(1, plotWidth - 2 * inset);
|
|
19752
|
+
const extent = domain.end - domain.start;
|
|
19753
|
+
const scale = inner / extent;
|
|
19754
|
+
return (position) => extent > 0 ? left + inset + (position - domain.start) * scale : left + plotWidth / 2;
|
|
19755
|
+
}
|
|
19756
|
+
xLabelCandidates(domain, at, x) {
|
|
19757
|
+
const inView = (position) => position >= domain.start && position <= domain.end;
|
|
19758
|
+
const ticks = this.xTicks();
|
|
19759
|
+
if (ticks) return ticks.filter((t) => inView(t.value)).map((t) => ({
|
|
19760
|
+
key: t.value,
|
|
19761
|
+
text: t.label,
|
|
19762
|
+
x: at(t.value)
|
|
19763
|
+
}));
|
|
19764
|
+
const positions = this.positions();
|
|
19765
|
+
return positions.map((position, index) => ({
|
|
19766
|
+
key: index,
|
|
19767
|
+
text: this.labels()[index] ?? "",
|
|
19768
|
+
x: x(index)
|
|
19769
|
+
})).filter((l) => inView(positions[l.key]));
|
|
19770
|
+
}
|
|
19771
|
+
labelsFit(labels, angle, axisPx) {
|
|
19772
|
+
return labels.every((label, i) => i === 0 || label.x - labels[i - 1].x >= (labelRoom(label.text, angle, axisPx) + labelRoom(labels[i - 1].text, angle, axisPx)) / 2);
|
|
19773
|
+
}
|
|
19774
|
+
xLabels(domain, at, x, plotWidth, axisPx, angle) {
|
|
19775
|
+
const candidates = this.xLabelCandidates(domain, at, x);
|
|
19776
|
+
if (this.xTicks()) return candidates;
|
|
19777
|
+
const texts = this.positions().map((_, i) => this.labels()[i] ?? "");
|
|
19778
|
+
if (!this.xValues()) {
|
|
19779
|
+
const count = texts.length;
|
|
19780
|
+
const extent = domain.end - domain.start;
|
|
19781
|
+
const spacing = count > 1 ? (plotWidth - (domain.span != null ? 2 * EDGE_INSET : 0)) / extent : plotWidth;
|
|
19782
|
+
const room = Math.max(0, ...texts.map((t) => labelRoom(t, angle, axisPx)));
|
|
19783
|
+
const step = Math.max(1, Math.ceil(room / spacing));
|
|
19784
|
+
return candidates.filter((l) => l.key % step === 0);
|
|
19785
|
+
}
|
|
19786
|
+
const labels = [];
|
|
19787
|
+
let edge = -Infinity;
|
|
19788
|
+
for (const label of candidates) {
|
|
19789
|
+
const half = labelRoom(label.text, angle, axisPx) / 2;
|
|
19790
|
+
if (label.x - half >= edge) {
|
|
19791
|
+
labels.push(label);
|
|
19792
|
+
edge = label.x + half;
|
|
19793
|
+
}
|
|
19794
|
+
}
|
|
19795
|
+
return labels;
|
|
19796
|
+
}
|
|
19797
|
+
widestXLabel(axisPx) {
|
|
19798
|
+
const texts = this.xTicks()?.map((t) => t.label) ?? this.labels();
|
|
19799
|
+
return Math.max(0, ...texts.map((t) => estimateTextWidth(t, axisPx)));
|
|
19800
|
+
}
|
|
19801
|
+
onGestureStart(event) {
|
|
19802
|
+
if (this.visibleXSpan() == null) return;
|
|
19803
|
+
event.preventDefault();
|
|
19804
|
+
const { start, end } = this.domain();
|
|
19805
|
+
this.gestureSpan = end - start;
|
|
19806
|
+
}
|
|
19807
|
+
onGestureChange(event) {
|
|
19808
|
+
if (this.gestureSpan == null || !("scale" in event) || !("clientX" in event)) return;
|
|
19809
|
+
const { scale, clientX } = event;
|
|
19810
|
+
if (typeof scale !== "number" || typeof clientX !== "number" || !(scale > 0)) return;
|
|
19811
|
+
event.preventDefault();
|
|
19812
|
+
this.zoomTo(this.gestureSpan / scale, {
|
|
19813
|
+
clientX,
|
|
19814
|
+
currentTarget: event.currentTarget
|
|
19815
|
+
});
|
|
19816
|
+
}
|
|
19817
|
+
onGestureEnd() {
|
|
19818
|
+
this.gestureSpan = null;
|
|
19819
|
+
}
|
|
19820
|
+
zoomTo(span, { clientX, currentTarget }) {
|
|
19821
|
+
const domain = this.domain();
|
|
19822
|
+
const full = domain.last - domain.first;
|
|
19823
|
+
if (!(full > 0) || !(currentTarget instanceof Element)) return;
|
|
19824
|
+
const next = clamp$1(span, Math.min(this.minSpan(), full), full);
|
|
19825
|
+
const shown = domain.end - domain.start;
|
|
19826
|
+
const inset = domain.span != null ? EDGE_INSET : 0;
|
|
19827
|
+
const { left, plotWidth } = this.layout();
|
|
19828
|
+
const ratio = clamp$1((clientX - currentTarget.getBoundingClientRect().left - left - inset) / Math.max(1, plotWidth - 2 * inset), 0, 1);
|
|
19829
|
+
const end = clamp$1(domain.start + ratio * shown + (1 - ratio) * next, domain.first + next, domain.last);
|
|
19830
|
+
this.setActive(null);
|
|
19831
|
+
this.zoomSpan.set(next);
|
|
19832
|
+
this.panEnd.set(end);
|
|
19833
|
+
this.visibleRangeChange.emit({
|
|
19834
|
+
start: end - next,
|
|
19835
|
+
end
|
|
19836
|
+
});
|
|
19837
|
+
}
|
|
19838
|
+
minSpan() {
|
|
19839
|
+
const known = this.positions().filter((p) => isFinite(p)).sort((a, b) => a - b);
|
|
19840
|
+
const gaps = known.slice(1).map((p, i) => p - known[i]).filter((gap) => gap > 0);
|
|
19841
|
+
return gaps.length ? Math.min(...gaps) * 2 : 1;
|
|
19842
|
+
}
|
|
19843
|
+
unitsPerPx() {
|
|
19844
|
+
return (this.domain().span ?? 0) / Math.max(1, this.layout().plotWidth - 2 * EDGE_INSET);
|
|
19845
|
+
}
|
|
19846
|
+
panTo(end) {
|
|
19847
|
+
const domain = this.domain();
|
|
19848
|
+
if (domain.span == null) return;
|
|
19849
|
+
const next = clamp$1(end, domain.first + domain.span, domain.last);
|
|
19850
|
+
if (next === domain.end) return;
|
|
19851
|
+
this.panEnd.set(next);
|
|
19852
|
+
this.visibleRangeChange.emit({
|
|
19853
|
+
start: next - domain.span,
|
|
19854
|
+
end: next
|
|
19855
|
+
});
|
|
19856
|
+
}
|
|
19857
|
+
endDrag() {
|
|
19858
|
+
this.drag = null;
|
|
19859
|
+
this.panning.set(false);
|
|
19860
|
+
}
|
|
19861
|
+
reveal(index) {
|
|
19862
|
+
const domain = this.domain();
|
|
19863
|
+
const position = this.positions()[index];
|
|
19864
|
+
if (domain.span == null) return;
|
|
19865
|
+
if (position < domain.start) this.panTo(position + domain.span);
|
|
19866
|
+
else if (position > domain.end) this.panTo(position);
|
|
19867
|
+
}
|
|
19868
|
+
indexAt(px) {
|
|
19869
|
+
const layout = this.layout();
|
|
19870
|
+
const count = this.count();
|
|
19871
|
+
const domain = this.domain();
|
|
19872
|
+
if (!this.xValues()) {
|
|
19873
|
+
if (count < 2) return 0;
|
|
19874
|
+
const inset = domain.span != null ? EDGE_INSET : 0;
|
|
19875
|
+
const inner = Math.max(1, layout.plotWidth - 2 * inset);
|
|
19876
|
+
return clamp$1(Math.round(domain.start + (px - layout.left - inset) / inner * (domain.end - domain.start)), Math.ceil(domain.start), Math.floor(domain.end));
|
|
19877
|
+
}
|
|
19878
|
+
const positions = this.positions();
|
|
19879
|
+
let best = -1;
|
|
19880
|
+
let nearest = Infinity;
|
|
19881
|
+
for (let index = 0; index < count; index++) {
|
|
19882
|
+
const position = positions[index];
|
|
19883
|
+
if (position < domain.start || position > domain.end || !this.series().some((_, s) => this.valueAt(s, index) != null)) continue;
|
|
19884
|
+
const distance = Math.abs(layout.x(index) - px);
|
|
19885
|
+
if (distance < nearest) {
|
|
19886
|
+
nearest = distance;
|
|
19887
|
+
best = index;
|
|
19888
|
+
}
|
|
19889
|
+
}
|
|
19890
|
+
return best;
|
|
19397
19891
|
}
|
|
19398
19892
|
valueAt(series, index) {
|
|
19399
19893
|
const value = this.series()[series]?.data[index];
|
|
19400
|
-
return value
|
|
19894
|
+
return this.isValue(value) && isFinite(this.positions()[index]) ? value : null;
|
|
19401
19895
|
}
|
|
19402
19896
|
firstPoint() {
|
|
19897
|
+
const domain = this.domain();
|
|
19403
19898
|
for (let index = 0; index < this.count(); index++) {
|
|
19899
|
+
if (this.positions()[index] < domain.start) continue;
|
|
19404
19900
|
const series = this.series().findIndex((_, s) => this.valueAt(s, index) != null);
|
|
19405
19901
|
if (series !== -1) return {
|
|
19406
19902
|
series,
|
|
@@ -19463,6 +19959,27 @@ var LineChartComponent = class LineChartComponent {
|
|
|
19463
19959
|
isRequired: false,
|
|
19464
19960
|
transformFunction: null
|
|
19465
19961
|
},
|
|
19962
|
+
xValues: {
|
|
19963
|
+
classPropertyName: "xValues",
|
|
19964
|
+
publicName: "xValues",
|
|
19965
|
+
isSignal: true,
|
|
19966
|
+
isRequired: false,
|
|
19967
|
+
transformFunction: null
|
|
19968
|
+
},
|
|
19969
|
+
xTicks: {
|
|
19970
|
+
classPropertyName: "xTicks",
|
|
19971
|
+
publicName: "xTicks",
|
|
19972
|
+
isSignal: true,
|
|
19973
|
+
isRequired: false,
|
|
19974
|
+
transformFunction: null
|
|
19975
|
+
},
|
|
19976
|
+
visibleXSpan: {
|
|
19977
|
+
classPropertyName: "visibleXSpan",
|
|
19978
|
+
publicName: "visibleXSpan",
|
|
19979
|
+
isSignal: true,
|
|
19980
|
+
isRequired: false,
|
|
19981
|
+
transformFunction: null
|
|
19982
|
+
},
|
|
19466
19983
|
curve: {
|
|
19467
19984
|
classPropertyName: "curve",
|
|
19468
19985
|
publicName: "curve",
|
|
@@ -19512,6 +20029,20 @@ var LineChartComponent = class LineChartComponent {
|
|
|
19512
20029
|
isRequired: false,
|
|
19513
20030
|
transformFunction: null
|
|
19514
20031
|
},
|
|
20032
|
+
xLabelOrientation: {
|
|
20033
|
+
classPropertyName: "xLabelOrientation",
|
|
20034
|
+
publicName: "xLabelOrientation",
|
|
20035
|
+
isSignal: true,
|
|
20036
|
+
isRequired: false,
|
|
20037
|
+
transformFunction: null
|
|
20038
|
+
},
|
|
20039
|
+
showAxisBreak: {
|
|
20040
|
+
classPropertyName: "showAxisBreak",
|
|
20041
|
+
publicName: "showAxisBreak",
|
|
20042
|
+
isSignal: true,
|
|
20043
|
+
isRequired: false,
|
|
20044
|
+
transformFunction: null
|
|
20045
|
+
},
|
|
19515
20046
|
height: {
|
|
19516
20047
|
classPropertyName: "height",
|
|
19517
20048
|
publicName: "height",
|
|
@@ -19557,11 +20088,12 @@ var LineChartComponent = class LineChartComponent {
|
|
|
19557
20088
|
},
|
|
19558
20089
|
outputs: {
|
|
19559
20090
|
pointClick: "pointClick",
|
|
19560
|
-
activePointChange: "activePointChange"
|
|
20091
|
+
activePointChange: "activePointChange",
|
|
20092
|
+
visibleRangeChange: "visibleRangeChange"
|
|
19561
20093
|
},
|
|
19562
20094
|
ngImport: i0,
|
|
19563
|
-
template: "<div\n class=\"ea-line-chart\"\n [ngClass]=\"hostClasses()\"\n [style.--ea-chart-duration]=\"animationDuration() + 'ms'\">\n @if (hasData()) {\n <div\n class=\"ea-line-chart__plot\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-roledescription]=\"i18n.messages().chart.roleDescription\"\n [attr.aria-label]=\"label()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\">\n @for (pass of renderPass(); track pass) {\n <svg\n class=\"ea-line-chart__svg\"\n aria-hidden=\"true\"\n [attr.width]=\"layout().width\"\n [attr.height]=\"layout().height\"\n [attr.viewBox]=\"'0 0 ' + layout().width + ' ' + layout().height\"\n [style.--ea-line-chart-baseline]=\"layout().baselineY + 'px'\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerdown)=\"
|
|
19564
|
-
styles: ["@keyframes ea-chart-fade{0%{opacity:0}}@keyframes ea-chart-draw{0%{stroke-dashoffset:1}}@keyframes ea-chart-grow-y{0%{transform:scaleY(0)}}@keyframes ea-chart-grow-x{0%{transform:scaleX(0)}}@keyframes ea-chart-grow{0%{transform:scale(0)}}ea-line-chart{display:block}.ea-line-chart{position:relative;display:flex;flex-direction:column;gap:.75em;font-family:var(--font-family-sans);color:var(--color-text-primary)}.ea-line-chart--2xs{font-size:var(--font-size-2xs)}.ea-line-chart--xs{font-size:var(--font-size-xs)}.ea-line-chart--sm{font-size:var(--font-size-sm)}.ea-line-chart--md{font-size:var(--font-size-md)}.ea-line-chart--lg{font-size:var(--font-size-lg)}.ea-line-chart--xl{font-size:var(--font-size-xl)}.ea-line-chart__plot{position:relative;border-radius:var(--radius-md);outline:none}.ea-line-chart__plot:focus-visible{box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-line-chart__plot:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-line-chart__plot svg{display:block;overflow:visible}.ea-line-chart__svg{direction:ltr;touch-action:pan-y}.ea-line-chart__hit{fill:transparent}.ea-line-chart__grid{stroke:var(--color-divider);stroke-width:1px;shape-rendering:crispEdges}.ea-line-chart__baseline{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges}.ea-line-chart__axis{font-size:.75em;fill:var(--color-text-secondary)}.ea-line-chart__crosshair{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges;pointer-events:none}.ea-line-chart__series{pointer-events:none;transition:opacity var(--duration-fast) var(--ease-out)}.ea-line-chart__series--dimmed{opacity:.35}.ea-line-chart__area{fill:var(--ea-chart-color);fill-opacity:.12}.ea-line-chart__line{fill:none;stroke:var(--ea-chart-color);stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.ea-line-chart__point{fill:var(--ea-chart-color);stroke:var(--ea-chart-surface, var(--color-bg-base));stroke-width:2px}.ea-line-chart__tooltip{display:flex;flex-direction:column;gap:var(--space-1)}.ea-line-chart__anchor{fill:transparent}.ea-line-chart__tooltip-title{font-weight:var(--font-weight-medium)}.ea-line-chart__tooltip-row{display:flex;align-items:center;gap:.5em}.ea-line-chart__tooltip-row--active{font-weight:var(--font-weight-medium)}.ea-line-chart__tooltip-value{
|
|
20095
|
+
template: "<div\n class=\"ea-line-chart\"\n [ngClass]=\"hostClasses()\"\n [style.--ea-chart-duration]=\"animationDuration() + 'ms'\">\n @if (hasData()) {\n <div\n class=\"ea-line-chart__plot\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-roledescription]=\"i18n.messages().chart.roleDescription\"\n [attr.aria-label]=\"label()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\">\n @for (pass of renderPass(); track pass) {\n <svg\n class=\"ea-line-chart__svg\"\n aria-hidden=\"true\"\n [attr.width]=\"layout().width\"\n [attr.height]=\"layout().height\"\n [attr.viewBox]=\"'0 0 ' + layout().width + ' ' + layout().height\"\n [style.--ea-line-chart-baseline]=\"layout().baselineY + 'px'\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (pointerleave)=\"onPointerLeave()\"\n (wheel)=\"onWheel($event)\"\n (gesturestart)=\"onGestureStart($event)\"\n (gesturechange)=\"onGestureChange($event)\"\n (gestureend)=\"onGestureEnd()\"\n (click)=\"onClick()\">\n @if (layout().windowed) {\n <defs>\n <clipPath [attr.id]=\"clipId\">\n <rect\n [attr.x]=\"layout().left\"\n y=\"0\"\n [attr.width]=\"layout().plotWidth\"\n [attr.height]=\"layout().height\" />\n </clipPath>\n </defs>\n }\n <rect\n class=\"ea-line-chart__hit\"\n [attr.x]=\"layout().left\"\n [attr.y]=\"layout().top\"\n [attr.width]=\"layout().plotWidth\"\n [attr.height]=\"layout().plotHeight\" />\n @for (tick of layout().ticks; track tick.value) {\n @if (showGrid()) {\n <line\n class=\"ea-line-chart__grid\"\n [attr.x1]=\"layout().left\"\n [attr.x2]=\"layout().left + layout().plotWidth\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n <text\n class=\"ea-line-chart__axis ea-line-chart__axis--y\"\n text-anchor=\"end\"\n dominant-baseline=\"middle\"\n [attr.x]=\"layout().tickX\"\n [attr.y]=\"tick.y\">\n {{ tick.text }}\n </text>\n }\n <line\n class=\"ea-line-chart__baseline\"\n [attr.x1]=\"layout().left\"\n [attr.x2]=\"layout().left + layout().plotWidth\"\n [attr.y1]=\"layout().top + layout().plotHeight\"\n [attr.y2]=\"layout().top + layout().plotHeight\" />\n @if (layout().axisBreak; as axisBreak) {\n <path\n class=\"ea-line-chart__y-axis\"\n [attr.d]=\"axisBreak.axis\" />\n <path\n class=\"ea-line-chart__axis-break\"\n [attr.d]=\"axisBreak.slashes\" />\n }\n @for (xLabel of layout().xLabels; track xLabel.key) {\n <line\n class=\"ea-line-chart__x-tick\"\n [attr.x1]=\"xLabel.x\"\n [attr.x2]=\"xLabel.x\"\n [attr.y1]=\"layout().axisY\"\n [attr.y2]=\"layout().tickEndY\" />\n <text\n class=\"ea-line-chart__axis ea-line-chart__axis--x\"\n [attr.text-anchor]=\"layout().labelAngle ? 'end' : 'middle'\"\n [attr.dominant-baseline]=\"layout().labelAngle ? 'central' : null\"\n [attr.transform]=\"\n layout().labelAngle\n ? 'rotate(' +\n -layout().labelAngle +\n ' ' +\n xLabel.x +\n ' ' +\n layout().labelY +\n ')'\n : null\n \"\n [attr.x]=\"xLabel.textX\"\n [attr.y]=\"layout().labelY\">\n {{ xLabel.text }}\n </text>\n }\n @if (layout().axisBreak; as axisBreak) {\n <!-- Keeps the break's gap open under a crosshair drawn along the y-axis -->\n <mask\n maskUnits=\"userSpaceOnUse\"\n [attr.id]=\"breakMaskId\">\n <rect\n fill=\"white\"\n x=\"0\"\n y=\"0\"\n [attr.width]=\"layout().width\"\n [attr.height]=\"layout().height\" />\n <rect\n fill=\"black\"\n [attr.x]=\"axisBreak.gap.x\"\n [attr.y]=\"axisBreak.gap.y\"\n [attr.width]=\"axisBreak.gap.width\"\n [attr.height]=\"axisBreak.gap.height\" />\n </mask>\n }\n @if (tooltip(); as tip) {\n <line\n class=\"ea-line-chart__crosshair\"\n [attr.mask]=\"layout().axisBreak ? 'url(#' + breakMaskId + ')' : null\"\n [attr.x1]=\"tip.x\"\n [attr.x2]=\"tip.x\"\n [attr.y1]=\"layout().top\"\n [attr.y2]=\"layout().top + layout().plotHeight\" />\n }\n <g [attr.clip-path]=\"layout().windowed ? 'url(#' + clipId + ')' : null\">\n <g class=\"ea-line-chart__lines\">\n @for (line of layout().series; track $index; let s = $index) {\n <g\n class=\"ea-line-chart__series\"\n [class.ea-line-chart__series--dimmed]=\"isDimmed(s)\"\n [style.--ea-chart-color]=\"line.color\">\n @if (showArea()) {\n @for (area of line.areas; track $index) {\n <path\n class=\"ea-line-chart__area\"\n [attr.d]=\"area\" />\n }\n }\n @for (path of line.paths; track $index) {\n <path\n class=\"ea-line-chart__line\"\n pathLength=\"1\"\n [attr.d]=\"path\" />\n }\n @for (point of line.points; track point.index) {\n @if (showPoints() || isActivePoint(s, point.index)) {\n <circle\n class=\"ea-line-chart__point\"\n [class.ea-line-chart__point--active]=\"\n isActivePoint(s, point.index)\n \"\n [attr.cx]=\"point.x\"\n [attr.cy]=\"point.y\"\n [attr.r]=\"isActivePoint(s, point.index) ? 6 : 4\" />\n }\n }\n </g>\n }\n </g>\n </g>\n @for (tip of tooltips(); track tip.key) {\n <rect\n class=\"ea-line-chart__anchor\"\n width=\"12\"\n height=\"12\"\n [attr.x]=\"tip.x - 6\"\n [attr.y]=\"tip.y - 6\"\n [eaTooltip]=\"tooltipContent\"\n [tooltipOpen]=\"true\"\n [maxWidth]=\"undefined\" />\n }\n </svg>\n }\n <ng-template #tooltipContent>\n @if (tooltip(); as tip) {\n <div class=\"ea-line-chart__tooltip\">\n <span class=\"ea-line-chart__tooltip-title\">{{ tip.title }}</span>\n @for (row of tip.rows; track $index) {\n <span\n class=\"ea-line-chart__tooltip-row\"\n [class.ea-line-chart__tooltip-row--active]=\"row.active\">\n <span\n class=\"ea-line-chart__swatch\"\n [style.--ea-chart-color]=\"row.color\">\n </span>\n <span class=\"ea-line-chart__tooltip-name\">{{ row.name }}</span>\n <span class=\"ea-line-chart__tooltip-value\">{{ row.value }}</span>\n </span>\n }\n </div>\n }\n </ng-template>\n <!-- Hidden through a block, since a table ignores the 1px size and keeps its full height -->\n <div class=\"ea-line-chart__table\">\n <table>\n <caption>\n {{ label() }}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">{{ i18n.messages().chart.category }}</th>\n\n @for (s of series(); track $index) {\n <th scope=\"col\">{{ s.name }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of labels(); track $index; let i = $index) {\n <tr>\n <th scope=\"row\">{{ row }}</th>\n\n @for (s of series(); track $index) {\n <td>{{ tableValue(s.data[i]) }}</td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n </div>\n <div\n class=\"ea-line-chart__live\"\n aria-live=\"polite\">\n {{ announcement() }}\n </div>\n } @else {\n <div\n class=\"ea-line-chart__empty\"\n role=\"img\"\n [attr.aria-label]=\"label()\"\n [style.height.px]=\"height()\">\n {{ i18n.messages().chart.noData }}\n </div>\n }\n @if (showsLegend()) {\n <ul\n class=\"ea-line-chart__legend\"\n aria-hidden=\"true\">\n @for (s of series(); track $index; let i = $index) {\n <li class=\"ea-line-chart__legend-item\">\n <span\n class=\"ea-line-chart__legend-line\"\n [style.--ea-chart-color]=\"seriesColor(i)\">\n </span>\n {{ s.name }}\n </li>\n }\n </ul>\n }\n</div>\n",
|
|
20096
|
+
styles: ["@keyframes ea-chart-fade{0%{opacity:0}}@keyframes ea-chart-draw{0%{stroke-dashoffset:1}}@keyframes ea-chart-grow-y{0%{transform:scaleY(0)}}@keyframes ea-chart-grow-x{0%{transform:scaleX(0)}}@keyframes ea-chart-grow{0%{transform:scale(0)}}ea-line-chart{display:block}.ea-line-chart{position:relative;display:flex;flex-direction:column;gap:.75em;font-family:var(--font-family-sans);color:var(--color-text-primary)}.ea-line-chart--2xs{font-size:var(--font-size-2xs)}.ea-line-chart--xs{font-size:var(--font-size-xs)}.ea-line-chart--sm{font-size:var(--font-size-sm)}.ea-line-chart--md{font-size:var(--font-size-md)}.ea-line-chart--lg{font-size:var(--font-size-lg)}.ea-line-chart--xl{font-size:var(--font-size-xl)}.ea-line-chart__plot{position:relative;border-radius:var(--radius-md);outline:none}.ea-line-chart__plot:focus-visible{box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-line-chart__plot:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-line-chart__plot svg{display:block;overflow:visible}.ea-line-chart__svg{direction:ltr;touch-action:pan-y}.ea-line-chart__hit{fill:transparent}.ea-line-chart__grid{stroke:var(--color-divider);stroke-width:1px;shape-rendering:crispEdges}.ea-line-chart__baseline{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges}.ea-line-chart__axis{font-size:.75em;fill:var(--color-text-secondary)}.ea-line-chart__x-tick{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges}.ea-line-chart__y-axis{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges;fill:none}.ea-line-chart__axis-break{fill:none;stroke:var(--color-border-strong);stroke-width:1.5px;stroke-linecap:round}.ea-line-chart__crosshair{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges;pointer-events:none}.ea-line-chart__series{pointer-events:none;transition:opacity var(--duration-fast) var(--ease-out)}.ea-line-chart__series--dimmed{opacity:.35}.ea-line-chart__area{fill:var(--ea-chart-color);fill-opacity:.12}.ea-line-chart__line{fill:none;stroke:var(--ea-chart-color);stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.ea-line-chart__point{fill:var(--ea-chart-color);stroke:var(--ea-chart-surface, var(--color-bg-base));stroke-width:2px}.ea-line-chart__tooltip{display:flex;flex-direction:column;gap:var(--space-1)}.ea-line-chart__anchor{fill:transparent}.ea-line-chart__tooltip-title{font-weight:var(--font-weight-medium)}.ea-line-chart__tooltip-row{display:flex;align-items:center;gap:.5em}.ea-line-chart__tooltip-row--active{font-weight:var(--font-weight-medium)}.ea-line-chart__tooltip-value{font-weight:var(--font-weight-semibold);font-variant-numeric:tabular-nums}.ea-line-chart__swatch{flex-shrink:0;width:.75em;height:.75em;border-radius:var(--radius-sm);background-color:var(--ea-chart-color)}.ea-line-chart__legend{display:flex;flex-wrap:wrap;justify-content:center;gap:.375em 1em;padding:0;margin:0;font-size:.875em;list-style:none;color:var(--color-text-secondary)}.ea-line-chart__legend-item{display:flex;align-items:center;gap:.375em}.ea-line-chart__legend-line{width:1em;height:2px;border-radius:var(--radius-full);background-color:var(--ea-chart-color)}.ea-line-chart__table,.ea-line-chart__live{position:absolute;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);width:1px;height:1px;padding:0;margin:-1px;white-space:nowrap;border:0}.ea-line-chart__empty{display:flex;align-items:center;justify-content:center;font-size:.875em;color:var(--color-text-tertiary)}.ea-line-chart--pannable .ea-line-chart__svg{cursor:grab}.ea-line-chart--panning .ea-line-chart__svg{cursor:grabbing;-webkit-user-select:none;user-select:none}.ea-line-chart--animate-draw .ea-line-chart__line{stroke-dasharray:1;animation-name:ea-chart-draw;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-line-chart--animate-draw .ea-line-chart__line{animation:none}}.ea-line-chart--animate-draw .ea-line-chart__area,.ea-line-chart--animate-draw .ea-line-chart__point{animation-name:ea-chart-fade;animation-delay:var(--ea-chart-duration, .6s);animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-line-chart--animate-draw .ea-line-chart__area,.ea-line-chart--animate-draw .ea-line-chart__point{animation:none}}.ea-line-chart--animate-reveal .ea-line-chart__lines{clip-path:inset(-8px);animation-name:ea-line-chart-reveal;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-line-chart--animate-reveal .ea-line-chart__lines{animation:none}}.ea-line-chart--animate-fade .ea-line-chart__series{animation-name:ea-chart-fade;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-line-chart--animate-fade .ea-line-chart__series{animation:none}}.ea-line-chart--animate-rise .ea-line-chart__series{animation-name:ea-chart-grow-y;transform-origin:0 var(--ea-line-chart-baseline);animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-line-chart--animate-rise .ea-line-chart__series{animation:none}}@keyframes ea-line-chart-reveal{0%{clip-path:inset(-8px 100% -8px -8px)}}\n"],
|
|
19565
20097
|
dependencies: [{
|
|
19566
20098
|
kind: "directive",
|
|
19567
20099
|
type: NgClass,
|
|
@@ -19597,8 +20129,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
19597
20129
|
imports: [NgClass, TooltipDirective],
|
|
19598
20130
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
19599
20131
|
encapsulation: ViewEncapsulation.None,
|
|
19600
|
-
template: "<div\n class=\"ea-line-chart\"\n [ngClass]=\"hostClasses()\"\n [style.--ea-chart-duration]=\"animationDuration() + 'ms'\">\n @if (hasData()) {\n <div\n class=\"ea-line-chart__plot\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-roledescription]=\"i18n.messages().chart.roleDescription\"\n [attr.aria-label]=\"label()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\">\n @for (pass of renderPass(); track pass) {\n <svg\n class=\"ea-line-chart__svg\"\n aria-hidden=\"true\"\n [attr.width]=\"layout().width\"\n [attr.height]=\"layout().height\"\n [attr.viewBox]=\"'0 0 ' + layout().width + ' ' + layout().height\"\n [style.--ea-line-chart-baseline]=\"layout().baselineY + 'px'\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerdown)=\"
|
|
19601
|
-
styles: ["@keyframes ea-chart-fade{0%{opacity:0}}@keyframes ea-chart-draw{0%{stroke-dashoffset:1}}@keyframes ea-chart-grow-y{0%{transform:scaleY(0)}}@keyframes ea-chart-grow-x{0%{transform:scaleX(0)}}@keyframes ea-chart-grow{0%{transform:scale(0)}}ea-line-chart{display:block}.ea-line-chart{position:relative;display:flex;flex-direction:column;gap:.75em;font-family:var(--font-family-sans);color:var(--color-text-primary)}.ea-line-chart--2xs{font-size:var(--font-size-2xs)}.ea-line-chart--xs{font-size:var(--font-size-xs)}.ea-line-chart--sm{font-size:var(--font-size-sm)}.ea-line-chart--md{font-size:var(--font-size-md)}.ea-line-chart--lg{font-size:var(--font-size-lg)}.ea-line-chart--xl{font-size:var(--font-size-xl)}.ea-line-chart__plot{position:relative;border-radius:var(--radius-md);outline:none}.ea-line-chart__plot:focus-visible{box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-line-chart__plot:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-line-chart__plot svg{display:block;overflow:visible}.ea-line-chart__svg{direction:ltr;touch-action:pan-y}.ea-line-chart__hit{fill:transparent}.ea-line-chart__grid{stroke:var(--color-divider);stroke-width:1px;shape-rendering:crispEdges}.ea-line-chart__baseline{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges}.ea-line-chart__axis{font-size:.75em;fill:var(--color-text-secondary)}.ea-line-chart__crosshair{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges;pointer-events:none}.ea-line-chart__series{pointer-events:none;transition:opacity var(--duration-fast) var(--ease-out)}.ea-line-chart__series--dimmed{opacity:.35}.ea-line-chart__area{fill:var(--ea-chart-color);fill-opacity:.12}.ea-line-chart__line{fill:none;stroke:var(--ea-chart-color);stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.ea-line-chart__point{fill:var(--ea-chart-color);stroke:var(--ea-chart-surface, var(--color-bg-base));stroke-width:2px}.ea-line-chart__tooltip{display:flex;flex-direction:column;gap:var(--space-1)}.ea-line-chart__anchor{fill:transparent}.ea-line-chart__tooltip-title{font-weight:var(--font-weight-medium)}.ea-line-chart__tooltip-row{display:flex;align-items:center;gap:.5em}.ea-line-chart__tooltip-row--active{font-weight:var(--font-weight-medium)}.ea-line-chart__tooltip-value{
|
|
20132
|
+
template: "<div\n class=\"ea-line-chart\"\n [ngClass]=\"hostClasses()\"\n [style.--ea-chart-duration]=\"animationDuration() + 'ms'\">\n @if (hasData()) {\n <div\n class=\"ea-line-chart__plot\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-roledescription]=\"i18n.messages().chart.roleDescription\"\n [attr.aria-label]=\"label()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\">\n @for (pass of renderPass(); track pass) {\n <svg\n class=\"ea-line-chart__svg\"\n aria-hidden=\"true\"\n [attr.width]=\"layout().width\"\n [attr.height]=\"layout().height\"\n [attr.viewBox]=\"'0 0 ' + layout().width + ' ' + layout().height\"\n [style.--ea-line-chart-baseline]=\"layout().baselineY + 'px'\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (pointerleave)=\"onPointerLeave()\"\n (wheel)=\"onWheel($event)\"\n (gesturestart)=\"onGestureStart($event)\"\n (gesturechange)=\"onGestureChange($event)\"\n (gestureend)=\"onGestureEnd()\"\n (click)=\"onClick()\">\n @if (layout().windowed) {\n <defs>\n <clipPath [attr.id]=\"clipId\">\n <rect\n [attr.x]=\"layout().left\"\n y=\"0\"\n [attr.width]=\"layout().plotWidth\"\n [attr.height]=\"layout().height\" />\n </clipPath>\n </defs>\n }\n <rect\n class=\"ea-line-chart__hit\"\n [attr.x]=\"layout().left\"\n [attr.y]=\"layout().top\"\n [attr.width]=\"layout().plotWidth\"\n [attr.height]=\"layout().plotHeight\" />\n @for (tick of layout().ticks; track tick.value) {\n @if (showGrid()) {\n <line\n class=\"ea-line-chart__grid\"\n [attr.x1]=\"layout().left\"\n [attr.x2]=\"layout().left + layout().plotWidth\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n <text\n class=\"ea-line-chart__axis ea-line-chart__axis--y\"\n text-anchor=\"end\"\n dominant-baseline=\"middle\"\n [attr.x]=\"layout().tickX\"\n [attr.y]=\"tick.y\">\n {{ tick.text }}\n </text>\n }\n <line\n class=\"ea-line-chart__baseline\"\n [attr.x1]=\"layout().left\"\n [attr.x2]=\"layout().left + layout().plotWidth\"\n [attr.y1]=\"layout().top + layout().plotHeight\"\n [attr.y2]=\"layout().top + layout().plotHeight\" />\n @if (layout().axisBreak; as axisBreak) {\n <path\n class=\"ea-line-chart__y-axis\"\n [attr.d]=\"axisBreak.axis\" />\n <path\n class=\"ea-line-chart__axis-break\"\n [attr.d]=\"axisBreak.slashes\" />\n }\n @for (xLabel of layout().xLabels; track xLabel.key) {\n <line\n class=\"ea-line-chart__x-tick\"\n [attr.x1]=\"xLabel.x\"\n [attr.x2]=\"xLabel.x\"\n [attr.y1]=\"layout().axisY\"\n [attr.y2]=\"layout().tickEndY\" />\n <text\n class=\"ea-line-chart__axis ea-line-chart__axis--x\"\n [attr.text-anchor]=\"layout().labelAngle ? 'end' : 'middle'\"\n [attr.dominant-baseline]=\"layout().labelAngle ? 'central' : null\"\n [attr.transform]=\"\n layout().labelAngle\n ? 'rotate(' +\n -layout().labelAngle +\n ' ' +\n xLabel.x +\n ' ' +\n layout().labelY +\n ')'\n : null\n \"\n [attr.x]=\"xLabel.textX\"\n [attr.y]=\"layout().labelY\">\n {{ xLabel.text }}\n </text>\n }\n @if (layout().axisBreak; as axisBreak) {\n <!-- Keeps the break's gap open under a crosshair drawn along the y-axis -->\n <mask\n maskUnits=\"userSpaceOnUse\"\n [attr.id]=\"breakMaskId\">\n <rect\n fill=\"white\"\n x=\"0\"\n y=\"0\"\n [attr.width]=\"layout().width\"\n [attr.height]=\"layout().height\" />\n <rect\n fill=\"black\"\n [attr.x]=\"axisBreak.gap.x\"\n [attr.y]=\"axisBreak.gap.y\"\n [attr.width]=\"axisBreak.gap.width\"\n [attr.height]=\"axisBreak.gap.height\" />\n </mask>\n }\n @if (tooltip(); as tip) {\n <line\n class=\"ea-line-chart__crosshair\"\n [attr.mask]=\"layout().axisBreak ? 'url(#' + breakMaskId + ')' : null\"\n [attr.x1]=\"tip.x\"\n [attr.x2]=\"tip.x\"\n [attr.y1]=\"layout().top\"\n [attr.y2]=\"layout().top + layout().plotHeight\" />\n }\n <g [attr.clip-path]=\"layout().windowed ? 'url(#' + clipId + ')' : null\">\n <g class=\"ea-line-chart__lines\">\n @for (line of layout().series; track $index; let s = $index) {\n <g\n class=\"ea-line-chart__series\"\n [class.ea-line-chart__series--dimmed]=\"isDimmed(s)\"\n [style.--ea-chart-color]=\"line.color\">\n @if (showArea()) {\n @for (area of line.areas; track $index) {\n <path\n class=\"ea-line-chart__area\"\n [attr.d]=\"area\" />\n }\n }\n @for (path of line.paths; track $index) {\n <path\n class=\"ea-line-chart__line\"\n pathLength=\"1\"\n [attr.d]=\"path\" />\n }\n @for (point of line.points; track point.index) {\n @if (showPoints() || isActivePoint(s, point.index)) {\n <circle\n class=\"ea-line-chart__point\"\n [class.ea-line-chart__point--active]=\"\n isActivePoint(s, point.index)\n \"\n [attr.cx]=\"point.x\"\n [attr.cy]=\"point.y\"\n [attr.r]=\"isActivePoint(s, point.index) ? 6 : 4\" />\n }\n }\n </g>\n }\n </g>\n </g>\n @for (tip of tooltips(); track tip.key) {\n <rect\n class=\"ea-line-chart__anchor\"\n width=\"12\"\n height=\"12\"\n [attr.x]=\"tip.x - 6\"\n [attr.y]=\"tip.y - 6\"\n [eaTooltip]=\"tooltipContent\"\n [tooltipOpen]=\"true\"\n [maxWidth]=\"undefined\" />\n }\n </svg>\n }\n <ng-template #tooltipContent>\n @if (tooltip(); as tip) {\n <div class=\"ea-line-chart__tooltip\">\n <span class=\"ea-line-chart__tooltip-title\">{{ tip.title }}</span>\n @for (row of tip.rows; track $index) {\n <span\n class=\"ea-line-chart__tooltip-row\"\n [class.ea-line-chart__tooltip-row--active]=\"row.active\">\n <span\n class=\"ea-line-chart__swatch\"\n [style.--ea-chart-color]=\"row.color\">\n </span>\n <span class=\"ea-line-chart__tooltip-name\">{{ row.name }}</span>\n <span class=\"ea-line-chart__tooltip-value\">{{ row.value }}</span>\n </span>\n }\n </div>\n }\n </ng-template>\n <!-- Hidden through a block, since a table ignores the 1px size and keeps its full height -->\n <div class=\"ea-line-chart__table\">\n <table>\n <caption>\n {{ label() }}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">{{ i18n.messages().chart.category }}</th>\n\n @for (s of series(); track $index) {\n <th scope=\"col\">{{ s.name }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of labels(); track $index; let i = $index) {\n <tr>\n <th scope=\"row\">{{ row }}</th>\n\n @for (s of series(); track $index) {\n <td>{{ tableValue(s.data[i]) }}</td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n </div>\n <div\n class=\"ea-line-chart__live\"\n aria-live=\"polite\">\n {{ announcement() }}\n </div>\n } @else {\n <div\n class=\"ea-line-chart__empty\"\n role=\"img\"\n [attr.aria-label]=\"label()\"\n [style.height.px]=\"height()\">\n {{ i18n.messages().chart.noData }}\n </div>\n }\n @if (showsLegend()) {\n <ul\n class=\"ea-line-chart__legend\"\n aria-hidden=\"true\">\n @for (s of series(); track $index; let i = $index) {\n <li class=\"ea-line-chart__legend-item\">\n <span\n class=\"ea-line-chart__legend-line\"\n [style.--ea-chart-color]=\"seriesColor(i)\">\n </span>\n {{ s.name }}\n </li>\n }\n </ul>\n }\n</div>\n",
|
|
20133
|
+
styles: ["@keyframes ea-chart-fade{0%{opacity:0}}@keyframes ea-chart-draw{0%{stroke-dashoffset:1}}@keyframes ea-chart-grow-y{0%{transform:scaleY(0)}}@keyframes ea-chart-grow-x{0%{transform:scaleX(0)}}@keyframes ea-chart-grow{0%{transform:scale(0)}}ea-line-chart{display:block}.ea-line-chart{position:relative;display:flex;flex-direction:column;gap:.75em;font-family:var(--font-family-sans);color:var(--color-text-primary)}.ea-line-chart--2xs{font-size:var(--font-size-2xs)}.ea-line-chart--xs{font-size:var(--font-size-xs)}.ea-line-chart--sm{font-size:var(--font-size-sm)}.ea-line-chart--md{font-size:var(--font-size-md)}.ea-line-chart--lg{font-size:var(--font-size-lg)}.ea-line-chart--xl{font-size:var(--font-size-xl)}.ea-line-chart__plot{position:relative;border-radius:var(--radius-md);outline:none}.ea-line-chart__plot:focus-visible{box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-line-chart__plot:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-line-chart__plot svg{display:block;overflow:visible}.ea-line-chart__svg{direction:ltr;touch-action:pan-y}.ea-line-chart__hit{fill:transparent}.ea-line-chart__grid{stroke:var(--color-divider);stroke-width:1px;shape-rendering:crispEdges}.ea-line-chart__baseline{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges}.ea-line-chart__axis{font-size:.75em;fill:var(--color-text-secondary)}.ea-line-chart__x-tick{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges}.ea-line-chart__y-axis{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges;fill:none}.ea-line-chart__axis-break{fill:none;stroke:var(--color-border-strong);stroke-width:1.5px;stroke-linecap:round}.ea-line-chart__crosshair{stroke:var(--color-border-strong);stroke-width:1px;shape-rendering:crispEdges;pointer-events:none}.ea-line-chart__series{pointer-events:none;transition:opacity var(--duration-fast) var(--ease-out)}.ea-line-chart__series--dimmed{opacity:.35}.ea-line-chart__area{fill:var(--ea-chart-color);fill-opacity:.12}.ea-line-chart__line{fill:none;stroke:var(--ea-chart-color);stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.ea-line-chart__point{fill:var(--ea-chart-color);stroke:var(--ea-chart-surface, var(--color-bg-base));stroke-width:2px}.ea-line-chart__tooltip{display:flex;flex-direction:column;gap:var(--space-1)}.ea-line-chart__anchor{fill:transparent}.ea-line-chart__tooltip-title{font-weight:var(--font-weight-medium)}.ea-line-chart__tooltip-row{display:flex;align-items:center;gap:.5em}.ea-line-chart__tooltip-row--active{font-weight:var(--font-weight-medium)}.ea-line-chart__tooltip-value{font-weight:var(--font-weight-semibold);font-variant-numeric:tabular-nums}.ea-line-chart__swatch{flex-shrink:0;width:.75em;height:.75em;border-radius:var(--radius-sm);background-color:var(--ea-chart-color)}.ea-line-chart__legend{display:flex;flex-wrap:wrap;justify-content:center;gap:.375em 1em;padding:0;margin:0;font-size:.875em;list-style:none;color:var(--color-text-secondary)}.ea-line-chart__legend-item{display:flex;align-items:center;gap:.375em}.ea-line-chart__legend-line{width:1em;height:2px;border-radius:var(--radius-full);background-color:var(--ea-chart-color)}.ea-line-chart__table,.ea-line-chart__live{position:absolute;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);width:1px;height:1px;padding:0;margin:-1px;white-space:nowrap;border:0}.ea-line-chart__empty{display:flex;align-items:center;justify-content:center;font-size:.875em;color:var(--color-text-tertiary)}.ea-line-chart--pannable .ea-line-chart__svg{cursor:grab}.ea-line-chart--panning .ea-line-chart__svg{cursor:grabbing;-webkit-user-select:none;user-select:none}.ea-line-chart--animate-draw .ea-line-chart__line{stroke-dasharray:1;animation-name:ea-chart-draw;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-line-chart--animate-draw .ea-line-chart__line{animation:none}}.ea-line-chart--animate-draw .ea-line-chart__area,.ea-line-chart--animate-draw .ea-line-chart__point{animation-name:ea-chart-fade;animation-delay:var(--ea-chart-duration, .6s);animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-line-chart--animate-draw .ea-line-chart__area,.ea-line-chart--animate-draw .ea-line-chart__point{animation:none}}.ea-line-chart--animate-reveal .ea-line-chart__lines{clip-path:inset(-8px);animation-name:ea-line-chart-reveal;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-line-chart--animate-reveal .ea-line-chart__lines{animation:none}}.ea-line-chart--animate-fade .ea-line-chart__series{animation-name:ea-chart-fade;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-line-chart--animate-fade .ea-line-chart__series{animation:none}}.ea-line-chart--animate-rise .ea-line-chart__series{animation-name:ea-chart-grow-y;transform-origin:0 var(--ea-line-chart-baseline);animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-line-chart--animate-rise .ea-line-chart__series{animation:none}}@keyframes ea-line-chart-reveal{0%{clip-path:inset(-8px 100% -8px -8px)}}\n"]
|
|
19602
20134
|
}]
|
|
19603
20135
|
}],
|
|
19604
20136
|
propDecorators: {
|
|
@@ -19618,6 +20150,30 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
19618
20150
|
required: false
|
|
19619
20151
|
}]
|
|
19620
20152
|
}],
|
|
20153
|
+
xValues: [{
|
|
20154
|
+
type: i0.Input,
|
|
20155
|
+
args: [{
|
|
20156
|
+
isSignal: true,
|
|
20157
|
+
alias: "xValues",
|
|
20158
|
+
required: false
|
|
20159
|
+
}]
|
|
20160
|
+
}],
|
|
20161
|
+
xTicks: [{
|
|
20162
|
+
type: i0.Input,
|
|
20163
|
+
args: [{
|
|
20164
|
+
isSignal: true,
|
|
20165
|
+
alias: "xTicks",
|
|
20166
|
+
required: false
|
|
20167
|
+
}]
|
|
20168
|
+
}],
|
|
20169
|
+
visibleXSpan: [{
|
|
20170
|
+
type: i0.Input,
|
|
20171
|
+
args: [{
|
|
20172
|
+
isSignal: true,
|
|
20173
|
+
alias: "visibleXSpan",
|
|
20174
|
+
required: false
|
|
20175
|
+
}]
|
|
20176
|
+
}],
|
|
19621
20177
|
curve: [{
|
|
19622
20178
|
type: i0.Input,
|
|
19623
20179
|
args: [{
|
|
@@ -19674,6 +20230,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
19674
20230
|
required: false
|
|
19675
20231
|
}]
|
|
19676
20232
|
}],
|
|
20233
|
+
xLabelOrientation: [{
|
|
20234
|
+
type: i0.Input,
|
|
20235
|
+
args: [{
|
|
20236
|
+
isSignal: true,
|
|
20237
|
+
alias: "xLabelOrientation",
|
|
20238
|
+
required: false
|
|
20239
|
+
}]
|
|
20240
|
+
}],
|
|
20241
|
+
showAxisBreak: [{
|
|
20242
|
+
type: i0.Input,
|
|
20243
|
+
args: [{
|
|
20244
|
+
isSignal: true,
|
|
20245
|
+
alias: "showAxisBreak",
|
|
20246
|
+
required: false
|
|
20247
|
+
}]
|
|
20248
|
+
}],
|
|
19677
20249
|
height: [{
|
|
19678
20250
|
type: i0.Input,
|
|
19679
20251
|
args: [{
|
|
@@ -19729,6 +20301,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
19729
20301
|
activePointChange: [{
|
|
19730
20302
|
type: i0.Output,
|
|
19731
20303
|
args: ["activePointChange"]
|
|
20304
|
+
}],
|
|
20305
|
+
visibleRangeChange: [{
|
|
20306
|
+
type: i0.Output,
|
|
20307
|
+
args: ["visibleRangeChange"]
|
|
19732
20308
|
}]
|
|
19733
20309
|
}
|
|
19734
20310
|
});
|
|
@@ -22638,7 +23214,7 @@ var PieChartComponent = class PieChartComponent {
|
|
|
22638
23214
|
},
|
|
22639
23215
|
ngImport: i0,
|
|
22640
23216
|
template: "<div\n class=\"ea-pie-chart\"\n [ngClass]=\"hostClasses()\"\n [style.--ea-chart-duration]=\"animationDuration() + 'ms'\">\n @if (hasData()) {\n <div\n class=\"ea-pie-chart__plot\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-roledescription]=\"i18n.messages().chart.roleDescription\"\n [attr.aria-label]=\"label()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\">\n <div class=\"ea-pie-chart__figure\">\n @for (pass of renderPass(); track pass) {\n <svg\n class=\"ea-pie-chart__svg\"\n aria-hidden=\"true\"\n [attr.width]=\"layout().diameter\"\n [attr.height]=\"layout().diameter\"\n [attr.viewBox]=\"'0 0 ' + layout().diameter + ' ' + layout().diameter\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerdown)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave()\"\n (click)=\"onClick()\">\n @for (slice of layout().slices; track slice.index) {\n <path\n class=\"ea-pie-chart__slice\"\n fill-rule=\"evenodd\"\n [class.ea-pie-chart__slice--dimmed]=\"isDimmed(slice.index)\"\n [style.--ea-chart-color]=\"slice.color\"\n [style.transform]=\"offset(slice)\"\n [attr.d]=\"slice.path\" />\n }\n @for (tip of tooltips(); track tip.key) {\n <rect\n class=\"ea-pie-chart__anchor\"\n width=\"2\"\n height=\"2\"\n [attr.x]=\"tip.x - 1\"\n [attr.y]=\"tip.y - 1\"\n [eaTooltip]=\"tooltipContent\"\n [tooltipOpen]=\"true\"\n [maxWidth]=\"undefined\" />\n }\n </svg>\n }\n <ng-template #tooltipContent>\n @if (tooltip(); as tip) {\n <div class=\"ea-pie-chart__tooltip\">\n <span class=\"ea-pie-chart__tooltip-row\">\n <span\n class=\"ea-pie-chart__swatch\"\n [style.--ea-chart-color]=\"tip.color\">\n </span>\n <span class=\"ea-pie-chart__tooltip-title\">{{ tip.title }}</span>\n </span>\n <span class=\"ea-pie-chart__tooltip-value\">{{ tip.detail }}</span>\n </div>\n }\n </ng-template>\n </div>\n <table class=\"ea-pie-chart__table\">\n <caption>\n {{ label() }}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">{{ i18n.messages().chart.category }}</th>\n <th scope=\"col\">{{ i18n.messages().chart.value }}</th>\n <th scope=\"col\">{{ i18n.messages().chart.share }}</th>\n </tr>\n </thead>\n <tbody>\n @for (slice of data(); track $index; let i = $index) {\n <tr>\n <th scope=\"row\">{{ slice.label }}</th>\n <td>{{ tableValue(slice) }}</td>\n <td>{{ tablePercent(i) }}</td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n <div\n class=\"ea-pie-chart__live\"\n aria-live=\"polite\">\n {{ announcement() }}\n </div>\n } @else {\n <div\n class=\"ea-pie-chart__empty\"\n role=\"img\"\n [attr.aria-label]=\"label()\"\n [style.height.px]=\"height()\">\n {{ i18n.messages().chart.noData }}\n </div>\n }\n @if (showLegend() && hasData()) {\n <ul\n class=\"ea-pie-chart__legend\"\n aria-hidden=\"true\">\n @for (item of legend(); track $index) {\n <li class=\"ea-pie-chart__legend-item\">\n <span\n class=\"ea-pie-chart__swatch\"\n [style.--ea-chart-color]=\"item.color\">\n </span>\n {{ item.label }}\n @if (showPercentages()) {\n <span class=\"ea-pie-chart__legend-percent\">{{ item.percent }}</span>\n }\n </li>\n }\n </ul>\n }\n</div>\n",
|
|
22641
|
-
styles: ["@keyframes ea-chart-fade{0%{opacity:0}}@keyframes ea-chart-draw{0%{stroke-dashoffset:1}}@keyframes ea-chart-grow-y{0%{transform:scaleY(0)}}@keyframes ea-chart-grow-x{0%{transform:scaleX(0)}}@keyframes ea-chart-grow{0%{transform:scale(0)}}@property --ea-pie-chart-sweep{syntax: \"<angle>\"; inherits: false; initial-value: 360deg;}ea-pie-chart{display:block}.ea-pie-chart{position:relative;display:flex;flex-direction:column;gap:.75em;font-family:var(--font-family-sans);color:var(--color-text-primary)}.ea-pie-chart--2xs{font-size:var(--font-size-2xs)}.ea-pie-chart--xs{font-size:var(--font-size-xs)}.ea-pie-chart--sm{font-size:var(--font-size-sm)}.ea-pie-chart--md{font-size:var(--font-size-md)}.ea-pie-chart--lg{font-size:var(--font-size-lg)}.ea-pie-chart--xl{font-size:var(--font-size-xl)}.ea-pie-chart__plot{position:relative;border-radius:var(--radius-md);outline:none}.ea-pie-chart__plot:focus-visible{box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-pie-chart__plot:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-pie-chart__plot svg{display:block;overflow:visible}.ea-pie-chart__plot{display:flex;justify-content:center}.ea-pie-chart__figure{position:relative}.ea-pie-chart__svg{display:block;touch-action:pan-y}.ea-pie-chart__slice{stroke:var(--ea-chart-surface, var(--color-bg-base));stroke-width:2px;stroke-linejoin:round;fill:var(--ea-chart-color);transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.ea-pie-chart__slice--dimmed{opacity:.35}.ea-pie-chart__tooltip{display:flex;flex-direction:column;gap:var(--space-1)}.ea-pie-chart__anchor{fill:transparent}.ea-pie-chart__tooltip-title{font-weight:var(--font-weight-medium)}.ea-pie-chart__tooltip-row{display:flex;align-items:center;gap:.5em}.ea-pie-chart__tooltip-value{font-variant-numeric:tabular-nums}.ea-pie-chart__swatch{flex-shrink:0;width:.75em;height:.75em;border-radius:var(--radius-sm);background-color:var(--ea-chart-color)}.ea-pie-chart__legend{display:flex;flex-wrap:wrap;justify-content:center;gap:.375em 1em;padding:0;margin:0;font-size:.875em;list-style:none;color:var(--color-text-secondary)}.ea-pie-chart__legend-item{display:flex;align-items:center;gap:.375em}.ea-pie-chart__legend-percent{font-variant-numeric:tabular-nums;color:var(--color-text-tertiary)}.ea-pie-chart__table,.ea-pie-chart__live{position:absolute;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);width:1px;height:1px;padding:0;margin:-1px;white-space:nowrap;border:0}.ea-pie-chart__empty{display:flex;align-items:center;justify-content:center;font-size:.875em;color:var(--color-text-tertiary)}.ea-pie-chart--animate-sweep .ea-pie-chart__svg{-webkit-mask-image:conic-gradient(currentColor var(--ea-pie-chart-sweep),transparent 0);mask-image:conic-gradient(currentColor var(--ea-pie-chart-sweep),transparent 0);animation-name:ea-pie-chart-sweep;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-pie-chart--animate-sweep .ea-pie-chart__svg{animation:none}}.ea-pie-chart--animate-grow .ea-pie-chart__svg{animation-name:ea-chart-grow;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-pie-chart--animate-grow .ea-pie-chart__svg{animation:none}}.ea-pie-chart--animate-fade .ea-pie-chart__svg{animation-name:ea-chart-fade;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-pie-chart--animate-fade .ea-pie-chart__svg{animation:none}}@keyframes ea-pie-chart-sweep{0%{--ea-pie-chart-sweep: 0deg}}\n"],
|
|
23217
|
+
styles: ["@keyframes ea-chart-fade{0%{opacity:0}}@keyframes ea-chart-draw{0%{stroke-dashoffset:1}}@keyframes ea-chart-grow-y{0%{transform:scaleY(0)}}@keyframes ea-chart-grow-x{0%{transform:scaleX(0)}}@keyframes ea-chart-grow{0%{transform:scale(0)}}@property --ea-pie-chart-sweep{syntax: \"<angle>\"; inherits: false; initial-value: 360deg;}ea-pie-chart{display:block}.ea-pie-chart{position:relative;display:flex;flex-direction:column;gap:.75em;font-family:var(--font-family-sans);color:var(--color-text-primary)}.ea-pie-chart--2xs{font-size:var(--font-size-2xs)}.ea-pie-chart--xs{font-size:var(--font-size-xs)}.ea-pie-chart--sm{font-size:var(--font-size-sm)}.ea-pie-chart--md{font-size:var(--font-size-md)}.ea-pie-chart--lg{font-size:var(--font-size-lg)}.ea-pie-chart--xl{font-size:var(--font-size-xl)}.ea-pie-chart__plot{position:relative;border-radius:var(--radius-md);outline:none}.ea-pie-chart__plot:focus-visible{box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-pie-chart__plot:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-pie-chart__plot svg{display:block;overflow:visible}.ea-pie-chart__plot{display:flex;justify-content:center}.ea-pie-chart__figure{position:relative}.ea-pie-chart__svg{display:block;touch-action:pan-y}.ea-pie-chart__slice{stroke:var(--ea-chart-surface, var(--color-bg-base));stroke-width:2px;stroke-linejoin:round;fill:var(--ea-chart-color);transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.ea-pie-chart__slice--dimmed{opacity:.35}.ea-pie-chart__tooltip{display:flex;flex-direction:column;gap:var(--space-1)}.ea-pie-chart__anchor{fill:transparent}.ea-pie-chart__tooltip-title{font-weight:var(--font-weight-medium)}.ea-pie-chart__tooltip-row{display:flex;align-items:center;gap:.5em}.ea-pie-chart__tooltip-value{font-weight:var(--font-weight-semibold);font-variant-numeric:tabular-nums}.ea-pie-chart__swatch{flex-shrink:0;width:.75em;height:.75em;border-radius:var(--radius-sm);background-color:var(--ea-chart-color)}.ea-pie-chart__legend{display:flex;flex-wrap:wrap;justify-content:center;gap:.375em 1em;padding:0;margin:0;font-size:.875em;list-style:none;color:var(--color-text-secondary)}.ea-pie-chart__legend-item{display:flex;align-items:center;gap:.375em}.ea-pie-chart__legend-percent{font-variant-numeric:tabular-nums;color:var(--color-text-tertiary)}.ea-pie-chart__table,.ea-pie-chart__live{position:absolute;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);width:1px;height:1px;padding:0;margin:-1px;white-space:nowrap;border:0}.ea-pie-chart__empty{display:flex;align-items:center;justify-content:center;font-size:.875em;color:var(--color-text-tertiary)}.ea-pie-chart--animate-sweep .ea-pie-chart__svg{-webkit-mask-image:conic-gradient(currentColor var(--ea-pie-chart-sweep),transparent 0);mask-image:conic-gradient(currentColor var(--ea-pie-chart-sweep),transparent 0);animation-name:ea-pie-chart-sweep;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-pie-chart--animate-sweep .ea-pie-chart__svg{animation:none}}.ea-pie-chart--animate-grow .ea-pie-chart__svg{animation-name:ea-chart-grow;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-pie-chart--animate-grow .ea-pie-chart__svg{animation:none}}.ea-pie-chart--animate-fade .ea-pie-chart__svg{animation-name:ea-chart-fade;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-pie-chart--animate-fade .ea-pie-chart__svg{animation:none}}@keyframes ea-pie-chart-sweep{0%{--ea-pie-chart-sweep: 0deg}}\n"],
|
|
22642
23218
|
dependencies: [{
|
|
22643
23219
|
kind: "directive",
|
|
22644
23220
|
type: NgClass,
|
|
@@ -22675,7 +23251,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
22675
23251
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
22676
23252
|
encapsulation: ViewEncapsulation.None,
|
|
22677
23253
|
template: "<div\n class=\"ea-pie-chart\"\n [ngClass]=\"hostClasses()\"\n [style.--ea-chart-duration]=\"animationDuration() + 'ms'\">\n @if (hasData()) {\n <div\n class=\"ea-pie-chart__plot\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-roledescription]=\"i18n.messages().chart.roleDescription\"\n [attr.aria-label]=\"label()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\">\n <div class=\"ea-pie-chart__figure\">\n @for (pass of renderPass(); track pass) {\n <svg\n class=\"ea-pie-chart__svg\"\n aria-hidden=\"true\"\n [attr.width]=\"layout().diameter\"\n [attr.height]=\"layout().diameter\"\n [attr.viewBox]=\"'0 0 ' + layout().diameter + ' ' + layout().diameter\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerdown)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave()\"\n (click)=\"onClick()\">\n @for (slice of layout().slices; track slice.index) {\n <path\n class=\"ea-pie-chart__slice\"\n fill-rule=\"evenodd\"\n [class.ea-pie-chart__slice--dimmed]=\"isDimmed(slice.index)\"\n [style.--ea-chart-color]=\"slice.color\"\n [style.transform]=\"offset(slice)\"\n [attr.d]=\"slice.path\" />\n }\n @for (tip of tooltips(); track tip.key) {\n <rect\n class=\"ea-pie-chart__anchor\"\n width=\"2\"\n height=\"2\"\n [attr.x]=\"tip.x - 1\"\n [attr.y]=\"tip.y - 1\"\n [eaTooltip]=\"tooltipContent\"\n [tooltipOpen]=\"true\"\n [maxWidth]=\"undefined\" />\n }\n </svg>\n }\n <ng-template #tooltipContent>\n @if (tooltip(); as tip) {\n <div class=\"ea-pie-chart__tooltip\">\n <span class=\"ea-pie-chart__tooltip-row\">\n <span\n class=\"ea-pie-chart__swatch\"\n [style.--ea-chart-color]=\"tip.color\">\n </span>\n <span class=\"ea-pie-chart__tooltip-title\">{{ tip.title }}</span>\n </span>\n <span class=\"ea-pie-chart__tooltip-value\">{{ tip.detail }}</span>\n </div>\n }\n </ng-template>\n </div>\n <table class=\"ea-pie-chart__table\">\n <caption>\n {{ label() }}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">{{ i18n.messages().chart.category }}</th>\n <th scope=\"col\">{{ i18n.messages().chart.value }}</th>\n <th scope=\"col\">{{ i18n.messages().chart.share }}</th>\n </tr>\n </thead>\n <tbody>\n @for (slice of data(); track $index; let i = $index) {\n <tr>\n <th scope=\"row\">{{ slice.label }}</th>\n <td>{{ tableValue(slice) }}</td>\n <td>{{ tablePercent(i) }}</td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n <div\n class=\"ea-pie-chart__live\"\n aria-live=\"polite\">\n {{ announcement() }}\n </div>\n } @else {\n <div\n class=\"ea-pie-chart__empty\"\n role=\"img\"\n [attr.aria-label]=\"label()\"\n [style.height.px]=\"height()\">\n {{ i18n.messages().chart.noData }}\n </div>\n }\n @if (showLegend() && hasData()) {\n <ul\n class=\"ea-pie-chart__legend\"\n aria-hidden=\"true\">\n @for (item of legend(); track $index) {\n <li class=\"ea-pie-chart__legend-item\">\n <span\n class=\"ea-pie-chart__swatch\"\n [style.--ea-chart-color]=\"item.color\">\n </span>\n {{ item.label }}\n @if (showPercentages()) {\n <span class=\"ea-pie-chart__legend-percent\">{{ item.percent }}</span>\n }\n </li>\n }\n </ul>\n }\n</div>\n",
|
|
22678
|
-
styles: ["@keyframes ea-chart-fade{0%{opacity:0}}@keyframes ea-chart-draw{0%{stroke-dashoffset:1}}@keyframes ea-chart-grow-y{0%{transform:scaleY(0)}}@keyframes ea-chart-grow-x{0%{transform:scaleX(0)}}@keyframes ea-chart-grow{0%{transform:scale(0)}}@property --ea-pie-chart-sweep{syntax: \"<angle>\"; inherits: false; initial-value: 360deg;}ea-pie-chart{display:block}.ea-pie-chart{position:relative;display:flex;flex-direction:column;gap:.75em;font-family:var(--font-family-sans);color:var(--color-text-primary)}.ea-pie-chart--2xs{font-size:var(--font-size-2xs)}.ea-pie-chart--xs{font-size:var(--font-size-xs)}.ea-pie-chart--sm{font-size:var(--font-size-sm)}.ea-pie-chart--md{font-size:var(--font-size-md)}.ea-pie-chart--lg{font-size:var(--font-size-lg)}.ea-pie-chart--xl{font-size:var(--font-size-xl)}.ea-pie-chart__plot{position:relative;border-radius:var(--radius-md);outline:none}.ea-pie-chart__plot:focus-visible{box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-pie-chart__plot:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-pie-chart__plot svg{display:block;overflow:visible}.ea-pie-chart__plot{display:flex;justify-content:center}.ea-pie-chart__figure{position:relative}.ea-pie-chart__svg{display:block;touch-action:pan-y}.ea-pie-chart__slice{stroke:var(--ea-chart-surface, var(--color-bg-base));stroke-width:2px;stroke-linejoin:round;fill:var(--ea-chart-color);transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.ea-pie-chart__slice--dimmed{opacity:.35}.ea-pie-chart__tooltip{display:flex;flex-direction:column;gap:var(--space-1)}.ea-pie-chart__anchor{fill:transparent}.ea-pie-chart__tooltip-title{font-weight:var(--font-weight-medium)}.ea-pie-chart__tooltip-row{display:flex;align-items:center;gap:.5em}.ea-pie-chart__tooltip-value{font-variant-numeric:tabular-nums}.ea-pie-chart__swatch{flex-shrink:0;width:.75em;height:.75em;border-radius:var(--radius-sm);background-color:var(--ea-chart-color)}.ea-pie-chart__legend{display:flex;flex-wrap:wrap;justify-content:center;gap:.375em 1em;padding:0;margin:0;font-size:.875em;list-style:none;color:var(--color-text-secondary)}.ea-pie-chart__legend-item{display:flex;align-items:center;gap:.375em}.ea-pie-chart__legend-percent{font-variant-numeric:tabular-nums;color:var(--color-text-tertiary)}.ea-pie-chart__table,.ea-pie-chart__live{position:absolute;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);width:1px;height:1px;padding:0;margin:-1px;white-space:nowrap;border:0}.ea-pie-chart__empty{display:flex;align-items:center;justify-content:center;font-size:.875em;color:var(--color-text-tertiary)}.ea-pie-chart--animate-sweep .ea-pie-chart__svg{-webkit-mask-image:conic-gradient(currentColor var(--ea-pie-chart-sweep),transparent 0);mask-image:conic-gradient(currentColor var(--ea-pie-chart-sweep),transparent 0);animation-name:ea-pie-chart-sweep;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-pie-chart--animate-sweep .ea-pie-chart__svg{animation:none}}.ea-pie-chart--animate-grow .ea-pie-chart__svg{animation-name:ea-chart-grow;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-pie-chart--animate-grow .ea-pie-chart__svg{animation:none}}.ea-pie-chart--animate-fade .ea-pie-chart__svg{animation-name:ea-chart-fade;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-pie-chart--animate-fade .ea-pie-chart__svg{animation:none}}@keyframes ea-pie-chart-sweep{0%{--ea-pie-chart-sweep: 0deg}}\n"]
|
|
23254
|
+
styles: ["@keyframes ea-chart-fade{0%{opacity:0}}@keyframes ea-chart-draw{0%{stroke-dashoffset:1}}@keyframes ea-chart-grow-y{0%{transform:scaleY(0)}}@keyframes ea-chart-grow-x{0%{transform:scaleX(0)}}@keyframes ea-chart-grow{0%{transform:scale(0)}}@property --ea-pie-chart-sweep{syntax: \"<angle>\"; inherits: false; initial-value: 360deg;}ea-pie-chart{display:block}.ea-pie-chart{position:relative;display:flex;flex-direction:column;gap:.75em;font-family:var(--font-family-sans);color:var(--color-text-primary)}.ea-pie-chart--2xs{font-size:var(--font-size-2xs)}.ea-pie-chart--xs{font-size:var(--font-size-xs)}.ea-pie-chart--sm{font-size:var(--font-size-sm)}.ea-pie-chart--md{font-size:var(--font-size-md)}.ea-pie-chart--lg{font-size:var(--font-size-lg)}.ea-pie-chart--xl{font-size:var(--font-size-xl)}.ea-pie-chart__plot{position:relative;border-radius:var(--radius-md);outline:none}.ea-pie-chart__plot:focus-visible{box-shadow:var(--shadow-focus-ring)}@media(forced-colors:active){.ea-pie-chart__plot:focus-visible{outline:2px solid Highlight;outline-offset:2px}}.ea-pie-chart__plot svg{display:block;overflow:visible}.ea-pie-chart__plot{display:flex;justify-content:center}.ea-pie-chart__figure{position:relative}.ea-pie-chart__svg{display:block;touch-action:pan-y}.ea-pie-chart__slice{stroke:var(--ea-chart-surface, var(--color-bg-base));stroke-width:2px;stroke-linejoin:round;fill:var(--ea-chart-color);transition:opacity var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.ea-pie-chart__slice--dimmed{opacity:.35}.ea-pie-chart__tooltip{display:flex;flex-direction:column;gap:var(--space-1)}.ea-pie-chart__anchor{fill:transparent}.ea-pie-chart__tooltip-title{font-weight:var(--font-weight-medium)}.ea-pie-chart__tooltip-row{display:flex;align-items:center;gap:.5em}.ea-pie-chart__tooltip-value{font-weight:var(--font-weight-semibold);font-variant-numeric:tabular-nums}.ea-pie-chart__swatch{flex-shrink:0;width:.75em;height:.75em;border-radius:var(--radius-sm);background-color:var(--ea-chart-color)}.ea-pie-chart__legend{display:flex;flex-wrap:wrap;justify-content:center;gap:.375em 1em;padding:0;margin:0;font-size:.875em;list-style:none;color:var(--color-text-secondary)}.ea-pie-chart__legend-item{display:flex;align-items:center;gap:.375em}.ea-pie-chart__legend-percent{font-variant-numeric:tabular-nums;color:var(--color-text-tertiary)}.ea-pie-chart__table,.ea-pie-chart__live{position:absolute;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);width:1px;height:1px;padding:0;margin:-1px;white-space:nowrap;border:0}.ea-pie-chart__empty{display:flex;align-items:center;justify-content:center;font-size:.875em;color:var(--color-text-tertiary)}.ea-pie-chart--animate-sweep .ea-pie-chart__svg{-webkit-mask-image:conic-gradient(currentColor var(--ea-pie-chart-sweep),transparent 0);mask-image:conic-gradient(currentColor var(--ea-pie-chart-sweep),transparent 0);animation-name:ea-pie-chart-sweep;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-pie-chart--animate-sweep .ea-pie-chart__svg{animation:none}}.ea-pie-chart--animate-grow .ea-pie-chart__svg{animation-name:ea-chart-grow;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-pie-chart--animate-grow .ea-pie-chart__svg{animation:none}}.ea-pie-chart--animate-fade .ea-pie-chart__svg{animation-name:ea-chart-fade;animation-duration:var(--ea-chart-duration, .6s);animation-timing-function:var(--ease-out);animation-fill-mode:both}@media(prefers-reduced-motion:reduce){.ea-pie-chart--animate-fade .ea-pie-chart__svg{animation:none}}@keyframes ea-pie-chart-sweep{0%{--ea-pie-chart-sweep: 0deg}}\n"]
|
|
22679
23255
|
}]
|
|
22680
23256
|
}],
|
|
22681
23257
|
propDecorators: {
|