@heartlandone/vega 2.75.1 → 2.77.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/cjs/{app-globals-35614ce8.js → app-globals-04e7024b.js} +28 -32
- package/dist/cjs/aria-attributes-value-mapper-f58c73f8.js +136 -0
- package/dist/cjs/breakpoints-751d433a.js +56 -0
- package/dist/cjs/{child-nodes-event-prevent-slimmer-aca87dac.js → child-nodes-event-prevent-slimmer-cc6d2919.js} +2 -2
- package/dist/cjs/{child-nodes-notify-observer-slimmer-257fedb3.js → child-nodes-notify-observer-slimmer-ed39283b.js} +1 -1
- package/dist/cjs/{code-block-c1d2e6a8.js → code-block-f1480ec3.js} +17 -17
- package/dist/cjs/{component-global-style-slimmer-adfa2e59.js → component-global-style-slimmer-93c5fb50.js} +2 -1
- package/dist/cjs/{component-usage-runtime-metrics-d10ace87.js → component-usage-runtime-metrics-4572c5b7.js} +1 -1
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-787c67dc.js → component-value-history-controller-slimmer.abstract-a9264cc8.js} +5 -5
- package/dist/cjs/{create-public-api-runtime-metrics-slimmer-e2e274e1.js → create-public-api-runtime-metrics-slimmer-9cb09fb2.js} +3 -41
- package/dist/cjs/{dark-mode-style-controller-c21172aa.js → dark-mode-style-controller-3a04af3d.js} +292 -1254
- package/dist/cjs/{date-required-rule-30ee62d0.js → date-required-rule-912469e0.js} +1 -1
- package/dist/cjs/{design-token-bb39e07e.js → design-token-c49717c8.js} +2 -2
- package/dist/cjs/dom-node-subject-observer-factory-c62823de.js +141 -0
- package/dist/cjs/{dto-renderer-manager-03e1a038.js → dto-renderer-manager-809c947b.js} +33 -33
- package/dist/cjs/{element-appender-slimmer-daa8b9f5.js → element-appender-slimmer-38583ca9.js} +349 -166
- package/dist/cjs/{event-emit-slimmer-2dacabbd.js → event-emit-slimmer-062cdcb8.js} +2 -2
- package/dist/cjs/{feature-flag-controller-ce2162c8.js → feature-flag-controller-9129ef52.js} +7 -1
- package/dist/cjs/{form-field-controller-slimmer-aef2fb1e.js → form-field-controller-slimmer-102f37c7.js} +13 -14
- package/dist/cjs/{internal-icon-manager-32f9ed63.js → icon-manager-c12c6ea9.js} +1 -52
- package/dist/cjs/{image-annotation-action-3fa501b7.js → image-annotation-action-8d9fa20c.js} +10 -9
- package/dist/cjs/index-592b4052.js +220 -0
- package/dist/cjs/{index-4d7bce1a.js → index-f054eb5d.js} +15 -3
- package/dist/cjs/index.cjs.js +68 -65
- package/dist/cjs/{inject-keyboard-manager-d21b4387.js → inject-keyboard-manager-0f5bd568.js} +1 -1
- package/dist/cjs/internal-icon-manager-c989189a.js +55 -0
- package/dist/cjs/{translation-5f9f9c0c.js → internal-translation-controller-053eb0f1.js} +0 -93
- package/dist/cjs/{internal-vega-event-manager-6befeb34.js → internal-vega-event-manager-f7ecf3d4.js} +81 -81
- package/dist/cjs/internal-vega-z-index-manager-f03ddb37.js +180 -0
- package/dist/cjs/{keyboard-manager-3dea6b28.js → keyboard-manager-055e9f67.js} +2 -2
- package/dist/cjs/{keyboard-manager-slimmer-0d45f944.js → keyboard-manager-slimmer-0cc0c1c7.js} +1 -1
- package/dist/cjs/legend-input-processor-1e53e5bc.js +2126 -0
- package/dist/cjs/loader.cjs.js +26 -23
- package/dist/cjs/misc-3d30df91.js +41 -0
- package/dist/cjs/{month-view-generator-49cc5fc2.js → month-view-generator-6a6dd527.js} +1 -1
- package/dist/cjs/{page-resize-observer-slimmer-11937d6f.js → page-resize-observer-slimmer-7f065ee1.js} +2 -54
- package/dist/cjs/{public-rules-dc2a8d62.js → public-rules-922849f3.js} +12 -13
- package/dist/cjs/{range-79b668e7.js → range-8aa49b08.js} +2 -2
- package/dist/cjs/{responsive-format-facade-d5dba942.js → responsive-format-facade-acc39a40.js} +13 -22
- package/dist/cjs/{rich-text-editor-required-rule-ba312af9.js → rich-text-editor-required-rule-22225840.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-63514c60.js → string-format-strategy.abstract-f2575647.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-f3e0bbc7.js → string-input-formatter-slimmer-0a334fc6.js} +5 -5
- package/dist/cjs/{string-mask-strategy-d23ac21a.js → string-mask-strategy-dda58395.js} +2 -2
- package/dist/cjs/{style-formatter-49693da7.js → style-formatter-028af284.js} +2 -2
- package/dist/cjs/{sub-state-notify-slimmer-468e19aa.js → sub-state-notify-slimmer-58121111.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-5d0b8ac3.js → sub-state-observer-slimmer-1dfbc4c3.js} +2 -2
- package/dist/cjs/{time-required-rule-c96ecdc9.js → time-required-rule-d6fa7aa8.js} +1 -1
- package/dist/cjs/{function-extension-cfbbc57e.js → token-extension-ffcaeae0.js} +621 -486
- package/dist/cjs/{translation-slimmer-f0ebe710.js → translation-slimmer-4533bd67.js} +4 -4
- package/dist/cjs/{type-guard-a0f026d8.js → type-guard-407ba0b8.js} +3 -3
- package/dist/cjs/{ui-9e181079.js → ui-234ea151.js} +12 -0
- package/dist/cjs/{valid-credit-card-number-rule-c854bed9.js → valid-credit-card-number-rule-41a8b51b.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +23 -32
- package/dist/cjs/vega-app-footer.cjs.entry.js +3 -3
- package/dist/cjs/vega-app-header-button.cjs.entry.js +47 -38
- package/dist/cjs/vega-backdrop.cjs.entry.js +2 -2
- package/dist/cjs/vega-banner.cjs.entry.js +15 -13
- package/dist/cjs/vega-bar-chart.cjs.entry.js +3 -3
- package/dist/cjs/vega-box.cjs.entry.js +18 -33
- package/dist/cjs/vega-brand-logo.cjs.entry.js +7 -5
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +14 -13
- package/dist/cjs/vega-button-circle.cjs.entry.js +37 -32
- package/dist/cjs/vega-button-group_2.cjs.entry.js +15 -15
- package/dist/cjs/vega-button-link.cjs.entry.js +15 -14
- package/dist/cjs/vega-button.cjs.entry.js +21 -30
- package/dist/cjs/vega-calendar_4.cjs.entry.js +48 -45
- package/dist/cjs/vega-card.cjs.entry.js +9 -28
- package/dist/cjs/vega-carousel.cjs.entry.js +15 -26
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +22 -20
- package/dist/cjs/vega-chip.cjs.entry.js +22 -33
- package/dist/cjs/vega-code-block.cjs.entry.js +658 -2709
- package/dist/cjs/vega-color-picker.cjs.entry.js +15 -12
- package/dist/cjs/vega-combo-box.cjs.entry.js +29 -28
- package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +78 -59
- package/dist/cjs/vega-dialog-controller-03ef4d9a.js +84 -0
- package/dist/cjs/vega-dialog_2.cjs.entry.js +37 -44
- package/dist/cjs/vega-divider.cjs.entry.js +12 -30
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +49 -55
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/{dom-node-subject-observer-factory-b5e71bf6.js → vega-event-id-ee01d8dd.js} +0 -139
- package/dist/cjs/vega-field-error.cjs.entry.js +1 -1
- package/dist/cjs/vega-field-label.cjs.entry.js +9 -8
- package/dist/cjs/vega-file-uploader.cjs.entry.js +28 -23
- package/dist/cjs/vega-flag-icon.cjs.entry.js +13 -27
- package/dist/cjs/vega-flex.cjs.entry.js +11 -28
- package/dist/cjs/vega-font.cjs.entry.js +12 -29
- package/dist/cjs/vega-form.cjs.entry.js +24 -22
- package/dist/cjs/vega-grid.cjs.entry.js +9 -28
- package/dist/cjs/vega-hint.cjs.entry.js +1 -1
- package/dist/cjs/vega-icon.cjs.entry.js +18 -31
- package/dist/cjs/vega-image-uploader.cjs.entry.js +34 -37
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +31 -27
- package/dist/cjs/vega-input-numeric.cjs.entry.js +24 -22
- package/dist/cjs/vega-input-passcode.cjs.entry.js +26 -24
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +4764 -5600
- package/dist/cjs/vega-input-range.cjs.entry.js +22 -20
- package/dist/cjs/vega-input-select.cjs.entry.js +41 -46
- package/dist/cjs/vega-input.cjs.entry.js +43 -31
- package/dist/cjs/vega-item-toggle.cjs.entry.js +8 -7
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +38 -40
- package/dist/cjs/vega-line-chart.cjs.entry.js +326 -24
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +16 -32
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +5 -4
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +12 -12
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +9 -10
- package/dist/cjs/vega-pagination.cjs.entry.js +28 -38
- package/dist/cjs/vega-pie-chart.cjs.entry.js +6 -89
- package/dist/cjs/vega-popover_2.cjs.entry.js +21 -31
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +66 -39
- package/dist/cjs/vega-radio_2.cjs.entry.js +25 -23
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +36 -20
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +58 -55
- package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
- package/dist/cjs/vega-segment-control.cjs.entry.js +10 -8
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +25 -32
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +22 -20
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +34 -40
- package/dist/cjs/vega-signature-capture.cjs.entry.js +27 -31
- package/dist/cjs/vega-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
- package/dist/cjs/vega-stepper.cjs.entry.js +23 -21
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +15 -14
- package/dist/cjs/vega-table_11.cjs.entry.js +67 -68
- package/dist/cjs/vega-text.cjs.entry.js +4 -3
- package/dist/cjs/vega-textarea.cjs.entry.js +22 -20
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +35 -41
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +15 -12
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +17 -28
- package/dist/cjs/vega.cjs.js +26 -23
- package/dist/cjs/{index-95fca64f.js → wait-for-component-did-render-70a01bf9.js} +1 -12
- package/dist/cjs/y-axis-input-processor-54a26515.js +832 -0
- package/dist/collection/components/vega-accordion/slimmers/vega-accordion-renderer.js +1 -1
- package/dist/collection/components/vega-accordion/vega-accordion.css +5 -0
- package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +17 -2
- package/dist/collection/components/vega-box/slimmers/controllers/vega-box-responsive-style-controller.js +2 -1
- package/dist/collection/components/vega-box/slimmers/controllers/vega-box-state-styles-controller.js +2 -1
- package/dist/collection/components/vega-button/vega-button.js +2 -1
- package/dist/collection/components/vega-button-circle/vega-button-circle.js +19 -4
- package/dist/collection/components/vega-button-link/vega-button-link.css +1 -1
- package/dist/collection/components/vega-button-link/vega-button-link.js +2 -1
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/base-repeat-pattern.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-daily-repeat-pattern.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-monthly-repeat-pattern.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-weekly-repeat-pattern.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-yearly-repeat-pattern.js +1 -1
- package/dist/collection/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.js +5 -14
- package/dist/collection/components/vega-combo-box/slimmers/renderers/vega-combo-box-dropdown-renderer.js +2 -2
- package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-open-state-controller.js +1 -1
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +1 -1
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +16 -2
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.css +184 -207
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +32 -0
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-search-controller.js +2 -2
- package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.js +2 -2
- package/dist/collection/components/vega-dropdown/vega-dropdown-group/slimmers/renderers/vega-dropdown-group-renderer.js +3 -3
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +6 -4
- package/dist/collection/components/vega-icon/vega-icon.js +2 -1
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-container-renderer.js +10 -2
- package/dist/collection/components/vega-input-phone-number/slimmers/controllers/country-select-controller.js +1 -1
- package/dist/collection/components/vega-input-phone-number/slimmers/controllers/vega-input-phone-number-value-controller.js +1 -1
- package/dist/collection/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.js +2 -2
- package/dist/collection/components/vega-input-phone-number/slimmers/renderers/phone-number-input-renderer.js +1 -1
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +4 -4
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +2 -2
- package/dist/collection/components/vega-pagination/vega-pagination.js +1 -1
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.js +30 -6
- package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.js +1 -1
- package/dist/collection/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.js +8 -1
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.js +27 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.css +12 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +8 -3
- package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +15 -0
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/base-extension-renderer.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +15 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/function-extension.js +0 -11
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.js +23 -23
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-extension.js +0 -10
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.js +7 -17
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +12 -16
- package/dist/collection/components/vega-rich-text-editor/helpers/extension-context-manager.js +31 -0
- package/dist/collection/components/vega-rich-text-editor/helpers/extension-context-manager.test.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/test/extensions/extension-test-utils.js +41 -0
- package/dist/collection/components/vega-signature-capture/slimmers/written-mode/controllers/written-mode-svg-controller.js +2 -1
- package/dist/collection/components/vega-table/interface.js +3 -0
- package/dist/collection/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.js +1 -1
- package/dist/collection/global/scripts/before-vega-load.js +4 -3
- package/dist/collection/helpers/calendar/calendar-date.js +1 -1
- package/dist/collection/helpers/calendar/calendar-event.js +1 -1
- package/dist/collection/helpers/calendar/calendar-time.js +1 -1
- package/dist/collection/helpers/chart/input-processors/format-time-positions-input-processor.js +2 -2
- package/dist/collection/helpers/chart/input-processors/pie-chart-arc-path-input-processor.js +1 -1
- package/dist/collection/helpers/chart/input-processors/x-axis-input-processor.js +5 -3
- package/dist/collection/helpers/chart/input-processors/x-axis-label-formatter-input-processor.js +2 -1
- package/dist/collection/helpers/chart/input-processors/y-axis-input-processor.js +7 -5
- package/dist/collection/helpers/chart/interacting-entry-generator/arc-path-hover-generator.js +1 -1
- package/dist/collection/helpers/chart/interacting-entry-generator/pie-legend-hover-generator.js +1 -1
- package/dist/collection/helpers/chart/renderers/canvas-renderer.js +1 -1
- package/dist/collection/helpers/chart/renderers/svg-renderer.js +1 -1
- package/dist/collection/helpers/chart/test/drawers/arc-path-drawer.test.js +1 -1
- package/dist/collection/helpers/chart/test/input-processors/format-time-positions-input-processor.test.js +1 -1
- package/dist/collection/helpers/chart/test/input-processors/sort-positions-input-processor.test.js +1 -1
- package/dist/collection/helpers/chart/test/input-processors/x-axis-input-processor.test.js +39 -0
- package/dist/collection/helpers/chart/test/input-processors/x-axis-label-formatter-input-processor.test.js +61 -14
- package/dist/collection/helpers/chart/test/input-processors/y-axis-input-processor.coverage.test.js +39 -0
- package/dist/collection/helpers/chart/test/input-processors/y-axis-input-processor.test.js +14 -0
- package/dist/collection/helpers/chart/test/renderers/svg-renderer.test.js +1 -1
- package/dist/collection/helpers/code-format/test/code-formatter.test.js +1 -1
- package/dist/collection/helpers/common/index.js +2 -37
- package/dist/collection/helpers/common/test/wait-for-component-did-render.test.js +67 -0
- package/dist/collection/helpers/common/test/wait-for-vega-handler.test.js +2 -2
- package/dist/collection/helpers/common/wait-for-component-did-render.js +27 -0
- package/dist/collection/helpers/common/wait-for-vega-handler.js +12 -1
- package/dist/collection/helpers/feature-control/feature-flags-map.js +6 -0
- package/dist/collection/helpers/formatter/responsive-map-formatter/responsive-border-radius-style-formatter.js +1 -1
- package/dist/collection/helpers/public-api.js +0 -2
- package/dist/collection/helpers/slimmers/component-global-style-slimmer.js +2 -1
- package/dist/collection/helpers/slimmers/field-error-ui-controller-slimmer.js +3 -4
- package/dist/collection/helpers/slimmers/form-field-message-translator.js +1 -1
- package/dist/collection/helpers/slimmers/global/vega-translate-observer-slimmer.js +1 -1
- package/dist/collection/helpers/slimmers/global/vega-watch-method-cancel-slimmer.js +1 -1
- package/dist/collection/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.js +132 -0
- package/dist/collection/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.js +196 -0
- package/dist/collection/helpers/slimmers/position-calculation/base-position-calculation-strategy.js +162 -151
- package/dist/collection/helpers/slimmers/position-calculation/position-calculation-controller.js +9 -0
- package/dist/collection/helpers/slimmers/position-calculation/screen-position-calculation-strategy.js +112 -1
- package/dist/collection/helpers/slimmers/position-calculation/screen-scroll-position-update.js +53 -0
- package/dist/collection/helpers/slimmers/position-calculation/test/screen-position-calculation-strategy.test.js +103 -6
- package/dist/collection/helpers/slimmers/string-input-formatter-slimmer.js +1 -1
- package/dist/collection/helpers/slimmers/translation/translation-slimmer.js +1 -1
- package/dist/collection/helpers/theme/controllers/brand-style-controller.js +3 -1
- package/dist/collection/helpers/theme/controllers/color-schema-overriding-controller.js +8 -6
- package/dist/collection/helpers/theme/controllers/dark-mode-style-controller.js +3 -1
- package/dist/collection/helpers/theme/internal-theme-manager.js +2 -1
- package/dist/collection/helpers/theme/tests/theme-manager-controller.test.js +1 -2
- package/dist/collection/helpers/ui/element-appender.js +4 -5
- package/dist/collection/helpers/ui/test/element-appender.test.js +66 -17
- package/dist/collection/helpers/validator/rules/valid-phone-number-rule.js +1 -1
- package/dist/collection/helpers/validator/test/rules/valid-phone-number-rule.test.js +10 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/polyfill/d3/d3-array-polyfill.js +89 -0
- package/dist/collection/polyfill/d3/d3-axis-polyfill.js +195 -0
- package/dist/collection/polyfill/d3/d3-scale-polyfill.js +582 -0
- package/dist/collection/polyfill/d3/d3-selection-polyfill.js +274 -0
- package/dist/collection/polyfill/d3/d3-shape-polyfill.js +252 -0
- package/dist/collection/polyfill/d3/d3-time-format-polyfill.js +207 -0
- package/dist/collection/polyfill/d3/d3-time-polyfill.js +99 -0
- package/dist/collection/polyfill/d3/index.js +31 -0
- package/dist/collection/polyfill/d3/test/d3-array-polyfill.test.js +72 -0
- package/dist/collection/polyfill/d3/test/d3-axis-polyfill.test.js +171 -0
- package/dist/collection/polyfill/d3/test/d3-integration.test.js +137 -0
- package/dist/collection/polyfill/d3/test/d3-scale-polyfill.test.js +382 -0
- package/dist/collection/polyfill/d3/test/d3-selection-polyfill.test.js +239 -0
- package/dist/collection/polyfill/d3/test/d3-shape-polyfill.test.js +225 -0
- package/dist/collection/polyfill/d3/test/d3-time-format-polyfill.test.js +162 -0
- package/dist/collection/polyfill/d3/test/d3-time-polyfill.test.js +76 -0
- package/dist/collection/polyfill/d3/test/index.test.js +78 -0
- package/dist/collection/polyfill/libphonenumber/as-you-type.js +405 -0
- package/dist/collection/polyfill/libphonenumber/format-helpers.js +186 -0
- package/dist/collection/polyfill/libphonenumber/index.js +22 -0
- package/dist/collection/polyfill/libphonenumber/metadata.js +150 -0
- package/dist/collection/polyfill/libphonenumber/metadata.json.js +3900 -0
- package/dist/collection/polyfill/libphonenumber/parse-phone-number.js +127 -0
- package/dist/collection/polyfill/libphonenumber/phone-number.js +38 -0
- package/dist/collection/polyfill/libphonenumber/test/as-you-type.test.js +309 -0
- package/dist/collection/polyfill/libphonenumber/test/format-helpers.test.js +192 -0
- package/dist/collection/polyfill/libphonenumber/test/index.test.js +16 -0
- package/dist/collection/polyfill/libphonenumber/test/metadata.test.js +196 -0
- package/dist/collection/polyfill/libphonenumber/test/parse-phone-number.test.js +218 -0
- package/dist/collection/polyfill/libphonenumber/test/phone-number.test.js +56 -0
- package/dist/collection/polyfill/libphonenumber/types.js +23 -0
- package/dist/collection/polyfill/prism/index.js +2 -0
- package/dist/collection/polyfill/prism/languages/css.js +86 -0
- package/dist/collection/polyfill/prism/languages/javascript.js +96 -0
- package/dist/collection/polyfill/prism/languages/jsx.js +46 -0
- package/dist/collection/polyfill/prism/languages/language-registry.js +41 -0
- package/dist/collection/polyfill/prism/languages/markup.js +71 -0
- package/dist/collection/polyfill/prism/languages/tsx.js +10 -0
- package/dist/collection/polyfill/prism/languages/typescript.js +64 -0
- package/dist/collection/polyfill/prism/test/css.test.js +61 -0
- package/dist/collection/polyfill/prism/test/javascript.test.js +113 -0
- package/dist/collection/polyfill/prism/test/jsx.test.js +48 -0
- package/dist/collection/polyfill/prism/test/language-registry.test.js +77 -0
- package/dist/collection/polyfill/prism/test/markup.test.js +57 -0
- package/dist/collection/polyfill/prism/test/test-utils.js +22 -0
- package/dist/collection/polyfill/prism/test/tokenizer.test.js +180 -0
- package/dist/collection/polyfill/prism/test/tsx.test.js +87 -0
- package/dist/collection/polyfill/prism/test/typescript.test.js +86 -0
- package/dist/collection/polyfill/prism/tokenizer.js +242 -0
- package/dist/collection/polyfill/tinycolor/tinycolor-polyfill.js +320 -0
- package/dist/collection/polyfill/tinycolor/tinycolor-polyfill.test.js +361 -0
- package/dist/collection/types/ui.type.js +12 -0
- package/dist/collection/utils/e2e-utils.js +10 -3
- package/dist/collection/utils/sanitize/constants/tag-sets.js +5 -0
- package/dist/collection/utils/sanitize/core/html-sanitizer.js +39 -0
- package/dist/collection/utils/sanitize/core/sanitize-strategy.js +62 -0
- package/dist/collection/utils/sanitize/core/types.js +4 -0
- package/dist/collection/utils/sanitize/index.js +12 -0
- package/dist/collection/utils/sanitize/strategies/empty-sanitize-strategy.js +17 -0
- package/dist/collection/utils/sanitize/strategies/index.js +3 -0
- package/dist/collection/utils/sanitize/strategies/label-sanitize-strategy.js +13 -0
- package/dist/collection/utils/sanitize/strategies/style-sanitize-strategy.js +50 -0
- package/dist/collection/utils/sanitize/test/empty-strategy.test.js +12 -0
- package/dist/collection/utils/sanitize/test/html-sanitizer.test.js +57 -0
- package/dist/collection/utils/sanitize/test/label-strategy.test.js +56 -0
- package/dist/collection/utils/sanitize/test/sanitize-strategy.test.js +85 -0
- package/dist/collection/utils/sanitize/test/sanitize.test.js +22 -0
- package/dist/collection/utils/sanitize/test/serialize-fragment.test.js +25 -0
- package/dist/collection/utils/sanitize/test/style-strategy.test.js +45 -0
- package/dist/collection/utils/sanitize/utils/serialize-fragment.js +17 -0
- package/dist/esm/{app-globals-2ac60ff5.js → app-globals-32055795.js} +12 -16
- package/dist/esm/aria-attributes-value-mapper-d4fef46a.js +134 -0
- package/dist/esm/breakpoints-56e5407b.js +53 -0
- package/dist/esm/{child-nodes-event-prevent-slimmer-e662bee2.js → child-nodes-event-prevent-slimmer-331312b8.js} +2 -2
- package/dist/esm/{child-nodes-notify-observer-slimmer-b676cd2b.js → child-nodes-notify-observer-slimmer-541dd6a4.js} +1 -1
- package/dist/esm/{code-block-8ee34ab6.js → code-block-b6247a45.js} +7 -7
- package/dist/esm/{component-global-style-slimmer-08046b38.js → component-global-style-slimmer-ac703085.js} +2 -1
- package/dist/esm/{component-usage-runtime-metrics-a84cc93e.js → component-usage-runtime-metrics-46020a03.js} +1 -1
- package/dist/esm/{component-value-history-controller-slimmer.abstract-a61bf821.js → component-value-history-controller-slimmer.abstract-2bb8533d.js} +6 -6
- package/dist/esm/{create-public-api-runtime-metrics-slimmer-bedf3a1e.js → create-public-api-runtime-metrics-slimmer-aaadaa08.js} +3 -38
- package/dist/esm/{dark-mode-style-controller-de88a117.js → dark-mode-style-controller-82e5c1c6.js} +292 -1254
- package/dist/esm/{date-required-rule-47ecc28f.js → date-required-rule-e771e7d9.js} +1 -1
- package/dist/esm/{design-token-007efbaa.js → design-token-5bc034e1.js} +2 -2
- package/dist/esm/dom-node-subject-observer-factory-82f346e3.js +138 -0
- package/dist/esm/{dto-renderer-manager-ee1a5864.js → dto-renderer-manager-6fd22ab7.js} +7 -7
- package/dist/esm/{element-appender-slimmer-35e26b5a.js → element-appender-slimmer-9ea377d0.js} +348 -165
- package/dist/esm/{event-emit-slimmer-09827cec.js → event-emit-slimmer-ffaecb9a.js} +2 -2
- package/dist/esm/{feature-flag-controller-51659753.js → feature-flag-controller-30f7b625.js} +7 -1
- package/dist/esm/{form-field-controller-slimmer-5d9dc384.js → form-field-controller-slimmer-5817d14d.js} +10 -11
- package/dist/esm/{internal-icon-manager-f0486245.js → icon-manager-539d7cf7.js} +2 -52
- package/dist/esm/{image-annotation-action-285d432e.js → image-annotation-action-6701b4c9.js} +6 -5
- package/dist/esm/index-3b327f29.js +215 -0
- package/dist/esm/{index-e9da316f.js → index-bfc6dfa2.js} +13 -1
- package/dist/esm/index.js +32 -29
- package/dist/esm/{inject-keyboard-manager-83d76ff5.js → inject-keyboard-manager-78730062.js} +1 -1
- package/dist/esm/internal-icon-manager-bd80b3bb.js +53 -0
- package/dist/esm/{translation-96e5debd.js → internal-translation-controller-911515f9.js} +1 -93
- package/dist/esm/{internal-vega-event-manager-efb6786e.js → internal-vega-event-manager-32a3d848.js} +1 -1
- package/dist/esm/internal-vega-z-index-manager-7d2b54c3.js +178 -0
- package/dist/esm/{keyboard-manager-c92808d8.js → keyboard-manager-38934f94.js} +2 -2
- package/dist/esm/{keyboard-manager-slimmer-79c78ce8.js → keyboard-manager-slimmer-9984d922.js} +1 -1
- package/dist/esm/legend-input-processor-122008c5.js +2116 -0
- package/dist/esm/loader.js +27 -24
- package/dist/esm/misc-9fdbcfbb.js +37 -0
- package/dist/esm/{month-view-generator-16192182.js → month-view-generator-eaf9029c.js} +1 -1
- package/dist/esm/{page-resize-observer-slimmer-8744cb44.js → page-resize-observer-slimmer-d6af0d86.js} +2 -52
- package/dist/esm/{public-rules-724873f5.js → public-rules-25cc3a39.js} +13 -14
- package/dist/esm/{range-5257c062.js → range-663f44dc.js} +2 -2
- package/dist/esm/{responsive-format-facade-28ee2dbd.js → responsive-format-facade-aa705823.js} +3 -12
- package/dist/esm/{rich-text-editor-required-rule-873e2e67.js → rich-text-editor-required-rule-a238b862.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-fc60db79.js → string-format-strategy.abstract-713fba36.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-ee32b1fd.js → string-input-formatter-slimmer-5b413ff9.js} +4 -4
- package/dist/esm/{string-mask-strategy-0b0accaa.js → string-mask-strategy-6beaf664.js} +2 -2
- package/dist/esm/{style-formatter-314b37f3.js → style-formatter-28138f5c.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-4453047a.js → sub-state-notify-slimmer-5133f1a8.js} +2 -2
- package/dist/esm/{sub-state-observer-slimmer-202ec7dc.js → sub-state-observer-slimmer-478c9f41.js} +3 -3
- package/dist/esm/{time-required-rule-5fa43804.js → time-required-rule-e4138a76.js} +1 -1
- package/dist/esm/{function-extension-e8c0e43e.js → token-extension-73e4460a.js} +609 -476
- package/dist/esm/{translation-slimmer-c936cb1b.js → translation-slimmer-2394b173.js} +1 -1
- package/dist/esm/{type-guard-c65a227d.js → type-guard-f50e34d6.js} +1 -1
- package/dist/esm/{ui-bb99c0c2.js → ui-ee31416b.js} +12 -0
- package/dist/esm/{valid-credit-card-number-rule-666c415d.js → valid-credit-card-number-rule-22ce81db.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +21 -30
- package/dist/esm/vega-app-footer.entry.js +3 -3
- package/dist/esm/vega-app-header-button.entry.js +38 -29
- package/dist/esm/vega-backdrop.entry.js +2 -2
- package/dist/esm/vega-banner.entry.js +12 -10
- package/dist/esm/vega-bar-chart.entry.js +3 -3
- package/dist/esm/vega-box.entry.js +14 -29
- package/dist/esm/vega-brand-logo.entry.js +7 -5
- package/dist/esm/vega-breadcrumb.entry.js +11 -10
- package/dist/esm/vega-button-circle.entry.js +36 -31
- package/dist/esm/vega-button-group_2.entry.js +12 -12
- package/dist/esm/vega-button-link.entry.js +13 -12
- package/dist/esm/vega-button.entry.js +19 -28
- package/dist/esm/vega-calendar_4.entry.js +23 -20
- package/dist/esm/vega-card.entry.js +9 -28
- package/dist/esm/vega-carousel.entry.js +14 -25
- package/dist/esm/vega-checkbox_2.entry.js +19 -17
- package/dist/esm/vega-chip.entry.js +18 -29
- package/dist/esm/vega-code-block.entry.js +653 -2704
- package/dist/esm/vega-color-picker.entry.js +15 -12
- package/dist/esm/vega-combo-box.entry.js +22 -21
- package/dist/esm/vega-counter-badge.entry.js +1 -1
- package/dist/esm/vega-date-picker_2.entry.js +59 -40
- package/dist/esm/vega-dialog-controller-bbb2fc52.js +82 -0
- package/dist/esm/vega-dialog_2.entry.js +23 -30
- package/dist/esm/vega-divider.entry.js +11 -29
- package/dist/esm/vega-dropdown_5.entry.js +39 -45
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-event-id-38aa77a0.js +113 -0
- package/dist/esm/vega-field-error.entry.js +1 -1
- package/dist/esm/vega-field-label.entry.js +7 -6
- package/dist/esm/vega-file-uploader.entry.js +19 -14
- package/dist/esm/vega-flag-icon.entry.js +12 -26
- package/dist/esm/vega-flex.entry.js +11 -28
- package/dist/esm/vega-font.entry.js +11 -28
- package/dist/esm/vega-form.entry.js +20 -18
- package/dist/esm/vega-grid.entry.js +9 -28
- package/dist/esm/vega-hint.entry.js +1 -1
- package/dist/esm/vega-icon.entry.js +15 -28
- package/dist/esm/vega-image-uploader.entry.js +28 -31
- package/dist/esm/vega-input-credit-card.entry.js +25 -21
- package/dist/esm/vega-input-numeric.entry.js +21 -19
- package/dist/esm/vega-input-passcode.entry.js +20 -18
- package/dist/esm/vega-input-phone-number.entry.js +4760 -5596
- package/dist/esm/vega-input-range.entry.js +19 -17
- package/dist/esm/vega-input-select.entry.js +27 -32
- package/dist/esm/vega-input.entry.js +33 -21
- package/dist/esm/{vega-internal-event-id-4a06d705.js → vega-internal-event-id-799d012e.js} +1 -1
- package/dist/esm/vega-item-toggle.entry.js +6 -5
- package/dist/esm/vega-left-nav_5.entry.js +29 -31
- package/dist/esm/vega-line-chart.entry.js +312 -10
- package/dist/esm/vega-loader-wrapper_2.entry.js +13 -29
- package/dist/esm/vega-page-notification_2.entry.js +4 -3
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +9 -9
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +7 -8
- package/dist/esm/vega-pagination.entry.js +20 -30
- package/dist/esm/vega-pie-chart.entry.js +6 -89
- package/dist/esm/vega-popover_2.entry.js +20 -30
- package/dist/esm/vega-progress-tracker_2.entry.js +64 -37
- package/dist/esm/vega-radio_2.entry.js +21 -19
- package/dist/esm/vega-rich-text-content.entry.js +32 -16
- package/dist/esm/vega-rich-text-editor_4.entry.js +33 -30
- package/dist/esm/vega-section-title.entry.js +1 -1
- package/dist/esm/vega-segment-control.entry.js +9 -7
- package/dist/esm/vega-selection-chip_2.entry.js +22 -29
- package/dist/esm/vega-selection-tile_2.entry.js +19 -17
- package/dist/esm/vega-sidenav_3.entry.js +24 -30
- package/dist/esm/vega-signature-capture.entry.js +24 -28
- package/dist/esm/vega-skeleton.entry.js +1 -1
- package/dist/esm/vega-slot-container.entry.js +1 -1
- package/dist/esm/vega-stepper.entry.js +18 -16
- package/dist/esm/vega-tab-group_2.entry.js +11 -10
- package/dist/esm/vega-table_11.entry.js +28 -29
- package/dist/esm/vega-text.entry.js +4 -3
- package/dist/esm/vega-textarea.entry.js +18 -16
- package/dist/esm/vega-time-picker_2.entry.js +26 -32
- package/dist/esm/vega-toggle-switch.entry.js +15 -12
- package/dist/esm/vega-tooltip_2.entry.js +18 -29
- package/dist/esm/vega.js +27 -24
- package/dist/esm/{index-51a7da7f.js → wait-for-component-did-render-b08ef07b.js} +3 -13
- package/dist/esm/y-axis-input-processor-c7e05353.js +826 -0
- package/dist/sri/vega-sri-manifest.json +425 -409
- package/dist/types/components/vega-app-footer/types.d.ts +18 -0
- package/dist/types/components/vega-app-header-button/types.d.ts +31 -0
- package/dist/types/components/vega-app-header-button/vega-app-header-button.d.ts +2 -0
- package/dist/types/components/vega-banner/types.d.ts +9 -0
- package/dist/types/components/vega-box/interface.d.ts +46 -0
- package/dist/types/components/vega-breadcrumb/types.d.ts +28 -0
- package/dist/types/components/vega-button/types.d.ts +12 -0
- package/dist/types/components/vega-button-circle/types.d.ts +9 -0
- package/dist/types/components/vega-button-circle/vega-button-circle.d.ts +2 -0
- package/dist/types/components/vega-button-group/types.d.ts +48 -0
- package/dist/types/components/vega-button-link/types.d.ts +3 -0
- package/dist/types/components/vega-calendar/types.d.ts +189 -0
- package/dist/types/components/vega-calendar/vega-calendar-event-preview/types.d.ts +6 -0
- package/dist/types/components/vega-chart/vega-bar-chart/types.d.ts +3 -0
- package/dist/types/components/vega-chip/types.d.ts +12 -0
- package/dist/types/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.d.ts +2 -10
- package/dist/types/components/vega-combo-box/types.d.ts +6 -0
- package/dist/types/components/vega-date-picker/types.d.ts +53 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.d.ts +3 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +9 -1
- package/dist/types/components/vega-dialog/types.d.ts +5 -0
- package/dist/types/components/vega-divider/interface.d.ts +18 -0
- package/dist/types/components/vega-dropdown/types.d.ts +30 -0
- package/dist/types/components/vega-dropdown/vega-dropdown-item/types.d.ts +9 -1
- package/dist/types/components/vega-field-error/types.d.ts +12 -0
- package/dist/types/components/vega-field-label/types.d.ts +16 -0
- package/dist/types/components/vega-file-uploader/types.d.ts +12 -0
- package/dist/types/components/vega-font/types.d.ts +3 -0
- package/dist/types/components/vega-form/types.d.ts +45 -0
- package/dist/types/components/vega-image-uploader/types.d.ts +33 -1
- package/dist/types/components/vega-input/types.d.ts +31 -0
- package/dist/types/components/vega-input-phone-number/types.d.ts +15 -0
- package/dist/types/components/vega-input-range/types.d.ts +9 -0
- package/dist/types/components/vega-input-select/types.d.ts +45 -0
- package/dist/types/components/vega-item-toggle/types.d.ts +21 -0
- package/dist/types/components/vega-loading-indicator/types.d.ts +3 -0
- package/dist/types/components/vega-modal/types.d.ts +9 -0
- package/dist/types/components/vega-nav/interface.d.ts +108 -0
- package/dist/types/components/vega-page-notification/types.d.ts +15 -0
- package/dist/types/components/vega-pagination/types.d.ts +11 -0
- package/dist/types/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.d.ts +16 -4
- package/dist/types/components/vega-progress-tracker/type.d.ts +8 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.d.ts +6 -0
- package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +2 -2
- package/dist/types/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/extensions/base-extension-renderer.d.ts +9 -1
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +9 -1
- package/dist/types/components/vega-rich-text-editor/extensions/functions/function-extension.d.ts +0 -7
- package/dist/types/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.d.ts +5 -10
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +1 -5
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.d.ts +3 -8
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.d.ts +5 -9
- package/dist/types/components/vega-rich-text-editor/helpers/extension-context-manager.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/helpers/extension-context-manager.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +477 -2
- package/dist/types/components/vega-rich-text-editor/test/extensions/extension-test-utils.d.ts +21 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-image-editor/types.d.ts +24 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/types.d.ts +24 -0
- package/dist/types/components/vega-segment-control/types.d.ts +18 -0
- package/dist/types/components/vega-selection-chip/interface.d.ts +12 -0
- package/dist/types/components/vega-selection-chip/vega-selection-chip-group/interface.d.ts +4 -0
- package/dist/types/components/vega-selection-tile/interface.d.ts +9 -0
- package/dist/types/components/vega-sidenav/types.d.ts +51 -0
- package/dist/types/components/vega-signature-capture/types.d.ts +29 -2
- package/dist/types/components/vega-skeleton/interface.d.ts +6 -0
- package/dist/types/components/vega-tab-group/types.d.ts +36 -0
- package/dist/types/components/vega-table/interface.d.ts +237 -20
- package/dist/types/components/vega-table/vega-table-expand-row/types.d.ts +6 -0
- package/dist/types/components/vega-table/vega-table-foot/types.d.ts +9 -0
- package/dist/types/components/vega-table/vega-table-foot-row/types.d.ts +9 -0
- package/dist/types/components/vega-table/vega-table-head/types.d.ts +9 -0
- package/dist/types/components/vega-table/vega-table-head-row/types.d.ts +12 -0
- package/dist/types/components/vega-table/vega-table-row/types.d.ts +18 -0
- package/dist/types/components/vega-text/types.d.ts +6 -0
- package/dist/types/components/vega-time-picker/types.d.ts +33 -0
- package/dist/types/components/vega-virtual-scroll/types.d.ts +30 -1
- package/dist/types/components.d.ts +24 -4
- package/dist/types/helpers/chart/test/input-processors/y-axis-input-processor.coverage.test.d.ts +1 -0
- package/dist/types/helpers/common/index.d.ts +2 -15
- package/dist/types/helpers/common/test/wait-for-component-did-render.test.d.ts +1 -0
- package/dist/types/helpers/common/wait-for-component-did-render.d.ts +8 -0
- package/dist/types/helpers/common/wait-for-vega-handler.d.ts +6 -15
- package/dist/types/helpers/feature-control/feature-flag.d.ts +2 -1
- package/dist/types/helpers/public-api.d.ts +0 -2
- package/dist/types/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.d.ts +44 -0
- package/dist/types/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.d.ts +1 -0
- package/dist/types/helpers/slimmers/position-calculation/base-position-calculation-strategy.d.ts +57 -48
- package/dist/types/helpers/slimmers/position-calculation/position-calculation-controller.d.ts +5 -0
- package/dist/types/helpers/slimmers/position-calculation/screen-position-calculation-strategy.d.ts +41 -1
- package/dist/types/helpers/slimmers/position-calculation/screen-scroll-position-update.d.ts +39 -0
- package/dist/types/helpers/ui/element-appender.d.ts +0 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/polyfill/d3/d3-array-polyfill.d.ts +48 -0
- package/dist/types/polyfill/d3/d3-axis-polyfill.d.ts +53 -0
- package/dist/types/polyfill/d3/d3-scale-polyfill.d.ts +42 -0
- package/dist/types/polyfill/d3/d3-selection-polyfill.d.ts +173 -0
- package/dist/types/polyfill/d3/d3-shape-polyfill.d.ts +129 -0
- package/dist/types/polyfill/d3/d3-time-format-polyfill.d.ts +28 -0
- package/dist/types/polyfill/d3/d3-time-polyfill.d.ts +68 -0
- package/dist/types/polyfill/d3/index.d.ts +27 -0
- package/dist/types/polyfill/d3/test/d3-array-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-axis-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-integration.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-scale-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-selection-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-shape-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-time-format-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-time-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/index.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/as-you-type.d.ts +154 -0
- package/dist/types/polyfill/libphonenumber/format-helpers.d.ts +64 -0
- package/dist/types/polyfill/libphonenumber/index.d.ts +22 -0
- package/dist/types/polyfill/libphonenumber/metadata.d.ts +45 -0
- package/dist/types/polyfill/libphonenumber/metadata.json.d.ts +470 -0
- package/dist/types/polyfill/libphonenumber/parse-phone-number.d.ts +26 -0
- package/dist/types/polyfill/libphonenumber/phone-number.d.ts +24 -0
- package/dist/types/polyfill/libphonenumber/test/as-you-type.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/test/format-helpers.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/test/index.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/test/metadata.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/test/parse-phone-number.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/test/phone-number.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/types.d.ts +77 -0
- package/dist/types/polyfill/prism/index.d.ts +3 -0
- package/dist/types/polyfill/prism/languages/css.d.ts +6 -0
- package/dist/types/polyfill/prism/languages/javascript.d.ts +7 -0
- package/dist/types/polyfill/prism/languages/jsx.d.ts +7 -0
- package/dist/types/polyfill/prism/languages/language-registry.d.ts +8 -0
- package/dist/types/polyfill/prism/languages/markup.d.ts +6 -0
- package/dist/types/polyfill/prism/languages/tsx.d.ts +7 -0
- package/dist/types/polyfill/prism/languages/typescript.d.ts +2 -0
- package/dist/types/polyfill/prism/test/css.test.d.ts +1 -0
- package/dist/types/polyfill/prism/test/javascript.test.d.ts +1 -0
- package/dist/types/polyfill/prism/test/jsx.test.d.ts +1 -0
- package/dist/types/polyfill/prism/test/language-registry.test.d.ts +1 -0
- package/dist/types/polyfill/prism/test/markup.test.d.ts +1 -0
- package/dist/types/polyfill/prism/test/test-utils.d.ts +10 -0
- package/dist/types/polyfill/prism/test/tokenizer.test.d.ts +1 -0
- package/dist/types/polyfill/prism/test/tsx.test.d.ts +1 -0
- package/dist/types/polyfill/prism/test/typescript.test.d.ts +1 -0
- package/dist/types/polyfill/prism/tokenizer.d.ts +17 -0
- package/dist/types/polyfill/prism/types.d.ts +25 -0
- package/dist/types/polyfill/tinycolor/tinycolor-polyfill.d.ts +149 -0
- package/dist/types/polyfill/tinycolor/tinycolor-polyfill.test.d.ts +1 -0
- package/dist/types/types/components.type.d.ts +5 -1
- package/dist/types/types/design-token.type.d.ts +36 -0
- package/dist/types/types/flag.type.d.ts +257 -3
- package/dist/types/types/general.d.ts +12 -0
- package/dist/types/types/ui.type.d.ts +372 -0
- package/dist/types/types/vega-chart.d.ts +292 -14
- package/dist/types/utils/e2e-utils.d.ts +2 -0
- package/dist/types/utils/sanitize/constants/tag-sets.d.ts +6 -0
- package/dist/types/utils/sanitize/core/html-sanitizer.d.ts +22 -0
- package/dist/types/utils/sanitize/core/sanitize-strategy.d.ts +27 -0
- package/dist/types/utils/sanitize/core/types.d.ts +13 -0
- package/dist/types/utils/sanitize/index.d.ts +12 -0
- package/dist/types/utils/sanitize/strategies/empty-sanitize-strategy.d.ts +14 -0
- package/dist/types/utils/sanitize/strategies/index.d.ts +3 -0
- package/dist/types/utils/sanitize/strategies/label-sanitize-strategy.d.ts +10 -0
- package/dist/types/utils/sanitize/strategies/style-sanitize-strategy.d.ts +24 -0
- package/dist/types/utils/sanitize/test/empty-strategy.test.d.ts +1 -0
- package/dist/types/utils/sanitize/test/html-sanitizer.test.d.ts +1 -0
- package/dist/types/utils/sanitize/test/label-strategy.test.d.ts +1 -0
- package/dist/types/utils/sanitize/test/sanitize-strategy.test.d.ts +1 -0
- package/dist/types/utils/sanitize/test/sanitize.test.d.ts +1 -0
- package/dist/types/utils/sanitize/test/serialize-fragment.test.d.ts +1 -0
- package/dist/types/utils/sanitize/test/style-strategy.test.d.ts +1 -0
- package/dist/types/utils/sanitize/utils/serialize-fragment.d.ts +12 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-0037068c.entry.js +1 -0
- package/dist/vega/p-010ff53d.entry.js +1 -0
- package/dist/vega/p-021d4ae4.js +1 -0
- package/dist/vega/{p-66fa700b.js → p-02c9796a.js} +1 -1
- package/dist/vega/p-03004a05.entry.js +1 -0
- package/dist/vega/p-0572c393.entry.js +1 -0
- package/dist/vega/p-0a3a285b.entry.js +1 -0
- package/dist/vega/{p-e5af5a4d.entry.js → p-0b4880bd.entry.js} +1 -1
- package/dist/vega/p-0d4cb1c7.entry.js +1 -0
- package/dist/vega/{p-920719ad.js → p-0e679d8c.js} +1 -1
- package/dist/vega/p-100b44c3.entry.js +1 -0
- package/dist/vega/p-168bb296.entry.js +1 -0
- package/dist/vega/{p-e77a83e4.js → p-18e8d9b7.js} +1 -1
- package/dist/vega/p-1a011d47.entry.js +1 -0
- package/dist/vega/p-1a3236e7.entry.js +1 -0
- package/dist/vega/{p-c9b6b5a9.js → p-1a51bf6f.js} +1 -1
- package/dist/vega/{p-ad2055f4.entry.js → p-1deedff2.entry.js} +1 -1
- package/dist/vega/p-1f3cd061.entry.js +1 -0
- package/dist/vega/p-1fa0c7da.entry.js +1 -0
- package/dist/vega/p-22056609.entry.js +1 -0
- package/dist/vega/p-242fbcad.entry.js +1 -0
- package/dist/vega/p-2a10e2e5.js +1 -0
- package/dist/vega/p-2b142818.entry.js +1 -0
- package/dist/vega/p-2bb5a232.js +1 -0
- package/dist/vega/{p-e9b86dac.entry.js → p-2c1a85dd.entry.js} +1 -1
- package/dist/vega/p-2d69632d.js +1 -0
- package/dist/vega/p-31ac7386.js +1 -0
- package/dist/vega/p-33f9ad94.entry.js +1 -0
- package/dist/vega/p-34bcf4ed.entry.js +1 -0
- package/dist/vega/{p-4897bedd.entry.js → p-358b4a06.entry.js} +1 -1
- package/dist/vega/p-36a09524.entry.js +1 -0
- package/dist/vega/p-3afc025e.entry.js +1 -0
- package/dist/vega/p-3c05abd9.entry.js +1 -0
- package/dist/vega/p-3ce2b05c.entry.js +1 -0
- package/dist/vega/{p-ea04a387.entry.js → p-3f3c771a.entry.js} +1 -1
- package/dist/vega/{p-1f83cebf.js → p-415ffa35.js} +1 -1
- package/dist/vega/p-43ff48c0.entry.js +1 -0
- package/dist/vega/{p-d849e0f5.js → p-4415ad28.js} +1 -1
- package/dist/vega/{p-0575d22e.js → p-464559e3.js} +1 -1
- package/dist/vega/p-4742feef.entry.js +1 -0
- package/dist/vega/p-49845a91.js +1 -0
- package/dist/vega/p-4aa52ed2.entry.js +1 -0
- package/dist/vega/p-4aa94940.entry.js +1 -0
- package/dist/vega/p-4bee4202.entry.js +1 -0
- package/dist/vega/{p-e16b3adf.js → p-4bffdb28.js} +1 -1
- package/dist/vega/{p-a2aeb646.js → p-4ea30592.js} +1 -1
- package/dist/vega/p-50d074ed.entry.js +1 -0
- package/dist/vega/{p-0b38a01f.entry.js → p-51fcb07f.entry.js} +1 -1
- package/dist/vega/p-5485c387.entry.js +1 -0
- package/dist/vega/p-560d2f48.entry.js +1 -0
- package/dist/vega/p-5833f33b.entry.js +1 -0
- package/dist/vega/p-592296d7.entry.js +1 -0
- package/dist/vega/p-593e0f80.js +1 -0
- package/dist/vega/p-5a25014f.js +1 -0
- package/dist/vega/p-5cfce62d.entry.js +1 -0
- package/dist/vega/p-5eb7f382.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-60f77f5f.entry.js +1 -0
- package/dist/vega/p-641cdb5c.entry.js +1 -0
- package/dist/vega/p-67745549.entry.js +1 -0
- package/dist/vega/{p-75f981ce.js → p-6b6f0fb4.js} +1 -1
- package/dist/vega/p-6d219c44.entry.js +1 -0
- package/dist/vega/p-70df91fb.entry.js +1 -0
- package/dist/vega/p-7425cedc.entry.js +1 -0
- package/dist/vega/p-781fd6e0.js +1 -0
- package/dist/vega/{p-5b71c85e.js → p-7c39ce96.js} +1 -1
- package/dist/vega/p-7d7aaff9.entry.js +1 -0
- package/dist/vega/{p-4dd6554e.entry.js → p-7f46cc1e.entry.js} +1 -1
- package/dist/vega/{p-badad9ed.js → p-81b044b9.js} +1 -1
- package/dist/vega/p-857069a5.entry.js +1 -0
- package/dist/vega/p-8ac2d165.js +1 -0
- package/dist/vega/p-8b5d3a52.js +1 -0
- package/dist/vega/{p-fff13ed1.entry.js → p-8b891f36.entry.js} +1 -1
- package/dist/vega/p-8e34b266.js +1 -0
- package/dist/vega/{p-dd11f735.js → p-9339c6c4.js} +1 -1
- package/dist/vega/p-9441f2ba.entry.js +1 -0
- package/dist/vega/p-95528b47.js +1 -0
- package/dist/vega/p-9fb877c1.entry.js +1 -0
- package/dist/vega/{p-6f8be8ea.js → p-a0b66c25.js} +1 -1
- package/dist/vega/p-a46e977b.entry.js +1 -0
- package/dist/vega/{p-d0e31633.js → p-a786259a.js} +1 -1
- package/dist/vega/p-a8792e3d.js +1 -0
- package/dist/vega/{p-60851f9d.js → p-aa1174dc.js} +1 -1
- package/dist/vega/p-ab834f06.js +1 -0
- package/dist/vega/p-ac82b9f9.entry.js +1 -0
- package/dist/vega/p-b1773281.entry.js +1 -0
- package/dist/vega/p-b201f379.js +1 -0
- package/dist/vega/p-b54dc37c.entry.js +1 -0
- package/dist/vega/p-b597393b.entry.js +1 -0
- package/dist/vega/p-b5f18f4b.entry.js +1 -0
- package/dist/vega/p-b7f3221f.js +1 -0
- package/dist/vega/p-be1a210b.js +1 -0
- package/dist/vega/p-bf6fc19f.entry.js +1 -0
- package/dist/vega/{p-691ba1ae.js → p-bff57aa4.js} +1 -1
- package/dist/vega/p-c165232c.entry.js +1 -0
- package/dist/vega/p-c292ade4.entry.js +1 -0
- package/dist/vega/p-c2d2faa0.js +1 -0
- package/dist/vega/p-c3d2f316.js +1 -0
- package/dist/vega/{p-671afda4.entry.js → p-c72e08c6.entry.js} +1 -1
- package/dist/vega/p-c801c85d.js +1 -0
- package/dist/vega/p-c8feb644.entry.js +1 -0
- package/dist/vega/p-cc5eaa1b.js +1 -0
- package/dist/vega/p-cccd7648.entry.js +1 -0
- package/dist/vega/p-cfecc1cb.entry.js +1 -0
- package/dist/vega/p-d07f5d5a.entry.js +1 -0
- package/dist/vega/p-d1cfe972.entry.js +1 -0
- package/dist/vega/p-d2ee5711.entry.js +1 -0
- package/dist/vega/p-d64fab3d.js +1 -0
- package/dist/vega/p-d78f6ede.js +1 -0
- package/dist/vega/p-d8180e42.entry.js +1 -0
- package/dist/vega/p-daa60a59.entry.js +1 -0
- package/dist/vega/p-dad3ba5f.js +1 -0
- package/dist/vega/p-db5fa164.entry.js +1 -0
- package/dist/vega/p-de64f6e6.js +1 -0
- package/dist/vega/p-e1fbfd20.js +1 -0
- package/dist/vega/p-e4917e76.js +1 -0
- package/dist/vega/{p-521d1d07.js → p-e52890db.js} +1 -1
- package/dist/vega/{p-1298b126.js → p-e632475e.js} +1 -1
- package/dist/vega/p-e6adf829.js +1 -0
- package/dist/vega/p-e6cf2ace.entry.js +1 -0
- package/dist/vega/p-e7fbef97.js +1 -0
- package/dist/vega/{p-77edf50c.js → p-e827d56d.js} +1 -1
- package/dist/vega/p-e8775a56.entry.js +1 -0
- package/dist/vega/p-f0e828d8.js +1 -0
- package/dist/vega/p-f2b0b58a.js +1 -0
- package/dist/vega/p-f3e6483c.js +1 -0
- package/dist/vega/p-f428086c.entry.js +1 -0
- package/dist/vega/p-fc9ac6e9.entry.js +1 -0
- package/dist/vega/p-ffd48e37.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +3 -9
- package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
- package/dist/cjs/language-extension-8c4a56ff.js +0 -210
- package/dist/cjs/legend-input-processor-27c65353.js +0 -4759
- package/dist/cjs/sanitize-fb222510.js +0 -131
- package/dist/cjs/wait-for-vega-handler-5469ff80.js +0 -63
- package/dist/cjs/y-axis-input-processor-9fbfd5e7.js +0 -2302
- package/dist/collection/utils/sanitize.js +0 -126
- package/dist/collection/utils/test/sanitize.test.js +0 -65
- package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
- package/dist/esm/dom-node-subject-observer-factory-064ee2b2.js +0 -250
- package/dist/esm/language-extension-29bf8acd.js +0 -207
- package/dist/esm/legend-input-processor-5ecae3a7.js +0 -4742
- package/dist/esm/sanitize-fd0cb40d.js +0 -129
- package/dist/esm/wait-for-vega-handler-c2c07ac3.js +0 -61
- package/dist/esm/y-axis-input-processor-bc54314a.js +0 -2290
- package/dist/types/utils/sanitize.d.ts +0 -71
- package/dist/vega/p-011b94b1.entry.js +0 -1
- package/dist/vega/p-012753b5.entry.js +0 -1
- package/dist/vega/p-024331ce.entry.js +0 -1
- package/dist/vega/p-08a90cc6.entry.js +0 -1
- package/dist/vega/p-0bb3be0b.entry.js +0 -1
- package/dist/vega/p-0ede1fea.entry.js +0 -1
- package/dist/vega/p-10ac8b57.js +0 -1
- package/dist/vega/p-112455b1.js +0 -1
- package/dist/vega/p-17c55205.entry.js +0 -1
- package/dist/vega/p-1e0d8228.entry.js +0 -1
- package/dist/vega/p-3353b3d7.js +0 -1
- package/dist/vega/p-365b1b35.entry.js +0 -1
- package/dist/vega/p-3ae9ee3d.entry.js +0 -1
- package/dist/vega/p-3af92370.entry.js +0 -1
- package/dist/vega/p-3bf66be2.js +0 -1
- package/dist/vega/p-3c5a28e4.entry.js +0 -1
- package/dist/vega/p-3e5f362f.js +0 -1
- package/dist/vega/p-430be941.js +0 -1
- package/dist/vega/p-43f585f7.entry.js +0 -1
- package/dist/vega/p-45296fd4.entry.js +0 -1
- package/dist/vega/p-46b077d9.js +0 -1
- package/dist/vega/p-476a173a.js +0 -1
- package/dist/vega/p-491618a6.entry.js +0 -1
- package/dist/vega/p-4a537391.entry.js +0 -1
- package/dist/vega/p-4aa893ef.entry.js +0 -1
- package/dist/vega/p-4c47e8bb.entry.js +0 -1
- package/dist/vega/p-4da75f2b.js +0 -1
- package/dist/vega/p-509eb52e.entry.js +0 -1
- package/dist/vega/p-5110ba73.entry.js +0 -1
- package/dist/vega/p-556f9a21.entry.js +0 -1
- package/dist/vega/p-55b54ba0.entry.js +0 -1
- package/dist/vega/p-5910be31.entry.js +0 -1
- package/dist/vega/p-5d676a94.js +0 -1
- package/dist/vega/p-5ea2e43c.entry.js +0 -1
- package/dist/vega/p-5efc6fe1.entry.js +0 -1
- package/dist/vega/p-64cd1931.entry.js +0 -1
- package/dist/vega/p-67fcf6f2.entry.js +0 -9
- package/dist/vega/p-68df4288.js +0 -1
- package/dist/vega/p-6a2205a1.entry.js +0 -1
- package/dist/vega/p-6a4277df.entry.js +0 -1
- package/dist/vega/p-6e136980.js +0 -1
- package/dist/vega/p-6fa8e231.entry.js +0 -1
- package/dist/vega/p-7045e84c.entry.js +0 -1
- package/dist/vega/p-7288f8c4.js +0 -1
- package/dist/vega/p-749f96a4.js +0 -1
- package/dist/vega/p-7aaece55.entry.js +0 -1
- package/dist/vega/p-7ec6a104.entry.js +0 -1
- package/dist/vega/p-81134e9e.entry.js +0 -1
- package/dist/vega/p-89d685a8.js +0 -1
- package/dist/vega/p-8c0eb12f.entry.js +0 -1
- package/dist/vega/p-8c9ea6f4.js +0 -1
- package/dist/vega/p-8d0ca805.js +0 -1
- package/dist/vega/p-8d701832.entry.js +0 -1
- package/dist/vega/p-8e42a14c.entry.js +0 -1
- package/dist/vega/p-8ed0faa2.entry.js +0 -1
- package/dist/vega/p-94394df7.entry.js +0 -1
- package/dist/vega/p-99aa554b.entry.js +0 -1
- package/dist/vega/p-9a2446f1.entry.js +0 -1
- package/dist/vega/p-9fd503e9.entry.js +0 -1
- package/dist/vega/p-a4670e23.js +0 -1
- package/dist/vega/p-a475d525.entry.js +0 -1
- package/dist/vega/p-a530797f.entry.js +0 -1
- package/dist/vega/p-a85ad369.entry.js +0 -1
- package/dist/vega/p-ac5e9955.entry.js +0 -1
- package/dist/vega/p-aedf7146.js +0 -1
- package/dist/vega/p-b1f869fb.js +0 -1
- package/dist/vega/p-b4ea3fad.js +0 -1
- package/dist/vega/p-bb4a558d.entry.js +0 -1
- package/dist/vega/p-bb8339ed.entry.js +0 -1
- package/dist/vega/p-be23bef2.js +0 -1
- package/dist/vega/p-be930e85.entry.js +0 -1
- package/dist/vega/p-bf2bd6d0.entry.js +0 -1
- package/dist/vega/p-c2488ed6.js +0 -1
- package/dist/vega/p-c379a5a5.entry.js +0 -1
- package/dist/vega/p-c616c592.js +0 -1
- package/dist/vega/p-ca3472c1.entry.js +0 -1
- package/dist/vega/p-cc43bffb.js +0 -1
- package/dist/vega/p-cf5b80f9.entry.js +0 -1
- package/dist/vega/p-db60a38e.entry.js +0 -1
- package/dist/vega/p-db8cdba6.js +0 -1
- package/dist/vega/p-e93545fd.js +0 -1
- package/dist/vega/p-e9c4fd24.entry.js +0 -1
- package/dist/vega/p-eb60cfe1.entry.js +0 -1
- package/dist/vega/p-ec192283.entry.js +0 -1
- package/dist/vega/p-ef9cbad1.js +0 -1
- package/dist/vega/p-f2a3a1ec.entry.js +0 -1
- package/dist/vega/p-f2cdd212.entry.js +0 -1
- package/dist/vega/p-f3c3ff26.entry.js +0 -1
- package/dist/vega/p-f4c05b4a.entry.js +0 -1
- package/dist/vega/p-f52a0155.entry.js +0 -1
- package/dist/vega/p-f69f84a7.js +0 -1
- package/dist/vega/p-f8641214.entry.js +0 -1
- package/dist/vega/p-f89443aa.entry.js +0 -1
- package/dist/vega/p-f8f7cf48.entry.js +0 -1
- package/dist/vega/p-fe12eff6.js +0 -1
- /package/dist/{types/utils/test/sanitize.test.d.ts → collection/polyfill/prism/types.js} +0 -0
- /package/dist/vega/{p-d9671d27.js → p-6c170474.js} +0 -0
|
@@ -1,2302 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const legendInputProcessor = require('./legend-input-processor-27c65353.js');
|
|
4
|
-
const array = require('./array-249289f2.js');
|
|
5
|
-
|
|
6
|
-
function ascending(a, b) {
|
|
7
|
-
return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function descending(a, b) {
|
|
11
|
-
return a == null || b == null ? NaN
|
|
12
|
-
: b < a ? -1
|
|
13
|
-
: b > a ? 1
|
|
14
|
-
: b >= a ? 0
|
|
15
|
-
: NaN;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function bisector(f) {
|
|
19
|
-
let compare1, compare2, delta;
|
|
20
|
-
|
|
21
|
-
// If an accessor is specified, promote it to a comparator. In this case we
|
|
22
|
-
// can test whether the search value is (self-) comparable. We can’t do this
|
|
23
|
-
// for a comparator (except for specific, known comparators) because we can’t
|
|
24
|
-
// tell if the comparator is symmetric, and an asymmetric comparator can’t be
|
|
25
|
-
// used to test whether a single value is comparable.
|
|
26
|
-
if (f.length !== 2) {
|
|
27
|
-
compare1 = ascending;
|
|
28
|
-
compare2 = (d, x) => ascending(f(d), x);
|
|
29
|
-
delta = (d, x) => f(d) - x;
|
|
30
|
-
} else {
|
|
31
|
-
compare1 = f === ascending || f === descending ? f : zero;
|
|
32
|
-
compare2 = f;
|
|
33
|
-
delta = f;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function left(a, x, lo = 0, hi = a.length) {
|
|
37
|
-
if (lo < hi) {
|
|
38
|
-
if (compare1(x, x) !== 0) return hi;
|
|
39
|
-
do {
|
|
40
|
-
const mid = (lo + hi) >>> 1;
|
|
41
|
-
if (compare2(a[mid], x) < 0) lo = mid + 1;
|
|
42
|
-
else hi = mid;
|
|
43
|
-
} while (lo < hi);
|
|
44
|
-
}
|
|
45
|
-
return lo;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function right(a, x, lo = 0, hi = a.length) {
|
|
49
|
-
if (lo < hi) {
|
|
50
|
-
if (compare1(x, x) !== 0) return hi;
|
|
51
|
-
do {
|
|
52
|
-
const mid = (lo + hi) >>> 1;
|
|
53
|
-
if (compare2(a[mid], x) <= 0) lo = mid + 1;
|
|
54
|
-
else hi = mid;
|
|
55
|
-
} while (lo < hi);
|
|
56
|
-
}
|
|
57
|
-
return lo;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function center(a, x, lo = 0, hi = a.length) {
|
|
61
|
-
const i = left(a, x, lo, hi - 1);
|
|
62
|
-
return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return {left, center, right};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function zero() {
|
|
69
|
-
return 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function number$2(x) {
|
|
73
|
-
return x === null ? NaN : +x;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const ascendingBisect = bisector(ascending);
|
|
77
|
-
const bisectRight = ascendingBisect.right;
|
|
78
|
-
bisector(number$2).center;
|
|
79
|
-
|
|
80
|
-
function extent(values, valueof) {
|
|
81
|
-
let min;
|
|
82
|
-
let max;
|
|
83
|
-
if (valueof === undefined) {
|
|
84
|
-
for (const value of values) {
|
|
85
|
-
if (value != null) {
|
|
86
|
-
if (min === undefined) {
|
|
87
|
-
if (value >= value) min = max = value;
|
|
88
|
-
} else {
|
|
89
|
-
if (min > value) min = value;
|
|
90
|
-
if (max < value) max = value;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
} else {
|
|
95
|
-
let index = -1;
|
|
96
|
-
for (let value of values) {
|
|
97
|
-
if ((value = valueof(value, ++index, values)) != null) {
|
|
98
|
-
if (min === undefined) {
|
|
99
|
-
if (value >= value) min = max = value;
|
|
100
|
-
} else {
|
|
101
|
-
if (min > value) min = value;
|
|
102
|
-
if (max < value) max = value;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return [min, max];
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
class InternMap extends Map {
|
|
111
|
-
constructor(entries, key = keyof) {
|
|
112
|
-
super();
|
|
113
|
-
Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});
|
|
114
|
-
if (entries != null) for (const [key, value] of entries) this.set(key, value);
|
|
115
|
-
}
|
|
116
|
-
get(key) {
|
|
117
|
-
return super.get(intern_get(this, key));
|
|
118
|
-
}
|
|
119
|
-
has(key) {
|
|
120
|
-
return super.has(intern_get(this, key));
|
|
121
|
-
}
|
|
122
|
-
set(key, value) {
|
|
123
|
-
return super.set(intern_set(this, key), value);
|
|
124
|
-
}
|
|
125
|
-
delete(key) {
|
|
126
|
-
return super.delete(intern_delete(this, key));
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function intern_get({_intern, _key}, value) {
|
|
131
|
-
const key = _key(value);
|
|
132
|
-
return _intern.has(key) ? _intern.get(key) : value;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function intern_set({_intern, _key}, value) {
|
|
136
|
-
const key = _key(value);
|
|
137
|
-
if (_intern.has(key)) return _intern.get(key);
|
|
138
|
-
_intern.set(key, value);
|
|
139
|
-
return value;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function intern_delete({_intern, _key}, value) {
|
|
143
|
-
const key = _key(value);
|
|
144
|
-
if (_intern.has(key)) {
|
|
145
|
-
value = _intern.get(key);
|
|
146
|
-
_intern.delete(key);
|
|
147
|
-
}
|
|
148
|
-
return value;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function keyof(value) {
|
|
152
|
-
return value !== null && typeof value === "object" ? value.valueOf() : value;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const e10 = Math.sqrt(50),
|
|
156
|
-
e5 = Math.sqrt(10),
|
|
157
|
-
e2 = Math.sqrt(2);
|
|
158
|
-
|
|
159
|
-
function tickSpec(start, stop, count) {
|
|
160
|
-
const step = (stop - start) / Math.max(0, count),
|
|
161
|
-
power = Math.floor(Math.log10(step)),
|
|
162
|
-
error = step / Math.pow(10, power),
|
|
163
|
-
factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
|
|
164
|
-
let i1, i2, inc;
|
|
165
|
-
if (power < 0) {
|
|
166
|
-
inc = Math.pow(10, -power) / factor;
|
|
167
|
-
i1 = Math.round(start * inc);
|
|
168
|
-
i2 = Math.round(stop * inc);
|
|
169
|
-
if (i1 / inc < start) ++i1;
|
|
170
|
-
if (i2 / inc > stop) --i2;
|
|
171
|
-
inc = -inc;
|
|
172
|
-
} else {
|
|
173
|
-
inc = Math.pow(10, power) * factor;
|
|
174
|
-
i1 = Math.round(start / inc);
|
|
175
|
-
i2 = Math.round(stop / inc);
|
|
176
|
-
if (i1 * inc < start) ++i1;
|
|
177
|
-
if (i2 * inc > stop) --i2;
|
|
178
|
-
}
|
|
179
|
-
if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);
|
|
180
|
-
return [i1, i2, inc];
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function ticks(start, stop, count) {
|
|
184
|
-
stop = +stop, start = +start, count = +count;
|
|
185
|
-
if (!(count > 0)) return [];
|
|
186
|
-
if (start === stop) return [start];
|
|
187
|
-
const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);
|
|
188
|
-
if (!(i2 >= i1)) return [];
|
|
189
|
-
const n = i2 - i1 + 1, ticks = new Array(n);
|
|
190
|
-
if (reverse) {
|
|
191
|
-
if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;
|
|
192
|
-
else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;
|
|
193
|
-
} else {
|
|
194
|
-
if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;
|
|
195
|
-
else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;
|
|
196
|
-
}
|
|
197
|
-
return ticks;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
function tickIncrement(start, stop, count) {
|
|
201
|
-
stop = +stop, start = +start, count = +count;
|
|
202
|
-
return tickSpec(start, stop, count)[2];
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function tickStep(start, stop, count) {
|
|
206
|
-
stop = +stop, start = +start, count = +count;
|
|
207
|
-
const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);
|
|
208
|
-
return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
function max(values, valueof) {
|
|
212
|
-
let max;
|
|
213
|
-
if (valueof === undefined) {
|
|
214
|
-
for (const value of values) {
|
|
215
|
-
if (value != null
|
|
216
|
-
&& (max < value || (max === undefined && value >= value))) {
|
|
217
|
-
max = value;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
} else {
|
|
221
|
-
let index = -1;
|
|
222
|
-
for (let value of values) {
|
|
223
|
-
if ((value = valueof(value, ++index, values)) != null
|
|
224
|
-
&& (max < value || (max === undefined && value >= value))) {
|
|
225
|
-
max = value;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
return max;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
function min(values, valueof) {
|
|
233
|
-
let min;
|
|
234
|
-
if (valueof === undefined) {
|
|
235
|
-
for (const value of values) {
|
|
236
|
-
if (value != null
|
|
237
|
-
&& (min > value || (min === undefined && value >= value))) {
|
|
238
|
-
min = value;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
} else {
|
|
242
|
-
let index = -1;
|
|
243
|
-
for (let value of values) {
|
|
244
|
-
if ((value = valueof(value, ++index, values)) != null
|
|
245
|
-
&& (min > value || (min === undefined && value >= value))) {
|
|
246
|
-
min = value;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
return min;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
function range(start, stop, step) {
|
|
254
|
-
start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
|
|
255
|
-
|
|
256
|
-
var i = -1,
|
|
257
|
-
n = Math.max(0, Math.ceil((stop - start) / step)) | 0,
|
|
258
|
-
range = new Array(n);
|
|
259
|
-
|
|
260
|
-
while (++i < n) {
|
|
261
|
-
range[i] = start + i * step;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
return range;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
function numberArray(a, b) {
|
|
268
|
-
if (!b) b = [];
|
|
269
|
-
var n = a ? Math.min(b.length, a.length) : 0,
|
|
270
|
-
c = b.slice(),
|
|
271
|
-
i;
|
|
272
|
-
return function(t) {
|
|
273
|
-
for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
|
|
274
|
-
return c;
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
function isNumberArray(x) {
|
|
279
|
-
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
function genericArray(a, b) {
|
|
283
|
-
var nb = b ? b.length : 0,
|
|
284
|
-
na = a ? Math.min(nb, a.length) : 0,
|
|
285
|
-
x = new Array(na),
|
|
286
|
-
c = new Array(nb),
|
|
287
|
-
i;
|
|
288
|
-
|
|
289
|
-
for (i = 0; i < na; ++i) x[i] = interpolate(a[i], b[i]);
|
|
290
|
-
for (; i < nb; ++i) c[i] = b[i];
|
|
291
|
-
|
|
292
|
-
return function(t) {
|
|
293
|
-
for (i = 0; i < na; ++i) c[i] = x[i](t);
|
|
294
|
-
return c;
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
function date$1(a, b) {
|
|
299
|
-
var d = new Date;
|
|
300
|
-
return a = +a, b = +b, function(t) {
|
|
301
|
-
return d.setTime(a * (1 - t) + b * t), d;
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
function object(a, b) {
|
|
306
|
-
var i = {},
|
|
307
|
-
c = {},
|
|
308
|
-
k;
|
|
309
|
-
|
|
310
|
-
if (a === null || typeof a !== "object") a = {};
|
|
311
|
-
if (b === null || typeof b !== "object") b = {};
|
|
312
|
-
|
|
313
|
-
for (k in b) {
|
|
314
|
-
if (k in a) {
|
|
315
|
-
i[k] = interpolate(a[k], b[k]);
|
|
316
|
-
} else {
|
|
317
|
-
c[k] = b[k];
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
return function(t) {
|
|
322
|
-
for (k in i) c[k] = i[k](t);
|
|
323
|
-
return c;
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
function interpolate(a, b) {
|
|
328
|
-
var t = typeof b, c;
|
|
329
|
-
return b == null || t === "boolean" ? legendInputProcessor.constant(b)
|
|
330
|
-
: (t === "number" ? legendInputProcessor.interpolateNumber
|
|
331
|
-
: t === "string" ? ((c = legendInputProcessor.color(b)) ? (b = c, legendInputProcessor.interpolateRgb) : legendInputProcessor.interpolateString)
|
|
332
|
-
: b instanceof legendInputProcessor.color ? legendInputProcessor.interpolateRgb
|
|
333
|
-
: b instanceof Date ? date$1
|
|
334
|
-
: isNumberArray(b) ? numberArray
|
|
335
|
-
: Array.isArray(b) ? genericArray
|
|
336
|
-
: typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
|
|
337
|
-
: legendInputProcessor.interpolateNumber)(a, b);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
function interpolateRound(a, b) {
|
|
341
|
-
return a = +a, b = +b, function(t) {
|
|
342
|
-
return Math.round(a * (1 - t) + b * t);
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
function formatDecimal(x) {
|
|
347
|
-
return Math.abs(x = Math.round(x)) >= 1e21
|
|
348
|
-
? x.toLocaleString("en").replace(/,/g, "")
|
|
349
|
-
: x.toString(10);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// Computes the decimal coefficient and exponent of the specified number x with
|
|
353
|
-
// significant digits p, where x is positive and p is in [1, 21] or undefined.
|
|
354
|
-
// For example, formatDecimalParts(1.23) returns ["123", 0].
|
|
355
|
-
function formatDecimalParts(x, p) {
|
|
356
|
-
if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
|
|
357
|
-
var i, coefficient = x.slice(0, i);
|
|
358
|
-
|
|
359
|
-
// The string returned by toExponential either has the form \d\.\d+e[-+]\d+
|
|
360
|
-
// (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
|
|
361
|
-
return [
|
|
362
|
-
coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
|
|
363
|
-
+x.slice(i + 1)
|
|
364
|
-
];
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
function exponent(x) {
|
|
368
|
-
return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
function formatGroup(grouping, thousands) {
|
|
372
|
-
return function(value, width) {
|
|
373
|
-
var i = value.length,
|
|
374
|
-
t = [],
|
|
375
|
-
j = 0,
|
|
376
|
-
g = grouping[0],
|
|
377
|
-
length = 0;
|
|
378
|
-
|
|
379
|
-
while (i > 0 && g > 0) {
|
|
380
|
-
if (length + g + 1 > width) g = Math.max(1, width - length);
|
|
381
|
-
t.push(value.substring(i -= g, i + g));
|
|
382
|
-
if ((length += g + 1) > width) break;
|
|
383
|
-
g = grouping[j = (j + 1) % grouping.length];
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
return t.reverse().join(thousands);
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
function formatNumerals(numerals) {
|
|
391
|
-
return function(value) {
|
|
392
|
-
return value.replace(/[0-9]/g, function(i) {
|
|
393
|
-
return numerals[+i];
|
|
394
|
-
});
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
// [[fill]align][sign][symbol][0][width][,][.precision][~][type]
|
|
399
|
-
var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
|
|
400
|
-
|
|
401
|
-
function formatSpecifier(specifier) {
|
|
402
|
-
if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
|
|
403
|
-
var match;
|
|
404
|
-
return new FormatSpecifier({
|
|
405
|
-
fill: match[1],
|
|
406
|
-
align: match[2],
|
|
407
|
-
sign: match[3],
|
|
408
|
-
symbol: match[4],
|
|
409
|
-
zero: match[5],
|
|
410
|
-
width: match[6],
|
|
411
|
-
comma: match[7],
|
|
412
|
-
precision: match[8] && match[8].slice(1),
|
|
413
|
-
trim: match[9],
|
|
414
|
-
type: match[10]
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
|
|
419
|
-
|
|
420
|
-
function FormatSpecifier(specifier) {
|
|
421
|
-
this.fill = specifier.fill === undefined ? " " : specifier.fill + "";
|
|
422
|
-
this.align = specifier.align === undefined ? ">" : specifier.align + "";
|
|
423
|
-
this.sign = specifier.sign === undefined ? "-" : specifier.sign + "";
|
|
424
|
-
this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "";
|
|
425
|
-
this.zero = !!specifier.zero;
|
|
426
|
-
this.width = specifier.width === undefined ? undefined : +specifier.width;
|
|
427
|
-
this.comma = !!specifier.comma;
|
|
428
|
-
this.precision = specifier.precision === undefined ? undefined : +specifier.precision;
|
|
429
|
-
this.trim = !!specifier.trim;
|
|
430
|
-
this.type = specifier.type === undefined ? "" : specifier.type + "";
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
FormatSpecifier.prototype.toString = function() {
|
|
434
|
-
return this.fill
|
|
435
|
-
+ this.align
|
|
436
|
-
+ this.sign
|
|
437
|
-
+ this.symbol
|
|
438
|
-
+ (this.zero ? "0" : "")
|
|
439
|
-
+ (this.width === undefined ? "" : Math.max(1, this.width | 0))
|
|
440
|
-
+ (this.comma ? "," : "")
|
|
441
|
-
+ (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0))
|
|
442
|
-
+ (this.trim ? "~" : "")
|
|
443
|
-
+ this.type;
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
|
|
447
|
-
function formatTrim(s) {
|
|
448
|
-
out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
|
|
449
|
-
switch (s[i]) {
|
|
450
|
-
case ".": i0 = i1 = i; break;
|
|
451
|
-
case "0": if (i0 === 0) i0 = i; i1 = i; break;
|
|
452
|
-
default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
var prefixExponent;
|
|
459
|
-
|
|
460
|
-
function formatPrefixAuto(x, p) {
|
|
461
|
-
var d = formatDecimalParts(x, p);
|
|
462
|
-
if (!d) return x + "";
|
|
463
|
-
var coefficient = d[0],
|
|
464
|
-
exponent = d[1],
|
|
465
|
-
i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
|
|
466
|
-
n = coefficient.length;
|
|
467
|
-
return i === n ? coefficient
|
|
468
|
-
: i > n ? coefficient + new Array(i - n + 1).join("0")
|
|
469
|
-
: i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i)
|
|
470
|
-
: "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
function formatRounded(x, p) {
|
|
474
|
-
var d = formatDecimalParts(x, p);
|
|
475
|
-
if (!d) return x + "";
|
|
476
|
-
var coefficient = d[0],
|
|
477
|
-
exponent = d[1];
|
|
478
|
-
return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient
|
|
479
|
-
: coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1)
|
|
480
|
-
: coefficient + new Array(exponent - coefficient.length + 2).join("0");
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
const formatTypes = {
|
|
484
|
-
"%": (x, p) => (x * 100).toFixed(p),
|
|
485
|
-
"b": (x) => Math.round(x).toString(2),
|
|
486
|
-
"c": (x) => x + "",
|
|
487
|
-
"d": formatDecimal,
|
|
488
|
-
"e": (x, p) => x.toExponential(p),
|
|
489
|
-
"f": (x, p) => x.toFixed(p),
|
|
490
|
-
"g": (x, p) => x.toPrecision(p),
|
|
491
|
-
"o": (x) => Math.round(x).toString(8),
|
|
492
|
-
"p": (x, p) => formatRounded(x * 100, p),
|
|
493
|
-
"r": formatRounded,
|
|
494
|
-
"s": formatPrefixAuto,
|
|
495
|
-
"X": (x) => Math.round(x).toString(16).toUpperCase(),
|
|
496
|
-
"x": (x) => Math.round(x).toString(16)
|
|
497
|
-
};
|
|
498
|
-
|
|
499
|
-
function identity$1(x) {
|
|
500
|
-
return x;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
var map = Array.prototype.map,
|
|
504
|
-
prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];
|
|
505
|
-
|
|
506
|
-
function formatLocale$1(locale) {
|
|
507
|
-
var group = locale.grouping === undefined || locale.thousands === undefined ? identity$1 : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""),
|
|
508
|
-
currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
|
|
509
|
-
currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
|
|
510
|
-
decimal = locale.decimal === undefined ? "." : locale.decimal + "",
|
|
511
|
-
numerals = locale.numerals === undefined ? identity$1 : formatNumerals(map.call(locale.numerals, String)),
|
|
512
|
-
percent = locale.percent === undefined ? "%" : locale.percent + "",
|
|
513
|
-
minus = locale.minus === undefined ? "−" : locale.minus + "",
|
|
514
|
-
nan = locale.nan === undefined ? "NaN" : locale.nan + "";
|
|
515
|
-
|
|
516
|
-
function newFormat(specifier) {
|
|
517
|
-
specifier = formatSpecifier(specifier);
|
|
518
|
-
|
|
519
|
-
var fill = specifier.fill,
|
|
520
|
-
align = specifier.align,
|
|
521
|
-
sign = specifier.sign,
|
|
522
|
-
symbol = specifier.symbol,
|
|
523
|
-
zero = specifier.zero,
|
|
524
|
-
width = specifier.width,
|
|
525
|
-
comma = specifier.comma,
|
|
526
|
-
precision = specifier.precision,
|
|
527
|
-
trim = specifier.trim,
|
|
528
|
-
type = specifier.type;
|
|
529
|
-
|
|
530
|
-
// The "n" type is an alias for ",g".
|
|
531
|
-
if (type === "n") comma = true, type = "g";
|
|
532
|
-
|
|
533
|
-
// The "" type, and any invalid type, is an alias for ".12~g".
|
|
534
|
-
else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g";
|
|
535
|
-
|
|
536
|
-
// If zero fill is specified, padding goes after sign and before digits.
|
|
537
|
-
if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "=";
|
|
538
|
-
|
|
539
|
-
// Compute the prefix and suffix.
|
|
540
|
-
// For SI-prefix, the suffix is lazily computed.
|
|
541
|
-
var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
|
|
542
|
-
suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
|
|
543
|
-
|
|
544
|
-
// What format function should we use?
|
|
545
|
-
// Is this an integer type?
|
|
546
|
-
// Can this type generate exponential notation?
|
|
547
|
-
var formatType = formatTypes[type],
|
|
548
|
-
maybeSuffix = /[defgprs%]/.test(type);
|
|
549
|
-
|
|
550
|
-
// Set the default precision if not specified,
|
|
551
|
-
// or clamp the specified precision to the supported range.
|
|
552
|
-
// For significant precision, it must be in [1, 21].
|
|
553
|
-
// For fixed precision, it must be in [0, 20].
|
|
554
|
-
precision = precision === undefined ? 6
|
|
555
|
-
: /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))
|
|
556
|
-
: Math.max(0, Math.min(20, precision));
|
|
557
|
-
|
|
558
|
-
function format(value) {
|
|
559
|
-
var valuePrefix = prefix,
|
|
560
|
-
valueSuffix = suffix,
|
|
561
|
-
i, n, c;
|
|
562
|
-
|
|
563
|
-
if (type === "c") {
|
|
564
|
-
valueSuffix = formatType(value) + valueSuffix;
|
|
565
|
-
value = "";
|
|
566
|
-
} else {
|
|
567
|
-
value = +value;
|
|
568
|
-
|
|
569
|
-
// Determine the sign. -0 is not less than 0, but 1 / -0 is!
|
|
570
|
-
var valueNegative = value < 0 || 1 / value < 0;
|
|
571
|
-
|
|
572
|
-
// Perform the initial formatting.
|
|
573
|
-
value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
|
|
574
|
-
|
|
575
|
-
// Trim insignificant zeros.
|
|
576
|
-
if (trim) value = formatTrim(value);
|
|
577
|
-
|
|
578
|
-
// If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.
|
|
579
|
-
if (valueNegative && +value === 0 && sign !== "+") valueNegative = false;
|
|
580
|
-
|
|
581
|
-
// Compute the prefix and suffix.
|
|
582
|
-
valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
|
|
583
|
-
valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
|
|
584
|
-
|
|
585
|
-
// Break the formatted value into the integer “value” part that can be
|
|
586
|
-
// grouped, and fractional or exponential “suffix” part that is not.
|
|
587
|
-
if (maybeSuffix) {
|
|
588
|
-
i = -1, n = value.length;
|
|
589
|
-
while (++i < n) {
|
|
590
|
-
if (c = value.charCodeAt(i), 48 > c || c > 57) {
|
|
591
|
-
valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
|
|
592
|
-
value = value.slice(0, i);
|
|
593
|
-
break;
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
// If the fill character is not "0", grouping is applied before padding.
|
|
600
|
-
if (comma && !zero) value = group(value, Infinity);
|
|
601
|
-
|
|
602
|
-
// Compute the padding.
|
|
603
|
-
var length = valuePrefix.length + value.length + valueSuffix.length,
|
|
604
|
-
padding = length < width ? new Array(width - length + 1).join(fill) : "";
|
|
605
|
-
|
|
606
|
-
// If the fill character is "0", grouping is applied after padding.
|
|
607
|
-
if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
|
|
608
|
-
|
|
609
|
-
// Reconstruct the final output based on the desired alignment.
|
|
610
|
-
switch (align) {
|
|
611
|
-
case "<": value = valuePrefix + value + valueSuffix + padding; break;
|
|
612
|
-
case "=": value = valuePrefix + padding + value + valueSuffix; break;
|
|
613
|
-
case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;
|
|
614
|
-
default: value = padding + valuePrefix + value + valueSuffix; break;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
return numerals(value);
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
format.toString = function() {
|
|
621
|
-
return specifier + "";
|
|
622
|
-
};
|
|
623
|
-
|
|
624
|
-
return format;
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
function formatPrefix(specifier, value) {
|
|
628
|
-
var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
|
|
629
|
-
e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
|
|
630
|
-
k = Math.pow(10, -e),
|
|
631
|
-
prefix = prefixes[8 + e / 3];
|
|
632
|
-
return function(value) {
|
|
633
|
-
return f(k * value) + prefix;
|
|
634
|
-
};
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
return {
|
|
638
|
-
format: newFormat,
|
|
639
|
-
formatPrefix: formatPrefix
|
|
640
|
-
};
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
var locale$1;
|
|
644
|
-
var format;
|
|
645
|
-
var formatPrefix;
|
|
646
|
-
|
|
647
|
-
defaultLocale$1({
|
|
648
|
-
thousands: ",",
|
|
649
|
-
grouping: [3],
|
|
650
|
-
currency: ["$", ""]
|
|
651
|
-
});
|
|
652
|
-
|
|
653
|
-
function defaultLocale$1(definition) {
|
|
654
|
-
locale$1 = formatLocale$1(definition);
|
|
655
|
-
format = locale$1.format;
|
|
656
|
-
formatPrefix = locale$1.formatPrefix;
|
|
657
|
-
return locale$1;
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
function precisionFixed(step) {
|
|
661
|
-
return Math.max(0, -exponent(Math.abs(step)));
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
function precisionPrefix(step, value) {
|
|
665
|
-
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
function precisionRound(step, max) {
|
|
669
|
-
step = Math.abs(step), max = Math.abs(max) - step;
|
|
670
|
-
return Math.max(0, exponent(max) - exponent(step)) + 1;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
function initRange(domain, range) {
|
|
674
|
-
switch (arguments.length) {
|
|
675
|
-
case 0: break;
|
|
676
|
-
case 1: this.range(domain); break;
|
|
677
|
-
default: this.range(range).domain(domain); break;
|
|
678
|
-
}
|
|
679
|
-
return this;
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
const implicit = Symbol("implicit");
|
|
683
|
-
|
|
684
|
-
function ordinal() {
|
|
685
|
-
var index = new InternMap(),
|
|
686
|
-
domain = [],
|
|
687
|
-
range = [],
|
|
688
|
-
unknown = implicit;
|
|
689
|
-
|
|
690
|
-
function scale(d) {
|
|
691
|
-
let i = index.get(d);
|
|
692
|
-
if (i === undefined) {
|
|
693
|
-
if (unknown !== implicit) return unknown;
|
|
694
|
-
index.set(d, i = domain.push(d) - 1);
|
|
695
|
-
}
|
|
696
|
-
return range[i % range.length];
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
scale.domain = function(_) {
|
|
700
|
-
if (!arguments.length) return domain.slice();
|
|
701
|
-
domain = [], index = new InternMap();
|
|
702
|
-
for (const value of _) {
|
|
703
|
-
if (index.has(value)) continue;
|
|
704
|
-
index.set(value, domain.push(value) - 1);
|
|
705
|
-
}
|
|
706
|
-
return scale;
|
|
707
|
-
};
|
|
708
|
-
|
|
709
|
-
scale.range = function(_) {
|
|
710
|
-
return arguments.length ? (range = Array.from(_), scale) : range.slice();
|
|
711
|
-
};
|
|
712
|
-
|
|
713
|
-
scale.unknown = function(_) {
|
|
714
|
-
return arguments.length ? (unknown = _, scale) : unknown;
|
|
715
|
-
};
|
|
716
|
-
|
|
717
|
-
scale.copy = function() {
|
|
718
|
-
return ordinal(domain, range).unknown(unknown);
|
|
719
|
-
};
|
|
720
|
-
|
|
721
|
-
initRange.apply(scale, arguments);
|
|
722
|
-
|
|
723
|
-
return scale;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
function band() {
|
|
727
|
-
var scale = ordinal().unknown(undefined),
|
|
728
|
-
domain = scale.domain,
|
|
729
|
-
ordinalRange = scale.range,
|
|
730
|
-
r0 = 0,
|
|
731
|
-
r1 = 1,
|
|
732
|
-
step,
|
|
733
|
-
bandwidth,
|
|
734
|
-
round = false,
|
|
735
|
-
paddingInner = 0,
|
|
736
|
-
paddingOuter = 0,
|
|
737
|
-
align = 0.5;
|
|
738
|
-
|
|
739
|
-
delete scale.unknown;
|
|
740
|
-
|
|
741
|
-
function rescale() {
|
|
742
|
-
var n = domain().length,
|
|
743
|
-
reverse = r1 < r0,
|
|
744
|
-
start = reverse ? r1 : r0,
|
|
745
|
-
stop = reverse ? r0 : r1;
|
|
746
|
-
step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
|
|
747
|
-
if (round) step = Math.floor(step);
|
|
748
|
-
start += (stop - start - step * (n - paddingInner)) * align;
|
|
749
|
-
bandwidth = step * (1 - paddingInner);
|
|
750
|
-
if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);
|
|
751
|
-
var values = range(n).map(function(i) { return start + step * i; });
|
|
752
|
-
return ordinalRange(reverse ? values.reverse() : values);
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
scale.domain = function(_) {
|
|
756
|
-
return arguments.length ? (domain(_), rescale()) : domain();
|
|
757
|
-
};
|
|
758
|
-
|
|
759
|
-
scale.range = function(_) {
|
|
760
|
-
return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
|
|
761
|
-
};
|
|
762
|
-
|
|
763
|
-
scale.rangeRound = function(_) {
|
|
764
|
-
return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();
|
|
765
|
-
};
|
|
766
|
-
|
|
767
|
-
scale.bandwidth = function() {
|
|
768
|
-
return bandwidth;
|
|
769
|
-
};
|
|
770
|
-
|
|
771
|
-
scale.step = function() {
|
|
772
|
-
return step;
|
|
773
|
-
};
|
|
774
|
-
|
|
775
|
-
scale.round = function(_) {
|
|
776
|
-
return arguments.length ? (round = !!_, rescale()) : round;
|
|
777
|
-
};
|
|
778
|
-
|
|
779
|
-
scale.padding = function(_) {
|
|
780
|
-
return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
|
|
781
|
-
};
|
|
782
|
-
|
|
783
|
-
scale.paddingInner = function(_) {
|
|
784
|
-
return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
|
|
785
|
-
};
|
|
786
|
-
|
|
787
|
-
scale.paddingOuter = function(_) {
|
|
788
|
-
return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
|
|
789
|
-
};
|
|
790
|
-
|
|
791
|
-
scale.align = function(_) {
|
|
792
|
-
return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
|
|
793
|
-
};
|
|
794
|
-
|
|
795
|
-
scale.copy = function() {
|
|
796
|
-
return band(domain(), [r0, r1])
|
|
797
|
-
.round(round)
|
|
798
|
-
.paddingInner(paddingInner)
|
|
799
|
-
.paddingOuter(paddingOuter)
|
|
800
|
-
.align(align);
|
|
801
|
-
};
|
|
802
|
-
|
|
803
|
-
return initRange.apply(rescale(), arguments);
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
function constants(x) {
|
|
807
|
-
return function() {
|
|
808
|
-
return x;
|
|
809
|
-
};
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
function number$1(x) {
|
|
813
|
-
return +x;
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
var unit = [0, 1];
|
|
817
|
-
|
|
818
|
-
function identity(x) {
|
|
819
|
-
return x;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
function normalize(a, b) {
|
|
823
|
-
return (b -= (a = +a))
|
|
824
|
-
? function(x) { return (x - a) / b; }
|
|
825
|
-
: constants(isNaN(b) ? NaN : 0.5);
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
function clamper(a, b) {
|
|
829
|
-
var t;
|
|
830
|
-
if (a > b) t = a, a = b, b = t;
|
|
831
|
-
return function(x) { return Math.max(a, Math.min(b, x)); };
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
|
|
835
|
-
// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
|
|
836
|
-
function bimap(domain, range, interpolate) {
|
|
837
|
-
var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
|
|
838
|
-
if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
|
|
839
|
-
else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
|
|
840
|
-
return function(x) { return r0(d0(x)); };
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
function polymap(domain, range, interpolate) {
|
|
844
|
-
var j = Math.min(domain.length, range.length) - 1,
|
|
845
|
-
d = new Array(j),
|
|
846
|
-
r = new Array(j),
|
|
847
|
-
i = -1;
|
|
848
|
-
|
|
849
|
-
// Reverse descending domains.
|
|
850
|
-
if (domain[j] < domain[0]) {
|
|
851
|
-
domain = domain.slice().reverse();
|
|
852
|
-
range = range.slice().reverse();
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
while (++i < j) {
|
|
856
|
-
d[i] = normalize(domain[i], domain[i + 1]);
|
|
857
|
-
r[i] = interpolate(range[i], range[i + 1]);
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
return function(x) {
|
|
861
|
-
var i = bisectRight(domain, x, 1, j) - 1;
|
|
862
|
-
return r[i](d[i](x));
|
|
863
|
-
};
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
function copy(source, target) {
|
|
867
|
-
return target
|
|
868
|
-
.domain(source.domain())
|
|
869
|
-
.range(source.range())
|
|
870
|
-
.interpolate(source.interpolate())
|
|
871
|
-
.clamp(source.clamp())
|
|
872
|
-
.unknown(source.unknown());
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
function transformer() {
|
|
876
|
-
var domain = unit,
|
|
877
|
-
range = unit,
|
|
878
|
-
interpolate$1 = interpolate,
|
|
879
|
-
transform,
|
|
880
|
-
untransform,
|
|
881
|
-
unknown,
|
|
882
|
-
clamp = identity,
|
|
883
|
-
piecewise,
|
|
884
|
-
output,
|
|
885
|
-
input;
|
|
886
|
-
|
|
887
|
-
function rescale() {
|
|
888
|
-
var n = Math.min(domain.length, range.length);
|
|
889
|
-
if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);
|
|
890
|
-
piecewise = n > 2 ? polymap : bimap;
|
|
891
|
-
output = input = null;
|
|
892
|
-
return scale;
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
function scale(x) {
|
|
896
|
-
return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x)));
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
scale.invert = function(y) {
|
|
900
|
-
return clamp(untransform((input || (input = piecewise(range, domain.map(transform), legendInputProcessor.interpolateNumber)))(y)));
|
|
901
|
-
};
|
|
902
|
-
|
|
903
|
-
scale.domain = function(_) {
|
|
904
|
-
return arguments.length ? (domain = Array.from(_, number$1), rescale()) : domain.slice();
|
|
905
|
-
};
|
|
906
|
-
|
|
907
|
-
scale.range = function(_) {
|
|
908
|
-
return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
|
|
909
|
-
};
|
|
910
|
-
|
|
911
|
-
scale.rangeRound = function(_) {
|
|
912
|
-
return range = Array.from(_), interpolate$1 = interpolateRound, rescale();
|
|
913
|
-
};
|
|
914
|
-
|
|
915
|
-
scale.clamp = function(_) {
|
|
916
|
-
return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;
|
|
917
|
-
};
|
|
918
|
-
|
|
919
|
-
scale.interpolate = function(_) {
|
|
920
|
-
return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
|
|
921
|
-
};
|
|
922
|
-
|
|
923
|
-
scale.unknown = function(_) {
|
|
924
|
-
return arguments.length ? (unknown = _, scale) : unknown;
|
|
925
|
-
};
|
|
926
|
-
|
|
927
|
-
return function(t, u) {
|
|
928
|
-
transform = t, untransform = u;
|
|
929
|
-
return rescale();
|
|
930
|
-
};
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
function continuous() {
|
|
934
|
-
return transformer()(identity, identity);
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
function tickFormat(start, stop, count, specifier) {
|
|
938
|
-
var step = tickStep(start, stop, count),
|
|
939
|
-
precision;
|
|
940
|
-
specifier = formatSpecifier(specifier == null ? ",f" : specifier);
|
|
941
|
-
switch (specifier.type) {
|
|
942
|
-
case "s": {
|
|
943
|
-
var value = Math.max(Math.abs(start), Math.abs(stop));
|
|
944
|
-
if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
|
|
945
|
-
return formatPrefix(specifier, value);
|
|
946
|
-
}
|
|
947
|
-
case "":
|
|
948
|
-
case "e":
|
|
949
|
-
case "g":
|
|
950
|
-
case "p":
|
|
951
|
-
case "r": {
|
|
952
|
-
if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
|
|
953
|
-
break;
|
|
954
|
-
}
|
|
955
|
-
case "f":
|
|
956
|
-
case "%": {
|
|
957
|
-
if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
|
|
958
|
-
break;
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
return format(specifier);
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
function linearish(scale) {
|
|
965
|
-
var domain = scale.domain;
|
|
966
|
-
|
|
967
|
-
scale.ticks = function(count) {
|
|
968
|
-
var d = domain();
|
|
969
|
-
return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
|
|
970
|
-
};
|
|
971
|
-
|
|
972
|
-
scale.tickFormat = function(count, specifier) {
|
|
973
|
-
var d = domain();
|
|
974
|
-
return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
|
|
975
|
-
};
|
|
976
|
-
|
|
977
|
-
scale.nice = function(count) {
|
|
978
|
-
if (count == null) count = 10;
|
|
979
|
-
|
|
980
|
-
var d = domain();
|
|
981
|
-
var i0 = 0;
|
|
982
|
-
var i1 = d.length - 1;
|
|
983
|
-
var start = d[i0];
|
|
984
|
-
var stop = d[i1];
|
|
985
|
-
var prestep;
|
|
986
|
-
var step;
|
|
987
|
-
var maxIter = 10;
|
|
988
|
-
|
|
989
|
-
if (stop < start) {
|
|
990
|
-
step = start, start = stop, stop = step;
|
|
991
|
-
step = i0, i0 = i1, i1 = step;
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
while (maxIter-- > 0) {
|
|
995
|
-
step = tickIncrement(start, stop, count);
|
|
996
|
-
if (step === prestep) {
|
|
997
|
-
d[i0] = start;
|
|
998
|
-
d[i1] = stop;
|
|
999
|
-
return domain(d);
|
|
1000
|
-
} else if (step > 0) {
|
|
1001
|
-
start = Math.floor(start / step) * step;
|
|
1002
|
-
stop = Math.ceil(stop / step) * step;
|
|
1003
|
-
} else if (step < 0) {
|
|
1004
|
-
start = Math.ceil(start * step) / step;
|
|
1005
|
-
stop = Math.floor(stop * step) / step;
|
|
1006
|
-
} else {
|
|
1007
|
-
break;
|
|
1008
|
-
}
|
|
1009
|
-
prestep = step;
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
return scale;
|
|
1013
|
-
};
|
|
1014
|
-
|
|
1015
|
-
return scale;
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
function linear() {
|
|
1019
|
-
var scale = continuous();
|
|
1020
|
-
|
|
1021
|
-
scale.copy = function() {
|
|
1022
|
-
return copy(scale, linear());
|
|
1023
|
-
};
|
|
1024
|
-
|
|
1025
|
-
initRange.apply(scale, arguments);
|
|
1026
|
-
|
|
1027
|
-
return linearish(scale);
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
function nice(domain, interval) {
|
|
1031
|
-
domain = domain.slice();
|
|
1032
|
-
|
|
1033
|
-
var i0 = 0,
|
|
1034
|
-
i1 = domain.length - 1,
|
|
1035
|
-
x0 = domain[i0],
|
|
1036
|
-
x1 = domain[i1],
|
|
1037
|
-
t;
|
|
1038
|
-
|
|
1039
|
-
if (x1 < x0) {
|
|
1040
|
-
t = i0, i0 = i1, i1 = t;
|
|
1041
|
-
t = x0, x0 = x1, x1 = t;
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
domain[i0] = interval.floor(x0);
|
|
1045
|
-
domain[i1] = interval.ceil(x1);
|
|
1046
|
-
return domain;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
const t0 = new Date, t1 = new Date;
|
|
1050
|
-
|
|
1051
|
-
function timeInterval(floori, offseti, count, field) {
|
|
1052
|
-
|
|
1053
|
-
function interval(date) {
|
|
1054
|
-
return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
interval.floor = (date) => {
|
|
1058
|
-
return floori(date = new Date(+date)), date;
|
|
1059
|
-
};
|
|
1060
|
-
|
|
1061
|
-
interval.ceil = (date) => {
|
|
1062
|
-
return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
|
|
1063
|
-
};
|
|
1064
|
-
|
|
1065
|
-
interval.round = (date) => {
|
|
1066
|
-
const d0 = interval(date), d1 = interval.ceil(date);
|
|
1067
|
-
return date - d0 < d1 - date ? d0 : d1;
|
|
1068
|
-
};
|
|
1069
|
-
|
|
1070
|
-
interval.offset = (date, step) => {
|
|
1071
|
-
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
|
|
1072
|
-
};
|
|
1073
|
-
|
|
1074
|
-
interval.range = (start, stop, step) => {
|
|
1075
|
-
const range = [];
|
|
1076
|
-
start = interval.ceil(start);
|
|
1077
|
-
step = step == null ? 1 : Math.floor(step);
|
|
1078
|
-
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
|
|
1079
|
-
let previous;
|
|
1080
|
-
do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
|
|
1081
|
-
while (previous < start && start < stop);
|
|
1082
|
-
return range;
|
|
1083
|
-
};
|
|
1084
|
-
|
|
1085
|
-
interval.filter = (test) => {
|
|
1086
|
-
return timeInterval((date) => {
|
|
1087
|
-
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
|
|
1088
|
-
}, (date, step) => {
|
|
1089
|
-
if (date >= date) {
|
|
1090
|
-
if (step < 0) while (++step <= 0) {
|
|
1091
|
-
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
|
|
1092
|
-
} else while (--step >= 0) {
|
|
1093
|
-
while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
});
|
|
1097
|
-
};
|
|
1098
|
-
|
|
1099
|
-
if (count) {
|
|
1100
|
-
interval.count = (start, end) => {
|
|
1101
|
-
t0.setTime(+start), t1.setTime(+end);
|
|
1102
|
-
floori(t0), floori(t1);
|
|
1103
|
-
return Math.floor(count(t0, t1));
|
|
1104
|
-
};
|
|
1105
|
-
|
|
1106
|
-
interval.every = (step) => {
|
|
1107
|
-
step = Math.floor(step);
|
|
1108
|
-
return !isFinite(step) || !(step > 0) ? null
|
|
1109
|
-
: !(step > 1) ? interval
|
|
1110
|
-
: interval.filter(field
|
|
1111
|
-
? (d) => field(d) % step === 0
|
|
1112
|
-
: (d) => interval.count(0, d) % step === 0);
|
|
1113
|
-
};
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
return interval;
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
const millisecond = timeInterval(() => {
|
|
1120
|
-
// noop
|
|
1121
|
-
}, (date, step) => {
|
|
1122
|
-
date.setTime(+date + step);
|
|
1123
|
-
}, (start, end) => {
|
|
1124
|
-
return end - start;
|
|
1125
|
-
});
|
|
1126
|
-
|
|
1127
|
-
// An optimized implementation for this simple case.
|
|
1128
|
-
millisecond.every = (k) => {
|
|
1129
|
-
k = Math.floor(k);
|
|
1130
|
-
if (!isFinite(k) || !(k > 0)) return null;
|
|
1131
|
-
if (!(k > 1)) return millisecond;
|
|
1132
|
-
return timeInterval((date) => {
|
|
1133
|
-
date.setTime(Math.floor(date / k) * k);
|
|
1134
|
-
}, (date, step) => {
|
|
1135
|
-
date.setTime(+date + step * k);
|
|
1136
|
-
}, (start, end) => {
|
|
1137
|
-
return (end - start) / k;
|
|
1138
|
-
});
|
|
1139
|
-
};
|
|
1140
|
-
|
|
1141
|
-
const durationSecond = 1000;
|
|
1142
|
-
const durationMinute = durationSecond * 60;
|
|
1143
|
-
const durationHour = durationMinute * 60;
|
|
1144
|
-
const durationDay = durationHour * 24;
|
|
1145
|
-
const durationWeek = durationDay * 7;
|
|
1146
|
-
const durationMonth = durationDay * 30;
|
|
1147
|
-
const durationYear = durationDay * 365;
|
|
1148
|
-
|
|
1149
|
-
const second = timeInterval((date) => {
|
|
1150
|
-
date.setTime(date - date.getMilliseconds());
|
|
1151
|
-
}, (date, step) => {
|
|
1152
|
-
date.setTime(+date + step * durationSecond);
|
|
1153
|
-
}, (start, end) => {
|
|
1154
|
-
return (end - start) / durationSecond;
|
|
1155
|
-
}, (date) => {
|
|
1156
|
-
return date.getUTCSeconds();
|
|
1157
|
-
});
|
|
1158
|
-
|
|
1159
|
-
const timeMinute = timeInterval((date) => {
|
|
1160
|
-
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
|
|
1161
|
-
}, (date, step) => {
|
|
1162
|
-
date.setTime(+date + step * durationMinute);
|
|
1163
|
-
}, (start, end) => {
|
|
1164
|
-
return (end - start) / durationMinute;
|
|
1165
|
-
}, (date) => {
|
|
1166
|
-
return date.getMinutes();
|
|
1167
|
-
});
|
|
1168
|
-
|
|
1169
|
-
timeInterval((date) => {
|
|
1170
|
-
date.setUTCSeconds(0, 0);
|
|
1171
|
-
}, (date, step) => {
|
|
1172
|
-
date.setTime(+date + step * durationMinute);
|
|
1173
|
-
}, (start, end) => {
|
|
1174
|
-
return (end - start) / durationMinute;
|
|
1175
|
-
}, (date) => {
|
|
1176
|
-
return date.getUTCMinutes();
|
|
1177
|
-
});
|
|
1178
|
-
|
|
1179
|
-
const timeHour = timeInterval((date) => {
|
|
1180
|
-
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
|
|
1181
|
-
}, (date, step) => {
|
|
1182
|
-
date.setTime(+date + step * durationHour);
|
|
1183
|
-
}, (start, end) => {
|
|
1184
|
-
return (end - start) / durationHour;
|
|
1185
|
-
}, (date) => {
|
|
1186
|
-
return date.getHours();
|
|
1187
|
-
});
|
|
1188
|
-
|
|
1189
|
-
timeInterval((date) => {
|
|
1190
|
-
date.setUTCMinutes(0, 0, 0);
|
|
1191
|
-
}, (date, step) => {
|
|
1192
|
-
date.setTime(+date + step * durationHour);
|
|
1193
|
-
}, (start, end) => {
|
|
1194
|
-
return (end - start) / durationHour;
|
|
1195
|
-
}, (date) => {
|
|
1196
|
-
return date.getUTCHours();
|
|
1197
|
-
});
|
|
1198
|
-
|
|
1199
|
-
const timeDay = timeInterval(
|
|
1200
|
-
date => date.setHours(0, 0, 0, 0),
|
|
1201
|
-
(date, step) => date.setDate(date.getDate() + step),
|
|
1202
|
-
(start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
|
|
1203
|
-
date => date.getDate() - 1
|
|
1204
|
-
);
|
|
1205
|
-
|
|
1206
|
-
const utcDay = timeInterval((date) => {
|
|
1207
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
1208
|
-
}, (date, step) => {
|
|
1209
|
-
date.setUTCDate(date.getUTCDate() + step);
|
|
1210
|
-
}, (start, end) => {
|
|
1211
|
-
return (end - start) / durationDay;
|
|
1212
|
-
}, (date) => {
|
|
1213
|
-
return date.getUTCDate() - 1;
|
|
1214
|
-
});
|
|
1215
|
-
|
|
1216
|
-
timeInterval((date) => {
|
|
1217
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
1218
|
-
}, (date, step) => {
|
|
1219
|
-
date.setUTCDate(date.getUTCDate() + step);
|
|
1220
|
-
}, (start, end) => {
|
|
1221
|
-
return (end - start) / durationDay;
|
|
1222
|
-
}, (date) => {
|
|
1223
|
-
return Math.floor(date / durationDay);
|
|
1224
|
-
});
|
|
1225
|
-
|
|
1226
|
-
function timeWeekday(i) {
|
|
1227
|
-
return timeInterval((date) => {
|
|
1228
|
-
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
|
1229
|
-
date.setHours(0, 0, 0, 0);
|
|
1230
|
-
}, (date, step) => {
|
|
1231
|
-
date.setDate(date.getDate() + step * 7);
|
|
1232
|
-
}, (start, end) => {
|
|
1233
|
-
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
|
|
1234
|
-
});
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
const timeSunday = timeWeekday(0);
|
|
1238
|
-
const timeMonday = timeWeekday(1);
|
|
1239
|
-
timeWeekday(2);
|
|
1240
|
-
timeWeekday(3);
|
|
1241
|
-
const timeThursday = timeWeekday(4);
|
|
1242
|
-
timeWeekday(5);
|
|
1243
|
-
timeWeekday(6);
|
|
1244
|
-
|
|
1245
|
-
function utcWeekday(i) {
|
|
1246
|
-
return timeInterval((date) => {
|
|
1247
|
-
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
|
|
1248
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
1249
|
-
}, (date, step) => {
|
|
1250
|
-
date.setUTCDate(date.getUTCDate() + step * 7);
|
|
1251
|
-
}, (start, end) => {
|
|
1252
|
-
return (end - start) / durationWeek;
|
|
1253
|
-
});
|
|
1254
|
-
}
|
|
1255
|
-
|
|
1256
|
-
const utcSunday = utcWeekday(0);
|
|
1257
|
-
const utcMonday = utcWeekday(1);
|
|
1258
|
-
utcWeekday(2);
|
|
1259
|
-
utcWeekday(3);
|
|
1260
|
-
const utcThursday = utcWeekday(4);
|
|
1261
|
-
utcWeekday(5);
|
|
1262
|
-
utcWeekday(6);
|
|
1263
|
-
|
|
1264
|
-
const timeMonth = timeInterval((date) => {
|
|
1265
|
-
date.setDate(1);
|
|
1266
|
-
date.setHours(0, 0, 0, 0);
|
|
1267
|
-
}, (date, step) => {
|
|
1268
|
-
date.setMonth(date.getMonth() + step);
|
|
1269
|
-
}, (start, end) => {
|
|
1270
|
-
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
|
1271
|
-
}, (date) => {
|
|
1272
|
-
return date.getMonth();
|
|
1273
|
-
});
|
|
1274
|
-
|
|
1275
|
-
timeInterval((date) => {
|
|
1276
|
-
date.setUTCDate(1);
|
|
1277
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
1278
|
-
}, (date, step) => {
|
|
1279
|
-
date.setUTCMonth(date.getUTCMonth() + step);
|
|
1280
|
-
}, (start, end) => {
|
|
1281
|
-
return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
|
|
1282
|
-
}, (date) => {
|
|
1283
|
-
return date.getUTCMonth();
|
|
1284
|
-
});
|
|
1285
|
-
|
|
1286
|
-
const timeYear = timeInterval((date) => {
|
|
1287
|
-
date.setMonth(0, 1);
|
|
1288
|
-
date.setHours(0, 0, 0, 0);
|
|
1289
|
-
}, (date, step) => {
|
|
1290
|
-
date.setFullYear(date.getFullYear() + step);
|
|
1291
|
-
}, (start, end) => {
|
|
1292
|
-
return end.getFullYear() - start.getFullYear();
|
|
1293
|
-
}, (date) => {
|
|
1294
|
-
return date.getFullYear();
|
|
1295
|
-
});
|
|
1296
|
-
|
|
1297
|
-
// An optimized implementation for this simple case.
|
|
1298
|
-
timeYear.every = (k) => {
|
|
1299
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {
|
|
1300
|
-
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
|
1301
|
-
date.setMonth(0, 1);
|
|
1302
|
-
date.setHours(0, 0, 0, 0);
|
|
1303
|
-
}, (date, step) => {
|
|
1304
|
-
date.setFullYear(date.getFullYear() + step * k);
|
|
1305
|
-
});
|
|
1306
|
-
};
|
|
1307
|
-
|
|
1308
|
-
const utcYear = timeInterval((date) => {
|
|
1309
|
-
date.setUTCMonth(0, 1);
|
|
1310
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
1311
|
-
}, (date, step) => {
|
|
1312
|
-
date.setUTCFullYear(date.getUTCFullYear() + step);
|
|
1313
|
-
}, (start, end) => {
|
|
1314
|
-
return end.getUTCFullYear() - start.getUTCFullYear();
|
|
1315
|
-
}, (date) => {
|
|
1316
|
-
return date.getUTCFullYear();
|
|
1317
|
-
});
|
|
1318
|
-
|
|
1319
|
-
// An optimized implementation for this simple case.
|
|
1320
|
-
utcYear.every = (k) => {
|
|
1321
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {
|
|
1322
|
-
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
|
|
1323
|
-
date.setUTCMonth(0, 1);
|
|
1324
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
1325
|
-
}, (date, step) => {
|
|
1326
|
-
date.setUTCFullYear(date.getUTCFullYear() + step * k);
|
|
1327
|
-
});
|
|
1328
|
-
};
|
|
1329
|
-
|
|
1330
|
-
function ticker(year, month, week, day, hour, minute) {
|
|
1331
|
-
|
|
1332
|
-
const tickIntervals = [
|
|
1333
|
-
[second, 1, durationSecond],
|
|
1334
|
-
[second, 5, 5 * durationSecond],
|
|
1335
|
-
[second, 15, 15 * durationSecond],
|
|
1336
|
-
[second, 30, 30 * durationSecond],
|
|
1337
|
-
[minute, 1, durationMinute],
|
|
1338
|
-
[minute, 5, 5 * durationMinute],
|
|
1339
|
-
[minute, 15, 15 * durationMinute],
|
|
1340
|
-
[minute, 30, 30 * durationMinute],
|
|
1341
|
-
[ hour, 1, durationHour ],
|
|
1342
|
-
[ hour, 3, 3 * durationHour ],
|
|
1343
|
-
[ hour, 6, 6 * durationHour ],
|
|
1344
|
-
[ hour, 12, 12 * durationHour ],
|
|
1345
|
-
[ day, 1, durationDay ],
|
|
1346
|
-
[ day, 2, 2 * durationDay ],
|
|
1347
|
-
[ week, 1, durationWeek ],
|
|
1348
|
-
[ month, 1, durationMonth ],
|
|
1349
|
-
[ month, 3, 3 * durationMonth ],
|
|
1350
|
-
[ year, 1, durationYear ]
|
|
1351
|
-
];
|
|
1352
|
-
|
|
1353
|
-
function ticks(start, stop, count) {
|
|
1354
|
-
const reverse = stop < start;
|
|
1355
|
-
if (reverse) [start, stop] = [stop, start];
|
|
1356
|
-
const interval = count && typeof count.range === "function" ? count : tickInterval(start, stop, count);
|
|
1357
|
-
const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop
|
|
1358
|
-
return reverse ? ticks.reverse() : ticks;
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
|
-
function tickInterval(start, stop, count) {
|
|
1362
|
-
const target = Math.abs(stop - start) / count;
|
|
1363
|
-
const i = bisector(([,, step]) => step).right(tickIntervals, target);
|
|
1364
|
-
if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));
|
|
1365
|
-
if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));
|
|
1366
|
-
const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
|
|
1367
|
-
return t.every(step);
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
return [ticks, tickInterval];
|
|
1371
|
-
}
|
|
1372
|
-
const [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);
|
|
1373
|
-
|
|
1374
|
-
function localDate(d) {
|
|
1375
|
-
if (0 <= d.y && d.y < 100) {
|
|
1376
|
-
var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
1377
|
-
date.setFullYear(d.y);
|
|
1378
|
-
return date;
|
|
1379
|
-
}
|
|
1380
|
-
return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
function utcDate(d) {
|
|
1384
|
-
if (0 <= d.y && d.y < 100) {
|
|
1385
|
-
var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
1386
|
-
date.setUTCFullYear(d.y);
|
|
1387
|
-
return date;
|
|
1388
|
-
}
|
|
1389
|
-
return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
1390
|
-
}
|
|
1391
|
-
|
|
1392
|
-
function newDate(y, m, d) {
|
|
1393
|
-
return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
function formatLocale(locale) {
|
|
1397
|
-
var locale_dateTime = locale.dateTime,
|
|
1398
|
-
locale_date = locale.date,
|
|
1399
|
-
locale_time = locale.time,
|
|
1400
|
-
locale_periods = locale.periods,
|
|
1401
|
-
locale_weekdays = locale.days,
|
|
1402
|
-
locale_shortWeekdays = locale.shortDays,
|
|
1403
|
-
locale_months = locale.months,
|
|
1404
|
-
locale_shortMonths = locale.shortMonths;
|
|
1405
|
-
|
|
1406
|
-
var periodRe = formatRe(locale_periods),
|
|
1407
|
-
periodLookup = formatLookup(locale_periods),
|
|
1408
|
-
weekdayRe = formatRe(locale_weekdays),
|
|
1409
|
-
weekdayLookup = formatLookup(locale_weekdays),
|
|
1410
|
-
shortWeekdayRe = formatRe(locale_shortWeekdays),
|
|
1411
|
-
shortWeekdayLookup = formatLookup(locale_shortWeekdays),
|
|
1412
|
-
monthRe = formatRe(locale_months),
|
|
1413
|
-
monthLookup = formatLookup(locale_months),
|
|
1414
|
-
shortMonthRe = formatRe(locale_shortMonths),
|
|
1415
|
-
shortMonthLookup = formatLookup(locale_shortMonths);
|
|
1416
|
-
|
|
1417
|
-
var formats = {
|
|
1418
|
-
"a": formatShortWeekday,
|
|
1419
|
-
"A": formatWeekday,
|
|
1420
|
-
"b": formatShortMonth,
|
|
1421
|
-
"B": formatMonth,
|
|
1422
|
-
"c": null,
|
|
1423
|
-
"d": formatDayOfMonth,
|
|
1424
|
-
"e": formatDayOfMonth,
|
|
1425
|
-
"f": formatMicroseconds,
|
|
1426
|
-
"g": formatYearISO,
|
|
1427
|
-
"G": formatFullYearISO,
|
|
1428
|
-
"H": formatHour24,
|
|
1429
|
-
"I": formatHour12,
|
|
1430
|
-
"j": formatDayOfYear,
|
|
1431
|
-
"L": formatMilliseconds,
|
|
1432
|
-
"m": formatMonthNumber,
|
|
1433
|
-
"M": formatMinutes,
|
|
1434
|
-
"p": formatPeriod,
|
|
1435
|
-
"q": formatQuarter,
|
|
1436
|
-
"Q": formatUnixTimestamp,
|
|
1437
|
-
"s": formatUnixTimestampSeconds,
|
|
1438
|
-
"S": formatSeconds,
|
|
1439
|
-
"u": formatWeekdayNumberMonday,
|
|
1440
|
-
"U": formatWeekNumberSunday,
|
|
1441
|
-
"V": formatWeekNumberISO,
|
|
1442
|
-
"w": formatWeekdayNumberSunday,
|
|
1443
|
-
"W": formatWeekNumberMonday,
|
|
1444
|
-
"x": null,
|
|
1445
|
-
"X": null,
|
|
1446
|
-
"y": formatYear,
|
|
1447
|
-
"Y": formatFullYear,
|
|
1448
|
-
"Z": formatZone,
|
|
1449
|
-
"%": formatLiteralPercent
|
|
1450
|
-
};
|
|
1451
|
-
|
|
1452
|
-
var utcFormats = {
|
|
1453
|
-
"a": formatUTCShortWeekday,
|
|
1454
|
-
"A": formatUTCWeekday,
|
|
1455
|
-
"b": formatUTCShortMonth,
|
|
1456
|
-
"B": formatUTCMonth,
|
|
1457
|
-
"c": null,
|
|
1458
|
-
"d": formatUTCDayOfMonth,
|
|
1459
|
-
"e": formatUTCDayOfMonth,
|
|
1460
|
-
"f": formatUTCMicroseconds,
|
|
1461
|
-
"g": formatUTCYearISO,
|
|
1462
|
-
"G": formatUTCFullYearISO,
|
|
1463
|
-
"H": formatUTCHour24,
|
|
1464
|
-
"I": formatUTCHour12,
|
|
1465
|
-
"j": formatUTCDayOfYear,
|
|
1466
|
-
"L": formatUTCMilliseconds,
|
|
1467
|
-
"m": formatUTCMonthNumber,
|
|
1468
|
-
"M": formatUTCMinutes,
|
|
1469
|
-
"p": formatUTCPeriod,
|
|
1470
|
-
"q": formatUTCQuarter,
|
|
1471
|
-
"Q": formatUnixTimestamp,
|
|
1472
|
-
"s": formatUnixTimestampSeconds,
|
|
1473
|
-
"S": formatUTCSeconds,
|
|
1474
|
-
"u": formatUTCWeekdayNumberMonday,
|
|
1475
|
-
"U": formatUTCWeekNumberSunday,
|
|
1476
|
-
"V": formatUTCWeekNumberISO,
|
|
1477
|
-
"w": formatUTCWeekdayNumberSunday,
|
|
1478
|
-
"W": formatUTCWeekNumberMonday,
|
|
1479
|
-
"x": null,
|
|
1480
|
-
"X": null,
|
|
1481
|
-
"y": formatUTCYear,
|
|
1482
|
-
"Y": formatUTCFullYear,
|
|
1483
|
-
"Z": formatUTCZone,
|
|
1484
|
-
"%": formatLiteralPercent
|
|
1485
|
-
};
|
|
1486
|
-
|
|
1487
|
-
var parses = {
|
|
1488
|
-
"a": parseShortWeekday,
|
|
1489
|
-
"A": parseWeekday,
|
|
1490
|
-
"b": parseShortMonth,
|
|
1491
|
-
"B": parseMonth,
|
|
1492
|
-
"c": parseLocaleDateTime,
|
|
1493
|
-
"d": parseDayOfMonth,
|
|
1494
|
-
"e": parseDayOfMonth,
|
|
1495
|
-
"f": parseMicroseconds,
|
|
1496
|
-
"g": parseYear,
|
|
1497
|
-
"G": parseFullYear,
|
|
1498
|
-
"H": parseHour24,
|
|
1499
|
-
"I": parseHour24,
|
|
1500
|
-
"j": parseDayOfYear,
|
|
1501
|
-
"L": parseMilliseconds,
|
|
1502
|
-
"m": parseMonthNumber,
|
|
1503
|
-
"M": parseMinutes,
|
|
1504
|
-
"p": parsePeriod,
|
|
1505
|
-
"q": parseQuarter,
|
|
1506
|
-
"Q": parseUnixTimestamp,
|
|
1507
|
-
"s": parseUnixTimestampSeconds,
|
|
1508
|
-
"S": parseSeconds,
|
|
1509
|
-
"u": parseWeekdayNumberMonday,
|
|
1510
|
-
"U": parseWeekNumberSunday,
|
|
1511
|
-
"V": parseWeekNumberISO,
|
|
1512
|
-
"w": parseWeekdayNumberSunday,
|
|
1513
|
-
"W": parseWeekNumberMonday,
|
|
1514
|
-
"x": parseLocaleDate,
|
|
1515
|
-
"X": parseLocaleTime,
|
|
1516
|
-
"y": parseYear,
|
|
1517
|
-
"Y": parseFullYear,
|
|
1518
|
-
"Z": parseZone,
|
|
1519
|
-
"%": parseLiteralPercent
|
|
1520
|
-
};
|
|
1521
|
-
|
|
1522
|
-
// These recursive directive definitions must be deferred.
|
|
1523
|
-
formats.x = newFormat(locale_date, formats);
|
|
1524
|
-
formats.X = newFormat(locale_time, formats);
|
|
1525
|
-
formats.c = newFormat(locale_dateTime, formats);
|
|
1526
|
-
utcFormats.x = newFormat(locale_date, utcFormats);
|
|
1527
|
-
utcFormats.X = newFormat(locale_time, utcFormats);
|
|
1528
|
-
utcFormats.c = newFormat(locale_dateTime, utcFormats);
|
|
1529
|
-
|
|
1530
|
-
function newFormat(specifier, formats) {
|
|
1531
|
-
return function(date) {
|
|
1532
|
-
var string = [],
|
|
1533
|
-
i = -1,
|
|
1534
|
-
j = 0,
|
|
1535
|
-
n = specifier.length,
|
|
1536
|
-
c,
|
|
1537
|
-
pad,
|
|
1538
|
-
format;
|
|
1539
|
-
|
|
1540
|
-
if (!(date instanceof Date)) date = new Date(+date);
|
|
1541
|
-
|
|
1542
|
-
while (++i < n) {
|
|
1543
|
-
if (specifier.charCodeAt(i) === 37) {
|
|
1544
|
-
string.push(specifier.slice(j, i));
|
|
1545
|
-
if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);
|
|
1546
|
-
else pad = c === "e" ? " " : "0";
|
|
1547
|
-
if (format = formats[c]) c = format(date, pad);
|
|
1548
|
-
string.push(c);
|
|
1549
|
-
j = i + 1;
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
|
|
1553
|
-
string.push(specifier.slice(j, i));
|
|
1554
|
-
return string.join("");
|
|
1555
|
-
};
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1558
|
-
function newParse(specifier, Z) {
|
|
1559
|
-
return function(string) {
|
|
1560
|
-
var d = newDate(1900, undefined, 1),
|
|
1561
|
-
i = parseSpecifier(d, specifier, string += "", 0),
|
|
1562
|
-
week, day;
|
|
1563
|
-
if (i != string.length) return null;
|
|
1564
|
-
|
|
1565
|
-
// If a UNIX timestamp is specified, return it.
|
|
1566
|
-
if ("Q" in d) return new Date(d.Q);
|
|
1567
|
-
if ("s" in d) return new Date(d.s * 1000 + ("L" in d ? d.L : 0));
|
|
1568
|
-
|
|
1569
|
-
// If this is utcParse, never use the local timezone.
|
|
1570
|
-
if (Z && !("Z" in d)) d.Z = 0;
|
|
1571
|
-
|
|
1572
|
-
// The am-pm flag is 0 for AM, and 1 for PM.
|
|
1573
|
-
if ("p" in d) d.H = d.H % 12 + d.p * 12;
|
|
1574
|
-
|
|
1575
|
-
// If the month was not specified, inherit from the quarter.
|
|
1576
|
-
if (d.m === undefined) d.m = "q" in d ? d.q : 0;
|
|
1577
|
-
|
|
1578
|
-
// Convert day-of-week and week-of-year to day-of-year.
|
|
1579
|
-
if ("V" in d) {
|
|
1580
|
-
if (d.V < 1 || d.V > 53) return null;
|
|
1581
|
-
if (!("w" in d)) d.w = 1;
|
|
1582
|
-
if ("Z" in d) {
|
|
1583
|
-
week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();
|
|
1584
|
-
week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
|
|
1585
|
-
week = utcDay.offset(week, (d.V - 1) * 7);
|
|
1586
|
-
d.y = week.getUTCFullYear();
|
|
1587
|
-
d.m = week.getUTCMonth();
|
|
1588
|
-
d.d = week.getUTCDate() + (d.w + 6) % 7;
|
|
1589
|
-
} else {
|
|
1590
|
-
week = localDate(newDate(d.y, 0, 1)), day = week.getDay();
|
|
1591
|
-
week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);
|
|
1592
|
-
week = timeDay.offset(week, (d.V - 1) * 7);
|
|
1593
|
-
d.y = week.getFullYear();
|
|
1594
|
-
d.m = week.getMonth();
|
|
1595
|
-
d.d = week.getDate() + (d.w + 6) % 7;
|
|
1596
|
-
}
|
|
1597
|
-
} else if ("W" in d || "U" in d) {
|
|
1598
|
-
if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
|
|
1599
|
-
day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
|
|
1600
|
-
d.m = 0;
|
|
1601
|
-
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
|
-
// If a time zone is specified, all fields are interpreted as UTC and then
|
|
1605
|
-
// offset according to the specified time zone.
|
|
1606
|
-
if ("Z" in d) {
|
|
1607
|
-
d.H += d.Z / 100 | 0;
|
|
1608
|
-
d.M += d.Z % 100;
|
|
1609
|
-
return utcDate(d);
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
// Otherwise, all fields are in local time.
|
|
1613
|
-
return localDate(d);
|
|
1614
|
-
};
|
|
1615
|
-
}
|
|
1616
|
-
|
|
1617
|
-
function parseSpecifier(d, specifier, string, j) {
|
|
1618
|
-
var i = 0,
|
|
1619
|
-
n = specifier.length,
|
|
1620
|
-
m = string.length,
|
|
1621
|
-
c,
|
|
1622
|
-
parse;
|
|
1623
|
-
|
|
1624
|
-
while (i < n) {
|
|
1625
|
-
if (j >= m) return -1;
|
|
1626
|
-
c = specifier.charCodeAt(i++);
|
|
1627
|
-
if (c === 37) {
|
|
1628
|
-
c = specifier.charAt(i++);
|
|
1629
|
-
parse = parses[c in pads ? specifier.charAt(i++) : c];
|
|
1630
|
-
if (!parse || ((j = parse(d, string, j)) < 0)) return -1;
|
|
1631
|
-
} else if (c != string.charCodeAt(j++)) {
|
|
1632
|
-
return -1;
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
|
|
1636
|
-
return j;
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
|
-
function parsePeriod(d, string, i) {
|
|
1640
|
-
var n = periodRe.exec(string.slice(i));
|
|
1641
|
-
return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
1642
|
-
}
|
|
1643
|
-
|
|
1644
|
-
function parseShortWeekday(d, string, i) {
|
|
1645
|
-
var n = shortWeekdayRe.exec(string.slice(i));
|
|
1646
|
-
return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
function parseWeekday(d, string, i) {
|
|
1650
|
-
var n = weekdayRe.exec(string.slice(i));
|
|
1651
|
-
return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
1652
|
-
}
|
|
1653
|
-
|
|
1654
|
-
function parseShortMonth(d, string, i) {
|
|
1655
|
-
var n = shortMonthRe.exec(string.slice(i));
|
|
1656
|
-
return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
|
-
function parseMonth(d, string, i) {
|
|
1660
|
-
var n = monthRe.exec(string.slice(i));
|
|
1661
|
-
return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
1662
|
-
}
|
|
1663
|
-
|
|
1664
|
-
function parseLocaleDateTime(d, string, i) {
|
|
1665
|
-
return parseSpecifier(d, locale_dateTime, string, i);
|
|
1666
|
-
}
|
|
1667
|
-
|
|
1668
|
-
function parseLocaleDate(d, string, i) {
|
|
1669
|
-
return parseSpecifier(d, locale_date, string, i);
|
|
1670
|
-
}
|
|
1671
|
-
|
|
1672
|
-
function parseLocaleTime(d, string, i) {
|
|
1673
|
-
return parseSpecifier(d, locale_time, string, i);
|
|
1674
|
-
}
|
|
1675
|
-
|
|
1676
|
-
function formatShortWeekday(d) {
|
|
1677
|
-
return locale_shortWeekdays[d.getDay()];
|
|
1678
|
-
}
|
|
1679
|
-
|
|
1680
|
-
function formatWeekday(d) {
|
|
1681
|
-
return locale_weekdays[d.getDay()];
|
|
1682
|
-
}
|
|
1683
|
-
|
|
1684
|
-
function formatShortMonth(d) {
|
|
1685
|
-
return locale_shortMonths[d.getMonth()];
|
|
1686
|
-
}
|
|
1687
|
-
|
|
1688
|
-
function formatMonth(d) {
|
|
1689
|
-
return locale_months[d.getMonth()];
|
|
1690
|
-
}
|
|
1691
|
-
|
|
1692
|
-
function formatPeriod(d) {
|
|
1693
|
-
return locale_periods[+(d.getHours() >= 12)];
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
function formatQuarter(d) {
|
|
1697
|
-
return 1 + ~~(d.getMonth() / 3);
|
|
1698
|
-
}
|
|
1699
|
-
|
|
1700
|
-
function formatUTCShortWeekday(d) {
|
|
1701
|
-
return locale_shortWeekdays[d.getUTCDay()];
|
|
1702
|
-
}
|
|
1703
|
-
|
|
1704
|
-
function formatUTCWeekday(d) {
|
|
1705
|
-
return locale_weekdays[d.getUTCDay()];
|
|
1706
|
-
}
|
|
1707
|
-
|
|
1708
|
-
function formatUTCShortMonth(d) {
|
|
1709
|
-
return locale_shortMonths[d.getUTCMonth()];
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
function formatUTCMonth(d) {
|
|
1713
|
-
return locale_months[d.getUTCMonth()];
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
|
-
function formatUTCPeriod(d) {
|
|
1717
|
-
return locale_periods[+(d.getUTCHours() >= 12)];
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
function formatUTCQuarter(d) {
|
|
1721
|
-
return 1 + ~~(d.getUTCMonth() / 3);
|
|
1722
|
-
}
|
|
1723
|
-
|
|
1724
|
-
return {
|
|
1725
|
-
format: function(specifier) {
|
|
1726
|
-
var f = newFormat(specifier += "", formats);
|
|
1727
|
-
f.toString = function() { return specifier; };
|
|
1728
|
-
return f;
|
|
1729
|
-
},
|
|
1730
|
-
parse: function(specifier) {
|
|
1731
|
-
var p = newParse(specifier += "", false);
|
|
1732
|
-
p.toString = function() { return specifier; };
|
|
1733
|
-
return p;
|
|
1734
|
-
},
|
|
1735
|
-
utcFormat: function(specifier) {
|
|
1736
|
-
var f = newFormat(specifier += "", utcFormats);
|
|
1737
|
-
f.toString = function() { return specifier; };
|
|
1738
|
-
return f;
|
|
1739
|
-
},
|
|
1740
|
-
utcParse: function(specifier) {
|
|
1741
|
-
var p = newParse(specifier += "", true);
|
|
1742
|
-
p.toString = function() { return specifier; };
|
|
1743
|
-
return p;
|
|
1744
|
-
}
|
|
1745
|
-
};
|
|
1746
|
-
}
|
|
1747
|
-
|
|
1748
|
-
var pads = {"-": "", "_": " ", "0": "0"},
|
|
1749
|
-
numberRe = /^\s*\d+/, // note: ignores next directive
|
|
1750
|
-
percentRe = /^%/,
|
|
1751
|
-
requoteRe = /[\\^$*+?|[\]().{}]/g;
|
|
1752
|
-
|
|
1753
|
-
function pad(value, fill, width) {
|
|
1754
|
-
var sign = value < 0 ? "-" : "",
|
|
1755
|
-
string = (sign ? -value : value) + "",
|
|
1756
|
-
length = string.length;
|
|
1757
|
-
return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
|
|
1758
|
-
}
|
|
1759
|
-
|
|
1760
|
-
function requote(s) {
|
|
1761
|
-
return s.replace(requoteRe, "\\$&");
|
|
1762
|
-
}
|
|
1763
|
-
|
|
1764
|
-
function formatRe(names) {
|
|
1765
|
-
return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
|
|
1766
|
-
}
|
|
1767
|
-
|
|
1768
|
-
function formatLookup(names) {
|
|
1769
|
-
return new Map(names.map((name, i) => [name.toLowerCase(), i]));
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1772
|
-
function parseWeekdayNumberSunday(d, string, i) {
|
|
1773
|
-
var n = numberRe.exec(string.slice(i, i + 1));
|
|
1774
|
-
return n ? (d.w = +n[0], i + n[0].length) : -1;
|
|
1775
|
-
}
|
|
1776
|
-
|
|
1777
|
-
function parseWeekdayNumberMonday(d, string, i) {
|
|
1778
|
-
var n = numberRe.exec(string.slice(i, i + 1));
|
|
1779
|
-
return n ? (d.u = +n[0], i + n[0].length) : -1;
|
|
1780
|
-
}
|
|
1781
|
-
|
|
1782
|
-
function parseWeekNumberSunday(d, string, i) {
|
|
1783
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
1784
|
-
return n ? (d.U = +n[0], i + n[0].length) : -1;
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
|
-
function parseWeekNumberISO(d, string, i) {
|
|
1788
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
1789
|
-
return n ? (d.V = +n[0], i + n[0].length) : -1;
|
|
1790
|
-
}
|
|
1791
|
-
|
|
1792
|
-
function parseWeekNumberMonday(d, string, i) {
|
|
1793
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
1794
|
-
return n ? (d.W = +n[0], i + n[0].length) : -1;
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
function parseFullYear(d, string, i) {
|
|
1798
|
-
var n = numberRe.exec(string.slice(i, i + 4));
|
|
1799
|
-
return n ? (d.y = +n[0], i + n[0].length) : -1;
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
function parseYear(d, string, i) {
|
|
1803
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
1804
|
-
return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;
|
|
1805
|
-
}
|
|
1806
|
-
|
|
1807
|
-
function parseZone(d, string, i) {
|
|
1808
|
-
var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
|
|
1809
|
-
return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
|
|
1810
|
-
}
|
|
1811
|
-
|
|
1812
|
-
function parseQuarter(d, string, i) {
|
|
1813
|
-
var n = numberRe.exec(string.slice(i, i + 1));
|
|
1814
|
-
return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;
|
|
1815
|
-
}
|
|
1816
|
-
|
|
1817
|
-
function parseMonthNumber(d, string, i) {
|
|
1818
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
1819
|
-
return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
function parseDayOfMonth(d, string, i) {
|
|
1823
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
1824
|
-
return n ? (d.d = +n[0], i + n[0].length) : -1;
|
|
1825
|
-
}
|
|
1826
|
-
|
|
1827
|
-
function parseDayOfYear(d, string, i) {
|
|
1828
|
-
var n = numberRe.exec(string.slice(i, i + 3));
|
|
1829
|
-
return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
|
|
1830
|
-
}
|
|
1831
|
-
|
|
1832
|
-
function parseHour24(d, string, i) {
|
|
1833
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
1834
|
-
return n ? (d.H = +n[0], i + n[0].length) : -1;
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
function parseMinutes(d, string, i) {
|
|
1838
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
1839
|
-
return n ? (d.M = +n[0], i + n[0].length) : -1;
|
|
1840
|
-
}
|
|
1841
|
-
|
|
1842
|
-
function parseSeconds(d, string, i) {
|
|
1843
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
1844
|
-
return n ? (d.S = +n[0], i + n[0].length) : -1;
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
|
-
function parseMilliseconds(d, string, i) {
|
|
1848
|
-
var n = numberRe.exec(string.slice(i, i + 3));
|
|
1849
|
-
return n ? (d.L = +n[0], i + n[0].length) : -1;
|
|
1850
|
-
}
|
|
1851
|
-
|
|
1852
|
-
function parseMicroseconds(d, string, i) {
|
|
1853
|
-
var n = numberRe.exec(string.slice(i, i + 6));
|
|
1854
|
-
return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
function parseLiteralPercent(d, string, i) {
|
|
1858
|
-
var n = percentRe.exec(string.slice(i, i + 1));
|
|
1859
|
-
return n ? i + n[0].length : -1;
|
|
1860
|
-
}
|
|
1861
|
-
|
|
1862
|
-
function parseUnixTimestamp(d, string, i) {
|
|
1863
|
-
var n = numberRe.exec(string.slice(i));
|
|
1864
|
-
return n ? (d.Q = +n[0], i + n[0].length) : -1;
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
|
-
function parseUnixTimestampSeconds(d, string, i) {
|
|
1868
|
-
var n = numberRe.exec(string.slice(i));
|
|
1869
|
-
return n ? (d.s = +n[0], i + n[0].length) : -1;
|
|
1870
|
-
}
|
|
1871
|
-
|
|
1872
|
-
function formatDayOfMonth(d, p) {
|
|
1873
|
-
return pad(d.getDate(), p, 2);
|
|
1874
|
-
}
|
|
1875
|
-
|
|
1876
|
-
function formatHour24(d, p) {
|
|
1877
|
-
return pad(d.getHours(), p, 2);
|
|
1878
|
-
}
|
|
1879
|
-
|
|
1880
|
-
function formatHour12(d, p) {
|
|
1881
|
-
return pad(d.getHours() % 12 || 12, p, 2);
|
|
1882
|
-
}
|
|
1883
|
-
|
|
1884
|
-
function formatDayOfYear(d, p) {
|
|
1885
|
-
return pad(1 + timeDay.count(timeYear(d), d), p, 3);
|
|
1886
|
-
}
|
|
1887
|
-
|
|
1888
|
-
function formatMilliseconds(d, p) {
|
|
1889
|
-
return pad(d.getMilliseconds(), p, 3);
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
|
-
function formatMicroseconds(d, p) {
|
|
1893
|
-
return formatMilliseconds(d, p) + "000";
|
|
1894
|
-
}
|
|
1895
|
-
|
|
1896
|
-
function formatMonthNumber(d, p) {
|
|
1897
|
-
return pad(d.getMonth() + 1, p, 2);
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
|
-
function formatMinutes(d, p) {
|
|
1901
|
-
return pad(d.getMinutes(), p, 2);
|
|
1902
|
-
}
|
|
1903
|
-
|
|
1904
|
-
function formatSeconds(d, p) {
|
|
1905
|
-
return pad(d.getSeconds(), p, 2);
|
|
1906
|
-
}
|
|
1907
|
-
|
|
1908
|
-
function formatWeekdayNumberMonday(d) {
|
|
1909
|
-
var day = d.getDay();
|
|
1910
|
-
return day === 0 ? 7 : day;
|
|
1911
|
-
}
|
|
1912
|
-
|
|
1913
|
-
function formatWeekNumberSunday(d, p) {
|
|
1914
|
-
return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1917
|
-
function dISO(d) {
|
|
1918
|
-
var day = d.getDay();
|
|
1919
|
-
return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);
|
|
1920
|
-
}
|
|
1921
|
-
|
|
1922
|
-
function formatWeekNumberISO(d, p) {
|
|
1923
|
-
d = dISO(d);
|
|
1924
|
-
return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);
|
|
1925
|
-
}
|
|
1926
|
-
|
|
1927
|
-
function formatWeekdayNumberSunday(d) {
|
|
1928
|
-
return d.getDay();
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
|
-
function formatWeekNumberMonday(d, p) {
|
|
1932
|
-
return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);
|
|
1933
|
-
}
|
|
1934
|
-
|
|
1935
|
-
function formatYear(d, p) {
|
|
1936
|
-
return pad(d.getFullYear() % 100, p, 2);
|
|
1937
|
-
}
|
|
1938
|
-
|
|
1939
|
-
function formatYearISO(d, p) {
|
|
1940
|
-
d = dISO(d);
|
|
1941
|
-
return pad(d.getFullYear() % 100, p, 2);
|
|
1942
|
-
}
|
|
1943
|
-
|
|
1944
|
-
function formatFullYear(d, p) {
|
|
1945
|
-
return pad(d.getFullYear() % 10000, p, 4);
|
|
1946
|
-
}
|
|
1947
|
-
|
|
1948
|
-
function formatFullYearISO(d, p) {
|
|
1949
|
-
var day = d.getDay();
|
|
1950
|
-
d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);
|
|
1951
|
-
return pad(d.getFullYear() % 10000, p, 4);
|
|
1952
|
-
}
|
|
1953
|
-
|
|
1954
|
-
function formatZone(d) {
|
|
1955
|
-
var z = d.getTimezoneOffset();
|
|
1956
|
-
return (z > 0 ? "-" : (z *= -1, "+"))
|
|
1957
|
-
+ pad(z / 60 | 0, "0", 2)
|
|
1958
|
-
+ pad(z % 60, "0", 2);
|
|
1959
|
-
}
|
|
1960
|
-
|
|
1961
|
-
function formatUTCDayOfMonth(d, p) {
|
|
1962
|
-
return pad(d.getUTCDate(), p, 2);
|
|
1963
|
-
}
|
|
1964
|
-
|
|
1965
|
-
function formatUTCHour24(d, p) {
|
|
1966
|
-
return pad(d.getUTCHours(), p, 2);
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
function formatUTCHour12(d, p) {
|
|
1970
|
-
return pad(d.getUTCHours() % 12 || 12, p, 2);
|
|
1971
|
-
}
|
|
1972
|
-
|
|
1973
|
-
function formatUTCDayOfYear(d, p) {
|
|
1974
|
-
return pad(1 + utcDay.count(utcYear(d), d), p, 3);
|
|
1975
|
-
}
|
|
1976
|
-
|
|
1977
|
-
function formatUTCMilliseconds(d, p) {
|
|
1978
|
-
return pad(d.getUTCMilliseconds(), p, 3);
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
|
-
function formatUTCMicroseconds(d, p) {
|
|
1982
|
-
return formatUTCMilliseconds(d, p) + "000";
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
|
-
function formatUTCMonthNumber(d, p) {
|
|
1986
|
-
return pad(d.getUTCMonth() + 1, p, 2);
|
|
1987
|
-
}
|
|
1988
|
-
|
|
1989
|
-
function formatUTCMinutes(d, p) {
|
|
1990
|
-
return pad(d.getUTCMinutes(), p, 2);
|
|
1991
|
-
}
|
|
1992
|
-
|
|
1993
|
-
function formatUTCSeconds(d, p) {
|
|
1994
|
-
return pad(d.getUTCSeconds(), p, 2);
|
|
1995
|
-
}
|
|
1996
|
-
|
|
1997
|
-
function formatUTCWeekdayNumberMonday(d) {
|
|
1998
|
-
var dow = d.getUTCDay();
|
|
1999
|
-
return dow === 0 ? 7 : dow;
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
|
-
function formatUTCWeekNumberSunday(d, p) {
|
|
2003
|
-
return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);
|
|
2004
|
-
}
|
|
2005
|
-
|
|
2006
|
-
function UTCdISO(d) {
|
|
2007
|
-
var day = d.getUTCDay();
|
|
2008
|
-
return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
|
-
function formatUTCWeekNumberISO(d, p) {
|
|
2012
|
-
d = UTCdISO(d);
|
|
2013
|
-
return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
|
-
function formatUTCWeekdayNumberSunday(d) {
|
|
2017
|
-
return d.getUTCDay();
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
|
-
function formatUTCWeekNumberMonday(d, p) {
|
|
2021
|
-
return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);
|
|
2022
|
-
}
|
|
2023
|
-
|
|
2024
|
-
function formatUTCYear(d, p) {
|
|
2025
|
-
return pad(d.getUTCFullYear() % 100, p, 2);
|
|
2026
|
-
}
|
|
2027
|
-
|
|
2028
|
-
function formatUTCYearISO(d, p) {
|
|
2029
|
-
d = UTCdISO(d);
|
|
2030
|
-
return pad(d.getUTCFullYear() % 100, p, 2);
|
|
2031
|
-
}
|
|
2032
|
-
|
|
2033
|
-
function formatUTCFullYear(d, p) {
|
|
2034
|
-
return pad(d.getUTCFullYear() % 10000, p, 4);
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
function formatUTCFullYearISO(d, p) {
|
|
2038
|
-
var day = d.getUTCDay();
|
|
2039
|
-
d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);
|
|
2040
|
-
return pad(d.getUTCFullYear() % 10000, p, 4);
|
|
2041
|
-
}
|
|
2042
|
-
|
|
2043
|
-
function formatUTCZone() {
|
|
2044
|
-
return "+0000";
|
|
2045
|
-
}
|
|
2046
|
-
|
|
2047
|
-
function formatLiteralPercent() {
|
|
2048
|
-
return "%";
|
|
2049
|
-
}
|
|
2050
|
-
|
|
2051
|
-
function formatUnixTimestamp(d) {
|
|
2052
|
-
return +d;
|
|
2053
|
-
}
|
|
2054
|
-
|
|
2055
|
-
function formatUnixTimestampSeconds(d) {
|
|
2056
|
-
return Math.floor(+d / 1000);
|
|
2057
|
-
}
|
|
2058
|
-
|
|
2059
|
-
var locale;
|
|
2060
|
-
exports.timeFormat = void 0;
|
|
2061
|
-
exports.timeParse = void 0;
|
|
2062
|
-
|
|
2063
|
-
defaultLocale({
|
|
2064
|
-
dateTime: "%x, %X",
|
|
2065
|
-
date: "%-m/%-d/%Y",
|
|
2066
|
-
time: "%-I:%M:%S %p",
|
|
2067
|
-
periods: ["AM", "PM"],
|
|
2068
|
-
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
2069
|
-
shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
2070
|
-
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
2071
|
-
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
|
2072
|
-
});
|
|
2073
|
-
|
|
2074
|
-
function defaultLocale(definition) {
|
|
2075
|
-
locale = formatLocale(definition);
|
|
2076
|
-
exports.timeFormat = locale.format;
|
|
2077
|
-
exports.timeParse = locale.parse;
|
|
2078
|
-
return locale;
|
|
2079
|
-
}
|
|
2080
|
-
|
|
2081
|
-
function date(t) {
|
|
2082
|
-
return new Date(t);
|
|
2083
|
-
}
|
|
2084
|
-
|
|
2085
|
-
function number(t) {
|
|
2086
|
-
return t instanceof Date ? +t : +new Date(+t);
|
|
2087
|
-
}
|
|
2088
|
-
|
|
2089
|
-
function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {
|
|
2090
|
-
var scale = continuous(),
|
|
2091
|
-
invert = scale.invert,
|
|
2092
|
-
domain = scale.domain;
|
|
2093
|
-
|
|
2094
|
-
var formatMillisecond = format(".%L"),
|
|
2095
|
-
formatSecond = format(":%S"),
|
|
2096
|
-
formatMinute = format("%I:%M"),
|
|
2097
|
-
formatHour = format("%I %p"),
|
|
2098
|
-
formatDay = format("%a %d"),
|
|
2099
|
-
formatWeek = format("%b %d"),
|
|
2100
|
-
formatMonth = format("%B"),
|
|
2101
|
-
formatYear = format("%Y");
|
|
2102
|
-
|
|
2103
|
-
function tickFormat(date) {
|
|
2104
|
-
return (second(date) < date ? formatMillisecond
|
|
2105
|
-
: minute(date) < date ? formatSecond
|
|
2106
|
-
: hour(date) < date ? formatMinute
|
|
2107
|
-
: day(date) < date ? formatHour
|
|
2108
|
-
: month(date) < date ? (week(date) < date ? formatDay : formatWeek)
|
|
2109
|
-
: year(date) < date ? formatMonth
|
|
2110
|
-
: formatYear)(date);
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2113
|
-
scale.invert = function(y) {
|
|
2114
|
-
return new Date(invert(y));
|
|
2115
|
-
};
|
|
2116
|
-
|
|
2117
|
-
scale.domain = function(_) {
|
|
2118
|
-
return arguments.length ? domain(Array.from(_, number)) : domain().map(date);
|
|
2119
|
-
};
|
|
2120
|
-
|
|
2121
|
-
scale.ticks = function(interval) {
|
|
2122
|
-
var d = domain();
|
|
2123
|
-
return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);
|
|
2124
|
-
};
|
|
2125
|
-
|
|
2126
|
-
scale.tickFormat = function(count, specifier) {
|
|
2127
|
-
return specifier == null ? tickFormat : format(specifier);
|
|
2128
|
-
};
|
|
2129
|
-
|
|
2130
|
-
scale.nice = function(interval) {
|
|
2131
|
-
var d = domain();
|
|
2132
|
-
if (!interval || typeof interval.range !== "function") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);
|
|
2133
|
-
return interval ? domain(nice(d, interval)) : scale;
|
|
2134
|
-
};
|
|
2135
|
-
|
|
2136
|
-
scale.copy = function() {
|
|
2137
|
-
return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));
|
|
2138
|
-
};
|
|
2139
|
-
|
|
2140
|
-
return scale;
|
|
2141
|
-
}
|
|
2142
|
-
|
|
2143
|
-
function time() {
|
|
2144
|
-
return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, exports.timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);
|
|
2145
|
-
}
|
|
2146
|
-
|
|
2147
|
-
/**
|
|
2148
|
-
* The XAxisDrawer class extends the BaseDrawer class and draws the x-axis of a chart using the provided render options.
|
|
2149
|
-
*/
|
|
2150
|
-
class XAxisDrawer extends legendInputProcessor.BaseDrawer {
|
|
2151
|
-
/** This function adds interaction support */
|
|
2152
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2153
|
-
addInteractionSupport() { }
|
|
2154
|
-
/**
|
|
2155
|
-
* This function draws the X-axis of a chart using the provided rendering options.
|
|
2156
|
-
*/
|
|
2157
|
-
draw() {
|
|
2158
|
-
this.renderer.drawXAxis(this.options.renderOptions, this.getColorFromToken('bg-tertiary'), this.getStyleTextFromToken('v-font-field-label-sm v-text-secondary'));
|
|
2159
|
-
}
|
|
2160
|
-
}
|
|
2161
|
-
|
|
2162
|
-
/** The YAxisDrawer class extends the BaseDrawer class and draws the Y-axis of a chart using the provided render options. */
|
|
2163
|
-
class YAxisDrawer extends legendInputProcessor.BaseDrawer {
|
|
2164
|
-
/** This function adds interaction support */
|
|
2165
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2166
|
-
addInteractionSupport() { }
|
|
2167
|
-
/**
|
|
2168
|
-
* The function draws the Y-axis of a chart using the provided rendering options.
|
|
2169
|
-
*/
|
|
2170
|
-
draw() {
|
|
2171
|
-
this.renderer.drawYAxis(this.options.renderOptions, this.getColorFromToken('bg-tertiary'), this.getStyleTextFromToken('v-font-field-label-sm v-text-secondary'));
|
|
2172
|
-
}
|
|
2173
|
-
}
|
|
2174
|
-
|
|
2175
|
-
/** The XAxisInputProcessor class generates X-axis options for a line chart based on input data and previous layout results. */
|
|
2176
|
-
class XAxisInputProcessor {
|
|
2177
|
-
/**
|
|
2178
|
-
* This function generates X-axis options for a line chart based on input data and previous layout results.
|
|
2179
|
-
*
|
|
2180
|
-
* @param {ChartOptions<LineChartDataType>} input - An object containing chart options, including the data source, x-axis options, and
|
|
2181
|
-
* container element.
|
|
2182
|
-
* @param {LayoutProcessResultType} [previousOutput] - The optional output from the previous layout
|
|
2183
|
-
* process. It is of type LayoutProcessResultType and contains information about the innerWidth and
|
|
2184
|
-
* innerHeight of the chart container.
|
|
2185
|
-
* @returns {ChartExtend<AxisScale<AxisDomain>>} a ChartExtend object that contains the options for the X-axis of a line chart, including
|
|
2186
|
-
* the scale generated by the scaleGenerator and the axis options generated by the axisGenerator.
|
|
2187
|
-
*/
|
|
2188
|
-
process(input, previousOutput) {
|
|
2189
|
-
const { dataSource, xAxis, container } = input;
|
|
2190
|
-
const { innerWidth, innerHeight } = previousOutput;
|
|
2191
|
-
const xAxisType = (xAxis === null || xAxis === void 0 ? void 0 : xAxis.type) || 'value';
|
|
2192
|
-
const scale = this.getScale(dataSource, innerWidth, xAxisType, container.tagName === 'VEGA-LINE-CHART' ? 1 : 0.1, xAxis === null || xAxis === void 0 ? void 0 : xAxis.sorter);
|
|
2193
|
-
return {
|
|
2194
|
-
start: { x: 0, y: innerHeight },
|
|
2195
|
-
end: { x: innerWidth, y: innerHeight },
|
|
2196
|
-
tickSize: 4,
|
|
2197
|
-
scale: scale,
|
|
2198
|
-
labelFormatter: xAxis === null || xAxis === void 0 ? void 0 : xAxis.labelFormatter,
|
|
2199
|
-
width: innerWidth,
|
|
2200
|
-
height: innerHeight,
|
|
2201
|
-
};
|
|
2202
|
-
}
|
|
2203
|
-
/**
|
|
2204
|
-
* get x scale
|
|
2205
|
-
*
|
|
2206
|
-
* @param {ChartDataSourceItem[]} data data source
|
|
2207
|
-
* @param {number} width svg width
|
|
2208
|
-
* @param {ChartXAxisType} xAxisType x axis data type
|
|
2209
|
-
* @param {number} padding x position offset value
|
|
2210
|
-
* @param {(item:string,nextItem:string)=>number} sorter the sorter function using when the category type
|
|
2211
|
-
* @returns {AxisScale<AxisDomain>} x scale
|
|
2212
|
-
*/
|
|
2213
|
-
getScale(data, width, xAxisType, padding = 0.1, sorter) {
|
|
2214
|
-
const flatData = array.flatNestedArray(data);
|
|
2215
|
-
const xData = flatData.map((item) => item.x);
|
|
2216
|
-
let xScale;
|
|
2217
|
-
if (xAxisType === 'time') {
|
|
2218
|
-
xScale = time()
|
|
2219
|
-
.domain(extent(xData))
|
|
2220
|
-
.range([0, width]);
|
|
2221
|
-
}
|
|
2222
|
-
else if (xAxisType === 'category') {
|
|
2223
|
-
xScale = band(typeof sorter === 'function' ? xData.sort(sorter) : xData, [0, width]).padding(padding);
|
|
2224
|
-
}
|
|
2225
|
-
else {
|
|
2226
|
-
xScale = linear()
|
|
2227
|
-
.domain(extent(xData))
|
|
2228
|
-
.range([0, width]);
|
|
2229
|
-
}
|
|
2230
|
-
return xScale;
|
|
2231
|
-
}
|
|
2232
|
-
}
|
|
2233
|
-
|
|
2234
|
-
/** The YAxisInputProcessor class generates Y-axis options for a line chart based on input data and previous layout results. */
|
|
2235
|
-
class YAxisInputProcessor {
|
|
2236
|
-
/**
|
|
2237
|
-
* This function generates the Y-axis options for a line chart based on the input data and previous layout results.
|
|
2238
|
-
*
|
|
2239
|
-
* @param {ChartOptions<LineChartDataType>} input - An object containing the chart options and data for a line chart. It includes the
|
|
2240
|
-
* dataSource and yAxis properties.
|
|
2241
|
-
* @param {LayoutProcessResultType} [previousOutput] - The output of the previous layout process,
|
|
2242
|
-
* which is an object containing the innerWidth and innerHeight of the chart. This parameter is
|
|
2243
|
-
* optional and can be undefined if it's the first layout process.
|
|
2244
|
-
* @returns {ChartExtend<AxisScale<AxisDomain>>} an object of type `ChartExtend<AxisScale<AxisDomain>>`, which is the result of calling the
|
|
2245
|
-
* `getAxisOptions` method of the `axisGenerator` object. This object contains options for the Y-axis
|
|
2246
|
-
* of a line chart, including the scale used for the axis.
|
|
2247
|
-
*/
|
|
2248
|
-
process(input, previousOutput) {
|
|
2249
|
-
const { dataSource, yAxis } = input;
|
|
2250
|
-
const { innerWidth, innerHeight } = previousOutput;
|
|
2251
|
-
const { scale, ticks } = this.getScale(dataSource, [innerHeight, 0], 4);
|
|
2252
|
-
return {
|
|
2253
|
-
start: { x: 0, y: 0 },
|
|
2254
|
-
end: { x: 0, y: innerHeight },
|
|
2255
|
-
tickSize: ticks,
|
|
2256
|
-
scale: scale,
|
|
2257
|
-
labelFormatter: yAxis === null || yAxis === void 0 ? void 0 : yAxis.labelFormatter,
|
|
2258
|
-
width: innerWidth,
|
|
2259
|
-
height: innerHeight,
|
|
2260
|
-
};
|
|
2261
|
-
}
|
|
2262
|
-
/**
|
|
2263
|
-
* get y scale
|
|
2264
|
-
*
|
|
2265
|
-
* @param {ChartDataSourceItem[]} data data source
|
|
2266
|
-
* @param {number[]} range svg scale range
|
|
2267
|
-
* @param {number} ticks the y-axis ticks
|
|
2268
|
-
* @returns {ScaleType}y scale
|
|
2269
|
-
*/
|
|
2270
|
-
getScale(data, range, ticks) {
|
|
2271
|
-
const flatData = array.flatNestedArray(data);
|
|
2272
|
-
const yData = flatData.map((item) => item.y).concat(0);
|
|
2273
|
-
let maxYData = max(yData);
|
|
2274
|
-
let minYData = min(yData);
|
|
2275
|
-
let yScale = linear().domain([minYData, maxYData]);
|
|
2276
|
-
const ticksValue = yScale.ticks(ticks);
|
|
2277
|
-
const step = Math.abs(ticksValue[ticksValue.length - 1] - ticksValue[ticksValue.length - 2]);
|
|
2278
|
-
const [minTickValue, maxTickValue] = extent(ticksValue);
|
|
2279
|
-
if (minYData < minTickValue) {
|
|
2280
|
-
minYData = minTickValue - step;
|
|
2281
|
-
ticks += 1;
|
|
2282
|
-
}
|
|
2283
|
-
if (maxYData > maxTickValue) {
|
|
2284
|
-
maxYData = maxTickValue + step;
|
|
2285
|
-
ticks += 1;
|
|
2286
|
-
}
|
|
2287
|
-
yScale = linear().domain([minYData, maxYData]).range(range);
|
|
2288
|
-
return { scale: yScale, ticks };
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
|
-
|
|
2292
|
-
exports.XAxisDrawer = XAxisDrawer;
|
|
2293
|
-
exports.XAxisInputProcessor = XAxisInputProcessor;
|
|
2294
|
-
exports.YAxisDrawer = YAxisDrawer;
|
|
2295
|
-
exports.YAxisInputProcessor = YAxisInputProcessor;
|
|
2296
|
-
exports.second = second;
|
|
2297
|
-
exports.timeDay = timeDay;
|
|
2298
|
-
exports.timeHour = timeHour;
|
|
2299
|
-
exports.timeMinute = timeMinute;
|
|
2300
|
-
exports.timeMonth = timeMonth;
|
|
2301
|
-
exports.timeSunday = timeSunday;
|
|
2302
|
-
exports.timeYear = timeYear;
|