@ids-group-ltd/ids-design-system 0.13.3 → 0.13.4
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 +846 -14
- package/components.md +552 -29
- package/design-system.md +9 -0
- package/docs/agent/INDEX.md +57 -15
- package/docs/agent/charts/chart-colour-which-palette-a-chart-takes.md +1 -1
- package/docs/agent/charts/column-series-component.md +8 -0
- package/docs/agent/charts/ds-bar-chart.md +6 -1
- package/docs/agent/charts/ds-chart-data-table.md +10 -0
- package/docs/agent/charts/ds-chart.md +8 -0
- package/docs/agent/charts/ds-column-chart.md +5 -1
- package/docs/agent/charts/ds-funnel-chart.md +5 -1
- package/docs/agent/charts/ds-heatmap-chart.md +20 -0
- package/docs/agent/charts/ds-line-chart.md +8 -4
- package/docs/agent/charts/{ds-donut-chart.md → ds-pie-chart.md} +10 -6
- package/docs/agent/charts/ds-scatter-chart.md +20 -0
- package/docs/agent/charts/ds-waterfall-chart.md +20 -0
- package/docs/agent/charts/line-series-component.md +8 -0
- package/docs/agent/charts/reference-label-component.md +8 -0
- package/docs/agent/charts/reference-line-component.md +8 -0
- package/docs/agent/charts/series-annotation-component.md +10 -0
- package/docs/agent/feedback/ds-alert.md +4 -0
- package/docs/agent/feedback/ds-avatar-group.md +4 -0
- package/docs/agent/feedback/ds-avatar.md +4 -0
- package/docs/agent/feedback/ds-badge.md +4 -0
- package/docs/agent/feedback/ds-banner.md +5 -1
- package/docs/agent/feedback/ds-bar.md +4 -0
- package/docs/agent/feedback/ds-description-item.md +8 -0
- package/docs/agent/feedback/ds-description-list.md +8 -0
- package/docs/agent/feedback/ds-empty-state.md +4 -0
- package/docs/agent/feedback/ds-list-item.md +8 -0
- package/docs/agent/feedback/ds-list.md +8 -0
- package/docs/agent/feedback/ds-loading-overlay.md +8 -0
- package/docs/agent/feedback/ds-skeleton.md +4 -0
- package/docs/agent/feedback/ds-spinner.md +4 -0
- package/docs/agent/feedback/ds-stat.md +4 -0
- package/docs/agent/feedback/ds-status-dot.md +4 -0
- package/docs/agent/feedback/ds-tag.md +4 -0
- package/docs/agent/feedback/ds-timeline-item.md +8 -0
- package/docs/agent/feedback/ds-toast-region.md +8 -0
- package/docs/agent/feedback/ds-toast.md +4 -0
- package/docs/agent/feedback/ds-tree.md +8 -0
- package/docs/agent/forms/ds-autocomplete.md +4 -0
- package/docs/agent/forms/ds-button-group.md +8 -0
- package/docs/agent/forms/ds-button.md +6 -2
- package/docs/agent/forms/ds-checkbox.md +4 -0
- package/docs/agent/forms/ds-color-picker.md +8 -0
- package/docs/agent/forms/ds-date-picker.md +5 -1
- package/docs/agent/forms/ds-dropzone.md +4 -0
- package/docs/agent/forms/ds-field-group.md +8 -0
- package/docs/agent/forms/ds-filter-bar.md +8 -0
- package/docs/agent/forms/ds-icon-button.md +4 -0
- package/docs/agent/forms/ds-input.md +13 -1
- package/docs/agent/forms/ds-multi-select.md +4 -0
- package/docs/agent/forms/ds-number-stepper.md +4 -0
- package/docs/agent/forms/ds-otp-input.md +8 -0
- package/docs/agent/forms/ds-password-rules.md +8 -0
- package/docs/agent/forms/ds-radio-group.md +8 -0
- package/docs/agent/forms/ds-radio.md +4 -0
- package/docs/agent/forms/ds-search.md +4 -0
- package/docs/agent/forms/ds-segmented.md +8 -0
- package/docs/agent/forms/ds-select.md +4 -0
- package/docs/agent/forms/ds-slider.md +8 -0
- package/docs/agent/forms/ds-split-button.md +8 -0
- package/docs/agent/forms/ds-switch.md +4 -0
- package/docs/agent/forms/ds-textarea.md +5 -1
- package/docs/agent/forms/ds-time-picker.md +8 -0
- package/docs/agent/forms/ds-toggle-button.md +8 -0
- package/docs/agent/forms/filter-item-directive.md +8 -0
- package/docs/agent/forms/the-picker-family-ds-select-ds-multi-select-ds-autocomplete.md +4 -0
- package/docs/agent/navigation/ds-app-layout.md +6 -2
- package/docs/agent/navigation/ds-auth-layout.md +5 -1
- package/docs/agent/navigation/ds-breadcrumbs.md +4 -0
- package/docs/agent/navigation/ds-container.md +8 -0
- package/docs/agent/navigation/ds-divider.md +4 -0
- package/docs/agent/navigation/ds-inline.md +8 -0
- package/docs/agent/navigation/ds-page-footer.md +4 -0
- package/docs/agent/navigation/ds-page-header.md +5 -1
- package/docs/agent/navigation/ds-pagination.md +5 -1
- package/docs/agent/navigation/ds-sidenav-footer.md +8 -0
- package/docs/agent/navigation/ds-sidenav-group.md +4 -0
- package/docs/agent/navigation/ds-sidenav-item.md +4 -0
- package/docs/agent/navigation/ds-sidenav.md +4 -0
- package/docs/agent/navigation/ds-stack.md +8 -0
- package/docs/agent/navigation/ds-stepper.md +4 -0
- package/docs/agent/navigation/ds-tab.md +8 -0
- package/docs/agent/navigation/ds-tabs.md +5 -1
- package/docs/agent/overlays/ds-bottom-sheet.md +4 -0
- package/docs/agent/overlays/ds-drawer.md +4 -0
- package/docs/agent/overlays/ds-menu.md +4 -0
- package/docs/agent/overlays/ds-modal-card.md +4 -0
- package/docs/agent/overlays/ds-modal.md +4 -0
- package/docs/agent/overlays/ds-popover.md +4 -0
- package/docs/agent/overlays/ds-tooltip-panel.md +8 -0
- package/docs/agent/overlays/ds-tooltip.md +4 -0
- package/docs/agent/surfaces/ds-accordion-item.md +8 -0
- package/docs/agent/surfaces/ds-accordion.md +4 -0
- package/docs/agent/surfaces/ds-card.md +6 -2
- package/docs/agent/tables/ds-cell-template.md +8 -0
- package/docs/agent/tables/ds-table-columns.md +8 -0
- package/docs/agent/tables/ds-table-export.md +8 -0
- package/docs/agent/tables/ds-table.md +9 -2
- package/docs/agent/tables/header-filter-directive.md +8 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +4 -4
- 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 +10 -8
- 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 +19 -19
- 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 +2 -2
- 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 +7 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +2 -2
- 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 +9 -6
- 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 +117 -27
- 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 +3 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +7 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs +32 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +2 -2
- 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 +14 -2
- 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 +404 -55
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +8 -6
- 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 +27 -10
- 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 +5 -3
- 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 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +23 -16
- 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-field-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +1 -1
- 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 +20 -10
- 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 +217 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +181 -500
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +6 -6
- 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 +7 -5
- 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 +2 -2
- 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 +2 -2
- 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 +14 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +391 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +5 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +300 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +9 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +7 -5
- 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 +2 -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 +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +4 -4
- 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 +4 -1
- 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 +9 -9
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +5 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +34 -21
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +252 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +271 -8
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +7 -3
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.10.0.json +2 -2
- package/migrations/0.10.1.json +3 -3
- package/migrations/0.10.2.json +8 -28
- package/migrations/0.11.0.json +3 -3
- package/migrations/0.11.1.json +15 -15
- package/migrations/0.11.2.json +9 -9
- package/migrations/0.11.3.json +1 -1
- package/migrations/0.11.4.json +8 -8
- package/migrations/0.12.1.json +1 -1
- package/migrations/0.12.2.json +1 -1
- package/migrations/0.12.3.json +3 -3
- package/migrations/0.13.0.json +24 -32
- package/migrations/0.13.1.json +5 -5
- package/migrations/0.13.4.json +994 -0
- package/migrations/0.5.0.json +1 -1
- package/migrations/0.8.0.json +4 -3
- package/migrations/0.9.0.json +1 -1
- package/package.json +41 -9
- package/styles/_chart-frame.scss +16 -3
- package/styles/_check-box.scss +12 -12
- package/styles/_dropdown-overlay.scss +14 -10
- package/styles/_field-box.scss +3 -3
- package/styles/_field-label.scss +7 -7
- package/styles/_overlay-motion.scss +1 -1
- package/styles/_table-controls.scss +3 -3
- package/styles/_tokens-charts.scss +40 -7
- package/styles/_tokens.scss +2 -2
- package/styles/_typography.scss +101 -101
- package/themes/dark/_theme.scss +13 -0
- package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +3 -3
- package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +5 -4
- package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +17 -17
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +4 -2
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +37 -4
- package/types/ids-group-ltd-ids-design-system-components-bottom-sheet.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +8 -4
- package/types/ids-group-ltd-ids-design-system-components-chart-data-table.d.ts +31 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +4 -0
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +230 -44
- package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +6 -2
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +9 -7
- package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +4 -4
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +5 -2
- package/types/ids-group-ltd-ids-design-system-components-heatmap-chart.d.ts +124 -0
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +85 -139
- package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +13 -1
- package/types/{ids-group-ltd-ids-design-system-components-donut-chart.d.ts → ids-group-ltd-ids-design-system-components-pie-chart.d.ts} +24 -19
- package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +183 -0
- package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +5 -1
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-table-export.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +11 -11
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +5 -2
- package/types/ids-group-ltd-ids-design-system-components-waterfall-chart.d.ts +116 -0
- package/types/ids-group-ltd-ids-design-system-components.d.ts +97 -4
- package/types/ids-group-ltd-ids-design-system-core.d.ts +30 -7
- package/types/ids-group-ltd-ids-design-system.d.ts +14 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +0 -382
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +0 -1
|
@@ -1,34 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, output,
|
|
3
|
-
import {
|
|
2
|
+
import { input, booleanAttribute, output, numberAttribute, computed, model, signal, contentChild, viewChild, inject, ElementRef, afterNextRender, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { resolveChartDefaults, CHART_SERIES_COLORS, formatPercent, describeSeries } from '@ids-group-ltd/ids-design-system/components';
|
|
4
4
|
import { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';
|
|
5
|
-
import {
|
|
5
|
+
import { stackOffsets, ChartComponent, chartViewHeight, CHART_DEFAULT_VALUE_SPACE, LineSeriesComponent, SeriesAnnotationComponent } from '@ids-group-ltd/ids-design-system/components/chart';
|
|
6
6
|
import { ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
|
|
7
7
|
import { ChartLegendComponent } from '@ids-group-ltd/ids-design-system/components/chart-legend';
|
|
8
|
+
import { ChartDataTableComponent } from '@ids-group-ltd/ids-design-system/components/chart-data-table';
|
|
8
9
|
|
|
9
|
-
const LINE_CHART_VIEW_WIDTH = 640;
|
|
10
|
-
const LINE_CHART_VIEW_HEIGHT = 320;
|
|
11
10
|
const LINE_CHART_DEFAULT_TICK_COUNT = 5;
|
|
12
|
-
const LINE_CHART_AXIS_LABEL_GAP = 8;
|
|
13
|
-
const AXIS_GUTTER = 46;
|
|
14
|
-
const BARE_EDGE_GUTTER = 12;
|
|
15
|
-
const PLOT_TOP = 14;
|
|
16
|
-
const CATEGORY_GUTTER = 30;
|
|
17
|
-
const CATEGORY_LABEL_OFFSET = 18;
|
|
18
|
-
const STACKED_PLOT_GAP = 34;
|
|
19
|
-
const MAX_CATEGORY_LABELS = 12;
|
|
20
|
-
const TICK_DECIMALS = 6;
|
|
21
|
-
function roundTo(value, decimals) {
|
|
22
|
-
if (!Number.isFinite(value)) {
|
|
23
|
-
return 0;
|
|
24
|
-
}
|
|
25
|
-
return Number(value.toFixed(decimals));
|
|
26
|
-
}
|
|
27
|
-
function normalizeTickCount(tickCount) {
|
|
28
|
-
return Number.isFinite(tickCount) && tickCount >= 1
|
|
29
|
-
? Math.floor(tickCount)
|
|
30
|
-
: LINE_CHART_DEFAULT_TICK_COUNT;
|
|
31
|
-
}
|
|
32
11
|
/** One reading per category, however long the series actually was. A series longer
|
|
33
12
|
* than `categories` loses its tail and a shorter one ends early: a line that stops
|
|
34
13
|
* short is a defect the reader can see, while a thrown error takes down the page
|
|
@@ -46,9 +25,9 @@ function alignSeriesValues(data, categoryCount, gaps) {
|
|
|
46
25
|
}
|
|
47
26
|
return aligned;
|
|
48
27
|
}
|
|
49
|
-
/** Largest finite reading across the given series, or zero. Never negative:
|
|
50
|
-
*
|
|
51
|
-
*
|
|
28
|
+
/** Largest finite reading across the given series, or zero. Never negative: this
|
|
29
|
+
* feeds the ceiling handed to `ds-chart`, which raises its domain and never lowers
|
|
30
|
+
* it, so a negative here would pin an axis below its own data. */
|
|
52
31
|
function domainMaxOf(valueGroups) {
|
|
53
32
|
let max = 0;
|
|
54
33
|
for (const values of valueGroups) {
|
|
@@ -60,123 +39,6 @@ function domainMaxOf(valueGroups) {
|
|
|
60
39
|
}
|
|
61
40
|
return max;
|
|
62
41
|
}
|
|
63
|
-
function nicedAxis(domainMax, tickCount) {
|
|
64
|
-
return {
|
|
65
|
-
max: niceDomain(0, domainMax, tickCount).max,
|
|
66
|
-
ticks: tickValues(0, domainMax, tickCount),
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
/** Both y axes, as the four modes define them. `'rounded'` and `'exact'` share the
|
|
70
|
-
* primary's gridlines and differ only in the step they divide the secondary domain
|
|
71
|
-
* by: `'rounded'` snaps the step up to a round number and overshoots the data,
|
|
72
|
-
* `'exact'` takes the domain itself and lands on it. `'independent'` and
|
|
73
|
-
* `'stacked'` nice each axis on its own — stacked plots sit one above the other,
|
|
74
|
-
* so there is nothing to align. */
|
|
75
|
-
function axisLayout(primaryDomainMax, secondaryDomainMax, mode, tickCount) {
|
|
76
|
-
const count = normalizeTickCount(tickCount);
|
|
77
|
-
const primary = nicedAxis(primaryDomainMax, count);
|
|
78
|
-
if (secondaryDomainMax === null) {
|
|
79
|
-
return { primary, secondary: null, alignedTicks: true };
|
|
80
|
-
}
|
|
81
|
-
const intervals = primary.ticks.length - 1;
|
|
82
|
-
const canAlign = (mode === 'rounded' || mode === 'exact') &&
|
|
83
|
-
intervals >= 1 &&
|
|
84
|
-
Number.isFinite(secondaryDomainMax) &&
|
|
85
|
-
secondaryDomainMax > 0;
|
|
86
|
-
if (!canAlign) {
|
|
87
|
-
return {
|
|
88
|
-
primary,
|
|
89
|
-
secondary: nicedAxis(secondaryDomainMax, count),
|
|
90
|
-
alignedTicks: false,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
const step = mode === 'rounded'
|
|
94
|
-
? roundStepAtLeast(secondaryDomainMax / intervals)
|
|
95
|
-
: secondaryDomainMax / intervals;
|
|
96
|
-
if (step <= 0) {
|
|
97
|
-
return { primary, secondary: { max: 0, ticks: [0] }, alignedTicks: true };
|
|
98
|
-
}
|
|
99
|
-
const ticks = [];
|
|
100
|
-
for (let index = 0; index <= intervals; index++) {
|
|
101
|
-
ticks.push(roundTo(step * index, TICK_DECIMALS));
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
primary,
|
|
105
|
-
secondary: { max: roundTo(step * intervals, TICK_DECIMALS), ticks },
|
|
106
|
-
alignedTicks: true,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
function chartLayout(mode, hasSecondaryAxis) {
|
|
110
|
-
const stacked = mode === 'stacked' && hasSecondaryAxis;
|
|
111
|
-
const left = AXIS_GUTTER;
|
|
112
|
-
const right = hasSecondaryAxis && !stacked ? AXIS_GUTTER : BARE_EDGE_GUTTER;
|
|
113
|
-
const width = LINE_CHART_VIEW_WIDTH - left - right;
|
|
114
|
-
const plotBottom = LINE_CHART_VIEW_HEIGHT - CATEGORY_GUTTER;
|
|
115
|
-
const categoryLabelY = plotBottom + CATEGORY_LABEL_OFFSET;
|
|
116
|
-
if (!stacked) {
|
|
117
|
-
const plot = {
|
|
118
|
-
left,
|
|
119
|
-
top: PLOT_TOP,
|
|
120
|
-
width,
|
|
121
|
-
height: plotBottom - PLOT_TOP,
|
|
122
|
-
};
|
|
123
|
-
return {
|
|
124
|
-
primaryPlot: plot,
|
|
125
|
-
secondaryPlot: plot,
|
|
126
|
-
categoryLabelY,
|
|
127
|
-
stacked: false,
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
const height = (plotBottom - PLOT_TOP - STACKED_PLOT_GAP) / 2;
|
|
131
|
-
return {
|
|
132
|
-
primaryPlot: { left, top: PLOT_TOP, width, height },
|
|
133
|
-
secondaryPlot: {
|
|
134
|
-
left,
|
|
135
|
-
top: PLOT_TOP + height + STACKED_PLOT_GAP,
|
|
136
|
-
width,
|
|
137
|
-
height,
|
|
138
|
-
},
|
|
139
|
-
categoryLabelY,
|
|
140
|
-
stacked: true,
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
function categoryCenters(count, plot) {
|
|
144
|
-
const total = Number.isFinite(count) && count > 0 ? Math.floor(count) : 0;
|
|
145
|
-
const scale = pointScale(total, plot.width);
|
|
146
|
-
const centers = [];
|
|
147
|
-
for (let index = 0; index < total; index++) {
|
|
148
|
-
centers.push(plot.left + scale.position(index));
|
|
149
|
-
}
|
|
150
|
-
return centers;
|
|
151
|
-
}
|
|
152
|
-
/** The y a reading sits at, always inside the plot. The clamp is what keeps a
|
|
153
|
-
* negative reading — which no zero-based axis can place — off the category labels
|
|
154
|
-
* below, and the finite test is what stops an unplottable one becoming `NaN`. */
|
|
155
|
-
function valueY(value, axisMax, plot) {
|
|
156
|
-
const baseline = plot.top + plot.height;
|
|
157
|
-
const y = baseline - linearScale(0, axisMax, plot.height)(value);
|
|
158
|
-
if (!Number.isFinite(y)) {
|
|
159
|
-
return baseline;
|
|
160
|
-
}
|
|
161
|
-
return Math.min(Math.max(y, plot.top), baseline);
|
|
162
|
-
}
|
|
163
|
-
function seriesPoints(values, axisMax, plot, centers) {
|
|
164
|
-
return values.map((value, index) => {
|
|
165
|
-
const x = centers[index];
|
|
166
|
-
if (value === null || !Number.isFinite(value) || !Number.isFinite(x)) {
|
|
167
|
-
return null;
|
|
168
|
-
}
|
|
169
|
-
return { categoryIndex: index, x, y: valueY(value, axisMax, plot), value };
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
/** Show every nth category label. Every label at 60 categories is a grey smear, and
|
|
173
|
-
* the axis stops saying anything at all. */
|
|
174
|
-
function categoryLabelStride(count, maxLabels = MAX_CATEGORY_LABELS) {
|
|
175
|
-
if (!Number.isFinite(count) || count <= 0 || maxLabels < 1) {
|
|
176
|
-
return 1;
|
|
177
|
-
}
|
|
178
|
-
return Math.max(1, Math.ceil(count / maxLabels));
|
|
179
|
-
}
|
|
180
42
|
function paletteIndexFor(slot, index, paletteSize) {
|
|
181
43
|
if (!Number.isFinite(paletteSize) || paletteSize < 1) {
|
|
182
44
|
return 0;
|
|
@@ -187,11 +49,8 @@ function paletteIndexFor(slot, index, paletteSize) {
|
|
|
187
49
|
return ((chosen % paletteSize) + paletteSize) % paletteSize;
|
|
188
50
|
}
|
|
189
51
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
// anchors to its own edge instead of centring. Both in the 640x320 viewBox.
|
|
193
|
-
const ANNOTATION_GAP = 12;
|
|
194
|
-
const ANNOTATION_EDGE_GUARD = 48;
|
|
52
|
+
/** Matches `--ds-line-chart-plot-height`, for the frame before the first style read and for SSR. */
|
|
53
|
+
const DEFAULT_PLOT_HEIGHT = 240;
|
|
195
54
|
// One dash per palette slot, in the same order the colours are. Slot 1 stays solid so a
|
|
196
55
|
// single-series chart is unchanged by turning patterns on.
|
|
197
56
|
const SERIES_DASH_ARRAYS = [
|
|
@@ -204,9 +63,6 @@ const SERIES_DASH_ARRAYS = [
|
|
|
204
63
|
'4 2',
|
|
205
64
|
'14 5',
|
|
206
65
|
];
|
|
207
|
-
function baselineOf(plot) {
|
|
208
|
-
return plot.top + plot.height;
|
|
209
|
-
}
|
|
210
66
|
class LineChartComponent {
|
|
211
67
|
/** X labels. Every series' `data` is read against this length. */
|
|
212
68
|
categories = input.required(...(ngDevMode ? [{ debugName: "categories" }] : /* istanbul ignore next */ []));
|
|
@@ -214,7 +70,7 @@ class LineChartComponent {
|
|
|
214
70
|
* loses its tail and a shorter one ends early. */
|
|
215
71
|
series = input.required(...(ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []));
|
|
216
72
|
/** How a secondary axis relates to the primary one. */
|
|
217
|
-
yAxisMode = input('
|
|
73
|
+
yAxisMode = input('aligned', ...(ngDevMode ? [{ debugName: "yAxisMode" }] : /* istanbul ignore next */ []));
|
|
218
74
|
/** Draws a dot at every reading. Off, the dots appear on hover and on focus only. */
|
|
219
75
|
showMarkers = input(true, { ...(ngDevMode ? { debugName: "showMarkers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
220
76
|
/** Labels pinned over their readings, for the points that have to read without a pointer. They
|
|
@@ -235,7 +91,6 @@ class LineChartComponent {
|
|
|
235
91
|
* crosshair left standing after the pointer has gone needs a reader who knows why. `pointClicked`
|
|
236
92
|
* fires either way — pinning is a state, not a handler. */
|
|
237
93
|
pinOnClick = input(false, { ...(ngDevMode ? { debugName: "pinOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
238
|
-
pinnedCategory = signal(false, ...(ngDevMode ? [{ debugName: "pinnedCategory" }] : /* istanbul ignore next */ []));
|
|
239
94
|
/** Dims every OTHER mark while one is hovered or focused, so the reader's eye is held on the
|
|
240
95
|
* one under the pointer. Off by default: the dimming costs the separation BETWEEN the dimmed
|
|
241
96
|
* marks — measured 2026-09-13, the worst pair of three dimmed series falls from dE 14.8 at full
|
|
@@ -245,6 +100,18 @@ class LineChartComponent {
|
|
|
245
100
|
/** What a `null` reading draws. The default refuses to assert that a missing
|
|
246
101
|
* reading is a zero. */
|
|
247
102
|
gaps = input('break', ...(ngDevMode ? [{ debugName: "gaps" }] : /* istanbul ignore next */ []));
|
|
103
|
+
/** How the line joins its readings. `'linear'` by default, which asserts nothing the data does
|
|
104
|
+
* not say; a curve is a claim about what happened BETWEEN two readings. */
|
|
105
|
+
curve = input('linear', ...(ngDevMode ? [{ debugName: "curve" }] : /* istanbul ignore next */ []));
|
|
106
|
+
/** How several series share the value axis. Stacking runs per AXIS, so a series on the secondary
|
|
107
|
+
* axis never piles onto one measured against the primary. */
|
|
108
|
+
stack = input('none', ...(ngDevMode ? [{ debugName: "stack" }] : /* istanbul ignore next */ []));
|
|
109
|
+
/** Names the first axis's unit beside it. On a plot carrying two scales the colour says which
|
|
110
|
+
* line reads which axis and this says what the numbers ARE - and a reader who has neither is
|
|
111
|
+
* left comparing two quantities that may not be comparable at all. */
|
|
112
|
+
yAxisLabel = input(null, ...(ngDevMode ? [{ debugName: "yAxisLabel" }] : /* istanbul ignore next */ []));
|
|
113
|
+
/** `yAxisLabel` for the second axis. */
|
|
114
|
+
secondaryAxisLabel = input(null, ...(ngDevMode ? [{ debugName: "secondaryAxisLabel" }] : /* istanbul ignore next */ []));
|
|
248
115
|
/** How many value-axis ticks to aim for. A hint, not a count: ticks snap to a round step, so
|
|
249
116
|
* the axis may carry one more or one fewer. */
|
|
250
117
|
tickCount = input(LINE_CHART_DEFAULT_TICK_COUNT, { ...(ngDevMode ? { debugName: "tickCount" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
@@ -301,12 +168,12 @@ class LineChartComponent {
|
|
|
301
168
|
* included. Unset falls back to `DS_CONFIG.chart.valueFormat`, then the browser's locale
|
|
302
169
|
* grouping with a K/M/B suffix past four digits. */
|
|
303
170
|
valueFormat = input(null, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
171
|
+
defaults = resolveChartDefaults(this);
|
|
172
|
+
frameResolved = this.defaults.frame;
|
|
173
|
+
dataTableResolved = this.defaults.dataTable;
|
|
174
|
+
emptyTextResolved = this.defaults.emptyText;
|
|
175
|
+
errorTextResolved = this.defaults.errorText;
|
|
176
|
+
valueFormatResolved = this.defaults.valueFormat;
|
|
310
177
|
resolvedSeries = computed(() => {
|
|
311
178
|
const categoryCount = this.categories().length;
|
|
312
179
|
const gaps = this.gaps();
|
|
@@ -316,6 +183,7 @@ class LineChartComponent {
|
|
|
316
183
|
return {
|
|
317
184
|
series,
|
|
318
185
|
values: alignSeriesValues(series.data, categoryCount, gaps),
|
|
186
|
+
lowerValues: null,
|
|
319
187
|
onSecondaryAxis: series.axis === 'secondary',
|
|
320
188
|
color: CHART_SERIES_COLORS[slot],
|
|
321
189
|
dash: patterns ? SERIES_DASH_ARRAYS[slot] : null,
|
|
@@ -349,209 +217,63 @@ class LineChartComponent {
|
|
|
349
217
|
* all; `40` is the documented non-zero step. The total is capped, so a long list of series does
|
|
350
218
|
* not crawl in. */
|
|
351
219
|
staggerMs = input(0, { ...(ngDevMode ? { debugName: "staggerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
352
|
-
markStagger(index) {
|
|
353
|
-
return `${staggerDelay(index, this.staggerMs())}ms`;
|
|
354
|
-
}
|
|
355
220
|
highlightedSeries = signal(null, ...(ngDevMode ? [{ debugName: "highlightedSeries" }] : /* istanbul ignore next */ []));
|
|
221
|
+
/** Every series with its band's own span, stacked per axis. Hiding a series does NOT re-pile the
|
|
222
|
+
* rest, for the same reason `rescaleOnHide` defaults off: switching one off must not move the
|
|
223
|
+
* ones still drawn. A `null` stays a hole in the line and contributes nothing to the pile. */
|
|
224
|
+
stackedSeries = computed(() => {
|
|
225
|
+
const mode = this.stack();
|
|
226
|
+
const entries = this.resolvedSeries();
|
|
227
|
+
if (mode === 'none') {
|
|
228
|
+
return entries;
|
|
229
|
+
}
|
|
230
|
+
const spans = new Map();
|
|
231
|
+
for (const secondary of [false, true]) {
|
|
232
|
+
const onThisAxis = entries.filter((entry) => entry.onSecondaryAxis === secondary);
|
|
233
|
+
const offsets = stackOffsets(onThisAxis.map((entry) => entry.values.map((value) => value ?? 0)), mode);
|
|
234
|
+
onThisAxis.forEach((entry, index) => spans.set(entry, [...offsets[index]]));
|
|
235
|
+
}
|
|
236
|
+
return entries.map((entry) => {
|
|
237
|
+
const span = spans.get(entry);
|
|
238
|
+
if (!span) {
|
|
239
|
+
return entry;
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
...entry,
|
|
243
|
+
values: entry.values.map((value, category) => value === null ? null : span[category].to),
|
|
244
|
+
lowerValues: entry.values.map((value, category) => value === null ? null : span[category].from),
|
|
245
|
+
};
|
|
246
|
+
});
|
|
247
|
+
}, ...(ngDevMode ? [{ debugName: "stackedSeries" }] : /* istanbul ignore next */ []));
|
|
356
248
|
visibleSeries = computed(() => {
|
|
357
249
|
const hidden = this.hiddenSeries();
|
|
358
|
-
return this.
|
|
250
|
+
return this.stackedSeries().filter((entry) => !hidden.includes(entry.series.id));
|
|
359
251
|
}, ...(ngDevMode ? [{ debugName: "visibleSeries" }] : /* istanbul ignore next */ []));
|
|
360
252
|
legendItems = computed(() => this.resolvedSeries().map((entry) => ({
|
|
361
253
|
id: entry.series.id,
|
|
362
254
|
label: entry.series.label,
|
|
363
255
|
color: entry.color,
|
|
364
256
|
})), ...(ngDevMode ? [{ debugName: "legendItems" }] : /* istanbul ignore next */ []));
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
:
|
|
377
|
-
const valuesOn = (secondary) => entries
|
|
378
|
-
.filter((entry) => entry.onSecondaryAxis === secondary)
|
|
379
|
-
.map((entry) => entry.values);
|
|
380
|
-
// The pin raises the axis, never lowers it: a maximum under the data would push readings off
|
|
381
|
-
// the top of the plot, and a chart that hides a value is worse than one with headroom.
|
|
382
|
-
const pinned = (asked, derived) => asked !== null && Number.isFinite(asked) && asked > derived
|
|
383
|
-
? asked
|
|
384
|
-
: derived;
|
|
385
|
-
return axisLayout(pinned(this.max(), domainMaxOf(valuesOn(false))), this.hasSecondaryAxis()
|
|
386
|
-
? pinned(this.maxSecondary(), domainMaxOf(valuesOn(true)))
|
|
387
|
-
: null, this.yAxisMode(), this.tickCount());
|
|
388
|
-
}, ...(ngDevMode ? [{ debugName: "axes" }] : /* istanbul ignore next */ []));
|
|
389
|
-
categoryPositions = computed(() => categoryCenters(this.categories().length, this.layout().primaryPlot), ...(ngDevMode ? [{ debugName: "categoryPositions" }] : /* istanbul ignore next */ []));
|
|
390
|
-
plottedSeries = computed(() => {
|
|
391
|
-
const axes = this.axes();
|
|
392
|
-
const centers = this.categoryPositions();
|
|
393
|
-
return this.visibleSeries().map((entry) => {
|
|
394
|
-
const plot = this.plotFor(entry.onSecondaryAxis);
|
|
395
|
-
const axisMax = entry.onSecondaryAxis && axes.secondary
|
|
396
|
-
? axes.secondary.max
|
|
397
|
-
: axes.primary.max;
|
|
398
|
-
const segments = lineSegments(seriesPoints(entry.values, axisMax, plot, centers));
|
|
399
|
-
const baselineY = plot.top + plot.height;
|
|
400
|
-
return {
|
|
401
|
-
...entry,
|
|
402
|
-
polylines: segments
|
|
403
|
-
.map((segment) => polylinePoints(segment))
|
|
404
|
-
.filter((points) => points.length > 0),
|
|
405
|
-
areaPaths: entry.series.area
|
|
406
|
-
? segments
|
|
407
|
-
.map((segment) => areaPath(segment, baselineY))
|
|
408
|
-
.filter((path) => path.length > 0)
|
|
409
|
-
: [],
|
|
410
|
-
markers: segments.flat(),
|
|
411
|
-
};
|
|
412
|
-
});
|
|
413
|
-
}, ...(ngDevMode ? [{ debugName: "plottedSeries" }] : /* istanbul ignore next */ []));
|
|
414
|
-
/** Annotations resolved onto the markers the plot already computed, so a label sits exactly on
|
|
415
|
-
* its reading and moves with it. One whose series is hidden or whose reading is missing has no
|
|
416
|
-
* marker and is dropped — a hidden series must not leave its label floating over the plot. */
|
|
417
|
-
placedAnnotations = computed(() => {
|
|
418
|
-
const plotted = this.plottedSeries();
|
|
419
|
-
return this.annotations().flatMap((annotation) => {
|
|
420
|
-
const entry = annotation.seriesId
|
|
421
|
-
? plotted.find((candidate) => candidate.series.id === annotation.seriesId)
|
|
422
|
-
: plotted[0];
|
|
423
|
-
const marker = entry?.markers.find((candidate) => candidate.categoryIndex === annotation.categoryIndex);
|
|
424
|
-
if (!entry || !marker) {
|
|
425
|
-
return [];
|
|
426
|
-
}
|
|
427
|
-
// Anchored away from the plot edges, because a centred label at the first or last category
|
|
428
|
-
// hangs half outside the viewBox and is clipped rather than merely tight.
|
|
429
|
-
const anchor = marker.x < ANNOTATION_EDGE_GUARD
|
|
430
|
-
? 'start'
|
|
431
|
-
: marker.x > LINE_CHART_VIEW_WIDTH - ANNOTATION_EDGE_GUARD
|
|
432
|
-
? 'end'
|
|
433
|
-
: 'middle';
|
|
434
|
-
return [
|
|
435
|
-
{
|
|
436
|
-
key: `${entry.series.id}:${annotation.categoryIndex}`,
|
|
437
|
-
label: annotation.label,
|
|
438
|
-
x: marker.x,
|
|
439
|
-
// Above the reading, and below it where there is no room — a peak sits at the top of
|
|
440
|
-
// the plot, which is exactly where a label clamped upward lands on its own marker.
|
|
441
|
-
y: marker.y - ANNOTATION_GAP >= ANNOTATION_GAP
|
|
442
|
-
? marker.y - ANNOTATION_GAP
|
|
443
|
-
: marker.y + ANNOTATION_GAP,
|
|
444
|
-
anchor,
|
|
445
|
-
},
|
|
446
|
-
];
|
|
447
|
-
});
|
|
448
|
-
}, ...(ngDevMode ? [{ debugName: "placedAnnotations" }] : /* istanbul ignore next */ []));
|
|
449
|
-
primaryTicks = computed(() => this.ticksFor(this.axes().primary.ticks, this.axes().primary.max, false), ...(ngDevMode ? [{ debugName: "primaryTicks" }] : /* istanbul ignore next */ []));
|
|
450
|
-
secondaryTicks = computed(() => {
|
|
451
|
-
const secondary = this.axes().secondary;
|
|
452
|
-
return secondary ? this.ticksFor(secondary.ticks, secondary.max, true) : [];
|
|
453
|
-
}, ...(ngDevMode ? [{ debugName: "secondaryTicks" }] : /* istanbul ignore next */ []));
|
|
454
|
-
/** Drawn only when the two axes do not share the primary's gridlines, and only
|
|
455
|
-
* when the axis has more than the single tick a degenerate domain leaves. */
|
|
456
|
-
showSecondaryGridlines = computed(() => !this.axes().alignedTicks && this.secondaryTicks().length > 1, ...(ngDevMode ? [{ debugName: "showSecondaryGridlines" }] : /* istanbul ignore next */ []));
|
|
457
|
-
stacked = computed(() => this.layout().stacked, ...(ngDevMode ? [{ debugName: "stacked" }] : /* istanbul ignore next */ []));
|
|
458
|
-
categoryLabelY = computed(() => this.layout().categoryLabelY, ...(ngDevMode ? [{ debugName: "categoryLabelY" }] : /* istanbul ignore next */ []));
|
|
459
|
-
/** The category under the pointer, or -1. */
|
|
460
|
-
host = inject(ElementRef);
|
|
461
|
-
activeCategory = signal(-1, ...(ngDevMode ? [{ debugName: "activeCategory" }] : /* istanbul ignore next */ []));
|
|
462
|
-
categoryBands = computed(() => pointScale(this.categories().length, this.layout().primaryPlot.width), ...(ngDevMode ? [{ debugName: "categoryBands" }] : /* istanbul ignore next */ []));
|
|
463
|
-
// The band is a slot CENTRED on its reading, so it starts half a step before it. At the two ends
|
|
464
|
-
// half of that slot is outside the plot, and clamping is what keeps the band off the axis labels
|
|
465
|
-
// rather than letting it hang past them.
|
|
466
|
-
activeBandX = computed(() => {
|
|
467
|
-
const plot = this.layout().primaryPlot;
|
|
468
|
-
const scale = this.categoryBands();
|
|
469
|
-
const center = plot.left + scale.position(this.activeCategory());
|
|
470
|
-
return Math.max(center - scale.step / 2, plot.left);
|
|
471
|
-
}, ...(ngDevMode ? [{ debugName: "activeBandX" }] : /* istanbul ignore next */ []));
|
|
472
|
-
activeBandWidth = computed(() => {
|
|
473
|
-
const plot = this.layout().primaryPlot;
|
|
474
|
-
const scale = this.categoryBands();
|
|
475
|
-
const center = plot.left + scale.position(this.activeCategory());
|
|
476
|
-
const start = Math.max(center - scale.step / 2, plot.left);
|
|
477
|
-
const end = Math.min(center + scale.step / 2, plot.left + plot.width);
|
|
478
|
-
return Math.max(end - start, 0);
|
|
479
|
-
}, ...(ngDevMode ? [{ debugName: "activeBandWidth" }] : /* istanbul ignore next */ []));
|
|
480
|
-
activeCategoryX = computed(() => this.activeBandX() + this.activeBandWidth() / 2, ...(ngDevMode ? [{ debugName: "activeCategoryX" }] : /* istanbul ignore next */ []));
|
|
481
|
-
onPlotPointer(event) {
|
|
482
|
-
const canvas = event.currentTarget;
|
|
483
|
-
const screen = canvas.getScreenCTM();
|
|
484
|
-
if (!screen) {
|
|
485
|
-
return;
|
|
486
|
-
}
|
|
487
|
-
// Client pixels are not viewBox units — the plot scales to the card's width.
|
|
488
|
-
const point = new DOMPoint(event.clientX, event.clientY).matrixTransform(screen.inverse());
|
|
489
|
-
const plot = this.layout().primaryPlot;
|
|
490
|
-
if (this.pinnedCategory()) {
|
|
491
|
-
return;
|
|
492
|
-
}
|
|
493
|
-
this.cancelCategoryClear();
|
|
494
|
-
const category = this.categoryBands().indexAt(point.x - plot.left);
|
|
495
|
-
this.activeCategory.set(category);
|
|
496
|
-
this.tooltipOrigin.set(this.tooltipAnchor() === 'pointer'
|
|
497
|
-
? { x: event.clientX, y: event.clientY }
|
|
498
|
-
: this.readingAnchor(screen, category));
|
|
499
|
-
}
|
|
500
|
-
/** The highest reading in the category, mapped back into client pixels. Anchoring there rather
|
|
501
|
-
* than at the cursor keeps the panel still while the pointer travels within one band, and puts
|
|
502
|
-
* it over the readings it names instead of over the finger. */
|
|
503
|
-
readingAnchor(screen, category) {
|
|
504
|
-
const tops = this.plottedSeries().flatMap((entry) => entry.markers
|
|
505
|
-
.filter((marker) => marker.categoryIndex === category)
|
|
506
|
-
.map((marker) => marker.y));
|
|
507
|
-
const y = tops.length ? Math.min(...tops) : this.layout().primaryPlot.top;
|
|
508
|
-
const point = new DOMPoint(this.plotLeft() + this.categoryBands().position(category), y).matrixTransform(screen);
|
|
509
|
-
return { x: point.x, y: point.y };
|
|
510
|
-
}
|
|
511
|
-
clearActiveCategory() {
|
|
512
|
-
if (this.pinnedCategory()) {
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
// Same grace the element-mark charts get from `chartActiveMark`: the panel is portaled out of
|
|
516
|
-
// the plot, so leaving the plot fires before the pointer can reach it. Clearing at once made
|
|
517
|
-
// the panel unreachable, and — because the pane takes pointer events now — put the plot and the
|
|
518
|
-
// panel in a loop where each closed the other.
|
|
519
|
-
this.cancelCategoryClear();
|
|
520
|
-
this.pendingCategoryClear = setTimeout(() => {
|
|
521
|
-
this.pendingCategoryClear = null;
|
|
522
|
-
this.activeCategory.set(-1);
|
|
523
|
-
this.tooltipOrigin.set(null);
|
|
524
|
-
}, Math.max(this.tooltipLingerResolved(), 0));
|
|
525
|
-
}
|
|
526
|
-
/** The panel is portaled to the body, so the plot never sees the pointer arrive on it. This is
|
|
527
|
-
* the other half of the grace period: reaching the panel keeps it open, and leaving the panel for
|
|
528
|
-
* anything that is not the plot starts the clear the plot can no longer start itself. */
|
|
529
|
-
onPointerAnywhere(event) {
|
|
530
|
-
if (!(event.target instanceof Element) || this.pinnedCategory()) {
|
|
531
|
-
return;
|
|
532
|
-
}
|
|
533
|
-
if (event.target.closest('.ds-chart-tooltip-pane')) {
|
|
534
|
-
this.cancelCategoryClear();
|
|
535
|
-
return;
|
|
257
|
+
/** A normalized stack draws shares, not readings, so the axis has to say so - the value a tooltip
|
|
258
|
+
* or the annex table prints stays the reading, which is what `valueFormat` goes on formatting. */
|
|
259
|
+
axisFormat = computed(() => this.stack() === 'normalized'
|
|
260
|
+
? (value) => formatPercent(value, 1)
|
|
261
|
+
: this.valueFormatResolved(), ...(ngDevMode ? [{ debugName: "axisFormat" }] : /* istanbul ignore next */ []));
|
|
262
|
+
/** Each axis takes the colour of the series measured against it, but only where two scales share
|
|
263
|
+
* one plot: on a single-scale chart it would restate the marks' own colour in the furniture,
|
|
264
|
+
* and under `'split'` the two plots are already apart. The chart knows its own series colours,
|
|
265
|
+
* so this is derived rather than asked for. */
|
|
266
|
+
axisTint = computed(() => {
|
|
267
|
+
if (!this.hasSecondaryAxis() || this.yAxisMode() === 'split') {
|
|
268
|
+
return { primary: null, secondary: null };
|
|
536
269
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
clearTimeout(this.pendingCategoryClear);
|
|
545
|
-
this.pendingCategoryClear = null;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
tooltipLingerResolved = resolveWithConfig(this.tooltipLingerMs, (config) => config.chart?.tooltipLingerMs, 0);
|
|
549
|
-
pendingCategoryClear = null;
|
|
550
|
-
releaseCategoryPin() {
|
|
551
|
-
this.pinnedCategory.set(false);
|
|
552
|
-
this.activeCategory.set(-1);
|
|
553
|
-
this.tooltipOrigin.set(null);
|
|
554
|
-
}
|
|
270
|
+
const find = (onSecondaryAxis) => this.visibleSeries().find((entry) => entry.onSecondaryAxis === onSecondaryAxis)?.color ?? null;
|
|
271
|
+
return { primary: find(false), secondary: find(true) };
|
|
272
|
+
}, ...(ngDevMode ? [{ debugName: "axisTint" }] : /* istanbul ignore next */ []));
|
|
273
|
+
primaryAxisFill = computed(() => this.axisTint().primary, ...(ngDevMode ? [{ debugName: "primaryAxisFill" }] : /* istanbul ignore next */ []));
|
|
274
|
+
secondaryAxisFill = computed(() => this.axisTint().secondary, ...(ngDevMode ? [{ debugName: "secondaryAxisFill" }] : /* istanbul ignore next */ []));
|
|
275
|
+
stacksSeries = computed(() => this.stack() !== 'none', ...(ngDevMode ? [{ debugName: "stacksSeries" }] : /* istanbul ignore next */ []));
|
|
276
|
+
tooltipLingerResolved = this.defaults.tooltipLingerMs;
|
|
555
277
|
/** Whether the plot opens a tooltip, and for what. `'axis'` names every series at the
|
|
556
278
|
* category under the pointer, which is the reading a multi-series line is compared on;
|
|
557
279
|
* `'item'` names only the marker itself. */
|
|
@@ -561,109 +283,14 @@ class LineChartComponent {
|
|
|
561
283
|
* so the panel stays put while the pointer moves within one band. `'pointer'` follows the
|
|
562
284
|
* cursor. */
|
|
563
285
|
tooltipAnchor = input('point', ...(ngDevMode ? [{ debugName: "tooltipAnchor" }] : /* istanbul ignore next */ []));
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
rovingByCategory = signal(new Map(), ...(ngDevMode ? [{ debugName: "rovingByCategory" }] : /* istanbul ignore next */ []));
|
|
573
|
-
isTabStop(seriesId, categoryIndex) {
|
|
574
|
-
return (this.rovingByCategory().get(seriesId) ?? 0) === categoryIndex;
|
|
575
|
-
}
|
|
576
|
-
onMarkerFocus(seriesIndex, categoryIndex, event) {
|
|
577
|
-
if (event.currentTarget instanceof Element) {
|
|
578
|
-
this.tooltipOrigin.set(event.currentTarget);
|
|
579
|
-
}
|
|
580
|
-
this.activeSeries.set(seriesIndex);
|
|
581
|
-
this.activeCategory.set(categoryIndex);
|
|
582
|
-
this.setRoving(seriesIndex, categoryIndex);
|
|
583
|
-
}
|
|
584
|
-
onMarkerNavigation(event, seriesIndex, categoryIndex) {
|
|
585
|
-
const markers = this.plottedSeries()[seriesIndex]?.markers ?? [];
|
|
586
|
-
const positions = markers.map((marker) => marker.categoryIndex);
|
|
587
|
-
const current = positions.indexOf(categoryIndex);
|
|
588
|
-
const next = nextRovingIndex(event.key, current, positions.length);
|
|
589
|
-
if (next === null) {
|
|
590
|
-
return;
|
|
591
|
-
}
|
|
592
|
-
event.preventDefault();
|
|
593
|
-
const nextCategory = positions[next];
|
|
594
|
-
this.setRoving(seriesIndex, nextCategory);
|
|
595
|
-
focusMark(event.currentTarget.closest('svg'), nextCategory, `[data-series-index="${seriesIndex}"]`);
|
|
596
|
-
}
|
|
597
|
-
setRoving(seriesIndex, categoryIndex) {
|
|
598
|
-
const seriesId = this.plottedSeries()[seriesIndex]?.series.id;
|
|
599
|
-
if (seriesId === undefined) {
|
|
600
|
-
return;
|
|
601
|
-
}
|
|
602
|
-
const next = new Map(this.rovingByCategory());
|
|
603
|
-
next.set(seriesId, categoryIndex);
|
|
604
|
-
this.rovingByCategory.set(next);
|
|
605
|
-
}
|
|
606
|
-
onMarkerBlur() {
|
|
607
|
-
this.activeSeries.set(-1);
|
|
608
|
-
this.clearActiveCategory();
|
|
609
|
-
}
|
|
610
|
-
tooltipContext = computed(() => {
|
|
611
|
-
const categoryIndex = this.activeCategory();
|
|
612
|
-
const categories = this.categories();
|
|
613
|
-
if (this.tooltip() === 'none' ||
|
|
614
|
-
categoryIndex < 0 ||
|
|
615
|
-
categoryIndex >= categories.length) {
|
|
616
|
-
return null;
|
|
617
|
-
}
|
|
618
|
-
const format = this.valueFormatResolved();
|
|
619
|
-
const focusedSeries = this.activeSeries();
|
|
620
|
-
const perSeries = this.tooltip() === 'item' || focusedSeries >= 0
|
|
621
|
-
? this.visibleSeries().slice(Math.max(focusedSeries, 0), Math.max(focusedSeries, 0) + 1)
|
|
622
|
-
: this.visibleSeries();
|
|
623
|
-
return {
|
|
624
|
-
category: categories[categoryIndex],
|
|
625
|
-
entries: perSeries
|
|
626
|
-
.map((entry) => ({ entry, value: entry.values[categoryIndex] }))
|
|
627
|
-
.filter((reading) => typeof reading.value === 'number' &&
|
|
628
|
-
Number.isFinite(reading.value))
|
|
629
|
-
.map(({ entry, value }) => ({
|
|
630
|
-
label: entry.series.label,
|
|
631
|
-
value,
|
|
632
|
-
formatted: format(value, 'tooltip'),
|
|
633
|
-
color: entry.color,
|
|
634
|
-
})),
|
|
635
|
-
};
|
|
636
|
-
}, ...(ngDevMode ? [{ debugName: "tooltipContext" }] : /* istanbul ignore next */ []));
|
|
637
|
-
plotLeft = computed(() => this.layout().primaryPlot.left, ...(ngDevMode ? [{ debugName: "plotLeft" }] : /* istanbul ignore next */ []));
|
|
638
|
-
plotRight = computed(() => this.layout().primaryPlot.left + this.layout().primaryPlot.width, ...(ngDevMode ? [{ debugName: "plotRight" }] : /* istanbul ignore next */ []));
|
|
639
|
-
primaryTopY = computed(() => this.layout().primaryPlot.top, ...(ngDevMode ? [{ debugName: "primaryTopY" }] : /* istanbul ignore next */ []));
|
|
640
|
-
secondaryTopY = computed(() => this.layout().secondaryPlot.top, ...(ngDevMode ? [{ debugName: "secondaryTopY" }] : /* istanbul ignore next */ []));
|
|
641
|
-
primaryBaselineY = computed(() => baselineOf(this.layout().primaryPlot), ...(ngDevMode ? [{ debugName: "primaryBaselineY" }] : /* istanbul ignore next */ []));
|
|
642
|
-
secondaryBaselineY = computed(() => baselineOf(this.layout().secondaryPlot), ...(ngDevMode ? [{ debugName: "secondaryBaselineY" }] : /* istanbul ignore next */ []));
|
|
643
|
-
/** Where the crosshair stops. Under `'stacked'` the two plots sit one above the other over one
|
|
644
|
-
* category axis, so a crosshair that ends at the upper plot's baseline leaves the lower plot —
|
|
645
|
-
* the same category, the same pointer — with nothing marked at all. */
|
|
646
|
-
cursorBottomY = computed(() => this.stacked() ? this.secondaryBaselineY() : this.primaryBaselineY(), ...(ngDevMode ? [{ debugName: "cursorBottomY" }] : /* istanbul ignore next */ []));
|
|
647
|
-
primaryLabelX = computed(() => this.layout().primaryPlot.left - LINE_CHART_AXIS_LABEL_GAP, ...(ngDevMode ? [{ debugName: "primaryLabelX" }] : /* istanbul ignore next */ []));
|
|
648
|
-
secondaryLabelX = computed(() => {
|
|
649
|
-
const layout = this.layout();
|
|
650
|
-
return layout.stacked
|
|
651
|
-
? layout.secondaryPlot.left - LINE_CHART_AXIS_LABEL_GAP
|
|
652
|
-
: layout.primaryPlot.left +
|
|
653
|
-
layout.primaryPlot.width +
|
|
654
|
-
LINE_CHART_AXIS_LABEL_GAP;
|
|
655
|
-
}, ...(ngDevMode ? [{ debugName: "secondaryLabelX" }] : /* istanbul ignore next */ []));
|
|
656
|
-
secondaryLabelAnchor = computed(() => this.layout().stacked ? 'end' : 'start', ...(ngDevMode ? [{ debugName: "secondaryLabelAnchor" }] : /* istanbul ignore next */ []));
|
|
657
|
-
categoryLabels = computed(() => {
|
|
658
|
-
const categories = this.categories();
|
|
659
|
-
const centers = this.categoryPositions();
|
|
660
|
-
const stride = categoryLabelStride(categories.length);
|
|
661
|
-
const labels = [];
|
|
662
|
-
for (let index = 0; index < categories.length; index += stride) {
|
|
663
|
-
labels.push({ x: centers[index], text: categories[index] });
|
|
664
|
-
}
|
|
665
|
-
return labels;
|
|
666
|
-
}, ...(ngDevMode ? [{ debugName: "categoryLabels" }] : /* istanbul ignore next */ []));
|
|
286
|
+
dataTableColumns = computed(() => [
|
|
287
|
+
'Category',
|
|
288
|
+
...this.resolvedSeries().map((entry) => entry.series.label),
|
|
289
|
+
], ...(ngDevMode ? [{ debugName: "dataTableColumns" }] : /* istanbul ignore next */ []));
|
|
290
|
+
dataTableRows = computed(() => this.tableRows().map((row) => ({
|
|
291
|
+
key: row.category,
|
|
292
|
+
cells: [row.category, ...row.cells],
|
|
293
|
+
})), ...(ngDevMode ? [{ debugName: "dataTableRows" }] : /* istanbul ignore next */ []));
|
|
667
294
|
tableRows = computed(() => {
|
|
668
295
|
const format = this.valueFormatResolved();
|
|
669
296
|
return this.categories().map((category, index) => ({
|
|
@@ -692,39 +319,100 @@ class LineChartComponent {
|
|
|
692
319
|
: ' Full values in the table below.';
|
|
693
320
|
// The plot's own text is inside an `aria-hidden` svg, so an annotation a sighted reader takes
|
|
694
321
|
// as the point of the chart would otherwise reach nobody else.
|
|
695
|
-
const notes = this.
|
|
322
|
+
const notes = this.markAnnotations().map((note) => note.label);
|
|
696
323
|
const noted = notes.length ? ` Noted: ${notes.join('; ')}.` : '';
|
|
697
324
|
return sentences.length === 0
|
|
698
325
|
? describeSeries(title, [], format, this.dataTableResolved() !== 'none')
|
|
699
326
|
: `${title}. ${sentences.join(' ')}${noted}${pointer}`;
|
|
700
327
|
}, ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
};
|
|
328
|
+
plot = viewChild(ChartComponent, ...(ngDevMode ? [{ debugName: "plot" }] : /* istanbul ignore next */ []));
|
|
329
|
+
/** Whether the category cursor is held. Read off the container, which owns the pin now that it
|
|
330
|
+
* owns the cursor. */
|
|
331
|
+
pinnedCategory = computed(() => this.plot()?.cursorPinned() ?? false, ...(ngDevMode ? [{ debugName: "pinnedCategory" }] : /* istanbul ignore next */ []));
|
|
332
|
+
releaseCategoryPin() {
|
|
333
|
+
this.plot()?.releaseCursor();
|
|
708
334
|
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
335
|
+
/** What the series mark draws: the stacked values, the hidden series already filtered out. */
|
|
336
|
+
markSeries = computed(() => this.visibleSeries().map((entry) => ({
|
|
337
|
+
id: entry.series.id,
|
|
338
|
+
label: entry.series.label,
|
|
339
|
+
data: entry.values,
|
|
340
|
+
axis: entry.onSecondaryAxis
|
|
341
|
+
? 'secondary'
|
|
342
|
+
: 'primary',
|
|
343
|
+
area: entry.series.area,
|
|
344
|
+
lower: entry.lowerValues ?? undefined,
|
|
345
|
+
color: entry.color,
|
|
346
|
+
})), ...(ngDevMode ? [{ debugName: "markSeries" }] : /* istanbul ignore next */ []));
|
|
347
|
+
dashPatterns = computed(() => this.visibleSeries().map((entry) => entry.dash ?? ''), ...(ngDevMode ? [{ debugName: "dashPatterns" }] : /* istanbul ignore next */ []));
|
|
348
|
+
/** The reading each label names, which is what the mark needs: it draws against the scales and
|
|
349
|
+
* never sees the series list. One whose series is hidden or whose reading is missing is
|
|
350
|
+
* dropped rather than left floating over the plot. */
|
|
351
|
+
markAnnotations = computed(() => this.annotations().flatMap((annotation) => {
|
|
352
|
+
const visible = this.visibleSeries();
|
|
353
|
+
const entry = annotation.seriesId
|
|
354
|
+
? visible.find((candidate) => candidate.series.id === annotation.seriesId)
|
|
355
|
+
: visible[0];
|
|
356
|
+
const value = entry?.values[annotation.categoryIndex];
|
|
357
|
+
if (!entry || typeof value !== 'number') {
|
|
358
|
+
return [];
|
|
359
|
+
}
|
|
360
|
+
return [
|
|
361
|
+
{
|
|
362
|
+
categoryIndex: annotation.categoryIndex,
|
|
363
|
+
value,
|
|
364
|
+
label: annotation.label,
|
|
365
|
+
axis: entry.onSecondaryAxis
|
|
366
|
+
? 'secondary'
|
|
367
|
+
: 'primary',
|
|
368
|
+
},
|
|
369
|
+
];
|
|
370
|
+
}), ...(ngDevMode ? [{ debugName: "markAnnotations" }] : /* istanbul ignore next */ []));
|
|
371
|
+
markAnchor = computed(() => this.tooltipAnchor() === 'pointer'
|
|
372
|
+
? 'pointer'
|
|
373
|
+
: 'reading', ...(ngDevMode ? [{ debugName: "markAnchor" }] : /* istanbul ignore next */ []));
|
|
374
|
+
hasSecondaryAxis = computed(() => this.visibleSeries().some((entry) => entry.onSecondaryAxis), ...(ngDevMode ? [{ debugName: "hasSecondaryAxis" }] : /* istanbul ignore next */ []));
|
|
375
|
+
/** The ceiling handed to the container, which raises its own domain to it and never lowers.
|
|
376
|
+
* Unless `rescaleOnHide` says otherwise it is the maximum across EVERY series, so switching
|
|
377
|
+
* one off does not move the gridlines under the ones still drawn. */
|
|
378
|
+
axisMax = computed(() => this.rescaleOnHide() ? this.max() : this.ceilingOf(false, this.max()), ...(ngDevMode ? [{ debugName: "axisMax" }] : /* istanbul ignore next */ []));
|
|
379
|
+
axisMaxSecondary = computed(() => this.rescaleOnHide()
|
|
380
|
+
? this.maxSecondary()
|
|
381
|
+
: this.ceilingOf(true, this.maxSecondary()), ...(ngDevMode ? [{ debugName: "axisMaxSecondary" }] : /* istanbul ignore next */ []));
|
|
382
|
+
ceilingOf(onSecondaryAxis, asked) {
|
|
383
|
+
const derived = domainMaxOf(this.stackedSeries()
|
|
384
|
+
.filter((entry) => entry.onSecondaryAxis === onSecondaryAxis)
|
|
385
|
+
.map((entry) => entry.values));
|
|
386
|
+
return asked !== null && Number.isFinite(asked) && asked > derived
|
|
387
|
+
? asked
|
|
388
|
+
: derived;
|
|
712
389
|
}
|
|
713
|
-
|
|
714
|
-
|
|
390
|
+
/** `--ds-line-chart-plot-height` reaches an SVG coordinate space only as a number, so it is read
|
|
391
|
+
* back off the host rather than applied as CSS. */
|
|
392
|
+
plotHeight = signal(DEFAULT_PLOT_HEIGHT, ...(ngDevMode ? [{ debugName: "plotHeight" }] : /* istanbul ignore next */ []));
|
|
393
|
+
/** Every state occupies the box the plot would have, so nothing on the page moves when the data
|
|
394
|
+
* lands, the request fails or the last series is switched off. */
|
|
395
|
+
viewHeightPx = computed(() => `${chartViewHeight(this.plotHeight(), CHART_DEFAULT_VALUE_SPACE)}px`, ...(ngDevMode ? [{ debugName: "viewHeightPx" }] : /* istanbul ignore next */ []));
|
|
396
|
+
onPointClicked(reading) {
|
|
397
|
+
const series = this.series().find((candidate) => candidate.id === reading.series.id);
|
|
398
|
+
if (!series) {
|
|
715
399
|
return;
|
|
716
400
|
}
|
|
717
|
-
|
|
718
|
-
|
|
401
|
+
this.pointClicked.emit({
|
|
402
|
+
series,
|
|
403
|
+
categoryIndex: reading.categoryIndex,
|
|
404
|
+
category: this.categories()[reading.categoryIndex] ?? '',
|
|
405
|
+
value: reading.value,
|
|
406
|
+
});
|
|
719
407
|
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
}
|
|
408
|
+
constructor() {
|
|
409
|
+
const host = inject(ElementRef);
|
|
410
|
+
afterNextRender(() => {
|
|
411
|
+
const parsed = Number.parseFloat(getComputedStyle(host.nativeElement).getPropertyValue('--_line-chart-plot-height'));
|
|
412
|
+
if (Number.isFinite(parsed) && parsed > 0) {
|
|
413
|
+
this.plotHeight.set(parsed);
|
|
414
|
+
}
|
|
415
|
+
});
|
|
728
416
|
}
|
|
729
417
|
isEmpty = computed(() => this.series().length === 0 || this.categories().length === 0, ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
730
418
|
showLegend = computed(() => this.series().length > 1, ...(ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []));
|
|
@@ -733,31 +421,24 @@ class LineChartComponent {
|
|
|
733
421
|
* chart does not resize when the data lands; falls back to three when `series`
|
|
734
422
|
* is still empty. */
|
|
735
423
|
skeletonSeries = computed(() => Array.from({ length: Math.max(this.series().length, 3) }), ...(ngDevMode ? [{ debugName: "skeletonSeries" }] : /* istanbul ignore next */ []));
|
|
736
|
-
plotFor(onSecondaryAxis) {
|
|
737
|
-
const layout = this.layout();
|
|
738
|
-
return onSecondaryAxis && layout.stacked
|
|
739
|
-
? layout.secondaryPlot
|
|
740
|
-
: layout.primaryPlot;
|
|
741
|
-
}
|
|
742
|
-
ticksFor(ticks, axisMax, onSecondaryAxis) {
|
|
743
|
-
const plot = this.plotFor(onSecondaryAxis);
|
|
744
|
-
const format = this.valueFormatResolved();
|
|
745
|
-
return ticks.map((value) => ({
|
|
746
|
-
y: valueY(value, axisMax, plot),
|
|
747
|
-
label: format(value, 'tick'),
|
|
748
|
-
}));
|
|
749
|
-
}
|
|
750
424
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: LineChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
751
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: LineChartComponent, isStandalone: true, selector: "ds-line-chart", inputs: { categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: true, transformFunction: null }, series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: true, transformFunction: null }, yAxisMode: { classPropertyName: "yAxisMode", publicName: "yAxisMode", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, annotations: { classPropertyName: "annotations", publicName: "annotations", 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 }, gaps: { classPropertyName: "gaps", publicName: "gaps", isSignal: true, isRequired: false, transformFunction: null }, tickCount: { classPropertyName: "tickCount", publicName: "tickCount", isSignal: true, isRequired: false, transformFunction: null }, frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, dataTable: { classPropertyName: "dataTable", publicName: "dataTable", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, maxSecondary: { classPropertyName: "maxSecondary", publicName: "maxSecondary", 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 }, hiddenSeries: { classPropertyName: "hiddenSeries", publicName: "hiddenSeries", isSignal: true, isRequired: false, transformFunction: null }, rescaleOnHide: { classPropertyName: "rescaleOnHide", publicName: "rescaleOnHide", isSignal: true, isRequired: false, transformFunction: null }, legendFilters: { classPropertyName: "legendFilters", publicName: "legendFilters", isSignal: true, isRequired: false, transformFunction: null }, legendMode: { classPropertyName: "legendMode", publicName: "legendMode", isSignal: true, isRequired: false, transformFunction: null }, noVisibleSeriesText: { classPropertyName: "noVisibleSeriesText", publicName: "noVisibleSeriesText", isSignal: true, isRequired: false, transformFunction: null }, patterns: { classPropertyName: "patterns", publicName: "patterns", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", 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 } }, outputs: { pointClicked: "pointClicked", hiddenSeries: "hiddenSeriesChange" }, host: { listeners: { "document:keydown.escape": "releaseCategoryPin()", "document:pointerover": "onPointerAnywhere($event)" }, properties: { "class.framed": "frameResolved() === 'auto'" } }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["dsChartTooltip"], descendants: true, isSignal: true }], ngImport: i0, template: "<figure class=\"line-chart\">\n @if (pinnedCategory()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"releaseCategoryPin()\">\n Unpin\n </button>\n }\n\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(--_line-chart-plot-height)\" />\n\n @if (skeletonSeries().length > 1) {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonSeries(); track $index) {\n <ds-skeleton\n width=\"var(--space-16)\"\n height=\"var(--space-3)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else if (noVisibleSeries()) {\n <p\n class=\"empty\"\n role=\"status\">\n {{ noVisibleSeriesText() }}\n </p>\n\n <ds-chart-legend\n [items]=\"legendItems()\"\n [toggleable]=\"legendFilters()\"\n [mode]=\"legendMode()\"\n [(hidden)]=\"hiddenSeries\"\n [(highlighted)]=\"highlightedSeries\" />\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"pinnedCategory()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <svg\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [attr.aria-hidden]=\"interactive() ? null : true\"\n [attr.viewBox]=\"viewBox\"\n (pointermove)=\"onPlotPointer($event)\"\n (pointerdown)=\"onPlotPointer($event)\"\n (pointerleave)=\"clearActiveCategory()\">\n @if (activeCategory() >= 0) {\n <g\n class=\"cursor\"\n animate.enter=\"cursor-in\"\n animate.leave=\"cursor-out\"\n [style.transform]=\"'translateX(' + activeBandX() + 'px)'\">\n <rect\n class=\"category-band\"\n aria-hidden=\"true\"\n x=\"0\"\n [attr.y]=\"primaryTopY()\"\n [attr.width]=\"activeBandWidth()\"\n [attr.height]=\"cursorBottomY() - primaryTopY()\" />\n\n <line\n class=\"cursor-line\"\n aria-hidden=\"true\"\n [attr.x1]=\"activeBandWidth() / 2\"\n [attr.x2]=\"activeBandWidth() / 2\"\n [attr.y1]=\"primaryTopY()\"\n [attr.y2]=\"cursorBottomY()\" />\n </g>\n }\n\n @for (tick of primaryTicks(); track $index) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track $index) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\"\n [class.secondary]=\"!stacked()\" />\n }\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"primaryBaselineY()\"\n [attr.y2]=\"primaryBaselineY()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotLeft()\"\n [attr.y1]=\"primaryTopY()\"\n [attr.y2]=\"primaryBaselineY()\" />\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryBaselineY()\"\n [attr.y2]=\"secondaryBaselineY()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotLeft()\"\n [attr.y1]=\"secondaryTopY()\"\n [attr.y2]=\"secondaryBaselineY()\" />\n }\n\n @for (\n entry of plottedSeries();\n track entry.series.id;\n let seriesIndex = $index\n ) {\n @for (path of entry.areaPaths; track $index) {\n <path\n class=\"series-area\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(seriesIndex)\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.d]=\"path\"\n [attr.fill]=\"entry.color\" />\n }\n }\n\n @for (\n entry of plottedSeries();\n track entry.series.id;\n let seriesIndex = $index\n ) {\n @for (points of entry.polylines; track $index) {\n <polyline\n class=\"series-line\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [attr.stroke-dasharray]=\"entry.dash\"\n [style.--_chart-mark-stagger]=\"markStagger(seriesIndex)\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.points]=\"points\"\n [attr.stroke]=\"entry.color\" />\n }\n }\n\n @if (showMarkers() || interactive()) {\n @for (\n entry of plottedSeries();\n track entry.series.id;\n let seriesIndex = $index\n ) {\n @for (marker of entry.markers; track marker.categoryIndex) {\n <circle\n class=\"series-marker\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [class.ghost]=\"!showMarkers()\"\n [class.interactive]=\"interactive()\"\n [class.is-active]=\"marker.categoryIndex === activeCategory()\"\n [attr.cx]=\"marker.x\"\n [attr.cy]=\"marker.y\"\n [attr.fill]=\"entry.color\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.data-series-index]=\"seriesIndex\"\n [attr.data-mark-index]=\"marker.categoryIndex\"\n [attr.tabindex]=\"\n interactive()\n ? isTabStop(entry.series.id, marker.categoryIndex)\n ? 0\n : -1\n : null\n \"\n [attr.aria-label]=\"\n interactive() ? markerLabel(entry, marker) : null\n \"\n (focus)=\"\n onMarkerFocus(seriesIndex, marker.categoryIndex, $event)\n \"\n (blur)=\"onMarkerBlur()\"\n (keydown)=\"\n onMarkerNavigation($event, seriesIndex, marker.categoryIndex)\n \"\n (click)=\"onMarkerClick(entry, marker)\"\n (keydown.enter)=\"onMarkerKey(entry, marker, $event)\"\n (keydown.space)=\"onMarkerKey(entry, marker, $event)\" />\n }\n }\n }\n\n @for (note of placedAnnotations(); track note.key) {\n <text\n class=\"annotation\"\n aria-hidden=\"true\"\n [attr.x]=\"note.x\"\n [attr.y]=\"note.y\"\n [attr.text-anchor]=\"note.anchor\">\n {{ note.label }}\n </text>\n }\n\n @for (tick of primaryTicks(); track $index) {\n <text\n class=\"axis-label\"\n text-anchor=\"end\"\n [attr.x]=\"primaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track $index) {\n <text\n class=\"axis-label\"\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 $index) {\n <text\n class=\"category-label\"\n text-anchor=\"middle\"\n [attr.x]=\"label.x\"\n [attr.y]=\"categoryLabelY()\">\n {{ label.text }}\n </text>\n }\n </svg>\n </div>\n\n @if (showLegend()) {\n <ds-chart-legend\n [items]=\"legendItems()\"\n [toggleable]=\"legendFilters()\"\n [mode]=\"legendMode()\"\n [(hidden)]=\"hiddenSeries\"\n [(highlighted)]=\"highlightedSeries\" />\n }\n\n @if (dataTableResolved() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Category\n </th>\n\n @for (entry of resolvedSeries(); track entry.series.id) {\n <th scope=\"col\">\n {{ entry.series.label }}\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (row of tableRows(); track $index) {\n <tr>\n <th scope=\"row\">\n {{ row.category }}\n </th>\n\n @for (cell of row.cells; track $index) {\n <td>\n {{ cell }}\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\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)}}@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.mark-enter{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)) both}.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.mark-enter{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)) both}.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.mark-enter{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)) both}.series-marker.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}: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,figcaption{-webkit-user-select:text;user-select:text}@media not (forced-colors:active){.series-marker:focus{outline:none}}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.line-chart{--_line-chart-grid-line-color: var(--ds-line-chart-grid-line-color, var(--ds-chart-grid-line-color));--_line-chart-axis-line-color: var(--ds-line-chart-axis-line-color, var(--ds-chart-axis-line-color));--_line-chart-axis-label-color: var(--ds-line-chart-axis-label-color, var(--ds-chart-axis-label-color));--_line-chart-axis-font-size: var(--ds-line-chart-axis-font-size, var(--ds-chart-axis-font-size));--_line-chart-annotation-color: var(--ds-line-chart-annotation-color, var(--text-primary));--_line-chart-annotation-font-size: var(--ds-line-chart-annotation-font-size, var(--ds-chart-axis-font-size));--_line-chart-annotation-weight: var(--ds-line-chart-annotation-weight, var(--font-weight-bold));--_line-chart-annotation-halo-color: var(--ds-line-chart-annotation-halo-color, var(--surface-default));--_line-chart-annotation-halo-width: var(--ds-line-chart-annotation-halo-width, 3px);--_line-chart-line-width: var(--ds-line-chart-line-width, var(--ds-chart-line-width));--_line-chart-dot-radius: var(--ds-line-chart-dot-radius, var(--ds-chart-dot-radius));--_line-chart-dot-radius-active: var(--ds-line-chart-dot-radius-active, var(--ds-chart-dot-radius-active));--_line-chart-hover-bg-color: var(--ds-line-chart-hover-bg-color, var(--ds-chart-hover-bg-color));--_line-chart-cursor-line-color: var(--ds-line-chart-cursor-line-color, var(--ds-chart-cursor-line-color));--_line-chart-line-width-bold: var( --ds-line-chart-line-width-bold, var(--ds-chart-line-width-bold) );--_line-chart-focus-color: var(--ds-line-chart-focus-color, var(--focus-ring-color));--_line-chart-focus-width: var(--ds-line-chart-focus-width, var(--focus-ring-width));--_line-chart-area-opacity: var(--ds-line-chart-area-opacity, .16);--_line-chart-plot-height: var(--ds-line-chart-plot-height, 240px);--_line-chart-swatch-size: var(--ds-line-chart-swatch-size, 10px);margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{display:grid;place-items:center;min-block-size:var(--_line-chart-plot-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)}.empty{aspect-ratio:640/320;inline-size:100%}.canvas{display:block;inline-size:100%;block-size:auto}.grid-line{stroke:var(--_line-chart-grid-line-color);stroke-width:1}.grid-line.secondary{stroke-dasharray:4 4}.axis-line{stroke:var(--_line-chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_line-chart-axis-label-color);font-size:var(--_line-chart-axis-font-size)}.annotation{fill:var(--_line-chart-annotation-color);font-size:var(--_line-chart-annotation-font-size);font-weight:var(--_line-chart-annotation-weight);paint-order:stroke;stroke:var(--_line-chart-annotation-halo-color);stroke-width:var(--_line-chart-annotation-halo-width);stroke-linejoin:round}.axis-label{dominant-baseline:middle}.series-area{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)}.series-area.is-dimmed{opacity:var(--ds-chart-dim-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),stroke-width var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-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-area{fill-opacity:var(--_line-chart-area-opacity);stroke:none}.series-line{fill:none;stroke-width:var(--_line-chart-line-width);stroke-linecap:round;stroke-linejoin:round}.plot:has(.series-line.is-dimmed) .series-line:not(.is-dimmed){stroke-width:var(--_line-chart-line-width-bold)}.series-marker{r:var(--_line-chart-dot-radius)}.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(--_line-chart-hover-bg-color)}.cursor-line{stroke:var(--_line-chart-cursor-line-color);stroke-width:1}.series-marker.is-active{r:var(--_line-chart-dot-radius-active)}.series-marker.ghost.is-active{fill-opacity:1}.series-marker.interactive{cursor:pointer;stroke:transparent;stroke-width:24px;vector-effect:non-scaling-stroke}@media(hover:none)and (pointer:coarse){.series-marker.interactive{stroke-width:44px}}.series-marker.ghost{fill-opacity:0}.series-marker.ghost:hover,.series-marker.ghost:focus-visible{fill-opacity:1}@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(--_line-chart-dot-radius-active)}.legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin:var(--space-3) 0 0;padding:0;list-style:none}.legend-item{display:inline-flex;gap:var(--space-2);align-items:center;color:var(--text-secondary);font-size:var(--font-size-xs)}.legend-swatch{flex:none;inline-size:var(--_line-chart-swatch-size);block-size:var(--_line-chart-swatch-size);border-radius:var(--radius-pill)}.skeleton{display:grid}.skeleton-legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin-block-start:var(--space-3)}.empty.is-error{color:var(--error)}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-start:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate", "dsChartTooltipExtraGap", "dsChartTooltipPreferBelow"] }, { kind: "component", type: ChartLegendComponent, selector: "ds-chart-legend", inputs: ["items", "hidden", "toggleable", "mode", "highlighted"], outputs: ["hiddenChange", "highlightedChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
425
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: LineChartComponent, isStandalone: true, selector: "ds-line-chart", inputs: { categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: true, transformFunction: null }, series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: true, transformFunction: null }, yAxisMode: { classPropertyName: "yAxisMode", publicName: "yAxisMode", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, annotations: { classPropertyName: "annotations", publicName: "annotations", 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 }, gaps: { classPropertyName: "gaps", publicName: "gaps", isSignal: true, isRequired: false, transformFunction: null }, curve: { classPropertyName: "curve", publicName: "curve", isSignal: true, isRequired: false, transformFunction: null }, stack: { classPropertyName: "stack", publicName: "stack", isSignal: true, isRequired: false, transformFunction: null }, yAxisLabel: { classPropertyName: "yAxisLabel", publicName: "yAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisLabel: { classPropertyName: "secondaryAxisLabel", publicName: "secondaryAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, tickCount: { classPropertyName: "tickCount", publicName: "tickCount", isSignal: true, isRequired: false, transformFunction: null }, frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, dataTable: { classPropertyName: "dataTable", publicName: "dataTable", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, maxSecondary: { classPropertyName: "maxSecondary", publicName: "maxSecondary", 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 }, hiddenSeries: { classPropertyName: "hiddenSeries", publicName: "hiddenSeries", isSignal: true, isRequired: false, transformFunction: null }, rescaleOnHide: { classPropertyName: "rescaleOnHide", publicName: "rescaleOnHide", isSignal: true, isRequired: false, transformFunction: null }, legendFilters: { classPropertyName: "legendFilters", publicName: "legendFilters", isSignal: true, isRequired: false, transformFunction: null }, legendMode: { classPropertyName: "legendMode", publicName: "legendMode", isSignal: true, isRequired: false, transformFunction: null }, noVisibleSeriesText: { classPropertyName: "noVisibleSeriesText", publicName: "noVisibleSeriesText", isSignal: true, isRequired: false, transformFunction: null }, patterns: { classPropertyName: "patterns", publicName: "patterns", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", 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 } }, outputs: { pointClicked: "pointClicked", hiddenSeries: "hiddenSeriesChange" }, host: { properties: { "class.framed": "frameResolved() === 'auto'", "style.--_line-chart-view-height": "viewHeightPx()" } }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["dsChartTooltip"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "plot", first: true, predicate: ChartComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<figure class=\"line-chart\">\n @if (pinnedCategory()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"releaseCategoryPin()\">\n Unpin\n </button>\n }\n\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(--_line-chart-plot-height)\" />\n\n @if (skeletonSeries().length > 1) {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonSeries(); track $index) {\n <ds-skeleton\n width=\"var(--space-16)\"\n height=\"var(--space-3)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else if (noVisibleSeries()) {\n <p\n class=\"empty\"\n role=\"status\">\n {{ noVisibleSeriesText() }}\n </p>\n\n <ds-chart-legend\n [items]=\"legendItems()\"\n [toggleable]=\"legendFilters()\"\n [mode]=\"legendMode()\"\n [(hidden)]=\"hiddenSeries\"\n [(highlighted)]=\"highlightedSeries\" />\n } @else {\n <ds-chart\n frame=\"none\"\n cursor=\"category\"\n [categories]=\"categories()\"\n [tickCount]=\"tickCount()\"\n [valueFormat]=\"axisFormat()\"\n [interactive]=\"interactive()\"\n [summary]=\"accessibleName()\"\n [max]=\"axisMax()\"\n [maxSecondary]=\"axisMaxSecondary()\"\n [secondaryAxisMode]=\"yAxisMode()\"\n [axisLabel]=\"yAxisLabel()\"\n [secondaryAxisLabel]=\"secondaryAxisLabel()\"\n [axisColor]=\"primaryAxisFill()\"\n [secondaryAxisColor]=\"secondaryAxisFill()\"\n [cursorPin]=\"pinOnClick()\"\n [tooltipLingerMs]=\"tooltipLingerMs()\"\n [plotHeight]=\"plotHeight()\">\n <svg:g\n #mark=\"dsLineSeries\"\n dsLineSeries\n [data]=\"markSeries()\"\n [showMarkers]=\"showMarkers()\"\n [interactive]=\"interactive()\"\n [pinOnClick]=\"pinOnClick()\"\n [dimOthers]=\"dimOthers()\"\n [highlighted]=\"highlightedSeries()\"\n [patterns]=\"dashPatterns()\"\n [stacked]=\"stacksSeries()\"\n [staggerMs]=\"staggerMs()\"\n [gaps]=\"gaps()\"\n [curve]=\"curve()\"\n [tooltip]=\"tooltip()\"\n [tooltipAnchor]=\"markAnchor()\"\n [tooltipLingerMs]=\"tooltipLingerResolved()\"\n [valueFormat]=\"valueFormatResolved()\"\n [dsChartTooltip]=\"mark.tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"\n pinnedCategory() || mark.activeMark.pinned()\n \"\n [dsChartTooltipOrigin]=\"mark.tooltipOrigin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\"\n (pointClicked)=\"onPointClicked($event)\" />\n\n <svg:g\n dsSeriesAnnotation\n [annotations]=\"markAnnotations()\" />\n </ds-chart>\n\n @if (showLegend()) {\n <ds-chart-legend\n [items]=\"legendItems()\"\n [toggleable]=\"legendFilters()\"\n [mode]=\"legendMode()\"\n [(hidden)]=\"hiddenSeries\"\n [(highlighted)]=\"highlightedSeries\" />\n }\n\n @if (dataTableResolved() !== 'none') {\n <ds-chart-data-table\n [columns]=\"dataTableColumns()\"\n [rows]=\"dataTableRows()\"\n [caption]=\"caption()\"\n [open]=\"dataTableResolved() === 'visible'\" />\n }\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)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}:host{--_line-chart-plot-height: var(--ds-line-chart-plot-height, 240px)}.line-chart{--_line-chart-grid-line-color: var(--ds-line-chart-grid-line-color, var(--ds-chart-grid-line-color));--_line-chart-axis-line-color: var(--ds-line-chart-axis-line-color, var(--ds-chart-axis-line-color));--_line-chart-axis-label-color: var(--ds-line-chart-axis-label-color, var(--ds-chart-axis-label-color));--_line-chart-axis-font-size: var(--ds-line-chart-axis-font-size, var(--ds-chart-axis-font-size));--_line-chart-annotation-color: var(--ds-line-chart-annotation-color, var(--text-primary));--_line-chart-annotation-font-size: var(--ds-line-chart-annotation-font-size, var(--ds-chart-axis-font-size));--_line-chart-annotation-font-weight: var(--ds-line-chart-annotation-font-weight, var(--font-weight-bold));--_line-chart-annotation-halo-color: var(--ds-line-chart-annotation-halo-color, var(--surface-default));--_line-chart-annotation-halo-width: var(--ds-line-chart-annotation-halo-width, 3px);--_line-chart-line-width: var(--ds-line-chart-line-width, var(--ds-chart-line-width));--_line-chart-dot-radius: var(--ds-line-chart-dot-radius, var(--ds-chart-dot-radius));--_line-chart-dot-radius-active: var(--ds-line-chart-dot-radius-active, var(--ds-chart-dot-radius-active));--_line-chart-hover-bg-color: var(--ds-line-chart-hover-bg-color, var(--ds-chart-hover-bg-color));--_line-chart-cursor-line-color: var(--ds-line-chart-cursor-line-color, var(--ds-chart-cursor-line-color));--_line-chart-line-width-bold: var( --ds-line-chart-line-width-bold, var(--ds-chart-line-width-bold) );--_line-chart-focus-color: var(--ds-line-chart-focus-color, var(--focus-ring-color));--_line-chart-focus-width: var(--ds-line-chart-focus-width, var(--focus-ring-width));--_line-chart-area-opacity: var(--ds-line-chart-area-opacity, .16);--_line-chart-swatch-size: var(--ds-line-chart-swatch-size, 10px);margin:0}.empty{display:grid;place-items:center;min-block-size:var(--_line-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)}ds-chart{--ds-chart-grid-line-color: var(--_line-chart-grid-line-color);--ds-chart-axis-line-color: var(--_line-chart-axis-line-color);--ds-chart-axis-label-color: var(--_line-chart-axis-label-color);--ds-chart-axis-font-size: var(--_line-chart-axis-font-size);--ds-chart-hover-bg-color: var(--_line-chart-hover-bg-color);--ds-chart-cursor-line-color: var(--_line-chart-cursor-line-color);--ds-chart-line-width: var(--_line-chart-line-width);--ds-chart-line-width-bold: var(--_line-chart-line-width-bold);--ds-chart-dot-radius: var(--_line-chart-dot-radius);--ds-chart-dot-radius-active: var(--_line-chart-dot-radius-active);--ds-chart-area-opacity: var(--_line-chart-area-opacity);--ds-chart-annotation-color: var(--_line-chart-annotation-color);--ds-chart-annotation-font-size: var(--_line-chart-annotation-font-size);--ds-chart-annotation-font-weight: var(--_line-chart-annotation-font-weight);--ds-chart-annotation-halo-color: var(--_line-chart-annotation-halo-color);--ds-chart-annotation-halo-width: var(--_line-chart-annotation-halo-width);--ds-chart-focus-ring-color: var(--_line-chart-focus-color);--focus-ring-width: var(--_line-chart-focus-width)}ds-chart-legend{--ds-chart-legend-swatch-size: var(--_line-chart-swatch-size)}.skeleton{display:grid}.skeleton-legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin-block-start:var(--space-3)}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-start:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "component", type: ChartComponent, selector: "ds-chart", inputs: ["categories", "tickCount", "min", "max", "cursor", "cursorPin", "tooltipLingerMs", "maxSecondary", "plotHeight", "axisGutter", "valueSpace", "caption", "interactive", "summary", "frame", "loading", "emptyText", "error", "errorText", "valueFormat", "secondaryAxisMode", "axisColor", "secondaryAxisColor", "axisLabel", "secondaryAxisLabel"], exportAs: ["dsChart"] }, { kind: "component", type: LineSeriesComponent, selector: "g[dsLineSeries]", inputs: ["data", "showMarkers", "interactive", "pinOnClick", "dimOthers", "highlighted", "patterns", "stacked", "staggerMs", "gaps", "curve", "tooltip", "tooltipAnchor", "tooltipLingerMs", "valueFormat"], outputs: ["pointClicked"], exportAs: ["dsLineSeries"] }, { kind: "component", type: SeriesAnnotationComponent, selector: "g[dsSeriesAnnotation]", inputs: ["annotations"] }, { kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate", "dsChartTooltipExtraGap", "dsChartTooltipPreferBelow"] }, { kind: "component", type: ChartLegendComponent, selector: "ds-chart-legend", inputs: ["items", "hidden", "toggleable", "mode", "highlighted"], outputs: ["hiddenChange", "highlightedChange"] }, { kind: "component", type: ChartDataTableComponent, selector: "ds-chart-data-table", inputs: ["columns", "rows", "caption", "open", "rowHeader"], outputs: ["toggled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
752
426
|
}
|
|
753
427
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: LineChartComponent, decorators: [{
|
|
754
428
|
type: Component,
|
|
755
|
-
args: [{ selector: 'ds-line-chart', standalone: true, imports: [
|
|
429
|
+
args: [{ selector: 'ds-line-chart', standalone: true, imports: [
|
|
430
|
+
SkeletonComponent,
|
|
431
|
+
ChartComponent,
|
|
432
|
+
LineSeriesComponent,
|
|
433
|
+
SeriesAnnotationComponent,
|
|
434
|
+
ChartTooltipDirective,
|
|
435
|
+
ChartLegendComponent,
|
|
436
|
+
ChartDataTableComponent,
|
|
437
|
+
], host: {
|
|
756
438
|
'[class.framed]': "frameResolved() === 'auto'",
|
|
757
|
-
'
|
|
758
|
-
'(document:pointerover)': 'onPointerAnywhere($event)',
|
|
759
|
-
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<figure class=\"line-chart\">\n @if (pinnedCategory()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"releaseCategoryPin()\">\n Unpin\n </button>\n }\n\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(--_line-chart-plot-height)\" />\n\n @if (skeletonSeries().length > 1) {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonSeries(); track $index) {\n <ds-skeleton\n width=\"var(--space-16)\"\n height=\"var(--space-3)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else if (noVisibleSeries()) {\n <p\n class=\"empty\"\n role=\"status\">\n {{ noVisibleSeriesText() }}\n </p>\n\n <ds-chart-legend\n [items]=\"legendItems()\"\n [toggleable]=\"legendFilters()\"\n [mode]=\"legendMode()\"\n [(hidden)]=\"hiddenSeries\"\n [(highlighted)]=\"highlightedSeries\" />\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"pinnedCategory()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <svg\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [attr.aria-hidden]=\"interactive() ? null : true\"\n [attr.viewBox]=\"viewBox\"\n (pointermove)=\"onPlotPointer($event)\"\n (pointerdown)=\"onPlotPointer($event)\"\n (pointerleave)=\"clearActiveCategory()\">\n @if (activeCategory() >= 0) {\n <g\n class=\"cursor\"\n animate.enter=\"cursor-in\"\n animate.leave=\"cursor-out\"\n [style.transform]=\"'translateX(' + activeBandX() + 'px)'\">\n <rect\n class=\"category-band\"\n aria-hidden=\"true\"\n x=\"0\"\n [attr.y]=\"primaryTopY()\"\n [attr.width]=\"activeBandWidth()\"\n [attr.height]=\"cursorBottomY() - primaryTopY()\" />\n\n <line\n class=\"cursor-line\"\n aria-hidden=\"true\"\n [attr.x1]=\"activeBandWidth() / 2\"\n [attr.x2]=\"activeBandWidth() / 2\"\n [attr.y1]=\"primaryTopY()\"\n [attr.y2]=\"cursorBottomY()\" />\n </g>\n }\n\n @for (tick of primaryTicks(); track $index) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track $index) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\"\n [class.secondary]=\"!stacked()\" />\n }\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"primaryBaselineY()\"\n [attr.y2]=\"primaryBaselineY()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotLeft()\"\n [attr.y1]=\"primaryTopY()\"\n [attr.y2]=\"primaryBaselineY()\" />\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryBaselineY()\"\n [attr.y2]=\"secondaryBaselineY()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plotLeft()\"\n [attr.x2]=\"plotLeft()\"\n [attr.y1]=\"secondaryTopY()\"\n [attr.y2]=\"secondaryBaselineY()\" />\n }\n\n @for (\n entry of plottedSeries();\n track entry.series.id;\n let seriesIndex = $index\n ) {\n @for (path of entry.areaPaths; track $index) {\n <path\n class=\"series-area\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(seriesIndex)\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.d]=\"path\"\n [attr.fill]=\"entry.color\" />\n }\n }\n\n @for (\n entry of plottedSeries();\n track entry.series.id;\n let seriesIndex = $index\n ) {\n @for (points of entry.polylines; track $index) {\n <polyline\n class=\"series-line\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [attr.stroke-dasharray]=\"entry.dash\"\n [style.--_chart-mark-stagger]=\"markStagger(seriesIndex)\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.points]=\"points\"\n [attr.stroke]=\"entry.color\" />\n }\n }\n\n @if (showMarkers() || interactive()) {\n @for (\n entry of plottedSeries();\n track entry.series.id;\n let seriesIndex = $index\n ) {\n @for (marker of entry.markers; track marker.categoryIndex) {\n <circle\n class=\"series-marker\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [class.ghost]=\"!showMarkers()\"\n [class.interactive]=\"interactive()\"\n [class.is-active]=\"marker.categoryIndex === activeCategory()\"\n [attr.cx]=\"marker.x\"\n [attr.cy]=\"marker.y\"\n [attr.fill]=\"entry.color\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.data-series-index]=\"seriesIndex\"\n [attr.data-mark-index]=\"marker.categoryIndex\"\n [attr.tabindex]=\"\n interactive()\n ? isTabStop(entry.series.id, marker.categoryIndex)\n ? 0\n : -1\n : null\n \"\n [attr.aria-label]=\"\n interactive() ? markerLabel(entry, marker) : null\n \"\n (focus)=\"\n onMarkerFocus(seriesIndex, marker.categoryIndex, $event)\n \"\n (blur)=\"onMarkerBlur()\"\n (keydown)=\"\n onMarkerNavigation($event, seriesIndex, marker.categoryIndex)\n \"\n (click)=\"onMarkerClick(entry, marker)\"\n (keydown.enter)=\"onMarkerKey(entry, marker, $event)\"\n (keydown.space)=\"onMarkerKey(entry, marker, $event)\" />\n }\n }\n }\n\n @for (note of placedAnnotations(); track note.key) {\n <text\n class=\"annotation\"\n aria-hidden=\"true\"\n [attr.x]=\"note.x\"\n [attr.y]=\"note.y\"\n [attr.text-anchor]=\"note.anchor\">\n {{ note.label }}\n </text>\n }\n\n @for (tick of primaryTicks(); track $index) {\n <text\n class=\"axis-label\"\n text-anchor=\"end\"\n [attr.x]=\"primaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track $index) {\n <text\n class=\"axis-label\"\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 $index) {\n <text\n class=\"category-label\"\n text-anchor=\"middle\"\n [attr.x]=\"label.x\"\n [attr.y]=\"categoryLabelY()\">\n {{ label.text }}\n </text>\n }\n </svg>\n </div>\n\n @if (showLegend()) {\n <ds-chart-legend\n [items]=\"legendItems()\"\n [toggleable]=\"legendFilters()\"\n [mode]=\"legendMode()\"\n [(hidden)]=\"hiddenSeries\"\n [(highlighted)]=\"highlightedSeries\" />\n }\n\n @if (dataTableResolved() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Category\n </th>\n\n @for (entry of resolvedSeries(); track entry.series.id) {\n <th scope=\"col\">\n {{ entry.series.label }}\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (row of tableRows(); track $index) {\n <tr>\n <th scope=\"row\">\n {{ row.category }}\n </th>\n\n @for (cell of row.cells; track $index) {\n <td>\n {{ cell }}\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\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)}}@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.mark-enter{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)) both}.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.mark-enter{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)) both}.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.mark-enter{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)) both}.series-marker.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}: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,figcaption{-webkit-user-select:text;user-select:text}@media not (forced-colors:active){.series-marker:focus{outline:none}}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.line-chart{--_line-chart-grid-line-color: var(--ds-line-chart-grid-line-color, var(--ds-chart-grid-line-color));--_line-chart-axis-line-color: var(--ds-line-chart-axis-line-color, var(--ds-chart-axis-line-color));--_line-chart-axis-label-color: var(--ds-line-chart-axis-label-color, var(--ds-chart-axis-label-color));--_line-chart-axis-font-size: var(--ds-line-chart-axis-font-size, var(--ds-chart-axis-font-size));--_line-chart-annotation-color: var(--ds-line-chart-annotation-color, var(--text-primary));--_line-chart-annotation-font-size: var(--ds-line-chart-annotation-font-size, var(--ds-chart-axis-font-size));--_line-chart-annotation-weight: var(--ds-line-chart-annotation-weight, var(--font-weight-bold));--_line-chart-annotation-halo-color: var(--ds-line-chart-annotation-halo-color, var(--surface-default));--_line-chart-annotation-halo-width: var(--ds-line-chart-annotation-halo-width, 3px);--_line-chart-line-width: var(--ds-line-chart-line-width, var(--ds-chart-line-width));--_line-chart-dot-radius: var(--ds-line-chart-dot-radius, var(--ds-chart-dot-radius));--_line-chart-dot-radius-active: var(--ds-line-chart-dot-radius-active, var(--ds-chart-dot-radius-active));--_line-chart-hover-bg-color: var(--ds-line-chart-hover-bg-color, var(--ds-chart-hover-bg-color));--_line-chart-cursor-line-color: var(--ds-line-chart-cursor-line-color, var(--ds-chart-cursor-line-color));--_line-chart-line-width-bold: var( --ds-line-chart-line-width-bold, var(--ds-chart-line-width-bold) );--_line-chart-focus-color: var(--ds-line-chart-focus-color, var(--focus-ring-color));--_line-chart-focus-width: var(--ds-line-chart-focus-width, var(--focus-ring-width));--_line-chart-area-opacity: var(--ds-line-chart-area-opacity, .16);--_line-chart-plot-height: var(--ds-line-chart-plot-height, 240px);--_line-chart-swatch-size: var(--ds-line-chart-swatch-size, 10px);margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{display:grid;place-items:center;min-block-size:var(--_line-chart-plot-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)}.empty{aspect-ratio:640/320;inline-size:100%}.canvas{display:block;inline-size:100%;block-size:auto}.grid-line{stroke:var(--_line-chart-grid-line-color);stroke-width:1}.grid-line.secondary{stroke-dasharray:4 4}.axis-line{stroke:var(--_line-chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_line-chart-axis-label-color);font-size:var(--_line-chart-axis-font-size)}.annotation{fill:var(--_line-chart-annotation-color);font-size:var(--_line-chart-annotation-font-size);font-weight:var(--_line-chart-annotation-weight);paint-order:stroke;stroke:var(--_line-chart-annotation-halo-color);stroke-width:var(--_line-chart-annotation-halo-width);stroke-linejoin:round}.axis-label{dominant-baseline:middle}.series-area{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)}.series-area.is-dimmed{opacity:var(--ds-chart-dim-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),stroke-width var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-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-area{fill-opacity:var(--_line-chart-area-opacity);stroke:none}.series-line{fill:none;stroke-width:var(--_line-chart-line-width);stroke-linecap:round;stroke-linejoin:round}.plot:has(.series-line.is-dimmed) .series-line:not(.is-dimmed){stroke-width:var(--_line-chart-line-width-bold)}.series-marker{r:var(--_line-chart-dot-radius)}.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(--_line-chart-hover-bg-color)}.cursor-line{stroke:var(--_line-chart-cursor-line-color);stroke-width:1}.series-marker.is-active{r:var(--_line-chart-dot-radius-active)}.series-marker.ghost.is-active{fill-opacity:1}.series-marker.interactive{cursor:pointer;stroke:transparent;stroke-width:24px;vector-effect:non-scaling-stroke}@media(hover:none)and (pointer:coarse){.series-marker.interactive{stroke-width:44px}}.series-marker.ghost{fill-opacity:0}.series-marker.ghost:hover,.series-marker.ghost:focus-visible{fill-opacity:1}@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(--_line-chart-dot-radius-active)}.legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin:var(--space-3) 0 0;padding:0;list-style:none}.legend-item{display:inline-flex;gap:var(--space-2);align-items:center;color:var(--text-secondary);font-size:var(--font-size-xs)}.legend-swatch{flex:none;inline-size:var(--_line-chart-swatch-size);block-size:var(--_line-chart-swatch-size);border-radius:var(--radius-pill)}.skeleton{display:grid}.skeleton-legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin-block-start:var(--space-3)}.empty.is-error{color:var(--error)}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-start:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}\n"] }]
|
|
760
|
-
}], propDecorators: { categories: [{ type: i0.Input, args: [{ isSignal: true, alias: "categories", required: true }] }], series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: true }] }], yAxisMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAxisMode", required: false }] }], showMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkers", required: false }] }], annotations: [{ type: i0.Input, args: [{ isSignal: true, alias: "annotations", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], pointClicked: [{ type: i0.Output, args: ["pointClicked"] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], gaps: [{ type: i0.Input, args: [{ isSignal: true, alias: "gaps", required: false }] }], tickCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "tickCount", required: false }] }], frame: [{ type: i0.Input, args: [{ isSignal: true, alias: "frame", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], dataTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTable", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], maxSecondary: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSecondary", 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 }] }], hiddenSeries: [{ type: i0.Input, args: [{ isSignal: true, alias: "hiddenSeries", required: false }] }, { type: i0.Output, args: ["hiddenSeriesChange"] }], rescaleOnHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "rescaleOnHide", required: false }] }], legendFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendFilters", required: false }] }], legendMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendMode", required: false }] }], noVisibleSeriesText: [{ type: i0.Input, args: [{ isSignal: true, alias: "noVisibleSeriesText", required: false }] }], patterns: [{ type: i0.Input, args: [{ isSignal: true, alias: "patterns", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipTemplate: [{ type: i0.ContentChild, args: ['dsChartTooltip', { isSignal: true }] }], tooltipAnchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipAnchor", required: false }] }] } });
|
|
439
|
+
'[style.--_line-chart-view-height]': 'viewHeightPx()',
|
|
440
|
+
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<figure class=\"line-chart\">\n @if (pinnedCategory()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"releaseCategoryPin()\">\n Unpin\n </button>\n }\n\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(--_line-chart-plot-height)\" />\n\n @if (skeletonSeries().length > 1) {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonSeries(); track $index) {\n <ds-skeleton\n width=\"var(--space-16)\"\n height=\"var(--space-3)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else if (noVisibleSeries()) {\n <p\n class=\"empty\"\n role=\"status\">\n {{ noVisibleSeriesText() }}\n </p>\n\n <ds-chart-legend\n [items]=\"legendItems()\"\n [toggleable]=\"legendFilters()\"\n [mode]=\"legendMode()\"\n [(hidden)]=\"hiddenSeries\"\n [(highlighted)]=\"highlightedSeries\" />\n } @else {\n <ds-chart\n frame=\"none\"\n cursor=\"category\"\n [categories]=\"categories()\"\n [tickCount]=\"tickCount()\"\n [valueFormat]=\"axisFormat()\"\n [interactive]=\"interactive()\"\n [summary]=\"accessibleName()\"\n [max]=\"axisMax()\"\n [maxSecondary]=\"axisMaxSecondary()\"\n [secondaryAxisMode]=\"yAxisMode()\"\n [axisLabel]=\"yAxisLabel()\"\n [secondaryAxisLabel]=\"secondaryAxisLabel()\"\n [axisColor]=\"primaryAxisFill()\"\n [secondaryAxisColor]=\"secondaryAxisFill()\"\n [cursorPin]=\"pinOnClick()\"\n [tooltipLingerMs]=\"tooltipLingerMs()\"\n [plotHeight]=\"plotHeight()\">\n <svg:g\n #mark=\"dsLineSeries\"\n dsLineSeries\n [data]=\"markSeries()\"\n [showMarkers]=\"showMarkers()\"\n [interactive]=\"interactive()\"\n [pinOnClick]=\"pinOnClick()\"\n [dimOthers]=\"dimOthers()\"\n [highlighted]=\"highlightedSeries()\"\n [patterns]=\"dashPatterns()\"\n [stacked]=\"stacksSeries()\"\n [staggerMs]=\"staggerMs()\"\n [gaps]=\"gaps()\"\n [curve]=\"curve()\"\n [tooltip]=\"tooltip()\"\n [tooltipAnchor]=\"markAnchor()\"\n [tooltipLingerMs]=\"tooltipLingerResolved()\"\n [valueFormat]=\"valueFormatResolved()\"\n [dsChartTooltip]=\"mark.tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"\n pinnedCategory() || mark.activeMark.pinned()\n \"\n [dsChartTooltipOrigin]=\"mark.tooltipOrigin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\"\n (pointClicked)=\"onPointClicked($event)\" />\n\n <svg:g\n dsSeriesAnnotation\n [annotations]=\"markAnnotations()\" />\n </ds-chart>\n\n @if (showLegend()) {\n <ds-chart-legend\n [items]=\"legendItems()\"\n [toggleable]=\"legendFilters()\"\n [mode]=\"legendMode()\"\n [(hidden)]=\"hiddenSeries\"\n [(highlighted)]=\"highlightedSeries\" />\n }\n\n @if (dataTableResolved() !== 'none') {\n <ds-chart-data-table\n [columns]=\"dataTableColumns()\"\n [rows]=\"dataTableRows()\"\n [caption]=\"caption()\"\n [open]=\"dataTableResolved() === 'visible'\" />\n }\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)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}:host{--_line-chart-plot-height: var(--ds-line-chart-plot-height, 240px)}.line-chart{--_line-chart-grid-line-color: var(--ds-line-chart-grid-line-color, var(--ds-chart-grid-line-color));--_line-chart-axis-line-color: var(--ds-line-chart-axis-line-color, var(--ds-chart-axis-line-color));--_line-chart-axis-label-color: var(--ds-line-chart-axis-label-color, var(--ds-chart-axis-label-color));--_line-chart-axis-font-size: var(--ds-line-chart-axis-font-size, var(--ds-chart-axis-font-size));--_line-chart-annotation-color: var(--ds-line-chart-annotation-color, var(--text-primary));--_line-chart-annotation-font-size: var(--ds-line-chart-annotation-font-size, var(--ds-chart-axis-font-size));--_line-chart-annotation-font-weight: var(--ds-line-chart-annotation-font-weight, var(--font-weight-bold));--_line-chart-annotation-halo-color: var(--ds-line-chart-annotation-halo-color, var(--surface-default));--_line-chart-annotation-halo-width: var(--ds-line-chart-annotation-halo-width, 3px);--_line-chart-line-width: var(--ds-line-chart-line-width, var(--ds-chart-line-width));--_line-chart-dot-radius: var(--ds-line-chart-dot-radius, var(--ds-chart-dot-radius));--_line-chart-dot-radius-active: var(--ds-line-chart-dot-radius-active, var(--ds-chart-dot-radius-active));--_line-chart-hover-bg-color: var(--ds-line-chart-hover-bg-color, var(--ds-chart-hover-bg-color));--_line-chart-cursor-line-color: var(--ds-line-chart-cursor-line-color, var(--ds-chart-cursor-line-color));--_line-chart-line-width-bold: var( --ds-line-chart-line-width-bold, var(--ds-chart-line-width-bold) );--_line-chart-focus-color: var(--ds-line-chart-focus-color, var(--focus-ring-color));--_line-chart-focus-width: var(--ds-line-chart-focus-width, var(--focus-ring-width));--_line-chart-area-opacity: var(--ds-line-chart-area-opacity, .16);--_line-chart-swatch-size: var(--ds-line-chart-swatch-size, 10px);margin:0}.empty{display:grid;place-items:center;min-block-size:var(--_line-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)}ds-chart{--ds-chart-grid-line-color: var(--_line-chart-grid-line-color);--ds-chart-axis-line-color: var(--_line-chart-axis-line-color);--ds-chart-axis-label-color: var(--_line-chart-axis-label-color);--ds-chart-axis-font-size: var(--_line-chart-axis-font-size);--ds-chart-hover-bg-color: var(--_line-chart-hover-bg-color);--ds-chart-cursor-line-color: var(--_line-chart-cursor-line-color);--ds-chart-line-width: var(--_line-chart-line-width);--ds-chart-line-width-bold: var(--_line-chart-line-width-bold);--ds-chart-dot-radius: var(--_line-chart-dot-radius);--ds-chart-dot-radius-active: var(--_line-chart-dot-radius-active);--ds-chart-area-opacity: var(--_line-chart-area-opacity);--ds-chart-annotation-color: var(--_line-chart-annotation-color);--ds-chart-annotation-font-size: var(--_line-chart-annotation-font-size);--ds-chart-annotation-font-weight: var(--_line-chart-annotation-font-weight);--ds-chart-annotation-halo-color: var(--_line-chart-annotation-halo-color);--ds-chart-annotation-halo-width: var(--_line-chart-annotation-halo-width);--ds-chart-focus-ring-color: var(--_line-chart-focus-color);--focus-ring-width: var(--_line-chart-focus-width)}ds-chart-legend{--ds-chart-legend-swatch-size: var(--_line-chart-swatch-size)}.skeleton{display:grid}.skeleton-legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin-block-start:var(--space-3)}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-start:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}\n"] }]
|
|
441
|
+
}], ctorParameters: () => [], propDecorators: { categories: [{ type: i0.Input, args: [{ isSignal: true, alias: "categories", required: true }] }], series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: true }] }], yAxisMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAxisMode", required: false }] }], showMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkers", required: false }] }], annotations: [{ type: i0.Input, args: [{ isSignal: true, alias: "annotations", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], pointClicked: [{ type: i0.Output, args: ["pointClicked"] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], gaps: [{ type: i0.Input, args: [{ isSignal: true, alias: "gaps", required: false }] }], curve: [{ type: i0.Input, args: [{ isSignal: true, alias: "curve", required: false }] }], stack: [{ type: i0.Input, args: [{ isSignal: true, alias: "stack", required: false }] }], yAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAxisLabel", required: false }] }], secondaryAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisLabel", required: false }] }], tickCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "tickCount", required: false }] }], frame: [{ type: i0.Input, args: [{ isSignal: true, alias: "frame", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], dataTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTable", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], maxSecondary: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSecondary", 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 }] }], hiddenSeries: [{ type: i0.Input, args: [{ isSignal: true, alias: "hiddenSeries", required: false }] }, { type: i0.Output, args: ["hiddenSeriesChange"] }], rescaleOnHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "rescaleOnHide", required: false }] }], legendFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendFilters", required: false }] }], legendMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendMode", required: false }] }], noVisibleSeriesText: [{ type: i0.Input, args: [{ isSignal: true, alias: "noVisibleSeriesText", required: false }] }], patterns: [{ type: i0.Input, args: [{ isSignal: true, alias: "patterns", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipTemplate: [{ type: i0.ContentChild, args: ['dsChartTooltip', { isSignal: true }] }], tooltipAnchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipAnchor", required: false }] }], plot: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ChartComponent), { isSignal: true }] }] } });
|
|
761
442
|
|
|
762
443
|
/**
|
|
763
444
|
* Generated bundle index. Do not edit.
|