@ids-group-ltd/ids-design-system 0.13.4 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +584 -0
- package/components.md +100 -52
- package/design-system.md +2 -0
- package/docs/agent/INDEX.md +3 -2
- package/docs/agent/charts/column-series-component.md +1 -1
- package/docs/agent/charts/ds-bar-chart.md +2 -1
- package/docs/agent/charts/ds-chart.md +3 -1
- package/docs/agent/charts/ds-config.md +3 -1
- package/docs/agent/charts/ds-line-chart.md +3 -3
- package/docs/agent/charts/ds-pie-chart.md +4 -3
- package/docs/agent/charts/line-series-component.md +1 -1
- package/docs/agent/feedback/ds-alert.md +1 -0
- package/docs/agent/feedback/ds-badge.md +1 -1
- package/docs/agent/feedback/ds-banner.md +1 -0
- package/docs/agent/feedback/ds-skeleton.md +2 -2
- package/docs/agent/feedback/ds-tag.md +1 -1
- package/docs/agent/forms/ds-autocomplete.md +2 -2
- package/docs/agent/forms/ds-button.md +1 -1
- package/docs/agent/forms/ds-color-picker.md +1 -1
- package/docs/agent/forms/ds-date-picker.md +2 -2
- package/docs/agent/forms/ds-filter-bar.md +1 -1
- package/docs/agent/forms/ds-icon-button.md +1 -1
- package/docs/agent/forms/ds-input.md +1 -1
- package/docs/agent/forms/ds-multi-select.md +2 -2
- package/docs/agent/forms/ds-otp-input.md +1 -1
- package/docs/agent/forms/ds-search.md +3 -3
- package/docs/agent/forms/ds-split-button.md +1 -1
- package/docs/agent/forms/ds-switch.md +4 -2
- package/docs/agent/forms/ds-textarea.md +2 -1
- package/docs/agent/foundations/tokens.md +1 -1
- package/docs/agent/navigation/ds-app-layout.md +2 -2
- package/docs/agent/navigation/ds-auth-layout.md +4 -4
- package/docs/agent/navigation/ds-page-header.md +1 -1
- package/docs/agent/navigation/ds-pagination.md +2 -2
- package/docs/agent/platform/ds-config.md +3 -3
- package/docs/agent/platform/ds-intl.md +33 -0
- package/docs/agent/surfaces/ds-accordion.md +2 -2
- package/docs/agent/tables/ds-cell-template.md +1 -1
- package/docs/agent/tables/ds-table.md +5 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +9 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +21 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +9 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +8 -8
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +13 -8
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs +5 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +5 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +12 -8
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +21 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +56 -32
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +7 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +4 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs +15 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +5 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +45 -39
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +414 -105
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +9 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +22 -18
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +16 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +4 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +7 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +12 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +13 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +40 -42
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs +13 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +3 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +5 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +27 -23
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +62 -13
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +15 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +5 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +13 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +22 -13
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs +12 -11
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +55 -29
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +41 -12
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +13 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +4 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +4 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +5 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +37 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +8 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs +5 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +9 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +6 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +20 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +18 -15
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +9 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +47 -38
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +5 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +9 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +26 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +12 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +8 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +5 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +14 -15
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +345 -66
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +361 -6
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.10.0.json +1 -1
- package/migrations/0.10.1.json +1 -1
- package/migrations/0.12.2.json +4 -1
- package/migrations/0.13.3.json +32 -10
- package/migrations/0.13.4.json +1630 -132
- package/migrations/0.14.0.json +615 -0
- package/migrations/0.14.1.json +856 -0
- package/migrations/0.5.0.json +10 -4
- package/migrations/0.7.0.json +5 -2
- package/migrations/0.9.0.json +5 -2
- package/migrations/README.md +7 -2
- package/package.json +1 -1
- package/schematics/check-overrides/index.cjs +56 -0
- package/schematics/check-overrides/scan.cjs +74 -0
- package/schematics/check-overrides/schema.json +19 -0
- package/schematics/check-overrides/surface.json +2304 -0
- package/schematics/collection.json +5 -0
- package/styles/_chart-frame.scss +4 -4
- package/styles/_chart-interactive.scss +33 -0
- package/styles/_chart-motion.scss +17 -10
- package/styles/_field-box.scss +12 -0
- package/styles/_overlay-motion.scss +20 -10
- package/styles/_skeleton-shimmer.scss +4 -1
- package/styles/_tokens-charts.scss +1 -1
- package/styles/_tokens.scss +1 -1
- package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +11 -2
- package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +4 -0
- package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +5 -2
- package/types/ids-group-ltd-ids-design-system-components-auth-layout.d.ts +5 -5
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +7 -4
- package/types/ids-group-ltd-ids-design-system-components-avatar-group.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-avatar.d.ts +5 -3
- package/types/ids-group-ltd-ids-design-system-components-badge.d.ts +6 -2
- package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +4 -0
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +20 -14
- package/types/ids-group-ltd-ids-design-system-components-breadcrumbs.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +2 -2
- package/types/ids-group-ltd-ids-design-system-components-chart-data-table.d.ts +5 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +11 -6
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +155 -36
- package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +6 -2
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +11 -8
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +9 -3
- package/types/ids-group-ltd-ids-design-system-components-description-list.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-filter-bar.d.ts +9 -4
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +13 -13
- package/types/ids-group-ltd-ids-design-system-components-heatmap-chart.d.ts +7 -5
- package/types/ids-group-ltd-ids-design-system-components-input.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +17 -11
- package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +6 -0
- package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +11 -6
- package/types/ids-group-ltd-ids-design-system-components-number-stepper.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-otp-input.d.ts +6 -2
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +17 -10
- package/types/ids-group-ltd-ids-design-system-components-password-rules.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +25 -14
- package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +15 -6
- package/types/ids-group-ltd-ids-design-system-components-search.d.ts +9 -3
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +3 -2
- package/types/ids-group-ltd-ids-design-system-components-sidenav-footer.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-slider.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-spinner.d.ts +6 -4
- package/types/ids-group-ltd-ids-design-system-components-split-button.d.ts +5 -2
- package/types/ids-group-ltd-ids-design-system-components-stepper.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +10 -1
- package/types/ids-group-ltd-ids-design-system-components-table-export.d.ts +1 -0
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +44 -28
- package/types/ids-group-ltd-ids-design-system-components-tabs.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-tag.d.ts +6 -2
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +15 -0
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-w3w.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-waterfall-chart.d.ts +7 -5
- package/types/ids-group-ltd-ids-design-system-components.d.ts +83 -17
- package/types/ids-group-ltd-ids-design-system-core.d.ts +420 -14
- package/types/ids-group-ltd-ids-design-system.d.ts +3 -3
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, input, numberAttribute, booleanAttribute, inject, ElementRef, computed, signal, effect, afterRenderEffect, viewChild, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component, output, viewChildren } from '@angular/core';
|
|
3
|
-
import { domainMinOf, niceDomain, linearScale, tickValues, roundStepAtLeast, resolveChartDefaults, elementWidth, bandScale, rotationWouldFit, labelInterval,
|
|
2
|
+
import { InjectionToken, input, numberAttribute, booleanAttribute, inject, ElementRef, NgZone, PLATFORM_ID, computed, signal, effect, afterRenderEffect, viewChild, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component, output, viewChildren } from '@angular/core';
|
|
3
|
+
import { domainMinOf, niceDomain, linearScale, tickValues, roundStepAtLeast, chartRenderGate, resolveChartDefaults, elementWidth, bandScale, rotationWouldFit, labelInterval, leaveMark, chartValueFormat, listenForMarkFocus, CHART_SERIES_COLORS, staggerDelay, markOf, rovingMarks, describeShare, lineSegments, linePath, areaPath, bandPath, nextRovingIndex, focusMark } from '@ids-group-ltd/ids-design-system/components';
|
|
4
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
4
5
|
import { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';
|
|
5
|
-
import { chartActiveMark } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
|
|
6
|
+
import { chartActiveMark, ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
|
|
7
|
+
import { DS_INTL, injectDsLocale, ICONS } from '@ids-group-ltd/ids-design-system/core';
|
|
6
8
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
7
|
-
import { ICONS } from '@ids-group-ltd/ids-design-system/core';
|
|
8
9
|
|
|
9
10
|
const CHART_DEFAULT_TICK_COUNT = 5;
|
|
10
11
|
const CHART_AXIS_LABEL_GAP = 8;
|
|
12
|
+
/** Room a rotated axis title needs across the gutter: its line box, turned on its side. */
|
|
13
|
+
const CHART_AXIS_TITLE_BAND = 20;
|
|
11
14
|
const CHART_CATEGORY_LABEL_OFFSET = 18;
|
|
12
15
|
const CHART_BAND_PADDING = 0.3;
|
|
13
16
|
/** What the chart lays out at while it measures zero: under SSR, while the host is
|
|
@@ -300,6 +303,7 @@ function categoryAt(x, plotLeft, plotWidth, categoryCount) {
|
|
|
300
303
|
const CHART_SCALES = new InjectionToken('CHART_SCALES');
|
|
301
304
|
|
|
302
305
|
class ChartComponent {
|
|
306
|
+
renderReady = chartRenderGate();
|
|
303
307
|
/** The category axis. Every projected mark is positioned against this list, so its length is
|
|
304
308
|
* what decides how many bands the plot has. */
|
|
305
309
|
categories = input([], ...(ngDevMode ? [{ debugName: "categories" }] : /* istanbul ignore next */ []));
|
|
@@ -313,10 +317,12 @@ class ChartComponent {
|
|
|
313
317
|
* only comparable when both are pinned. */
|
|
314
318
|
max = input(null, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
|
|
315
319
|
/** Draws a band and a crosshair down the category under the pointer, and reports that category
|
|
316
|
-
* to every mark through `activeIndex`.
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
|
|
320
|
+
* to every mark through `activeIndex`. On a plot of two or more marks that show a tooltip, the
|
|
321
|
+
* panel then names every mark's reading at that category wherever in it the pointer is.
|
|
322
|
+
* `'auto'`, the default, is `'category'` for such a composed plot and `'none'` for a plot of one
|
|
323
|
+
* mark, whose marks already answer per mark: two affordances on one plot read as two different
|
|
324
|
+
* questions. */
|
|
325
|
+
cursor = input('auto', ...(ngDevMode ? [{ debugName: "cursor" }] : /* istanbul ignore next */ []));
|
|
320
326
|
/** Whether a press holds the category cursor where it is, so the reader can look away from the
|
|
321
327
|
* plot with the comparison still on screen. Released by pressing it again, by Escape, or by a
|
|
322
328
|
* press outside the plot. */
|
|
@@ -358,17 +364,16 @@ class ChartComponent {
|
|
|
358
364
|
* resize when the data lands. */
|
|
359
365
|
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
360
366
|
/** Shown in place of the plot when `categories` is empty. Unset falls back to
|
|
361
|
-
* `
|
|
367
|
+
* `DS_INTL.chart.empty`. */
|
|
362
368
|
emptyText = input(null, ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
363
369
|
/** Shows `errorText` in place of the plot. Separate from `loading` and from an empty
|
|
364
370
|
* `categories`, because "the request failed" and "there is nothing to show" read the same to a
|
|
365
371
|
* reader and mean opposite things. */
|
|
366
372
|
error = input(false, { ...(ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
367
|
-
/** The message the error state prints. Unset falls back to `
|
|
368
|
-
* `'Could not load the data'`. */
|
|
373
|
+
/** The message the error state prints. Unset falls back to `DS_INTL.chart.error`. */
|
|
369
374
|
errorText = input(null, ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
370
|
-
/** Formats the value-axis ticks. Unset falls back to `DS_CONFIG.chart.valueFormat`, then
|
|
371
|
-
*
|
|
375
|
+
/** Formats the value-axis ticks. Unset falls back to `DS_CONFIG.chart.valueFormat`, then
|
|
376
|
+
* `DS_CONFIG.locale` / `LOCALE_ID`. */
|
|
372
377
|
valueFormat = input(null, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
|
|
373
378
|
/** How the second value axis relates to the first, once a mark has reported against it. The
|
|
374
379
|
* same four words `ds-line-chart` takes. */
|
|
@@ -387,15 +392,20 @@ class ChartComponent {
|
|
|
387
392
|
/** `axisLabel` for the second axis. */
|
|
388
393
|
secondaryAxisLabel = input(null, ...(ngDevMode ? [{ debugName: "secondaryAxisLabel" }] : /* istanbul ignore next */ []));
|
|
389
394
|
defaults = resolveChartDefaults(this);
|
|
395
|
+
intl = inject(DS_INTL);
|
|
390
396
|
frameResolved = this.defaults.frame;
|
|
391
397
|
emptyTextResolved = this.defaults.emptyText;
|
|
392
398
|
errorTextResolved = this.defaults.errorText;
|
|
393
399
|
valueFormatResolved = this.defaults.valueFormat;
|
|
394
400
|
host = inject(ElementRef);
|
|
401
|
+
zone = inject(NgZone);
|
|
402
|
+
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
395
403
|
/** The `<svg>`'s own rendered width: `:host(.framed)` carries the frame padding, so the host's
|
|
396
404
|
* CONTENT box - which is what a `ResizeObserver` reports - is the box the canvas fills at
|
|
397
405
|
* `inline-size: 100%`. Measuring the host is therefore measuring the canvas. */
|
|
398
406
|
measuredWidth = elementWidth(this.host);
|
|
407
|
+
/** Server-rendered output has no width to wait for, so it draws at the stand-in. */
|
|
408
|
+
measured = computed(() => !this.isBrowser || this.measuredWidth() > 0, ...(ngDevMode ? [{ debugName: "measured" }] : /* istanbul ignore next */ []));
|
|
399
409
|
viewWidth = computed(() => this.measuredWidth() || CHART_FALLBACK_WIDTH, ...(ngDevMode ? [{ debugName: "viewWidth" }] : /* istanbul ignore next */ []));
|
|
400
410
|
/** Whether the marks may animate yet. The first frame draws at `CHART_FALLBACK_WIDTH` scaled to
|
|
401
411
|
* fit, so the measurement that follows moves every mark - and a mark that transitions its
|
|
@@ -413,19 +423,32 @@ class ChartComponent {
|
|
|
413
423
|
if (this.settled() || this.measuredWidth() === 0) {
|
|
414
424
|
return;
|
|
415
425
|
}
|
|
426
|
+
let first = 0;
|
|
416
427
|
let second = 0;
|
|
417
|
-
|
|
418
|
-
|
|
428
|
+
// Outside the zone: under zone.js each frame callback is a full application tick, two per
|
|
429
|
+
// chart, and the signal write schedules the one render this needs by itself.
|
|
430
|
+
this.zone.runOutsideAngular(() => {
|
|
431
|
+
first = requestAnimationFrame(() => {
|
|
432
|
+
second = requestAnimationFrame(() => this.settled.set(true));
|
|
433
|
+
});
|
|
419
434
|
});
|
|
420
435
|
onCleanup(() => {
|
|
421
436
|
cancelAnimationFrame(first);
|
|
422
437
|
cancelAnimationFrame(second);
|
|
423
438
|
});
|
|
424
439
|
});
|
|
440
|
+
effect((onCleanup) => {
|
|
441
|
+
const canvas = this.canvasElement()?.nativeElement;
|
|
442
|
+
if (canvas && this.cursorResolved() === 'category') {
|
|
443
|
+
onCleanup(this.listenForCursor(canvas));
|
|
444
|
+
}
|
|
445
|
+
});
|
|
425
446
|
// The read phase, so every `getComputedTextLength` lands in one batch before any write:
|
|
426
|
-
// interleaving them forces a synchronous layout per label.
|
|
447
|
+
// interleaving them forces a synchronous layout per label. It re-measures when a label's text
|
|
448
|
+
// changes, and only then - not when a resize merely moves the labels.
|
|
427
449
|
afterRenderEffect({
|
|
428
450
|
read: () => {
|
|
451
|
+
this.labelTexts();
|
|
429
452
|
this.measuredLabelWidth.set(this.widestLabel('.axis-label.is-primary'));
|
|
430
453
|
this.measuredSecondaryLabelWidth.set(this.widestLabel('.axis-label.is-secondary'));
|
|
431
454
|
this.measuredCategoryLabelWidth.set(this.widestLabel('.category-label'));
|
|
@@ -461,7 +484,17 @@ class ChartComponent {
|
|
|
461
484
|
* This converges rather than oscillating: a tick's TEXT is decided by the domain and the tick
|
|
462
485
|
* count, neither of which the gutter feeds, so widening it moves the labels without rewriting
|
|
463
486
|
* them and the second measurement equals the first. */
|
|
464
|
-
effectiveAxisGutter = computed(() => Math.max(this.axisGutter(), this.measuredLabelWidth() + CHART_AXIS_LABEL_GAP), ...(ngDevMode ? [{ debugName: "effectiveAxisGutter" }] : /* istanbul ignore next */ []));
|
|
487
|
+
effectiveAxisGutter = computed(() => Math.max(this.axisGutter(), this.measuredLabelWidth() + CHART_AXIS_LABEL_GAP + this.axisTitleGutter()), ...(ngDevMode ? [{ debugName: "effectiveAxisGutter" }] : /* istanbul ignore next */ []));
|
|
488
|
+
/** A rotated axis title stands in the same gutter as the tick labels, so the gutter has to carry
|
|
489
|
+
* both or the widest tick runs through the title. Its own width is its line height, because it
|
|
490
|
+
* is turned on its side. */
|
|
491
|
+
axisTitleGutter = computed(() => this.axisLabel() ? CHART_AXIS_TITLE_BAND : 0, ...(ngDevMode ? [{ debugName: "axisTitleGutter" }] : /* istanbul ignore next */ []));
|
|
492
|
+
/** Where a rotated axis title sits: hard against the outer edge, with the tick labels between it
|
|
493
|
+
* and the plot. */
|
|
494
|
+
axisTitleX = computed(() => CHART_AXIS_TITLE_BAND / 2, ...(ngDevMode ? [{ debugName: "axisTitleX" }] : /* istanbul ignore next */ []));
|
|
495
|
+
/** Mirrors `axisTitleX` against the right edge, so the two titles stand the same distance from
|
|
496
|
+
* their own ticks. */
|
|
497
|
+
secondaryTitleX = computed(() => this.viewWidth() - CHART_AXIS_TITLE_BAND / 2, ...(ngDevMode ? [{ debugName: "secondaryTitleX" }] : /* istanbul ignore next */ []));
|
|
465
498
|
/** Widest secondary tick label, measured the same way and for the same reason as the primary
|
|
466
499
|
* one: those labels sit OUTSIDE the plot's right edge and an SVG canvas clips what a DOM
|
|
467
500
|
* column merely overflowed. */
|
|
@@ -469,8 +502,15 @@ class ChartComponent {
|
|
|
469
502
|
/** The plot gives the right-hand labels room only when they are drawn there - a stacked second
|
|
470
503
|
* axis puts both label columns down the left, so the plot keeps the full width. */
|
|
471
504
|
rightGutter = computed(() => this.hasSecondaryAxis() && !this.stacked()
|
|
472
|
-
? Math.max(this.axisGutter(), this.measuredSecondaryLabelWidth() +
|
|
505
|
+
? Math.max(this.axisGutter(), this.measuredSecondaryLabelWidth() +
|
|
506
|
+
CHART_AXIS_LABEL_GAP +
|
|
507
|
+
this.secondaryTitleGutter())
|
|
473
508
|
: CHART_EDGE_GUTTER, ...(ngDevMode ? [{ debugName: "rightGutter" }] : /* istanbul ignore next */ []));
|
|
509
|
+
/** The second axis's title stands in the right gutter exactly as the first one's stands in the
|
|
510
|
+
* left, so both sides reserve the same band and the plot sits centred between its two labels. */
|
|
511
|
+
secondaryTitleGutter = computed(() => this.secondaryAxisLabel() && this.hasSecondaryAxis()
|
|
512
|
+
? CHART_AXIS_TITLE_BAND
|
|
513
|
+
: 0, ...(ngDevMode ? [{ debugName: "secondaryTitleGutter" }] : /* istanbul ignore next */ []));
|
|
474
514
|
plot = computed(() => chartPlot(this.viewWidth(), this.plotHeight(), this.effectiveAxisGutter(), this.valueSpace(), this.rightGutter()), ...(ngDevMode ? [{ debugName: "plot" }] : /* istanbul ignore next */ []));
|
|
475
515
|
secondaryPlot = computed(() => {
|
|
476
516
|
const plot = this.plot();
|
|
@@ -498,6 +538,85 @@ class ChartComponent {
|
|
|
498
538
|
return next;
|
|
499
539
|
});
|
|
500
540
|
}
|
|
541
|
+
/** A template that replaces the panel's body, for a preset that prints more than label+value. */
|
|
542
|
+
tooltipTemplate = input(null, ...(ngDevMode ? [{ debugName: "tooltipTemplate" }] : /* istanbul ignore next */ []));
|
|
543
|
+
/** Extra clearance between the mark and the panel, for a chart that prints a value label in
|
|
544
|
+
* the gap the panel would otherwise take. */
|
|
545
|
+
tooltipExtraGap = input(0, { ...(ngDevMode ? { debugName: "tooltipExtraGap" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
546
|
+
tooltipSources = signal(new Map(), ...(ngDevMode ? [{ debugName: "tooltipSources" }] : /* istanbul ignore next */ []));
|
|
547
|
+
reportTooltip(id, source) {
|
|
548
|
+
this.tooltipSources.update((sources) => new Map(sources).set(id, source));
|
|
549
|
+
}
|
|
550
|
+
releaseTooltip(id) {
|
|
551
|
+
this.tooltipSources.update((sources) => {
|
|
552
|
+
const next = new Map(sources);
|
|
553
|
+
next.delete(id);
|
|
554
|
+
return next;
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
/** Two or more marks that show a tooltip: the plot reads as one comparison, so its panel is about
|
|
558
|
+
* the category rather than about whichever mark the pointer happens to be over. */
|
|
559
|
+
composed = computed(() => [...this.tooltipSources().values()].filter((source) => source.offersTooltip?.() ?? true).length > 1, ...(ngDevMode ? [{ debugName: "composed" }] : /* istanbul ignore next */ []));
|
|
560
|
+
cursorResolved = computed(() => {
|
|
561
|
+
const cursor = this.cursor();
|
|
562
|
+
if (cursor !== 'auto') {
|
|
563
|
+
return cursor;
|
|
564
|
+
}
|
|
565
|
+
return this.composed() ? 'category' : 'none';
|
|
566
|
+
}, ...(ngDevMode ? [{ debugName: "cursorResolved" }] : /* istanbul ignore next */ []));
|
|
567
|
+
/** The offer to show, if any mark is making one. At most one mark has a context at a time: a
|
|
568
|
+
* per-mark tooltip only fills it while that mark is hovered, and an axis tooltip only while the
|
|
569
|
+
* category cursor is on. The container opening the panel is what stops two marks opening two. */
|
|
570
|
+
activeTooltip = computed(() => [...this.tooltipSources().values()].find((source) => source.context() !== null) ?? null, ...(ngDevMode ? [{ debugName: "activeTooltip" }] : /* istanbul ignore next */ []));
|
|
571
|
+
tooltipContext = computed(() => {
|
|
572
|
+
const categoryIndex = this.activeIndex();
|
|
573
|
+
if (this.cursorResolved() === 'category' &&
|
|
574
|
+
this.composed() &&
|
|
575
|
+
categoryIndex >= 0) {
|
|
576
|
+
const entries = [...this.tooltipSources().values()].flatMap((source) => source.axisEntries?.() ?? []);
|
|
577
|
+
return entries.length === 0
|
|
578
|
+
? null
|
|
579
|
+
: { category: this.categories()[categoryIndex] ?? '', entries };
|
|
580
|
+
}
|
|
581
|
+
const base = this.activeTooltip()?.context() ?? null;
|
|
582
|
+
if (base === null || this.cursorResolved() !== 'category') {
|
|
583
|
+
return base;
|
|
584
|
+
}
|
|
585
|
+
// A category panel is about the category, not about the mark that happened to open it, so
|
|
586
|
+
// every other mark's reading at the same category belongs in it. Matched by label, because a
|
|
587
|
+
// mark that already named itself must not be listed twice.
|
|
588
|
+
const named = new Set(base.entries.map((entry) => entry.label));
|
|
589
|
+
const rest = [...this.tooltipSources().values()]
|
|
590
|
+
.flatMap((source) => source.axisEntries?.() ?? [])
|
|
591
|
+
.filter((entry) => !named.has(entry.label));
|
|
592
|
+
return rest.length === 0
|
|
593
|
+
? base
|
|
594
|
+
: { ...base, entries: [...base.entries, ...rest] };
|
|
595
|
+
}, ...(ngDevMode ? [{ debugName: "tooltipContext" }] : /* istanbul ignore next */ []));
|
|
596
|
+
tooltipOrigin = computed(() => {
|
|
597
|
+
const own = this.activeTooltip()?.origin() ?? null;
|
|
598
|
+
// A point rather than an element is a panel that follows the pointer, and stays with it.
|
|
599
|
+
if (this.cursorResolved() !== 'category' ||
|
|
600
|
+
(own !== null && !(own instanceof Element))) {
|
|
601
|
+
return own;
|
|
602
|
+
}
|
|
603
|
+
// A category panel belongs over the TALLEST reading at that category, not over whichever mark
|
|
604
|
+
// happened to open it: a line that dips under a column would otherwise put the panel low and
|
|
605
|
+
// let the column stand over it. Every mark's reading counts whether or not the pointer is on
|
|
606
|
+
// it, or the panel jumps between the two as the pointer crosses the column's edge.
|
|
607
|
+
const boxes = [...this.tooltipSources().values()]
|
|
608
|
+
.map((source) => (source.axisOrigin ?? source.origin)())
|
|
609
|
+
.filter((origin) => origin instanceof Element)
|
|
610
|
+
.map((element) => ({ element, top: element.getBoundingClientRect().top }))
|
|
611
|
+
.filter(({ element }) => {
|
|
612
|
+
const box = element.getBoundingClientRect();
|
|
613
|
+
return box.width > 0 && box.height > 0;
|
|
614
|
+
});
|
|
615
|
+
return boxes.length === 0
|
|
616
|
+
? (own ?? this.cursorOrigin())
|
|
617
|
+
: boxes.reduce((highest, candidate) => candidate.top < highest.top ? candidate : highest).element;
|
|
618
|
+
}, ...(ngDevMode ? [{ debugName: "tooltipOrigin" }] : /* istanbul ignore next */ []));
|
|
619
|
+
tooltipPinned = computed(() => (this.activeTooltip()?.pinned?.() ?? false) || this.cursorPinned(), ...(ngDevMode ? [{ debugName: "tooltipPinned" }] : /* istanbul ignore next */ []));
|
|
501
620
|
/** Compared by value, which is what stops a mark that reports AND reads `yPosition()` in one
|
|
502
621
|
* effect from running forever: every report allocates a fresh `Map` and `niceDomain` a fresh
|
|
503
622
|
* object, so identity always differs and the read would re-arm the write. Measured without it:
|
|
@@ -559,7 +678,7 @@ class ChartComponent {
|
|
|
559
678
|
zeroOffset = computed(() => this.yPosition()(0), ...(ngDevMode ? [{ debugName: "zeroOffset" }] : /* istanbul ignore next */ []));
|
|
560
679
|
cursorBand = computed(() => {
|
|
561
680
|
const index = this.activeIndex();
|
|
562
|
-
if (this.
|
|
681
|
+
if (this.cursorResolved() !== 'category' || index < 0) {
|
|
563
682
|
return null;
|
|
564
683
|
}
|
|
565
684
|
const width = this.bandWidth();
|
|
@@ -583,15 +702,17 @@ class ChartComponent {
|
|
|
583
702
|
releaseCursor() {
|
|
584
703
|
this.cursorState.release();
|
|
585
704
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
705
|
+
canvasElement = viewChild('canvasEl', ...(ngDevMode ? [{ debugName: "canvasElement" }] : /* istanbul ignore next */ []));
|
|
706
|
+
// Read once per hover and dropped on any scroll, rather than on every move: a move that follows
|
|
707
|
+
// the cursor band's own update would otherwise force a second layout in the same frame.
|
|
708
|
+
canvasRect = null;
|
|
709
|
+
plotPointer(event, canvas) {
|
|
710
|
+
this.canvasRect ??= canvas.getBoundingClientRect();
|
|
591
711
|
const plot = this.plot();
|
|
592
712
|
// The canvas is scaled to its box, so a client x has to come back through the viewBox before
|
|
593
713
|
// it means anything to a plot measured in view units.
|
|
594
|
-
const viewX = ((event.clientX -
|
|
714
|
+
const viewX = ((event.clientX - this.canvasRect.left) / this.canvasRect.width) *
|
|
715
|
+
this.viewWidth();
|
|
595
716
|
const index = this.clampIndex(categoryAt(viewX, plot.left, plot.width, this.categories().length));
|
|
596
717
|
this.pointerAt.set({ x: event.clientX, y: event.clientY });
|
|
597
718
|
if (event.type === 'pointerdown' && this.cursorPin()) {
|
|
@@ -600,10 +721,36 @@ class ChartComponent {
|
|
|
600
721
|
}
|
|
601
722
|
this.cursorState.enter(index, event);
|
|
602
723
|
}
|
|
603
|
-
|
|
604
|
-
|
|
724
|
+
/** The plot listens to the pointer only when it draws a category cursor, and outside the zone:
|
|
725
|
+
* the handler writes signals, which schedule the render they need. */
|
|
726
|
+
listenForCursor(canvas) {
|
|
727
|
+
const forgetRect = () => {
|
|
728
|
+
this.canvasRect = null;
|
|
729
|
+
};
|
|
730
|
+
const onPointer = (event) => this.plotPointer(event, canvas);
|
|
731
|
+
const onEnter = () => window.addEventListener('scroll', forgetRect, {
|
|
732
|
+
capture: true,
|
|
733
|
+
passive: true,
|
|
734
|
+
});
|
|
735
|
+
const onLeave = () => {
|
|
736
|
+
window.removeEventListener('scroll', forgetRect, { capture: true });
|
|
737
|
+
forgetRect();
|
|
605
738
|
this.cursorState.leave();
|
|
606
|
-
}
|
|
739
|
+
};
|
|
740
|
+
this.zone.runOutsideAngular(() => {
|
|
741
|
+
canvas.addEventListener('pointerenter', onEnter);
|
|
742
|
+
canvas.addEventListener('pointermove', onPointer);
|
|
743
|
+
canvas.addEventListener('pointerdown', onPointer);
|
|
744
|
+
canvas.addEventListener('pointerleave', onLeave);
|
|
745
|
+
});
|
|
746
|
+
return () => {
|
|
747
|
+
canvas.removeEventListener('pointerenter', onEnter);
|
|
748
|
+
canvas.removeEventListener('pointermove', onPointer);
|
|
749
|
+
canvas.removeEventListener('pointerdown', onPointer);
|
|
750
|
+
canvas.removeEventListener('pointerleave', onLeave);
|
|
751
|
+
window.removeEventListener('scroll', forgetRect, { capture: true });
|
|
752
|
+
forgetRect();
|
|
753
|
+
};
|
|
607
754
|
}
|
|
608
755
|
bandElement = viewChild('cursorBandEl', ...(ngDevMode ? [{ debugName: "bandElement" }] : /* istanbul ignore next */ []));
|
|
609
756
|
cursorOrigin = computed(() => this.cursorBand() ? (this.bandElement()?.nativeElement ?? null) : null, ...(ngDevMode ? [{ debugName: "cursorOrigin" }] : /* istanbul ignore next */ []));
|
|
@@ -634,6 +781,11 @@ class ChartComponent {
|
|
|
634
781
|
label: format(value, 'tick'),
|
|
635
782
|
}));
|
|
636
783
|
}, ...(ngDevMode ? [{ debugName: "ticks" }] : /* istanbul ignore next */ []));
|
|
784
|
+
labelTexts = computed(() => [
|
|
785
|
+
...this.ticks().map((tick) => tick.label),
|
|
786
|
+
...this.secondaryTicks().map((tick) => tick.label),
|
|
787
|
+
...this.categories(),
|
|
788
|
+
].join('\n'), ...(ngDevMode ? [{ debugName: "labelTexts" }] : /* istanbul ignore next */ []));
|
|
637
789
|
/** Rotation is spent before thinning: a tilt costs the reader a glance, dropping a label costs
|
|
638
790
|
* them a reading. Both are decided from the widest label as it actually rendered. */
|
|
639
791
|
categoryLabelsRotated = computed(() => rotationWouldFit([this.measuredCategoryLabelWidth()], this.plot().width / Math.max(1, this.categories().length)), ...(ngDevMode ? [{ debugName: "categoryLabelsRotated" }] : /* istanbul ignore next */ []));
|
|
@@ -652,18 +804,18 @@ class ChartComponent {
|
|
|
652
804
|
* projected INTO the branch that this decides, so a container that waited for a report before
|
|
653
805
|
* rendering them would never receive one. */
|
|
654
806
|
isEmpty = computed(() => this.categories().length === 0, ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
655
|
-
accessibleName = computed(() => this.summary() ?? this.caption() ??
|
|
807
|
+
accessibleName = computed(() => this.summary() ?? this.caption() ?? this.intl().chart.title, ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
|
|
656
808
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
657
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartComponent, isStandalone: true, selector: "ds-chart", inputs: { categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: false, transformFunction: null }, tickCount: { classPropertyName: "tickCount", publicName: "tickCount", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, cursor: { classPropertyName: "cursor", publicName: "cursor", isSignal: true, isRequired: false, transformFunction: null }, cursorPin: { classPropertyName: "cursorPin", publicName: "cursorPin", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, maxSecondary: { classPropertyName: "maxSecondary", publicName: "maxSecondary", isSignal: true, isRequired: false, transformFunction: null }, plotHeight: { classPropertyName: "plotHeight", publicName: "plotHeight", isSignal: true, isRequired: false, transformFunction: null }, axisGutter: { classPropertyName: "axisGutter", publicName: "axisGutter", isSignal: true, isRequired: false, transformFunction: null }, valueSpace: { classPropertyName: "valueSpace", publicName: "valueSpace", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisMode: { classPropertyName: "secondaryAxisMode", publicName: "secondaryAxisMode", isSignal: true, isRequired: false, transformFunction: null }, axisColor: { classPropertyName: "axisColor", publicName: "axisColor", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisColor: { classPropertyName: "secondaryAxisColor", publicName: "secondaryAxisColor", isSignal: true, isRequired: false, transformFunction: null }, axisLabel: { classPropertyName: "axisLabel", publicName: "axisLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisLabel: { classPropertyName: "secondaryAxisLabel", publicName: "secondaryAxisLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.framed": "frameResolved() === 'auto'", "class.measuring": "!settled()", "style.--_chart-view-height": "viewHeight() + 'px'" } }, providers: [
|
|
809
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartComponent, isStandalone: true, selector: "ds-chart", inputs: { categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: false, transformFunction: null }, tickCount: { classPropertyName: "tickCount", publicName: "tickCount", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, cursor: { classPropertyName: "cursor", publicName: "cursor", isSignal: true, isRequired: false, transformFunction: null }, cursorPin: { classPropertyName: "cursorPin", publicName: "cursorPin", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, maxSecondary: { classPropertyName: "maxSecondary", publicName: "maxSecondary", isSignal: true, isRequired: false, transformFunction: null }, plotHeight: { classPropertyName: "plotHeight", publicName: "plotHeight", isSignal: true, isRequired: false, transformFunction: null }, axisGutter: { classPropertyName: "axisGutter", publicName: "axisGutter", isSignal: true, isRequired: false, transformFunction: null }, valueSpace: { classPropertyName: "valueSpace", publicName: "valueSpace", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisMode: { classPropertyName: "secondaryAxisMode", publicName: "secondaryAxisMode", isSignal: true, isRequired: false, transformFunction: null }, axisColor: { classPropertyName: "axisColor", publicName: "axisColor", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisColor: { classPropertyName: "secondaryAxisColor", publicName: "secondaryAxisColor", isSignal: true, isRequired: false, transformFunction: null }, axisLabel: { classPropertyName: "axisLabel", publicName: "axisLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisLabel: { classPropertyName: "secondaryAxisLabel", publicName: "secondaryAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, tooltipTemplate: { classPropertyName: "tooltipTemplate", publicName: "tooltipTemplate", isSignal: true, isRequired: false, transformFunction: null }, tooltipExtraGap: { classPropertyName: "tooltipExtraGap", publicName: "tooltipExtraGap", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.framed": "frameResolved() === 'auto'", "class.measuring": "!settled()", "style.--_chart-view-height": "viewHeight() + 'px'" } }, providers: [
|
|
658
810
|
{
|
|
659
811
|
provide: CHART_SCALES,
|
|
660
812
|
useExisting: forwardRef(() => ChartComponent),
|
|
661
813
|
},
|
|
662
|
-
], viewQueries: [{ propertyName: "bandElement", first: true, predicate: ["cursorBandEl"], descendants: true, isSignal: true }], exportAs: ["dsChart"], ngImport: i0, template: "<figure class=\"chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n <ds-skeleton height=\"var(--_chart-view-height)\" />\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\">\n <svg\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [style.block-size.px]=\"viewHeight()\"\n [attr.viewBox]=\"viewBox()\"\n (pointermove)=\"onPlotPointer($event)\"\n (pointerdown)=\"onPlotPointer($event)\"\n (pointerleave)=\"clearCursor()\">\n @if (cursorBand(); as band) {\n <g\n class=\"cursor\"\n aria-hidden=\"true\"\n animate.enter=\"cursor-in\"\n animate.leave=\"cursor-out\">\n <rect\n #cursorBandEl\n class=\"category-band\"\n [attr.x]=\"band.x\"\n [attr.y]=\"band.top\"\n [attr.width]=\"band.width\"\n [attr.height]=\"band.bottom - band.top\" />\n\n <line\n class=\"cursor-line\"\n [attr.x1]=\"band.x + band.width / 2\"\n [attr.x2]=\"band.x + band.width / 2\"\n [attr.y1]=\"band.top\"\n [attr.y2]=\"band.bottom\" />\n </g>\n }\n\n <!-- Hidden as a group rather than on the svg: a projected mark may be focusable, and an\n aria-hidden ancestor would leave it reachable by Tab and invisible to a reader. -->\n <g\n class=\"axes\"\n aria-hidden=\"true\">\n @for (tick of ticks(); track tick.value) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"plotBottom()\"\n [attr.y2]=\"plotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"plot().top\"\n [attr.y2]=\"plotBottom()\" />\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track tick.value) {\n <line\n class=\"grid-line is-secondary\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n }\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryPlotBottom()\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"secondaryPlot().top\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n }\n\n @if (reachesBelowZero()) {\n <line\n class=\"zero-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"zeroOffset()\"\n [attr.y2]=\"zeroOffset()\" />\n }\n </g>\n\n <!-- Two slots, one group: a reference line has to paint UNDER the marks whatever order the\n consumer wrote it in, and a selected slot is what decides that instead of the author.\n Both stay inside `.marks`, which is what the boot transition guard is keyed on. -->\n <g class=\"marks\">\n <ng-content select=\"[dsReferenceLine]\" />\n\n <ng-content />\n </g>\n\n <g\n class=\"labels\"\n aria-hidden=\"true\">\n @if (axisLabel()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"axisLabelFill()\"\n [attr.transform]=\"\n 'rotate(-90 12 ' +\n (plot().top + plot().height / 2) +\n ') translate(0 0)'\n \"\n [attr.x]=\"12\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ axisLabel() }}\n </text>\n }\n\n @if (secondaryAxisLabel() && hasSecondaryAxis()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.transform]=\"\n 'rotate(90 ' +\n (viewWidth() - 12) +\n ' ' +\n (plot().top + plot().height / 2) +\n ')'\n \"\n [attr.x]=\"viewWidth() - 12\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ secondaryAxisLabel() }}\n </text>\n }\n\n @for (tick of ticks(); track tick.value) {\n <text\n class=\"axis-label is-primary\"\n text-anchor=\"end\"\n [style.fill]=\"axisLabelFill()\"\n [attr.x]=\"axisLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track tick.value) {\n <text\n class=\"axis-label is-secondary\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.text-anchor]=\"secondaryLabelAnchor()\"\n [attr.x]=\"secondaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (label of categoryLabels(); track label.index) {\n <text\n class=\"category-label\"\n [class.is-rotated]=\"categoryLabelsRotated()\"\n [attr.text-anchor]=\"categoryLabelsRotated() ? 'end' : 'middle'\"\n [attr.x]=\"label.x\"\n [attr.y]=\"categoryLabelY()\"\n [attr.transform]=\"\n categoryLabelsRotated()\n ? 'rotate(-45 ' + label.x + ' ' + categoryLabelY() + ')'\n : null\n \">\n {{ label.text }}\n </text>\n }\n\n <!-- Over the marks, where `.marks` is under them: an annotation's LINE is furniture and\n belongs below the readings, its NAME has to survive a column drawn through it. -->\n <ng-content select=\"[dsReferenceLabel], [dsSeriesAnnotation]\" />\n </g>\n </svg>\n </div>\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table{-webkit-user-select:text;user-select:text}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}.empty.is-error,.empty-text.is-error{color:var(--error)}.chart{--_chart-grid-line-color: var(--ds-chart-grid-line-color, var(--chart-grid-line-color));--_chart-axis-line-color: var(--ds-chart-axis-line-color, var(--chart-axis-line-color));--_chart-axis-label-color: var(--ds-chart-axis-label-color, var(--chart-axis-label-color));--_chart-axis-font-size: var(--ds-chart-axis-font-size, var(--chart-axis-font-size));margin:0}.empty{display:grid;place-items:center;min-block-size:var(--_chart-view-height);margin:0;color:var(--text-secondary);text-align:center;border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.canvas{display:block;inline-size:100%}:host(.measuring) .marks ::ng-deep *{transition-duration:0ms!important}.grid-line{stroke:var(--_chart-grid-line-color);stroke-width:1}.axis-line,.zero-line{stroke:var(--_chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size)}.category-label.is-rotated{dominant-baseline:middle}.axis-title{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size);font-weight:var(--font-weight-bold)}.axis-label{dominant-baseline:middle}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}.cursor.cursor-in{animation:ds-chart-mark-fade-in var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.cursor.cursor-out{animation:ds-chart-mark-exit var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.category-band{fill:var(--ds-chart-hover-bg-color)}.cursor-line{stroke:var(--ds-chart-cursor-line-color);stroke-width:1}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
814
|
+
], viewQueries: [{ propertyName: "canvasElement", first: true, predicate: ["canvasEl"], descendants: true, isSignal: true }, { propertyName: "bandElement", first: true, predicate: ["cursorBandEl"], descendants: true, isSignal: true }], exportAs: ["dsChart"], ngImport: i0, template: "<figure class=\"chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading() || !renderReady()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n <ds-skeleton height=\"var(--_chart-view-height)\" [shimmer]=\"loading()\" />\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipExtraGap]=\"tooltipExtraGap()\"\n [dsChartTooltipPinned]=\"tooltipPinned()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate()\">\n <svg\n #canvasEl\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [style.block-size.px]=\"viewHeight()\"\n [attr.viewBox]=\"viewBox()\">\n @if (cursorBand(); as band) {\n <g\n class=\"cursor\"\n aria-hidden=\"true\"\n animate.enter=\"cursor-in\"\n animate.leave=\"cursor-out\">\n <rect\n #cursorBandEl\n class=\"category-band\"\n [attr.x]=\"band.x\"\n [attr.y]=\"band.top\"\n [attr.width]=\"band.width\"\n [attr.height]=\"band.bottom - band.top\" />\n\n <line\n class=\"cursor-line\"\n [attr.x1]=\"band.x + band.width / 2\"\n [attr.x2]=\"band.x + band.width / 2\"\n [attr.y1]=\"band.top\"\n [attr.y2]=\"band.bottom\" />\n </g>\n }\n\n <!-- Hidden as a group rather than on the svg: a projected mark may be focusable, and an\n aria-hidden ancestor would leave it reachable by Tab and invisible to a reader. -->\n <g\n class=\"axes\"\n aria-hidden=\"true\">\n @for (tick of ticks(); track tick.value) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"plotBottom()\"\n [attr.y2]=\"plotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"plot().top\"\n [attr.y2]=\"plotBottom()\" />\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track tick.value) {\n <line\n class=\"grid-line is-secondary\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n }\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryPlotBottom()\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"secondaryPlot().top\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n }\n\n @if (reachesBelowZero()) {\n <line\n class=\"zero-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"zeroOffset()\"\n [attr.y2]=\"zeroOffset()\" />\n }\n </g>\n\n <!-- Two slots, one group: a reference line has to paint UNDER the marks whatever order the\n consumer wrote it in, and a selected slot is what decides that instead of the author.\n Both stay inside `.marks`, which is what the boot transition guard is keyed on. -->\n <g class=\"marks\">\n <ng-content select=\"[dsReferenceLine]\" />\n\n <ng-content />\n </g>\n\n <g\n class=\"labels\"\n aria-hidden=\"true\">\n @if (axisLabel()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"axisLabelFill()\"\n [attr.transform]=\"\n 'rotate(-90 ' +\n axisTitleX() +\n ' ' +\n (plot().top + plot().height / 2) +\n ')'\n \"\n [attr.x]=\"axisTitleX()\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ axisLabel() }}\n </text>\n }\n\n @if (secondaryAxisLabel() && hasSecondaryAxis()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.transform]=\"\n 'rotate(90 ' +\n secondaryTitleX() +\n ' ' +\n (plot().top + plot().height / 2) +\n ')'\n \"\n [attr.x]=\"secondaryTitleX()\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ secondaryAxisLabel() }}\n </text>\n }\n\n @for (tick of ticks(); track tick.value) {\n <text\n class=\"axis-label is-primary\"\n text-anchor=\"end\"\n [style.fill]=\"axisLabelFill()\"\n [attr.x]=\"axisLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track tick.value) {\n <text\n class=\"axis-label is-secondary\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.text-anchor]=\"secondaryLabelAnchor()\"\n [attr.x]=\"secondaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (label of categoryLabels(); track label.index) {\n <text\n class=\"category-label\"\n [class.is-rotated]=\"categoryLabelsRotated()\"\n [attr.text-anchor]=\"categoryLabelsRotated() ? 'end' : 'middle'\"\n [attr.x]=\"label.x\"\n [attr.y]=\"categoryLabelY()\"\n [attr.transform]=\"\n categoryLabelsRotated()\n ? 'rotate(-45 ' + label.x + ' ' + categoryLabelY() + ')'\n : null\n \">\n {{ label.text }}\n </text>\n }\n\n <!-- Over the marks, where `.marks` is under them: an annotation's LINE is furniture and\n belongs below the readings, its NAME has to survive a column drawn through it. -->\n <ng-content select=\"[dsReferenceLabel], [dsSeriesAnnotation]\" />\n </g>\n </svg>\n </div>\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table{-webkit-user-select:text;user-select:text}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}.empty.is-error,.empty-text.is-error{color:var(--error)}.chart{--_chart-grid-line-color: var(--ds-chart-grid-line-color, var(--chart-grid-line-color));--_chart-axis-line-color: var(--ds-chart-axis-line-color, var(--chart-axis-line-color));--_chart-axis-label-color: var(--ds-chart-axis-label-color, var(--chart-axis-label-color));--_chart-axis-font-size: var(--ds-chart-axis-font-size, var(--chart-axis-font-size));margin:0}.empty{display:grid;place-items:center;min-block-size:var(--_chart-view-height);margin:0;color:var(--text-secondary);text-align:center;border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.canvas{display:block;inline-size:100%}:host(.measuring) .marks ::ng-deep *{transition-duration:0ms!important}.grid-line{stroke:var(--_chart-grid-line-color);stroke-width:1}.axis-line,.zero-line{stroke:var(--_chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size)}.category-label.is-rotated{dominant-baseline:middle}.axis-title{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size);font-weight:var(--font-weight-bold)}.axis-label{dominant-baseline:middle}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}.cursor.cursor-in{animation:ds-chart-mark-fade-in var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.cursor.cursor-out{animation:ds-chart-mark-exit var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.category-band{fill:var(--ds-chart-hover-bg-color)}.cursor-line{stroke:var(--ds-chart-cursor-line-color);stroke-width:1}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline", "shimmer"] }, { kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate", "dsChartTooltipExtraGap", "dsChartTooltipPinned"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
663
815
|
}
|
|
664
816
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartComponent, decorators: [{
|
|
665
817
|
type: Component,
|
|
666
|
-
args: [{ selector: 'ds-chart', standalone: true, exportAs: 'dsChart', imports: [SkeletonComponent], host: {
|
|
818
|
+
args: [{ selector: 'ds-chart', standalone: true, exportAs: 'dsChart', imports: [SkeletonComponent, ChartTooltipDirective], host: {
|
|
667
819
|
'[class.framed]': "frameResolved() === 'auto'",
|
|
668
820
|
'[class.measuring]': '!settled()',
|
|
669
821
|
'[style.--_chart-view-height]': "viewHeight() + 'px'",
|
|
@@ -672,11 +824,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
672
824
|
provide: CHART_SCALES,
|
|
673
825
|
useExisting: forwardRef(() => ChartComponent),
|
|
674
826
|
},
|
|
675
|
-
], template: "<figure class=\"chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n <ds-skeleton height=\"var(--_chart-view-height)\" />\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\">\n <svg\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [style.block-size.px]=\"viewHeight()\"\n [attr.viewBox]=\"viewBox()\"\n (pointermove)=\"onPlotPointer($event)\"\n (pointerdown)=\"onPlotPointer($event)\"\n (pointerleave)=\"clearCursor()\">\n @if (cursorBand(); as band) {\n <g\n class=\"cursor\"\n aria-hidden=\"true\"\n animate.enter=\"cursor-in\"\n animate.leave=\"cursor-out\">\n <rect\n #cursorBandEl\n class=\"category-band\"\n [attr.x]=\"band.x\"\n [attr.y]=\"band.top\"\n [attr.width]=\"band.width\"\n [attr.height]=\"band.bottom - band.top\" />\n\n <line\n class=\"cursor-line\"\n [attr.x1]=\"band.x + band.width / 2\"\n [attr.x2]=\"band.x + band.width / 2\"\n [attr.y1]=\"band.top\"\n [attr.y2]=\"band.bottom\" />\n </g>\n }\n\n <!-- Hidden as a group rather than on the svg: a projected mark may be focusable, and an\n aria-hidden ancestor would leave it reachable by Tab and invisible to a reader. -->\n <g\n class=\"axes\"\n aria-hidden=\"true\">\n @for (tick of ticks(); track tick.value) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"plotBottom()\"\n [attr.y2]=\"plotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"plot().top\"\n [attr.y2]=\"plotBottom()\" />\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track tick.value) {\n <line\n class=\"grid-line is-secondary\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n }\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryPlotBottom()\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"secondaryPlot().top\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n }\n\n @if (reachesBelowZero()) {\n <line\n class=\"zero-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"zeroOffset()\"\n [attr.y2]=\"zeroOffset()\" />\n }\n </g>\n\n <!-- Two slots, one group: a reference line has to paint UNDER the marks whatever order the\n consumer wrote it in, and a selected slot is what decides that instead of the author.\n Both stay inside `.marks`, which is what the boot transition guard is keyed on. -->\n <g class=\"marks\">\n <ng-content select=\"[dsReferenceLine]\" />\n\n <ng-content />\n </g>\n\n <g\n class=\"labels\"\n aria-hidden=\"true\">\n @if (axisLabel()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"axisLabelFill()\"\n [attr.transform]=\"\n 'rotate(-90 12 ' +\n (plot().top + plot().height / 2) +\n ') translate(0 0)'\n \"\n [attr.x]=\"12\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ axisLabel() }}\n </text>\n }\n\n @if (secondaryAxisLabel() && hasSecondaryAxis()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.transform]=\"\n 'rotate(90 ' +\n (viewWidth() - 12) +\n ' ' +\n (plot().top + plot().height / 2) +\n ')'\n \"\n [attr.x]=\"viewWidth() - 12\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ secondaryAxisLabel() }}\n </text>\n }\n\n @for (tick of ticks(); track tick.value) {\n <text\n class=\"axis-label is-primary\"\n text-anchor=\"end\"\n [style.fill]=\"axisLabelFill()\"\n [attr.x]=\"axisLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track tick.value) {\n <text\n class=\"axis-label is-secondary\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.text-anchor]=\"secondaryLabelAnchor()\"\n [attr.x]=\"secondaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (label of categoryLabels(); track label.index) {\n <text\n class=\"category-label\"\n [class.is-rotated]=\"categoryLabelsRotated()\"\n [attr.text-anchor]=\"categoryLabelsRotated() ? 'end' : 'middle'\"\n [attr.x]=\"label.x\"\n [attr.y]=\"categoryLabelY()\"\n [attr.transform]=\"\n categoryLabelsRotated()\n ? 'rotate(-45 ' + label.x + ' ' + categoryLabelY() + ')'\n : null\n \">\n {{ label.text }}\n </text>\n }\n\n <!-- Over the marks, where `.marks` is under them: an annotation's LINE is furniture and\n belongs below the readings, its NAME has to survive a column drawn through it. -->\n <ng-content select=\"[dsReferenceLabel], [dsSeriesAnnotation]\" />\n </g>\n </svg>\n </div>\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table{-webkit-user-select:text;user-select:text}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}.empty.is-error,.empty-text.is-error{color:var(--error)}.chart{--_chart-grid-line-color: var(--ds-chart-grid-line-color, var(--chart-grid-line-color));--_chart-axis-line-color: var(--ds-chart-axis-line-color, var(--chart-axis-line-color));--_chart-axis-label-color: var(--ds-chart-axis-label-color, var(--chart-axis-label-color));--_chart-axis-font-size: var(--ds-chart-axis-font-size, var(--chart-axis-font-size));margin:0}.empty{display:grid;place-items:center;min-block-size:var(--_chart-view-height);margin:0;color:var(--text-secondary);text-align:center;border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.canvas{display:block;inline-size:100%}:host(.measuring) .marks ::ng-deep *{transition-duration:0ms!important}.grid-line{stroke:var(--_chart-grid-line-color);stroke-width:1}.axis-line,.zero-line{stroke:var(--_chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size)}.category-label.is-rotated{dominant-baseline:middle}.axis-title{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size);font-weight:var(--font-weight-bold)}.axis-label{dominant-baseline:middle}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}.cursor.cursor-in{animation:ds-chart-mark-fade-in var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.cursor.cursor-out{animation:ds-chart-mark-exit var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.category-band{fill:var(--ds-chart-hover-bg-color)}.cursor-line{stroke:var(--ds-chart-cursor-line-color);stroke-width:1}\n"] }]
|
|
676
|
-
}], ctorParameters: () => [], propDecorators: { categories: [{ type: i0.Input, args: [{ isSignal: true, alias: "categories", required: false }] }], tickCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "tickCount", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], cursor: [{ type: i0.Input, args: [{ isSignal: true, alias: "cursor", required: false }] }], cursorPin: [{ type: i0.Input, args: [{ isSignal: true, alias: "cursorPin", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], maxSecondary: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSecondary", required: false }] }], plotHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "plotHeight", required: false }] }], axisGutter: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisGutter", required: false }] }], valueSpace: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueSpace", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], frame: [{ type: i0.Input, args: [{ isSignal: true, alias: "frame", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], secondaryAxisMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisMode", required: false }] }], axisColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisColor", required: false }] }], secondaryAxisColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisColor", required: false }] }], axisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisLabel", required: false }] }], secondaryAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisLabel", required: false }] }], bandElement: [{ type: i0.ViewChild, args: ['cursorBandEl', { isSignal: true }] }] } });
|
|
827
|
+
], template: "<figure class=\"chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading() || !renderReady()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n <ds-skeleton height=\"var(--_chart-view-height)\" [shimmer]=\"loading()\" />\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipExtraGap]=\"tooltipExtraGap()\"\n [dsChartTooltipPinned]=\"tooltipPinned()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate()\">\n <svg\n #canvasEl\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [style.block-size.px]=\"viewHeight()\"\n [attr.viewBox]=\"viewBox()\">\n @if (cursorBand(); as band) {\n <g\n class=\"cursor\"\n aria-hidden=\"true\"\n animate.enter=\"cursor-in\"\n animate.leave=\"cursor-out\">\n <rect\n #cursorBandEl\n class=\"category-band\"\n [attr.x]=\"band.x\"\n [attr.y]=\"band.top\"\n [attr.width]=\"band.width\"\n [attr.height]=\"band.bottom - band.top\" />\n\n <line\n class=\"cursor-line\"\n [attr.x1]=\"band.x + band.width / 2\"\n [attr.x2]=\"band.x + band.width / 2\"\n [attr.y1]=\"band.top\"\n [attr.y2]=\"band.bottom\" />\n </g>\n }\n\n <!-- Hidden as a group rather than on the svg: a projected mark may be focusable, and an\n aria-hidden ancestor would leave it reachable by Tab and invisible to a reader. -->\n <g\n class=\"axes\"\n aria-hidden=\"true\">\n @for (tick of ticks(); track tick.value) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"plotBottom()\"\n [attr.y2]=\"plotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"plot().top\"\n [attr.y2]=\"plotBottom()\" />\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track tick.value) {\n <line\n class=\"grid-line is-secondary\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n }\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryPlotBottom()\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"secondaryPlot().top\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n }\n\n @if (reachesBelowZero()) {\n <line\n class=\"zero-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"zeroOffset()\"\n [attr.y2]=\"zeroOffset()\" />\n }\n </g>\n\n <!-- Two slots, one group: a reference line has to paint UNDER the marks whatever order the\n consumer wrote it in, and a selected slot is what decides that instead of the author.\n Both stay inside `.marks`, which is what the boot transition guard is keyed on. -->\n <g class=\"marks\">\n <ng-content select=\"[dsReferenceLine]\" />\n\n <ng-content />\n </g>\n\n <g\n class=\"labels\"\n aria-hidden=\"true\">\n @if (axisLabel()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"axisLabelFill()\"\n [attr.transform]=\"\n 'rotate(-90 ' +\n axisTitleX() +\n ' ' +\n (plot().top + plot().height / 2) +\n ')'\n \"\n [attr.x]=\"axisTitleX()\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ axisLabel() }}\n </text>\n }\n\n @if (secondaryAxisLabel() && hasSecondaryAxis()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.transform]=\"\n 'rotate(90 ' +\n secondaryTitleX() +\n ' ' +\n (plot().top + plot().height / 2) +\n ')'\n \"\n [attr.x]=\"secondaryTitleX()\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ secondaryAxisLabel() }}\n </text>\n }\n\n @for (tick of ticks(); track tick.value) {\n <text\n class=\"axis-label is-primary\"\n text-anchor=\"end\"\n [style.fill]=\"axisLabelFill()\"\n [attr.x]=\"axisLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track tick.value) {\n <text\n class=\"axis-label is-secondary\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.text-anchor]=\"secondaryLabelAnchor()\"\n [attr.x]=\"secondaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (label of categoryLabels(); track label.index) {\n <text\n class=\"category-label\"\n [class.is-rotated]=\"categoryLabelsRotated()\"\n [attr.text-anchor]=\"categoryLabelsRotated() ? 'end' : 'middle'\"\n [attr.x]=\"label.x\"\n [attr.y]=\"categoryLabelY()\"\n [attr.transform]=\"\n categoryLabelsRotated()\n ? 'rotate(-45 ' + label.x + ' ' + categoryLabelY() + ')'\n : null\n \">\n {{ label.text }}\n </text>\n }\n\n <!-- Over the marks, where `.marks` is under them: an annotation's LINE is furniture and\n belongs below the readings, its NAME has to survive a column drawn through it. -->\n <ng-content select=\"[dsReferenceLabel], [dsSeriesAnnotation]\" />\n </g>\n </svg>\n </div>\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table{-webkit-user-select:text;user-select:text}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}.empty.is-error,.empty-text.is-error{color:var(--error)}.chart{--_chart-grid-line-color: var(--ds-chart-grid-line-color, var(--chart-grid-line-color));--_chart-axis-line-color: var(--ds-chart-axis-line-color, var(--chart-axis-line-color));--_chart-axis-label-color: var(--ds-chart-axis-label-color, var(--chart-axis-label-color));--_chart-axis-font-size: var(--ds-chart-axis-font-size, var(--chart-axis-font-size));margin:0}.empty{display:grid;place-items:center;min-block-size:var(--_chart-view-height);margin:0;color:var(--text-secondary);text-align:center;border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.canvas{display:block;inline-size:100%}:host(.measuring) .marks ::ng-deep *{transition-duration:0ms!important}.grid-line{stroke:var(--_chart-grid-line-color);stroke-width:1}.axis-line,.zero-line{stroke:var(--_chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size)}.category-label.is-rotated{dominant-baseline:middle}.axis-title{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size);font-weight:var(--font-weight-bold)}.axis-label{dominant-baseline:middle}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}.cursor.cursor-in{animation:ds-chart-mark-fade-in var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.cursor.cursor-out{animation:ds-chart-mark-exit var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.category-band{fill:var(--ds-chart-hover-bg-color)}.cursor-line{stroke:var(--ds-chart-cursor-line-color);stroke-width:1}\n"] }]
|
|
828
|
+
}], ctorParameters: () => [], propDecorators: { categories: [{ type: i0.Input, args: [{ isSignal: true, alias: "categories", required: false }] }], tickCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "tickCount", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], cursor: [{ type: i0.Input, args: [{ isSignal: true, alias: "cursor", required: false }] }], cursorPin: [{ type: i0.Input, args: [{ isSignal: true, alias: "cursorPin", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], maxSecondary: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSecondary", required: false }] }], plotHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "plotHeight", required: false }] }], axisGutter: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisGutter", required: false }] }], valueSpace: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueSpace", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], frame: [{ type: i0.Input, args: [{ isSignal: true, alias: "frame", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], secondaryAxisMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisMode", required: false }] }], axisColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisColor", required: false }] }], secondaryAxisColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisColor", required: false }] }], axisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisLabel", required: false }] }], secondaryAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisLabel", required: false }] }], tooltipTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipTemplate", required: false }] }], tooltipExtraGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipExtraGap", required: false }] }], canvasElement: [{ type: i0.ViewChild, args: ['canvasEl', { isSignal: true }] }], bandElement: [{ type: i0.ViewChild, args: ['cursorBandEl', { isSignal: true }] }] } });
|
|
677
829
|
|
|
678
830
|
/** The disc's radius, and half the glyph's box, in the same CSS pixels the plot is drawn in. */
|
|
679
831
|
const PIN_DISC_RADIUS = 11;
|
|
832
|
+
// Clears the column's top edge: at one radius the disc sits flush against it and reads as part of
|
|
833
|
+
// the bar rather than as a badge on it.
|
|
834
|
+
const PIN_TOP_GAP = 4;
|
|
680
835
|
const PIN_GLYPH_SIZE = 14;
|
|
681
836
|
/** Distance from a mark's own tip to its value label's baseline. */
|
|
682
837
|
const VALUE_LABEL_GAP = 8;
|
|
@@ -694,7 +849,10 @@ let nextSeriesId$1 = 0;
|
|
|
694
849
|
* container's canvas would draw nothing. Written as `<svg:g dsColumnSeries>`.
|
|
695
850
|
*/
|
|
696
851
|
class ColumnSeriesComponent {
|
|
852
|
+
leaveMark = leaveMark;
|
|
697
853
|
scales = inject(CHART_SCALES);
|
|
854
|
+
locale = injectDsLocale();
|
|
855
|
+
intl = inject(DS_INTL);
|
|
698
856
|
/** Not `input.required`: the preset reads `tooltipContext()` from a binding on this same
|
|
699
857
|
* element, and a required input throws NG0950 for the pass before its own value is written. */
|
|
700
858
|
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
@@ -725,7 +883,7 @@ class ColumnSeriesComponent {
|
|
|
725
883
|
tooltipLingerMs = input(0, { ...(ngDevMode ? { debugName: "tooltipLingerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
726
884
|
/** Formats every value this series prints. Called with `'tick'` for an axis label and
|
|
727
885
|
* `'tooltip'` everywhere a value is printed in full. */
|
|
728
|
-
valueFormat = input(
|
|
886
|
+
valueFormat = input(chartValueFormat(injectDsLocale()), ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
|
|
729
887
|
/** The mark's share of its category's own slot, before the maximum width caps it. Measured off
|
|
730
888
|
* the slot rather than off `bandWidth()`, which has the container's own padding already taken
|
|
731
889
|
* out of it - applying both would narrow every uncapped column twice. */
|
|
@@ -738,6 +896,9 @@ class ColumnSeriesComponent {
|
|
|
738
896
|
/** Where each mark starts and ends on the value axis, one entry per point. Unset, every mark
|
|
739
897
|
* runs from zero to its own value, which is the unstacked case. */
|
|
740
898
|
offsets = input(null, ...(ngDevMode ? [{ debugName: "offsets" }] : /* istanbul ignore next */ []));
|
|
899
|
+
/** Which value axis the columns are measured against. `'secondary'` reads them off the second
|
|
900
|
+
* axis, the way `axis: 'secondary'` does on a line series' data. */
|
|
901
|
+
axis = input('primary', ...(ngDevMode ? [{ debugName: "axis" }] : /* istanbul ignore next */ []));
|
|
741
902
|
/** One colour for the whole series, which is what several series drawn together need. Unset,
|
|
742
903
|
* each mark takes the categorical palette by its own position - the right reading when the
|
|
743
904
|
* marks ARE the categories, which is the single-series case. A point's own colour wins over
|
|
@@ -748,6 +909,14 @@ class ColumnSeriesComponent {
|
|
|
748
909
|
/** Names the series in the tooltip, where the category then becomes the panel's heading. Unset,
|
|
749
910
|
* the panel names the category instead, which is what a chart of one series has to say. */
|
|
750
911
|
seriesLabel = input(null, ...(ngDevMode ? [{ debugName: "seriesLabel" }] : /* istanbul ignore next */ []));
|
|
912
|
+
/** Identifies this series to the legend, so hovering a legend item can single it out. */
|
|
913
|
+
seriesKey = input(null, ...(ngDevMode ? [{ debugName: "seriesKey" }] : /* istanbul ignore next */ []));
|
|
914
|
+
/** The series the reader is pointing at in the legend. Every other series fades. */
|
|
915
|
+
highlighted = input(null, ...(ngDevMode ? [{ debugName: "highlighted" }] : /* istanbul ignore next */ []));
|
|
916
|
+
dimmedBySeries = computed(() => {
|
|
917
|
+
const highlighted = this.highlighted();
|
|
918
|
+
return highlighted !== null && highlighted !== this.seriesKey();
|
|
919
|
+
}, ...(ngDevMode ? [{ debugName: "dimmedBySeries" }] : /* istanbul ignore next */ []));
|
|
751
920
|
/** The clicked datum. Fires on click and on Enter or Space, whatever `interactive` says. */
|
|
752
921
|
pointClicked = output();
|
|
753
922
|
seriesId = nextSeriesId$1++;
|
|
@@ -765,12 +934,29 @@ class ColumnSeriesComponent {
|
|
|
765
934
|
});
|
|
766
935
|
}, ...(ngDevMode ? [{ debugName: "spans" }] : /* istanbul ignore next */ []));
|
|
767
936
|
constructor() {
|
|
768
|
-
effect(() => this.scales.reportDomain(this.domainId, this.spans().flatMap((span) => [span.from, span.to])));
|
|
937
|
+
effect(() => this.scales.reportDomain(this.domainId, this.spans().flatMap((span) => [span.from, span.to]), this.axis()));
|
|
938
|
+
// The container opens the panel, so a plot holding several marks can only ever show one.
|
|
939
|
+
this.scales.reportTooltip(this.domainId, {
|
|
940
|
+
context: this.tooltipContext,
|
|
941
|
+
origin: computed(() => this.activeMark.origin()),
|
|
942
|
+
pinned: this.activeMark.pinned,
|
|
943
|
+
offersTooltip: computed(() => this.tooltip() !== 'none'),
|
|
944
|
+
axisOrigin: computed(() => {
|
|
945
|
+
const categoryIndex = this.scales.activeIndex();
|
|
946
|
+
return categoryIndex < 0
|
|
947
|
+
? null
|
|
948
|
+
: (this.barElements()[categoryIndex]?.nativeElement ?? null);
|
|
949
|
+
}),
|
|
950
|
+
axisEntries: this.axisEntries,
|
|
951
|
+
});
|
|
952
|
+
listenForMarkFocus(inject(ElementRef), (event, hit) => this.onMarkFocus(event, hit), () => this.activeMark.leave());
|
|
769
953
|
}
|
|
770
954
|
ngOnDestroy() {
|
|
955
|
+
this.scales.releaseTooltip(this.domainId);
|
|
771
956
|
this.scales.releaseDomain(this.domainId);
|
|
772
957
|
}
|
|
773
958
|
activeMark = chartActiveMark(() => this.tooltipLingerMs());
|
|
959
|
+
barElements = viewChildren('barEl', ...(ngDevMode ? [{ debugName: "barElements" }] : /* istanbul ignore next */ []));
|
|
774
960
|
/** One SERIES' slot inside a category's band: the whole band while a chart draws one series,
|
|
775
961
|
* a share of it per series when several are grouped. The box that catches the pointer is sized
|
|
776
962
|
* from this rather than from the drawn column, so a short column stays reachable. */
|
|
@@ -788,13 +974,30 @@ class ColumnSeriesComponent {
|
|
|
788
974
|
const plot = this.scales.plot();
|
|
789
975
|
return chartViewHeight(plot.height, plot.top, true);
|
|
790
976
|
}, ...(ngDevMode ? [{ debugName: "hitHeight" }] : /* istanbul ignore next */ []));
|
|
977
|
+
/** Stacked series sit on top of one another, so a full-slot hit box on each one means only the
|
|
978
|
+
* series drawn last is ever reachable. Stacked, a mark catches the pointer over its own segment
|
|
979
|
+
* and nothing else. */
|
|
980
|
+
stacked = computed(() => this.offsets() !== null, ...(ngDevMode ? [{ debugName: "stacked" }] : /* istanbul ignore next */ []));
|
|
981
|
+
/** Keeps a thin segment reachable without letting it reach into its neighbours. */
|
|
982
|
+
static MIN_STACK_HIT = 6;
|
|
983
|
+
hitBox(mark) {
|
|
984
|
+
if (!this.stacked()) {
|
|
985
|
+
return { y: 0, height: this.hitHeight() };
|
|
986
|
+
}
|
|
987
|
+
const height = Math.max(mark.height, ColumnSeriesComponent.MIN_STACK_HIT);
|
|
988
|
+
const overflow = height - mark.height;
|
|
989
|
+
return { y: mark.top - overflow / 2, height };
|
|
990
|
+
}
|
|
791
991
|
pinDiscRadius = PIN_DISC_RADIUS;
|
|
792
992
|
pinGlyphSize = PIN_GLYPH_SIZE;
|
|
793
993
|
pinGlyphOffset = -PIN_GLYPH_SIZE / 2;
|
|
794
994
|
pinGlyph = inject(DomSanitizer).bypassSecurityTrustHtml(ICONS.pin);
|
|
995
|
+
hatchInUse = computed(() => this.marks().some((mark) => mark.hatched), ...(ngDevMode ? [{ debugName: "hatchInUse" }] : /* istanbul ignore next */ []));
|
|
795
996
|
marks = computed(() => {
|
|
796
997
|
const toX = this.scales.xPosition();
|
|
797
|
-
const toY = this.
|
|
998
|
+
const toY = this.axis() === 'secondary'
|
|
999
|
+
? this.scales.secondaryYPosition()
|
|
1000
|
+
: this.scales.yPosition();
|
|
798
1001
|
const spans = this.spans();
|
|
799
1002
|
const format = this.valueFormat();
|
|
800
1003
|
return this.data().map((point, index) => {
|
|
@@ -819,7 +1022,7 @@ class ColumnSeriesComponent {
|
|
|
819
1022
|
top: Math.min(tip, baseline),
|
|
820
1023
|
height: Math.abs(tip - baseline),
|
|
821
1024
|
labelY: below ? tip + VALUE_LABEL_GAP : tip - VALUE_LABEL_GAP,
|
|
822
|
-
pinY: Math.min(tip, baseline) + PIN_DISC_RADIUS,
|
|
1025
|
+
pinY: Math.min(tip, baseline) + PIN_DISC_RADIUS + PIN_TOP_GAP,
|
|
823
1026
|
// Growing from the baseline, never the mark's own tip - a column below zero grows
|
|
824
1027
|
// downward, so its transform-origin flips to the top edge it hangs from.
|
|
825
1028
|
origin: below ? 'top' : 'bottom',
|
|
@@ -832,45 +1035,76 @@ class ColumnSeriesComponent {
|
|
|
832
1035
|
markStagger(index) {
|
|
833
1036
|
return `${staggerDelay(index, this.staggerMs())}ms`;
|
|
834
1037
|
}
|
|
835
|
-
|
|
836
|
-
|
|
1038
|
+
tooltipMark = computed(() => this.tooltipAnchor() === 'mark' ? '.bar' : undefined, ...(ngDevMode ? [{ debugName: "tooltipMark" }] : /* istanbul ignore next */ []));
|
|
1039
|
+
onMarkClick(event) {
|
|
1040
|
+
const hit = markOf(event);
|
|
1041
|
+
const mark = hit && this.marks()[hit.index];
|
|
1042
|
+
if (!hit || !mark) {
|
|
1043
|
+
return;
|
|
1044
|
+
}
|
|
1045
|
+
this.pointClicked.emit(mark.point);
|
|
837
1046
|
if (this.pinOnClick()) {
|
|
838
|
-
this.activeMark.pin(index, event, this.
|
|
1047
|
+
this.activeMark.pin(hit.index, event, this.tooltipMark(), hit.element);
|
|
839
1048
|
}
|
|
840
1049
|
}
|
|
841
|
-
|
|
842
|
-
|
|
1050
|
+
onMarkOver(event) {
|
|
1051
|
+
const hit = markOf(event);
|
|
1052
|
+
if (hit) {
|
|
1053
|
+
this.activeMark.enter(hit.index, event, this.tooltipMark(), hit.element);
|
|
1054
|
+
}
|
|
843
1055
|
}
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
1056
|
+
onMarkOut(event) {
|
|
1057
|
+
const hit = markOf(event);
|
|
1058
|
+
const next = event.relatedTarget instanceof Element
|
|
1059
|
+
? event.relatedTarget.closest('[data-mark-index]')
|
|
1060
|
+
: null;
|
|
1061
|
+
if (hit && next !== hit.element) {
|
|
1062
|
+
this.activeMark.leave();
|
|
1063
|
+
}
|
|
852
1064
|
}
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
1065
|
+
roving = rovingMarks(() => this.marks().length);
|
|
1066
|
+
onMarkFocus(event, hit) {
|
|
1067
|
+
this.roving.focus(hit.index);
|
|
1068
|
+
this.activeMark.enter(hit.index, event, this.tooltipMark(), hit.element);
|
|
1069
|
+
}
|
|
1070
|
+
onMarkKey(event) {
|
|
1071
|
+
const hit = markOf(event);
|
|
1072
|
+
if (!hit) {
|
|
856
1073
|
return;
|
|
857
1074
|
}
|
|
858
|
-
event.
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
1075
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
1076
|
+
// Only the column's own key opens it: a key pressed on a control inside belongs to that
|
|
1077
|
+
// control.
|
|
1078
|
+
const mark = this.marks()[hit.index];
|
|
1079
|
+
if (this.interactive() && event.target === hit.element && mark) {
|
|
1080
|
+
event.preventDefault();
|
|
1081
|
+
this.pointClicked.emit(mark.point);
|
|
1082
|
+
}
|
|
866
1083
|
return;
|
|
867
1084
|
}
|
|
868
|
-
event.
|
|
869
|
-
this.pointClicked.emit(point);
|
|
1085
|
+
this.roving.navigate(event, hit.index, hit.element.closest('.columns'));
|
|
870
1086
|
}
|
|
871
1087
|
entryLabel(mark) {
|
|
872
1088
|
return `${mark.point.label}, ${mark.formattedValue}`;
|
|
873
1089
|
}
|
|
1090
|
+
/** This series' reading at the category the cursor is on. Filled whatever `tooltip` says: it
|
|
1091
|
+
* feeds the container's category panel, never a panel of this mark's own. */
|
|
1092
|
+
axisEntries = computed(() => {
|
|
1093
|
+
const categoryIndex = this.scales.activeIndex();
|
|
1094
|
+
const mark = this.marks()[categoryIndex];
|
|
1095
|
+
if (categoryIndex < 0 || !mark) {
|
|
1096
|
+
return [];
|
|
1097
|
+
}
|
|
1098
|
+
return [
|
|
1099
|
+
{
|
|
1100
|
+
label: this.seriesLabel() ?? mark.point.label,
|
|
1101
|
+
value: mark.point.value,
|
|
1102
|
+
formatted: mark.formattedValue,
|
|
1103
|
+
color: mark.color,
|
|
1104
|
+
hatched: mark.hatched,
|
|
1105
|
+
},
|
|
1106
|
+
];
|
|
1107
|
+
}, ...(ngDevMode ? [{ debugName: "axisEntries" }] : /* istanbul ignore next */ []));
|
|
874
1108
|
tooltipContext = computed(() => {
|
|
875
1109
|
const mark = this.marks()[this.activeMark.index()];
|
|
876
1110
|
if (this.tooltip() === 'none' || !mark) {
|
|
@@ -885,20 +1119,21 @@ class ColumnSeriesComponent {
|
|
|
885
1119
|
value: mark.point.value,
|
|
886
1120
|
formatted: mark.formattedValue,
|
|
887
1121
|
color: mark.color,
|
|
1122
|
+
hatched: mark.hatched,
|
|
888
1123
|
detail: this.partOfWhole()
|
|
889
|
-
? describeShare(this.data().map((point) => point.value), this.activeMark.index())
|
|
1124
|
+
? describeShare(this.data().map((point) => point.value), this.activeMark.index(), this.locale, (share) => this.intl().chart.shareOfTotal(share))
|
|
890
1125
|
: undefined,
|
|
891
1126
|
},
|
|
892
1127
|
],
|
|
893
1128
|
};
|
|
894
1129
|
}, ...(ngDevMode ? [{ debugName: "tooltipContext" }] : /* istanbul ignore next */ []));
|
|
895
1130
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ColumnSeriesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
896
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ColumnSeriesComponent, isStandalone: true, selector: "g[dsColumnSeries]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, showValues: { classPropertyName: "showValues", publicName: "showValues", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, partOfWhole: { classPropertyName: "partOfWhole", publicName: "partOfWhole", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipAnchor: { classPropertyName: "tooltipAnchor", publicName: "tooltipAnchor", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, columnWidthRatio: { classPropertyName: "columnWidthRatio", publicName: "columnWidthRatio", isSignal: true, isRequired: false, transformFunction: null }, slot: { classPropertyName: "slot", publicName: "slot", isSignal: true, isRequired: false, transformFunction: null }, slotCount: { classPropertyName: "slotCount", publicName: "slotCount", isSignal: true, isRequired: false, transformFunction: null }, offsets: { classPropertyName: "offsets", publicName: "offsets", isSignal: true, isRequired: false, transformFunction: null }, seriesColor: { classPropertyName: "seriesColor", publicName: "seriesColor", isSignal: true, isRequired: false, transformFunction: null }, seriesFill: { classPropertyName: "seriesFill", publicName: "seriesFill", isSignal: true, isRequired: false, transformFunction: null }, seriesLabel: { classPropertyName: "seriesLabel", publicName: "seriesLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClicked: "pointClicked" }, exportAs: ["dsColumnSeries"], ngImport: i0, template: "<svg:g\n class=\"columns\"\n [class.dims-others]=\"dimOthers()\"\n [style.--_column-chart-column-share]=\"markWidthPx()\"\n [style.--_column-chart-slot-step]=\"slotStepPx()\"\n [style.--_column-slot]=\"slot()\"\n [style.--_column-slots]=\"slotCount()\">\n <!-- `userSpaceOnUse`, so the stripe pitch is the same on a tall column and a short one: with the\n default object bounding box it would scale with each mark and read as a different texture\n per bar. -->\n <svg:defs>\n <svg:pattern\n class=\"hatch\"\n patternUnits=\"userSpaceOnUse\"\n width=\"8\"\n height=\"8\"\n patternTransform=\"rotate(45)\"\n [attr.id]=\"hatchId\">\n <svg:rect\n class=\"hatch-ground\"\n width=\"8\"\n height=\"8\" />\n\n <svg:line\n class=\"hatch-stripe\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"8\" />\n </svg:pattern>\n </svg:defs>\n\n @for (mark of marks(); track mark.key; let index = $index) {\n <svg:g\n class=\"column\"\n animate.leave=\"mark-leave\"\n [class.interactive]=\"interactive()\"\n [class.below-baseline]=\"mark.below\"\n [class.is-pinned]=\"activeMark.pinned() && activeMark.index() === index\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [style.--_column-mark-height]=\"mark.height + 'px'\"\n [style.--_column-baseline-y]=\"mark.baseline + 'px'\"\n [style.--_column-x]=\"mark.x + 'px'\"\n [attr.data-mark-index]=\"index\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.aria-label]=\"interactive() ? entryLabel(mark) : null\"\n (pointerenter)=\"onMarkEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(mark.point, index, $event)\"\n (keydown.enter)=\"onPointKey(mark.point, $event)\"\n (keydown.space)=\"onPointKey(mark.point, $event)\">\n <!-- The box that catches the pointer is the whole category slot, not the drawn column: a\n column two pixels tall is otherwise unreachable, and a pointer that has to find the\n mark is a pointer that misses it. -->\n <svg:rect\n class=\"hit-area\"\n y=\"0\"\n [attr.height]=\"hitHeight()\" />\n\n <svg:g\n class=\"bar\"\n animate.enter=\"mark-enter\"\n [style.transform-origin]=\"mark.origin\">\n <!-- Under the capped rect, not beside it: `rx` rounds all four corners, and the cap\n belongs on the free end alone. This one fills the two corners at the baseline back\n in, and both keep `y` and `height` a plain interpolable length, which a `<path>`\n would not. -->\n <svg:rect\n class=\"bar-base\"\n [attr.fill]=\"mark.color\" />\n\n <svg:rect\n class=\"bar-cap\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"mark.color\" />\n\n <!-- Stripes OVER the painted mark, not a pattern in place of its fill: a pattern carries\n its own colour, so one shared definition cannot take each mark's. Painting the surface\n colour through it leaves the mark's own hue showing between the stripes. -->\n @if (mark.hatched) {\n <svg:rect\n class=\"bar-hatch\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"'url(#' + hatchId + ')'\" />\n }\n </svg:g>\n\n @if (showValues()) {\n <svg:text\n class=\"value\"\n text-anchor=\"middle\"\n [attr.y]=\"mark.labelY\">\n {{ mark.formattedValue }}\n </svg:text>\n }\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <svg:g\n class=\"pin-marker\"\n aria-hidden=\"true\"\n [attr.transform]=\"'translate(0,' + mark.pinY + ')'\">\n <svg:circle\n class=\"pin-disc\"\n [attr.r]=\"pinDiscRadius\" />\n\n <svg:svg\n class=\"pin-glyph\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n [attr.x]=\"pinGlyphOffset\"\n [attr.y]=\"pinGlyphOffset\"\n [attr.width]=\"pinGlyphSize\"\n [attr.height]=\"pinGlyphSize\"\n [innerHTML]=\"pinGlyph\" />\n </svg:g>\n }\n </svg:g>\n }\n</svg:g>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.column .bar{transform-origin:bottom}.bar.mark-enter{animation:ds-chart-mark-grow-y var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.column.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}@media not (forced-colors:active){.column:focus{outline:none}}.columns .column{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.columns .column.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:hover) .column.interactive:not(:hover),.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:focus-visible) .column.interactive:not(:focus-visible),.columns.dims-others:has(.column.is-pinned) .column:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.columns .column.interactive{cursor:pointer}.columns{--_column-chart-column-max-width: var(--ds-column-chart-column-max-width, 48px);--_column-chart-column-gap: var(--ds-column-chart-column-gap, var(--ds-chart-bar-gap));--_column-chart-cap-radius: var( --ds-column-chart-cap-radius, var(--ds-chart-mark-cap-radius) );--_chart-hatch-color: var( --ds-chart-hatch-color, var(--surface-default) );--_chart-hatch-width: var(--ds-chart-hatch-width, 3px)}.column{--_column-mark-width: min( var(--_column-chart-column-share), var(--_column-chart-column-max-width) );--_column-hit-width: min( var(--_column-chart-slot-step), calc( var(--_column-chart-column-max-width) + var(--_column-chart-column-gap) ) );--_column-square-height: min( var(--_column-chart-cap-radius), calc(var(--_column-mark-height) / 2) );--_column-slot-offset: calc( (2 * var(--_column-slot, 0) - var(--_column-slots, 1) + 1) * (var(--_column-mark-width) + var(--_column-chart-column-gap)) / 2 );transform:translate(calc(var(--_column-x, 0px) + var(--_column-slot-offset)))}.hit-area{width:var(--_column-hit-width);x:calc(var(--_column-hit-width) / -2);fill:transparent}.bar{transform-box:fill-box}.bar-base,.bar-cap,.bar-hatch{width:var(--_column-mark-width);x:calc(var(--_column-mark-width) / -2);transition:y var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),height var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.bar-cap{rx:var(--_column-chart-cap-radius)}.hatch-ground{fill:none}.hatch-stripe{stroke:var(--_chart-hatch-color);stroke-width:var(--_chart-hatch-width)}.bar-hatch{rx:var(--_column-chart-cap-radius);pointer-events:none}.bar-base{height:var(--_column-square-height);y:calc(var(--_column-baseline-y) - var(--_column-square-height))}.column.below-baseline .bar-base{y:var(--_column-baseline-y)}.value{fill:currentcolor;font-size:var(--font-size-xs);font-weight:700;pointer-events:none}.column.below-baseline .value{dominant-baseline:hanging}@media not (forced-colors:active){.column.interactive:focus-visible{outline:none}}.column.interactive:focus-visible .bar-cap{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color))}@media(forced-colors:active){.column.interactive:focus-visible .bar-cap{stroke:Highlight;filter:none}}.pin-marker{pointer-events:none}.pin-disc{fill:var(--surface-default);stroke:var(--border-divider);stroke-width:var(--border-width-default)}.pin-glyph{color:var(--text-primary)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1131
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ColumnSeriesComponent, isStandalone: true, selector: "g[dsColumnSeries]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, showValues: { classPropertyName: "showValues", publicName: "showValues", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, partOfWhole: { classPropertyName: "partOfWhole", publicName: "partOfWhole", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipAnchor: { classPropertyName: "tooltipAnchor", publicName: "tooltipAnchor", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, columnWidthRatio: { classPropertyName: "columnWidthRatio", publicName: "columnWidthRatio", isSignal: true, isRequired: false, transformFunction: null }, slot: { classPropertyName: "slot", publicName: "slot", isSignal: true, isRequired: false, transformFunction: null }, slotCount: { classPropertyName: "slotCount", publicName: "slotCount", isSignal: true, isRequired: false, transformFunction: null }, offsets: { classPropertyName: "offsets", publicName: "offsets", isSignal: true, isRequired: false, transformFunction: null }, axis: { classPropertyName: "axis", publicName: "axis", isSignal: true, isRequired: false, transformFunction: null }, seriesColor: { classPropertyName: "seriesColor", publicName: "seriesColor", isSignal: true, isRequired: false, transformFunction: null }, seriesFill: { classPropertyName: "seriesFill", publicName: "seriesFill", isSignal: true, isRequired: false, transformFunction: null }, seriesLabel: { classPropertyName: "seriesLabel", publicName: "seriesLabel", isSignal: true, isRequired: false, transformFunction: null }, seriesKey: { classPropertyName: "seriesKey", publicName: "seriesKey", isSignal: true, isRequired: false, transformFunction: null }, highlighted: { classPropertyName: "highlighted", publicName: "highlighted", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClicked: "pointClicked" }, viewQueries: [{ propertyName: "barElements", predicate: ["barEl"], descendants: true, isSignal: true }], exportAs: ["dsColumnSeries"], ngImport: i0, template: "<svg:g\n class=\"columns\"\n [class.dims-others]=\"dimOthers()\"\n [class.is-dimmed]=\"dimmedBySeries()\"\n [style.--_column-chart-column-share]=\"markWidthPx()\"\n [style.--_column-chart-slot-step]=\"slotStepPx()\"\n [style.--_column-slot]=\"slot()\"\n [style.--_column-slots]=\"slotCount()\"\n (pointerover)=\"onMarkOver($event)\"\n (pointerout)=\"onMarkOut($event)\"\n (keydown)=\"onMarkKey($event)\"\n (click)=\"onMarkClick($event)\">\n <!-- `userSpaceOnUse`, so the stripe pitch is the same on a tall column and a short one: with the\n default object bounding box it would scale with each mark and read as a different texture\n per bar. The stripe runs down the tile's middle: on its edge the tile clips it to half its\n width. -->\n @if (hatchInUse()) {\n <svg:defs>\n <svg:pattern\n class=\"hatch\"\n patternUnits=\"userSpaceOnUse\"\n width=\"8\"\n height=\"8\"\n patternTransform=\"rotate(-45)\"\n [attr.id]=\"hatchId\">\n <svg:rect\n class=\"hatch-ground\"\n width=\"8\"\n height=\"8\" />\n\n <svg:line\n class=\"hatch-stripe\"\n x1=\"4\"\n y1=\"0\"\n x2=\"4\"\n y2=\"8\" />\n </svg:pattern>\n </svg:defs>\n }\n\n @for (mark of marks(); track mark.key; let index = $index) {\n <svg:g\n class=\"column\"\n [class.interactive]=\"interactive()\"\n [class.below-baseline]=\"mark.below\"\n [class.is-pinned]=\"activeMark.pinned() && activeMark.index() === index\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [style.--_column-mark-height]=\"mark.height + 'px'\"\n [style.--_column-baseline-y]=\"mark.baseline + 'px'\"\n [style.--_column-x]=\"mark.x + 'px'\"\n [attr.data-mark-index]=\"index\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === roving.tabStop() ? 0 : -1) : null\n \"\n [attr.aria-label]=\"interactive() ? entryLabel(mark) : null\"\n (animate.leave)=\"leaveMark($event)\">\n <!-- The box that catches the pointer is the whole category slot, not the drawn column: a\n column two pixels tall is otherwise unreachable, and a pointer that has to find the\n mark is a pointer that misses it. -->\n @let hit = hitBox(mark);\n\n <svg:rect\n class=\"hit-area\"\n [attr.y]=\"hit.y\"\n [attr.height]=\"hit.height\" />\n\n <svg:g\n #barEl\n class=\"bar\"\n [style.transform-origin]=\"mark.origin\">\n <!-- Under the capped rect, not beside it: `rx` rounds all four corners, and the cap\n belongs on the free end alone. This one fills the two corners at the baseline back\n in, and both keep `y` and `height` a plain interpolable length, which a `<path>`\n would not. -->\n <svg:rect\n class=\"bar-base\"\n [attr.fill]=\"mark.color\" />\n\n <svg:rect\n class=\"bar-cap\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"mark.color\" />\n\n <!-- Stripes OVER the painted mark, not a pattern in place of its fill: a pattern carries\n its own colour, so one shared definition cannot take each mark's. Painting the surface\n colour through it leaves the mark's own hue showing between the stripes. -->\n @if (mark.hatched) {\n <svg:rect\n class=\"bar-hatch\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"'url(#' + hatchId + ')'\" />\n }\n </svg:g>\n\n @if (showValues()) {\n <svg:text\n class=\"value\"\n text-anchor=\"middle\"\n [attr.y]=\"mark.labelY\">\n {{ mark.formattedValue }}\n </svg:text>\n }\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <svg:g\n class=\"pin-marker\"\n aria-hidden=\"true\"\n [attr.transform]=\"'translate(0,' + mark.pinY + ')'\">\n <svg:circle\n class=\"pin-disc\"\n [attr.r]=\"pinDiscRadius\" />\n\n <svg:svg\n class=\"pin-glyph\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n [attr.x]=\"pinGlyphOffset\"\n [attr.y]=\"pinGlyphOffset\"\n [attr.width]=\"pinGlyphSize\"\n [attr.height]=\"pinGlyphSize\"\n [innerHTML]=\"pinGlyph\" />\n </svg:g>\n }\n </svg:g>\n }\n</svg:g>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.column .bar{transform-origin:bottom}.bar{animation:ds-chart-mark-grow-y var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.column.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}@media not (forced-colors:active){.column:focus{outline:none}}.columns .column{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.columns .column.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:hover) .column.interactive:not(:hover),.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:focus-visible) .column.interactive:not(:focus-visible),.columns.dims-others:has(.column.is-pinned) .column:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.columns .column.interactive{cursor:pointer}.columns{--_column-chart-column-max-width: var(--ds-column-chart-column-max-width, 48px);--_column-chart-column-gap: var(--ds-column-chart-column-gap, var(--ds-chart-bar-gap));--_column-chart-cap-radius: var( --ds-column-chart-cap-radius, var(--ds-chart-mark-cap-radius) );--_chart-hatch-color: var( --ds-chart-hatch-color, var(--surface-default) );--_chart-hatch-width: var(--ds-chart-hatch-width, 1.5px)}.column{--_column-mark-width: min( var(--_column-chart-column-share), var(--_column-chart-column-max-width) );--_column-hit-width: min( var(--_column-chart-slot-step), calc( var(--_column-chart-column-max-width) + var(--_column-chart-column-gap) ) );--_column-square-height: min( var(--_column-chart-cap-radius), calc(var(--_column-mark-height) / 2) );--_column-slot-offset: calc( (2 * var(--_column-slot, 0) - var(--_column-slots, 1) + 1) * (var(--_column-mark-width) + var(--_column-chart-column-gap)) / 2 );transform:translate(calc(var(--_column-x, 0px) + var(--_column-slot-offset)))}.hit-area{width:var(--_column-hit-width);x:calc(var(--_column-hit-width) / -2);fill:transparent}.bar{transform-box:fill-box}.bar-base,.bar-cap,.bar-hatch{width:var(--_column-mark-width);x:calc(var(--_column-mark-width) / -2);transition:y var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),height var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.bar-cap{rx:var(--_column-chart-cap-radius)}.hatch-ground{fill:none}.hatch-stripe{stroke:var(--_chart-hatch-color);stroke-width:var(--_chart-hatch-width)}.bar-hatch{rx:var(--_column-chart-cap-radius);pointer-events:none}.bar-base{height:var(--_column-square-height);y:calc(var(--_column-baseline-y) - var(--_column-square-height))}.column.below-baseline .bar-base{y:var(--_column-baseline-y)}.value{fill:currentcolor;font-size:var(--font-size-xs);font-weight:700;pointer-events:none}.column.below-baseline .value{dominant-baseline:hanging}@media not (forced-colors:active){.column.interactive:focus-visible{outline:none}}.column.interactive:focus-visible .bar-cap{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color))}@media(forced-colors:active){.column.interactive:focus-visible .bar-cap{stroke:Highlight;filter:none}}.pin-marker{pointer-events:none}.pin-disc{fill:var(--surface-default);stroke:var(--border-divider);stroke-width:var(--border-width-default)}.pin-glyph{color:var(--text-primary)}.columns.is-dimmed{opacity:var(--ds-chart-dim-opacity);transition:opacity var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
897
1132
|
}
|
|
898
1133
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ColumnSeriesComponent, decorators: [{
|
|
899
1134
|
type: Component,
|
|
900
|
-
args: [{ selector: 'g[dsColumnSeries]', standalone: true, exportAs: 'dsColumnSeries', encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g\n class=\"columns\"\n [class.dims-others]=\"dimOthers()\"\n [style.--_column-chart-column-share]=\"markWidthPx()\"\n [style.--_column-chart-slot-step]=\"slotStepPx()\"\n [style.--_column-slot]=\"slot()\"\n [style.--_column-slots]=\"slotCount()\">\n <!-- `userSpaceOnUse`, so the stripe pitch is the same on a tall column and a short one: with the\n default object bounding box it would scale with each mark and read as a different texture\n per bar. -->\n <svg:defs>\n
|
|
901
|
-
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], showValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValues", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], partOfWhole: [{ type: i0.Input, args: [{ isSignal: true, alias: "partOfWhole", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipAnchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipAnchor", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], columnWidthRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnWidthRatio", required: false }] }], slot: [{ type: i0.Input, args: [{ isSignal: true, alias: "slot", required: false }] }], slotCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "slotCount", required: false }] }], offsets: [{ type: i0.Input, args: [{ isSignal: true, alias: "offsets", required: false }] }], seriesColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesColor", required: false }] }], seriesFill: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesFill", required: false }] }], seriesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesLabel", required: false }] }], pointClicked: [{ type: i0.Output, args: ["pointClicked"] }] } });
|
|
1135
|
+
args: [{ selector: 'g[dsColumnSeries]', standalone: true, exportAs: 'dsColumnSeries', encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g\n class=\"columns\"\n [class.dims-others]=\"dimOthers()\"\n [class.is-dimmed]=\"dimmedBySeries()\"\n [style.--_column-chart-column-share]=\"markWidthPx()\"\n [style.--_column-chart-slot-step]=\"slotStepPx()\"\n [style.--_column-slot]=\"slot()\"\n [style.--_column-slots]=\"slotCount()\"\n (pointerover)=\"onMarkOver($event)\"\n (pointerout)=\"onMarkOut($event)\"\n (keydown)=\"onMarkKey($event)\"\n (click)=\"onMarkClick($event)\">\n <!-- `userSpaceOnUse`, so the stripe pitch is the same on a tall column and a short one: with the\n default object bounding box it would scale with each mark and read as a different texture\n per bar. The stripe runs down the tile's middle: on its edge the tile clips it to half its\n width. -->\n @if (hatchInUse()) {\n <svg:defs>\n <svg:pattern\n class=\"hatch\"\n patternUnits=\"userSpaceOnUse\"\n width=\"8\"\n height=\"8\"\n patternTransform=\"rotate(-45)\"\n [attr.id]=\"hatchId\">\n <svg:rect\n class=\"hatch-ground\"\n width=\"8\"\n height=\"8\" />\n\n <svg:line\n class=\"hatch-stripe\"\n x1=\"4\"\n y1=\"0\"\n x2=\"4\"\n y2=\"8\" />\n </svg:pattern>\n </svg:defs>\n }\n\n @for (mark of marks(); track mark.key; let index = $index) {\n <svg:g\n class=\"column\"\n [class.interactive]=\"interactive()\"\n [class.below-baseline]=\"mark.below\"\n [class.is-pinned]=\"activeMark.pinned() && activeMark.index() === index\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [style.--_column-mark-height]=\"mark.height + 'px'\"\n [style.--_column-baseline-y]=\"mark.baseline + 'px'\"\n [style.--_column-x]=\"mark.x + 'px'\"\n [attr.data-mark-index]=\"index\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === roving.tabStop() ? 0 : -1) : null\n \"\n [attr.aria-label]=\"interactive() ? entryLabel(mark) : null\"\n (animate.leave)=\"leaveMark($event)\">\n <!-- The box that catches the pointer is the whole category slot, not the drawn column: a\n column two pixels tall is otherwise unreachable, and a pointer that has to find the\n mark is a pointer that misses it. -->\n @let hit = hitBox(mark);\n\n <svg:rect\n class=\"hit-area\"\n [attr.y]=\"hit.y\"\n [attr.height]=\"hit.height\" />\n\n <svg:g\n #barEl\n class=\"bar\"\n [style.transform-origin]=\"mark.origin\">\n <!-- Under the capped rect, not beside it: `rx` rounds all four corners, and the cap\n belongs on the free end alone. This one fills the two corners at the baseline back\n in, and both keep `y` and `height` a plain interpolable length, which a `<path>`\n would not. -->\n <svg:rect\n class=\"bar-base\"\n [attr.fill]=\"mark.color\" />\n\n <svg:rect\n class=\"bar-cap\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"mark.color\" />\n\n <!-- Stripes OVER the painted mark, not a pattern in place of its fill: a pattern carries\n its own colour, so one shared definition cannot take each mark's. Painting the surface\n colour through it leaves the mark's own hue showing between the stripes. -->\n @if (mark.hatched) {\n <svg:rect\n class=\"bar-hatch\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"'url(#' + hatchId + ')'\" />\n }\n </svg:g>\n\n @if (showValues()) {\n <svg:text\n class=\"value\"\n text-anchor=\"middle\"\n [attr.y]=\"mark.labelY\">\n {{ mark.formattedValue }}\n </svg:text>\n }\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <svg:g\n class=\"pin-marker\"\n aria-hidden=\"true\"\n [attr.transform]=\"'translate(0,' + mark.pinY + ')'\">\n <svg:circle\n class=\"pin-disc\"\n [attr.r]=\"pinDiscRadius\" />\n\n <svg:svg\n class=\"pin-glyph\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n [attr.x]=\"pinGlyphOffset\"\n [attr.y]=\"pinGlyphOffset\"\n [attr.width]=\"pinGlyphSize\"\n [attr.height]=\"pinGlyphSize\"\n [innerHTML]=\"pinGlyph\" />\n </svg:g>\n }\n </svg:g>\n }\n</svg:g>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.column .bar{transform-origin:bottom}.bar{animation:ds-chart-mark-grow-y var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.column.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}@media not (forced-colors:active){.column:focus{outline:none}}.columns .column{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.columns .column.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:hover) .column.interactive:not(:hover),.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:focus-visible) .column.interactive:not(:focus-visible),.columns.dims-others:has(.column.is-pinned) .column:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.columns .column.interactive{cursor:pointer}.columns{--_column-chart-column-max-width: var(--ds-column-chart-column-max-width, 48px);--_column-chart-column-gap: var(--ds-column-chart-column-gap, var(--ds-chart-bar-gap));--_column-chart-cap-radius: var( --ds-column-chart-cap-radius, var(--ds-chart-mark-cap-radius) );--_chart-hatch-color: var( --ds-chart-hatch-color, var(--surface-default) );--_chart-hatch-width: var(--ds-chart-hatch-width, 1.5px)}.column{--_column-mark-width: min( var(--_column-chart-column-share), var(--_column-chart-column-max-width) );--_column-hit-width: min( var(--_column-chart-slot-step), calc( var(--_column-chart-column-max-width) + var(--_column-chart-column-gap) ) );--_column-square-height: min( var(--_column-chart-cap-radius), calc(var(--_column-mark-height) / 2) );--_column-slot-offset: calc( (2 * var(--_column-slot, 0) - var(--_column-slots, 1) + 1) * (var(--_column-mark-width) + var(--_column-chart-column-gap)) / 2 );transform:translate(calc(var(--_column-x, 0px) + var(--_column-slot-offset)))}.hit-area{width:var(--_column-hit-width);x:calc(var(--_column-hit-width) / -2);fill:transparent}.bar{transform-box:fill-box}.bar-base,.bar-cap,.bar-hatch{width:var(--_column-mark-width);x:calc(var(--_column-mark-width) / -2);transition:y var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),height var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.bar-cap{rx:var(--_column-chart-cap-radius)}.hatch-ground{fill:none}.hatch-stripe{stroke:var(--_chart-hatch-color);stroke-width:var(--_chart-hatch-width)}.bar-hatch{rx:var(--_column-chart-cap-radius);pointer-events:none}.bar-base{height:var(--_column-square-height);y:calc(var(--_column-baseline-y) - var(--_column-square-height))}.column.below-baseline .bar-base{y:var(--_column-baseline-y)}.value{fill:currentcolor;font-size:var(--font-size-xs);font-weight:700;pointer-events:none}.column.below-baseline .value{dominant-baseline:hanging}@media not (forced-colors:active){.column.interactive:focus-visible{outline:none}}.column.interactive:focus-visible .bar-cap{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color))}@media(forced-colors:active){.column.interactive:focus-visible .bar-cap{stroke:Highlight;filter:none}}.pin-marker{pointer-events:none}.pin-disc{fill:var(--surface-default);stroke:var(--border-divider);stroke-width:var(--border-width-default)}.pin-glyph{color:var(--text-primary)}.columns.is-dimmed{opacity:var(--ds-chart-dim-opacity);transition:opacity var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}\n"] }]
|
|
1136
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], showValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValues", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], partOfWhole: [{ type: i0.Input, args: [{ isSignal: true, alias: "partOfWhole", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipAnchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipAnchor", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], columnWidthRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnWidthRatio", required: false }] }], slot: [{ type: i0.Input, args: [{ isSignal: true, alias: "slot", required: false }] }], slotCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "slotCount", required: false }] }], offsets: [{ type: i0.Input, args: [{ isSignal: true, alias: "offsets", required: false }] }], axis: [{ type: i0.Input, args: [{ isSignal: true, alias: "axis", required: false }] }], seriesColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesColor", required: false }] }], seriesFill: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesFill", required: false }] }], seriesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesLabel", required: false }] }], seriesKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesKey", required: false }] }], highlighted: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlighted", required: false }] }], pointClicked: [{ type: i0.Output, args: ["pointClicked"] }], barElements: [{ type: i0.ViewChildren, args: ['barEl', { isSignal: true }] }] } });
|
|
902
1137
|
|
|
903
1138
|
let nextSeriesId = 0;
|
|
904
1139
|
/**
|
|
@@ -909,6 +1144,7 @@ let nextSeriesId = 0;
|
|
|
909
1144
|
* know is not rendered, and neither are its descendants. Written as `<svg:g dsLineSeries>`.
|
|
910
1145
|
*/
|
|
911
1146
|
class LineSeriesComponent {
|
|
1147
|
+
leaveMark = leaveMark;
|
|
912
1148
|
scales = inject(CHART_SCALES);
|
|
913
1149
|
/** Not `input.required`: the preset reads `tooltipContext()` from a binding on this same
|
|
914
1150
|
* element, and a required input throws NG0950 for the pass before its own value is written. */
|
|
@@ -916,6 +1152,10 @@ class LineSeriesComponent {
|
|
|
916
1152
|
/** Draws a round marker at every reading. Off leaves the line alone, which reads better past
|
|
917
1153
|
* roughly twenty points. */
|
|
918
1154
|
showMarkers = input(true, { ...(ngDevMode ? { debugName: "showMarkers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1155
|
+
/** Lays the line and its markers on a band of the surface colour, so they stay legible where
|
|
1156
|
+
* they cross other marks. On by default: a line shares its plot more often than not, and on an
|
|
1157
|
+
* empty plot the band only separates it from the gridlines. */
|
|
1158
|
+
outline = input(true, { ...(ngDevMode ? { debugName: "outline" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
919
1159
|
/** Turns on the click affordance - the pointer cursor and the hover tint. `pointClicked`
|
|
920
1160
|
* fires whether or not this is set. */
|
|
921
1161
|
interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
@@ -927,8 +1167,8 @@ class LineSeriesComponent {
|
|
|
927
1167
|
dimOthers = input(false, { ...(ngDevMode ? { debugName: "dimOthers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
928
1168
|
/** The one series to single out: every other one draws faded and this one draws bold, so the
|
|
929
1169
|
* comparison survives a monochrome print. Driven from a legend, or from whatever else the app
|
|
930
|
-
* uses to mean "show me this one".
|
|
931
|
-
*
|
|
1170
|
+
* uses to mean "show me this one". Fades the others whether or not `dimOthers` is set, which
|
|
1171
|
+
* governs only what a pointer over a marker does. */
|
|
932
1172
|
highlighted = input(null, ...(ngDevMode ? [{ debugName: "highlighted" }] : /* istanbul ignore next */ []));
|
|
933
1173
|
/** A dash pattern per series, in the order the series are given. A series past the end of the
|
|
934
1174
|
* list, or given an empty string, draws solid. */
|
|
@@ -963,7 +1203,7 @@ class LineSeriesComponent {
|
|
|
963
1203
|
tooltipLingerMs = input(0, { ...(ngDevMode ? { debugName: "tooltipLingerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
964
1204
|
/** Formats every value this series prints. Called with `'tick'` for an axis label and
|
|
965
1205
|
* `'tooltip'` everywhere a value is printed in full. */
|
|
966
|
-
valueFormat = input(
|
|
1206
|
+
valueFormat = input(chartValueFormat(injectDsLocale()), ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
|
|
967
1207
|
/** The clicked reading, with the series it belongs to and its position in `categories`.
|
|
968
1208
|
* Fires on click and on Enter or Space, whatever `interactive` says. */
|
|
969
1209
|
pointClicked = output();
|
|
@@ -973,8 +1213,21 @@ class LineSeriesComponent {
|
|
|
973
1213
|
this.scales.reportDomain(`${this.domainId}-primary`, this.valuesOn('primary'), 'primary');
|
|
974
1214
|
this.scales.reportDomain(`${this.domainId}-secondary`, this.valuesOn('secondary'), 'secondary');
|
|
975
1215
|
});
|
|
1216
|
+
// The container opens the panel, so a plot holding several marks can only ever show one.
|
|
1217
|
+
this.scales.reportTooltip(this.domainId, {
|
|
1218
|
+
context: this.tooltipContext,
|
|
1219
|
+
origin: this.tooltipOrigin,
|
|
1220
|
+
offersTooltip: computed(() => this.tooltip() !== 'none'),
|
|
1221
|
+
axisOrigin: this.topReadingElement,
|
|
1222
|
+
axisEntries: this.axisEntries,
|
|
1223
|
+
});
|
|
1224
|
+
listenForMarkFocus(inject(ElementRef), (event, hit) => this.onMarkerFocus(event, hit), () => {
|
|
1225
|
+
this.focusedSeries.set(null);
|
|
1226
|
+
this.activeMark.leave();
|
|
1227
|
+
});
|
|
976
1228
|
}
|
|
977
1229
|
ngOnDestroy() {
|
|
1230
|
+
this.scales.releaseTooltip(this.domainId);
|
|
978
1231
|
this.scales.releaseDomain(`${this.domainId}-primary`);
|
|
979
1232
|
this.scales.releaseDomain(`${this.domainId}-secondary`);
|
|
980
1233
|
}
|
|
@@ -1073,53 +1326,87 @@ class LineSeriesComponent {
|
|
|
1073
1326
|
* every mouse-operable control has to be separately focusable, which is what keeps a
|
|
1074
1327
|
* 12-category, 2-series plot from being twenty-four stops in the page's tab order. */
|
|
1075
1328
|
rovingBySeries = signal(new Map(), ...(ngDevMode ? [{ debugName: "rovingBySeries" }] : /* istanbul ignore next */ []));
|
|
1329
|
+
firstMarkerBySeries = computed(() => new Map(this.plotted().map((entry) => [
|
|
1330
|
+
entry.series.id,
|
|
1331
|
+
entry.markers[0]?.markIndex,
|
|
1332
|
+
])), ...(ngDevMode ? [{ debugName: "firstMarkerBySeries" }] : /* istanbul ignore next */ []));
|
|
1076
1333
|
isTabStop(seriesId, markIndex) {
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
return chosen === markIndex;
|
|
1080
|
-
}
|
|
1081
|
-
const first = this.plotted().find((entry) => entry.series.id === seriesId)
|
|
1082
|
-
?.markers[0];
|
|
1083
|
-
return first?.markIndex === markIndex;
|
|
1334
|
+
return ((this.rovingBySeries().get(seriesId) ??
|
|
1335
|
+
this.firstMarkerBySeries().get(seriesId)) === markIndex);
|
|
1084
1336
|
}
|
|
1085
1337
|
/** The series a marker holds focus on, which narrows an `'axis'` panel to that one reading: a
|
|
1086
1338
|
* pointer answers for every series at once, a focused marker answers for its own. */
|
|
1087
1339
|
focusedSeries = signal(null, ...(ngDevMode ? [{ debugName: "focusedSeries" }] : /* istanbul ignore next */ []));
|
|
1088
|
-
|
|
1089
|
-
|
|
1340
|
+
/** A reading is active when its own marker is hovered OR when the category cursor is on its
|
|
1341
|
+
* category: one band, one answer, so the dot grows wherever in the band the pointer is rather
|
|
1342
|
+
* than only on the 4px dot itself. */
|
|
1343
|
+
isActiveMarker(marker) {
|
|
1344
|
+
return (marker.markIndex === this.activeMark.index() ||
|
|
1345
|
+
marker.categoryIndex === this.scales.activeIndex());
|
|
1090
1346
|
}
|
|
1091
|
-
|
|
1092
|
-
const
|
|
1347
|
+
onMarkerOver(event) {
|
|
1348
|
+
const hit = markOf(event);
|
|
1349
|
+
if (hit) {
|
|
1350
|
+
this.activeMark.enter(hit.index, event, undefined, hit.element);
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
onMarkerOut(event) {
|
|
1354
|
+
const hit = markOf(event);
|
|
1355
|
+
if (!hit) {
|
|
1356
|
+
return;
|
|
1357
|
+
}
|
|
1358
|
+
const next = event.relatedTarget instanceof Element
|
|
1359
|
+
? event.relatedTarget.closest('[data-mark-index]')
|
|
1360
|
+
: null;
|
|
1361
|
+
if (next !== hit.element) {
|
|
1362
|
+
this.activeMark.leave();
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
onMarkerFocus(event, hit) {
|
|
1366
|
+
const marker = this.allMarkers()[hit.index];
|
|
1093
1367
|
if (marker) {
|
|
1094
|
-
this.rovingBySeries.update((roving) => new Map(roving).set(marker.seriesId,
|
|
1368
|
+
this.rovingBySeries.update((roving) => new Map(roving).set(marker.seriesId, hit.index));
|
|
1095
1369
|
this.focusedSeries.set(marker.seriesId);
|
|
1096
1370
|
this.scales.setActiveIndex(marker.categoryIndex);
|
|
1097
1371
|
}
|
|
1098
|
-
this.
|
|
1372
|
+
this.activeMark.enter(hit.index, event, undefined, hit.element);
|
|
1099
1373
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1374
|
+
onMarkerKey(event) {
|
|
1375
|
+
const hit = markOf(event);
|
|
1376
|
+
if (!hit) {
|
|
1377
|
+
return;
|
|
1378
|
+
}
|
|
1379
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
1380
|
+
this.selectMarker(hit.index);
|
|
1381
|
+
return;
|
|
1382
|
+
}
|
|
1383
|
+
const marker = this.allMarkers()[hit.index];
|
|
1106
1384
|
const strand = this.allMarkers().filter((candidate) => candidate.seriesId === marker?.seriesId);
|
|
1107
|
-
const current = strand.findIndex((candidate) => candidate.markIndex ===
|
|
1385
|
+
const current = strand.findIndex((candidate) => candidate.markIndex === hit.index);
|
|
1108
1386
|
const next = nextRovingIndex(event.key, current, strand.length);
|
|
1109
1387
|
if (next === null) {
|
|
1110
1388
|
return;
|
|
1111
1389
|
}
|
|
1112
1390
|
event.preventDefault();
|
|
1113
|
-
focusMark(
|
|
1391
|
+
focusMark(hit.element.closest('.lines'), strand[next].markIndex);
|
|
1114
1392
|
}
|
|
1115
1393
|
isDimmed(seriesId) {
|
|
1116
1394
|
const highlighted = this.highlighted();
|
|
1117
|
-
|
|
1395
|
+
// Not gated on `dimOthers`: that input governs what a POINTER over a mark does, and naming a
|
|
1396
|
+
// series in the legend is the reader asking for this one directly.
|
|
1397
|
+
return highlighted !== null && highlighted !== seriesId;
|
|
1118
1398
|
}
|
|
1119
|
-
onMarkerClick(
|
|
1120
|
-
|
|
1121
|
-
|
|
1399
|
+
onMarkerClick(event) {
|
|
1400
|
+
const hit = markOf(event);
|
|
1401
|
+
if (!hit) {
|
|
1402
|
+
return;
|
|
1403
|
+
}
|
|
1404
|
+
if (this.pinOnClick()) {
|
|
1405
|
+
this.activeMark.pin(hit.index, event, '.series-marker', hit.element);
|
|
1122
1406
|
}
|
|
1407
|
+
this.selectMarker(hit.index);
|
|
1408
|
+
}
|
|
1409
|
+
selectMarker(markIndex) {
|
|
1123
1410
|
const marker = this.allMarkers()[markIndex];
|
|
1124
1411
|
const series = this.data().find((entry) => entry.id === marker?.seriesId);
|
|
1125
1412
|
if (marker && series) {
|
|
@@ -1133,6 +1420,28 @@ class LineSeriesComponent {
|
|
|
1133
1420
|
markerLabel(marker) {
|
|
1134
1421
|
return `${marker.seriesLabel}, ${marker.category}, ${marker.formattedValue}`;
|
|
1135
1422
|
}
|
|
1423
|
+
/** What this series reads at the category the cursor is on, whatever `tooltip` says. It feeds
|
|
1424
|
+
* the container's category panel, so one band answers for every mark on the plot rather than
|
|
1425
|
+
* each mark owning a hover field of its own. */
|
|
1426
|
+
axisEntries = computed(() => {
|
|
1427
|
+
const categoryIndex = this.scales.activeIndex();
|
|
1428
|
+
if (categoryIndex < 0) {
|
|
1429
|
+
return [];
|
|
1430
|
+
}
|
|
1431
|
+
return this.plotted().flatMap((entry) => {
|
|
1432
|
+
const marker = entry.markers.find((candidate) => candidate.categoryIndex === categoryIndex);
|
|
1433
|
+
return marker
|
|
1434
|
+
? [
|
|
1435
|
+
{
|
|
1436
|
+
label: marker.seriesLabel,
|
|
1437
|
+
value: marker.value,
|
|
1438
|
+
formatted: marker.formattedValue,
|
|
1439
|
+
color: marker.color,
|
|
1440
|
+
},
|
|
1441
|
+
]
|
|
1442
|
+
: [];
|
|
1443
|
+
});
|
|
1444
|
+
}, ...(ngDevMode ? [{ debugName: "axisEntries" }] : /* istanbul ignore next */ []));
|
|
1136
1445
|
tooltipContext = computed(() => {
|
|
1137
1446
|
if (this.tooltip() === 'none') {
|
|
1138
1447
|
return null;
|
|
@@ -1217,12 +1526,12 @@ class LineSeriesComponent {
|
|
|
1217
1526
|
};
|
|
1218
1527
|
}, ...(ngDevMode ? [{ debugName: "axisTooltipContext" }] : /* istanbul ignore next */ []));
|
|
1219
1528
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: LineSeriesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1220
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: LineSeriesComponent, isStandalone: true, selector: "g[dsLineSeries]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, highlighted: { classPropertyName: "highlighted", publicName: "highlighted", isSignal: true, isRequired: false, transformFunction: null }, patterns: { classPropertyName: "patterns", publicName: "patterns", isSignal: true, isRequired: false, transformFunction: null }, stacked: { classPropertyName: "stacked", publicName: "stacked", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, gaps: { classPropertyName: "gaps", publicName: "gaps", isSignal: true, isRequired: false, transformFunction: null }, curve: { classPropertyName: "curve", publicName: "curve", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipAnchor: { classPropertyName: "tooltipAnchor", publicName: "tooltipAnchor", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClicked: "pointClicked" }, viewQueries: [{ propertyName: "markerElements", predicate: ["markerEl"], descendants: true, isSignal: true }], exportAs: ["dsLineSeries"], ngImport: i0, template: "<svg:g\n class=\"lines\"\n [class.dims-others]=\"dimOthers()\">\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.areaPaths; track $index) {\n <svg:path\n class=\"series-area\"\n
|
|
1529
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: LineSeriesComponent, isStandalone: true, selector: "g[dsLineSeries]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, outline: { classPropertyName: "outline", publicName: "outline", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, highlighted: { classPropertyName: "highlighted", publicName: "highlighted", isSignal: true, isRequired: false, transformFunction: null }, patterns: { classPropertyName: "patterns", publicName: "patterns", isSignal: true, isRequired: false, transformFunction: null }, stacked: { classPropertyName: "stacked", publicName: "stacked", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, gaps: { classPropertyName: "gaps", publicName: "gaps", isSignal: true, isRequired: false, transformFunction: null }, curve: { classPropertyName: "curve", publicName: "curve", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipAnchor: { classPropertyName: "tooltipAnchor", publicName: "tooltipAnchor", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClicked: "pointClicked" }, viewQueries: [{ propertyName: "markerElements", predicate: ["markerEl"], descendants: true, isSignal: true }], exportAs: ["dsLineSeries"], ngImport: i0, template: "<svg:g\n class=\"lines\"\n [class.dims-others]=\"dimOthers()\"\n [class.is-outlined]=\"outline()\"\n (pointerover)=\"onMarkerOver($event)\"\n (pointerout)=\"onMarkerOut($event)\"\n (keydown)=\"onMarkerKey($event)\"\n (click)=\"onMarkerClick($event)\">\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.areaPaths; track $index) {\n <svg:path\n class=\"series-area\"\n [class.is-stacked]=\"stacked()\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.d]=\"path\"\n [attr.fill]=\"entry.color\"\n (animate.leave)=\"leaveMark($event)\" />\n }\n }\n\n @if (outline()) {\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.linePaths; track $index) {\n <svg:path\n class=\"series-halo\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.stroke-dasharray]=\"dashFor(entry.seriesIndex)\"\n [attr.d]=\"path\" />\n }\n }\n }\n\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.linePaths; track $index) {\n <svg:path\n class=\"series-line\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.stroke-dasharray]=\"dashFor(entry.seriesIndex)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.d]=\"path\"\n [attr.stroke]=\"entry.color\"\n (animate.leave)=\"leaveMark($event)\" />\n }\n }\n\n @if (showMarkers() || interactive()) {\n @for (entry of plotted(); track entry.series.id) {\n @for (marker of entry.markers; track marker.key) {\n <svg:circle\n #markerEl\n class=\"series-marker\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [class.ghost]=\"!showMarkers()\"\n [class.interactive]=\"interactive()\"\n [class.is-active]=\"isActiveMarker(marker)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.cx]=\"marker.x\"\n [attr.cy]=\"marker.y\"\n [attr.fill]=\"entry.color\"\n [attr.data-mark-index]=\"marker.markIndex\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive()\n ? isTabStop(entry.series.id, marker.markIndex)\n ? 0\n : -1\n : null\n \"\n [attr.aria-label]=\"interactive() ? markerLabel(marker) : null\" />\n }\n }\n }\n</svg:g>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.series-line{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.series-line.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-area{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.series-area.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-marker{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}@media not (forced-colors:active){.series-marker:focus{outline:none}}.lines{--_chart-line-width: var(--ds-chart-line-width);--_chart-line-width-bold: var(--ds-chart-line-width-bold);--_chart-dot-radius: var(--ds-chart-dot-radius);--_chart-dot-radius-active: var(--ds-chart-dot-radius-active);--_chart-area-opacity: var(--ds-chart-area-opacity)}.series-line{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),stroke var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.series-line.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),r var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-marker.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker.interactive{cursor:pointer}.series-area{fill-opacity:var(--_chart-area-opacity);stroke:none}.series-area.is-stacked{stroke:var(--surface-default);stroke-width:2;stroke-linejoin:round}.lines:has(.series-line.is-dimmed) .series-line:not(.is-dimmed){stroke-width:var(--_chart-line-width-bold)}.series-halo{fill:none;stroke:var(--surface-default);stroke-width:calc(var(--_chart-line-width) + var(--_chart-line-outline, 3px));stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.series-halo.is-dimmed{opacity:0}.series-line{fill:none;stroke-width:var(--_chart-line-width);stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.series-marker{r:var(--_chart-dot-radius)}.lines.is-outlined .series-marker{stroke:var(--surface-default);stroke-width:var(--_chart-line-outline, 3px);paint-order:stroke}.series-marker.ghost{fill-opacity:0}.series-marker.ghost:hover,.series-marker.ghost:focus-visible,.series-marker.ghost.is-active{fill-opacity:1}.series-marker.is-active{r:var(--_chart-dot-radius-active)}.series-marker.interactive{stroke:transparent;stroke-width:24px;vector-effect:non-scaling-stroke}@media(pointer:coarse){.series-marker.interactive{stroke-width:44px}}@media not (forced-colors:active){.series-marker.interactive:focus-visible{outline:none}}.series-marker.interactive:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color));r:var(--_chart-dot-radius-active)}@media(forced-colors:active){.series-line{stroke:CanvasText}.series-marker{fill:CanvasText}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1221
1530
|
}
|
|
1222
1531
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: LineSeriesComponent, decorators: [{
|
|
1223
1532
|
type: Component,
|
|
1224
|
-
args: [{ selector: 'g[dsLineSeries]', standalone: true, exportAs: 'dsLineSeries', encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g\n class=\"lines\"\n [class.dims-others]=\"dimOthers()\">\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.areaPaths; track $index) {\n <svg:path\n class=\"series-area\"\n
|
|
1225
|
-
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], showMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkers", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], highlighted: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlighted", required: false }] }], patterns: [{ type: i0.Input, args: [{ isSignal: true, alias: "patterns", required: false }] }], stacked: [{ type: i0.Input, args: [{ isSignal: true, alias: "stacked", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], gaps: [{ type: i0.Input, args: [{ isSignal: true, alias: "gaps", required: false }] }], curve: [{ type: i0.Input, args: [{ isSignal: true, alias: "curve", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipAnchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipAnchor", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], pointClicked: [{ type: i0.Output, args: ["pointClicked"] }], markerElements: [{ type: i0.ViewChildren, args: ['markerEl', { isSignal: true }] }] } });
|
|
1533
|
+
args: [{ selector: 'g[dsLineSeries]', standalone: true, exportAs: 'dsLineSeries', encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g\n class=\"lines\"\n [class.dims-others]=\"dimOthers()\"\n [class.is-outlined]=\"outline()\"\n (pointerover)=\"onMarkerOver($event)\"\n (pointerout)=\"onMarkerOut($event)\"\n (keydown)=\"onMarkerKey($event)\"\n (click)=\"onMarkerClick($event)\">\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.areaPaths; track $index) {\n <svg:path\n class=\"series-area\"\n [class.is-stacked]=\"stacked()\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.d]=\"path\"\n [attr.fill]=\"entry.color\"\n (animate.leave)=\"leaveMark($event)\" />\n }\n }\n\n @if (outline()) {\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.linePaths; track $index) {\n <svg:path\n class=\"series-halo\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.stroke-dasharray]=\"dashFor(entry.seriesIndex)\"\n [attr.d]=\"path\" />\n }\n }\n }\n\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.linePaths; track $index) {\n <svg:path\n class=\"series-line\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.stroke-dasharray]=\"dashFor(entry.seriesIndex)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.d]=\"path\"\n [attr.stroke]=\"entry.color\"\n (animate.leave)=\"leaveMark($event)\" />\n }\n }\n\n @if (showMarkers() || interactive()) {\n @for (entry of plotted(); track entry.series.id) {\n @for (marker of entry.markers; track marker.key) {\n <svg:circle\n #markerEl\n class=\"series-marker\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [class.ghost]=\"!showMarkers()\"\n [class.interactive]=\"interactive()\"\n [class.is-active]=\"isActiveMarker(marker)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.cx]=\"marker.x\"\n [attr.cy]=\"marker.y\"\n [attr.fill]=\"entry.color\"\n [attr.data-mark-index]=\"marker.markIndex\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive()\n ? isTabStop(entry.series.id, marker.markIndex)\n ? 0\n : -1\n : null\n \"\n [attr.aria-label]=\"interactive() ? markerLabel(marker) : null\" />\n }\n }\n }\n</svg:g>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.series-line{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.series-line.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-area{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.series-area.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-marker{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}@media not (forced-colors:active){.series-marker:focus{outline:none}}.lines{--_chart-line-width: var(--ds-chart-line-width);--_chart-line-width-bold: var(--ds-chart-line-width-bold);--_chart-dot-radius: var(--ds-chart-dot-radius);--_chart-dot-radius-active: var(--ds-chart-dot-radius-active);--_chart-area-opacity: var(--ds-chart-area-opacity)}.series-line{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),stroke var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.series-line.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),r var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-marker.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker.interactive{cursor:pointer}.series-area{fill-opacity:var(--_chart-area-opacity);stroke:none}.series-area.is-stacked{stroke:var(--surface-default);stroke-width:2;stroke-linejoin:round}.lines:has(.series-line.is-dimmed) .series-line:not(.is-dimmed){stroke-width:var(--_chart-line-width-bold)}.series-halo{fill:none;stroke:var(--surface-default);stroke-width:calc(var(--_chart-line-width) + var(--_chart-line-outline, 3px));stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.series-halo.is-dimmed{opacity:0}.series-line{fill:none;stroke-width:var(--_chart-line-width);stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.series-marker{r:var(--_chart-dot-radius)}.lines.is-outlined .series-marker{stroke:var(--surface-default);stroke-width:var(--_chart-line-outline, 3px);paint-order:stroke}.series-marker.ghost{fill-opacity:0}.series-marker.ghost:hover,.series-marker.ghost:focus-visible,.series-marker.ghost.is-active{fill-opacity:1}.series-marker.is-active{r:var(--_chart-dot-radius-active)}.series-marker.interactive{stroke:transparent;stroke-width:24px;vector-effect:non-scaling-stroke}@media(pointer:coarse){.series-marker.interactive{stroke-width:44px}}@media not (forced-colors:active){.series-marker.interactive:focus-visible{outline:none}}.series-marker.interactive:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color));r:var(--_chart-dot-radius-active)}@media(forced-colors:active){.series-line{stroke:CanvasText}.series-marker{fill:CanvasText}}\n"] }]
|
|
1534
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], showMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkers", required: false }] }], outline: [{ type: i0.Input, args: [{ isSignal: true, alias: "outline", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], highlighted: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlighted", required: false }] }], patterns: [{ type: i0.Input, args: [{ isSignal: true, alias: "patterns", required: false }] }], stacked: [{ type: i0.Input, args: [{ isSignal: true, alias: "stacked", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], gaps: [{ type: i0.Input, args: [{ isSignal: true, alias: "gaps", required: false }] }], curve: [{ type: i0.Input, args: [{ isSignal: true, alias: "curve", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipAnchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipAnchor", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], pointClicked: [{ type: i0.Output, args: ["pointClicked"] }], markerElements: [{ type: i0.ViewChildren, args: ['markerEl', { isSignal: true }] }] } });
|
|
1226
1535
|
|
|
1227
1536
|
/**
|
|
1228
1537
|
* The names of a chart's reference lines, laid out by the same geometry that draws them.
|
|
@@ -1239,11 +1548,11 @@ class ReferenceLabelComponent {
|
|
|
1239
1548
|
thresholds = input([], ...(ngDevMode ? [{ debugName: "thresholds" }] : /* istanbul ignore next */ []));
|
|
1240
1549
|
lines = computed(() => thresholdMarks(this.thresholds(), this.scales.plot(), this.scales.yPosition()).filter((mark) => mark.label !== ''), ...(ngDevMode ? [{ debugName: "lines" }] : /* istanbul ignore next */ []));
|
|
1241
1550
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ReferenceLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1242
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ReferenceLabelComponent, isStandalone: true, selector: "g[dsReferenceLabel]", inputs: { thresholds: { classPropertyName: "thresholds", publicName: "thresholds", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<svg:g class=\"reference-labels\">\n
|
|
1551
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ReferenceLabelComponent, isStandalone: true, selector: "g[dsReferenceLabel]", inputs: { thresholds: { classPropertyName: "thresholds", publicName: "thresholds", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (lines().length) {\n <svg:g class=\"reference-labels\">\n @for (line of lines(); track line.key) {\n <svg:text\n class=\"threshold-label\"\n text-anchor=\"start\"\n [style.--_chart-threshold-color]=\"line.color\"\n [attr.x]=\"line.labelX\"\n [attr.y]=\"line.labelY\">\n {{ line.label }}\n </svg:text>\n }\n </svg:g>\n}\n", styles: [".threshold-label{--_chart-threshold-color: var(--ds-chart-threshold-color, var(--chart-threshold-color));fill:var(--_chart-threshold-color);font-size:var(--ds-chart-axis-font-size);font-weight:600;paint-order:stroke;stroke:var(--ds-chart-frame-bg-color);stroke-width:3;stroke-linejoin:round}@media(forced-colors:active){.threshold-label{fill:CanvasText;stroke:Canvas}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1243
1552
|
}
|
|
1244
1553
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ReferenceLabelComponent, decorators: [{
|
|
1245
1554
|
type: Component,
|
|
1246
|
-
args: [{ selector: 'g[dsReferenceLabel]', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g class=\"reference-labels\">\n
|
|
1555
|
+
args: [{ selector: 'g[dsReferenceLabel]', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (lines().length) {\n <svg:g class=\"reference-labels\">\n @for (line of lines(); track line.key) {\n <svg:text\n class=\"threshold-label\"\n text-anchor=\"start\"\n [style.--_chart-threshold-color]=\"line.color\"\n [attr.x]=\"line.labelX\"\n [attr.y]=\"line.labelY\">\n {{ line.label }}\n </svg:text>\n }\n </svg:g>\n}\n", styles: [".threshold-label{--_chart-threshold-color: var(--ds-chart-threshold-color, var(--chart-threshold-color));fill:var(--_chart-threshold-color);font-size:var(--ds-chart-axis-font-size);font-weight:600;paint-order:stroke;stroke:var(--ds-chart-frame-bg-color);stroke-width:3;stroke-linejoin:round}@media(forced-colors:active){.threshold-label{fill:CanvasText;stroke:Canvas}}\n"] }]
|
|
1247
1556
|
}], propDecorators: { thresholds: [{ type: i0.Input, args: [{ isSignal: true, alias: "thresholds", required: false }] }] } });
|
|
1248
1557
|
|
|
1249
1558
|
let nextReferenceId = 0;
|
|
@@ -1276,11 +1585,11 @@ class ReferenceLineComponent {
|
|
|
1276
1585
|
}
|
|
1277
1586
|
lines = computed(() => thresholdMarks(this.thresholds(), this.scales.plot(), this.scales.yPosition()), ...(ngDevMode ? [{ debugName: "lines" }] : /* istanbul ignore next */ []));
|
|
1278
1587
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ReferenceLineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1279
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ReferenceLineComponent, isStandalone: true, selector: "g[dsReferenceLine]", inputs: { thresholds: { classPropertyName: "thresholds", publicName: "thresholds", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<svg:g\n
|
|
1588
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ReferenceLineComponent, isStandalone: true, selector: "g[dsReferenceLine]", inputs: { thresholds: { classPropertyName: "thresholds", publicName: "thresholds", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (lines().length) {\n <svg:g\n class=\"references\"\n aria-hidden=\"true\">\n @for (line of lines(); track line.key) {\n <svg:g\n class=\"reference\"\n [style.--_chart-threshold-color]=\"line.color\">\n @if (line.band) {\n <svg:rect\n class=\"threshold-band\"\n [attr.x]=\"line.left\"\n [attr.y]=\"line.top\"\n [attr.width]=\"line.width\"\n [attr.height]=\"line.height\" />\n } @else {\n <svg:line\n class=\"threshold-line\"\n [class.is-dashed]=\"line.dash === 'dashed'\"\n [class.is-dotted]=\"line.dash === 'dotted'\"\n [attr.x1]=\"line.left\"\n [attr.x2]=\"line.right\"\n [attr.y1]=\"line.y\"\n [attr.y2]=\"line.y\" />\n }\n </svg:g>\n }\n </svg:g>\n}\n", styles: [".references{--_chart-threshold-color: var(--ds-chart-threshold-color, var(--chart-threshold-color));--_chart-threshold-band-opacity: var(--ds-chart-threshold-band-opacity, var(--chart-threshold-band-opacity));--_chart-threshold-dashed-pattern: var(--ds-chart-threshold-dashed-pattern, var(--chart-threshold-dashed-pattern));--_chart-threshold-dotted-pattern: var(--ds-chart-threshold-dotted-pattern, var(--chart-threshold-dotted-pattern));pointer-events:none}.threshold-line{stroke:var(--_chart-threshold-color);stroke-width:var(--ds-chart-line-width)}.threshold-line.is-dashed{stroke-dasharray:var(--_chart-threshold-dashed-pattern)}.threshold-line.is-dotted{stroke-dasharray:var(--_chart-threshold-dotted-pattern);stroke-linecap:round}.threshold-band{fill:var(--_chart-threshold-color);fill-opacity:var(--_chart-threshold-band-opacity)}@media(forced-colors:active){.threshold-line{stroke:CanvasText}.threshold-band{fill:CanvasText}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1280
1589
|
}
|
|
1281
1590
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ReferenceLineComponent, decorators: [{
|
|
1282
1591
|
type: Component,
|
|
1283
|
-
args: [{ selector: 'g[dsReferenceLine]', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g\n
|
|
1592
|
+
args: [{ selector: 'g[dsReferenceLine]', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (lines().length) {\n <svg:g\n class=\"references\"\n aria-hidden=\"true\">\n @for (line of lines(); track line.key) {\n <svg:g\n class=\"reference\"\n [style.--_chart-threshold-color]=\"line.color\">\n @if (line.band) {\n <svg:rect\n class=\"threshold-band\"\n [attr.x]=\"line.left\"\n [attr.y]=\"line.top\"\n [attr.width]=\"line.width\"\n [attr.height]=\"line.height\" />\n } @else {\n <svg:line\n class=\"threshold-line\"\n [class.is-dashed]=\"line.dash === 'dashed'\"\n [class.is-dotted]=\"line.dash === 'dotted'\"\n [attr.x1]=\"line.left\"\n [attr.x2]=\"line.right\"\n [attr.y1]=\"line.y\"\n [attr.y2]=\"line.y\" />\n }\n </svg:g>\n }\n </svg:g>\n}\n", styles: [".references{--_chart-threshold-color: var(--ds-chart-threshold-color, var(--chart-threshold-color));--_chart-threshold-band-opacity: var(--ds-chart-threshold-band-opacity, var(--chart-threshold-band-opacity));--_chart-threshold-dashed-pattern: var(--ds-chart-threshold-dashed-pattern, var(--chart-threshold-dashed-pattern));--_chart-threshold-dotted-pattern: var(--ds-chart-threshold-dotted-pattern, var(--chart-threshold-dotted-pattern));pointer-events:none}.threshold-line{stroke:var(--_chart-threshold-color);stroke-width:var(--ds-chart-line-width)}.threshold-line.is-dashed{stroke-dasharray:var(--_chart-threshold-dashed-pattern)}.threshold-line.is-dotted{stroke-dasharray:var(--_chart-threshold-dotted-pattern);stroke-linecap:round}.threshold-band{fill:var(--_chart-threshold-color);fill-opacity:var(--_chart-threshold-band-opacity)}@media(forced-colors:active){.threshold-line{stroke:CanvasText}.threshold-band{fill:CanvasText}}\n"] }]
|
|
1284
1593
|
}], ctorParameters: () => [], propDecorators: { thresholds: [{ type: i0.Input, args: [{ isSignal: true, alias: "thresholds", required: false }] }] } });
|
|
1285
1594
|
|
|
1286
1595
|
/**
|
|
@@ -1307,11 +1616,11 @@ class SeriesAnnotationComponent {
|
|
|
1307
1616
|
})), plot.left + plot.width);
|
|
1308
1617
|
}, ...(ngDevMode ? [{ debugName: "placed" }] : /* istanbul ignore next */ []));
|
|
1309
1618
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SeriesAnnotationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1310
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: SeriesAnnotationComponent, isStandalone: true, selector: "g[dsSeriesAnnotation]", inputs: { annotations: { classPropertyName: "annotations", publicName: "annotations", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<svg:g class=\"annotations\">\n
|
|
1619
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: SeriesAnnotationComponent, isStandalone: true, selector: "g[dsSeriesAnnotation]", inputs: { annotations: { classPropertyName: "annotations", publicName: "annotations", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (placed().length) {\n <svg:g class=\"annotations\">\n @for (note of placed(); track note.key) {\n <svg:text\n class=\"annotation\"\n [attr.x]=\"note.x\"\n [attr.y]=\"note.y\"\n [attr.text-anchor]=\"note.anchor\">\n {{ note.label }}\n </svg:text>\n }\n </svg:g>\n}\n", styles: [".annotations{--_chart-annotation-color: var(--ds-chart-annotation-color, var(--text-primary));--_chart-annotation-font-size: var(--ds-chart-annotation-font-size, var(--ds-chart-axis-font-size));--_chart-annotation-font-weight: var(--ds-chart-annotation-font-weight, var(--font-weight-bold));--_chart-annotation-halo-color: var(--ds-chart-annotation-halo-color, var(--surface-default));--_chart-annotation-halo-width: var(--ds-chart-annotation-halo-width, 3px)}.annotation{fill:var(--_chart-annotation-color);font-size:var(--_chart-annotation-font-size);font-weight:var(--_chart-annotation-font-weight);paint-order:stroke;stroke:var(--_chart-annotation-halo-color);stroke-width:var(--_chart-annotation-halo-width);stroke-linejoin:round}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1311
1620
|
}
|
|
1312
1621
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SeriesAnnotationComponent, decorators: [{
|
|
1313
1622
|
type: Component,
|
|
1314
|
-
args: [{ selector: 'g[dsSeriesAnnotation]', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g class=\"annotations\">\n
|
|
1623
|
+
args: [{ selector: 'g[dsSeriesAnnotation]', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (placed().length) {\n <svg:g class=\"annotations\">\n @for (note of placed(); track note.key) {\n <svg:text\n class=\"annotation\"\n [attr.x]=\"note.x\"\n [attr.y]=\"note.y\"\n [attr.text-anchor]=\"note.anchor\">\n {{ note.label }}\n </svg:text>\n }\n </svg:g>\n}\n", styles: [".annotations{--_chart-annotation-color: var(--ds-chart-annotation-color, var(--text-primary));--_chart-annotation-font-size: var(--ds-chart-annotation-font-size, var(--ds-chart-axis-font-size));--_chart-annotation-font-weight: var(--ds-chart-annotation-font-weight, var(--font-weight-bold));--_chart-annotation-halo-color: var(--ds-chart-annotation-halo-color, var(--surface-default));--_chart-annotation-halo-width: var(--ds-chart-annotation-halo-width, 3px)}.annotation{fill:var(--_chart-annotation-color);font-size:var(--_chart-annotation-font-size);font-weight:var(--_chart-annotation-font-weight);paint-order:stroke;stroke:var(--_chart-annotation-halo-color);stroke-width:var(--_chart-annotation-halo-width);stroke-linejoin:round}\n"] }]
|
|
1315
1624
|
}], propDecorators: { annotations: [{ type: i0.Input, args: [{ isSignal: true, alias: "annotations", required: false }] }] } });
|
|
1316
1625
|
|
|
1317
1626
|
/**
|