@porscheinformatik/clr-addons 21.9.0 → 21.10.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/porscheinformatik-clr-addons-charts.mjs +363 -52
- package/fesm2022/porscheinformatik-clr-addons-charts.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/clr-addons-phs.css +6 -0
- package/styles/clr-addons-phs.css.map +1 -1
- package/styles/clr-addons-phs.min.css +1 -1
- package/styles/clr-addons-phs.min.css.map +1 -1
- package/types/porscheinformatik-clr-addons-charts.d.ts +77 -11
|
@@ -2,11 +2,12 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, viewChild, computed, signal, Directive, ChangeDetectionStrategy, Component, Injectable, inject, output, Renderer2, DestroyRef, DOCUMENT, Inject, ElementRef, contentChild, NgModule } from '@angular/core';
|
|
3
3
|
import { format, select, scaleBand, scaleLinear, max, axisBottom, axisLeft, group, sum, scalePoint, min, line, curveMonotoneX, area, axisRight, arc, pie, color } from 'd3';
|
|
4
4
|
import * as i1 from '@clr/angular';
|
|
5
|
-
import { ClrAlertModule, ClrDropdownModule, ClrIcon, ClrSignpostContent, ClrStartDateInput, ClrEndDateInput
|
|
5
|
+
import { ClrAlertModule, ClrDropdownModule, ClrIcon, ClrSignpostModule, ClrSignpostContent, ClrStartDateInput, ClrEndDateInput } from '@clr/angular';
|
|
6
6
|
import * as i3 from '@clr/angular/icon';
|
|
7
7
|
import { ClarityIcons, downloadIcon } from '@clr/angular/icon';
|
|
8
8
|
import * as i2 from '@clr/angular/popover/common';
|
|
9
|
-
import
|
|
9
|
+
import * as i1$1 from 'ngx-skeleton-loader';
|
|
10
|
+
import { NgxSkeletonLoaderComponent, NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
|
|
10
11
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
11
12
|
import { ReplaySubject, skip } from 'rxjs';
|
|
12
13
|
import { map, distinctUntilChanged, debounceTime } from 'rxjs/operators';
|
|
@@ -459,33 +460,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
459
460
|
class ChartLegendComponent {
|
|
460
461
|
constructor() {
|
|
461
462
|
this.items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
463
|
+
this.hoveredIndex = input(-1, ...(ngDevMode ? [{ debugName: "hoveredIndex" }] : /* istanbul ignore next */ []));
|
|
464
|
+
this.loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
465
|
+
this.orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
466
|
+
this.itemHover = output();
|
|
467
|
+
this.clicked = output();
|
|
462
468
|
this.toChartColor = toChartColor;
|
|
463
469
|
}
|
|
470
|
+
onLegendHover(item, index, hover) {
|
|
471
|
+
this.itemHover.emit({ item, index, hover });
|
|
472
|
+
}
|
|
464
473
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: ChartLegendComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
465
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: ChartLegendComponent, isStandalone: true, selector: "cng-chart-legend", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
474
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: ChartLegendComponent, isStandalone: true, selector: "cng-chart-legend", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, hoveredIndex: { classPropertyName: "hoveredIndex", publicName: "hoveredIndex", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemHover: "itemHover", clicked: "clicked" }, ngImport: i0, template: `
|
|
466
475
|
<div class="chart-legend" data-testid="chart-legend">
|
|
467
|
-
@for (item of items(); track item.label) {
|
|
468
|
-
<div
|
|
476
|
+
@for (item of items(); track item.label; let i = $index) {
|
|
477
|
+
<div
|
|
478
|
+
class="legend-item has-more-info"
|
|
479
|
+
[attr.data-testid]="'chart-legend-item-' + item.label"
|
|
480
|
+
(mouseenter)="onLegendHover(item, i, true)"
|
|
481
|
+
(mouseleave)="onLegendHover(item, i, false)"
|
|
482
|
+
(click)="clicked.emit(item)"
|
|
483
|
+
>
|
|
469
484
|
<span class="legend-color-square" [style.background-color]="toChartColor(item.color)"></span>
|
|
470
|
-
<span
|
|
485
|
+
<span
|
|
486
|
+
class="legend-label"
|
|
487
|
+
[class.legend-label-hover]="hoveredIndex() === i"
|
|
488
|
+
[attr.data-testid]="'chart-legend-label-' + item.label"
|
|
489
|
+
>{{ item.label }}</span
|
|
490
|
+
>
|
|
471
491
|
</div>
|
|
472
492
|
}
|
|
473
493
|
</div>
|
|
474
|
-
`, isInline: true, styles: [":host{display:block}.chart-legend{display:flex;flex-wrap:wrap;gap:.25rem 1rem;padding:.5rem 0 .25rem;font-size:11px;color:var(--cds-global-color-construction-400, #666)}.legend-item{display:flex;align-items:center;
|
|
494
|
+
`, isInline: true, styles: [":host{display:block}.chart-legend{display:flex;flex-wrap:wrap;gap:.25rem 1rem;padding:.5rem 0 .25rem;font-size:11px;color:var(--cds-global-color-construction-400, #666)}.legend-item{display:flex;align-items:center}.legend-label{margin-left:4px;max-width:85px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;line-height:16px;font-weight:500;color:var(--clr-color-neutral-900, #222);transition:font-weight .15s}.legend-color-square{width:10px;height:10px;border-radius:2px;flex-shrink:0}.legend-label-hover,.legend-item:hover .legend-label{font-weight:700;color:var(--clr-color-neutral-1000, #000)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
475
495
|
}
|
|
476
496
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: ChartLegendComponent, decorators: [{
|
|
477
497
|
type: Component,
|
|
478
498
|
args: [{ selector: 'cng-chart-legend', template: `
|
|
479
499
|
<div class="chart-legend" data-testid="chart-legend">
|
|
480
|
-
@for (item of items(); track item.label) {
|
|
481
|
-
<div
|
|
500
|
+
@for (item of items(); track item.label; let i = $index) {
|
|
501
|
+
<div
|
|
502
|
+
class="legend-item has-more-info"
|
|
503
|
+
[attr.data-testid]="'chart-legend-item-' + item.label"
|
|
504
|
+
(mouseenter)="onLegendHover(item, i, true)"
|
|
505
|
+
(mouseleave)="onLegendHover(item, i, false)"
|
|
506
|
+
(click)="clicked.emit(item)"
|
|
507
|
+
>
|
|
482
508
|
<span class="legend-color-square" [style.background-color]="toChartColor(item.color)"></span>
|
|
483
|
-
<span
|
|
509
|
+
<span
|
|
510
|
+
class="legend-label"
|
|
511
|
+
[class.legend-label-hover]="hoveredIndex() === i"
|
|
512
|
+
[attr.data-testid]="'chart-legend-label-' + item.label"
|
|
513
|
+
>{{ item.label }}</span
|
|
514
|
+
>
|
|
484
515
|
</div>
|
|
485
516
|
}
|
|
486
517
|
</div>
|
|
487
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block}.chart-legend{display:flex;flex-wrap:wrap;gap:.25rem 1rem;padding:.5rem 0 .25rem;font-size:11px;color:var(--cds-global-color-construction-400, #666)}.legend-item{display:flex;align-items:center;
|
|
488
|
-
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }] } });
|
|
518
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block}.chart-legend{display:flex;flex-wrap:wrap;gap:.25rem 1rem;padding:.5rem 0 .25rem;font-size:11px;color:var(--cds-global-color-construction-400, #666)}.legend-item{display:flex;align-items:center}.legend-label{margin-left:4px;max-width:85px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;line-height:16px;font-weight:500;color:var(--clr-color-neutral-900, #222);transition:font-weight .15s}.legend-color-square{width:10px;height:10px;border-radius:2px;flex-shrink:0}.legend-label-hover,.legend-item:hover .legend-label{font-weight:700;color:var(--clr-color-neutral-1000, #000)}\n"] }]
|
|
519
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], hoveredIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoveredIndex", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], itemHover: [{ type: i0.Output, args: ["itemHover"] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
489
520
|
|
|
490
521
|
class ChartSkeletonComponent {
|
|
491
522
|
constructor() {
|
|
@@ -1063,11 +1094,11 @@ class BarChartComponent extends ChartBase {
|
|
|
1063
1094
|
return Math.floor(height / BarChartComponent.HORIZONTAL_BAR_MIN_HEIGHT_PX);
|
|
1064
1095
|
}
|
|
1065
1096
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: BarChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1066
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: BarChartComponent, isStandalone: false, selector: "clr-bar-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, stacks: { classPropertyName: "stacks", publicName: "stacks", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: true, transformFunction: null }, tooltipOrientation: { classPropertyName: "tooltipOrientation", publicName: "tooltipOrientation", isSignal: true, isRequired: false, transformFunction: null }, barSizePx: { classPropertyName: "barSizePx", publicName: "barSizePx", isSignal: true, isRequired: false, transformFunction: null }, barAreaSizePx: { classPropertyName: "barAreaSizePx", publicName: "barAreaSizePx", isSignal: true, isRequired: false, transformFunction: null }, tooltipPercentOfTotal: { classPropertyName: "tooltipPercentOfTotal", publicName: "tooltipPercentOfTotal", isSignal: true, isRequired: false, transformFunction: null }, tooltipPercentOf: { classPropertyName: "tooltipPercentOf", publicName: "tooltipPercentOf", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooManyItemsMessage: { classPropertyName: "tooManyItemsMessage", publicName: "tooManyItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooManyItemsGroupedMessage: { classPropertyName: "tooManyItemsGroupedMessage", publicName: "tooManyItemsGroupedMessage", isSignal: true, isRequired: false, transformFunction: null }, allValuesZeroMessage: { classPropertyName: "allValuesZeroMessage", publicName: "allValuesZeroMessage", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, xAxisLabel: { classPropertyName: "xAxisLabel", publicName: "xAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yAxisLabel: { classPropertyName: "yAxisLabel", publicName: "yAxisLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-container\" data-testid=\"bar-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"bar-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !data()?.length || allValuesZero()\" #chart></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"bar-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"!stacks() ? selectedItem()?.color : undefined\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"valueClicked.emit({ key: tooltipKey(), label: tooltipLabel(), value: tooltipValue() })\"\n >\n <ng-container ngProjectAs=\"cng-title\"> ({{ tooltipValue() }}) {{ tooltipLabel() }}</ng-container>\n\n <p class=\"mt-0\" data-testid=\"bar-chart-tooltip-percentage\">\n {{ (100 * tooltipValue()) / total() | number: '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n\n @if (stacks()) {\n @for (slice of selectedStackSlices(); track slice.key) {\n <div\n class=\"mt-0-5 d-flex\"\n [attr.data-testid]=\"'bar-chart-tooltip-stack-slice-' + (slice.fullLabel || slice.label)\"\n >\n <div class=\"color-square mr-0-5\" [style.background-color]=\"toChartColor(slice.color)\"></div>\n <strong>{{ slice.fullLabel || slice.label }}: </strong>\n <span\n class=\"has-more-info\"\n [attr.data-testid]=\"'bar-chart-tooltip-stack-value-' + (slice.fullLabel || slice.label)\"\n (click)=\"\n valueClicked.emit({\n key: [slice.key],\n label: slice.fullLabel || slice.label,\n value: slice.value,\n })\n \"\n >\n {{ slice.value }}\n </span>\n </div>\n <p\n class=\"mt-0-25 percentage-info\"\n [attr.data-testid]=\"'bar-chart-tooltip-stack-percentage-' + (slice.fullLabel || slice.label)\"\n >\n {{ (100 * slice.value) / total() | number: '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n {{ slice.percentageOfStack | number: '1.0-2' }}% {{ tooltipPercentOf() }} \"{{ tooltipLabel() }}\"\n </p>\n }\n }\n </cng-chart-tooltip>\n }\n @if (loading() || !data()?.length || allValuesZero()) {\n <cng-bar-chart-skeleton\n data-testid=\"bar-chart-skeleton\"\n [orientation]=\"orientation()\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n />\n }\n @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"bar-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length && !allValuesZero()) {\n <cng-chart-legend data-testid=\"bar-chart-legend\" [items]=\"legendItems()\" />\n }\n @if (showExportButton() && !loading() && data()?.length) {\n <cng-chart-export-button\n data-testid=\"bar-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100
|
|
1097
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: BarChartComponent, isStandalone: false, selector: "clr-bar-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, stacks: { classPropertyName: "stacks", publicName: "stacks", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: true, transformFunction: null }, tooltipOrientation: { classPropertyName: "tooltipOrientation", publicName: "tooltipOrientation", isSignal: true, isRequired: false, transformFunction: null }, barSizePx: { classPropertyName: "barSizePx", publicName: "barSizePx", isSignal: true, isRequired: false, transformFunction: null }, barAreaSizePx: { classPropertyName: "barAreaSizePx", publicName: "barAreaSizePx", isSignal: true, isRequired: false, transformFunction: null }, tooltipPercentOfTotal: { classPropertyName: "tooltipPercentOfTotal", publicName: "tooltipPercentOfTotal", isSignal: true, isRequired: false, transformFunction: null }, tooltipPercentOf: { classPropertyName: "tooltipPercentOf", publicName: "tooltipPercentOf", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooManyItemsMessage: { classPropertyName: "tooManyItemsMessage", publicName: "tooManyItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooManyItemsGroupedMessage: { classPropertyName: "tooManyItemsGroupedMessage", publicName: "tooManyItemsGroupedMessage", isSignal: true, isRequired: false, transformFunction: null }, allValuesZeroMessage: { classPropertyName: "allValuesZeroMessage", publicName: "allValuesZeroMessage", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, xAxisLabel: { classPropertyName: "xAxisLabel", publicName: "xAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yAxisLabel: { classPropertyName: "yAxisLabel", publicName: "yAxisLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-container\" data-testid=\"bar-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"bar-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !data()?.length || allValuesZero()\" #chart></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"bar-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"!stacks() ? selectedItem()?.color : undefined\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"valueClicked.emit({ key: tooltipKey(), label: tooltipLabel(), value: tooltipValue() })\"\n >\n <ng-container ngProjectAs=\"cng-title\"> ({{ tooltipValue() }}) {{ tooltipLabel() }}</ng-container>\n\n <p class=\"mt-0\" data-testid=\"bar-chart-tooltip-percentage\">\n {{ (100 * tooltipValue()) / total() | number: '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n\n @if (stacks()) {\n @for (slice of selectedStackSlices(); track slice.key) {\n <div\n class=\"mt-0-5 d-flex\"\n [attr.data-testid]=\"'bar-chart-tooltip-stack-slice-' + (slice.fullLabel || slice.label)\"\n >\n <div class=\"color-square mr-0-5\" [style.background-color]=\"toChartColor(slice.color)\"></div>\n <strong>{{ slice.fullLabel || slice.label }}: </strong>\n <span\n class=\"has-more-info\"\n [attr.data-testid]=\"'bar-chart-tooltip-stack-value-' + (slice.fullLabel || slice.label)\"\n (click)=\"\n valueClicked.emit({\n key: [slice.key],\n label: slice.fullLabel || slice.label,\n value: slice.value,\n })\n \"\n >\n {{ slice.value }}\n </span>\n </div>\n <p\n class=\"mt-0-25 percentage-info\"\n [attr.data-testid]=\"'bar-chart-tooltip-stack-percentage-' + (slice.fullLabel || slice.label)\"\n >\n {{ (100 * slice.value) / total() | number: '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n {{ slice.percentageOfStack | number: '1.0-2' }}% {{ tooltipPercentOf() }} \"{{ tooltipLabel() }}\"\n </p>\n }\n }\n </cng-chart-tooltip>\n }\n @if (loading() || !data()?.length || allValuesZero()) {\n <cng-bar-chart-skeleton\n data-testid=\"bar-chart-skeleton\"\n [orientation]=\"orientation()\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n />\n }\n @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"bar-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length && !allValuesZero()) {\n <cng-chart-legend data-testid=\"bar-chart-legend\" [items]=\"legendItems()\" />\n }\n @if (showExportButton() && !loading() && data()?.length) {\n <cng-chart-export-button\n data-testid=\"bar-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100%;position:absolute;inset:0}cng-bar-chart-skeleton{height:100%}.percentage-info{margin-left:15px}\n"], dependencies: [{ kind: "component", type: ChartAlertOverlayComponent, selector: "cng-chart-alert-overlay", inputs: ["alertMessage", "alertType"] }, { kind: "component", type: ChartExportButtonComponent, selector: "cng-chart-export-button", inputs: ["svgRef", "filename", "buttonTitle", "legendItems"] }, { kind: "component", type: ChartLegendComponent, selector: "cng-chart-legend", inputs: ["items", "hoveredIndex", "loading", "orientation"], outputs: ["itemHover", "clicked"] }, { kind: "component", type: ChartSkeletonComponent, selector: "cng-bar-chart-skeleton", inputs: ["skeletonType", "orientation"] }, { kind: "component", type: ChartTooltipComponent, selector: "cng-chart-tooltip", inputs: ["tooltipPosition", "tooltipOrientation", "squareColor", "tooltipClickable"], outputs: ["tooltipClosed", "tooltipHeaderClicked"] }, { kind: "directive", type: OutsideClickDirective, selector: "[cngOutsideClick]", outputs: ["cngOutsideClick"] }, { kind: "directive", type: WindowResizeDirective, selector: "[cngWindowResize]", inputs: ["debounce", "includeFirst"], outputs: ["cngWindowResize"] }, { kind: "pipe", type: i8.DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1067
1098
|
}
|
|
1068
1099
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: BarChartComponent, decorators: [{
|
|
1069
1100
|
type: Component,
|
|
1070
|
-
args: [{ selector: 'clr-bar-chart', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"chart-container\" data-testid=\"bar-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"bar-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !data()?.length || allValuesZero()\" #chart></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"bar-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"!stacks() ? selectedItem()?.color : undefined\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"valueClicked.emit({ key: tooltipKey(), label: tooltipLabel(), value: tooltipValue() })\"\n >\n <ng-container ngProjectAs=\"cng-title\"> ({{ tooltipValue() }}) {{ tooltipLabel() }}</ng-container>\n\n <p class=\"mt-0\" data-testid=\"bar-chart-tooltip-percentage\">\n {{ (100 * tooltipValue()) / total() | number: '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n\n @if (stacks()) {\n @for (slice of selectedStackSlices(); track slice.key) {\n <div\n class=\"mt-0-5 d-flex\"\n [attr.data-testid]=\"'bar-chart-tooltip-stack-slice-' + (slice.fullLabel || slice.label)\"\n >\n <div class=\"color-square mr-0-5\" [style.background-color]=\"toChartColor(slice.color)\"></div>\n <strong>{{ slice.fullLabel || slice.label }}: </strong>\n <span\n class=\"has-more-info\"\n [attr.data-testid]=\"'bar-chart-tooltip-stack-value-' + (slice.fullLabel || slice.label)\"\n (click)=\"\n valueClicked.emit({\n key: [slice.key],\n label: slice.fullLabel || slice.label,\n value: slice.value,\n })\n \"\n >\n {{ slice.value }}\n </span>\n </div>\n <p\n class=\"mt-0-25 percentage-info\"\n [attr.data-testid]=\"'bar-chart-tooltip-stack-percentage-' + (slice.fullLabel || slice.label)\"\n >\n {{ (100 * slice.value) / total() | number: '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n {{ slice.percentageOfStack | number: '1.0-2' }}% {{ tooltipPercentOf() }} \"{{ tooltipLabel() }}\"\n </p>\n }\n }\n </cng-chart-tooltip>\n }\n @if (loading() || !data()?.length || allValuesZero()) {\n <cng-bar-chart-skeleton\n data-testid=\"bar-chart-skeleton\"\n [orientation]=\"orientation()\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n />\n }\n @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"bar-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length && !allValuesZero()) {\n <cng-chart-legend data-testid=\"bar-chart-legend\" [items]=\"legendItems()\" />\n }\n @if (showExportButton() && !loading() && data()?.length) {\n <cng-chart-export-button\n data-testid=\"bar-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100
|
|
1101
|
+
args: [{ selector: 'clr-bar-chart', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"chart-container\" data-testid=\"bar-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"bar-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !data()?.length || allValuesZero()\" #chart></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"bar-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"!stacks() ? selectedItem()?.color : undefined\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"valueClicked.emit({ key: tooltipKey(), label: tooltipLabel(), value: tooltipValue() })\"\n >\n <ng-container ngProjectAs=\"cng-title\"> ({{ tooltipValue() }}) {{ tooltipLabel() }}</ng-container>\n\n <p class=\"mt-0\" data-testid=\"bar-chart-tooltip-percentage\">\n {{ (100 * tooltipValue()) / total() | number: '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n\n @if (stacks()) {\n @for (slice of selectedStackSlices(); track slice.key) {\n <div\n class=\"mt-0-5 d-flex\"\n [attr.data-testid]=\"'bar-chart-tooltip-stack-slice-' + (slice.fullLabel || slice.label)\"\n >\n <div class=\"color-square mr-0-5\" [style.background-color]=\"toChartColor(slice.color)\"></div>\n <strong>{{ slice.fullLabel || slice.label }}: </strong>\n <span\n class=\"has-more-info\"\n [attr.data-testid]=\"'bar-chart-tooltip-stack-value-' + (slice.fullLabel || slice.label)\"\n (click)=\"\n valueClicked.emit({\n key: [slice.key],\n label: slice.fullLabel || slice.label,\n value: slice.value,\n })\n \"\n >\n {{ slice.value }}\n </span>\n </div>\n <p\n class=\"mt-0-25 percentage-info\"\n [attr.data-testid]=\"'bar-chart-tooltip-stack-percentage-' + (slice.fullLabel || slice.label)\"\n >\n {{ (100 * slice.value) / total() | number: '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n {{ slice.percentageOfStack | number: '1.0-2' }}% {{ tooltipPercentOf() }} \"{{ tooltipLabel() }}\"\n </p>\n }\n }\n </cng-chart-tooltip>\n }\n @if (loading() || !data()?.length || allValuesZero()) {\n <cng-bar-chart-skeleton\n data-testid=\"bar-chart-skeleton\"\n [orientation]=\"orientation()\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n />\n }\n @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"bar-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length && !allValuesZero()) {\n <cng-chart-legend data-testid=\"bar-chart-legend\" [items]=\"legendItems()\" />\n }\n @if (showExportButton() && !loading() && data()?.length) {\n <cng-chart-export-button\n data-testid=\"bar-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100%;position:absolute;inset:0}cng-bar-chart-skeleton{height:100%}.percentage-info{margin-left:15px}\n"] }]
|
|
1071
1102
|
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], stacks: [{ type: i0.Input, args: [{ isSignal: true, alias: "stacks", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: true }] }], tooltipOrientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOrientation", required: false }] }], barSizePx: [{ type: i0.Input, args: [{ isSignal: true, alias: "barSizePx", required: false }] }], barAreaSizePx: [{ type: i0.Input, args: [{ isSignal: true, alias: "barAreaSizePx", required: false }] }], tooltipPercentOfTotal: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPercentOfTotal", required: false }] }], tooltipPercentOf: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPercentOf", required: false }] }], noItemsMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noItemsMessage", required: false }] }], tooManyItemsMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooManyItemsMessage", required: false }] }], tooManyItemsGroupedMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooManyItemsGroupedMessage", required: false }] }], allValuesZeroMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "allValuesZeroMessage", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], showExportButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExportButton", required: false }] }], exportButtonTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportButtonTitle", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], xAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "xAxisLabel", required: false }] }], yAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAxisLabel", required: false }] }], valueClicked: [{ type: i0.Output, args: ["valueClicked"] }] } });
|
|
1072
1103
|
|
|
1073
1104
|
class GroupedBarChartComponent extends ChartBase {
|
|
@@ -1085,6 +1116,8 @@ class GroupedBarChartComponent extends ChartBase {
|
|
|
1085
1116
|
this.tooManyItemsGroupedMessage = input(TOO_MANY_ITEMS_GROUPED_MESSAGE, ...(ngDevMode ? [{ debugName: "tooManyItemsGroupedMessage" }] : /* istanbul ignore next */ []));
|
|
1086
1117
|
this.allValuesZeroMessage = input(ALL_ITEMS_ZERO_MESSAGE, ...(ngDevMode ? [{ debugName: "allValuesZeroMessage" }] : /* istanbul ignore next */ []));
|
|
1087
1118
|
this.showLegend = input(true, ...(ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []));
|
|
1119
|
+
this.showValues = input(false, ...(ngDevMode ? [{ debugName: "showValues" }] : /* istanbul ignore next */ []));
|
|
1120
|
+
this.showValueOnHover = input(false, ...(ngDevMode ? [{ debugName: "showValueOnHover" }] : /* istanbul ignore next */ []));
|
|
1088
1121
|
this.showExportButton = input(false, ...(ngDevMode ? [{ debugName: "showExportButton" }] : /* istanbul ignore next */ []));
|
|
1089
1122
|
this.exportButtonTitle = input('Export', ...(ngDevMode ? [{ debugName: "exportButtonTitle" }] : /* istanbul ignore next */ []));
|
|
1090
1123
|
this.exportFilename = input('grouped-bar-chart', ...(ngDevMode ? [{ debugName: "exportFilename" }] : /* istanbul ignore next */ []));
|
|
@@ -1134,6 +1167,7 @@ class GroupedBarChartComponent extends ChartBase {
|
|
|
1134
1167
|
this.totalGroupCount = signal(0, ...(ngDevMode ? [{ debugName: "totalGroupCount" }] : /* istanbul ignore next */ []));
|
|
1135
1168
|
this.showingGroupCount = signal(0, ...(ngDevMode ? [{ debugName: "showingGroupCount" }] : /* istanbul ignore next */ []));
|
|
1136
1169
|
this.slicedDataPoints = signal([], ...(ngDevMode ? [{ debugName: "slicedDataPoints" }] : /* istanbul ignore next */ []));
|
|
1170
|
+
this.hoveredValueKey = signal(undefined, ...(ngDevMode ? [{ debugName: "hoveredValueKey" }] : /* istanbul ignore next */ []));
|
|
1137
1171
|
this.barSelection = null;
|
|
1138
1172
|
this.labelSelection = null;
|
|
1139
1173
|
}
|
|
@@ -1152,6 +1186,7 @@ class GroupedBarChartComponent extends ChartBase {
|
|
|
1152
1186
|
}
|
|
1153
1187
|
updateChart() {
|
|
1154
1188
|
this.svg.selectAll('*').remove();
|
|
1189
|
+
this.hoveredValueKey.set(undefined);
|
|
1155
1190
|
if (this.loading()) {
|
|
1156
1191
|
this.resetVisibleState();
|
|
1157
1192
|
return;
|
|
@@ -1231,6 +1266,7 @@ class GroupedBarChartComponent extends ChartBase {
|
|
|
1231
1266
|
this.addVerticalBarRectangle(x0, x1, y)
|
|
1232
1267
|
.attr('class', 'bar')
|
|
1233
1268
|
.style('fill', (d) => toChartColor(d.color));
|
|
1269
|
+
this.addVerticalValueLabels(g, x0, x1, y);
|
|
1234
1270
|
this.appendAxisLabel(g, xAxisLabel, width / 2, height + 40);
|
|
1235
1271
|
this.appendAxisLabel(g, yAxisLabel, -height / 2, -(leftMargin - 10), 'rotate(-90)');
|
|
1236
1272
|
}
|
|
@@ -1269,6 +1305,7 @@ class GroupedBarChartComponent extends ChartBase {
|
|
|
1269
1305
|
this.addHorizontalBarRectangle(x, y0, y1)
|
|
1270
1306
|
.attr('class', 'bar')
|
|
1271
1307
|
.style('fill', (d) => toChartColor(d.color));
|
|
1308
|
+
this.addHorizontalValueLabels(g, x, y0, y1);
|
|
1272
1309
|
this.appendAxisLabel(g, xAxisLabel, width / 2, height + 40);
|
|
1273
1310
|
this.appendAxisLabel(g, yAxisLabel, -height / 2, -(leftMargin - this.yAxisLabelWidthPx() / 2), 'rotate(-90)');
|
|
1274
1311
|
}
|
|
@@ -1279,10 +1316,73 @@ class GroupedBarChartComponent extends ChartBase {
|
|
|
1279
1316
|
.join('g')
|
|
1280
1317
|
.attr('class', 'bar-group')
|
|
1281
1318
|
.style('cursor', 'pointer')
|
|
1282
|
-
.on('mouseover', (_event, d) =>
|
|
1283
|
-
|
|
1319
|
+
.on('mouseover', (_event, d) => {
|
|
1320
|
+
this.setHoverStyles(d, true);
|
|
1321
|
+
if (this.showValueOnHover()) {
|
|
1322
|
+
this.hoveredValueKey.set(d.key);
|
|
1323
|
+
this.updateHoveredValueLabels();
|
|
1324
|
+
}
|
|
1325
|
+
})
|
|
1326
|
+
.on('mouseout', (_event, d) => {
|
|
1327
|
+
this.setHoverStyles(d, false);
|
|
1328
|
+
if (this.showValueOnHover()) {
|
|
1329
|
+
this.hoveredValueKey.set(undefined);
|
|
1330
|
+
this.updateHoveredValueLabels();
|
|
1331
|
+
}
|
|
1332
|
+
})
|
|
1284
1333
|
.call(this.addBarClickHandler.bind(this));
|
|
1285
1334
|
}
|
|
1335
|
+
addHorizontalValueLabels(g, x, y0, y1) {
|
|
1336
|
+
if (!this.showValues() && !this.showValueOnHover()) {
|
|
1337
|
+
return;
|
|
1338
|
+
}
|
|
1339
|
+
const barHeight = Math.max(0, Math.min(this.barSizePx(), y1.bandwidth()));
|
|
1340
|
+
const yOffset = (y1.bandwidth() - barHeight) / 2;
|
|
1341
|
+
g.selectAll('.value-label')
|
|
1342
|
+
.data(this.slicedDataPoints(), (d) => d.key)
|
|
1343
|
+
.join('text')
|
|
1344
|
+
.attr('class', 'value-label')
|
|
1345
|
+
.attr('x', (d) => x(d.value) + 5)
|
|
1346
|
+
.attr('y', (d) => {
|
|
1347
|
+
return (y0(d.groupKey) || 0) + (y1(d.fullLabel ?? d.label) || 0) + yOffset + barHeight / 2;
|
|
1348
|
+
})
|
|
1349
|
+
.attr('dominant-baseline', 'middle')
|
|
1350
|
+
.attr('text-anchor', 'start')
|
|
1351
|
+
.call(this.addValueLabelStyles.bind(this));
|
|
1352
|
+
}
|
|
1353
|
+
addVerticalValueLabels(g, x0, x1, y) {
|
|
1354
|
+
if (!this.showValues() && !this.showValueOnHover()) {
|
|
1355
|
+
return;
|
|
1356
|
+
}
|
|
1357
|
+
const barWidth = Math.max(0, Math.min(this.barSizePx(), x1.bandwidth()));
|
|
1358
|
+
const xOffset = (x1.bandwidth() - barWidth) / 2;
|
|
1359
|
+
g.selectAll('.value-label')
|
|
1360
|
+
.data(this.slicedDataPoints(), (d) => d.key)
|
|
1361
|
+
.join('text')
|
|
1362
|
+
.attr('class', 'value-label')
|
|
1363
|
+
.attr('x', (d) => {
|
|
1364
|
+
return (x0(d.groupKey) || 0) + (x1(d.fullLabel ?? d.label) || 0) + xOffset + barWidth / 2;
|
|
1365
|
+
})
|
|
1366
|
+
.attr('y', (d) => y(d.value) - 6)
|
|
1367
|
+
.attr('text-anchor', 'middle')
|
|
1368
|
+
.call(this.addValueLabelStyles.bind(this));
|
|
1369
|
+
}
|
|
1370
|
+
addValueLabelStyles(g) {
|
|
1371
|
+
g.style('font-size', '11px')
|
|
1372
|
+
.style('font-weight', '600')
|
|
1373
|
+
.style('fill', (d) => toChartColor(d.color))
|
|
1374
|
+
.attr('stroke', '#fff')
|
|
1375
|
+
.attr('stroke-width', 3)
|
|
1376
|
+
.attr('paint-order', 'stroke fill')
|
|
1377
|
+
.style('pointer-events', 'none')
|
|
1378
|
+
.style('opacity', (d) => this.showValues() || this.hoveredValueKey() === d.key ? '1' : '0')
|
|
1379
|
+
.text((d) => format('~s')(d.value));
|
|
1380
|
+
}
|
|
1381
|
+
updateHoveredValueLabels() {
|
|
1382
|
+
this.svg
|
|
1383
|
+
.selectAll('.value-label')
|
|
1384
|
+
.style('opacity', (d) => this.showValues() || this.hoveredValueKey() === d.key ? '1' : '0');
|
|
1385
|
+
}
|
|
1286
1386
|
addHorizontalBarRectangle(x, y0, y1, outlineSize = 0) {
|
|
1287
1387
|
const barHeight = Math.max(0, Math.min(this.barSizePx(), y1.bandwidth()));
|
|
1288
1388
|
const yOffset = (y1.bandwidth() - barHeight) / 2;
|
|
@@ -1417,12 +1517,12 @@ class GroupedBarChartComponent extends ChartBase {
|
|
|
1417
1517
|
this.slicedDataPoints.set([]);
|
|
1418
1518
|
}
|
|
1419
1519
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: GroupedBarChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1420
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: GroupedBarChartComponent, isStandalone: false, selector: "clr-grouped-bar-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, groups: { classPropertyName: "groups", publicName: "groups", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, tooltipOrientation: { classPropertyName: "tooltipOrientation", publicName: "tooltipOrientation", isSignal: true, isRequired: false, transformFunction: null }, barSizePx: { classPropertyName: "barSizePx", publicName: "barSizePx", isSignal: true, isRequired: false, transformFunction: null }, groupAreaSizePx: { classPropertyName: "groupAreaSizePx", publicName: "groupAreaSizePx", isSignal: true, isRequired: false, transformFunction: null }, yAxisLabelWidthPx: { classPropertyName: "yAxisLabelWidthPx", publicName: "yAxisLabelWidthPx", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooManyItemsGroupedMessage: { classPropertyName: "tooManyItemsGroupedMessage", publicName: "tooManyItemsGroupedMessage", isSignal: true, isRequired: false, transformFunction: null }, allValuesZeroMessage: { classPropertyName: "allValuesZeroMessage", publicName: "allValuesZeroMessage", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, xAxisLabel: { classPropertyName: "xAxisLabel", publicName: "xAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yAxisLabel: { classPropertyName: "yAxisLabel", publicName: "yAxisLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-container\">\n <div class=\"chart-area\" #container (cngWindowResize)=\"updateChart()\" [class.pt-3]=\"alertMessageAndType()\">\n <svg\n [class.d-none]=\"loading() || !data()?.length || allValuesZero()\"\n #chart\n role=\"img\"\n [attr.aria-label]=\"xAxisLabel() || yAxisLabel() ? yAxisLabel() + ' by ' + xAxisLabel() : 'Grouped bar chart'\"\n ></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedItem()?.color\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"emitSelectedValue()\"\n >\n <ng-container ngProjectAs=\"cng-title\">({{ selectedItem()?.value }}) {{ tooltipLabel() }}</ng-container>\n\n <p class=\"mt-0\">\n <strong>{{ selectedItem()?.groupLabel }}</strong>\n </p>\n </cng-chart-tooltip>\n }\n @if (loading() || !data()?.length || allValuesZero()) {\n <cng-bar-chart-skeleton [orientation]=\"orientation()\" [skeletonType]=\"loading() ? 'loading' : 'placeholder'\" />\n }\n @if (alertMessageAndType()) {\n <cng-chart-alert-overlay [alertType]=\"alertMessageAndType()[1]\" [alertMessage]=\"alertMessageAndType()[0]\" />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length && !allValuesZero()) {\n <cng-chart-legend [items]=\"legendItems()\" />\n }\n @if (showExportButton() && !loading() && data()?.length) {\n <cng-chart-export-button\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100%}cng-bar-chart-skeleton{height:100%}\n"], dependencies: [{ kind: "component", type: ChartAlertOverlayComponent, selector: "cng-chart-alert-overlay", inputs: ["alertMessage", "alertType"] }, { kind: "component", type: ChartExportButtonComponent, selector: "cng-chart-export-button", inputs: ["svgRef", "filename", "buttonTitle", "legendItems"] }, { kind: "component", type: ChartLegendComponent, selector: "cng-chart-legend", inputs: ["items"] }, { kind: "component", type: ChartSkeletonComponent, selector: "cng-bar-chart-skeleton", inputs: ["skeletonType", "orientation"] }, { kind: "component", type: ChartTooltipComponent, selector: "cng-chart-tooltip", inputs: ["tooltipPosition", "tooltipOrientation", "squareColor", "tooltipClickable"], outputs: ["tooltipClosed", "tooltipHeaderClicked"] }, { kind: "directive", type: OutsideClickDirective, selector: "[cngOutsideClick]", outputs: ["cngOutsideClick"] }, { kind: "directive", type: WindowResizeDirective, selector: "[cngWindowResize]", inputs: ["debounce", "includeFirst"], outputs: ["cngWindowResize"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1520
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: GroupedBarChartComponent, isStandalone: false, selector: "clr-grouped-bar-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, groups: { classPropertyName: "groups", publicName: "groups", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, tooltipOrientation: { classPropertyName: "tooltipOrientation", publicName: "tooltipOrientation", isSignal: true, isRequired: false, transformFunction: null }, barSizePx: { classPropertyName: "barSizePx", publicName: "barSizePx", isSignal: true, isRequired: false, transformFunction: null }, groupAreaSizePx: { classPropertyName: "groupAreaSizePx", publicName: "groupAreaSizePx", isSignal: true, isRequired: false, transformFunction: null }, yAxisLabelWidthPx: { classPropertyName: "yAxisLabelWidthPx", publicName: "yAxisLabelWidthPx", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooManyItemsGroupedMessage: { classPropertyName: "tooManyItemsGroupedMessage", publicName: "tooManyItemsGroupedMessage", isSignal: true, isRequired: false, transformFunction: null }, allValuesZeroMessage: { classPropertyName: "allValuesZeroMessage", publicName: "allValuesZeroMessage", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, showValues: { classPropertyName: "showValues", publicName: "showValues", isSignal: true, isRequired: false, transformFunction: null }, showValueOnHover: { classPropertyName: "showValueOnHover", publicName: "showValueOnHover", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, xAxisLabel: { classPropertyName: "xAxisLabel", publicName: "xAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yAxisLabel: { classPropertyName: "yAxisLabel", publicName: "yAxisLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-container\">\n <div class=\"chart-area\" #container (cngWindowResize)=\"updateChart()\" [class.pt-3]=\"alertMessageAndType()\">\n <svg\n [class.d-none]=\"loading() || !data()?.length || allValuesZero()\"\n #chart\n role=\"img\"\n [attr.aria-label]=\"xAxisLabel() || yAxisLabel() ? yAxisLabel() + ' by ' + xAxisLabel() : 'Grouped bar chart'\"\n ></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedItem()?.color\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"emitSelectedValue()\"\n >\n <ng-container ngProjectAs=\"cng-title\">({{ selectedItem()?.value }}) {{ tooltipLabel() }}</ng-container>\n\n <p class=\"mt-0\">\n <strong>{{ selectedItem()?.groupLabel }}</strong>\n </p>\n </cng-chart-tooltip>\n }\n @if (loading() || !data()?.length || allValuesZero()) {\n <cng-bar-chart-skeleton [orientation]=\"orientation()\" [skeletonType]=\"loading() ? 'loading' : 'placeholder'\" />\n }\n @if (alertMessageAndType()) {\n <cng-chart-alert-overlay [alertType]=\"alertMessageAndType()[1]\" [alertMessage]=\"alertMessageAndType()[0]\" />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length && !allValuesZero()) {\n <cng-chart-legend [items]=\"legendItems()\" />\n }\n @if (showExportButton() && !loading() && data()?.length) {\n <cng-chart-export-button\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100%}cng-bar-chart-skeleton{height:100%}\n"], dependencies: [{ kind: "component", type: ChartAlertOverlayComponent, selector: "cng-chart-alert-overlay", inputs: ["alertMessage", "alertType"] }, { kind: "component", type: ChartExportButtonComponent, selector: "cng-chart-export-button", inputs: ["svgRef", "filename", "buttonTitle", "legendItems"] }, { kind: "component", type: ChartLegendComponent, selector: "cng-chart-legend", inputs: ["items", "hoveredIndex", "loading", "orientation"], outputs: ["itemHover", "clicked"] }, { kind: "component", type: ChartSkeletonComponent, selector: "cng-bar-chart-skeleton", inputs: ["skeletonType", "orientation"] }, { kind: "component", type: ChartTooltipComponent, selector: "cng-chart-tooltip", inputs: ["tooltipPosition", "tooltipOrientation", "squareColor", "tooltipClickable"], outputs: ["tooltipClosed", "tooltipHeaderClicked"] }, { kind: "directive", type: OutsideClickDirective, selector: "[cngOutsideClick]", outputs: ["cngOutsideClick"] }, { kind: "directive", type: WindowResizeDirective, selector: "[cngWindowResize]", inputs: ["debounce", "includeFirst"], outputs: ["cngWindowResize"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1421
1521
|
}
|
|
1422
1522
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: GroupedBarChartComponent, decorators: [{
|
|
1423
1523
|
type: Component,
|
|
1424
1524
|
args: [{ selector: 'clr-grouped-bar-chart', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"chart-container\">\n <div class=\"chart-area\" #container (cngWindowResize)=\"updateChart()\" [class.pt-3]=\"alertMessageAndType()\">\n <svg\n [class.d-none]=\"loading() || !data()?.length || allValuesZero()\"\n #chart\n role=\"img\"\n [attr.aria-label]=\"xAxisLabel() || yAxisLabel() ? yAxisLabel() + ' by ' + xAxisLabel() : 'Grouped bar chart'\"\n ></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedItem()?.color\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"emitSelectedValue()\"\n >\n <ng-container ngProjectAs=\"cng-title\">({{ selectedItem()?.value }}) {{ tooltipLabel() }}</ng-container>\n\n <p class=\"mt-0\">\n <strong>{{ selectedItem()?.groupLabel }}</strong>\n </p>\n </cng-chart-tooltip>\n }\n @if (loading() || !data()?.length || allValuesZero()) {\n <cng-bar-chart-skeleton [orientation]=\"orientation()\" [skeletonType]=\"loading() ? 'loading' : 'placeholder'\" />\n }\n @if (alertMessageAndType()) {\n <cng-chart-alert-overlay [alertType]=\"alertMessageAndType()[1]\" [alertMessage]=\"alertMessageAndType()[0]\" />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length && !allValuesZero()) {\n <cng-chart-legend [items]=\"legendItems()\" />\n }\n @if (showExportButton() && !loading() && data()?.length) {\n <cng-chart-export-button\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100%}cng-bar-chart-skeleton{height:100%}\n"] }]
|
|
1425
|
-
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], groups: [{ type: i0.Input, args: [{ isSignal: true, alias: "groups", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], tooltipOrientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOrientation", required: false }] }], barSizePx: [{ type: i0.Input, args: [{ isSignal: true, alias: "barSizePx", required: false }] }], groupAreaSizePx: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupAreaSizePx", required: false }] }], yAxisLabelWidthPx: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAxisLabelWidthPx", required: false }] }], noItemsMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noItemsMessage", required: false }] }], tooManyItemsGroupedMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooManyItemsGroupedMessage", required: false }] }], allValuesZeroMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "allValuesZeroMessage", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], showExportButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExportButton", required: false }] }], exportButtonTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportButtonTitle", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], xAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "xAxisLabel", required: false }] }], yAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAxisLabel", required: false }] }], valueClicked: [{ type: i0.Output, args: ["valueClicked"] }] } });
|
|
1525
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], groups: [{ type: i0.Input, args: [{ isSignal: true, alias: "groups", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], tooltipOrientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOrientation", required: false }] }], barSizePx: [{ type: i0.Input, args: [{ isSignal: true, alias: "barSizePx", required: false }] }], groupAreaSizePx: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupAreaSizePx", required: false }] }], yAxisLabelWidthPx: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAxisLabelWidthPx", required: false }] }], noItemsMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noItemsMessage", required: false }] }], tooManyItemsGroupedMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooManyItemsGroupedMessage", required: false }] }], allValuesZeroMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "allValuesZeroMessage", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], showValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValues", required: false }] }], showValueOnHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValueOnHover", required: false }] }], showExportButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExportButton", required: false }] }], exportButtonTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportButtonTitle", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], xAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "xAxisLabel", required: false }] }], yAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAxisLabel", required: false }] }], valueClicked: [{ type: i0.Output, args: ["valueClicked"] }] } });
|
|
1426
1526
|
|
|
1427
1527
|
/*
|
|
1428
1528
|
* Copyright (c) 2018-2026 Porsche Informatik. All Rights Reserved.
|
|
@@ -1436,7 +1536,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
1436
1536
|
* - Calls `onClick` with the clicked element, data point and series when a dot is clicked.
|
|
1437
1537
|
*
|
|
1438
1538
|
*/
|
|
1439
|
-
function renderDots(g, series, x, y, onClick) {
|
|
1539
|
+
function renderDots(g, series, x, y, onClick, onHover, onHoverEnd) {
|
|
1440
1540
|
g.selectAll(`.dot-${series.key}`)
|
|
1441
1541
|
.data(series.data, (d) => d.x)
|
|
1442
1542
|
.join('circle')
|
|
@@ -1448,11 +1548,13 @@ function renderDots(g, series, x, y, onClick) {
|
|
|
1448
1548
|
.attr('stroke', '#fff')
|
|
1449
1549
|
.attr('stroke-width', 2)
|
|
1450
1550
|
.style('cursor', 'pointer')
|
|
1451
|
-
.on('mouseover', (e) => {
|
|
1551
|
+
.on('mouseover', (e, d) => {
|
|
1452
1552
|
select(e.currentTarget).attr('r', 6);
|
|
1553
|
+
onHover?.(d, series);
|
|
1453
1554
|
})
|
|
1454
1555
|
.on('mouseout', (e) => {
|
|
1455
1556
|
select(e.currentTarget).attr('r', 4);
|
|
1557
|
+
onHoverEnd?.();
|
|
1456
1558
|
})
|
|
1457
1559
|
.on('click', (event, d) => {
|
|
1458
1560
|
event.stopPropagation();
|
|
@@ -1558,6 +1660,7 @@ class LineChartComponent extends ChartBase {
|
|
|
1558
1660
|
this.showArea = input(false, ...(ngDevMode ? [{ debugName: "showArea" }] : /* istanbul ignore next */ []));
|
|
1559
1661
|
this.showLegend = input(true, ...(ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []));
|
|
1560
1662
|
this.showValues = input(false, ...(ngDevMode ? [{ debugName: "showValues" }] : /* istanbul ignore next */ []));
|
|
1663
|
+
this.showValueOnHover = input(false, ...(ngDevMode ? [{ debugName: "showValueOnHover" }] : /* istanbul ignore next */ []));
|
|
1561
1664
|
this.showExportButton = input(false, ...(ngDevMode ? [{ debugName: "showExportButton" }] : /* istanbul ignore next */ []));
|
|
1562
1665
|
this.exportButtonTitle = input('Export', ...(ngDevMode ? [{ debugName: "exportButtonTitle" }] : /* istanbul ignore next */ []));
|
|
1563
1666
|
this.exportFilename = input('line-chart', ...(ngDevMode ? [{ debugName: "exportFilename" }] : /* istanbul ignore next */ []));
|
|
@@ -1588,6 +1691,7 @@ class LineChartComponent extends ChartBase {
|
|
|
1588
1691
|
}
|
|
1589
1692
|
return this.series().map(s => ({ label: s.label, color: s.color }));
|
|
1590
1693
|
}, ...(ngDevMode ? [{ debugName: "legendItems" }] : /* istanbul ignore next */ []));
|
|
1694
|
+
this.hoveredValueKey = signal(undefined, ...(ngDevMode ? [{ debugName: "hoveredValueKey" }] : /* istanbul ignore next */ []));
|
|
1591
1695
|
}
|
|
1592
1696
|
ngOnChanges(_changes) {
|
|
1593
1697
|
if (!this.svg) {
|
|
@@ -1601,6 +1705,7 @@ class LineChartComponent extends ChartBase {
|
|
|
1601
1705
|
}
|
|
1602
1706
|
updateChart() {
|
|
1603
1707
|
this.svg.selectAll('*').remove();
|
|
1708
|
+
this.hoveredValueKey.set(undefined);
|
|
1604
1709
|
if (this.loading()) {
|
|
1605
1710
|
return;
|
|
1606
1711
|
}
|
|
@@ -1670,15 +1775,15 @@ class LineChartComponent extends ChartBase {
|
|
|
1670
1775
|
.attr('stroke-linecap', 'round')
|
|
1671
1776
|
.attr('d', lineGenerator);
|
|
1672
1777
|
// Dots
|
|
1673
|
-
renderDots(g, series, x, y, (el, point, s) => this.openTooltip(el, point, s));
|
|
1674
|
-
|
|
1675
|
-
if (this.showValues()) {
|
|
1778
|
+
renderDots(g, series, x, y, (el, point, s) => this.openTooltip(el, point, s), point => this.setHoveredValueKey(this.getValueKey(series.key, point.x)), () => this.setHoveredValueKey(undefined));
|
|
1779
|
+
if (this.showValues() || this.showValueOnHover()) {
|
|
1676
1780
|
g.selectAll(`.value-label-${series.key}`)
|
|
1677
1781
|
.data(series.data, (d) => d.x)
|
|
1678
1782
|
.join('text')
|
|
1679
1783
|
.attr('class', `value-label value-label-${series.key}`)
|
|
1680
1784
|
.attr('x', (d) => x(d.x) ?? 0)
|
|
1681
1785
|
.attr('y', (d) => y(d.value) - 9)
|
|
1786
|
+
.attr('data-value-key', (d) => this.getValueKey(series.key, d.x))
|
|
1682
1787
|
.attr('text-anchor', 'middle')
|
|
1683
1788
|
.style('font-size', '11px')
|
|
1684
1789
|
.style('font-weight', '600')
|
|
@@ -1687,10 +1792,26 @@ class LineChartComponent extends ChartBase {
|
|
|
1687
1792
|
.attr('stroke-width', 3)
|
|
1688
1793
|
.attr('paint-order', 'stroke fill')
|
|
1689
1794
|
.style('pointer-events', 'none')
|
|
1795
|
+
.style('opacity', (d) => this.showValues() || this.hoveredValueKey() === this.getValueKey(series.key, d.x) ? '1' : '0')
|
|
1690
1796
|
.text((d) => format('~s')(d.value));
|
|
1691
1797
|
}
|
|
1692
1798
|
}
|
|
1693
1799
|
}
|
|
1800
|
+
getValueKey(seriesKey, x) {
|
|
1801
|
+
return `${seriesKey}:${x}`;
|
|
1802
|
+
}
|
|
1803
|
+
setHoveredValueKey(key) {
|
|
1804
|
+
if (!this.showValueOnHover()) {
|
|
1805
|
+
return;
|
|
1806
|
+
}
|
|
1807
|
+
this.hoveredValueKey.set(key);
|
|
1808
|
+
this.updateHoveredValueLabels();
|
|
1809
|
+
}
|
|
1810
|
+
updateHoveredValueLabels() {
|
|
1811
|
+
this.svg.selectAll('.value-label').style('opacity', (_d, index, nodes) => {
|
|
1812
|
+
return this.showValues() || select(nodes[index]).attr('data-value-key') === this.hoveredValueKey() ? '1' : '0';
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1694
1815
|
openTooltip(el, point, series) {
|
|
1695
1816
|
const rect = el.getBoundingClientRect();
|
|
1696
1817
|
const container = this.chartRef().nativeElement.getBoundingClientRect();
|
|
@@ -1701,12 +1822,12 @@ class LineChartComponent extends ChartBase {
|
|
|
1701
1822
|
this.selectedItem.set({ ...point, seriesKey: series.key, seriesLabel: series.label, color: series.color });
|
|
1702
1823
|
}
|
|
1703
1824
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: LineChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1704
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: LineChartComponent, isStandalone: false, selector: "clr-line-chart", inputs: { series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: true, transformFunction: null }, tooltipOrientation: { classPropertyName: "tooltipOrientation", publicName: "tooltipOrientation", isSignal: true, isRequired: false, transformFunction: null }, showArea: { classPropertyName: "showArea", publicName: "showArea", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, showValues: { classPropertyName: "showValues", publicName: "showValues", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooltipPercentOfTotal: { classPropertyName: "tooltipPercentOfTotal", publicName: "tooltipPercentOfTotal", isSignal: true, isRequired: false, transformFunction: null }, xAxisLabel: { classPropertyName: "xAxisLabel", publicName: "xAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yAxisLabel: { classPropertyName: "yAxisLabel", publicName: "yAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yMin: { classPropertyName: "yMin", publicName: "yMin", isSignal: true, isRequired: false, transformFunction: null }, autoscaleYAxis: { classPropertyName: "autoscaleYAxis", publicName: "autoscaleYAxis", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-container\" data-testid=\"line-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"line-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"line-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedItem()?.color\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"\n valueClicked.emit({\n seriesKey: selectedItem().seriesKey,\n seriesLabel: selectedItem().seriesLabel,\n x: selectedItem().x,\n xLabel: selectedItem().xLabel,\n value: selectedItem().value,\n })\n \"\n >\n <ng-container ngProjectAs=\"cng-title\">\n ({{ selectedItem().value }}) {{ selectedItem().xLabel || selectedItem().x }}\n </ng-container>\n\n <p class=\"mt-0\" data-testid=\"line-chart-tooltip-series\">\n <strong>{{ selectedItem().seriesLabel }}:</strong>\n {{ selectedItem().value }}\n </p>\n <p class=\"mt-0\" data-testid=\"line-chart-tooltip-percentage\">\n {{ (100 * selectedItem().value) / total() | number : '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n </cng-chart-tooltip>\n } @if (loading() || !hasData()) {\n <cng-bar-chart-skeleton\n data-testid=\"line-chart-skeleton\"\n orientation=\"vertical\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n />\n } @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"line-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length) {\n <cng-chart-legend data-testid=\"line-chart-legend\" [items]=\"legendItems()\" />\n } @if (showExportButton() && !loading() && hasData()) {\n <cng-chart-export-button\n data-testid=\"line-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100%}cng-bar-chart-skeleton{height:100%}.line,.area{pointer-events:none}.dot{transition:r .1s ease}\n"], dependencies: [{ kind: "component", type: ChartAlertOverlayComponent, selector: "cng-chart-alert-overlay", inputs: ["alertMessage", "alertType"] }, { kind: "component", type: ChartExportButtonComponent, selector: "cng-chart-export-button", inputs: ["svgRef", "filename", "buttonTitle", "legendItems"] }, { kind: "component", type: ChartLegendComponent, selector: "cng-chart-legend", inputs: ["items"] }, { kind: "component", type: ChartSkeletonComponent, selector: "cng-bar-chart-skeleton", inputs: ["skeletonType", "orientation"] }, { kind: "component", type: ChartTooltipComponent, selector: "cng-chart-tooltip", inputs: ["tooltipPosition", "tooltipOrientation", "squareColor", "tooltipClickable"], outputs: ["tooltipClosed", "tooltipHeaderClicked"] }, { kind: "directive", type: OutsideClickDirective, selector: "[cngOutsideClick]", outputs: ["cngOutsideClick"] }, { kind: "directive", type: WindowResizeDirective, selector: "[cngWindowResize]", inputs: ["debounce", "includeFirst"], outputs: ["cngWindowResize"] }, { kind: "pipe", type: i8.DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1825
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: LineChartComponent, isStandalone: false, selector: "clr-line-chart", inputs: { series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: true, transformFunction: null }, tooltipOrientation: { classPropertyName: "tooltipOrientation", publicName: "tooltipOrientation", isSignal: true, isRequired: false, transformFunction: null }, showArea: { classPropertyName: "showArea", publicName: "showArea", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, showValues: { classPropertyName: "showValues", publicName: "showValues", isSignal: true, isRequired: false, transformFunction: null }, showValueOnHover: { classPropertyName: "showValueOnHover", publicName: "showValueOnHover", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooltipPercentOfTotal: { classPropertyName: "tooltipPercentOfTotal", publicName: "tooltipPercentOfTotal", isSignal: true, isRequired: false, transformFunction: null }, xAxisLabel: { classPropertyName: "xAxisLabel", publicName: "xAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yAxisLabel: { classPropertyName: "yAxisLabel", publicName: "yAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yMin: { classPropertyName: "yMin", publicName: "yMin", isSignal: true, isRequired: false, transformFunction: null }, autoscaleYAxis: { classPropertyName: "autoscaleYAxis", publicName: "autoscaleYAxis", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-container\" data-testid=\"line-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"line-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"line-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedItem()?.color\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"\n valueClicked.emit({\n seriesKey: selectedItem().seriesKey,\n seriesLabel: selectedItem().seriesLabel,\n x: selectedItem().x,\n xLabel: selectedItem().xLabel,\n value: selectedItem().value,\n })\n \"\n >\n <ng-container ngProjectAs=\"cng-title\">\n ({{ selectedItem().value }}) {{ selectedItem().xLabel || selectedItem().x }}\n </ng-container>\n\n <p class=\"mt-0\" data-testid=\"line-chart-tooltip-series\">\n <strong>{{ selectedItem().seriesLabel }}:</strong>\n {{ selectedItem().value }}\n </p>\n <p class=\"mt-0\" data-testid=\"line-chart-tooltip-percentage\">\n {{ (100 * selectedItem().value) / total() | number : '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n </cng-chart-tooltip>\n } @if (loading() || !hasData()) {\n <cng-bar-chart-skeleton\n data-testid=\"line-chart-skeleton\"\n orientation=\"vertical\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n />\n } @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"line-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length) {\n <cng-chart-legend data-testid=\"line-chart-legend\" [items]=\"legendItems()\" />\n } @if (showExportButton() && !loading() && hasData()) {\n <cng-chart-export-button\n data-testid=\"line-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100%}cng-bar-chart-skeleton{height:100%}.line,.area{pointer-events:none}.dot{transition:r .1s ease}\n"], dependencies: [{ kind: "component", type: ChartAlertOverlayComponent, selector: "cng-chart-alert-overlay", inputs: ["alertMessage", "alertType"] }, { kind: "component", type: ChartExportButtonComponent, selector: "cng-chart-export-button", inputs: ["svgRef", "filename", "buttonTitle", "legendItems"] }, { kind: "component", type: ChartLegendComponent, selector: "cng-chart-legend", inputs: ["items", "hoveredIndex", "loading", "orientation"], outputs: ["itemHover", "clicked"] }, { kind: "component", type: ChartSkeletonComponent, selector: "cng-bar-chart-skeleton", inputs: ["skeletonType", "orientation"] }, { kind: "component", type: ChartTooltipComponent, selector: "cng-chart-tooltip", inputs: ["tooltipPosition", "tooltipOrientation", "squareColor", "tooltipClickable"], outputs: ["tooltipClosed", "tooltipHeaderClicked"] }, { kind: "directive", type: OutsideClickDirective, selector: "[cngOutsideClick]", outputs: ["cngOutsideClick"] }, { kind: "directive", type: WindowResizeDirective, selector: "[cngWindowResize]", inputs: ["debounce", "includeFirst"], outputs: ["cngWindowResize"] }, { kind: "pipe", type: i8.DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1705
1826
|
}
|
|
1706
1827
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: LineChartComponent, decorators: [{
|
|
1707
1828
|
type: Component,
|
|
1708
1829
|
args: [{ selector: 'clr-line-chart', standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"chart-container\" data-testid=\"line-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"line-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"line-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedItem()?.color\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"\n valueClicked.emit({\n seriesKey: selectedItem().seriesKey,\n seriesLabel: selectedItem().seriesLabel,\n x: selectedItem().x,\n xLabel: selectedItem().xLabel,\n value: selectedItem().value,\n })\n \"\n >\n <ng-container ngProjectAs=\"cng-title\">\n ({{ selectedItem().value }}) {{ selectedItem().xLabel || selectedItem().x }}\n </ng-container>\n\n <p class=\"mt-0\" data-testid=\"line-chart-tooltip-series\">\n <strong>{{ selectedItem().seriesLabel }}:</strong>\n {{ selectedItem().value }}\n </p>\n <p class=\"mt-0\" data-testid=\"line-chart-tooltip-percentage\">\n {{ (100 * selectedItem().value) / total() | number : '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n </cng-chart-tooltip>\n } @if (loading() || !hasData()) {\n <cng-bar-chart-skeleton\n data-testid=\"line-chart-skeleton\"\n orientation=\"vertical\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n />\n } @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"line-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length) {\n <cng-chart-legend data-testid=\"line-chart-legend\" [items]=\"legendItems()\" />\n } @if (showExportButton() && !loading() && hasData()) {\n <cng-chart-export-button\n data-testid=\"line-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100%}cng-bar-chart-skeleton{height:100%}.line,.area{pointer-events:none}.dot{transition:r .1s ease}\n"] }]
|
|
1709
|
-
}], propDecorators: { series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: true }] }], tooltipOrientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOrientation", required: false }] }], showArea: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArea", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], showValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValues", required: false }] }], showExportButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExportButton", required: false }] }], exportButtonTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportButtonTitle", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], noItemsMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noItemsMessage", required: false }] }], tooltipPercentOfTotal: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPercentOfTotal", required: false }] }], xAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "xAxisLabel", required: false }] }], yAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAxisLabel", required: false }] }], yMin: [{ type: i0.Input, args: [{ isSignal: true, alias: "yMin", required: false }] }], autoscaleYAxis: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoscaleYAxis", required: false }] }], valueClicked: [{ type: i0.Output, args: ["valueClicked"] }] } });
|
|
1830
|
+
}], propDecorators: { series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: true }] }], tooltipOrientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOrientation", required: false }] }], showArea: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArea", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], showValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValues", required: false }] }], showValueOnHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValueOnHover", required: false }] }], showExportButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExportButton", required: false }] }], exportButtonTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportButtonTitle", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], noItemsMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noItemsMessage", required: false }] }], tooltipPercentOfTotal: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPercentOfTotal", required: false }] }], xAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "xAxisLabel", required: false }] }], yAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAxisLabel", required: false }] }], yMin: [{ type: i0.Input, args: [{ isSignal: true, alias: "yMin", required: false }] }], autoscaleYAxis: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoscaleYAxis", required: false }] }], valueClicked: [{ type: i0.Output, args: ["valueClicked"] }] } });
|
|
1710
1831
|
|
|
1711
1832
|
class AreaChartComponent extends ChartBase {
|
|
1712
1833
|
constructor() {
|
|
@@ -1838,7 +1959,7 @@ class AreaChartComponent extends ChartBase {
|
|
|
1838
1959
|
this.selectedItem.set({ ...point, seriesKey: series.key, seriesLabel: series.label, color: series.color });
|
|
1839
1960
|
}
|
|
1840
1961
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: AreaChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1841
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: AreaChartComponent, isStandalone: false, selector: "clr-area-chart", inputs: { series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: true, transformFunction: null }, tooltipOrientation: { classPropertyName: "tooltipOrientation", publicName: "tooltipOrientation", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, areaOpacity: { classPropertyName: "areaOpacity", publicName: "areaOpacity", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooltipPercentOfTotal: { classPropertyName: "tooltipPercentOfTotal", publicName: "tooltipPercentOfTotal", isSignal: true, isRequired: false, transformFunction: null }, xAxisLabel: { classPropertyName: "xAxisLabel", publicName: "xAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yAxisLabel: { classPropertyName: "yAxisLabel", publicName: "yAxisLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-container\" data-testid=\"area-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"area-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"area-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedItem()?.color\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"\n valueClicked.emit({\n seriesKey: selectedItem().seriesKey,\n seriesLabel: selectedItem().seriesLabel,\n x: selectedItem().x,\n xLabel: selectedItem().xLabel,\n value: selectedItem().value,\n })\n \"\n >\n <ng-container ngProjectAs=\"cng-title\">\n ({{ selectedItem().value }}) {{ selectedItem().xLabel || selectedItem().x }}\n </ng-container>\n\n <p class=\"mt-0\" data-testid=\"area-chart-tooltip-series\">\n <strong>{{ selectedItem().seriesLabel }}:</strong>\n {{ selectedItem().value }}\n </p>\n <p class=\"mt-0\" data-testid=\"area-chart-tooltip-percentage\">\n {{ (100 * selectedItem().value) / total() | number : '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n </cng-chart-tooltip>\n } @if (loading() || !hasData()) {\n <cng-bar-chart-skeleton\n data-testid=\"area-chart-skeleton\"\n orientation=\"vertical\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n />\n } @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"area-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length) {\n <cng-chart-legend data-testid=\"area-chart-legend\" [items]=\"legendItems()\" />\n } @if (showExportButton() && !loading() && hasData()) {\n <cng-chart-export-button\n data-testid=\"area-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100%}cng-bar-chart-skeleton{height:100%}.line,.area{pointer-events:none}.dot{transition:r .1s ease}\n"], dependencies: [{ kind: "component", type: ChartAlertOverlayComponent, selector: "cng-chart-alert-overlay", inputs: ["alertMessage", "alertType"] }, { kind: "component", type: ChartExportButtonComponent, selector: "cng-chart-export-button", inputs: ["svgRef", "filename", "buttonTitle", "legendItems"] }, { kind: "component", type: ChartLegendComponent, selector: "cng-chart-legend", inputs: ["items"] }, { kind: "component", type: ChartSkeletonComponent, selector: "cng-bar-chart-skeleton", inputs: ["skeletonType", "orientation"] }, { kind: "component", type: ChartTooltipComponent, selector: "cng-chart-tooltip", inputs: ["tooltipPosition", "tooltipOrientation", "squareColor", "tooltipClickable"], outputs: ["tooltipClosed", "tooltipHeaderClicked"] }, { kind: "directive", type: OutsideClickDirective, selector: "[cngOutsideClick]", outputs: ["cngOutsideClick"] }, { kind: "directive", type: WindowResizeDirective, selector: "[cngWindowResize]", inputs: ["debounce", "includeFirst"], outputs: ["cngWindowResize"] }, { kind: "pipe", type: i8.DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1962
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: AreaChartComponent, isStandalone: false, selector: "clr-area-chart", inputs: { series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: true, transformFunction: null }, tooltipOrientation: { classPropertyName: "tooltipOrientation", publicName: "tooltipOrientation", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, areaOpacity: { classPropertyName: "areaOpacity", publicName: "areaOpacity", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooltipPercentOfTotal: { classPropertyName: "tooltipPercentOfTotal", publicName: "tooltipPercentOfTotal", isSignal: true, isRequired: false, transformFunction: null }, xAxisLabel: { classPropertyName: "xAxisLabel", publicName: "xAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yAxisLabel: { classPropertyName: "yAxisLabel", publicName: "yAxisLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-container\" data-testid=\"area-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"area-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"area-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedItem()?.color\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"\n valueClicked.emit({\n seriesKey: selectedItem().seriesKey,\n seriesLabel: selectedItem().seriesLabel,\n x: selectedItem().x,\n xLabel: selectedItem().xLabel,\n value: selectedItem().value,\n })\n \"\n >\n <ng-container ngProjectAs=\"cng-title\">\n ({{ selectedItem().value }}) {{ selectedItem().xLabel || selectedItem().x }}\n </ng-container>\n\n <p class=\"mt-0\" data-testid=\"area-chart-tooltip-series\">\n <strong>{{ selectedItem().seriesLabel }}:</strong>\n {{ selectedItem().value }}\n </p>\n <p class=\"mt-0\" data-testid=\"area-chart-tooltip-percentage\">\n {{ (100 * selectedItem().value) / total() | number : '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n </cng-chart-tooltip>\n } @if (loading() || !hasData()) {\n <cng-bar-chart-skeleton\n data-testid=\"area-chart-skeleton\"\n orientation=\"vertical\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n />\n } @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"area-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length) {\n <cng-chart-legend data-testid=\"area-chart-legend\" [items]=\"legendItems()\" />\n } @if (showExportButton() && !loading() && hasData()) {\n <cng-chart-export-button\n data-testid=\"area-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100%}cng-bar-chart-skeleton{height:100%}.line,.area{pointer-events:none}.dot{transition:r .1s ease}\n"], dependencies: [{ kind: "component", type: ChartAlertOverlayComponent, selector: "cng-chart-alert-overlay", inputs: ["alertMessage", "alertType"] }, { kind: "component", type: ChartExportButtonComponent, selector: "cng-chart-export-button", inputs: ["svgRef", "filename", "buttonTitle", "legendItems"] }, { kind: "component", type: ChartLegendComponent, selector: "cng-chart-legend", inputs: ["items", "hoveredIndex", "loading", "orientation"], outputs: ["itemHover", "clicked"] }, { kind: "component", type: ChartSkeletonComponent, selector: "cng-bar-chart-skeleton", inputs: ["skeletonType", "orientation"] }, { kind: "component", type: ChartTooltipComponent, selector: "cng-chart-tooltip", inputs: ["tooltipPosition", "tooltipOrientation", "squareColor", "tooltipClickable"], outputs: ["tooltipClosed", "tooltipHeaderClicked"] }, { kind: "directive", type: OutsideClickDirective, selector: "[cngOutsideClick]", outputs: ["cngOutsideClick"] }, { kind: "directive", type: WindowResizeDirective, selector: "[cngWindowResize]", inputs: ["debounce", "includeFirst"], outputs: ["cngWindowResize"] }, { kind: "pipe", type: i8.DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1842
1963
|
}
|
|
1843
1964
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: AreaChartComponent, decorators: [{
|
|
1844
1965
|
type: Component,
|
|
@@ -2133,26 +2254,126 @@ class ComboChartComponent extends ChartBase {
|
|
|
2133
2254
|
}
|
|
2134
2255
|
}
|
|
2135
2256
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: ComboChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2136
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: ComboChartComponent, isStandalone: false, selector: "clr-combo-chart", inputs: { barSeries: { classPropertyName: "barSeries", publicName: "barSeries", isSignal: true, isRequired: false, transformFunction: null }, lineSeries: { classPropertyName: "lineSeries", publicName: "lineSeries", isSignal: true, isRequired: false, transformFunction: null }, tooltipOrientation: { classPropertyName: "tooltipOrientation", publicName: "tooltipOrientation", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooltipPercentOfTotal: { classPropertyName: "tooltipPercentOfTotal", publicName: "tooltipPercentOfTotal", isSignal: true, isRequired: false, transformFunction: null }, xAxisLabel: { classPropertyName: "xAxisLabel", publicName: "xAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yAxisLabel: { classPropertyName: "yAxisLabel", publicName: "yAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yLineAxisLabel: { classPropertyName: "yLineAxisLabel", publicName: "yLineAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yBarMax: { classPropertyName: "yBarMax", publicName: "yBarMax", isSignal: true, isRequired: false, transformFunction: null }, yLineMax: { classPropertyName: "yLineMax", publicName: "yLineMax", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-container\" data-testid=\"combo-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"combo-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"combo-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedItem()?.color\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"\n valueClicked.emit({\n seriesKey: selectedItem().seriesKey,\n seriesLabel: selectedItem().seriesLabel,\n seriesType: selectedItem().seriesType,\n x: selectedItem().x,\n xLabel: selectedItem().xLabel,\n value: selectedItem().value,\n })\n \"\n >\n <ng-container ngProjectAs=\"cng-title\">\n ({{ selectedItem().value }}) {{ selectedItem().xLabel || selectedItem().x }}\n </ng-container>\n\n <p class=\"mt-0\" data-testid=\"combo-chart-tooltip-series\">\n <strong>{{ selectedItem().seriesLabel }}:</strong>\n {{ selectedItem().value }}\n </p>\n <p class=\"mt-0\" data-testid=\"combo-chart-tooltip-percentage\">\n {{ (100 * selectedItem().value) / selectedItem().total | number : '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n </cng-chart-tooltip>\n } @if (loading() || !hasData()) {\n <cng-bar-chart-skeleton\n data-testid=\"combo-chart-skeleton\"\n orientation=\"vertical\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n />\n } @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"combo-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length) {\n <cng-chart-legend data-testid=\"combo-chart-legend\" [items]=\"legendItems()\" />\n } @if (showExportButton() && !loading() && hasData()) {\n <cng-chart-export-button\n data-testid=\"combo-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100%}cng-bar-chart-skeleton{height:100%}.combo-line{pointer-events:none}.combo-dot{transition:r .1s ease}\n"], dependencies: [{ kind: "component", type: ChartAlertOverlayComponent, selector: "cng-chart-alert-overlay", inputs: ["alertMessage", "alertType"] }, { kind: "component", type: ChartExportButtonComponent, selector: "cng-chart-export-button", inputs: ["svgRef", "filename", "buttonTitle", "legendItems"] }, { kind: "component", type: ChartLegendComponent, selector: "cng-chart-legend", inputs: ["items"] }, { kind: "component", type: ChartSkeletonComponent, selector: "cng-bar-chart-skeleton", inputs: ["skeletonType", "orientation"] }, { kind: "component", type: ChartTooltipComponent, selector: "cng-chart-tooltip", inputs: ["tooltipPosition", "tooltipOrientation", "squareColor", "tooltipClickable"], outputs: ["tooltipClosed", "tooltipHeaderClicked"] }, { kind: "directive", type: OutsideClickDirective, selector: "[cngOutsideClick]", outputs: ["cngOutsideClick"] }, { kind: "directive", type: WindowResizeDirective, selector: "[cngWindowResize]", inputs: ["debounce", "includeFirst"], outputs: ["cngWindowResize"] }, { kind: "pipe", type: i8.DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2257
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: ComboChartComponent, isStandalone: false, selector: "clr-combo-chart", inputs: { barSeries: { classPropertyName: "barSeries", publicName: "barSeries", isSignal: true, isRequired: false, transformFunction: null }, lineSeries: { classPropertyName: "lineSeries", publicName: "lineSeries", isSignal: true, isRequired: false, transformFunction: null }, tooltipOrientation: { classPropertyName: "tooltipOrientation", publicName: "tooltipOrientation", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooltipPercentOfTotal: { classPropertyName: "tooltipPercentOfTotal", publicName: "tooltipPercentOfTotal", isSignal: true, isRequired: false, transformFunction: null }, xAxisLabel: { classPropertyName: "xAxisLabel", publicName: "xAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yAxisLabel: { classPropertyName: "yAxisLabel", publicName: "yAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yLineAxisLabel: { classPropertyName: "yLineAxisLabel", publicName: "yLineAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, yBarMax: { classPropertyName: "yBarMax", publicName: "yBarMax", isSignal: true, isRequired: false, transformFunction: null }, yLineMax: { classPropertyName: "yLineMax", publicName: "yLineMax", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-container\" data-testid=\"combo-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"combo-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"combo-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedItem()?.color\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"\n valueClicked.emit({\n seriesKey: selectedItem().seriesKey,\n seriesLabel: selectedItem().seriesLabel,\n seriesType: selectedItem().seriesType,\n x: selectedItem().x,\n xLabel: selectedItem().xLabel,\n value: selectedItem().value,\n })\n \"\n >\n <ng-container ngProjectAs=\"cng-title\">\n ({{ selectedItem().value }}) {{ selectedItem().xLabel || selectedItem().x }}\n </ng-container>\n\n <p class=\"mt-0\" data-testid=\"combo-chart-tooltip-series\">\n <strong>{{ selectedItem().seriesLabel }}:</strong>\n {{ selectedItem().value }}\n </p>\n <p class=\"mt-0\" data-testid=\"combo-chart-tooltip-percentage\">\n {{ (100 * selectedItem().value) / selectedItem().total | number : '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n </cng-chart-tooltip>\n } @if (loading() || !hasData()) {\n <cng-bar-chart-skeleton\n data-testid=\"combo-chart-skeleton\"\n orientation=\"vertical\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n />\n } @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"combo-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length) {\n <cng-chart-legend data-testid=\"combo-chart-legend\" [items]=\"legendItems()\" />\n } @if (showExportButton() && !loading() && hasData()) {\n <cng-chart-export-button\n data-testid=\"combo-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100%}cng-bar-chart-skeleton{height:100%}.combo-line{pointer-events:none}.combo-dot{transition:r .1s ease}\n"], dependencies: [{ kind: "component", type: ChartAlertOverlayComponent, selector: "cng-chart-alert-overlay", inputs: ["alertMessage", "alertType"] }, { kind: "component", type: ChartExportButtonComponent, selector: "cng-chart-export-button", inputs: ["svgRef", "filename", "buttonTitle", "legendItems"] }, { kind: "component", type: ChartLegendComponent, selector: "cng-chart-legend", inputs: ["items", "hoveredIndex", "loading", "orientation"], outputs: ["itemHover", "clicked"] }, { kind: "component", type: ChartSkeletonComponent, selector: "cng-bar-chart-skeleton", inputs: ["skeletonType", "orientation"] }, { kind: "component", type: ChartTooltipComponent, selector: "cng-chart-tooltip", inputs: ["tooltipPosition", "tooltipOrientation", "squareColor", "tooltipClickable"], outputs: ["tooltipClosed", "tooltipHeaderClicked"] }, { kind: "directive", type: OutsideClickDirective, selector: "[cngOutsideClick]", outputs: ["cngOutsideClick"] }, { kind: "directive", type: WindowResizeDirective, selector: "[cngWindowResize]", inputs: ["debounce", "includeFirst"], outputs: ["cngWindowResize"] }, { kind: "pipe", type: i8.DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2137
2258
|
}
|
|
2138
2259
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: ComboChartComponent, decorators: [{
|
|
2139
2260
|
type: Component,
|
|
2140
2261
|
args: [{ selector: 'clr-combo-chart', standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"chart-container\" data-testid=\"combo-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"combo-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"combo-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedItem()?.color\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"\n valueClicked.emit({\n seriesKey: selectedItem().seriesKey,\n seriesLabel: selectedItem().seriesLabel,\n seriesType: selectedItem().seriesType,\n x: selectedItem().x,\n xLabel: selectedItem().xLabel,\n value: selectedItem().value,\n })\n \"\n >\n <ng-container ngProjectAs=\"cng-title\">\n ({{ selectedItem().value }}) {{ selectedItem().xLabel || selectedItem().x }}\n </ng-container>\n\n <p class=\"mt-0\" data-testid=\"combo-chart-tooltip-series\">\n <strong>{{ selectedItem().seriesLabel }}:</strong>\n {{ selectedItem().value }}\n </p>\n <p class=\"mt-0\" data-testid=\"combo-chart-tooltip-percentage\">\n {{ (100 * selectedItem().value) / selectedItem().total | number : '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n </cng-chart-tooltip>\n } @if (loading() || !hasData()) {\n <cng-bar-chart-skeleton\n data-testid=\"combo-chart-skeleton\"\n orientation=\"vertical\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n />\n } @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"combo-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && !loading() && legendItems().length) {\n <cng-chart-legend data-testid=\"combo-chart-legend\" [items]=\"legendItems()\" />\n } @if (showExportButton() && !loading() && hasData()) {\n <cng-chart-export-button\n data-testid=\"combo-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep .domain{display:none}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1;min-height:0;position:relative}svg{height:100%;width:100%}cng-bar-chart-skeleton{height:100%}.combo-line{pointer-events:none}.combo-dot{transition:r .1s ease}\n"] }]
|
|
2141
2262
|
}], propDecorators: { barSeries: [{ type: i0.Input, args: [{ isSignal: true, alias: "barSeries", required: false }] }], lineSeries: [{ type: i0.Input, args: [{ isSignal: true, alias: "lineSeries", required: false }] }], tooltipOrientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOrientation", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], showExportButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExportButton", required: false }] }], exportButtonTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportButtonTitle", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], noItemsMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noItemsMessage", required: false }] }], tooltipPercentOfTotal: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPercentOfTotal", required: false }] }], xAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "xAxisLabel", required: false }] }], yAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAxisLabel", required: false }] }], yLineAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "yLineAxisLabel", required: false }] }], yBarMax: [{ type: i0.Input, args: [{ isSignal: true, alias: "yBarMax", required: false }] }], yLineMax: [{ type: i0.Input, args: [{ isSignal: true, alias: "yLineMax", required: false }] }], valueClicked: [{ type: i0.Output, args: ["valueClicked"] }] } });
|
|
2142
2263
|
|
|
2264
|
+
class DonutChartSkeletonComponent {
|
|
2265
|
+
constructor() {
|
|
2266
|
+
this.donutSize = input(...(ngDevMode ? [undefined, { debugName: "donutSize" }] : /* istanbul ignore next */ []));
|
|
2267
|
+
this.innerRadiusRatio = input.required(...(ngDevMode ? [{ debugName: "innerRadiusRatio" }] : /* istanbul ignore next */ []));
|
|
2268
|
+
this.skeletonType = input('loading', ...(ngDevMode ? [{ debugName: "skeletonType" }] : /* istanbul ignore next */ []));
|
|
2269
|
+
this.animationStyle = computed(() => (this.skeletonType() === 'loading' ? 'pulse' : false), ...(ngDevMode ? [{ debugName: "animationStyle" }] : /* istanbul ignore next */ []));
|
|
2270
|
+
}
|
|
2271
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: DonutChartSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2272
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.23", type: DonutChartSkeletonComponent, isStandalone: true, selector: "cng-donut-chart-skeleton", inputs: { donutSize: { classPropertyName: "donutSize", publicName: "donutSize", isSignal: true, isRequired: false, transformFunction: null }, innerRadiusRatio: { classPropertyName: "innerRadiusRatio", publicName: "innerRadiusRatio", isSignal: true, isRequired: true, transformFunction: null }, skeletonType: { classPropertyName: "skeletonType", publicName: "skeletonType", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
2273
|
+
<div class="chart-skeleton">
|
|
2274
|
+
<div class="donut-wrapper">
|
|
2275
|
+
<ngx-skeleton-loader
|
|
2276
|
+
[class.placeholder-skeleton]="skeletonType() === 'placeholder'"
|
|
2277
|
+
[appearance]="'circle'"
|
|
2278
|
+
[animation]="animationStyle()"
|
|
2279
|
+
[theme]="{ width: '100%', height: '100%', margin: '0' }"
|
|
2280
|
+
/>
|
|
2281
|
+
<div
|
|
2282
|
+
class="inner-donut-circle"
|
|
2283
|
+
[style.width.%]="(1 - innerRadiusRatio()) * 100"
|
|
2284
|
+
[style.height.%]="(1 - innerRadiusRatio()) * 100"
|
|
2285
|
+
></div>
|
|
2286
|
+
</div>
|
|
2287
|
+
</div>
|
|
2288
|
+
`, isInline: true, styles: [":host{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;box-sizing:border-box}:host(.pt-3){padding-top:3rem}.chart-skeleton{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:0}.donut-wrapper{position:relative;height:100%;max-height:200px;aspect-ratio:1;max-width:100%}.inner-donut-circle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background-color:var(--clr-card-bg-color);border-radius:50%}\n"], dependencies: [{ kind: "component", type: NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: ["count", "loadingText", "appearance", "animation", "ariaLabel", "theme", "size", "measureUnit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2289
|
+
}
|
|
2290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: DonutChartSkeletonComponent, decorators: [{
|
|
2291
|
+
type: Component,
|
|
2292
|
+
args: [{ selector: 'cng-donut-chart-skeleton', template: `
|
|
2293
|
+
<div class="chart-skeleton">
|
|
2294
|
+
<div class="donut-wrapper">
|
|
2295
|
+
<ngx-skeleton-loader
|
|
2296
|
+
[class.placeholder-skeleton]="skeletonType() === 'placeholder'"
|
|
2297
|
+
[appearance]="'circle'"
|
|
2298
|
+
[animation]="animationStyle()"
|
|
2299
|
+
[theme]="{ width: '100%', height: '100%', margin: '0' }"
|
|
2300
|
+
/>
|
|
2301
|
+
<div
|
|
2302
|
+
class="inner-donut-circle"
|
|
2303
|
+
[style.width.%]="(1 - innerRadiusRatio()) * 100"
|
|
2304
|
+
[style.height.%]="(1 - innerRadiusRatio()) * 100"
|
|
2305
|
+
></div>
|
|
2306
|
+
</div>
|
|
2307
|
+
</div>
|
|
2308
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgxSkeletonLoaderComponent], styles: [":host{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;box-sizing:border-box}:host(.pt-3){padding-top:3rem}.chart-skeleton{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:0}.donut-wrapper{position:relative;height:100%;max-height:200px;aspect-ratio:1;max-width:100%}.inner-donut-circle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background-color:var(--clr-card-bg-color);border-radius:50%}\n"] }]
|
|
2309
|
+
}], propDecorators: { donutSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "donutSize", required: false }] }], innerRadiusRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "innerRadiusRatio", required: true }] }], skeletonType: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonType", required: false }] }] } });
|
|
2310
|
+
|
|
2311
|
+
class ChartLegendSkeletonComponent {
|
|
2312
|
+
constructor() {
|
|
2313
|
+
this.orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
2314
|
+
this.count = input(2, ...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
|
|
2315
|
+
this.skeletonType = input('loading', ...(ngDevMode ? [{ debugName: "skeletonType" }] : /* istanbul ignore next */ []));
|
|
2316
|
+
this.animationStyle = computed(() => (this.skeletonType() === 'loading' ? 'pulse' : false), ...(ngDevMode ? [{ debugName: "animationStyle" }] : /* istanbul ignore next */ []));
|
|
2317
|
+
}
|
|
2318
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: ChartLegendSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2319
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.23", type: ChartLegendSkeletonComponent, isStandalone: true, selector: "cng-chart-legend-skeleton", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, skeletonType: { classPropertyName: "skeletonType", publicName: "skeletonType", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
2320
|
+
<ngx-skeleton-loader
|
|
2321
|
+
class="d-flex gap-m"
|
|
2322
|
+
[class.clr-flex-column]="orientation() === 'vertical'"
|
|
2323
|
+
[class.clr-flex-row]="orientation() === 'horizontal'"
|
|
2324
|
+
[class.placeholder-skeleton]="skeletonType() === 'placeholder'"
|
|
2325
|
+
[appearance]="'line'"
|
|
2326
|
+
[count]="count()"
|
|
2327
|
+
[animation]="animationStyle()"
|
|
2328
|
+
[theme]="{
|
|
2329
|
+
height: '16px',
|
|
2330
|
+
width: '60px',
|
|
2331
|
+
marginBottom: '0px',
|
|
2332
|
+
}"
|
|
2333
|
+
/>
|
|
2334
|
+
`, isInline: true, styles: [".placeholder-skeleton ::ng-deep .skeleton-loader{cursor:default}\n"], dependencies: [{ kind: "component", type: NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: ["count", "loadingText", "appearance", "animation", "ariaLabel", "theme", "size", "measureUnit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2335
|
+
}
|
|
2336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: ChartLegendSkeletonComponent, decorators: [{
|
|
2337
|
+
type: Component,
|
|
2338
|
+
args: [{ selector: 'cng-chart-legend-skeleton', template: `
|
|
2339
|
+
<ngx-skeleton-loader
|
|
2340
|
+
class="d-flex gap-m"
|
|
2341
|
+
[class.clr-flex-column]="orientation() === 'vertical'"
|
|
2342
|
+
[class.clr-flex-row]="orientation() === 'horizontal'"
|
|
2343
|
+
[class.placeholder-skeleton]="skeletonType() === 'placeholder'"
|
|
2344
|
+
[appearance]="'line'"
|
|
2345
|
+
[count]="count()"
|
|
2346
|
+
[animation]="animationStyle()"
|
|
2347
|
+
[theme]="{
|
|
2348
|
+
height: '16px',
|
|
2349
|
+
width: '60px',
|
|
2350
|
+
marginBottom: '0px',
|
|
2351
|
+
}"
|
|
2352
|
+
/>
|
|
2353
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgxSkeletonLoaderComponent], styles: [".placeholder-skeleton ::ng-deep .skeleton-loader{cursor:default}\n"] }]
|
|
2354
|
+
}], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], skeletonType: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonType", required: false }] }] } });
|
|
2355
|
+
|
|
2143
2356
|
class PieChartComponent extends ChartBase {
|
|
2144
2357
|
constructor() {
|
|
2145
2358
|
super(...arguments);
|
|
2146
2359
|
this.data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
2147
2360
|
this.donut = input(true, ...(ngDevMode ? [{ debugName: "donut" }] : /* istanbul ignore next */ []));
|
|
2361
|
+
this.centerValue = input(undefined, ...(ngDevMode ? [{ debugName: "centerValue" }] : /* istanbul ignore next */ []));
|
|
2362
|
+
this.centerLabel = input(undefined, ...(ngDevMode ? [{ debugName: "centerLabel" }] : /* istanbul ignore next */ []));
|
|
2363
|
+
this.formatCenterValue = input(false, ...(ngDevMode ? [{ debugName: "formatCenterValue" }] : /* istanbul ignore next */ []));
|
|
2364
|
+
this.formatSlices = input(false, ...(ngDevMode ? [{ debugName: "formatSlices" }] : /* istanbul ignore next */ []));
|
|
2148
2365
|
this.showLegend = input(true, ...(ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []));
|
|
2366
|
+
this.legendPosition = input('bottom', ...(ngDevMode ? [{ debugName: "legendPosition" }] : /* istanbul ignore next */ []));
|
|
2149
2367
|
this.showExportButton = input(false, ...(ngDevMode ? [{ debugName: "showExportButton" }] : /* istanbul ignore next */ []));
|
|
2150
2368
|
this.exportButtonTitle = input('Export', ...(ngDevMode ? [{ debugName: "exportButtonTitle" }] : /* istanbul ignore next */ []));
|
|
2151
2369
|
this.exportFilename = input('pie-chart', ...(ngDevMode ? [{ debugName: "exportFilename" }] : /* istanbul ignore next */ []));
|
|
2152
2370
|
this.tooltipOrientation = input('top', ...(ngDevMode ? [{ debugName: "tooltipOrientation" }] : /* istanbul ignore next */ []));
|
|
2371
|
+
this.innerRadiusRatio = input(0.5, ...(ngDevMode ? [{ debugName: "innerRadiusRatio" }] : /* istanbul ignore next */ []));
|
|
2372
|
+
this.excludeZeroItemValuesFromLegend = input(true, ...(ngDevMode ? [{ debugName: "excludeZeroItemValuesFromLegend" }] : /* istanbul ignore next */ []));
|
|
2153
2373
|
this.noItemsMessage = input(NO_ITEMS_MESSAGE, ...(ngDevMode ? [{ debugName: "noItemsMessage" }] : /* istanbul ignore next */ []));
|
|
2154
2374
|
this.tooltipPercentOfTotal = input('of total', ...(ngDevMode ? [{ debugName: "tooltipPercentOfTotal" }] : /* istanbul ignore next */ []));
|
|
2155
2375
|
this.valueClicked = output();
|
|
2376
|
+
this.showSkeleton = computed(() => this.loading() || !this.total(), ...(ngDevMode ? [{ debugName: "showSkeleton" }] : /* istanbul ignore next */ []));
|
|
2156
2377
|
this.hasData = computed(() => this.data()?.some(d => d.value > 0), ...(ngDevMode ? [{ debugName: "hasData" }] : /* istanbul ignore next */ []));
|
|
2157
2378
|
this.total = computed(() => this.data()?.reduce((acc, d) => acc + d.value, 0) ?? 0, ...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
2158
2379
|
this.alertMessageAndType = computed(() => {
|
|
@@ -2168,8 +2389,11 @@ class PieChartComponent extends ChartBase {
|
|
|
2168
2389
|
if (!this.showLegend()) {
|
|
2169
2390
|
return [];
|
|
2170
2391
|
}
|
|
2171
|
-
return (this.data() ?? [])
|
|
2392
|
+
return (this.data() ?? [])
|
|
2393
|
+
.filter(d => (this.excludeZeroItemValuesFromLegend() ? d.value > 0 : d.value >= 0))
|
|
2394
|
+
.map(d => ({ label: d.fullLabel ?? d.label, color: d.color, key: d.key, value: d.value }));
|
|
2172
2395
|
}, ...(ngDevMode ? [{ debugName: "legendItems" }] : /* istanbul ignore next */ []));
|
|
2396
|
+
this.hoveredIndex = signal(undefined, ...(ngDevMode ? [{ debugName: "hoveredIndex" }] : /* istanbul ignore next */ []));
|
|
2173
2397
|
}
|
|
2174
2398
|
ngOnChanges(_changes) {
|
|
2175
2399
|
if (!this.svg) {
|
|
@@ -2188,16 +2412,14 @@ class PieChartComponent extends ChartBase {
|
|
|
2188
2412
|
}
|
|
2189
2413
|
const { width, height } = this.getContainerDimensions();
|
|
2190
2414
|
const radius = Math.min(width, height) / 2;
|
|
2191
|
-
const innerRadius = this.donut() ? radius *
|
|
2192
|
-
const outerRadius = radius
|
|
2415
|
+
const innerRadius = this.donut() ? radius * this.innerRadiusRatio() : 0;
|
|
2416
|
+
const outerRadius = radius - 5;
|
|
2193
2417
|
this.arcGen = arc().innerRadius(innerRadius).outerRadius(outerRadius);
|
|
2194
|
-
|
|
2195
|
-
.innerRadius(innerRadius)
|
|
2196
|
-
.outerRadius(outerRadius * 1.06);
|
|
2418
|
+
this.hoverArcGen = arc().innerRadius(innerRadius).outerRadius(radius);
|
|
2197
2419
|
const pieGen = pie()
|
|
2198
2420
|
.value(d => d.value)
|
|
2199
2421
|
.sort(null);
|
|
2200
|
-
const arcs = pieGen(this.data()
|
|
2422
|
+
const arcs = pieGen(this.data());
|
|
2201
2423
|
const g = this.svg
|
|
2202
2424
|
.attr('width', width)
|
|
2203
2425
|
.attr('height', height)
|
|
@@ -2209,15 +2431,22 @@ class PieChartComponent extends ChartBase {
|
|
|
2209
2431
|
.join('path')
|
|
2210
2432
|
.attr('class', 'slice')
|
|
2211
2433
|
.attr('d', this.arcGen)
|
|
2434
|
+
.style('display', (d) => (d.data.value ? null : 'none'))
|
|
2212
2435
|
.style('fill', (d) => toChartColor(d.data.color))
|
|
2213
2436
|
.attr('stroke', '#fff')
|
|
2214
2437
|
.attr('stroke-width', 2)
|
|
2215
2438
|
.style('cursor', 'pointer')
|
|
2216
|
-
.on('mouseover', (e) => {
|
|
2217
|
-
select(e.currentTarget)
|
|
2439
|
+
.on('mouseover', (e, d) => {
|
|
2440
|
+
select(e.currentTarget)
|
|
2441
|
+
.attr('d', this.hoverArcGen)
|
|
2442
|
+
.style('opacity', 0.8);
|
|
2443
|
+
this.hoveredIndex.set(this.data().indexOf(d.data));
|
|
2218
2444
|
})
|
|
2219
2445
|
.on('mouseout', (e) => {
|
|
2220
|
-
select(e.currentTarget)
|
|
2446
|
+
select(e.currentTarget)
|
|
2447
|
+
.attr('d', this.arcGen)
|
|
2448
|
+
.style('opacity', 1);
|
|
2449
|
+
this.hoveredIndex.set(undefined);
|
|
2221
2450
|
})
|
|
2222
2451
|
.on('click', (event, d) => {
|
|
2223
2452
|
event.stopPropagation();
|
|
@@ -2247,7 +2476,7 @@ class PieChartComponent extends ChartBase {
|
|
|
2247
2476
|
.style('font-weight', '600')
|
|
2248
2477
|
.style('fill', '#fff')
|
|
2249
2478
|
.style('pointer-events', 'none')
|
|
2250
|
-
.text((d) => format('~s')(d.data.value));
|
|
2479
|
+
.text((d) => this.formatSlices() ? format('~s')(d.data.value) : d.data.value || '');
|
|
2251
2480
|
labelGroups
|
|
2252
2481
|
.append('text')
|
|
2253
2482
|
.attr('class', 'label-percent')
|
|
@@ -2258,7 +2487,7 @@ class PieChartComponent extends ChartBase {
|
|
|
2258
2487
|
.style('pointer-events', 'none')
|
|
2259
2488
|
.text((d) => `${((100 * d.data.value) / total).toFixed(1)}%`);
|
|
2260
2489
|
// Center label (donut only)
|
|
2261
|
-
if (this.donut()) {
|
|
2490
|
+
if (this.donut() && this.centerValue() === undefined) {
|
|
2262
2491
|
g.append('text')
|
|
2263
2492
|
.attr('class', 'center-label')
|
|
2264
2493
|
.attr('text-anchor', 'middle')
|
|
@@ -2266,7 +2495,7 @@ class PieChartComponent extends ChartBase {
|
|
|
2266
2495
|
.style('font-size', '1.4rem')
|
|
2267
2496
|
.style('font-weight', '600')
|
|
2268
2497
|
.style('fill', 'var(--cds-global-color-gray-900, #21333b)')
|
|
2269
|
-
.text(format('~s')(this.total()));
|
|
2498
|
+
.text(this.formatCenterValue() ? format('~s')(this.total()) : this.total());
|
|
2270
2499
|
g.append('text')
|
|
2271
2500
|
.attr('class', 'center-sublabel')
|
|
2272
2501
|
.attr('text-anchor', 'middle')
|
|
@@ -2274,8 +2503,7 @@ class PieChartComponent extends ChartBase {
|
|
|
2274
2503
|
.style('font-size', '0.65rem')
|
|
2275
2504
|
.style('fill', 'var(--cds-global-color-construction-400, #666)')
|
|
2276
2505
|
.style('text-transform', 'uppercase')
|
|
2277
|
-
.style('letter-spacing', '0.05em')
|
|
2278
|
-
.text('Total');
|
|
2506
|
+
.style('letter-spacing', '0.05em');
|
|
2279
2507
|
}
|
|
2280
2508
|
}
|
|
2281
2509
|
openTooltip(d, width, height) {
|
|
@@ -2286,13 +2514,79 @@ class PieChartComponent extends ChartBase {
|
|
|
2286
2514
|
});
|
|
2287
2515
|
this.selectedItem.set(d.data);
|
|
2288
2516
|
}
|
|
2517
|
+
setHoverStylesByIndex(index) {
|
|
2518
|
+
this.svg
|
|
2519
|
+
.selectAll('.slice')
|
|
2520
|
+
.filter((_d, i) => i === index)
|
|
2521
|
+
.attr('d', this.hoverArcGen)
|
|
2522
|
+
.style('opacity', 0.8);
|
|
2523
|
+
this.hoveredIndex.set(index);
|
|
2524
|
+
}
|
|
2525
|
+
unsetHoverStylesByIndex(index) {
|
|
2526
|
+
this.svg
|
|
2527
|
+
.selectAll('.slice')
|
|
2528
|
+
.filter((_d, i) => i === index)
|
|
2529
|
+
.attr('d', this.arcGen)
|
|
2530
|
+
.style('opacity', 1);
|
|
2531
|
+
this.hoveredIndex.set(undefined);
|
|
2532
|
+
}
|
|
2533
|
+
onLegendHover(index, hover) {
|
|
2534
|
+
return hover ? this.setHoverStylesByIndex(index) : this.unsetHoverStylesByIndex(index);
|
|
2535
|
+
}
|
|
2536
|
+
onLegendClick(item) {
|
|
2537
|
+
this.valueClicked.emit({ key: item.key, label: item.label, value: item.value });
|
|
2538
|
+
}
|
|
2289
2539
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: PieChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2290
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: PieChartComponent, isStandalone: false, selector: "clr-pie-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, donut: { classPropertyName: "donut", publicName: "donut", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, tooltipOrientation: { classPropertyName: "tooltipOrientation", publicName: "tooltipOrientation", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooltipPercentOfTotal: { classPropertyName: "tooltipPercentOfTotal", publicName: "tooltipPercentOfTotal", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-container\" data-testid=\"pie-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"pie-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (tooltipPosition()) {\n
|
|
2540
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: PieChartComponent, isStandalone: false, selector: "clr-pie-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, donut: { classPropertyName: "donut", publicName: "donut", isSignal: true, isRequired: false, transformFunction: null }, centerValue: { classPropertyName: "centerValue", publicName: "centerValue", isSignal: true, isRequired: false, transformFunction: null }, centerLabel: { classPropertyName: "centerLabel", publicName: "centerLabel", isSignal: true, isRequired: false, transformFunction: null }, formatCenterValue: { classPropertyName: "formatCenterValue", publicName: "formatCenterValue", isSignal: true, isRequired: false, transformFunction: null }, formatSlices: { classPropertyName: "formatSlices", publicName: "formatSlices", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, legendPosition: { classPropertyName: "legendPosition", publicName: "legendPosition", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, tooltipOrientation: { classPropertyName: "tooltipOrientation", publicName: "tooltipOrientation", isSignal: true, isRequired: false, transformFunction: null }, innerRadiusRatio: { classPropertyName: "innerRadiusRatio", publicName: "innerRadiusRatio", isSignal: true, isRequired: false, transformFunction: null }, excludeZeroItemValuesFromLegend: { classPropertyName: "excludeZeroItemValuesFromLegend", publicName: "excludeZeroItemValuesFromLegend", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, tooltipPercentOfTotal: { classPropertyName: "tooltipPercentOfTotal", publicName: "tooltipPercentOfTotal", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-container\" data-testid=\"pie-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"pie-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (centerValue() != null && !showSkeleton()) {\n <div class=\"center-text\">\n <div\n class=\"center-number has-more-info\"\n (click)=\"\n valueClicked.emit({\n value: centerValue(),\n })\n \"\n >\n {{ centerValue() }}\n </div>\n @if (centerLabel()) {\n <div class=\"center-sublabel-text\">{{ centerLabel() }}</div>\n }\n </div>\n }\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"pie-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedItem()?.color\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"\n valueClicked.emit({\n key: selectedItem().key,\n label: selectedItem().fullLabel || selectedItem().label,\n value: selectedItem().value,\n })\n \"\n >\n <ng-container ngProjectAs=\"cng-title\">\n ({{ selectedItem().value }}) {{ selectedItem().fullLabel || selectedItem().label }}\n </ng-container>\n\n <p class=\"mt-0\" data-testid=\"pie-chart-tooltip-percentage\">\n {{ (100 * selectedItem().value) / total() | number: '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n </cng-chart-tooltip>\n }\n @if (loading() || !hasData()) {\n <cng-donut-chart-skeleton\n data-testid=\"pie-chart-skeleton\"\n [innerRadiusRatio]=\"0.55\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n [class.pt-3]=\"!!alertMessageAndType()\"\n />\n }\n @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"pie-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && loading()) {\n <cng-chart-legend-skeleton [count]=\"2\" [skeletonType]=\"'loading'\" [class.legend-top]=\"legendPosition() === 'top'\" />\n } @else if (showLegend() && !loading() && legendItems().length && !alertMessageAndType()) {\n <cng-chart-legend\n data-testid=\"pie-chart-legend\"\n [items]=\"legendItems()\"\n [hoveredIndex]=\"hoveredIndex() ?? -1\"\n (itemHover)=\"onLegendHover($event.index, $event.hover)\"\n (clicked)=\"onLegendClick($event)\"\n [class.legend-top]=\"legendPosition() === 'top'\"\n />\n }\n @if (showExportButton() && !loading() && hasData()) {\n <cng-chart-export-button\n data-testid=\"pie-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1 1 auto;height:auto;min-height:0;position:relative}svg{height:100%;width:100%}cng-donut-chart-skeleton{height:100%}.slice{transition:d .15s ease}.label-value{font-size:11px;font-weight:600;fill:#fff}.label-percent{font-size:10px;fill:#ffffffe6}.center-label{font-size:1.4rem;font-weight:600;fill:var(--cds-global-color-gray-900, #21333b)}.center-text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;pointer-events:none}.center-number{text-decoration:underline;text-decoration-style:dotted;text-decoration-thickness:2px;text-decoration-color:var(--clr-color-neutral-600, #666);text-underline-offset:3px;font-size:1.4rem;font-weight:600;color:var(--cds-global-color-gray-900, #21333b);pointer-events:auto;cursor:pointer}.center-sublabel-text{font-size:.75rem;color:var(--cds-global-color-construction-400, #666);margin-top:2px}.center-sublabel{font-size:.65rem;fill:var(--cds-global-color-construction-400, #666);text-transform:uppercase;letter-spacing:.05em}.legend-top{order:-1}\n"], dependencies: [{ kind: "component", type: ChartAlertOverlayComponent, selector: "cng-chart-alert-overlay", inputs: ["alertMessage", "alertType"] }, { kind: "component", type: ChartExportButtonComponent, selector: "cng-chart-export-button", inputs: ["svgRef", "filename", "buttonTitle", "legendItems"] }, { kind: "component", type: ChartLegendComponent, selector: "cng-chart-legend", inputs: ["items", "hoveredIndex", "loading", "orientation"], outputs: ["itemHover", "clicked"] }, { kind: "component", type: ChartTooltipComponent, selector: "cng-chart-tooltip", inputs: ["tooltipPosition", "tooltipOrientation", "squareColor", "tooltipClickable"], outputs: ["tooltipClosed", "tooltipHeaderClicked"] }, { kind: "directive", type: OutsideClickDirective, selector: "[cngOutsideClick]", outputs: ["cngOutsideClick"] }, { kind: "directive", type: WindowResizeDirective, selector: "[cngWindowResize]", inputs: ["debounce", "includeFirst"], outputs: ["cngWindowResize"] }, { kind: "component", type: DonutChartSkeletonComponent, selector: "cng-donut-chart-skeleton", inputs: ["donutSize", "innerRadiusRatio", "skeletonType"] }, { kind: "component", type: ChartLegendSkeletonComponent, selector: "cng-chart-legend-skeleton", inputs: ["orientation", "count", "skeletonType"] }, { kind: "pipe", type: i8.DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2291
2541
|
}
|
|
2292
2542
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: PieChartComponent, decorators: [{
|
|
2293
2543
|
type: Component,
|
|
2294
|
-
args: [{ selector: 'clr-pie-chart', standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"chart-container\" data-testid=\"pie-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"pie-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (tooltipPosition()) {\n
|
|
2295
|
-
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], donut: [{ type: i0.Input, args: [{ isSignal: true, alias: "donut", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], showExportButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExportButton", required: false }] }], exportButtonTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportButtonTitle", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], tooltipOrientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOrientation", required: false }] }], noItemsMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noItemsMessage", required: false }] }], tooltipPercentOfTotal: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPercentOfTotal", required: false }] }], valueClicked: [{ type: i0.Output, args: ["valueClicked"] }] } });
|
|
2544
|
+
args: [{ selector: 'clr-pie-chart', standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"chart-container\" data-testid=\"pie-chart\">\n <div\n class=\"chart-area\"\n data-testid=\"pie-chart-area\"\n #container\n (cngWindowResize)=\"updateChart()\"\n [class.pt-3]=\"alertMessageAndType()\"\n >\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (centerValue() != null && !showSkeleton()) {\n <div class=\"center-text\">\n <div\n class=\"center-number has-more-info\"\n (click)=\"\n valueClicked.emit({\n value: centerValue(),\n })\n \"\n >\n {{ centerValue() }}\n </div>\n @if (centerLabel()) {\n <div class=\"center-sublabel-text\">{{ centerLabel() }}</div>\n }\n </div>\n }\n\n @if (tooltipPosition()) {\n <cng-chart-tooltip\n data-testid=\"pie-chart-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedItem()?.color\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"\n valueClicked.emit({\n key: selectedItem().key,\n label: selectedItem().fullLabel || selectedItem().label,\n value: selectedItem().value,\n })\n \"\n >\n <ng-container ngProjectAs=\"cng-title\">\n ({{ selectedItem().value }}) {{ selectedItem().fullLabel || selectedItem().label }}\n </ng-container>\n\n <p class=\"mt-0\" data-testid=\"pie-chart-tooltip-percentage\">\n {{ (100 * selectedItem().value) / total() | number: '1.0-2' }}%\n {{ tooltipPercentOfTotal() }}\n </p>\n </cng-chart-tooltip>\n }\n @if (loading() || !hasData()) {\n <cng-donut-chart-skeleton\n data-testid=\"pie-chart-skeleton\"\n [innerRadiusRatio]=\"0.55\"\n [skeletonType]=\"loading() ? 'loading' : 'placeholder'\"\n [class.pt-3]=\"!!alertMessageAndType()\"\n />\n }\n @if (alertMessageAndType()) {\n <cng-chart-alert-overlay\n data-testid=\"pie-chart-alert-overlay\"\n [alertType]=\"alertMessageAndType()[1]\"\n [alertMessage]=\"alertMessageAndType()[0]\"\n />\n }\n </div>\n\n @if (showLegend() && loading()) {\n <cng-chart-legend-skeleton [count]=\"2\" [skeletonType]=\"'loading'\" [class.legend-top]=\"legendPosition() === 'top'\" />\n } @else if (showLegend() && !loading() && legendItems().length && !alertMessageAndType()) {\n <cng-chart-legend\n data-testid=\"pie-chart-legend\"\n [items]=\"legendItems()\"\n [hoveredIndex]=\"hoveredIndex() ?? -1\"\n (itemHover)=\"onLegendHover($event.index, $event.hover)\"\n (clicked)=\"onLegendClick($event)\"\n [class.legend-top]=\"legendPosition() === 'top'\"\n />\n }\n @if (showExportButton() && !loading() && hasData()) {\n <cng-chart-export-button\n data-testid=\"pie-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n [legendItems]=\"legendItems()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}.chart-container{display:flex;flex-direction:column;width:100%;height:100%;position:relative}.chart-area{flex:1 1 auto;height:auto;min-height:0;position:relative}svg{height:100%;width:100%}cng-donut-chart-skeleton{height:100%}.slice{transition:d .15s ease}.label-value{font-size:11px;font-weight:600;fill:#fff}.label-percent{font-size:10px;fill:#ffffffe6}.center-label{font-size:1.4rem;font-weight:600;fill:var(--cds-global-color-gray-900, #21333b)}.center-text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;pointer-events:none}.center-number{text-decoration:underline;text-decoration-style:dotted;text-decoration-thickness:2px;text-decoration-color:var(--clr-color-neutral-600, #666);text-underline-offset:3px;font-size:1.4rem;font-weight:600;color:var(--cds-global-color-gray-900, #21333b);pointer-events:auto;cursor:pointer}.center-sublabel-text{font-size:.75rem;color:var(--cds-global-color-construction-400, #666);margin-top:2px}.center-sublabel{font-size:.65rem;fill:var(--cds-global-color-construction-400, #666);text-transform:uppercase;letter-spacing:.05em}.legend-top{order:-1}\n"] }]
|
|
2545
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], donut: [{ type: i0.Input, args: [{ isSignal: true, alias: "donut", required: false }] }], centerValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "centerValue", required: false }] }], centerLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "centerLabel", required: false }] }], formatCenterValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatCenterValue", required: false }] }], formatSlices: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatSlices", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], legendPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendPosition", required: false }] }], showExportButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExportButton", required: false }] }], exportButtonTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportButtonTitle", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], tooltipOrientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOrientation", required: false }] }], innerRadiusRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "innerRadiusRatio", required: false }] }], excludeZeroItemValuesFromLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "excludeZeroItemValuesFromLegend", required: false }] }], noItemsMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noItemsMessage", required: false }] }], tooltipPercentOfTotal: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPercentOfTotal", required: false }] }], valueClicked: [{ type: i0.Output, args: ["valueClicked"] }] } });
|
|
2546
|
+
|
|
2547
|
+
class FunnelSkeletonComponent {
|
|
2548
|
+
constructor() {
|
|
2549
|
+
this.centered = input(false, ...(ngDevMode ? [{ debugName: "centered" }] : /* istanbul ignore next */ []));
|
|
2550
|
+
}
|
|
2551
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FunnelSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2552
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: FunnelSkeletonComponent, isStandalone: true, selector: "cng-funnel-skeleton", inputs: { centered: { classPropertyName: "centered", publicName: "centered", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
2553
|
+
<div class="funnel-skeleton-container">
|
|
2554
|
+
@for (_ of [1, 2, 3, 4, 5, 6, 7, 8]; track $index) {
|
|
2555
|
+
<div class="funnel-bar bar-{{ $index + 1 }}" [class.centered]="centered()">
|
|
2556
|
+
<ngx-skeleton-loader
|
|
2557
|
+
[appearance]="'line'"
|
|
2558
|
+
[count]="1"
|
|
2559
|
+
[animation]="'pulse'"
|
|
2560
|
+
[theme]="{
|
|
2561
|
+
height: '100%',
|
|
2562
|
+
'border-radius': 'var(--clr-base-border-radius-xxs)',
|
|
2563
|
+
}"
|
|
2564
|
+
/>
|
|
2565
|
+
</div>
|
|
2566
|
+
}
|
|
2567
|
+
</div>
|
|
2568
|
+
`, isInline: true, styles: [".funnel-skeleton-container{width:100%;height:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:var(--clr-base-gap-xs);padding:0 250px}.funnel-bar{height:calc((100% - 5 * var(--clr-base-gap-xs)) / 6);min-height:2rem}.funnel-bar.centered{margin:auto}.funnel-bar.bar-1{width:100%}.funnel-bar.bar-2{width:85%}.funnel-bar.bar-3{width:70%}.funnel-bar.bar-4{width:55%}.funnel-bar.bar-5{width:40%}.funnel-bar.bar-6{width:35%}.funnel-bar.bar-7{width:20%}.funnel-bar.bar-8{width:15%}\n"], dependencies: [{ kind: "ngmodule", type: NgxSkeletonLoaderModule }, { kind: "component", type: i1$1.NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: ["count", "loadingText", "appearance", "animation", "ariaLabel", "theme", "size", "measureUnit"] }, { kind: "ngmodule", type: ClrSignpostModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2569
|
+
}
|
|
2570
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FunnelSkeletonComponent, decorators: [{
|
|
2571
|
+
type: Component,
|
|
2572
|
+
args: [{ selector: 'cng-funnel-skeleton', imports: [NgxSkeletonLoaderModule, ClrSignpostModule], template: `
|
|
2573
|
+
<div class="funnel-skeleton-container">
|
|
2574
|
+
@for (_ of [1, 2, 3, 4, 5, 6, 7, 8]; track $index) {
|
|
2575
|
+
<div class="funnel-bar bar-{{ $index + 1 }}" [class.centered]="centered()">
|
|
2576
|
+
<ngx-skeleton-loader
|
|
2577
|
+
[appearance]="'line'"
|
|
2578
|
+
[count]="1"
|
|
2579
|
+
[animation]="'pulse'"
|
|
2580
|
+
[theme]="{
|
|
2581
|
+
height: '100%',
|
|
2582
|
+
'border-radius': 'var(--clr-base-border-radius-xxs)',
|
|
2583
|
+
}"
|
|
2584
|
+
/>
|
|
2585
|
+
</div>
|
|
2586
|
+
}
|
|
2587
|
+
</div>
|
|
2588
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".funnel-skeleton-container{width:100%;height:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:var(--clr-base-gap-xs);padding:0 250px}.funnel-bar{height:calc((100% - 5 * var(--clr-base-gap-xs)) / 6);min-height:2rem}.funnel-bar.centered{margin:auto}.funnel-bar.bar-1{width:100%}.funnel-bar.bar-2{width:85%}.funnel-bar.bar-3{width:70%}.funnel-bar.bar-4{width:55%}.funnel-bar.bar-5{width:40%}.funnel-bar.bar-6{width:35%}.funnel-bar.bar-7{width:20%}.funnel-bar.bar-8{width:15%}\n"] }]
|
|
2589
|
+
}], propDecorators: { centered: [{ type: i0.Input, args: [{ isSignal: true, alias: "centered", required: false }] }] } });
|
|
2296
2590
|
|
|
2297
2591
|
/*
|
|
2298
2592
|
* Copyright (c) 2018-2026 Porsche Informatik. All Rights Reserved.
|
|
@@ -2316,6 +2610,8 @@ class FunnelChartComponent extends ChartBase {
|
|
|
2316
2610
|
this.exportFilename = input('funnel-chart', ...(ngDevMode ? [{ debugName: "exportFilename" }] : /* istanbul ignore next */ []));
|
|
2317
2611
|
/** Rendering mode. 'default' = horizontal bars with sections; 'centered' = centered trapezoid funnel. */
|
|
2318
2612
|
this.orientation = input('default', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
2613
|
+
this.tooltipOrientation = input('bottom', ...(ngDevMode ? [{ debugName: "tooltipOrientation" }] : /* istanbul ignore next */ []));
|
|
2614
|
+
this.prefixTotalWithLabel = input(false, ...(ngDevMode ? [{ debugName: "prefixTotalWithLabel" }] : /* istanbul ignore next */ []));
|
|
2319
2615
|
/** Width reserved on each side for labels (px). */
|
|
2320
2616
|
this.textSize = input(200, ...(ngDevMode ? [{ debugName: "textSize" }] : /* istanbul ignore next */ []));
|
|
2321
2617
|
/** Gap between funnel bars and their side-line labels (px). */
|
|
@@ -2347,6 +2643,8 @@ class FunnelChartComponent extends ChartBase {
|
|
|
2347
2643
|
* the built-in default palette.
|
|
2348
2644
|
*/
|
|
2349
2645
|
this.sectionColors = input({}, ...(ngDevMode ? [{ debugName: "sectionColors" }] : /* istanbul ignore next */ []));
|
|
2646
|
+
this.tooltipPercentOfTotal = input('', ...(ngDevMode ? [{ debugName: "tooltipPercentOfTotal" }] : /* istanbul ignore next */ []));
|
|
2647
|
+
this.emptyChartWhenNoData = input(false, ...(ngDevMode ? [{ debugName: "emptyChartWhenNoData" }] : /* istanbul ignore next */ []));
|
|
2350
2648
|
// ── Outputs ─────────────────────────────────────────────────────────────────
|
|
2351
2649
|
this.valueClicked = output();
|
|
2352
2650
|
// ── Computed ─────────────────────────────────────────────────────────────────
|
|
@@ -2401,7 +2699,9 @@ class FunnelChartComponent extends ChartBase {
|
|
|
2401
2699
|
}
|
|
2402
2700
|
// ── Data calculation ─────────────────────────────────────────────────────────
|
|
2403
2701
|
calculateDataPoints(funnelWidth, barHeight) {
|
|
2404
|
-
const maxValue =
|
|
2702
|
+
const maxValue = this.emptyChartWhenNoData()
|
|
2703
|
+
? max(this.data(), d => d.value) || 1
|
|
2704
|
+
: (max(this.data(), d => d.value) ?? 1);
|
|
2405
2705
|
const widthScale = scaleLinear().domain([0, maxValue]).range([0, funnelWidth]);
|
|
2406
2706
|
const sectionColorOverrides = this.sectionColors();
|
|
2407
2707
|
return this.data().map((d, i) => {
|
|
@@ -2623,7 +2923,9 @@ class FunnelChartComponent extends ChartBase {
|
|
|
2623
2923
|
}
|
|
2624
2924
|
calculateCenteredDataPoints(maxFunnelWidth, barHeight, spacerHeight) {
|
|
2625
2925
|
const total = this.data()[0]?.value ?? 1;
|
|
2626
|
-
const maxValue =
|
|
2926
|
+
const maxValue = this.emptyChartWhenNoData()
|
|
2927
|
+
? max(this.data(), d => d.value) || 1
|
|
2928
|
+
: (max(this.data(), d => d.value) ?? 1);
|
|
2627
2929
|
const scale = scaleLinear().domain([0, maxValue]).range([0, maxFunnelWidth]);
|
|
2628
2930
|
return this.data().map((d, i) => {
|
|
2629
2931
|
const point = {
|
|
@@ -2893,12 +3195,12 @@ class FunnelChartComponent extends ChartBase {
|
|
|
2893
3195
|
return Math.round(factor * value) / factor;
|
|
2894
3196
|
}
|
|
2895
3197
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FunnelChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2896
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: FunnelChartComponent, isStandalone: false, selector: "clr-funnel-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, textSize: { classPropertyName: "textSize", publicName: "textSize", isSignal: true, isRequired: false, transformFunction: null }, lineTextPadding: { classPropertyName: "lineTextPadding", publicName: "lineTextPadding", isSignal: true, isRequired: false, transformFunction: null }, barGap: { classPropertyName: "barGap", publicName: "barGap", isSignal: true, isRequired: false, transformFunction: null }, sideLineVerticalPadding: { classPropertyName: "sideLineVerticalPadding", publicName: "sideLineVerticalPadding", isSignal: true, isRequired: false, transformFunction: null }, minLineSize: { classPropertyName: "minLineSize", publicName: "minLineSize", isSignal: true, isRequired: false, transformFunction: null }, barToSpacerRatio: { classPropertyName: "barToSpacerRatio", publicName: "barToSpacerRatio", isSignal: true, isRequired: false, transformFunction: null }, middleLineVerticalPadding: { classPropertyName: "middleLineVerticalPadding", publicName: "middleLineVerticalPadding", isSignal: true, isRequired: false, transformFunction: null }, barColor: { classPropertyName: "barColor", publicName: "barColor", isSignal: true, isRequired: false, transformFunction: null }, spacerColor: { classPropertyName: "spacerColor", publicName: "spacerColor", isSignal: true, isRequired: false, transformFunction: null }, chartLabels: { classPropertyName: "chartLabels", publicName: "chartLabels", isSignal: true, isRequired: false, transformFunction: null }, sectionColors: { classPropertyName: "sectionColors", publicName: "sectionColors", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"funnel-container\" data-testid=\"funnel-chart\" #container (cngWindowResize)=\"updateChart()\">\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (!loading()) {\n @for (pos of sectionTooltips(); track pos.key) {\n <clr-signpost\n [attr.data-testid]=\"'funnel-chart-section-signpost-' + pos.key\"\n [style.left.px]=\"pos.x\"\n [style.top.px]=\"pos.y\"\n >\n <cds-icon\n clrSignpostTrigger\n [attr.data-testid]=\"'funnel-chart-section-signpost-trigger-' + pos.key\"\n shape=\"info-circle\"\n size=\"18\"\n />\n <clr-signpost-content\n clrPosition=\"bottom-left\"\n [attr.data-testid]=\"'funnel-chart-section-signpost-content-' + pos.key\"\n >\n <p class=\"mt-0\" [attr.data-testid]=\"'funnel-chart-section-description-' + pos.key\">{{ pos.description }}</p>\n </clr-signpost-content>\n </clr-signpost>\n }\n }\n @if (loading()) {\n <cng-bar-chart-skeleton data-testid=\"funnel-chart-skeleton\" orientation=\"vertical\" skeletonType=\"loading\" />\n }\n @if (tooltipPosition()) {\n @if (orientation() === 'centered') {\n <!-- \u2500\u2500 Centered mode tooltip \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <cng-chart-tooltip\n data-testid=\"funnel-chart-centered-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n tooltipOrientation=\"bottom\"\n [squareColor]=\"selectedSpacerItem() ? centeredSpacerCssColor() : centeredBarCssColor()\"\n [tooltipClickable]=\"!selectedSpacerItem()\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"\n selectedItem() &&\n valueClicked.emit({\n value: selectedItem().value,\n label: selectedItem().label,\n key: selectedItem().key,\n section: undefined,\n })\n \"\n >\n <ng-container ngProjectAs=\"cng-title\">\n @if (selectedSpacerItem()) {\n {{ data()[selectedSpacerItem().index].label }} \u2192 {{ data()[selectedSpacerItem().index + 1].label }}\n } @else {\n ({{ selectedItem().value }}) {{ selectedItem().label }}\n }\n </ng-container>\n\n @if (selectedSpacerItem()) {\n <p class=\"mt-0\" data-testid=\"funnel-chart-centered-tooltip-transition\">\n <strong\n >{{ data()[selectedSpacerItem().index].value }} \u2192\n {{ data()[selectedSpacerItem().index + 1].value }}</strong\n >\n </p>\n @for (section of data()[selectedSpacerItem().index].sections ?? []; track section.key) {\n @let drillable = section.value > 0;\n <p\n class=\"tooltip-row mt-0 mt-0-5 d-flex\"\n [attr.data-testid]=\"'funnel-chart-centered-tooltip-section-' + section.key\"\n >\n <strong>{{ section.label }}: </strong>\n <span\n class=\"row-right\"\n [attr.data-testid]=\"'funnel-chart-centered-tooltip-section-value-' + section.key\"\n [class.has-more-info]=\"drillable\"\n (click)=\"\n drillable &&\n valueClicked.emit({\n value: section.value,\n label: data()[selectedSpacerItem().index].label + ': ' + section.label,\n key: data()[selectedSpacerItem().index].key,\n section: section.key,\n })\n \"\n >{{ section.value }}</span\n >\n ({{ pct(section.value, data()[selectedSpacerItem().index].value) }}%)\n </p>\n }\n } @else {\n <p class=\"mt-0\" data-testid=\"funnel-chart-centered-tooltip-percentage\">\n {{ pct(selectedItem().value, total()) }}% {{ resolvedChartLabels().all }}\n </p>\n }\n </cng-chart-tooltip>\n } @else {\n <!-- \u2500\u2500 Default mode tooltip \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <cng-chart-tooltip\n data-testid=\"funnel-chart-default-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n tooltipOrientation=\"bottom\"\n [squareColor]=\"undefined\"\n [tooltipClickable]=\"false\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n >\n <ng-container ngProjectAs=\"cng-title\">{{ selectedItemLabel() }}</ng-container>\n @for (section of selectedItem().sections; track section.key) {\n @let drillable = section.value > 0;\n <p\n class=\"tooltip-row mt-0 mt-0-5 d-flex\"\n [attr.data-testid]=\"'funnel-chart-default-tooltip-section-' + section.key\"\n >\n <span>\n <div class=\"color-square mr-0-5\" [style.background-color]=\"section.cssColor\"></div>\n </span>\n <strong>{{ section.label }}: </strong>\n <span\n class=\"row-right\"\n [attr.data-testid]=\"'funnel-chart-default-tooltip-section-value-' + section.key\"\n [class.has-more-info]=\"drillable\"\n (click)=\"\n drillable &&\n valueClicked.emit({\n value: section.value,\n label: selectedItemLabel() + ': ' + section.label,\n key: selectedItem().key,\n section: section.key,\n })\n \"\n >{{ section.value }}</span\n >\n ({{ section.percentage }}%)\n </p>\n }\n\n <p class=\"tooltip-row mt-0-5\" data-testid=\"funnel-chart-default-tooltip-total\">\n <strong>{{ resolvedChartLabels().total }}: </strong>\n <span\n class=\"has-more-info\"\n data-testid=\"funnel-chart-default-tooltip-total-value\"\n (click)=\"\n valueClicked.emit({\n value: selectedItem().value,\n label: selectedItemLabel(),\n key: selectedItem().key,\n section: undefined,\n })\n \"\n >{{ selectedItem().value }}</span\n >\n </p>\n\n <ng-container ngProjectAs=\"cng-footer\">\n <p class=\"tooltip-row mt-0\" data-testid=\"funnel-chart-default-tooltip-all\">\n <strong>{{ resolvedChartLabels().all }}: </strong>\n <span class=\"row-right\" data-testid=\"funnel-chart-default-tooltip-all-value\">{{ total() }}</span>\n </p>\n </ng-container>\n </cng-chart-tooltip>\n }\n }\n @if (showExportButton() && !loading() && hasData()) {\n <cng-chart-export-button\n class=\"funnel-export-btn\"\n data-testid=\"funnel-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}.funnel-container{height:100%;width:100%;max-width:1400px;margin:auto;position:relative}svg{width:100%;height:100%}clr-signpost{position:absolute!important}.tooltip-row{display:flex;justify-content:space-between;align-items:center}.row-right{margin-left:auto}.funnel-export-btn{position:absolute;bottom:0;right:0;opacity:0;pointer-events:none;transition:opacity .2s ease}.funnel-container:hover .funnel-export-btn{opacity:1;pointer-events:auto}\n"], dependencies: [{ kind: "component", type: i1.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }, { kind: "component", type: i1.ClrSignpost, selector: "clr-signpost", inputs: ["clrSignpostTriggerAriaLabel", "clrSignpostHideTrigger"] }, { kind: "component", type: i1.ClrSignpostContent, selector: "clr-signpost-content", inputs: ["clrSignpostCloseAriaLabel", "clrPosition"] }, { kind: "directive", type: i1.ClrSignpostTrigger, selector: "[clrSignpostTrigger]" }, { kind: "component", type: ChartExportButtonComponent, selector: "cng-chart-export-button", inputs: ["svgRef", "filename", "buttonTitle", "legendItems"] }, { kind: "component", type: ChartSkeletonComponent, selector: "cng-bar-chart-skeleton", inputs: ["skeletonType", "orientation"] }, { kind: "component", type: ChartTooltipComponent, selector: "cng-chart-tooltip", inputs: ["tooltipPosition", "tooltipOrientation", "squareColor", "tooltipClickable"], outputs: ["tooltipClosed", "tooltipHeaderClicked"] }, { kind: "directive", type: OutsideClickDirective, selector: "[cngOutsideClick]", outputs: ["cngOutsideClick"] }, { kind: "directive", type: WindowResizeDirective, selector: "[cngWindowResize]", inputs: ["debounce", "includeFirst"], outputs: ["cngWindowResize"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3198
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: FunnelChartComponent, isStandalone: false, selector: "clr-funnel-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, exportButtonTitle: { classPropertyName: "exportButtonTitle", publicName: "exportButtonTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, tooltipOrientation: { classPropertyName: "tooltipOrientation", publicName: "tooltipOrientation", isSignal: true, isRequired: false, transformFunction: null }, prefixTotalWithLabel: { classPropertyName: "prefixTotalWithLabel", publicName: "prefixTotalWithLabel", isSignal: true, isRequired: false, transformFunction: null }, textSize: { classPropertyName: "textSize", publicName: "textSize", isSignal: true, isRequired: false, transformFunction: null }, lineTextPadding: { classPropertyName: "lineTextPadding", publicName: "lineTextPadding", isSignal: true, isRequired: false, transformFunction: null }, barGap: { classPropertyName: "barGap", publicName: "barGap", isSignal: true, isRequired: false, transformFunction: null }, sideLineVerticalPadding: { classPropertyName: "sideLineVerticalPadding", publicName: "sideLineVerticalPadding", isSignal: true, isRequired: false, transformFunction: null }, minLineSize: { classPropertyName: "minLineSize", publicName: "minLineSize", isSignal: true, isRequired: false, transformFunction: null }, barToSpacerRatio: { classPropertyName: "barToSpacerRatio", publicName: "barToSpacerRatio", isSignal: true, isRequired: false, transformFunction: null }, middleLineVerticalPadding: { classPropertyName: "middleLineVerticalPadding", publicName: "middleLineVerticalPadding", isSignal: true, isRequired: false, transformFunction: null }, barColor: { classPropertyName: "barColor", publicName: "barColor", isSignal: true, isRequired: false, transformFunction: null }, spacerColor: { classPropertyName: "spacerColor", publicName: "spacerColor", isSignal: true, isRequired: false, transformFunction: null }, chartLabels: { classPropertyName: "chartLabels", publicName: "chartLabels", isSignal: true, isRequired: false, transformFunction: null }, sectionColors: { classPropertyName: "sectionColors", publicName: "sectionColors", isSignal: true, isRequired: false, transformFunction: null }, tooltipPercentOfTotal: { classPropertyName: "tooltipPercentOfTotal", publicName: "tooltipPercentOfTotal", isSignal: true, isRequired: false, transformFunction: null }, emptyChartWhenNoData: { classPropertyName: "emptyChartWhenNoData", publicName: "emptyChartWhenNoData", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueClicked: "valueClicked" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"funnel-container\" data-testid=\"funnel-chart\" #container (cngWindowResize)=\"updateChart()\">\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (!loading()) {\n @for (pos of sectionTooltips(); track pos.key) {\n <clr-signpost\n [attr.data-testid]=\"'funnel-chart-section-signpost-' + pos.key\"\n [style.left.px]=\"pos.x\"\n [style.top.px]=\"pos.y\"\n >\n <cds-icon\n clrSignpostTrigger\n [attr.data-testid]=\"'funnel-chart-section-signpost-trigger-' + pos.key\"\n shape=\"info-circle\"\n size=\"18\"\n />\n <clr-signpost-content\n clrPosition=\"bottom-left\"\n [attr.data-testid]=\"'funnel-chart-section-signpost-content-' + pos.key\"\n *clrIfOpen\n >\n <p class=\"mt-0\" [attr.data-testid]=\"'funnel-chart-section-description-' + pos.key\">{{ pos.description }}</p>\n </clr-signpost-content>\n </clr-signpost>\n }\n }\n @if (loading()) {\n @if (orientation() === 'centered') {\n <cng-funnel-skeleton data-testid=\"funnel-chart-skeleton\" [centered]=\"true\" />\n } @else {\n <cng-funnel-skeleton data-testid=\"funnel-chart-skeleton\" />\n }\n }\n @if (tooltipPosition()) {\n @if (orientation() === 'centered') {\n <!-- \u2500\u2500 Centered mode tooltip \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <cng-chart-tooltip\n data-testid=\"funnel-chart-centered-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedSpacerItem() ? centeredSpacerCssColor() : centeredBarCssColor()\"\n [tooltipClickable]=\"!selectedSpacerItem()\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"\n selectedItem() &&\n valueClicked.emit({\n value: selectedItem().value,\n label: selectedItem().label,\n key: selectedItem().key,\n section: undefined,\n })\n \"\n >\n <ng-container ngProjectAs=\"cng-title\">\n @if (selectedSpacerItem()) {\n {{ data()[selectedSpacerItem().index].label }} \u2192 {{ data()[selectedSpacerItem().index + 1].label }}\n } @else {\n ({{ selectedItem().value }}) {{ selectedItem().label }}\n }\n </ng-container>\n\n @if (selectedSpacerItem()) {\n <p class=\"mt-0\" data-testid=\"funnel-chart-centered-tooltip-transition\">\n <strong\n >{{ data()[selectedSpacerItem().index].value }} \u2192\n {{ data()[selectedSpacerItem().index + 1].value }}</strong\n >\n </p>\n @for (section of data()[selectedSpacerItem().index].sections ?? []; track section.key) {\n @let drillable = section.value > 0;\n <p\n class=\"tooltip-row mt-0 mt-0-5 d-flex\"\n [attr.data-testid]=\"'funnel-chart-centered-tooltip-section-' + section.key\"\n >\n <strong>{{ section.label }}: </strong>\n <span\n class=\"row-right\"\n [attr.data-testid]=\"'funnel-chart-centered-tooltip-section-value-' + section.key\"\n [class.has-more-info]=\"drillable\"\n (click)=\"\n drillable &&\n valueClicked.emit({\n value: section.value,\n label: data()[selectedSpacerItem().index].label + ' | ' + section.label,\n key: data()[selectedSpacerItem().index].key,\n section: section.key,\n })\n \"\n >{{ section.value }}</span\n >\n ({{ pct(section.value, data()[selectedSpacerItem().index].value) }}%)\n </p>\n }\n } @else {\n <p class=\"mt-0\" data-testid=\"funnel-chart-centered-tooltip-percentage\">\n {{ pct(selectedItem().value, total()) }}% {{ tooltipPercentOfTotal() || resolvedChartLabels().all }}\n </p>\n }\n </cng-chart-tooltip>\n } @else {\n <!-- \u2500\u2500 Default mode tooltip \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <cng-chart-tooltip\n data-testid=\"funnel-chart-default-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"undefined\"\n [tooltipClickable]=\"false\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n >\n <ng-container ngProjectAs=\"cng-title\">{{ selectedItemLabel() }}</ng-container>\n @for (section of selectedItem().sections; track section.key) {\n @let drillable = section.value > 0;\n <p\n class=\"tooltip-row mt-0 mt-0-5 d-flex\"\n [attr.data-testid]=\"'funnel-chart-default-tooltip-section-' + section.key\"\n >\n <span>\n <div class=\"color-square mr-0-5\" [style.background-color]=\"section.cssColor\"></div>\n </span>\n <strong>{{ section.label }}: </strong>\n <span\n class=\"row-right\"\n [attr.data-testid]=\"'funnel-chart-default-tooltip-section-value-' + section.key\"\n [class.has-more-info]=\"drillable\"\n (click)=\"\n drillable &&\n valueClicked.emit({\n value: section.value,\n label: selectedItemLabel() + ' | ' + section.label,\n key: selectedItem().key,\n section: section.key,\n })\n \"\n >{{ section.value }}</span\n >\n ({{ section.percentage }}%)\n </p>\n }\n\n <p class=\"tooltip-row mt-0-5\" data-testid=\"funnel-chart-default-tooltip-total\">\n <strong\n >{{\n (prefixTotalWithLabel() ? selectedItemLabel() + ' ' : '') + resolvedChartLabels().total\n }}\n : </strong\n >\n <span\n class=\"has-more-info\"\n data-testid=\"funnel-chart-default-tooltip-total-value\"\n (click)=\"\n valueClicked.emit({\n value: selectedItem().value,\n label: selectedItemLabel(),\n key: selectedItem().key,\n section: undefined,\n })\n \"\n >{{ selectedItem().value }}</span\n >\n </p>\n\n <ng-container ngProjectAs=\"cng-footer\">\n <p class=\"tooltip-row mt-0\" data-testid=\"funnel-chart-default-tooltip-all\">\n <strong>{{ resolvedChartLabels().all }}: </strong>\n <span class=\"row-right\" data-testid=\"funnel-chart-default-tooltip-all-value\">{{ total() }}</span>\n </p>\n </ng-container>\n </cng-chart-tooltip>\n }\n }\n @if (showExportButton() && !loading() && hasData()) {\n <cng-chart-export-button\n class=\"funnel-export-btn\"\n data-testid=\"funnel-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}.funnel-container{height:100%;width:100%;max-width:1400px;margin:auto;position:relative}svg{width:100%;height:100%}clr-signpost{position:absolute!important}.tooltip-row{display:flex;justify-content:space-between;align-items:center}.row-right{margin-left:auto}.funnel-export-btn{position:absolute;bottom:0;right:0;opacity:0;pointer-events:none;transition:opacity .2s ease}.funnel-container:hover .funnel-export-btn{opacity:1;pointer-events:auto}\n"], dependencies: [{ kind: "component", type: i1.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }, { kind: "component", type: i1.ClrSignpost, selector: "clr-signpost", inputs: ["clrSignpostTriggerAriaLabel", "clrSignpostHideTrigger"] }, { kind: "component", type: i1.ClrSignpostContent, selector: "clr-signpost-content", inputs: ["clrSignpostCloseAriaLabel", "clrPosition"] }, { kind: "directive", type: i1.ClrSignpostTrigger, selector: "[clrSignpostTrigger]" }, { kind: "directive", type: i2.ClrIfOpen, selector: "[clrIfOpen]", inputs: ["clrIfOpen"], outputs: ["clrIfOpenChange"] }, { kind: "component", type: ChartExportButtonComponent, selector: "cng-chart-export-button", inputs: ["svgRef", "filename", "buttonTitle", "legendItems"] }, { kind: "component", type: ChartTooltipComponent, selector: "cng-chart-tooltip", inputs: ["tooltipPosition", "tooltipOrientation", "squareColor", "tooltipClickable"], outputs: ["tooltipClosed", "tooltipHeaderClicked"] }, { kind: "directive", type: OutsideClickDirective, selector: "[cngOutsideClick]", outputs: ["cngOutsideClick"] }, { kind: "directive", type: WindowResizeDirective, selector: "[cngWindowResize]", inputs: ["debounce", "includeFirst"], outputs: ["cngWindowResize"] }, { kind: "component", type: FunnelSkeletonComponent, selector: "cng-funnel-skeleton", inputs: ["centered"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2897
3199
|
}
|
|
2898
3200
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: FunnelChartComponent, decorators: [{
|
|
2899
3201
|
type: Component,
|
|
2900
|
-
args: [{ selector: 'clr-funnel-chart', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"funnel-container\" data-testid=\"funnel-chart\" #container (cngWindowResize)=\"updateChart()\">\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (!loading()) {\n @for (pos of sectionTooltips(); track pos.key) {\n <clr-signpost\n [attr.data-testid]=\"'funnel-chart-section-signpost-' + pos.key\"\n [style.left.px]=\"pos.x\"\n [style.top.px]=\"pos.y\"\n >\n <cds-icon\n clrSignpostTrigger\n [attr.data-testid]=\"'funnel-chart-section-signpost-trigger-' + pos.key\"\n shape=\"info-circle\"\n size=\"18\"\n />\n <clr-signpost-content\n clrPosition=\"bottom-left\"\n [attr.data-testid]=\"'funnel-chart-section-signpost-content-' + pos.key\"\n >\n <p class=\"mt-0\" [attr.data-testid]=\"'funnel-chart-section-description-' + pos.key\">{{ pos.description }}</p>\n </clr-signpost-content>\n </clr-signpost>\n }\n }\n @if (loading()) {\n <cng-
|
|
2901
|
-
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], showExportButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExportButton", required: false }] }], exportButtonTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportButtonTitle", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], textSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "textSize", required: false }] }], lineTextPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "lineTextPadding", required: false }] }], barGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "barGap", required: false }] }], sideLineVerticalPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "sideLineVerticalPadding", required: false }] }], minLineSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLineSize", required: false }] }], barToSpacerRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "barToSpacerRatio", required: false }] }], middleLineVerticalPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "middleLineVerticalPadding", required: false }] }], barColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "barColor", required: false }] }], spacerColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "spacerColor", required: false }] }], chartLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartLabels", required: false }] }], sectionColors: [{ type: i0.Input, args: [{ isSignal: true, alias: "sectionColors", required: false }] }], valueClicked: [{ type: i0.Output, args: ["valueClicked"] }] } });
|
|
3202
|
+
args: [{ selector: 'clr-funnel-chart', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"funnel-container\" data-testid=\"funnel-chart\" #container (cngWindowResize)=\"updateChart()\">\n <svg [class.d-none]=\"loading() || !hasData()\" #chart></svg>\n\n @if (!loading()) {\n @for (pos of sectionTooltips(); track pos.key) {\n <clr-signpost\n [attr.data-testid]=\"'funnel-chart-section-signpost-' + pos.key\"\n [style.left.px]=\"pos.x\"\n [style.top.px]=\"pos.y\"\n >\n <cds-icon\n clrSignpostTrigger\n [attr.data-testid]=\"'funnel-chart-section-signpost-trigger-' + pos.key\"\n shape=\"info-circle\"\n size=\"18\"\n />\n <clr-signpost-content\n clrPosition=\"bottom-left\"\n [attr.data-testid]=\"'funnel-chart-section-signpost-content-' + pos.key\"\n *clrIfOpen\n >\n <p class=\"mt-0\" [attr.data-testid]=\"'funnel-chart-section-description-' + pos.key\">{{ pos.description }}</p>\n </clr-signpost-content>\n </clr-signpost>\n }\n }\n @if (loading()) {\n @if (orientation() === 'centered') {\n <cng-funnel-skeleton data-testid=\"funnel-chart-skeleton\" [centered]=\"true\" />\n } @else {\n <cng-funnel-skeleton data-testid=\"funnel-chart-skeleton\" />\n }\n }\n @if (tooltipPosition()) {\n @if (orientation() === 'centered') {\n <!-- \u2500\u2500 Centered mode tooltip \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <cng-chart-tooltip\n data-testid=\"funnel-chart-centered-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"selectedSpacerItem() ? centeredSpacerCssColor() : centeredBarCssColor()\"\n [tooltipClickable]=\"!selectedSpacerItem()\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n (tooltipHeaderClicked)=\"\n selectedItem() &&\n valueClicked.emit({\n value: selectedItem().value,\n label: selectedItem().label,\n key: selectedItem().key,\n section: undefined,\n })\n \"\n >\n <ng-container ngProjectAs=\"cng-title\">\n @if (selectedSpacerItem()) {\n {{ data()[selectedSpacerItem().index].label }} \u2192 {{ data()[selectedSpacerItem().index + 1].label }}\n } @else {\n ({{ selectedItem().value }}) {{ selectedItem().label }}\n }\n </ng-container>\n\n @if (selectedSpacerItem()) {\n <p class=\"mt-0\" data-testid=\"funnel-chart-centered-tooltip-transition\">\n <strong\n >{{ data()[selectedSpacerItem().index].value }} \u2192\n {{ data()[selectedSpacerItem().index + 1].value }}</strong\n >\n </p>\n @for (section of data()[selectedSpacerItem().index].sections ?? []; track section.key) {\n @let drillable = section.value > 0;\n <p\n class=\"tooltip-row mt-0 mt-0-5 d-flex\"\n [attr.data-testid]=\"'funnel-chart-centered-tooltip-section-' + section.key\"\n >\n <strong>{{ section.label }}: </strong>\n <span\n class=\"row-right\"\n [attr.data-testid]=\"'funnel-chart-centered-tooltip-section-value-' + section.key\"\n [class.has-more-info]=\"drillable\"\n (click)=\"\n drillable &&\n valueClicked.emit({\n value: section.value,\n label: data()[selectedSpacerItem().index].label + ' | ' + section.label,\n key: data()[selectedSpacerItem().index].key,\n section: section.key,\n })\n \"\n >{{ section.value }}</span\n >\n ({{ pct(section.value, data()[selectedSpacerItem().index].value) }}%)\n </p>\n }\n } @else {\n <p class=\"mt-0\" data-testid=\"funnel-chart-centered-tooltip-percentage\">\n {{ pct(selectedItem().value, total()) }}% {{ tooltipPercentOfTotal() || resolvedChartLabels().all }}\n </p>\n }\n </cng-chart-tooltip>\n } @else {\n <!-- \u2500\u2500 Default mode tooltip \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <cng-chart-tooltip\n data-testid=\"funnel-chart-default-tooltip\"\n [tooltipPosition]=\"tooltipPosition()\"\n [tooltipOrientation]=\"tooltipOrientation()\"\n [squareColor]=\"undefined\"\n [tooltipClickable]=\"false\"\n (tooltipClosed)=\"resetTooltip()\"\n (cngOutsideClick)=\"resetTooltip()\"\n >\n <ng-container ngProjectAs=\"cng-title\">{{ selectedItemLabel() }}</ng-container>\n @for (section of selectedItem().sections; track section.key) {\n @let drillable = section.value > 0;\n <p\n class=\"tooltip-row mt-0 mt-0-5 d-flex\"\n [attr.data-testid]=\"'funnel-chart-default-tooltip-section-' + section.key\"\n >\n <span>\n <div class=\"color-square mr-0-5\" [style.background-color]=\"section.cssColor\"></div>\n </span>\n <strong>{{ section.label }}: </strong>\n <span\n class=\"row-right\"\n [attr.data-testid]=\"'funnel-chart-default-tooltip-section-value-' + section.key\"\n [class.has-more-info]=\"drillable\"\n (click)=\"\n drillable &&\n valueClicked.emit({\n value: section.value,\n label: selectedItemLabel() + ' | ' + section.label,\n key: selectedItem().key,\n section: section.key,\n })\n \"\n >{{ section.value }}</span\n >\n ({{ section.percentage }}%)\n </p>\n }\n\n <p class=\"tooltip-row mt-0-5\" data-testid=\"funnel-chart-default-tooltip-total\">\n <strong\n >{{\n (prefixTotalWithLabel() ? selectedItemLabel() + ' ' : '') + resolvedChartLabels().total\n }}\n : </strong\n >\n <span\n class=\"has-more-info\"\n data-testid=\"funnel-chart-default-tooltip-total-value\"\n (click)=\"\n valueClicked.emit({\n value: selectedItem().value,\n label: selectedItemLabel(),\n key: selectedItem().key,\n section: undefined,\n })\n \"\n >{{ selectedItem().value }}</span\n >\n </p>\n\n <ng-container ngProjectAs=\"cng-footer\">\n <p class=\"tooltip-row mt-0\" data-testid=\"funnel-chart-default-tooltip-all\">\n <strong>{{ resolvedChartLabels().all }}: </strong>\n <span class=\"row-right\" data-testid=\"funnel-chart-default-tooltip-all-value\">{{ total() }}</span>\n </p>\n </ng-container>\n </cng-chart-tooltip>\n }\n }\n @if (showExportButton() && !loading() && hasData()) {\n <cng-chart-export-button\n class=\"funnel-export-btn\"\n data-testid=\"funnel-chart-export\"\n [svgRef]=\"svgElement()\"\n [filename]=\"exportFilename()\"\n [buttonTitle]=\"exportButtonTitle()\"\n />\n }\n</div>\n", styles: [":host{display:block;width:100%;height:100%}.funnel-container{height:100%;width:100%;max-width:1400px;margin:auto;position:relative}svg{width:100%;height:100%}clr-signpost{position:absolute!important}.tooltip-row{display:flex;justify-content:space-between;align-items:center}.row-right{margin-left:auto}.funnel-export-btn{position:absolute;bottom:0;right:0;opacity:0;pointer-events:none;transition:opacity .2s ease}.funnel-container:hover .funnel-export-btn{opacity:1;pointer-events:auto}\n"] }]
|
|
3203
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], showExportButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showExportButton", required: false }] }], exportButtonTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportButtonTitle", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], tooltipOrientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOrientation", required: false }] }], prefixTotalWithLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefixTotalWithLabel", required: false }] }], textSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "textSize", required: false }] }], lineTextPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "lineTextPadding", required: false }] }], barGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "barGap", required: false }] }], sideLineVerticalPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "sideLineVerticalPadding", required: false }] }], minLineSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLineSize", required: false }] }], barToSpacerRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "barToSpacerRatio", required: false }] }], middleLineVerticalPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "middleLineVerticalPadding", required: false }] }], barColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "barColor", required: false }] }], spacerColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "spacerColor", required: false }] }], chartLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartLabels", required: false }] }], sectionColors: [{ type: i0.Input, args: [{ isSignal: true, alias: "sectionColors", required: false }] }], tooltipPercentOfTotal: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPercentOfTotal", required: false }] }], emptyChartWhenNoData: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyChartWhenNoData", required: false }] }], valueClicked: [{ type: i0.Output, args: ["valueClicked"] }] } });
|
|
2902
3204
|
|
|
2903
3205
|
const PREFERRED_ORDER = ['top-right', 'top-left', 'bottom-right', 'bottom-left'];
|
|
2904
3206
|
class AutoPositionDirective {
|
|
@@ -3045,7 +3347,10 @@ class ClrChartsModule {
|
|
|
3045
3347
|
ChartSkeletonComponent,
|
|
3046
3348
|
ChartTooltipComponent,
|
|
3047
3349
|
OutsideClickDirective,
|
|
3048
|
-
WindowResizeDirective
|
|
3350
|
+
WindowResizeDirective,
|
|
3351
|
+
DonutChartSkeletonComponent,
|
|
3352
|
+
ChartLegendSkeletonComponent,
|
|
3353
|
+
FunnelSkeletonComponent], exports: [AreaChartComponent,
|
|
3049
3354
|
BarChartComponent,
|
|
3050
3355
|
ComboChartComponent,
|
|
3051
3356
|
FunnelChartComponent,
|
|
@@ -3060,7 +3365,10 @@ class ClrChartsModule {
|
|
|
3060
3365
|
ChartAlertOverlayComponent,
|
|
3061
3366
|
ChartExportButtonComponent,
|
|
3062
3367
|
ChartSkeletonComponent,
|
|
3063
|
-
ChartTooltipComponent
|
|
3368
|
+
ChartTooltipComponent,
|
|
3369
|
+
DonutChartSkeletonComponent,
|
|
3370
|
+
ChartLegendSkeletonComponent,
|
|
3371
|
+
FunnelSkeletonComponent] }); }
|
|
3064
3372
|
}
|
|
3065
3373
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: ClrChartsModule, decorators: [{
|
|
3066
3374
|
type: NgModule,
|
|
@@ -3079,6 +3387,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
3079
3387
|
ChartTooltipComponent,
|
|
3080
3388
|
OutsideClickDirective,
|
|
3081
3389
|
WindowResizeDirective,
|
|
3390
|
+
DonutChartSkeletonComponent,
|
|
3391
|
+
ChartLegendSkeletonComponent,
|
|
3392
|
+
FunnelSkeletonComponent,
|
|
3082
3393
|
],
|
|
3083
3394
|
declarations: [...CLR_CHARTS_DECLARATIONS],
|
|
3084
3395
|
exports: [...CLR_CHARTS_DECLARATIONS],
|