@ids-group-ltd/ids-design-system 0.13.3 → 0.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +846 -14
- package/components.md +552 -29
- package/design-system.md +9 -0
- package/docs/agent/INDEX.md +57 -15
- package/docs/agent/charts/chart-colour-which-palette-a-chart-takes.md +1 -1
- package/docs/agent/charts/column-series-component.md +8 -0
- package/docs/agent/charts/ds-bar-chart.md +6 -1
- package/docs/agent/charts/ds-chart-data-table.md +10 -0
- package/docs/agent/charts/ds-chart.md +8 -0
- package/docs/agent/charts/ds-column-chart.md +5 -1
- package/docs/agent/charts/ds-funnel-chart.md +5 -1
- package/docs/agent/charts/ds-heatmap-chart.md +20 -0
- package/docs/agent/charts/ds-line-chart.md +8 -4
- package/docs/agent/charts/{ds-donut-chart.md → ds-pie-chart.md} +10 -6
- package/docs/agent/charts/ds-scatter-chart.md +20 -0
- package/docs/agent/charts/ds-waterfall-chart.md +20 -0
- package/docs/agent/charts/line-series-component.md +8 -0
- package/docs/agent/charts/reference-label-component.md +8 -0
- package/docs/agent/charts/reference-line-component.md +8 -0
- package/docs/agent/charts/series-annotation-component.md +10 -0
- package/docs/agent/feedback/ds-alert.md +4 -0
- package/docs/agent/feedback/ds-avatar-group.md +4 -0
- package/docs/agent/feedback/ds-avatar.md +4 -0
- package/docs/agent/feedback/ds-badge.md +4 -0
- package/docs/agent/feedback/ds-banner.md +5 -1
- package/docs/agent/feedback/ds-bar.md +4 -0
- package/docs/agent/feedback/ds-description-item.md +8 -0
- package/docs/agent/feedback/ds-description-list.md +8 -0
- package/docs/agent/feedback/ds-empty-state.md +4 -0
- package/docs/agent/feedback/ds-list-item.md +8 -0
- package/docs/agent/feedback/ds-list.md +8 -0
- package/docs/agent/feedback/ds-loading-overlay.md +8 -0
- package/docs/agent/feedback/ds-skeleton.md +4 -0
- package/docs/agent/feedback/ds-spinner.md +4 -0
- package/docs/agent/feedback/ds-stat.md +4 -0
- package/docs/agent/feedback/ds-status-dot.md +4 -0
- package/docs/agent/feedback/ds-tag.md +4 -0
- package/docs/agent/feedback/ds-timeline-item.md +8 -0
- package/docs/agent/feedback/ds-toast-region.md +8 -0
- package/docs/agent/feedback/ds-toast.md +4 -0
- package/docs/agent/feedback/ds-tree.md +8 -0
- package/docs/agent/forms/ds-autocomplete.md +4 -0
- package/docs/agent/forms/ds-button-group.md +8 -0
- package/docs/agent/forms/ds-button.md +6 -2
- package/docs/agent/forms/ds-checkbox.md +4 -0
- package/docs/agent/forms/ds-color-picker.md +8 -0
- package/docs/agent/forms/ds-date-picker.md +5 -1
- package/docs/agent/forms/ds-dropzone.md +4 -0
- package/docs/agent/forms/ds-field-group.md +8 -0
- package/docs/agent/forms/ds-filter-bar.md +8 -0
- package/docs/agent/forms/ds-icon-button.md +4 -0
- package/docs/agent/forms/ds-input.md +13 -1
- package/docs/agent/forms/ds-multi-select.md +4 -0
- package/docs/agent/forms/ds-number-stepper.md +4 -0
- package/docs/agent/forms/ds-otp-input.md +8 -0
- package/docs/agent/forms/ds-password-rules.md +8 -0
- package/docs/agent/forms/ds-radio-group.md +8 -0
- package/docs/agent/forms/ds-radio.md +4 -0
- package/docs/agent/forms/ds-search.md +4 -0
- package/docs/agent/forms/ds-segmented.md +8 -0
- package/docs/agent/forms/ds-select.md +4 -0
- package/docs/agent/forms/ds-slider.md +8 -0
- package/docs/agent/forms/ds-split-button.md +8 -0
- package/docs/agent/forms/ds-switch.md +4 -0
- package/docs/agent/forms/ds-textarea.md +5 -1
- package/docs/agent/forms/ds-time-picker.md +8 -0
- package/docs/agent/forms/ds-toggle-button.md +8 -0
- package/docs/agent/forms/filter-item-directive.md +8 -0
- package/docs/agent/forms/the-picker-family-ds-select-ds-multi-select-ds-autocomplete.md +4 -0
- package/docs/agent/navigation/ds-app-layout.md +6 -2
- package/docs/agent/navigation/ds-auth-layout.md +5 -1
- package/docs/agent/navigation/ds-breadcrumbs.md +4 -0
- package/docs/agent/navigation/ds-container.md +8 -0
- package/docs/agent/navigation/ds-divider.md +4 -0
- package/docs/agent/navigation/ds-inline.md +8 -0
- package/docs/agent/navigation/ds-page-footer.md +4 -0
- package/docs/agent/navigation/ds-page-header.md +5 -1
- package/docs/agent/navigation/ds-pagination.md +5 -1
- package/docs/agent/navigation/ds-sidenav-footer.md +8 -0
- package/docs/agent/navigation/ds-sidenav-group.md +4 -0
- package/docs/agent/navigation/ds-sidenav-item.md +4 -0
- package/docs/agent/navigation/ds-sidenav.md +4 -0
- package/docs/agent/navigation/ds-stack.md +8 -0
- package/docs/agent/navigation/ds-stepper.md +4 -0
- package/docs/agent/navigation/ds-tab.md +8 -0
- package/docs/agent/navigation/ds-tabs.md +5 -1
- package/docs/agent/overlays/ds-bottom-sheet.md +4 -0
- package/docs/agent/overlays/ds-drawer.md +4 -0
- package/docs/agent/overlays/ds-menu.md +4 -0
- package/docs/agent/overlays/ds-modal-card.md +4 -0
- package/docs/agent/overlays/ds-modal.md +4 -0
- package/docs/agent/overlays/ds-popover.md +4 -0
- package/docs/agent/overlays/ds-tooltip-panel.md +8 -0
- package/docs/agent/overlays/ds-tooltip.md +4 -0
- package/docs/agent/surfaces/ds-accordion-item.md +8 -0
- package/docs/agent/surfaces/ds-accordion.md +4 -0
- package/docs/agent/surfaces/ds-card.md +6 -2
- package/docs/agent/tables/ds-cell-template.md +8 -0
- package/docs/agent/tables/ds-table-columns.md +8 -0
- package/docs/agent/tables/ds-table-export.md +8 -0
- package/docs/agent/tables/ds-table.md +9 -2
- package/docs/agent/tables/header-filter-directive.md +8 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +10 -8
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +19 -19
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +7 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +9 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +117 -27
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +3 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +7 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs +32 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +14 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +404 -55
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +8 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +27 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +5 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +23 -16
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +20 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs +217 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +181 -500
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +6 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +7 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +14 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +391 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +5 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +300 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +9 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +7 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +4 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +9 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +5 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +34 -21
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +252 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +271 -8
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +7 -3
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.10.0.json +2 -2
- package/migrations/0.10.1.json +3 -3
- package/migrations/0.10.2.json +8 -28
- package/migrations/0.11.0.json +3 -3
- package/migrations/0.11.1.json +15 -15
- package/migrations/0.11.2.json +9 -9
- package/migrations/0.11.3.json +1 -1
- package/migrations/0.11.4.json +8 -8
- package/migrations/0.12.1.json +1 -1
- package/migrations/0.12.2.json +1 -1
- package/migrations/0.12.3.json +3 -3
- package/migrations/0.13.0.json +24 -32
- package/migrations/0.13.1.json +5 -5
- package/migrations/0.13.4.json +994 -0
- package/migrations/0.5.0.json +1 -1
- package/migrations/0.8.0.json +4 -3
- package/migrations/0.9.0.json +1 -1
- package/package.json +41 -9
- package/styles/_chart-frame.scss +16 -3
- package/styles/_check-box.scss +12 -12
- package/styles/_dropdown-overlay.scss +14 -10
- package/styles/_field-box.scss +3 -3
- package/styles/_field-label.scss +7 -7
- package/styles/_overlay-motion.scss +1 -1
- package/styles/_table-controls.scss +3 -3
- package/styles/_tokens-charts.scss +40 -7
- package/styles/_tokens.scss +2 -2
- package/styles/_typography.scss +101 -101
- package/themes/dark/_theme.scss +13 -0
- package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +3 -3
- package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +5 -4
- package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +17 -17
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +4 -2
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +37 -4
- package/types/ids-group-ltd-ids-design-system-components-bottom-sheet.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +8 -4
- package/types/ids-group-ltd-ids-design-system-components-chart-data-table.d.ts +31 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +4 -0
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +230 -44
- package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +6 -2
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +9 -7
- package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +4 -4
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +5 -2
- package/types/ids-group-ltd-ids-design-system-components-heatmap-chart.d.ts +124 -0
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +85 -139
- package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +13 -1
- package/types/{ids-group-ltd-ids-design-system-components-donut-chart.d.ts → ids-group-ltd-ids-design-system-components-pie-chart.d.ts} +24 -19
- package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +183 -0
- package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +5 -1
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-table-export.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +11 -11
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +5 -2
- package/types/ids-group-ltd-ids-design-system-components-waterfall-chart.d.ts +116 -0
- package/types/ids-group-ltd-ids-design-system-components.d.ts +97 -4
- package/types/ids-group-ltd-ids-design-system-core.d.ts +30 -7
- package/types/ids-group-ltd-ids-design-system.d.ts +14 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +0 -382
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +0 -1
|
@@ -1,382 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, numberAttribute, booleanAttribute, output, contentChild, signal, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
-
import { defaultChartFormat, markAt, nextRovingIndex, focusMark, largestRemainder, CHART_SERIES_COLORS, describeSeries } from '@ids-group-ltd/ids-design-system/components';
|
|
4
|
-
import { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';
|
|
5
|
-
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
6
|
-
import { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';
|
|
7
|
-
import { chartActiveMark, ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
|
|
8
|
-
|
|
9
|
-
const FULL_TURN = Math.PI * 2;
|
|
10
|
-
const FULL_TURN_EPSILON = 1e-9;
|
|
11
|
-
const DEFAULT_THICKNESS = 0.32;
|
|
12
|
-
/** Diameter of the hole, as a fraction of the ring's own diameter. The centre content is held to
|
|
13
|
-
* the square that fits inside it. */
|
|
14
|
-
function holeFraction(thickness) {
|
|
15
|
-
const ratio = Number.isFinite(thickness) && thickness > 0 && thickness <= 1
|
|
16
|
-
? thickness
|
|
17
|
-
: DEFAULT_THICKNESS;
|
|
18
|
-
return round(1 - ratio);
|
|
19
|
-
}
|
|
20
|
-
/** The slices a legend can carry, with everything past `limit` summed into one. The kept slices stay
|
|
21
|
-
* in the order given — a ring is read against its legend top to bottom, so reordering by value
|
|
22
|
-
* would move every other slice to make room for the grouping. The remainder takes the neutral
|
|
23
|
-
* eighth palette slot, which is what that slot is for. */
|
|
24
|
-
function groupSmallest(slices, limit, otherLabel) {
|
|
25
|
-
if (limit === null || !Number.isInteger(limit) || limit < 2) {
|
|
26
|
-
return [...slices];
|
|
27
|
-
}
|
|
28
|
-
if (slices.length <= limit) {
|
|
29
|
-
return [...slices];
|
|
30
|
-
}
|
|
31
|
-
const ranked = [...slices]
|
|
32
|
-
.map((slice, index) => ({ index, value: positiveValues([slice.value])[0] }))
|
|
33
|
-
.sort((a, b) => b.value - a.value || a.index - b.index);
|
|
34
|
-
const kept = new Set(ranked.slice(0, limit - 1).map((entry) => entry.index));
|
|
35
|
-
const remainder = slices
|
|
36
|
-
.filter((unusedSlice, index) => !kept.has(index))
|
|
37
|
-
.reduce((sum, slice) => sum + positiveValues([slice.value])[0], 0);
|
|
38
|
-
return [
|
|
39
|
-
...slices.filter((unusedSlice, index) => kept.has(index)),
|
|
40
|
-
{ id: 'ds-donut-other', label: otherLabel, value: remainder, slot: 8 },
|
|
41
|
-
];
|
|
42
|
-
}
|
|
43
|
-
/** A ring is a part-to-whole picture, so anything that is not a positive share
|
|
44
|
-
* becomes zero. Non-finite values go in the same pass: one NaN reaches every
|
|
45
|
-
* other slice through the total, and a `d` attribute holding NaN draws nothing
|
|
46
|
-
* at all rather than failing loudly. */
|
|
47
|
-
function positiveValues(values) {
|
|
48
|
-
return values.map((value) => Number.isFinite(value) && value > 0 ? value : 0);
|
|
49
|
-
}
|
|
50
|
-
function resolveTotal(values) {
|
|
51
|
-
return positiveValues(values).reduce((sum, value) => sum + value, 0);
|
|
52
|
-
}
|
|
53
|
-
function sliceArcs(values) {
|
|
54
|
-
const positive = positiveValues(values);
|
|
55
|
-
const total = resolveTotal(positive);
|
|
56
|
-
if (total <= 0) {
|
|
57
|
-
return positive.map(() => ({ startAngle: 0, endAngle: 0 }));
|
|
58
|
-
}
|
|
59
|
-
let cursor = 0;
|
|
60
|
-
return positive.map((value) => {
|
|
61
|
-
const startAngle = cursor;
|
|
62
|
-
cursor += (value / total) * FULL_TURN;
|
|
63
|
-
return { startAngle, endAngle: cursor };
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
function resolveInnerRadius(outerRadius, thickness) {
|
|
67
|
-
if (!Number.isFinite(outerRadius) || outerRadius <= 0) {
|
|
68
|
-
return 0;
|
|
69
|
-
}
|
|
70
|
-
// A thickness outside (0, 1] draws no ring: at 0 the band has no width, above
|
|
71
|
-
// 1 the inner radius goes negative. An unusable one falls back to the default
|
|
72
|
-
// instead of rendering an empty chart.
|
|
73
|
-
const ratio = Number.isFinite(thickness) && thickness > 0 && thickness <= 1
|
|
74
|
-
? thickness
|
|
75
|
-
: DEFAULT_THICKNESS;
|
|
76
|
-
return outerRadius * (1 - ratio);
|
|
77
|
-
}
|
|
78
|
-
function paletteIndex(slot, index, paletteLength) {
|
|
79
|
-
if (paletteLength <= 0) {
|
|
80
|
-
return 0;
|
|
81
|
-
}
|
|
82
|
-
if (slot !== undefined && Number.isInteger(slot) && slot > 0) {
|
|
83
|
-
return (slot - 1) % paletteLength;
|
|
84
|
-
}
|
|
85
|
-
return index % paletteLength;
|
|
86
|
-
}
|
|
87
|
-
/** One `"x y"` pair for a path. Angles run clockwise from 12 o'clock, where a
|
|
88
|
-
* reader expects a ring to start; SVG's y axis points down, so that is
|
|
89
|
-
* (sin, -cos) rather than the (cos, sin) of the maths convention. */
|
|
90
|
-
function ringPoint(centerX, centerY, radius, angle) {
|
|
91
|
-
const { x, y } = ringCoords(centerX, centerY, radius, angle);
|
|
92
|
-
return `${x} ${y}`;
|
|
93
|
-
}
|
|
94
|
-
/** The same point as numbers, for PLACING something rather than drawing a path. */
|
|
95
|
-
function ringCoords(centerX, centerY, radius, angle) {
|
|
96
|
-
return {
|
|
97
|
-
x: round(centerX + radius * Math.sin(angle)),
|
|
98
|
-
y: round(centerY - radius * Math.cos(angle)),
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
function arcPath(centerX, centerY, outerRadius, innerRadius, startAngle, endAngle) {
|
|
102
|
-
const finite = [
|
|
103
|
-
centerX,
|
|
104
|
-
centerY,
|
|
105
|
-
outerRadius,
|
|
106
|
-
innerRadius,
|
|
107
|
-
startAngle,
|
|
108
|
-
endAngle,
|
|
109
|
-
].every((value) => Number.isFinite(value));
|
|
110
|
-
if (!finite || outerRadius <= 0) {
|
|
111
|
-
return '';
|
|
112
|
-
}
|
|
113
|
-
const inner = Math.min(Math.max(innerRadius, 0), outerRadius);
|
|
114
|
-
const sweep = endAngle - startAngle;
|
|
115
|
-
if (sweep <= 0) {
|
|
116
|
-
return '';
|
|
117
|
-
}
|
|
118
|
-
if (sweep >= FULL_TURN - FULL_TURN_EPSILON) {
|
|
119
|
-
return fullRingPath(centerX, centerY, outerRadius, inner);
|
|
120
|
-
}
|
|
121
|
-
const largeArcFlag = sweep > Math.PI ? 1 : 0;
|
|
122
|
-
const outerRadii = `${round(outerRadius)} ${round(outerRadius)}`;
|
|
123
|
-
const outerArc = `M ${ringPoint(centerX, centerY, outerRadius, startAngle)}` +
|
|
124
|
-
` A ${outerRadii} 0 ${largeArcFlag} 1 ${ringPoint(centerX, centerY, outerRadius, endAngle)}`;
|
|
125
|
-
if (inner === 0) {
|
|
126
|
-
return `${outerArc} L ${round(centerX)} ${round(centerY)} Z`;
|
|
127
|
-
}
|
|
128
|
-
const innerRadii = `${round(inner)} ${round(inner)}`;
|
|
129
|
-
return (`${outerArc} L ${ringPoint(centerX, centerY, inner, endAngle)}` +
|
|
130
|
-
` A ${innerRadii} 0 ${largeArcFlag} 0 ${ringPoint(centerX, centerY, inner, startAngle)} Z`);
|
|
131
|
-
}
|
|
132
|
-
function fullRingPath(centerX, centerY, outerRadius, innerRadius) {
|
|
133
|
-
const outer = circlePath(centerX, centerY, outerRadius, 1);
|
|
134
|
-
if (innerRadius <= 0) {
|
|
135
|
-
return outer;
|
|
136
|
-
}
|
|
137
|
-
// The hole is cut by winding the inner circle the other way, which the default
|
|
138
|
-
// nonzero fill rule then cancels against the outer one.
|
|
139
|
-
return `${outer} ${circlePath(centerX, centerY, innerRadius, 0)}`;
|
|
140
|
-
}
|
|
141
|
-
/** A single arc of a full turn ends where it starts and SVG draws nothing for
|
|
142
|
-
* it, so a closed circle is two half-turns. */
|
|
143
|
-
function circlePath(centerX, centerY, radius, sweepFlag) {
|
|
144
|
-
const top = ringPoint(centerX, centerY, radius, 0);
|
|
145
|
-
const bottom = ringPoint(centerX, centerY, radius, Math.PI);
|
|
146
|
-
const radii = `${round(radius)} ${round(radius)}`;
|
|
147
|
-
return `M ${top} A ${radii} 0 1 ${sweepFlag} ${bottom} A ${radii} 0 1 ${sweepFlag} ${top} Z`;
|
|
148
|
-
}
|
|
149
|
-
function round(value) {
|
|
150
|
-
return Math.round(value * 1000) / 1000;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const RING_VIEW_BOX_SIZE = 100;
|
|
154
|
-
const RING_CENTER = RING_VIEW_BOX_SIZE / 2;
|
|
155
|
-
const RING_OUTER_RADIUS = RING_VIEW_BOX_SIZE / 2;
|
|
156
|
-
class DonutChartComponent {
|
|
157
|
-
/** One slice per entry. A non-positive or non-finite value counts as zero — a ring is a
|
|
158
|
-
* part-to-whole picture and has no way to draw a negative share. */
|
|
159
|
-
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
160
|
-
/** Printed inside the ring. Null prints the sum through `valueFormat`. */
|
|
161
|
-
centerValue = input(null, ...(ngDevMode ? [{ debugName: "centerValue" }] : /* istanbul ignore next */ []));
|
|
162
|
-
/** Caption under the centre value. */
|
|
163
|
-
centerLabel = input(null, ...(ngDevMode ? [{ debugName: "centerLabel" }] : /* istanbul ignore next */ []));
|
|
164
|
-
/** Logical placement, so a right-to-left page needs no second value. */
|
|
165
|
-
legend = input('end', ...(ngDevMode ? [{ debugName: "legend" }] : /* istanbul ignore next */ []));
|
|
166
|
-
/** Longest legend to draw. Past it the smallest slices are summed into one, so a long tail does
|
|
167
|
-
* not become a legend nobody reads. Off by default: grouping changes what the chart says, and
|
|
168
|
-
* that is the consumer's call. Values below 2 are ignored — one slice is not a donut. */
|
|
169
|
-
maxSlices = input(null, { ...(ngDevMode ? { debugName: "maxSlices" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
|
|
170
|
-
/** Names the grouped slice. */
|
|
171
|
-
otherLabel = input('Other', ...(ngDevMode ? [{ debugName: "otherLabel" }] : /* istanbul ignore next */ []));
|
|
172
|
-
/** Ring width as a fraction of the radius. */
|
|
173
|
-
thickness = input(DEFAULT_THICKNESS, { ...(ngDevMode ? { debugName: "thickness" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
174
|
-
/** Whether the chart draws its own bordered, padded box. `'auto'`, the default, draws it;
|
|
175
|
-
* `'none'` leaves the chart bare, for one placed inside a card the page has already drawn.
|
|
176
|
-
* Unset falls back to `DS_CONFIG.chart.frame`, then `'auto'` — whether charts live inside cards
|
|
177
|
-
* is one decision per app rather than per plot. */
|
|
178
|
-
frame = input(null, ...(ngDevMode ? [{ debugName: "frame" }] : /* istanbul ignore next */ []));
|
|
179
|
-
/** How long the tooltip stays after the pointer leaves the mark, in milliseconds. Zero, the
|
|
180
|
-
* default, takes it away at once: a panel that outlives the pointer sits over the plot the
|
|
181
|
-
* reader has moved on to.
|
|
182
|
-
*
|
|
183
|
-
* Raise it only for a panel a reader has to REACH — one carrying a link, a figure, or anything
|
|
184
|
-
* selectable — which is WCAG 1.4.13's hoverable clause. The panel is portaled to the body, so
|
|
185
|
-
* crossing the gap to it at an ordinary pointer speed needs about 140. Unset falls back to
|
|
186
|
-
* `DS_CONFIG.chart.tooltipLingerMs`, then 0. */
|
|
187
|
-
tooltipLingerMs = input(null, { ...(ngDevMode ? { debugName: "tooltipLingerMs" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
|
|
188
|
-
/** Printed above the plot as the chart's visible title, and reused as the annex table's
|
|
189
|
-
* caption. */
|
|
190
|
-
caption = input(null, ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
191
|
-
/** Accessible name. Generated from the data when omitted. */
|
|
192
|
-
summary = input(null, ...(ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []));
|
|
193
|
-
/** The label-and-value table under the plot: `'toggle'` puts it behind a disclosure,
|
|
194
|
-
* `'visible'` opens it, `'none'` renders none. It is the non-visual route to the numbers, so
|
|
195
|
-
* `'none'` belongs only where the same data is already in a table on the page.
|
|
196
|
-
* Unset falls back to `DS_CONFIG.chart.dataTable`, then `'none'`. */
|
|
197
|
-
dataTable = input(null, ...(ngDevMode ? [{ debugName: "dataTable" }] : /* istanbul ignore next */ []));
|
|
198
|
-
/** Prints each slice's share of the ring — in the legend, on the tooltip and in the data table.
|
|
199
|
-
* On by default, unlike every other chart, because a ring IS parts of one whole: the share is a
|
|
200
|
-
* real quantity here whatever the data, not a claim the consumer has to make. Off drops all
|
|
201
|
-
* three, for a ring whose slices are already labelled in percent. */
|
|
202
|
-
partOfWhole = input(true, { ...(ngDevMode ? { debugName: "partOfWhole" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
203
|
-
/** Draws skeleton marks in place of the data, at the same count, so the chart does not resize
|
|
204
|
-
* when the data lands. */
|
|
205
|
-
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
206
|
-
/** Shown in place of the plot when `data` is empty. Unset falls back to
|
|
207
|
-
* `DS_CONFIG.chart.emptyText`, then `'No data'`. */
|
|
208
|
-
emptyText = input(null, ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
209
|
-
/** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,
|
|
210
|
-
* because "the request failed" and "there is nothing to show" read the same to a reader and
|
|
211
|
-
* mean opposite things. */
|
|
212
|
-
error = input(false, { ...(ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
213
|
-
/** The message the error state prints. Unset falls back to `DS_CONFIG.chart.errorText`, then
|
|
214
|
-
* `'Could not load the data'`. */
|
|
215
|
-
errorText = input(null, ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
216
|
-
/** Formats every value the chart prints, the annex table and the generated description
|
|
217
|
-
* included. Unset falls back to `DS_CONFIG.chart.valueFormat`, then the browser's locale
|
|
218
|
-
* grouping with a K/M/B suffix past four digits. */
|
|
219
|
-
valueFormat = input(null, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
|
|
220
|
-
frameResolved = resolveWithConfig(this.frame, (config) => config.chart?.frame, 'auto');
|
|
221
|
-
dataTableResolved = resolveWithConfig(this.dataTable, (config) => config.chart?.dataTable, 'none');
|
|
222
|
-
emptyTextResolved = resolveWithConfig(this.emptyText, (config) => config.chart?.emptyText, 'No data');
|
|
223
|
-
errorTextResolved = resolveWithConfig(this.errorText, (config) => config.chart?.errorText, 'Could not load the data');
|
|
224
|
-
valueFormatResolved = resolveWithConfig(this.valueFormat, (config) => config.chart?.valueFormat, defaultChartFormat);
|
|
225
|
-
/** Turns on the click affordance — the pointer cursor and any hover tint.
|
|
226
|
-
* The click output fires whether or not this is set, so a consumer that
|
|
227
|
-
* binds the output and forgets the flag still receives every click. */
|
|
228
|
-
interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
229
|
-
/** The slice that was clicked, or activated with Enter or Space. Fires whether or not
|
|
230
|
-
* `interactive` is set. */
|
|
231
|
-
sliceClicked = output();
|
|
232
|
-
/** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a press
|
|
233
|
-
* outside releases it. Off by default: a click is already the drill-down hook, and a mark left
|
|
234
|
-
* lit after the pointer has gone needs a reader who knows why it is lit. `sliceClicked` fires
|
|
235
|
-
* either way — pinning is a state, not a handler. */
|
|
236
|
-
pinOnClick = input(false, { ...(ngDevMode ? { debugName: "pinOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
237
|
-
/** Dims every OTHER mark while one is hovered or focused, so the reader's eye is held on the
|
|
238
|
-
* one under the pointer. Off by default: the dimming costs the separation BETWEEN the dimmed
|
|
239
|
-
* marks — measured 2026-09-13, the worst pair of three dimmed series falls from dE 14.8 at full
|
|
240
|
-
* opacity to 2.1 at `--ds-chart-dim-opacity`'s default 0.3 — so it buys loudness for one mark
|
|
241
|
-
* and pays for it with the rest of the chart. */
|
|
242
|
-
dimOthers = input(false, { ...(ngDevMode ? { debugName: "dimOthers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
243
|
-
/** Accepted for parity with the other four charts and deliberately without effect here: a ring
|
|
244
|
-
* arrives as ONE object, because arcs share their edges and fading them one at a time lets the
|
|
245
|
-
* background through every seam. There is nothing to stagger. */
|
|
246
|
-
staggerMs = input(0, { ...(ngDevMode ? { debugName: "staggerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
247
|
-
/** Whether a hovered or focused slice opens a tooltip. `'axis'` is not offered — a ring
|
|
248
|
-
* has no axis to group readings under. */
|
|
249
|
-
tooltip = input('item', ...(ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []));
|
|
250
|
-
tooltipTemplate = contentChild('dsChartTooltip', ...(ngDevMode ? [{ debugName: "tooltipTemplate" }] : /* istanbul ignore next */ []));
|
|
251
|
-
tooltipLingerResolved = resolveWithConfig(this.tooltipLingerMs, (config) => config.chart?.tooltipLingerMs, 0);
|
|
252
|
-
activeMark = chartActiveMark(() => this.tooltipLingerResolved());
|
|
253
|
-
onMarkClick(payload, index, event) {
|
|
254
|
-
this.sliceClicked.emit(payload);
|
|
255
|
-
if (this.pinOnClick()) {
|
|
256
|
-
this.activeMark.pin(index, event);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
/** One tab stop per chart, not one per slice: WCAG 2.1.1's Understanding is explicit that not
|
|
260
|
-
* every mouse-operable control has to be separately focusable. */
|
|
261
|
-
rovingIndex = signal(0, ...(ngDevMode ? [{ debugName: "rovingIndex" }] : /* istanbul ignore next */ []));
|
|
262
|
-
tabStopIndex = computed(() => Math.min(this.rovingIndex(), Math.max(0, this.slices().length - 1)), ...(ngDevMode ? [{ debugName: "tabStopIndex" }] : /* istanbul ignore next */ []));
|
|
263
|
-
onMarkFocus(index, event) {
|
|
264
|
-
this.rovingIndex.set(index);
|
|
265
|
-
this.activeMark.enter(index, event);
|
|
266
|
-
}
|
|
267
|
-
/** A legend item stands for its arc, so it opens the arc's tooltip over the ARC and dims the
|
|
268
|
-
* other slices — the same state hovering the arc itself produces. */
|
|
269
|
-
onLegendEnter(index, event) {
|
|
270
|
-
this.activeMark.enter(index, event, this.arcAt(event, index));
|
|
271
|
-
}
|
|
272
|
-
onLegendFocus(index, event) {
|
|
273
|
-
this.rovingIndex.set(index);
|
|
274
|
-
this.onLegendEnter(index, event);
|
|
275
|
-
}
|
|
276
|
-
onLegendClick(slice, index, event) {
|
|
277
|
-
this.sliceClicked.emit(slice);
|
|
278
|
-
if (this.pinOnClick()) {
|
|
279
|
-
this.activeMark.pin(index, event, this.arcAt(event, index));
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
arcAt(event, index) {
|
|
283
|
-
return markAt(event.currentTarget.closest('.chart'), index, '.slice');
|
|
284
|
-
}
|
|
285
|
-
isDimmed(index) {
|
|
286
|
-
return (this.dimOthers() &&
|
|
287
|
-
this.activeMark.index() !== -1 &&
|
|
288
|
-
this.activeMark.index() !== index);
|
|
289
|
-
}
|
|
290
|
-
onMarkNavigation(event, index, scope) {
|
|
291
|
-
const next = nextRovingIndex(event.key, index, this.slices().length);
|
|
292
|
-
if (next === null) {
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
event.preventDefault();
|
|
296
|
-
this.rovingIndex.set(next);
|
|
297
|
-
focusMark(event.currentTarget.closest(scope), next);
|
|
298
|
-
}
|
|
299
|
-
tooltipContext = computed(() => {
|
|
300
|
-
const entry = this.slices()[this.activeMark.index()];
|
|
301
|
-
if (this.tooltip() === 'none' || !entry) {
|
|
302
|
-
return null;
|
|
303
|
-
}
|
|
304
|
-
return {
|
|
305
|
-
category: '',
|
|
306
|
-
entries: [
|
|
307
|
-
{
|
|
308
|
-
label: entry.slice.label,
|
|
309
|
-
value: entry.slice.value,
|
|
310
|
-
formatted: this.partOfWhole()
|
|
311
|
-
? `${entry.formattedValue} · ${entry.formattedPercent}`
|
|
312
|
-
: entry.formattedValue,
|
|
313
|
-
color: entry.color,
|
|
314
|
-
},
|
|
315
|
-
],
|
|
316
|
-
};
|
|
317
|
-
}, ...(ngDevMode ? [{ debugName: "tooltipContext" }] : /* istanbul ignore next */ []));
|
|
318
|
-
viewBox = `0 0 ${RING_VIEW_BOX_SIZE} ${RING_VIEW_BOX_SIZE}`;
|
|
319
|
-
total = computed(() => resolveTotal(this.data().map((slice) => slice.value)), ...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
320
|
-
visibleSlices = computed(() => groupSmallest(this.data(), this.maxSlices(), this.otherLabel()), ...(ngDevMode ? [{ debugName: "visibleSlices" }] : /* istanbul ignore next */ []));
|
|
321
|
-
slices = computed(() => {
|
|
322
|
-
const data = this.visibleSlices();
|
|
323
|
-
const values = data.map((slice) => slice.value);
|
|
324
|
-
const arcs = sliceArcs(values);
|
|
325
|
-
const percents = largestRemainder(positiveValues(values));
|
|
326
|
-
const innerRadius = resolveInnerRadius(RING_OUTER_RADIUS, this.thickness());
|
|
327
|
-
const format = (value) => this.valueFormatResolved()(value, 'tooltip');
|
|
328
|
-
const midRadius = (RING_OUTER_RADIUS + innerRadius) / 2;
|
|
329
|
-
return data.map((slice, index) => ({
|
|
330
|
-
slice,
|
|
331
|
-
// Halfway along the arc and halfway through the ring: the one point that is inside a slice
|
|
332
|
-
// whatever its sweep, which the bounding box of a curved wedge is not.
|
|
333
|
-
center: ringCoords(RING_CENTER, RING_CENTER, midRadius, (arcs[index].startAngle + arcs[index].endAngle) / 2),
|
|
334
|
-
path: arcPath(RING_CENTER, RING_CENTER, RING_OUTER_RADIUS, innerRadius, arcs[index].startAngle, arcs[index].endAngle),
|
|
335
|
-
color: CHART_SERIES_COLORS[paletteIndex(slice.slot, index, CHART_SERIES_COLORS.length)],
|
|
336
|
-
formattedValue: format(slice.value),
|
|
337
|
-
formattedPercent: `${percents[index]}%`,
|
|
338
|
-
}));
|
|
339
|
-
}, ...(ngDevMode ? [{ debugName: "slices" }] : /* istanbul ignore next */ []));
|
|
340
|
-
resolvedCenterValue = computed(() => this.centerValue() ?? this.valueFormatResolved()(this.total(), 'tooltip'), ...(ngDevMode ? [{ debugName: "resolvedCenterValue" }] : /* istanbul ignore next */ []));
|
|
341
|
-
accessibleName = computed(() => this.summary() ??
|
|
342
|
-
describeSeries(this.caption() ?? 'Chart', this.data().map((slice) => ({
|
|
343
|
-
label: slice.label,
|
|
344
|
-
value: slice.value,
|
|
345
|
-
})), (value) => this.valueFormatResolved()(value, 'tooltip'), this.dataTableResolved() !== 'none'), ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
|
|
346
|
-
hole = computed(() => holeFraction(this.thickness()), ...(ngDevMode ? [{ debugName: "hole" }] : /* istanbul ignore next */ []));
|
|
347
|
-
entryLabel(entry) {
|
|
348
|
-
return this.partOfWhole()
|
|
349
|
-
? `${entry.slice.label}, ${entry.formattedValue}, ${entry.formattedPercent}`
|
|
350
|
-
: `${entry.slice.label}, ${entry.formattedValue}`;
|
|
351
|
-
}
|
|
352
|
-
onSliceKey(slice, event) {
|
|
353
|
-
// Only the legend item's own key opens it: a key pressed on a control inside belongs to that
|
|
354
|
-
// control.
|
|
355
|
-
if (!this.interactive() || event.target !== event.currentTarget) {
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
event.preventDefault();
|
|
359
|
-
this.sliceClicked.emit(slice);
|
|
360
|
-
}
|
|
361
|
-
// Both focusable would double the tab order; the legend items already carry the route.
|
|
362
|
-
// Without this the ring is unreachable at `legend="none"`.
|
|
363
|
-
ringCarriesTheRoute = computed(() => this.interactive() && this.legend() === 'none', ...(ngDevMode ? [{ debugName: "ringCarriesTheRoute" }] : /* istanbul ignore next */ []));
|
|
364
|
-
isEmpty = computed(() => this.data().length === 0, ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
365
|
-
/** Placeholder legend rows while loading. Follows the real slice count so the
|
|
366
|
-
* chart does not resize when the data lands; falls back to three when `data`
|
|
367
|
-
* is still empty. */
|
|
368
|
-
skeletonRows = computed(() => Array.from({ length: Math.max(this.data().length, 3) }), ...(ngDevMode ? [{ debugName: "skeletonRows" }] : /* istanbul ignore next */ []));
|
|
369
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DonutChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
370
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DonutChartComponent, isStandalone: true, selector: "ds-donut-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, centerValue: { classPropertyName: "centerValue", publicName: "centerValue", isSignal: true, isRequired: false, transformFunction: null }, centerLabel: { classPropertyName: "centerLabel", publicName: "centerLabel", isSignal: true, isRequired: false, transformFunction: null }, legend: { classPropertyName: "legend", publicName: "legend", isSignal: true, isRequired: false, transformFunction: null }, maxSlices: { classPropertyName: "maxSlices", publicName: "maxSlices", isSignal: true, isRequired: false, transformFunction: null }, otherLabel: { classPropertyName: "otherLabel", publicName: "otherLabel", isSignal: true, isRequired: false, transformFunction: null }, thickness: { classPropertyName: "thickness", publicName: "thickness", isSignal: true, isRequired: false, transformFunction: null }, frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, dataTable: { classPropertyName: "dataTable", publicName: "dataTable", isSignal: true, isRequired: false, transformFunction: null }, partOfWhole: { classPropertyName: "partOfWhole", publicName: "partOfWhole", 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 }, 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 }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sliceClicked: "sliceClicked" }, host: { properties: { "class.framed": "frameResolved() === 'auto'" } }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["dsChartTooltip"], descendants: true, isSignal: true }], ngImport: i0, template: "<figure\n class=\"donut-chart\"\n [style.--_donut-chart-hole-fraction]=\"hole()\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p\n class=\"empty-text is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n </div>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\"\n [class.legend-bottom]=\"legend() === 'bottom'\">\n <ds-skeleton\n circle\n width=\"var(--_donut-chart-size)\"\n height=\"var(--_donut-chart-size)\" />\n\n @if (legend() !== 'none') {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_donut-chart-legend-row-height)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p class=\"empty-text\">\n {{ emptyTextResolved() }}\n </p>\n </div>\n } @else {\n <div\n class=\"chart\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [class.legend-bottom]=\"legend() === 'bottom'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <div\n class=\"ring\"\n [class.ring-outline]=\"total() === 0\">\n <svg\n class=\"ring-svg\"\n animate.enter=\"mark-enter\"\n [class.dims-others]=\"dimOthers()\"\n [attr.aria-hidden]=\"ringCarriesTheRoute() ? null : true\"\n [attr.viewBox]=\"viewBox\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <path\n class=\"slice\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [class.is-dimmed]=\"isDimmed(index)\"\n [class.focusable]=\"ringCarriesTheRoute()\"\n [attr.d]=\"entry.path\"\n [style.fill]=\"entry.color\"\n [attr.role]=\"ringCarriesTheRoute() ? 'button' : null\"\n [attr.tabindex]=\"\n ringCarriesTheRoute()\n ? index === tabStopIndex()\n ? 0\n : -1\n : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"\n ringCarriesTheRoute() ? entryLabel(entry) : null\n \"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.ring-svg')\"\n (click)=\"onMarkClick(entry.slice, index, $event)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n </path>\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <foreignObject\n class=\"pin-marker\"\n width=\"14\"\n height=\"14\"\n [attr.x]=\"entry.center.x - 7\"\n [attr.y]=\"entry.center.y - 7\">\n <ds-icon\n name=\"pin\"\n [size]=\"14\" />\n </foreignObject>\n }\n }\n </svg>\n\n <div class=\"center\">\n <span class=\"center-value\">\n {{ resolvedCenterValue() }}\n </span>\n\n @if (centerLabel()) {\n <span class=\"center-label\">\n {{ centerLabel() }}\n </span>\n }\n </div>\n </div>\n\n @if (legend() !== 'none') {\n <ul class=\"legend\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <li\n class=\"legend-item\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"onLegendEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onLegendFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.legend')\"\n (click)=\"onLegendClick(entry.slice, index, $event)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n <span\n class=\"swatch\"\n animate.enter=\"mark-enter\"\n [style.background]=\"entry.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ entry.slice.label }}\n </span>\n\n <span class=\"legend-value\">\n {{ entry.formattedValue }}\n </span>\n\n @if (partOfWhole()) {\n <span class=\"legend-percent\">\n {{ entry.formattedPercent }}\n </span>\n }\n </li>\n }\n </ul>\n }\n </div>\n\n @if (dataTableResolved() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n @if (partOfWhole()) {\n <th scope=\"col\">\n Share of total\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of slices(); track entry.slice.id) {\n <tr>\n <td>\n {{ entry.slice.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n @if (partOfWhole()) {\n <td>\n {{ entry.formattedPercent }}\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.ring-svg.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.ring-svg.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.swatch.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.swatch.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table,figcaption{-webkit-user-select:text;user-select:text}@media not (forced-colors:active){.slice:focus{outline:none}}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.donut-chart{--_donut-chart-size: var(--ds-donut-chart-size, 180px);--_donut-chart-gap: var(--ds-donut-chart-gap, var(--space-5));--_donut-chart-legend-row-gap: var(--ds-donut-chart-legend-row-gap, var(--space-2));--_donut-chart-legend-row-height: var(--ds-donut-chart-legend-row-height, 16px);--_donut-chart-swatch-size: var(--ds-donut-chart-swatch-size, 10px);--_donut-chart-focus-color: var(--ds-donut-chart-focus-color, var(--focus-ring-color));--_donut-chart-focus-width: var(--ds-donut-chart-focus-width, var(--focus-ring-width));--_donut-chart-outline-width: var(--ds-donut-chart-outline-width, calc(var(--border-width-strong) + var(--border-width-default)));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{display:flex;flex-direction:column;gap:var(--space-3);align-items:center}.empty-ring,.ring-outline{position:relative;inline-size:var(--_donut-chart-size);block-size:var(--_donut-chart-size);border:var(--_donut-chart-outline-width) solid var(--border-divider);border-radius:var(--radius-pill)}.empty-ring:before,.ring-outline:before{content:\"\";position:absolute;inset:calc((100% - var(--_donut-chart-hole-fraction) * 100%) / 2);border:calc(var(--_donut-chart-hole-fraction) * var(--_donut-chart-outline-width)) solid var(--border-divider);border-radius:var(--radius-pill)}.empty-text{margin:0;color:var(--text-secondary)}.chart,.skeleton{display:flex;flex-wrap:wrap;gap:var(--_donut-chart-gap);align-items:center;justify-content:center}.chart.legend-bottom,.skeleton.legend-bottom{flex-direction:column}.ring{position:relative;flex:none;inline-size:var(--_donut-chart-size);block-size:var(--_donut-chart-size)}.ring-svg{display:block;inline-size:100%;block-size:100%}@media not (forced-colors:active){.slice.focusable:focus-visible{outline:none}}.slice.focusable: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))}.center{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;inline-size:max(56%,var(--_donut-chart-hole-fraction) * 70%);margin-inline:auto;overflow-wrap:anywhere;text-align:center;pointer-events:none}.center-value,.center-label{text-shadow:0 0 var(--space-1) var(--ds-chart-frame-bg-color),0 0 var(--space-0-5) var(--ds-chart-frame-bg-color)}.center-value{color:var(--text-primary);font-size:var(--font-size-h4);font-weight:700}.center-label{color:var(--text-tertiary);font-size:var(--font-size-xs)}.legend,.skeleton-legend{display:grid;row-gap:var(--_donut-chart-legend-row-gap);min-inline-size:0}.legend{margin:0;padding:0;list-style:none}.skeleton-legend{flex:1 1 auto}.legend-item{display:grid;grid-template-columns:auto 1fr auto auto;column-gap:var(--space-2);align-items:baseline}.legend-item.interactive{cursor:pointer}.swatch{align-self:center;inline-size:var(--_donut-chart-swatch-size);block-size:var(--_donut-chart-swatch-size);border-radius:var(--radius-pill)}.legend-label{color:var(--text-secondary)}.legend-value{font-weight:700}.legend-percent{color:var(--text-tertiary);font-size:var(--font-size-xs)}.legend-bottom .legend{display:flex;flex-wrap:wrap;gap:var(--_donut-chart-legend-row-gap) var(--space-4)}.legend-bottom .legend-item{display:flex;column-gap:var(--space-2)}.empty-text.is-error{color:var(--error)}.ring-svg .slice{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)}.ring-svg .slice.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.ring-svg.dims-others:not(:has(.slice.is-pinned)):has(.slice.interactive:hover) .slice.interactive:not(:hover),.ring-svg.dims-others:not(:has(.slice.is-pinned)):has(.slice.interactive:focus-visible) .slice.interactive:not(:focus-visible),.ring-svg.dims-others:has(.slice.is-pinned) .slice:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.ring-svg .slice.interactive{cursor:pointer}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-start:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}.pin-marker{display:grid;place-items:center;inline-size:var(--ds-chart-pin-size, 22px);block-size:var(--ds-chart-pin-size, 22px);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-primary);box-shadow:var(--shadow-1);pointer-events:none}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate", "dsChartTooltipExtraGap", "dsChartTooltipPreferBelow"] }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
371
|
-
}
|
|
372
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DonutChartComponent, decorators: [{
|
|
373
|
-
type: Component,
|
|
374
|
-
args: [{ selector: 'ds-donut-chart', standalone: true, imports: [SkeletonComponent, ChartTooltipDirective, IconComponent], host: { '[class.framed]': "frameResolved() === 'auto'" }, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<figure\n class=\"donut-chart\"\n [style.--_donut-chart-hole-fraction]=\"hole()\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p\n class=\"empty-text is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n </div>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\"\n [class.legend-bottom]=\"legend() === 'bottom'\">\n <ds-skeleton\n circle\n width=\"var(--_donut-chart-size)\"\n height=\"var(--_donut-chart-size)\" />\n\n @if (legend() !== 'none') {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_donut-chart-legend-row-height)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p class=\"empty-text\">\n {{ emptyTextResolved() }}\n </p>\n </div>\n } @else {\n <div\n class=\"chart\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [class.legend-bottom]=\"legend() === 'bottom'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <div\n class=\"ring\"\n [class.ring-outline]=\"total() === 0\">\n <svg\n class=\"ring-svg\"\n animate.enter=\"mark-enter\"\n [class.dims-others]=\"dimOthers()\"\n [attr.aria-hidden]=\"ringCarriesTheRoute() ? null : true\"\n [attr.viewBox]=\"viewBox\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <path\n class=\"slice\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [class.is-dimmed]=\"isDimmed(index)\"\n [class.focusable]=\"ringCarriesTheRoute()\"\n [attr.d]=\"entry.path\"\n [style.fill]=\"entry.color\"\n [attr.role]=\"ringCarriesTheRoute() ? 'button' : null\"\n [attr.tabindex]=\"\n ringCarriesTheRoute()\n ? index === tabStopIndex()\n ? 0\n : -1\n : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"\n ringCarriesTheRoute() ? entryLabel(entry) : null\n \"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.ring-svg')\"\n (click)=\"onMarkClick(entry.slice, index, $event)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n </path>\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <foreignObject\n class=\"pin-marker\"\n width=\"14\"\n height=\"14\"\n [attr.x]=\"entry.center.x - 7\"\n [attr.y]=\"entry.center.y - 7\">\n <ds-icon\n name=\"pin\"\n [size]=\"14\" />\n </foreignObject>\n }\n }\n </svg>\n\n <div class=\"center\">\n <span class=\"center-value\">\n {{ resolvedCenterValue() }}\n </span>\n\n @if (centerLabel()) {\n <span class=\"center-label\">\n {{ centerLabel() }}\n </span>\n }\n </div>\n </div>\n\n @if (legend() !== 'none') {\n <ul class=\"legend\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <li\n class=\"legend-item\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"onLegendEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onLegendFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.legend')\"\n (click)=\"onLegendClick(entry.slice, index, $event)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n <span\n class=\"swatch\"\n animate.enter=\"mark-enter\"\n [style.background]=\"entry.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ entry.slice.label }}\n </span>\n\n <span class=\"legend-value\">\n {{ entry.formattedValue }}\n </span>\n\n @if (partOfWhole()) {\n <span class=\"legend-percent\">\n {{ entry.formattedPercent }}\n </span>\n }\n </li>\n }\n </ul>\n }\n </div>\n\n @if (dataTableResolved() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n @if (partOfWhole()) {\n <th scope=\"col\">\n Share of total\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of slices(); track entry.slice.id) {\n <tr>\n <td>\n {{ entry.slice.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n @if (partOfWhole()) {\n <td>\n {{ entry.formattedPercent }}\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.ring-svg.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.ring-svg.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.swatch.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.swatch.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table,figcaption{-webkit-user-select:text;user-select:text}@media not (forced-colors:active){.slice:focus{outline:none}}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.donut-chart{--_donut-chart-size: var(--ds-donut-chart-size, 180px);--_donut-chart-gap: var(--ds-donut-chart-gap, var(--space-5));--_donut-chart-legend-row-gap: var(--ds-donut-chart-legend-row-gap, var(--space-2));--_donut-chart-legend-row-height: var(--ds-donut-chart-legend-row-height, 16px);--_donut-chart-swatch-size: var(--ds-donut-chart-swatch-size, 10px);--_donut-chart-focus-color: var(--ds-donut-chart-focus-color, var(--focus-ring-color));--_donut-chart-focus-width: var(--ds-donut-chart-focus-width, var(--focus-ring-width));--_donut-chart-outline-width: var(--ds-donut-chart-outline-width, calc(var(--border-width-strong) + var(--border-width-default)));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{display:flex;flex-direction:column;gap:var(--space-3);align-items:center}.empty-ring,.ring-outline{position:relative;inline-size:var(--_donut-chart-size);block-size:var(--_donut-chart-size);border:var(--_donut-chart-outline-width) solid var(--border-divider);border-radius:var(--radius-pill)}.empty-ring:before,.ring-outline:before{content:\"\";position:absolute;inset:calc((100% - var(--_donut-chart-hole-fraction) * 100%) / 2);border:calc(var(--_donut-chart-hole-fraction) * var(--_donut-chart-outline-width)) solid var(--border-divider);border-radius:var(--radius-pill)}.empty-text{margin:0;color:var(--text-secondary)}.chart,.skeleton{display:flex;flex-wrap:wrap;gap:var(--_donut-chart-gap);align-items:center;justify-content:center}.chart.legend-bottom,.skeleton.legend-bottom{flex-direction:column}.ring{position:relative;flex:none;inline-size:var(--_donut-chart-size);block-size:var(--_donut-chart-size)}.ring-svg{display:block;inline-size:100%;block-size:100%}@media not (forced-colors:active){.slice.focusable:focus-visible{outline:none}}.slice.focusable: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))}.center{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;inline-size:max(56%,var(--_donut-chart-hole-fraction) * 70%);margin-inline:auto;overflow-wrap:anywhere;text-align:center;pointer-events:none}.center-value,.center-label{text-shadow:0 0 var(--space-1) var(--ds-chart-frame-bg-color),0 0 var(--space-0-5) var(--ds-chart-frame-bg-color)}.center-value{color:var(--text-primary);font-size:var(--font-size-h4);font-weight:700}.center-label{color:var(--text-tertiary);font-size:var(--font-size-xs)}.legend,.skeleton-legend{display:grid;row-gap:var(--_donut-chart-legend-row-gap);min-inline-size:0}.legend{margin:0;padding:0;list-style:none}.skeleton-legend{flex:1 1 auto}.legend-item{display:grid;grid-template-columns:auto 1fr auto auto;column-gap:var(--space-2);align-items:baseline}.legend-item.interactive{cursor:pointer}.swatch{align-self:center;inline-size:var(--_donut-chart-swatch-size);block-size:var(--_donut-chart-swatch-size);border-radius:var(--radius-pill)}.legend-label{color:var(--text-secondary)}.legend-value{font-weight:700}.legend-percent{color:var(--text-tertiary);font-size:var(--font-size-xs)}.legend-bottom .legend{display:flex;flex-wrap:wrap;gap:var(--_donut-chart-legend-row-gap) var(--space-4)}.legend-bottom .legend-item{display:flex;column-gap:var(--space-2)}.empty-text.is-error{color:var(--error)}.ring-svg .slice{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)}.ring-svg .slice.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.ring-svg.dims-others:not(:has(.slice.is-pinned)):has(.slice.interactive:hover) .slice.interactive:not(:hover),.ring-svg.dims-others:not(:has(.slice.is-pinned)):has(.slice.interactive:focus-visible) .slice.interactive:not(:focus-visible),.ring-svg.dims-others:has(.slice.is-pinned) .slice:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.ring-svg .slice.interactive{cursor:pointer}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-start:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}.pin-marker{display:grid;place-items:center;inline-size:var(--ds-chart-pin-size, 22px);block-size:var(--ds-chart-pin-size, 22px);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-primary);box-shadow:var(--shadow-1);pointer-events:none}\n"] }]
|
|
375
|
-
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], centerValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "centerValue", required: false }] }], centerLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "centerLabel", required: false }] }], legend: [{ type: i0.Input, args: [{ isSignal: true, alias: "legend", required: false }] }], maxSlices: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSlices", required: false }] }], otherLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "otherLabel", required: false }] }], thickness: [{ type: i0.Input, args: [{ isSignal: true, alias: "thickness", required: false }] }], frame: [{ type: i0.Input, args: [{ isSignal: true, alias: "frame", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], dataTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTable", required: false }] }], partOfWhole: [{ type: i0.Input, args: [{ isSignal: true, alias: "partOfWhole", 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 }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], sliceClicked: [{ type: i0.Output, args: ["sliceClicked"] }], 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 }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipTemplate: [{ type: i0.ContentChild, args: ['dsChartTooltip', { isSignal: true }] }] } });
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Generated bundle index. Do not edit.
|
|
379
|
-
*/
|
|
380
|
-
|
|
381
|
-
export { DonutChartComponent };
|
|
382
|
-
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-donut-chart.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-donut-chart.mjs","sources":["../../../src/lib/components/donut-chart/donut-chart.math.ts","../../../src/lib/components/donut-chart/donut-chart.component.ts","../../../src/lib/components/donut-chart/donut-chart.component.html","../../../src/lib/components/donut-chart/ids-group-ltd-ids-design-system-components-donut-chart.ts"],"sourcesContent":["import type { DonutChartSlice } from './donut-chart.types';\n\nconst FULL_TURN = Math.PI * 2;\nconst FULL_TURN_EPSILON = 1e-9;\n\nexport const DEFAULT_THICKNESS = 0.32;\n\n/** Diameter of the hole, as a fraction of the ring's own diameter. The centre content is held to\n * the square that fits inside it. */\nexport function holeFraction(thickness: number): number {\n const ratio =\n Number.isFinite(thickness) && thickness > 0 && thickness <= 1\n ? thickness\n : DEFAULT_THICKNESS;\n\n return round(1 - ratio);\n}\n\n/** The slices a legend can carry, with everything past `limit` summed into one. The kept slices stay\n * in the order given — a ring is read against its legend top to bottom, so reordering by value\n * would move every other slice to make room for the grouping. The remainder takes the neutral\n * eighth palette slot, which is what that slot is for. */\nexport function groupSmallest(\n slices: readonly DonutChartSlice[],\n limit: number | null,\n otherLabel: string,\n): DonutChartSlice[] {\n if (limit === null || !Number.isInteger(limit) || limit < 2) {\n return [...slices];\n }\n if (slices.length <= limit) {\n return [...slices];\n }\n const ranked = [...slices]\n .map((slice, index) => ({ index, value: positiveValues([slice.value])[0] }))\n .sort((a, b) => b.value - a.value || a.index - b.index);\n const kept = new Set(ranked.slice(0, limit - 1).map((entry) => entry.index));\n const remainder = slices\n .filter((unusedSlice, index) => !kept.has(index))\n .reduce((sum, slice) => sum + positiveValues([slice.value])[0], 0);\n\n return [\n ...slices.filter((unusedSlice, index) => kept.has(index)),\n { id: 'ds-donut-other', label: otherLabel, value: remainder, slot: 8 },\n ];\n}\n\nexport interface DonutArc {\n readonly startAngle: number;\n readonly endAngle: number;\n}\n\n/** A ring is a part-to-whole picture, so anything that is not a positive share\n * becomes zero. Non-finite values go in the same pass: one NaN reaches every\n * other slice through the total, and a `d` attribute holding NaN draws nothing\n * at all rather than failing loudly. */\nexport function positiveValues(values: readonly number[]): number[] {\n return values.map((value) =>\n Number.isFinite(value) && value > 0 ? value : 0,\n );\n}\n\nexport function resolveTotal(values: readonly number[]): number {\n return positiveValues(values).reduce((sum, value) => sum + value, 0);\n}\n\nexport function sliceArcs(values: readonly number[]): DonutArc[] {\n const positive = positiveValues(values);\n const total = resolveTotal(positive);\n if (total <= 0) {\n return positive.map(() => ({ startAngle: 0, endAngle: 0 }));\n }\n let cursor = 0;\n\n return positive.map((value) => {\n const startAngle = cursor;\n cursor += (value / total) * FULL_TURN;\n\n return { startAngle, endAngle: cursor };\n });\n}\n\nexport function resolveInnerRadius(\n outerRadius: number,\n thickness: number,\n): number {\n if (!Number.isFinite(outerRadius) || outerRadius <= 0) {\n return 0;\n }\n // A thickness outside (0, 1] draws no ring: at 0 the band has no width, above\n // 1 the inner radius goes negative. An unusable one falls back to the default\n // instead of rendering an empty chart.\n const ratio =\n Number.isFinite(thickness) && thickness > 0 && thickness <= 1\n ? thickness\n : DEFAULT_THICKNESS;\n\n return outerRadius * (1 - ratio);\n}\n\nexport function paletteIndex(\n slot: number | undefined,\n index: number,\n paletteLength: number,\n): number {\n if (paletteLength <= 0) {\n return 0;\n }\n if (slot !== undefined && Number.isInteger(slot) && slot > 0) {\n return (slot - 1) % paletteLength;\n }\n\n return index % paletteLength;\n}\n\n/** One `\"x y\"` pair for a path. Angles run clockwise from 12 o'clock, where a\n * reader expects a ring to start; SVG's y axis points down, so that is\n * (sin, -cos) rather than the (cos, sin) of the maths convention. */\nexport function ringPoint(\n centerX: number,\n centerY: number,\n radius: number,\n angle: number,\n): string {\n const { x, y } = ringCoords(centerX, centerY, radius, angle);\n\n return `${x} ${y}`;\n}\n\n/** The same point as numbers, for PLACING something rather than drawing a path. */\nexport function ringCoords(\n centerX: number,\n centerY: number,\n radius: number,\n angle: number,\n): { x: number; y: number } {\n return {\n x: round(centerX + radius * Math.sin(angle)),\n y: round(centerY - radius * Math.cos(angle)),\n };\n}\n\nexport function arcPath(\n centerX: number,\n centerY: number,\n outerRadius: number,\n innerRadius: number,\n startAngle: number,\n endAngle: number,\n): string {\n const finite = [\n centerX,\n centerY,\n outerRadius,\n innerRadius,\n startAngle,\n endAngle,\n ].every((value) => Number.isFinite(value));\n if (!finite || outerRadius <= 0) {\n return '';\n }\n const inner = Math.min(Math.max(innerRadius, 0), outerRadius);\n const sweep = endAngle - startAngle;\n if (sweep <= 0) {\n return '';\n }\n if (sweep >= FULL_TURN - FULL_TURN_EPSILON) {\n return fullRingPath(centerX, centerY, outerRadius, inner);\n }\n const largeArcFlag = sweep > Math.PI ? 1 : 0;\n const outerRadii = `${round(outerRadius)} ${round(outerRadius)}`;\n const outerArc =\n `M ${ringPoint(centerX, centerY, outerRadius, startAngle)}` +\n ` A ${outerRadii} 0 ${largeArcFlag} 1 ${ringPoint(centerX, centerY, outerRadius, endAngle)}`;\n if (inner === 0) {\n return `${outerArc} L ${round(centerX)} ${round(centerY)} Z`;\n }\n const innerRadii = `${round(inner)} ${round(inner)}`;\n\n return (\n `${outerArc} L ${ringPoint(centerX, centerY, inner, endAngle)}` +\n ` A ${innerRadii} 0 ${largeArcFlag} 0 ${ringPoint(centerX, centerY, inner, startAngle)} Z`\n );\n}\n\nfunction fullRingPath(\n centerX: number,\n centerY: number,\n outerRadius: number,\n innerRadius: number,\n): string {\n const outer = circlePath(centerX, centerY, outerRadius, 1);\n if (innerRadius <= 0) {\n return outer;\n }\n\n // The hole is cut by winding the inner circle the other way, which the default\n // nonzero fill rule then cancels against the outer one.\n return `${outer} ${circlePath(centerX, centerY, innerRadius, 0)}`;\n}\n\n/** A single arc of a full turn ends where it starts and SVG draws nothing for\n * it, so a closed circle is two half-turns. */\nfunction circlePath(\n centerX: number,\n centerY: number,\n radius: number,\n sweepFlag: 0 | 1,\n): string {\n const top = ringPoint(centerX, centerY, radius, 0);\n const bottom = ringPoint(centerX, centerY, radius, Math.PI);\n const radii = `${round(radius)} ${round(radius)}`;\n\n return `M ${top} A ${radii} 0 1 ${sweepFlag} ${bottom} A ${radii} 0 1 ${sweepFlag} ${top} Z`;\n}\n\nfunction round(value: number): number {\n return Math.round(value * 1000) / 1000;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n contentChild,\n input,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport {\n CHART_SERIES_COLORS,\n defaultChartFormat,\n describeSeries,\n focusMark,\n largestRemainder,\n markAt,\n nextRovingIndex,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';\nimport type {\n ChartDataTable,\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport {\n DEFAULT_THICKNESS,\n arcPath,\n groupSmallest,\n holeFraction,\n paletteIndex,\n positiveValues,\n resolveInnerRadius,\n resolveTotal,\n ringCoords,\n sliceArcs,\n} from './donut-chart.math';\nimport type { DonutChartSlice } from './donut-chart.types';\n\nconst RING_VIEW_BOX_SIZE = 100;\nconst RING_CENTER = RING_VIEW_BOX_SIZE / 2;\nconst RING_OUTER_RADIUS = RING_VIEW_BOX_SIZE / 2;\n\n@Component({\n selector: 'ds-donut-chart',\n standalone: true,\n imports: [SkeletonComponent, ChartTooltipDirective, IconComponent],\n templateUrl: './donut-chart.component.html',\n styleUrl: './donut-chart.component.scss',\n host: { '[class.framed]': \"frameResolved() === 'auto'\" },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DonutChartComponent {\n /** One slice per entry. A non-positive or non-finite value counts as zero — a ring is a\n * part-to-whole picture and has no way to draw a negative share. */\n readonly data = input.required<readonly DonutChartSlice[]>();\n\n /** Printed inside the ring. Null prints the sum through `valueFormat`. */\n readonly centerValue = input<string | null>(null);\n\n /** Caption under the centre value. */\n readonly centerLabel = input<string | null>(null);\n\n /** Logical placement, so a right-to-left page needs no second value. */\n readonly legend = input<'end' | 'bottom' | 'none'>('end');\n\n /** Longest legend to draw. Past it the smallest slices are summed into one, so a long tail does\n * not become a legend nobody reads. Off by default: grouping changes what the chart says, and\n * that is the consumer's call. Values below 2 are ignored — one slice is not a donut. */\n readonly maxSlices = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n\n /** Names the grouped slice. */\n readonly otherLabel = input<string>('Other');\n\n /** Ring width as a fraction of the radius. */\n readonly thickness = input(DEFAULT_THICKNESS, { transform: numberAttribute });\n\n /** Whether the chart draws its own bordered, padded box. `'auto'`, the default, draws it;\n * `'none'` leaves the chart bare, for one placed inside a card the page has already drawn.\n * Unset falls back to `DS_CONFIG.chart.frame`, then `'auto'` — whether charts live inside cards\n * is one decision per app rather than per plot. */\n readonly frame = input<ChartFrame | null>(null);\n\n /** How long the tooltip stays after the pointer leaves the mark, in milliseconds. Zero, the\n * default, takes it away at once: a panel that outlives the pointer sits over the plot the\n * reader has moved on to.\n *\n * Raise it only for a panel a reader has to REACH — one carrying a link, a figure, or anything\n * selectable — which is WCAG 1.4.13's hoverable clause. The panel is portaled to the body, so\n * crossing the gap to it at an ordinary pointer speed needs about 140. Unset falls back to\n * `DS_CONFIG.chart.tooltipLingerMs`, then 0. */\n readonly tooltipLingerMs = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n /** Printed above the plot as the chart's visible title, and reused as the annex table's\n * caption. */\n readonly caption = input<string | null>(null);\n\n /** Accessible name. Generated from the data when omitted. */\n readonly summary = input<string | null>(null);\n\n /** The label-and-value table under the plot: `'toggle'` puts it behind a disclosure,\n * `'visible'` opens it, `'none'` renders none. It is the non-visual route to the numbers, so\n * `'none'` belongs only where the same data is already in a table on the page.\n * Unset falls back to `DS_CONFIG.chart.dataTable`, then `'none'`. */\n readonly dataTable = input<ChartDataTable | null>(null);\n\n /** Prints each slice's share of the ring — in the legend, on the tooltip and in the data table.\n * On by default, unlike every other chart, because a ring IS parts of one whole: the share is a\n * real quantity here whatever the data, not a claim the consumer has to make. Off drops all\n * three, for a ring whose slices are already labelled in percent. */\n readonly partOfWhole = input(true, { transform: booleanAttribute });\n\n /** Draws skeleton marks in place of the data, at the same count, so the chart does not resize\n * when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n /** Shown in place of the plot when `data` is empty. Unset falls back to\n * `DS_CONFIG.chart.emptyText`, then `'No data'`. */\n readonly emptyText = input<string | null>(null);\n\n /** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,\n * because \"the request failed\" and \"there is nothing to show\" read the same to a reader and\n * mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** The message the error state prints. Unset falls back to `DS_CONFIG.chart.errorText`, then\n * `'Could not load the data'`. */\n readonly errorText = input<string | null>(null);\n /** Formats every value the chart prints, the annex table and the generated description\n * included. Unset falls back to `DS_CONFIG.chart.valueFormat`, then the browser's locale\n * grouping with a K/M/B suffix past four digits. */\n readonly valueFormat = input<ChartValueFormat | null>(null);\n\n readonly frameResolved = resolveWithConfig(\n this.frame,\n (config) => config.chart?.frame,\n 'auto' as ChartFrame,\n );\n readonly dataTableResolved = resolveWithConfig(\n this.dataTable,\n (config) => config.chart?.dataTable,\n 'none' as ChartDataTable,\n );\n readonly emptyTextResolved = resolveWithConfig(\n this.emptyText,\n (config) => config.chart?.emptyText,\n 'No data',\n );\n readonly errorTextResolved = resolveWithConfig(\n this.errorText,\n (config) => config.chart?.errorText,\n 'Could not load the data',\n );\n readonly valueFormatResolved = resolveWithConfig(\n this.valueFormat,\n (config) => config.chart?.valueFormat,\n defaultChartFormat,\n );\n\n /** Turns on the click affordance — the pointer cursor and any hover tint.\n * The click output fires whether or not this is set, so a consumer that\n * binds the output and forgets the flag still receives every click. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** The slice that was clicked, or activated with Enter or Space. Fires whether or not\n * `interactive` is set. */\n readonly sliceClicked = output<DonutChartSlice>();\n\n /** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a press\n * outside releases it. Off by default: a click is already the drill-down hook, and a mark left\n * lit after the pointer has gone needs a reader who knows why it is lit. `sliceClicked` fires\n * either way — pinning is a state, not a handler. */\n readonly pinOnClick = input(false, { transform: booleanAttribute });\n\n /** Dims every OTHER mark while one is hovered or focused, so the reader's eye is held on the\n * one under the pointer. Off by default: the dimming costs the separation BETWEEN the dimmed\n * marks — measured 2026-09-13, the worst pair of three dimmed series falls from dE 14.8 at full\n * opacity to 2.1 at `--ds-chart-dim-opacity`'s default 0.3 — so it buys loudness for one mark\n * and pays for it with the rest of the chart. */\n readonly dimOthers = input(false, { transform: booleanAttribute });\n\n /** Accepted for parity with the other four charts and deliberately without effect here: a ring\n * arrives as ONE object, because arcs share their edges and fading them one at a time lets the\n * background through every seam. There is nothing to stagger. */\n readonly staggerMs = input(0, { transform: numberAttribute });\n\n /** Whether a hovered or focused slice opens a tooltip. `'axis'` is not offered — a ring\n * has no axis to group readings under. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n protected readonly tooltipTemplate =\n contentChild<TemplateRef<{ $implicit: ChartTooltipContext }>>(\n 'dsChartTooltip',\n );\n\n private readonly tooltipLingerResolved = resolveWithConfig(\n this.tooltipLingerMs,\n (config) => config.chart?.tooltipLingerMs,\n 0,\n );\n\n protected readonly activeMark = chartActiveMark(() =>\n this.tooltipLingerResolved(),\n );\n\n protected onMarkClick(\n payload: DonutChartSlice,\n index: number,\n event: Event,\n ): void {\n this.sliceClicked.emit(payload);\n if (this.pinOnClick()) {\n this.activeMark.pin(index, event);\n }\n }\n /** One tab stop per chart, not one per slice: WCAG 2.1.1's Understanding is explicit that not\n * every mouse-operable control has to be separately focusable. */\n protected readonly rovingIndex = signal(0);\n\n protected readonly tabStopIndex = computed(() =>\n Math.min(this.rovingIndex(), Math.max(0, this.slices().length - 1)),\n );\n\n protected onMarkFocus(index: number, event: FocusEvent): void {\n this.rovingIndex.set(index);\n this.activeMark.enter(index, event);\n }\n\n /** A legend item stands for its arc, so it opens the arc's tooltip over the ARC and dims the\n * other slices — the same state hovering the arc itself produces. */\n protected onLegendEnter(index: number, event: Event): void {\n this.activeMark.enter(index, event, this.arcAt(event, index));\n }\n\n protected onLegendFocus(index: number, event: FocusEvent): void {\n this.rovingIndex.set(index);\n this.onLegendEnter(index, event);\n }\n\n protected onLegendClick(\n slice: DonutChartSlice,\n index: number,\n event: Event,\n ): void {\n this.sliceClicked.emit(slice);\n if (this.pinOnClick()) {\n this.activeMark.pin(index, event, this.arcAt(event, index));\n }\n }\n\n private arcAt(event: Event, index: number): Element | null {\n return markAt(\n (event.currentTarget as Element).closest('.chart'),\n index,\n '.slice',\n );\n }\n\n protected isDimmed(index: number): boolean {\n return (\n this.dimOthers() &&\n this.activeMark.index() !== -1 &&\n this.activeMark.index() !== index\n );\n }\n\n protected onMarkNavigation(\n event: KeyboardEvent,\n index: number,\n scope: string,\n ): void {\n const next = nextRovingIndex(event.key, index, this.slices().length);\n if (next === null) {\n return;\n }\n event.preventDefault();\n this.rovingIndex.set(next);\n focusMark((event.currentTarget as Element).closest(scope), next);\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const entry = this.slices()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !entry) {\n return null;\n }\n\n return {\n category: '',\n entries: [\n {\n label: entry.slice.label,\n value: entry.slice.value,\n formatted: this.partOfWhole()\n ? `${entry.formattedValue} · ${entry.formattedPercent}`\n : entry.formattedValue,\n color: entry.color,\n },\n ],\n };\n },\n );\n\n protected readonly viewBox = `0 0 ${RING_VIEW_BOX_SIZE} ${RING_VIEW_BOX_SIZE}`;\n\n protected readonly total = computed(() =>\n resolveTotal(this.data().map((slice) => slice.value)),\n );\n\n protected readonly visibleSlices = computed(() =>\n groupSmallest(this.data(), this.maxSlices(), this.otherLabel()),\n );\n\n protected readonly slices = computed(() => {\n const data = this.visibleSlices();\n const values = data.map((slice) => slice.value);\n const arcs = sliceArcs(values);\n const percents = largestRemainder(positiveValues(values));\n const innerRadius = resolveInnerRadius(RING_OUTER_RADIUS, this.thickness());\n const format = (value: number) =>\n this.valueFormatResolved()(value, 'tooltip');\n\n const midRadius = (RING_OUTER_RADIUS + innerRadius) / 2;\n\n return data.map((slice, index) => ({\n slice,\n // Halfway along the arc and halfway through the ring: the one point that is inside a slice\n // whatever its sweep, which the bounding box of a curved wedge is not.\n center: ringCoords(\n RING_CENTER,\n RING_CENTER,\n midRadius,\n (arcs[index].startAngle + arcs[index].endAngle) / 2,\n ),\n path: arcPath(\n RING_CENTER,\n RING_CENTER,\n RING_OUTER_RADIUS,\n innerRadius,\n arcs[index].startAngle,\n arcs[index].endAngle,\n ),\n color:\n CHART_SERIES_COLORS[\n paletteIndex(slice.slot, index, CHART_SERIES_COLORS.length)\n ],\n formattedValue: format(slice.value),\n formattedPercent: `${percents[index]}%`,\n }));\n });\n\n protected readonly resolvedCenterValue = computed(\n () =>\n this.centerValue() ?? this.valueFormatResolved()(this.total(), 'tooltip'),\n );\n\n protected readonly accessibleName = computed(\n () =>\n this.summary() ??\n describeSeries(\n this.caption() ?? 'Chart',\n this.data().map((slice) => ({\n label: slice.label,\n value: slice.value,\n })),\n (value) => this.valueFormatResolved()(value, 'tooltip'),\n this.dataTableResolved() !== 'none',\n ),\n );\n\n protected readonly hole = computed(() => holeFraction(this.thickness()));\n\n protected entryLabel(entry: {\n slice: DonutChartSlice;\n formattedValue: string;\n formattedPercent: string;\n }) {\n return this.partOfWhole()\n ? `${entry.slice.label}, ${entry.formattedValue}, ${entry.formattedPercent}`\n : `${entry.slice.label}, ${entry.formattedValue}`;\n }\n\n protected onSliceKey(slice: DonutChartSlice, event: Event): void {\n // Only the legend item's own key opens it: a key pressed on a control inside belongs to that\n // control.\n if (!this.interactive() || event.target !== event.currentTarget) {\n return;\n }\n event.preventDefault();\n this.sliceClicked.emit(slice);\n }\n\n // Both focusable would double the tab order; the legend items already carry the route.\n // Without this the ring is unreachable at `legend=\"none\"`.\n protected readonly ringCarriesTheRoute = computed(\n () => this.interactive() && this.legend() === 'none',\n );\n\n protected readonly isEmpty = computed(() => this.data().length === 0);\n\n /** Placeholder legend rows while loading. Follows the real slice count so the\n * chart does not resize when the data lands; falls back to three when `data`\n * is still empty. */\n protected readonly skeletonRows = computed(() =>\n Array.from({ length: Math.max(this.data().length, 3) }),\n );\n}\n","<figure\n class=\"donut-chart\"\n [style.--_donut-chart-hole-fraction]=\"hole()\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p\n class=\"empty-text is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n </div>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\"\n [class.legend-bottom]=\"legend() === 'bottom'\">\n <ds-skeleton\n circle\n width=\"var(--_donut-chart-size)\"\n height=\"var(--_donut-chart-size)\" />\n\n @if (legend() !== 'none') {\n <div class=\"skeleton-legend\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_donut-chart-legend-row-height)\" />\n }\n </div>\n }\n </div>\n } @else if (isEmpty()) {\n <div class=\"empty\">\n <div\n class=\"empty-ring\"\n aria-hidden=\"true\">\n </div>\n\n <p class=\"empty-text\">\n {{ emptyTextResolved() }}\n </p>\n </div>\n } @else {\n <div\n class=\"chart\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [class.legend-bottom]=\"legend() === 'bottom'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <div\n class=\"ring\"\n [class.ring-outline]=\"total() === 0\">\n <svg\n class=\"ring-svg\"\n animate.enter=\"mark-enter\"\n [class.dims-others]=\"dimOthers()\"\n [attr.aria-hidden]=\"ringCarriesTheRoute() ? null : true\"\n [attr.viewBox]=\"viewBox\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <path\n class=\"slice\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [class.is-dimmed]=\"isDimmed(index)\"\n [class.focusable]=\"ringCarriesTheRoute()\"\n [attr.d]=\"entry.path\"\n [style.fill]=\"entry.color\"\n [attr.role]=\"ringCarriesTheRoute() ? 'button' : null\"\n [attr.tabindex]=\"\n ringCarriesTheRoute()\n ? index === tabStopIndex()\n ? 0\n : -1\n : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"\n ringCarriesTheRoute() ? entryLabel(entry) : null\n \"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.ring-svg')\"\n (click)=\"onMarkClick(entry.slice, index, $event)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n </path>\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <foreignObject\n class=\"pin-marker\"\n width=\"14\"\n height=\"14\"\n [attr.x]=\"entry.center.x - 7\"\n [attr.y]=\"entry.center.y - 7\">\n <ds-icon\n name=\"pin\"\n [size]=\"14\" />\n </foreignObject>\n }\n }\n </svg>\n\n <div class=\"center\">\n <span class=\"center-value\">\n {{ resolvedCenterValue() }}\n </span>\n\n @if (centerLabel()) {\n <span class=\"center-label\">\n {{ centerLabel() }}\n </span>\n }\n </div>\n </div>\n\n @if (legend() !== 'none') {\n <ul class=\"legend\">\n @for (entry of slices(); track entry.slice.id; let index = $index) {\n <li\n class=\"legend-item\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"onLegendEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onLegendFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index, '.legend')\"\n (click)=\"onLegendClick(entry.slice, index, $event)\"\n (keydown.enter)=\"onSliceKey(entry.slice, $event)\"\n (keydown.space)=\"onSliceKey(entry.slice, $event)\">\n <span\n class=\"swatch\"\n animate.enter=\"mark-enter\"\n [style.background]=\"entry.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ entry.slice.label }}\n </span>\n\n <span class=\"legend-value\">\n {{ entry.formattedValue }}\n </span>\n\n @if (partOfWhole()) {\n <span class=\"legend-percent\">\n {{ entry.formattedPercent }}\n </span>\n }\n </li>\n }\n </ul>\n }\n </div>\n\n @if (dataTableResolved() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n @if (partOfWhole()) {\n <th scope=\"col\">\n Share of total\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of slices(); track entry.slice.id) {\n <tr>\n <td>\n {{ entry.slice.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n @if (partOfWhole()) {\n <td>\n {{ entry.formattedPercent }}\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEA,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC;AAC7B,MAAM,iBAAiB,GAAG,IAAI;AAEvB,MAAM,iBAAiB,GAAG,IAAI;AAErC;AACsC;AAChC,SAAU,YAAY,CAAC,SAAiB,EAAA;AAC5C,IAAA,MAAM,KAAK,GACT,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,CAAC,IAAI,SAAS,IAAI;AAC1D,UAAE;UACA,iBAAiB;AAEvB,IAAA,OAAO,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC;AACzB;AAEA;;;AAG2D;SAC3C,aAAa,CAC3B,MAAkC,EAClC,KAAoB,EACpB,UAAkB,EAAA;AAElB,IAAA,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE;AAC3D,QAAA,OAAO,CAAC,GAAG,MAAM,CAAC;IACpB;AACA,IAAA,IAAI,MAAM,CAAC,MAAM,IAAI,KAAK,EAAE;AAC1B,QAAA,OAAO,CAAC,GAAG,MAAM,CAAC;IACpB;AACA,IAAA,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM;SACtB,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1E,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,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