@redvars/peacock 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BaseField-CAog9TIc.js → BaseField-BMumJpkW.js} +6 -3
- package/dist/BaseField-BMumJpkW.js.map +1 -0
- package/dist/{BaseInput-CcMfg1Y2.js → BaseInput-mWdyYv27.js} +6 -3
- package/dist/BaseInput-mWdyYv27.js.map +1 -0
- package/dist/accordion.js.map +1 -1
- package/dist/ai-badge.js +2 -2
- package/dist/ai-summary.js +2 -2
- package/dist/alert.js +2 -2
- package/dist/anchor-nav.js +2 -2
- package/dist/app-shell.js +2 -2
- package/dist/assistant-panel.js +2 -2
- package/dist/assistant-step.js +2 -2
- package/dist/assistant-steps.js +2 -2
- package/dist/avatar-group.js +2 -2
- package/dist/banner.js +2 -2
- package/dist/{base-button-Do2TUy8M.js → base-button-BJMGMcMv.js} +3 -1
- package/dist/base-button-BJMGMcMv.js.map +1 -0
- package/dist/{base-progress-BiLlZVHJ.js → base-progress-CvLVSjuy.js} +4 -2
- package/dist/base-progress-CvLVSjuy.js.map +1 -0
- package/dist/bottom-sheet.js +2 -2
- package/dist/breadcrumb.js +2 -2
- package/dist/button-group.js +4 -4
- package/dist/button.js +3 -3
- package/dist/calendar.js +2 -2
- package/dist/canvas-base-BTQMEVn_.js +788 -0
- package/dist/canvas-base-BTQMEVn_.js.map +1 -0
- package/dist/canvas-link-CtgsALq4.js +54 -0
- package/dist/canvas-link-CtgsALq4.js.map +1 -0
- package/dist/{cartesian-chart-C-f1frt0.js → cartesian-chart-DM1FC_XT.js} +3 -2
- package/dist/cartesian-chart-DM1FC_XT.js.map +1 -0
- package/dist/{cb-group-base-DeuCVx3a.js → cb-group-base-B6fa4Lll.js} +2 -2
- package/dist/{cb-group-base-DeuCVx3a.js.map → cb-group-base-B6fa4Lll.js.map} +1 -1
- package/dist/cb-group.js +3 -3
- package/dist/cb-rule.js +3 -3
- package/dist/chart-area.js +5 -4
- package/dist/chart-area.js.map +1 -1
- package/dist/chart-bar.js +5 -4
- package/dist/chart-bar.js.map +1 -1
- package/dist/chart-base-Dhxuw_Mw.js +833 -0
- package/dist/chart-base-Dhxuw_Mw.js.map +1 -0
- package/dist/chart-doughnut.js +4 -3
- package/dist/chart-doughnut.js.map +1 -1
- package/dist/chart-line.js +5 -4
- package/dist/chart-line.js.map +1 -1
- package/dist/chart-pie.js +4 -3
- package/dist/chart-pie.js.map +1 -1
- package/dist/chat-message.js +2 -2
- package/dist/chat-thread.js +2 -2
- package/dist/checkbox-group.js +4 -4
- package/dist/checkbox.js +4 -4
- package/dist/chip-set.js +3 -3
- package/dist/chip.js +4 -4
- package/dist/circular-progress.js +3 -3
- package/dist/citation.js +2 -2
- package/dist/code-editor.js +5 -4
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +2 -2
- package/dist/color-field.js +5 -5
- package/dist/color-picker.js +2 -2
- package/dist/command-palette.js +2 -2
- package/dist/comment-composer.js +5 -5
- package/dist/condition-builder.js +3 -3
- package/dist/confirm-dialog.js +2 -2
- package/dist/copy-button.js +2 -2
- package/dist/currency-field.js +5 -5
- package/dist/custom-elements-jsdocs.json +2115 -336
- package/dist/custom-elements.json +19483 -615
- package/dist/date-field.js +6 -6
- package/dist/date-picker.js +4 -2
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-field.js +6 -6
- package/dist/datetime-field.js +6 -6
- package/dist/dependency-map-layout-5KUueabk.js +1390 -0
- package/dist/dependency-map-layout-5KUueabk.js.map +1 -0
- package/dist/dependency-map.js +1605 -0
- package/dist/dependency-map.js.map +1 -0
- package/dist/description-item.js +2 -2
- package/dist/description-list.js +2 -2
- package/dist/diagram-2r11KySs.js +2029 -0
- package/dist/diagram-2r11KySs.js.map +1 -0
- package/dist/diagram-controls.js +345 -0
- package/dist/diagram-controls.js.map +1 -0
- package/dist/diagram-minimap.js +216 -0
- package/dist/diagram-minimap.js.map +1 -0
- package/dist/diagram.js +20 -0
- package/dist/diagram.js.map +1 -0
- package/dist/diff-viewer.js +2 -2
- package/dist/discussion-activity.js +2 -2
- package/dist/discussion-comment.js +2 -2
- package/dist/discussion.js +5 -5
- package/dist/{document-editor-BO7QPbO5.js → document-editor-BnEugM3E.js} +2 -2
- package/dist/{document-editor-BO7QPbO5.js.map → document-editor-BnEugM3E.js.map} +1 -1
- package/dist/document-editor.js +3 -3
- package/dist/draft-card.js +2 -2
- package/dist/erd.js +2021 -0
- package/dist/erd.js.map +1 -0
- package/dist/fab.js +4 -4
- package/dist/field.js +257 -43
- package/dist/field.js.map +1 -1
- package/dist/file-upload.js +37 -15
- package/dist/file-upload.js.map +1 -1
- package/dist/filter-bar.js +2 -2
- package/dist/flow.js +27 -970
- package/dist/flow.js.map +1 -1
- package/dist/focus-ring.js +2 -0
- package/dist/focus-ring.js.map +1 -1
- package/dist/{form-associated-D3Tn33s_.js → form-associated-BHbg72PG.js} +3 -1
- package/dist/{form-associated-D3Tn33s_.js.map → form-associated-BHbg72PG.js.map} +1 -1
- package/dist/{form-submitter-DWwv6K9-.js → form-submitter-beG1CXAn.js} +7 -1
- package/dist/{form-submitter-DWwv6K9-.js.map → form-submitter-beG1CXAn.js.map} +1 -1
- package/dist/form.js +2 -2
- package/dist/{generative-view-DmtpDobn.js → generative-view-BgOcLRXr.js} +13 -13
- package/dist/generative-view-BgOcLRXr.js.map +1 -0
- package/dist/generative-view.js +3 -3
- package/dist/geometry-INg82Lxq.js +305 -0
- package/dist/geometry-INg82Lxq.js.map +1 -0
- package/dist/history-YbTSQZHj.js +45 -0
- package/dist/history-YbTSQZHj.js.map +1 -0
- package/dist/host-CZK7xhzh.js +40 -0
- package/dist/host-CZK7xhzh.js.map +1 -0
- package/dist/html-editor.js +5 -5
- package/dist/{hyperlink-DhE9RlVS.js → hyperlink-DycWPKwU.js} +10 -1
- package/dist/hyperlink-DycWPKwU.js.map +1 -0
- package/dist/{i18n-controller-urcQKYGe.js → i18n-controller-Cp43HjJl.js} +2 -2
- package/dist/{i18n-controller-urcQKYGe.js.map → i18n-controller-Cp43HjJl.js.map} +1 -1
- package/dist/icon-button.js +4 -4
- package/dist/image.js +2 -2
- package/dist/index.js +37 -18
- package/dist/index.js.map +1 -1
- package/dist/inline-edit.js +2 -2
- package/dist/input.js +4 -4
- package/dist/json-viewer.js +2 -2
- package/dist/kanban.js +2 -2
- package/dist/kbd.js +2 -2
- package/dist/linear-progress.js +3 -3
- package/dist/link-button.js +2 -2
- package/dist/list-item.js +2 -2
- package/dist/list.js +2 -2
- package/dist/listbox.js +3 -3
- package/dist/loader-full.js +13 -13
- package/dist/loader.js +44 -15
- package/dist/loader.js.map +1 -1
- package/dist/markdown-editor.js +5 -5
- package/dist/markers-BFmh1OCz.js +46 -0
- package/dist/markers-BFmh1OCz.js.map +1 -0
- package/dist/measure-controller-Dmc5hZKg.js +89 -0
- package/dist/measure-controller-Dmc5hZKg.js.map +1 -0
- package/dist/mention-input.js +6 -5
- package/dist/mention-input.js.map +1 -1
- package/dist/menu-item.js +3 -2
- package/dist/menu-item.js.map +1 -1
- package/dist/menu.js +2 -2
- package/dist/modal.js +2 -2
- package/dist/navigation-bar.js +2 -2
- package/dist/navigation-drawer.js +2 -2
- package/dist/navigation-rail.js +2 -2
- package/dist/notification-center.js +2 -2
- package/dist/number-field.js +6 -5
- package/dist/number-field.js.map +1 -1
- package/dist/option.js +2 -2
- package/dist/page-header.js +2 -2
- package/dist/pagination.js +2 -2
- package/dist/password-field.js +5 -5
- package/dist/password-rules.js +2 -2
- package/dist/phone-field.js +5 -5
- package/dist/{picker-field-B4DtcJfL.js → picker-field-dTlIMAQn.js} +3 -3
- package/dist/{picker-field-B4DtcJfL.js.map → picker-field-dTlIMAQn.js.map} +1 -1
- package/dist/pin-input.js +5 -5
- package/dist/presence-indicator.js +2 -2
- package/dist/prompt-input.js +5 -5
- package/dist/radio-group.js +1 -0
- package/dist/radio-group.js.map +1 -1
- package/dist/radio.js +5 -5
- package/dist/radio.js.map +1 -1
- package/dist/rating.js +5 -4
- package/dist/rating.js.map +1 -1
- package/dist/redvars-loader.js +2 -2
- package/dist/relative-time.js +2 -2
- package/dist/resizable-panels.js +2 -2
- package/dist/{rich-text-input-DLICqof1.js → rich-text-input-DM_BOzgk.js} +3 -3
- package/dist/{rich-text-input-DLICqof1.js.map → rich-text-input-DM_BOzgk.js.map} +1 -1
- package/dist/ripple.js +2 -0
- package/dist/ripple.js.map +1 -1
- package/dist/{schema-hMt-NRLk.js → schema-B8g30A_n.js} +2 -2
- package/dist/{schema-hMt-NRLk.js.map → schema-B8g30A_n.js.map} +1 -1
- package/dist/search.js +4 -4
- package/dist/segmented-button-group.js +1 -1
- package/dist/select.js +7 -7
- package/dist/side-sheet.js +2 -2
- package/dist/signature-pad.js +5 -4
- package/dist/signature-pad.js.map +1 -1
- package/dist/slider.js +5 -4
- package/dist/slider.js.map +1 -1
- package/dist/snackbar.js +2 -2
- package/dist/sparkline.js +2 -2
- package/dist/split-button.js +2 -2
- package/dist/src/__internal/diagram/canvas-base.d.ts +105 -0
- package/dist/src/__internal/diagram/canvas-link.d.ts +21 -0
- package/dist/src/__internal/diagram/geometry.d.ts +49 -0
- package/dist/src/__internal/diagram/history.d.ts +17 -0
- package/dist/src/__internal/diagram/host.d.ts +45 -0
- package/dist/src/__internal/diagram/markers.d.ts +16 -0
- package/dist/src/__internal/diagram/measure-controller.d.ts +32 -0
- package/dist/src/__internal/diagram/motion.d.ts +22 -0
- package/dist/src/__internal/diagram/selection.d.ts +20 -0
- package/dist/src/__internal/diagram/types.d.ts +39 -0
- package/dist/src/__internal/diagram/viewport-controller.d.ts +89 -0
- package/dist/src/__internal/i18n/strings.d.ts +149 -0
- package/dist/src/__internal/toggle-base.d.ts +8 -0
- package/dist/src/__internal/utils/deprecate.d.ts +3 -3
- package/dist/src/accordion/accordion.d.ts +1 -0
- package/dist/src/code-editor/code-editor.d.ts +1 -0
- package/dist/src/date-picker/date-picker.d.ts +2 -0
- package/dist/src/dependency-map/dependency-map-layout.d.ts +48 -0
- package/dist/src/dependency-map/dependency-map.d.ts +241 -0
- package/dist/src/dependency-map/index.d.ts +2 -0
- package/dist/src/diagram/diagram.d.ts +300 -0
- package/dist/src/diagram/flow.d.ts +53 -0
- package/dist/src/diagram/index.d.ts +4 -0
- package/dist/src/diagram-controls/diagram-controls.d.ts +46 -0
- package/dist/src/diagram-controls/index.d.ts +1 -0
- package/dist/src/diagram-minimap/diagram-minimap.d.ts +39 -0
- package/dist/src/diagram-minimap/index.d.ts +1 -0
- package/dist/src/erd/erd-layout.d.ts +27 -0
- package/dist/src/erd/erd.d.ts +266 -0
- package/dist/src/erd/index.d.ts +2 -0
- package/dist/src/field/field.d.ts +38 -1
- package/dist/src/file-upload/file-upload.d.ts +3 -1
- package/dist/src/focus-ring/focus-ring.d.ts +2 -0
- package/dist/src/index.d.ts +15 -2
- package/dist/src/input/BaseField.d.ts +3 -0
- package/dist/src/input/BaseInput.d.ts +3 -0
- package/dist/src/menu/menu-item/menu-item.d.ts +1 -0
- package/dist/src/number-field/number-field.d.ts +4 -0
- package/dist/src/progress/base-progress.d.ts +3 -0
- package/dist/src/radio/radio-group.d.ts +1 -0
- package/dist/src/rating/rating.d.ts +1 -0
- package/dist/src/ripple/ripple.d.ts +2 -0
- package/dist/src/signature-pad/signature-pad.d.ts +1 -0
- package/dist/src/slider/slider.d.ts +1 -0
- package/dist/src/switch/switch.d.ts +1 -0
- package/dist/src/tabs/tab.d.ts +2 -0
- package/dist/src/tabs/tabs.d.ts +1 -0
- package/dist/src/textarea/textarea.d.ts +1 -0
- package/dist/src/time-picker/time-picker.d.ts +2 -0
- package/dist/src/transfer-list/transfer-list.d.ts +1 -0
- package/dist/src/tree-chart/index.d.ts +2 -0
- package/dist/src/tree-chart/tree-chart-layout.d.ts +49 -0
- package/dist/src/tree-chart/tree-chart.d.ts +221 -0
- package/dist/src/workflow/index.d.ts +2 -0
- package/dist/src/workflow/workflow-format.d.ts +5 -0
- package/dist/src/workflow/workflow-model.d.ts +194 -0
- package/dist/src/workflow/workflow.d.ts +313 -0
- package/dist/src/workflow-timeline/index.d.ts +1 -0
- package/dist/src/workflow-timeline/workflow-timeline.d.ts +41 -0
- package/dist/stat.js +2 -2
- package/dist/status-indicator.js +2 -2
- package/dist/step.js +2 -2
- package/dist/stepper.js +2 -2
- package/dist/{strings-DmbqMTfs.js → strings-BJPuhKJk.js} +163 -1
- package/dist/{strings-DmbqMTfs.js.map → strings-BJPuhKJk.js.map} +1 -1
- package/dist/sub-menu.js +2 -2
- package/dist/svg.js +2 -2
- package/dist/switch.js +5 -4
- package/dist/switch.js.map +1 -1
- package/dist/tab.js +1 -0
- package/dist/tab.js.map +1 -1
- package/dist/table.js +2 -2
- package/dist/tabs.js +1 -0
- package/dist/tabs.js.map +1 -1
- package/dist/test/diagram-controls.test.d.ts +1 -0
- package/dist/test/diagram-geometry.test.d.ts +1 -0
- package/dist/test/diagram.test.d.ts +1 -0
- package/dist/test/erd.test.d.ts +1 -0
- package/dist/test/toggle-label.test.d.ts +1 -0
- package/dist/test/tree-chart.test.d.ts +1 -0
- package/dist/test/workflow-debug.test.d.ts +1 -0
- package/dist/test/workflow.test.d.ts +1 -0
- package/dist/textarea.js +7 -5
- package/dist/textarea.js.map +1 -1
- package/dist/time-field.js +6 -6
- package/dist/time-picker.js +4 -2
- package/dist/time-picker.js.map +1 -1
- package/dist/timeline-item.js +2 -2
- package/dist/timeline.js +2 -2
- package/dist/{toggle-base-BQO5pjrU.js → toggle-base-BlaHalfS.js} +19 -3
- package/dist/toggle-base-BlaHalfS.js.map +1 -0
- package/dist/tour.js +2 -2
- package/dist/transfer-list.js +5 -4
- package/dist/transfer-list.js.map +1 -1
- package/dist/{chart-base-B-gOg2Di.js → transform-CxeQFXXB.js} +9 -839
- package/dist/transform-CxeQFXXB.js.map +1 -0
- package/dist/tree-chart.js +1986 -0
- package/dist/tree-chart.js.map +1 -0
- package/dist/tree-item.js +2 -2
- package/dist/tree.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typing-indicator.js +2 -2
- package/dist/url-field.js +5 -5
- package/dist/user-menu.js +2 -2
- package/dist/virtual-list.js +2 -2
- package/dist/workflow-format-BsyveyeC.js +34 -0
- package/dist/workflow-format-BsyveyeC.js.map +1 -0
- package/dist/workflow-model-CauduOG2.js +330 -0
- package/dist/workflow-model-CauduOG2.js.map +1 -0
- package/dist/workflow-timeline.js +354 -0
- package/dist/workflow-timeline.js.map +1 -0
- package/dist/workflow.js +3337 -0
- package/dist/workflow.js.map +1 -0
- package/dist/workspace-switcher.js +2 -2
- package/package.json +1 -1
- package/readme.md +44 -2
- package/src/LoaderUtils.ts +9 -2
- package/src/__internal/diagram/canvas-base.ts +410 -0
- package/src/__internal/diagram/canvas-link.ts +66 -0
- package/src/__internal/diagram/geometry.ts +372 -0
- package/src/__internal/diagram/history.ts +49 -0
- package/src/__internal/diagram/host.ts +76 -0
- package/src/__internal/diagram/markers.ts +56 -0
- package/src/__internal/diagram/measure-controller.ts +104 -0
- package/src/__internal/diagram/motion.ts +89 -0
- package/src/__internal/diagram/selection.ts +69 -0
- package/src/__internal/diagram/types.ts +56 -0
- package/src/__internal/diagram/viewport-controller.ts +494 -0
- package/src/__internal/i18n/strings.ts +201 -0
- package/src/__internal/mixins/field.ts +3 -0
- package/src/__internal/mixins/form-associated.ts +2 -0
- package/src/__internal/mixins/form-submitter.ts +6 -0
- package/src/__internal/mixins/hyperlink.ts +10 -0
- package/src/__internal/toggle-base.ts +16 -0
- package/src/__internal/utils/deprecate.ts +5 -4
- package/src/accordion/accordion.ts +1 -0
- package/src/button/base-button/base-button.ts +2 -0
- package/src/code-editor/code-editor.ts +1 -0
- package/src/date-picker/date-picker.ts +2 -0
- package/src/dependency-map/dependency-map-layout.ts +505 -0
- package/src/dependency-map/dependency-map.scss +626 -0
- package/src/dependency-map/dependency-map.ts +1280 -0
- package/src/dependency-map/index.ts +16 -0
- package/src/diagram/diagram.scss +513 -0
- package/src/diagram/diagram.ts +1852 -0
- package/src/diagram/flow.ts +81 -0
- package/src/diagram/index.ts +44 -0
- package/src/diagram-controls/diagram-controls.scss +68 -0
- package/src/diagram-controls/diagram-controls.ts +255 -0
- package/src/diagram-controls/index.ts +1 -0
- package/src/diagram-minimap/diagram-minimap.scss +41 -0
- package/src/diagram-minimap/diagram-minimap.ts +149 -0
- package/src/diagram-minimap/index.ts +1 -0
- package/src/erd/erd-layout.ts +92 -0
- package/src/erd/erd.scss +636 -0
- package/src/erd/erd.ts +1728 -0
- package/src/erd/index.ts +17 -0
- package/src/field/field.scss +197 -23
- package/src/field/field.ts +109 -16
- package/src/file-upload/file-upload.scss +37 -10
- package/src/file-upload/file-upload.ts +3 -1
- package/src/focus-ring/focus-ring.ts +2 -0
- package/src/generative-view/catalog.generated.ts +12 -11
- package/src/index.ts +121 -2
- package/src/input/BaseField.ts +3 -0
- package/src/input/BaseInput.ts +3 -0
- package/src/loader.ts +25 -0
- package/src/mention-input/mention-input.scss +2 -0
- package/src/menu/menu-item/menu-item.ts +1 -0
- package/src/number-field/number-field.ts +4 -0
- package/src/progress/base-progress.ts +3 -0
- package/src/radio/radio-group.ts +1 -0
- package/src/radio/radio.ts +1 -1
- package/src/rating/rating.ts +1 -0
- package/src/ripple/ripple.ts +2 -0
- package/src/signature-pad/signature-pad.ts +1 -0
- package/src/slider/slider.ts +1 -0
- package/src/switch/switch.ts +1 -0
- package/src/tabs/tab.ts +2 -0
- package/src/tabs/tabs.ts +1 -0
- package/src/textarea/textarea.scss +2 -0
- package/src/textarea/textarea.ts +1 -0
- package/src/time-picker/time-picker.ts +2 -0
- package/src/transfer-list/transfer-list.ts +1 -0
- package/src/tree-chart/index.ts +13 -0
- package/src/tree-chart/tree-chart-layout.ts +185 -0
- package/src/tree-chart/tree-chart.scss +377 -0
- package/src/tree-chart/tree-chart.ts +1170 -0
- package/src/workflow/index.ts +35 -0
- package/src/workflow/workflow-format.ts +29 -0
- package/src/workflow/workflow-model.ts +583 -0
- package/src/workflow/workflow.scss +1164 -0
- package/src/workflow/workflow.ts +2674 -0
- package/src/workflow-timeline/index.ts +1 -0
- package/src/workflow-timeline/workflow-timeline.scss +128 -0
- package/src/workflow-timeline/workflow-timeline.ts +238 -0
- package/dist/BaseField-CAog9TIc.js.map +0 -1
- package/dist/BaseInput-CcMfg1Y2.js.map +0 -1
- package/dist/base-button-Do2TUy8M.js.map +0 -1
- package/dist/base-progress-BiLlZVHJ.js.map +0 -1
- package/dist/cartesian-chart-C-f1frt0.js.map +0 -1
- package/dist/chart-base-B-gOg2Di.js.map +0 -1
- package/dist/generative-view-DmtpDobn.js.map +0 -1
- package/dist/hyperlink-DhE9RlVS.js.map +0 -1
- package/dist/src/flow/flow.d.ts +0 -178
- package/dist/src/flow/index.d.ts +0 -2
- package/dist/toggle-base-BQO5pjrU.js.map +0 -1
- package/src/button/button-group/readme.md +0 -23
- package/src/flow/flow.scss +0 -215
- package/src/flow/flow.ts +0 -958
- package/src/flow/index.ts +0 -10
- /package/dist/test/{flow.test.d.ts → dependency-map.test.d.ts} +0 -0
|
@@ -0,0 +1,833 @@
|
|
|
1
|
+
import { S as Selection, r as root, a as constant$1, i as interpolateNumber, b as color, d as interpolateRgb, e as interpolateString, c as cubicOut } from './transform-CxeQFXXB.js';
|
|
2
|
+
import { _ as __decorate, a as i, A, b, i as i$1 } from './IndividualComponent-BK7XZjE2.js';
|
|
3
|
+
import { n } from './property-B2TG3KEE.js';
|
|
4
|
+
import { r } from './state-BCeDVCI9.js';
|
|
5
|
+
import { e } from './query-CHb9Ft_d.js';
|
|
6
|
+
import { e as e$1 } from './class-map-NDIkZErE.js';
|
|
7
|
+
import { o } from './style-map-CHOg6N_R.js';
|
|
8
|
+
import { I as I18nController } from './i18n-controller-Cp43HjJl.js';
|
|
9
|
+
import { i as isRtl } from './locale-DEsJZCQG.js';
|
|
10
|
+
|
|
11
|
+
function select(selector) {
|
|
12
|
+
return typeof selector === "string"
|
|
13
|
+
? new Selection([[document.querySelector(selector)]], [document.documentElement])
|
|
14
|
+
: new Selection([[selector]], root);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function numberArray(a, b) {
|
|
18
|
+
if (!b) b = [];
|
|
19
|
+
var n = a ? Math.min(b.length, a.length) : 0,
|
|
20
|
+
c = b.slice(),
|
|
21
|
+
i;
|
|
22
|
+
return function(t) {
|
|
23
|
+
for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
|
|
24
|
+
return c;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function isNumberArray(x) {
|
|
29
|
+
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function genericArray(a, b) {
|
|
33
|
+
var nb = b ? b.length : 0,
|
|
34
|
+
na = a ? Math.min(nb, a.length) : 0,
|
|
35
|
+
x = new Array(na),
|
|
36
|
+
c = new Array(nb),
|
|
37
|
+
i;
|
|
38
|
+
|
|
39
|
+
for (i = 0; i < na; ++i) x[i] = interpolate(a[i], b[i]);
|
|
40
|
+
for (; i < nb; ++i) c[i] = b[i];
|
|
41
|
+
|
|
42
|
+
return function(t) {
|
|
43
|
+
for (i = 0; i < na; ++i) c[i] = x[i](t);
|
|
44
|
+
return c;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function date(a, b) {
|
|
49
|
+
var d = new Date;
|
|
50
|
+
return a = +a, b = +b, function(t) {
|
|
51
|
+
return d.setTime(a * (1 - t) + b * t), d;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function object(a, b) {
|
|
56
|
+
var i = {},
|
|
57
|
+
c = {},
|
|
58
|
+
k;
|
|
59
|
+
|
|
60
|
+
if (a === null || typeof a !== "object") a = {};
|
|
61
|
+
if (b === null || typeof b !== "object") b = {};
|
|
62
|
+
|
|
63
|
+
for (k in b) {
|
|
64
|
+
if (k in a) {
|
|
65
|
+
i[k] = interpolate(a[k], b[k]);
|
|
66
|
+
} else {
|
|
67
|
+
c[k] = b[k];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return function(t) {
|
|
72
|
+
for (k in i) c[k] = i[k](t);
|
|
73
|
+
return c;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function interpolate(a, b) {
|
|
78
|
+
var t = typeof b, c;
|
|
79
|
+
return b == null || t === "boolean" ? constant$1(b)
|
|
80
|
+
: (t === "number" ? interpolateNumber
|
|
81
|
+
: t === "string" ? ((c = color(b)) ? (b = c, interpolateRgb) : interpolateString)
|
|
82
|
+
: b instanceof color ? interpolateRgb
|
|
83
|
+
: b instanceof Date ? date
|
|
84
|
+
: isNumberArray(b) ? numberArray
|
|
85
|
+
: Array.isArray(b) ? genericArray
|
|
86
|
+
: typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
|
|
87
|
+
: interpolateNumber)(a, b);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function constant(x) {
|
|
91
|
+
return function constant() {
|
|
92
|
+
return x;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function array(x) {
|
|
97
|
+
return typeof x === "object" && "length" in x
|
|
98
|
+
? x // Array, TypedArray, NodeList, array-like
|
|
99
|
+
: Array.from(x); // Map, Set, iterable, string, or anything else
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Number of `--color-chart-n` tokens series cycle through. */
|
|
103
|
+
const CHART_PALETTE_SIZE = 8;
|
|
104
|
+
/** Default motion duration for enter and data-change animations. */
|
|
105
|
+
const DURATION = 450;
|
|
106
|
+
/** Tooltip offset from the pointer or anchor. */
|
|
107
|
+
const TOOLTIP_OFFSET = 12;
|
|
108
|
+
/** The palette color for the series or slice at `index`. */
|
|
109
|
+
function chartColor(index) {
|
|
110
|
+
return `var(--color-chart-${(index % CHART_PALETTE_SIZE) + 1})`;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Shared behaviour for every Peacock chart: container sizing, palette, value formatting,
|
|
114
|
+
* tooltip, legend, keyboard navigation, the accessible data table, and loading and empty states.
|
|
115
|
+
* Subclasses draw the marks with d3 into the SVG returned by `renderSvgContent()`.
|
|
116
|
+
*/
|
|
117
|
+
class ChartBase extends i {
|
|
118
|
+
constructor() {
|
|
119
|
+
// ── Properties
|
|
120
|
+
super(...arguments);
|
|
121
|
+
/** Height of the plot in pixels. The width follows the container. */
|
|
122
|
+
this.height = 300;
|
|
123
|
+
/** Accessible name of the chart, read by screen readers. */
|
|
124
|
+
this.label = '';
|
|
125
|
+
/** Shows a skeleton while data loads. */
|
|
126
|
+
this.loading = false;
|
|
127
|
+
/**
|
|
128
|
+
* When the legend shows: `auto` shows it for more than one series (always for pie and
|
|
129
|
+
* doughnut slices), `show` always, `hide` never.
|
|
130
|
+
*/
|
|
131
|
+
this.legend = 'auto';
|
|
132
|
+
/** Hides the tooltip. */
|
|
133
|
+
this.hideTooltip = false;
|
|
134
|
+
/** Turns off enter and update animations. They are also off when the user prefers reduced motion. */
|
|
135
|
+
this.disableAnimation = false;
|
|
136
|
+
// ── State
|
|
137
|
+
/** Keys of series or slices switched off in the legend. */
|
|
138
|
+
this.hiddenKeys = new Set();
|
|
139
|
+
/** Index of the hovered or focused category or slice, -1 for none. */
|
|
140
|
+
this.activeIndex = -1;
|
|
141
|
+
/** Width of the plot, measured from the container. */
|
|
142
|
+
this.plotWidth = 0;
|
|
143
|
+
/** Text for the polite live region, set during keyboard navigation. */
|
|
144
|
+
this.announcement = '';
|
|
145
|
+
/** Whether the marks have been drawn once. */
|
|
146
|
+
this.hasDrawn = false;
|
|
147
|
+
/** Peacock's strings and the locale values are formatted in. */
|
|
148
|
+
this.i18n = new I18nController(this);
|
|
149
|
+
this.handlePointerMove = (event) => {
|
|
150
|
+
const point = this.pointFromEvent(event);
|
|
151
|
+
if (!point)
|
|
152
|
+
return;
|
|
153
|
+
const index = this.itemAtPoint(point.x, point.y);
|
|
154
|
+
this.activeIndex = index;
|
|
155
|
+
this.pointer = index >= 0 ? point : undefined;
|
|
156
|
+
};
|
|
157
|
+
this.handlePointerLeave = () => {
|
|
158
|
+
this.activeIndex = -1;
|
|
159
|
+
this.pointer = undefined;
|
|
160
|
+
};
|
|
161
|
+
this.handleClick = (event) => {
|
|
162
|
+
const point = this.pointFromEvent(event);
|
|
163
|
+
if (!point)
|
|
164
|
+
return;
|
|
165
|
+
const index = this.itemAtPoint(point.x, point.y);
|
|
166
|
+
if (index >= 0)
|
|
167
|
+
this.selectItem(index);
|
|
168
|
+
};
|
|
169
|
+
this.handleKeyDown = (event) => {
|
|
170
|
+
const count = this.getItemCount();
|
|
171
|
+
if (!count)
|
|
172
|
+
return;
|
|
173
|
+
let next = this.activeIndex;
|
|
174
|
+
// Left and Right follow the reading direction: in RTL, Left moves forward.
|
|
175
|
+
let { key } = event;
|
|
176
|
+
if (isRtl(this) && (key === 'ArrowLeft' || key === 'ArrowRight')) {
|
|
177
|
+
key = key === 'ArrowLeft' ? 'ArrowRight' : 'ArrowLeft';
|
|
178
|
+
}
|
|
179
|
+
switch (key) {
|
|
180
|
+
case 'ArrowRight':
|
|
181
|
+
case 'ArrowDown':
|
|
182
|
+
next = next < 0 ? 0 : Math.min(next + 1, count - 1);
|
|
183
|
+
break;
|
|
184
|
+
case 'ArrowLeft':
|
|
185
|
+
case 'ArrowUp':
|
|
186
|
+
next = next < 0 ? count - 1 : Math.max(next - 1, 0);
|
|
187
|
+
break;
|
|
188
|
+
case 'Home':
|
|
189
|
+
next = 0;
|
|
190
|
+
break;
|
|
191
|
+
case 'End':
|
|
192
|
+
next = count - 1;
|
|
193
|
+
break;
|
|
194
|
+
case 'Escape':
|
|
195
|
+
next = -1;
|
|
196
|
+
break;
|
|
197
|
+
case 'Enter':
|
|
198
|
+
case ' ':
|
|
199
|
+
if (this.activeIndex >= 0) {
|
|
200
|
+
event.preventDefault();
|
|
201
|
+
this.selectItem(this.activeIndex);
|
|
202
|
+
}
|
|
203
|
+
return;
|
|
204
|
+
default:
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
event.preventDefault();
|
|
208
|
+
this.pointer = undefined;
|
|
209
|
+
this.activeIndex = next;
|
|
210
|
+
this.announce(next);
|
|
211
|
+
};
|
|
212
|
+
this.handleBlur = () => {
|
|
213
|
+
this.activeIndex = -1;
|
|
214
|
+
this.pointer = undefined;
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
// ── Lifecycle
|
|
218
|
+
connectedCallback() {
|
|
219
|
+
super.connectedCallback();
|
|
220
|
+
this.resizeObserver = new ResizeObserver(entries => {
|
|
221
|
+
const width = Math.floor(entries[0]?.contentRect.width ?? 0);
|
|
222
|
+
if (width !== this.plotWidth)
|
|
223
|
+
this.plotWidth = width;
|
|
224
|
+
});
|
|
225
|
+
this.resizeObserver.observe(this);
|
|
226
|
+
}
|
|
227
|
+
disconnectedCallback() {
|
|
228
|
+
super.disconnectedCallback();
|
|
229
|
+
this.resizeObserver?.disconnect();
|
|
230
|
+
this.resizeObserver = undefined;
|
|
231
|
+
}
|
|
232
|
+
updated(changed) {
|
|
233
|
+
super.updated(changed);
|
|
234
|
+
if (!this.svgElement || this.plotWidth <= 0)
|
|
235
|
+
return;
|
|
236
|
+
const drawKeys = this.drawProperties();
|
|
237
|
+
const needsDraw = drawKeys.some(key => changed.has(key));
|
|
238
|
+
if (needsDraw) {
|
|
239
|
+
const resizeOnly = [...changed.keys()].every(key => key === 'plotWidth' || !drawKeys.includes(key));
|
|
240
|
+
// The first draw animates the marks in; later resizes snap.
|
|
241
|
+
this.draw((!resizeOnly || !this.hasDrawn) && this.motionEnabled());
|
|
242
|
+
this.hasDrawn = true;
|
|
243
|
+
this.drawHighlight();
|
|
244
|
+
}
|
|
245
|
+
else if (changed.has('activeIndex') || changed.has('activeSeries')) {
|
|
246
|
+
this.drawHighlight();
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
/** Property names that trigger a redraw when they change. */
|
|
250
|
+
drawProperties() {
|
|
251
|
+
return ['height', 'plotWidth', 'hiddenKeys', 'loading', 'valueFormatter'];
|
|
252
|
+
}
|
|
253
|
+
/** The legend mode in effect: unknown values count as `auto`. */
|
|
254
|
+
legendMode() {
|
|
255
|
+
return this.legend === 'show' || this.legend === 'hide'
|
|
256
|
+
? this.legend
|
|
257
|
+
: 'auto';
|
|
258
|
+
}
|
|
259
|
+
/** Whether the legend shows when `legend` is `auto`. */
|
|
260
|
+
legendAuto() {
|
|
261
|
+
return this.getSeries().length > 1;
|
|
262
|
+
}
|
|
263
|
+
/** Whether the legend shows. */
|
|
264
|
+
legendVisible() {
|
|
265
|
+
const mode = this.legendMode();
|
|
266
|
+
if (mode === 'auto')
|
|
267
|
+
return this.legendAuto();
|
|
268
|
+
return mode === 'show';
|
|
269
|
+
}
|
|
270
|
+
/** Width and height of the SVG. */
|
|
271
|
+
svgSize() {
|
|
272
|
+
return { width: this.plotWidth, height: this.height };
|
|
273
|
+
}
|
|
274
|
+
/** Motion duration in ms, 0 when animation is off. */
|
|
275
|
+
motionEnabled() {
|
|
276
|
+
if (this.disableAnimation)
|
|
277
|
+
return false;
|
|
278
|
+
return !window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Returns a transition of `selection` when `animate` is true, else the selection itself, so
|
|
282
|
+
* callers set end values once. Transitions share the attr/style API used here.
|
|
283
|
+
*/
|
|
284
|
+
motion(selection, animate) {
|
|
285
|
+
if (!animate) {
|
|
286
|
+
selection.interrupt();
|
|
287
|
+
return selection;
|
|
288
|
+
}
|
|
289
|
+
return selection
|
|
290
|
+
.transition()
|
|
291
|
+
.duration(DURATION)
|
|
292
|
+
.ease(cubicOut);
|
|
293
|
+
}
|
|
294
|
+
/** Formats a value for tooltips and value labels. */
|
|
295
|
+
formatValue(value) {
|
|
296
|
+
return this.valueFormatter
|
|
297
|
+
? this.valueFormatter(value)
|
|
298
|
+
: this.getNumberFormats().standard.format(value);
|
|
299
|
+
}
|
|
300
|
+
/** Formats an axis tick. */
|
|
301
|
+
formatTick(value) {
|
|
302
|
+
return this.valueFormatter
|
|
303
|
+
? this.valueFormatter(value)
|
|
304
|
+
: this.getNumberFormats().compact.format(value);
|
|
305
|
+
}
|
|
306
|
+
/** Whether a series or slice is switched off in the legend. */
|
|
307
|
+
isHidden(key) {
|
|
308
|
+
return this.hiddenKeys.has(key);
|
|
309
|
+
}
|
|
310
|
+
/** Extra content layered over the plot, such as the doughnut centre. */
|
|
311
|
+
renderOverlay() {
|
|
312
|
+
return A;
|
|
313
|
+
}
|
|
314
|
+
/** Skeleton shown while `loading`. */
|
|
315
|
+
renderSkeleton() {
|
|
316
|
+
const bars = [55, 80, 40, 95, 65, 75, 50];
|
|
317
|
+
return b `<div
|
|
318
|
+
class="skeleton skeleton-bars"
|
|
319
|
+
style=${o({ height: `${this.height}px` })}
|
|
320
|
+
aria-hidden="true"
|
|
321
|
+
>
|
|
322
|
+
${bars.map(h => b `<span style=${o({ height: `${h}%` })}></span>`)}
|
|
323
|
+
</div>`;
|
|
324
|
+
}
|
|
325
|
+
// ── Private methods
|
|
326
|
+
/** The number formats for the resolved locale, cached per instance. */
|
|
327
|
+
getNumberFormats() {
|
|
328
|
+
const { locale } = this.i18n;
|
|
329
|
+
if (this.numberFormats?.locale !== locale) {
|
|
330
|
+
this.numberFormats = {
|
|
331
|
+
locale,
|
|
332
|
+
standard: new Intl.NumberFormat(locale),
|
|
333
|
+
compact: new Intl.NumberFormat(locale, {
|
|
334
|
+
notation: 'compact',
|
|
335
|
+
maximumFractionDigits: 1,
|
|
336
|
+
}),
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
return this.numberFormats;
|
|
340
|
+
}
|
|
341
|
+
pointFromEvent(event) {
|
|
342
|
+
const rect = this.plotElement?.getBoundingClientRect();
|
|
343
|
+
if (!rect)
|
|
344
|
+
return undefined;
|
|
345
|
+
return { x: event.clientX - rect.left, y: event.clientY - rect.top };
|
|
346
|
+
}
|
|
347
|
+
announce(index) {
|
|
348
|
+
const model = index >= 0 ? this.getTooltip(index) : undefined;
|
|
349
|
+
this.announcement = model
|
|
350
|
+
? `${model.title}. ${model.rows.map(row => `${row.label} ${row.value}`).join(', ')}`
|
|
351
|
+
: '';
|
|
352
|
+
}
|
|
353
|
+
/** Fires `select` for the item at `index`. */
|
|
354
|
+
selectItem(index) {
|
|
355
|
+
this.dispatchEvent(new CustomEvent('select', {
|
|
356
|
+
bubbles: true,
|
|
357
|
+
composed: true,
|
|
358
|
+
detail: this.getSelectDetail(index),
|
|
359
|
+
}));
|
|
360
|
+
}
|
|
361
|
+
toggleSeries(key) {
|
|
362
|
+
const next = new Set(this.hiddenKeys);
|
|
363
|
+
if (next.has(key))
|
|
364
|
+
next.delete(key);
|
|
365
|
+
else
|
|
366
|
+
next.add(key);
|
|
367
|
+
this.hiddenKeys = next;
|
|
368
|
+
}
|
|
369
|
+
// ── Render helpers
|
|
370
|
+
renderTooltip() {
|
|
371
|
+
if (this.hideTooltip || this.activeIndex < 0)
|
|
372
|
+
return A;
|
|
373
|
+
const model = this.getTooltip(this.activeIndex);
|
|
374
|
+
if (!model || !model.rows.length)
|
|
375
|
+
return A;
|
|
376
|
+
const x = this.pointer?.x ?? model.x;
|
|
377
|
+
const y = this.pointer?.y ?? model.y;
|
|
378
|
+
const flip = x > this.plotWidth * 0.6;
|
|
379
|
+
return b `<div
|
|
380
|
+
class=${e$1({ tooltip: true, flip })}
|
|
381
|
+
part="tooltip"
|
|
382
|
+
aria-hidden="true"
|
|
383
|
+
style=${o({
|
|
384
|
+
left: `${flip ? x - TOOLTIP_OFFSET : x + TOOLTIP_OFFSET}px`,
|
|
385
|
+
top: `${y}px`,
|
|
386
|
+
})}
|
|
387
|
+
>
|
|
388
|
+
${model.title
|
|
389
|
+
? b `<div class="tooltip-title">${model.title}</div>`
|
|
390
|
+
: A}
|
|
391
|
+
${model.rows.map(row => b `<div class="tooltip-row">
|
|
392
|
+
<span
|
|
393
|
+
class="swatch"
|
|
394
|
+
style=${o({ background: row.color })}
|
|
395
|
+
></span>
|
|
396
|
+
<span class="tooltip-label">${row.label}</span>
|
|
397
|
+
<span class="tooltip-value">${row.value}</span>
|
|
398
|
+
</div>`)}
|
|
399
|
+
</div>`;
|
|
400
|
+
}
|
|
401
|
+
renderLegend() {
|
|
402
|
+
if (!this.legendVisible())
|
|
403
|
+
return A;
|
|
404
|
+
return b `<div class="legend" part="legend">
|
|
405
|
+
${this.getSeries().map(series => b `<button
|
|
406
|
+
type="button"
|
|
407
|
+
class=${e$1({
|
|
408
|
+
'legend-item': true,
|
|
409
|
+
'is-hidden': this.isHidden(series.key),
|
|
410
|
+
})}
|
|
411
|
+
aria-pressed=${this.isHidden(series.key) ? 'false' : 'true'}
|
|
412
|
+
@click=${() => this.toggleSeries(series.key)}
|
|
413
|
+
@pointerenter=${() => {
|
|
414
|
+
this.activeSeries = series.key;
|
|
415
|
+
}}
|
|
416
|
+
@pointerleave=${() => {
|
|
417
|
+
this.activeSeries = undefined;
|
|
418
|
+
}}
|
|
419
|
+
>
|
|
420
|
+
<span
|
|
421
|
+
class="swatch"
|
|
422
|
+
style=${o({ background: series.color })}
|
|
423
|
+
></span>
|
|
424
|
+
<span>${series.label}</span>
|
|
425
|
+
</button>`)}
|
|
426
|
+
</div>`;
|
|
427
|
+
}
|
|
428
|
+
renderPlot() {
|
|
429
|
+
const { width, height } = this.svgSize();
|
|
430
|
+
const name = this.label || this.i18n.t('chart');
|
|
431
|
+
return b `<div
|
|
432
|
+
class="plot"
|
|
433
|
+
part="plot"
|
|
434
|
+
style=${o({ height: `${this.height}px` })}
|
|
435
|
+
tabindex="0"
|
|
436
|
+
role="group"
|
|
437
|
+
aria-roledescription=${this.i18n.t('chartRole')}
|
|
438
|
+
aria-label=${this.i18n.t('chartInstructions')(name)}
|
|
439
|
+
@pointermove=${this.handlePointerMove}
|
|
440
|
+
@pointerleave=${this.handlePointerLeave}
|
|
441
|
+
@click=${this.handleClick}
|
|
442
|
+
@keydown=${this.handleKeyDown}
|
|
443
|
+
@blur=${this.handleBlur}
|
|
444
|
+
>
|
|
445
|
+
<svg class="chart-svg" aria-hidden="true" width=${width} height=${height}>
|
|
446
|
+
${this.renderSvgContent()}
|
|
447
|
+
</svg>
|
|
448
|
+
${this.renderOverlay()} ${this.renderTooltip()}
|
|
449
|
+
</div>`;
|
|
450
|
+
}
|
|
451
|
+
// ── Render
|
|
452
|
+
render() {
|
|
453
|
+
let body;
|
|
454
|
+
if (this.loading) {
|
|
455
|
+
body = this.renderSkeleton();
|
|
456
|
+
}
|
|
457
|
+
else if (!this.hasData()) {
|
|
458
|
+
body = b `<div
|
|
459
|
+
class="empty"
|
|
460
|
+
style=${o({ height: `${this.height}px` })}
|
|
461
|
+
>
|
|
462
|
+
<slot name="empty">${this.i18n.t('noData')}</slot>
|
|
463
|
+
</div>`;
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
body = this.renderPlot();
|
|
467
|
+
}
|
|
468
|
+
const hasContent = !this.loading && this.hasData();
|
|
469
|
+
return b `<div
|
|
470
|
+
class="chart"
|
|
471
|
+
part="container"
|
|
472
|
+
aria-busy=${this.loading ? 'true' : 'false'}
|
|
473
|
+
>
|
|
474
|
+
${body} ${hasContent ? this.renderLegend() : A}
|
|
475
|
+
<slot name="insight" class="insight"></slot>
|
|
476
|
+
${hasContent
|
|
477
|
+
? b `<table class="sr-only">
|
|
478
|
+
<caption>
|
|
479
|
+
${this.label || this.i18n.t('chartData')}
|
|
480
|
+
</caption>
|
|
481
|
+
${this.renderTable()}
|
|
482
|
+
</table>`
|
|
483
|
+
: A}
|
|
484
|
+
<div class="sr-only" aria-live="polite">${this.announcement}</div>
|
|
485
|
+
</div>`;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
__decorate([
|
|
489
|
+
n({ type: Number, reflect: true })
|
|
490
|
+
], ChartBase.prototype, "height", void 0);
|
|
491
|
+
__decorate([
|
|
492
|
+
n({ type: String })
|
|
493
|
+
], ChartBase.prototype, "label", void 0);
|
|
494
|
+
__decorate([
|
|
495
|
+
n({ type: Boolean, reflect: true })
|
|
496
|
+
], ChartBase.prototype, "loading", void 0);
|
|
497
|
+
__decorate([
|
|
498
|
+
n({ type: String, reflect: true })
|
|
499
|
+
], ChartBase.prototype, "legend", void 0);
|
|
500
|
+
__decorate([
|
|
501
|
+
n({ type: Boolean, attribute: 'hide-tooltip' })
|
|
502
|
+
], ChartBase.prototype, "hideTooltip", void 0);
|
|
503
|
+
__decorate([
|
|
504
|
+
n({ type: Boolean, attribute: 'disable-animation' })
|
|
505
|
+
], ChartBase.prototype, "disableAnimation", void 0);
|
|
506
|
+
__decorate([
|
|
507
|
+
n({ attribute: false })
|
|
508
|
+
], ChartBase.prototype, "valueFormatter", void 0);
|
|
509
|
+
__decorate([
|
|
510
|
+
n({ attribute: false })
|
|
511
|
+
], ChartBase.prototype, "strings", void 0);
|
|
512
|
+
__decorate([
|
|
513
|
+
r()
|
|
514
|
+
], ChartBase.prototype, "hiddenKeys", void 0);
|
|
515
|
+
__decorate([
|
|
516
|
+
r()
|
|
517
|
+
], ChartBase.prototype, "activeIndex", void 0);
|
|
518
|
+
__decorate([
|
|
519
|
+
r()
|
|
520
|
+
], ChartBase.prototype, "activeSeries", void 0);
|
|
521
|
+
__decorate([
|
|
522
|
+
r()
|
|
523
|
+
], ChartBase.prototype, "pointer", void 0);
|
|
524
|
+
__decorate([
|
|
525
|
+
r()
|
|
526
|
+
], ChartBase.prototype, "plotWidth", void 0);
|
|
527
|
+
__decorate([
|
|
528
|
+
r()
|
|
529
|
+
], ChartBase.prototype, "announcement", void 0);
|
|
530
|
+
__decorate([
|
|
531
|
+
e('svg.chart-svg')
|
|
532
|
+
], ChartBase.prototype, "svgElement", void 0);
|
|
533
|
+
__decorate([
|
|
534
|
+
e('.plot')
|
|
535
|
+
], ChartBase.prototype, "plotElement", void 0);
|
|
536
|
+
|
|
537
|
+
var css_248z = i$1`* {
|
|
538
|
+
box-sizing: border-box;
|
|
539
|
+
-webkit-tap-highlight-color: transparent;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
.screen-reader-only {
|
|
543
|
+
position: absolute !important;
|
|
544
|
+
inline-size: 1px !important;
|
|
545
|
+
block-size: 1px !important;
|
|
546
|
+
padding: 0 !important;
|
|
547
|
+
margin: -1px !important;
|
|
548
|
+
overflow: hidden !important;
|
|
549
|
+
clip-path: inset(50%) !important;
|
|
550
|
+
white-space: nowrap !important;
|
|
551
|
+
border: 0 !important;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
[hidden] {
|
|
555
|
+
display: none !important;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
@media (forced-colors: active) {
|
|
559
|
+
.selected,
|
|
560
|
+
[aria-selected=true],
|
|
561
|
+
[aria-pressed=true],
|
|
562
|
+
[aria-checked=true],
|
|
563
|
+
[aria-current]:not([aria-current=false]) {
|
|
564
|
+
outline: 2px solid Highlight;
|
|
565
|
+
outline-offset: -2px;
|
|
566
|
+
}
|
|
567
|
+
.disabled,
|
|
568
|
+
[aria-disabled=true] {
|
|
569
|
+
color: GrayText;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
:host {
|
|
573
|
+
display: block;
|
|
574
|
+
width: 100%;
|
|
575
|
+
min-width: 0;
|
|
576
|
+
color: var(--color-on-surface);
|
|
577
|
+
--_chart-grid-color: var(--chart-grid-color, var(--color-outline-variant));
|
|
578
|
+
--_chart-axis-color: var(--chart-axis-color, var(--color-on-surface-variant));
|
|
579
|
+
--_chart-dim-opacity: var(--chart-dim-opacity, 0.4);
|
|
580
|
+
--_chart-cursor-color: var(--chart-cursor-color, var(--color-on-surface));
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.chart {
|
|
584
|
+
display: flex;
|
|
585
|
+
flex-direction: column;
|
|
586
|
+
gap: var(--spacing-200);
|
|
587
|
+
width: 100%;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.plot {
|
|
591
|
+
position: relative;
|
|
592
|
+
width: 100%;
|
|
593
|
+
outline: none;
|
|
594
|
+
touch-action: pan-y;
|
|
595
|
+
border-radius: var(--shape-corner-small);
|
|
596
|
+
}
|
|
597
|
+
.plot:focus-visible {
|
|
598
|
+
outline: 2px solid var(--color-primary);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.chart-svg {
|
|
602
|
+
display: block;
|
|
603
|
+
overflow: visible;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.gridline {
|
|
607
|
+
stroke: var(--_chart-grid-color);
|
|
608
|
+
stroke-dasharray: 3 3;
|
|
609
|
+
shape-rendering: crispEdges;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
.baseline {
|
|
613
|
+
stroke: var(--_chart-grid-color);
|
|
614
|
+
shape-rendering: crispEdges;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.axis-label {
|
|
618
|
+
font-family: var(--typography-label-medium-font-family) !important;
|
|
619
|
+
font-size: var(--typography-label-medium-font-size) !important;
|
|
620
|
+
font-weight: var(--typography-label-medium-font-weight) !important;
|
|
621
|
+
line-height: var(--typography-label-medium-line-height) !important;
|
|
622
|
+
letter-spacing: var(--typography-label-medium-letter-spacing) !important;
|
|
623
|
+
fill: var(--_chart-axis-color);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
.value-label {
|
|
627
|
+
font-family: var(--typography-label-small-font-family) !important;
|
|
628
|
+
font-size: var(--typography-label-small-font-size) !important;
|
|
629
|
+
font-weight: var(--typography-label-small-font-weight) !important;
|
|
630
|
+
line-height: var(--typography-label-small-line-height) !important;
|
|
631
|
+
letter-spacing: var(--typography-label-small-letter-spacing) !important;
|
|
632
|
+
fill: var(--color-on-surface);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.cursor {
|
|
636
|
+
fill: var(--_chart-cursor-color);
|
|
637
|
+
stroke: var(--_chart-cursor-color);
|
|
638
|
+
opacity: 0;
|
|
639
|
+
pointer-events: none;
|
|
640
|
+
transition: opacity var(--duration-short2) var(--easing-standard);
|
|
641
|
+
}
|
|
642
|
+
.cursor.is-visible {
|
|
643
|
+
opacity: 0.08;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.cursor-line.is-visible {
|
|
647
|
+
opacity: 0.4;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
.mark {
|
|
651
|
+
transition: opacity var(--duration-short3) var(--easing-standard);
|
|
652
|
+
}
|
|
653
|
+
.mark.is-dimmed {
|
|
654
|
+
opacity: var(--_chart-dim-opacity);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
.tooltip {
|
|
658
|
+
position: absolute;
|
|
659
|
+
z-index: 1;
|
|
660
|
+
min-width: 8rem;
|
|
661
|
+
padding: var(--spacing-150) var(--spacing-200);
|
|
662
|
+
border-radius: var(--shape-corner-small);
|
|
663
|
+
background: var(--color-surface-container-high);
|
|
664
|
+
color: var(--color-on-surface);
|
|
665
|
+
box-shadow: var(--elevation-level2);
|
|
666
|
+
pointer-events: none;
|
|
667
|
+
transform: translateY(-50%);
|
|
668
|
+
white-space: nowrap;
|
|
669
|
+
}
|
|
670
|
+
.tooltip.flip {
|
|
671
|
+
transform: translate(-100%, -50%);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.tooltip-title {
|
|
675
|
+
font-family: var(--typography-label-large-font-family) !important;
|
|
676
|
+
font-size: var(--typography-label-large-font-size) !important;
|
|
677
|
+
font-weight: var(--typography-label-large-font-weight) !important;
|
|
678
|
+
line-height: var(--typography-label-large-line-height) !important;
|
|
679
|
+
letter-spacing: var(--typography-label-large-letter-spacing) !important;
|
|
680
|
+
margin-bottom: var(--spacing-100);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
.tooltip-row {
|
|
684
|
+
display: flex;
|
|
685
|
+
align-items: center;
|
|
686
|
+
gap: var(--spacing-150);
|
|
687
|
+
font-family: var(--typography-body-small-font-family) !important;
|
|
688
|
+
font-size: var(--typography-body-small-font-size) !important;
|
|
689
|
+
font-weight: var(--typography-body-small-font-weight) !important;
|
|
690
|
+
line-height: var(--typography-body-small-line-height) !important;
|
|
691
|
+
letter-spacing: var(--typography-body-small-letter-spacing) !important;
|
|
692
|
+
}
|
|
693
|
+
.tooltip-row + .tooltip-row {
|
|
694
|
+
margin-top: var(--spacing-050);
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.tooltip-label {
|
|
698
|
+
flex: 1;
|
|
699
|
+
color: var(--color-on-surface-variant);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
.tooltip-value {
|
|
703
|
+
font-variant-numeric: tabular-nums;
|
|
704
|
+
font-weight: 500;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.swatch {
|
|
708
|
+
flex: none;
|
|
709
|
+
width: 0.625rem;
|
|
710
|
+
height: 0.625rem;
|
|
711
|
+
border-radius: var(--shape-corner-full);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
::slotted([slot=insight]) {
|
|
715
|
+
display: block;
|
|
716
|
+
margin-block-start: var(--spacing-150);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.legend {
|
|
720
|
+
display: flex;
|
|
721
|
+
flex-wrap: wrap;
|
|
722
|
+
justify-content: center;
|
|
723
|
+
gap: var(--spacing-050) var(--spacing-200);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.legend-item {
|
|
727
|
+
background: transparent;
|
|
728
|
+
border: none;
|
|
729
|
+
appearance: none;
|
|
730
|
+
margin: 0;
|
|
731
|
+
outline: none;
|
|
732
|
+
padding: 0;
|
|
733
|
+
font-family: var(--typography-label-medium-font-family) !important;
|
|
734
|
+
font-size: var(--typography-label-medium-font-size) !important;
|
|
735
|
+
font-weight: var(--typography-label-medium-font-weight) !important;
|
|
736
|
+
line-height: var(--typography-label-medium-line-height) !important;
|
|
737
|
+
letter-spacing: var(--typography-label-medium-letter-spacing) !important;
|
|
738
|
+
display: inline-flex;
|
|
739
|
+
align-items: center;
|
|
740
|
+
gap: var(--spacing-100);
|
|
741
|
+
padding: var(--spacing-050) var(--spacing-100);
|
|
742
|
+
border-radius: var(--shape-corner-small);
|
|
743
|
+
color: var(--color-on-surface);
|
|
744
|
+
cursor: pointer;
|
|
745
|
+
}
|
|
746
|
+
.legend-item:hover {
|
|
747
|
+
background: var(--color-surface-container-high);
|
|
748
|
+
}
|
|
749
|
+
.legend-item:focus-visible {
|
|
750
|
+
outline: 2px solid var(--color-primary);
|
|
751
|
+
}
|
|
752
|
+
.legend-item.is-hidden {
|
|
753
|
+
color: var(--color-on-surface-variant);
|
|
754
|
+
text-decoration: line-through;
|
|
755
|
+
}
|
|
756
|
+
.legend-item.is-hidden .swatch {
|
|
757
|
+
opacity: var(--_chart-dim-opacity);
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
.empty {
|
|
761
|
+
display: flex;
|
|
762
|
+
align-items: center;
|
|
763
|
+
justify-content: center;
|
|
764
|
+
font-family: var(--typography-body-medium-font-family) !important;
|
|
765
|
+
font-size: var(--typography-body-medium-font-size) !important;
|
|
766
|
+
font-weight: var(--typography-body-medium-font-weight) !important;
|
|
767
|
+
line-height: var(--typography-body-medium-line-height) !important;
|
|
768
|
+
letter-spacing: var(--typography-body-medium-letter-spacing) !important;
|
|
769
|
+
color: var(--color-on-surface-variant);
|
|
770
|
+
border: 1px dashed var(--color-outline-variant);
|
|
771
|
+
border-radius: var(--shape-corner-medium);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.skeleton {
|
|
775
|
+
position: relative;
|
|
776
|
+
overflow: hidden;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
.skeleton-bars {
|
|
780
|
+
display: flex;
|
|
781
|
+
align-items: flex-end;
|
|
782
|
+
gap: var(--spacing-200);
|
|
783
|
+
padding: var(--spacing-200) 0 0;
|
|
784
|
+
border-bottom: 1px solid var(--color-outline-variant);
|
|
785
|
+
}
|
|
786
|
+
.skeleton-bars span {
|
|
787
|
+
flex: 1;
|
|
788
|
+
border-radius: var(--shape-corner-extra-small) var(--shape-corner-extra-small) 0 0;
|
|
789
|
+
background: var(--color-surface-container-highest);
|
|
790
|
+
animation: chart-pulse 1.6s var(--easing-standard) infinite;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.skeleton-circle {
|
|
794
|
+
display: flex;
|
|
795
|
+
align-items: center;
|
|
796
|
+
justify-content: center;
|
|
797
|
+
}
|
|
798
|
+
.skeleton-circle span {
|
|
799
|
+
height: 100%;
|
|
800
|
+
aspect-ratio: 1;
|
|
801
|
+
border-radius: 50%;
|
|
802
|
+
background: var(--color-surface-container-highest);
|
|
803
|
+
animation: chart-pulse 1.6s var(--easing-standard) infinite;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
@keyframes chart-pulse {
|
|
807
|
+
50% {
|
|
808
|
+
opacity: 0.5;
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
.sr-only {
|
|
812
|
+
position: absolute;
|
|
813
|
+
width: 1px;
|
|
814
|
+
height: 1px;
|
|
815
|
+
margin: -1px;
|
|
816
|
+
padding: 0;
|
|
817
|
+
overflow: hidden;
|
|
818
|
+
clip: rect(0 0 0 0);
|
|
819
|
+
white-space: nowrap;
|
|
820
|
+
border: 0;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
@media (prefers-reduced-motion: reduce) {
|
|
824
|
+
.skeleton span,
|
|
825
|
+
.mark,
|
|
826
|
+
.cursor {
|
|
827
|
+
animation: none;
|
|
828
|
+
transition: none;
|
|
829
|
+
}
|
|
830
|
+
}`;
|
|
831
|
+
|
|
832
|
+
export { ChartBase as C, constant as a, array as b, css_248z as c, chartColor as d, interpolate as i, select as s };
|
|
833
|
+
//# sourceMappingURL=chart-base-Dhxuw_Mw.js.map
|