@ngstarter-ui/components 1.0.21
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 +0 -0
- package/fesm2022/ngstarter-ui-components-action-required.mjs +42 -0
- package/fesm2022/ngstarter-ui-components-action-required.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-alert.mjs +132 -0
- package/fesm2022/ngstarter-ui-components-alert.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-announcement.mjs +86 -0
- package/fesm2022/ngstarter-ui-components-announcement.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs +360 -0
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-avatar.mjs +235 -0
- package/fesm2022/ngstarter-ui-components-avatar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-badge.mjs +97 -0
- package/fesm2022/ngstarter-ui-components-badge.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-block-loader.mjs +48 -0
- package/fesm2022/ngstarter-ui-components-block-loader.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs +327 -0
- package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs +209 -0
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs +175 -0
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-button.mjs +70 -0
- package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-card-overlay.mjs +49 -0
- package/fesm2022/ngstarter-ui-components-card-overlay.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-card.mjs +199 -0
- package/fesm2022/ngstarter-ui-components-card.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-carousel.mjs +614 -0
- package/fesm2022/ngstarter-ui-components-carousel.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-checkbox.mjs +300 -0
- package/fesm2022/ngstarter-ui-components-checkbox.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-chips.mjs +589 -0
- package/fesm2022/ngstarter-ui-components-chips.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs +347 -0
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-color-picker.mjs +713 -0
- package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-color-scheme.mjs +106 -0
- package/fesm2022/ngstarter-ui-components-color-scheme.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs +72 -0
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-command-bar.mjs +57 -0
- package/fesm2022/ngstarter-ui-components-command-bar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs +1024 -0
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-comparison-slider.mjs +177 -0
- package/fesm2022/ngstarter-ui-components-comparison-slider.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-confirm.mjs +85 -0
- package/fesm2022/ngstarter-ui-components-confirm.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-Bk6QTli8.mjs +173 -0
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-Bk6QTli8.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-content-editor-content-editable.directive-Bvfa2dqh.mjs +124 -0
- package/fesm2022/ngstarter-ui-components-content-editor-content-editor-content-editable.directive-Bvfa2dqh.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs +99 -0
- package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-C_iRTCPH.mjs +33 -0
- package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-C_iRTCPH.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-BbkC_t86.mjs +354 -0
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-BbkC_t86.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-D9_CxTY1.mjs +114 -0
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-D9_CxTY1.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-B4zJyUg1.mjs +146 -0
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-B4zJyUg1.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-Cv6wx5Xe.mjs +215 -0
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-Cv6wx5Xe.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-1Zi2nAX5.mjs +2548 -0
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-1Zi2nAX5.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-C9bQvDYU.mjs +110 -0
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-C9bQvDYU.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BbHds2r2.mjs +141 -0
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BbHds2r2.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-DlDh7Fnn.mjs +1604 -0
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-DlDh7Fnn.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-m4DTihP2.mjs +175 -0
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-m4DTihP2.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +2 -0
- package/fesm2022/ngstarter-ui-components-content-editor.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-fade.mjs +35 -0
- package/fesm2022/ngstarter-ui-components-content-fade.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs +107 -0
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-core.mjs +1330 -0
- package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-country-select.mjs +489 -0
- package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-crop.mjs +183 -0
- package/fesm2022/ngstarter-ui-components-crop.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-currency-select.mjs +397 -0
- package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-data-view.mjs +1494 -0
- package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs +154 -0
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-datepicker.mjs +1159 -0
- package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-dialog.mjs +357 -0
- package/fesm2022/ngstarter-ui-components-dialog.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-divider.mjs +42 -0
- package/fesm2022/ngstarter-ui-components-divider.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-drawer.mjs +132 -0
- package/fesm2022/ngstarter-ui-components-drawer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs +245 -0
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-empty-state.mjs +75 -0
- package/fesm2022/ngstarter-ui-components-empty-state.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-expand.mjs +56 -0
- package/fesm2022/ngstarter-ui-components-expand.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-expansion.mjs +193 -0
- package/fesm2022/ngstarter-ui-components-expansion.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs +333 -0
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-field.mjs +230 -0
- package/fesm2022/ngstarter-ui-components-form-field.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-autocomplete-many-field-BKQVlZHV.mjs +124 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-autocomplete-many-field-BKQVlZHV.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-checkbox-field-CoyKdvhV.mjs +22 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-checkbox-field-CoyKdvhV.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-datepicker-field-Bzc0TPO9.mjs +44 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-datepicker-field-Bzc0TPO9.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-divider-content-CwGzDCZv.mjs +17 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-divider-content-CwGzDCZv.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-image-content-ICTwkZPa.mjs +17 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-image-content-ICTwkZPa.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-input-field-RYxi-Mpw.mjs +35 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-input-field-RYxi-Mpw.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-radio-group-field-Cv3AGpoq.mjs +38 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-radio-group-field-Cv3AGpoq.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-select-field-eLcwI-BY.mjs +39 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-select-field-eLcwI-BY.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-text-content-BjzH_M3-.mjs +24 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-text-content-BjzH_M3-.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-textarea-field-4zH7FTQ1.mjs +37 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-textarea-field-4zH7FTQ1.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-timezone-field-BpH65Hd-.mjs +35 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-timezone-field-BpH65Hd-.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-toggle-field-iyqUrWxt.mjs +22 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-toggle-field-iyqUrWxt.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer.mjs +317 -0
- package/fesm2022/ngstarter-ui-components-form-renderer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-gauge.mjs +44 -0
- package/fesm2022/ngstarter-ui-components-gauge.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-grid.mjs +78 -0
- package/fesm2022/ngstarter-ui-components-grid.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs +736 -0
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-headless-stepper.mjs +192 -0
- package/fesm2022/ngstarter-ui-components-headless-stepper.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-icon.mjs +61 -0
- package/fesm2022/ngstarter-ui-components-icon.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-image-designer.mjs +4016 -0
- package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs +20 -0
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs +151 -0
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs +349 -0
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs +162 -0
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-incidents.mjs +257 -0
- package/fesm2022/ngstarter-ui-components-incidents.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs +179 -0
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-input-mask.mjs +180 -0
- package/fesm2022/ngstarter-ui-components-input-mask.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-input-validator.mjs +24 -0
- package/fesm2022/ngstarter-ui-components-input-validator.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-input.mjs +152 -0
- package/fesm2022/ngstarter-ui-components-input.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs +156 -0
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-kbd.mjs +31 -0
- package/fesm2022/ngstarter-ui-components-kbd.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-layout.mjs +199 -0
- package/fesm2022/ngstarter-ui-components-layout.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-list.mjs +279 -0
- package/fesm2022/ngstarter-ui-components-list.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-logo.mjs +51 -0
- package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-marquee.mjs +76 -0
- package/fesm2022/ngstarter-ui-components-marquee.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-menu.mjs +851 -0
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs +928 -0
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-navigation.mjs +439 -0
- package/fesm2022/ngstarter-ui-components-navigation.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-notifications.mjs +181 -0
- package/fesm2022/ngstarter-ui-components-notifications.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-number-input.mjs +293 -0
- package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-option.mjs +157 -0
- package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-overlay.mjs +112 -0
- package/fesm2022/ngstarter-ui-components-overlay.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs +77 -0
- package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-paginator.mjs +297 -0
- package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-panel.mjs +123 -0
- package/fesm2022/ngstarter-ui-components-panel.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-password-strength.mjs +335 -0
- package/fesm2022/ngstarter-ui-components-password-strength.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +651 -0
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-pin-input.mjs +193 -0
- package/fesm2022/ngstarter-ui-components-pin-input.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-popover.mjs +302 -0
- package/fesm2022/ngstarter-ui-components-popover.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs +68 -0
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-radio-card.mjs +102 -0
- package/fesm2022/ngstarter-ui-components-radio-card.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-radio.mjs +147 -0
- package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs +87 -0
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs +74 -0
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs +95 -0
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs +219 -0
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs +459 -0
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-segmented.mjs +218 -0
- package/fesm2022/ngstarter-ui-components-segmented.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-select.mjs +496 -0
- package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-side-panel.mjs +107 -0
- package/fesm2022/ngstarter-ui-components-side-panel.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-sidebar.mjs +435 -0
- package/fesm2022/ngstarter-ui-components-sidebar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-sidenav.mjs +354 -0
- package/fesm2022/ngstarter-ui-components-sidenav.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs +452 -0
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-skeleton.mjs +22 -0
- package/fesm2022/ngstarter-ui-components-skeleton.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +93 -0
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-slider.mjs +481 -0
- package/fesm2022/ngstarter-ui-components-slider.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs +354 -0
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-sort.mjs +140 -0
- package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-spinner.mjs +75 -0
- package/fesm2022/ngstarter-ui-components-spinner.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs +93 -0
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-split.mjs +948 -0
- package/fesm2022/ngstarter-ui-components-split.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-stepper.mjs +103 -0
- package/fesm2022/ngstarter-ui-components-stepper.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-suggestions.mjs +72 -0
- package/fesm2022/ngstarter-ui-components-suggestions.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs +265 -0
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-table.mjs +648 -0
- package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-tabs.mjs +591 -0
- package/fesm2022/ngstarter-ui-components-tabs.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-text-editor.mjs +1012 -0
- package/fesm2022/ngstarter-ui-components-text-editor.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs +212 -0
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-tiles.mjs +634 -0
- package/fesm2022/ngstarter-ui-components-tiles.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-timeline.mjs +122 -0
- package/fesm2022/ngstarter-ui-components-timeline.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-timepicker.mjs +486 -0
- package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs +371 -0
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-toolbar.mjs +299 -0
- package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-tooltip.mjs +506 -0
- package/fesm2022/ngstarter-ui-components-tooltip.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-tree.mjs +200 -0
- package/fesm2022/ngstarter-ui-components-tree.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-upload.mjs +330 -0
- package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-video-player.mjs +516 -0
- package/fesm2022/ngstarter-ui-components-video-player.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs +218 -0
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-visual-builder.mjs +18 -0
- package/fesm2022/ngstarter-ui-components-visual-builder.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components.mjs +6 -0
- package/fesm2022/ngstarter-ui-components.mjs.map +1 -0
- package/package.json +535 -0
- package/styles/_common.scss +456 -0
- package/styles/_global.scss +91 -0
- package/styles/themes/default.scss +2 -0
- package/types/ngstarter-ui-components-action-required.d.ts +14 -0
- package/types/ngstarter-ui-components-alert.d.ts +50 -0
- package/types/ngstarter-ui-components-announcement.d.ts +59 -0
- package/types/ngstarter-ui-components-autocomplete.d.ts +83 -0
- package/types/ngstarter-ui-components-avatar.d.ts +69 -0
- package/types/ngstarter-ui-components-badge.d.ts +38 -0
- package/types/ngstarter-ui-components-block-loader.d.ts +21 -0
- package/types/ngstarter-ui-components-bottom-sheet.d.ts +149 -0
- package/types/ngstarter-ui-components-breadcrumbs.d.ts +104 -0
- package/types/ngstarter-ui-components-button-toggle.d.ts +54 -0
- package/types/ngstarter-ui-components-button.d.ts +27 -0
- package/types/ngstarter-ui-components-card-overlay.d.ts +20 -0
- package/types/ngstarter-ui-components-card.d.ts +85 -0
- package/types/ngstarter-ui-components-carousel.d.ts +76 -0
- package/types/ngstarter-ui-components-checkbox.d.ts +94 -0
- package/types/ngstarter-ui-components-chips.d.ts +189 -0
- package/types/ngstarter-ui-components-code-highlighter.d.ts +28 -0
- package/types/ngstarter-ui-components-color-picker.d.ts +92 -0
- package/types/ngstarter-ui-components-color-scheme.d.ts +44 -0
- package/types/ngstarter-ui-components-color-switcher.d.ts +26 -0
- package/types/ngstarter-ui-components-command-bar.d.ts +28 -0
- package/types/ngstarter-ui-components-comment-editor.d.ts +194 -0
- package/types/ngstarter-ui-components-comparison-slider.d.ts +42 -0
- package/types/ngstarter-ui-components-confirm.d.ts +34 -0
- package/types/ngstarter-ui-components-content-editor.d.ts +321 -0
- package/types/ngstarter-ui-components-content-fade.d.ts +17 -0
- package/types/ngstarter-ui-components-cookie-popup.d.ts +41 -0
- package/types/ngstarter-ui-components-core.d.ts +421 -0
- package/types/ngstarter-ui-components-country-select.d.ts +78 -0
- package/types/ngstarter-ui-components-crop.d.ts +59 -0
- package/types/ngstarter-ui-components-currency-select.d.ts +82 -0
- package/types/ngstarter-ui-components-data-view.d.ts +391 -0
- package/types/ngstarter-ui-components-date-format-select.d.ts +59 -0
- package/types/ngstarter-ui-components-datepicker.d.ts +384 -0
- package/types/ngstarter-ui-components-dialog.d.ts +115 -0
- package/types/ngstarter-ui-components-divider.d.ts +18 -0
- package/types/ngstarter-ui-components-drawer.d.ts +32 -0
- package/types/ngstarter-ui-components-emoji-picker.d.ts +49 -0
- package/types/ngstarter-ui-components-empty-state.d.ts +33 -0
- package/types/ngstarter-ui-components-expand.d.ts +26 -0
- package/types/ngstarter-ui-components-expansion.d.ts +68 -0
- package/types/ngstarter-ui-components-filter-builder.d.ts +106 -0
- package/types/ngstarter-ui-components-form-field.d.ts +107 -0
- package/types/ngstarter-ui-components-form-renderer.d.ts +121 -0
- package/types/ngstarter-ui-components-gauge.d.ts +21 -0
- package/types/ngstarter-ui-components-grid.d.ts +45 -0
- package/types/ngstarter-ui-components-guided-tour.d.ts +227 -0
- package/types/ngstarter-ui-components-headless-stepper.d.ts +65 -0
- package/types/ngstarter-ui-components-icon.d.ts +17 -0
- package/types/ngstarter-ui-components-image-designer.d.ts +357 -0
- package/types/ngstarter-ui-components-image-placeholder.d.ts +8 -0
- package/types/ngstarter-ui-components-image-resizer.d.ts +35 -0
- package/types/ngstarter-ui-components-image-viewer.d.ts +63 -0
- package/types/ngstarter-ui-components-image-zoom-viewer.d.ts +34 -0
- package/types/ngstarter-ui-components-incidents.d.ts +119 -0
- package/types/ngstarter-ui-components-inline-text-edit.d.ts +39 -0
- package/types/ngstarter-ui-components-input-mask.d.ts +36 -0
- package/types/ngstarter-ui-components-input-validator.d.ts +5 -0
- package/types/ngstarter-ui-components-input.d.ts +53 -0
- package/types/ngstarter-ui-components-kanban-board.d.ts +68 -0
- package/types/ngstarter-ui-components-kbd.d.ts +13 -0
- package/types/ngstarter-ui-components-layout.d.ts +83 -0
- package/types/ngstarter-ui-components-list.d.ts +98 -0
- package/types/ngstarter-ui-components-logo.d.ts +26 -0
- package/types/ngstarter-ui-components-marquee.d.ts +27 -0
- package/types/ngstarter-ui-components-menu.d.ts +199 -0
- package/types/ngstarter-ui-components-micro-chart.d.ts +195 -0
- package/types/ngstarter-ui-components-navigation.d.ts +136 -0
- package/types/ngstarter-ui-components-notifications.d.ts +84 -0
- package/types/ngstarter-ui-components-number-input.d.ts +99 -0
- package/types/ngstarter-ui-components-option.d.ts +61 -0
- package/types/ngstarter-ui-components-overlay.d.ts +12 -0
- package/types/ngstarter-ui-components-page-loading-bar.d.ts +20 -0
- package/types/ngstarter-ui-components-paginator.d.ts +145 -0
- package/types/ngstarter-ui-components-panel.d.ts +59 -0
- package/types/ngstarter-ui-components-password-strength.d.ts +109 -0
- package/types/ngstarter-ui-components-phone-input.d.ts +103 -0
- package/types/ngstarter-ui-components-pin-input.d.ts +48 -0
- package/types/ngstarter-ui-components-popover.d.ts +94 -0
- package/types/ngstarter-ui-components-progress-bar.d.ts +30 -0
- package/types/ngstarter-ui-components-radio-card.d.ts +37 -0
- package/types/ngstarter-ui-components-radio.d.ts +45 -0
- package/types/ngstarter-ui-components-rail-nav.d.ts +36 -0
- package/types/ngstarter-ui-components-resizable-container.d.ts +25 -0
- package/types/ngstarter-ui-components-screen-loader.d.ts +34 -0
- package/types/ngstarter-ui-components-scroll-spy.d.ts +63 -0
- package/types/ngstarter-ui-components-scrollbar-area.d.ts +67 -0
- package/types/ngstarter-ui-components-segmented.d.ts +65 -0
- package/types/ngstarter-ui-components-select.d.ts +126 -0
- package/types/ngstarter-ui-components-side-panel.d.ts +42 -0
- package/types/ngstarter-ui-components-sidebar.d.ts +143 -0
- package/types/ngstarter-ui-components-sidenav.d.ts +86 -0
- package/types/ngstarter-ui-components-signature-pad.d.ts +49 -0
- package/types/ngstarter-ui-components-skeleton.d.ts +9 -0
- package/types/ngstarter-ui-components-slide-toggle.d.ts +41 -0
- package/types/ngstarter-ui-components-slider.d.ts +85 -0
- package/types/ngstarter-ui-components-snack-bar.d.ts +142 -0
- package/types/ngstarter-ui-components-sort.d.ts +66 -0
- package/types/ngstarter-ui-components-spinner.d.ts +28 -0
- package/types/ngstarter-ui-components-splash-screen.d.ts +31 -0
- package/types/ngstarter-ui-components-split.d.ts +210 -0
- package/types/ngstarter-ui-components-stepper.d.ts +44 -0
- package/types/ngstarter-ui-components-suggestions.d.ts +32 -0
- package/types/ngstarter-ui-components-tab-panel.d.ts +96 -0
- package/types/ngstarter-ui-components-table.d.ts +277 -0
- package/types/ngstarter-ui-components-tabs.d.ts +145 -0
- package/types/ngstarter-ui-components-text-editor.d.ts +191 -0
- package/types/ngstarter-ui-components-thumbnail-maker.d.ts +35 -0
- package/types/ngstarter-ui-components-tiles.d.ts +109 -0
- package/types/ngstarter-ui-components-timeline.d.ts +57 -0
- package/types/ngstarter-ui-components-timepicker.d.ts +115 -0
- package/types/ngstarter-ui-components-timezone-select.d.ts +75 -0
- package/types/ngstarter-ui-components-toolbar.d.ts +74 -0
- package/types/ngstarter-ui-components-tooltip.d.ts +52 -0
- package/types/ngstarter-ui-components-tree.d.ts +60 -0
- package/types/ngstarter-ui-components-upload.d.ts +134 -0
- package/types/ngstarter-ui-components-video-player.d.ts +67 -0
- package/types/ngstarter-ui-components-video-viewer.d.ts +98 -0
- package/types/ngstarter-ui-components-visual-builder.d.ts +8 -0
- package/types/ngstarter-ui-components.d.ts +2 -0
|
@@ -0,0 +1,928 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Renderer2, ViewContainerRef, Injector, DOCUMENT, PLATFORM_ID, DestroyRef, ElementRef, input, numberAttribute, booleanAttribute, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { isPlatformServer } from '@angular/common';
|
|
4
|
+
import { curveStep, curveBumpX, curveCatmullRom, curveLinear, select, scalePoint, min, max, scaleLinear, area, line, pointer, scaleBand, arc, pie, scaleOrdinal, schemeTableau10, interpolate } from 'd3';
|
|
5
|
+
import { fromEvent } from 'rxjs';
|
|
6
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
8
|
+
import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
|
|
9
|
+
import { PositionManager } from '@ngstarter-ui/components/overlay';
|
|
10
|
+
|
|
11
|
+
class BaseChartTooltip {
|
|
12
|
+
_tooltipOrigin;
|
|
13
|
+
_tooltipPortal;
|
|
14
|
+
_overlayRef;
|
|
15
|
+
_renderer = inject(Renderer2);
|
|
16
|
+
_overlay = inject(Overlay);
|
|
17
|
+
_viewContainerRef = inject(ViewContainerRef);
|
|
18
|
+
_injector = inject(Injector);
|
|
19
|
+
_document = inject(DOCUMENT);
|
|
20
|
+
_createTooltipOrigin() {
|
|
21
|
+
let tooltipOrigin = this._document.querySelector('.ngs-mchart-tooltip-origin');
|
|
22
|
+
if (!tooltipOrigin) {
|
|
23
|
+
tooltipOrigin = this._renderer.createElement('div');
|
|
24
|
+
tooltipOrigin.classList.add('ngs-mchart-tooltip-origin');
|
|
25
|
+
this._renderer.appendChild(this._document.body, tooltipOrigin);
|
|
26
|
+
}
|
|
27
|
+
this._tooltipOrigin = tooltipOrigin;
|
|
28
|
+
this._renderer.setStyle(this._tooltipOrigin, 'width', '0');
|
|
29
|
+
this._renderer.setStyle(this._tooltipOrigin, 'height', '0');
|
|
30
|
+
this._renderer.setStyle(this._tooltipOrigin, 'z-index', '-1');
|
|
31
|
+
this._renderer.setStyle(this._tooltipOrigin, 'position', 'fixed');
|
|
32
|
+
this._renderer.setStyle(this._tooltipOrigin, 'opacity', '0');
|
|
33
|
+
}
|
|
34
|
+
_showTooltip(data) {
|
|
35
|
+
this._overlayRef?.detach();
|
|
36
|
+
this._overlayRef = this._overlay.create(this._getOverlayConfig());
|
|
37
|
+
this._overlayRef.attach(this._getContentPortal(data));
|
|
38
|
+
}
|
|
39
|
+
_hideTooltip() {
|
|
40
|
+
this._overlayRef?.detach();
|
|
41
|
+
}
|
|
42
|
+
_setTooltipPositionByEvent(e) {
|
|
43
|
+
const gap = 10;
|
|
44
|
+
this._renderer.setStyle(this._tooltipOrigin, 'left', (e.clientX - gap) + 'px');
|
|
45
|
+
this._renderer.setStyle(this._tooltipOrigin, 'top', (e.clientY) + 'px');
|
|
46
|
+
this._renderer.setStyle(this._tooltipOrigin, 'width', (gap * 2) + 'px');
|
|
47
|
+
}
|
|
48
|
+
_setTooltipVisible() {
|
|
49
|
+
this._renderer.addClass(this._tooltipOrigin, 'is-visible');
|
|
50
|
+
}
|
|
51
|
+
_setTooltipInVisible() {
|
|
52
|
+
this._renderer.removeClass(this._tooltipOrigin, 'is-visible');
|
|
53
|
+
}
|
|
54
|
+
_getContentPortal(data) {
|
|
55
|
+
this._tooltipPortal = new TemplatePortal(this.getTooltipTemplateRef(), this._viewContainerRef, {
|
|
56
|
+
'$implicit': {
|
|
57
|
+
...data
|
|
58
|
+
}
|
|
59
|
+
}, this._injector);
|
|
60
|
+
return this._tooltipPortal;
|
|
61
|
+
}
|
|
62
|
+
_getOverlayConfig() {
|
|
63
|
+
return new OverlayConfig({
|
|
64
|
+
panelClass: 'ngs-mchart-tooltip-overlay',
|
|
65
|
+
positionStrategy: this._getOverlayPositionStrategy(),
|
|
66
|
+
scrollStrategy: this._overlay.scrollStrategies.reposition()
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
_getOverlayPositionStrategy() {
|
|
70
|
+
return this._overlay
|
|
71
|
+
.position()
|
|
72
|
+
.flexibleConnectedTo(this._tooltipOrigin)
|
|
73
|
+
.withFlexibleDimensions()
|
|
74
|
+
.withGrowAfterOpen()
|
|
75
|
+
.withPositions(this._getOverlayPositions());
|
|
76
|
+
}
|
|
77
|
+
_getOverlayPositions() {
|
|
78
|
+
return (new PositionManager()).build(this.getTooltipPosition());
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
let nextId$1 = 0;
|
|
83
|
+
class MchartLine extends BaseChartTooltip {
|
|
84
|
+
_initialized = false;
|
|
85
|
+
_host;
|
|
86
|
+
_svg;
|
|
87
|
+
_dimensions;
|
|
88
|
+
_hostWidth = 0;
|
|
89
|
+
_hostHeight = 0;
|
|
90
|
+
_innerWidth = 0;
|
|
91
|
+
_innerHeight = 0;
|
|
92
|
+
_yScale;
|
|
93
|
+
_xScale;
|
|
94
|
+
_curveMap = {
|
|
95
|
+
'linear': curveLinear,
|
|
96
|
+
'catmullRom': curveCatmullRom,
|
|
97
|
+
'curveBumpX': curveBumpX,
|
|
98
|
+
'curveStep': curveStep
|
|
99
|
+
};
|
|
100
|
+
_resizeObserver;
|
|
101
|
+
_tooltipDot;
|
|
102
|
+
_area;
|
|
103
|
+
_line;
|
|
104
|
+
_platformId = inject(PLATFORM_ID);
|
|
105
|
+
_destroyRef = inject(DestroyRef);
|
|
106
|
+
_elementRef = inject(ElementRef);
|
|
107
|
+
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
108
|
+
labels = input([], ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
109
|
+
strokeWidth = input(2, { ...(ngDevMode ? { debugName: "strokeWidth" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
110
|
+
showArea = input(false, { ...(ngDevMode ? { debugName: "showArea" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
111
|
+
showMarkers = input(false, { ...(ngDevMode ? { debugName: "showMarkers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
112
|
+
responsive = input(false, { ...(ngDevMode ? { debugName: "responsive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
113
|
+
fillAreaGradient = input(false, { ...(ngDevMode ? { debugName: "fillAreaGradient" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
114
|
+
curve = input('linear', ...(ngDevMode ? [{ debugName: "curve" }] : /* istanbul ignore next */ []));
|
|
115
|
+
xAccessor = input((d, i) => i, ...(ngDevMode ? [{ debugName: "xAccessor" }] : /* istanbul ignore next */ []));
|
|
116
|
+
yAccessor = input((d) => d, ...(ngDevMode ? [{ debugName: "yAccessor" }] : /* istanbul ignore next */ []));
|
|
117
|
+
compact = input(false, { ...(ngDevMode ? { debugName: "compact" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
118
|
+
markerDotSize = input(5, { ...(ngDevMode ? { debugName: "markerDotSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
119
|
+
tooltip = input(...(ngDevMode ? [undefined, { debugName: "tooltip" }] : /* istanbul ignore next */ []));
|
|
120
|
+
tooltipPosition = input('after-center', ...(ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []));
|
|
121
|
+
_currentTooltipPosition = 'after-center';
|
|
122
|
+
get gradientId() {
|
|
123
|
+
return 'areaGradient' + this._gradientId;
|
|
124
|
+
}
|
|
125
|
+
_gradientId = nextId$1++;
|
|
126
|
+
constructor() {
|
|
127
|
+
super();
|
|
128
|
+
effect(() => {
|
|
129
|
+
this._currentTooltipPosition = this.tooltipPosition();
|
|
130
|
+
});
|
|
131
|
+
effect(() => {
|
|
132
|
+
if (!this._initialized) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
this._render();
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
ngAfterViewChecked() {
|
|
139
|
+
if (isPlatformServer(this._platformId)) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (!this._initialized) {
|
|
143
|
+
const element = this._elementRef.nativeElement;
|
|
144
|
+
this._dimensions = element.getBoundingClientRect();
|
|
145
|
+
if (this._dimensions.width !== 0 && this._dimensions.height !== 0) {
|
|
146
|
+
this._initialized = true;
|
|
147
|
+
this._render();
|
|
148
|
+
this._setupResizeObserver();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
ngOnDestroy() {
|
|
153
|
+
this._resizeObserver?.disconnect();
|
|
154
|
+
}
|
|
155
|
+
getTooltipPosition() {
|
|
156
|
+
return this._currentTooltipPosition;
|
|
157
|
+
}
|
|
158
|
+
getTooltipTemplateRef() {
|
|
159
|
+
return this.tooltip();
|
|
160
|
+
}
|
|
161
|
+
_render() {
|
|
162
|
+
this._setupContainers();
|
|
163
|
+
this._setupData();
|
|
164
|
+
}
|
|
165
|
+
_setupContainers() {
|
|
166
|
+
this._hostWidth = this._dimensions.width;
|
|
167
|
+
this._hostHeight = this._dimensions.height;
|
|
168
|
+
this._innerWidth = this._dimensions.width;
|
|
169
|
+
this._innerHeight = this._dimensions.height;
|
|
170
|
+
this._host = select(this._elementRef.nativeElement);
|
|
171
|
+
this._svg = this._host
|
|
172
|
+
.select('svg')
|
|
173
|
+
.attr('viewBox', `0 0 ${this._hostWidth} ${this._hostHeight}`);
|
|
174
|
+
if (this.tooltip()) {
|
|
175
|
+
this._tooltipDot = this._renderer.createElement('div');
|
|
176
|
+
this._renderer.setStyle(this._tooltipDot, 'width', '10px');
|
|
177
|
+
this._renderer.setStyle(this._tooltipDot, 'height', '10px');
|
|
178
|
+
this._renderer.setStyle(this._tooltipDot, 'z-index', '-1');
|
|
179
|
+
this._renderer.setStyle(this._tooltipDot, 'position', 'fixed');
|
|
180
|
+
this._renderer.setStyle(this._tooltipDot, 'opacity', '0');
|
|
181
|
+
this._renderer.appendChild(this._document.body, this._tooltipDot);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
_setupData(isUpdate = false) {
|
|
185
|
+
let markerDotSize = this.markerDotSize();
|
|
186
|
+
if (!this.showMarkers()) {
|
|
187
|
+
markerDotSize = this.strokeWidth();
|
|
188
|
+
}
|
|
189
|
+
const xAccessor = this.xAccessor();
|
|
190
|
+
const yAccessor = this.yAccessor();
|
|
191
|
+
const xDomain = this.data().map((d, i) => xAccessor(d, i));
|
|
192
|
+
if (!this._xScale) {
|
|
193
|
+
this._xScale = scalePoint().domain(xDomain);
|
|
194
|
+
}
|
|
195
|
+
this._xScale.range([markerDotSize, this._innerWidth - markerDotSize]);
|
|
196
|
+
const yDomain = [
|
|
197
|
+
this.compact() ? min(this.data().map(d => yAccessor(d))) : 0,
|
|
198
|
+
max(this.data().map(d => yAccessor(d)))
|
|
199
|
+
];
|
|
200
|
+
if (!this._yScale) {
|
|
201
|
+
this._yScale = scaleLinear()
|
|
202
|
+
.domain(yDomain);
|
|
203
|
+
}
|
|
204
|
+
this._yScale.range([this._innerHeight - markerDotSize, markerDotSize]);
|
|
205
|
+
if (this.showArea()) {
|
|
206
|
+
const areaGenerator = area()
|
|
207
|
+
.x((d, i) => this._xScale(xAccessor(d, i)))
|
|
208
|
+
.y1((d) => this._yScale(yAccessor(d)))
|
|
209
|
+
.y0(this._innerHeight - markerDotSize)
|
|
210
|
+
.curve(this._curveMap[this.curve()]);
|
|
211
|
+
if (!this._area) {
|
|
212
|
+
// add area
|
|
213
|
+
this._area = this._svg
|
|
214
|
+
.append('path')
|
|
215
|
+
.datum(this.data())
|
|
216
|
+
.attr('d', areaGenerator)
|
|
217
|
+
.attr('class', 'area');
|
|
218
|
+
if (this.fillAreaGradient()) {
|
|
219
|
+
this._area.attr('fill', `url(#${this.gradientId})`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
this._area.attr('d', areaGenerator);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
const lineGenerator = line()
|
|
227
|
+
.x((d, i) => this._xScale(xAccessor(d, i)))
|
|
228
|
+
.y((d) => this._yScale(yAccessor(d)));
|
|
229
|
+
if (!this._line) {
|
|
230
|
+
// add line
|
|
231
|
+
this._line = this._svg
|
|
232
|
+
.append('path')
|
|
233
|
+
.datum(this.data())
|
|
234
|
+
.attr('d', lineGenerator.curve(this._curveMap[this.curve()]))
|
|
235
|
+
.attr('class', 'line')
|
|
236
|
+
.attr('stroke-width', this.strokeWidth());
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
this._line.attr('d', lineGenerator.curve(this._curveMap[this.curve()]));
|
|
240
|
+
}
|
|
241
|
+
if (isUpdate) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (this.showMarkers() || this.tooltip()) {
|
|
245
|
+
const markerLine = this._svg
|
|
246
|
+
.append('line')
|
|
247
|
+
.attr('x1', 0)
|
|
248
|
+
.attr('x2', 0)
|
|
249
|
+
.attr('y1', 0)
|
|
250
|
+
.attr('y2', this._innerHeight - markerDotSize)
|
|
251
|
+
.attr('opacity', 0)
|
|
252
|
+
.attr('class', 'marker-line');
|
|
253
|
+
const markerDot = this._svg
|
|
254
|
+
.append('circle')
|
|
255
|
+
.attr('cx', 0)
|
|
256
|
+
.attr('cy', 0)
|
|
257
|
+
.attr('r', markerDotSize)
|
|
258
|
+
.attr('opacity', 0)
|
|
259
|
+
.attr('class', 'marker-dot');
|
|
260
|
+
let x = 0;
|
|
261
|
+
let y = 0;
|
|
262
|
+
let label;
|
|
263
|
+
let value;
|
|
264
|
+
if (this.tooltip()) {
|
|
265
|
+
this._createTooltipOrigin();
|
|
266
|
+
}
|
|
267
|
+
fromEvent(this._document, 'mousemove')
|
|
268
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
269
|
+
.subscribe((e) => {
|
|
270
|
+
const target = e.target;
|
|
271
|
+
const oldXPosition = +markerDot.attr('cx');
|
|
272
|
+
const pointerCoords = pointer(e, this._svg.node());
|
|
273
|
+
const [posX, posY] = pointerCoords;
|
|
274
|
+
let visible = true;
|
|
275
|
+
if (posX < this.markerDotSize() || posY < this.markerDotSize() || posX > this._hostWidth || posY > this._hostHeight) {
|
|
276
|
+
visible = false;
|
|
277
|
+
this._overlayRef?.detach();
|
|
278
|
+
markerLine.attr('opacity', 0);
|
|
279
|
+
markerDot.attr('opacity', 0);
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
if (target.closest('.ngs-mchart-line') ||
|
|
283
|
+
target.classList.contains('ngs-mchart-tooltip-overlay') ||
|
|
284
|
+
target.closest('.ngs-mchart-tooltip-overlay')) {
|
|
285
|
+
if (this.showMarkers()) {
|
|
286
|
+
markerLine.attr('opacity', 1);
|
|
287
|
+
markerDot.attr('opacity', 1);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
visible = false;
|
|
292
|
+
this._overlayRef?.detach();
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
const eachBand = this._xScale.step();
|
|
296
|
+
const index = Math.round((posX / eachBand));
|
|
297
|
+
const dataValue = this.data()[index];
|
|
298
|
+
label = this.labels()[index] ? this.labels()[index] : xAccessor(index, index);
|
|
299
|
+
value = yAccessor(dataValue);
|
|
300
|
+
x = this._xScale(xAccessor(index, index));
|
|
301
|
+
y = this._yScale(yAccessor(dataValue));
|
|
302
|
+
markerLine
|
|
303
|
+
.attr('x1', x)
|
|
304
|
+
.attr('x2', x);
|
|
305
|
+
markerDot
|
|
306
|
+
.attr('cx', x)
|
|
307
|
+
.attr('cy', y);
|
|
308
|
+
if (this.tooltip()) {
|
|
309
|
+
if (posX < this._hostWidth / 2) {
|
|
310
|
+
this._currentTooltipPosition = 'after-center';
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
this._currentTooltipPosition = 'before-center';
|
|
314
|
+
}
|
|
315
|
+
this._setTooltipPositionByEvent(e);
|
|
316
|
+
if (visible) {
|
|
317
|
+
this._setTooltipVisible();
|
|
318
|
+
if (!this._overlayRef?.hasAttached()) {
|
|
319
|
+
this._showTooltip({
|
|
320
|
+
label,
|
|
321
|
+
value
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
if (oldXPosition !== x) {
|
|
326
|
+
this._showTooltip({
|
|
327
|
+
label,
|
|
328
|
+
value
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
this._overlayRef.updatePositionStrategy(this._getOverlayPositionStrategy());
|
|
333
|
+
this._overlayRef.updatePosition();
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
this._setTooltipInVisible();
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
_setupResizeObserver() {
|
|
345
|
+
if (!this.responsive()) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
this._resizeObserver = new ResizeObserver((entries) => {
|
|
349
|
+
if (this._hostWidth !== entries[0].contentRect.width || this._hostHeight !== entries[0].contentRect.height) {
|
|
350
|
+
this._hostWidth = entries[0].contentRect.width;
|
|
351
|
+
this._hostHeight = entries[0].contentRect.height;
|
|
352
|
+
this._innerWidth = entries[0].contentRect.width;
|
|
353
|
+
this._innerHeight = entries[0].contentRect.height;
|
|
354
|
+
this._svg
|
|
355
|
+
.attr("viewBox", `0 0 ${this._hostWidth} ${this._hostHeight}`);
|
|
356
|
+
this._setupData(true);
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
this._resizeObserver.observe(this._elementRef.nativeElement);
|
|
360
|
+
}
|
|
361
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MchartLine, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
362
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: MchartLine, isStandalone: true, selector: "ngs-mchart-line", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, showArea: { classPropertyName: "showArea", publicName: "showArea", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, fillAreaGradient: { classPropertyName: "fillAreaGradient", publicName: "fillAreaGradient", isSignal: true, isRequired: false, transformFunction: null }, curve: { classPropertyName: "curve", publicName: "curve", isSignal: true, isRequired: false, transformFunction: null }, xAccessor: { classPropertyName: "xAccessor", publicName: "xAccessor", isSignal: true, isRequired: false, transformFunction: null }, yAccessor: { classPropertyName: "yAccessor", publicName: "yAccessor", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, markerDotSize: { classPropertyName: "markerDotSize", publicName: "markerDotSize", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.fill-area-gradient": "fillAreaGradient()" }, classAttribute: "ngs-mchart-line" }, exportAs: ["ngsMchartLine"], usesInheritance: true, ngImport: i0, template: "<svg>\n @if (fillAreaGradient()) {\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" class=\"lg-start-color\"/>\n <stop offset=\"100%\" class=\"lg-end-color\"/>\n </linearGradient>\n }\n</svg>\n", styles: [":host{--ngs-mchart-line-line-bg: var(--color-primary);--ngs-mchart-line-area-bg: var(--color-primary-200);--ngs-mchart-line-marker-line-bg: var(--color-neutral);--ngs-mchart-line-marker-dot-bg: var(--color-primary);--ngs-mchart-line-area-gradient-start-color: var(--color-primary);--ngs-mchart-line-area-gradient-end-color: var(--color-background);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .line{stroke:var(--ngs-mchart-line-line-bg);fill:none;stroke-linejoin:round;stroke-linecap:round}:host ::ng-deep .area{stroke-width:0}:host ::ng-deep .marker-line{stroke:var(--ngs-mchart-line-marker-line-bg);stroke-width:1;stroke-dasharray:3}:host ::ng-deep .marker-dot{fill:var(--ngs-mchart-line-marker-dot-bg)}:host:not(.fill-area-gradient) ::ng-deep .area{fill:var(--ngs-mchart-line-area-bg)}:host.fill-area-gradient .lg-start-color{stop-color:var(--ngs-mchart-line-area-gradient-start-color)}:host.fill-area-gradient .lg-end-color{stop-color:var(--ngs-mchart-line-area-gradient-end-color)}:host-context(html.dark){--ngs-mchart-line-area-bg: var(--color-neutral-700);--ngs-mchart-line-area-gradient-start-color: var(--color-neutral-700)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
363
|
+
}
|
|
364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MchartLine, decorators: [{
|
|
365
|
+
type: Component,
|
|
366
|
+
args: [{ selector: 'ngs-mchart-line', exportAs: 'ngsMchartLine', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
367
|
+
'class': 'ngs-mchart-line',
|
|
368
|
+
'[class.fill-area-gradient]': 'fillAreaGradient()',
|
|
369
|
+
}, template: "<svg>\n @if (fillAreaGradient()) {\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" class=\"lg-start-color\"/>\n <stop offset=\"100%\" class=\"lg-end-color\"/>\n </linearGradient>\n }\n</svg>\n", styles: [":host{--ngs-mchart-line-line-bg: var(--color-primary);--ngs-mchart-line-area-bg: var(--color-primary-200);--ngs-mchart-line-marker-line-bg: var(--color-neutral);--ngs-mchart-line-marker-dot-bg: var(--color-primary);--ngs-mchart-line-area-gradient-start-color: var(--color-primary);--ngs-mchart-line-area-gradient-end-color: var(--color-background);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .line{stroke:var(--ngs-mchart-line-line-bg);fill:none;stroke-linejoin:round;stroke-linecap:round}:host ::ng-deep .area{stroke-width:0}:host ::ng-deep .marker-line{stroke:var(--ngs-mchart-line-marker-line-bg);stroke-width:1;stroke-dasharray:3}:host ::ng-deep .marker-dot{fill:var(--ngs-mchart-line-marker-dot-bg)}:host:not(.fill-area-gradient) ::ng-deep .area{fill:var(--ngs-mchart-line-area-bg)}:host.fill-area-gradient .lg-start-color{stop-color:var(--ngs-mchart-line-area-gradient-start-color)}:host.fill-area-gradient .lg-end-color{stop-color:var(--ngs-mchart-line-area-gradient-end-color)}:host-context(html.dark){--ngs-mchart-line-area-bg: var(--color-neutral-700);--ngs-mchart-line-area-gradient-start-color: var(--color-neutral-700)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
370
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], showArea: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArea", required: false }] }], showMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkers", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], fillAreaGradient: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillAreaGradient", required: false }] }], curve: [{ type: i0.Input, args: [{ isSignal: true, alias: "curve", required: false }] }], xAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "xAccessor", required: false }] }], yAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAccessor", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], markerDotSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "markerDotSize", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }] } });
|
|
371
|
+
|
|
372
|
+
let nextId = 0;
|
|
373
|
+
class MchartBar extends BaseChartTooltip {
|
|
374
|
+
_initialized = false;
|
|
375
|
+
_host;
|
|
376
|
+
_svg;
|
|
377
|
+
_hlContainer;
|
|
378
|
+
_dataContainer;
|
|
379
|
+
_dimensions;
|
|
380
|
+
_innerWidth = 0;
|
|
381
|
+
_innerHeight = 0;
|
|
382
|
+
_hostWidth = 0;
|
|
383
|
+
_hostHeight = 0;
|
|
384
|
+
_xScale;
|
|
385
|
+
_yScale;
|
|
386
|
+
_resizeObserver;
|
|
387
|
+
_platformId = inject(PLATFORM_ID);
|
|
388
|
+
_elementRef = inject(ElementRef);
|
|
389
|
+
_destroyRef = inject(DestroyRef);
|
|
390
|
+
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
391
|
+
labels = input([], ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
392
|
+
gap = input(0.2, { ...(ngDevMode ? { debugName: "gap" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
393
|
+
radius = input(0, { ...(ngDevMode ? { debugName: "radius" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
394
|
+
highlight = input(false, { ...(ngDevMode ? { debugName: "highlight" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
395
|
+
responsive = input(false, { ...(ngDevMode ? { debugName: "responsive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
396
|
+
fillGradient = input(false, { ...(ngDevMode ? { debugName: "fillGradient" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
397
|
+
xAccessor = input((d, i) => i, ...(ngDevMode ? [{ debugName: "xAccessor" }] : /* istanbul ignore next */ []));
|
|
398
|
+
yAccessor = input((d) => d, ...(ngDevMode ? [{ debugName: "yAccessor" }] : /* istanbul ignore next */ []));
|
|
399
|
+
tooltip = input(...(ngDevMode ? [undefined, { debugName: "tooltip" }] : /* istanbul ignore next */ []));
|
|
400
|
+
tooltipPosition = input('after-center', ...(ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []));
|
|
401
|
+
_currentTooltipPosition = 'after-center';
|
|
402
|
+
get gradientId() {
|
|
403
|
+
return 'areaGradient' + this._gradientId;
|
|
404
|
+
}
|
|
405
|
+
_gradientId = nextId++;
|
|
406
|
+
constructor() {
|
|
407
|
+
super();
|
|
408
|
+
effect(() => {
|
|
409
|
+
this._currentTooltipPosition = this.tooltipPosition();
|
|
410
|
+
});
|
|
411
|
+
effect(() => {
|
|
412
|
+
if (!this._initialized) {
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
this._render();
|
|
416
|
+
this._setupResizeObserver();
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
ngAfterViewChecked() {
|
|
420
|
+
if (isPlatformServer(this._platformId)) {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
if (!this._initialized) {
|
|
424
|
+
const element = this._elementRef.nativeElement;
|
|
425
|
+
this._dimensions = element.getBoundingClientRect();
|
|
426
|
+
if (this._dimensions.width !== 0 && this._dimensions.height !== 0) {
|
|
427
|
+
this._initialized = true;
|
|
428
|
+
this._render();
|
|
429
|
+
this._setupResizeObserver();
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
ngOnDestroy() {
|
|
434
|
+
this._resizeObserver?.disconnect();
|
|
435
|
+
}
|
|
436
|
+
getTooltipPosition() {
|
|
437
|
+
return this._currentTooltipPosition;
|
|
438
|
+
}
|
|
439
|
+
getTooltipTemplateRef() {
|
|
440
|
+
return this.tooltip();
|
|
441
|
+
}
|
|
442
|
+
_render() {
|
|
443
|
+
this._init();
|
|
444
|
+
this._setupAxisScale();
|
|
445
|
+
this._setupData();
|
|
446
|
+
this._initTooltip();
|
|
447
|
+
}
|
|
448
|
+
_init() {
|
|
449
|
+
this._hostWidth = this._dimensions.width;
|
|
450
|
+
this._hostHeight = this._dimensions.height;
|
|
451
|
+
this._innerWidth = this._dimensions.width;
|
|
452
|
+
this._innerHeight = this._dimensions.height;
|
|
453
|
+
this._host = select(this._elementRef.nativeElement);
|
|
454
|
+
this._svg = this._host
|
|
455
|
+
.select('svg')
|
|
456
|
+
.attr('viewBox', `0 0 ${this._hostWidth} ${this._hostHeight}`);
|
|
457
|
+
}
|
|
458
|
+
_setupAxisScale() {
|
|
459
|
+
if (!this._xScale) {
|
|
460
|
+
this._xScale = scaleBand()
|
|
461
|
+
.paddingInner(this.gap())
|
|
462
|
+
.domain(this.data().map((d, i) => i.toString()));
|
|
463
|
+
}
|
|
464
|
+
this._xScale.range([0, this._innerWidth]);
|
|
465
|
+
if (!this._yScale) {
|
|
466
|
+
this._yScale = scaleLinear().domain([0, Math.max(...this.data())]);
|
|
467
|
+
}
|
|
468
|
+
this._yScale.range([this._innerHeight, 0]);
|
|
469
|
+
}
|
|
470
|
+
_setupData() {
|
|
471
|
+
if (this.highlight()) {
|
|
472
|
+
if (!this._hlContainer) {
|
|
473
|
+
this._hlContainer = this._svg.append('g')
|
|
474
|
+
.attr('class', 'hl-container')
|
|
475
|
+
.attr('transform', `translate(0,0)`);
|
|
476
|
+
this._hlContainer.selectAll('rect')
|
|
477
|
+
.data(this.data())
|
|
478
|
+
.enter()
|
|
479
|
+
.append('rect')
|
|
480
|
+
.attr('rx', this.radius())
|
|
481
|
+
.attr('x', (d, i) => this._xScale(i.toString()))
|
|
482
|
+
.attr('y', 0)
|
|
483
|
+
.attr('width', this._xScale.bandwidth())
|
|
484
|
+
.attr('height', this._innerHeight)
|
|
485
|
+
.attr('class', 'highlight');
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
this._hlContainer.selectAll('rect')
|
|
489
|
+
.attr('x', (d, i) => this._xScale(i.toString()))
|
|
490
|
+
.attr('y', 0)
|
|
491
|
+
.attr('width', this._xScale.bandwidth())
|
|
492
|
+
.attr('height', this._innerHeight);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
if (!this._dataContainer) {
|
|
496
|
+
this._dataContainer = this._svg.append('g')
|
|
497
|
+
.attr('class', 'data-container')
|
|
498
|
+
.attr('transform', `translate(0,0)`);
|
|
499
|
+
const allBars = this._dataContainer.selectAll('rect')
|
|
500
|
+
.data(this.data())
|
|
501
|
+
.enter()
|
|
502
|
+
.append('rect')
|
|
503
|
+
.attr('rx', this.radius())
|
|
504
|
+
.attr('x', (d, i) => this._xScale(i.toString()))
|
|
505
|
+
.attr('y', (d) => this._yScale(d))
|
|
506
|
+
.attr('width', this._xScale.bandwidth())
|
|
507
|
+
.attr('height', (d) => this._innerHeight - this._yScale(d))
|
|
508
|
+
.attr('class', 'bar');
|
|
509
|
+
if (this.fillGradient()) {
|
|
510
|
+
allBars.attr('fill', `url(#${this.gradientId})`);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
else {
|
|
514
|
+
this._dataContainer.selectAll('rect')
|
|
515
|
+
.attr('x', (d, i) => this._xScale(i.toString()))
|
|
516
|
+
.attr('y', (d) => this._yScale(d))
|
|
517
|
+
.attr('width', this._xScale.bandwidth())
|
|
518
|
+
.attr('height', (d) => this._innerHeight - this._yScale(d));
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
_setupResizeObserver() {
|
|
522
|
+
if (!this.responsive()) {
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
this._resizeObserver?.disconnect();
|
|
526
|
+
this._resizeObserver = new ResizeObserver((entries) => {
|
|
527
|
+
if (this._hostWidth !== entries[0].contentRect.width || this._hostHeight !== entries[0].contentRect.height) {
|
|
528
|
+
this._hostWidth = entries[0].contentRect.width;
|
|
529
|
+
this._hostHeight = entries[0].contentRect.height;
|
|
530
|
+
this._innerWidth = entries[0].contentRect.width;
|
|
531
|
+
this._innerHeight = entries[0].contentRect.height;
|
|
532
|
+
this._svg.attr('viewBox', `0 0 ${this._hostWidth} ${this._hostHeight}`);
|
|
533
|
+
this._setupAxisScale();
|
|
534
|
+
this._setupData();
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
this._resizeObserver.observe(this._elementRef.nativeElement);
|
|
538
|
+
}
|
|
539
|
+
_initTooltip() {
|
|
540
|
+
if (!this.tooltip()) {
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
const xAccessor = this.xAccessor();
|
|
544
|
+
const yAccessor = this.yAccessor();
|
|
545
|
+
this._createTooltipOrigin();
|
|
546
|
+
let x = 0;
|
|
547
|
+
let y = 0;
|
|
548
|
+
let label;
|
|
549
|
+
let value;
|
|
550
|
+
let oldX;
|
|
551
|
+
fromEvent(this._document, 'mousemove')
|
|
552
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
553
|
+
.subscribe((e) => {
|
|
554
|
+
const target = e.target;
|
|
555
|
+
const pointerCoords = pointer(e, this._svg.node());
|
|
556
|
+
const [posX, posY] = pointerCoords;
|
|
557
|
+
let visible = true;
|
|
558
|
+
if (posX < 0 || posY < 0 || posX > this._hostWidth || posY > this._hostHeight) {
|
|
559
|
+
visible = false;
|
|
560
|
+
oldX = null;
|
|
561
|
+
this._overlayRef?.detach();
|
|
562
|
+
}
|
|
563
|
+
else {
|
|
564
|
+
if (!target.closest('.ngs-mchart-line') ||
|
|
565
|
+
!target.classList.contains('ngs-mchart-tooltip-overlay') ||
|
|
566
|
+
!target.closest('.ngs-mchart-tooltip-overlay')) {
|
|
567
|
+
oldX = null;
|
|
568
|
+
this._overlayRef?.detach();
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
const eachBand = this._xScale.step();
|
|
572
|
+
const index = Math.floor(posX / eachBand);
|
|
573
|
+
const dataValue = this.data()[index];
|
|
574
|
+
label = this.labels()[index] ? this.labels()[index] : xAccessor(index, index);
|
|
575
|
+
value = yAccessor(dataValue);
|
|
576
|
+
x = this._xScale(xAccessor(index, index));
|
|
577
|
+
y = this._yScale(yAccessor(dataValue));
|
|
578
|
+
if (posX < this._hostWidth / 2) {
|
|
579
|
+
this._currentTooltipPosition = 'after-center';
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
this._currentTooltipPosition = 'before-center';
|
|
583
|
+
}
|
|
584
|
+
this._setTooltipPositionByEvent(e);
|
|
585
|
+
if (visible) {
|
|
586
|
+
this._setTooltipVisible();
|
|
587
|
+
if (!this._overlayRef?.hasAttached()) {
|
|
588
|
+
oldX = x;
|
|
589
|
+
this._showTooltip({
|
|
590
|
+
label,
|
|
591
|
+
value
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
else {
|
|
595
|
+
if (oldX !== x) {
|
|
596
|
+
oldX = x;
|
|
597
|
+
this._showTooltip({
|
|
598
|
+
label,
|
|
599
|
+
value
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
else {
|
|
603
|
+
this._overlayRef.updatePositionStrategy(this._getOverlayPositionStrategy());
|
|
604
|
+
this._overlayRef.updatePosition();
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
oldX = x;
|
|
610
|
+
this._setTooltipInVisible();
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MchartBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
615
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: MchartBar, isStandalone: true, selector: "ngs-mchart-bar", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, highlight: { classPropertyName: "highlight", publicName: "highlight", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, fillGradient: { classPropertyName: "fillGradient", publicName: "fillGradient", isSignal: true, isRequired: false, transformFunction: null }, xAccessor: { classPropertyName: "xAccessor", publicName: "xAccessor", isSignal: true, isRequired: false, transformFunction: null }, yAccessor: { classPropertyName: "yAccessor", publicName: "yAccessor", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.fill-gradient": "fillGradient()", "class.with-tooltip": "!!tooltip()" }, classAttribute: "ngs-mchart-bar" }, exportAs: ["ngsMchartBar"], usesInheritance: true, ngImport: i0, template: "<svg>\n <defs>\n @if (fillGradient()) {\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" class=\"lg-start-color\"/>\n <stop offset=\"100%\" class=\"lg-end-color\"/>\n </linearGradient>\n }\n </defs>\n</svg>\n", styles: [":host{--ngs-mchart-bar-bar-bg: var(--color-primary);--ngs-mchart-bar-bar-gradient-start-color: var(--color-primary-500);--ngs-mchart-bar-bar-gradient-end-color: var(--color-primary);--ngs-mchart-bar-highlight-bg: var(--color-neutral-200);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .highlight{fill:var(--ngs-mchart-bar-highlight-bg)}:host:not(.fill-gradient) ::ng-deep .bar{fill:var(--ngs-mchart-bar-bar-bg)}:host.fill-gradient .lg-start-color{stop-color:var(--ngs-mchart-bar-bar-gradient-start-color)}:host.fill-gradient .lg-end-color{stop-color:var(--ngs-mchart-bar-bar-gradient-end-color)}:host.with-tooltip ::ng-deep .bar:hover{opacity:.85}:host-context(html.dark){--ngs-mchart-bar-highlight-bg: var(--color-neutral-700)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
616
|
+
}
|
|
617
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MchartBar, decorators: [{
|
|
618
|
+
type: Component,
|
|
619
|
+
args: [{ selector: 'ngs-mchart-bar', exportAs: 'ngsMchartBar', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
620
|
+
'class': 'ngs-mchart-bar',
|
|
621
|
+
'[class.fill-gradient]': 'fillGradient()',
|
|
622
|
+
'[class.with-tooltip]': '!!tooltip()',
|
|
623
|
+
}, template: "<svg>\n <defs>\n @if (fillGradient()) {\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" class=\"lg-start-color\"/>\n <stop offset=\"100%\" class=\"lg-end-color\"/>\n </linearGradient>\n }\n </defs>\n</svg>\n", styles: [":host{--ngs-mchart-bar-bar-bg: var(--color-primary);--ngs-mchart-bar-bar-gradient-start-color: var(--color-primary-500);--ngs-mchart-bar-bar-gradient-end-color: var(--color-primary);--ngs-mchart-bar-highlight-bg: var(--color-neutral-200);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .highlight{fill:var(--ngs-mchart-bar-highlight-bg)}:host:not(.fill-gradient) ::ng-deep .bar{fill:var(--ngs-mchart-bar-bar-bg)}:host.fill-gradient .lg-start-color{stop-color:var(--ngs-mchart-bar-bar-gradient-start-color)}:host.fill-gradient .lg-end-color{stop-color:var(--ngs-mchart-bar-bar-gradient-end-color)}:host.with-tooltip ::ng-deep .bar:hover{opacity:.85}:host-context(html.dark){--ngs-mchart-bar-highlight-bg: var(--color-neutral-700)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
624
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], highlight: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlight", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], fillGradient: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillGradient", required: false }] }], xAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "xAccessor", required: false }] }], yAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAccessor", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }] } });
|
|
625
|
+
|
|
626
|
+
class MchartPie extends BaseChartTooltip {
|
|
627
|
+
_initialized = false;
|
|
628
|
+
_host;
|
|
629
|
+
_svg;
|
|
630
|
+
_dataContainer;
|
|
631
|
+
_legendContainer;
|
|
632
|
+
_dimensions;
|
|
633
|
+
_innerWidth = 0;
|
|
634
|
+
_innerHeight = 0;
|
|
635
|
+
_hostWidth = 0;
|
|
636
|
+
_hostHeight = 0;
|
|
637
|
+
_resizeObserver;
|
|
638
|
+
_platformId = inject(PLATFORM_ID);
|
|
639
|
+
_elementRef = inject(ElementRef);
|
|
640
|
+
_radius = 0;
|
|
641
|
+
_arcGenerator;
|
|
642
|
+
_pieGenerator;
|
|
643
|
+
_colorsGenerator;
|
|
644
|
+
_arcTweenGenerator;
|
|
645
|
+
_pieData;
|
|
646
|
+
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
647
|
+
labels = input([], ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
648
|
+
valueAccessor = input((d) => d, ...(ngDevMode ? [{ debugName: "valueAccessor" }] : /* istanbul ignore next */ []));
|
|
649
|
+
dataItemStrokeWidth = input(1, { ...(ngDevMode ? { debugName: "dataItemStrokeWidth" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
650
|
+
legendContainerWidth = input(0, { ...(ngDevMode ? { debugName: "legendContainerWidth" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
651
|
+
showDataAnimation = input(false, { ...(ngDevMode ? { debugName: "showDataAnimation" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
652
|
+
showValueOnSlices = input(false, { ...(ngDevMode ? { debugName: "showValueOnSlices" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
653
|
+
showLegend = input(false, { ...(ngDevMode ? { debugName: "showLegend" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
654
|
+
legendOffset = input(30, { ...(ngDevMode ? { debugName: "legendOffset" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
655
|
+
legendItemHeight = input(30, { ...(ngDevMode ? { debugName: "legendItemHeight" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
656
|
+
legendItemSymbolSize = input(12, { ...(ngDevMode ? { debugName: "legendItemSymbolSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
657
|
+
legendItemFontSize = input(14, { ...(ngDevMode ? { debugName: "legendItemFontSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
658
|
+
legendItemSymbolBorderRadius = input(12, { ...(ngDevMode ? { debugName: "legendItemSymbolBorderRadius" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
659
|
+
valueFontSize = input(12, { ...(ngDevMode ? { debugName: "valueFontSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
660
|
+
tooltip = input(...(ngDevMode ? [undefined, { debugName: "tooltip" }] : /* istanbul ignore next */ []));
|
|
661
|
+
tooltipPosition = input('after-center', ...(ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []));
|
|
662
|
+
getTooltipPosition() {
|
|
663
|
+
return this.tooltipPosition();
|
|
664
|
+
}
|
|
665
|
+
getTooltipTemplateRef() {
|
|
666
|
+
return this.tooltip();
|
|
667
|
+
}
|
|
668
|
+
ngAfterViewChecked() {
|
|
669
|
+
if (isPlatformServer(this._platformId)) {
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
if (!this._initialized) {
|
|
673
|
+
const element = this._elementRef.nativeElement;
|
|
674
|
+
this._dimensions = element.getBoundingClientRect();
|
|
675
|
+
if (this._dimensions.width !== 0 && this._dimensions.height !== 0) {
|
|
676
|
+
this._initialized = true;
|
|
677
|
+
this._render();
|
|
678
|
+
this._setupResizeObserver();
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
ngOnChanges(changes) {
|
|
683
|
+
if (!this._initialized) {
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
if (changes['data'] && !changes['data'].firstChange) {
|
|
687
|
+
this._draw(true);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
ngOnDestroy() {
|
|
691
|
+
this._resizeObserver?.disconnect();
|
|
692
|
+
}
|
|
693
|
+
_render() {
|
|
694
|
+
this._initDimensions();
|
|
695
|
+
this._initContainers();
|
|
696
|
+
this._setGenerators();
|
|
697
|
+
this._setLegend();
|
|
698
|
+
this._draw();
|
|
699
|
+
this._initTooltip();
|
|
700
|
+
}
|
|
701
|
+
_initDimensions() {
|
|
702
|
+
const legendContainerWidth = this.showLegend() ? this.legendContainerWidth() : 0;
|
|
703
|
+
this._hostWidth = this._dimensions.width;
|
|
704
|
+
this._hostHeight = this._dimensions.height;
|
|
705
|
+
this._innerWidth = this._dimensions.width - legendContainerWidth - this.dataItemStrokeWidth() * 2;
|
|
706
|
+
this._innerHeight = this._dimensions.height - this.dataItemStrokeWidth() * 2;
|
|
707
|
+
this._host = select(this._elementRef.nativeElement);
|
|
708
|
+
this._svg = this._host
|
|
709
|
+
.select('svg')
|
|
710
|
+
.attr('viewBox', `0 0 ${this._hostWidth} ${this._hostHeight}`);
|
|
711
|
+
this._radius = Math.min(this._innerWidth, this._innerHeight) * .5;
|
|
712
|
+
}
|
|
713
|
+
_initContainers() {
|
|
714
|
+
this._dataContainer = this._svg
|
|
715
|
+
.append('g')
|
|
716
|
+
.attr('class', 'data-container')
|
|
717
|
+
.attr('transform', `translate(${this._radius},${this._innerHeight * .5})`);
|
|
718
|
+
if (this.showLegend()) {
|
|
719
|
+
this._legendContainer = this._svg
|
|
720
|
+
.append('g')
|
|
721
|
+
.attr('class', 'legend-container');
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
_setGenerators() {
|
|
725
|
+
const self = this;
|
|
726
|
+
this._arcGenerator = arc()
|
|
727
|
+
.innerRadius(0)
|
|
728
|
+
.outerRadius(this._radius);
|
|
729
|
+
this._pieGenerator = pie()
|
|
730
|
+
.value(this.valueAccessor());
|
|
731
|
+
this._colorsGenerator = scaleOrdinal(schemeTableau10)
|
|
732
|
+
.domain(this.data().map((d, i) => i.toString()));
|
|
733
|
+
this._arcTweenGenerator = function (d) {
|
|
734
|
+
// @ts-ignore
|
|
735
|
+
const _this = this;
|
|
736
|
+
const current = d;
|
|
737
|
+
const interpolateGenerator = interpolate(_this._previous, current);
|
|
738
|
+
_this._previous = current;
|
|
739
|
+
return (t) => {
|
|
740
|
+
return self._arcGenerator(interpolateGenerator(t));
|
|
741
|
+
};
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
_setLegend() {
|
|
745
|
+
if (!this.showLegend()) {
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
this._legendContainer
|
|
749
|
+
.selectAll('g.legend-item')
|
|
750
|
+
.data(this.data())
|
|
751
|
+
.join('g')
|
|
752
|
+
.attr('class', 'legend-item')
|
|
753
|
+
.attr('data-index', (d, i) => i)
|
|
754
|
+
.attr('transform', (d, i) => `translate(0, ${i * this.legendItemHeight()})`)
|
|
755
|
+
.on('mouseenter', (event, d) => {
|
|
756
|
+
const target = event.target;
|
|
757
|
+
const index = +target.getAttribute('data-index');
|
|
758
|
+
this._dataContainer
|
|
759
|
+
.select(`path.data-item[data-index="${index}"]`)
|
|
760
|
+
.classed('active', true);
|
|
761
|
+
})
|
|
762
|
+
.on('mouseleave', (event, d) => {
|
|
763
|
+
const target = event.target;
|
|
764
|
+
const index = +target.getAttribute('data-index');
|
|
765
|
+
this._dataContainer
|
|
766
|
+
.select(`path.data-item[data-index="${index}"]`)
|
|
767
|
+
.classed('active', false);
|
|
768
|
+
});
|
|
769
|
+
this._legendContainer
|
|
770
|
+
.selectAll('g.legend-item')
|
|
771
|
+
.selectAll('text')
|
|
772
|
+
.data((d, i) => [i])
|
|
773
|
+
.join('text')
|
|
774
|
+
.attr('class', 'legend-item-text')
|
|
775
|
+
.attr('x', this.legendItemSymbolSize() * 2)
|
|
776
|
+
.attr('y', this.legendItemHeight() * .5)
|
|
777
|
+
.attr('font-size', this.legendItemFontSize())
|
|
778
|
+
.text((i) => this.labels()[i]);
|
|
779
|
+
this._legendContainer
|
|
780
|
+
.selectAll('g.legend-item')
|
|
781
|
+
.selectAll('rect')
|
|
782
|
+
.data((d, i) => [i])
|
|
783
|
+
.join('rect')
|
|
784
|
+
.attr('class', 'legend-item-symbol')
|
|
785
|
+
.attr('rx', this.legendItemSymbolBorderRadius())
|
|
786
|
+
.attr('width', this.legendItemSymbolSize())
|
|
787
|
+
.attr('height', this.legendItemSymbolSize())
|
|
788
|
+
.attr('fill', (i) => this._colorsGenerator(i))
|
|
789
|
+
.attr('y', this.legendItemFontSize() * .5 - 2);
|
|
790
|
+
const dimensions = this._legendContainer.node().getBBox();
|
|
791
|
+
this._legendContainer.attr('transform', `translate(${this._radius * 2 + this.legendOffset()},${this._innerHeight * .5 - .5 * dimensions.height})`);
|
|
792
|
+
}
|
|
793
|
+
_draw(isUpdate = false) {
|
|
794
|
+
if (isUpdate) {
|
|
795
|
+
this._colorsGenerator
|
|
796
|
+
.domain(this.data().map((d, i) => i.toString()));
|
|
797
|
+
}
|
|
798
|
+
this._pieData = this._pieGenerator(this.data());
|
|
799
|
+
this._dataContainer
|
|
800
|
+
.selectAll('g.data-item-group')
|
|
801
|
+
.data(this.data())
|
|
802
|
+
.join('g')
|
|
803
|
+
.attr('class', 'data-item-group')
|
|
804
|
+
.attr('data-index', (d, i) => i);
|
|
805
|
+
this._dataContainer
|
|
806
|
+
.selectAll('g.data-item-group')
|
|
807
|
+
.selectAll('path')
|
|
808
|
+
.data((d, i) => [this._pieData[i]])
|
|
809
|
+
.join('path')
|
|
810
|
+
.attr('class', 'data-item')
|
|
811
|
+
.attr('stroke-width', this.dataItemStrokeWidth())
|
|
812
|
+
.attr('d', (d) => this._arcGenerator(d))
|
|
813
|
+
.style('fill', (d) => this._colorsGenerator(d.index))
|
|
814
|
+
.attr('data-index', (d) => d.index)
|
|
815
|
+
.transition()
|
|
816
|
+
.duration(this.showDataAnimation() ? 1000 : 0)
|
|
817
|
+
.attrTween('d', this._arcTweenGenerator);
|
|
818
|
+
if (this.showValueOnSlices()) {
|
|
819
|
+
this._dataContainer
|
|
820
|
+
.selectAll('g.data-item-group')
|
|
821
|
+
.selectAll('text')
|
|
822
|
+
.data((d, i) => [this._pieData[i]])
|
|
823
|
+
.join('text')
|
|
824
|
+
.attr('class', 'value')
|
|
825
|
+
.attr('font-size', this.valueFontSize())
|
|
826
|
+
.attr('transform', (d) => {
|
|
827
|
+
const coordinates = this._arcGenerator.centroid(d);
|
|
828
|
+
return `translate(${coordinates[0]},${coordinates[1]})`;
|
|
829
|
+
})
|
|
830
|
+
.text((d) => d.data);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
_setupResizeObserver() {
|
|
834
|
+
}
|
|
835
|
+
_initTooltip() {
|
|
836
|
+
if (!this.tooltip()) {
|
|
837
|
+
return;
|
|
838
|
+
}
|
|
839
|
+
let oldValue;
|
|
840
|
+
this._createTooltipOrigin();
|
|
841
|
+
this._dataContainer
|
|
842
|
+
.selectAll('g.data-item-group')
|
|
843
|
+
.data(this._pieData)
|
|
844
|
+
.on('mousemove', (event, d) => {
|
|
845
|
+
const target = event.target;
|
|
846
|
+
this._setTooltipPositionByEvent(event);
|
|
847
|
+
this._setTooltipVisible();
|
|
848
|
+
const index = +target.getAttribute('data-index');
|
|
849
|
+
const label = this.labels()[index] ? this.labels()[index] : null;
|
|
850
|
+
const color = this._colorsGenerator(index);
|
|
851
|
+
const value = d.data;
|
|
852
|
+
if (!this._overlayRef?.hasAttached()) {
|
|
853
|
+
this._showTooltip({
|
|
854
|
+
label,
|
|
855
|
+
color,
|
|
856
|
+
value
|
|
857
|
+
});
|
|
858
|
+
oldValue = value;
|
|
859
|
+
}
|
|
860
|
+
else {
|
|
861
|
+
if (oldValue !== d.data) {
|
|
862
|
+
this._showTooltip({
|
|
863
|
+
label,
|
|
864
|
+
color,
|
|
865
|
+
value
|
|
866
|
+
});
|
|
867
|
+
oldValue = value;
|
|
868
|
+
}
|
|
869
|
+
else {
|
|
870
|
+
this._overlayRef.updatePosition();
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
});
|
|
874
|
+
this._dataContainer
|
|
875
|
+
.on('mouseleave', (event) => {
|
|
876
|
+
this._setTooltipInVisible();
|
|
877
|
+
this._hideTooltip();
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MchartPie, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
881
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.4", type: MchartPie, isStandalone: true, selector: "ngs-mchart-pie", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, valueAccessor: { classPropertyName: "valueAccessor", publicName: "valueAccessor", isSignal: true, isRequired: false, transformFunction: null }, dataItemStrokeWidth: { classPropertyName: "dataItemStrokeWidth", publicName: "dataItemStrokeWidth", isSignal: true, isRequired: false, transformFunction: null }, legendContainerWidth: { classPropertyName: "legendContainerWidth", publicName: "legendContainerWidth", isSignal: true, isRequired: false, transformFunction: null }, showDataAnimation: { classPropertyName: "showDataAnimation", publicName: "showDataAnimation", isSignal: true, isRequired: false, transformFunction: null }, showValueOnSlices: { classPropertyName: "showValueOnSlices", publicName: "showValueOnSlices", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, legendOffset: { classPropertyName: "legendOffset", publicName: "legendOffset", isSignal: true, isRequired: false, transformFunction: null }, legendItemHeight: { classPropertyName: "legendItemHeight", publicName: "legendItemHeight", isSignal: true, isRequired: false, transformFunction: null }, legendItemSymbolSize: { classPropertyName: "legendItemSymbolSize", publicName: "legendItemSymbolSize", isSignal: true, isRequired: false, transformFunction: null }, legendItemFontSize: { classPropertyName: "legendItemFontSize", publicName: "legendItemFontSize", isSignal: true, isRequired: false, transformFunction: null }, legendItemSymbolBorderRadius: { classPropertyName: "legendItemSymbolBorderRadius", publicName: "legendItemSymbolBorderRadius", isSignal: true, isRequired: false, transformFunction: null }, valueFontSize: { classPropertyName: "valueFontSize", publicName: "valueFontSize", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ngs-mchart-pie" }, exportAs: ["ngsMchartPie"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<svg></svg>\n", styles: [":host{--ngs-mchart-pie-stroke-color: var(--color-background);--ngs-mchart-pie-legend-item-color: var(--color-neutral-900);--ngs-mchart-pie-legend-item-hover-color: var(--color-primary);--ngs-mchart-pie-value-color: var(--color-neutral-950);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host:has(.data-item.active) ::ng-deep .data-item:not(.active){opacity:.7;scale:.93;transition:scale .2s}:host ::ng-deep .data-item{stroke:var(--ngs-mchart-pie-stroke-color)}:host ::ng-deep .value{text-anchor:middle;alignment-baseline:middle;fill:var(--ngs-mchart-pie-value-color)}:host ::ng-deep .legend-item{cursor:pointer}:host ::ng-deep .legend-item:hover .legend-item-text{fill:var(--ngs-mchart-pie-legend-item-hover-color)}:host ::ng-deep .legend-item-text{fill:var(--ngs-mchart-pie-legend-item-color)}:host-context(html.dark){--ngs-mchart-pie-legend-item-color: var(--color-neutral-200)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
882
|
+
}
|
|
883
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MchartPie, decorators: [{
|
|
884
|
+
type: Component,
|
|
885
|
+
args: [{ selector: 'ngs-mchart-pie', exportAs: 'ngsMchartPie', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
886
|
+
'class': 'ngs-mchart-pie'
|
|
887
|
+
}, template: "<svg></svg>\n", styles: [":host{--ngs-mchart-pie-stroke-color: var(--color-background);--ngs-mchart-pie-legend-item-color: var(--color-neutral-900);--ngs-mchart-pie-legend-item-hover-color: var(--color-primary);--ngs-mchart-pie-value-color: var(--color-neutral-950);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host:has(.data-item.active) ::ng-deep .data-item:not(.active){opacity:.7;scale:.93;transition:scale .2s}:host ::ng-deep .data-item{stroke:var(--ngs-mchart-pie-stroke-color)}:host ::ng-deep .value{text-anchor:middle;alignment-baseline:middle;fill:var(--ngs-mchart-pie-value-color)}:host ::ng-deep .legend-item{cursor:pointer}:host ::ng-deep .legend-item:hover .legend-item-text{fill:var(--ngs-mchart-pie-legend-item-hover-color)}:host ::ng-deep .legend-item-text{fill:var(--ngs-mchart-pie-legend-item-color)}:host-context(html.dark){--ngs-mchart-pie-legend-item-color: var(--color-neutral-200)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
888
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], valueAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueAccessor", required: false }] }], dataItemStrokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataItemStrokeWidth", required: false }] }], legendContainerWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendContainerWidth", required: false }] }], showDataAnimation: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDataAnimation", required: false }] }], showValueOnSlices: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValueOnSlices", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], legendOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendOffset", required: false }] }], legendItemHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItemHeight", required: false }] }], legendItemSymbolSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItemSymbolSize", required: false }] }], legendItemFontSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItemFontSize", required: false }] }], legendItemSymbolBorderRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItemSymbolBorderRadius", required: false }] }], valueFontSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFontSize", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }] } });
|
|
889
|
+
|
|
890
|
+
class MchartTooltip {
|
|
891
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MchartTooltip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
892
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: MchartTooltip, isStandalone: true, selector: "ngs-mchart-tooltip", host: { classAttribute: "ngs-mchart-tooltip" }, exportAs: ["ngsMchartTooltip"], ngImport: i0, template: "<div class=\"title\">\n <ng-content select=\"ngs-mchart-tooltip-title\" />\n</div>\n<div class=\"body\">\n <ng-content select=\"ngs-mchart-tooltip-body\" />\n</div>\n<ng-content />\n", styles: [":host{display:block;width:max-content;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a;border-radius:.5rem;background:#fff;font-size:.75rem;overflow:hidden}:host .title:empty{display:none}:host .body:empty{display:none}:host-context(html.dark){background:var(--color-tertiary-200);color:var(--color-neutral-800)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] });
|
|
893
|
+
}
|
|
894
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MchartTooltip, decorators: [{
|
|
895
|
+
type: Component,
|
|
896
|
+
args: [{ selector: 'ngs-mchart-tooltip', exportAs: 'ngsMchartTooltip', host: {
|
|
897
|
+
'class': 'ngs-mchart-tooltip'
|
|
898
|
+
}, template: "<div class=\"title\">\n <ng-content select=\"ngs-mchart-tooltip-title\" />\n</div>\n<div class=\"body\">\n <ng-content select=\"ngs-mchart-tooltip-body\" />\n</div>\n<ng-content />\n", styles: [":host{display:block;width:max-content;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a;border-radius:.5rem;background:#fff;font-size:.75rem;overflow:hidden}:host .title:empty{display:none}:host .body:empty{display:none}:host-context(html.dark){background:var(--color-tertiary-200);color:var(--color-neutral-800)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
899
|
+
}] });
|
|
900
|
+
|
|
901
|
+
class MchartTooltipTitle {
|
|
902
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MchartTooltipTitle, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
903
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: MchartTooltipTitle, isStandalone: true, selector: "ngs-mchart-tooltip-title", host: { classAttribute: "ngs-mchart-tooltip-title" }, exportAs: ["ngsMchartTooltipTitle"], ngImport: i0, template: "<ng-content />\n", styles: [":host{display:block;background:var(--color-neutral-200);padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2);font-weight:500}:host-context(html.dark){background:var(--color-neutral-300);color:var(--color-neutral-900)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] });
|
|
904
|
+
}
|
|
905
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MchartTooltipTitle, decorators: [{
|
|
906
|
+
type: Component,
|
|
907
|
+
args: [{ selector: 'ngs-mchart-tooltip-title', exportAs: 'ngsMchartTooltipTitle', host: {
|
|
908
|
+
'class': 'ngs-mchart-tooltip-title'
|
|
909
|
+
}, template: "<ng-content />\n", styles: [":host{display:block;background:var(--color-neutral-200);padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2);font-weight:500}:host-context(html.dark){background:var(--color-neutral-300);color:var(--color-neutral-900)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
910
|
+
}] });
|
|
911
|
+
|
|
912
|
+
class MchartTooltipBody {
|
|
913
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MchartTooltipBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
914
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: MchartTooltipBody, isStandalone: true, selector: "ngs-mchart-tooltip-body", host: { classAttribute: "ngs-mchart-tooltip-body" }, exportAs: ["ngsMchartTooltipBody"], ngImport: i0, template: "<ng-content />\n", styles: [":host{display:block;padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] });
|
|
915
|
+
}
|
|
916
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MchartTooltipBody, decorators: [{
|
|
917
|
+
type: Component,
|
|
918
|
+
args: [{ selector: 'ngs-mchart-tooltip-body', exportAs: 'ngsMchartTooltipBody', host: {
|
|
919
|
+
'class': 'ngs-mchart-tooltip-body'
|
|
920
|
+
}, template: "<ng-content />\n", styles: [":host{display:block;padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
921
|
+
}] });
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* Generated bundle index. Do not edit.
|
|
925
|
+
*/
|
|
926
|
+
|
|
927
|
+
export { MchartBar, MchartLine, MchartPie, MchartTooltip, MchartTooltipBody, MchartTooltipTitle };
|
|
928
|
+
//# sourceMappingURL=ngstarter-ui-components-micro-chart.mjs.map
|