@masmarino/gabarit 1.4.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +231 -144
- package/accordion/README.md +56 -0
- package/alert/README.md +87 -0
- package/app-shell/README.md +133 -0
- package/auth/README.md +155 -0
- package/auth-activate/README.md +119 -0
- package/auth-login/README.md +113 -0
- package/auth-register/README.md +104 -0
- package/auth-reset-password/README.md +120 -0
- package/autocomplete/README.md +77 -0
- package/avatar/README.md +34 -0
- package/avatar-group/README.md +47 -0
- package/badge/README.md +177 -0
- package/bar-chart/README.md +44 -0
- package/breadcrumb/README.md +38 -0
- package/button/README.md +175 -0
- package/card/README.md +179 -0
- package/checkbox/README.md +50 -0
- package/checkbox-group/README.md +78 -0
- package/confirm-danger-modal/README.md +77 -0
- package/copy-button/README.md +90 -0
- package/copy-field/README.md +54 -0
- package/date-picker/README.md +84 -0
- package/description-list/README.md +63 -0
- package/dimension-card/README.md +39 -0
- package/disclosure/README.md +48 -0
- package/divider/README.md +31 -0
- package/drawer/README.md +49 -0
- package/empty-state/README.md +84 -0
- package/fesm2022/masmarino-gabarit-accordion.mjs +243 -0
- package/fesm2022/masmarino-gabarit-accordion.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-alert.mjs +208 -0
- package/fesm2022/masmarino-gabarit-alert.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-app-shell.mjs +378 -0
- package/fesm2022/masmarino-gabarit-app-shell.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-activate.mjs +415 -0
- package/fesm2022/masmarino-gabarit-auth-activate.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-login.mjs +467 -0
- package/fesm2022/masmarino-gabarit-auth-login.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-register.mjs +457 -0
- package/fesm2022/masmarino-gabarit-auth-register.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-reset-password.mjs +364 -0
- package/fesm2022/masmarino-gabarit-auth-reset-password.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth.mjs +844 -0
- package/fesm2022/masmarino-gabarit-auth.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-autocomplete.mjs +477 -0
- package/fesm2022/masmarino-gabarit-autocomplete.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-avatar-group.mjs +199 -0
- package/fesm2022/masmarino-gabarit-avatar-group.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-avatar.mjs +107 -0
- package/fesm2022/masmarino-gabarit-avatar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-badge.mjs +449 -0
- package/fesm2022/masmarino-gabarit-badge.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-bar-chart.mjs +408 -0
- package/fesm2022/masmarino-gabarit-bar-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-breadcrumb.mjs +59 -0
- package/fesm2022/masmarino-gabarit-breadcrumb.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-button.mjs +374 -0
- package/fesm2022/masmarino-gabarit-button.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-card.mjs +400 -0
- package/fesm2022/masmarino-gabarit-card.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-chart.mjs +1289 -0
- package/fesm2022/masmarino-gabarit-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-checkbox-group.mjs +335 -0
- package/fesm2022/masmarino-gabarit-checkbox-group.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-checkbox.mjs +170 -0
- package/fesm2022/masmarino-gabarit-checkbox.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-confirm-danger-modal.mjs +387 -0
- package/fesm2022/masmarino-gabarit-confirm-danger-modal.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-copy-button.mjs +407 -0
- package/fesm2022/masmarino-gabarit-copy-button.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-copy-field.mjs +229 -0
- package/fesm2022/masmarino-gabarit-copy-field.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-date-picker.mjs +1238 -0
- package/fesm2022/masmarino-gabarit-date-picker.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-description-list.mjs +127 -0
- package/fesm2022/masmarino-gabarit-description-list.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-dimension-card.mjs +162 -0
- package/fesm2022/masmarino-gabarit-dimension-card.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-disclosure.mjs +154 -0
- package/fesm2022/masmarino-gabarit-disclosure.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-divider.mjs +90 -0
- package/fesm2022/masmarino-gabarit-divider.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-docs.mjs +21 -11
- package/fesm2022/masmarino-gabarit-docs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-drawer.mjs +209 -0
- package/fesm2022/masmarino-gabarit-drawer.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-empty-state.mjs +226 -0
- package/fesm2022/masmarino-gabarit-empty-state.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-file-upload.mjs +335 -0
- package/fesm2022/masmarino-gabarit-file-upload.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-floating-panel.mjs +13 -0
- package/fesm2022/masmarino-gabarit-floating-panel.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-format.mjs +345 -0
- package/fesm2022/masmarino-gabarit-format.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-funnel-chart.mjs +247 -0
- package/fesm2022/masmarino-gabarit-funnel-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-gauge-bar.mjs +180 -0
- package/fesm2022/masmarino-gabarit-gauge-bar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-git-field.mjs +127 -0
- package/fesm2022/masmarino-gabarit-git-field.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-icon-marker.mjs +150 -0
- package/fesm2022/masmarino-gabarit-icon-marker.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-icon.mjs +308 -0
- package/fesm2022/masmarino-gabarit-icon.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-input.mjs +493 -0
- package/fesm2022/masmarino-gabarit-input.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-job-graph.mjs +216 -0
- package/fesm2022/masmarino-gabarit-job-graph.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-job-status.mjs +104 -0
- package/fesm2022/masmarino-gabarit-job-status.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-line-chart.mjs +574 -0
- package/fesm2022/masmarino-gabarit-line-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-list-card.mjs +320 -0
- package/fesm2022/masmarino-gabarit-list-card.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-list-row.mjs +58 -0
- package/fesm2022/masmarino-gabarit-list-row.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs +369 -0
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-menu.mjs +461 -0
- package/fesm2022/masmarino-gabarit-menu.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs +897 -0
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs +629 -0
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-modal.mjs +260 -0
- package/fesm2022/masmarino-gabarit-modal.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs +332 -0
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-notification-dot.mjs +119 -0
- package/fesm2022/masmarino-gabarit-notification-dot.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-page-header.mjs +78 -0
- package/fesm2022/masmarino-gabarit-page-header.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-page-layout.mjs +157 -0
- package/fesm2022/masmarino-gabarit-page-layout.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-pagination.mjs +415 -0
- package/fesm2022/masmarino-gabarit-pagination.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-panel.mjs +80 -0
- package/fesm2022/masmarino-gabarit-panel.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs +606 -0
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-pie-chart.mjs +317 -0
- package/fesm2022/masmarino-gabarit-pie-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-popover.mjs +139 -0
- package/fesm2022/masmarino-gabarit-popover.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-radio-group.mjs +202 -0
- package/fesm2022/masmarino-gabarit-radio-group.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-save-status.mjs +142 -0
- package/fesm2022/masmarino-gabarit-save-status.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-search-bar.mjs +576 -0
- package/fesm2022/masmarino-gabarit-search-bar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-secret-reveal.mjs +348 -0
- package/fesm2022/masmarino-gabarit-secret-reveal.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-segmented-control.mjs +272 -0
- package/fesm2022/masmarino-gabarit-segmented-control.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-select.mjs +510 -0
- package/fesm2022/masmarino-gabarit-select.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-skeleton-list.mjs +189 -0
- package/fesm2022/masmarino-gabarit-skeleton-list.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-skeleton.mjs +109 -0
- package/fesm2022/masmarino-gabarit-skeleton.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-slider.mjs +239 -0
- package/fesm2022/masmarino-gabarit-slider.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-sparkline.mjs +276 -0
- package/fesm2022/masmarino-gabarit-sparkline.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-spinner.mjs +86 -0
- package/fesm2022/masmarino-gabarit-spinner.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-stat-grid.mjs +139 -0
- package/fesm2022/masmarino-gabarit-stat-grid.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-stat-tile.mjs +312 -0
- package/fesm2022/masmarino-gabarit-stat-tile.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-stepper.mjs +219 -0
- package/fesm2022/masmarino-gabarit-stepper.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-switch.mjs +151 -0
- package/fesm2022/masmarino-gabarit-switch.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-table.mjs +206 -0
- package/fesm2022/masmarino-gabarit-table.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tabs.mjs +210 -0
- package/fesm2022/masmarino-gabarit-tabs.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tag-input.mjs +288 -0
- package/fesm2022/masmarino-gabarit-tag-input.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tag.mjs +155 -0
- package/fesm2022/masmarino-gabarit-tag.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-textarea.mjs +369 -0
- package/fesm2022/masmarino-gabarit-textarea.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-timeline-chart.mjs +521 -0
- package/fesm2022/masmarino-gabarit-timeline-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-toaster.mjs +220 -0
- package/fesm2022/masmarino-gabarit-toaster.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tooltip.mjs +182 -0
- package/fesm2022/masmarino-gabarit-tooltip.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tree.mjs +258 -0
- package/fesm2022/masmarino-gabarit-tree.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-user-chip.mjs +106 -0
- package/fesm2022/masmarino-gabarit-user-chip.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit.mjs +83 -24785
- package/fesm2022/masmarino-gabarit.mjs.map +1 -1
- package/file-upload/README.md +47 -0
- package/fonts/OFL-ibm-plex.txt +93 -0
- package/fonts/ibm-plex-mono-400.woff2 +0 -0
- package/fonts/ibm-plex-mono-500.woff2 +0 -0
- package/fonts/ibm-plex-sans-400.woff2 +0 -0
- package/fonts/ibm-plex-sans-500.woff2 +0 -0
- package/fonts/ibm-plex-sans-600.woff2 +0 -0
- package/fonts/ibm-plex-sans-condensed-600.woff2 +0 -0
- package/fonts/index.scss +28 -0
- package/funnel-chart/README.md +39 -0
- package/gauge-bar/README.md +35 -0
- package/git-field/README.md +34 -0
- package/icon/README.md +52 -0
- package/icon-marker/README.md +37 -0
- package/input/README.md +120 -0
- package/job-graph/README.md +76 -0
- package/job-status/README.md +34 -0
- package/line-chart/README.md +52 -0
- package/list-card/README.md +144 -0
- package/list-row/README.md +72 -0
- package/list-toolbar/README.md +52 -0
- package/menu/README.md +90 -0
- package/mfa-enrollment/README.md +189 -0
- package/mfa-settings/README.md +154 -0
- package/modal/README.md +72 -0
- package/nav-tabs/README.md +106 -0
- package/notification-dot/README.md +43 -0
- package/package.json +335 -1
- package/page-header/README.md +56 -0
- package/page-layout/README.md +76 -0
- package/pagination/README.md +73 -0
- package/panel/README.md +56 -0
- package/passkey-settings/README.md +120 -0
- package/pie-chart/README.md +85 -0
- package/popover/README.md +62 -0
- package/radio-group/README.md +47 -0
- package/save-status/README.md +44 -0
- package/search-bar/README.md +84 -0
- package/secret-reveal/README.md +60 -0
- package/segmented-control/README.md +79 -0
- package/select/README.md +61 -0
- package/skeleton/README.md +49 -0
- package/skeleton-list/README.md +40 -0
- package/slider/README.md +44 -0
- package/sparkline/README.md +37 -0
- package/spinner/README.md +41 -0
- package/src/lib/tokens/_a11y.scss +22 -0
- package/src/lib/tokens/_base.scss +31 -0
- package/src/lib/tokens/_palette.scss +52 -51
- package/src/lib/tokens/_semantic.scss +17 -124
- package/src/lib/tokens/_themes.scss +144 -0
- package/src/lib/tokens/_utilities.scss +10 -10
- package/src/lib/tokens/index.scss +3 -0
- package/stat-grid/README.md +47 -0
- package/stat-tile/README.md +75 -0
- package/stepper/README.md +67 -0
- package/switch/README.md +51 -0
- package/table/README.md +75 -0
- package/tabs/README.md +34 -0
- package/tag/README.md +34 -0
- package/tag-input/README.md +45 -0
- package/textarea/README.md +76 -0
- package/timeline-chart/README.md +49 -0
- package/toaster/README.md +92 -0
- package/tooltip/README.md +50 -0
- package/tree/README.md +79 -0
- package/types/masmarino-gabarit-accordion.d.ts +54 -0
- package/types/masmarino-gabarit-alert.d.ts +65 -0
- package/types/masmarino-gabarit-app-shell.d.ts +102 -0
- package/types/masmarino-gabarit-auth-activate.d.ts +70 -0
- package/types/masmarino-gabarit-auth-login.d.ts +63 -0
- package/types/masmarino-gabarit-auth-register.d.ts +66 -0
- package/types/masmarino-gabarit-auth-reset-password.d.ts +53 -0
- package/types/masmarino-gabarit-auth.d.ts +543 -0
- package/types/masmarino-gabarit-autocomplete.d.ts +139 -0
- package/types/masmarino-gabarit-avatar-group.d.ts +59 -0
- package/types/masmarino-gabarit-avatar.d.ts +31 -0
- package/types/masmarino-gabarit-badge.d.ts +139 -0
- package/types/masmarino-gabarit-bar-chart.d.ts +111 -0
- package/types/masmarino-gabarit-breadcrumb.d.ts +12 -0
- package/types/masmarino-gabarit-button.d.ts +108 -0
- package/types/masmarino-gabarit-card.d.ts +102 -0
- package/types/masmarino-gabarit-chart.d.ts +361 -0
- package/types/masmarino-gabarit-checkbox-group.d.ts +113 -0
- package/types/masmarino-gabarit-checkbox.d.ts +49 -0
- package/types/masmarino-gabarit-confirm-danger-modal.d.ts +94 -0
- package/types/masmarino-gabarit-copy-button.d.ts +111 -0
- package/types/masmarino-gabarit-copy-field.d.ts +64 -0
- package/types/masmarino-gabarit-date-picker.d.ts +397 -0
- package/types/masmarino-gabarit-description-list.d.ts +40 -0
- package/types/masmarino-gabarit-dimension-card.d.ts +55 -0
- package/types/masmarino-gabarit-disclosure.d.ts +44 -0
- package/types/masmarino-gabarit-divider.d.ts +20 -0
- package/types/masmarino-gabarit-docs.d.ts +20 -59
- package/types/masmarino-gabarit-drawer.d.ts +51 -0
- package/types/masmarino-gabarit-empty-state.d.ts +67 -0
- package/types/masmarino-gabarit-file-upload.d.ts +95 -0
- package/types/masmarino-gabarit-floating-panel.d.ts +7 -0
- package/types/masmarino-gabarit-format.d.ts +54 -0
- package/types/masmarino-gabarit-funnel-chart.d.ts +78 -0
- package/types/masmarino-gabarit-gauge-bar.d.ts +54 -0
- package/types/masmarino-gabarit-git-field.d.ts +39 -0
- package/types/masmarino-gabarit-icon-marker.d.ts +47 -0
- package/types/masmarino-gabarit-icon.d.ts +23 -0
- package/types/masmarino-gabarit-input.d.ts +181 -0
- package/types/masmarino-gabarit-job-graph.d.ts +63 -0
- package/types/masmarino-gabarit-job-status.d.ts +20 -0
- package/types/masmarino-gabarit-line-chart.d.ts +153 -0
- package/types/masmarino-gabarit-list-card.d.ts +87 -0
- package/types/masmarino-gabarit-list-row.d.ts +14 -0
- package/types/masmarino-gabarit-list-toolbar.d.ts +100 -0
- package/types/masmarino-gabarit-menu.d.ts +92 -0
- package/types/masmarino-gabarit-mfa-enrollment.d.ts +142 -0
- package/types/masmarino-gabarit-mfa-settings.d.ts +89 -0
- package/types/masmarino-gabarit-modal.d.ts +60 -0
- package/types/masmarino-gabarit-nav-tabs.d.ts +65 -0
- package/types/masmarino-gabarit-notification-dot.d.ts +34 -0
- package/types/masmarino-gabarit-page-header.d.ts +20 -0
- package/types/masmarino-gabarit-page-layout.d.ts +46 -0
- package/types/masmarino-gabarit-pagination.d.ts +109 -0
- package/types/masmarino-gabarit-panel.d.ts +21 -0
- package/types/masmarino-gabarit-passkey-settings.d.ts +94 -0
- package/types/masmarino-gabarit-pie-chart.d.ts +94 -0
- package/types/masmarino-gabarit-popover.d.ts +32 -0
- package/types/masmarino-gabarit-radio-group.d.ts +66 -0
- package/types/masmarino-gabarit-save-status.d.ts +39 -0
- package/types/masmarino-gabarit-search-bar.d.ts +183 -0
- package/types/masmarino-gabarit-secret-reveal.d.ts +95 -0
- package/types/masmarino-gabarit-segmented-control.d.ts +76 -0
- package/types/masmarino-gabarit-select.d.ts +145 -0
- package/types/masmarino-gabarit-skeleton-list.d.ts +54 -0
- package/types/masmarino-gabarit-skeleton.d.ts +26 -0
- package/types/masmarino-gabarit-slider.d.ts +73 -0
- package/types/masmarino-gabarit-sparkline.d.ts +70 -0
- package/types/masmarino-gabarit-spinner.d.ts +20 -0
- package/types/masmarino-gabarit-stat-grid.d.ts +39 -0
- package/types/masmarino-gabarit-stat-tile.d.ts +79 -0
- package/types/masmarino-gabarit-stepper.d.ts +67 -0
- package/types/masmarino-gabarit-switch.d.ts +42 -0
- package/types/masmarino-gabarit-table.d.ts +60 -0
- package/types/masmarino-gabarit-tabs.d.ts +40 -0
- package/types/masmarino-gabarit-tag-input.d.ts +78 -0
- package/types/masmarino-gabarit-tag.d.ts +35 -0
- package/types/masmarino-gabarit-textarea.d.ts +109 -0
- package/types/masmarino-gabarit-timeline-chart.d.ts +145 -0
- package/types/masmarino-gabarit-toaster.d.ts +62 -0
- package/types/masmarino-gabarit-tooltip.d.ts +38 -0
- package/types/masmarino-gabarit-tree.d.ts +71 -0
- package/types/masmarino-gabarit-user-chip.d.ts +26 -0
- package/types/masmarino-gabarit.d.ts +83 -6605
- package/user-chip/README.md +42 -0
|
@@ -0,0 +1,1289 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Injectable, InjectionToken, booleanAttribute, computed, effect, inject, input, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { formatCompact } from "@masmarino/gabarit/format";
|
|
4
|
+
function linearScale(domain, range) {
|
|
5
|
+
const [d0, d1] = domain;
|
|
6
|
+
const [r0, r1] = range;
|
|
7
|
+
const span = d1 - d0;
|
|
8
|
+
const ratio = span === 0 ? 0 : (r1 - r0) / span;
|
|
9
|
+
return {
|
|
10
|
+
domain,
|
|
11
|
+
range,
|
|
12
|
+
map: (value) => r0 + (value - d0) * ratio,
|
|
13
|
+
invert: (pixel) => ratio === 0 ? d0 : d0 + (pixel - r0) / ratio
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function timeScale(domain, range) {
|
|
17
|
+
const numeric = linearScale([domain[0].getTime(), domain[1].getTime()], range);
|
|
18
|
+
return {
|
|
19
|
+
domain,
|
|
20
|
+
range,
|
|
21
|
+
map: (value) => numeric.map(value.getTime()),
|
|
22
|
+
invert: (pixel) => new Date(numeric.invert(pixel))
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function bandScale(domain, range, padding = 0) {
|
|
26
|
+
const [r0, r1] = range;
|
|
27
|
+
const step = domain.length === 0 ? 0 : (r1 - r0) / domain.length;
|
|
28
|
+
return {
|
|
29
|
+
domain,
|
|
30
|
+
range,
|
|
31
|
+
bandwidth: step * (1 - Math.min(Math.max(padding, 0), 1)),
|
|
32
|
+
map: (value) => {
|
|
33
|
+
const index = domain.indexOf(value);
|
|
34
|
+
return index === -1 ? NaN : r0 + index * step;
|
|
35
|
+
},
|
|
36
|
+
invert: (pixel) => {
|
|
37
|
+
if (step === 0) return null;
|
|
38
|
+
const index = Math.floor((pixel - r0) / step);
|
|
39
|
+
return index >= 0 && index < domain.length ? domain[index] : null;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const EMPTY_BOX = {
|
|
44
|
+
width: 0,
|
|
45
|
+
height: 0,
|
|
46
|
+
margin: {
|
|
47
|
+
top: 0,
|
|
48
|
+
right: 0,
|
|
49
|
+
bottom: 0,
|
|
50
|
+
left: 0
|
|
51
|
+
},
|
|
52
|
+
innerWidth: 0,
|
|
53
|
+
innerHeight: 0
|
|
54
|
+
};
|
|
55
|
+
const CHART_CONTEXT = new InjectionToken("gbt-chart-context");
|
|
56
|
+
var ChartContext = class ChartContext {
|
|
57
|
+
_box = signal(EMPTY_BOX, ...ngDevMode ? [{ debugName: "_box" }] : /* istanbul ignore next */ []);
|
|
58
|
+
_xSpec = signal({
|
|
59
|
+
kind: "linear",
|
|
60
|
+
domain: [0, 1]
|
|
61
|
+
}, ...ngDevMode ? [{ debugName: "_xSpec" }] : /* istanbul ignore next */ []);
|
|
62
|
+
_ySpec = signal({
|
|
63
|
+
kind: "linear",
|
|
64
|
+
domain: [0, 1]
|
|
65
|
+
}, ...ngDevMode ? [{ debugName: "_ySpec" }] : /* istanbul ignore next */ []);
|
|
66
|
+
_activeIndex = signal(null, ...ngDevMode ? [{ debugName: "_activeIndex" }] : /* istanbul ignore next */ []);
|
|
67
|
+
_pointValues = signal([], ...ngDevMode ? [{ debugName: "_pointValues" }] : /* istanbul ignore next */ []);
|
|
68
|
+
box = this._box.asReadonly();
|
|
69
|
+
xSpec = this._xSpec.asReadonly();
|
|
70
|
+
ySpec = this._ySpec.asReadonly();
|
|
71
|
+
activeIndex = this._activeIndex.asReadonly();
|
|
72
|
+
pointValues = this._pointValues.asReadonly();
|
|
73
|
+
xScale = computed(() => {
|
|
74
|
+
const spec = this._xSpec();
|
|
75
|
+
const range = [0, this._box().innerWidth];
|
|
76
|
+
if (spec.kind === "time") return timeScale(spec.domain, range);
|
|
77
|
+
if (spec.kind === "band") return bandScale(spec.domain, range, spec.padding ?? 0);
|
|
78
|
+
return linearScale(spec.domain, range);
|
|
79
|
+
}, ...ngDevMode ? [{ debugName: "xScale" }] : /* istanbul ignore next */ []);
|
|
80
|
+
yScale = computed(() => linearScale(this._ySpec().domain, [this._box().innerHeight, 0]), ...ngDevMode ? [{ debugName: "yScale" }] : /* istanbul ignore next */ []);
|
|
81
|
+
pointPositions = computed(() => {
|
|
82
|
+
const kind = this._xSpec().kind;
|
|
83
|
+
const scale = this.xScale();
|
|
84
|
+
return this._pointValues().map((value) => kind === "band" ? scale.map(value) + scale.bandwidth / 2 : scale.map(value));
|
|
85
|
+
}, ...ngDevMode ? [{ debugName: "pointPositions" }] : /* istanbul ignore next */ []);
|
|
86
|
+
activePosition = computed(() => {
|
|
87
|
+
const index = this._activeIndex();
|
|
88
|
+
if (index === null) return null;
|
|
89
|
+
return this.pointPositions()[index] ?? null;
|
|
90
|
+
}, ...ngDevMode ? [{ debugName: "activePosition" }] : /* istanbul ignore next */ []);
|
|
91
|
+
setPointValues(values) {
|
|
92
|
+
this._pointValues.set(values);
|
|
93
|
+
}
|
|
94
|
+
setGeometry(box) {
|
|
95
|
+
this._box.set(box);
|
|
96
|
+
}
|
|
97
|
+
setSpecs(x, y) {
|
|
98
|
+
this._xSpec.set(x);
|
|
99
|
+
this._ySpec.set(y);
|
|
100
|
+
}
|
|
101
|
+
setActiveIndex(index) {
|
|
102
|
+
this._activeIndex.set(index);
|
|
103
|
+
}
|
|
104
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
105
|
+
minVersion: "12.0.0",
|
|
106
|
+
version: "22.2.0",
|
|
107
|
+
ngImport: i0,
|
|
108
|
+
type: ChartContext,
|
|
109
|
+
deps: [],
|
|
110
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
111
|
+
});
|
|
112
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
113
|
+
minVersion: "12.0.0",
|
|
114
|
+
version: "22.2.0",
|
|
115
|
+
ngImport: i0,
|
|
116
|
+
type: ChartContext
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
120
|
+
minVersion: "12.0.0",
|
|
121
|
+
version: "22.2.0",
|
|
122
|
+
ngImport: i0,
|
|
123
|
+
type: ChartContext,
|
|
124
|
+
decorators: [{ type: Injectable }]
|
|
125
|
+
});
|
|
126
|
+
const ESTIMATED_CHAR_WIDTH = 6.5;
|
|
127
|
+
function estimateLabelWidth(label) {
|
|
128
|
+
return label.length * ESTIMATED_CHAR_WIDTH;
|
|
129
|
+
}
|
|
130
|
+
function niceTicks(min, max, count) {
|
|
131
|
+
if (!Number.isFinite(min) || !Number.isFinite(max)) return [];
|
|
132
|
+
if (min === max) return [min];
|
|
133
|
+
if (max < min) return niceTicks(max, min, count);
|
|
134
|
+
const rawStep = (max - min) / Math.max(1, count);
|
|
135
|
+
const magnitude = 10 ** Math.floor(Math.log10(rawStep));
|
|
136
|
+
const normalized = rawStep / magnitude;
|
|
137
|
+
const step = magnitude * (normalized <= 1 ? 1 : normalized <= 2 ? 2 : normalized <= 5 ? 5 : 10);
|
|
138
|
+
const first = Math.floor(min / step) * step;
|
|
139
|
+
const last = Math.ceil(max / step) * step;
|
|
140
|
+
const decimals = Math.max(0, -Math.floor(Math.log10(step)));
|
|
141
|
+
const ticks = [];
|
|
142
|
+
for (let value = first; value <= last + step / 1e9; value += step) ticks.push(Number(value.toFixed(decimals)));
|
|
143
|
+
return ticks;
|
|
144
|
+
}
|
|
145
|
+
const SECOND = 1e3;
|
|
146
|
+
const MINUTE = 60 * SECOND;
|
|
147
|
+
const HOUR = 60 * MINUTE;
|
|
148
|
+
const DAY$1 = 24 * HOUR;
|
|
149
|
+
const STEPS = [
|
|
150
|
+
{
|
|
151
|
+
ms: SECOND,
|
|
152
|
+
unit: "second"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
ms: 5 * SECOND,
|
|
156
|
+
unit: "second"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
ms: 15 * SECOND,
|
|
160
|
+
unit: "second"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
ms: 30 * SECOND,
|
|
164
|
+
unit: "second"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
ms: MINUTE,
|
|
168
|
+
unit: "minute"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
ms: 5 * MINUTE,
|
|
172
|
+
unit: "minute"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
ms: 15 * MINUTE,
|
|
176
|
+
unit: "minute"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
ms: 30 * MINUTE,
|
|
180
|
+
unit: "minute"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
ms: HOUR,
|
|
184
|
+
unit: "hour"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
ms: 3 * HOUR,
|
|
188
|
+
unit: "hour"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
ms: 6 * HOUR,
|
|
192
|
+
unit: "hour"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
ms: 12 * HOUR,
|
|
196
|
+
unit: "hour"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
ms: DAY$1,
|
|
200
|
+
unit: "day"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
ms: 2 * DAY$1,
|
|
204
|
+
unit: "day"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
ms: 7 * DAY$1,
|
|
208
|
+
unit: "day"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
ms: 30 * DAY$1,
|
|
212
|
+
unit: "month",
|
|
213
|
+
months: 1
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
ms: 90 * DAY$1,
|
|
217
|
+
unit: "month",
|
|
218
|
+
months: 3
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
ms: 365 * DAY$1,
|
|
222
|
+
unit: "year",
|
|
223
|
+
months: 12
|
|
224
|
+
}
|
|
225
|
+
];
|
|
226
|
+
const FORMATS = {
|
|
227
|
+
second: {
|
|
228
|
+
hour: "2-digit",
|
|
229
|
+
minute: "2-digit",
|
|
230
|
+
second: "2-digit"
|
|
231
|
+
},
|
|
232
|
+
minute: {
|
|
233
|
+
hour: "2-digit",
|
|
234
|
+
minute: "2-digit"
|
|
235
|
+
},
|
|
236
|
+
hour: {
|
|
237
|
+
hour: "2-digit",
|
|
238
|
+
minute: "2-digit"
|
|
239
|
+
},
|
|
240
|
+
day: {
|
|
241
|
+
day: "2-digit",
|
|
242
|
+
month: "2-digit"
|
|
243
|
+
},
|
|
244
|
+
month: {
|
|
245
|
+
month: "short",
|
|
246
|
+
year: "numeric"
|
|
247
|
+
},
|
|
248
|
+
year: { year: "numeric" }
|
|
249
|
+
};
|
|
250
|
+
const MIN_PIXELS_PER_TICK = 60;
|
|
251
|
+
function timeTicks(start, end, pixelWidth) {
|
|
252
|
+
const span = end.getTime() - start.getTime();
|
|
253
|
+
const makeFormatter = (unit) => (date, locale) => new Intl.DateTimeFormat(locale, {
|
|
254
|
+
...FORMATS[unit],
|
|
255
|
+
timeZone: "UTC"
|
|
256
|
+
}).format(date);
|
|
257
|
+
if (span <= 0) return {
|
|
258
|
+
values: [start],
|
|
259
|
+
unit: "day",
|
|
260
|
+
format: makeFormatter("day")
|
|
261
|
+
};
|
|
262
|
+
const maxTicks = Math.max(2, Math.floor(pixelWidth / MIN_PIXELS_PER_TICK));
|
|
263
|
+
const coarsest = STEPS[STEPS.length - 1];
|
|
264
|
+
const chosen = STEPS.find((step) => span / step.ms + 1 <= maxTicks) ?? {
|
|
265
|
+
...coarsest,
|
|
266
|
+
months: coarsest.months * Math.max(1, Math.ceil((span / coarsest.ms + 1) / maxTicks))
|
|
267
|
+
};
|
|
268
|
+
const values = [];
|
|
269
|
+
if (chosen.months) {
|
|
270
|
+
const step = chosen.months;
|
|
271
|
+
const cursor = step >= 12 ? new Date(Date.UTC(Math.floor(start.getUTCFullYear() / (step / 12)) * (step / 12), 0, 1)) : new Date(Date.UTC(start.getUTCFullYear(), Math.floor(start.getUTCMonth() / step) * step, 1));
|
|
272
|
+
while (cursor.getTime() < start.getTime()) cursor.setUTCMonth(cursor.getUTCMonth() + step);
|
|
273
|
+
while (cursor.getTime() <= end.getTime()) {
|
|
274
|
+
values.push(new Date(cursor));
|
|
275
|
+
cursor.setUTCMonth(cursor.getUTCMonth() + step);
|
|
276
|
+
}
|
|
277
|
+
} else {
|
|
278
|
+
const first = Math.ceil(start.getTime() / chosen.ms) * chosen.ms;
|
|
279
|
+
for (let t = first; t <= end.getTime(); t += chosen.ms) values.push(new Date(t));
|
|
280
|
+
}
|
|
281
|
+
if (values.length === 0) values.push(start);
|
|
282
|
+
return {
|
|
283
|
+
values,
|
|
284
|
+
unit: chosen.unit,
|
|
285
|
+
format: makeFormatter(chosen.unit)
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
var ChartAxis = class ChartAxis {
|
|
289
|
+
context = inject(CHART_CONTEXT);
|
|
290
|
+
axis = input.required(...ngDevMode ? [{ debugName: "axis" }] : /* istanbul ignore next */ []);
|
|
291
|
+
locale = input.required(...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
292
|
+
tickCount = input(5, ...ngDevMode ? [{ debugName: "tickCount" }] : /* istanbul ignore next */ []);
|
|
293
|
+
format = input(null, ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
|
|
294
|
+
grid = input(false, {
|
|
295
|
+
...ngDevMode ? { debugName: "grid" } : /* istanbul ignore next */ {},
|
|
296
|
+
transform: booleanAttribute
|
|
297
|
+
});
|
|
298
|
+
groupTransform = computed(() => {
|
|
299
|
+
const box = this.context.box();
|
|
300
|
+
return this.axis() === "x" ? `translate(0,${box.innerHeight})` : "translate(0,0)";
|
|
301
|
+
}, ...ngDevMode ? [{ debugName: "groupTransform" }] : /* istanbul ignore next */ []);
|
|
302
|
+
ticks = computed(() => {
|
|
303
|
+
if (this.axis() === "y") return this.yTicks();
|
|
304
|
+
const ticks = this.xTicks();
|
|
305
|
+
if (this.context.xSpec().kind === "band") return ticks;
|
|
306
|
+
const last = ticks.length - 1;
|
|
307
|
+
return ticks.map((tick, index) => ({
|
|
308
|
+
...tick,
|
|
309
|
+
anchor: index === 0 ? "start" : index === last ? "end" : "middle"
|
|
310
|
+
}));
|
|
311
|
+
}, ...ngDevMode ? [{ debugName: "ticks" }] : /* istanbul ignore next */ []);
|
|
312
|
+
gridLines = computed(() => {
|
|
313
|
+
if (!this.grid() || this.axis() !== "y") return [];
|
|
314
|
+
return this.yTicks().map((tick) => tick.y - 4);
|
|
315
|
+
}, ...ngDevMode ? [{ debugName: "gridLines" }] : /* istanbul ignore next */ []);
|
|
316
|
+
innerWidth = computed(() => this.context.box().innerWidth, ...ngDevMode ? [{ debugName: "innerWidth" }] : /* istanbul ignore next */ []);
|
|
317
|
+
yTicks() {
|
|
318
|
+
const spec = this.context.ySpec();
|
|
319
|
+
const scale = this.context.yScale();
|
|
320
|
+
const custom = this.format();
|
|
321
|
+
return niceTicks(spec.domain[0], spec.domain[1], this.tickCount()).map((value) => ({
|
|
322
|
+
key: `y-${value}`,
|
|
323
|
+
x: -8,
|
|
324
|
+
y: scale.map(value) + 4,
|
|
325
|
+
label: custom ? custom(value) : formatCompact(value, this.locale()),
|
|
326
|
+
date: null,
|
|
327
|
+
anchor: "end"
|
|
328
|
+
}));
|
|
329
|
+
}
|
|
330
|
+
xTicks() {
|
|
331
|
+
const spec = this.context.xSpec();
|
|
332
|
+
const box = this.context.box();
|
|
333
|
+
const custom = this.format();
|
|
334
|
+
if (spec.kind === "band") {
|
|
335
|
+
const scale = this.context.xScale();
|
|
336
|
+
const labels = spec.domain.map((category) => custom ? custom(category) : category);
|
|
337
|
+
const step = spec.domain.length === 0 ? 0 : box.innerWidth / spec.domain.length;
|
|
338
|
+
const widest = labels.reduce((large, label) => Math.max(large, estimateLabelWidth(label)), 0);
|
|
339
|
+
const keepEvery = Math.max(1, Math.ceil((widest + 8) / Math.max(step, 1)));
|
|
340
|
+
return spec.domain.map((category, index) => ({
|
|
341
|
+
key: `x-${category}`,
|
|
342
|
+
x: scale.map(category) + scale.bandwidth / 2,
|
|
343
|
+
y: 20,
|
|
344
|
+
label: labels[index],
|
|
345
|
+
date: null,
|
|
346
|
+
anchor: "middle"
|
|
347
|
+
})).filter((_, index) => index % keepEvery === 0);
|
|
348
|
+
}
|
|
349
|
+
if (spec.kind === "time") {
|
|
350
|
+
const scale = this.context.xScale();
|
|
351
|
+
const result = timeTicks(spec.domain[0], spec.domain[1], box.innerWidth);
|
|
352
|
+
const fine = result.unit === "hour" || result.unit === "minute" || result.unit === "second";
|
|
353
|
+
const multiDay = new Set(result.values.map((v) => v.toISOString().slice(0, 10))).size > 1;
|
|
354
|
+
const seen = /* @__PURE__ */ new Set();
|
|
355
|
+
return result.values.map((value) => {
|
|
356
|
+
const day = value.toISOString().slice(0, 10);
|
|
357
|
+
const first = fine && multiDay && !seen.has(day);
|
|
358
|
+
seen.add(day);
|
|
359
|
+
return {
|
|
360
|
+
key: `x-${value.getTime()}`,
|
|
361
|
+
x: scale.map(value),
|
|
362
|
+
y: first ? 14 : 20,
|
|
363
|
+
label: custom ? custom(value) : result.format(value, this.locale()),
|
|
364
|
+
date: first ? new Intl.DateTimeFormat(this.locale(), {
|
|
365
|
+
day: "2-digit",
|
|
366
|
+
month: "2-digit",
|
|
367
|
+
timeZone: "UTC"
|
|
368
|
+
}).format(value) : null,
|
|
369
|
+
anchor: "middle"
|
|
370
|
+
};
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
const scale = this.context.xScale();
|
|
374
|
+
return niceTicks(spec.domain[0], spec.domain[1], this.tickCount()).map((value) => ({
|
|
375
|
+
key: `x-${value}`,
|
|
376
|
+
x: scale.map(value),
|
|
377
|
+
y: 20,
|
|
378
|
+
label: custom ? custom(value) : formatCompact(value, this.locale()),
|
|
379
|
+
date: null,
|
|
380
|
+
anchor: "middle"
|
|
381
|
+
}));
|
|
382
|
+
}
|
|
383
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
384
|
+
minVersion: "12.0.0",
|
|
385
|
+
version: "22.2.0",
|
|
386
|
+
ngImport: i0,
|
|
387
|
+
type: ChartAxis,
|
|
388
|
+
deps: [],
|
|
389
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
390
|
+
});
|
|
391
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
392
|
+
minVersion: "17.0.0",
|
|
393
|
+
version: "22.2.0",
|
|
394
|
+
type: ChartAxis,
|
|
395
|
+
isStandalone: true,
|
|
396
|
+
selector: "g[gbtChartAxis]",
|
|
397
|
+
inputs: {
|
|
398
|
+
axis: {
|
|
399
|
+
classPropertyName: "axis",
|
|
400
|
+
publicName: "axis",
|
|
401
|
+
isSignal: true,
|
|
402
|
+
isRequired: true,
|
|
403
|
+
transformFunction: null
|
|
404
|
+
},
|
|
405
|
+
locale: {
|
|
406
|
+
classPropertyName: "locale",
|
|
407
|
+
publicName: "locale",
|
|
408
|
+
isSignal: true,
|
|
409
|
+
isRequired: true,
|
|
410
|
+
transformFunction: null
|
|
411
|
+
},
|
|
412
|
+
tickCount: {
|
|
413
|
+
classPropertyName: "tickCount",
|
|
414
|
+
publicName: "tickCount",
|
|
415
|
+
isSignal: true,
|
|
416
|
+
isRequired: false,
|
|
417
|
+
transformFunction: null
|
|
418
|
+
},
|
|
419
|
+
format: {
|
|
420
|
+
classPropertyName: "format",
|
|
421
|
+
publicName: "format",
|
|
422
|
+
isSignal: true,
|
|
423
|
+
isRequired: false,
|
|
424
|
+
transformFunction: null
|
|
425
|
+
},
|
|
426
|
+
grid: {
|
|
427
|
+
classPropertyName: "grid",
|
|
428
|
+
publicName: "grid",
|
|
429
|
+
isSignal: true,
|
|
430
|
+
isRequired: false,
|
|
431
|
+
transformFunction: null
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
host: {
|
|
435
|
+
attributes: { "aria-hidden": "true" },
|
|
436
|
+
properties: {
|
|
437
|
+
"attr.transform": "groupTransform()",
|
|
438
|
+
"attr.axis": "axis()"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
ngImport: i0,
|
|
442
|
+
template: "@for (y of gridLines(); track $index) {\n <svg:line\n class=\"gbt-chart-axis__grid\"\n x1=\"0\"\n [attr.x2]=\"innerWidth()\"\n [attr.y1]=\"y\"\n [attr.y2]=\"y\"\n />\n}\n@for (tick of ticks(); track tick.key) {\n <svg:text\n class=\"gbt-chart-axis__label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"tick.y\"\n [attr.text-anchor]=\"tick.anchor\"\n >\n @if (tick.date) {\n <svg:tspan [attr.x]=\"tick.x\" dy=\"0\">{{ tick.label }}</svg:tspan>\n <svg:tspan [attr.x]=\"tick.x\" dy=\"1.1em\">{{ tick.date }}</svg:tspan>\n } @else {\n {{ tick.label }}\n }\n </svg:text>\n}\n",
|
|
443
|
+
styles: [".gbt-chart-axis__label{fill:var(--text-discret);font-size:.75rem;font-family:var(--font-family)}.gbt-chart-axis__grid{stroke:var(--border-color);stroke-width:1;opacity:.5}\n"],
|
|
444
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
445
|
+
});
|
|
446
|
+
};
|
|
447
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
448
|
+
minVersion: "12.0.0",
|
|
449
|
+
version: "22.2.0",
|
|
450
|
+
ngImport: i0,
|
|
451
|
+
type: ChartAxis,
|
|
452
|
+
decorators: [{
|
|
453
|
+
type: Component,
|
|
454
|
+
args: [{
|
|
455
|
+
selector: "g[gbtChartAxis]",
|
|
456
|
+
standalone: true,
|
|
457
|
+
imports: [],
|
|
458
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
459
|
+
host: {
|
|
460
|
+
"[attr.transform]": "groupTransform()",
|
|
461
|
+
"[attr.axis]": "axis()",
|
|
462
|
+
"aria-hidden": "true"
|
|
463
|
+
},
|
|
464
|
+
template: "@for (y of gridLines(); track $index) {\n <svg:line\n class=\"gbt-chart-axis__grid\"\n x1=\"0\"\n [attr.x2]=\"innerWidth()\"\n [attr.y1]=\"y\"\n [attr.y2]=\"y\"\n />\n}\n@for (tick of ticks(); track tick.key) {\n <svg:text\n class=\"gbt-chart-axis__label\"\n [attr.x]=\"tick.x\"\n [attr.y]=\"tick.y\"\n [attr.text-anchor]=\"tick.anchor\"\n >\n @if (tick.date) {\n <svg:tspan [attr.x]=\"tick.x\" dy=\"0\">{{ tick.label }}</svg:tspan>\n <svg:tspan [attr.x]=\"tick.x\" dy=\"1.1em\">{{ tick.date }}</svg:tspan>\n } @else {\n {{ tick.label }}\n }\n </svg:text>\n}\n",
|
|
465
|
+
styles: [".gbt-chart-axis__label{fill:var(--text-discret);font-size:.75rem;font-family:var(--font-family)}.gbt-chart-axis__grid{stroke:var(--border-color);stroke-width:1;opacity:.5}\n"]
|
|
466
|
+
}]
|
|
467
|
+
}],
|
|
468
|
+
propDecorators: {
|
|
469
|
+
axis: [{
|
|
470
|
+
type: i0.Input,
|
|
471
|
+
args: [{
|
|
472
|
+
isSignal: true,
|
|
473
|
+
alias: "axis",
|
|
474
|
+
required: true
|
|
475
|
+
}]
|
|
476
|
+
}],
|
|
477
|
+
locale: [{
|
|
478
|
+
type: i0.Input,
|
|
479
|
+
args: [{
|
|
480
|
+
isSignal: true,
|
|
481
|
+
alias: "locale",
|
|
482
|
+
required: true
|
|
483
|
+
}]
|
|
484
|
+
}],
|
|
485
|
+
tickCount: [{
|
|
486
|
+
type: i0.Input,
|
|
487
|
+
args: [{
|
|
488
|
+
isSignal: true,
|
|
489
|
+
alias: "tickCount",
|
|
490
|
+
required: false
|
|
491
|
+
}]
|
|
492
|
+
}],
|
|
493
|
+
format: [{
|
|
494
|
+
type: i0.Input,
|
|
495
|
+
args: [{
|
|
496
|
+
isSignal: true,
|
|
497
|
+
alias: "format",
|
|
498
|
+
required: false
|
|
499
|
+
}]
|
|
500
|
+
}],
|
|
501
|
+
grid: [{
|
|
502
|
+
type: i0.Input,
|
|
503
|
+
args: [{
|
|
504
|
+
isSignal: true,
|
|
505
|
+
alias: "grid",
|
|
506
|
+
required: false
|
|
507
|
+
}]
|
|
508
|
+
}]
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
const DAY = 864e5;
|
|
512
|
+
function yDomain(series, includeZero) {
|
|
513
|
+
const values = series.flatMap((s) => s.points.map((p) => p.y));
|
|
514
|
+
if (values.length === 0) return [0, 1];
|
|
515
|
+
let min = Math.min(...values);
|
|
516
|
+
let max = Math.max(...values);
|
|
517
|
+
if (includeZero) {
|
|
518
|
+
min = Math.min(min, 0);
|
|
519
|
+
max = Math.max(max, 0);
|
|
520
|
+
}
|
|
521
|
+
if (min === max) return [min, min + 1];
|
|
522
|
+
return [min, max];
|
|
523
|
+
}
|
|
524
|
+
function numericXDomain(series) {
|
|
525
|
+
const values = series.flatMap((s) => s.points.map((p) => p.x));
|
|
526
|
+
if (values.length === 0) return [0, 1];
|
|
527
|
+
const min = Math.min(...values);
|
|
528
|
+
const max = Math.max(...values);
|
|
529
|
+
return min === max ? [min, min + 1] : [min, max];
|
|
530
|
+
}
|
|
531
|
+
function timeXDomain(series) {
|
|
532
|
+
const values = series.flatMap((s) => s.points.map((p) => p.x.getTime()));
|
|
533
|
+
if (values.length === 0) return [/* @__PURE__ */ new Date(-864e5), /* @__PURE__ */ new Date(0)];
|
|
534
|
+
const min = Math.min(...values);
|
|
535
|
+
const max = Math.max(...values);
|
|
536
|
+
return min === max ? [new Date(min), new Date(min + DAY)] : [new Date(min), new Date(max)];
|
|
537
|
+
}
|
|
538
|
+
function niceYDomain(series, includeZero, tickCount) {
|
|
539
|
+
const [min, max] = yDomain(series, includeZero);
|
|
540
|
+
const ticks = niceTicks(min, max, tickCount);
|
|
541
|
+
if (ticks.length === 0) return [min, max];
|
|
542
|
+
return [ticks[0], ticks[ticks.length - 1]];
|
|
543
|
+
}
|
|
544
|
+
function niceXDomain(series, tickCount) {
|
|
545
|
+
const [min, max] = numericXDomain(series);
|
|
546
|
+
const ticks = niceTicks(min, max, tickCount);
|
|
547
|
+
if (ticks.length === 0) return [min, max];
|
|
548
|
+
return [ticks[0], ticks[ticks.length - 1]];
|
|
549
|
+
}
|
|
550
|
+
var ChartEmpty = class ChartEmpty {
|
|
551
|
+
message = input.required(...ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []);
|
|
552
|
+
actionLabel = input("", ...ngDevMode ? [{ debugName: "actionLabel" }] : /* istanbul ignore next */ []);
|
|
553
|
+
action = output();
|
|
554
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
555
|
+
minVersion: "12.0.0",
|
|
556
|
+
version: "22.2.0",
|
|
557
|
+
ngImport: i0,
|
|
558
|
+
type: ChartEmpty,
|
|
559
|
+
deps: [],
|
|
560
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
561
|
+
});
|
|
562
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
563
|
+
minVersion: "17.0.0",
|
|
564
|
+
version: "22.2.0",
|
|
565
|
+
type: ChartEmpty,
|
|
566
|
+
isStandalone: true,
|
|
567
|
+
selector: "gbt-chart-empty",
|
|
568
|
+
inputs: {
|
|
569
|
+
message: {
|
|
570
|
+
classPropertyName: "message",
|
|
571
|
+
publicName: "message",
|
|
572
|
+
isSignal: true,
|
|
573
|
+
isRequired: true,
|
|
574
|
+
transformFunction: null
|
|
575
|
+
},
|
|
576
|
+
actionLabel: {
|
|
577
|
+
classPropertyName: "actionLabel",
|
|
578
|
+
publicName: "actionLabel",
|
|
579
|
+
isSignal: true,
|
|
580
|
+
isRequired: false,
|
|
581
|
+
transformFunction: null
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
outputs: { action: "action" },
|
|
585
|
+
ngImport: i0,
|
|
586
|
+
template: "<div class=\"gbt-chart-empty\" role=\"status\">\n <div class=\"gbt-chart-empty__icon\" aria-hidden=\"true\">\n <ng-content select=\"[gbtChartEmptyIcon]\" />\n </div>\n <p class=\"gbt-chart-empty__message\">{{ message() }}</p>\n @if (actionLabel()) {\n <button type=\"button\" class=\"gbt-chart-empty__action\" (click)=\"action.emit()\">\n {{ actionLabel() }}\n </button>\n }\n</div>\n",
|
|
587
|
+
styles: [".gbt-chart-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;min-height:8rem;padding:1.5rem;color:var(--text-secondary);text-align:center}.gbt-chart-empty__icon{width:64px;height:64px;color:var(--text-discret)}.gbt-chart-empty__icon:empty{display:none}.gbt-chart-empty__icon svg{width:100%;height:100%}.gbt-chart-empty__message{margin:0;font-size:.875rem}.gbt-chart-empty__action{min-width:24px;min-height:24px;padding:.375rem .75rem;border:1px solid var(--border-color);border-radius:var(--site-border-radius);background:transparent;color:var(--primary);font:inherit;cursor:pointer}.gbt-chart-empty__action:hover{background:var(--bg-hover)}.gbt-chart-empty__action:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}\n"],
|
|
588
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
589
|
+
});
|
|
590
|
+
};
|
|
591
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
592
|
+
minVersion: "12.0.0",
|
|
593
|
+
version: "22.2.0",
|
|
594
|
+
ngImport: i0,
|
|
595
|
+
type: ChartEmpty,
|
|
596
|
+
decorators: [{
|
|
597
|
+
type: Component,
|
|
598
|
+
args: [{
|
|
599
|
+
selector: "gbt-chart-empty",
|
|
600
|
+
standalone: true,
|
|
601
|
+
imports: [],
|
|
602
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
603
|
+
template: "<div class=\"gbt-chart-empty\" role=\"status\">\n <div class=\"gbt-chart-empty__icon\" aria-hidden=\"true\">\n <ng-content select=\"[gbtChartEmptyIcon]\" />\n </div>\n <p class=\"gbt-chart-empty__message\">{{ message() }}</p>\n @if (actionLabel()) {\n <button type=\"button\" class=\"gbt-chart-empty__action\" (click)=\"action.emit()\">\n {{ actionLabel() }}\n </button>\n }\n</div>\n",
|
|
604
|
+
styles: [".gbt-chart-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;min-height:8rem;padding:1.5rem;color:var(--text-secondary);text-align:center}.gbt-chart-empty__icon{width:64px;height:64px;color:var(--text-discret)}.gbt-chart-empty__icon:empty{display:none}.gbt-chart-empty__icon svg{width:100%;height:100%}.gbt-chart-empty__message{margin:0;font-size:.875rem}.gbt-chart-empty__action{min-width:24px;min-height:24px;padding:.375rem .75rem;border:1px solid var(--border-color);border-radius:var(--site-border-radius);background:transparent;color:var(--primary);font:inherit;cursor:pointer}.gbt-chart-empty__action:hover{background:var(--bg-hover)}.gbt-chart-empty__action:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}\n"]
|
|
605
|
+
}]
|
|
606
|
+
}],
|
|
607
|
+
propDecorators: {
|
|
608
|
+
message: [{
|
|
609
|
+
type: i0.Input,
|
|
610
|
+
args: [{
|
|
611
|
+
isSignal: true,
|
|
612
|
+
alias: "message",
|
|
613
|
+
required: true
|
|
614
|
+
}]
|
|
615
|
+
}],
|
|
616
|
+
actionLabel: [{
|
|
617
|
+
type: i0.Input,
|
|
618
|
+
args: [{
|
|
619
|
+
isSignal: true,
|
|
620
|
+
alias: "actionLabel",
|
|
621
|
+
required: false
|
|
622
|
+
}]
|
|
623
|
+
}],
|
|
624
|
+
action: [{
|
|
625
|
+
type: i0.Output,
|
|
626
|
+
args: ["action"]
|
|
627
|
+
}]
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
function nearestIndex(sorted, target) {
|
|
631
|
+
if (sorted.length === 0) return -1;
|
|
632
|
+
let low = 0;
|
|
633
|
+
let high = sorted.length - 1;
|
|
634
|
+
while (low < high) {
|
|
635
|
+
const mid = low + high >> 1;
|
|
636
|
+
if (sorted[mid] < target) low = mid + 1;
|
|
637
|
+
else high = mid;
|
|
638
|
+
}
|
|
639
|
+
const previous = low - 1;
|
|
640
|
+
if (previous < 0) return low;
|
|
641
|
+
return target - sorted[previous] <= sorted[low] - target ? previous : low;
|
|
642
|
+
}
|
|
643
|
+
const DEFAULT_MARGIN = {
|
|
644
|
+
top: 16,
|
|
645
|
+
right: 8,
|
|
646
|
+
bottom: 32,
|
|
647
|
+
left: 48
|
|
648
|
+
};
|
|
649
|
+
var ChartFrame = class ChartFrame {
|
|
650
|
+
context = inject(ChartContext);
|
|
651
|
+
label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
652
|
+
heading = input("", ...ngDevMode ? [{ debugName: "heading" }] : /* istanbul ignore next */ []);
|
|
653
|
+
headingLevel = input(2, ...ngDevMode ? [{ debugName: "headingLevel" }] : /* istanbul ignore next */ []);
|
|
654
|
+
headline = input("", ...ngDevMode ? [{ debugName: "headline" }] : /* istanbul ignore next */ []);
|
|
655
|
+
trend = input("", ...ngDevMode ? [{ debugName: "trend" }] : /* istanbul ignore next */ []);
|
|
656
|
+
x = input.required(...ngDevMode ? [{ debugName: "x" }] : /* istanbul ignore next */ []);
|
|
657
|
+
y = input.required(...ngDevMode ? [{ debugName: "y" }] : /* istanbul ignore next */ []);
|
|
658
|
+
margin = input({}, ...ngDevMode ? [{ debugName: "margin" }] : /* istanbul ignore next */ []);
|
|
659
|
+
size = input(null, ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
660
|
+
pointValues = input([], ...ngDevMode ? [{ debugName: "pointValues" }] : /* istanbul ignore next */ []);
|
|
661
|
+
activeIndexChange = output();
|
|
662
|
+
surface = viewChild.required("surface", ...ngDevMode ? [{ debugName: "surface" }] : /* istanbul ignore next */ []);
|
|
663
|
+
measured = signal(null, ...ngDevMode ? [{ debugName: "measured" }] : /* istanbul ignore next */ []);
|
|
664
|
+
ready = computed(() => this.context.box().innerWidth > 0, ...ngDevMode ? [{ debugName: "ready" }] : /* istanbul ignore next */ []);
|
|
665
|
+
viewBox = computed(() => {
|
|
666
|
+
const b = this.context.box();
|
|
667
|
+
return `0 0 ${b.width} ${b.height}`;
|
|
668
|
+
}, ...ngDevMode ? [{ debugName: "viewBox" }] : /* istanbul ignore next */ []);
|
|
669
|
+
innerTransform = computed(() => {
|
|
670
|
+
const m = this.context.box().margin;
|
|
671
|
+
return `translate(${m.left},${m.top})`;
|
|
672
|
+
}, ...ngDevMode ? [{ debugName: "innerTransform" }] : /* istanbul ignore next */ []);
|
|
673
|
+
activePosition = computed(() => this.context.activePosition(), ...ngDevMode ? [{ debugName: "activePosition" }] : /* istanbul ignore next */ []);
|
|
674
|
+
innerHeight = computed(() => this.context.box().innerHeight, ...ngDevMode ? [{ debugName: "innerHeight" }] : /* istanbul ignore next */ []);
|
|
675
|
+
constructor() {
|
|
676
|
+
effect(() => this.activeIndexChange.emit(this.context.activeIndex()));
|
|
677
|
+
effect(() => {
|
|
678
|
+
const margin = {
|
|
679
|
+
...DEFAULT_MARGIN,
|
|
680
|
+
...this.margin()
|
|
681
|
+
};
|
|
682
|
+
const size = this.size() ?? this.measured();
|
|
683
|
+
const width = size?.width ?? 0;
|
|
684
|
+
const height = size?.height ?? 0;
|
|
685
|
+
this.context.setSpecs(this.x(), this.y());
|
|
686
|
+
this.context.setPointValues(this.pointValues());
|
|
687
|
+
this.context.setGeometry({
|
|
688
|
+
width,
|
|
689
|
+
height,
|
|
690
|
+
margin,
|
|
691
|
+
innerWidth: Math.max(0, width - margin.left - margin.right),
|
|
692
|
+
innerHeight: Math.max(0, height - margin.top - margin.bottom)
|
|
693
|
+
});
|
|
694
|
+
});
|
|
695
|
+
effect((onCleanup) => {
|
|
696
|
+
if (this.size() || typeof ResizeObserver === "undefined") return;
|
|
697
|
+
const element = this.surface().nativeElement;
|
|
698
|
+
const observer = new ResizeObserver((entries) => {
|
|
699
|
+
const rect = entries[0]?.contentRect;
|
|
700
|
+
if (rect) this.measured.set({
|
|
701
|
+
width: rect.width,
|
|
702
|
+
height: rect.height
|
|
703
|
+
});
|
|
704
|
+
});
|
|
705
|
+
observer.observe(element);
|
|
706
|
+
onCleanup(() => observer.disconnect());
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
onKeydown(event) {
|
|
710
|
+
const count = this.pointValues().length;
|
|
711
|
+
if (count === 0) return;
|
|
712
|
+
const current = this.context.activeIndex();
|
|
713
|
+
const last = count - 1;
|
|
714
|
+
switch (event.key) {
|
|
715
|
+
case "ArrowRight":
|
|
716
|
+
this.context.setActiveIndex(current === null ? 0 : Math.min(last, current + 1));
|
|
717
|
+
break;
|
|
718
|
+
case "ArrowLeft":
|
|
719
|
+
this.context.setActiveIndex(current === null ? last : Math.max(0, current - 1));
|
|
720
|
+
break;
|
|
721
|
+
case "Home":
|
|
722
|
+
this.context.setActiveIndex(0);
|
|
723
|
+
break;
|
|
724
|
+
case "End":
|
|
725
|
+
this.context.setActiveIndex(last);
|
|
726
|
+
break;
|
|
727
|
+
case "Escape":
|
|
728
|
+
this.context.setActiveIndex(null);
|
|
729
|
+
break;
|
|
730
|
+
default: return;
|
|
731
|
+
}
|
|
732
|
+
event.preventDefault();
|
|
733
|
+
}
|
|
734
|
+
onBlur() {
|
|
735
|
+
this.context.setActiveIndex(null);
|
|
736
|
+
}
|
|
737
|
+
onPointerMove(event) {
|
|
738
|
+
const positions = this.context.pointPositions();
|
|
739
|
+
if (positions.length === 0) return;
|
|
740
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
741
|
+
const local = event.clientX - rect.left - this.context.box().margin.left;
|
|
742
|
+
this.context.setActiveIndex(nearestIndex(positions, local));
|
|
743
|
+
}
|
|
744
|
+
onPointerLeave(event) {
|
|
745
|
+
const surface = event.currentTarget;
|
|
746
|
+
if (surface.ownerDocument.activeElement === surface) return;
|
|
747
|
+
this.context.setActiveIndex(null);
|
|
748
|
+
}
|
|
749
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
750
|
+
minVersion: "12.0.0",
|
|
751
|
+
version: "22.2.0",
|
|
752
|
+
ngImport: i0,
|
|
753
|
+
type: ChartFrame,
|
|
754
|
+
deps: [],
|
|
755
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
756
|
+
});
|
|
757
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
758
|
+
minVersion: "17.0.0",
|
|
759
|
+
version: "22.2.0",
|
|
760
|
+
type: ChartFrame,
|
|
761
|
+
isStandalone: true,
|
|
762
|
+
selector: "gbt-chart-frame",
|
|
763
|
+
inputs: {
|
|
764
|
+
label: {
|
|
765
|
+
classPropertyName: "label",
|
|
766
|
+
publicName: "label",
|
|
767
|
+
isSignal: true,
|
|
768
|
+
isRequired: true,
|
|
769
|
+
transformFunction: null
|
|
770
|
+
},
|
|
771
|
+
heading: {
|
|
772
|
+
classPropertyName: "heading",
|
|
773
|
+
publicName: "heading",
|
|
774
|
+
isSignal: true,
|
|
775
|
+
isRequired: false,
|
|
776
|
+
transformFunction: null
|
|
777
|
+
},
|
|
778
|
+
headingLevel: {
|
|
779
|
+
classPropertyName: "headingLevel",
|
|
780
|
+
publicName: "headingLevel",
|
|
781
|
+
isSignal: true,
|
|
782
|
+
isRequired: false,
|
|
783
|
+
transformFunction: null
|
|
784
|
+
},
|
|
785
|
+
headline: {
|
|
786
|
+
classPropertyName: "headline",
|
|
787
|
+
publicName: "headline",
|
|
788
|
+
isSignal: true,
|
|
789
|
+
isRequired: false,
|
|
790
|
+
transformFunction: null
|
|
791
|
+
},
|
|
792
|
+
trend: {
|
|
793
|
+
classPropertyName: "trend",
|
|
794
|
+
publicName: "trend",
|
|
795
|
+
isSignal: true,
|
|
796
|
+
isRequired: false,
|
|
797
|
+
transformFunction: null
|
|
798
|
+
},
|
|
799
|
+
x: {
|
|
800
|
+
classPropertyName: "x",
|
|
801
|
+
publicName: "x",
|
|
802
|
+
isSignal: true,
|
|
803
|
+
isRequired: true,
|
|
804
|
+
transformFunction: null
|
|
805
|
+
},
|
|
806
|
+
y: {
|
|
807
|
+
classPropertyName: "y",
|
|
808
|
+
publicName: "y",
|
|
809
|
+
isSignal: true,
|
|
810
|
+
isRequired: true,
|
|
811
|
+
transformFunction: null
|
|
812
|
+
},
|
|
813
|
+
margin: {
|
|
814
|
+
classPropertyName: "margin",
|
|
815
|
+
publicName: "margin",
|
|
816
|
+
isSignal: true,
|
|
817
|
+
isRequired: false,
|
|
818
|
+
transformFunction: null
|
|
819
|
+
},
|
|
820
|
+
size: {
|
|
821
|
+
classPropertyName: "size",
|
|
822
|
+
publicName: "size",
|
|
823
|
+
isSignal: true,
|
|
824
|
+
isRequired: false,
|
|
825
|
+
transformFunction: null
|
|
826
|
+
},
|
|
827
|
+
pointValues: {
|
|
828
|
+
classPropertyName: "pointValues",
|
|
829
|
+
publicName: "pointValues",
|
|
830
|
+
isSignal: true,
|
|
831
|
+
isRequired: false,
|
|
832
|
+
transformFunction: null
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
outputs: { activeIndexChange: "activeIndexChange" },
|
|
836
|
+
providers: [ChartContext, {
|
|
837
|
+
provide: CHART_CONTEXT,
|
|
838
|
+
useExisting: ChartContext
|
|
839
|
+
}],
|
|
840
|
+
viewQueries: [{
|
|
841
|
+
propertyName: "surface",
|
|
842
|
+
first: true,
|
|
843
|
+
predicate: ["surface"],
|
|
844
|
+
descendants: true,
|
|
845
|
+
isSignal: true
|
|
846
|
+
}],
|
|
847
|
+
ngImport: i0,
|
|
848
|
+
template: "<div class=\"gbt-chart-frame\">\n @if (heading()) {\n <div class=\"gbt-chart-frame__header\">\n @switch (headingLevel()) {\n @case (1) {\n <h1 class=\"gbt-chart-frame__title\">{{ heading() }}</h1>\n }\n @case (3) {\n <h3 class=\"gbt-chart-frame__title\">{{ heading() }}</h3>\n }\n @case (4) {\n <h4 class=\"gbt-chart-frame__title\">{{ heading() }}</h4>\n }\n @case (5) {\n <h5 class=\"gbt-chart-frame__title\">{{ heading() }}</h5>\n }\n @case (6) {\n <h6 class=\"gbt-chart-frame__title\">{{ heading() }}</h6>\n }\n @default {\n <h2 class=\"gbt-chart-frame__title\">{{ heading() }}</h2>\n }\n }\n @if (headline()) {\n <p class=\"gbt-chart-frame__headline\">{{ headline() }}</p>\n }\n @if (trend()) {\n <p class=\"gbt-chart-frame__trend\">{{ trend() }}</p>\n }\n </div>\n }\n\n <div\n #surface\n class=\"gbt-chart-frame__surface\"\n [attr.tabindex]=\"ready() && pointValues().length > 0 ? 0 : null\"\n [attr.role]=\"ready() ? 'group' : null\"\n [attr.aria-label]=\"ready() ? label() : null\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n >\n @if (ready()) {\n <svg\n class=\"gbt-chart-frame__svg\"\n [attr.viewBox]=\"viewBox()\"\n role=\"presentation\"\n focusable=\"false\"\n >\n <g [attr.transform]=\"innerTransform()\">\n <ng-content select=\"[gbtChartLayer]\" />\n @if (activePosition() !== null) {\n <line\n class=\"gbt-chart-frame__guide\"\n [attr.x1]=\"activePosition()\"\n [attr.x2]=\"activePosition()\"\n y1=\"0\"\n [attr.y2]=\"innerHeight()\"\n aria-hidden=\"true\"\n />\n }\n </g>\n </svg>\n <ng-content select=\"gbt-chart-tooltip\" />\n }\n </div>\n <ng-content select=\"gbt-chart-empty\" />\n <ng-content select=\"gbt-chart-table\" />\n</div>\n",
|
|
849
|
+
styles: [":host{display:block}.gbt-chart-frame{position:relative;width:100%;height:100%;display:flex;flex-direction:column}.gbt-chart-frame__surface{flex:1;min-height:0;position:relative}.gbt-chart-frame__surface:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-chart-frame__svg{display:block;width:100%;height:100%}.gbt-chart-frame__guide{stroke:var(--border-color);stroke-width:1;pointer-events:none}.gbt-chart-frame__header{display:grid;grid-template-columns:1fr auto;align-items:baseline;column-gap:.75rem;margin-bottom:.5rem}.gbt-chart-frame__title{font-family:var(--gbt-font-display, var(--font-display));margin:0;font-size:.875rem;font-weight:600;color:var(--text-primary)}.gbt-chart-frame__headline{margin:0;grid-row:1;grid-column:2;font-size:1.375rem;font-weight:600;font-variant-numeric:tabular-nums;color:var(--text-primary)}.gbt-chart-frame__trend{margin:0;grid-column:2;justify-self:end;font-size:.6875rem;font-weight:600;color:var(--text-secondary)}\n"],
|
|
850
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
851
|
+
});
|
|
852
|
+
};
|
|
853
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
854
|
+
minVersion: "12.0.0",
|
|
855
|
+
version: "22.2.0",
|
|
856
|
+
ngImport: i0,
|
|
857
|
+
type: ChartFrame,
|
|
858
|
+
decorators: [{
|
|
859
|
+
type: Component,
|
|
860
|
+
args: [{
|
|
861
|
+
selector: "gbt-chart-frame",
|
|
862
|
+
standalone: true,
|
|
863
|
+
imports: [],
|
|
864
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
865
|
+
providers: [ChartContext, {
|
|
866
|
+
provide: CHART_CONTEXT,
|
|
867
|
+
useExisting: ChartContext
|
|
868
|
+
}],
|
|
869
|
+
template: "<div class=\"gbt-chart-frame\">\n @if (heading()) {\n <div class=\"gbt-chart-frame__header\">\n @switch (headingLevel()) {\n @case (1) {\n <h1 class=\"gbt-chart-frame__title\">{{ heading() }}</h1>\n }\n @case (3) {\n <h3 class=\"gbt-chart-frame__title\">{{ heading() }}</h3>\n }\n @case (4) {\n <h4 class=\"gbt-chart-frame__title\">{{ heading() }}</h4>\n }\n @case (5) {\n <h5 class=\"gbt-chart-frame__title\">{{ heading() }}</h5>\n }\n @case (6) {\n <h6 class=\"gbt-chart-frame__title\">{{ heading() }}</h6>\n }\n @default {\n <h2 class=\"gbt-chart-frame__title\">{{ heading() }}</h2>\n }\n }\n @if (headline()) {\n <p class=\"gbt-chart-frame__headline\">{{ headline() }}</p>\n }\n @if (trend()) {\n <p class=\"gbt-chart-frame__trend\">{{ trend() }}</p>\n }\n </div>\n }\n\n <div\n #surface\n class=\"gbt-chart-frame__surface\"\n [attr.tabindex]=\"ready() && pointValues().length > 0 ? 0 : null\"\n [attr.role]=\"ready() ? 'group' : null\"\n [attr.aria-label]=\"ready() ? label() : null\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n >\n @if (ready()) {\n <svg\n class=\"gbt-chart-frame__svg\"\n [attr.viewBox]=\"viewBox()\"\n role=\"presentation\"\n focusable=\"false\"\n >\n <g [attr.transform]=\"innerTransform()\">\n <ng-content select=\"[gbtChartLayer]\" />\n @if (activePosition() !== null) {\n <line\n class=\"gbt-chart-frame__guide\"\n [attr.x1]=\"activePosition()\"\n [attr.x2]=\"activePosition()\"\n y1=\"0\"\n [attr.y2]=\"innerHeight()\"\n aria-hidden=\"true\"\n />\n }\n </g>\n </svg>\n <ng-content select=\"gbt-chart-tooltip\" />\n }\n </div>\n <ng-content select=\"gbt-chart-empty\" />\n <ng-content select=\"gbt-chart-table\" />\n</div>\n",
|
|
870
|
+
styles: [":host{display:block}.gbt-chart-frame{position:relative;width:100%;height:100%;display:flex;flex-direction:column}.gbt-chart-frame__surface{flex:1;min-height:0;position:relative}.gbt-chart-frame__surface:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-chart-frame__svg{display:block;width:100%;height:100%}.gbt-chart-frame__guide{stroke:var(--border-color);stroke-width:1;pointer-events:none}.gbt-chart-frame__header{display:grid;grid-template-columns:1fr auto;align-items:baseline;column-gap:.75rem;margin-bottom:.5rem}.gbt-chart-frame__title{font-family:var(--gbt-font-display, var(--font-display));margin:0;font-size:.875rem;font-weight:600;color:var(--text-primary)}.gbt-chart-frame__headline{margin:0;grid-row:1;grid-column:2;font-size:1.375rem;font-weight:600;font-variant-numeric:tabular-nums;color:var(--text-primary)}.gbt-chart-frame__trend{margin:0;grid-column:2;justify-self:end;font-size:.6875rem;font-weight:600;color:var(--text-secondary)}\n"]
|
|
871
|
+
}]
|
|
872
|
+
}],
|
|
873
|
+
ctorParameters: () => [],
|
|
874
|
+
propDecorators: {
|
|
875
|
+
label: [{
|
|
876
|
+
type: i0.Input,
|
|
877
|
+
args: [{
|
|
878
|
+
isSignal: true,
|
|
879
|
+
alias: "label",
|
|
880
|
+
required: true
|
|
881
|
+
}]
|
|
882
|
+
}],
|
|
883
|
+
heading: [{
|
|
884
|
+
type: i0.Input,
|
|
885
|
+
args: [{
|
|
886
|
+
isSignal: true,
|
|
887
|
+
alias: "heading",
|
|
888
|
+
required: false
|
|
889
|
+
}]
|
|
890
|
+
}],
|
|
891
|
+
headingLevel: [{
|
|
892
|
+
type: i0.Input,
|
|
893
|
+
args: [{
|
|
894
|
+
isSignal: true,
|
|
895
|
+
alias: "headingLevel",
|
|
896
|
+
required: false
|
|
897
|
+
}]
|
|
898
|
+
}],
|
|
899
|
+
headline: [{
|
|
900
|
+
type: i0.Input,
|
|
901
|
+
args: [{
|
|
902
|
+
isSignal: true,
|
|
903
|
+
alias: "headline",
|
|
904
|
+
required: false
|
|
905
|
+
}]
|
|
906
|
+
}],
|
|
907
|
+
trend: [{
|
|
908
|
+
type: i0.Input,
|
|
909
|
+
args: [{
|
|
910
|
+
isSignal: true,
|
|
911
|
+
alias: "trend",
|
|
912
|
+
required: false
|
|
913
|
+
}]
|
|
914
|
+
}],
|
|
915
|
+
x: [{
|
|
916
|
+
type: i0.Input,
|
|
917
|
+
args: [{
|
|
918
|
+
isSignal: true,
|
|
919
|
+
alias: "x",
|
|
920
|
+
required: true
|
|
921
|
+
}]
|
|
922
|
+
}],
|
|
923
|
+
y: [{
|
|
924
|
+
type: i0.Input,
|
|
925
|
+
args: [{
|
|
926
|
+
isSignal: true,
|
|
927
|
+
alias: "y",
|
|
928
|
+
required: true
|
|
929
|
+
}]
|
|
930
|
+
}],
|
|
931
|
+
margin: [{
|
|
932
|
+
type: i0.Input,
|
|
933
|
+
args: [{
|
|
934
|
+
isSignal: true,
|
|
935
|
+
alias: "margin",
|
|
936
|
+
required: false
|
|
937
|
+
}]
|
|
938
|
+
}],
|
|
939
|
+
size: [{
|
|
940
|
+
type: i0.Input,
|
|
941
|
+
args: [{
|
|
942
|
+
isSignal: true,
|
|
943
|
+
alias: "size",
|
|
944
|
+
required: false
|
|
945
|
+
}]
|
|
946
|
+
}],
|
|
947
|
+
pointValues: [{
|
|
948
|
+
type: i0.Input,
|
|
949
|
+
args: [{
|
|
950
|
+
isSignal: true,
|
|
951
|
+
alias: "pointValues",
|
|
952
|
+
required: false
|
|
953
|
+
}]
|
|
954
|
+
}],
|
|
955
|
+
activeIndexChange: [{
|
|
956
|
+
type: i0.Output,
|
|
957
|
+
args: ["activeIndexChange"]
|
|
958
|
+
}],
|
|
959
|
+
surface: [{
|
|
960
|
+
type: i0.ViewChild,
|
|
961
|
+
args: ["surface", { isSignal: true }]
|
|
962
|
+
}]
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
const DASH_ARRAYS = {
|
|
966
|
+
solid: "none",
|
|
967
|
+
dashed: "6 3",
|
|
968
|
+
dotted: "1 3"
|
|
969
|
+
};
|
|
970
|
+
var ChartLegend = class ChartLegend {
|
|
971
|
+
entries = input.required(...ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []);
|
|
972
|
+
interactive = input(false, {
|
|
973
|
+
...ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {},
|
|
974
|
+
transform: booleanAttribute
|
|
975
|
+
});
|
|
976
|
+
activeIndex = input(null, ...ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []);
|
|
977
|
+
activeIndexChange = output();
|
|
978
|
+
dashArray(pattern) {
|
|
979
|
+
return DASH_ARRAYS[pattern ?? "solid"];
|
|
980
|
+
}
|
|
981
|
+
onMouseLeave(event) {
|
|
982
|
+
const target = event.currentTarget;
|
|
983
|
+
if (target.ownerDocument.activeElement === target) return;
|
|
984
|
+
this.activeIndexChange.emit(null);
|
|
985
|
+
}
|
|
986
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
987
|
+
minVersion: "12.0.0",
|
|
988
|
+
version: "22.2.0",
|
|
989
|
+
ngImport: i0,
|
|
990
|
+
type: ChartLegend,
|
|
991
|
+
deps: [],
|
|
992
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
993
|
+
});
|
|
994
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
995
|
+
minVersion: "17.0.0",
|
|
996
|
+
version: "22.2.0",
|
|
997
|
+
type: ChartLegend,
|
|
998
|
+
isStandalone: true,
|
|
999
|
+
selector: "gbt-chart-legend",
|
|
1000
|
+
inputs: {
|
|
1001
|
+
entries: {
|
|
1002
|
+
classPropertyName: "entries",
|
|
1003
|
+
publicName: "entries",
|
|
1004
|
+
isSignal: true,
|
|
1005
|
+
isRequired: true,
|
|
1006
|
+
transformFunction: null
|
|
1007
|
+
},
|
|
1008
|
+
interactive: {
|
|
1009
|
+
classPropertyName: "interactive",
|
|
1010
|
+
publicName: "interactive",
|
|
1011
|
+
isSignal: true,
|
|
1012
|
+
isRequired: false,
|
|
1013
|
+
transformFunction: null
|
|
1014
|
+
},
|
|
1015
|
+
activeIndex: {
|
|
1016
|
+
classPropertyName: "activeIndex",
|
|
1017
|
+
publicName: "activeIndex",
|
|
1018
|
+
isSignal: true,
|
|
1019
|
+
isRequired: false,
|
|
1020
|
+
transformFunction: null
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
outputs: { activeIndexChange: "activeIndexChange" },
|
|
1024
|
+
ngImport: i0,
|
|
1025
|
+
template: "<ul class=\"gbt-chart-legend\">\n @for (entry of entries(); track $index) {\n <li\n class=\"gbt-chart-legend__item\"\n [class.gbt-chart-legend__item--active]=\"interactive() && activeIndex() === $index\"\n [attr.data-pattern]=\"entry.pattern ?? 'solid'\"\n [attr.tabindex]=\"interactive() ? 0 : null\"\n (mouseenter)=\"interactive() && activeIndexChange.emit($index)\"\n (mouseleave)=\"interactive() && onMouseLeave($event)\"\n (focus)=\"interactive() && activeIndexChange.emit($index)\"\n (blur)=\"interactive() && activeIndexChange.emit(null)\"\n >\n <svg class=\"gbt-chart-legend__swatch\" viewBox=\"0 0 24 8\" aria-hidden=\"true\" focusable=\"false\">\n @if (entry.color; as color) {\n <rect\n class=\"gbt-chart-legend__fill\"\n x=\"4\"\n y=\"0\"\n width=\"8\"\n height=\"8\"\n rx=\"2\"\n [attr.fill]=\"color\"\n />\n } @else {\n <line\n class=\"gbt-chart-legend__line\"\n x1=\"0\"\n y1=\"4\"\n x2=\"24\"\n y2=\"4\"\n [attr.stroke-dasharray]=\"dashArray(entry.pattern)\"\n stroke-width=\"2\"\n />\n }\n </svg>\n {{ entry.label }}\n @if (entry.value; as value) {\n <span class=\"gbt-chart-legend__value\">{{ value }}</span>\n }\n </li>\n }\n</ul>\n",
|
|
1026
|
+
styles: [".gbt-chart-legend{display:flex;flex-wrap:wrap;gap:.75rem 1.25rem;margin:0;padding:0;list-style:none;font-size:.8125rem;color:var(--text-secondary)}.gbt-chart-legend__item{display:inline-flex;align-items:center;gap:.375rem;border-radius:var(--site-border-radius-sm)}.gbt-chart-legend__item:nth-child(3n+1) .gbt-chart-legend__line{stroke:var(--chart-series-1-base)}.gbt-chart-legend__item:nth-child(3n+2) .gbt-chart-legend__line{stroke:var(--chart-series-2-base)}.gbt-chart-legend__item:nth-child(3n+3) .gbt-chart-legend__line{stroke:var(--chart-series-3-base)}.gbt-chart-legend__item[tabindex]{cursor:default;padding:.125rem .25rem;margin:-.125rem -.25rem}.gbt-chart-legend__item[tabindex]:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:1px}.gbt-chart-legend__item--active{background:var(--bg-hover)}.gbt-chart-legend__swatch{width:1.5rem;height:.5rem;flex:none}.gbt-chart-legend__value{margin-left:.375rem;font-variant-numeric:tabular-nums;font-weight:600;color:var(--text-primary)}\n"],
|
|
1027
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1028
|
+
});
|
|
1029
|
+
};
|
|
1030
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1031
|
+
minVersion: "12.0.0",
|
|
1032
|
+
version: "22.2.0",
|
|
1033
|
+
ngImport: i0,
|
|
1034
|
+
type: ChartLegend,
|
|
1035
|
+
decorators: [{
|
|
1036
|
+
type: Component,
|
|
1037
|
+
args: [{
|
|
1038
|
+
selector: "gbt-chart-legend",
|
|
1039
|
+
standalone: true,
|
|
1040
|
+
imports: [],
|
|
1041
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1042
|
+
template: "<ul class=\"gbt-chart-legend\">\n @for (entry of entries(); track $index) {\n <li\n class=\"gbt-chart-legend__item\"\n [class.gbt-chart-legend__item--active]=\"interactive() && activeIndex() === $index\"\n [attr.data-pattern]=\"entry.pattern ?? 'solid'\"\n [attr.tabindex]=\"interactive() ? 0 : null\"\n (mouseenter)=\"interactive() && activeIndexChange.emit($index)\"\n (mouseleave)=\"interactive() && onMouseLeave($event)\"\n (focus)=\"interactive() && activeIndexChange.emit($index)\"\n (blur)=\"interactive() && activeIndexChange.emit(null)\"\n >\n <svg class=\"gbt-chart-legend__swatch\" viewBox=\"0 0 24 8\" aria-hidden=\"true\" focusable=\"false\">\n @if (entry.color; as color) {\n <rect\n class=\"gbt-chart-legend__fill\"\n x=\"4\"\n y=\"0\"\n width=\"8\"\n height=\"8\"\n rx=\"2\"\n [attr.fill]=\"color\"\n />\n } @else {\n <line\n class=\"gbt-chart-legend__line\"\n x1=\"0\"\n y1=\"4\"\n x2=\"24\"\n y2=\"4\"\n [attr.stroke-dasharray]=\"dashArray(entry.pattern)\"\n stroke-width=\"2\"\n />\n }\n </svg>\n {{ entry.label }}\n @if (entry.value; as value) {\n <span class=\"gbt-chart-legend__value\">{{ value }}</span>\n }\n </li>\n }\n</ul>\n",
|
|
1043
|
+
styles: [".gbt-chart-legend{display:flex;flex-wrap:wrap;gap:.75rem 1.25rem;margin:0;padding:0;list-style:none;font-size:.8125rem;color:var(--text-secondary)}.gbt-chart-legend__item{display:inline-flex;align-items:center;gap:.375rem;border-radius:var(--site-border-radius-sm)}.gbt-chart-legend__item:nth-child(3n+1) .gbt-chart-legend__line{stroke:var(--chart-series-1-base)}.gbt-chart-legend__item:nth-child(3n+2) .gbt-chart-legend__line{stroke:var(--chart-series-2-base)}.gbt-chart-legend__item:nth-child(3n+3) .gbt-chart-legend__line{stroke:var(--chart-series-3-base)}.gbt-chart-legend__item[tabindex]{cursor:default;padding:.125rem .25rem;margin:-.125rem -.25rem}.gbt-chart-legend__item[tabindex]:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:1px}.gbt-chart-legend__item--active{background:var(--bg-hover)}.gbt-chart-legend__swatch{width:1.5rem;height:.5rem;flex:none}.gbt-chart-legend__value{margin-left:.375rem;font-variant-numeric:tabular-nums;font-weight:600;color:var(--text-primary)}\n"]
|
|
1044
|
+
}]
|
|
1045
|
+
}],
|
|
1046
|
+
propDecorators: {
|
|
1047
|
+
entries: [{
|
|
1048
|
+
type: i0.Input,
|
|
1049
|
+
args: [{
|
|
1050
|
+
isSignal: true,
|
|
1051
|
+
alias: "entries",
|
|
1052
|
+
required: true
|
|
1053
|
+
}]
|
|
1054
|
+
}],
|
|
1055
|
+
interactive: [{
|
|
1056
|
+
type: i0.Input,
|
|
1057
|
+
args: [{
|
|
1058
|
+
isSignal: true,
|
|
1059
|
+
alias: "interactive",
|
|
1060
|
+
required: false
|
|
1061
|
+
}]
|
|
1062
|
+
}],
|
|
1063
|
+
activeIndex: [{
|
|
1064
|
+
type: i0.Input,
|
|
1065
|
+
args: [{
|
|
1066
|
+
isSignal: true,
|
|
1067
|
+
alias: "activeIndex",
|
|
1068
|
+
required: false
|
|
1069
|
+
}]
|
|
1070
|
+
}],
|
|
1071
|
+
activeIndexChange: [{
|
|
1072
|
+
type: i0.Output,
|
|
1073
|
+
args: ["activeIndexChange"]
|
|
1074
|
+
}]
|
|
1075
|
+
}
|
|
1076
|
+
});
|
|
1077
|
+
var ChartTable = class ChartTable {
|
|
1078
|
+
caption = input.required(...ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []);
|
|
1079
|
+
columns = input.required(...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
|
|
1080
|
+
rows = input.required(...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
1081
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1082
|
+
minVersion: "12.0.0",
|
|
1083
|
+
version: "22.2.0",
|
|
1084
|
+
ngImport: i0,
|
|
1085
|
+
type: ChartTable,
|
|
1086
|
+
deps: [],
|
|
1087
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1088
|
+
});
|
|
1089
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1090
|
+
minVersion: "17.0.0",
|
|
1091
|
+
version: "22.2.0",
|
|
1092
|
+
type: ChartTable,
|
|
1093
|
+
isStandalone: true,
|
|
1094
|
+
selector: "gbt-chart-table",
|
|
1095
|
+
inputs: {
|
|
1096
|
+
caption: {
|
|
1097
|
+
classPropertyName: "caption",
|
|
1098
|
+
publicName: "caption",
|
|
1099
|
+
isSignal: true,
|
|
1100
|
+
isRequired: true,
|
|
1101
|
+
transformFunction: null
|
|
1102
|
+
},
|
|
1103
|
+
columns: {
|
|
1104
|
+
classPropertyName: "columns",
|
|
1105
|
+
publicName: "columns",
|
|
1106
|
+
isSignal: true,
|
|
1107
|
+
isRequired: true,
|
|
1108
|
+
transformFunction: null
|
|
1109
|
+
},
|
|
1110
|
+
rows: {
|
|
1111
|
+
classPropertyName: "rows",
|
|
1112
|
+
publicName: "rows",
|
|
1113
|
+
isSignal: true,
|
|
1114
|
+
isRequired: true,
|
|
1115
|
+
transformFunction: null
|
|
1116
|
+
}
|
|
1117
|
+
},
|
|
1118
|
+
ngImport: i0,
|
|
1119
|
+
template: "<div class=\"gbt-sr-only\">\n <table>\n <caption>\n {{\n caption()\n }}\n </caption>\n <thead>\n <tr>\n @for (column of columns(); track column) {\n <th scope=\"col\">{{ column }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of rows(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td>{{ cell }}</td>\n }\n </tr>\n }\n </tbody>\n </table>\n</div>\n",
|
|
1120
|
+
styles: [".gbt-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n"],
|
|
1121
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1122
|
+
});
|
|
1123
|
+
};
|
|
1124
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1125
|
+
minVersion: "12.0.0",
|
|
1126
|
+
version: "22.2.0",
|
|
1127
|
+
ngImport: i0,
|
|
1128
|
+
type: ChartTable,
|
|
1129
|
+
decorators: [{
|
|
1130
|
+
type: Component,
|
|
1131
|
+
args: [{
|
|
1132
|
+
selector: "gbt-chart-table",
|
|
1133
|
+
standalone: true,
|
|
1134
|
+
imports: [],
|
|
1135
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1136
|
+
template: "<div class=\"gbt-sr-only\">\n <table>\n <caption>\n {{\n caption()\n }}\n </caption>\n <thead>\n <tr>\n @for (column of columns(); track column) {\n <th scope=\"col\">{{ column }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of rows(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td>{{ cell }}</td>\n }\n </tr>\n }\n </tbody>\n </table>\n</div>\n",
|
|
1137
|
+
styles: [".gbt-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n"]
|
|
1138
|
+
}]
|
|
1139
|
+
}],
|
|
1140
|
+
propDecorators: {
|
|
1141
|
+
caption: [{
|
|
1142
|
+
type: i0.Input,
|
|
1143
|
+
args: [{
|
|
1144
|
+
isSignal: true,
|
|
1145
|
+
alias: "caption",
|
|
1146
|
+
required: true
|
|
1147
|
+
}]
|
|
1148
|
+
}],
|
|
1149
|
+
columns: [{
|
|
1150
|
+
type: i0.Input,
|
|
1151
|
+
args: [{
|
|
1152
|
+
isSignal: true,
|
|
1153
|
+
alias: "columns",
|
|
1154
|
+
required: true
|
|
1155
|
+
}]
|
|
1156
|
+
}],
|
|
1157
|
+
rows: [{
|
|
1158
|
+
type: i0.Input,
|
|
1159
|
+
args: [{
|
|
1160
|
+
isSignal: true,
|
|
1161
|
+
alias: "rows",
|
|
1162
|
+
required: true
|
|
1163
|
+
}]
|
|
1164
|
+
}]
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
var ChartTooltip = class ChartTooltip {
|
|
1168
|
+
context = inject(CHART_CONTEXT);
|
|
1169
|
+
points = input.required(...ngDevMode ? [{ debugName: "points" }] : /* istanbul ignore next */ []);
|
|
1170
|
+
active = computed(() => {
|
|
1171
|
+
const index = this.context.activeIndex();
|
|
1172
|
+
if (index === null) return null;
|
|
1173
|
+
return this.points()[index] ?? null;
|
|
1174
|
+
}, ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
1175
|
+
left = computed(() => {
|
|
1176
|
+
const position = this.context.activePosition();
|
|
1177
|
+
if (position === null) return 0;
|
|
1178
|
+
return position + this.context.box().margin.left;
|
|
1179
|
+
}, ...ngDevMode ? [{ debugName: "left" }] : /* istanbul ignore next */ []);
|
|
1180
|
+
anchor = computed(() => {
|
|
1181
|
+
const index = this.context.activeIndex();
|
|
1182
|
+
if (index === null) return "middle";
|
|
1183
|
+
const last = this.context.pointValues().length - 1;
|
|
1184
|
+
return index === 0 ? "start" : index === last ? "end" : "middle";
|
|
1185
|
+
}, ...ngDevMode ? [{ debugName: "anchor" }] : /* istanbul ignore next */ []);
|
|
1186
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1187
|
+
minVersion: "12.0.0",
|
|
1188
|
+
version: "22.2.0",
|
|
1189
|
+
ngImport: i0,
|
|
1190
|
+
type: ChartTooltip,
|
|
1191
|
+
deps: [],
|
|
1192
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1193
|
+
});
|
|
1194
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1195
|
+
minVersion: "17.0.0",
|
|
1196
|
+
version: "22.2.0",
|
|
1197
|
+
type: ChartTooltip,
|
|
1198
|
+
isStandalone: true,
|
|
1199
|
+
selector: "gbt-chart-tooltip",
|
|
1200
|
+
inputs: { points: {
|
|
1201
|
+
classPropertyName: "points",
|
|
1202
|
+
publicName: "points",
|
|
1203
|
+
isSignal: true,
|
|
1204
|
+
isRequired: true,
|
|
1205
|
+
transformFunction: null
|
|
1206
|
+
} },
|
|
1207
|
+
ngImport: i0,
|
|
1208
|
+
template: "<div class=\"gbt-chart-tooltip\" role=\"status\" aria-live=\"polite\">\n @if (active(); as point) {\n <div class=\"gbt-chart-tooltip__panel\" [style.left.px]=\"left()\" [attr.data-anchor]=\"anchor()\">\n <p class=\"gbt-chart-tooltip__header\">{{ point.header }}</p>\n <ul class=\"gbt-chart-tooltip__rows\">\n @for (row of point.rows; track $index) {\n <li>\n <span\n class=\"gbt-chart-tooltip__swatch\"\n [attr.data-series]=\"row.series ?? null\"\n [attr.data-pattern]=\"row.pattern ?? 'solid'\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"gbt-chart-tooltip__label\">{{ row.label }}</span>\n <span class=\"gbt-chart-tooltip__value\">{{ row.value }}</span>\n </li>\n }\n </ul>\n </div>\n }\n</div>\n",
|
|
1209
|
+
styles: [".gbt-chart-tooltip__panel{position:absolute;top:0;padding:.375rem .625rem;border:1px solid var(--border-color);border-radius:var(--site-border-radius);background:var(--bg-principal);color:var(--text-primary);font-size:.8125rem;pointer-events:none;white-space:nowrap}.gbt-chart-tooltip__panel[data-anchor=start]{transform:translate(0)}.gbt-chart-tooltip__panel[data-anchor=middle]{transform:translate(-50%)}.gbt-chart-tooltip__panel[data-anchor=end]{transform:translate(-100%)}.gbt-chart-tooltip__header{margin:0 0 .25rem;font-weight:600}.gbt-chart-tooltip__rows{margin:0;padding:0;list-style:none}.gbt-chart-tooltip__rows li{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5rem}.gbt-chart-tooltip__label{color:var(--text-secondary)}.gbt-chart-tooltip__value{font-variant-numeric:tabular-nums;font-weight:600}.gbt-chart-tooltip__swatch{width:10px;height:10px;border-radius:50%}.gbt-chart-tooltip__swatch[data-series=\"1\"]{background:var(--chart-series-1-base)}.gbt-chart-tooltip__swatch[data-series=\"2\"]{background:var(--chart-series-2-base)}.gbt-chart-tooltip__swatch[data-series=\"3\"]{background:var(--chart-series-3-base)}.gbt-chart-tooltip__swatch[data-pattern=dashed]{border-radius:2px}.gbt-chart-tooltip__swatch[data-pattern=dotted]{border-radius:50%;transform:scale(.7)}\n"],
|
|
1210
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1211
|
+
});
|
|
1212
|
+
};
|
|
1213
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1214
|
+
minVersion: "12.0.0",
|
|
1215
|
+
version: "22.2.0",
|
|
1216
|
+
ngImport: i0,
|
|
1217
|
+
type: ChartTooltip,
|
|
1218
|
+
decorators: [{
|
|
1219
|
+
type: Component,
|
|
1220
|
+
args: [{
|
|
1221
|
+
selector: "gbt-chart-tooltip",
|
|
1222
|
+
standalone: true,
|
|
1223
|
+
imports: [],
|
|
1224
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1225
|
+
template: "<div class=\"gbt-chart-tooltip\" role=\"status\" aria-live=\"polite\">\n @if (active(); as point) {\n <div class=\"gbt-chart-tooltip__panel\" [style.left.px]=\"left()\" [attr.data-anchor]=\"anchor()\">\n <p class=\"gbt-chart-tooltip__header\">{{ point.header }}</p>\n <ul class=\"gbt-chart-tooltip__rows\">\n @for (row of point.rows; track $index) {\n <li>\n <span\n class=\"gbt-chart-tooltip__swatch\"\n [attr.data-series]=\"row.series ?? null\"\n [attr.data-pattern]=\"row.pattern ?? 'solid'\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"gbt-chart-tooltip__label\">{{ row.label }}</span>\n <span class=\"gbt-chart-tooltip__value\">{{ row.value }}</span>\n </li>\n }\n </ul>\n </div>\n }\n</div>\n",
|
|
1226
|
+
styles: [".gbt-chart-tooltip__panel{position:absolute;top:0;padding:.375rem .625rem;border:1px solid var(--border-color);border-radius:var(--site-border-radius);background:var(--bg-principal);color:var(--text-primary);font-size:.8125rem;pointer-events:none;white-space:nowrap}.gbt-chart-tooltip__panel[data-anchor=start]{transform:translate(0)}.gbt-chart-tooltip__panel[data-anchor=middle]{transform:translate(-50%)}.gbt-chart-tooltip__panel[data-anchor=end]{transform:translate(-100%)}.gbt-chart-tooltip__header{margin:0 0 .25rem;font-weight:600}.gbt-chart-tooltip__rows{margin:0;padding:0;list-style:none}.gbt-chart-tooltip__rows li{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5rem}.gbt-chart-tooltip__label{color:var(--text-secondary)}.gbt-chart-tooltip__value{font-variant-numeric:tabular-nums;font-weight:600}.gbt-chart-tooltip__swatch{width:10px;height:10px;border-radius:50%}.gbt-chart-tooltip__swatch[data-series=\"1\"]{background:var(--chart-series-1-base)}.gbt-chart-tooltip__swatch[data-series=\"2\"]{background:var(--chart-series-2-base)}.gbt-chart-tooltip__swatch[data-series=\"3\"]{background:var(--chart-series-3-base)}.gbt-chart-tooltip__swatch[data-pattern=dashed]{border-radius:2px}.gbt-chart-tooltip__swatch[data-pattern=dotted]{border-radius:50%;transform:scale(.7)}\n"]
|
|
1227
|
+
}]
|
|
1228
|
+
}],
|
|
1229
|
+
propDecorators: { points: [{
|
|
1230
|
+
type: i0.Input,
|
|
1231
|
+
args: [{
|
|
1232
|
+
isSignal: true,
|
|
1233
|
+
alias: "points",
|
|
1234
|
+
required: true
|
|
1235
|
+
}]
|
|
1236
|
+
}] }
|
|
1237
|
+
});
|
|
1238
|
+
const round = (n) => Number(n.toFixed(2));
|
|
1239
|
+
function linePath(points) {
|
|
1240
|
+
if (points.length === 0) return "";
|
|
1241
|
+
return points.map((point, index) => `${index === 0 ? "M" : "L"}${round(point.x)},${round(point.y)}`).join("");
|
|
1242
|
+
}
|
|
1243
|
+
function areaPath(points, baseline) {
|
|
1244
|
+
if (points.length === 0) return "";
|
|
1245
|
+
const last = points[points.length - 1];
|
|
1246
|
+
const first = points[0];
|
|
1247
|
+
return `${linePath(points)}L${round(last.x)},${round(baseline)}L${round(first.x)},${round(baseline)}Z`;
|
|
1248
|
+
}
|
|
1249
|
+
function arcPoint(radius, angle) {
|
|
1250
|
+
return {
|
|
1251
|
+
x: radius * Math.sin(angle),
|
|
1252
|
+
y: -radius * Math.cos(angle)
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
function point(p) {
|
|
1256
|
+
return `${round(p.x)},${round(p.y)}`;
|
|
1257
|
+
}
|
|
1258
|
+
const FULL_CIRCLE = Math.PI * 2;
|
|
1259
|
+
function arcPath(arc) {
|
|
1260
|
+
const { startAngle, endAngle, innerRadius, outerRadius } = arc;
|
|
1261
|
+
const span = endAngle - startAngle;
|
|
1262
|
+
if (span <= 0) return "";
|
|
1263
|
+
if (span >= FULL_CIRCLE - 1e-9) {
|
|
1264
|
+
const mid = startAngle + Math.PI;
|
|
1265
|
+
return arcPath({
|
|
1266
|
+
startAngle,
|
|
1267
|
+
endAngle: mid,
|
|
1268
|
+
innerRadius,
|
|
1269
|
+
outerRadius
|
|
1270
|
+
}) + arcPath({
|
|
1271
|
+
startAngle: mid,
|
|
1272
|
+
endAngle: startAngle + FULL_CIRCLE,
|
|
1273
|
+
innerRadius,
|
|
1274
|
+
outerRadius
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
const largeArc = span > Math.PI ? 1 : 0;
|
|
1278
|
+
const outerStart = arcPoint(outerRadius, startAngle);
|
|
1279
|
+
const outerEnd = arcPoint(outerRadius, endAngle);
|
|
1280
|
+
const outerArc = `A${round(outerRadius)},${round(outerRadius)} 0 ${largeArc},1 ${point(outerEnd)}`;
|
|
1281
|
+
if (innerRadius <= 0) return `M0,0L${point(outerStart)}${outerArc}Z`;
|
|
1282
|
+
const innerStart = arcPoint(innerRadius, startAngle);
|
|
1283
|
+
const innerEnd = arcPoint(innerRadius, endAngle);
|
|
1284
|
+
const innerArc = `A${round(innerRadius)},${round(innerRadius)} 0 ${largeArc},0 ${point(innerStart)}`;
|
|
1285
|
+
return `M${point(outerStart)}${outerArc}L${point(innerEnd)}${innerArc}Z`;
|
|
1286
|
+
}
|
|
1287
|
+
export { CHART_CONTEXT, ChartAxis, ChartEmpty, ChartFrame, ChartLegend, ChartTable, ChartTooltip, arcPath, areaPath, bandScale, estimateLabelWidth, linePath, linearScale, nearestIndex, niceTicks, niceXDomain, niceYDomain, timeScale, timeTicks, timeXDomain };
|
|
1288
|
+
|
|
1289
|
+
//# sourceMappingURL=masmarino-gabarit-chart.mjs.map
|