@watermarkinsights/ripple 5.23.0-alpha.0 → 5.23.0-alpha.10
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-d75466f5.js → app-globals-04c40b05.js} +26 -17
- package/dist/cjs/{chartFunctions-97471b69.js → chartFunctions-8d17cbb8.js} +19 -1
- package/dist/cjs/{functions-71af585d.js → functions-156cc201.js} +2 -2
- package/dist/cjs/{interfaces-069f135e.js → interfaces-8419be91.js} +22 -21
- package/dist/cjs/{intl-169a8805.js → intl-789e4b6c.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/priv-calendar.cjs.entry.js +26 -13
- package/dist/cjs/priv-chart-popover-old.cjs.entry.js +2 -2
- package/dist/cjs/priv-chart-popover_2.cjs.entry.js +9 -9
- package/dist/cjs/priv-navigator-button.cjs.entry.js +1 -1
- package/dist/cjs/priv-navigator-item.cjs.entry.js +1 -1
- package/dist/cjs/priv-option-list.cjs.entry.js +3 -3
- package/dist/cjs/ripple.cjs.js +2 -2
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +4 -4
- package/dist/cjs/wm-button.cjs.entry.js +4 -4
- package/dist/cjs/wm-chart-bar.cjs.entry.js +53 -34
- package/dist/cjs/wm-chart.cjs.entry.js +3 -3
- package/dist/cjs/wm-date-range.cjs.entry.js +1 -1
- package/dist/cjs/wm-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/wm-file-list.cjs.entry.js +1 -1
- package/dist/cjs/wm-file.cjs.entry.js +2 -2
- package/dist/cjs/wm-flyout.cjs.entry.js +3 -3
- package/dist/cjs/wm-input.cjs.entry.js +3 -3
- package/dist/cjs/wm-line-chart.cjs.entry.js +3 -3
- package/dist/cjs/wm-modal-pss_3.cjs.entry.js +6 -6
- package/dist/cjs/wm-modal_3.cjs.entry.js +8 -10
- package/dist/cjs/wm-navigation_3.cjs.entry.js +6 -6
- package/dist/cjs/wm-navigator.cjs.entry.js +2 -2
- package/dist/cjs/wm-nested-select.cjs.entry.js +5 -5
- package/dist/cjs/wm-optgroup.cjs.entry.js +2 -2
- package/dist/cjs/wm-option_2.cjs.entry.js +68 -38
- package/dist/cjs/wm-pagination.cjs.entry.js +4 -4
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +2 -2
- package/dist/cjs/wm-search.cjs.entry.js +5 -5
- package/dist/cjs/wm-snackbar.cjs.entry.js +5 -5
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +8 -8
- package/dist/cjs/wm-tag-input.cjs.entry.js +4 -4
- package/dist/cjs/wm-tag-option.cjs.entry.js +1 -1
- package/dist/cjs/wm-textarea.cjs.entry.js +3 -3
- package/dist/cjs/wm-timepicker.cjs.entry.js +3 -3
- package/dist/cjs/wm-toggletip.cjs.entry.js +4 -4
- package/dist/cjs/wm-uploader.cjs.entry.js +5 -5
- package/dist/collection/components/charts/chartFunctions.js +17 -0
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +22 -22
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +7 -19
- package/dist/collection/components/charts/priv-chart-popover-old/priv-chart-popover-old.css +10 -8
- package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.css +7 -24
- package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.js +52 -45
- package/dist/collection/components/charts/wm-chart-legend/wm-chart-legend.js +3 -3
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +30 -12
- package/dist/collection/components/selects/priv-option-list/priv-option-list.js +1 -1
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +3 -3
- package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +1 -1
- package/dist/collection/components/selects/wm-option/wm-option.js +1 -1
- package/dist/collection/components/selects/wm-select/wm-select.js +65 -35
- package/dist/collection/components/wm-action-menu/wm-action-menu.js +1 -1
- package/dist/collection/components/wm-button/wm-button.css +14 -15
- package/dist/collection/components/wm-button/wm-button.js +1 -1
- package/dist/collection/components/wm-file/wm-file.js +1 -1
- package/dist/collection/components/wm-file-list/wm-file-list.js +1 -1
- package/dist/collection/components/wm-flyout/wm-flyout.js +1 -1
- package/dist/collection/components/wm-input/wm-input.js +1 -1
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +1 -1
- package/dist/collection/components/wm-modal/wm-modal-footer.js +1 -1
- package/dist/collection/components/wm-modal/wm-modal-header.js +1 -1
- package/dist/collection/components/wm-modal/wm-modal.js +4 -6
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +1 -1
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +1 -1
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +2 -2
- package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +1 -1
- package/dist/collection/components/wm-navigation/wm-navigation-item.js +1 -1
- package/dist/collection/components/wm-navigation/wm-navigation.js +2 -2
- package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +1 -1
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +1 -1
- package/dist/collection/components/wm-pagination/wm-pagination.css +12 -17
- package/dist/collection/components/wm-pagination/wm-pagination.js +1 -1
- package/dist/collection/components/wm-search/wm-search.css +8 -8
- package/dist/collection/components/wm-search/wm-search.js +2 -2
- package/dist/collection/components/wm-snackbar/wm-snackbar.css +10 -13
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +2 -2
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +3 -2
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +2 -2
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +3 -3
- package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +1 -1
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +2 -2
- package/dist/collection/components/wm-textarea/wm-textarea.js +1 -1
- package/dist/collection/components/wm-timepicker/wm-timepicker.js +2 -2
- package/dist/collection/components/wm-toggletip/wm-toggletip.js +3 -3
- package/dist/collection/components/wm-uploader/wm-uploader.css +23 -16
- package/dist/collection/components/wm-uploader/wm-uploader.js +2 -2
- package/dist/collection/dev/chart-bar.js +77 -41
- package/dist/collection/global/functions.js +2 -2
- package/dist/collection/global/global.js +25 -16
- package/dist/collection/global/interfaces.js +21 -19
- package/dist/esm/{app-globals-be942f12.js → app-globals-db909d00.js} +26 -17
- package/dist/esm/{chartFunctions-9c95674d.js → chartFunctions-93592f14.js} +19 -2
- package/dist/esm/{functions-2cfbd8c7.js → functions-c1d5f184.js} +2 -2
- package/dist/esm/{interfaces-30d10bc0.js → interfaces-7e50d034.js} +22 -20
- package/dist/esm/{intl-23d21b06.js → intl-8c69d10b.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/priv-calendar.entry.js +26 -13
- package/dist/esm/priv-chart-popover-old.entry.js +2 -2
- package/dist/esm/priv-chart-popover_2.entry.js +9 -9
- package/dist/esm/priv-navigator-button.entry.js +1 -1
- package/dist/esm/priv-navigator-item.entry.js +1 -1
- package/dist/esm/priv-option-list.entry.js +3 -3
- package/dist/esm/ripple.js +2 -2
- package/dist/esm/wm-action-menu_2.entry.js +4 -4
- package/dist/esm/wm-button.entry.js +4 -4
- package/dist/esm/wm-chart-bar.entry.js +53 -34
- package/dist/esm/wm-chart.entry.js +3 -3
- package/dist/esm/wm-date-range.entry.js +1 -1
- package/dist/esm/wm-datepicker.entry.js +1 -1
- package/dist/esm/wm-file-list.entry.js +1 -1
- package/dist/esm/wm-file.entry.js +2 -2
- package/dist/esm/wm-flyout.entry.js +3 -3
- package/dist/esm/wm-input.entry.js +3 -3
- package/dist/esm/wm-line-chart.entry.js +3 -3
- package/dist/esm/wm-modal-pss_3.entry.js +6 -6
- package/dist/esm/wm-modal_3.entry.js +8 -10
- package/dist/esm/wm-navigation_3.entry.js +6 -6
- package/dist/esm/wm-navigator.entry.js +2 -2
- package/dist/esm/wm-nested-select.entry.js +5 -5
- package/dist/esm/wm-optgroup.entry.js +2 -2
- package/dist/esm/wm-option_2.entry.js +68 -38
- package/dist/esm/wm-pagination.entry.js +4 -4
- package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
- package/dist/esm/wm-search.entry.js +5 -5
- package/dist/esm/wm-snackbar.entry.js +5 -5
- package/dist/esm/wm-tab-item_3.entry.js +8 -8
- package/dist/esm/wm-tag-input.entry.js +4 -4
- package/dist/esm/wm-tag-option.entry.js +1 -1
- package/dist/esm/wm-textarea.entry.js +3 -3
- package/dist/esm/wm-timepicker.entry.js +3 -3
- package/dist/esm/wm-toggletip.entry.js +4 -4
- package/dist/esm/wm-uploader.entry.js +5 -5
- package/dist/esm-es5/app-globals-db909d00.js +1 -0
- package/dist/esm-es5/{chartFunctions-9c95674d.js → chartFunctions-93592f14.js} +1 -1
- package/dist/esm-es5/{functions-2cfbd8c7.js → functions-c1d5f184.js} +1 -1
- package/dist/esm-es5/interfaces-7e50d034.js +1 -0
- package/dist/esm-es5/{intl-23d21b06.js → intl-8c69d10b.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-calendar.entry.js +1 -1
- package/dist/esm-es5/priv-chart-popover-old.entry.js +1 -1
- package/dist/esm-es5/priv-chart-popover_2.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
- package/dist/esm-es5/priv-option-list.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
- package/dist/esm-es5/wm-button.entry.js +1 -1
- package/dist/esm-es5/wm-chart-bar.entry.js +1 -1
- package/dist/esm-es5/wm-chart.entry.js +1 -1
- package/dist/esm-es5/wm-date-range.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-file-list.entry.js +1 -1
- package/dist/esm-es5/wm-file.entry.js +1 -1
- package/dist/esm-es5/wm-flyout.entry.js +1 -1
- package/dist/esm-es5/wm-input.entry.js +1 -1
- package/dist/esm-es5/wm-line-chart.entry.js +1 -1
- package/dist/esm-es5/wm-modal-pss_3.entry.js +1 -1
- package/dist/esm-es5/wm-modal_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigator.entry.js +1 -1
- package/dist/esm-es5/wm-nested-select.entry.js +1 -1
- package/dist/esm-es5/wm-optgroup.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/esm-es5/wm-pagination.entry.js +1 -1
- package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
- package/dist/esm-es5/wm-search.entry.js +1 -1
- package/dist/esm-es5/wm-snackbar.entry.js +1 -1
- package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
- package/dist/esm-es5/wm-tag-input.entry.js +1 -1
- package/dist/esm-es5/wm-tag-option.entry.js +1 -1
- package/dist/esm-es5/wm-textarea.entry.js +1 -1
- package/dist/esm-es5/wm-timepicker.entry.js +1 -1
- package/dist/esm-es5/wm-toggletip.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/ripple/{p-5f50c561.system.entry.js → p-0356e736.system.entry.js} +1 -1
- package/dist/ripple/{p-0abc1b51.system.entry.js → p-086da1c5.system.entry.js} +1 -1
- package/dist/ripple/{p-b939d3cb.system.entry.js → p-0886099f.system.entry.js} +1 -1
- package/dist/ripple/{p-5cbbaf69.system.entry.js → p-08ba2a77.system.entry.js} +1 -1
- package/dist/ripple/{p-d49676b7.system.entry.js → p-0e418fe4.system.entry.js} +1 -1
- package/dist/ripple/{p-15ab0cf9.system.entry.js → p-0efafbd8.system.entry.js} +1 -1
- package/dist/ripple/{p-909f8797.entry.js → p-1641d37f.entry.js} +1 -1
- package/dist/ripple/p-179c505c.entry.js +1 -0
- package/dist/ripple/{p-9dc0fcd6.system.entry.js → p-17f3fa47.system.entry.js} +1 -1
- package/dist/ripple/{p-0ef91339.entry.js → p-23f08f5a.entry.js} +1 -1
- package/dist/ripple/{p-b3092643.entry.js → p-24598e3e.entry.js} +1 -1
- package/dist/ripple/{p-8c20ccd2.entry.js → p-24ce5997.entry.js} +1 -1
- package/dist/ripple/{p-b089276a.entry.js → p-25043b32.entry.js} +1 -1
- package/dist/ripple/{p-10f93b97.system.entry.js → p-262d5bd5.system.entry.js} +1 -1
- package/dist/ripple/{p-8888e7f0.system.entry.js → p-275386c1.system.entry.js} +1 -1
- package/dist/ripple/{p-6ea645ee.system.entry.js → p-2d042b40.system.entry.js} +1 -1
- package/dist/ripple/{p-1802aedc.system.entry.js → p-2d5bd606.system.entry.js} +1 -1
- package/dist/ripple/{p-79ec0bb2.entry.js → p-3410da36.entry.js} +1 -1
- package/dist/ripple/p-3436e819.entry.js +1 -0
- package/dist/ripple/{p-6d375c14.system.entry.js → p-35dfeacb.system.entry.js} +1 -1
- package/dist/ripple/{p-cf845266.entry.js → p-367df770.entry.js} +1 -1
- package/dist/ripple/{p-ad8132aa.entry.js → p-3b2e7166.entry.js} +1 -1
- package/dist/ripple/{p-d522499c.entry.js → p-3de0e2b0.entry.js} +1 -1
- package/dist/ripple/{p-575f24e8.system.entry.js → p-46c77ecb.system.entry.js} +1 -1
- package/dist/ripple/{p-3e10eb3d.entry.js → p-48950aef.entry.js} +1 -1
- package/dist/ripple/{p-8d858325.system.entry.js → p-4934d53f.system.entry.js} +1 -1
- package/dist/ripple/{p-d6ca433c.entry.js → p-49b75a61.entry.js} +1 -1
- package/dist/ripple/{p-bd4a3dd8.system.entry.js → p-4a138695.system.entry.js} +1 -1
- package/dist/ripple/{p-78edd963.entry.js → p-4b813987.entry.js} +1 -1
- package/dist/ripple/{p-1124978e.system.entry.js → p-55cdf672.system.entry.js} +1 -1
- package/dist/ripple/p-625d4010.entry.js +1 -0
- package/dist/ripple/{p-377cf709.entry.js → p-6434eacf.entry.js} +1 -1
- package/dist/ripple/{p-9246f0dc.js → p-6a2fb1a1.js} +1 -1
- package/dist/ripple/{p-79b3dfc8.entry.js → p-724fbe77.entry.js} +1 -1
- package/dist/ripple/{p-0b2a0825.system.entry.js → p-74b5624a.system.entry.js} +1 -1
- package/dist/ripple/p-75816848.system.js +1 -0
- package/dist/ripple/{p-bc271e17.system.entry.js → p-7c103a48.system.entry.js} +1 -1
- package/dist/ripple/{p-35ef7bba.entry.js → p-7f4a409e.entry.js} +1 -1
- package/dist/ripple/{p-bc052b23.entry.js → p-86f5e918.entry.js} +1 -1
- package/dist/ripple/p-8a4d79dc.system.entry.js +1 -0
- package/dist/ripple/p-8ac14bb1.system.js +1 -0
- package/dist/ripple/{p-f6d60ed8.system.entry.js → p-90f0283c.system.entry.js} +1 -1
- package/dist/ripple/{p-01e8cea6.entry.js → p-94842057.entry.js} +1 -1
- package/dist/ripple/{p-78524594.entry.js → p-986d1792.entry.js} +1 -1
- package/dist/ripple/p-9a0ec366.js +1 -0
- package/dist/ripple/{p-966f2c9e.entry.js → p-9bcdb6ae.entry.js} +1 -1
- package/dist/ripple/{p-b313c3d3.system.entry.js → p-a289d92b.system.entry.js} +1 -1
- package/dist/ripple/{p-c8c8e85f.system.js → p-a402c6bb.system.js} +1 -1
- package/dist/ripple/{p-21114d99.entry.js → p-aecb621d.entry.js} +1 -1
- package/dist/ripple/{p-34574dc8.system.entry.js → p-af9e6028.system.entry.js} +1 -1
- package/dist/ripple/p-b1afda53.entry.js +1 -0
- package/dist/ripple/p-b37fbb7e.entry.js +1 -0
- package/dist/ripple/{p-d62f5fd3.entry.js → p-b589b0da.entry.js} +1 -1
- package/dist/ripple/{p-576f4d06.system.entry.js → p-bfe3c687.system.entry.js} +1 -1
- package/dist/ripple/{p-2e71fe42.entry.js → p-c04fad73.entry.js} +1 -1
- package/dist/ripple/{p-f2a1f116.entry.js → p-c3ba7789.entry.js} +1 -1
- package/dist/ripple/{p-26d92a96.system.entry.js → p-c5030fa3.system.entry.js} +1 -1
- package/dist/ripple/{p-cab65a05.system.entry.js → p-c97b06b5.system.entry.js} +1 -1
- package/dist/ripple/{p-d13b78fd.system.entry.js → p-cd5aa832.system.entry.js} +1 -1
- package/dist/ripple/p-cda66d45.js +1 -0
- package/dist/ripple/p-ce4150f6.system.js +1 -0
- package/dist/ripple/{p-a0c4a12e.entry.js → p-d002e65f.entry.js} +1 -1
- package/dist/ripple/{p-fda4032a.system.entry.js → p-d4051c50.system.entry.js} +1 -1
- package/dist/ripple/{p-6394d25d.entry.js → p-d9d16c9d.entry.js} +1 -1
- package/dist/ripple/p-da3ae566.system.js +1 -0
- package/dist/ripple/{p-bf83369d.system.entry.js → p-da88bdfa.system.entry.js} +1 -1
- package/dist/ripple/{p-0ad87064.system.entry.js → p-defdef0c.system.entry.js} +1 -1
- package/dist/ripple/{p-efe93044.entry.js → p-e70f1e74.entry.js} +1 -1
- package/dist/ripple/p-eee663f4.system.entry.js +1 -0
- package/dist/ripple/{p-325393da.js → p-f031ced7.js} +1 -1
- package/dist/ripple/{p-685863a1.system.entry.js → p-f2b09954.system.entry.js} +1 -1
- package/dist/ripple/{p-c8d6b61a.system.js → p-f503991a.system.js} +1 -1
- package/dist/ripple/{p-7e0efb95.entry.js → p-f6844f41.entry.js} +1 -1
- package/dist/ripple/{p-77de2d9e.system.entry.js → p-f7742db8.system.entry.js} +1 -1
- package/dist/ripple/{p-32f95573.system.entry.js → p-f91c86d2.system.entry.js} +1 -1
- package/dist/ripple/{p-51cd1c0f.entry.js → p-fc67950d.entry.js} +1 -1
- package/dist/ripple/{p-d4877cbc.system.entry.js → p-fce3ce5c.system.entry.js} +1 -1
- package/dist/ripple/{p-1c9c0cf2.system.entry.js → p-fe49bfb7.system.entry.js} +1 -1
- package/dist/ripple/{p-56d17ec6.js → p-fe625125.js} +1 -1
- package/dist/ripple/{p-84d88288.entry.js → p-ff25bdd6.entry.js} +1 -1
- package/dist/ripple/p-ffa6f621.entry.js +1 -0
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/charts/chartFunctions.d.ts +1 -0
- package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +1 -1
- package/dist/types/components/charts/wm-chart-bar/wm-chart-bar.d.ts +8 -16
- package/dist/types/components/datepickers/priv-calendar/priv-calendar.d.ts +5 -1
- package/dist/types/components/selects/wm-select/wm-select.d.ts +7 -4
- package/dist/types/components.d.ts +2 -2
- package/dist/types/global/interfaces.d.ts +15 -8
- package/package.json +2 -2
- package/dist/esm-es5/app-globals-be942f12.js +0 -1
- package/dist/esm-es5/interfaces-30d10bc0.js +0 -1
- package/dist/ripple/p-1430f504.entry.js +0 -1
- package/dist/ripple/p-157468c5.entry.js +0 -1
- package/dist/ripple/p-1806bab8.system.js +0 -1
- package/dist/ripple/p-30a65553.system.js +0 -1
- package/dist/ripple/p-3989274d.system.entry.js +0 -1
- package/dist/ripple/p-4c727f0f.system.js +0 -1
- package/dist/ripple/p-5a5456e8.js +0 -1
- package/dist/ripple/p-7ee3f5ab.system.entry.js +0 -1
- package/dist/ripple/p-a68d6bed.entry.js +0 -1
- package/dist/ripple/p-b4ce79cd.entry.js +0 -1
- package/dist/ripple/p-c4e4a44c.entry.js +0 -1
- package/dist/ripple/p-d6effc35.system.js +0 -1
- package/dist/ripple/p-dcb1935c.entry.js +0 -1
- package/dist/ripple/p-f210f4ff.js +0 -1
|
@@ -708,3 +708,20 @@ export function findLargestNiceInterval(maxIntervals, total) {
|
|
|
708
708
|
}
|
|
709
709
|
return { numIntervals: 1, interval: total };
|
|
710
710
|
}
|
|
711
|
+
export function findNiceRoundNumber(value) {
|
|
712
|
+
// Given a value, find the next "nice" round number >= that value.
|
|
713
|
+
// Examples: 982 → 1000, 45 → 50, 1234 → 1500, 7 → 10
|
|
714
|
+
if (value <= 0)
|
|
715
|
+
return 0;
|
|
716
|
+
const niceValues = [1, 1.5, 2, 2.5, 3, 5, 10];
|
|
717
|
+
const magnitude = Math.pow(10, Math.floor(Math.log10(value)));
|
|
718
|
+
const normalized = value / magnitude;
|
|
719
|
+
// Find the smallest nice value that is >= the normalized value
|
|
720
|
+
for (const nice of niceValues) {
|
|
721
|
+
if (nice >= normalized) {
|
|
722
|
+
return nice * magnitude;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
// Fallback: next order of magnitude
|
|
726
|
+
return 10 * magnitude;
|
|
727
|
+
}
|
|
@@ -860,12 +860,6 @@
|
|
|
860
860
|
mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath style='fill: var(--icon-fill, currentColor)' d='M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z'/%3E%3C/svg%3E%0A");
|
|
861
861
|
}
|
|
862
862
|
|
|
863
|
-
priv-chart-popover {
|
|
864
|
-
--wmcolor-chart-popover-link-background: var(--wmcolor-background-transparent);
|
|
865
|
-
--wmcolor-chart-popover-link-text-focus: var(--wmcolor-interactive-focus);
|
|
866
|
-
--wmcolor-chart-popover-link-text: var(--wmcolor-interactive);
|
|
867
|
-
--wmcolor-chart-popover-background: var(--wmcolor-background);
|
|
868
|
-
}
|
|
869
863
|
priv-chart-popover.user-is-keying .button-text {
|
|
870
864
|
outline: 3px solid var(--wmcolor-interactive-focus);
|
|
871
865
|
outline-offset: 2px;
|
|
@@ -893,10 +887,10 @@ priv-chart-popover.user-is-keying .button-text {
|
|
|
893
887
|
-webkit-box-shadow: 0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.12);
|
|
894
888
|
-moz-box-shadow: 0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.12);
|
|
895
889
|
box-shadow: 0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.12);
|
|
896
|
-
background-color: var(--wmcolor-
|
|
890
|
+
background-color: var(--wmcolor-background);
|
|
897
891
|
font-size: 0.875rem;
|
|
898
|
-
text-align:
|
|
899
|
-
|
|
892
|
+
text-align: start;
|
|
893
|
+
inline-size: 10.5rem;
|
|
900
894
|
padding: 0.625rem 0.9375rem;
|
|
901
895
|
box-sizing: border-box;
|
|
902
896
|
}
|
|
@@ -904,9 +898,9 @@ priv-chart-popover.user-is-keying .button-text {
|
|
|
904
898
|
font-size: 1em;
|
|
905
899
|
font-weight: 500;
|
|
906
900
|
margin: 0;
|
|
907
|
-
padding-
|
|
908
|
-
padding-
|
|
909
|
-
padding-
|
|
901
|
+
padding-block-start: 0;
|
|
902
|
+
padding-inline-start: 0;
|
|
903
|
+
padding-block-end: 0.25rem;
|
|
910
904
|
}
|
|
911
905
|
.popover .title.positive {
|
|
912
906
|
color: var(--wmcolor-chart-label-text-positive);
|
|
@@ -916,7 +910,7 @@ priv-chart-popover.user-is-keying .button-text {
|
|
|
916
910
|
}
|
|
917
911
|
.popover .text {
|
|
918
912
|
margin: 0;
|
|
919
|
-
margin-
|
|
913
|
+
margin-block-end: 0.5rem;
|
|
920
914
|
}
|
|
921
915
|
.popover .popover-button {
|
|
922
916
|
-webkit-box-shadow: none;
|
|
@@ -924,12 +918,12 @@ priv-chart-popover.user-is-keying .button-text {
|
|
|
924
918
|
box-shadow: none;
|
|
925
919
|
position: relative;
|
|
926
920
|
display: inline-block;
|
|
927
|
-
margin-
|
|
928
|
-
padding-
|
|
929
|
-
padding-
|
|
930
|
-
|
|
921
|
+
margin-inline-start: 1rem;
|
|
922
|
+
padding-inline-start: 0;
|
|
923
|
+
padding-inline-end: 0;
|
|
924
|
+
block-size: auto;
|
|
931
925
|
border: none;
|
|
932
|
-
background: var(--wmcolor-
|
|
926
|
+
background: var(--wmcolor-background-transparent);
|
|
933
927
|
cursor: pointer;
|
|
934
928
|
text-decoration: none;
|
|
935
929
|
letter-spacing: 0;
|
|
@@ -937,7 +931,7 @@ priv-chart-popover.user-is-keying .button-text {
|
|
|
937
931
|
text-align: initial;
|
|
938
932
|
font-size: 0.875rem;
|
|
939
933
|
font-weight: 700;
|
|
940
|
-
color: var(--wmcolor-
|
|
934
|
+
color: var(--wmcolor-interactive);
|
|
941
935
|
line-height: normal;
|
|
942
936
|
}
|
|
943
937
|
.popover .popover-button .button-text {
|
|
@@ -945,8 +939,13 @@ priv-chart-popover.user-is-keying .button-text {
|
|
|
945
939
|
}
|
|
946
940
|
.popover .popover-button .btn-icon {
|
|
947
941
|
position: absolute;
|
|
948
|
-
|
|
949
|
-
|
|
942
|
+
inset-block-start: 0.1875rem;
|
|
943
|
+
inset-inline-start: -1rem;
|
|
944
|
+
}
|
|
945
|
+
.popover .popover-button span {
|
|
946
|
+
text-decoration: underline;
|
|
947
|
+
text-decoration-thickness: 0.0714285714em;
|
|
948
|
+
text-underline-offset: 0.1428571429em;
|
|
950
949
|
}
|
|
951
950
|
.popover .popover-button:focus {
|
|
952
951
|
outline: none;
|
|
@@ -959,5 +958,6 @@ priv-chart-popover.user-is-keying .button-text {
|
|
|
959
958
|
text-decoration: none;
|
|
960
959
|
}
|
|
961
960
|
.popover .popover-button:hover span {
|
|
962
|
-
text-
|
|
961
|
+
color: var(--wmcolor-link-text-hover);
|
|
962
|
+
text-decoration-thickness: 0.1428571429em;
|
|
963
963
|
}
|
|
@@ -57,7 +57,7 @@ export class ChartPopover {
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
handleOpenChange() {
|
|
60
|
-
this.
|
|
60
|
+
this.intChartPopoverToggled.emit(this.open);
|
|
61
61
|
if (this.open) {
|
|
62
62
|
this.popoverEl.showPopover();
|
|
63
63
|
}
|
|
@@ -106,9 +106,9 @@ export class ChartPopover {
|
|
|
106
106
|
}
|
|
107
107
|
render() {
|
|
108
108
|
const titleAffordance = this.header && (this.header[0] === "-" ? "negative" : this.header[0] === "+" ? "positive" : "");
|
|
109
|
-
return (h(Host, { key: '
|
|
109
|
+
return (h(Host, { key: 'ccf8d6d35d85b8c902d1350aa74d75b479c43b3c', class: this.isKeying ? "user-is-keying" : "" }, h("div", { key: '1340158d01632a92f6ef8c0a5637bc28e5ce7ea5', ref: (el) => (this.popoverEl = el), popover: "manual", "aria-hidden": "true", class: "popover" }, h("h1", { key: 'afb65849a7b7ff30b78f8e78f74bc57824f6acd5', class: `title ${titleAffordance}` }, this.header), h("p", { key: '2f523aae12190a62184136fec74b50fed7436f4a', class: "text" }, this.text), this.buttonText ? (h("button", { tabindex: "-1",
|
|
110
110
|
// @ts-ignore
|
|
111
|
-
focusable: "false", class: "popover-button", onClick: () => this.handleButtonClick() }, h("svg", { class: "btn-icon", height: "9", width: "9" }, h("path", { fill: "#575195", d: "M0 3.38v2.25h9V3.38H0zM0 0v2.25h4.5V0H0zm6.19 6.75H0V9h6.19V6.75z" })), h("span", { class: "button-text" }, this.buttonText))) : ("")), h("div", { key: '
|
|
111
|
+
focusable: "false", class: "popover-button", onClick: () => this.handleButtonClick() }, h("svg", { class: "btn-icon", height: "9", width: "9" }, h("path", { fill: "#575195", d: "M0 3.38v2.25h9V3.38H0zM0 0v2.25h4.5V0H0zm6.19 6.75H0V9h6.19V6.75z" })), h("span", { class: "button-text" }, this.buttonText))) : ("")), h("div", { key: '15568d7b0bb0dbc6884bf9baaea4b9ae715d33cf', ref: (el) => (this.liveRegionEl = el), class: "live-region sr-only", "aria-live": "polite", "aria-atomic": "true" }, this.announcement)));
|
|
112
112
|
}
|
|
113
113
|
static get is() { return "priv-chart-popover"; }
|
|
114
114
|
static get originalStyleUrls() {
|
|
@@ -128,7 +128,7 @@ export class ChartPopover {
|
|
|
128
128
|
"mutable": false,
|
|
129
129
|
"complexType": {
|
|
130
130
|
"original": "ChartData",
|
|
131
|
-
"resolved": "undefined | { [key: string]: any;
|
|
131
|
+
"resolved": "undefined | { [key: string]: any; barLegend: string; amount: number; color?: string | undefined; popoverTitle?: string | undefined; popoverText?: string | undefined; popoverButtonText?: string | undefined; }",
|
|
132
132
|
"references": {
|
|
133
133
|
"ChartData": {
|
|
134
134
|
"location": "import",
|
|
@@ -253,7 +253,7 @@ export class ChartPopover {
|
|
|
253
253
|
},
|
|
254
254
|
"complexType": {
|
|
255
255
|
"original": "ChartData",
|
|
256
|
-
"resolved": "{ [key: string]: any;
|
|
256
|
+
"resolved": "{ [key: string]: any; barLegend: string; amount: number; color?: string | undefined; popoverTitle?: string | undefined; popoverText?: string | undefined; popoverButtonText?: string | undefined; }",
|
|
257
257
|
"references": {
|
|
258
258
|
"ChartData": {
|
|
259
259
|
"location": "import",
|
|
@@ -263,8 +263,8 @@ export class ChartPopover {
|
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
}, {
|
|
266
|
-
"method": "
|
|
267
|
-
"name": "
|
|
266
|
+
"method": "intChartPopoverToggled",
|
|
267
|
+
"name": "intChartPopoverToggled",
|
|
268
268
|
"bubbles": true,
|
|
269
269
|
"cancelable": true,
|
|
270
270
|
"composed": true,
|
|
@@ -317,18 +317,6 @@ export class ChartPopover {
|
|
|
317
317
|
"target": "window",
|
|
318
318
|
"capture": false,
|
|
319
319
|
"passive": false
|
|
320
|
-
}, {
|
|
321
|
-
"name": "wmUserIsTabbing",
|
|
322
|
-
"method": "toggleTabbingOn",
|
|
323
|
-
"target": "window",
|
|
324
|
-
"capture": false,
|
|
325
|
-
"passive": false
|
|
326
|
-
}, {
|
|
327
|
-
"name": "wmUserIsNotKeying",
|
|
328
|
-
"method": "toggleTabbingOff",
|
|
329
|
-
"target": "window",
|
|
330
|
-
"capture": false,
|
|
331
|
-
"passive": false
|
|
332
320
|
}, {
|
|
333
321
|
"name": "wmUserIsNotTabbing",
|
|
334
322
|
"method": "toggleTabbingOff",
|
|
@@ -861,17 +861,13 @@
|
|
|
861
861
|
}
|
|
862
862
|
|
|
863
863
|
priv-chart-popover-old {
|
|
864
|
-
--wmcolor-chart-popover-link-background: var(--wmcolor-background-transparent);
|
|
865
|
-
--wmcolor-chart-popover-link-text-focus: var(--wmcolor-interactive-focus);
|
|
866
|
-
--wmcolor-chart-popover-link-text: var(--wmcolor-interactive);
|
|
867
|
-
--wmcolor-chart-popover-background: var(--wmcolor-background);
|
|
868
864
|
position: fixed;
|
|
869
865
|
z-index: 10;
|
|
870
866
|
border-radius: 0.1875rem;
|
|
871
867
|
-webkit-box-shadow: 0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.12);
|
|
872
868
|
-moz-box-shadow: 0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.12);
|
|
873
869
|
box-shadow: 0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.12);
|
|
874
|
-
background-color: var(--wmcolor-
|
|
870
|
+
background-color: var(--wmcolor-background);
|
|
875
871
|
font-size: 0.875rem;
|
|
876
872
|
text-align: left;
|
|
877
873
|
}
|
|
@@ -927,7 +923,7 @@ priv-chart-popover-old.user-is-tabbing .button-text {
|
|
|
927
923
|
padding-right: 0;
|
|
928
924
|
height: auto;
|
|
929
925
|
border: none;
|
|
930
|
-
background: var(--wmcolor-
|
|
926
|
+
background: var(--wmcolor-background-transparent);
|
|
931
927
|
cursor: pointer;
|
|
932
928
|
text-decoration: none;
|
|
933
929
|
letter-spacing: 0;
|
|
@@ -935,7 +931,7 @@ priv-chart-popover-old.user-is-tabbing .button-text {
|
|
|
935
931
|
text-align: initial;
|
|
936
932
|
font-size: 0.875rem;
|
|
937
933
|
font-weight: 700;
|
|
938
|
-
color: var(--wmcolor-
|
|
934
|
+
color: var(--wmcolor-link-text);
|
|
939
935
|
line-height: normal;
|
|
940
936
|
}
|
|
941
937
|
.popover .popover-button .button-text {
|
|
@@ -946,6 +942,11 @@ priv-chart-popover-old.user-is-tabbing .button-text {
|
|
|
946
942
|
top: 0.1875rem;
|
|
947
943
|
left: -1rem;
|
|
948
944
|
}
|
|
945
|
+
.popover .popover-button span {
|
|
946
|
+
text-decoration: underline;
|
|
947
|
+
text-decoration-thickness: 0.0714285714em;
|
|
948
|
+
text-underline-offset: 0.1428571429em;
|
|
949
|
+
}
|
|
949
950
|
.popover .popover-button:focus {
|
|
950
951
|
outline: none;
|
|
951
952
|
}
|
|
@@ -957,5 +958,6 @@ priv-chart-popover-old.user-is-tabbing .button-text {
|
|
|
957
958
|
text-decoration: none;
|
|
958
959
|
}
|
|
959
960
|
.popover .popover-button:hover span {
|
|
960
|
-
text-
|
|
961
|
+
color: var(--wmcolor-link-text-hover);
|
|
962
|
+
text-decoration-thickness: 0.1428571429em;
|
|
961
963
|
}
|
|
@@ -872,20 +872,11 @@
|
|
|
872
872
|
outline: 3px solid var(--wmcolor-interactive-focus);
|
|
873
873
|
outline-offset: 3px;
|
|
874
874
|
}
|
|
875
|
-
.component-wrapper :has(.bar:focus-visible) priv-chart-popover:host {
|
|
876
|
-
--outline: 3px solid var(--wmcolor-interactive-focus);
|
|
877
|
-
}
|
|
878
|
-
.component-wrapper :has(.bar:focus-visible) priv-chart-popover:host .popover {
|
|
879
|
-
background-color: red !important;
|
|
880
|
-
}
|
|
881
|
-
.component-wrapper :has(.bar:focus-visible) priv-chart-popover:host button {
|
|
882
|
-
outline: 3px solid var(--wmcolor-interactive-focus);
|
|
883
|
-
outline-offset: 2px;
|
|
884
|
-
}
|
|
885
875
|
|
|
886
876
|
.chart-wrapper {
|
|
887
877
|
display: flex;
|
|
888
878
|
container: chart-measure/inline-size;
|
|
879
|
+
gap: 0.75rem;
|
|
889
880
|
}
|
|
890
881
|
|
|
891
882
|
.legend.--top {
|
|
@@ -902,6 +893,7 @@
|
|
|
902
893
|
display: flex;
|
|
903
894
|
flex-direction: column;
|
|
904
895
|
gap: 0.25rem;
|
|
896
|
+
margin-bottom: 1.5rem;
|
|
905
897
|
}
|
|
906
898
|
.label .label-text {
|
|
907
899
|
display: block;
|
|
@@ -916,12 +908,6 @@
|
|
|
916
908
|
width: 100%;
|
|
917
909
|
color: var(--wmcolor-chart-subinfo-text);
|
|
918
910
|
}
|
|
919
|
-
.label.--top {
|
|
920
|
-
margin-bottom: 1.5rem;
|
|
921
|
-
}
|
|
922
|
-
.label.--none {
|
|
923
|
-
display: none;
|
|
924
|
-
}
|
|
925
911
|
|
|
926
912
|
.chart-left-side {
|
|
927
913
|
grid-column: 1;
|
|
@@ -935,19 +921,22 @@
|
|
|
935
921
|
grid-template-columns: minmax(0, max-content) auto 1fr;
|
|
936
922
|
grid-template-rows: 1fr;
|
|
937
923
|
margin-right: 3rem;
|
|
924
|
+
row-gap: 0.75rem;
|
|
938
925
|
}
|
|
939
926
|
|
|
940
927
|
.chart-right-side {
|
|
941
928
|
grid-column: 4;
|
|
942
929
|
grid-row: 1/-1;
|
|
943
930
|
}
|
|
931
|
+
.chart-right-side:empty {
|
|
932
|
+
display: none;
|
|
933
|
+
}
|
|
944
934
|
|
|
945
935
|
.category-axis-label {
|
|
946
936
|
max-width: 9.375rem;
|
|
947
937
|
display: flex;
|
|
948
938
|
align-items: center;
|
|
949
939
|
justify-content: center;
|
|
950
|
-
margin-inline-end: 0.75rem;
|
|
951
940
|
}
|
|
952
941
|
@container chart-measure (max-width: 414px) {
|
|
953
942
|
.category-axis-label {
|
|
@@ -976,7 +965,6 @@
|
|
|
976
965
|
grid-column: 2/-1;
|
|
977
966
|
row-gap: 0.75rem;
|
|
978
967
|
align-items: center;
|
|
979
|
-
margin-block-end: 0.75rem;
|
|
980
968
|
grid-template-rows: repeat(var(--row-count), minmax(1.5rem, 1fr)) 0;
|
|
981
969
|
}
|
|
982
970
|
|
|
@@ -997,7 +985,7 @@
|
|
|
997
985
|
grid-template-rows: subgrid;
|
|
998
986
|
align-items: center;
|
|
999
987
|
}
|
|
1000
|
-
.bar-area.user-is-keying .bar:focus {
|
|
988
|
+
.bar-area.user-is-keying:not(.hide-focus-ring) .bar:focus {
|
|
1001
989
|
outline: none;
|
|
1002
990
|
outline: 3px solid var(--wmcolor-interactive-focus);
|
|
1003
991
|
outline-offset: 3px;
|
|
@@ -1041,11 +1029,7 @@
|
|
|
1041
1029
|
display: flex;
|
|
1042
1030
|
align-items: center;
|
|
1043
1031
|
cursor: pointer;
|
|
1044
|
-
}
|
|
1045
|
-
.bar:focus-visible {
|
|
1046
1032
|
outline: none;
|
|
1047
|
-
outline: 3px solid var(--wmcolor-interactive-focus);
|
|
1048
|
-
outline-offset: 3px;
|
|
1049
1033
|
}
|
|
1050
1034
|
|
|
1051
1035
|
.value {
|
|
@@ -1062,7 +1046,6 @@
|
|
|
1062
1046
|
display: flex;
|
|
1063
1047
|
justify-content: space-between;
|
|
1064
1048
|
font-size: 0.75rem;
|
|
1065
|
-
margin-block-end: 0.75rem;
|
|
1066
1049
|
}
|
|
1067
1050
|
@container chart-measure (max-width: 414px) {
|
|
1068
1051
|
.x-axis .tick:not(:first-of-type):not(:last-of-type) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
-
import {
|
|
3
|
-
import { formatDisplayValue, suffixNumber, renderInstructionsText, findLargestNiceInterval, getMaxTicks, } from "../chartFunctions";
|
|
2
|
+
import { chartPalettes, } from "../../../global/interfaces";
|
|
3
|
+
import { formatDisplayValue, suffixNumber, renderInstructionsText, findLargestNiceInterval, getMaxTicks, findNiceRoundNumber, } from "../chartFunctions";
|
|
4
4
|
import { chartMessages } from "../../../global/intl";
|
|
5
5
|
import { isElOrChild } from "../../../global/functions";
|
|
6
6
|
export class ChartBar {
|
|
@@ -21,10 +21,10 @@ export class ChartBar {
|
|
|
21
21
|
var _a, _b, _c, _d;
|
|
22
22
|
let palette = ["wmcolor-dataviz-discrete-01"]; // default to single color
|
|
23
23
|
if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.colors) === "semantic") {
|
|
24
|
-
palette =
|
|
24
|
+
palette = chartPalettes.semantic;
|
|
25
25
|
}
|
|
26
26
|
else if (((_b = this.config) === null || _b === void 0 ? void 0 : _b.colors) == "discrete") {
|
|
27
|
-
palette =
|
|
27
|
+
palette = chartPalettes.discrete;
|
|
28
28
|
}
|
|
29
29
|
else if ((_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.colors) === null || _d === void 0 ? void 0 : _d.startsWith("wmcolor-")) {
|
|
30
30
|
palette = [this.config.colors];
|
|
@@ -43,6 +43,10 @@ export class ChartBar {
|
|
|
43
43
|
var _a;
|
|
44
44
|
return this.subinfo || ((_a = this.config) === null || _a === void 0 ? void 0 : _a.subinfo) || "";
|
|
45
45
|
}
|
|
46
|
+
get gridVisible() {
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
return !!this.gridInfo && ((_a = this.config) === null || _a === void 0 ? void 0 : _a.gridMax) != undefined && ((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.showGrid) !== null && _c !== void 0 ? _c : true);
|
|
49
|
+
}
|
|
46
50
|
// #endregion getters
|
|
47
51
|
////////////////////////////////////////////////////////////
|
|
48
52
|
// #region Component lifecycle
|
|
@@ -54,6 +58,9 @@ export class ChartBar {
|
|
|
54
58
|
}
|
|
55
59
|
});
|
|
56
60
|
resizeObserver.observe(this.barAreaEl);
|
|
61
|
+
if (this.config && this.data) {
|
|
62
|
+
this.processData();
|
|
63
|
+
}
|
|
57
64
|
}
|
|
58
65
|
// #endregion component lifecycle
|
|
59
66
|
////////////////////////////////////////////////////////////
|
|
@@ -63,10 +70,16 @@ export class ChartBar {
|
|
|
63
70
|
if (this.config && this.data) {
|
|
64
71
|
const itemTotal = this.data.reduce((acc, item) => acc + item.amount, 0);
|
|
65
72
|
const largest = Math.max(...this.data.map((item) => item.amount));
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
if (this.config.gridMax == "auto") {
|
|
74
|
+
this.gridMax = findNiceRoundNumber(largest);
|
|
75
|
+
}
|
|
76
|
+
else if (!!this.config.gridMax) {
|
|
77
|
+
this.gridMax = this.config.gridMax;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
// fallback to 1 and chart should not render
|
|
81
|
+
this.gridMax = 1;
|
|
82
|
+
}
|
|
70
83
|
const processedItems = this.processItems(itemTotal);
|
|
71
84
|
if (this.sort === "ascending") {
|
|
72
85
|
processedItems.sort((a, b) => a.amount - b.amount);
|
|
@@ -80,6 +93,9 @@ export class ChartBar {
|
|
|
80
93
|
}
|
|
81
94
|
processItems(itemTotal) {
|
|
82
95
|
var _a, _b;
|
|
96
|
+
if (!this.data) {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
83
99
|
const valueFormat = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.valueFormat) || "amount"; // default to amount
|
|
84
100
|
const printModeFormat = ((_b = this.config) === null || _b === void 0 ? void 0 : _b.printModeFormat) || "amount"; // default to amount
|
|
85
101
|
const defaultColor = "wmcolor-dataviz-discrete-01";
|
|
@@ -88,7 +104,7 @@ export class ChartBar {
|
|
|
88
104
|
var _a;
|
|
89
105
|
const barColor = item.color || (isUniformConfigColor ? this.colorPalette[0] : (_a = this.colorPalette[index]) !== null && _a !== void 0 ? _a : defaultColor);
|
|
90
106
|
return {
|
|
91
|
-
|
|
107
|
+
barLegend: item.barLegend,
|
|
92
108
|
amount: item.amount,
|
|
93
109
|
gridPercent: (item.amount / this.gridMax) * 100,
|
|
94
110
|
displayValue: formatDisplayValue(item.amount, itemTotal, valueFormat),
|
|
@@ -102,7 +118,7 @@ export class ChartBar {
|
|
|
102
118
|
}
|
|
103
119
|
propogateExternalLegendData() {
|
|
104
120
|
document.querySelectorAll("wm-chart-legend").forEach((legend) => {
|
|
105
|
-
if (legend.chartIds.includes(this.el.id)) {
|
|
121
|
+
if (legend.chartIds.split(" ").includes(this.el.id)) {
|
|
106
122
|
legend.processedData = this.processedData;
|
|
107
123
|
}
|
|
108
124
|
});
|
|
@@ -130,7 +146,9 @@ export class ChartBar {
|
|
|
130
146
|
switch (ev.key) {
|
|
131
147
|
case "ArrowDown":
|
|
132
148
|
ev.preventDefault();
|
|
133
|
-
this.
|
|
149
|
+
if (this.el.shadowRoot.activeElement === this.componentWrapperEl) {
|
|
150
|
+
this.focusBar(0);
|
|
151
|
+
}
|
|
134
152
|
break;
|
|
135
153
|
case "Tab":
|
|
136
154
|
this.clearFocus();
|
|
@@ -148,12 +166,10 @@ export class ChartBar {
|
|
|
148
166
|
switch (ev.key) {
|
|
149
167
|
case "ArrowUp":
|
|
150
168
|
ev.preventDefault();
|
|
151
|
-
ev.stopPropagation();
|
|
152
169
|
this.focusBar(barIdx - 1);
|
|
153
170
|
break;
|
|
154
171
|
case "ArrowDown":
|
|
155
172
|
ev.preventDefault();
|
|
156
|
-
ev.stopPropagation();
|
|
157
173
|
this.focusBar(barIdx + 1);
|
|
158
174
|
break;
|
|
159
175
|
case "Enter":
|
|
@@ -170,21 +186,15 @@ export class ChartBar {
|
|
|
170
186
|
this.highlightBar(idx);
|
|
171
187
|
}
|
|
172
188
|
}
|
|
173
|
-
|
|
189
|
+
handleLegendItemClick(ev) {
|
|
174
190
|
if (ev.target.nodeName === "WM-CHART-LEGEND") {
|
|
175
|
-
//
|
|
191
|
+
// If event from an internal legend bubbles up to the chart, ignore it
|
|
176
192
|
const legendEl = ev.target;
|
|
177
193
|
if (legendEl.chartIds.includes(this.el.id)) {
|
|
178
194
|
this.highlightBar(ev.detail.idx);
|
|
179
195
|
}
|
|
180
196
|
}
|
|
181
197
|
}
|
|
182
|
-
handleInternalLegendItemClick(ev) {
|
|
183
|
-
const legendEl = ev.target;
|
|
184
|
-
if (legendEl.chartIds.includes(this.el.id)) {
|
|
185
|
-
this.highlightBar(ev.detail.idx);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
198
|
handleDocumentClick(_ev) {
|
|
189
199
|
// Clear highlights when highlight is set from an external legend (not opening a popover)
|
|
190
200
|
if (!this.popoverEl.open) {
|
|
@@ -219,11 +229,11 @@ export class ChartBar {
|
|
|
219
229
|
y: barToFocus.getBoundingClientRect().top + cornerOffset,
|
|
220
230
|
});
|
|
221
231
|
}
|
|
222
|
-
|
|
232
|
+
handlePopoverToggled(_ev) {
|
|
223
233
|
setTimeout(() => {
|
|
224
234
|
// allow time for the popover to reopen if the click that closed it was on a bar, to prevent flash
|
|
225
235
|
if (this.popoverEl.open) {
|
|
226
|
-
this.highlightBar(this.processedData.findIndex((item) => { var _a; return item.
|
|
236
|
+
this.highlightBar(this.processedData.findIndex((item) => { var _a; return item.barLegend === ((_a = this.popoverEl.chartData) === null || _a === void 0 ? void 0 : _a.barLegend); }));
|
|
227
237
|
}
|
|
228
238
|
else {
|
|
229
239
|
this.clearHighlights();
|
|
@@ -231,12 +241,17 @@ export class ChartBar {
|
|
|
231
241
|
}, 30);
|
|
232
242
|
}
|
|
233
243
|
openPopover(clickedProcessedData, coords) {
|
|
234
|
-
|
|
244
|
+
if (!this.data || !this.config) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
let matchingChartData = this.data.find((item) => item.barLegend === clickedProcessedData.barLegend);
|
|
235
248
|
if (matchingChartData) {
|
|
249
|
+
const popoverButtonText = matchingChartData.popoverButtonText || this.config.popoverButtonText || "";
|
|
250
|
+
this.barAreaEl.classList.toggle("hide-focus-ring", !!popoverButtonText);
|
|
236
251
|
this.popoverEl.chartData = matchingChartData;
|
|
237
252
|
this.popoverEl.header = matchingChartData.popoverTitle || this.config.popoverTitle || "";
|
|
238
253
|
this.popoverEl.text = matchingChartData.popoverText || this.config.popoverText || "";
|
|
239
|
-
this.popoverEl.buttonText =
|
|
254
|
+
this.popoverEl.buttonText = popoverButtonText;
|
|
240
255
|
this.popoverEl.coords = coords;
|
|
241
256
|
window.setTimeout(() => {
|
|
242
257
|
this.popoverEl.open = true;
|
|
@@ -262,7 +277,6 @@ export class ChartBar {
|
|
|
262
277
|
clearFocus() {
|
|
263
278
|
if (this.popoverEl.open) {
|
|
264
279
|
this.popoverEl.open = false;
|
|
265
|
-
console.log("popover closed from clearFocus: ", this.popoverEl.open);
|
|
266
280
|
}
|
|
267
281
|
this.clearHighlights();
|
|
268
282
|
}
|
|
@@ -271,14 +285,17 @@ export class ChartBar {
|
|
|
271
285
|
// #region Rendering
|
|
272
286
|
////////////////////////////////////////////////////////////
|
|
273
287
|
renderBarLegends() {
|
|
274
|
-
return this.processedData.map((item) => (h("div", { key: `legend-${item.
|
|
288
|
+
return this.processedData.map((item) => (h("div", { key: `legend-${item.barLegend}`, class: "bar-legend" }, item.barLegend)));
|
|
275
289
|
}
|
|
276
290
|
renderBars() {
|
|
291
|
+
if (!this.gridInfo || !this.processedData) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
277
294
|
// Use effective grid max (numTicks * interval) for accurate bar sizing
|
|
278
295
|
const effectiveGridMax = this.gridInfo.numTicks * this.gridInfo.interval;
|
|
279
296
|
return this.processedData.map((item, idx) => {
|
|
280
297
|
const barPercent = effectiveGridMax > 0 ? (item.amount / effectiveGridMax) * 100 : 0;
|
|
281
|
-
return (h("div", { key: `bar-${item.
|
|
298
|
+
return (h("div", { key: `bar-${item.barLegend}`, class: "bar-wrapper" }, h("div", { class: "bar", style: { width: `${barPercent}%`, backgroundColor: `var(--${item.color})` }, onClick: (ev) => this.handleBarClick(ev, idx), onKeyDown: (ev) => this.handleBarKeyDown(ev, idx), tabindex: "-1", "aria-label": `${item.barLegend} ${item.displayValue}` }), h("span", { class: "value", style: { insetInlineStart: `${barPercent}%` } }, item.displayValue)));
|
|
282
299
|
});
|
|
283
300
|
}
|
|
284
301
|
renderXAxis() {
|
|
@@ -287,17 +304,19 @@ export class ChartBar {
|
|
|
287
304
|
_a.tickLabels.map((label) => (h("div", { class: "tick", key: label }, h("span", null, label))))));
|
|
288
305
|
}
|
|
289
306
|
renderGrid() {
|
|
290
|
-
|
|
307
|
+
var _a;
|
|
308
|
+
const backgroundSize = (_a = this.gridInfo) === null || _a === void 0 ? void 0 : _a.backgroundSize;
|
|
309
|
+
return h("div", { class: "grid-lines", style: { "--background-size": backgroundSize } });
|
|
291
310
|
}
|
|
292
311
|
renderLegend(orientation) {
|
|
293
312
|
var _a, _b, _c;
|
|
294
|
-
return (h("div", { class: `legend --${orientation} --${this.showLegend}` }, h("wm-chart-legend", { orientation: orientation, chartIds: this.el.id, processedData: this.processedData, printMode: (_c = (_a = this.printMode) !== null && _a !== void 0 ? _a : (_b = this.config) === null || _b === void 0 ? void 0 : _b.printMode) !== null && _c !== void 0 ? _c : false, onWmLegendItemClick: (ev) => this.
|
|
313
|
+
return (h("div", { class: `legend --${orientation} --${this.showLegend}` }, h("wm-chart-legend", { orientation: orientation, chartIds: this.el.id, processedData: this.processedData, printMode: (_c = (_a = this.printMode) !== null && _a !== void 0 ? _a : (_b = this.config) === null || _b === void 0 ? void 0 : _b.printMode) !== null && _c !== void 0 ? _c : false, onWmLegendItemClick: (ev) => this.handleLegendItemClick(ev) })));
|
|
295
314
|
}
|
|
296
315
|
// #endregion rendering
|
|
297
316
|
render() {
|
|
298
317
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
299
318
|
const rowCount = this.processedData.length || 1;
|
|
300
|
-
return (h(Host, { key: '
|
|
319
|
+
return (h(Host, { key: 'ad0daf61aaea04e629067a42e7902af1fa7793e1' }, h("div", { key: 'fd3bc76698192a61e72e9917cfcd359e3f602a73', ref: (el) => (this.componentWrapperEl = el), class: "component-wrapper", tabindex: "0", role: "application", onKeyDown: (ev) => this.handleChartKeyDown(ev), onBlur: (ev) => this.handleComponentBlur(ev), "aria-roledescription": chartMessages.interactiveChart, "aria-describedby": "chart-instructions", "aria-label": (_a = this.config) === null || _a === void 0 ? void 0 : _a.label }, h("div", { key: 'eeb46c231b1d6d12617fd5e83791cec5bb79df50', class: "popover-wrapper" }, h("priv-chart-popover", { key: '77cceb950026b5b380d124bcc13a0c3afd14d4c0', ref: (el) => (this.popoverEl = el), onIntChartPopoverToggled: (ev) => this.handlePopoverToggled(ev) })), ((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.showLabel) !== null && _c !== void 0 ? _c : true) && (h("label", { key: '7dce85fa4c245428136a69f22e4414327a4c57be', id: "label", class: "label" }, h("span", { key: 'f597b928ec6ed8bb79ec97639f4dcfd50f4eb0ee', class: "label-text" }, (_d = this.config) === null || _d === void 0 ? void 0 : _d.label), this.subinfoText ? h("span", { class: "subinfo" }, this.subinfoText) : "")), this.showLegend === "top" && this.renderLegend("horizontal"), h("div", { key: 'adcbae45a652a10a1c503f9e0f4206db8e21ecec', class: "chart-wrapper" }, h("div", { key: '621189bd233e10bd525c1ea1fd313f1086fbe075', class: "chart-left-side" }, this.showLegend === "left" && this.renderLegend("vertical"), h("div", { key: 'cc695fe64ea268e8dd7c534f27c21c4bfae0652e', class: "category-axis-label" }, h("span", { key: 'c43829bef211aa9b22d0ba572fbacb858e13153e', class: "axis-label-text" }, (_e = this.config) === null || _e === void 0 ? void 0 : _e.categoryAxisLabel))), h("div", { key: 'e2d015e2c849ff4adad1b77b6a2ffe2af0ec2a13', class: "chart-center" }, h("div", { key: 'c69b6ee334a3804af619514beb75ba70d660f59e', class: "chart-area", style: { "--row-count": rowCount.toString() } }, this.processedData && this.renderBarLegends(), h("div", { key: '32bbe7336101b67c563b8467d4adc435d01a4081', class: `bar-area ${this.isKeying ? "user-is-keying" : ""}`, ref: (el) => (this.barAreaEl = el) }, this.gridVisible && this.renderGrid(), ((_f = this.config) === null || _f === void 0 ? void 0 : _f.gridMax) != undefined && this.renderBars())), h("div", { key: 'f9ea11600bacd3de8745740a0e2344e141da677d', class: "value-axis-label" }, h("span", { key: '0b3d471ec3058861b85f710effcd4381bb872f77', class: "axis-label-text" }, (_g = this.config) === null || _g === void 0 ? void 0 : _g.valueAxisLabel)), this.gridVisible && this.renderXAxis()), h("div", { key: '5112a121dcc755eafa13e0ac5628a7562a4a6f9b', class: "chart-right-side" }, this.showLegend === "right" && this.renderLegend("vertical"))), this.showLegend === "bottom" && this.renderLegend("horizontal"), renderInstructionsText())));
|
|
301
320
|
}
|
|
302
321
|
static get is() { return "wm-chart-bar"; }
|
|
303
322
|
static get encapsulation() { return "shadow"; }
|
|
@@ -318,7 +337,7 @@ export class ChartBar {
|
|
|
318
337
|
"mutable": false,
|
|
319
338
|
"complexType": {
|
|
320
339
|
"original": "ChartConfig",
|
|
321
|
-
"resolved": "undefined | { label: string;
|
|
340
|
+
"resolved": "undefined | { label: string; showLabel: boolean; valueAxisLabel: string; categoryAxisLabel: string; printMode: boolean; printModeFormat: \"amount\" | \"percentage\"; gridMax: number | \"auto\"; sort?: \"ascending\" | \"descending\" | \"none\" | undefined; showLegend?: \"top\" | \"bottom\" | \"left\" | \"right\" | \"none\" | undefined; showGrid?: boolean | undefined; subinfo?: string | undefined; valueFormat?: \"amount\" | \"percentage\" | \"none\" | undefined; colors?: string | undefined; popoverTitle?: string | undefined; popoverText?: string | undefined; popoverButtonText?: string | undefined; }",
|
|
322
341
|
"references": {
|
|
323
342
|
"ChartConfig": {
|
|
324
343
|
"location": "import",
|
|
@@ -432,7 +451,7 @@ export class ChartBar {
|
|
|
432
451
|
static get listeners() {
|
|
433
452
|
return [{
|
|
434
453
|
"name": "wmLegendItemClick",
|
|
435
|
-
"method": "
|
|
454
|
+
"method": "handleLegendItemClick",
|
|
436
455
|
"target": "document",
|
|
437
456
|
"capture": false,
|
|
438
457
|
"passive": false
|
|
@@ -448,18 +467,6 @@ export class ChartBar {
|
|
|
448
467
|
"target": "window",
|
|
449
468
|
"capture": false,
|
|
450
469
|
"passive": false
|
|
451
|
-
}, {
|
|
452
|
-
"name": "wmUserIsTabbing",
|
|
453
|
-
"method": "handleUserIsKeying",
|
|
454
|
-
"target": "window",
|
|
455
|
-
"capture": false,
|
|
456
|
-
"passive": false
|
|
457
|
-
}, {
|
|
458
|
-
"name": "wmUserIsNotKeying",
|
|
459
|
-
"method": "handleUserIsNotKeying",
|
|
460
|
-
"target": "window",
|
|
461
|
-
"capture": false,
|
|
462
|
-
"passive": false
|
|
463
470
|
}, {
|
|
464
471
|
"name": "wmUserIsNotTabbing",
|
|
465
472
|
"method": "handleUserIsNotKeying",
|
|
@@ -7,7 +7,7 @@ export class ChartLegend {
|
|
|
7
7
|
this.printMode = false;
|
|
8
8
|
}
|
|
9
9
|
handleChartBarHighlighted(ev) {
|
|
10
|
-
if (this.chartIds.includes(ev.target.id)) {
|
|
10
|
+
if (this.chartIds.split(" ").includes(ev.target.id)) {
|
|
11
11
|
this.highlightLegendItem(ev.detail.idx);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -26,10 +26,10 @@ export class ChartLegend {
|
|
|
26
26
|
this.wmLegendItemClick.emit({ idx: idx });
|
|
27
27
|
}
|
|
28
28
|
renderLegendItems() {
|
|
29
|
-
return this.processedData.map((item, idx) => (h("div", { class: "legend-item", key: item.
|
|
29
|
+
return this.processedData.map((item, idx) => (h("div", { class: "legend-item", key: item.barLegend, onClick: () => this.handleLegendItemClick(idx) }, h("div", { class: "color", style: { "--color": `var(--${item.color})` } }), h("div", { class: "label" }, item.barLegend), h("span", { class: `print-value ${this.printMode ? "force-visible" : ""}` }, "(", item.printValue, ")"))));
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
|
-
return (h(Host, { key: '
|
|
32
|
+
return (h(Host, { key: 'f8c8c56e0a679b0f8ba7cb3af815276cb766b2fc' }, h("div", { key: '29ab0bebb0e7489a822da43959f08ba5848344e4', class: `legend-container --${this.orientation}`, "aria-hidden": "true" }, this.renderLegendItems())));
|
|
33
33
|
}
|
|
34
34
|
static get is() { return "wm-chart-legend"; }
|
|
35
35
|
static get encapsulation() { return "shadow"; }
|