@ids-group-ltd/ids-design-system 0.13.3 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1104 -14
- package/components.md +567 -34
- 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 +10 -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 +5 -1
- 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 +7 -1
- package/docs/agent/forms/ds-textarea.md +6 -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/platform/ds-config.md +2 -1
- 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 +12 -4
- 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 +140 -43
- 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 +42 -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 +39 -14
- 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 +727 -93
- 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 +29 -12
- 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 +25 -24
- 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 +183 -501
- 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 +44 -8
- 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 +22 -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 +382 -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 +322 -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 +6 -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-skeleton.mjs +23 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +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-switch.mjs +20 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +6 -6
- 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 +36 -28
- 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 +23 -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 +361 -17
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +2 -3
- 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 +5 -2
- 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.3.json +32 -10
- package/migrations/0.13.4.json +2492 -0
- package/migrations/0.14.0.json +591 -0
- package/migrations/0.5.0.json +11 -5
- package/migrations/0.7.0.json +5 -2
- package/migrations/0.8.0.json +4 -3
- package/migrations/0.9.0.json +6 -3
- package/migrations/README.md +7 -2
- package/package.json +41 -9
- package/styles/_chart-frame.scss +19 -6
- package/styles/_chart-motion.scss +17 -10
- 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 +15 -7
- package/styles/_skeleton-shimmer.scss +4 -1
- package/styles/_table-controls.scss +3 -3
- package/styles/_tokens-charts.scss +40 -7
- package/styles/_tokens.scss +3 -3
- 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 +40 -9
- 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 +34 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +15 -3
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +345 -60
- 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 +8 -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 +8 -7
- 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 +88 -139
- package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +4 -0
- 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 +18 -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} +25 -23
- 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 +189 -0
- package/types/ids-group-ltd-ids-design-system-components-search.d.ts +2 -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-skeleton.d.ts +1 -0
- package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +10 -1
- package/types/ids-group-ltd-ids-design-system-components-table-export.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +44 -33
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +13 -0
- 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 +142 -6
- package/types/ids-group-ltd-ids-design-system-core.d.ts +42 -10
- 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,13 +1,16 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, input, numberAttribute, booleanAttribute, inject, ElementRef, computed, signal, effect, afterRenderEffect, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component, output } from '@angular/core';
|
|
3
|
-
import { domainMinOf, niceDomain, linearScale, tickValues, roundStepAtLeast,
|
|
2
|
+
import { InjectionToken, input, numberAttribute, booleanAttribute, inject, ElementRef, NgZone, PLATFORM_ID, computed, signal, effect, afterRenderEffect, viewChild, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component, output, viewChildren } from '@angular/core';
|
|
3
|
+
import { domainMinOf, niceDomain, linearScale, tickValues, roundStepAtLeast, resolveChartDefaults, elementWidth, bandScale, rotationWouldFit, labelInterval, leaveMark, defaultChartFormat, CHART_SERIES_COLORS, staggerDelay, markOf, rovingMarks, describeShare, lineSegments, linePath, areaPath, bandPath, nextRovingIndex, focusMark } from '@ids-group-ltd/ids-design-system/components';
|
|
4
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
4
5
|
import { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';
|
|
5
|
-
import {
|
|
6
|
+
import { chartActiveMark, ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
|
|
6
7
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
7
|
-
import {
|
|
8
|
+
import { ICONS } from '@ids-group-ltd/ids-design-system/core';
|
|
8
9
|
|
|
9
10
|
const CHART_DEFAULT_TICK_COUNT = 5;
|
|
10
11
|
const CHART_AXIS_LABEL_GAP = 8;
|
|
12
|
+
/** Room a rotated axis title needs across the gutter: its line box, turned on its side. */
|
|
13
|
+
const CHART_AXIS_TITLE_BAND = 20;
|
|
11
14
|
const CHART_CATEGORY_LABEL_OFFSET = 18;
|
|
12
15
|
const CHART_BAND_PADDING = 0.3;
|
|
13
16
|
/** What the chart lays out at while it measures zero: under SSR, while the host is
|
|
@@ -156,16 +159,16 @@ function zeroRow(ticks) {
|
|
|
156
159
|
}
|
|
157
160
|
/** The second value axis, as the four modes define it.
|
|
158
161
|
*
|
|
159
|
-
* `'
|
|
160
|
-
* step: `'
|
|
161
|
-
* step the data needs and lands on it. `'
|
|
162
|
+
* `'aligned'` and `'exact'` hang the second scale on the first's tick rows and differ only in the
|
|
163
|
+
* step: `'aligned'` snaps it up to a round number and overshoots the data, `'exact'` takes the
|
|
164
|
+
* step the data needs and lands on it. `'dual-grid'` and `'split'` nice the second domain on
|
|
162
165
|
* its own - stacked plots sit one above the other, so there is nothing to align.
|
|
163
166
|
*
|
|
164
167
|
* Falls back to an independent scale wherever alignment is not available: fewer than two rows, no
|
|
165
168
|
* shared zero row, or a domain whose sign has no rows on its side of that zero.
|
|
166
169
|
*
|
|
167
170
|
* @internal */
|
|
168
|
-
function secondaryAxis(primaryTicks, reported, tickCount, mode) {
|
|
171
|
+
function secondaryAxis(primaryTicks, reported, tickCount, mode, pinnedMax = null) {
|
|
169
172
|
let minimum = 0;
|
|
170
173
|
let maximum = 0;
|
|
171
174
|
for (const values of reported) {
|
|
@@ -173,12 +176,15 @@ function secondaryAxis(primaryTicks, reported, tickCount, mode) {
|
|
|
173
176
|
minimum = Math.min(minimum, domainMinOf(finite));
|
|
174
177
|
maximum = finite.reduce((highest, value) => Math.max(highest, value), maximum);
|
|
175
178
|
}
|
|
179
|
+
if (pinnedMax !== null && Number.isFinite(pinnedMax)) {
|
|
180
|
+
maximum = pinnedMax;
|
|
181
|
+
}
|
|
176
182
|
const independent = () => ({
|
|
177
183
|
domain: niceDomain(minimum, maximum, tickCount),
|
|
178
184
|
ticks: tickValues(minimum, maximum, tickCount),
|
|
179
185
|
aligned: false,
|
|
180
186
|
});
|
|
181
|
-
if (mode !== '
|
|
187
|
+
if (mode !== 'aligned' && mode !== 'exact') {
|
|
182
188
|
return independent();
|
|
183
189
|
}
|
|
184
190
|
const zero = zeroRow(primaryTicks);
|
|
@@ -191,7 +197,7 @@ function secondaryAxis(primaryTicks, reported, tickCount, mode) {
|
|
|
191
197
|
return independent();
|
|
192
198
|
}
|
|
193
199
|
const needed = Math.max(rowsAbove > 0 ? maximum / rowsAbove : 0, rowsBelow > 0 ? -minimum / rowsBelow : 0);
|
|
194
|
-
const step = mode === '
|
|
200
|
+
const step = mode === 'aligned' ? roundStepAtLeast(needed) : needed;
|
|
195
201
|
if (!Number.isFinite(step) || step <= 0) {
|
|
196
202
|
return {
|
|
197
203
|
domain: { min: 0, max: 0 },
|
|
@@ -219,8 +225,7 @@ function roundTick(value) {
|
|
|
219
225
|
*
|
|
220
226
|
* `'normalized'` divides a running SUM rather than each share in turn: adding 20/60 to 40/60
|
|
221
227
|
* lands on 0.9999999999999999, which draws a category that visibly falls short of full.
|
|
222
|
-
|
|
223
|
-
* @internal */
|
|
228
|
+
*/
|
|
224
229
|
function stackOffsets(series, mode) {
|
|
225
230
|
const reading = (value) => Number.isFinite(value) ? value : 0;
|
|
226
231
|
if (mode === 'none' || mode === 'grouped') {
|
|
@@ -249,6 +254,51 @@ function stackOffsets(series, mode) {
|
|
|
249
254
|
: { from: 0, to: 0 };
|
|
250
255
|
}));
|
|
251
256
|
}
|
|
257
|
+
/** View units between a reading and the label above it, and the margin inside which a label
|
|
258
|
+
* anchors to its own edge instead of centring.
|
|
259
|
+
*
|
|
260
|
+
* @internal */
|
|
261
|
+
const ANNOTATION_GAP = 12;
|
|
262
|
+
/** @internal */
|
|
263
|
+
const ANNOTATION_EDGE_GUARD = 48;
|
|
264
|
+
/** Places a label against each reading it names.
|
|
265
|
+
*
|
|
266
|
+
* @internal */
|
|
267
|
+
function annotationMarks(readings, plotWidth) {
|
|
268
|
+
return readings.map((reading) => ({
|
|
269
|
+
key: reading.key,
|
|
270
|
+
label: reading.label,
|
|
271
|
+
x: reading.x,
|
|
272
|
+
// Above the reading, and below it where there is no room - a peak sits at the top of the
|
|
273
|
+
// plot, which is exactly where a label clamped upward lands on its own marker.
|
|
274
|
+
y: reading.y - ANNOTATION_GAP >= ANNOTATION_GAP
|
|
275
|
+
? reading.y - ANNOTATION_GAP
|
|
276
|
+
: reading.y + ANNOTATION_GAP,
|
|
277
|
+
// Anchored away from the plot edges: a centred label at the first or last category hangs
|
|
278
|
+
// half outside the viewBox and is clipped rather than merely tight.
|
|
279
|
+
anchor: reading.x < ANNOTATION_EDGE_GUARD
|
|
280
|
+
? 'start'
|
|
281
|
+
: reading.x > plotWidth - ANNOTATION_EDGE_GUARD
|
|
282
|
+
? 'end'
|
|
283
|
+
: 'middle',
|
|
284
|
+
}));
|
|
285
|
+
}
|
|
286
|
+
/** Which category a pointer at `x` is over, or `-1` outside the plot. Bands are equal and abut,
|
|
287
|
+
* so the reading is a division rather than a search - and the half band at each end belongs to
|
|
288
|
+
* the first and last category, which is where a reader aiming at the edge means to be.
|
|
289
|
+
*
|
|
290
|
+
* @internal */
|
|
291
|
+
function categoryAt(x, plotLeft, plotWidth, categoryCount) {
|
|
292
|
+
if (categoryCount <= 0 || plotWidth <= 0 || !Number.isFinite(x)) {
|
|
293
|
+
return -1;
|
|
294
|
+
}
|
|
295
|
+
const offset = x - plotLeft;
|
|
296
|
+
if (offset < 0 || offset > plotWidth) {
|
|
297
|
+
return -1;
|
|
298
|
+
}
|
|
299
|
+
const band = plotWidth / categoryCount;
|
|
300
|
+
return Math.min(categoryCount - 1, Math.floor(offset / band));
|
|
301
|
+
}
|
|
252
302
|
|
|
253
303
|
const CHART_SCALES = new InjectionToken('CHART_SCALES');
|
|
254
304
|
|
|
@@ -265,6 +315,21 @@ class ChartComponent {
|
|
|
265
315
|
/** Pins the ceiling of the value axis. See `min`. Two charts drawn one subject at a time are
|
|
266
316
|
* only comparable when both are pinned. */
|
|
267
317
|
max = input(null, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
|
|
318
|
+
/** Draws a band and a crosshair down the category under the pointer, and reports that category
|
|
319
|
+
* to every mark through `activeIndex`. `'none'`, the default, leaves the plot alone: a chart
|
|
320
|
+
* whose marks are the hover targets already answers per mark, and two affordances on one plot
|
|
321
|
+
* read as two different questions. */
|
|
322
|
+
cursor = input('none', ...(ngDevMode ? [{ debugName: "cursor" }] : /* istanbul ignore next */ []));
|
|
323
|
+
/** Whether a press holds the category cursor where it is, so the reader can look away from the
|
|
324
|
+
* plot with the comparison still on screen. Released by pressing it again, by Escape, or by a
|
|
325
|
+
* press outside the plot. */
|
|
326
|
+
cursorPin = input(false, { ...(ngDevMode ? { debugName: "cursorPin" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
327
|
+
/** Milliseconds the cursor survives the pointer leaving the plot. The tooltip panel is portaled
|
|
328
|
+
* out of the plot, so without a grace period it closes before the pointer can reach it. */
|
|
329
|
+
tooltipLingerMs = input(null, { ...(ngDevMode ? { debugName: "tooltipLingerMs" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
|
|
330
|
+
/** Pins the ceiling of the SECOND value axis, the way `max` pins the first. Two plots read
|
|
331
|
+
* against each other need both pinned, or the second rescales under them. */
|
|
332
|
+
maxSecondary = input(null, { ...(ngDevMode ? { debugName: "maxSecondary" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
|
|
268
333
|
/** Height of the plot itself, in CSS pixels, axis labels and value headroom excluded. Real
|
|
269
334
|
* pixels rather than a share of the width: one viewBox unit is one pixel, so a card that
|
|
270
335
|
* widens spreads the categories further apart and leaves the plot exactly this tall. */
|
|
@@ -310,7 +375,7 @@ class ChartComponent {
|
|
|
310
375
|
valueFormat = input(null, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
|
|
311
376
|
/** How the second value axis relates to the first, once a mark has reported against it. The
|
|
312
377
|
* same four words `ds-line-chart` takes. */
|
|
313
|
-
secondaryAxisMode = input('
|
|
378
|
+
secondaryAxisMode = input('aligned', ...(ngDevMode ? [{ debugName: "secondaryAxisMode" }] : /* istanbul ignore next */ []));
|
|
314
379
|
/** Paints the first axis's tick labels in the colour of the marks measured against it. A
|
|
315
380
|
* two-scale plot is ambiguous without it - nothing on the canvas says which of two lines is
|
|
316
381
|
* read against which set of numbers - and it is the author, not the container, who knows which
|
|
@@ -318,15 +383,26 @@ class ChartComponent {
|
|
|
318
383
|
axisColor = input(null, ...(ngDevMode ? [{ debugName: "axisColor" }] : /* istanbul ignore next */ []));
|
|
319
384
|
/** `axisColor` for the second axis. */
|
|
320
385
|
secondaryAxisColor = input(null, ...(ngDevMode ? [{ debugName: "secondaryAxisColor" }] : /* istanbul ignore next */ []));
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
386
|
+
/** Names the first axis's unit beside it. On a two-scale plot the colour says which line reads
|
|
387
|
+
* which axis and this says what the numbers ARE - a reader who has neither is left comparing
|
|
388
|
+
* two quantities that may not be comparable at all. */
|
|
389
|
+
axisLabel = input(null, ...(ngDevMode ? [{ debugName: "axisLabel" }] : /* istanbul ignore next */ []));
|
|
390
|
+
/** `axisLabel` for the second axis. */
|
|
391
|
+
secondaryAxisLabel = input(null, ...(ngDevMode ? [{ debugName: "secondaryAxisLabel" }] : /* istanbul ignore next */ []));
|
|
392
|
+
defaults = resolveChartDefaults(this);
|
|
393
|
+
frameResolved = this.defaults.frame;
|
|
394
|
+
emptyTextResolved = this.defaults.emptyText;
|
|
395
|
+
errorTextResolved = this.defaults.errorText;
|
|
396
|
+
valueFormatResolved = this.defaults.valueFormat;
|
|
325
397
|
host = inject(ElementRef);
|
|
398
|
+
zone = inject(NgZone);
|
|
399
|
+
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
326
400
|
/** The `<svg>`'s own rendered width: `:host(.framed)` carries the frame padding, so the host's
|
|
327
401
|
* CONTENT box - which is what a `ResizeObserver` reports - is the box the canvas fills at
|
|
328
402
|
* `inline-size: 100%`. Measuring the host is therefore measuring the canvas. */
|
|
329
403
|
measuredWidth = elementWidth(this.host);
|
|
404
|
+
/** Server-rendered output has no width to wait for, so it draws at the stand-in. */
|
|
405
|
+
measured = computed(() => !this.isBrowser || this.measuredWidth() > 0, ...(ngDevMode ? [{ debugName: "measured" }] : /* istanbul ignore next */ []));
|
|
330
406
|
viewWidth = computed(() => this.measuredWidth() || CHART_FALLBACK_WIDTH, ...(ngDevMode ? [{ debugName: "viewWidth" }] : /* istanbul ignore next */ []));
|
|
331
407
|
/** Whether the marks may animate yet. The first frame draws at `CHART_FALLBACK_WIDTH` scaled to
|
|
332
408
|
* fit, so the measurement that follows moves every mark - and a mark that transitions its
|
|
@@ -344,21 +420,35 @@ class ChartComponent {
|
|
|
344
420
|
if (this.settled() || this.measuredWidth() === 0) {
|
|
345
421
|
return;
|
|
346
422
|
}
|
|
423
|
+
let first = 0;
|
|
347
424
|
let second = 0;
|
|
348
|
-
|
|
349
|
-
|
|
425
|
+
// Outside the zone: under zone.js each frame callback is a full application tick, two per
|
|
426
|
+
// chart, and the signal write schedules the one render this needs by itself.
|
|
427
|
+
this.zone.runOutsideAngular(() => {
|
|
428
|
+
first = requestAnimationFrame(() => {
|
|
429
|
+
second = requestAnimationFrame(() => this.settled.set(true));
|
|
430
|
+
});
|
|
350
431
|
});
|
|
351
432
|
onCleanup(() => {
|
|
352
433
|
cancelAnimationFrame(first);
|
|
353
434
|
cancelAnimationFrame(second);
|
|
354
435
|
});
|
|
355
436
|
});
|
|
437
|
+
effect((onCleanup) => {
|
|
438
|
+
const canvas = this.canvasElement()?.nativeElement;
|
|
439
|
+
if (canvas && this.cursor() === 'category') {
|
|
440
|
+
onCleanup(this.listenForCursor(canvas));
|
|
441
|
+
}
|
|
442
|
+
});
|
|
356
443
|
// The read phase, so every `getComputedTextLength` lands in one batch before any write:
|
|
357
|
-
// interleaving them forces a synchronous layout per label.
|
|
444
|
+
// interleaving them forces a synchronous layout per label. It re-measures when a label's text
|
|
445
|
+
// changes, and only then - not when a resize merely moves the labels.
|
|
358
446
|
afterRenderEffect({
|
|
359
447
|
read: () => {
|
|
448
|
+
this.labelTexts();
|
|
360
449
|
this.measuredLabelWidth.set(this.widestLabel('.axis-label.is-primary'));
|
|
361
450
|
this.measuredSecondaryLabelWidth.set(this.widestLabel('.axis-label.is-secondary'));
|
|
451
|
+
this.measuredCategoryLabelWidth.set(this.widestLabel('.category-label'));
|
|
362
452
|
},
|
|
363
453
|
});
|
|
364
454
|
}
|
|
@@ -372,7 +462,7 @@ class ChartComponent {
|
|
|
372
462
|
}
|
|
373
463
|
/** Two plots, one above the other, sharing the category axis: the only mode whose second axis
|
|
374
464
|
* is a second PLOT rather than a second scale over the first. */
|
|
375
|
-
stacked = computed(() => this.secondaryAxisMode() === '
|
|
465
|
+
stacked = computed(() => this.secondaryAxisMode() === 'split' && this.hasSecondaryAxis(), ...(ngDevMode ? [{ debugName: "stacked" }] : /* istanbul ignore next */ []));
|
|
376
466
|
viewHeight = computed(() => chartViewHeight(this.plotHeight(), this.valueSpace(), this.reachesBelowZero()) + (this.stacked() ? this.plotHeight() + CHART_STACKED_PLOT_GAP : 0), ...(ngDevMode ? [{ debugName: "viewHeight" }] : /* istanbul ignore next */ []));
|
|
377
467
|
/** One viewBox unit is one CSS pixel, in both axes. That is the whole point of measuring: a
|
|
378
468
|
* radius, a gutter or a width cap set anywhere inside the plot is then the length it says it
|
|
@@ -381,6 +471,8 @@ class ChartComponent {
|
|
|
381
471
|
/** Widest tick label actually rendered, in the CSS pixels the canvas is drawn in. Zero until the
|
|
382
472
|
* first read, and zero under SSR, where `axisGutter` alone decides. */
|
|
383
473
|
measuredLabelWidth = signal(0, ...(ngDevMode ? [{ debugName: "measuredLabelWidth" }] : /* istanbul ignore next */ []));
|
|
474
|
+
/** The widest category label as drawn, which is what decides whether they all fit. */
|
|
475
|
+
measuredCategoryLabelWidth = signal(0, ...(ngDevMode ? [{ debugName: "measuredCategoryLabelWidth" }] : /* istanbul ignore next */ []));
|
|
384
476
|
/** `axisGutter` is the FLOOR, not the answer: a compact number is far wider in some locales than
|
|
385
477
|
* in others - `3,5 тыс.` against `3.5k` - and an SVG canvas CLIPS what a DOM column merely
|
|
386
478
|
* overflowed, so a fixed gutter silently eats the leading digit. The gutter takes whichever is
|
|
@@ -389,7 +481,17 @@ class ChartComponent {
|
|
|
389
481
|
* This converges rather than oscillating: a tick's TEXT is decided by the domain and the tick
|
|
390
482
|
* count, neither of which the gutter feeds, so widening it moves the labels without rewriting
|
|
391
483
|
* them and the second measurement equals the first. */
|
|
392
|
-
effectiveAxisGutter = computed(() => Math.max(this.axisGutter(), this.measuredLabelWidth() + CHART_AXIS_LABEL_GAP), ...(ngDevMode ? [{ debugName: "effectiveAxisGutter" }] : /* istanbul ignore next */ []));
|
|
484
|
+
effectiveAxisGutter = computed(() => Math.max(this.axisGutter(), this.measuredLabelWidth() + CHART_AXIS_LABEL_GAP + this.axisTitleGutter()), ...(ngDevMode ? [{ debugName: "effectiveAxisGutter" }] : /* istanbul ignore next */ []));
|
|
485
|
+
/** A rotated axis title stands in the same gutter as the tick labels, so the gutter has to carry
|
|
486
|
+
* both or the widest tick runs through the title. Its own width is its line height, because it
|
|
487
|
+
* is turned on its side. */
|
|
488
|
+
axisTitleGutter = computed(() => this.axisLabel() ? CHART_AXIS_TITLE_BAND : 0, ...(ngDevMode ? [{ debugName: "axisTitleGutter" }] : /* istanbul ignore next */ []));
|
|
489
|
+
/** Where a rotated axis title sits: hard against the outer edge, with the tick labels between it
|
|
490
|
+
* and the plot. */
|
|
491
|
+
axisTitleX = computed(() => CHART_AXIS_TITLE_BAND / 2, ...(ngDevMode ? [{ debugName: "axisTitleX" }] : /* istanbul ignore next */ []));
|
|
492
|
+
/** Mirrors `axisTitleX` against the right edge, so the two titles stand the same distance from
|
|
493
|
+
* their own ticks. */
|
|
494
|
+
secondaryTitleX = computed(() => this.viewWidth() - CHART_AXIS_TITLE_BAND / 2, ...(ngDevMode ? [{ debugName: "secondaryTitleX" }] : /* istanbul ignore next */ []));
|
|
393
495
|
/** Widest secondary tick label, measured the same way and for the same reason as the primary
|
|
394
496
|
* one: those labels sit OUTSIDE the plot's right edge and an SVG canvas clips what a DOM
|
|
395
497
|
* column merely overflowed. */
|
|
@@ -397,8 +499,15 @@ class ChartComponent {
|
|
|
397
499
|
/** The plot gives the right-hand labels room only when they are drawn there - a stacked second
|
|
398
500
|
* axis puts both label columns down the left, so the plot keeps the full width. */
|
|
399
501
|
rightGutter = computed(() => this.hasSecondaryAxis() && !this.stacked()
|
|
400
|
-
? Math.max(this.axisGutter(), this.measuredSecondaryLabelWidth() +
|
|
502
|
+
? Math.max(this.axisGutter(), this.measuredSecondaryLabelWidth() +
|
|
503
|
+
CHART_AXIS_LABEL_GAP +
|
|
504
|
+
this.secondaryTitleGutter())
|
|
401
505
|
: CHART_EDGE_GUTTER, ...(ngDevMode ? [{ debugName: "rightGutter" }] : /* istanbul ignore next */ []));
|
|
506
|
+
/** The second axis's title stands in the right gutter exactly as the first one's stands in the
|
|
507
|
+
* left, so both sides reserve the same band and the plot sits centred between its two labels. */
|
|
508
|
+
secondaryTitleGutter = computed(() => this.secondaryAxisLabel() && this.hasSecondaryAxis()
|
|
509
|
+
? CHART_AXIS_TITLE_BAND
|
|
510
|
+
: 0, ...(ngDevMode ? [{ debugName: "secondaryTitleGutter" }] : /* istanbul ignore next */ []));
|
|
402
511
|
plot = computed(() => chartPlot(this.viewWidth(), this.plotHeight(), this.effectiveAxisGutter(), this.valueSpace(), this.rightGutter()), ...(ngDevMode ? [{ debugName: "plot" }] : /* istanbul ignore next */ []));
|
|
403
512
|
secondaryPlot = computed(() => {
|
|
404
513
|
const plot = this.plot();
|
|
@@ -426,13 +535,73 @@ class ChartComponent {
|
|
|
426
535
|
return next;
|
|
427
536
|
});
|
|
428
537
|
}
|
|
538
|
+
/** A template that replaces the panel's body, for a preset that prints more than label+value. */
|
|
539
|
+
tooltipTemplate = input(null, ...(ngDevMode ? [{ debugName: "tooltipTemplate" }] : /* istanbul ignore next */ []));
|
|
540
|
+
/** Extra clearance between the mark and the panel, for a chart that prints a value label in
|
|
541
|
+
* the gap the panel would otherwise take. */
|
|
542
|
+
tooltipExtraGap = input(0, { ...(ngDevMode ? { debugName: "tooltipExtraGap" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
543
|
+
tooltipSources = signal(new Map(), ...(ngDevMode ? [{ debugName: "tooltipSources" }] : /* istanbul ignore next */ []));
|
|
544
|
+
reportTooltip(id, source) {
|
|
545
|
+
this.tooltipSources.update((sources) => new Map(sources).set(id, source));
|
|
546
|
+
}
|
|
547
|
+
releaseTooltip(id) {
|
|
548
|
+
this.tooltipSources.update((sources) => {
|
|
549
|
+
const next = new Map(sources);
|
|
550
|
+
next.delete(id);
|
|
551
|
+
return next;
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
/** The offer to show, if any mark is making one. At most one mark has a context at a time: a
|
|
555
|
+
* per-mark tooltip only fills it while that mark is hovered, and an axis tooltip only while the
|
|
556
|
+
* category cursor is on. The container opening the panel is what stops two marks opening two. */
|
|
557
|
+
activeTooltip = computed(() => [...this.tooltipSources().values()].find((source) => source.context() !== null) ?? null, ...(ngDevMode ? [{ debugName: "activeTooltip" }] : /* istanbul ignore next */ []));
|
|
558
|
+
tooltipContext = computed(() => {
|
|
559
|
+
const base = this.activeTooltip()?.context() ?? null;
|
|
560
|
+
if (base === null || this.cursor() !== 'category') {
|
|
561
|
+
return base;
|
|
562
|
+
}
|
|
563
|
+
// A category panel is about the category, not about the mark that happened to open it, so
|
|
564
|
+
// every other mark's reading at the same category belongs in it. Matched by label, because a
|
|
565
|
+
// mark that already named itself must not be listed twice.
|
|
566
|
+
const named = new Set(base.entries.map((entry) => entry.label));
|
|
567
|
+
const rest = [...this.tooltipSources().values()]
|
|
568
|
+
.flatMap((source) => source.axisEntries?.() ?? [])
|
|
569
|
+
.filter((entry) => !named.has(entry.label));
|
|
570
|
+
return rest.length === 0
|
|
571
|
+
? base
|
|
572
|
+
: { ...base, entries: [...base.entries, ...rest] };
|
|
573
|
+
}, ...(ngDevMode ? [{ debugName: "tooltipContext" }] : /* istanbul ignore next */ []));
|
|
574
|
+
tooltipOrigin = computed(() => {
|
|
575
|
+
const own = this.activeTooltip()?.origin() ?? null;
|
|
576
|
+
if (this.cursor() !== 'category') {
|
|
577
|
+
return own;
|
|
578
|
+
}
|
|
579
|
+
// A category panel belongs over the TALLEST reading at that category, not over whichever mark
|
|
580
|
+
// happened to open it: a line that dips under a column would otherwise put the panel low and
|
|
581
|
+
// let the column stand over it.
|
|
582
|
+
const boxes = [...this.tooltipSources().values()]
|
|
583
|
+
.map((source) => source.origin())
|
|
584
|
+
.filter((origin) => origin instanceof Element)
|
|
585
|
+
.map((element) => ({ element, top: element.getBoundingClientRect().top }))
|
|
586
|
+
.filter(({ element }) => {
|
|
587
|
+
const box = element.getBoundingClientRect();
|
|
588
|
+
return box.width > 0 && box.height > 0;
|
|
589
|
+
});
|
|
590
|
+
return boxes.length === 0
|
|
591
|
+
? own
|
|
592
|
+
: boxes.reduce((highest, candidate) => candidate.top < highest.top ? candidate : highest).element;
|
|
593
|
+
}, ...(ngDevMode ? [{ debugName: "tooltipOrigin" }] : /* istanbul ignore next */ []));
|
|
594
|
+
tooltipPreferBelow = computed(() => (this.activeTooltip()?.preferBelow?.() ?? false) || this.cursorPinned(), ...(ngDevMode ? [{ debugName: "tooltipPreferBelow" }] : /* istanbul ignore next */ []));
|
|
429
595
|
/** Compared by value, which is what stops a mark that reports AND reads `yPosition()` in one
|
|
430
596
|
* effect from running forever: every report allocates a fresh `Map` and `niceDomain` a fresh
|
|
431
597
|
* object, so identity always differs and the read would re-arm the write. Measured without it:
|
|
432
598
|
* 97507 effect runs in 45 seconds, no Angular loop error, renderer unresponsive. */
|
|
433
599
|
domain = computed(() => axisDomain(this.valuesOn('primary'), this.tickCount(), this.min(), this.max()), { ...(ngDevMode ? { debugName: "domain" } : /* istanbul ignore next */ {}), equal: (a, b) => a.min === b.min && a.max === b.max });
|
|
434
|
-
|
|
435
|
-
|
|
600
|
+
// Counts VALUES, not reporters: `valuesOn` returns one entry per mark that registered, and a
|
|
601
|
+
// line series registers both axes unconditionally, so an empty contribution would otherwise
|
|
602
|
+
// raise a whole second axis on a plot that has one.
|
|
603
|
+
hasSecondaryAxis = computed(() => this.valuesOn('secondary').some((values) => values.length > 0), ...(ngDevMode ? [{ debugName: "hasSecondaryAxis" }] : /* istanbul ignore next */ []));
|
|
604
|
+
secondary = computed(() => secondaryAxis(this.ticks().map((tick) => tick.value), this.valuesOn('secondary'), this.tickCount(), this.secondaryAxisMode(), this.maxSecondary()), { ...(ngDevMode ? { debugName: "secondary" } : /* istanbul ignore next */ {}), equal: (a, b) => a.aligned === b.aligned &&
|
|
436
605
|
a.domain.min === b.domain.min &&
|
|
437
606
|
a.domain.max === b.domain.max &&
|
|
438
607
|
a.ticks.length === b.ticks.length &&
|
|
@@ -482,12 +651,92 @@ class ChartComponent {
|
|
|
482
651
|
return valueScale(this.domain(), plot.top, plot.height);
|
|
483
652
|
}, ...(ngDevMode ? [{ debugName: "yPosition" }] : /* istanbul ignore next */ []));
|
|
484
653
|
zeroOffset = computed(() => this.yPosition()(0), ...(ngDevMode ? [{ debugName: "zeroOffset" }] : /* istanbul ignore next */ []));
|
|
485
|
-
|
|
654
|
+
cursorBand = computed(() => {
|
|
655
|
+
const index = this.activeIndex();
|
|
656
|
+
if (this.cursor() !== 'category' || index < 0) {
|
|
657
|
+
return null;
|
|
658
|
+
}
|
|
659
|
+
const width = this.bandWidth();
|
|
660
|
+
const plot = this.plot();
|
|
661
|
+
return {
|
|
662
|
+
x: this.xPosition()(index) - width / 2,
|
|
663
|
+
width,
|
|
664
|
+
top: plot.top,
|
|
665
|
+
bottom: plot.top + plot.height,
|
|
666
|
+
};
|
|
667
|
+
}, ...(ngDevMode ? [{ debugName: "cursorBand" }] : /* istanbul ignore next */ []));
|
|
668
|
+
/** The same state machine the element marks run on: pin, linger, the grace period that lets the
|
|
669
|
+
* pointer reach a portaled panel, Escape and press-outside. A category cursor differs from a
|
|
670
|
+
* mark only in what the index counts, so it takes the behaviour rather than restating it. */
|
|
671
|
+
cursorState = chartActiveMark(() => this.defaults.tooltipLingerMs());
|
|
672
|
+
activeIndex = this.cursorState.index;
|
|
673
|
+
pointerAt = signal(null, ...(ngDevMode ? [{ debugName: "pointerAt" }] : /* istanbul ignore next */ []));
|
|
674
|
+
cursorPointer = computed(() => this.activeIndex() < 0 ? null : this.pointerAt(), ...(ngDevMode ? [{ debugName: "cursorPointer" }] : /* istanbul ignore next */ []));
|
|
675
|
+
/** Whether the cursor is held. A preset renders its own way out of the pin from this. */
|
|
676
|
+
cursorPinned = this.cursorState.pinned;
|
|
677
|
+
releaseCursor() {
|
|
678
|
+
this.cursorState.release();
|
|
679
|
+
}
|
|
680
|
+
canvasElement = viewChild('canvasEl', ...(ngDevMode ? [{ debugName: "canvasElement" }] : /* istanbul ignore next */ []));
|
|
681
|
+
// Read once per hover and dropped on any scroll, rather than on every move: a move that follows
|
|
682
|
+
// the cursor band's own update would otherwise force a second layout in the same frame.
|
|
683
|
+
canvasRect = null;
|
|
684
|
+
plotPointer(event, canvas) {
|
|
685
|
+
this.canvasRect ??= canvas.getBoundingClientRect();
|
|
686
|
+
const plot = this.plot();
|
|
687
|
+
// The canvas is scaled to its box, so a client x has to come back through the viewBox before
|
|
688
|
+
// it means anything to a plot measured in view units.
|
|
689
|
+
const viewX = ((event.clientX - this.canvasRect.left) / this.canvasRect.width) *
|
|
690
|
+
this.viewWidth();
|
|
691
|
+
const index = this.clampIndex(categoryAt(viewX, plot.left, plot.width, this.categories().length));
|
|
692
|
+
this.pointerAt.set({ x: event.clientX, y: event.clientY });
|
|
693
|
+
if (event.type === 'pointerdown' && this.cursorPin()) {
|
|
694
|
+
this.cursorState.pin(index, event);
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
this.cursorState.enter(index, event);
|
|
698
|
+
}
|
|
699
|
+
/** The plot listens to the pointer only when it draws a category cursor, and outside the zone:
|
|
700
|
+
* the handler writes signals, which schedule the render they need. */
|
|
701
|
+
listenForCursor(canvas) {
|
|
702
|
+
const forgetRect = () => {
|
|
703
|
+
this.canvasRect = null;
|
|
704
|
+
};
|
|
705
|
+
const onPointer = (event) => this.plotPointer(event, canvas);
|
|
706
|
+
const onEnter = () => window.addEventListener('scroll', forgetRect, {
|
|
707
|
+
capture: true,
|
|
708
|
+
passive: true,
|
|
709
|
+
});
|
|
710
|
+
const onLeave = () => {
|
|
711
|
+
window.removeEventListener('scroll', forgetRect, { capture: true });
|
|
712
|
+
forgetRect();
|
|
713
|
+
this.cursorState.leave();
|
|
714
|
+
};
|
|
715
|
+
this.zone.runOutsideAngular(() => {
|
|
716
|
+
canvas.addEventListener('pointerenter', onEnter);
|
|
717
|
+
canvas.addEventListener('pointermove', onPointer);
|
|
718
|
+
canvas.addEventListener('pointerdown', onPointer);
|
|
719
|
+
canvas.addEventListener('pointerleave', onLeave);
|
|
720
|
+
});
|
|
721
|
+
return () => {
|
|
722
|
+
canvas.removeEventListener('pointerenter', onEnter);
|
|
723
|
+
canvas.removeEventListener('pointermove', onPointer);
|
|
724
|
+
canvas.removeEventListener('pointerdown', onPointer);
|
|
725
|
+
canvas.removeEventListener('pointerleave', onLeave);
|
|
726
|
+
window.removeEventListener('scroll', forgetRect, { capture: true });
|
|
727
|
+
forgetRect();
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
bandElement = viewChild('cursorBandEl', ...(ngDevMode ? [{ debugName: "bandElement" }] : /* istanbul ignore next */ []));
|
|
731
|
+
cursorOrigin = computed(() => this.cursorBand() ? (this.bandElement()?.nativeElement ?? null) : null, ...(ngDevMode ? [{ debugName: "cursorOrigin" }] : /* istanbul ignore next */ []));
|
|
486
732
|
setActiveIndex(index) {
|
|
733
|
+
this.cursorState.setIndex(this.clampIndex(index));
|
|
734
|
+
}
|
|
735
|
+
clampIndex(index) {
|
|
487
736
|
const last = this.categories().length - 1;
|
|
488
|
-
|
|
737
|
+
return Number.isFinite(index)
|
|
489
738
|
? Math.min(Math.max(Math.trunc(index), -1), last)
|
|
490
|
-
: -1
|
|
739
|
+
: -1;
|
|
491
740
|
}
|
|
492
741
|
plotRight = computed(() => this.plot().left + this.plot().width, ...(ngDevMode ? [{ debugName: "plotRight" }] : /* istanbul ignore next */ []));
|
|
493
742
|
plotBottom = computed(() => this.plot().top + this.plot().height, ...(ngDevMode ? [{ debugName: "plotBottom" }] : /* istanbul ignore next */ []));
|
|
@@ -507,9 +756,23 @@ class ChartComponent {
|
|
|
507
756
|
label: format(value, 'tick'),
|
|
508
757
|
}));
|
|
509
758
|
}, ...(ngDevMode ? [{ debugName: "ticks" }] : /* istanbul ignore next */ []));
|
|
759
|
+
labelTexts = computed(() => [
|
|
760
|
+
...this.ticks().map((tick) => tick.label),
|
|
761
|
+
...this.secondaryTicks().map((tick) => tick.label),
|
|
762
|
+
...this.categories(),
|
|
763
|
+
].join('\n'), ...(ngDevMode ? [{ debugName: "labelTexts" }] : /* istanbul ignore next */ []));
|
|
764
|
+
/** Rotation is spent before thinning: a tilt costs the reader a glance, dropping a label costs
|
|
765
|
+
* them a reading. Both are decided from the widest label as it actually rendered. */
|
|
766
|
+
categoryLabelsRotated = computed(() => rotationWouldFit([this.measuredCategoryLabelWidth()], this.plot().width / Math.max(1, this.categories().length)), ...(ngDevMode ? [{ debugName: "categoryLabelsRotated" }] : /* istanbul ignore next */ []));
|
|
767
|
+
categoryLabelInterval = computed(() => labelInterval([this.measuredCategoryLabelWidth()], this.plot().width / Math.max(1, this.categories().length), this.categoryLabelsRotated()), ...(ngDevMode ? [{ debugName: "categoryLabelInterval" }] : /* istanbul ignore next */ []));
|
|
510
768
|
categoryLabels = computed(() => {
|
|
511
769
|
const toX = this.xPosition();
|
|
512
|
-
|
|
770
|
+
const interval = this.categoryLabelInterval();
|
|
771
|
+
return (this.categories()
|
|
772
|
+
.map((text, index) => ({ x: toX(index), text, index }))
|
|
773
|
+
// The first is always drawn and the rest follow the interval, so the axis keeps an anchor
|
|
774
|
+
// the reader can count from rather than an arbitrary offset into the categories.
|
|
775
|
+
.filter((label) => label.index % interval === 0));
|
|
513
776
|
}, ...(ngDevMode ? [{ debugName: "categoryLabels" }] : /* istanbul ignore next */ []));
|
|
514
777
|
reachesBelowZero = computed(() => this.domain().min < 0, ...(ngDevMode ? [{ debugName: "reachesBelowZero" }] : /* istanbul ignore next */ []));
|
|
515
778
|
/** Empty is read off `categories` alone, never off the reported domains: the marks are
|
|
@@ -518,16 +781,16 @@ class ChartComponent {
|
|
|
518
781
|
isEmpty = computed(() => this.categories().length === 0, ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
519
782
|
accessibleName = computed(() => this.summary() ?? this.caption() ?? 'Chart', ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
|
|
520
783
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
521
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartComponent, isStandalone: true, selector: "ds-chart", inputs: { categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: false, transformFunction: null }, tickCount: { classPropertyName: "tickCount", publicName: "tickCount", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, plotHeight: { classPropertyName: "plotHeight", publicName: "plotHeight", isSignal: true, isRequired: false, transformFunction: null }, axisGutter: { classPropertyName: "axisGutter", publicName: "axisGutter", isSignal: true, isRequired: false, transformFunction: null }, valueSpace: { classPropertyName: "valueSpace", publicName: "valueSpace", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisMode: { classPropertyName: "secondaryAxisMode", publicName: "secondaryAxisMode", isSignal: true, isRequired: false, transformFunction: null }, axisColor: { classPropertyName: "axisColor", publicName: "axisColor", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisColor: { classPropertyName: "secondaryAxisColor", publicName: "secondaryAxisColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.framed": "frameResolved() === 'auto'", "class.measuring": "!settled()", "style.--_chart-view-height": "viewHeight() + 'px'" } }, providers: [
|
|
784
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartComponent, isStandalone: true, selector: "ds-chart", inputs: { categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: false, transformFunction: null }, tickCount: { classPropertyName: "tickCount", publicName: "tickCount", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, cursor: { classPropertyName: "cursor", publicName: "cursor", isSignal: true, isRequired: false, transformFunction: null }, cursorPin: { classPropertyName: "cursorPin", publicName: "cursorPin", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, maxSecondary: { classPropertyName: "maxSecondary", publicName: "maxSecondary", isSignal: true, isRequired: false, transformFunction: null }, plotHeight: { classPropertyName: "plotHeight", publicName: "plotHeight", isSignal: true, isRequired: false, transformFunction: null }, axisGutter: { classPropertyName: "axisGutter", publicName: "axisGutter", isSignal: true, isRequired: false, transformFunction: null }, valueSpace: { classPropertyName: "valueSpace", publicName: "valueSpace", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisMode: { classPropertyName: "secondaryAxisMode", publicName: "secondaryAxisMode", isSignal: true, isRequired: false, transformFunction: null }, axisColor: { classPropertyName: "axisColor", publicName: "axisColor", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisColor: { classPropertyName: "secondaryAxisColor", publicName: "secondaryAxisColor", isSignal: true, isRequired: false, transformFunction: null }, axisLabel: { classPropertyName: "axisLabel", publicName: "axisLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisLabel: { classPropertyName: "secondaryAxisLabel", publicName: "secondaryAxisLabel", isSignal: true, isRequired: false, transformFunction: null }, tooltipTemplate: { classPropertyName: "tooltipTemplate", publicName: "tooltipTemplate", isSignal: true, isRequired: false, transformFunction: null }, tooltipExtraGap: { classPropertyName: "tooltipExtraGap", publicName: "tooltipExtraGap", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.framed": "frameResolved() === 'auto'", "class.measuring": "!settled()", "style.--_chart-view-height": "viewHeight() + 'px'" } }, providers: [
|
|
522
785
|
{
|
|
523
786
|
provide: CHART_SCALES,
|
|
524
787
|
useExisting: forwardRef(() => ChartComponent),
|
|
525
788
|
},
|
|
526
|
-
], ngImport: i0, template: "<figure class=\"chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n <ds-skeleton height=\"var(--_chart-view-height)\" />\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\">\n <svg\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [style.block-size.px]=\"viewHeight()\"\n [attr.viewBox]=\"viewBox()\">\n <!-- Hidden as a group rather than on the svg: a projected mark may be focusable, and an\n aria-hidden ancestor would leave it reachable by Tab and invisible to a reader. -->\n <g\n class=\"axes\"\n aria-hidden=\"true\">\n @for (tick of ticks(); track tick.value) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"plotBottom()\"\n [attr.y2]=\"plotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"plot().top\"\n [attr.y2]=\"plotBottom()\" />\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track tick.value) {\n <line\n class=\"grid-line is-secondary\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n }\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryPlotBottom()\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"secondaryPlot().top\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n }\n\n @if (reachesBelowZero()) {\n <line\n class=\"zero-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"zeroOffset()\"\n [attr.y2]=\"zeroOffset()\" />\n }\n </g>\n\n <!-- Two slots, one group: a reference line has to paint UNDER the marks whatever order the\n consumer wrote it in, and a selected slot is what decides that instead of the author.\n Both stay inside `.marks`, which is what the boot transition guard is keyed on. -->\n <g class=\"marks\">\n <ng-content select=\"[dsReferenceLine]\" />\n\n <ng-content />\n </g>\n\n <g\n class=\"labels\"\n aria-hidden=\"true\">\n @for (tick of ticks(); track tick.value) {\n <text\n class=\"axis-label is-primary\"\n text-anchor=\"end\"\n [style.fill]=\"axisLabelFill()\"\n [attr.x]=\"axisLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track tick.value) {\n <text\n class=\"axis-label is-secondary\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.text-anchor]=\"secondaryLabelAnchor()\"\n [attr.x]=\"secondaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (label of categoryLabels(); track $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\n <!-- Over the marks, where `.marks` is under them: an annotation's LINE is furniture and\n belongs below the readings, its NAME has to survive a column drawn through it. -->\n <ng-content select=\"[dsReferenceLabel]\" />\n </g>\n </svg>\n </div>\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table,figcaption{-webkit-user-select:text;user-select:text}.chart{--_chart-grid-line-color: var(--ds-chart-grid-line-color, var(--chart-grid-line-color));--_chart-axis-line-color: var(--ds-chart-axis-line-color, var(--chart-axis-line-color));--_chart-axis-label-color: var(--ds-chart-axis-label-color, var(--chart-axis-label-color));--_chart-axis-font-size: var(--ds-chart-axis-font-size, var(--chart-axis-font-size));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{display:grid;place-items:center;min-block-size:var(--_chart-view-height);margin:0;color:var(--text-secondary);text-align:center;border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.canvas{display:block;inline-size:100%}:host(.measuring) .marks ::ng-deep *{transition-duration:0ms!important}.grid-line{stroke:var(--_chart-grid-line-color);stroke-width:1}.axis-line,.zero-line{stroke:var(--_chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size)}.axis-label{dominant-baseline:middle}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
789
|
+
], viewQueries: [{ propertyName: "canvasElement", first: true, predicate: ["canvasEl"], descendants: true, isSignal: true }, { propertyName: "bandElement", first: true, predicate: ["cursorBandEl"], descendants: true, isSignal: true }], exportAs: ["dsChart"], ngImport: i0, template: "<figure class=\"chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n <ds-skeleton height=\"var(--_chart-view-height)\" />\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipExtraGap]=\"tooltipExtraGap()\"\n [dsChartTooltipPreferBelow]=\"tooltipPreferBelow()\"\n [dsChartTooltipPinned]=\"tooltipPreferBelow()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate()\">\n <svg\n #canvasEl\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [style.block-size.px]=\"viewHeight()\"\n [attr.viewBox]=\"viewBox()\">\n @if (cursorBand(); as band) {\n <g\n class=\"cursor\"\n aria-hidden=\"true\"\n animate.enter=\"cursor-in\"\n animate.leave=\"cursor-out\">\n <rect\n #cursorBandEl\n class=\"category-band\"\n [attr.x]=\"band.x\"\n [attr.y]=\"band.top\"\n [attr.width]=\"band.width\"\n [attr.height]=\"band.bottom - band.top\" />\n\n <line\n class=\"cursor-line\"\n [attr.x1]=\"band.x + band.width / 2\"\n [attr.x2]=\"band.x + band.width / 2\"\n [attr.y1]=\"band.top\"\n [attr.y2]=\"band.bottom\" />\n </g>\n }\n\n <!-- Hidden as a group rather than on the svg: a projected mark may be focusable, and an\n aria-hidden ancestor would leave it reachable by Tab and invisible to a reader. -->\n <g\n class=\"axes\"\n aria-hidden=\"true\">\n @for (tick of ticks(); track tick.value) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"plotBottom()\"\n [attr.y2]=\"plotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"plot().top\"\n [attr.y2]=\"plotBottom()\" />\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track tick.value) {\n <line\n class=\"grid-line is-secondary\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n }\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryPlotBottom()\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"secondaryPlot().top\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n }\n\n @if (reachesBelowZero()) {\n <line\n class=\"zero-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"zeroOffset()\"\n [attr.y2]=\"zeroOffset()\" />\n }\n </g>\n\n <!-- Two slots, one group: a reference line has to paint UNDER the marks whatever order the\n consumer wrote it in, and a selected slot is what decides that instead of the author.\n Both stay inside `.marks`, which is what the boot transition guard is keyed on. -->\n <g class=\"marks\">\n <ng-content select=\"[dsReferenceLine]\" />\n\n <ng-content />\n </g>\n\n <g\n class=\"labels\"\n aria-hidden=\"true\">\n @if (axisLabel()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"axisLabelFill()\"\n [attr.transform]=\"\n 'rotate(-90 ' +\n axisTitleX() +\n ' ' +\n (plot().top + plot().height / 2) +\n ')'\n \"\n [attr.x]=\"axisTitleX()\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ axisLabel() }}\n </text>\n }\n\n @if (secondaryAxisLabel() && hasSecondaryAxis()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.transform]=\"\n 'rotate(90 ' +\n secondaryTitleX() +\n ' ' +\n (plot().top + plot().height / 2) +\n ')'\n \"\n [attr.x]=\"secondaryTitleX()\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ secondaryAxisLabel() }}\n </text>\n }\n\n @for (tick of ticks(); track tick.value) {\n <text\n class=\"axis-label is-primary\"\n text-anchor=\"end\"\n [style.fill]=\"axisLabelFill()\"\n [attr.x]=\"axisLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track tick.value) {\n <text\n class=\"axis-label is-secondary\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.text-anchor]=\"secondaryLabelAnchor()\"\n [attr.x]=\"secondaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (label of categoryLabels(); track label.index) {\n <text\n class=\"category-label\"\n [class.is-rotated]=\"categoryLabelsRotated()\"\n [attr.text-anchor]=\"categoryLabelsRotated() ? 'end' : 'middle'\"\n [attr.x]=\"label.x\"\n [attr.y]=\"categoryLabelY()\"\n [attr.transform]=\"\n categoryLabelsRotated()\n ? 'rotate(-45 ' + label.x + ' ' + categoryLabelY() + ')'\n : null\n \">\n {{ label.text }}\n </text>\n }\n\n <!-- Over the marks, where `.marks` is under them: an annotation's LINE is furniture and\n belongs below the readings, its NAME has to survive a column drawn through it. -->\n <ng-content select=\"[dsReferenceLabel], [dsSeriesAnnotation]\" />\n </g>\n </svg>\n </div>\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table{-webkit-user-select:text;user-select:text}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}.empty.is-error,.empty-text.is-error{color:var(--error)}.chart{--_chart-grid-line-color: var(--ds-chart-grid-line-color, var(--chart-grid-line-color));--_chart-axis-line-color: var(--ds-chart-axis-line-color, var(--chart-axis-line-color));--_chart-axis-label-color: var(--ds-chart-axis-label-color, var(--chart-axis-label-color));--_chart-axis-font-size: var(--ds-chart-axis-font-size, var(--chart-axis-font-size));margin:0}.empty{display:grid;place-items:center;min-block-size:var(--_chart-view-height);margin:0;color:var(--text-secondary);text-align:center;border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.canvas{display:block;inline-size:100%}:host(.measuring) .marks ::ng-deep *{transition-duration:0ms!important}.grid-line{stroke:var(--_chart-grid-line-color);stroke-width:1}.axis-line,.zero-line{stroke:var(--_chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size)}.category-label.is-rotated{dominant-baseline:middle}.axis-title{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size);font-weight:var(--font-weight-bold)}.axis-label{dominant-baseline:middle}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}.cursor.cursor-in{animation:ds-chart-mark-fade-in var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.cursor.cursor-out{animation:ds-chart-mark-exit var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.category-band{fill:var(--ds-chart-hover-bg-color)}.cursor-line{stroke:var(--ds-chart-cursor-line-color);stroke-width:1}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate", "dsChartTooltipExtraGap", "dsChartTooltipPreferBelow", "dsChartTooltipPinned"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
527
790
|
}
|
|
528
791
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartComponent, decorators: [{
|
|
529
792
|
type: Component,
|
|
530
|
-
args: [{ selector: 'ds-chart', standalone: true, imports: [SkeletonComponent], host: {
|
|
793
|
+
args: [{ selector: 'ds-chart', standalone: true, exportAs: 'dsChart', imports: [SkeletonComponent, ChartTooltipDirective], host: {
|
|
531
794
|
'[class.framed]': "frameResolved() === 'auto'",
|
|
532
795
|
'[class.measuring]': '!settled()',
|
|
533
796
|
'[style.--_chart-view-height]': "viewHeight() + 'px'",
|
|
@@ -536,11 +799,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
536
799
|
provide: CHART_SCALES,
|
|
537
800
|
useExisting: forwardRef(() => ChartComponent),
|
|
538
801
|
},
|
|
539
|
-
], template: "<figure class=\"chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n <ds-skeleton height=\"var(--_chart-view-height)\" />\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\">\n <svg\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [style.block-size.px]=\"viewHeight()\"\n [attr.viewBox]=\"viewBox()\">\n <!-- Hidden as a group rather than on the svg: a projected mark may be focusable, and an\n aria-hidden ancestor would leave it reachable by Tab and invisible to a reader. -->\n <g\n class=\"axes\"\n aria-hidden=\"true\">\n @for (tick of ticks(); track tick.value) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"plotBottom()\"\n [attr.y2]=\"plotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"plot().top\"\n [attr.y2]=\"plotBottom()\" />\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track tick.value) {\n <line\n class=\"grid-line is-secondary\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n }\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryPlotBottom()\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"secondaryPlot().top\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n }\n\n @if (reachesBelowZero()) {\n <line\n class=\"zero-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"zeroOffset()\"\n [attr.y2]=\"zeroOffset()\" />\n }\n </g>\n\n <!-- Two slots, one group: a reference line has to paint UNDER the marks whatever order the\n consumer wrote it in, and a selected slot is what decides that instead of the author.\n Both stay inside `.marks`, which is what the boot transition guard is keyed on. -->\n <g class=\"marks\">\n <ng-content select=\"[dsReferenceLine]\" />\n\n <ng-content />\n </g>\n\n <g\n class=\"labels\"\n aria-hidden=\"true\">\n @for (tick of ticks(); track tick.value) {\n <text\n class=\"axis-label is-primary\"\n text-anchor=\"end\"\n [style.fill]=\"axisLabelFill()\"\n [attr.x]=\"axisLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track tick.value) {\n <text\n class=\"axis-label is-secondary\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.text-anchor]=\"secondaryLabelAnchor()\"\n [attr.x]=\"secondaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (label of categoryLabels(); track $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\n <!-- Over the marks, where `.marks` is under them: an annotation's LINE is furniture and\n belongs below the readings, its NAME has to survive a column drawn through it. -->\n <ng-content select=\"[dsReferenceLabel]\" />\n </g>\n </svg>\n </div>\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table,figcaption{-webkit-user-select:text;user-select:text}.chart{--_chart-grid-line-color: var(--ds-chart-grid-line-color, var(--chart-grid-line-color));--_chart-axis-line-color: var(--ds-chart-axis-line-color, var(--chart-axis-line-color));--_chart-axis-label-color: var(--ds-chart-axis-label-color, var(--chart-axis-label-color));--_chart-axis-font-size: var(--ds-chart-axis-font-size, var(--chart-axis-font-size));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{display:grid;place-items:center;min-block-size:var(--_chart-view-height);margin:0;color:var(--text-secondary);text-align:center;border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.canvas{display:block;inline-size:100%}:host(.measuring) .marks ::ng-deep *{transition-duration:0ms!important}.grid-line{stroke:var(--_chart-grid-line-color);stroke-width:1}.axis-line,.zero-line{stroke:var(--_chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size)}.axis-label{dominant-baseline:middle}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}\n"] }]
|
|
540
|
-
}], ctorParameters: () => [], propDecorators: { categories: [{ type: i0.Input, args: [{ isSignal: true, alias: "categories", required: false }] }], tickCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "tickCount", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], plotHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "plotHeight", required: false }] }], axisGutter: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisGutter", required: false }] }], valueSpace: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueSpace", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], frame: [{ type: i0.Input, args: [{ isSignal: true, alias: "frame", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], secondaryAxisMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisMode", required: false }] }], axisColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisColor", required: false }] }], secondaryAxisColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisColor", required: false }] }] } });
|
|
802
|
+
], template: "<figure class=\"chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n <ds-skeleton height=\"var(--_chart-view-height)\" />\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipExtraGap]=\"tooltipExtraGap()\"\n [dsChartTooltipPreferBelow]=\"tooltipPreferBelow()\"\n [dsChartTooltipPinned]=\"tooltipPreferBelow()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate()\">\n <svg\n #canvasEl\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [style.block-size.px]=\"viewHeight()\"\n [attr.viewBox]=\"viewBox()\">\n @if (cursorBand(); as band) {\n <g\n class=\"cursor\"\n aria-hidden=\"true\"\n animate.enter=\"cursor-in\"\n animate.leave=\"cursor-out\">\n <rect\n #cursorBandEl\n class=\"category-band\"\n [attr.x]=\"band.x\"\n [attr.y]=\"band.top\"\n [attr.width]=\"band.width\"\n [attr.height]=\"band.bottom - band.top\" />\n\n <line\n class=\"cursor-line\"\n [attr.x1]=\"band.x + band.width / 2\"\n [attr.x2]=\"band.x + band.width / 2\"\n [attr.y1]=\"band.top\"\n [attr.y2]=\"band.bottom\" />\n </g>\n }\n\n <!-- Hidden as a group rather than on the svg: a projected mark may be focusable, and an\n aria-hidden ancestor would leave it reachable by Tab and invisible to a reader. -->\n <g\n class=\"axes\"\n aria-hidden=\"true\">\n @for (tick of ticks(); track tick.value) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"plotBottom()\"\n [attr.y2]=\"plotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"plot().top\"\n [attr.y2]=\"plotBottom()\" />\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track tick.value) {\n <line\n class=\"grid-line is-secondary\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n }\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryPlotBottom()\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"secondaryPlot().top\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n }\n\n @if (reachesBelowZero()) {\n <line\n class=\"zero-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"zeroOffset()\"\n [attr.y2]=\"zeroOffset()\" />\n }\n </g>\n\n <!-- Two slots, one group: a reference line has to paint UNDER the marks whatever order the\n consumer wrote it in, and a selected slot is what decides that instead of the author.\n Both stay inside `.marks`, which is what the boot transition guard is keyed on. -->\n <g class=\"marks\">\n <ng-content select=\"[dsReferenceLine]\" />\n\n <ng-content />\n </g>\n\n <g\n class=\"labels\"\n aria-hidden=\"true\">\n @if (axisLabel()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"axisLabelFill()\"\n [attr.transform]=\"\n 'rotate(-90 ' +\n axisTitleX() +\n ' ' +\n (plot().top + plot().height / 2) +\n ')'\n \"\n [attr.x]=\"axisTitleX()\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ axisLabel() }}\n </text>\n }\n\n @if (secondaryAxisLabel() && hasSecondaryAxis()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.transform]=\"\n 'rotate(90 ' +\n secondaryTitleX() +\n ' ' +\n (plot().top + plot().height / 2) +\n ')'\n \"\n [attr.x]=\"secondaryTitleX()\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ secondaryAxisLabel() }}\n </text>\n }\n\n @for (tick of ticks(); track tick.value) {\n <text\n class=\"axis-label is-primary\"\n text-anchor=\"end\"\n [style.fill]=\"axisLabelFill()\"\n [attr.x]=\"axisLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track tick.value) {\n <text\n class=\"axis-label is-secondary\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.text-anchor]=\"secondaryLabelAnchor()\"\n [attr.x]=\"secondaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (label of categoryLabels(); track label.index) {\n <text\n class=\"category-label\"\n [class.is-rotated]=\"categoryLabelsRotated()\"\n [attr.text-anchor]=\"categoryLabelsRotated() ? 'end' : 'middle'\"\n [attr.x]=\"label.x\"\n [attr.y]=\"categoryLabelY()\"\n [attr.transform]=\"\n categoryLabelsRotated()\n ? 'rotate(-45 ' + label.x + ' ' + categoryLabelY() + ')'\n : null\n \">\n {{ label.text }}\n </text>\n }\n\n <!-- Over the marks, where `.marks` is under them: an annotation's LINE is furniture and\n belongs below the readings, its NAME has to survive a column drawn through it. -->\n <ng-content select=\"[dsReferenceLabel], [dsSeriesAnnotation]\" />\n </g>\n </svg>\n </div>\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table{-webkit-user-select:text;user-select:text}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}.empty.is-error,.empty-text.is-error{color:var(--error)}.chart{--_chart-grid-line-color: var(--ds-chart-grid-line-color, var(--chart-grid-line-color));--_chart-axis-line-color: var(--ds-chart-axis-line-color, var(--chart-axis-line-color));--_chart-axis-label-color: var(--ds-chart-axis-label-color, var(--chart-axis-label-color));--_chart-axis-font-size: var(--ds-chart-axis-font-size, var(--chart-axis-font-size));margin:0}.empty{display:grid;place-items:center;min-block-size:var(--_chart-view-height);margin:0;color:var(--text-secondary);text-align:center;border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.canvas{display:block;inline-size:100%}:host(.measuring) .marks ::ng-deep *{transition-duration:0ms!important}.grid-line{stroke:var(--_chart-grid-line-color);stroke-width:1}.axis-line,.zero-line{stroke:var(--_chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size)}.category-label.is-rotated{dominant-baseline:middle}.axis-title{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size);font-weight:var(--font-weight-bold)}.axis-label{dominant-baseline:middle}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}.cursor.cursor-in{animation:ds-chart-mark-fade-in var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.cursor.cursor-out{animation:ds-chart-mark-exit var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.category-band{fill:var(--ds-chart-hover-bg-color)}.cursor-line{stroke:var(--ds-chart-cursor-line-color);stroke-width:1}\n"] }]
|
|
803
|
+
}], ctorParameters: () => [], propDecorators: { categories: [{ type: i0.Input, args: [{ isSignal: true, alias: "categories", required: false }] }], tickCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "tickCount", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], cursor: [{ type: i0.Input, args: [{ isSignal: true, alias: "cursor", required: false }] }], cursorPin: [{ type: i0.Input, args: [{ isSignal: true, alias: "cursorPin", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], maxSecondary: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSecondary", required: false }] }], plotHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "plotHeight", required: false }] }], axisGutter: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisGutter", required: false }] }], valueSpace: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueSpace", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], frame: [{ type: i0.Input, args: [{ isSignal: true, alias: "frame", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], secondaryAxisMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisMode", required: false }] }], axisColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisColor", required: false }] }], secondaryAxisColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisColor", required: false }] }], axisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisLabel", required: false }] }], secondaryAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisLabel", required: false }] }], tooltipTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipTemplate", required: false }] }], tooltipExtraGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipExtraGap", required: false }] }], canvasElement: [{ type: i0.ViewChild, args: ['canvasEl', { isSignal: true }] }], bandElement: [{ type: i0.ViewChild, args: ['cursorBandEl', { isSignal: true }] }] } });
|
|
541
804
|
|
|
542
805
|
/** The disc's radius, and half the glyph's box, in the same CSS pixels the plot is drawn in. */
|
|
543
806
|
const PIN_DISC_RADIUS = 11;
|
|
807
|
+
// Clears the column's top edge: at one radius the disc sits flush against it and reads as part of
|
|
808
|
+
// the bar rather than as a badge on it.
|
|
809
|
+
const PIN_TOP_GAP = 4;
|
|
544
810
|
const PIN_GLYPH_SIZE = 14;
|
|
545
811
|
/** Distance from a mark's own tip to its value label's baseline. */
|
|
546
812
|
const VALUE_LABEL_GAP = 8;
|
|
@@ -556,23 +822,40 @@ let nextSeriesId$1 = 0;
|
|
|
556
822
|
* Hosted on a `<g>` rather than an element of its own: an element the SVG specification does not
|
|
557
823
|
* know is not rendered, and neither are its descendants, so `<ds-column-series>` inside the
|
|
558
824
|
* container's canvas would draw nothing. Written as `<svg:g dsColumnSeries>`.
|
|
559
|
-
*
|
|
560
|
-
* @internal
|
|
561
825
|
*/
|
|
562
826
|
class ColumnSeriesComponent {
|
|
827
|
+
leaveMark = leaveMark;
|
|
563
828
|
scales = inject(CHART_SCALES);
|
|
564
829
|
/** Not `input.required`: the preset reads `tooltipContext()` from a binding on this same
|
|
565
830
|
* element, and a required input throws NG0950 for the pass before its own value is written. */
|
|
566
831
|
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
832
|
+
/** Prints each column's value above the column. */
|
|
567
833
|
showValues = input(true, { ...(ngDevMode ? { debugName: "showValues" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
834
|
+
/** Turns on the click affordance - the pointer cursor and the hover tint. `pointClicked`
|
|
835
|
+
* fires whether or not this is set. */
|
|
568
836
|
interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
837
|
+
/** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a
|
|
838
|
+
* press outside releases it. Pinning is a state, not a handler. */
|
|
569
839
|
pinOnClick = input(false, { ...(ngDevMode ? { debugName: "pinOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
840
|
+
/** Fades every mark but the one under the pointer. Off by default: the dimming buys loudness
|
|
841
|
+
* for one mark and pays for it with the separation between the rest. */
|
|
570
842
|
dimOthers = input(false, { ...(ngDevMode ? { debugName: "dimOthers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
843
|
+
/** Milliseconds between one mark's entrance and the next. The total is capped, so a long
|
|
844
|
+
* series does not crawl in. */
|
|
571
845
|
staggerMs = input(0, { ...(ngDevMode ? { debugName: "staggerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
846
|
+
/** Declares that the marks are parts of one whole, which is what makes a share of their total
|
|
847
|
+
* a real quantity. On, each mark's share appears on the tooltip's second line. */
|
|
572
848
|
partOfWhole = input(false, { ...(ngDevMode ? { debugName: "partOfWhole" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
849
|
+
/** Whether a hovered or focused column opens a tooltip. */
|
|
573
850
|
tooltip = input('item', ...(ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []));
|
|
851
|
+
/** Where the tooltip is pinned. `'mark'` is the column itself; `'cell'` is the full-height
|
|
852
|
+
* category cell, which puts the panel at the top of the plot whatever the column's value. */
|
|
574
853
|
tooltipAnchor = input('mark', ...(ngDevMode ? [{ debugName: "tooltipAnchor" }] : /* istanbul ignore next */ []));
|
|
854
|
+
/** How long the panel survives the pointer leaving the mark. Raise it only for a panel a
|
|
855
|
+
* reader has to REACH, which is WCAG 1.4.13's hoverable clause; about 140 crosses the gap. */
|
|
575
856
|
tooltipLingerMs = input(0, { ...(ngDevMode ? { debugName: "tooltipLingerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
857
|
+
/** Formats every value this series prints. Called with `'tick'` for an axis label and
|
|
858
|
+
* `'tooltip'` everywhere a value is printed in full. */
|
|
576
859
|
valueFormat = input(defaultChartFormat, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
|
|
577
860
|
/** The mark's share of its category's own slot, before the maximum width caps it. Measured off
|
|
578
861
|
* the slot rather than off `bandWidth()`, which has the container's own padding already taken
|
|
@@ -596,6 +879,15 @@ class ColumnSeriesComponent {
|
|
|
596
879
|
/** Names the series in the tooltip, where the category then becomes the panel's heading. Unset,
|
|
597
880
|
* the panel names the category instead, which is what a chart of one series has to say. */
|
|
598
881
|
seriesLabel = input(null, ...(ngDevMode ? [{ debugName: "seriesLabel" }] : /* istanbul ignore next */ []));
|
|
882
|
+
/** Identifies this series to the legend, so hovering a legend item can single it out. */
|
|
883
|
+
seriesKey = input(null, ...(ngDevMode ? [{ debugName: "seriesKey" }] : /* istanbul ignore next */ []));
|
|
884
|
+
/** The series the reader is pointing at in the legend. Every other series fades. */
|
|
885
|
+
highlighted = input(null, ...(ngDevMode ? [{ debugName: "highlighted" }] : /* istanbul ignore next */ []));
|
|
886
|
+
dimmedBySeries = computed(() => {
|
|
887
|
+
const highlighted = this.highlighted();
|
|
888
|
+
return highlighted !== null && highlighted !== this.seriesKey();
|
|
889
|
+
}, ...(ngDevMode ? [{ debugName: "dimmedBySeries" }] : /* istanbul ignore next */ []));
|
|
890
|
+
/** The clicked datum. Fires on click and on Enter or Space, whatever `interactive` says. */
|
|
599
891
|
pointClicked = output();
|
|
600
892
|
seriesId = nextSeriesId$1++;
|
|
601
893
|
domainId = `column-series-${this.seriesId}`;
|
|
@@ -613,8 +905,16 @@ class ColumnSeriesComponent {
|
|
|
613
905
|
}, ...(ngDevMode ? [{ debugName: "spans" }] : /* istanbul ignore next */ []));
|
|
614
906
|
constructor() {
|
|
615
907
|
effect(() => this.scales.reportDomain(this.domainId, this.spans().flatMap((span) => [span.from, span.to])));
|
|
908
|
+
// The container opens the panel, so a plot holding several marks can only ever show one.
|
|
909
|
+
this.scales.reportTooltip(this.domainId, {
|
|
910
|
+
context: this.tooltipContext,
|
|
911
|
+
origin: computed(() => this.activeMark.origin()),
|
|
912
|
+
preferBelow: computed(() => this.activeMark.pinned()),
|
|
913
|
+
axisEntries: this.axisEntries,
|
|
914
|
+
});
|
|
616
915
|
}
|
|
617
916
|
ngOnDestroy() {
|
|
917
|
+
this.scales.releaseTooltip(this.domainId);
|
|
618
918
|
this.scales.releaseDomain(this.domainId);
|
|
619
919
|
}
|
|
620
920
|
activeMark = chartActiveMark(() => this.tooltipLingerMs());
|
|
@@ -635,11 +935,28 @@ class ColumnSeriesComponent {
|
|
|
635
935
|
const plot = this.scales.plot();
|
|
636
936
|
return chartViewHeight(plot.height, plot.top, true);
|
|
637
937
|
}, ...(ngDevMode ? [{ debugName: "hitHeight" }] : /* istanbul ignore next */ []));
|
|
938
|
+
/** Stacked series sit on top of one another, so a full-slot hit box on each one means only the
|
|
939
|
+
* series drawn last is ever reachable. Stacked, a mark catches the pointer over its own segment
|
|
940
|
+
* and nothing else. */
|
|
941
|
+
stacked = computed(() => this.offsets() !== null, ...(ngDevMode ? [{ debugName: "stacked" }] : /* istanbul ignore next */ []));
|
|
942
|
+
/** Keeps a thin segment reachable without letting it reach into its neighbours. */
|
|
943
|
+
static MIN_STACK_HIT = 6;
|
|
944
|
+
hitBox(mark) {
|
|
945
|
+
if (!this.stacked()) {
|
|
946
|
+
return { y: 0, height: this.hitHeight() };
|
|
947
|
+
}
|
|
948
|
+
const height = Math.max(mark.height, ColumnSeriesComponent.MIN_STACK_HIT);
|
|
949
|
+
const overflow = height - mark.height;
|
|
950
|
+
return { y: mark.top - overflow / 2, height };
|
|
951
|
+
}
|
|
638
952
|
pinDiscRadius = PIN_DISC_RADIUS;
|
|
639
953
|
pinGlyphSize = PIN_GLYPH_SIZE;
|
|
640
954
|
pinGlyphOffset = -PIN_GLYPH_SIZE / 2;
|
|
641
955
|
pinGlyph = inject(DomSanitizer).bypassSecurityTrustHtml(ICONS.pin);
|
|
642
956
|
marks = computed(() => {
|
|
957
|
+
if (!(this.scales.measured?.() ?? true)) {
|
|
958
|
+
return [];
|
|
959
|
+
}
|
|
643
960
|
const toX = this.scales.xPosition();
|
|
644
961
|
const toY = this.scales.yPosition();
|
|
645
962
|
const spans = this.spans();
|
|
@@ -666,7 +983,7 @@ class ColumnSeriesComponent {
|
|
|
666
983
|
top: Math.min(tip, baseline),
|
|
667
984
|
height: Math.abs(tip - baseline),
|
|
668
985
|
labelY: below ? tip + VALUE_LABEL_GAP : tip - VALUE_LABEL_GAP,
|
|
669
|
-
pinY: Math.min(tip, baseline) + PIN_DISC_RADIUS,
|
|
986
|
+
pinY: Math.min(tip, baseline) + PIN_DISC_RADIUS + PIN_TOP_GAP,
|
|
670
987
|
// Growing from the baseline, never the mark's own tip - a column below zero grows
|
|
671
988
|
// downward, so its transform-origin flips to the top edge it hangs from.
|
|
672
989
|
origin: below ? 'top' : 'bottom',
|
|
@@ -679,45 +996,84 @@ class ColumnSeriesComponent {
|
|
|
679
996
|
markStagger(index) {
|
|
680
997
|
return `${staggerDelay(index, this.staggerMs())}ms`;
|
|
681
998
|
}
|
|
682
|
-
|
|
683
|
-
|
|
999
|
+
tooltipMark = computed(() => this.tooltipAnchor() === 'mark' ? '.bar' : undefined, ...(ngDevMode ? [{ debugName: "tooltipMark" }] : /* istanbul ignore next */ []));
|
|
1000
|
+
onMarkClick(event) {
|
|
1001
|
+
const hit = markOf(event);
|
|
1002
|
+
const mark = hit && this.marks()[hit.index];
|
|
1003
|
+
if (!hit || !mark) {
|
|
1004
|
+
return;
|
|
1005
|
+
}
|
|
1006
|
+
this.pointClicked.emit(mark.point);
|
|
684
1007
|
if (this.pinOnClick()) {
|
|
685
|
-
this.activeMark.pin(index, event, this.
|
|
1008
|
+
this.activeMark.pin(hit.index, event, this.tooltipMark(), hit.element);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
onMarkOver(event) {
|
|
1012
|
+
const hit = markOf(event);
|
|
1013
|
+
if (hit) {
|
|
1014
|
+
this.activeMark.enter(hit.index, event, this.tooltipMark(), hit.element);
|
|
686
1015
|
}
|
|
687
1016
|
}
|
|
688
|
-
|
|
689
|
-
|
|
1017
|
+
onMarkOut(event) {
|
|
1018
|
+
const hit = markOf(event);
|
|
1019
|
+
const next = event.relatedTarget instanceof Element
|
|
1020
|
+
? event.relatedTarget.closest('[data-mark-index]')
|
|
1021
|
+
: null;
|
|
1022
|
+
if (hit && next !== hit.element) {
|
|
1023
|
+
this.activeMark.leave();
|
|
1024
|
+
}
|
|
690
1025
|
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
this.onMarkEnter(index, event);
|
|
1026
|
+
roving = rovingMarks(() => this.marks().length);
|
|
1027
|
+
onMarkFocus(event) {
|
|
1028
|
+
const hit = markOf(event);
|
|
1029
|
+
if (hit) {
|
|
1030
|
+
this.roving.focus(hit.index);
|
|
1031
|
+
this.activeMark.enter(hit.index, event, this.tooltipMark(), hit.element);
|
|
1032
|
+
}
|
|
699
1033
|
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
return;
|
|
1034
|
+
onMarkBlur(event) {
|
|
1035
|
+
if (markOf(event)) {
|
|
1036
|
+
this.activeMark.leave();
|
|
704
1037
|
}
|
|
705
|
-
event.preventDefault();
|
|
706
|
-
this.rovingIndex.set(next);
|
|
707
|
-
focusMark(event.currentTarget.closest('.columns'), next);
|
|
708
1038
|
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
if (!this.interactive() || event.target !== event.currentTarget) {
|
|
1039
|
+
onMarkKey(event) {
|
|
1040
|
+
const hit = markOf(event);
|
|
1041
|
+
if (!hit) {
|
|
713
1042
|
return;
|
|
714
1043
|
}
|
|
715
|
-
event.
|
|
716
|
-
|
|
1044
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
1045
|
+
// Only the column's own key opens it: a key pressed on a control inside belongs to that
|
|
1046
|
+
// control.
|
|
1047
|
+
const mark = this.marks()[hit.index];
|
|
1048
|
+
if (this.interactive() && event.target === hit.element && mark) {
|
|
1049
|
+
event.preventDefault();
|
|
1050
|
+
this.pointClicked.emit(mark.point);
|
|
1051
|
+
}
|
|
1052
|
+
return;
|
|
1053
|
+
}
|
|
1054
|
+
this.roving.navigate(event, hit.index, hit.element.closest('.columns'));
|
|
717
1055
|
}
|
|
718
1056
|
entryLabel(mark) {
|
|
719
1057
|
return `${mark.point.label}, ${mark.formattedValue}`;
|
|
720
1058
|
}
|
|
1059
|
+
/** This series' reading at the category the cursor is on. Filled whatever `tooltip` says: it
|
|
1060
|
+
* feeds the container's category panel, never a panel of this mark's own. */
|
|
1061
|
+
axisEntries = computed(() => {
|
|
1062
|
+
const categoryIndex = this.scales.activeIndex();
|
|
1063
|
+
const mark = this.marks()[categoryIndex];
|
|
1064
|
+
if (categoryIndex < 0 || !mark) {
|
|
1065
|
+
return [];
|
|
1066
|
+
}
|
|
1067
|
+
return [
|
|
1068
|
+
{
|
|
1069
|
+
label: this.seriesLabel() ?? mark.point.label,
|
|
1070
|
+
value: mark.point.value,
|
|
1071
|
+
formatted: mark.formattedValue,
|
|
1072
|
+
color: mark.color,
|
|
1073
|
+
hatched: mark.hatched,
|
|
1074
|
+
},
|
|
1075
|
+
];
|
|
1076
|
+
}, ...(ngDevMode ? [{ debugName: "axisEntries" }] : /* istanbul ignore next */ []));
|
|
721
1077
|
tooltipContext = computed(() => {
|
|
722
1078
|
const mark = this.marks()[this.activeMark.index()];
|
|
723
1079
|
if (this.tooltip() === 'none' || !mark) {
|
|
@@ -732,6 +1088,7 @@ class ColumnSeriesComponent {
|
|
|
732
1088
|
value: mark.point.value,
|
|
733
1089
|
formatted: mark.formattedValue,
|
|
734
1090
|
color: mark.color,
|
|
1091
|
+
hatched: mark.hatched,
|
|
735
1092
|
detail: this.partOfWhole()
|
|
736
1093
|
? describeShare(this.data().map((point) => point.value), this.activeMark.index())
|
|
737
1094
|
: undefined,
|
|
@@ -740,12 +1097,12 @@ class ColumnSeriesComponent {
|
|
|
740
1097
|
};
|
|
741
1098
|
}, ...(ngDevMode ? [{ debugName: "tooltipContext" }] : /* istanbul ignore next */ []));
|
|
742
1099
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ColumnSeriesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
743
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ColumnSeriesComponent, isStandalone: true, selector: "g[dsColumnSeries]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, showValues: { classPropertyName: "showValues", publicName: "showValues", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, partOfWhole: { classPropertyName: "partOfWhole", publicName: "partOfWhole", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipAnchor: { classPropertyName: "tooltipAnchor", publicName: "tooltipAnchor", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, columnWidthRatio: { classPropertyName: "columnWidthRatio", publicName: "columnWidthRatio", isSignal: true, isRequired: false, transformFunction: null }, slot: { classPropertyName: "slot", publicName: "slot", isSignal: true, isRequired: false, transformFunction: null }, slotCount: { classPropertyName: "slotCount", publicName: "slotCount", isSignal: true, isRequired: false, transformFunction: null }, offsets: { classPropertyName: "offsets", publicName: "offsets", isSignal: true, isRequired: false, transformFunction: null }, seriesColor: { classPropertyName: "seriesColor", publicName: "seriesColor", isSignal: true, isRequired: false, transformFunction: null }, seriesFill: { classPropertyName: "seriesFill", publicName: "seriesFill", isSignal: true, isRequired: false, transformFunction: null }, seriesLabel: { classPropertyName: "seriesLabel", publicName: "seriesLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClicked: "pointClicked" }, exportAs: ["dsColumnSeries"], ngImport: i0, template: "<svg:g\n class=\"columns\"\n [class.dims-others]=\"dimOthers()\"\n [style.--_column-chart-column-share]=\"markWidthPx()\"\n [style.--_column-chart-slot-step]=\"slotStepPx()\"\n [style.--_column-slot]=\"slot()\"\n [style.--_column-slots]=\"slotCount()\">\n <!-- `userSpaceOnUse`, so the stripe pitch is the same on a tall column and a short one: with the\n default object bounding box it would scale with each mark and read as a different texture\n per bar. -->\n <svg:defs>\n <svg:pattern\n class=\"hatch\"\n patternUnits=\"userSpaceOnUse\"\n width=\"8\"\n height=\"8\"\n patternTransform=\"rotate(45)\"\n [attr.id]=\"hatchId\">\n <svg:rect\n class=\"hatch-ground\"\n width=\"8\"\n height=\"8\" />\n\n <svg:line\n class=\"hatch-stripe\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"8\" />\n </svg:pattern>\n </svg:defs>\n\n @for (mark of marks(); track mark.key; let index = $index) {\n <svg:g\n class=\"column\"\n animate.leave=\"mark-leave\"\n [class.interactive]=\"interactive()\"\n [class.below-baseline]=\"mark.below\"\n [class.is-pinned]=\"activeMark.pinned() && activeMark.index() === index\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [style.--_column-mark-height]=\"mark.height + 'px'\"\n [style.--_column-baseline-y]=\"mark.baseline + 'px'\"\n [style.--_column-x]=\"mark.x + 'px'\"\n [attr.data-mark-index]=\"index\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.aria-label]=\"interactive() ? entryLabel(mark) : null\"\n (pointerenter)=\"onMarkEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(mark.point, index, $event)\"\n (keydown.enter)=\"onPointKey(mark.point, $event)\"\n (keydown.space)=\"onPointKey(mark.point, $event)\">\n <!-- The box that catches the pointer is the whole category slot, not the drawn column: a\n column two pixels tall is otherwise unreachable, and a pointer that has to find the\n mark is a pointer that misses it. -->\n <svg:rect\n class=\"hit-area\"\n y=\"0\"\n [attr.height]=\"hitHeight()\" />\n\n <svg:g\n class=\"bar\"\n animate.enter=\"mark-enter\"\n [style.transform-origin]=\"mark.origin\">\n <!-- Under the capped rect, not beside it: `rx` rounds all four corners, and the cap\n belongs on the free end alone. This one fills the two corners at the baseline back\n in, and both keep `y` and `height` a plain interpolable length, which a `<path>`\n would not. -->\n <svg:rect\n class=\"bar-base\"\n [attr.fill]=\"mark.color\" />\n\n <svg:rect\n class=\"bar-cap\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"mark.color\" />\n\n <!-- Stripes OVER the painted mark, not a pattern in place of its fill: a pattern carries\n its own colour, so one shared definition cannot take each mark's. Painting the surface\n colour through it leaves the mark's own hue showing between the stripes. -->\n @if (mark.hatched) {\n <svg:rect\n class=\"bar-hatch\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"'url(#' + hatchId + ')'\" />\n }\n </svg:g>\n\n @if (showValues()) {\n <svg:text\n class=\"value\"\n text-anchor=\"middle\"\n [attr.y]=\"mark.labelY\">\n {{ mark.formattedValue }}\n </svg:text>\n }\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <svg:g\n class=\"pin-marker\"\n aria-hidden=\"true\"\n [attr.transform]=\"'translate(0,' + mark.pinY + ')'\">\n <svg:circle\n class=\"pin-disc\"\n [attr.r]=\"pinDiscRadius\" />\n\n <svg:svg\n class=\"pin-glyph\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n [attr.x]=\"pinGlyphOffset\"\n [attr.y]=\"pinGlyphOffset\"\n [attr.width]=\"pinGlyphSize\"\n [attr.height]=\"pinGlyphSize\"\n [innerHTML]=\"pinGlyph\" />\n </svg:g>\n }\n </svg:g>\n }\n</svg:g>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.column .bar{transform-origin:bottom}.bar.mark-enter{animation:ds-chart-mark-grow-y var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.column.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}@media not (forced-colors:active){.column:focus{outline:none}}.columns .column{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.columns .column.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:hover) .column.interactive:not(:hover),.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:focus-visible) .column.interactive:not(:focus-visible),.columns.dims-others:has(.column.is-pinned) .column:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.columns .column.interactive{cursor:pointer}.columns{--_column-chart-column-max-width: var(--ds-column-chart-column-max-width, 48px);--_column-chart-column-gap: var(--ds-column-chart-column-gap, var(--ds-chart-bar-gap));--_column-chart-cap-radius: var( --ds-column-chart-cap-radius, var(--ds-chart-mark-cap-radius) );--_column-chart-hatch-color: var( --ds-chart-hatch-color, var(--surface-default) );--_column-chart-hatch-width: var(--ds-chart-hatch-width, 3px)}.column{--_column-mark-width: min( var(--_column-chart-column-share), var(--_column-chart-column-max-width) );--_column-hit-width: min( var(--_column-chart-slot-step), calc( var(--_column-chart-column-max-width) + var(--_column-chart-column-gap) ) );--_column-square-height: min( var(--_column-chart-cap-radius), calc(var(--_column-mark-height) / 2) );--_column-slot-offset: calc( (2 * var(--_column-slot, 0) - var(--_column-slots, 1) + 1) * (var(--_column-mark-width) + var(--_column-chart-column-gap)) / 2 );transform:translate(calc(var(--_column-x, 0px) + var(--_column-slot-offset)))}.hit-area{width:var(--_column-hit-width);x:calc(var(--_column-hit-width) / -2);fill:transparent}.bar{transform-box:fill-box}.bar-base,.bar-cap,.bar-hatch{width:var(--_column-mark-width);x:calc(var(--_column-mark-width) / -2);transition:y var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),height var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.bar-cap{rx:var(--_column-chart-cap-radius)}.hatch-ground{fill:none}.hatch-stripe{stroke:var(--_column-chart-hatch-color);stroke-width:var(--_column-chart-hatch-width)}.bar-hatch{rx:var(--_column-chart-cap-radius);pointer-events:none}.bar-base{height:var(--_column-square-height);y:calc(var(--_column-baseline-y) - var(--_column-square-height))}.column.below-baseline .bar-base{y:var(--_column-baseline-y)}.value{fill:currentcolor;font-size:var(--font-size-xs);font-weight:700;pointer-events:none}.column.below-baseline .value{dominant-baseline:hanging}@media not (forced-colors:active){.column.interactive:focus-visible{outline:none}}.column.interactive:focus-visible .bar-cap{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color))}@media(forced-colors:active){.column.interactive:focus-visible .bar-cap{stroke:Highlight;filter:none}}.pin-marker{pointer-events:none}.pin-disc{fill:var(--surface-default);stroke:var(--border-divider);stroke-width:var(--border-width-default)}.pin-glyph{color:var(--text-primary)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1100
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ColumnSeriesComponent, isStandalone: true, selector: "g[dsColumnSeries]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, showValues: { classPropertyName: "showValues", publicName: "showValues", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, partOfWhole: { classPropertyName: "partOfWhole", publicName: "partOfWhole", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipAnchor: { classPropertyName: "tooltipAnchor", publicName: "tooltipAnchor", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, columnWidthRatio: { classPropertyName: "columnWidthRatio", publicName: "columnWidthRatio", isSignal: true, isRequired: false, transformFunction: null }, slot: { classPropertyName: "slot", publicName: "slot", isSignal: true, isRequired: false, transformFunction: null }, slotCount: { classPropertyName: "slotCount", publicName: "slotCount", isSignal: true, isRequired: false, transformFunction: null }, offsets: { classPropertyName: "offsets", publicName: "offsets", isSignal: true, isRequired: false, transformFunction: null }, seriesColor: { classPropertyName: "seriesColor", publicName: "seriesColor", isSignal: true, isRequired: false, transformFunction: null }, seriesFill: { classPropertyName: "seriesFill", publicName: "seriesFill", isSignal: true, isRequired: false, transformFunction: null }, seriesLabel: { classPropertyName: "seriesLabel", publicName: "seriesLabel", isSignal: true, isRequired: false, transformFunction: null }, seriesKey: { classPropertyName: "seriesKey", publicName: "seriesKey", isSignal: true, isRequired: false, transformFunction: null }, highlighted: { classPropertyName: "highlighted", publicName: "highlighted", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClicked: "pointClicked" }, exportAs: ["dsColumnSeries"], ngImport: i0, template: "<svg:g\n class=\"columns\"\n [class.dims-others]=\"dimOthers()\"\n [class.is-dimmed]=\"dimmedBySeries()\"\n [style.--_column-chart-column-share]=\"markWidthPx()\"\n [style.--_column-chart-slot-step]=\"slotStepPx()\"\n [style.--_column-slot]=\"slot()\"\n [style.--_column-slots]=\"slotCount()\"\n (pointerover)=\"onMarkOver($event)\"\n (pointerout)=\"onMarkOut($event)\"\n (focusin)=\"onMarkFocus($event)\"\n (focusout)=\"onMarkBlur($event)\"\n (keydown)=\"onMarkKey($event)\"\n (click)=\"onMarkClick($event)\">\n <!-- `userSpaceOnUse`, so the stripe pitch is the same on a tall column and a short one: with the\n default object bounding box it would scale with each mark and read as a different texture\n per bar. -->\n <svg:defs>\n <svg:pattern\n class=\"hatch\"\n patternUnits=\"userSpaceOnUse\"\n width=\"8\"\n height=\"8\"\n patternTransform=\"rotate(45)\"\n [attr.id]=\"hatchId\">\n <svg:rect\n class=\"hatch-ground\"\n width=\"8\"\n height=\"8\" />\n\n <svg:line\n class=\"hatch-stripe\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"8\" />\n </svg:pattern>\n </svg:defs>\n\n @for (mark of marks(); track mark.key; let index = $index) {\n <svg:g\n class=\"column\"\n [class.interactive]=\"interactive()\"\n [class.below-baseline]=\"mark.below\"\n [class.is-pinned]=\"activeMark.pinned() && activeMark.index() === index\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [style.--_column-mark-height]=\"mark.height + 'px'\"\n [style.--_column-baseline-y]=\"mark.baseline + 'px'\"\n [style.--_column-x]=\"mark.x + 'px'\"\n [attr.data-mark-index]=\"index\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === roving.tabStop() ? 0 : -1) : null\n \"\n [attr.aria-label]=\"interactive() ? entryLabel(mark) : null\"\n (animate.leave)=\"leaveMark($event)\">\n <!-- The box that catches the pointer is the whole category slot, not the drawn column: a\n column two pixels tall is otherwise unreachable, and a pointer that has to find the\n mark is a pointer that misses it. -->\n @let hit = hitBox(mark);\n\n <svg:rect\n class=\"hit-area\"\n [attr.y]=\"hit.y\"\n [attr.height]=\"hit.height\" />\n\n <svg:g\n class=\"bar\"\n [style.transform-origin]=\"mark.origin\">\n <!-- Under the capped rect, not beside it: `rx` rounds all four corners, and the cap\n belongs on the free end alone. This one fills the two corners at the baseline back\n in, and both keep `y` and `height` a plain interpolable length, which a `<path>`\n would not. -->\n <svg:rect\n class=\"bar-base\"\n [attr.fill]=\"mark.color\" />\n\n <svg:rect\n class=\"bar-cap\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"mark.color\" />\n\n <!-- Stripes OVER the painted mark, not a pattern in place of its fill: a pattern carries\n its own colour, so one shared definition cannot take each mark's. Painting the surface\n colour through it leaves the mark's own hue showing between the stripes. -->\n @if (mark.hatched) {\n <svg:rect\n class=\"bar-hatch\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"'url(#' + hatchId + ')'\" />\n }\n </svg:g>\n\n @if (showValues()) {\n <svg:text\n class=\"value\"\n text-anchor=\"middle\"\n [attr.y]=\"mark.labelY\">\n {{ mark.formattedValue }}\n </svg:text>\n }\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <svg:g\n class=\"pin-marker\"\n aria-hidden=\"true\"\n [attr.transform]=\"'translate(0,' + mark.pinY + ')'\">\n <svg:circle\n class=\"pin-disc\"\n [attr.r]=\"pinDiscRadius\" />\n\n <svg:svg\n class=\"pin-glyph\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n [attr.x]=\"pinGlyphOffset\"\n [attr.y]=\"pinGlyphOffset\"\n [attr.width]=\"pinGlyphSize\"\n [attr.height]=\"pinGlyphSize\"\n [innerHTML]=\"pinGlyph\" />\n </svg:g>\n }\n </svg:g>\n }\n</svg:g>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.column .bar{transform-origin:bottom}.bar{animation:ds-chart-mark-grow-y var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.column.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}@media not (forced-colors:active){.column:focus{outline:none}}.columns .column{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.columns .column.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:hover) .column.interactive:not(:hover),.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:focus-visible) .column.interactive:not(:focus-visible),.columns.dims-others:has(.column.is-pinned) .column:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.columns .column.interactive{cursor:pointer}.columns{--_column-chart-column-max-width: var(--ds-column-chart-column-max-width, 48px);--_column-chart-column-gap: var(--ds-column-chart-column-gap, var(--ds-chart-bar-gap));--_column-chart-cap-radius: var( --ds-column-chart-cap-radius, var(--ds-chart-mark-cap-radius) );--_chart-hatch-color: var( --ds-chart-hatch-color, var(--surface-default) );--_chart-hatch-width: var(--ds-chart-hatch-width, 3px)}.column{--_column-mark-width: min( var(--_column-chart-column-share), var(--_column-chart-column-max-width) );--_column-hit-width: min( var(--_column-chart-slot-step), calc( var(--_column-chart-column-max-width) + var(--_column-chart-column-gap) ) );--_column-square-height: min( var(--_column-chart-cap-radius), calc(var(--_column-mark-height) / 2) );--_column-slot-offset: calc( (2 * var(--_column-slot, 0) - var(--_column-slots, 1) + 1) * (var(--_column-mark-width) + var(--_column-chart-column-gap)) / 2 );transform:translate(calc(var(--_column-x, 0px) + var(--_column-slot-offset)))}.hit-area{width:var(--_column-hit-width);x:calc(var(--_column-hit-width) / -2);fill:transparent}.bar{transform-box:fill-box}.bar-base,.bar-cap,.bar-hatch{width:var(--_column-mark-width);x:calc(var(--_column-mark-width) / -2);transition:y var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),height var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.bar-cap{rx:var(--_column-chart-cap-radius)}.hatch-ground{fill:none}.hatch-stripe{stroke:var(--_chart-hatch-color);stroke-width:var(--_chart-hatch-width)}.bar-hatch{rx:var(--_column-chart-cap-radius);pointer-events:none}.bar-base{height:var(--_column-square-height);y:calc(var(--_column-baseline-y) - var(--_column-square-height))}.column.below-baseline .bar-base{y:var(--_column-baseline-y)}.value{fill:currentcolor;font-size:var(--font-size-xs);font-weight:700;pointer-events:none}.column.below-baseline .value{dominant-baseline:hanging}@media not (forced-colors:active){.column.interactive:focus-visible{outline:none}}.column.interactive:focus-visible .bar-cap{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color))}@media(forced-colors:active){.column.interactive:focus-visible .bar-cap{stroke:Highlight;filter:none}}.pin-marker{pointer-events:none}.pin-disc{fill:var(--surface-default);stroke:var(--border-divider);stroke-width:var(--border-width-default)}.pin-glyph{color:var(--text-primary)}.columns.is-dimmed{opacity:var(--ds-chart-dim-opacity);transition:opacity var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
744
1101
|
}
|
|
745
1102
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ColumnSeriesComponent, decorators: [{
|
|
746
1103
|
type: Component,
|
|
747
|
-
args: [{ selector: 'g[dsColumnSeries]', standalone: true, exportAs: 'dsColumnSeries', encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g\n class=\"columns\"\n [class.dims-others]=\"dimOthers()\"\n [style.--_column-chart-column-share]=\"markWidthPx()\"\n [style.--_column-chart-slot-step]=\"slotStepPx()\"\n [style.--_column-slot]=\"slot()\"\n [style.--_column-slots]=\"slotCount()\">\n <!-- `userSpaceOnUse`, so the stripe pitch is the same on a tall column and a short one: with the\n default object bounding box it would scale with each mark and read as a different texture\n per bar. -->\n <svg:defs>\n <svg:pattern\n class=\"hatch\"\n patternUnits=\"userSpaceOnUse\"\n width=\"8\"\n height=\"8\"\n patternTransform=\"rotate(45)\"\n [attr.id]=\"hatchId\">\n <svg:rect\n class=\"hatch-ground\"\n width=\"8\"\n height=\"8\" />\n\n <svg:line\n class=\"hatch-stripe\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"8\" />\n </svg:pattern>\n </svg:defs>\n\n @for (mark of marks(); track mark.key; let index = $index) {\n <svg:g\n class=\"column\"\n
|
|
748
|
-
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], showValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValues", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], partOfWhole: [{ type: i0.Input, args: [{ isSignal: true, alias: "partOfWhole", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipAnchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipAnchor", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], columnWidthRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnWidthRatio", required: false }] }], slot: [{ type: i0.Input, args: [{ isSignal: true, alias: "slot", required: false }] }], slotCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "slotCount", required: false }] }], offsets: [{ type: i0.Input, args: [{ isSignal: true, alias: "offsets", required: false }] }], seriesColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesColor", required: false }] }], seriesFill: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesFill", required: false }] }], seriesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesLabel", required: false }] }], pointClicked: [{ type: i0.Output, args: ["pointClicked"] }] } });
|
|
1104
|
+
args: [{ selector: 'g[dsColumnSeries]', standalone: true, exportAs: 'dsColumnSeries', encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g\n class=\"columns\"\n [class.dims-others]=\"dimOthers()\"\n [class.is-dimmed]=\"dimmedBySeries()\"\n [style.--_column-chart-column-share]=\"markWidthPx()\"\n [style.--_column-chart-slot-step]=\"slotStepPx()\"\n [style.--_column-slot]=\"slot()\"\n [style.--_column-slots]=\"slotCount()\"\n (pointerover)=\"onMarkOver($event)\"\n (pointerout)=\"onMarkOut($event)\"\n (focusin)=\"onMarkFocus($event)\"\n (focusout)=\"onMarkBlur($event)\"\n (keydown)=\"onMarkKey($event)\"\n (click)=\"onMarkClick($event)\">\n <!-- `userSpaceOnUse`, so the stripe pitch is the same on a tall column and a short one: with the\n default object bounding box it would scale with each mark and read as a different texture\n per bar. -->\n <svg:defs>\n <svg:pattern\n class=\"hatch\"\n patternUnits=\"userSpaceOnUse\"\n width=\"8\"\n height=\"8\"\n patternTransform=\"rotate(45)\"\n [attr.id]=\"hatchId\">\n <svg:rect\n class=\"hatch-ground\"\n width=\"8\"\n height=\"8\" />\n\n <svg:line\n class=\"hatch-stripe\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"8\" />\n </svg:pattern>\n </svg:defs>\n\n @for (mark of marks(); track mark.key; let index = $index) {\n <svg:g\n class=\"column\"\n [class.interactive]=\"interactive()\"\n [class.below-baseline]=\"mark.below\"\n [class.is-pinned]=\"activeMark.pinned() && activeMark.index() === index\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [style.--_column-mark-height]=\"mark.height + 'px'\"\n [style.--_column-baseline-y]=\"mark.baseline + 'px'\"\n [style.--_column-x]=\"mark.x + 'px'\"\n [attr.data-mark-index]=\"index\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === roving.tabStop() ? 0 : -1) : null\n \"\n [attr.aria-label]=\"interactive() ? entryLabel(mark) : null\"\n (animate.leave)=\"leaveMark($event)\">\n <!-- The box that catches the pointer is the whole category slot, not the drawn column: a\n column two pixels tall is otherwise unreachable, and a pointer that has to find the\n mark is a pointer that misses it. -->\n @let hit = hitBox(mark);\n\n <svg:rect\n class=\"hit-area\"\n [attr.y]=\"hit.y\"\n [attr.height]=\"hit.height\" />\n\n <svg:g\n class=\"bar\"\n [style.transform-origin]=\"mark.origin\">\n <!-- Under the capped rect, not beside it: `rx` rounds all four corners, and the cap\n belongs on the free end alone. This one fills the two corners at the baseline back\n in, and both keep `y` and `height` a plain interpolable length, which a `<path>`\n would not. -->\n <svg:rect\n class=\"bar-base\"\n [attr.fill]=\"mark.color\" />\n\n <svg:rect\n class=\"bar-cap\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"mark.color\" />\n\n <!-- Stripes OVER the painted mark, not a pattern in place of its fill: a pattern carries\n its own colour, so one shared definition cannot take each mark's. Painting the surface\n colour through it leaves the mark's own hue showing between the stripes. -->\n @if (mark.hatched) {\n <svg:rect\n class=\"bar-hatch\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"'url(#' + hatchId + ')'\" />\n }\n </svg:g>\n\n @if (showValues()) {\n <svg:text\n class=\"value\"\n text-anchor=\"middle\"\n [attr.y]=\"mark.labelY\">\n {{ mark.formattedValue }}\n </svg:text>\n }\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <svg:g\n class=\"pin-marker\"\n aria-hidden=\"true\"\n [attr.transform]=\"'translate(0,' + mark.pinY + ')'\">\n <svg:circle\n class=\"pin-disc\"\n [attr.r]=\"pinDiscRadius\" />\n\n <svg:svg\n class=\"pin-glyph\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n [attr.x]=\"pinGlyphOffset\"\n [attr.y]=\"pinGlyphOffset\"\n [attr.width]=\"pinGlyphSize\"\n [attr.height]=\"pinGlyphSize\"\n [innerHTML]=\"pinGlyph\" />\n </svg:g>\n }\n </svg:g>\n }\n</svg:g>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.column .bar{transform-origin:bottom}.bar{animation:ds-chart-mark-grow-y var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.column.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}@media not (forced-colors:active){.column:focus{outline:none}}.columns .column{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.columns .column.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:hover) .column.interactive:not(:hover),.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:focus-visible) .column.interactive:not(:focus-visible),.columns.dims-others:has(.column.is-pinned) .column:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.columns .column.interactive{cursor:pointer}.columns{--_column-chart-column-max-width: var(--ds-column-chart-column-max-width, 48px);--_column-chart-column-gap: var(--ds-column-chart-column-gap, var(--ds-chart-bar-gap));--_column-chart-cap-radius: var( --ds-column-chart-cap-radius, var(--ds-chart-mark-cap-radius) );--_chart-hatch-color: var( --ds-chart-hatch-color, var(--surface-default) );--_chart-hatch-width: var(--ds-chart-hatch-width, 3px)}.column{--_column-mark-width: min( var(--_column-chart-column-share), var(--_column-chart-column-max-width) );--_column-hit-width: min( var(--_column-chart-slot-step), calc( var(--_column-chart-column-max-width) + var(--_column-chart-column-gap) ) );--_column-square-height: min( var(--_column-chart-cap-radius), calc(var(--_column-mark-height) / 2) );--_column-slot-offset: calc( (2 * var(--_column-slot, 0) - var(--_column-slots, 1) + 1) * (var(--_column-mark-width) + var(--_column-chart-column-gap)) / 2 );transform:translate(calc(var(--_column-x, 0px) + var(--_column-slot-offset)))}.hit-area{width:var(--_column-hit-width);x:calc(var(--_column-hit-width) / -2);fill:transparent}.bar{transform-box:fill-box}.bar-base,.bar-cap,.bar-hatch{width:var(--_column-mark-width);x:calc(var(--_column-mark-width) / -2);transition:y var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),height var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.bar-cap{rx:var(--_column-chart-cap-radius)}.hatch-ground{fill:none}.hatch-stripe{stroke:var(--_chart-hatch-color);stroke-width:var(--_chart-hatch-width)}.bar-hatch{rx:var(--_column-chart-cap-radius);pointer-events:none}.bar-base{height:var(--_column-square-height);y:calc(var(--_column-baseline-y) - var(--_column-square-height))}.column.below-baseline .bar-base{y:var(--_column-baseline-y)}.value{fill:currentcolor;font-size:var(--font-size-xs);font-weight:700;pointer-events:none}.column.below-baseline .value{dominant-baseline:hanging}@media not (forced-colors:active){.column.interactive:focus-visible{outline:none}}.column.interactive:focus-visible .bar-cap{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color))}@media(forced-colors:active){.column.interactive:focus-visible .bar-cap{stroke:Highlight;filter:none}}.pin-marker{pointer-events:none}.pin-disc{fill:var(--surface-default);stroke:var(--border-divider);stroke-width:var(--border-width-default)}.pin-glyph{color:var(--text-primary)}.columns.is-dimmed{opacity:var(--ds-chart-dim-opacity);transition:opacity var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}\n"] }]
|
|
1105
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], showValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValues", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], partOfWhole: [{ type: i0.Input, args: [{ isSignal: true, alias: "partOfWhole", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipAnchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipAnchor", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], columnWidthRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnWidthRatio", required: false }] }], slot: [{ type: i0.Input, args: [{ isSignal: true, alias: "slot", required: false }] }], slotCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "slotCount", required: false }] }], offsets: [{ type: i0.Input, args: [{ isSignal: true, alias: "offsets", required: false }] }], seriesColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesColor", required: false }] }], seriesFill: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesFill", required: false }] }], seriesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesLabel", required: false }] }], seriesKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesKey", required: false }] }], highlighted: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlighted", required: false }] }], pointClicked: [{ type: i0.Output, args: ["pointClicked"] }] } });
|
|
749
1106
|
|
|
750
1107
|
let nextSeriesId = 0;
|
|
751
1108
|
/**
|
|
@@ -754,21 +1111,70 @@ let nextSeriesId = 0;
|
|
|
754
1111
|
*
|
|
755
1112
|
* Hosted on a `<g>` rather than an element of its own: an element the SVG specification does not
|
|
756
1113
|
* know is not rendered, and neither are its descendants. Written as `<svg:g dsLineSeries>`.
|
|
757
|
-
*
|
|
758
|
-
* @internal
|
|
759
1114
|
*/
|
|
760
1115
|
class LineSeriesComponent {
|
|
1116
|
+
leaveMark = leaveMark;
|
|
761
1117
|
scales = inject(CHART_SCALES);
|
|
762
1118
|
/** Not `input.required`: the preset reads `tooltipContext()` from a binding on this same
|
|
763
1119
|
* element, and a required input throws NG0950 for the pass before its own value is written. */
|
|
764
1120
|
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
1121
|
+
/** Draws a round marker at every reading. Off leaves the line alone, which reads better past
|
|
1122
|
+
* roughly twenty points. */
|
|
765
1123
|
showMarkers = input(true, { ...(ngDevMode ? { debugName: "showMarkers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1124
|
+
/** Lays the line and its markers on a band of the surface colour, so they stay legible where
|
|
1125
|
+
* they cross other marks. On by default: a line shares its plot more often than not, and on an
|
|
1126
|
+
* empty plot the band only separates it from the gridlines. */
|
|
1127
|
+
outline = input(true, { ...(ngDevMode ? { debugName: "outline" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1128
|
+
/** Turns on the click affordance - the pointer cursor and the hover tint. `pointClicked`
|
|
1129
|
+
* fires whether or not this is set. */
|
|
766
1130
|
interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1131
|
+
/** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a
|
|
1132
|
+
* press outside releases it. Pinning is a state, not a handler. */
|
|
1133
|
+
pinOnClick = input(false, { ...(ngDevMode ? { debugName: "pinOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1134
|
+
/** Fades every series but the one under the pointer. Off by default: the dimming buys loudness
|
|
1135
|
+
* for one line and pays for it with the separation between the rest. */
|
|
1136
|
+
dimOthers = input(false, { ...(ngDevMode ? { debugName: "dimOthers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1137
|
+
/** The one series to single out: every other one draws faded and this one draws bold, so the
|
|
1138
|
+
* comparison survives a monochrome print. Driven from a legend, or from whatever else the app
|
|
1139
|
+
* uses to mean "show me this one". Fades the others whether or not `dimOthers` is set, which
|
|
1140
|
+
* governs only what a pointer over a marker does. */
|
|
1141
|
+
highlighted = input(null, ...(ngDevMode ? [{ debugName: "highlighted" }] : /* istanbul ignore next */ []));
|
|
1142
|
+
/** A dash pattern per series, in the order the series are given. A series past the end of the
|
|
1143
|
+
* list, or given an empty string, draws solid. */
|
|
1144
|
+
patterns = input([], ...(ngDevMode ? [{ debugName: "patterns" }] : /* istanbul ignore next */ []));
|
|
1145
|
+
/** Fills each area from the series below it rather than from the baseline, which is what a
|
|
1146
|
+
* stacked plot needs and what the fill reads as. */
|
|
1147
|
+
stacked = input(false, { ...(ngDevMode ? { debugName: "stacked" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1148
|
+
/** The dash for a series' position, or null where it draws solid. */
|
|
1149
|
+
dashFor(seriesIndex) {
|
|
1150
|
+
return this.patterns()[seriesIndex] || null;
|
|
1151
|
+
}
|
|
1152
|
+
/** Milliseconds between one marker's entrance and the next. The total is capped. */
|
|
767
1153
|
staggerMs = input(0, { ...(ngDevMode ? { debugName: "staggerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
1154
|
+
/** What a `null` reading draws: `'break'` leaves a hole in the line, `'zero'` plots a point
|
|
1155
|
+
* at zero. A missing measurement and a measured zero are different facts. */
|
|
768
1156
|
gaps = input('break', ...(ngDevMode ? [{ debugName: "gaps" }] : /* istanbul ignore next */ []));
|
|
1157
|
+
/** How the line joins its readings. `'linear'` by default, which asserts nothing the data does
|
|
1158
|
+
* not say; a curve is a claim about what happened BETWEEN two readings. `'step'` holds each
|
|
1159
|
+
* reading to the next, `'smooth'` is a monotone cubic that draws no peak the data lacks. */
|
|
1160
|
+
curve = input('linear', ...(ngDevMode ? [{ debugName: "curve" }] : /* istanbul ignore next */ []));
|
|
1161
|
+
/** Whether a hovered or focused reading opens a tooltip, and for what. `'item'` names the
|
|
1162
|
+
* marker itself. `'axis'` names every series at the category under the pointer, which is the
|
|
1163
|
+
* reading a multi-series line is compared on - it follows the container's `cursor`, so set
|
|
1164
|
+
* `cursor="category"` on `ds-chart` with it or nothing marks the category being read. */
|
|
769
1165
|
tooltip = input('item', ...(ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []));
|
|
1166
|
+
/** Where an `'axis'` panel hangs: `'reading'` puts it over the highest reading in the category,
|
|
1167
|
+
* so it names what it points at and stays put while the pointer travels within one band;
|
|
1168
|
+
* `'pointer'` follows the cursor. */
|
|
1169
|
+
tooltipAnchor = input('reading', ...(ngDevMode ? [{ debugName: "tooltipAnchor" }] : /* istanbul ignore next */ []));
|
|
1170
|
+
/** How long the panel survives the pointer leaving the marker. Raise it only for a panel a
|
|
1171
|
+
* reader has to REACH, which is WCAG 1.4.13's hoverable clause; about 140 crosses the gap. */
|
|
770
1172
|
tooltipLingerMs = input(0, { ...(ngDevMode ? { debugName: "tooltipLingerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
1173
|
+
/** Formats every value this series prints. Called with `'tick'` for an axis label and
|
|
1174
|
+
* `'tooltip'` everywhere a value is printed in full. */
|
|
771
1175
|
valueFormat = input(defaultChartFormat, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
|
|
1176
|
+
/** The clicked reading, with the series it belongs to and its position in `categories`.
|
|
1177
|
+
* Fires on click and on Enter or Space, whatever `interactive` says. */
|
|
772
1178
|
pointClicked = output();
|
|
773
1179
|
domainId = `line-series-${nextSeriesId++}`;
|
|
774
1180
|
constructor() {
|
|
@@ -776,8 +1182,15 @@ class LineSeriesComponent {
|
|
|
776
1182
|
this.scales.reportDomain(`${this.domainId}-primary`, this.valuesOn('primary'), 'primary');
|
|
777
1183
|
this.scales.reportDomain(`${this.domainId}-secondary`, this.valuesOn('secondary'), 'secondary');
|
|
778
1184
|
});
|
|
1185
|
+
// The container opens the panel, so a plot holding several marks can only ever show one.
|
|
1186
|
+
this.scales.reportTooltip(this.domainId, {
|
|
1187
|
+
context: this.tooltipContext,
|
|
1188
|
+
origin: this.tooltipOrigin,
|
|
1189
|
+
axisEntries: this.axisEntries,
|
|
1190
|
+
});
|
|
779
1191
|
}
|
|
780
1192
|
ngOnDestroy() {
|
|
1193
|
+
this.scales.releaseTooltip(this.domainId);
|
|
781
1194
|
this.scales.releaseDomain(`${this.domainId}-primary`);
|
|
782
1195
|
this.scales.releaseDomain(`${this.domainId}-secondary`);
|
|
783
1196
|
}
|
|
@@ -800,6 +1213,9 @@ class LineSeriesComponent {
|
|
|
800
1213
|
return readings;
|
|
801
1214
|
}
|
|
802
1215
|
plotted = computed(() => {
|
|
1216
|
+
if (!(this.scales.measured?.() ?? true)) {
|
|
1217
|
+
return [];
|
|
1218
|
+
}
|
|
803
1219
|
const toX = this.scales.xPosition();
|
|
804
1220
|
const primaryY = this.scales.yPosition();
|
|
805
1221
|
const secondaryY = this.scales.secondaryYPosition();
|
|
@@ -819,13 +1235,14 @@ class LineSeriesComponent {
|
|
|
819
1235
|
});
|
|
820
1236
|
const segments = lineSegments(points);
|
|
821
1237
|
const format = this.valueFormat();
|
|
1238
|
+
const curve = this.curve();
|
|
822
1239
|
return {
|
|
823
1240
|
series,
|
|
824
1241
|
color,
|
|
825
1242
|
seriesIndex: index,
|
|
826
|
-
|
|
1243
|
+
linePaths: segments.map((segment) => linePath(segment, curve)),
|
|
827
1244
|
areaPaths: series.area
|
|
828
|
-
?
|
|
1245
|
+
? this.areaPathsFor(series, segments, toX, toY, curve)
|
|
829
1246
|
: [],
|
|
830
1247
|
markers: points
|
|
831
1248
|
.filter((point) => point !== null)
|
|
@@ -845,31 +1262,127 @@ class LineSeriesComponent {
|
|
|
845
1262
|
};
|
|
846
1263
|
});
|
|
847
1264
|
}, ...(ngDevMode ? [{ debugName: "plotted" }] : /* istanbul ignore next */ []));
|
|
1265
|
+
areaPathsFor(series, segments, toX, toY, curve) {
|
|
1266
|
+
const lower = series.lower;
|
|
1267
|
+
if (!lower) {
|
|
1268
|
+
return segments
|
|
1269
|
+
.map((segment) => areaPath(segment, toY(0), curve))
|
|
1270
|
+
.filter((path) => path.length > 0);
|
|
1271
|
+
}
|
|
1272
|
+
const lowerSegments = lineSegments(lower.map((value, categoryIndex) => value === null
|
|
1273
|
+
? null
|
|
1274
|
+
: {
|
|
1275
|
+
categoryIndex,
|
|
1276
|
+
x: toX(categoryIndex),
|
|
1277
|
+
y: toY(value),
|
|
1278
|
+
value,
|
|
1279
|
+
}));
|
|
1280
|
+
return segments
|
|
1281
|
+
.map((segment, index) => lowerSegments[index]
|
|
1282
|
+
? bandPath(segment, lowerSegments[index], curve)
|
|
1283
|
+
: areaPath(segment, toY(0), curve))
|
|
1284
|
+
.filter((path) => path.length > 0);
|
|
1285
|
+
}
|
|
848
1286
|
allMarkers = computed(() => this.plotted().flatMap((entry) => entry.markers), ...(ngDevMode ? [{ debugName: "allMarkers" }] : /* istanbul ignore next */ []));
|
|
849
1287
|
seriesStagger(index) {
|
|
850
1288
|
return `${staggerDelay(index, this.staggerMs())}ms`;
|
|
851
1289
|
}
|
|
852
|
-
/** One tab stop
|
|
853
|
-
*
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
1290
|
+
/** One tab stop PER SERIES: each line is a strand the reader walks with the arrows, and the
|
|
1291
|
+
* strands are what the chart is comparing. WCAG 2.1.1's Understanding is explicit that not
|
|
1292
|
+
* every mouse-operable control has to be separately focusable, which is what keeps a
|
|
1293
|
+
* 12-category, 2-series plot from being twenty-four stops in the page's tab order. */
|
|
1294
|
+
rovingBySeries = signal(new Map(), ...(ngDevMode ? [{ debugName: "rovingBySeries" }] : /* istanbul ignore next */ []));
|
|
1295
|
+
firstMarkerBySeries = computed(() => new Map(this.plotted().map((entry) => [
|
|
1296
|
+
entry.series.id,
|
|
1297
|
+
entry.markers[0]?.markIndex,
|
|
1298
|
+
])), ...(ngDevMode ? [{ debugName: "firstMarkerBySeries" }] : /* istanbul ignore next */ []));
|
|
1299
|
+
isTabStop(seriesId, markIndex) {
|
|
1300
|
+
return ((this.rovingBySeries().get(seriesId) ??
|
|
1301
|
+
this.firstMarkerBySeries().get(seriesId)) === markIndex);
|
|
1302
|
+
}
|
|
1303
|
+
/** The series a marker holds focus on, which narrows an `'axis'` panel to that one reading: a
|
|
1304
|
+
* pointer answers for every series at once, a focused marker answers for its own. */
|
|
1305
|
+
focusedSeries = signal(null, ...(ngDevMode ? [{ debugName: "focusedSeries" }] : /* istanbul ignore next */ []));
|
|
1306
|
+
/** A reading is active when its own marker is hovered OR when the category cursor is on its
|
|
1307
|
+
* category: one band, one answer, so the dot grows wherever in the band the pointer is rather
|
|
1308
|
+
* than only on the 4px dot itself. */
|
|
1309
|
+
isActiveMarker(marker) {
|
|
1310
|
+
return (marker.markIndex === this.activeMark.index() ||
|
|
1311
|
+
marker.categoryIndex === this.scales.activeIndex());
|
|
1312
|
+
}
|
|
1313
|
+
onMarkerOver(event) {
|
|
1314
|
+
const hit = markOf(event);
|
|
1315
|
+
if (hit) {
|
|
1316
|
+
this.activeMark.enter(hit.index, event, undefined, hit.element);
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
onMarkerOut(event) {
|
|
1320
|
+
const hit = markOf(event);
|
|
1321
|
+
if (!hit) {
|
|
1322
|
+
return;
|
|
1323
|
+
}
|
|
1324
|
+
const next = event.relatedTarget instanceof Element
|
|
1325
|
+
? event.relatedTarget.closest('[data-mark-index]')
|
|
1326
|
+
: null;
|
|
1327
|
+
if (next !== hit.element) {
|
|
1328
|
+
this.activeMark.leave();
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
onMarkerFocus(event) {
|
|
1332
|
+
const hit = markOf(event);
|
|
1333
|
+
if (!hit) {
|
|
1334
|
+
return;
|
|
1335
|
+
}
|
|
1336
|
+
const marker = this.allMarkers()[hit.index];
|
|
1337
|
+
if (marker) {
|
|
1338
|
+
this.rovingBySeries.update((roving) => new Map(roving).set(marker.seriesId, hit.index));
|
|
1339
|
+
this.focusedSeries.set(marker.seriesId);
|
|
1340
|
+
this.scales.setActiveIndex(marker.categoryIndex);
|
|
1341
|
+
}
|
|
1342
|
+
this.activeMark.enter(hit.index, event, undefined, hit.element);
|
|
858
1343
|
}
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
1344
|
+
onMarkerBlur(event) {
|
|
1345
|
+
if (markOf(event)) {
|
|
1346
|
+
this.focusedSeries.set(null);
|
|
1347
|
+
this.activeMark.leave();
|
|
1348
|
+
}
|
|
862
1349
|
}
|
|
863
|
-
|
|
864
|
-
const
|
|
1350
|
+
onMarkerKey(event) {
|
|
1351
|
+
const hit = markOf(event);
|
|
1352
|
+
if (!hit) {
|
|
1353
|
+
return;
|
|
1354
|
+
}
|
|
1355
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
1356
|
+
this.selectMarker(hit.index);
|
|
1357
|
+
return;
|
|
1358
|
+
}
|
|
1359
|
+
const marker = this.allMarkers()[hit.index];
|
|
1360
|
+
const strand = this.allMarkers().filter((candidate) => candidate.seriesId === marker?.seriesId);
|
|
1361
|
+
const current = strand.findIndex((candidate) => candidate.markIndex === hit.index);
|
|
1362
|
+
const next = nextRovingIndex(event.key, current, strand.length);
|
|
865
1363
|
if (next === null) {
|
|
866
1364
|
return;
|
|
867
1365
|
}
|
|
868
1366
|
event.preventDefault();
|
|
869
|
-
|
|
870
|
-
focusMark(event.currentTarget.closest('.lines'), next);
|
|
1367
|
+
focusMark(hit.element.closest('.lines'), strand[next].markIndex);
|
|
871
1368
|
}
|
|
872
|
-
|
|
1369
|
+
isDimmed(seriesId) {
|
|
1370
|
+
const highlighted = this.highlighted();
|
|
1371
|
+
// Not gated on `dimOthers`: that input governs what a POINTER over a mark does, and naming a
|
|
1372
|
+
// series in the legend is the reader asking for this one directly.
|
|
1373
|
+
return highlighted !== null && highlighted !== seriesId;
|
|
1374
|
+
}
|
|
1375
|
+
onMarkerClick(event) {
|
|
1376
|
+
const hit = markOf(event);
|
|
1377
|
+
if (!hit) {
|
|
1378
|
+
return;
|
|
1379
|
+
}
|
|
1380
|
+
if (this.pinOnClick()) {
|
|
1381
|
+
this.activeMark.pin(hit.index, event, '.series-marker', hit.element);
|
|
1382
|
+
}
|
|
1383
|
+
this.selectMarker(hit.index);
|
|
1384
|
+
}
|
|
1385
|
+
selectMarker(markIndex) {
|
|
873
1386
|
const marker = this.allMarkers()[markIndex];
|
|
874
1387
|
const series = this.data().find((entry) => entry.id === marker?.seriesId);
|
|
875
1388
|
if (marker && series) {
|
|
@@ -883,9 +1396,37 @@ class LineSeriesComponent {
|
|
|
883
1396
|
markerLabel(marker) {
|
|
884
1397
|
return `${marker.seriesLabel}, ${marker.category}, ${marker.formattedValue}`;
|
|
885
1398
|
}
|
|
1399
|
+
/** What this series reads at the category the cursor is on, whatever `tooltip` says. It feeds
|
|
1400
|
+
* the container's category panel, so one band answers for every mark on the plot rather than
|
|
1401
|
+
* each mark owning a hover field of its own. */
|
|
1402
|
+
axisEntries = computed(() => {
|
|
1403
|
+
const categoryIndex = this.scales.activeIndex();
|
|
1404
|
+
if (categoryIndex < 0) {
|
|
1405
|
+
return [];
|
|
1406
|
+
}
|
|
1407
|
+
return this.plotted().flatMap((entry) => {
|
|
1408
|
+
const marker = entry.markers.find((candidate) => candidate.categoryIndex === categoryIndex);
|
|
1409
|
+
return marker
|
|
1410
|
+
? [
|
|
1411
|
+
{
|
|
1412
|
+
label: marker.seriesLabel,
|
|
1413
|
+
value: marker.value,
|
|
1414
|
+
formatted: marker.formattedValue,
|
|
1415
|
+
color: marker.color,
|
|
1416
|
+
},
|
|
1417
|
+
]
|
|
1418
|
+
: [];
|
|
1419
|
+
});
|
|
1420
|
+
}, ...(ngDevMode ? [{ debugName: "axisEntries" }] : /* istanbul ignore next */ []));
|
|
886
1421
|
tooltipContext = computed(() => {
|
|
1422
|
+
if (this.tooltip() === 'none') {
|
|
1423
|
+
return null;
|
|
1424
|
+
}
|
|
1425
|
+
if (this.tooltip() === 'axis') {
|
|
1426
|
+
return this.axisTooltipContext();
|
|
1427
|
+
}
|
|
887
1428
|
const marker = this.allMarkers()[this.activeMark.index()];
|
|
888
|
-
if (
|
|
1429
|
+
if (!marker) {
|
|
889
1430
|
return null;
|
|
890
1431
|
}
|
|
891
1432
|
return {
|
|
@@ -900,13 +1441,73 @@ class LineSeriesComponent {
|
|
|
900
1441
|
],
|
|
901
1442
|
};
|
|
902
1443
|
}, ...(ngDevMode ? [{ debugName: "tooltipContext" }] : /* istanbul ignore next */ []));
|
|
1444
|
+
markerElements = viewChildren('markerEl', ...(ngDevMode ? [{ debugName: "markerElements" }] : /* istanbul ignore next */ []));
|
|
1445
|
+
/** The topmost reading at the active category, as its own element. The cursor band spans the
|
|
1446
|
+
* whole plot, so anchoring an `'axis'` panel to it opens the panel at the top of the chart
|
|
1447
|
+
* rather than over the readings it is about. */
|
|
1448
|
+
topReadingElement = computed(() => {
|
|
1449
|
+
const categoryIndex = this.scales.activeIndex();
|
|
1450
|
+
if (categoryIndex < 0) {
|
|
1451
|
+
return null;
|
|
1452
|
+
}
|
|
1453
|
+
const highest = this.allMarkers()
|
|
1454
|
+
.filter((marker) => marker.categoryIndex === categoryIndex)
|
|
1455
|
+
.reduce((top, marker) => (top === null || marker.y < top.y ? marker : top), null);
|
|
1456
|
+
return highest
|
|
1457
|
+
? (this.markerElements()[highest.markIndex]?.nativeElement ?? null)
|
|
1458
|
+
: null;
|
|
1459
|
+
}, ...(ngDevMode ? [{ debugName: "topReadingElement" }] : /* istanbul ignore next */ []));
|
|
1460
|
+
/** Where the panel hangs: the reading or the pointer in `'axis'` mode, the hovered mark
|
|
1461
|
+
* otherwise. */
|
|
1462
|
+
tooltipOrigin = computed(() => {
|
|
1463
|
+
if (this.tooltip() !== 'axis') {
|
|
1464
|
+
return this.activeMark.origin();
|
|
1465
|
+
}
|
|
1466
|
+
if (this.tooltipAnchor() === 'pointer') {
|
|
1467
|
+
return this.scales.cursorPointer() ?? this.scales.cursorOrigin();
|
|
1468
|
+
}
|
|
1469
|
+
return this.topReadingElement() ?? this.scales.cursorOrigin();
|
|
1470
|
+
}, ...(ngDevMode ? [{ debugName: "tooltipOrigin" }] : /* istanbul ignore next */ []));
|
|
1471
|
+
/** Every series' reading at the category the CONTAINER says is active, which is what the
|
|
1472
|
+
* category cursor sets. A series with no reading there contributes no row rather than a
|
|
1473
|
+
* blank one. */
|
|
1474
|
+
axisTooltipContext = computed(() => {
|
|
1475
|
+
const categoryIndex = this.scales.activeIndex();
|
|
1476
|
+
if (categoryIndex < 0) {
|
|
1477
|
+
return null;
|
|
1478
|
+
}
|
|
1479
|
+
const focused = this.focusedSeries();
|
|
1480
|
+
const reporting = focused
|
|
1481
|
+
? this.plotted().filter((entry) => entry.series.id === focused)
|
|
1482
|
+
: this.plotted();
|
|
1483
|
+
const entries = reporting.flatMap((entry) => {
|
|
1484
|
+
const marker = entry.markers.find((candidate) => candidate.categoryIndex === categoryIndex);
|
|
1485
|
+
return marker
|
|
1486
|
+
? [
|
|
1487
|
+
{
|
|
1488
|
+
label: marker.seriesLabel,
|
|
1489
|
+
value: marker.value,
|
|
1490
|
+
formatted: marker.formattedValue,
|
|
1491
|
+
color: marker.color,
|
|
1492
|
+
},
|
|
1493
|
+
]
|
|
1494
|
+
: [];
|
|
1495
|
+
});
|
|
1496
|
+
if (!entries.length) {
|
|
1497
|
+
return null;
|
|
1498
|
+
}
|
|
1499
|
+
return {
|
|
1500
|
+
category: this.scales.categories()[categoryIndex] ?? '',
|
|
1501
|
+
entries,
|
|
1502
|
+
};
|
|
1503
|
+
}, ...(ngDevMode ? [{ debugName: "axisTooltipContext" }] : /* istanbul ignore next */ []));
|
|
903
1504
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: LineSeriesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
904
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: LineSeriesComponent, isStandalone: true, selector: "g[dsLineSeries]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, gaps: { classPropertyName: "gaps", publicName: "gaps", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClicked: "pointClicked" }, exportAs: ["dsLineSeries"], ngImport: i0, template: "<svg:g
|
|
1505
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: LineSeriesComponent, isStandalone: true, selector: "g[dsLineSeries]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, outline: { classPropertyName: "outline", publicName: "outline", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, highlighted: { classPropertyName: "highlighted", publicName: "highlighted", isSignal: true, isRequired: false, transformFunction: null }, patterns: { classPropertyName: "patterns", publicName: "patterns", isSignal: true, isRequired: false, transformFunction: null }, stacked: { classPropertyName: "stacked", publicName: "stacked", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, gaps: { classPropertyName: "gaps", publicName: "gaps", isSignal: true, isRequired: false, transformFunction: null }, curve: { classPropertyName: "curve", publicName: "curve", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipAnchor: { classPropertyName: "tooltipAnchor", publicName: "tooltipAnchor", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClicked: "pointClicked" }, viewQueries: [{ propertyName: "markerElements", predicate: ["markerEl"], descendants: true, isSignal: true }], exportAs: ["dsLineSeries"], ngImport: i0, template: "<svg:g\n class=\"lines\"\n [class.dims-others]=\"dimOthers()\"\n [class.is-outlined]=\"outline()\"\n (pointerover)=\"onMarkerOver($event)\"\n (pointerout)=\"onMarkerOut($event)\"\n (focusin)=\"onMarkerFocus($event)\"\n (focusout)=\"onMarkerBlur($event)\"\n (keydown)=\"onMarkerKey($event)\"\n (click)=\"onMarkerClick($event)\">\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.areaPaths; track $index) {\n <svg:path\n class=\"series-area\"\n [class.is-stacked]=\"stacked()\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.d]=\"path\"\n [attr.fill]=\"entry.color\"\n (animate.leave)=\"leaveMark($event)\" />\n }\n }\n\n @if (outline()) {\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.linePaths; track $index) {\n <svg:path\n class=\"series-halo\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.stroke-dasharray]=\"dashFor(entry.seriesIndex)\"\n [attr.d]=\"path\" />\n }\n }\n }\n\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.linePaths; track $index) {\n <svg:path\n class=\"series-line\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.stroke-dasharray]=\"dashFor(entry.seriesIndex)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.d]=\"path\"\n [attr.stroke]=\"entry.color\"\n (animate.leave)=\"leaveMark($event)\" />\n }\n }\n\n @if (showMarkers() || interactive()) {\n @for (entry of plotted(); track entry.series.id) {\n @for (marker of entry.markers; track marker.key) {\n <svg:circle\n #markerEl\n class=\"series-marker\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [class.ghost]=\"!showMarkers()\"\n [class.interactive]=\"interactive()\"\n [class.is-active]=\"isActiveMarker(marker)\"\n [attr.cx]=\"marker.x\"\n [attr.cy]=\"marker.y\"\n [attr.fill]=\"entry.color\"\n [attr.data-mark-index]=\"marker.markIndex\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive()\n ? isTabStop(entry.series.id, marker.markIndex)\n ? 0\n : -1\n : null\n \"\n [attr.aria-label]=\"interactive() ? markerLabel(marker) : null\" />\n }\n }\n }\n</svg:g>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.series-line{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.series-line.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-area{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.series-area.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}@media not (forced-colors:active){.series-marker:focus{outline:none}}.lines{--_chart-line-width: var(--ds-chart-line-width);--_chart-line-width-bold: var(--ds-chart-line-width-bold);--_chart-dot-radius: var(--ds-chart-dot-radius);--_chart-dot-radius-active: var(--ds-chart-dot-radius-active);--_chart-area-opacity: var(--ds-chart-area-opacity)}.series-line{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),stroke var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.series-line.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),r var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-marker.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker.interactive{cursor:pointer}.series-area{fill-opacity:var(--_chart-area-opacity);stroke:none}.series-area.is-stacked{stroke:var(--surface-default);stroke-width:2;stroke-linejoin:round}.lines:has(.series-line.is-dimmed) .series-line:not(.is-dimmed){stroke-width:var(--_chart-line-width-bold)}.series-halo{fill:none;stroke:var(--surface-default);stroke-width:calc(var(--_chart-line-width) + var(--_chart-line-outline, 3px));stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.series-halo.is-dimmed{opacity:0}.series-line{fill:none;stroke-width:var(--_chart-line-width);stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.series-marker{r:var(--_chart-dot-radius)}.lines.is-outlined .series-marker{stroke:var(--surface-default);stroke-width:var(--_chart-line-outline, 3px);paint-order:stroke}.series-marker.ghost{fill-opacity:0}.series-marker.ghost:hover,.series-marker.ghost:focus-visible,.series-marker.ghost.is-active{fill-opacity:1}.series-marker.is-active{r:var(--_chart-dot-radius-active)}.series-marker.interactive{stroke:transparent;stroke-width:24px;vector-effect:non-scaling-stroke}@media(pointer:coarse){.series-marker.interactive{stroke-width:44px}}@media not (forced-colors:active){.series-marker.interactive:focus-visible{outline:none}}.series-marker.interactive:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color));r:var(--_chart-dot-radius-active)}@media(forced-colors:active){.series-line{stroke:CanvasText}.series-marker{fill:CanvasText}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
905
1506
|
}
|
|
906
1507
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: LineSeriesComponent, decorators: [{
|
|
907
1508
|
type: Component,
|
|
908
|
-
args: [{ selector: 'g[dsLineSeries]', standalone: true, exportAs: 'dsLineSeries', encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g
|
|
909
|
-
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], showMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkers", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], gaps: [{ type: i0.Input, args: [{ isSignal: true, alias: "gaps", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], pointClicked: [{ type: i0.Output, args: ["pointClicked"] }] } });
|
|
1509
|
+
args: [{ selector: 'g[dsLineSeries]', standalone: true, exportAs: 'dsLineSeries', encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g\n class=\"lines\"\n [class.dims-others]=\"dimOthers()\"\n [class.is-outlined]=\"outline()\"\n (pointerover)=\"onMarkerOver($event)\"\n (pointerout)=\"onMarkerOut($event)\"\n (focusin)=\"onMarkerFocus($event)\"\n (focusout)=\"onMarkerBlur($event)\"\n (keydown)=\"onMarkerKey($event)\"\n (click)=\"onMarkerClick($event)\">\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.areaPaths; track $index) {\n <svg:path\n class=\"series-area\"\n [class.is-stacked]=\"stacked()\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.d]=\"path\"\n [attr.fill]=\"entry.color\"\n (animate.leave)=\"leaveMark($event)\" />\n }\n }\n\n @if (outline()) {\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.linePaths; track $index) {\n <svg:path\n class=\"series-halo\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.stroke-dasharray]=\"dashFor(entry.seriesIndex)\"\n [attr.d]=\"path\" />\n }\n }\n }\n\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.linePaths; track $index) {\n <svg:path\n class=\"series-line\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.stroke-dasharray]=\"dashFor(entry.seriesIndex)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.d]=\"path\"\n [attr.stroke]=\"entry.color\"\n (animate.leave)=\"leaveMark($event)\" />\n }\n }\n\n @if (showMarkers() || interactive()) {\n @for (entry of plotted(); track entry.series.id) {\n @for (marker of entry.markers; track marker.key) {\n <svg:circle\n #markerEl\n class=\"series-marker\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [class.ghost]=\"!showMarkers()\"\n [class.interactive]=\"interactive()\"\n [class.is-active]=\"isActiveMarker(marker)\"\n [attr.cx]=\"marker.x\"\n [attr.cy]=\"marker.y\"\n [attr.fill]=\"entry.color\"\n [attr.data-mark-index]=\"marker.markIndex\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive()\n ? isTabStop(entry.series.id, marker.markIndex)\n ? 0\n : -1\n : null\n \"\n [attr.aria-label]=\"interactive() ? markerLabel(marker) : null\" />\n }\n }\n }\n</svg:g>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.series-line{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.series-line.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-area{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.series-area.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}@media not (forced-colors:active){.series-marker:focus{outline:none}}.lines{--_chart-line-width: var(--ds-chart-line-width);--_chart-line-width-bold: var(--ds-chart-line-width-bold);--_chart-dot-radius: var(--ds-chart-dot-radius);--_chart-dot-radius-active: var(--ds-chart-dot-radius-active);--_chart-area-opacity: var(--ds-chart-area-opacity)}.series-line{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),stroke var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.series-line.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),r var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-marker.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker.interactive{cursor:pointer}.series-area{fill-opacity:var(--_chart-area-opacity);stroke:none}.series-area.is-stacked{stroke:var(--surface-default);stroke-width:2;stroke-linejoin:round}.lines:has(.series-line.is-dimmed) .series-line:not(.is-dimmed){stroke-width:var(--_chart-line-width-bold)}.series-halo{fill:none;stroke:var(--surface-default);stroke-width:calc(var(--_chart-line-width) + var(--_chart-line-outline, 3px));stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.series-halo.is-dimmed{opacity:0}.series-line{fill:none;stroke-width:var(--_chart-line-width);stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.series-marker{r:var(--_chart-dot-radius)}.lines.is-outlined .series-marker{stroke:var(--surface-default);stroke-width:var(--_chart-line-outline, 3px);paint-order:stroke}.series-marker.ghost{fill-opacity:0}.series-marker.ghost:hover,.series-marker.ghost:focus-visible,.series-marker.ghost.is-active{fill-opacity:1}.series-marker.is-active{r:var(--_chart-dot-radius-active)}.series-marker.interactive{stroke:transparent;stroke-width:24px;vector-effect:non-scaling-stroke}@media(pointer:coarse){.series-marker.interactive{stroke-width:44px}}@media not (forced-colors:active){.series-marker.interactive:focus-visible{outline:none}}.series-marker.interactive:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color));r:var(--_chart-dot-radius-active)}@media(forced-colors:active){.series-line{stroke:CanvasText}.series-marker{fill:CanvasText}}\n"] }]
|
|
1510
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], showMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkers", required: false }] }], outline: [{ type: i0.Input, args: [{ isSignal: true, alias: "outline", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], highlighted: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlighted", required: false }] }], patterns: [{ type: i0.Input, args: [{ isSignal: true, alias: "patterns", required: false }] }], stacked: [{ type: i0.Input, args: [{ isSignal: true, alias: "stacked", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], gaps: [{ type: i0.Input, args: [{ isSignal: true, alias: "gaps", required: false }] }], curve: [{ type: i0.Input, args: [{ isSignal: true, alias: "curve", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipAnchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipAnchor", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], pointClicked: [{ type: i0.Output, args: ["pointClicked"] }], markerElements: [{ type: i0.ViewChildren, args: ['markerEl', { isSignal: true }] }] } });
|
|
910
1511
|
|
|
911
1512
|
/**
|
|
912
1513
|
* The names of a chart's reference lines, laid out by the same geometry that draws them.
|
|
@@ -914,11 +1515,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
914
1515
|
* A second element rather than part of `g[dsReferenceLine]`: the strokes belong under the marks
|
|
915
1516
|
* and the names over them, and a projected element lands in exactly one of the container's slots.
|
|
916
1517
|
* Reports no domain - the line it names already did.
|
|
917
|
-
*
|
|
918
|
-
* @internal
|
|
919
1518
|
*/
|
|
920
1519
|
class ReferenceLabelComponent {
|
|
921
1520
|
scales = inject(CHART_SCALES);
|
|
1521
|
+
/** The same list `dsReferenceLine` is given. This mark draws only the labels, so it is placed
|
|
1522
|
+
* AFTER the series and the line mark before it, which is what keeps a label legible over a mark
|
|
1523
|
+
* that would otherwise cover it. */
|
|
922
1524
|
thresholds = input([], ...(ngDevMode ? [{ debugName: "thresholds" }] : /* istanbul ignore next */ []));
|
|
923
1525
|
lines = computed(() => thresholdMarks(this.thresholds(), this.scales.plot(), this.scales.yPosition()).filter((mark) => mark.label !== ''), ...(ngDevMode ? [{ debugName: "lines" }] : /* istanbul ignore next */ []));
|
|
924
1526
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ReferenceLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -939,11 +1541,12 @@ let nextReferenceId = 0;
|
|
|
939
1541
|
*
|
|
940
1542
|
* Hosted on a `<g>` rather than an element of its own: an element the SVG specification does not
|
|
941
1543
|
* know is not rendered, and neither are its descendants. Written as `<svg:g dsReferenceLine>`.
|
|
942
|
-
*
|
|
943
|
-
* @internal
|
|
944
1544
|
*/
|
|
945
1545
|
class ReferenceLineComponent {
|
|
946
1546
|
scales = inject(CHART_SCALES);
|
|
1547
|
+
/** The lines and bands to draw across the plot. Each entry is ONE reading, `value`, plus an
|
|
1548
|
+
* optional `label`, `color` and `dash`; a `to` makes it a band between two readings. Each one
|
|
1549
|
+
* widens the value axis to hold it, so a target above every mark still lands on the plot. */
|
|
947
1550
|
thresholds = input([], ...(ngDevMode ? [{ debugName: "thresholds" }] : /* istanbul ignore next */ []));
|
|
948
1551
|
domainId = `reference-line-${nextReferenceId++}`;
|
|
949
1552
|
constructor() {
|
|
@@ -965,9 +1568,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
965
1568
|
args: [{ selector: 'g[dsReferenceLine]', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g\n class=\"references\"\n aria-hidden=\"true\">\n @for (line of lines(); track line.key) {\n <svg:g\n class=\"reference\"\n [style.--_chart-threshold-color]=\"line.color\">\n @if (line.band) {\n <svg:rect\n class=\"threshold-band\"\n [attr.x]=\"line.left\"\n [attr.y]=\"line.top\"\n [attr.width]=\"line.width\"\n [attr.height]=\"line.height\" />\n } @else {\n <svg:line\n class=\"threshold-line\"\n [class.is-dashed]=\"line.dash === 'dashed'\"\n [class.is-dotted]=\"line.dash === 'dotted'\"\n [attr.x1]=\"line.left\"\n [attr.x2]=\"line.right\"\n [attr.y1]=\"line.y\"\n [attr.y2]=\"line.y\" />\n }\n </svg:g>\n }\n</svg:g>\n", styles: [".references{--_chart-threshold-color: var(--ds-chart-threshold-color, var(--chart-threshold-color));--_chart-threshold-band-opacity: var(--ds-chart-threshold-band-opacity, var(--chart-threshold-band-opacity));--_chart-threshold-dashed-pattern: var(--ds-chart-threshold-dashed-pattern, var(--chart-threshold-dashed-pattern));--_chart-threshold-dotted-pattern: var(--ds-chart-threshold-dotted-pattern, var(--chart-threshold-dotted-pattern));pointer-events:none}.threshold-line{stroke:var(--_chart-threshold-color);stroke-width:var(--ds-chart-line-width)}.threshold-line.is-dashed{stroke-dasharray:var(--_chart-threshold-dashed-pattern)}.threshold-line.is-dotted{stroke-dasharray:var(--_chart-threshold-dotted-pattern);stroke-linecap:round}.threshold-band{fill:var(--_chart-threshold-color);fill-opacity:var(--_chart-threshold-band-opacity)}@media(forced-colors:active){.threshold-line{stroke:CanvasText}.threshold-band{fill:CanvasText}}\n"] }]
|
|
966
1569
|
}], ctorParameters: () => [], propDecorators: { thresholds: [{ type: i0.Input, args: [{ isSignal: true, alias: "thresholds", required: false }] }] } });
|
|
967
1570
|
|
|
1571
|
+
/**
|
|
1572
|
+
* A tooltip answers "what is this?" on hover; an annotation answers it in a printed page or a
|
|
1573
|
+
* screenshot.
|
|
1574
|
+
*
|
|
1575
|
+
* Takes the readings rather than finding them: a mark never sees the other marks, so the caller
|
|
1576
|
+
* that owns the series is the one that knows which value a label belongs to. Reports no domain -
|
|
1577
|
+
* the series it annotates already did.
|
|
1578
|
+
*/
|
|
1579
|
+
class SeriesAnnotationComponent {
|
|
1580
|
+
scales = inject(CHART_SCALES);
|
|
1581
|
+
annotations = input([], ...(ngDevMode ? [{ debugName: "annotations" }] : /* istanbul ignore next */ []));
|
|
1582
|
+
placed = computed(() => {
|
|
1583
|
+
const plot = this.scales.plot();
|
|
1584
|
+
const xPosition = this.scales.xPosition();
|
|
1585
|
+
const yPosition = this.scales.yPosition();
|
|
1586
|
+
const secondaryYPosition = this.scales.secondaryYPosition();
|
|
1587
|
+
return annotationMarks(this.annotations().map((annotation, index) => ({
|
|
1588
|
+
key: `${annotation.categoryIndex}:${index}`,
|
|
1589
|
+
label: annotation.label,
|
|
1590
|
+
x: xPosition(annotation.categoryIndex),
|
|
1591
|
+
y: (annotation.axis === 'secondary' ? secondaryYPosition : yPosition)(annotation.value),
|
|
1592
|
+
})), plot.left + plot.width);
|
|
1593
|
+
}, ...(ngDevMode ? [{ debugName: "placed" }] : /* istanbul ignore next */ []));
|
|
1594
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SeriesAnnotationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1595
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: SeriesAnnotationComponent, isStandalone: true, selector: "g[dsSeriesAnnotation]", inputs: { annotations: { classPropertyName: "annotations", publicName: "annotations", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<svg:g class=\"annotations\">\n @for (note of placed(); track note.key) {\n <svg:text\n class=\"annotation\"\n [attr.x]=\"note.x\"\n [attr.y]=\"note.y\"\n [attr.text-anchor]=\"note.anchor\">\n {{ note.label }}\n </svg:text>\n }\n</svg:g>\n", styles: [".annotations{--_chart-annotation-color: var(--ds-chart-annotation-color, var(--text-primary));--_chart-annotation-font-size: var(--ds-chart-annotation-font-size, var(--ds-chart-axis-font-size));--_chart-annotation-font-weight: var(--ds-chart-annotation-font-weight, var(--font-weight-bold));--_chart-annotation-halo-color: var(--ds-chart-annotation-halo-color, var(--surface-default));--_chart-annotation-halo-width: var(--ds-chart-annotation-halo-width, 3px)}.annotation{fill:var(--_chart-annotation-color);font-size:var(--_chart-annotation-font-size);font-weight:var(--_chart-annotation-font-weight);paint-order:stroke;stroke:var(--_chart-annotation-halo-color);stroke-width:var(--_chart-annotation-halo-width);stroke-linejoin:round}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1596
|
+
}
|
|
1597
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SeriesAnnotationComponent, decorators: [{
|
|
1598
|
+
type: Component,
|
|
1599
|
+
args: [{ selector: 'g[dsSeriesAnnotation]', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g class=\"annotations\">\n @for (note of placed(); track note.key) {\n <svg:text\n class=\"annotation\"\n [attr.x]=\"note.x\"\n [attr.y]=\"note.y\"\n [attr.text-anchor]=\"note.anchor\">\n {{ note.label }}\n </svg:text>\n }\n</svg:g>\n", styles: [".annotations{--_chart-annotation-color: var(--ds-chart-annotation-color, var(--text-primary));--_chart-annotation-font-size: var(--ds-chart-annotation-font-size, var(--ds-chart-axis-font-size));--_chart-annotation-font-weight: var(--ds-chart-annotation-font-weight, var(--font-weight-bold));--_chart-annotation-halo-color: var(--ds-chart-annotation-halo-color, var(--surface-default));--_chart-annotation-halo-width: var(--ds-chart-annotation-halo-width, 3px)}.annotation{fill:var(--_chart-annotation-color);font-size:var(--_chart-annotation-font-size);font-weight:var(--_chart-annotation-font-weight);paint-order:stroke;stroke:var(--_chart-annotation-halo-color);stroke-width:var(--_chart-annotation-halo-width);stroke-linejoin:round}\n"] }]
|
|
1600
|
+
}], propDecorators: { annotations: [{ type: i0.Input, args: [{ isSignal: true, alias: "annotations", required: false }] }] } });
|
|
1601
|
+
|
|
968
1602
|
/**
|
|
969
1603
|
* Generated bundle index. Do not edit.
|
|
970
1604
|
*/
|
|
971
1605
|
|
|
972
|
-
export { CHART_SCALES, ChartComponent, ColumnSeriesComponent, LineSeriesComponent, ReferenceLabelComponent, ReferenceLineComponent, chartViewHeight, stackOffsets };
|
|
1606
|
+
export { CHART_DEFAULT_VALUE_SPACE, CHART_SCALES, ChartComponent, ColumnSeriesComponent, LineSeriesComponent, ReferenceLabelComponent, ReferenceLineComponent, SeriesAnnotationComponent, annotationMarks, chartViewHeight, stackOffsets };
|
|
973
1607
|
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-chart.mjs.map
|