@awc-ui/core 1.0.0-beta.3 → 1.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/lazy-loading-indicator-CoC-_DMs.js +69 -0
- package/dist/cjs/lazy-loading-indicator-CoC-_DMs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/md-accordion-item.cjs.entry.js +3 -3
- package/dist/cjs/md-app-bar.cjs.entry.js +1 -1
- package/dist/cjs/md-area-chart.cjs.entry.js +2 -2
- package/dist/cjs/md-autocomplete.cjs.entry.js +4 -3
- package/dist/cjs/md-autocomplete.cjs.entry.js.map +1 -1
- package/dist/cjs/md-avatar_2.cjs.entry.js +3 -3
- package/dist/cjs/md-badge.cjs.entry.js +2 -2
- package/dist/cjs/md-bar-chart.cjs.entry.js +2 -2
- package/dist/cjs/md-bottom-sheet.cjs.entry.js +4 -4
- package/dist/cjs/md-breadcrumbs.cjs.entry.js +2 -2
- package/dist/cjs/md-button-group.cjs.entry.js +2 -2
- package/dist/cjs/{md-button_7.cjs.entry.js → md-button_6.cjs.entry.js} +13 -38
- package/dist/cjs/md-button_6.cjs.entry.js.map +1 -0
- package/dist/cjs/md-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/md-chip.cjs.entry.js +2 -2
- package/dist/cjs/md-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/md-dialog.cjs.entry.js +2 -2
- package/dist/cjs/md-divider.cjs.entry.js +2 -2
- package/dist/cjs/md-fab-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/md-fab-menu.cjs.entry.js +2 -2
- package/dist/cjs/md-fab.cjs.entry.js +2 -2
- package/dist/cjs/md-line-chart.cjs.entry.js +2 -2
- package/dist/cjs/md-list-item.cjs.entry.js +3 -3
- package/dist/cjs/md-list.cjs.entry.js +3 -3
- package/dist/cjs/md-loading-indicator-CmzdcYLR.js +33 -0
- package/dist/cjs/md-loading-indicator-CmzdcYLR.js.map +1 -0
- package/dist/cjs/md-loading-indicator.cjs.entry.js +11 -0
- package/dist/cjs/md-loading-indicator.cjs.entry.js.map +1 -0
- package/dist/cjs/md-menu_2.cjs.entry.js +5 -5
- package/dist/cjs/md-multi-select.cjs.entry.js +5 -4
- package/dist/cjs/md-multi-select.cjs.entry.js.map +1 -1
- package/dist/cjs/md-navigation-bar.cjs.entry.js +1 -1
- package/dist/cjs/md-navigation-tab.cjs.entry.js +2 -2
- package/dist/cjs/md-number-field.cjs.entry.js +2 -2
- package/dist/cjs/md-organization-chart.cjs.entry.js +2 -2
- package/dist/cjs/md-otp-field.cjs.entry.js +3 -3
- package/dist/cjs/md-search.cjs.entry.js +7 -6
- package/dist/cjs/md-search.cjs.entry.js.map +1 -1
- package/dist/cjs/md-select-option.cjs.entry.js +1 -1
- package/dist/cjs/md-select.cjs.entry.js +5 -4
- package/dist/cjs/md-select.cjs.entry.js.map +1 -1
- package/dist/cjs/md-slider.cjs.entry.js +2 -2
- package/dist/cjs/md-sparkline.cjs.entry.js +2 -2
- package/dist/cjs/md-status-dot.cjs.entry.js +1 -1
- package/dist/cjs/md-table.cjs.entry.js +3 -3
- package/dist/cjs/md-text-field.cjs.entry.js +7 -7
- package/dist/cjs/md-time-picker.cjs.entry.js +1 -1
- package/dist/cjs/md-transfer-list.cjs.entry.js +1 -1
- package/dist/cjs/md3.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/md-accordion-item/md-accordion-item.js +3 -3
- package/dist/collection/components/md-app-bar/md-app-bar.js +1 -1
- package/dist/collection/components/md-area-chart/md-area-chart.js +2 -2
- package/dist/collection/components/md-autocomplete/md-autocomplete.js +4 -3
- package/dist/collection/components/md-autocomplete/md-autocomplete.js.map +1 -1
- package/dist/collection/components/md-avatar/md-avatar.js +2 -2
- package/dist/collection/components/md-badge/md-badge.js +2 -2
- package/dist/collection/components/md-bar-chart/md-bar-chart.js +2 -2
- package/dist/collection/components/md-bottom-sheet/md-bottom-sheet.js +4 -4
- package/dist/collection/components/md-breadcrumbs/md-breadcrumbs.js +2 -2
- package/dist/collection/components/md-button/md-button.js +4 -3
- package/dist/collection/components/md-button/md-button.js.map +1 -1
- package/dist/collection/components/md-button-group/md-button-group.js +2 -2
- package/dist/collection/components/md-card/md-card.js +2 -2
- package/dist/collection/components/md-checkbox/md-checkbox.js +2 -2
- package/dist/collection/components/md-chip/md-chip.js +2 -2
- package/dist/collection/components/md-date-picker/md-date-picker.js +1 -1
- package/dist/collection/components/md-dialog/md-dialog.js +2 -2
- package/dist/collection/components/md-divider/md-divider.js +2 -2
- package/dist/collection/components/md-fab/md-fab.js +2 -2
- package/dist/collection/components/md-fab-menu/md-fab-menu.js +2 -2
- package/dist/collection/components/md-fab-menu-item/md-fab-menu-item.js +2 -2
- package/dist/collection/components/md-icon-button/md-icon-button.js +4 -4
- package/dist/collection/components/md-line-chart/md-line-chart.js +2 -2
- package/dist/collection/components/md-list/md-list.js +3 -3
- package/dist/collection/components/md-list-item/md-list-item.js +3 -3
- package/dist/collection/components/md-loading-indicator/md-loading-indicator.js +2 -2
- package/dist/collection/components/md-menu/md-menu.js +3 -3
- package/dist/collection/components/md-menu-item/md-menu-item.js +2 -2
- package/dist/collection/components/md-multi-select/md-multi-select.js +5 -4
- package/dist/collection/components/md-multi-select/md-multi-select.js.map +1 -1
- package/dist/collection/components/md-navigation-bar/md-navigation-bar.js +1 -1
- package/dist/collection/components/md-navigation-tab/md-navigation-tab.js +2 -2
- package/dist/collection/components/md-number-field/md-number-field.js +2 -2
- package/dist/collection/components/md-organization-chart/md-organization-chart.js +2 -2
- package/dist/collection/components/md-otp-field/md-otp-field.js +3 -3
- package/dist/collection/components/md-ripple/md-ripple.js +1 -1
- package/dist/collection/components/md-search/md-search.js +7 -6
- package/dist/collection/components/md-search/md-search.js.map +1 -1
- package/dist/collection/components/md-select/md-select.js +5 -4
- package/dist/collection/components/md-select/md-select.js.map +1 -1
- package/dist/collection/components/md-select-option/md-select-option.js +1 -1
- package/dist/collection/components/md-slider/md-slider.js +2 -2
- package/dist/collection/components/md-sparkline/md-sparkline.js +2 -2
- package/dist/collection/components/md-status-dot/md-status-dot.js +1 -1
- package/dist/collection/components/md-table/md-table.js +3 -3
- package/dist/collection/components/md-text-field/md-text-field.js +7 -7
- package/dist/collection/components/md-time-picker/md-time-picker.js +1 -1
- package/dist/collection/components/md-tooltip/md-tooltip.js +1 -1
- package/dist/collection/components/md-transfer-list/md-transfer-list.js +1 -1
- package/dist/collection/utils/lazy-loading-indicator.js +62 -0
- package/dist/collection/utils/lazy-loading-indicator.js.map +1 -0
- package/dist/components/md-accordion-item.js +1 -1
- package/dist/components/md-app-bar.js +1 -1
- package/dist/components/md-area-chart.js +1 -1
- package/dist/components/md-area-chart.js.map +1 -1
- package/dist/components/md-autocomplete.js +1 -1
- package/dist/components/md-autocomplete.js.map +1 -1
- package/dist/components/md-avatar.js +1 -1
- package/dist/components/md-badge.js +1 -1
- package/dist/components/md-bar-chart.js +1 -1
- package/dist/components/md-bottom-sheet.js +1 -1
- package/dist/components/md-breadcrumb-item.js +1 -1
- package/dist/components/md-breadcrumbs.js +1 -1
- package/dist/components/md-button-group.js +1 -1
- package/dist/components/md-button.js +1 -1
- package/dist/components/md-card.js +1 -1
- package/dist/components/md-checkbox.js +1 -1
- package/dist/components/md-chip.js +1 -1
- package/dist/components/md-date-picker.js +1 -1
- package/dist/components/md-date-picker.js.map +1 -1
- package/dist/components/md-dialog.js +1 -1
- package/dist/components/md-dialog.js.map +1 -1
- package/dist/components/md-divider.js +1 -1
- package/dist/components/md-divider.js.map +1 -1
- package/dist/components/md-fab-menu-item.js +1 -1
- package/dist/components/md-fab-menu.js +1 -1
- package/dist/components/md-fab.js +1 -1
- package/dist/components/md-icon-button.js +1 -1
- package/dist/components/md-line-chart.js +1 -1
- package/dist/components/md-line-chart.js.map +1 -1
- package/dist/components/md-list-item.js +1 -1
- package/dist/components/md-list.js +1 -1
- package/dist/components/md-loading-indicator.js +1 -1
- package/dist/components/md-menu-item.js +1 -1
- package/dist/components/md-menu.js +1 -1
- package/dist/components/md-multi-select.js +1 -1
- package/dist/components/md-multi-select.js.map +1 -1
- package/dist/components/md-navigation-bar.js +1 -1
- package/dist/components/md-navigation-rail-tab.js +1 -1
- package/dist/components/md-navigation-rail.js +1 -1
- package/dist/components/md-navigation-tab.js +1 -1
- package/dist/components/md-number-field.js +1 -1
- package/dist/components/md-organization-chart.js +1 -1
- package/dist/components/md-otp-field.js +1 -1
- package/dist/components/md-radio.js +1 -1
- package/dist/components/md-ripple.js +1 -1
- package/dist/components/md-search.js +1 -1
- package/dist/components/md-search.js.map +1 -1
- package/dist/components/md-segmented-button.js +1 -1
- package/dist/components/md-select-option.js +1 -1
- package/dist/components/md-select.js +1 -1
- package/dist/components/md-side-sheet.js +1 -1
- package/dist/components/md-slider.js +1 -1
- package/dist/components/md-snackbar.js +1 -1
- package/dist/components/md-snackbar.js.map +1 -1
- package/dist/components/md-sparkline.js +1 -1
- package/dist/components/md-split-button.js +1 -1
- package/dist/components/md-status-dot.js +1 -1
- package/dist/components/md-step.js +1 -1
- package/dist/components/md-step.js.map +1 -1
- package/dist/components/md-stepper.js +1 -1
- package/dist/components/md-stepper.js.map +1 -1
- package/dist/components/md-sub-menu-item.js +1 -1
- package/dist/components/md-tab.js +1 -1
- package/dist/components/md-table-expand-toggle.js +1 -1
- package/dist/components/md-table-pagination.js +1 -1
- package/dist/components/md-table-pagination.js.map +1 -1
- package/dist/components/md-table.js +1 -1
- package/dist/components/md-text-field.js +1 -1
- package/dist/components/md-time-picker.js +1 -1
- package/dist/components/md-time-picker.js.map +1 -1
- package/dist/components/md-tooltip.js +1 -1
- package/dist/components/md-transfer-list.js +1 -1
- package/dist/components/{p-Eb44PPZa.js → p-1RSrsLOs.js} +2 -2
- package/dist/components/{p-D8oM1Kr3.js → p-2HV152w7.js} +2 -2
- package/dist/components/{p-BA2v4IuG.js → p-6ZDAcEKN.js} +2 -2
- package/dist/components/{p-BADA63mI.js → p-B2fYoYe9.js} +2 -2
- package/dist/components/p-B2fYoYe9.js.map +1 -0
- package/dist/components/{p-CCMritCA.js → p-C77M30dm.js} +2 -2
- package/dist/{components-csr/p-Bmu7RqHM.js → components/p-CNgkGl_1.js} +2 -2
- package/dist/components/p-CNgkGl_1.js.map +1 -0
- package/dist/components/{p-CtVItLby.js → p-D5Ht729E.js} +2 -2
- package/dist/components/p-DPqGg8C1.js +2 -0
- package/dist/components/p-DPqGg8C1.js.map +1 -0
- package/dist/components/{p-CTC8XAB6.js → p-De3E5Q8v.js} +2 -2
- package/dist/components/{p-B-JfuA2g.js → p-Dm_7DA1f.js} +2 -2
- package/dist/components/{p-DEzb9xsY.js → p-Dz3R-2Wn.js} +2 -2
- package/dist/components/{p-B-iHDK5h.js → p-Zjf9uhOr.js} +2 -2
- package/dist/components/{p-DfU4xY2F.js → p-ssLobpGS.js} +2 -2
- package/dist/components/{p-DYL-8C5C.js → p-zMR3UIR_.js} +2 -2
- package/dist/components-csr/md-accordion-item.js +1 -1
- package/dist/components-csr/md-app-bar.js +1 -1
- package/dist/components-csr/md-area-chart.js +1 -1
- package/dist/components-csr/md-area-chart.js.map +1 -1
- package/dist/components-csr/md-autocomplete.js +1 -1
- package/dist/components-csr/md-autocomplete.js.map +1 -1
- package/dist/components-csr/md-avatar.js +1 -1
- package/dist/components-csr/md-badge.js +1 -1
- package/dist/components-csr/md-bar-chart.js +1 -1
- package/dist/components-csr/md-bottom-sheet.js +1 -1
- package/dist/components-csr/md-breadcrumb-item.js +1 -1
- package/dist/components-csr/md-breadcrumbs.js +1 -1
- package/dist/components-csr/md-button-group.js +1 -1
- package/dist/components-csr/md-button.js +1 -1
- package/dist/components-csr/md-card.js +1 -1
- package/dist/components-csr/md-checkbox.js +1 -1
- package/dist/components-csr/md-chip.js +1 -1
- package/dist/components-csr/md-date-picker.js +1 -1
- package/dist/components-csr/md-date-picker.js.map +1 -1
- package/dist/components-csr/md-dialog.js +1 -1
- package/dist/components-csr/md-dialog.js.map +1 -1
- package/dist/components-csr/md-divider.js +1 -1
- package/dist/components-csr/md-divider.js.map +1 -1
- package/dist/components-csr/md-fab-menu-item.js +1 -1
- package/dist/components-csr/md-fab-menu.js +1 -1
- package/dist/components-csr/md-fab.js +1 -1
- package/dist/components-csr/md-icon-button.js +1 -1
- package/dist/components-csr/md-line-chart.js +1 -1
- package/dist/components-csr/md-line-chart.js.map +1 -1
- package/dist/components-csr/md-list-item.js +1 -1
- package/dist/components-csr/md-list.js +1 -1
- package/dist/components-csr/md-loading-indicator.js +1 -1
- package/dist/components-csr/md-menu-item.js +1 -1
- package/dist/components-csr/md-menu.js +1 -1
- package/dist/components-csr/md-multi-select.js +1 -1
- package/dist/components-csr/md-multi-select.js.map +1 -1
- package/dist/components-csr/md-navigation-bar.js +1 -1
- package/dist/components-csr/md-navigation-rail-tab.js +1 -1
- package/dist/components-csr/md-navigation-rail.js +1 -1
- package/dist/components-csr/md-navigation-tab.js +1 -1
- package/dist/components-csr/md-number-field.js +1 -1
- package/dist/components-csr/md-organization-chart.js +1 -1
- package/dist/components-csr/md-otp-field.js +1 -1
- package/dist/components-csr/md-radio.js +1 -1
- package/dist/components-csr/md-ripple.js +1 -1
- package/dist/components-csr/md-search.js +1 -1
- package/dist/components-csr/md-search.js.map +1 -1
- package/dist/components-csr/md-segmented-button.js +1 -1
- package/dist/components-csr/md-select-option.js +1 -1
- package/dist/components-csr/md-select.js +1 -1
- package/dist/components-csr/md-side-sheet.js +1 -1
- package/dist/components-csr/md-slider.js +1 -1
- package/dist/components-csr/md-snackbar.js +1 -1
- package/dist/components-csr/md-snackbar.js.map +1 -1
- package/dist/components-csr/md-sparkline.js +1 -1
- package/dist/components-csr/md-split-button.js +1 -1
- package/dist/components-csr/md-status-dot.js +1 -1
- package/dist/components-csr/md-step.js +1 -1
- package/dist/components-csr/md-step.js.map +1 -1
- package/dist/components-csr/md-stepper.js +1 -1
- package/dist/components-csr/md-stepper.js.map +1 -1
- package/dist/components-csr/md-sub-menu-item.js +1 -1
- package/dist/components-csr/md-tab.js +1 -1
- package/dist/components-csr/md-table-expand-toggle.js +1 -1
- package/dist/components-csr/md-table-pagination.js +1 -1
- package/dist/components-csr/md-table-pagination.js.map +1 -1
- package/dist/components-csr/md-table.js +1 -1
- package/dist/components-csr/md-text-field.js +1 -1
- package/dist/components-csr/md-time-picker.js +1 -1
- package/dist/components-csr/md-time-picker.js.map +1 -1
- package/dist/components-csr/md-tooltip.js +1 -1
- package/dist/components-csr/md-transfer-list.js +1 -1
- package/dist/components-csr/p-6WgHjhDg.js +2 -0
- package/dist/components-csr/p-6WgHjhDg.js.map +1 -0
- package/dist/components-csr/{p-C0DlKmRg.js → p-BEmwDSzw.js} +2 -2
- package/dist/components-csr/{p-DvXQXhgu.js → p-BQKzjYcY.js} +2 -2
- package/dist/components-csr/{p-CG6FaRlt.js → p-BWMwewtY.js} +2 -2
- package/dist/components-csr/{p--OUYjgKN.js → p-BZakoRau.js} +2 -2
- package/dist/components-csr/p-BZakoRau.js.map +1 -0
- package/dist/components-csr/{p-CSrxeWwL.js → p-Bkt_X-6v.js} +2 -2
- package/dist/components-csr/{p-Hm3X1iai.js → p-C3vB0Hd9.js} +2 -2
- package/dist/components-csr/{p-CrbzXk64.js → p-CF7mq5T7.js} +2 -2
- package/dist/components-csr/{p-DF19mmLl.js → p-CVMM-tdC.js} +2 -2
- package/dist/components-csr/{p-C4_7YnHT.js → p-DMQ-6aj8.js} +2 -2
- package/dist/components-csr/{p--TCJgZnE.js → p-DjKPc5EU.js} +2 -2
- package/dist/{components/p-Lsoo1B-2.js → components-csr/p-If0JHsYV.js} +2 -2
- package/dist/components-csr/p-If0JHsYV.js.map +1 -0
- package/dist/components-csr/{p-IWA0yIjJ.js → p-R_guULjT.js} +2 -2
- package/dist/components-csr/{p-uZbtHo-A.js → p-uSMrgqAy.js} +2 -2
- package/dist/esm/{a11y-C6CRqodW.js → a11y-BckJ95d7.js} +3 -3
- package/dist/esm/{a11y-C6CRqodW.js.map → a11y-BckJ95d7.js.map} +1 -1
- package/dist/esm/{bar-chart-ZZrajEkM.js → bar-chart-BuTyuCbt.js} +4 -4
- package/dist/esm/{bar-chart-ZZrajEkM.js.map → bar-chart-BuTyuCbt.js.map} +1 -1
- package/dist/esm/{chart-32olae06.js → chart-ByIhkqsG.js} +4 -4
- package/dist/esm/{chart-32olae06.js.map → chart-ByIhkqsG.js.map} +1 -1
- package/dist/esm/{hit-test-DHldf5Lm.js → hit-test-c_hI-yCX.js} +3 -3
- package/dist/esm/{hit-test-DHldf5Lm.js.map → hit-test-c_hI-yCX.js.map} +1 -1
- package/dist/esm/lazy-loading-indicator-BWFcjJiK.js +67 -0
- package/dist/esm/lazy-loading-indicator-BWFcjJiK.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/md-accordion-item.entry.js +3 -3
- package/dist/esm/md-app-bar.entry.js +1 -1
- package/dist/esm/md-area-chart.entry.js +6 -6
- package/dist/esm/md-autocomplete.entry.js +4 -3
- package/dist/esm/md-autocomplete.entry.js.map +1 -1
- package/dist/esm/md-avatar_2.entry.js +3 -3
- package/dist/esm/md-badge.entry.js +2 -2
- package/dist/esm/md-bar-chart.entry.js +6 -6
- package/dist/esm/md-bottom-sheet.entry.js +4 -4
- package/dist/esm/md-breadcrumb-item.entry.js +1 -1
- package/dist/esm/md-breadcrumbs.entry.js +2 -2
- package/dist/esm/md-button-group.entry.js +2 -2
- package/dist/esm/{md-button_7.entry.js → md-button_6.entry.js} +15 -39
- package/dist/esm/md-button_6.entry.js.map +1 -0
- package/dist/esm/md-checkbox.entry.js +2 -2
- package/dist/esm/md-chip.entry.js +2 -2
- package/dist/esm/md-date-picker.entry.js +1 -1
- package/dist/esm/md-dialog.entry.js +2 -2
- package/dist/esm/md-divider.entry.js +2 -2
- package/dist/esm/md-fab-menu-item.entry.js +2 -2
- package/dist/esm/md-fab-menu.entry.js +2 -2
- package/dist/esm/md-fab.entry.js +2 -2
- package/dist/esm/md-line-chart.entry.js +6 -6
- package/dist/esm/md-list-item.entry.js +4 -4
- package/dist/esm/md-list.entry.js +3 -3
- package/dist/esm/md-loading-indicator-Bf-Pt29l.js +31 -0
- package/dist/esm/md-loading-indicator-Bf-Pt29l.js.map +1 -0
- package/dist/esm/md-loading-indicator.entry.js +5 -0
- package/dist/esm/md-loading-indicator.entry.js.map +1 -0
- package/dist/esm/md-menu_2.entry.js +5 -5
- package/dist/esm/md-multi-select.entry.js +5 -4
- package/dist/esm/md-multi-select.entry.js.map +1 -1
- package/dist/esm/md-navigation-bar.entry.js +1 -1
- package/dist/esm/md-navigation-rail-tab.entry.js +1 -1
- package/dist/esm/md-navigation-tab.entry.js +3 -3
- package/dist/esm/md-number-field.entry.js +2 -2
- package/dist/esm/md-organization-chart.entry.js +2 -2
- package/dist/esm/md-otp-field.entry.js +3 -3
- package/dist/esm/md-pie-chart.entry.js +2 -2
- package/dist/esm/md-search.entry.js +7 -6
- package/dist/esm/md-search.entry.js.map +1 -1
- package/dist/esm/md-select-option.entry.js +1 -1
- package/dist/esm/md-select.entry.js +5 -4
- package/dist/esm/md-select.entry.js.map +1 -1
- package/dist/esm/md-slider.entry.js +2 -2
- package/dist/esm/md-sparkline.entry.js +6 -6
- package/dist/esm/md-status-dot.entry.js +1 -1
- package/dist/esm/md-table.entry.js +3 -3
- package/dist/esm/md-text-field.entry.js +7 -7
- package/dist/esm/md-time-picker.entry.js +1 -1
- package/dist/esm/md-transfer-list.entry.js +1 -1
- package/dist/esm/md3.js +1 -1
- package/dist/esm/{rtl-DvOKnoqK.js → rtl-CVFH1DkU.js} +3 -3
- package/dist/esm/{rtl-DvOKnoqK.js.map → rtl-CVFH1DkU.js.map} +1 -1
- package/dist/esm/{url-BjYKc1Ge.js → url-BdEoSBtL.js} +3 -3
- package/dist/esm/{url-BjYKc1Ge.js.map → url-BdEoSBtL.js.map} +1 -1
- package/dist/md3/md3.esm.js +1 -1
- package/dist/md3/p-08f1c469.entry.js +2 -0
- package/dist/md3/{p-7f53a423.entry.js.map → p-08f1c469.entry.js.map} +1 -1
- package/dist/md3/{p-7112374d.entry.js → p-108f89d7.entry.js} +2 -2
- package/dist/md3/{p-d7e99f9e.entry.js → p-1112bffc.entry.js} +2 -2
- package/dist/md3/{p-ef7b1826.entry.js → p-114c270b.entry.js} +2 -2
- package/dist/md3/{p-944e69e0.entry.js → p-1835fe36.entry.js} +2 -2
- package/dist/md3/{p-22633b2d.entry.js → p-2ba2db3b.entry.js} +2 -2
- package/dist/md3/{p-1d7e0203.entry.js → p-3f64a27d.entry.js} +2 -2
- package/dist/md3/{p-bed8dfec.entry.js → p-43c708ad.entry.js} +2 -2
- package/dist/md3/{p-ae360663.entry.js → p-4b7cf934.entry.js} +2 -2
- package/dist/md3/{p-27135a6b.entry.js → p-4f26bd60.entry.js} +2 -2
- package/dist/md3/{p-2befc42c.entry.js → p-56c7c570.entry.js} +2 -2
- package/dist/md3/{p-0a599351.entry.js → p-56ca0c3c.entry.js} +2 -2
- package/dist/md3/{p-96c06b24.entry.js → p-5b63149a.entry.js} +2 -2
- package/dist/md3/{p-4ba3623e.entry.js → p-5f668b0a.entry.js} +2 -2
- package/dist/md3/{p-9b9677cc.entry.js → p-6237ddac.entry.js} +2 -2
- package/dist/md3/{p-b243284b.entry.js → p-6d65fc6a.entry.js} +2 -2
- package/dist/md3/{p-8b1ea5dc.entry.js → p-707b6d7c.entry.js} +2 -2
- package/dist/md3/{p-a49df43d.entry.js → p-71f1660b.entry.js} +2 -2
- package/dist/md3/{p-7858833e.entry.js → p-7501170f.entry.js} +2 -2
- package/dist/md3/{p-6ea7117d.entry.js → p-7d1686a7.entry.js} +2 -2
- package/dist/md3/p-7e7f0e45.entry.js +2 -0
- package/dist/md3/p-7e7f0e45.entry.js.map +1 -0
- package/dist/md3/{p-4aed552f.entry.js → p-80379565.entry.js} +2 -2
- package/dist/md3/p-830724e4.entry.js +2 -0
- package/dist/md3/p-830724e4.entry.js.map +1 -0
- package/dist/md3/{p-e3c37222.entry.js → p-87f88d62.entry.js} +2 -2
- package/dist/md3/p-8a7e0297.entry.js +2 -0
- package/dist/md3/p-8a7e0297.entry.js.map +1 -0
- package/dist/md3/{p-8135c606.entry.js → p-8bdcda53.entry.js} +2 -2
- package/dist/md3/p-9003a7d4.entry.js +2 -0
- package/dist/md3/p-9003a7d4.entry.js.map +1 -0
- package/dist/md3/{p-6bf632c7.entry.js → p-90ccf4c3.entry.js} +2 -2
- package/dist/md3/{p-BjYKc1Ge.js → p-BdEoSBtL.js} +2 -2
- package/dist/md3/{p-BjYKc1Ge.js.map → p-BdEoSBtL.js.map} +1 -1
- package/dist/md3/{p-DzPKu-Ma.js → p-CGqeEMjY.js} +2 -2
- package/dist/md3/{p-DzPKu-Ma.js.map → p-CGqeEMjY.js.map} +1 -1
- package/dist/md3/{p-DvOKnoqK.js → p-CVFH1DkU.js} +2 -2
- package/dist/md3/{p-DvOKnoqK.js.map → p-CVFH1DkU.js.map} +1 -1
- package/dist/md3/p-Cch92tDM.js +2 -0
- package/dist/md3/{p-RLxbNqRv.js.map → p-Cch92tDM.js.map} +1 -1
- package/dist/md3/p-D17cVKxS.js +2 -0
- package/dist/md3/p-D17cVKxS.js.map +1 -0
- package/dist/md3/{p-Bx6--dQF.js → p-DGtztV3K.js} +2 -2
- package/dist/md3/{p-Bx6--dQF.js.map → p-DGtztV3K.js.map} +1 -1
- package/dist/md3/p-DnKDoE8K.js +2 -0
- package/dist/md3/p-DnKDoE8K.js.map +1 -0
- package/dist/md3/{p-5f39b49d.entry.js → p-ab568d1c.entry.js} +2 -2
- package/dist/md3/p-ae30e899.entry.js +2 -0
- package/dist/md3/p-ae30e899.entry.js.map +1 -0
- package/dist/md3/p-b54bbf88.entry.js +2 -0
- package/dist/md3/p-b54bbf88.entry.js.map +1 -0
- package/dist/md3/{p-21c89d1d.entry.js → p-ba011453.entry.js} +2 -2
- package/dist/md3/{p-cdcea99f.entry.js → p-c2944c87.entry.js} +2 -2
- package/dist/md3/{p-3a4bd4eb.entry.js → p-cc6e8afd.entry.js} +2 -2
- package/dist/md3/{p-c0476406.entry.js → p-d8885f53.entry.js} +2 -2
- package/dist/md3/{p-da0c36d9.entry.js → p-db6fb4e1.entry.js} +2 -2
- package/dist/md3/{p-5929e59c.entry.js → p-dcba2857.entry.js} +2 -2
- package/dist/md3/{p-925768ac.entry.js → p-e357e8ac.entry.js} +2 -2
- package/dist/md3/{p-e6b09e71.entry.js → p-e5c6795e.entry.js} +2 -2
- package/dist/md3/{p-1e85b8a8.entry.js → p-e871663b.entry.js} +2 -2
- package/dist/md3/p-f297d786.entry.js +2 -0
- package/dist/md3/{p-38f82d34.entry.js.map → p-f297d786.entry.js.map} +1 -1
- package/dist/md3/{p-b5586b66.entry.js → p-f5399b73.entry.js} +2 -2
- package/dist/md3/{p-5c35f916.entry.js → p-fd686966.entry.js} +2 -2
- package/dist/md3/{p-C_ogF68H.js → p-nhfFYWzy.js} +2 -2
- package/dist/md3/{p-C_ogF68H.js.map → p-nhfFYWzy.js.map} +1 -1
- package/dist/types/utils/lazy-loading-indicator.d.ts +7 -0
- package/hydrate/index.js +172 -106
- package/hydrate/index.mjs +172 -106
- package/package.json +18 -4
- package/dist/cjs/md-button_7.cjs.entry.js.map +0 -1
- package/dist/components/p-BADA63mI.js.map +0 -1
- package/dist/components/p-Lsoo1B-2.js.map +0 -1
- package/dist/components-csr/p--OUYjgKN.js.map +0 -1
- package/dist/components-csr/p-Bmu7RqHM.js.map +0 -1
- package/dist/esm/md-button_7.entry.js.map +0 -1
- package/dist/md3/p-2dda08b2.entry.js +0 -2
- package/dist/md3/p-2dda08b2.entry.js.map +0 -1
- package/dist/md3/p-38f82d34.entry.js +0 -2
- package/dist/md3/p-5db87a9d.entry.js +0 -2
- package/dist/md3/p-5db87a9d.entry.js.map +0 -1
- package/dist/md3/p-637baee1.entry.js +0 -2
- package/dist/md3/p-637baee1.entry.js.map +0 -1
- package/dist/md3/p-7f53a423.entry.js +0 -2
- package/dist/md3/p-RLxbNqRv.js +0 -2
- package/dist/md3/p-b7602557.entry.js +0 -2
- package/dist/md3/p-b7602557.entry.js.map +0 -1
- package/dist/md3/p-eddae19a.entry.js +0 -2
- package/dist/md3/p-eddae19a.entry.js.map +0 -1
- /package/dist/components/{p-Eb44PPZa.js.map → p-1RSrsLOs.js.map} +0 -0
- /package/dist/components/{p-D8oM1Kr3.js.map → p-2HV152w7.js.map} +0 -0
- /package/dist/components/{p-BA2v4IuG.js.map → p-6ZDAcEKN.js.map} +0 -0
- /package/dist/components/{p-CCMritCA.js.map → p-C77M30dm.js.map} +0 -0
- /package/dist/components/{p-CtVItLby.js.map → p-D5Ht729E.js.map} +0 -0
- /package/dist/components/{p-CTC8XAB6.js.map → p-De3E5Q8v.js.map} +0 -0
- /package/dist/components/{p-B-JfuA2g.js.map → p-Dm_7DA1f.js.map} +0 -0
- /package/dist/components/{p-DEzb9xsY.js.map → p-Dz3R-2Wn.js.map} +0 -0
- /package/dist/components/{p-B-iHDK5h.js.map → p-Zjf9uhOr.js.map} +0 -0
- /package/dist/components/{p-DfU4xY2F.js.map → p-ssLobpGS.js.map} +0 -0
- /package/dist/components/{p-DYL-8C5C.js.map → p-zMR3UIR_.js.map} +0 -0
- /package/dist/components-csr/{p-C0DlKmRg.js.map → p-BEmwDSzw.js.map} +0 -0
- /package/dist/components-csr/{p-DvXQXhgu.js.map → p-BQKzjYcY.js.map} +0 -0
- /package/dist/components-csr/{p-CG6FaRlt.js.map → p-BWMwewtY.js.map} +0 -0
- /package/dist/components-csr/{p-CSrxeWwL.js.map → p-Bkt_X-6v.js.map} +0 -0
- /package/dist/components-csr/{p-Hm3X1iai.js.map → p-C3vB0Hd9.js.map} +0 -0
- /package/dist/components-csr/{p-CrbzXk64.js.map → p-CF7mq5T7.js.map} +0 -0
- /package/dist/components-csr/{p-DF19mmLl.js.map → p-CVMM-tdC.js.map} +0 -0
- /package/dist/components-csr/{p-C4_7YnHT.js.map → p-DMQ-6aj8.js.map} +0 -0
- /package/dist/components-csr/{p--TCJgZnE.js.map → p-DjKPc5EU.js.map} +0 -0
- /package/dist/components-csr/{p-IWA0yIjJ.js.map → p-R_guULjT.js.map} +0 -0
- /package/dist/components-csr/{p-uZbtHo-A.js.map → p-uSMrgqAy.js.map} +0 -0
- /package/dist/md3/{p-7112374d.entry.js.map → p-108f89d7.entry.js.map} +0 -0
- /package/dist/md3/{p-d7e99f9e.entry.js.map → p-1112bffc.entry.js.map} +0 -0
- /package/dist/md3/{p-ef7b1826.entry.js.map → p-114c270b.entry.js.map} +0 -0
- /package/dist/md3/{p-944e69e0.entry.js.map → p-1835fe36.entry.js.map} +0 -0
- /package/dist/md3/{p-22633b2d.entry.js.map → p-2ba2db3b.entry.js.map} +0 -0
- /package/dist/md3/{p-1d7e0203.entry.js.map → p-3f64a27d.entry.js.map} +0 -0
- /package/dist/md3/{p-bed8dfec.entry.js.map → p-43c708ad.entry.js.map} +0 -0
- /package/dist/md3/{p-ae360663.entry.js.map → p-4b7cf934.entry.js.map} +0 -0
- /package/dist/md3/{p-27135a6b.entry.js.map → p-4f26bd60.entry.js.map} +0 -0
- /package/dist/md3/{p-2befc42c.entry.js.map → p-56c7c570.entry.js.map} +0 -0
- /package/dist/md3/{p-0a599351.entry.js.map → p-56ca0c3c.entry.js.map} +0 -0
- /package/dist/md3/{p-96c06b24.entry.js.map → p-5b63149a.entry.js.map} +0 -0
- /package/dist/md3/{p-4ba3623e.entry.js.map → p-5f668b0a.entry.js.map} +0 -0
- /package/dist/md3/{p-9b9677cc.entry.js.map → p-6237ddac.entry.js.map} +0 -0
- /package/dist/md3/{p-b243284b.entry.js.map → p-6d65fc6a.entry.js.map} +0 -0
- /package/dist/md3/{p-8b1ea5dc.entry.js.map → p-707b6d7c.entry.js.map} +0 -0
- /package/dist/md3/{p-a49df43d.entry.js.map → p-71f1660b.entry.js.map} +0 -0
- /package/dist/md3/{p-7858833e.entry.js.map → p-7501170f.entry.js.map} +0 -0
- /package/dist/md3/{p-6ea7117d.entry.js.map → p-7d1686a7.entry.js.map} +0 -0
- /package/dist/md3/{p-4aed552f.entry.js.map → p-80379565.entry.js.map} +0 -0
- /package/dist/md3/{p-e3c37222.entry.js.map → p-87f88d62.entry.js.map} +0 -0
- /package/dist/md3/{p-8135c606.entry.js.map → p-8bdcda53.entry.js.map} +0 -0
- /package/dist/md3/{p-6bf632c7.entry.js.map → p-90ccf4c3.entry.js.map} +0 -0
- /package/dist/md3/{p-5f39b49d.entry.js.map → p-ab568d1c.entry.js.map} +0 -0
- /package/dist/md3/{p-21c89d1d.entry.js.map → p-ba011453.entry.js.map} +0 -0
- /package/dist/md3/{p-cdcea99f.entry.js.map → p-c2944c87.entry.js.map} +0 -0
- /package/dist/md3/{p-3a4bd4eb.entry.js.map → p-cc6e8afd.entry.js.map} +0 -0
- /package/dist/md3/{p-c0476406.entry.js.map → p-d8885f53.entry.js.map} +0 -0
- /package/dist/md3/{p-da0c36d9.entry.js.map → p-db6fb4e1.entry.js.map} +0 -0
- /package/dist/md3/{p-5929e59c.entry.js.map → p-dcba2857.entry.js.map} +0 -0
- /package/dist/md3/{p-925768ac.entry.js.map → p-e357e8ac.entry.js.map} +0 -0
- /package/dist/md3/{p-e6b09e71.entry.js.map → p-e5c6795e.entry.js.map} +0 -0
- /package/dist/md3/{p-1e85b8a8.entry.js.map → p-e871663b.entry.js.map} +0 -0
- /package/dist/md3/{p-b5586b66.entry.js.map → p-f5399b73.entry.js.map} +0 -0
- /package/dist/md3/{p-5c35f916.entry.js.map → p-fd686966.entry.js.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{w as t,a as i,r as s,c as h,i as n,s as e,p as o,b as r,m as a,d as c,e as l,f,g as u,h as m}from"./p-CVFH1DkU.js";import{H as p,n as d,h as v,a as F,e as w,s as g,b as y,d as A,E as b}from"./p-CGqeEMjY.js";const M=()=>typeof performance!=="undefined"?performance.now():Date.now();const k=8;class x{constructor(e){this.container=e;this.ctx=null;this.spec=null;this.theme=null;this.scene=null;this.cb={};this.hoverRaf=0;this.lastHoverIndex=-2;this.hoverEnabled=true;this.hoverOpts={};this.hasRendered=false;this.introRaf=0;this.lastW=0;this.lastH=0;this.lastDpr=1;this.emphasisSeries=-1;this.emphasisT=0;this.emphasisTarget=0;this.emphasisRaf=0;this.focusLines=null;this.focus=new p;this.downAt=null;this.dragged=false;this.rtl=false;this.sceneLtr=null;this.dprWatch=t((()=>this.render()));this.dirWatch=i((()=>{if(n(this.container)!==this.rtl)this.render()}));this.handlePointerDown=t=>{this.downAt={x:t.clientX,y:t.clientY};this.dragged=false};this.handlePointerMove=t=>{if(this.downAt&&Math.hypot(t.clientX-this.downAt.x,t.clientY-this.downAt.y)>k){this.dragged=true}if(!this.scene||!this.hoverEnabled)return;const i=this.canvas.getBoundingClientRect();const h=t.clientX-i.left;const n=t.clientY-i.top;const e=!!this.scene.inverted;const o=d(this.scene.xPositions,e?n:h);if(this.hoverRaf)cancelAnimationFrame(this.hoverRaf);this.hoverRaf=requestAnimationFrame((()=>{this.hoverRaf=0;if(!this.scene||!this.spec||!this.theme)return;const t=this.scene.hoverPoints.length>1?this.nearestSeries(h,n):-1;s(this.hoverLayer,this.scene,o,this.spec.yFormatter,this.theme.fontFamily,{x:h,y:n},e?"horizontal":"vertical",t,{...this.hoverOpts,rtl:this.rtl});this.setFocus(t);if(o!==this.lastHoverIndex){this.lastHoverIndex=o;this.cb.onHover?.(o)}}))};this.handlePointerLeave=()=>{if(this.hoverRaf){cancelAnimationFrame(this.hoverRaf);this.hoverRaf=0}h(this.hoverLayer);this.focus.reset();this.setFocus(-1);if(this.lastHoverIndex!==-1){this.lastHoverIndex=-1;this.cb.onHover?.(-1)}};this.handleClick=t=>{const i=this.dragged;this.dragged=false;this.downAt=null;if(!this.scene)return;const s=this.canvas.getBoundingClientRect();const h=t.clientX-s.left;const n=t.clientY-s.top;const e=v(this.scene,h,n,this.seriesLines(this.scene));if(!e)return;const o=t;if(e.kind==="mark"){this.cb.onPointClick?.(e.seriesIndex,e.dataIndex,o);return}if(i)return;if(e.kind==="line")this.cb.onLineClick?.(e.seriesIndex,e.dataIndex,o);else if(e.kind==="area")this.cb.onAreaClick?.(e.seriesIndex,e.dataIndex,o);else this.cb.onAxisClick?.(e.dataIndex,F(this.scene,e.dataIndex),o)};this.onLegendToggle=t=>{if(this.spec){this.spec.series[t.seriesIndex].hidden=!this.spec.series[t.seriesIndex].hidden;this.hasRendered=false;this.render();this.cb.onLegendClick?.({...t,hidden:this.spec.series[t.seriesIndex].hidden})}else{this.cb.onLegendClick?.(t)}};if(getComputedStyle(e).position==="static")e.style.position="relative";this.canvas=document.createElement("canvas");this.canvas.style.cssText="position:absolute;inset:0;width:100%;height:100%;display:block";this.canvas.setAttribute("part","plot-canvas");this.overlay=document.createElement("div");this.overlay.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden";this.legendLayer=document.createElement("div");this.legendLayer.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:visible";this.glyphLayer=document.createElement("div");this.glyphLayer.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden";this.endLabelLayer=document.createElement("div");this.endLabelLayer.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden";this.hoverLayer=document.createElement("div");this.hoverLayer.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden";e.append(this.canvas,this.overlay,this.legendLayer,this.glyphLayer,this.endLabelLayer,this.hoverLayer);this.ctx=this.canvas.getContext("2d");this.canvas.addEventListener("pointerdown",this.handlePointerDown);this.canvas.addEventListener("pointermove",this.handlePointerMove);this.canvas.addEventListener("pointerleave",this.handlePointerLeave);this.canvas.addEventListener("click",this.handleClick)}getScene(){return this.scene}setHoverEnabled(t){this.hoverEnabled=t;if(!t)h(this.hoverLayer)}setTooltip(t){this.hoverOpts=t}setSpec(t,i,s={}){this.spec=t;this.theme=i;this.cb=s;cancelAnimationFrame(this.emphasisRaf);this.focus.reset();this.emphasisSeries=-1;this.emphasisT=0;this.emphasisTarget=0;this.render()}resize(){const t=this.container.getBoundingClientRect();if(Math.round(t.width)===this.lastW&&Math.round(t.height)===this.lastH)return;this.render()}toDataURL(t="image/png"){return typeof this.canvas.toDataURL==="function"?this.canvas.toDataURL(t):""}dispose(){if(this.hoverRaf)cancelAnimationFrame(this.hoverRaf);this.stopIntro();cancelAnimationFrame(this.emphasisRaf);this.canvas.removeEventListener("pointerdown",this.handlePointerDown);this.canvas.removeEventListener("pointermove",this.handlePointerMove);this.canvas.removeEventListener("pointerleave",this.handlePointerLeave);this.canvas.removeEventListener("click",this.handleClick);this.dprWatch.dispose();this.dirWatch.dispose();this.canvas.remove();this.overlay.remove();this.glyphLayer.remove();this.endLabelLayer.remove();this.hoverLayer.remove();this.spec=null;this.scene=null;this.sceneLtr=null}render(){if(!this.spec||!this.theme)return;this.dprWatch.update();const t=this.container.getBoundingClientRect();const i=Math.round(t.width);const s=Math.round(t.height);if(i<2||s<2)return;this.lastW=i;this.lastH=s;const h=Math.min(window.devicePixelRatio||1,4);this.lastDpr=h;this.canvas.width=i*h;this.canvas.height=s*h;this.rtl=n(this.container);const a=()=>{this.sceneLtr=m(this.spec,this.theme,i,s);return this.mirrored(this.sceneLtr)};this.scene=a();e(this.overlay,this.scene,this.theme.fontFamily,{onLegendClick:this.onLegendToggle},this.rtl,this.legendLayer);const c=this.overlay.querySelector('[part="legend"]');if(c&&this.spec.legend&&this.spec.legend!=="none"){const t=this.spec.legend==="left"||this.spec.legend==="right";const i=t?c.offsetWidth:c.offsetHeight;if(i>0&&Math.abs((this.spec.legendExtent??-1)-i)>2){this.spec.legendExtent=i;this.scene=a();e(this.overlay,this.scene,this.theme.fontFamily,{onLegendClick:this.onLegendToggle},this.rtl,this.legendLayer)}}const{variant:l,duration:f}=r(this.spec);const u=!this.hasRendered&&l!=="none"&&!o();const p=this.sceneLtr?this.sceneLtr.lines.length>0||this.sceneLtr.areas.length>0||this.sceneLtr.markers.length>0:false;if(u){this.hasRendered=p;this.playIntro(h,l,f);return}this.hasRendered=this.hasRendered||p;this.stopIntro();this.paintGeometry(w(this.scene,this.emphasisSeries,this.emphasisT),h)}clearIntroOpacity(){this.canvas.style.opacity="";this.glyphLayer.style.opacity=""}stopIntro(){cancelAnimationFrame(this.introRaf);this.introRaf=0;this.clearIntroOpacity()}mirrored(t){return this.rtl?a(t):t}paintGeometry(t,i){this.drawGeometry(t,i);c(this.glyphLayer,t.glyphs??[],this.theme?.fontFamily);l(this.endLabelLayer,t.endLabels??[],this.theme?.fontFamily)}paintEmphasis(){if(this.scene)this.drawGeometry(w(this.scene,this.emphasisSeries,this.emphasisT),this.lastDpr)}setFocus(t){const i=t>=0?1:0;const s=t>=0?t:this.emphasisSeries;if(i===this.emphasisTarget&&s===this.emphasisSeries)return;this.emphasisSeries=s;this.emphasisTarget=i;if(o()){cancelAnimationFrame(this.emphasisRaf);this.emphasisT=i;if(i===0)this.emphasisSeries=-1;this.paintEmphasis();return}cancelAnimationFrame(this.emphasisRaf);let h=0;const n=t=>{if(!h)h=t;const i=t-h;h=t;const s=this.emphasisTarget>this.emphasisT?1:-1;this.emphasisT+=s*(i/b);if(s>0&&this.emphasisT>=this.emphasisTarget||s<0&&this.emphasisT<=this.emphasisTarget){this.emphasisT=this.emphasisTarget;if(this.emphasisTarget===0)this.emphasisSeries=-1;this.paintEmphasis();return}this.paintEmphasis();this.emphasisRaf=requestAnimationFrame(n)};this.emphasisRaf=requestAnimationFrame(n)}replay(){this.hasRendered=false;this.render()}drawGeometry(t,i){if(!this.ctx)return;this.ctx.setTransform(i,0,0,i,0,0);f(this.ctx,t)}playIntro(t,i,s){const h=this.sceneLtr;if(!h)return;let n=s;if(i==="stagger"){const t=new Set(h.lines.map((t=>t.seriesIndex??0))).size||1;n=Math.min(s*t,5200)}this.stopIntro();const e=t=>{const i=t<1?String(t):"";this.canvas.style.opacity=i;this.glyphLayer.style.opacity=i};const o=u(i,h,0);e(o.alpha);this.drawGeometry(o.scene,t);let r=0;const a=s=>{if(!r)r=s;const o=(s-r)/n;if(o>=1){e(1);this.paintGeometry(this.mirrored(h),t);return}const{scene:c,alpha:l}=u(i,h,o);e(l);this.paintGeometry(this.mirrored(c),t);this.introRaf=requestAnimationFrame(a)};this.introRaf=requestAnimationFrame(a)}focusIndex(t){if(!this.scene||!this.spec||!this.theme)return;if(t<0){h(this.hoverLayer);this.focus.reset();this.setFocus(-1);return}const i=!!this.scene.inverted;const n=this.scene.hoverPoints.map((i=>i.byIndex[t])).find(Boolean);const e=this.scene.xPositions[t]??0;const o=n?{x:n.x,y:n.y}:{x:i?this.scene.plot.x:e,y:i?e:this.scene.plot.y};s(this.hoverLayer,this.scene,t,this.spec.yFormatter,this.theme.fontFamily,o,i?"horizontal":"vertical",-1,{...this.hoverOpts,rtl:this.rtl})}seriesLines(t){if(this.focusLines?.scene===t)return this.focusLines.points;const i=g(t);this.focusLines={scene:t,points:i};return i}nearestSeries(t,i){if(!this.scene)return-1;if(this.scene.areas.length>0&&this.hoverOpts.trigger!=="item"){this.focus.reset();return-1}const s=y(this.scene,t,i);if(s>=0){this.focus.reset();return s}const h=!!this.scene.inverted;const n=h?i:t;const e=h?t:i;const o=this.seriesLines(this.scene);const r=this.scene.hoverPoints.map(((t,i)=>({seriesIndex:t.seriesIndex,distance:A(o[i],n,e)})));return this.focus.pick(r,M())}}export{x as L};
|
|
2
|
+
//# sourceMappingURL=p-Cch92tDM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-RLxbNqRv.js","sources":["src/utils/charts/engine/chart.ts"],"sourcesContent":["/*\n * Chart engine — LineChartEngine\n * ===========================================================\n * The instance that replaces the ECharts object. Owns a plot\n * <canvas> + a DOM overlay layer inside the host's canvas box,\n * and runs the render pipeline: spec + theme + size →\n * computeLayout → draw geometry + sync the text/legend overlay. Exposes\n * setSpec / resize / dispose and a legend-toggle + hover callback,\n * mirroring the surface md-line-chart needs.\n * ===========================================================\n */\n\nimport { computeLayout, type EngineTheme, type LineChartSpec } from './layout';\nimport { drawSceneCanvas } from './renderer-canvas';\nimport { syncOverlay, renderGlyphs, renderEndLabels } from './overlay';\nimport { clearHover, renderHover, type HoverOptions } from './hover';\nimport { watchDevicePixelRatio, type DprWatcher } from './dpr';\nimport { resolveIntro, stepAnimation, prefersReducedMotion } from './animate';\n\n/** Monotonic ms, for the hover-focus dwell. */\nconst now = (): number => (typeof performance !== 'undefined' ? performance.now() : Date.now());\nimport { distanceToLine, emphasizeScene, HoverFocus, EMPHASIS_MS } from './emphasis';\nimport { axisSeriesValues, hitTestScene, nearestIndex, seriesSampleLines, type AxisSeriesValue, areaSeriesAt } from './hit-test';\nimport { isRtl, mirrorScene, watchDirection, type DirectionWatcher } from './rtl';\nimport type { MdChartAnimation } from '../types';\nimport type { LegendItem, RenderScene } from './scene';\n\nexport interface EngineCallbacks {\n onLegendClick?: (item: LegendItem) => void;\n /** Fires with the nearest category index as the pointer moves (or -1 on leave). */\n onHover?: (dataIndex: number) => void;\n /** Fires when a data point is clicked (nearest series + index). */\n onPointClick?: (seriesIndex: number, dataIndex: number, e: PointerEvent) => void;\n /** Fires when a series' drawn LINE is clicked away from its data points. */\n onLineClick?: (seriesIndex: number, dataIndex: number, e: PointerEvent) => void;\n /** Fires when a series' filled AREA is clicked (not its line or its points). */\n onAreaClick?: (seriesIndex: number, dataIndex: number, e: PointerEvent) => void;\n /** Fires when the plot background is clicked: the nearest x index plus every\n * visible series' value there. */\n onAxisClick?: (dataIndex: number, values: AxisSeriesValue[], e: PointerEvent) => void;\n}\n\n/**\n * How far (px) the pointer may travel between press and release for the release\n * to still count as a click on the plot. Anything further is a gesture (the\n * drag-to-zoom band, a slider pan), and the background / line / area clicks stay\n * quiet. Matches the same threshold md-line-chart uses to tell a stray drag from\n * a click. A MARK click is exempt — that behaviour predates this and is public.\n */\nconst DRAG_SLOP = 8;\n\nexport class LineChartEngine {\n private canvas: HTMLCanvasElement;\n private overlay: HTMLDivElement;\n /** Legend lives here: same box, but NOT clipped, so a focus ring keeps its\n * outer pixels where the legend hugs the plot edge. */\n private legendLayer: HTMLDivElement;\n private glyphLayer: HTMLDivElement;\n private endLabelLayer: HTMLDivElement;\n private hoverLayer: HTMLDivElement;\n private ctx: CanvasRenderingContext2D | null = null;\n private spec: LineChartSpec | null = null;\n private theme: EngineTheme | null = null;\n private scene: RenderScene | null = null;\n private cb: EngineCallbacks = {};\n private hoverRaf = 0;\n private lastHoverIndex = -2;\n private hoverEnabled = true;\n private hoverOpts: HoverOptions = {};\n private hasRendered = false;\n private introRaf = 0;\n private lastW = 0;\n private lastH = 0;\n private lastDpr = 1;\n // Hover emphasis: the series kept vivid (persists through the fade-out so the\n // others un-dim gradually) + the animated dim factor (0 none → 1 full).\n private emphasisSeries = -1;\n private emphasisT = 0;\n private emphasisTarget = 0;\n private emphasisRaf = 0;\n /** Per-scene cache for {@link seriesLines}. */\n private focusLines: { scene: RenderScene; points: [number, number][][] } | null = null;\n /** Picks which series the hover emphasises, and keeps that choice steady. */\n private focus = new HoverFocus();\n /** Where the pointer went down, and whether it has since travelled far enough\n * to make the coming click the end of a drag rather than a click. */\n private downAt: { x: number; y: number } | null = null;\n private dragged = false;\n /** Host is laid out right-to-left — the finished scene is mirrored. */\n private rtl = false;\n /** The scene BEFORE mirroring, for the +x-sweeping intro animations. */\n private sceneLtr: RenderScene | null = null;\n private dprWatch: DprWatcher = watchDevicePixelRatio(() => this.render());\n /** Re-render when the page (or an ancestor) flips direction — but only if\n * THIS chart's own computed direction actually changed. */\n private dirWatch: DirectionWatcher = watchDirection(() => {\n if (isRtl(this.container) !== this.rtl) this.render();\n });\n\n constructor(private container: HTMLElement) {\n // Host provides a positioned box; layer the canvas + overlay in it.\n if (getComputedStyle(container).position === 'static') container.style.position = 'relative';\n\n this.canvas = document.createElement('canvas');\n this.canvas.style.cssText = 'position:absolute;inset:0;width:100%;height:100%;display:block';\n this.canvas.setAttribute('part', 'plot-canvas');\n\n this.overlay = document.createElement('div');\n this.overlay.style.cssText = 'position:absolute;inset:0;pointer-events:none;overflow:hidden';\n\n this.legendLayer = document.createElement('div');\n this.legendLayer.style.cssText = 'position:absolute;inset:0;pointer-events:none;overflow:visible';\n\n // Emoji / text markers get their own layer so they can rise / reveal / fade\n // with the data geometry each animation frame (the static overlay above is\n // only synced once per render).\n this.glyphLayer = document.createElement('div');\n this.glyphLayer.style.cssText = 'position:absolute;inset:0;pointer-events:none;overflow:hidden';\n\n // End-of-line series labels live in their own PERSISTENT layer (not cleared\n // each frame) so they can fade in/out on collision via a CSS transition.\n this.endLabelLayer = document.createElement('div');\n this.endLabelLayer.style.cssText = 'position:absolute;inset:0;pointer-events:none;overflow:hidden';\n\n // Hover UI (crosshair + tooltip) sits above the static overlay so it\n // updates on pointermove without re-syncing the labels/legend.\n this.hoverLayer = document.createElement('div');\n this.hoverLayer.style.cssText = 'position:absolute;inset:0;pointer-events:none;overflow:hidden';\n\n container.append(this.canvas, this.overlay, this.legendLayer, this.glyphLayer, this.endLabelLayer, this.hoverLayer);\n\n this.ctx = this.canvas.getContext('2d');\n\n this.canvas.addEventListener('pointerdown', this.handlePointerDown);\n this.canvas.addEventListener('pointermove', this.handlePointerMove);\n this.canvas.addEventListener('pointerleave', this.handlePointerLeave);\n this.canvas.addEventListener('click', this.handleClick);\n }\n\n /** The current render scene — for diagnostics/tests. */\n getScene(): RenderScene | null {\n return this.scene;\n }\n\n /** Enable/disable the hover crosshair + tooltip (sparkline `show-tooltip`). */\n setHoverEnabled(enabled: boolean): void {\n this.hoverEnabled = enabled;\n if (!enabled) clearHover(this.hoverLayer);\n }\n\n /**\n * Install the tooltip extras: a developer's content renderer and/or the\n * formatter consulted for a series with no value at the hovered x. Presentation\n * only — it deliberately does NOT go through `setSpec`, so swapping the\n * renderer never re-runs layout.\n */\n setTooltip(opts: HoverOptions): void {\n this.hoverOpts = opts;\n }\n\n\n\n setSpec(spec: LineChartSpec, theme: EngineTheme, cb: EngineCallbacks = {}): void {\n this.spec = spec;\n this.theme = theme;\n this.cb = cb;\n // The series set may have changed — drop any stale hover focus.\n cancelAnimationFrame(this.emphasisRaf);\n this.focus.reset();\n this.emphasisSeries = -1;\n this.emphasisT = 0;\n this.emphasisTarget = 0;\n this.render();\n }\n\n resize(): void {\n // A ResizeObserver fires an initial callback right after observe() with the\n // same size the first render already used. Re-rendering there would draw the\n // static final geometry and cancel the just-scheduled intro animation (RO\n // delivery runs before rAF in the frame), so skip when size is unchanged.\n const rect = this.container.getBoundingClientRect();\n if (Math.round(rect.width) === this.lastW && Math.round(rect.height) === this.lastH) return;\n this.render();\n }\n\n /** Current frame as a data URL (for toDataURL export). */\n toDataURL(type = 'image/png'): string {\n // Guard for canvases that can't export (mock-doc / SSR): return '' rather\n // than throwing, so the host's toDataURL() degrades gracefully.\n return typeof this.canvas.toDataURL === 'function' ? this.canvas.toDataURL(type) : '';\n }\n\n dispose(): void {\n if (this.hoverRaf) cancelAnimationFrame(this.hoverRaf);\n // stopIntro rather than a bare cancel. Nothing depends on the clear here —\n // dispose() removes the canvas a few lines down — but routing EVERY cancel\n // of introRaf through stopIntro is what makes the invariant hold: the\n // inline opacity is only ever non-empty while the entrance loop is live.\n // The bug this fixes was one cancel site that forgot the clear.\n this.stopIntro();\n cancelAnimationFrame(this.emphasisRaf);\n this.canvas.removeEventListener('pointerdown', this.handlePointerDown);\n this.canvas.removeEventListener('pointermove', this.handlePointerMove);\n this.canvas.removeEventListener('pointerleave', this.handlePointerLeave);\n this.canvas.removeEventListener('click', this.handleClick);\n this.dprWatch.dispose();\n this.dirWatch.dispose();\n this.canvas.remove();\n this.overlay.remove();\n this.glyphLayer.remove();\n this.endLabelLayer.remove();\n this.hoverLayer.remove();\n this.spec = null;\n this.scene = null;\n this.sceneLtr = null;\n }\n\n private render(): void {\n if (!this.spec || !this.theme) return;\n this.dprWatch.update();\n const rect = this.container.getBoundingClientRect();\n const w = Math.round(rect.width);\n const h = Math.round(rect.height);\n if (w < 2 || h < 2) return; // not laid out yet — ResizeObserver retries\n this.lastW = w;\n this.lastH = h;\n\n // Cap the backing-store scale for perf; 4 keeps lines crisp through ~200%\n // browser zoom on a 2x display (the dpr watcher re-renders on zoom).\n const dpr = Math.min(window.devicePixelRatio || 1, 4);\n this.lastDpr = dpr;\n this.canvas.width = w * dpr;\n this.canvas.height = h * dpr;\n\n // Layout always runs left-to-right; an RTL host gets the finished frame\n // mirrored (see rtl.ts), so no part of the geometry pipeline needs to know.\n // The un-mirrored scene is kept because the intro animations sweep along +x\n // (`draw` reveals by a moving cutX) — they run in that space and each frame\n // is mirrored on its way to the canvas, so the reveal follows the reading\n // direction instead of running backwards.\n this.rtl = isRtl(this.container);\n const layout = (): RenderScene => {\n this.sceneLtr = computeLayout(this.spec!, this.theme!, w, h);\n return this.mirrored(this.sceneLtr);\n };\n\n this.scene = layout();\n // Chrome (axes, gridlines, labels, legend) is static — sync it once; only\n // the data geometry animates on the first render.\n syncOverlay(this.overlay, this.scene, this.theme.fontFamily, { onLegendClick: this.onLegendToggle }, this.rtl, this.legendLayer);\n // Two-pass legend: a wrapped legend's real extent isn't known until it's in\n // the DOM. Re-reserve the gutter to its measured height/width and re-lay-out\n // so a many-series legend never spills onto the plot.\n const legendEl = this.overlay.querySelector('[part=\"legend\"]') as HTMLElement | null;\n if (legendEl && this.spec.legend && this.spec.legend !== 'none') {\n const side = this.spec.legend === 'left' || this.spec.legend === 'right';\n const extent = side ? legendEl.offsetWidth : legendEl.offsetHeight;\n if (extent > 0 && Math.abs((this.spec.legendExtent ?? -1) - extent) > 2) {\n this.spec.legendExtent = extent;\n this.scene = layout();\n syncOverlay(this.overlay, this.scene, this.theme.fontFamily, { onLegendClick: this.onLegendToggle }, this.rtl, this.legendLayer);\n }\n }\n const { variant, duration } = resolveIntro(this.spec);\n const animate = !this.hasRendered && variant !== 'none' && !prefersReducedMotion();\n // An EMPTY scene is not a chart that has been shown: a host that hydrates\n // before its data lands renders once with no series, and treating that as\n // the first render spent the entrance on nothing — the real data then\n // arrived un-animated. The first render with geometry owns the entrance.\n const hasContent = this.sceneLtr\n ? this.sceneLtr.lines.length > 0 || this.sceneLtr.areas.length > 0 || this.sceneLtr.markers.length > 0\n : false;\n if (animate) {\n this.hasRendered = hasContent;\n this.playIntro(dpr, variant, duration);\n return;\n }\n this.hasRendered = this.hasRendered || hasContent;\n this.stopIntro();\n // Preserve any active hover emphasis across non-hover re-renders.\n this.paintGeometry(emphasizeScene(this.scene, this.emphasisSeries, this.emphasisT), dpr);\n }\n\n /**\n * Clear the inline opacity the entrance fades the layers in with.\n *\n * The entrance is the ONLY writer of it, and the loop's terminal frame the\n * only thing that clears it — so any path that ends the entrance early must\n * undo it here, or the chart is left drawn into a canvas pinned at\n * `opacity: 0` with nothing left to write style again.\n */\n private clearIntroOpacity(): void {\n this.canvas.style.opacity = '';\n this.glyphLayer.style.opacity = '';\n }\n\n /** End the entrance loop AND undo the fade it applied. Use this instead of a\n * bare `cancelAnimationFrame(this.introRaf)` outside the loop itself. */\n private stopIntro(): void {\n cancelAnimationFrame(this.introRaf);\n this.introRaf = 0;\n this.clearIntroOpacity();\n }\n\n /** A scene as it should reach the canvas: mirrored on an RTL host. */\n private mirrored(scene: RenderScene): RenderScene {\n return this.rtl ? mirrorScene(scene) : scene;\n }\n\n /** Draw the plot geometry (canvas) + the emoji/text markers (their own layer)\n * for a scene — both animate together frame to frame. */\n private paintGeometry(scene: RenderScene, dpr: number): void {\n this.drawGeometry(scene, dpr);\n renderGlyphs(this.glyphLayer, scene.glyphs ?? [], this.theme?.fontFamily);\n renderEndLabels(this.endLabelLayer, scene.endLabels ?? [], this.theme?.fontFamily);\n }\n\n /** Redraw the plot geometry at the current emphasis (hover-focus dimming).\n * Glyphs are unaffected by emphasis, so only the canvas is repainted. */\n private paintEmphasis(): void {\n if (this.scene) this.drawGeometry(emphasizeScene(this.scene, this.emphasisSeries, this.emphasisT), this.lastDpr);\n }\n\n /** Focus a series (dim the rest) with a short MD3 fade; -1 fades everything\n * back. The emphasised series is kept while fading OUT so the others un-dim\n * gradually instead of snapping. */\n private setFocus(idx: number): void {\n const target = idx >= 0 ? 1 : 0;\n const series = idx >= 0 ? idx : this.emphasisSeries; // keep the last series while fading out\n if (target === this.emphasisTarget && series === this.emphasisSeries) return;\n this.emphasisSeries = series;\n this.emphasisTarget = target;\n if (prefersReducedMotion()) {\n cancelAnimationFrame(this.emphasisRaf);\n this.emphasisT = target;\n if (target === 0) this.emphasisSeries = -1;\n this.paintEmphasis();\n return;\n }\n cancelAnimationFrame(this.emphasisRaf);\n let last = 0;\n const step = (now: number): void => {\n if (!last) last = now;\n const dt = now - last;\n last = now;\n const dir = this.emphasisTarget > this.emphasisT ? 1 : -1;\n this.emphasisT += dir * (dt / EMPHASIS_MS);\n if ((dir > 0 && this.emphasisT >= this.emphasisTarget) || (dir < 0 && this.emphasisT <= this.emphasisTarget)) {\n this.emphasisT = this.emphasisTarget;\n if (this.emphasisTarget === 0) this.emphasisSeries = -1; // fully restored → clear\n this.paintEmphasis();\n return;\n }\n this.paintEmphasis();\n this.emphasisRaf = requestAnimationFrame(step);\n };\n this.emphasisRaf = requestAnimationFrame(step);\n }\n\n /** Replay the entry animation from the start (uses the current spec's variant). */\n replay(): void {\n this.hasRendered = false;\n this.render();\n }\n\n private drawGeometry(scene: RenderScene, dpr: number): void {\n if (!this.ctx) return;\n this.ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawSceneCanvas(this.ctx, scene);\n }\n\n private playIntro(dpr: number, variant: MdChartAnimation, duration: number): void {\n // Animate in LTR space (the reveals sweep along +x) and mirror each frame.\n const target = this.sceneLtr;\n if (!target) return;\n // A staggered reveal draws each series in turn, so the whole timeline scales\n // with the series count (`duration` is the per-series draw time) — capped so\n // a many-series chart doesn't crawl.\n let dur = duration;\n if (variant === 'stagger') {\n const n = new Set(target.lines.map((l) => l.seriesIndex ?? 0)).size || 1;\n dur = Math.min(duration * n, 5200);\n }\n this.stopIntro();\n // Grow + fade share one layer opacity: `alpha` < 1 fades the canvas (and its\n // glyph overlay) in; an empty string restores the stylesheet default once the\n // entrance settles. draw/stagger report alpha 1, so their layer stays fully\n // opaque and only the geometry animates.\n const setOpacity = (a: number): void => {\n const v = a < 1 ? String(a) : '';\n this.canvas.style.opacity = v;\n this.glyphLayer.style.opacity = v;\n };\n // Draw t=0 NOW rather than waiting for the first frame. Setting the\n // canvas size above cleared it, so deferring the first draw leaves one\n // frame of blank canvas under a DOM overlay that has already painted its\n // labels — the chart appears to blink before it starts.\n const first = stepAnimation(variant, target, 0);\n setOpacity(first.alpha);\n this.drawGeometry(first.scene, dpr);\n let start = 0;\n const frame = (now: number): void => {\n if (!start) start = now;\n const tRaw = (now - start) / dur;\n if (tRaw >= 1) {\n setOpacity(1);\n this.paintGeometry(this.mirrored(target), dpr);\n return;\n }\n const { scene, alpha } = stepAnimation(variant, target, tRaw);\n setOpacity(alpha);\n this.paintGeometry(this.mirrored(scene), dpr);\n this.introRaf = requestAnimationFrame(frame);\n };\n this.introRaf = requestAnimationFrame(frame);\n }\n\n private handlePointerDown = (e: PointerEvent): void => {\n this.downAt = { x: e.clientX, y: e.clientY };\n this.dragged = false;\n };\n\n /**\n * Show the hover UI at a data index without a pointer — the keyboard path.\n *\n * A sighted keyboard user has to see the same crosshair and tooltip a mouse\n * user gets, so this reuses the pointer's own rendering rather than a second\n * presentation. The cursor is taken from the point itself, which is what the\n * tooltip positions against. `-1` clears.\n */\n focusIndex(index: number): void {\n if (!this.scene || !this.spec || !this.theme) return;\n if (index < 0) {\n clearHover(this.hoverLayer);\n this.focus.reset();\n this.setFocus(-1);\n return;\n }\n const inverted = !!this.scene.inverted;\n // Anchor on the topmost series that actually has a point here.\n const pt = this.scene.hoverPoints.map((hp) => hp.byIndex[index]).find(Boolean);\n const pos = this.scene.xPositions[index] ?? 0;\n const cursor = pt ? { x: pt.x, y: pt.y } : { x: inverted ? this.scene.plot.x : pos, y: inverted ? pos : this.scene.plot.y };\n renderHover(\n this.hoverLayer,\n this.scene,\n index,\n this.spec.yFormatter,\n this.theme.fontFamily,\n cursor,\n inverted ? 'horizontal' : 'vertical',\n -1,\n { ...this.hoverOpts, rtl: this.rtl },\n );\n }\n\n private handlePointerMove = (e: PointerEvent): void => {\n // Before the hover guard: a drag has to be recognised even with the hover UI\n // switched off (sparklines), and while the zoom band is being dragged.\n if (this.downAt && Math.hypot(e.clientX - this.downAt.x, e.clientY - this.downAt.y) > DRAG_SLOP) {\n this.dragged = true;\n }\n if (!this.scene || !this.hoverEnabled) return;\n const rect = this.canvas.getBoundingClientRect();\n const px = e.clientX - rect.left;\n const py = e.clientY - rect.top;\n // For an inverted chart the main axis is vertical, so hit-test along y.\n const inverted = !!this.scene.inverted;\n const idx = nearestIndex(this.scene.xPositions, inverted ? py : px);\n if (this.hoverRaf) cancelAnimationFrame(this.hoverRaf);\n this.hoverRaf = requestAnimationFrame(() => {\n this.hoverRaf = 0;\n if (!this.scene || !this.spec || !this.theme) return;\n // Emphasise the series nearest the cursor and fade the others (only worth\n // it with more than one series); the hover highlights fade to match.\n const focus = this.scene.hoverPoints.length > 1 ? this.nearestSeries(px, py) : -1;\n renderHover(this.hoverLayer, this.scene, idx, this.spec.yFormatter, this.theme.fontFamily, { x: px, y: py }, inverted ? 'horizontal' : 'vertical', focus, { ...this.hoverOpts, rtl: this.rtl });\n this.setFocus(focus);\n if (idx !== this.lastHoverIndex) {\n this.lastHoverIndex = idx;\n this.cb.onHover?.(idx);\n }\n });\n };\n\n /**\n * Each visible series' samples as `[main, value]` pixel pairs ordered along\n * the main axis, for the hover-focus distance test. Built once per scene and\n * only when a multi-series chart is actually hovered, so the single-series\n * and never-hovered cases cost nothing. (Integer-keyed records enumerate in\n * ascending numeric order, so `byIndex` is already in main-axis order.)\n */\n private seriesLines(scene: RenderScene): [number, number][][] {\n if (this.focusLines?.scene === scene) return this.focusLines.points;\n const points = seriesSampleLines(scene);\n this.focusLines = { scene, points };\n return points;\n }\n\n /**\n * Series whose drawn line is nearest the cursor, or -1.\n *\n * Distance is to the LINE, not to the sample at the hovered index: series\n * measured at different x (irregular data) mostly have no sample there, and\n * comparing exact samples handed the emphasis to whichever series owned that\n * slot — so it strobed as the pointer moved. The currently emphasised series\n * then holds on unless a rival is clearly nearer ({@link pickFocusSeries}),\n * which is what settles lines running close together.\n */\n private nearestSeries(px: number, py: number): number {\n if (!this.scene) return -1;\n // Emphasis exists to pick one LINE out of several running close together.\n // On a FILLED chart it does something else entirely: it recolours large\n // areas, and with an axis-triggered tooltip — which already lists every\n // series — singling one band out contradicts the card and washes the figure\n // out. So a filled chart on axis trigger emphasises nothing; the crosshair\n // and the card carry the reading. Item trigger is the opposite case: the\n // card names exactly ONE series, and without the highlight there would be\n // nothing to say which band it meant, so there the emphasis is essential.\n if (this.scene.areas.length > 0 && this.hoverOpts.trigger !== 'item') {\n this.focus.reset();\n return -1;\n }\n // The cursor is inside a band, and that band owns it. Distance-to-line is\n // the wrong test there: on a thick stacked band the nearest line is usually\n // the NEIGHBOURING series' edge, so the tooltip named a series the pointer\n // was never over.\n const inArea = areaSeriesAt(this.scene, px, py);\n if (inArea >= 0) {\n // Containment doesn't strobe the way a distance tie does, so it is\n // adopted immediately — but the dwell state still has to follow, or the\n // next move outside the bands inherits a stale focus.\n this.focus.reset();\n return inArea;\n }\n const inverted = !!this.scene.inverted;\n const cursorMain = inverted ? py : px;\n const cursorValue = inverted ? px : py;\n const lines = this.seriesLines(this.scene);\n const candidates = this.scene.hoverPoints.map((hp, i) => ({\n seriesIndex: hp.seriesIndex,\n distance: distanceToLine(lines[i], cursorMain, cursorValue),\n }));\n return this.focus.pick(candidates, now());\n }\n\n private handlePointerLeave = (): void => {\n if (this.hoverRaf) {\n cancelAnimationFrame(this.hoverRaf);\n this.hoverRaf = 0;\n }\n clearHover(this.hoverLayer);\n this.focus.reset(); // next hover adopts a series immediately\n this.setFocus(-1); // restore all series to full emphasis\n if (this.lastHoverIndex !== -1) {\n this.lastHoverIndex = -1;\n this.cb.onHover?.(-1);\n }\n };\n\n /**\n * Resolve a click to the most specific thing under it — mark, then line, then\n * area, then the plot background — and fire that one callback only\n * ({@link hitTestScene} owns the geometry).\n */\n private handleClick = (e: MouseEvent): void => {\n const dragged = this.dragged;\n this.dragged = false;\n this.downAt = null;\n if (!this.scene) return;\n const rect = this.canvas.getBoundingClientRect();\n const px = e.clientX - rect.left;\n const py = e.clientY - rect.top;\n const hit = hitTestScene(this.scene, px, py, this.seriesLines(this.scene));\n if (!hit) return;\n const pe = e as PointerEvent;\n if (hit.kind === 'mark') {\n this.cb.onPointClick?.(hit.seriesIndex, hit.dataIndex, pe);\n return;\n }\n // The plot-wide clicks are the ones a stray drag would spam, so they take\n // the drag guard (a mark click never has — see DRAG_SLOP).\n if (dragged) return;\n if (hit.kind === 'line') this.cb.onLineClick?.(hit.seriesIndex, hit.dataIndex, pe);\n else if (hit.kind === 'area') this.cb.onAreaClick?.(hit.seriesIndex, hit.dataIndex, pe);\n else this.cb.onAxisClick?.(hit.dataIndex, axisSeriesValues(this.scene, hit.dataIndex), pe);\n };\n\n /** Toggle the series' visibility on legend click (ECharts-style built-in\n * behaviour) and forward the resulting state to the consumer. */\n private onLegendToggle = (item: LegendItem): void => {\n if (this.spec) {\n this.spec.series[item.seriesIndex].hidden = !this.spec.series[item.seriesIndex].hidden;\n // Re-play the entry motion so the chart animates into its new\n // configuration (respects the variant + reduced-motion / 'none').\n this.hasRendered = false;\n this.render();\n this.cb.onLegendClick?.({ ...item, hidden: this.spec.series[item.seriesIndex].hidden });\n } else {\n this.cb.onLegendClick?.(item);\n }\n };\n}\n"],"names":[],"mappings":";;;AAAA;;;;;;;;;;AAUG;AASH;AACA,MAAM,GAAG,GAAG,OAAe,OAAO,WAAW,KAAK,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAsB/F;;;;;;AAMG;AACH,MAAM,SAAS,GAAG,CAAC;MAEN,eAAe,CAAA;AAgD1B,IAAA,WAAA,CAAoB,SAAsB,EAAA;AAAtB,QAAA,IAAA,CAAA,SAAS,GAAT,SAAS;AAvCrB,QAAA,IAAA,CAAA,GAA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WAAW,EAAE,EAAE,CAAC,WAAW;YAC3B,QAAQ,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,WAAW,CAAC;AAC5D,SAAA,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC;;AA2D5C;;;;"}
|
|
1
|
+
{"version":3,"file":"p-Cch92tDM.js","sources":["src/utils/charts/engine/chart.ts"],"sourcesContent":["/*\n * Chart engine — LineChartEngine\n * ===========================================================\n * The instance that replaces the ECharts object. Owns a plot\n * <canvas> + a DOM overlay layer inside the host's canvas box,\n * and runs the render pipeline: spec + theme + size →\n * computeLayout → draw geometry + sync the text/legend overlay. Exposes\n * setSpec / resize / dispose and a legend-toggle + hover callback,\n * mirroring the surface md-line-chart needs.\n * ===========================================================\n */\n\nimport { computeLayout, type EngineTheme, type LineChartSpec } from './layout';\nimport { drawSceneCanvas } from './renderer-canvas';\nimport { syncOverlay, renderGlyphs, renderEndLabels } from './overlay';\nimport { clearHover, renderHover, type HoverOptions } from './hover';\nimport { watchDevicePixelRatio, type DprWatcher } from './dpr';\nimport { resolveIntro, stepAnimation, prefersReducedMotion } from './animate';\n\n/** Monotonic ms, for the hover-focus dwell. */\nconst now = (): number => (typeof performance !== 'undefined' ? performance.now() : Date.now());\nimport { distanceToLine, emphasizeScene, HoverFocus, EMPHASIS_MS } from './emphasis';\nimport { axisSeriesValues, hitTestScene, nearestIndex, seriesSampleLines, type AxisSeriesValue, areaSeriesAt } from './hit-test';\nimport { isRtl, mirrorScene, watchDirection, type DirectionWatcher } from './rtl';\nimport type { MdChartAnimation } from '../types';\nimport type { LegendItem, RenderScene } from './scene';\n\nexport interface EngineCallbacks {\n onLegendClick?: (item: LegendItem) => void;\n /** Fires with the nearest category index as the pointer moves (or -1 on leave). */\n onHover?: (dataIndex: number) => void;\n /** Fires when a data point is clicked (nearest series + index). */\n onPointClick?: (seriesIndex: number, dataIndex: number, e: PointerEvent) => void;\n /** Fires when a series' drawn LINE is clicked away from its data points. */\n onLineClick?: (seriesIndex: number, dataIndex: number, e: PointerEvent) => void;\n /** Fires when a series' filled AREA is clicked (not its line or its points). */\n onAreaClick?: (seriesIndex: number, dataIndex: number, e: PointerEvent) => void;\n /** Fires when the plot background is clicked: the nearest x index plus every\n * visible series' value there. */\n onAxisClick?: (dataIndex: number, values: AxisSeriesValue[], e: PointerEvent) => void;\n}\n\n/**\n * How far (px) the pointer may travel between press and release for the release\n * to still count as a click on the plot. Anything further is a gesture (the\n * drag-to-zoom band, a slider pan), and the background / line / area clicks stay\n * quiet. Matches the same threshold md-line-chart uses to tell a stray drag from\n * a click. A MARK click is exempt — that behaviour predates this and is public.\n */\nconst DRAG_SLOP = 8;\n\nexport class LineChartEngine {\n private canvas: HTMLCanvasElement;\n private overlay: HTMLDivElement;\n /** Legend lives here: same box, but NOT clipped, so a focus ring keeps its\n * outer pixels where the legend hugs the plot edge. */\n private legendLayer: HTMLDivElement;\n private glyphLayer: HTMLDivElement;\n private endLabelLayer: HTMLDivElement;\n private hoverLayer: HTMLDivElement;\n private ctx: CanvasRenderingContext2D | null = null;\n private spec: LineChartSpec | null = null;\n private theme: EngineTheme | null = null;\n private scene: RenderScene | null = null;\n private cb: EngineCallbacks = {};\n private hoverRaf = 0;\n private lastHoverIndex = -2;\n private hoverEnabled = true;\n private hoverOpts: HoverOptions = {};\n private hasRendered = false;\n private introRaf = 0;\n private lastW = 0;\n private lastH = 0;\n private lastDpr = 1;\n // Hover emphasis: the series kept vivid (persists through the fade-out so the\n // others un-dim gradually) + the animated dim factor (0 none → 1 full).\n private emphasisSeries = -1;\n private emphasisT = 0;\n private emphasisTarget = 0;\n private emphasisRaf = 0;\n /** Per-scene cache for {@link seriesLines}. */\n private focusLines: { scene: RenderScene; points: [number, number][][] } | null = null;\n /** Picks which series the hover emphasises, and keeps that choice steady. */\n private focus = new HoverFocus();\n /** Where the pointer went down, and whether it has since travelled far enough\n * to make the coming click the end of a drag rather than a click. */\n private downAt: { x: number; y: number } | null = null;\n private dragged = false;\n /** Host is laid out right-to-left — the finished scene is mirrored. */\n private rtl = false;\n /** The scene BEFORE mirroring, for the +x-sweeping intro animations. */\n private sceneLtr: RenderScene | null = null;\n private dprWatch: DprWatcher = watchDevicePixelRatio(() => this.render());\n /** Re-render when the page (or an ancestor) flips direction — but only if\n * THIS chart's own computed direction actually changed. */\n private dirWatch: DirectionWatcher = watchDirection(() => {\n if (isRtl(this.container) !== this.rtl) this.render();\n });\n\n constructor(private container: HTMLElement) {\n // Host provides a positioned box; layer the canvas + overlay in it.\n if (getComputedStyle(container).position === 'static') container.style.position = 'relative';\n\n this.canvas = document.createElement('canvas');\n this.canvas.style.cssText = 'position:absolute;inset:0;width:100%;height:100%;display:block';\n this.canvas.setAttribute('part', 'plot-canvas');\n\n this.overlay = document.createElement('div');\n this.overlay.style.cssText = 'position:absolute;inset:0;pointer-events:none;overflow:hidden';\n\n this.legendLayer = document.createElement('div');\n this.legendLayer.style.cssText = 'position:absolute;inset:0;pointer-events:none;overflow:visible';\n\n // Emoji / text markers get their own layer so they can rise / reveal / fade\n // with the data geometry each animation frame (the static overlay above is\n // only synced once per render).\n this.glyphLayer = document.createElement('div');\n this.glyphLayer.style.cssText = 'position:absolute;inset:0;pointer-events:none;overflow:hidden';\n\n // End-of-line series labels live in their own PERSISTENT layer (not cleared\n // each frame) so they can fade in/out on collision via a CSS transition.\n this.endLabelLayer = document.createElement('div');\n this.endLabelLayer.style.cssText = 'position:absolute;inset:0;pointer-events:none;overflow:hidden';\n\n // Hover UI (crosshair + tooltip) sits above the static overlay so it\n // updates on pointermove without re-syncing the labels/legend.\n this.hoverLayer = document.createElement('div');\n this.hoverLayer.style.cssText = 'position:absolute;inset:0;pointer-events:none;overflow:hidden';\n\n container.append(this.canvas, this.overlay, this.legendLayer, this.glyphLayer, this.endLabelLayer, this.hoverLayer);\n\n this.ctx = this.canvas.getContext('2d');\n\n this.canvas.addEventListener('pointerdown', this.handlePointerDown);\n this.canvas.addEventListener('pointermove', this.handlePointerMove);\n this.canvas.addEventListener('pointerleave', this.handlePointerLeave);\n this.canvas.addEventListener('click', this.handleClick);\n }\n\n /** The current render scene — for diagnostics/tests. */\n getScene(): RenderScene | null {\n return this.scene;\n }\n\n /** Enable/disable the hover crosshair + tooltip (sparkline `show-tooltip`). */\n setHoverEnabled(enabled: boolean): void {\n this.hoverEnabled = enabled;\n if (!enabled) clearHover(this.hoverLayer);\n }\n\n /**\n * Install the tooltip extras: a developer's content renderer and/or the\n * formatter consulted for a series with no value at the hovered x. Presentation\n * only — it deliberately does NOT go through `setSpec`, so swapping the\n * renderer never re-runs layout.\n */\n setTooltip(opts: HoverOptions): void {\n this.hoverOpts = opts;\n }\n\n\n\n setSpec(spec: LineChartSpec, theme: EngineTheme, cb: EngineCallbacks = {}): void {\n this.spec = spec;\n this.theme = theme;\n this.cb = cb;\n // The series set may have changed — drop any stale hover focus.\n cancelAnimationFrame(this.emphasisRaf);\n this.focus.reset();\n this.emphasisSeries = -1;\n this.emphasisT = 0;\n this.emphasisTarget = 0;\n this.render();\n }\n\n resize(): void {\n // A ResizeObserver fires an initial callback right after observe() with the\n // same size the first render already used. Re-rendering there would draw the\n // static final geometry and cancel the just-scheduled intro animation (RO\n // delivery runs before rAF in the frame), so skip when size is unchanged.\n const rect = this.container.getBoundingClientRect();\n if (Math.round(rect.width) === this.lastW && Math.round(rect.height) === this.lastH) return;\n this.render();\n }\n\n /** Current frame as a data URL (for toDataURL export). */\n toDataURL(type = 'image/png'): string {\n // Guard for canvases that can't export (mock-doc / SSR): return '' rather\n // than throwing, so the host's toDataURL() degrades gracefully.\n return typeof this.canvas.toDataURL === 'function' ? this.canvas.toDataURL(type) : '';\n }\n\n dispose(): void {\n if (this.hoverRaf) cancelAnimationFrame(this.hoverRaf);\n // stopIntro rather than a bare cancel. Nothing depends on the clear here —\n // dispose() removes the canvas a few lines down — but routing EVERY cancel\n // of introRaf through stopIntro is what makes the invariant hold: the\n // inline opacity is only ever non-empty while the entrance loop is live.\n // The bug this fixes was one cancel site that forgot the clear.\n this.stopIntro();\n cancelAnimationFrame(this.emphasisRaf);\n this.canvas.removeEventListener('pointerdown', this.handlePointerDown);\n this.canvas.removeEventListener('pointermove', this.handlePointerMove);\n this.canvas.removeEventListener('pointerleave', this.handlePointerLeave);\n this.canvas.removeEventListener('click', this.handleClick);\n this.dprWatch.dispose();\n this.dirWatch.dispose();\n this.canvas.remove();\n this.overlay.remove();\n this.glyphLayer.remove();\n this.endLabelLayer.remove();\n this.hoverLayer.remove();\n this.spec = null;\n this.scene = null;\n this.sceneLtr = null;\n }\n\n private render(): void {\n if (!this.spec || !this.theme) return;\n this.dprWatch.update();\n const rect = this.container.getBoundingClientRect();\n const w = Math.round(rect.width);\n const h = Math.round(rect.height);\n if (w < 2 || h < 2) return; // not laid out yet — ResizeObserver retries\n this.lastW = w;\n this.lastH = h;\n\n // Cap the backing-store scale for perf; 4 keeps lines crisp through ~200%\n // browser zoom on a 2x display (the dpr watcher re-renders on zoom).\n const dpr = Math.min(window.devicePixelRatio || 1, 4);\n this.lastDpr = dpr;\n this.canvas.width = w * dpr;\n this.canvas.height = h * dpr;\n\n // Layout always runs left-to-right; an RTL host gets the finished frame\n // mirrored (see rtl.ts), so no part of the geometry pipeline needs to know.\n // The un-mirrored scene is kept because the intro animations sweep along +x\n // (`draw` reveals by a moving cutX) — they run in that space and each frame\n // is mirrored on its way to the canvas, so the reveal follows the reading\n // direction instead of running backwards.\n this.rtl = isRtl(this.container);\n const layout = (): RenderScene => {\n this.sceneLtr = computeLayout(this.spec!, this.theme!, w, h);\n return this.mirrored(this.sceneLtr);\n };\n\n this.scene = layout();\n // Chrome (axes, gridlines, labels, legend) is static — sync it once; only\n // the data geometry animates on the first render.\n syncOverlay(this.overlay, this.scene, this.theme.fontFamily, { onLegendClick: this.onLegendToggle }, this.rtl, this.legendLayer);\n // Two-pass legend: a wrapped legend's real extent isn't known until it's in\n // the DOM. Re-reserve the gutter to its measured height/width and re-lay-out\n // so a many-series legend never spills onto the plot.\n const legendEl = this.overlay.querySelector('[part=\"legend\"]') as HTMLElement | null;\n if (legendEl && this.spec.legend && this.spec.legend !== 'none') {\n const side = this.spec.legend === 'left' || this.spec.legend === 'right';\n const extent = side ? legendEl.offsetWidth : legendEl.offsetHeight;\n if (extent > 0 && Math.abs((this.spec.legendExtent ?? -1) - extent) > 2) {\n this.spec.legendExtent = extent;\n this.scene = layout();\n syncOverlay(this.overlay, this.scene, this.theme.fontFamily, { onLegendClick: this.onLegendToggle }, this.rtl, this.legendLayer);\n }\n }\n const { variant, duration } = resolveIntro(this.spec);\n const animate = !this.hasRendered && variant !== 'none' && !prefersReducedMotion();\n // An EMPTY scene is not a chart that has been shown: a host that hydrates\n // before its data lands renders once with no series, and treating that as\n // the first render spent the entrance on nothing — the real data then\n // arrived un-animated. The first render with geometry owns the entrance.\n const hasContent = this.sceneLtr\n ? this.sceneLtr.lines.length > 0 || this.sceneLtr.areas.length > 0 || this.sceneLtr.markers.length > 0\n : false;\n if (animate) {\n this.hasRendered = hasContent;\n this.playIntro(dpr, variant, duration);\n return;\n }\n this.hasRendered = this.hasRendered || hasContent;\n this.stopIntro();\n // Preserve any active hover emphasis across non-hover re-renders.\n this.paintGeometry(emphasizeScene(this.scene, this.emphasisSeries, this.emphasisT), dpr);\n }\n\n /**\n * Clear the inline opacity the entrance fades the layers in with.\n *\n * The entrance is the ONLY writer of it, and the loop's terminal frame the\n * only thing that clears it — so any path that ends the entrance early must\n * undo it here, or the chart is left drawn into a canvas pinned at\n * `opacity: 0` with nothing left to write style again.\n */\n private clearIntroOpacity(): void {\n this.canvas.style.opacity = '';\n this.glyphLayer.style.opacity = '';\n }\n\n /** End the entrance loop AND undo the fade it applied. Use this instead of a\n * bare `cancelAnimationFrame(this.introRaf)` outside the loop itself. */\n private stopIntro(): void {\n cancelAnimationFrame(this.introRaf);\n this.introRaf = 0;\n this.clearIntroOpacity();\n }\n\n /** A scene as it should reach the canvas: mirrored on an RTL host. */\n private mirrored(scene: RenderScene): RenderScene {\n return this.rtl ? mirrorScene(scene) : scene;\n }\n\n /** Draw the plot geometry (canvas) + the emoji/text markers (their own layer)\n * for a scene — both animate together frame to frame. */\n private paintGeometry(scene: RenderScene, dpr: number): void {\n this.drawGeometry(scene, dpr);\n renderGlyphs(this.glyphLayer, scene.glyphs ?? [], this.theme?.fontFamily);\n renderEndLabels(this.endLabelLayer, scene.endLabels ?? [], this.theme?.fontFamily);\n }\n\n /** Redraw the plot geometry at the current emphasis (hover-focus dimming).\n * Glyphs are unaffected by emphasis, so only the canvas is repainted. */\n private paintEmphasis(): void {\n if (this.scene) this.drawGeometry(emphasizeScene(this.scene, this.emphasisSeries, this.emphasisT), this.lastDpr);\n }\n\n /** Focus a series (dim the rest) with a short MD3 fade; -1 fades everything\n * back. The emphasised series is kept while fading OUT so the others un-dim\n * gradually instead of snapping. */\n private setFocus(idx: number): void {\n const target = idx >= 0 ? 1 : 0;\n const series = idx >= 0 ? idx : this.emphasisSeries; // keep the last series while fading out\n if (target === this.emphasisTarget && series === this.emphasisSeries) return;\n this.emphasisSeries = series;\n this.emphasisTarget = target;\n if (prefersReducedMotion()) {\n cancelAnimationFrame(this.emphasisRaf);\n this.emphasisT = target;\n if (target === 0) this.emphasisSeries = -1;\n this.paintEmphasis();\n return;\n }\n cancelAnimationFrame(this.emphasisRaf);\n let last = 0;\n const step = (now: number): void => {\n if (!last) last = now;\n const dt = now - last;\n last = now;\n const dir = this.emphasisTarget > this.emphasisT ? 1 : -1;\n this.emphasisT += dir * (dt / EMPHASIS_MS);\n if ((dir > 0 && this.emphasisT >= this.emphasisTarget) || (dir < 0 && this.emphasisT <= this.emphasisTarget)) {\n this.emphasisT = this.emphasisTarget;\n if (this.emphasisTarget === 0) this.emphasisSeries = -1; // fully restored → clear\n this.paintEmphasis();\n return;\n }\n this.paintEmphasis();\n this.emphasisRaf = requestAnimationFrame(step);\n };\n this.emphasisRaf = requestAnimationFrame(step);\n }\n\n /** Replay the entry animation from the start (uses the current spec's variant). */\n replay(): void {\n this.hasRendered = false;\n this.render();\n }\n\n private drawGeometry(scene: RenderScene, dpr: number): void {\n if (!this.ctx) return;\n this.ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawSceneCanvas(this.ctx, scene);\n }\n\n private playIntro(dpr: number, variant: MdChartAnimation, duration: number): void {\n // Animate in LTR space (the reveals sweep along +x) and mirror each frame.\n const target = this.sceneLtr;\n if (!target) return;\n // A staggered reveal draws each series in turn, so the whole timeline scales\n // with the series count (`duration` is the per-series draw time) — capped so\n // a many-series chart doesn't crawl.\n let dur = duration;\n if (variant === 'stagger') {\n const n = new Set(target.lines.map((l) => l.seriesIndex ?? 0)).size || 1;\n dur = Math.min(duration * n, 5200);\n }\n this.stopIntro();\n // Grow + fade share one layer opacity: `alpha` < 1 fades the canvas (and its\n // glyph overlay) in; an empty string restores the stylesheet default once the\n // entrance settles. draw/stagger report alpha 1, so their layer stays fully\n // opaque and only the geometry animates.\n const setOpacity = (a: number): void => {\n const v = a < 1 ? String(a) : '';\n this.canvas.style.opacity = v;\n this.glyphLayer.style.opacity = v;\n };\n // Draw t=0 NOW rather than waiting for the first frame. Setting the\n // canvas size above cleared it, so deferring the first draw leaves one\n // frame of blank canvas under a DOM overlay that has already painted its\n // labels — the chart appears to blink before it starts.\n const first = stepAnimation(variant, target, 0);\n setOpacity(first.alpha);\n this.drawGeometry(first.scene, dpr);\n let start = 0;\n const frame = (now: number): void => {\n if (!start) start = now;\n const tRaw = (now - start) / dur;\n if (tRaw >= 1) {\n setOpacity(1);\n this.paintGeometry(this.mirrored(target), dpr);\n return;\n }\n const { scene, alpha } = stepAnimation(variant, target, tRaw);\n setOpacity(alpha);\n this.paintGeometry(this.mirrored(scene), dpr);\n this.introRaf = requestAnimationFrame(frame);\n };\n this.introRaf = requestAnimationFrame(frame);\n }\n\n private handlePointerDown = (e: PointerEvent): void => {\n this.downAt = { x: e.clientX, y: e.clientY };\n this.dragged = false;\n };\n\n /**\n * Show the hover UI at a data index without a pointer — the keyboard path.\n *\n * A sighted keyboard user has to see the same crosshair and tooltip a mouse\n * user gets, so this reuses the pointer's own rendering rather than a second\n * presentation. The cursor is taken from the point itself, which is what the\n * tooltip positions against. `-1` clears.\n */\n focusIndex(index: number): void {\n if (!this.scene || !this.spec || !this.theme) return;\n if (index < 0) {\n clearHover(this.hoverLayer);\n this.focus.reset();\n this.setFocus(-1);\n return;\n }\n const inverted = !!this.scene.inverted;\n // Anchor on the topmost series that actually has a point here.\n const pt = this.scene.hoverPoints.map((hp) => hp.byIndex[index]).find(Boolean);\n const pos = this.scene.xPositions[index] ?? 0;\n const cursor = pt ? { x: pt.x, y: pt.y } : { x: inverted ? this.scene.plot.x : pos, y: inverted ? pos : this.scene.plot.y };\n renderHover(\n this.hoverLayer,\n this.scene,\n index,\n this.spec.yFormatter,\n this.theme.fontFamily,\n cursor,\n inverted ? 'horizontal' : 'vertical',\n -1,\n { ...this.hoverOpts, rtl: this.rtl },\n );\n }\n\n private handlePointerMove = (e: PointerEvent): void => {\n // Before the hover guard: a drag has to be recognised even with the hover UI\n // switched off (sparklines), and while the zoom band is being dragged.\n if (this.downAt && Math.hypot(e.clientX - this.downAt.x, e.clientY - this.downAt.y) > DRAG_SLOP) {\n this.dragged = true;\n }\n if (!this.scene || !this.hoverEnabled) return;\n const rect = this.canvas.getBoundingClientRect();\n const px = e.clientX - rect.left;\n const py = e.clientY - rect.top;\n // For an inverted chart the main axis is vertical, so hit-test along y.\n const inverted = !!this.scene.inverted;\n const idx = nearestIndex(this.scene.xPositions, inverted ? py : px);\n if (this.hoverRaf) cancelAnimationFrame(this.hoverRaf);\n this.hoverRaf = requestAnimationFrame(() => {\n this.hoverRaf = 0;\n if (!this.scene || !this.spec || !this.theme) return;\n // Emphasise the series nearest the cursor and fade the others (only worth\n // it with more than one series); the hover highlights fade to match.\n const focus = this.scene.hoverPoints.length > 1 ? this.nearestSeries(px, py) : -1;\n renderHover(this.hoverLayer, this.scene, idx, this.spec.yFormatter, this.theme.fontFamily, { x: px, y: py }, inverted ? 'horizontal' : 'vertical', focus, { ...this.hoverOpts, rtl: this.rtl });\n this.setFocus(focus);\n if (idx !== this.lastHoverIndex) {\n this.lastHoverIndex = idx;\n this.cb.onHover?.(idx);\n }\n });\n };\n\n /**\n * Each visible series' samples as `[main, value]` pixel pairs ordered along\n * the main axis, for the hover-focus distance test. Built once per scene and\n * only when a multi-series chart is actually hovered, so the single-series\n * and never-hovered cases cost nothing. (Integer-keyed records enumerate in\n * ascending numeric order, so `byIndex` is already in main-axis order.)\n */\n private seriesLines(scene: RenderScene): [number, number][][] {\n if (this.focusLines?.scene === scene) return this.focusLines.points;\n const points = seriesSampleLines(scene);\n this.focusLines = { scene, points };\n return points;\n }\n\n /**\n * Series whose drawn line is nearest the cursor, or -1.\n *\n * Distance is to the LINE, not to the sample at the hovered index: series\n * measured at different x (irregular data) mostly have no sample there, and\n * comparing exact samples handed the emphasis to whichever series owned that\n * slot — so it strobed as the pointer moved. The currently emphasised series\n * then holds on unless a rival is clearly nearer ({@link pickFocusSeries}),\n * which is what settles lines running close together.\n */\n private nearestSeries(px: number, py: number): number {\n if (!this.scene) return -1;\n // Emphasis exists to pick one LINE out of several running close together.\n // On a FILLED chart it does something else entirely: it recolours large\n // areas, and with an axis-triggered tooltip — which already lists every\n // series — singling one band out contradicts the card and washes the figure\n // out. So a filled chart on axis trigger emphasises nothing; the crosshair\n // and the card carry the reading. Item trigger is the opposite case: the\n // card names exactly ONE series, and without the highlight there would be\n // nothing to say which band it meant, so there the emphasis is essential.\n if (this.scene.areas.length > 0 && this.hoverOpts.trigger !== 'item') {\n this.focus.reset();\n return -1;\n }\n // The cursor is inside a band, and that band owns it. Distance-to-line is\n // the wrong test there: on a thick stacked band the nearest line is usually\n // the NEIGHBOURING series' edge, so the tooltip named a series the pointer\n // was never over.\n const inArea = areaSeriesAt(this.scene, px, py);\n if (inArea >= 0) {\n // Containment doesn't strobe the way a distance tie does, so it is\n // adopted immediately — but the dwell state still has to follow, or the\n // next move outside the bands inherits a stale focus.\n this.focus.reset();\n return inArea;\n }\n const inverted = !!this.scene.inverted;\n const cursorMain = inverted ? py : px;\n const cursorValue = inverted ? px : py;\n const lines = this.seriesLines(this.scene);\n const candidates = this.scene.hoverPoints.map((hp, i) => ({\n seriesIndex: hp.seriesIndex,\n distance: distanceToLine(lines[i], cursorMain, cursorValue),\n }));\n return this.focus.pick(candidates, now());\n }\n\n private handlePointerLeave = (): void => {\n if (this.hoverRaf) {\n cancelAnimationFrame(this.hoverRaf);\n this.hoverRaf = 0;\n }\n clearHover(this.hoverLayer);\n this.focus.reset(); // next hover adopts a series immediately\n this.setFocus(-1); // restore all series to full emphasis\n if (this.lastHoverIndex !== -1) {\n this.lastHoverIndex = -1;\n this.cb.onHover?.(-1);\n }\n };\n\n /**\n * Resolve a click to the most specific thing under it — mark, then line, then\n * area, then the plot background — and fire that one callback only\n * ({@link hitTestScene} owns the geometry).\n */\n private handleClick = (e: MouseEvent): void => {\n const dragged = this.dragged;\n this.dragged = false;\n this.downAt = null;\n if (!this.scene) return;\n const rect = this.canvas.getBoundingClientRect();\n const px = e.clientX - rect.left;\n const py = e.clientY - rect.top;\n const hit = hitTestScene(this.scene, px, py, this.seriesLines(this.scene));\n if (!hit) return;\n const pe = e as PointerEvent;\n if (hit.kind === 'mark') {\n this.cb.onPointClick?.(hit.seriesIndex, hit.dataIndex, pe);\n return;\n }\n // The plot-wide clicks are the ones a stray drag would spam, so they take\n // the drag guard (a mark click never has — see DRAG_SLOP).\n if (dragged) return;\n if (hit.kind === 'line') this.cb.onLineClick?.(hit.seriesIndex, hit.dataIndex, pe);\n else if (hit.kind === 'area') this.cb.onAreaClick?.(hit.seriesIndex, hit.dataIndex, pe);\n else this.cb.onAxisClick?.(hit.dataIndex, axisSeriesValues(this.scene, hit.dataIndex), pe);\n };\n\n /** Toggle the series' visibility on legend click (ECharts-style built-in\n * behaviour) and forward the resulting state to the consumer. */\n private onLegendToggle = (item: LegendItem): void => {\n if (this.spec) {\n this.spec.series[item.seriesIndex].hidden = !this.spec.series[item.seriesIndex].hidden;\n // Re-play the entry motion so the chart animates into its new\n // configuration (respects the variant + reduced-motion / 'none').\n this.hasRendered = false;\n this.render();\n this.cb.onLegendClick?.({ ...item, hidden: this.spec.series[item.seriesIndex].hidden });\n } else {\n this.cb.onLegendClick?.(item);\n }\n };\n}\n"],"names":[],"mappings":";;;AAAA;;;;;;;;;;AAUG;AASH;AACA,MAAM,GAAG,GAAG,OAAe,OAAO,WAAW,KAAK,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAsB/F;;;;;;AAMG;AACH,MAAM,SAAS,GAAG,CAAC;MAEN,eAAe,CAAA;AAgD1B,IAAA,WAAA,CAAoB,SAAsB,EAAA;AAAtB,QAAA,IAAA,CAAA,SAAS,GAAT,SAAS;AAvCrB,QAAA,IAAA,CAAA,GAAG,GAAoC,IAAI;AAC3C,QAAA,IAAA,CAAA,IAAI,GAAyB,IAAI;AACjC,QAAA,IAAA,CAAA,KAAK,GAAuB,IAAI;AAChC,QAAA,IAAA,CAAA,KAAK,GAAuB,IAAI;AAChC,QAAA,IAAA,CAAA,EAAE,GAAoB,EAAE;AACxB,QAAA,IAAA,CAAA,QAAQ,GAAG,CAAC;AACZ,QAAA,IAAA,CAAA,cAAc,GAAG,EAAE;AACnB,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI;AACnB,QAAA,IAAA,CAAA,SAAS,GAAiB,EAAE;AAC5B,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;AACnB,QAAA,IAAA,CAAA,QAAQ,GAAG,CAAC;AACZ,QAAA,IAAA,CAAA,KAAK,GAAG,CAAC;AACT,QAAA,IAAA,CAAA,KAAK,GAAG,CAAC;AACT,QAAA,IAAA,CAAA,OAAO,GAAG,CAAC;;;AAGX,QAAA,IAAA,CAAA,cAAc,GAAG,EAA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AAC,KAAK,EAAE;YAClB,OAAO,EAAE;;;;;;AAMX,QAAA,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC;AAC/C,QAAA,IAAI,MAAM,IAAI,CAAC,EAAE;;;;AAIf,YAAA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;AAClB,YAAA,OAAO,MAAM;;QAEf,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ;QACtC,MAAM,UAAU,GAAG,QAAQ,GAAG,EAAE,GAAG,EAAE;QACrC,MAAM,WAAW,GAAG,QAAQ,GAAG,EAAE,GAAG,EAAE;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;AAC1C,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM;YACxD,WAAW,EAAE,EAAE,CAAC,WAAW;YAC3B,QAAQ,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,WAAW,CAAC;AAC5D,SAAA,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC;;AA2D5C;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as i,h as a,H as o}from"./p-WmvQpZnM.js";const n=()=>`:host{--_color:var(--md-loading-indicator-color, var(--md-sys-color-primary, #6750A4));--_size:var(--md-loading-indicator-size, max(32px, calc(48px + var(--md-sys-density-scale, 0) * 4px)));--_shape-size:var(--md-loading-indicator-shape-size, calc(var(--_size) * 0.792));--_container-color:var(--md-loading-indicator-container-color, var(--md-sys-color-primary-container, #EADDFF));--_container-shape:var(--md-loading-indicator-container-shape, var(--md-sys-shape-corner-full, 50%));display:inline-flex;align-items:center;justify-content:center;inline-size:var(--_size);block-size:var(--_size);flex-shrink:0;box-sizing:border-box;overflow:hidden}:host(.md-loading-indicator--contained){--_color:var(--md-loading-indicator-color, var(--md-sys-color-on-primary-container, #21005D));background-color:var(--_container-color);border-radius:var(--_container-shape)}.md-loading-indicator__shape{display:block;inline-size:var(--_shape-size);block-size:var(--_shape-size);background-color:var(--_color);will-change:clip-path, transform;animation:md-loading-morph 4.55s infinite}@keyframes md-loading-morph{0%{clip-path:polygon( 50% 5.3%, 55.4% 9.1%, 59.3% 15.3%, 64% 16.1%, 71.2% 13.3%, 77.1% 14.7%, 78.3% 21.7%, 78.1% 28.4%, 82.6% 31.2%, 90% 33.4%, 92.6% 38.6%, 88.4% 44.9%, 85.3% 50%, 88.4% 55.1%, 92.6% 61.4%, 90% 66.6%, 82.6% 68.8%, 78.1% 71.6%, 78.3% 78.3%, 77.1% 85.3%, 71.2% 86.7%, 64% 83.9%, 59.3% 84.7%, 55.4% 90.9%, 50% 94.7%, 44.6% 90.9%, 40.7% 84.7%, 36% 83.9%, 28.8% 86.7%, 22.9% 85.3%, 21.7% 78.3%, 21.9% 71.6%, 17.4% 68.8%, 10% 66.6%, 7.4% 61.4%, 11.6% 55.1%, 14.7% 50%, 11.6% 44.9%, 7.4% 38.6%, 10% 33.4%, 17.4% 31.2%, 21.9% 28.4%, 21.7% 21.7%, 22.9% 14.7%, 28.8% 13.3%, 36% 16.1%, 40.7% 15.3%, 44.6% 9.1% );transform:rotate(0deg);animation-timing-function:cubic-bezier(0.34, 1.45, 0.4, 1)}14.3%{clip-path:polygon( 50% 6.8%, 55.4% 9.1%, 59.8% 13.6%, 64.2% 15.8%, 70% 15.4%, 76.2% 15.9%, 79.9% 20.1%, 80.8% 26.4%, 81.8% 31.6%, 85.8% 35.2%, 90.8% 39.1%, 92.6% 44.4%, 90% 50%, 86.7% 54.8%, 86.4% 59.8%, 88.1% 65.8%, 87.4% 71.6%, 82.7% 75.1%, 76.7% 76.7%, 72.5% 79.4%, 70% 84.6%, 66.4% 89.7%, 60.9% 90.8%, 55.1% 88.4%, 50% 86.8%, 44.9% 88.4%, 39.1% 90.8%, 33.6% 89.7%, 30% 84.6%, 27.5% 79.4%, 23.3% 76.7%, 17.3% 75.1%, 12.6% 71.6%, 11.9% 65.8%, 13.6% 59.8%, 13.3% 54.8%, 10% 50%, 7.4% 44.4%, 9.2% 39.1%, 14.2% 35.2%, 18.2% 31.6%, 19.2% 26.4%, 20.1% 20.1%, 23.8% 15.9%, 30% 15.4%, 35.8% 15.8%, 40.2% 13.6%, 44.6% 9.1% );transform:rotate(154deg);animation-timing-function:cubic-bezier(0.34, 1.45, 0.4, 1)}28.6%{clip-path:polygon( 50% 6.8%, 55.4% 8.9%, 60% 12.7%, 63.9% 16.4%, 67.5% 19.7%, 71.1% 22.5%, 75% 25%, 79.5% 27.4%, 84.4% 30.1%, 89.3% 33.7%, 91.4% 38.9%, 90% 44.7%, 87.6% 50%, 85.4% 54.7%, 83.5% 59%, 82.1% 63.3%, 81.2% 68%, 80.2% 73.2%, 78.9% 78.9%, 76.3% 84.2%, 71% 86.4%, 65% 86.2%, 59.5% 85.5%, 54.6% 84.8%, 50% 84.6%, 45.4% 84.8%, 40.5% 85.5%, 35% 86.2%, 29% 86.4%, 23.7% 84.2%, 21.1% 78.9%, 19.8% 73.2%, 18.8% 68%, 17.9% 63.3%, 16.5% 59%, 14.6% 54.7%, 12.4% 50%, 10% 44.7%, 8.6% 38.9%, 10.7% 33.7%, 15.6% 30.1%, 20.5% 27.4%, 25% 25%, 28.9% 22.5%, 32.5% 19.7%, 36.1% 16.4%, 40% 12.7%, 44.6% 8.9% );transform:rotate(309deg);animation-timing-function:cubic-bezier(0.34, 1.45, 0.4, 1)}42.9%{clip-path:polygon( 50% 5.1%, 55.8% 5.6%, 61.5% 7.3%, 66.6% 9.9%, 71.1% 13.4%, 74.8% 17.6%, 77.6% 22.4%, 79.5% 27.4%, 80.3% 32.5%, 80.1% 37.5%, 79.1% 42.2%, 77.5% 46.4%, 76.4% 50%, 77.5% 53.6%, 79.1% 57.8%, 80.1% 62.5%, 80.3% 67.5%, 79.5% 72.6%, 77.6% 77.6%, 74.8% 82.4%, 71.1% 86.6%, 66.6% 90.1%, 61.5% 92.7%, 55.8% 94.4%, 50% 94.9%, 44.2% 94.4%, 38.5% 92.7%, 33.4% 90.1%, 28.9% 86.6%, 25.2% 82.4%, 22.4% 77.6%, 20.5% 72.6%, 19.7% 67.5%, 19.9% 62.5%, 20.9% 57.8%, 22.5% 53.6%, 23.6% 50%, 22.5% 46.4%, 20.9% 42.2%, 19.9% 37.5%, 19.7% 32.5%, 20.5% 27.4%, 22.4% 22.4%, 25.2% 17.6%, 28.9% 13.4%, 33.4% 9.9%, 38.5% 7.3%, 44.2% 5.6% );transform:rotate(463deg);animation-timing-function:cubic-bezier(0.34, 1.45, 0.4, 1)}57.1%{clip-path:polygon( 50% 3.4%, 55.7% 7.1%, 59.5% 14.5%, 62.8% 19.1%, 68.4% 18.2%, 76.4% 15.7%, 82.9% 17.1%, 84.3% 23.6%, 81.8% 31.6%, 80.9% 37.2%, 85.5% 40.5%, 92.9% 44.3%, 96.6% 50%, 92.9% 55.7%, 85.5% 59.5%, 80.9% 62.8%, 81.8% 68.4%, 84.3% 76.4%, 82.9% 82.9%, 76.4% 84.3%, 68.4% 81.8%, 62.8% 80.9%, 59.5% 85.5%, 55.7% 92.9%, 50% 96.6%, 44.3% 92.9%, 40.5% 85.5%, 37.2% 80.9%, 31.6% 81.8%, 23.6% 84.3%, 17.1% 82.9%, 15.7% 76.4%, 18.2% 68.4%, 19.1% 62.8%, 14.5% 59.5%, 7.1% 55.7%, 3.4% 50%, 7.1% 44.3%, 14.5% 40.5%, 19.1% 37.2%, 18.2% 31.6%, 15.7% 23.6%, 17.1% 17.1%, 23.6% 15.7%, 31.6% 18.2%, 37.2% 19.1%, 40.5% 14.5%, 44.3% 7.1% );transform:rotate(617deg);animation-timing-function:cubic-bezier(0.34, 1.45, 0.4, 1)}71.4%{clip-path:polygon( 50% 18.1%, 54.2% 17.7%, 58.9% 16.8%, 64.3% 15.5%, 70.5% 14.5%, 77% 14.8%, 82.4% 17.6%, 85.2% 23%, 85.5% 29.5%, 84.5% 35.7%, 83.2% 41.1%, 82.3% 45.8%, 81.9% 50%, 82.3% 54.2%, 83.2% 58.9%, 84.5% 64.3%, 85.5% 70.5%, 85.2% 77%, 82.4% 82.4%, 77% 85.2%, 70.5% 85.5%, 64.3% 84.5%, 58.9% 83.2%, 54.2% 82.3%, 50% 81.9%, 45.8% 82.3%, 41.1% 83.2%, 35.7% 84.5%, 29.5% 85.5%, 23% 85.2%, 17.6% 82.4%, 14.8% 77%, 14.5% 70.5%, 15.5% 64.3%, 16.8% 58.9%, 17.7% 54.2%, 18.1% 50%, 17.7% 45.8%, 16.8% 41.1%, 15.5% 35.7%, 14.5% 29.5%, 14.8% 23%, 17.6% 17.6%, 23% 14.8%, 29.5% 14.5%, 35.7% 15.5%, 41.1% 16.8%, 45.8% 17.7% );transform:rotate(771deg);animation-timing-function:cubic-bezier(0.34, 1.45, 0.4, 1)}85.7%{clip-path:polygon( 50% 14.5%, 54.9% 12.8%, 60.3% 11.6%, 66.1% 11.2%, 72% 11.9%, 77.7% 13.9%, 82.5% 17.5%, 86.1% 22.3%, 88.1% 28%, 88.8% 33.9%, 88.4% 39.7%, 87.2% 45.1%, 85.5% 50%, 83.5% 54.4%, 81.3% 58.4%, 79% 62%, 76.5% 65.3%, 73.9% 68.4%, 71.2% 71.2%, 68.4% 73.9%, 65.3% 76.5%, 62% 79%, 58.4% 81.3%, 54.4% 83.5%, 50% 85.5%, 45.1% 87.2%, 39.7% 88.4%, 33.9% 88.8%, 28% 88.1%, 22.3% 86.1%, 17.5% 82.5%, 13.9% 77.7%, 11.9% 72%, 11.2% 66.1%, 11.6% 60.3%, 12.8% 54.9%, 14.5% 50%, 16.5% 45.6%, 18.7% 41.6%, 21% 38%, 23.5% 34.7%, 26.1% 31.6%, 28.8% 28.8%, 31.6% 26.1%, 34.7% 23.5%, 38% 21%, 41.6% 18.7%, 45.6% 16.5% );transform:rotate(926deg);animation-timing-function:cubic-bezier(0.34, 1.45, 0.4, 1)}100%{clip-path:polygon( 50% 5.3%, 55.4% 9.1%, 59.3% 15.3%, 64% 16.1%, 71.2% 13.3%, 77.1% 14.7%, 78.3% 21.7%, 78.1% 28.4%, 82.6% 31.2%, 90% 33.4%, 92.6% 38.6%, 88.4% 44.9%, 85.3% 50%, 88.4% 55.1%, 92.6% 61.4%, 90% 66.6%, 82.6% 68.8%, 78.1% 71.6%, 78.3% 78.3%, 77.1% 85.3%, 71.2% 86.7%, 64% 83.9%, 59.3% 84.7%, 55.4% 90.9%, 50% 94.7%, 44.6% 90.9%, 40.7% 84.7%, 36% 83.9%, 28.8% 86.7%, 22.9% 85.3%, 21.7% 78.3%, 21.9% 71.6%, 17.4% 68.8%, 10% 66.6%, 7.4% 61.4%, 11.6% 55.1%, 14.7% 50%, 11.6% 44.9%, 7.4% 38.6%, 10% 33.4%, 17.4% 31.2%, 21.9% 28.4%, 21.7% 21.7%, 22.9% 14.7%, 28.8% 13.3%, 36% 16.1%, 40.7% 15.3%, 44.6% 9.1% );transform:rotate(1080deg)}}.md-loading-indicator__sr-only{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host(:focus-visible){outline:3px solid var(--md-sys-color-secondary, #625B71);outline-offset:2px;border-radius:var(--_container-shape)}@media (prefers-reduced-motion: reduce){.md-loading-indicator__shape{animation:md-loading-pulse 2s ease-in-out infinite;border-radius:50%;clip-path:none}}@keyframes md-loading-pulse{0%,100%{opacity:1}50%{opacity:0.4}}@media (forced-colors: active){.md-loading-indicator__shape{background-color:CanvasText}:host(.md-loading-indicator--contained){background-color:Canvas;outline:1px solid CanvasText}}:host([density='-1']){--md-sys-density-scale:-1}:host([density='-2']){--md-sys-density-scale:-2}:host([density='-3']){--md-sys-density-scale:-3}:host([density='-4']){--md-sys-density-scale:-4}`;const e=class{constructor(a){i(this,a);this.variant="uncontained";this.label="Loading";this.density=0}render(){return a(o,{key:"7283d7970401998bed6a0fba112756031f1ecdee",class:{"md-loading-indicator":true,[`md-loading-indicator--${this.variant}`]:true},role:"progressbar","aria-label":this.label,"aria-live":"polite"},a("span",{key:"b89f9b6f9eafd337fcf89af79771cee126ea7606",class:"md-loading-indicator__shape",part:"shape","aria-hidden":"true"}),a("span",{key:"5ff8ac5edfcb49334c22f3ac3b9d9be0edaf7b19",class:"md-loading-indicator__sr-only",role:"status"},this.label))}};e.style=n();export{e as MdLoadingIndicator};
|
|
2
|
+
//# sourceMappingURL=p-D17cVKxS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"p-D17cVKxS.js","sources":["src/components/md-loading-indicator/md-loading-indicator.css?tag=md-loading-indicator&encapsulation=shadow","src/components/md-loading-indicator/md-loading-indicator.tsx"],"sourcesContent":["/* ==========================================================\n md-loading-indicator — Material Design 3 Loading Indicator\n Spec: https://m3.material.io/components/loading-indicator/specs\n Ref: material-components-android LoadingIndicatorDrawingDelegate\n\n A looping shape-morph animation matching the Android M3\n implementation. Morphs through seven Material shapes:\n Soft Burst → Cookie 9 → Pentagon → Pill →\n Sunny → Cookie 4 → Oval → (repeat)\n\n Timing: 650 ms per shape, 4.55 s full cycle.\n Rotation: ~154° per shape (1080° / 7), 3 full turns per cycle.\n Easing: bouncy spring — each segment overshoots its target\n shape before settling, so the polygon morph and the\n rotation both gain a tactile \"rubber band\" feel.\n Curve sits between the project's spring-spatial-default\n (overshoot 1.21) and spring-spatial-fast (1.67) tokens.\n Shapes: 48-vertex polygons with Gaussian-smoothed corners\n matching Android CornerRounding parameters.\n\n PUBLIC CSS CUSTOM PROPERTIES (override per-instance):\n --md-loading-indicator-color Indicator shape color\n --md-loading-indicator-size Overall component size (default 48px)\n --md-loading-indicator-shape-size Morphing shape size (default 38px)\n --md-loading-indicator-container-color Container background (contained variant)\n --md-loading-indicator-container-shape Container border radius\n\n CSS PARTS:\n shape The morphing indicator shape\n\n SLOTS:\n (none)\n ========================================================== */\n\n:host {\n --_color: var(--md-loading-indicator-color, var(--md-sys-color-primary, #6750A4));\n --_size: var(--md-loading-indicator-size, max(32px, calc(48px + var(--md-sys-density-scale, 0) * 4px)));\n /* Derived from --_size, NOT sized independently. These are two public hooks\n over one shape: setting only `--md-loading-indicator-size` used to leave\n the polygon at its own 38px default, so shrinking the component crammed a\n 38px shape into a smaller container and the morph rendered as a clipped\n blob. 0.792 is the spec ratio (38/48), so the default is unchanged at\n density 0 and any override now scales both boxes together. */\n --_shape-size: var(--md-loading-indicator-shape-size, calc(var(--_size) * 0.792));\n --_container-color: var(--md-loading-indicator-container-color, var(--md-sys-color-primary-container, #EADDFF));\n --_container-shape: var(--md-loading-indicator-container-shape, var(--md-sys-shape-corner-full, 50%));\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--_size);\n block-size: var(--_size);\n flex-shrink: 0;\n box-sizing: border-box;\n /* Belt-and-braces: an explicit shape-size larger than the container would\n otherwise spill the polygon past the (round) container edge. */\n overflow: hidden;\n}\n\n/* ==========================================================\n CONTAINED VARIANT\n Shape uses on-primary-container; background is primary-container.\n ========================================================== */\n\n:host(.md-loading-indicator--contained) {\n --_color: var(--md-loading-indicator-color, var(--md-sys-color-on-primary-container, #21005D));\n\n background-color: var(--_container-color);\n border-radius: var(--_container-shape);\n}\n\n/* ==========================================================\n MORPHING SHAPE\n 48-vertex clip-path polygon animated through 7 Material\n shapes with Gaussian-smoothed corners. Each shape is\n approximated by radial sampling at 7.5° intervals then\n smoothed to match Android CornerRounding values.\n ========================================================== */\n\n.md-loading-indicator__shape {\n display: block;\n inline-size: var(--_shape-size);\n block-size: var(--_shape-size);\n background-color: var(--_color);\n will-change: clip-path, transform;\n animation: md-loading-morph 4.55s infinite;\n}\n\n@keyframes md-loading-morph {\n /* ── Shape 1: Soft Burst — 10 rounded bumps ── */\n 0% {\n clip-path: polygon(\n 50% 5.3%, 55.4% 9.1%, 59.3% 15.3%, 64% 16.1%, 71.2% 13.3%, 77.1% 14.7%,\n 78.3% 21.7%, 78.1% 28.4%, 82.6% 31.2%, 90% 33.4%, 92.6% 38.6%, 88.4% 44.9%,\n 85.3% 50%, 88.4% 55.1%, 92.6% 61.4%, 90% 66.6%, 82.6% 68.8%, 78.1% 71.6%,\n 78.3% 78.3%, 77.1% 85.3%, 71.2% 86.7%, 64% 83.9%, 59.3% 84.7%, 55.4% 90.9%,\n 50% 94.7%, 44.6% 90.9%, 40.7% 84.7%, 36% 83.9%, 28.8% 86.7%, 22.9% 85.3%,\n 21.7% 78.3%, 21.9% 71.6%, 17.4% 68.8%, 10% 66.6%, 7.4% 61.4%, 11.6% 55.1%,\n 14.7% 50%, 11.6% 44.9%, 7.4% 38.6%, 10% 33.4%, 17.4% 31.2%, 21.9% 28.4%,\n 21.7% 21.7%, 22.9% 14.7%, 28.8% 13.3%, 36% 16.1%, 40.7% 15.3%, 44.6% 9.1%\n );\n transform: rotate(0deg);\n animation-timing-function: cubic-bezier(0.34, 1.45, 0.4, 1);\n }\n\n /* ── Shape 2: Cookie 9 — 9 rounded scallops ── */\n 14.3% {\n clip-path: polygon(\n 50% 6.8%, 55.4% 9.1%, 59.8% 13.6%, 64.2% 15.8%, 70% 15.4%, 76.2% 15.9%,\n 79.9% 20.1%, 80.8% 26.4%, 81.8% 31.6%, 85.8% 35.2%, 90.8% 39.1%, 92.6% 44.4%,\n 90% 50%, 86.7% 54.8%, 86.4% 59.8%, 88.1% 65.8%, 87.4% 71.6%, 82.7% 75.1%,\n 76.7% 76.7%, 72.5% 79.4%, 70% 84.6%, 66.4% 89.7%, 60.9% 90.8%, 55.1% 88.4%,\n 50% 86.8%, 44.9% 88.4%, 39.1% 90.8%, 33.6% 89.7%, 30% 84.6%, 27.5% 79.4%,\n 23.3% 76.7%, 17.3% 75.1%, 12.6% 71.6%, 11.9% 65.8%, 13.6% 59.8%, 13.3% 54.8%,\n 10% 50%, 7.4% 44.4%, 9.2% 39.1%, 14.2% 35.2%, 18.2% 31.6%, 19.2% 26.4%,\n 20.1% 20.1%, 23.8% 15.9%, 30% 15.4%, 35.8% 15.8%, 40.2% 13.6%, 44.6% 9.1%\n );\n transform: rotate(154deg);\n animation-timing-function: cubic-bezier(0.34, 1.45, 0.4, 1);\n }\n\n /* ── Shape 3: Pentagon — 5 rounded sides (fill ratio 0.80) ── */\n 28.6% {\n clip-path: polygon(\n 50% 6.8%, 55.4% 8.9%, 60% 12.7%, 63.9% 16.4%, 67.5% 19.7%, 71.1% 22.5%,\n 75% 25%, 79.5% 27.4%, 84.4% 30.1%, 89.3% 33.7%, 91.4% 38.9%, 90% 44.7%,\n 87.6% 50%, 85.4% 54.7%, 83.5% 59%, 82.1% 63.3%, 81.2% 68%, 80.2% 73.2%,\n 78.9% 78.9%, 76.3% 84.2%, 71% 86.4%, 65% 86.2%, 59.5% 85.5%, 54.6% 84.8%,\n 50% 84.6%, 45.4% 84.8%, 40.5% 85.5%, 35% 86.2%, 29% 86.4%, 23.7% 84.2%,\n 21.1% 78.9%, 19.8% 73.2%, 18.8% 68%, 17.9% 63.3%, 16.5% 59%, 14.6% 54.7%,\n 12.4% 50%, 10% 44.7%, 8.6% 38.9%, 10.7% 33.7%, 15.6% 30.1%, 20.5% 27.4%,\n 25% 25%, 28.9% 22.5%, 32.5% 19.7%, 36.1% 16.4%, 40% 12.7%, 44.6% 8.9%\n );\n transform: rotate(309deg);\n animation-timing-function: cubic-bezier(0.34, 1.45, 0.4, 1);\n }\n\n /* ── Shape 4: Pill — capsule with rounded ends ── */\n 42.9% {\n clip-path: polygon(\n 50% 5.1%, 55.8% 5.6%, 61.5% 7.3%, 66.6% 9.9%, 71.1% 13.4%, 74.8% 17.6%,\n 77.6% 22.4%, 79.5% 27.4%, 80.3% 32.5%, 80.1% 37.5%, 79.1% 42.2%, 77.5% 46.4%,\n 76.4% 50%, 77.5% 53.6%, 79.1% 57.8%, 80.1% 62.5%, 80.3% 67.5%, 79.5% 72.6%,\n 77.6% 77.6%, 74.8% 82.4%, 71.1% 86.6%, 66.6% 90.1%, 61.5% 92.7%, 55.8% 94.4%,\n 50% 94.9%, 44.2% 94.4%, 38.5% 92.7%, 33.4% 90.1%, 28.9% 86.6%, 25.2% 82.4%,\n 22.4% 77.6%, 20.5% 72.6%, 19.7% 67.5%, 19.9% 62.5%, 20.9% 57.8%, 22.5% 53.6%,\n 23.6% 50%, 22.5% 46.4%, 20.9% 42.2%, 19.9% 37.5%, 19.7% 32.5%, 20.5% 27.4%,\n 22.4% 22.4%, 25.2% 17.6%, 28.9% 13.4%, 33.4% 9.9%, 38.5% 7.3%, 44.2% 5.6%\n );\n transform: rotate(463deg);\n animation-timing-function: cubic-bezier(0.34, 1.45, 0.4, 1);\n }\n\n /* ── Shape 5: Sunny — 8 rounded rays ── */\n 57.1% {\n clip-path: polygon(\n 50% 3.4%, 55.7% 7.1%, 59.5% 14.5%, 62.8% 19.1%, 68.4% 18.2%, 76.4% 15.7%,\n 82.9% 17.1%, 84.3% 23.6%, 81.8% 31.6%, 80.9% 37.2%, 85.5% 40.5%, 92.9% 44.3%,\n 96.6% 50%, 92.9% 55.7%, 85.5% 59.5%, 80.9% 62.8%, 81.8% 68.4%, 84.3% 76.4%,\n 82.9% 82.9%, 76.4% 84.3%, 68.4% 81.8%, 62.8% 80.9%, 59.5% 85.5%, 55.7% 92.9%,\n 50% 96.6%, 44.3% 92.9%, 40.5% 85.5%, 37.2% 80.9%, 31.6% 81.8%, 23.6% 84.3%,\n 17.1% 82.9%, 15.7% 76.4%, 18.2% 68.4%, 19.1% 62.8%, 14.5% 59.5%, 7.1% 55.7%,\n 3.4% 50%, 7.1% 44.3%, 14.5% 40.5%, 19.1% 37.2%, 18.2% 31.6%, 15.7% 23.6%,\n 17.1% 17.1%, 23.6% 15.7%, 31.6% 18.2%, 37.2% 19.1%, 40.5% 14.5%, 44.3% 7.1%\n );\n transform: rotate(617deg);\n animation-timing-function: cubic-bezier(0.34, 1.45, 0.4, 1);\n }\n\n /* ── Shape 6: Cookie 4 — rounded diamond (fill ratio 0.70) ── */\n 71.4% {\n clip-path: polygon(\n 50% 18.1%, 54.2% 17.7%, 58.9% 16.8%, 64.3% 15.5%, 70.5% 14.5%, 77% 14.8%,\n 82.4% 17.6%, 85.2% 23%, 85.5% 29.5%, 84.5% 35.7%, 83.2% 41.1%, 82.3% 45.8%,\n 81.9% 50%, 82.3% 54.2%, 83.2% 58.9%, 84.5% 64.3%, 85.5% 70.5%, 85.2% 77%,\n 82.4% 82.4%, 77% 85.2%, 70.5% 85.5%, 64.3% 84.5%, 58.9% 83.2%, 54.2% 82.3%,\n 50% 81.9%, 45.8% 82.3%, 41.1% 83.2%, 35.7% 84.5%, 29.5% 85.5%, 23% 85.2%,\n 17.6% 82.4%, 14.8% 77%, 14.5% 70.5%, 15.5% 64.3%, 16.8% 58.9%, 17.7% 54.2%,\n 18.1% 50%, 17.7% 45.8%, 16.8% 41.1%, 15.5% 35.7%, 14.5% 29.5%, 14.8% 23%,\n 17.6% 17.6%, 23% 14.8%, 29.5% 14.5%, 35.7% 15.5%, 41.1% 16.8%, 45.8% 17.7%\n );\n transform: rotate(771deg);\n animation-timing-function: cubic-bezier(0.34, 1.45, 0.4, 1);\n }\n\n /* ── Shape 7: Oval — tilted ellipse (-45°) ── */\n 85.7% {\n clip-path: polygon(\n 50% 14.5%, 54.9% 12.8%, 60.3% 11.6%, 66.1% 11.2%, 72% 11.9%, 77.7% 13.9%,\n 82.5% 17.5%, 86.1% 22.3%, 88.1% 28%, 88.8% 33.9%, 88.4% 39.7%, 87.2% 45.1%,\n 85.5% 50%, 83.5% 54.4%, 81.3% 58.4%, 79% 62%, 76.5% 65.3%, 73.9% 68.4%,\n 71.2% 71.2%, 68.4% 73.9%, 65.3% 76.5%, 62% 79%, 58.4% 81.3%, 54.4% 83.5%,\n 50% 85.5%, 45.1% 87.2%, 39.7% 88.4%, 33.9% 88.8%, 28% 88.1%, 22.3% 86.1%,\n 17.5% 82.5%, 13.9% 77.7%, 11.9% 72%, 11.2% 66.1%, 11.6% 60.3%, 12.8% 54.9%,\n 14.5% 50%, 16.5% 45.6%, 18.7% 41.6%, 21% 38%, 23.5% 34.7%, 26.1% 31.6%,\n 28.8% 28.8%, 31.6% 26.1%, 34.7% 23.5%, 38% 21%, 41.6% 18.7%, 45.6% 16.5%\n );\n transform: rotate(926deg);\n animation-timing-function: cubic-bezier(0.34, 1.45, 0.4, 1);\n }\n\n /* ── Loop: back to Soft Burst ── */\n 100% {\n clip-path: polygon(\n 50% 5.3%, 55.4% 9.1%, 59.3% 15.3%, 64% 16.1%, 71.2% 13.3%, 77.1% 14.7%,\n 78.3% 21.7%, 78.1% 28.4%, 82.6% 31.2%, 90% 33.4%, 92.6% 38.6%, 88.4% 44.9%,\n 85.3% 50%, 88.4% 55.1%, 92.6% 61.4%, 90% 66.6%, 82.6% 68.8%, 78.1% 71.6%,\n 78.3% 78.3%, 77.1% 85.3%, 71.2% 86.7%, 64% 83.9%, 59.3% 84.7%, 55.4% 90.9%,\n 50% 94.7%, 44.6% 90.9%, 40.7% 84.7%, 36% 83.9%, 28.8% 86.7%, 22.9% 85.3%,\n 21.7% 78.3%, 21.9% 71.6%, 17.4% 68.8%, 10% 66.6%, 7.4% 61.4%, 11.6% 55.1%,\n 14.7% 50%, 11.6% 44.9%, 7.4% 38.6%, 10% 33.4%, 17.4% 31.2%, 21.9% 28.4%,\n 21.7% 21.7%, 22.9% 14.7%, 28.8% 13.3%, 36% 16.1%, 40.7% 15.3%, 44.6% 9.1%\n );\n transform: rotate(1080deg);\n }\n}\n\n/* ==========================================================\n VISUALLY HIDDEN (screen-reader-only status text)\n ========================================================== */\n\n.md-loading-indicator__sr-only {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n\n/* ==========================================================\n FOCUS RING\n Some assistive technologies can programmatically focus\n progressbar elements. Provide a visible ring when focused.\n ========================================================== */\n\n:host(:focus-visible) {\n outline: 3px solid var(--md-sys-color-secondary, #625B71);\n outline-offset: 2px;\n border-radius: var(--_container-shape);\n}\n\n/* ==========================================================\n REDUCED MOTION\n Replace the complex morph animation with a gentle opacity\n pulse so the \"loading\" intent is still communicated visually.\n ========================================================== */\n\n@media (prefers-reduced-motion: reduce) {\n .md-loading-indicator__shape {\n animation: md-loading-pulse 2s ease-in-out infinite;\n border-radius: 50%;\n clip-path: none;\n }\n}\n\n@keyframes md-loading-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.4; }\n}\n\n/* ==========================================================\n FORCED COLORS (High Contrast)\n ========================================================== */\n\n@media (forced-colors: active) {\n .md-loading-indicator__shape {\n background-color: CanvasText;\n }\n\n :host(.md-loading-indicator--contained) {\n background-color: Canvas;\n outline: 1px solid CanvasText;\n }\n}\n\n/* ==========================================================\n DENSITY (local override)\n Maps the local `density` prop onto the same --md-sys-density-scale signal a\n global `data-density` ancestor sets. Declared on :host, so a local rung wins\n over the inherited global one. Every density-sensitive value in this file\n derives from that single signal by calc — never add a fixed per-rung ladder.\n ========================================================== */\n:host([density='-1']) { --md-sys-density-scale: -1; }\n:host([density='-2']) { --md-sys-density-scale: -2; }\n:host([density='-3']) { --md-sys-density-scale: -3; }\n:host([density='-4']) { --md-sys-density-scale: -4; }\n","import { Component, Host, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'md-loading-indicator',\n styleUrl: 'md-loading-indicator.css',\n shadow: true,\n})\nexport class MdLoadingIndicator {\n /** Visual style: uncontained (default) or contained (with background container) */\n @Prop({ reflect: true }) variant: 'uncontained' | 'contained' = 'uncontained';\n\n /** Accessible label for screen readers */\n @Prop() label: string = 'Loading';\n\n /**\n * Local density rung. Drives the same `--md-sys-density-scale` signal that a\n * global `data-density` ancestor sets, so a local value simply overrides the\n * inherited one. 0 = default, -4 = ultra-compact.\n */\n @Prop({ reflect: true }) density: 0 | -1 | -2 | -3 | -4 = 0;\n\n render() {\n return (\n <Host\n class={{\n 'md-loading-indicator': true,\n [`md-loading-indicator--${this.variant}`]: true,\n }}\n role=\"progressbar\"\n aria-label={this.label}\n aria-live=\"polite\"\n >\n <span class=\"md-loading-indicator__shape\" part=\"shape\" aria-hidden=\"true\"></span>\n <span class=\"md-loading-indicator__sr-only\" role=\"status\">{this.label}</span>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,qBAAqB,GAAG,MAAM,CAAC,o0PAAo0P,CAAC;;MCO71P,kBAAkB,GAAA,MAAA;AAL/B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAO2B,QAAA,IAAA,CAAA,OAAO,GAAgC,aAAa;;AAGrE,QAAA,IAAA,CAAA,KAAK,GAAW,SAAS;AAEjC;;;;AAIG;AACsB,QAAA,IAAA,CAAA,OAAO,GAA0B,CAAC;AAkB5D;IAhBC,MAAM,GAAA;QACJ,QACE,CAAA,CAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EACH,KAAK,EAAE;AACL,gBAAA,sBAAsB,EAAE,IAAI;AAC5B,gBAAA,CAAC,yBAAyB,IAAI,CAAC,OAAO,CAAA,CAAE,GAAG,IAAI;AAChD,aAAA,EACD,IAAI,EAAC,aAAa,EAAA,YAAA,EACN,IAAI,CAAC,KAAK,eACZ,QAAQ,EAAA,EAElB,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,6BAA6B,EAAC,IAAI,EAAC,OAAO,EAAA,aAAA,EAAa,MAAM,EAAA,CAAQ,EACjF,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,+BAA+B,EAAC,IAAI,EAAC,QAAQ,EAAA,EAAE,IAAI,CAAC,KAAK,CAAQ,CACxE;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{v as t,x as s,y as i,z as n,A as e,B as o,C as h,D as c,E as a,F as r,G as l,H as f,I as u,J as d,K as x,w as m,c as y,e as M,f as p,i as b,s as g,g as v,h as w,L as k,l as I,M as A,n as z,m as F,N as S}from"./p-DvOKnoqK.js";import{n as $}from"./p-DzPKu-Ma.js";function L(t,s){return t.length*s*.58}function T(t,s){const i=t[1];const n=s[1];if(!(i>0)||!(n>0))return[t,s];const e=t[0]<0?-t[0]/i:0;const o=s[0]<0?-s[0]/n:0;const h=Math.max(e,o);if(h<=0)return[t,s];return[[-h*i,i],[-h*n,n]]}function B(t,s,i){if(s<=0||L(t,i)<=s)return t;const n=i*.58;const e=Math.floor(s/n)-1;return e>=1?`${t.slice(0,e)}…`:""}function q(t,s){const i=t.categories.length||Math.max(0,...t.series.map((t=>(t.range??t.data??[]).length)));const n=t.stack!=="none";const e=t.series.map((t=>n&&!t.range?t.stack||"stacked":"__unstacked__"));const o=h(t.series.map((t=>t.hidden||t.range?[]:t.data??[])),t.stack,e);t.series.forEach(((t,s)=>{if(!t.range||t.hidden)return;o[s]=t.range.map((t=>t?[Math.min(t[0],t[1]),Math.max(t[0],t[1])]:t))}));const d=[];t.series.forEach(((t,s)=>{if(t.hidden)return;o[s].forEach((t=>{if(t)d.push(t[0],t[1])}))}));const x=s=>(t.series[s].axisIndex??0)===1;const m=!!t.valueAxis2&&t.series.some(((t,s)=>!t.hidden&&x(s)));const y=[];if(m){d.length=0;t.series.forEach(((t,s)=>{if(t.hidden)return;o[s].forEach((t=>{if(t)(x(s)?y:d).push(t[0],t[1])}))}))}let M=l(d,{min:t.valueMin,max:t.valueMax,scale:t.valueScale,includeZero:true});let p=m?l(y,{min:t.valueAxis2.min,max:t.valueAxis2.max,scale:t.valueScale,includeZero:true}):M;if(m&&t.valueScale==="value"&&t.valueMin==null&&t.valueMax==null&&t.valueAxis2.min==null&&t.valueAxis2.max==null){[M,p]=T(M,p)}const b=c(t.valueBreaks,d,t.valueScale);const g={...b,ranges:a(r(b.ranges,M),M,t.valueScale)};const v=f(M,g.ranges,t.valueScale,6).filter((t=>!u(g.ranges,t)));const w=v.map((s=>(t.valueTickFormatter??t.valueFormatter)(s)));const k=t.valueAxis2?.formatter??t.valueTickFormatter??t.valueFormatter;const I=m&&!t.valueAxis2.hidden?f(p,[],t.valueScale,6):[];const A=I.map((t=>k(t)));const z=Math.max(0,...A.map((t=>L(t,s.labelSize))));const F=[];for(let s=0;s<i;s++)F.push(t.categoryFormatter(t.categories[s]??s));return{C:i,stacked:n,stackKeys:e,bands:o,onAxis2:x,hasAxis2:m,vDomain:M,vDomain2:p,vBreaks:g,vTickVals:v,vTickLabels:w,v2TickVals:I,v2TickLabels:A,maxV2LabelW:z,catLabels:F}}function D(t,s,i,n,e,o,h){const c=i?s.y:s.x;const a=i?s.height:s.width;const r=t.series.find((t=>!t.hidden&&t.pointWidths))?.pointWidths;const l=t=>{const s=r?.[t];return typeof s==="number"&&Number.isFinite(s)&&s>0?s:1};let f=0;const u=[];for(let t=0;t<n;t++){u.push(f);f+=l(t)}if(f<=0)f=Math.max(1,n);const d=t=>n>0?a*l(t)/f:a;const x=t=>c+a*u[t]/f;const m=t=>x(t)+d(t)/2;const y=s=>d(s)*(1-t.categoryGapRatio);const M=t.series.map(((t,s)=>s)).filter((s=>!t.series[s].hidden&&!t.series[s].overlay));const p=[];for(const t of M){const s=o[t];if(!p.includes(s))p.push(s)}const b=e?Math.max(1,p.length):Math.max(1,M.length);const g=s=>y(s)/(b+(b-1)*t.barGapRatio);const v=new Map;const w=new Map;if(e){for(let s=0;s<n;s++){const i=new Map;const n=new Map;t.series.forEach(((t,e)=>{if(t.hidden)return;const c=h[e][s];if(!c)return;const a=`${o[e]}|${s}`;if(c[1]>(i.get(a)??-Infinity)){i.set(a,c[1]);v.set(a,e)}if(c[0]<(n.get(a)??Infinity)){n.set(a,c[0]);w.set(a,e)}}))}}return{sizeAt:d,bandCenter:m,groupInnerAt:y,barWAt:g,groupNames:p,visibleIdx:M,topSeriesFor:v,botSeriesFor:w,mainLen:a}}function C(t,s,i,n,e,o,h,c,a){const r=t.subtitle?s.labelSize+4:0;const l=t.title?s.titleSize+10+r:0;const f=t.valueHidden||t.valueHideTicks?0:Math.max(0,...h.map((t=>L(t,s.labelSize))));const u=t.categoryHidden||t.categoryHideTicks?0:Math.max(0,...c.map((t=>L(t,s.labelSize))));const x=t.showLabels?Math.max(0,...t.series.flatMap((i=>i.range?i.range.flatMap((i=>i?[L(t.valueFormatter(i[0]),s.labelSize),L(t.valueFormatter(i[1]),s.labelSize)]:[])):(i.data??[]).map((i=>typeof i==="number"?L(t.valueFormatter(i),s.labelSize):0))))):0;const m=t.valueLabel?s.labelSize+6:0;const y=t.categoryLabel?s.labelSize+6:0;const M=s.labelSize+8;const p=!e?t.categoryLabelRotation??0:0;const b=Math.abs(p)*Math.PI/180;const g=p?u*Math.sin(b)+s.labelSize*Math.cos(b)+8:M;const v=!!t.legend&&t.legend!=="none"&&t.series.length>1;const w=v&&(t.legend==="left"||t.legend==="right");const k=v&&!w&&t.legend.startsWith("bottom");const I=v&&!w&&!k;const A=I||k?d(t.series.map((t=>t.label)),s.labelSize,i*.86):1;const z=t.legendExtent!=null&&(I||k)?t.legendExtent+8:A*(s.labelSize+8)+6;const F=I?z:0;const S=k?z:0;const $=w?t.legendExtent!=null?t.legendExtent+16:Math.max(0,...t.series.map((t=>L(t.label,s.labelSize))))+34:0;const T=t.legend==="left"?$:0;const B=t.legend==="right"?$:0;const q=(t.showLabels||t.showTotals)&&t.series.some((t=>!t.hidden&&(!!t.range||(t.data??[]).some((t=>typeof t==="number"&&t<0)))));const D=!!t.categoryLabelsMirrored&&e&&!t.categoryHidden&&!t.categoryHideTicks;const C=!!t.compact;const R=q?e?x+8:s.labelSize+4:0;let W;let E;let P;let V;if(C){W=E=P=V=2}else if(e){W=l+8+F;V=u+12+y+T+(q?x+8:0);P=(t.valueHidden||t.valueHideTicks?0:M)+m+6+S;E=12+(t.showLabels?x+8:0)+B+(D?u+12:0)}else{W=l+8+F+(t.showLabels?s.labelSize+4:0);E=12+B+(t.showLabels?x/2:0)+(o?a+10+(t.valueAxis2.label?s.labelSize+6:0):0);V=f+10+m+T;P=(t.categoryHidden||t.categoryHideTicks?0:g)+y+6+S+(q?s.labelSize+4:0)}const K={x:V,y:W,width:Math.max(1,i-V-E),height:Math.max(1,n-W-P)};return{plot:K,compact:C,legendBandTop:F,legendBandBottom:S,lowEndRoom:R,mirrorCats:D,maxDataLabelW:x,catRot:p,catRotRad:b}}function R(h,c,a,r){const l=h.horizontal;const{C:f,stacked:u,stackKeys:d,bands:m,onAxis2:y,hasAxis2:M,vDomain:p,vDomain2:b,vBreaks:g,vTickVals:v,vTickLabels:w,v2TickVals:k,v2TickLabels:I,maxV2LabelW:A,catLabels:z}=q(h,c);if(h.polar)return W(h,c,a,r,m,p,z,f);const{plot:F,compact:S,legendBandTop:$,legendBandBottom:T,lowEndRoom:R,mirrorCats:E,maxDataLabelW:P,catRot:V,catRotRad:K}=C(h,c,a,r,l,M,w,z,A);const N=l?F.width:F.height;const _=t(p,N,h.valueScale,g.ranges,g.sizing);const j=Math.min(p[1],Math.max(p[0],0));const G=M?t(b,N,h.valueScale,[],g.sizing):_;const H=t=>l?F.x+_.scale(t):F.y+F.height-_.scale(t);const O=t=>l?F.x+G.scale(t):F.y+F.height-G.scale(t);const Z=(t,s)=>M&&y(t)?O(s):H(s);const J=H(j);const U=(_.breaks??[]).map((t=>l?{lo:F.x+t.px,hi:F.x+t.px+t.gap}:{lo:F.y+F.height-t.px-t.gap,hi:F.y+F.height-t.px}));const Q=t=>{if(!U.length)return[t];const s=l?t.x:t.y;const i=s+(l?t.w:t.h);let n=[{lo:s,hi:i}];for(const t of U){const s=[];for(const i of n){if(t.hi<=i.lo||t.lo>=i.hi){s.push(i);continue}if(t.lo>i.lo)s.push({lo:i.lo,hi:t.lo});if(t.hi<i.hi)s.push({lo:t.hi,hi:i.hi})}n=s}if(n.length===1&&n[0].lo===s&&n[0].hi===i)return[t];return n.filter((t=>t.hi-t.lo>.5)).map(((s,i,n)=>({...t,radius:i===(l?n.length-1:0)?t.radius:[0,0,0,0],...l?{x:s.lo,w:s.hi-s.lo}:{y:s.lo,h:s.hi-s.lo}})))};const{sizeAt:X,bandCenter:Y,groupInnerAt:tt,barWAt:st,groupNames:it,visibleIdx:nt,topSeriesFor:et,botSeriesFor:ot,mainLen:ht}=D(h,F,l,f,u,d,m);const ct=[];const at=[];const rt=[];const lt=[];const ft=h.cornerRadius;h.series.forEach(((t,i)=>{if(t.hidden)return;const n=u?Math.max(0,it.indexOf(d[i])):Math.max(0,nt.indexOf(i));const e={};for(let o=0;o<f;o++){const a=m[i][o];if(!a)continue;const r=!!t.range;const f=r?null:t.data[o];const y=typeof f==="number"?f:a[1];const M=Z(i,a[0]);const p=Z(i,a[1]);const b=t.overlay?X(o)*(t.widthRatio??.45):st(o);const g=b*h.barGapRatio;const v=h.barWidth!=null&&!t.overlay?Math.min(Math.max(1,h.barWidth),b):b;const w=t.overlay?Y(o)-b/2:Y(o)-tt(o)/2+n*(b+g);const k=w+(b-v)/2;const I=y>=0;const A=`${d[i]}|${o}`;const z=I?a[0]===0:a[1]===0;const F=r||!u||(I?et.get(A)===i:ot.get(A)===i);const S=h.chevron?Math.min(v*.03,5,Math.abs(p-M)*.35):0;const $=h.chevron?x(v)-S/2:0;let T;if(l){const s=Math.min(M,p)+S/2;const n=Math.abs(p-M)-S;const c=r?[ft,ft,ft,ft]:F?I?[0,ft,ft,0]:[ft,0,0,ft]:[0,0,0,0];T={x:s,y:k,w:n,h:v,color:t.pointColors?.[o]??t.color,radius:c,seriesIndex:i,dataIndex:o,horizontal:true,arrow:h.chevron?I?1:-1:undefined,notch:h.chevron?!z:undefined};e[o]={x:I?Math.max(M,p)+$:Math.min(M,p)-$,y:k+v/2,value:y,color:T.color,...r?{low:a[0],high:a[1]}:null}}else{const s=Math.min(M,p)+S/2;const n=Math.abs(p-M)-S;const c=r?[ft,ft,ft,ft]:F?I?[ft,ft,0,0]:[0,0,ft,ft]:[0,0,0,0];T={x:k,y:s,w:v,h:n,color:t.pointColors?.[o]??t.color,radius:c,seriesIndex:i,dataIndex:o,horizontal:false,arrow:h.chevron?I?1:-1:undefined,notch:h.chevron?!z:undefined};e[o]={x:k+v/2,y:I?Math.min(M,p)-$:Math.max(M,p)+$,value:y,color:T.color,...r?{low:a[0],high:a[1]}:null}}ct.push(...Q(T));if(h.showLabels&&r){lt.push({seriesIndex:i,dataIndex:o,text:h.valueFormatter(a[0]),color:c.textColor,size:c.labelSize,atLowEnd:true},{seriesIndex:i,dataIndex:o,text:h.valueFormatter(a[1]),color:c.textColor,size:c.labelSize,atLowEnd:false})}else if(h.showLabels&&u&&typeof f==="number"){const t=h.stack==="percentage"?Math.abs(a[1]-a[0])*(f<0?-1:1):f;const n=h.valueFormatter(t);const e=l?T.w>L(n,c.labelSize)+8&&T.h>c.labelSize:T.h>c.labelSize+6&&T.w>L(n,c.labelSize)+4;if(e){lt.push({seriesIndex:i,dataIndex:o,text:n,color:s(T.color),size:c.labelSize,fontWeight:600,inside:true})}}else if(h.showLabels&&typeof f==="number"){lt.push({seriesIndex:i,dataIndex:o,text:h.valueFormatter(f),color:c.textColor,size:c.labelSize,atLowEnd:!I})}}at.push({seriesIndex:i,color:t.color,label:t.label,byIndex:e,values:t.range?m[i].map((t=>t?t[1]:null)):t.data})}));if(h.showTotals&&u&&h.stack!=="percentage"){for(let t=0;t<f;t++){for(const s of it){let i=-Infinity;let n=Infinity;let e=0;let o=false;h.series.forEach(((h,c)=>{if(h.hidden||d[c]!==s)return;const a=m[c][t];const r=h.data?.[t];if(!a)return;o=true;i=Math.max(i,a[1]);n=Math.min(n,a[0]);if(typeof r==="number")e+=r}));if(!o)continue;const a=h.valueFormatter(e);const r=i>0||n>=0;const l=r?et.get(`${s}|${t}`):ot.get(`${s}|${t}`);if(l==null)continue;lt.push({seriesIndex:l,dataIndex:t,text:a,color:c.textColor,size:c.labelSize,fontWeight:600,atLowEnd:!r})}}}const ut=[];const dt=[];const xt=5;const mt=F.y+F.height;const yt=i(h.valueDash);const Mt=i(h.valueGridDash);const pt=i(h.categoryDash);if(!h.valueHidden&&!S){for(const t of v){const s=H(t);if(l){ut.push({x1:s,y1:F.y,x2:s,y2:mt,color:c.gridLineColor,width:1,dash:Mt});if(h.axisTicks)dt.push({x1:s,y1:mt,x2:s,y2:mt+xt,color:c.axisLineColor,width:1,dash:yt})}else{ut.push({x1:F.x,y1:s,x2:F.x+F.width,y2:s,color:c.gridLineColor,width:1,dash:Mt});if(h.axisTicks)dt.push({x1:F.x-xt,y1:s,x2:F.x,y2:s,color:c.axisLineColor,width:1,dash:yt})}}}if(!S){const t=h.categoryAxisLine!==false;const s=h.valueAxisLine!==false;const i=_.breaks??[];if(t){dt.push(l?{x1:F.x,y1:F.y,x2:F.x,y2:F.y+F.height,color:c.axisLineColor,width:1,dash:pt}:{x1:F.x,y1:F.y+F.height,x2:F.x+F.width,y2:F.y+F.height,color:c.axisLineColor,width:1,dash:pt})}if(s){if(l){const t=i.map((t=>({px:t.px,gap:t.gap})));dt.push(...n("x",F.x,F.x+F.width,F.y+F.height,t,c.axisLineColor,yt));for(const s of t)dt.push(...e("x",F.x+s.px,F.x+s.px+s.gap,F.y,F.y+F.height,c.axisLineColor))}else{const t=i.map((t=>({px:F.height-t.px-t.gap,gap:t.gap})));dt.push(...n("y",F.y,F.y+F.height,F.x,t,c.axisLineColor,yt));for(const s of t)dt.push(...e("y",F.y+s.px,F.y+s.px+s.gap,F.x,F.x+F.width,c.axisLineColor))}}}if(h.title&&!S){const t=o(h.titleAlign,F.x,F.width);rt.push({x:t.x,y:$+6,text:h.title,color:c.textColor,fontSize:c.titleSize,fontWeight:600,align:t.align,baseline:"top",key:"title"});if(h.subtitle){rt.push({x:t.x,y:$+6+c.titleSize+4,text:h.subtitle,color:c.textColorMuted,fontSize:c.labelSize,align:t.align,baseline:"top",key:"subtitle"})}}if(M&&!h.valueAxis2.hidden&&!S&&!l){const t=F.x+F.width;dt.push({x1:t,y1:F.y,x2:t,y2:F.y+F.height,color:c.axisLineColor,width:1,dash:yt});k.forEach(((s,i)=>{const n=O(s);if(h.axisTicks)dt.push({x1:t,y1:n,x2:t+xt,y2:n,color:c.axisLineColor,width:1,dash:yt});rt.push({x:t+8,y:n,text:I[i],color:c.textColorMuted,fontSize:c.labelSize,align:"start",baseline:"middle",key:`v2t-${i}`})}));if(h.valueAxis2.label){rt.push({x:a-4,y:F.y+F.height/2,text:h.valueAxis2.label,color:c.textColor,fontSize:c.labelSize,align:"center",baseline:"bottom",rotate:-90,key:"val2-axis-title"})}}if(!h.valueHidden&&!h.valueHideTicks&&!S){v.forEach(((t,s)=>{const i=H(t);if(l){rt.push({x:i,y:F.y+F.height+6,text:w[s],color:c.textColorMuted,fontSize:c.labelSize,align:"center",baseline:"top",key:`vt-${s}`})}else{rt.push({x:F.x-8,y:i,text:w[s],color:c.textColorMuted,fontSize:c.labelSize,align:"end",baseline:"middle",key:`vt-${s}`})}}))}const bt=[];const gt=l?c.labelSize+6:48;const vt=Math.max(1,Math.ceil(f/Math.max(1,Math.floor(ht/gt))));for(let t=0;t<f;t++){const s=Y(t);bt.push(s);const i=t%vt===0;if(h.axisTicks&&!S&&i&&!h.categoryHidden){if(l)dt.push({x1:F.x-xt,y1:s,x2:F.x,y2:s,color:c.axisLineColor,width:1});else dt.push({x1:s,y1:mt,x2:s,y2:mt+xt,color:c.axisLineColor,width:1})}if(h.categoryHidden||h.categoryHideTicks||S||!i)continue;if(l){rt.push({x:F.x-8-R,y:s,text:z[t],color:c.textColorMuted,fontSize:c.labelSize,align:"end",baseline:"middle",key:`ct-${t}`});if(E){rt.push({x:F.x+F.width+8+(h.showLabels?P+4:0),y:s,text:z[t],color:c.textColorMuted,fontSize:c.labelSize,align:"start",baseline:"middle",key:`ctm-${t}`})}}else if(V){const i=L(z[t],c.labelSize);const n=V<0?-1:1;rt.push({x:s+n*i*Math.cos(K)/2,y:F.y+F.height+6+R+i*Math.sin(K)/2,text:z[t],color:c.textColorMuted,fontSize:c.labelSize,align:"center",baseline:"middle",rotate:V,key:`ct-${t}`})}else{const i=t+vt<f?Y(t+vt):s+vt*X(t);const n=t-vt>=0?Y(t-vt):s-vt*X(t);const e=Math.min(i-s,s-n)-6;rt.push({x:s,y:F.y+F.height+6+R,text:B(z[t],e,c.labelSize),color:c.textColorMuted,fontSize:c.labelSize,align:"center",baseline:"top",key:`ct-${t}`})}}if(!S){const t=h.categoryLabel;const s=h.valueLabel;if(l){if(t)rt.push({x:4,y:F.y+F.height/2,text:t,color:c.textColor,fontSize:c.labelSize,align:"center",baseline:"top",rotate:-90,key:"cat-axis-title"});if(s)rt.push({x:F.x+F.width/2,y:r-2-T,text:s,color:c.textColor,fontSize:c.labelSize,align:"center",baseline:"bottom",key:"val-axis-title"})}else{if(s)rt.push({x:4,y:F.y+F.height/2,text:s,color:c.textColor,fontSize:c.labelSize,align:"center",baseline:"top",rotate:-90,key:"val-axis-title"});if(t)rt.push({x:F.x+F.width/2,y:r-2-T,text:t,color:c.textColor,fontSize:c.labelSize,align:"center",baseline:"bottom",key:"cat-axis-title"})}}const wt=h.legend==="none"||S?[]:h.series.map(((t,s)=>({label:t.label,color:t.color,seriesIndex:s,hidden:t.hidden,x:0,y:0})));return{width:a,height:r,plot:F,background:c.background==="transparent"?undefined:c.background,gridlines:ut,axisLines:dt,areas:[],bars:ct,slices:[],lines:[],markers:[],texts:rt,barLabels:lt,legend:wt,legendPosition:h.legend,xPositions:bt,xValues:h.categories,xLabels:z,barBaseline:J,hoverPoints:at}}function W(t,s,i,n,e,h,c,a){const r=[];const l=t.subtitle?s.labelSize+4:0;const u=t.title?s.titleSize+10+l:0;const x=!!t.legend&&t.legend!=="none"&&t.series.length>1;const m=x&&t.legend.startsWith("bottom");const y=x&&!m&&!(t.legend==="left"||t.legend==="right");const M=x?d(t.series.map((t=>t.label)),s.labelSize,i*.86):1;const p=t.legendExtent!=null&&(y||m)?t.legendExtent+8:M*(s.labelSize+8)+6;const b=y?p:0;const g=m?p:0;const v=t.categoryHidden||t.categoryHideTicks?0:Math.max(0,...c.map((t=>L(t,s.labelSize))))+12;const w={x:v,y:u+b,width:Math.max(1,i-v),height:Math.max(1,n-u-b-g)};const k=w.x+w.width/2;const I=w.y+w.height/2;const A=t.valueTickFormatter??t.valueFormatter;const z=t.valueHidden||t.valueHideTicks?[]:f(h,[],t.valueScale,8).filter((t=>t>=h[0]-1e-9&&t<=h[1]+1e-9));const F=Math.max(0,...z.map((t=>L(A(t),s.labelSize))));const S=z.length?F+18:0;const $=Math.max(8,Math.min(w.width,w.height)/2-8-S);const T=$*Math.max(0,Math.min(.9,t.polarHole??.22));const B=a>0?($-T)/a:$-T;const q=Math.max(1,B*(1-t.categoryGapRatio));const D=-Math.PI/2;const C=2*Math.PI*Math.max(.1,Math.min(1,t.polarSweep??.75));const[R,W]=h;const E=W-R||1;const P=t=>D+(t-R)/E*C;const V=[];const K=[];const N=[];for(let t=0;t<a;t++){const s=$-t*B;N.push(s-q/2)}t.series.forEach(((t,s)=>{if(t.hidden)return;const i={};for(let n=0;n<a;n++){const o=e[s][n];if(!o)continue;const h=$-n*B;const c=h-q;const a=P(o[0]);const r=P(o[1]);if(Math.abs(r-a)<1e-6)continue;V.push({cx:k,cy:I,innerR:c,outerR:h,startAngle:Math.min(a,r),endAngle:Math.max(a,r),color:t.pointColors?.[n]??t.color,dataIndex:n,seriesIndex:s,pill:true,capStart:false,capEnd:false});const l=(a+r)/2;const f=(c+h)/2;i[n]={x:k+f*Math.cos(l),y:I+f*Math.sin(l),value:typeof t.data?.[n]==="number"?t.data[n]:o[1]}}K.push({seriesIndex:s,color:t.color,label:t.label,byIndex:i,values:t.data??[]})}));for(let t=0;t<a;t++){const s=V.filter((s=>s.dataIndex===t));if(!s.length)continue;let i=s[0];let n=s[0];for(const t of s){if(t.startAngle<i.startAngle)i=t;if(t.endAngle>n.endAngle)n=t}i.capStart=true;n.capEnd=true}const _=$+16;for(const t of z){const i=P(t);const n=Math.cos(i);const e=Math.sin(i);r.push({x:k+_*n,y:I+_*e,text:A(t),color:s.textColorMuted,fontSize:s.labelSize,align:n>.35?"start":n<-.35?"end":"center",baseline:e>.35?"top":e<-.35?"bottom":"middle",key:`vt-${t}`})}if(!t.categoryHidden&&!t.categoryHideTicks){for(let t=0;t<a;t++){r.push({x:k-q/2-12,y:I-N[t],text:c[t],color:s.textColorMuted,fontSize:s.labelSize,align:"end",baseline:"middle",key:`ct-${t}`})}}if(t.title){const i=o(t.titleAlign,w.x,w.width);r.push({x:i.x,y:b+6,text:t.title,color:s.textColor,fontSize:s.titleSize,fontWeight:600,align:i.align,baseline:"top",key:"title"});if(t.subtitle){r.push({x:i.x,y:b+6+s.titleSize+6,text:t.subtitle,color:s.textColorMuted,fontSize:s.labelSize,align:i.align,baseline:"top",key:"subtitle"})}}const j=t.legend==="none"?[]:t.series.map(((t,s)=>({label:t.label,color:t.color,seriesIndex:s,hidden:t.hidden,x:0,y:0})));return{width:i,height:n,plot:w,background:s.background==="transparent"?undefined:s.background,gridlines:[],axisLines:[],areas:[],bars:[],slices:V,lines:[],markers:[],texts:r,legend:j,legendPosition:t.legend,polar:true,xPositions:N,xValues:t.categories,xLabels:c,hoverPoints:K}}function E(t,s,i){const n=t-i.cx;const e=s-i.cy;const o=Math.hypot(n,e);if(o<i.innerR||o>i.outerR)return false;const h=Math.min(i.startAngle,i.endAngle);const c=Math.max(i.startAngle,i.endAngle);const a=Math.PI*2;let r=(Math.atan2(e,n)-h)%a;if(r<0)r+=a;return r<=c-h}function P(t,s,i){for(const n of t)if(n.endAngle!==n.startAngle&&E(s,i,n))return n;return null}const V=.62;const K=200;const N=220;const _=(t,s)=>`${t}:${s??-1}`;function j(t,s,i){return{...t,slices:t.slices.map((t=>{const n=s.get(_(t.dataIndex,t.seriesIndex))??0;return n>.002?{...t,color:S(t.color,i,V*n)}:t}))}}const G=(t,s,i)=>t+(s-t)*i;const H=260;function O(t){const s=(t.xValues??[]).map((t=>t==null?"":String(t)));const i=s.length>0&&new Set(s).size===s.length;return i?t=>`${t.seriesIndex}::${s[t.dataIndex]??t.dataIndex}`:t=>`${t.seriesIndex}#${t.dataIndex}`}function Z(t,s){return O(t)(s)}function J(t){const s=O(t);const i=new Map;return t.bars.map((t=>{const n=s(t);const e=i.get(n)??0;i.set(n,e+1);return e===0?n:`${n}~${e}`}))}function U(t){const s=J(t);const i=new Map;t.bars.forEach(((t,n)=>i.set(s[n],t)));return i}function Q(t,s,i){return{...s,x:G(t.x,s.x,i),y:G(t.y,s.y,i),w:G(t.w,s.w,i),h:G(t.h,s.h,i)}}function X(t,s){if(t.bars.length!==s.bars.length)return true;const i=U(t);for(const t of s.bars){const n=i.get(Z(s,t));if(!n)return true;if(Math.abs(n.x-t.x)>.5||Math.abs(n.y-t.y)>.5||Math.abs(n.w-t.w)>.5||Math.abs(n.h-t.h)>.5)return true}return false}class Y{constructor(t){this.container=t;this.ctx=null;this.spec=null;this.theme=null;this.scene=null;this.cb={};this.hoverRaf=0;this.lastHoverIndex=-2;this.hoverEnabled=true;this.clickable=false;this.hoverOpts={};this.hasRendered=false;this.introRaf=0;this.lastDpr=1;this.followRaf=0;this.followLast=0;this.hoverSlice=null;this.dimAnim=new Map;this.dimRaf=0;this.dimLast=0;this.lastPointer={x:0,y:0};this.tooltipTimer=0;this.tooltipShown=false;this.displayed=null;this.pendingDrill=null;this.drillArmRaf=0;this.lastW=0;this.lastH=0;this.dprWatch=m((()=>this.render()));this.rtl=false;this.dirWatch=y((()=>{if(b(this.container)!==this.rtl)this.render()}));this.followStep=t=>{if(!this.scene){this.followRaf=0;return}const s=this.followLast?t-this.followLast:16;this.followLast=t;const i=this.renderFollow(Math.min(1,s/H));this.followRaf=i?requestAnimationFrame(this.followStep):0};this.stepDim=t=>{if(!this.scene||!this.theme){this.dimRaf=0;return}const s=this.dimLast?t-this.dimLast:16;this.dimLast=t;let i=false;for(const t of this.scene.slices){const n=_(t.dataIndex,t.seriesIndex);const e=this.dimTarget(t);const o=this.dimAnim.get(n)??0;let h=o+Math.sign(e-o)*(s/K);if((e-o)*(e-h)<=0)h=e;this.dimAnim.set(n,h);if(h!==e)i=true}this.drawGeometry(j(this.scene,this.dimAnim,this.theme.surface),this.lastDpr);this.dimRaf=i?requestAnimationFrame(this.stepDim):0};this.handlePointerMove=t=>{if(!this.scene||!this.spec||!this.hoverEnabled)return;const s=this.canvas.getBoundingClientRect();const i=t.clientX-s.left;const n=t.clientY-s.top;if(this.spec.polar){const t=P(this.scene.slices,i,n);const s=t?{dataIndex:t.dataIndex,seriesIndex:t.seriesIndex??-1}:null;this.lastPointer={x:i,y:n};if(this.hoverRaf)cancelAnimationFrame(this.hoverRaf);this.hoverRaf=requestAnimationFrame((()=>{this.hoverRaf=0;if(!this.scene||!this.spec||!this.theme)return;this.canvas.style.cursor=s?"pointer":"";const t=s?.dataIndex!==this.hoverSlice?.dataIndex||s?.seriesIndex!==this.hoverSlice?.seriesIndex;if(t){this.hoverSlice=s;this.startDim();this.armTooltip(s)}else if(this.tooltipShown&&s){this.showPolarTooltip(s)}const i=s?s.dataIndex:-1;if(i!==this.lastHoverIndex){this.lastHoverIndex=i;this.cb.onHover?.(i)}}));return}const e=$(this.scene.xPositions,this.spec.horizontal?n:i);if(this.hoverRaf)cancelAnimationFrame(this.hoverRaf);this.hoverRaf=requestAnimationFrame((()=>{this.hoverRaf=0;if(!this.scene||!this.spec||!this.theme)return;this.canvas.style.cursor=this.clickable&&this.overBar(i,n)?"pointer":"";M(this.hoverLayer,this.scene,e,this.spec.valueFormatter,this.theme.fontFamily,{x:i,y:n},this.spec.horizontal?"horizontal":"vertical",-1,this.hoverOpts);if(e!==this.lastHoverIndex){this.lastHoverIndex=e;this.cb.onHover?.(e)}}))};this.handlePointerLeave=()=>{if(this.hoverRaf){cancelAnimationFrame(this.hoverRaf);this.hoverRaf=0}this.canvas.style.cursor="";p(this.hoverLayer);if(this.spec?.polar&&this.scene){clearTimeout(this.tooltipTimer);this.tooltipShown=false;this.canvas.style.cursor="";if(this.hoverSlice){this.hoverSlice=null;this.startDim()}}if(this.lastHoverIndex!==-1){this.lastHoverIndex=-1;this.cb.onHover?.(-1)}};this.handleClick=t=>{if(!this.scene||!this.cb.onPointClick)return;const s=this.canvas.getBoundingClientRect();const i=t.clientX-s.left;const n=t.clientY-s.top;for(const s of this.scene.bars){if(i>=s.x&&i<=s.x+s.w&&n>=s.y&&n<=s.y+s.h){this.cb.onPointClick(s.seriesIndex,s.dataIndex,t);return}}};this.onLegendToggle=t=>{if(this.spec){this.spec.series[t.seriesIndex].hidden=!this.spec.series[t.seriesIndex].hidden;this.hasRendered=false;this.render();this.cb.onLegendClick?.({...t,hidden:this.spec.series[t.seriesIndex].hidden})}else{this.cb.onLegendClick?.(t)}};if(getComputedStyle(t).position==="static")t.style.position="relative";this.canvas=document.createElement("canvas");this.canvas.style.cssText="position:absolute;inset:0;width:100%;height:100%;display:block";this.canvas.setAttribute("part","plot-canvas");this.overlay=document.createElement("div");this.overlay.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden";this.legendLayer=document.createElement("div");this.legendLayer.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:visible";this.barLabelLayer=document.createElement("div");this.barLabelLayer.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden";this.hoverLayer=document.createElement("div");this.hoverLayer.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden";t.append(this.canvas,this.overlay,this.legendLayer,this.barLabelLayer,this.hoverLayer);this.ctx=this.canvas.getContext("2d");this.canvas.addEventListener("pointermove",this.handlePointerMove);this.canvas.addEventListener("pointerleave",this.handlePointerLeave);this.canvas.addEventListener("click",this.handleClick)}getScene(){return this.scene}setHoverEnabled(t){this.hoverEnabled=t;if(!t)p(this.hoverLayer)}setClickable(t){this.clickable=t;if(!t)this.canvas.style.cursor=""}overBar(t,s){return!!this.scene?.bars.some((i=>t>=i.x&&t<=i.x+i.w&&s>=i.y&&s<=i.y+i.h))}setTooltip(t){this.hoverOpts=t}setSpec(t,s,i={},n={}){this.spec=t;this.theme=s;this.cb=i;this.render(n)}resize(){const t=this.container.getBoundingClientRect();if(Math.round(t.width)===this.lastW&&Math.round(t.height)===this.lastH)return;this.render()}toDataURL(t="image/png"){return typeof this.canvas.toDataURL==="function"?this.canvas.toDataURL(t):""}dispose(){if(this.hoverRaf)cancelAnimationFrame(this.hoverRaf);this.stopIntro();cancelAnimationFrame(this.drillArmRaf);cancelAnimationFrame(this.dimRaf);cancelAnimationFrame(this.followRaf);clearTimeout(this.tooltipTimer);this.canvas.removeEventListener("pointermove",this.handlePointerMove);this.canvas.removeEventListener("pointerleave",this.handlePointerLeave);this.canvas.removeEventListener("click",this.handleClick);this.dprWatch.dispose();this.dirWatch.dispose();this.canvas.remove();this.overlay.remove();this.barLabelLayer.remove();this.hoverLayer.remove();this.spec=null;this.scene=null}render(t={}){if(!this.spec||!this.theme)return;this.dprWatch.update();const s=this.container.getBoundingClientRect();const i=Math.round(s.width);const n=Math.round(s.height);if(i<2||n<2)return;const e=this.scene;const o=i!==this.lastW||n!==this.lastH;this.lastW=i;this.lastH=n;const h=Math.min(window.devicePixelRatio||1,4);this.lastDpr=h;this.hoverSlice=null;this.dimAnim.clear();cancelAnimationFrame(this.dimRaf);this.dimRaf=0;if(this.hoverRaf){cancelAnimationFrame(this.hoverRaf);this.hoverRaf=0}clearTimeout(this.tooltipTimer);this.tooltipShown=false;this.canvas.width=i*h;this.canvas.height=n*h;const c=this.scene?.xPositions.length??0;this.rtl=b(this.container);const a=()=>{const t=R(this.spec,this.theme,i,n);return this.rtl?F(t):t};this.scene=a();if(this.lastHoverIndex>=0){if(this.lastHoverIndex<this.scene.xPositions.length&&c===this.scene.xPositions.length){this.focusIndexInternal(this.lastHoverIndex)}else{p(this.hoverLayer);this.lastHoverIndex=-1}}g(this.overlay,this.scene,this.theme.fontFamily,{onLegendClick:this.onLegendToggle},this.rtl,this.legendLayer);const r=this.legendLayer.querySelector('[part="legend"]');if(r&&this.spec.legend&&this.spec.legend!=="none"){const t=this.spec.legend==="left"||this.spec.legend==="right";const s=t?r.offsetWidth:r.offsetHeight;if(s>0&&Math.abs((this.spec.legendExtent??-1)-s)>2){this.spec.legendExtent=s;this.scene=a();g(this.overlay,this.scene,this.theme.fontFamily,{onLegendClick:this.onLegendToggle},this.rtl,this.legendLayer)}}const{variant:l,duration:f}=w(this.spec);const u=this.pendingDrill;const d=v();const x=l!=="none"&&!d;const m=this.scene.bars.length>0||this.scene.slices.length>0;const y=!this.hasRendered&&x;if(u&&x){this.hasRendered=true;this.playDrill(h,u,f);return}if(y){this.hasRendered=m;this.playIntro(h,l,f);return}this.hasRendered=this.hasRendered||m;const M=!!e&&X(e,this.scene);if(t.animate!==false&&!d&&!o&&e&&(M||this.followRaf)){this.stopIntro();this.ensureFollow();return}this.stopIntro();cancelAnimationFrame(this.followRaf);this.followRaf=0;this.paint(this.scene,h);this.displayed=U(this.scene)}drill(t,s="down"){const i=this.scene;if(!i)return;const n=!!this.spec?.horizontal;if(s==="up"){this.arm(n?{from:i.plot.y,size:i.plot.height,split:false}:{from:i.plot.x,size:i.plot.width,split:false});return}const e=i.bars.filter((s=>s.dataIndex===t));if(!e.length){this.arm(null);return}const o=Math.min(...e.map((t=>n?t.y:t.x)));const h=Math.max(...e.map((t=>n?t.y+t.h:t.x+t.w)));this.arm({from:o,size:Math.max(1,h-o),split:true})}arm(t){this.pendingDrill=t;cancelAnimationFrame(this.drillArmRaf);if(!t)return;this.drillArmRaf=requestAnimationFrame((()=>{this.pendingDrill=null}))}clearIntroOpacity(){this.canvas.style.opacity="";this.barLabelLayer.style.opacity=""}stopIntro(){cancelAnimationFrame(this.introRaf);this.introRaf=0;this.clearIntroOpacity()}playDrill(t,s,i){const n=this.scene;if(!n)return;this.stopIntro();this.paint(k(n,s.from,s.size,0,s.split),t);let e=0;const o=h=>{if(!e)e=h;const c=(h-e)/i;if(c>=1){this.displayed=U(n);this.paint(n,t);return}this.paint(k(n,s.from,s.size,c,s.split),t);this.introRaf=requestAnimationFrame(o)};this.introRaf=requestAnimationFrame(o)}replay(){this.hasRendered=false;this.render()}drawGeometry(t,s){if(this.ctx){this.ctx.setTransform(s,0,0,s,0,0);I(this.ctx,t)}}paint(t,s){this.drawGeometry(t,s);A(this.barLabelLayer,t,this.theme?.fontFamily)}playIntro(t,s,i){const n=this.scene;if(!n)return;this.stopIntro();const e=t=>{const s=t<1?String(t):"";this.canvas.style.opacity=s;this.barLabelLayer.style.opacity=s};const o=z(s,n,0);e(o.alpha);this.paint(o.scene,t);let h=0;const c=o=>{if(!h)h=o;const a=(o-h)/i;if(a>=1){e(1);this.displayed=U(n);this.paint(n,t);return}const{scene:r,alpha:l}=z(s,n,a);e(l);this.paint(r,t);this.introRaf=requestAnimationFrame(c)};this.introRaf=requestAnimationFrame(c)}ensureFollow(){if(!this.scene)return;if(v()){cancelAnimationFrame(this.followRaf);this.followRaf=0;this.displayed=U(this.scene);this.paint(this.scene,this.lastDpr);return}const t=this.renderFollow(0);if(t&&!this.followRaf){this.followLast=0;this.followRaf=requestAnimationFrame(this.followStep)}}renderFollow(t){const s=this.scene;if(!s)return false;const i=J(s);const n=this.displayed??U(s);const e=new Map;const o=[];let h=false;s.bars.forEach(((s,c)=>{const a=i[c];const r=n.get(a);const l=r?Q(r,s,t):s;e.set(a,l);o.push(l);if(Math.abs(l.x-s.x)>.3||Math.abs(l.y-s.y)>.3||Math.abs(l.w-s.w)>.3||Math.abs(l.h-s.h)>.3)h=true}));this.displayed=e;this.paint({...s,bars:o},this.lastDpr);return h}focusIndex(t){this.lastHoverIndex=t;this.focusIndexInternal(t)}focusIndexInternal(t){if(!this.scene||!this.spec||!this.theme)return;if(this.spec.polar){const s=t<0?null:{dataIndex:t,seriesIndex:-1};if(s?.dataIndex!==this.hoverSlice?.dataIndex||s?.seriesIndex!==this.hoverSlice?.seriesIndex){this.hoverSlice=s;this.startDim()}}if(t<0){p(this.hoverLayer);return}const s=!!this.spec.horizontal;const i=this.scene.hoverPoints.map((s=>s.byIndex[t])).find(Boolean);const n=this.scene.xPositions[t]??0;const e=i?{x:i.x,y:i.y}:{x:s?this.scene.plot.x:n,y:s?n:this.scene.plot.y};M(this.hoverLayer,this.scene,t,this.spec.valueFormatter,this.theme.fontFamily,e,this.spec.polar?"none":s?"horizontal":"vertical",-1,this.hoverOpts)}dimTarget(t){const s=this.hoverSlice;if(!s)return 0;if(s.seriesIndex<0)return t.dataIndex===s.dataIndex?0:1;return t.dataIndex===s.dataIndex&&t.seriesIndex===s.seriesIndex?0:1}startDim(){if(!this.scene||!this.theme)return;if(v()){cancelAnimationFrame(this.dimRaf);this.dimRaf=0;for(const t of this.scene.slices)this.dimAnim.set(_(t.dataIndex,t.seriesIndex),this.dimTarget(t));this.drawGeometry(j(this.scene,this.dimAnim,this.theme.surface),this.lastDpr);return}if(!this.dimRaf){this.dimLast=0;this.dimRaf=requestAnimationFrame(this.stepDim)}}armTooltip(t){clearTimeout(this.tooltipTimer);p(this.hoverLayer);this.tooltipShown=false;if(!t)return;this.tooltipTimer=window.setTimeout((()=>{const s=this.hoverSlice;if(s&&s.dataIndex===t.dataIndex&&s.seriesIndex===t.seriesIndex){this.showPolarTooltip(t);this.tooltipShown=true}}),N)}showPolarTooltip(t){if(!this.scene||!this.spec||!this.theme)return;M(this.hoverLayer,this.scene,t.dataIndex,this.spec.valueFormatter,this.theme.fontFamily,this.lastPointer,"none",t.seriesIndex,{...this.hoverOpts,trigger:"item"})}}export{Y as B};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{v as t,x as s,y as i,z as n,A as e,B as o,C as h,D as c,E as a,F as r,G as l,H as f,I as u,J as d,K as x,w as m,a as y,r as M,c as p,i as b,s as g,p as v,b as w,L as k,f as I,M as A,g as z,m as F,N as S}from"./p-CVFH1DkU.js";import{n as $}from"./p-CGqeEMjY.js";function L(t,s){return t.length*s*.58}function T(t,s){const i=t[1];const n=s[1];if(!(i>0)||!(n>0))return[t,s];const e=t[0]<0?-t[0]/i:0;const o=s[0]<0?-s[0]/n:0;const h=Math.max(e,o);if(h<=0)return[t,s];return[[-h*i,i],[-h*n,n]]}function B(t,s,i){if(s<=0||L(t,i)<=s)return t;const n=i*.58;const e=Math.floor(s/n)-1;return e>=1?`${t.slice(0,e)}…`:""}function C(t,s){const i=t.categories.length||Math.max(0,...t.series.map((t=>(t.range??t.data??[]).length)));const n=t.stack!=="none";const e=t.series.map((t=>n&&!t.range?t.stack||"stacked":"__unstacked__"));const o=h(t.series.map((t=>t.hidden||t.range?[]:t.data??[])),t.stack,e);t.series.forEach(((t,s)=>{if(!t.range||t.hidden)return;o[s]=t.range.map((t=>t?[Math.min(t[0],t[1]),Math.max(t[0],t[1])]:t))}));const d=[];t.series.forEach(((t,s)=>{if(t.hidden)return;o[s].forEach((t=>{if(t)d.push(t[0],t[1])}))}));const x=s=>(t.series[s].axisIndex??0)===1;const m=!!t.valueAxis2&&t.series.some(((t,s)=>!t.hidden&&x(s)));const y=[];if(m){d.length=0;t.series.forEach(((t,s)=>{if(t.hidden)return;o[s].forEach((t=>{if(t)(x(s)?y:d).push(t[0],t[1])}))}))}let M=l(d,{min:t.valueMin,max:t.valueMax,scale:t.valueScale,includeZero:true});let p=m?l(y,{min:t.valueAxis2.min,max:t.valueAxis2.max,scale:t.valueScale,includeZero:true}):M;if(m&&t.valueScale==="value"&&t.valueMin==null&&t.valueMax==null&&t.valueAxis2.min==null&&t.valueAxis2.max==null){[M,p]=T(M,p)}const b=c(t.valueBreaks,d,t.valueScale);const g={...b,ranges:a(r(b.ranges,M),M,t.valueScale)};const v=f(M,g.ranges,t.valueScale,6).filter((t=>!u(g.ranges,t)));const w=v.map((s=>(t.valueTickFormatter??t.valueFormatter)(s)));const k=t.valueAxis2?.formatter??t.valueTickFormatter??t.valueFormatter;const I=m&&!t.valueAxis2.hidden?f(p,[],t.valueScale,6):[];const A=I.map((t=>k(t)));const z=Math.max(0,...A.map((t=>L(t,s.labelSize))));const F=[];for(let s=0;s<i;s++)F.push(t.categoryFormatter(t.categories[s]??s));return{C:i,stacked:n,stackKeys:e,bands:o,onAxis2:x,hasAxis2:m,vDomain:M,vDomain2:p,vBreaks:g,vTickVals:v,vTickLabels:w,v2TickVals:I,v2TickLabels:A,maxV2LabelW:z,catLabels:F}}function q(t,s,i,n,e,o,h){const c=i?s.y:s.x;const a=i?s.height:s.width;const r=t.series.find((t=>!t.hidden&&t.pointWidths))?.pointWidths;const l=t=>{const s=r?.[t];return typeof s==="number"&&Number.isFinite(s)&&s>0?s:1};let f=0;const u=[];for(let t=0;t<n;t++){u.push(f);f+=l(t)}if(f<=0)f=Math.max(1,n);const d=t=>n>0?a*l(t)/f:a;const x=t=>c+a*u[t]/f;const m=t=>x(t)+d(t)/2;const y=s=>d(s)*(1-t.categoryGapRatio);const M=t.series.map(((t,s)=>s)).filter((s=>!t.series[s].hidden&&!t.series[s].overlay));const p=[];for(const t of M){const s=o[t];if(!p.includes(s))p.push(s)}const b=e?Math.max(1,p.length):Math.max(1,M.length);const g=s=>y(s)/(b+(b-1)*t.barGapRatio);const v=new Map;const w=new Map;if(e){for(let s=0;s<n;s++){const i=new Map;const n=new Map;t.series.forEach(((t,e)=>{if(t.hidden)return;const c=h[e][s];if(!c)return;const a=`${o[e]}|${s}`;if(c[1]>(i.get(a)??-Infinity)){i.set(a,c[1]);v.set(a,e)}if(c[0]<(n.get(a)??Infinity)){n.set(a,c[0]);w.set(a,e)}}))}}return{sizeAt:d,bandCenter:m,groupInnerAt:y,barWAt:g,groupNames:p,visibleIdx:M,topSeriesFor:v,botSeriesFor:w,mainLen:a}}function D(t,s,i,n,e,o,h,c,a){const r=t.subtitle?s.labelSize+4:0;const l=t.title?s.titleSize+10+r:0;const f=t.valueHidden||t.valueHideTicks?0:Math.max(0,...h.map((t=>L(t,s.labelSize))));const u=t.categoryHidden||t.categoryHideTicks?0:Math.max(0,...c.map((t=>L(t,s.labelSize))));const x=t.showLabels?Math.max(0,...t.series.flatMap((i=>i.range?i.range.flatMap((i=>i?[L(t.valueFormatter(i[0]),s.labelSize),L(t.valueFormatter(i[1]),s.labelSize)]:[])):(i.data??[]).map((i=>typeof i==="number"?L(t.valueFormatter(i),s.labelSize):0))))):0;const m=t.valueLabel?s.labelSize+6:0;const y=t.categoryLabel?s.labelSize+6:0;const M=s.labelSize+8;const p=!e?t.categoryLabelRotation??0:0;const b=Math.abs(p)*Math.PI/180;const g=p?u*Math.sin(b)+s.labelSize*Math.cos(b)+8:M;const v=!!t.legend&&t.legend!=="none"&&t.series.length>1;const w=v&&(t.legend==="left"||t.legend==="right");const k=v&&!w&&t.legend.startsWith("bottom");const I=v&&!w&&!k;const A=I||k?d(t.series.map((t=>t.label)),s.labelSize,i*.86):1;const z=t.legendExtent!=null&&(I||k)?t.legendExtent+8:A*(s.labelSize+8)+6;const F=I?z:0;const S=k?z:0;const $=w?t.legendExtent!=null?t.legendExtent+16:Math.max(0,...t.series.map((t=>L(t.label,s.labelSize))))+34:0;const T=t.legend==="left"?$:0;const B=t.legend==="right"?$:0;const C=(t.showLabels||t.showTotals)&&t.series.some((t=>!t.hidden&&(!!t.range||(t.data??[]).some((t=>typeof t==="number"&&t<0)))));const q=!!t.categoryLabelsMirrored&&e&&!t.categoryHidden&&!t.categoryHideTicks;const D=!!t.compact;const R=C?e?x+8:s.labelSize+4:0;let E;let W;let V;let P;if(D){E=W=V=P=2}else if(e){E=l+8+F;P=u+12+y+T+(C?x+8:0);V=(t.valueHidden||t.valueHideTicks?0:M)+m+6+S;W=12+(t.showLabels?x+8:0)+B+(q?u+12:0)}else{E=l+8+F+(t.showLabels?s.labelSize+4:0);W=12+B+(t.showLabels?x/2:0)+(o?a+10+(t.valueAxis2.label?s.labelSize+6:0):0);P=f+10+m+T;V=(t.categoryHidden||t.categoryHideTicks?0:g)+y+6+S+(C?s.labelSize+4:0)}const N={x:P,y:E,width:Math.max(1,i-P-W),height:Math.max(1,n-E-V)};return{plot:N,compact:D,legendBandTop:F,legendBandBottom:S,lowEndRoom:R,mirrorCats:q,maxDataLabelW:x,catRot:p,catRotRad:b}}function R(h,c,a,r){const l=h.horizontal;const{C:f,stacked:u,stackKeys:d,bands:m,onAxis2:y,hasAxis2:M,vDomain:p,vDomain2:b,vBreaks:g,vTickVals:v,vTickLabels:w,v2TickVals:k,v2TickLabels:I,maxV2LabelW:A,catLabels:z}=C(h,c);if(h.polar)return E(h,c,a,r,m,p,z,f);const{plot:F,compact:S,legendBandTop:$,legendBandBottom:T,lowEndRoom:R,mirrorCats:W,maxDataLabelW:V,catRot:P,catRotRad:N}=D(h,c,a,r,l,M,w,z,A);const _=l?F.width:F.height;const j=t(p,_,h.valueScale,g.ranges,g.sizing);const G=Math.min(p[1],Math.max(p[0],0));const H=M?t(b,_,h.valueScale,[],g.sizing):j;const K=t=>l?F.x+j.scale(t):F.y+F.height-j.scale(t);const U=t=>l?F.x+H.scale(t):F.y+F.height-H.scale(t);const Z=(t,s)=>M&&y(t)?U(s):K(s);const J=K(G);const O=(j.breaks??[]).map((t=>l?{lo:F.x+t.px,hi:F.x+t.px+t.gap}:{lo:F.y+F.height-t.px-t.gap,hi:F.y+F.height-t.px}));const Y=t=>{if(!O.length)return[t];const s=l?t.x:t.y;const i=s+(l?t.w:t.h);let n=[{lo:s,hi:i}];for(const t of O){const s=[];for(const i of n){if(t.hi<=i.lo||t.lo>=i.hi){s.push(i);continue}if(t.lo>i.lo)s.push({lo:i.lo,hi:t.lo});if(t.hi<i.hi)s.push({lo:t.hi,hi:i.hi})}n=s}if(n.length===1&&n[0].lo===s&&n[0].hi===i)return[t];return n.filter((t=>t.hi-t.lo>.5)).map(((s,i,n)=>({...t,radius:i===(l?n.length-1:0)?t.radius:[0,0,0,0],...l?{x:s.lo,w:s.hi-s.lo}:{y:s.lo,h:s.hi-s.lo}})))};const{sizeAt:Q,bandCenter:X,groupInnerAt:tt,barWAt:st,groupNames:it,visibleIdx:nt,topSeriesFor:et,botSeriesFor:ot,mainLen:ht}=q(h,F,l,f,u,d,m);const ct=[];const at=[];const rt=[];const lt=[];const ft=h.cornerRadius;h.series.forEach(((t,i)=>{if(t.hidden)return;const n=u?Math.max(0,it.indexOf(d[i])):Math.max(0,nt.indexOf(i));const e={};for(let o=0;o<f;o++){const a=m[i][o];if(!a)continue;const r=!!t.range;const f=r?null:t.data[o];const y=typeof f==="number"?f:a[1];const M=Z(i,a[0]);const p=Z(i,a[1]);const b=t.overlay?Q(o)*(t.widthRatio??.45):st(o);const g=b*h.barGapRatio;const v=h.barWidth!=null&&!t.overlay?Math.min(Math.max(1,h.barWidth),b):b;const w=t.overlay?X(o)-b/2:X(o)-tt(o)/2+n*(b+g);const k=w+(b-v)/2;const I=y>=0;const A=`${d[i]}|${o}`;const z=I?a[0]===0:a[1]===0;const F=r||!u||(I?et.get(A)===i:ot.get(A)===i);const S=h.chevron?Math.min(v*.03,5,Math.abs(p-M)*.35):0;const $=h.chevron?x(v)-S/2:0;let T;if(l){const s=Math.min(M,p)+S/2;const n=Math.abs(p-M)-S;const c=r?[ft,ft,ft,ft]:F?I?[0,ft,ft,0]:[ft,0,0,ft]:[0,0,0,0];T={x:s,y:k,w:n,h:v,color:t.pointColors?.[o]??t.color,radius:c,seriesIndex:i,dataIndex:o,horizontal:true,arrow:h.chevron?I?1:-1:undefined,notch:h.chevron?!z:undefined};e[o]={x:I?Math.max(M,p)+$:Math.min(M,p)-$,y:k+v/2,value:y,color:T.color,...r?{low:a[0],high:a[1]}:null}}else{const s=Math.min(M,p)+S/2;const n=Math.abs(p-M)-S;const c=r?[ft,ft,ft,ft]:F?I?[ft,ft,0,0]:[0,0,ft,ft]:[0,0,0,0];T={x:k,y:s,w:v,h:n,color:t.pointColors?.[o]??t.color,radius:c,seriesIndex:i,dataIndex:o,horizontal:false,arrow:h.chevron?I?1:-1:undefined,notch:h.chevron?!z:undefined};e[o]={x:k+v/2,y:I?Math.min(M,p)-$:Math.max(M,p)+$,value:y,color:T.color,...r?{low:a[0],high:a[1]}:null}}ct.push(...Y(T));if(h.showLabels&&r){lt.push({seriesIndex:i,dataIndex:o,text:h.valueFormatter(a[0]),color:c.textColor,size:c.labelSize,atLowEnd:true},{seriesIndex:i,dataIndex:o,text:h.valueFormatter(a[1]),color:c.textColor,size:c.labelSize,atLowEnd:false})}else if(h.showLabels&&u&&typeof f==="number"){const t=h.stack==="percentage"?Math.abs(a[1]-a[0])*(f<0?-1:1):f;const n=h.valueFormatter(t);const e=l?T.w>L(n,c.labelSize)+8&&T.h>c.labelSize:T.h>c.labelSize+6&&T.w>L(n,c.labelSize)+4;if(e){lt.push({seriesIndex:i,dataIndex:o,text:n,color:s(T.color),size:c.labelSize,fontWeight:600,inside:true})}}else if(h.showLabels&&typeof f==="number"){lt.push({seriesIndex:i,dataIndex:o,text:h.valueFormatter(f),color:c.textColor,size:c.labelSize,atLowEnd:!I})}}at.push({seriesIndex:i,color:t.color,label:t.label,byIndex:e,values:t.range?m[i].map((t=>t?t[1]:null)):t.data})}));if(h.showTotals&&u&&h.stack!=="percentage"){for(let t=0;t<f;t++){for(const s of it){let i=-Infinity;let n=Infinity;let e=0;let o=false;h.series.forEach(((h,c)=>{if(h.hidden||d[c]!==s)return;const a=m[c][t];const r=h.data?.[t];if(!a)return;o=true;i=Math.max(i,a[1]);n=Math.min(n,a[0]);if(typeof r==="number")e+=r}));if(!o)continue;const a=h.valueFormatter(e);const r=i>0||n>=0;const l=r?et.get(`${s}|${t}`):ot.get(`${s}|${t}`);if(l==null)continue;lt.push({seriesIndex:l,dataIndex:t,text:a,color:c.textColor,size:c.labelSize,fontWeight:600,atLowEnd:!r})}}}const ut=[];const dt=[];const xt=5;const mt=F.y+F.height;const yt=i(h.valueDash);const Mt=i(h.valueGridDash);const pt=i(h.categoryDash);if(!h.valueHidden&&!S){for(const t of v){const s=K(t);if(l){ut.push({x1:s,y1:F.y,x2:s,y2:mt,color:c.gridLineColor,width:1,dash:Mt});if(h.axisTicks)dt.push({x1:s,y1:mt,x2:s,y2:mt+xt,color:c.axisLineColor,width:1,dash:yt})}else{ut.push({x1:F.x,y1:s,x2:F.x+F.width,y2:s,color:c.gridLineColor,width:1,dash:Mt});if(h.axisTicks)dt.push({x1:F.x-xt,y1:s,x2:F.x,y2:s,color:c.axisLineColor,width:1,dash:yt})}}}if(!S){const t=h.categoryAxisLine!==false;const s=h.valueAxisLine!==false;const i=j.breaks??[];if(t){dt.push(l?{x1:F.x,y1:F.y,x2:F.x,y2:F.y+F.height,color:c.axisLineColor,width:1,dash:pt}:{x1:F.x,y1:F.y+F.height,x2:F.x+F.width,y2:F.y+F.height,color:c.axisLineColor,width:1,dash:pt})}if(s){if(l){const t=i.map((t=>({px:t.px,gap:t.gap})));dt.push(...n("x",F.x,F.x+F.width,F.y+F.height,t,c.axisLineColor,yt));for(const s of t)dt.push(...e("x",F.x+s.px,F.x+s.px+s.gap,F.y,F.y+F.height,c.axisLineColor))}else{const t=i.map((t=>({px:F.height-t.px-t.gap,gap:t.gap})));dt.push(...n("y",F.y,F.y+F.height,F.x,t,c.axisLineColor,yt));for(const s of t)dt.push(...e("y",F.y+s.px,F.y+s.px+s.gap,F.x,F.x+F.width,c.axisLineColor))}}}if(h.title&&!S){const t=o(h.titleAlign,F.x,F.width);rt.push({x:t.x,y:$+6,text:h.title,color:c.textColor,fontSize:c.titleSize,fontWeight:600,align:t.align,baseline:"top",key:"title"});if(h.subtitle){rt.push({x:t.x,y:$+6+c.titleSize+4,text:h.subtitle,color:c.textColorMuted,fontSize:c.labelSize,align:t.align,baseline:"top",key:"subtitle"})}}if(M&&!h.valueAxis2.hidden&&!S&&!l){const t=F.x+F.width;dt.push({x1:t,y1:F.y,x2:t,y2:F.y+F.height,color:c.axisLineColor,width:1,dash:yt});k.forEach(((s,i)=>{const n=U(s);if(h.axisTicks)dt.push({x1:t,y1:n,x2:t+xt,y2:n,color:c.axisLineColor,width:1,dash:yt});rt.push({x:t+8,y:n,text:I[i],color:c.textColorMuted,fontSize:c.labelSize,align:"start",baseline:"middle",key:`v2t-${i}`})}));if(h.valueAxis2.label){rt.push({x:a-4,y:F.y+F.height/2,text:h.valueAxis2.label,color:c.textColor,fontSize:c.labelSize,align:"center",baseline:"bottom",rotate:-90,key:"val2-axis-title"})}}if(!h.valueHidden&&!h.valueHideTicks&&!S){v.forEach(((t,s)=>{const i=K(t);if(l){rt.push({x:i,y:F.y+F.height+6,text:w[s],color:c.textColorMuted,fontSize:c.labelSize,align:"center",baseline:"top",key:`vt-${s}`})}else{rt.push({x:F.x-8,y:i,text:w[s],color:c.textColorMuted,fontSize:c.labelSize,align:"end",baseline:"middle",key:`vt-${s}`})}}))}const bt=[];const gt=l?c.labelSize+6:48;const vt=Math.max(1,Math.ceil(f/Math.max(1,Math.floor(ht/gt))));for(let t=0;t<f;t++){const s=X(t);bt.push(s);const i=t%vt===0;if(h.axisTicks&&!S&&i&&!h.categoryHidden){if(l)dt.push({x1:F.x-xt,y1:s,x2:F.x,y2:s,color:c.axisLineColor,width:1});else dt.push({x1:s,y1:mt,x2:s,y2:mt+xt,color:c.axisLineColor,width:1})}if(h.categoryHidden||h.categoryHideTicks||S||!i)continue;if(l){rt.push({x:F.x-8-R,y:s,text:z[t],color:c.textColorMuted,fontSize:c.labelSize,align:"end",baseline:"middle",key:`ct-${t}`});if(W){rt.push({x:F.x+F.width+8+(h.showLabels?V+4:0),y:s,text:z[t],color:c.textColorMuted,fontSize:c.labelSize,align:"start",baseline:"middle",key:`ctm-${t}`})}}else if(P){const i=L(z[t],c.labelSize);const n=P<0?-1:1;rt.push({x:s+n*i*Math.cos(N)/2,y:F.y+F.height+6+R+i*Math.sin(N)/2,text:z[t],color:c.textColorMuted,fontSize:c.labelSize,align:"center",baseline:"middle",rotate:P,key:`ct-${t}`})}else{const i=t+vt<f?X(t+vt):s+vt*Q(t);const n=t-vt>=0?X(t-vt):s-vt*Q(t);const e=Math.min(i-s,s-n)-6;rt.push({x:s,y:F.y+F.height+6+R,text:B(z[t],e,c.labelSize),color:c.textColorMuted,fontSize:c.labelSize,align:"center",baseline:"top",key:`ct-${t}`})}}if(!S){const t=h.categoryLabel;const s=h.valueLabel;if(l){if(t)rt.push({x:4,y:F.y+F.height/2,text:t,color:c.textColor,fontSize:c.labelSize,align:"center",baseline:"top",rotate:-90,key:"cat-axis-title"});if(s)rt.push({x:F.x+F.width/2,y:r-2-T,text:s,color:c.textColor,fontSize:c.labelSize,align:"center",baseline:"bottom",key:"val-axis-title"})}else{if(s)rt.push({x:4,y:F.y+F.height/2,text:s,color:c.textColor,fontSize:c.labelSize,align:"center",baseline:"top",rotate:-90,key:"val-axis-title"});if(t)rt.push({x:F.x+F.width/2,y:r-2-T,text:t,color:c.textColor,fontSize:c.labelSize,align:"center",baseline:"bottom",key:"cat-axis-title"})}}const wt=h.legend==="none"||S?[]:h.series.map(((t,s)=>({label:t.label,color:t.color,seriesIndex:s,hidden:t.hidden,x:0,y:0})));return{width:a,height:r,plot:F,background:c.background==="transparent"?undefined:c.background,gridlines:ut,axisLines:dt,areas:[],bars:ct,slices:[],lines:[],markers:[],texts:rt,barLabels:lt,legend:wt,legendPosition:h.legend,xPositions:bt,xValues:h.categories,xLabels:z,barBaseline:J,hoverPoints:at}}function E(t,s,i,n,e,h,c,a){const r=[];const l=t.subtitle?s.labelSize+4:0;const u=t.title?s.titleSize+10+l:0;const x=!!t.legend&&t.legend!=="none"&&t.series.length>1;const m=x&&t.legend.startsWith("bottom");const y=x&&!m&&!(t.legend==="left"||t.legend==="right");const M=x?d(t.series.map((t=>t.label)),s.labelSize,i*.86):1;const p=t.legendExtent!=null&&(y||m)?t.legendExtent+8:M*(s.labelSize+8)+6;const b=y?p:0;const g=m?p:0;const v=t.categoryHidden||t.categoryHideTicks?0:Math.max(0,...c.map((t=>L(t,s.labelSize))))+12;const w={x:v,y:u+b,width:Math.max(1,i-v),height:Math.max(1,n-u-b-g)};const k=w.x+w.width/2;const I=w.y+w.height/2;const A=t.valueTickFormatter??t.valueFormatter;const z=t.valueHidden||t.valueHideTicks?[]:f(h,[],t.valueScale,8).filter((t=>t>=h[0]-1e-9&&t<=h[1]+1e-9));const F=Math.max(0,...z.map((t=>L(A(t),s.labelSize))));const S=z.length?F+18:0;const $=Math.max(8,Math.min(w.width,w.height)/2-8-S);const T=$*Math.max(0,Math.min(.9,t.polarHole??.22));const B=a>0?($-T)/a:$-T;const C=Math.max(1,B*(1-t.categoryGapRatio));const q=-Math.PI/2;const D=2*Math.PI*Math.max(.1,Math.min(1,t.polarSweep??.75));const[R,E]=h;const W=E-R||1;const V=t=>q+(t-R)/W*D;const P=[];const N=[];const _=[];for(let t=0;t<a;t++){const s=$-t*B;_.push(s-C/2)}t.series.forEach(((t,s)=>{if(t.hidden)return;const i={};for(let n=0;n<a;n++){const o=e[s][n];if(!o)continue;const h=$-n*B;const c=h-C;const a=V(o[0]);const r=V(o[1]);if(Math.abs(r-a)<1e-6)continue;P.push({cx:k,cy:I,innerR:c,outerR:h,startAngle:Math.min(a,r),endAngle:Math.max(a,r),color:t.pointColors?.[n]??t.color,dataIndex:n,seriesIndex:s,pill:true,capStart:false,capEnd:false});const l=(a+r)/2;const f=(c+h)/2;i[n]={x:k+f*Math.cos(l),y:I+f*Math.sin(l),value:typeof t.data?.[n]==="number"?t.data[n]:o[1]}}N.push({seriesIndex:s,color:t.color,label:t.label,byIndex:i,values:t.data??[]})}));for(let t=0;t<a;t++){const s=P.filter((s=>s.dataIndex===t));if(!s.length)continue;let i=s[0];let n=s[0];for(const t of s){if(t.startAngle<i.startAngle)i=t;if(t.endAngle>n.endAngle)n=t}i.capStart=true;n.capEnd=true}const j=$+16;for(const t of z){const i=V(t);const n=Math.cos(i);const e=Math.sin(i);r.push({x:k+j*n,y:I+j*e,text:A(t),color:s.textColorMuted,fontSize:s.labelSize,align:n>.35?"start":n<-.35?"end":"center",baseline:e>.35?"top":e<-.35?"bottom":"middle",key:`vt-${t}`})}if(!t.categoryHidden&&!t.categoryHideTicks){for(let t=0;t<a;t++){r.push({x:k-C/2-12,y:I-_[t],text:c[t],color:s.textColorMuted,fontSize:s.labelSize,align:"end",baseline:"middle",key:`ct-${t}`})}}if(t.title){const i=o(t.titleAlign,w.x,w.width);r.push({x:i.x,y:b+6,text:t.title,color:s.textColor,fontSize:s.titleSize,fontWeight:600,align:i.align,baseline:"top",key:"title"});if(t.subtitle){r.push({x:i.x,y:b+6+s.titleSize+6,text:t.subtitle,color:s.textColorMuted,fontSize:s.labelSize,align:i.align,baseline:"top",key:"subtitle"})}}const G=t.legend==="none"?[]:t.series.map(((t,s)=>({label:t.label,color:t.color,seriesIndex:s,hidden:t.hidden,x:0,y:0})));return{width:i,height:n,plot:w,background:s.background==="transparent"?undefined:s.background,gridlines:[],axisLines:[],areas:[],bars:[],slices:P,lines:[],markers:[],texts:r,legend:G,legendPosition:t.legend,polar:true,xPositions:_,xValues:t.categories,xLabels:c,hoverPoints:N}}function W(t,s,i){const n=t-i.cx;const e=s-i.cy;const o=Math.hypot(n,e);if(o<i.innerR||o>i.outerR)return false;const h=Math.min(i.startAngle,i.endAngle);const c=Math.max(i.startAngle,i.endAngle);const a=Math.PI*2;let r=(Math.atan2(e,n)-h)%a;if(r<0)r+=a;return r<=c-h}function V(t,s,i){for(const n of t)if(n.endAngle!==n.startAngle&&W(s,i,n))return n;return null}const P=.62;const N=200;const _=220;const j=(t,s)=>`${t}:${s??-1}`;function G(t,s,i){return{...t,slices:t.slices.map((t=>{const n=s.get(j(t.dataIndex,t.seriesIndex))??0;return n>.002?{...t,color:S(t.color,i,P*n)}:t}))}}const H=(t,s,i)=>t+(s-t)*i;const K=260;function U(t){const s=(t.xValues??[]).map((t=>t==null?"":String(t)));const i=s.length>0&&new Set(s).size===s.length;return i?t=>`${t.seriesIndex}::${s[t.dataIndex]??t.dataIndex}`:t=>`${t.seriesIndex}#${t.dataIndex}`}function Z(t,s){return U(t)(s)}function J(t){const s=U(t);const i=new Map;return t.bars.map((t=>{const n=s(t);const e=i.get(n)??0;i.set(n,e+1);return e===0?n:`${n}~${e}`}))}function O(t){const s=J(t);const i=new Map;t.bars.forEach(((t,n)=>i.set(s[n],t)));return i}function Y(t,s,i){return{...s,x:H(t.x,s.x,i),y:H(t.y,s.y,i),w:H(t.w,s.w,i),h:H(t.h,s.h,i)}}function Q(t,s){if(t.bars.length!==s.bars.length)return true;const i=O(t);for(const t of s.bars){const n=i.get(Z(s,t));if(!n)return true;if(Math.abs(n.x-t.x)>.5||Math.abs(n.y-t.y)>.5||Math.abs(n.w-t.w)>.5||Math.abs(n.h-t.h)>.5)return true}return false}class X{constructor(t){this.container=t;this.ctx=null;this.spec=null;this.theme=null;this.scene=null;this.cb={};this.hoverRaf=0;this.lastHoverIndex=-2;this.hoverEnabled=true;this.clickable=false;this.hoverOpts={};this.hasRendered=false;this.introRaf=0;this.lastDpr=1;this.followRaf=0;this.followLast=0;this.hoverSlice=null;this.dimAnim=new Map;this.dimRaf=0;this.dimLast=0;this.lastPointer={x:0,y:0};this.tooltipTimer=0;this.tooltipShown=false;this.displayed=null;this.pendingDrill=null;this.drillArmRaf=0;this.lastW=0;this.lastH=0;this.dprWatch=m((()=>this.render()));this.rtl=false;this.dirWatch=y((()=>{if(b(this.container)!==this.rtl)this.render()}));this.followStep=t=>{if(!this.scene){this.followRaf=0;return}const s=this.followLast?t-this.followLast:16;this.followLast=t;const i=this.renderFollow(Math.min(1,s/K));this.followRaf=i?requestAnimationFrame(this.followStep):0};this.stepDim=t=>{if(!this.scene||!this.theme){this.dimRaf=0;return}const s=this.dimLast?t-this.dimLast:16;this.dimLast=t;let i=false;for(const t of this.scene.slices){const n=j(t.dataIndex,t.seriesIndex);const e=this.dimTarget(t);const o=this.dimAnim.get(n)??0;let h=o+Math.sign(e-o)*(s/N);if((e-o)*(e-h)<=0)h=e;this.dimAnim.set(n,h);if(h!==e)i=true}this.drawGeometry(G(this.scene,this.dimAnim,this.theme.surface),this.lastDpr);this.dimRaf=i?requestAnimationFrame(this.stepDim):0};this.handlePointerMove=t=>{if(!this.scene||!this.spec||!this.hoverEnabled)return;const s=this.canvas.getBoundingClientRect();const i=t.clientX-s.left;const n=t.clientY-s.top;if(this.spec.polar){const t=V(this.scene.slices,i,n);const s=t?{dataIndex:t.dataIndex,seriesIndex:t.seriesIndex??-1}:null;this.lastPointer={x:i,y:n};if(this.hoverRaf)cancelAnimationFrame(this.hoverRaf);this.hoverRaf=requestAnimationFrame((()=>{this.hoverRaf=0;if(!this.scene||!this.spec||!this.theme)return;this.canvas.style.cursor=s?"pointer":"";const t=s?.dataIndex!==this.hoverSlice?.dataIndex||s?.seriesIndex!==this.hoverSlice?.seriesIndex;if(t){this.hoverSlice=s;this.startDim();this.armTooltip(s)}else if(this.tooltipShown&&s){this.showPolarTooltip(s)}const i=s?s.dataIndex:-1;if(i!==this.lastHoverIndex){this.lastHoverIndex=i;this.cb.onHover?.(i)}}));return}const e=$(this.scene.xPositions,this.spec.horizontal?n:i);if(this.hoverRaf)cancelAnimationFrame(this.hoverRaf);this.hoverRaf=requestAnimationFrame((()=>{this.hoverRaf=0;if(!this.scene||!this.spec||!this.theme)return;this.canvas.style.cursor=this.clickable&&this.overBar(i,n)?"pointer":"";M(this.hoverLayer,this.scene,e,this.spec.valueFormatter,this.theme.fontFamily,{x:i,y:n},this.spec.horizontal?"horizontal":"vertical",-1,this.hoverOpts);if(e!==this.lastHoverIndex){this.lastHoverIndex=e;this.cb.onHover?.(e)}}))};this.handlePointerLeave=()=>{if(this.hoverRaf){cancelAnimationFrame(this.hoverRaf);this.hoverRaf=0}this.canvas.style.cursor="";p(this.hoverLayer);if(this.spec?.polar&&this.scene){clearTimeout(this.tooltipTimer);this.tooltipShown=false;this.canvas.style.cursor="";if(this.hoverSlice){this.hoverSlice=null;this.startDim()}}if(this.lastHoverIndex!==-1){this.lastHoverIndex=-1;this.cb.onHover?.(-1)}};this.handleClick=t=>{if(!this.scene||!this.cb.onPointClick)return;const s=this.canvas.getBoundingClientRect();const i=t.clientX-s.left;const n=t.clientY-s.top;for(const s of this.scene.bars){if(i>=s.x&&i<=s.x+s.w&&n>=s.y&&n<=s.y+s.h){this.cb.onPointClick(s.seriesIndex,s.dataIndex,t);return}}};this.onLegendToggle=t=>{if(this.spec){this.spec.series[t.seriesIndex].hidden=!this.spec.series[t.seriesIndex].hidden;this.hasRendered=false;this.render();this.cb.onLegendClick?.({...t,hidden:this.spec.series[t.seriesIndex].hidden})}else{this.cb.onLegendClick?.(t)}};if(getComputedStyle(t).position==="static")t.style.position="relative";this.canvas=document.createElement("canvas");this.canvas.style.cssText="position:absolute;inset:0;width:100%;height:100%;display:block";this.canvas.setAttribute("part","plot-canvas");this.overlay=document.createElement("div");this.overlay.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden";this.legendLayer=document.createElement("div");this.legendLayer.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:visible";this.barLabelLayer=document.createElement("div");this.barLabelLayer.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden";this.hoverLayer=document.createElement("div");this.hoverLayer.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden";t.append(this.canvas,this.overlay,this.legendLayer,this.barLabelLayer,this.hoverLayer);this.ctx=this.canvas.getContext("2d");this.canvas.addEventListener("pointermove",this.handlePointerMove);this.canvas.addEventListener("pointerleave",this.handlePointerLeave);this.canvas.addEventListener("click",this.handleClick)}getScene(){return this.scene}setHoverEnabled(t){this.hoverEnabled=t;if(!t)p(this.hoverLayer)}setClickable(t){this.clickable=t;if(!t)this.canvas.style.cursor=""}overBar(t,s){return!!this.scene?.bars.some((i=>t>=i.x&&t<=i.x+i.w&&s>=i.y&&s<=i.y+i.h))}setTooltip(t){this.hoverOpts=t}setSpec(t,s,i={},n={}){this.spec=t;this.theme=s;this.cb=i;this.render(n)}resize(){const t=this.container.getBoundingClientRect();if(Math.round(t.width)===this.lastW&&Math.round(t.height)===this.lastH)return;this.render()}toDataURL(t="image/png"){return typeof this.canvas.toDataURL==="function"?this.canvas.toDataURL(t):""}dispose(){if(this.hoverRaf)cancelAnimationFrame(this.hoverRaf);this.stopIntro();cancelAnimationFrame(this.drillArmRaf);cancelAnimationFrame(this.dimRaf);cancelAnimationFrame(this.followRaf);clearTimeout(this.tooltipTimer);this.canvas.removeEventListener("pointermove",this.handlePointerMove);this.canvas.removeEventListener("pointerleave",this.handlePointerLeave);this.canvas.removeEventListener("click",this.handleClick);this.dprWatch.dispose();this.dirWatch.dispose();this.canvas.remove();this.overlay.remove();this.barLabelLayer.remove();this.hoverLayer.remove();this.spec=null;this.scene=null}render(t={}){if(!this.spec||!this.theme)return;this.dprWatch.update();const s=this.container.getBoundingClientRect();const i=Math.round(s.width);const n=Math.round(s.height);if(i<2||n<2)return;const e=this.scene;const o=i!==this.lastW||n!==this.lastH;this.lastW=i;this.lastH=n;const h=Math.min(window.devicePixelRatio||1,4);this.lastDpr=h;this.hoverSlice=null;this.dimAnim.clear();cancelAnimationFrame(this.dimRaf);this.dimRaf=0;if(this.hoverRaf){cancelAnimationFrame(this.hoverRaf);this.hoverRaf=0}clearTimeout(this.tooltipTimer);this.tooltipShown=false;this.canvas.width=i*h;this.canvas.height=n*h;const c=this.scene?.xPositions.length??0;this.rtl=b(this.container);const a=()=>{const t=R(this.spec,this.theme,i,n);return this.rtl?F(t):t};this.scene=a();if(this.lastHoverIndex>=0){if(this.lastHoverIndex<this.scene.xPositions.length&&c===this.scene.xPositions.length){this.focusIndexInternal(this.lastHoverIndex)}else{p(this.hoverLayer);this.lastHoverIndex=-1}}g(this.overlay,this.scene,this.theme.fontFamily,{onLegendClick:this.onLegendToggle},this.rtl,this.legendLayer);const r=this.legendLayer.querySelector('[part="legend"]');if(r&&this.spec.legend&&this.spec.legend!=="none"){const t=this.spec.legend==="left"||this.spec.legend==="right";const s=t?r.offsetWidth:r.offsetHeight;if(s>0&&Math.abs((this.spec.legendExtent??-1)-s)>2){this.spec.legendExtent=s;this.scene=a();g(this.overlay,this.scene,this.theme.fontFamily,{onLegendClick:this.onLegendToggle},this.rtl,this.legendLayer)}}const{variant:l,duration:f}=w(this.spec);const u=this.pendingDrill;const d=v();const x=l!=="none"&&!d;const m=this.scene.bars.length>0||this.scene.slices.length>0;const y=!this.hasRendered&&x;if(u&&x){this.hasRendered=true;this.playDrill(h,u,f);return}if(y){this.hasRendered=m;this.playIntro(h,l,f);return}this.hasRendered=this.hasRendered||m;const M=!!e&&Q(e,this.scene);if(t.animate!==false&&!d&&!o&&e&&(M||this.followRaf)){this.stopIntro();this.ensureFollow();return}this.stopIntro();cancelAnimationFrame(this.followRaf);this.followRaf=0;this.paint(this.scene,h);this.displayed=O(this.scene)}drill(t,s="down"){const i=this.scene;if(!i)return;const n=!!this.spec?.horizontal;if(s==="up"){this.arm(n?{from:i.plot.y,size:i.plot.height,split:false}:{from:i.plot.x,size:i.plot.width,split:false});return}const e=i.bars.filter((s=>s.dataIndex===t));if(!e.length){this.arm(null);return}const o=Math.min(...e.map((t=>n?t.y:t.x)));const h=Math.max(...e.map((t=>n?t.y+t.h:t.x+t.w)));this.arm({from:o,size:Math.max(1,h-o),split:true})}arm(t){this.pendingDrill=t;cancelAnimationFrame(this.drillArmRaf);if(!t)return;this.drillArmRaf=requestAnimationFrame((()=>{this.pendingDrill=null}))}clearIntroOpacity(){this.canvas.style.opacity="";this.barLabelLayer.style.opacity=""}stopIntro(){cancelAnimationFrame(this.introRaf);this.introRaf=0;this.clearIntroOpacity()}playDrill(t,s,i){const n=this.scene;if(!n)return;this.stopIntro();this.paint(k(n,s.from,s.size,0,s.split),t);let e=0;const o=h=>{if(!e)e=h;const c=(h-e)/i;if(c>=1){this.displayed=O(n);this.paint(n,t);return}this.paint(k(n,s.from,s.size,c,s.split),t);this.introRaf=requestAnimationFrame(o)};this.introRaf=requestAnimationFrame(o)}replay(){this.hasRendered=false;this.render()}drawGeometry(t,s){if(this.ctx){this.ctx.setTransform(s,0,0,s,0,0);I(this.ctx,t)}}paint(t,s){this.drawGeometry(t,s);A(this.barLabelLayer,t,this.theme?.fontFamily)}playIntro(t,s,i){const n=this.scene;if(!n)return;this.stopIntro();const e=t=>{const s=t<1?String(t):"";this.canvas.style.opacity=s;this.barLabelLayer.style.opacity=s};const o=z(s,n,0);e(o.alpha);this.paint(o.scene,t);let h=0;const c=o=>{if(!h)h=o;const a=(o-h)/i;if(a>=1){e(1);this.displayed=O(n);this.paint(n,t);return}const{scene:r,alpha:l}=z(s,n,a);e(l);this.paint(r,t);this.introRaf=requestAnimationFrame(c)};this.introRaf=requestAnimationFrame(c)}ensureFollow(){if(!this.scene)return;if(v()){cancelAnimationFrame(this.followRaf);this.followRaf=0;this.displayed=O(this.scene);this.paint(this.scene,this.lastDpr);return}const t=this.renderFollow(0);if(t&&!this.followRaf){this.followLast=0;this.followRaf=requestAnimationFrame(this.followStep)}}renderFollow(t){const s=this.scene;if(!s)return false;const i=J(s);const n=this.displayed??O(s);const e=new Map;const o=[];let h=false;s.bars.forEach(((s,c)=>{const a=i[c];const r=n.get(a);const l=r?Y(r,s,t):s;e.set(a,l);o.push(l);if(Math.abs(l.x-s.x)>.3||Math.abs(l.y-s.y)>.3||Math.abs(l.w-s.w)>.3||Math.abs(l.h-s.h)>.3)h=true}));this.displayed=e;this.paint({...s,bars:o},this.lastDpr);return h}focusIndex(t){this.lastHoverIndex=t;this.focusIndexInternal(t)}focusIndexInternal(t){if(!this.scene||!this.spec||!this.theme)return;if(this.spec.polar){const s=t<0?null:{dataIndex:t,seriesIndex:-1};if(s?.dataIndex!==this.hoverSlice?.dataIndex||s?.seriesIndex!==this.hoverSlice?.seriesIndex){this.hoverSlice=s;this.startDim()}}if(t<0){p(this.hoverLayer);return}const s=!!this.spec.horizontal;const i=this.scene.hoverPoints.map((s=>s.byIndex[t])).find(Boolean);const n=this.scene.xPositions[t]??0;const e=i?{x:i.x,y:i.y}:{x:s?this.scene.plot.x:n,y:s?n:this.scene.plot.y};M(this.hoverLayer,this.scene,t,this.spec.valueFormatter,this.theme.fontFamily,e,this.spec.polar?"none":s?"horizontal":"vertical",-1,this.hoverOpts)}dimTarget(t){const s=this.hoverSlice;if(!s)return 0;if(s.seriesIndex<0)return t.dataIndex===s.dataIndex?0:1;return t.dataIndex===s.dataIndex&&t.seriesIndex===s.seriesIndex?0:1}startDim(){if(!this.scene||!this.theme)return;if(v()){cancelAnimationFrame(this.dimRaf);this.dimRaf=0;for(const t of this.scene.slices)this.dimAnim.set(j(t.dataIndex,t.seriesIndex),this.dimTarget(t));this.drawGeometry(G(this.scene,this.dimAnim,this.theme.surface),this.lastDpr);return}if(!this.dimRaf){this.dimLast=0;this.dimRaf=requestAnimationFrame(this.stepDim)}}armTooltip(t){clearTimeout(this.tooltipTimer);p(this.hoverLayer);this.tooltipShown=false;if(!t)return;this.tooltipTimer=window.setTimeout((()=>{const s=this.hoverSlice;if(s&&s.dataIndex===t.dataIndex&&s.seriesIndex===t.seriesIndex){this.showPolarTooltip(t);this.tooltipShown=true}}),_)}showPolarTooltip(t){if(!this.scene||!this.spec||!this.theme)return;M(this.hoverLayer,this.scene,t.dataIndex,this.spec.valueFormatter,this.theme.fontFamily,this.lastPointer,"none",t.seriesIndex,{...this.hoverOpts,trigger:"item"})}}export{X as B};
|
|
2
|
+
//# sourceMappingURL=p-DGtztV3K.js.map
|