@refinitiv-ui/elements 7.0.0-next.0 → 7.0.0-next.1
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/CHANGELOG.md +115 -0
- package/cli.mjs +21 -0
- package/lib/accordion/index.js +1 -10
- package/lib/appstate-bar/custom-elements.json +2 -2
- package/lib/appstate-bar/custom-elements.md +4 -4
- package/lib/appstate-bar/index.d.ts +2 -2
- package/lib/appstate-bar/index.js +2 -8
- package/lib/appstate-bar/themes/halo/dark/index.js +1 -1
- package/lib/appstate-bar/themes/halo/light/index.js +1 -1
- package/lib/appstate-bar/themes/solar/charcoal/index.js +1 -1
- package/lib/appstate-bar/themes/solar/pearl/index.js +1 -1
- package/lib/autosuggest/custom-elements.json +8 -8
- package/lib/autosuggest/custom-elements.md +8 -8
- package/lib/autosuggest/helpers/types.d.ts +18 -18
- package/lib/autosuggest/index.d.ts +9 -32
- package/lib/autosuggest/index.js +112 -187
- package/lib/autosuggest/themes/halo/dark/index.js +1 -1
- package/lib/autosuggest/themes/halo/light/index.js +1 -1
- package/lib/autosuggest/themes/solar/charcoal/index.js +1 -1
- package/lib/autosuggest/themes/solar/pearl/index.js +1 -1
- package/lib/button/custom-elements.json +1 -1
- package/lib/button/custom-elements.md +1 -1
- package/lib/button/index.d.ts +1 -1
- package/lib/button/index.js +1 -1
- package/lib/button/themes/halo/dark/index.js +2 -1
- package/lib/button/themes/halo/light/index.js +2 -1
- package/lib/button/themes/solar/charcoal/index.js +2 -1
- package/lib/button/themes/solar/pearl/index.js +2 -1
- package/lib/button-bar/index.js +0 -5
- package/lib/calendar/custom-elements.json +2 -2
- package/lib/calendar/custom-elements.md +4 -4
- package/lib/calendar/index.d.ts +9 -2
- package/lib/calendar/index.js +27 -29
- package/lib/calendar/themes/halo/dark/index.js +1 -1
- package/lib/calendar/themes/halo/light/index.js +1 -1
- package/lib/calendar/themes/solar/charcoal/index.js +1 -1
- package/lib/calendar/themes/solar/pearl/index.js +1 -1
- package/lib/calendar/types.d.ts +5 -5
- package/lib/calendar/utils.d.ts +2 -13
- package/lib/calendar/utils.js +2 -20
- package/lib/canvas/custom-elements.json +1 -1
- package/lib/canvas/custom-elements.md +1 -1
- package/lib/canvas/index.d.ts +1 -1
- package/lib/canvas/index.js +10 -9
- package/lib/card/custom-elements.json +1 -1
- package/lib/card/custom-elements.md +3 -3
- package/lib/card/helpers/types.d.ts +1 -1
- package/lib/card/index.d.ts +2 -1
- package/lib/card/index.js +5 -4
- package/lib/card/themes/halo/dark/index.js +1 -1
- package/lib/card/themes/halo/light/index.js +1 -1
- package/lib/card/themes/solar/charcoal/index.js +1 -1
- package/lib/card/themes/solar/pearl/index.js +1 -1
- package/lib/chart/bare.d.ts +1 -0
- package/lib/chart/bare.js +1 -0
- package/lib/chart/custom-elements.json +10 -5
- package/lib/chart/custom-elements.md +9 -8
- package/lib/chart/elements/chart.d.ts +182 -0
- package/lib/chart/elements/chart.js +509 -0
- package/lib/chart/helpers/index.d.ts +1 -1
- package/lib/chart/helpers/index.js +1 -1
- package/lib/chart/helpers/merge.d.ts +3 -3
- package/lib/chart/helpers/merge.js +1 -1
- package/lib/chart/helpers/types.d.ts +1 -66
- package/lib/chart/index.d.ts +1 -192
- package/lib/chart/index.js +5 -485
- package/lib/chart/plugins/doughnut-center-label.d.ts +22 -3
- package/lib/chart/plugins/doughnut-center-label.js +62 -51
- package/lib/chart/plugins/index.d.ts +1 -0
- package/lib/chart/plugins/index.js +1 -0
- package/lib/chart/themes/halo/dark/index.js +1 -1
- package/lib/chart/themes/halo/light/index.js +1 -1
- package/lib/chart/themes/solar/charcoal/index.js +1 -1
- package/lib/chart/themes/solar/pearl/index.js +1 -1
- package/lib/checkbox/custom-elements.json +1 -1
- package/lib/checkbox/custom-elements.md +3 -3
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/checkbox/index.js +1 -2
- package/lib/checkbox/themes/halo/dark/index.js +1 -1
- package/lib/checkbox/themes/halo/light/index.js +1 -1
- package/lib/checkbox/themes/solar/charcoal/index.js +1 -1
- package/lib/checkbox/themes/solar/pearl/index.js +1 -1
- package/lib/clock/custom-elements.json +2 -2
- package/lib/clock/custom-elements.md +2 -2
- package/lib/clock/index.d.ts +2 -2
- package/lib/clock/index.js +2 -6
- package/lib/clock/utils/TickManager.d.ts +1 -1
- package/lib/collapse/custom-elements.json +1 -1
- package/lib/collapse/custom-elements.md +3 -3
- package/lib/collapse/index.d.ts +7 -1
- package/lib/collapse/index.js +27 -30
- package/lib/collapse/themes/halo/dark/index.js +1 -1
- package/lib/collapse/themes/halo/light/index.js +1 -1
- package/lib/collapse/themes/solar/charcoal/index.js +1 -1
- package/lib/collapse/themes/solar/pearl/index.js +1 -1
- package/lib/color-dialog/custom-elements.json +2 -2
- package/lib/color-dialog/custom-elements.md +4 -4
- package/lib/color-dialog/helpers/value-model.js +4 -5
- package/lib/color-dialog/index.d.ts +4 -4
- package/lib/color-dialog/index.js +4 -4
- package/lib/color-picker/custom-elements.json +1 -1
- package/lib/color-picker/custom-elements.md +3 -3
- package/lib/color-picker/index.d.ts +1 -1
- package/lib/color-picker/index.js +3 -5
- package/lib/combo-box/custom-elements.json +3 -6
- package/lib/combo-box/custom-elements.md +5 -6
- package/lib/combo-box/helpers/types.d.ts +2 -2
- package/lib/combo-box/index.d.ts +3 -12
- package/lib/combo-box/index.js +15 -30
- package/lib/combo-box/themes/halo/dark/index.js +2 -1
- package/lib/combo-box/themes/halo/light/index.js +2 -1
- package/lib/combo-box/themes/solar/charcoal/index.js +2 -1
- package/lib/combo-box/themes/solar/pearl/index.js +2 -1
- package/lib/counter/themes/halo/dark/index.js +2 -1
- package/lib/counter/themes/halo/light/index.js +2 -1
- package/lib/counter/themes/solar/charcoal/index.js +2 -1
- package/lib/counter/themes/solar/pearl/index.js +2 -1
- package/lib/datetime-field/index.d.ts +2 -2
- package/lib/datetime-field/index.js +7 -12
- package/lib/datetime-field/types.d.ts +3 -3
- package/lib/datetime-field/utils.d.ts +2 -2
- package/lib/datetime-field/utils.js +2 -2
- package/lib/datetime-picker/custom-elements.json +4 -4
- package/lib/datetime-picker/custom-elements.md +4 -4
- package/lib/datetime-picker/index.d.ts +4 -4
- package/lib/datetime-picker/index.js +9 -13
- package/lib/datetime-picker/themes/halo/dark/index.js +2 -1
- package/lib/datetime-picker/themes/halo/light/index.js +2 -1
- package/lib/datetime-picker/themes/solar/charcoal/index.js +2 -1
- package/lib/datetime-picker/themes/solar/pearl/index.js +2 -1
- package/lib/datetime-picker/types.d.ts +1 -1
- package/lib/dialog/custom-elements.json +2 -13
- package/lib/dialog/custom-elements.md +4 -5
- package/lib/dialog/index.d.ts +11 -43
- package/lib/dialog/index.js +21 -80
- package/lib/dialog/themes/halo/dark/index.js +1 -1
- package/lib/dialog/themes/halo/light/index.js +1 -1
- package/lib/dialog/themes/solar/charcoal/index.js +1 -1
- package/lib/dialog/themes/solar/pearl/index.js +1 -1
- package/lib/email-field/custom-elements.json +3 -3
- package/lib/email-field/custom-elements.md +5 -5
- package/lib/email-field/index.d.ts +3 -3
- package/lib/email-field/index.js +5 -4
- package/lib/email-field/themes/halo/dark/index.js +2 -1
- package/lib/email-field/themes/halo/light/index.js +2 -1
- package/lib/email-field/themes/solar/charcoal/index.js +2 -1
- package/lib/email-field/themes/solar/pearl/index.js +2 -1
- package/lib/events.d.ts +13 -13
- package/lib/flag/custom-elements.json +2 -14
- package/lib/flag/custom-elements.md +3 -6
- package/lib/flag/index.d.ts +21 -9
- package/lib/flag/index.js +43 -24
- package/lib/header/themes/halo/dark/index.js +1 -1
- package/lib/header/themes/halo/light/index.js +1 -1
- package/lib/header/themes/solar/charcoal/index.js +1 -1
- package/lib/header/themes/solar/pearl/index.js +1 -1
- package/lib/heatmap/helpers/color.js +2 -1
- package/lib/heatmap/helpers/text.d.ts +1 -1
- package/lib/heatmap/helpers/text.js +1 -1
- package/lib/heatmap/helpers/types.d.ts +7 -7
- package/lib/heatmap/index.js +156 -140
- package/lib/icon/custom-elements.json +0 -13
- package/lib/icon/custom-elements.md +0 -1
- package/lib/icon/index.d.ts +20 -2
- package/lib/icon/index.js +41 -14
- package/lib/icon/themes/halo/dark/index.js +1 -1
- package/lib/icon/themes/halo/light/index.js +1 -1
- package/lib/icon/themes/solar/charcoal/index.js +1 -1
- package/lib/icon/themes/solar/pearl/index.js +1 -1
- package/lib/interactive-chart/custom-elements.json +1 -1
- package/lib/interactive-chart/custom-elements.md +3 -3
- package/lib/interactive-chart/helpers/merge.d.ts +2 -2
- package/lib/interactive-chart/helpers/types.d.ts +7 -7
- package/lib/interactive-chart/index.d.ts +1 -1
- package/lib/interactive-chart/index.js +5 -3
- package/lib/item/custom-elements.json +4 -4
- package/lib/item/custom-elements.md +2 -2
- package/lib/item/helpers/types.d.ts +2 -2
- package/lib/item/index.d.ts +2 -1
- package/lib/item/index.js +2 -1
- package/lib/item/themes/halo/dark/index.js +1 -1
- package/lib/item/themes/halo/light/index.js +1 -1
- package/lib/item/themes/solar/charcoal/index.js +1 -1
- package/lib/item/themes/solar/pearl/index.js +1 -1
- package/lib/label/index.js +9 -34
- package/lib/layout/index.js +0 -13
- package/lib/led-gauge/index.js +7 -7
- package/lib/list/custom-elements.json +1 -1
- package/lib/list/custom-elements.md +3 -3
- package/lib/list/elements/list.d.ts +1 -1
- package/lib/list/elements/list.js +4 -8
- package/lib/list/helpers/renderer.d.ts +0 -4
- package/lib/list/helpers/renderer.js +5 -5
- package/lib/list/helpers/types.d.ts +1 -1
- package/lib/list/themes/halo/dark/index.js +2 -2
- package/lib/list/themes/halo/light/index.js +2 -2
- package/lib/list/themes/solar/charcoal/index.js +2 -2
- package/lib/list/themes/solar/pearl/index.js +2 -2
- package/lib/multi-input/custom-elements.json +5 -5
- package/lib/multi-input/custom-elements.md +5 -5
- package/lib/multi-input/helpers/types.d.ts +3 -3
- package/lib/multi-input/index.d.ts +5 -17
- package/lib/multi-input/index.js +8 -21
- package/lib/multi-input/themes/halo/dark/index.js +1 -1
- package/lib/multi-input/themes/halo/light/index.js +1 -1
- package/lib/multi-input/themes/solar/charcoal/index.js +1 -1
- package/lib/multi-input/themes/solar/pearl/index.js +1 -1
- package/lib/notification/custom-elements.json +2 -2
- package/lib/notification/custom-elements.md +4 -4
- package/lib/notification/elements/notification.d.ts +2 -2
- package/lib/notification/elements/notification.js +2 -2
- package/lib/notification/helpers/types.d.ts +2 -2
- package/lib/number-field/custom-elements.json +2 -2
- package/lib/number-field/custom-elements.md +4 -4
- package/lib/number-field/index.d.ts +4 -4
- package/lib/number-field/index.js +24 -19
- package/lib/number-field/themes/halo/dark/index.js +2 -1
- package/lib/number-field/themes/halo/light/index.js +2 -1
- package/lib/number-field/themes/solar/charcoal/index.js +2 -1
- package/lib/number-field/themes/solar/pearl/index.js +2 -1
- package/lib/overlay/custom-elements.json +6 -9
- package/lib/overlay/custom-elements.md +7 -8
- package/lib/overlay/elements/overlay-backdrop.d.ts +1 -8
- package/lib/overlay/elements/overlay-backdrop.js +3 -13
- package/lib/overlay/elements/overlay-viewport.d.ts +1 -8
- package/lib/overlay/elements/overlay-viewport.js +3 -13
- package/lib/overlay/elements/overlay.d.ts +7 -15
- package/lib/overlay/elements/overlay.js +13 -55
- package/lib/overlay/helpers/types.d.ts +13 -13
- package/lib/overlay/managers/close-manager.d.ts +1 -1
- package/lib/overlay/managers/close-manager.js +6 -4
- package/lib/overlay/managers/focus-manager.js +2 -1
- package/lib/overlay/managers/interaction-lock-manager.js +1 -1
- package/lib/overlay/managers/viewport-manager.js +3 -0
- package/lib/overlay/managers/zindex-manager.d.ts +1 -1
- package/lib/overlay/managers/zindex-manager.js +1 -1
- package/lib/overlay/themes/halo/dark/index.js +1 -1
- package/lib/overlay/themes/halo/light/index.js +1 -1
- package/lib/overlay/themes/solar/charcoal/index.js +1 -1
- package/lib/overlay/themes/solar/pearl/index.js +1 -1
- package/lib/overlay-menu/custom-elements.json +2 -2
- package/lib/overlay-menu/custom-elements.md +2 -2
- package/lib/overlay-menu/helpers/types.d.ts +2 -2
- package/lib/overlay-menu/index.d.ts +2 -2
- package/lib/overlay-menu/index.js +36 -42
- package/lib/overlay-menu/managers/menu-manager.d.ts +0 -1
- package/lib/overlay-menu/managers/menu-manager.js +1 -5
- package/lib/overlay-menu/themes/halo/dark/index.js +1 -1
- package/lib/overlay-menu/themes/halo/light/index.js +1 -1
- package/lib/overlay-menu/themes/solar/charcoal/index.js +1 -1
- package/lib/overlay-menu/themes/solar/pearl/index.js +1 -1
- package/lib/pagination/custom-elements.json +1 -1
- package/lib/pagination/custom-elements.md +3 -3
- package/lib/pagination/index.d.ts +1 -2
- package/lib/pagination/index.js +3 -7
- package/lib/pagination/themes/halo/dark/index.js +1 -1
- package/lib/pagination/themes/halo/light/index.js +1 -1
- package/lib/pagination/themes/solar/charcoal/index.js +1 -1
- package/lib/pagination/themes/solar/pearl/index.js +1 -1
- package/lib/password-field/custom-elements.json +2 -6
- package/lib/password-field/custom-elements.md +4 -5
- package/lib/password-field/index.d.ts +2 -3
- package/lib/password-field/index.js +2 -3
- package/lib/password-field/themes/halo/dark/index.js +2 -1
- package/lib/password-field/themes/halo/light/index.js +2 -1
- package/lib/password-field/themes/solar/charcoal/index.js +2 -1
- package/lib/password-field/themes/solar/pearl/index.js +2 -1
- package/lib/pill/custom-elements.json +1 -1
- package/lib/pill/custom-elements.md +3 -3
- package/lib/pill/index.d.ts +1 -1
- package/lib/pill/index.js +2 -2
- package/lib/pill/themes/halo/dark/index.js +2 -1
- package/lib/pill/themes/halo/light/index.js +2 -1
- package/lib/pill/themes/solar/charcoal/index.js +2 -1
- package/lib/pill/themes/solar/pearl/index.js +2 -1
- package/lib/radio-button/custom-elements.json +1 -1
- package/lib/radio-button/custom-elements.md +3 -3
- package/lib/radio-button/index.d.ts +1 -1
- package/lib/radio-button/index.js +1 -6
- package/lib/radio-button/themes/halo/dark/index.js +1 -1
- package/lib/radio-button/themes/halo/light/index.js +1 -1
- package/lib/radio-button/themes/solar/charcoal/index.js +1 -1
- package/lib/radio-button/themes/solar/pearl/index.js +1 -1
- package/lib/rating/custom-elements.json +1 -1
- package/lib/rating/custom-elements.md +3 -3
- package/lib/rating/index.d.ts +1 -1
- package/lib/rating/index.js +1 -5
- package/lib/search-field/custom-elements.json +3 -3
- package/lib/search-field/custom-elements.md +5 -5
- package/lib/search-field/index.d.ts +3 -3
- package/lib/search-field/index.js +6 -7
- package/lib/search-field/themes/halo/dark/index.js +2 -1
- package/lib/search-field/themes/halo/light/index.js +2 -1
- package/lib/search-field/themes/solar/charcoal/index.js +2 -1
- package/lib/search-field/themes/solar/pearl/index.js +2 -1
- package/lib/select/custom-elements.json +2 -2
- package/lib/select/custom-elements.md +4 -4
- package/lib/select/helpers/types.d.ts +2 -2
- package/lib/select/index.d.ts +2 -2
- package/lib/select/index.js +15 -20
- package/lib/select/themes/halo/dark/index.js +2 -1
- package/lib/select/themes/halo/light/index.js +2 -1
- package/lib/select/themes/solar/charcoal/index.js +2 -1
- package/lib/select/themes/solar/pearl/index.js +2 -1
- package/lib/sidebar-layout/index.js +2 -3
- package/lib/sidebar-layout/themes/halo/dark/index.js +1 -1
- package/lib/sidebar-layout/themes/halo/light/index.js +1 -1
- package/lib/sidebar-layout/themes/solar/charcoal/index.js +1 -1
- package/lib/sidebar-layout/themes/solar/pearl/index.js +1 -1
- package/lib/slider/custom-elements.json +3 -3
- package/lib/slider/custom-elements.md +5 -5
- package/lib/slider/index.d.ts +3 -3
- package/lib/slider/index.js +117 -111
- package/lib/swing-gauge/types.d.ts +1 -1
- package/lib/tab/custom-elements.json +1 -1
- package/lib/tab/custom-elements.md +3 -3
- package/lib/tab/index.d.ts +1 -1
- package/lib/tab/index.js +1 -1
- package/lib/tab/themes/halo/dark/index.js +1 -1
- package/lib/tab/themes/halo/light/index.js +1 -1
- package/lib/tab/themes/solar/charcoal/index.js +1 -1
- package/lib/tab/themes/solar/pearl/index.js +1 -1
- package/lib/tab-bar/custom-elements.json +1 -1
- package/lib/tab-bar/custom-elements.md +3 -3
- package/lib/tab-bar/index.d.ts +1 -1
- package/lib/tab-bar/index.js +1 -5
- package/lib/tab-bar/themes/halo/dark/index.js +1 -1
- package/lib/tab-bar/themes/halo/light/index.js +1 -1
- package/lib/text-field/custom-elements.json +3 -3
- package/lib/text-field/custom-elements.md +5 -5
- package/lib/text-field/index.d.ts +4 -10
- package/lib/text-field/index.js +11 -26
- package/lib/text-field/themes/halo/dark/index.js +2 -1
- package/lib/text-field/themes/halo/light/index.js +2 -1
- package/lib/text-field/themes/solar/charcoal/index.js +2 -1
- package/lib/text-field/themes/solar/pearl/index.js +2 -1
- package/lib/time-picker/custom-elements.json +1 -1
- package/lib/time-picker/custom-elements.md +3 -3
- package/lib/time-picker/index.d.ts +1 -1
- package/lib/time-picker/index.js +19 -20
- package/lib/time-picker/themes/halo/dark/index.js +2 -1
- package/lib/time-picker/themes/halo/light/index.js +2 -1
- package/lib/time-picker/themes/solar/charcoal/index.js +2 -1
- package/lib/time-picker/themes/solar/pearl/index.js +2 -1
- package/lib/toggle/custom-elements.json +1 -1
- package/lib/toggle/custom-elements.md +3 -3
- package/lib/toggle/index.d.ts +1 -1
- package/lib/toggle/index.js +2 -5
- package/lib/toggle/themes/halo/dark/index.js +1 -1
- package/lib/toggle/themes/halo/light/index.js +1 -1
- package/lib/toggle/themes/solar/charcoal/index.js +1 -1
- package/lib/toggle/themes/solar/pearl/index.js +1 -1
- package/lib/tooltip/elements/tooltip-element.js +1 -1
- package/lib/tooltip/helpers/types.d.ts +10 -10
- package/lib/tooltip/index.js +5 -4
- package/lib/tooltip/managers/tooltip-manager.js +2 -5
- package/lib/tornado-chart/elements/tornado-item.js +8 -9
- package/lib/tornado-chart/themes/halo/dark/index.js +2 -2
- package/lib/tornado-chart/themes/halo/light/index.js +2 -2
- package/lib/tornado-chart/themes/solar/charcoal/index.js +1 -1
- package/lib/tornado-chart/themes/solar/pearl/index.js +1 -1
- package/lib/tree/custom-elements.json +2 -2
- package/lib/tree/custom-elements.md +2 -2
- package/lib/tree/elements/tree.d.ts +2 -2
- package/lib/tree/elements/tree.js +2 -4
- package/lib/tree/helpers/renderer.d.ts +0 -4
- package/lib/tree/helpers/renderer.js +5 -5
- package/lib/tree/helpers/types.d.ts +2 -2
- package/lib/tree/themes/halo/dark/index.js +2 -2
- package/lib/tree/themes/halo/light/index.js +2 -2
- package/lib/tree/themes/solar/charcoal/index.js +2 -2
- package/lib/tree/themes/solar/pearl/index.js +2 -2
- package/lib/tree-select/custom-elements.json +7 -7
- package/lib/tree-select/custom-elements.md +7 -7
- package/lib/tree-select/helpers/types.d.ts +2 -2
- package/lib/tree-select/index.d.ts +5 -6
- package/lib/tree-select/index.js +23 -23
- package/lib/tree-select/themes/halo/dark/index.js +2 -1
- package/lib/tree-select/themes/halo/light/index.js +2 -1
- package/lib/tree-select/themes/solar/charcoal/index.js +2 -1
- package/lib/tree-select/themes/solar/pearl/index.js +2 -1
- package/lib/version.js +1 -1
- package/package.json +32 -30
- package/lib/chart/helpers/legend.d.ts +0 -5
- package/lib/chart/helpers/legend.js +0 -78
package/lib/heatmap/index.js
CHANGED
|
@@ -11,130 +11,14 @@ import '../tooltip/index.js';
|
|
|
11
11
|
import { Track } from './helpers/track.js';
|
|
12
12
|
import { blend, brighten, darken, isLight, interpolate } from './helpers/color.js';
|
|
13
13
|
import { getResponsiveFontSize, getMaximumTextWidth, MIN_FONT_SIZE } from './helpers/text.js';
|
|
14
|
-
const
|
|
14
|
+
const CELL_PADDING = 0.12;
|
|
15
|
+
const CELL_MAX_TEXT_WIDTH = 1 - CELL_PADDING;
|
|
15
16
|
const DEFAULT_CANVAS_RATIO = 0.75; // ratio — 4:3
|
|
16
17
|
/**
|
|
17
18
|
* A graphical representation of data where the individual
|
|
18
19
|
* values contained in a matrix are represented as colors
|
|
19
20
|
*/
|
|
20
21
|
let Heatmap = class Heatmap extends ResponsiveElement {
|
|
21
|
-
constructor() {
|
|
22
|
-
super();
|
|
23
|
-
/**
|
|
24
|
-
* Heatmap configuration options.
|
|
25
|
-
* @type {HeatmapConfig}
|
|
26
|
-
*/
|
|
27
|
-
this.config = null;
|
|
28
|
-
/**
|
|
29
|
-
* Number of maximum label width that cell can paint in pixel.
|
|
30
|
-
* e.g. label-width: 30px; cell label hides when text length reaches 30px.
|
|
31
|
-
*/
|
|
32
|
-
this.labelWidth = 0;
|
|
33
|
-
/**
|
|
34
|
-
* Hide all labels in the cells
|
|
35
|
-
*/
|
|
36
|
-
this.labelHidden = false;
|
|
37
|
-
/**
|
|
38
|
-
* Hide all axes
|
|
39
|
-
*/
|
|
40
|
-
this.axisHidden = false;
|
|
41
|
-
/**
|
|
42
|
-
* Minimum point of the cell coloring
|
|
43
|
-
*/
|
|
44
|
-
this.minPoint = -1;
|
|
45
|
-
/**
|
|
46
|
-
* Middle point of the cell coloring
|
|
47
|
-
*/
|
|
48
|
-
this.midPoint = 0;
|
|
49
|
-
/**
|
|
50
|
-
* Maximum point of the cell coloring
|
|
51
|
-
*/
|
|
52
|
-
this.maxPoint = 1;
|
|
53
|
-
/**
|
|
54
|
-
* Enable cell color blending
|
|
55
|
-
*/
|
|
56
|
-
this.blend = false;
|
|
57
|
-
/**
|
|
58
|
-
* Cell minimum color saturation, value can be from 0 - 1
|
|
59
|
-
*/
|
|
60
|
-
this.saturation = 0.4;
|
|
61
|
-
/**
|
|
62
|
-
* Current active cell
|
|
63
|
-
*/
|
|
64
|
-
this._hoverCell = null;
|
|
65
|
-
/**
|
|
66
|
-
* Internal cells data storage
|
|
67
|
-
*/
|
|
68
|
-
this.cells = [];
|
|
69
|
-
/**
|
|
70
|
-
* Canvas's font color according to theme
|
|
71
|
-
*/
|
|
72
|
-
this.foregroundColor = '';
|
|
73
|
-
/**
|
|
74
|
-
* Canvas's background color according to theme
|
|
75
|
-
*/
|
|
76
|
-
this.backgroundColor = '';
|
|
77
|
-
/**
|
|
78
|
-
* Row cells track for easier calculations
|
|
79
|
-
*/
|
|
80
|
-
this.rowTrack = new Track();
|
|
81
|
-
/**
|
|
82
|
-
* Column cells track for easier calculations
|
|
83
|
-
*/
|
|
84
|
-
this.colTrack = new Track();
|
|
85
|
-
/**
|
|
86
|
-
* A flag to check if calculated responsive height it been set.
|
|
87
|
-
*/
|
|
88
|
-
this.responsiveHeight = false;
|
|
89
|
-
/**
|
|
90
|
-
* A flag to check if the component has a size.
|
|
91
|
-
*/
|
|
92
|
-
this.isSizeCalculated = false;
|
|
93
|
-
/**
|
|
94
|
-
* Use to prevent resizes observer in certain use cases
|
|
95
|
-
*/
|
|
96
|
-
this.updateTimer = 0;
|
|
97
|
-
/**
|
|
98
|
-
* Use to throttle heatmap painting
|
|
99
|
-
*/
|
|
100
|
-
this.renderTask = new MicroTaskRunner();
|
|
101
|
-
/**
|
|
102
|
-
* A flag to check if the cell has header enable.
|
|
103
|
-
*/
|
|
104
|
-
this.hasCellHeader = false;
|
|
105
|
-
/**
|
|
106
|
-
* A flag to check if cell's content is within its boundary
|
|
107
|
-
*/
|
|
108
|
-
this.contentWithinCellBoundary = true;
|
|
109
|
-
/**
|
|
110
|
-
* Margin around each cell
|
|
111
|
-
*/
|
|
112
|
-
this.cellMargin = 1;
|
|
113
|
-
/**
|
|
114
|
-
* Above point color that is customisable using CSS variable
|
|
115
|
-
*/
|
|
116
|
-
this.abovePointColor = '';
|
|
117
|
-
/**
|
|
118
|
-
* Middle point color that is customisable using CSS variable
|
|
119
|
-
*/
|
|
120
|
-
this.midPointColor = '';
|
|
121
|
-
/**
|
|
122
|
-
* Below point color that is customisable using CSS variable
|
|
123
|
-
*/
|
|
124
|
-
this.belowPointColor = '';
|
|
125
|
-
/** @ignore */
|
|
126
|
-
this.onResize = this.onResize.bind(this);
|
|
127
|
-
/** @ignore */
|
|
128
|
-
this.onMouseMove = this.onMouseMove.bind(this);
|
|
129
|
-
/** @ignore */
|
|
130
|
-
this.stopAnimation = this.stopAnimation.bind(this);
|
|
131
|
-
/** @ignore */
|
|
132
|
-
this.tooltipRenderer = this.tooltipRenderer.bind(this);
|
|
133
|
-
/** @ignore */
|
|
134
|
-
this.tooltipCondition = this.tooltipCondition.bind(this);
|
|
135
|
-
/** @ignore */
|
|
136
|
-
this.onMouseLeave = this.onMouseLeave.bind(this);
|
|
137
|
-
}
|
|
138
22
|
/**
|
|
139
23
|
* Element version number
|
|
140
24
|
* @returns version number
|
|
@@ -198,7 +82,6 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
198
82
|
get hoverCell() {
|
|
199
83
|
return this._hoverCell;
|
|
200
84
|
}
|
|
201
|
-
/* istanbul ignore next */
|
|
202
85
|
set hoverCell(hoverCell) {
|
|
203
86
|
const previousHoverCell = this._hoverCell;
|
|
204
87
|
this._hoverCell = hoverCell;
|
|
@@ -212,7 +95,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
212
95
|
* @param event an event that occur while the user interacting with element
|
|
213
96
|
* @returns data of cell
|
|
214
97
|
*/
|
|
215
|
-
/*
|
|
98
|
+
/* c8 ignore start */
|
|
216
99
|
getCellDataAtEvent(event) {
|
|
217
100
|
return this.hitTest(event);
|
|
218
101
|
}
|
|
@@ -257,6 +140,124 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
257
140
|
});
|
|
258
141
|
return result;
|
|
259
142
|
}
|
|
143
|
+
constructor() {
|
|
144
|
+
super();
|
|
145
|
+
/**
|
|
146
|
+
* Heatmap configuration options.
|
|
147
|
+
* @type {HeatmapConfig}
|
|
148
|
+
*/
|
|
149
|
+
this.config = null;
|
|
150
|
+
/**
|
|
151
|
+
* Number of maximum label width that cell can paint in pixel.
|
|
152
|
+
* e.g. label-width: 30px; cell label hides when text length reaches 30px.
|
|
153
|
+
*/
|
|
154
|
+
this.labelWidth = 0;
|
|
155
|
+
/**
|
|
156
|
+
* Hide all labels in the cells
|
|
157
|
+
*/
|
|
158
|
+
this.labelHidden = false;
|
|
159
|
+
/**
|
|
160
|
+
* Hide all axes
|
|
161
|
+
*/
|
|
162
|
+
this.axisHidden = false;
|
|
163
|
+
/* c8 ignore stop */
|
|
164
|
+
/**
|
|
165
|
+
* Minimum point of the cell coloring
|
|
166
|
+
*/
|
|
167
|
+
this.minPoint = -1;
|
|
168
|
+
/**
|
|
169
|
+
* Middle point of the cell coloring
|
|
170
|
+
*/
|
|
171
|
+
this.midPoint = 0;
|
|
172
|
+
/**
|
|
173
|
+
* Maximum point of the cell coloring
|
|
174
|
+
*/
|
|
175
|
+
this.maxPoint = 1;
|
|
176
|
+
/**
|
|
177
|
+
* Enable cell color blending
|
|
178
|
+
*/
|
|
179
|
+
this.blend = false;
|
|
180
|
+
/**
|
|
181
|
+
* Cell minimum color saturation, value can be from 0 - 1
|
|
182
|
+
*/
|
|
183
|
+
this.saturation = 0.4;
|
|
184
|
+
/**
|
|
185
|
+
* Current active cell
|
|
186
|
+
*/
|
|
187
|
+
this._hoverCell = null;
|
|
188
|
+
/**
|
|
189
|
+
* Internal cells data storage
|
|
190
|
+
*/
|
|
191
|
+
this.cells = [];
|
|
192
|
+
/**
|
|
193
|
+
* Canvas's font color according to theme
|
|
194
|
+
*/
|
|
195
|
+
this.foregroundColor = '';
|
|
196
|
+
/**
|
|
197
|
+
* Canvas's background color according to theme
|
|
198
|
+
*/
|
|
199
|
+
this.backgroundColor = '';
|
|
200
|
+
/**
|
|
201
|
+
* Row cells track for easier calculations
|
|
202
|
+
*/
|
|
203
|
+
this.rowTrack = new Track();
|
|
204
|
+
/**
|
|
205
|
+
* Column cells track for easier calculations
|
|
206
|
+
*/
|
|
207
|
+
this.colTrack = new Track();
|
|
208
|
+
/**
|
|
209
|
+
* A flag to check if calculated responsive height it been set.
|
|
210
|
+
*/
|
|
211
|
+
this.responsiveHeight = false;
|
|
212
|
+
/**
|
|
213
|
+
* A flag to check if the component has a size.
|
|
214
|
+
*/
|
|
215
|
+
this.isSizeCalculated = false;
|
|
216
|
+
/**
|
|
217
|
+
* Use to prevent resizes observer in certain use cases
|
|
218
|
+
*/
|
|
219
|
+
this.updateTimer = 0;
|
|
220
|
+
/**
|
|
221
|
+
* Use to throttle heatmap painting
|
|
222
|
+
*/
|
|
223
|
+
this.renderTask = new MicroTaskRunner();
|
|
224
|
+
/**
|
|
225
|
+
* A flag to check if the cell has header enable.
|
|
226
|
+
*/
|
|
227
|
+
this.hasCellHeader = false;
|
|
228
|
+
/**
|
|
229
|
+
* A flag to check if cell's content is within its boundary
|
|
230
|
+
*/
|
|
231
|
+
this.contentWithinCellBoundary = true;
|
|
232
|
+
/**
|
|
233
|
+
* Margin around each cell
|
|
234
|
+
*/
|
|
235
|
+
this.cellMargin = 1;
|
|
236
|
+
/**
|
|
237
|
+
* Above point color that is customisable using CSS variable
|
|
238
|
+
*/
|
|
239
|
+
this.abovePointColor = '';
|
|
240
|
+
/**
|
|
241
|
+
* Middle point color that is customisable using CSS variable
|
|
242
|
+
*/
|
|
243
|
+
this.midPointColor = '';
|
|
244
|
+
/**
|
|
245
|
+
* Below point color that is customisable using CSS variable
|
|
246
|
+
*/
|
|
247
|
+
this.belowPointColor = '';
|
|
248
|
+
/** @ignore */
|
|
249
|
+
this.onResize = this.onResize.bind(this);
|
|
250
|
+
/** @ignore */
|
|
251
|
+
this.onMouseMove = this.onMouseMove.bind(this);
|
|
252
|
+
/** @ignore */
|
|
253
|
+
this.stopAnimation = this.stopAnimation.bind(this);
|
|
254
|
+
/** @ignore */
|
|
255
|
+
this.tooltipRenderer = this.tooltipRenderer.bind(this);
|
|
256
|
+
/** @ignore */
|
|
257
|
+
this.tooltipCondition = this.tooltipCondition.bind(this);
|
|
258
|
+
/** @ignore */
|
|
259
|
+
this.onMouseLeave = this.onMouseLeave.bind(this);
|
|
260
|
+
}
|
|
260
261
|
/**
|
|
261
262
|
* Called when the element’s DOM has been updated and rendered
|
|
262
263
|
* @param changedProperties changed properties
|
|
@@ -290,7 +291,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
290
291
|
* @param event mousemove event
|
|
291
292
|
* @returns {void}
|
|
292
293
|
*/
|
|
293
|
-
/*
|
|
294
|
+
/* c8 ignore start */
|
|
294
295
|
onMouseMove(event) {
|
|
295
296
|
if (event.composedPath().includes(this.canvas) || this.tooltipCallback && this.tooltipOverlay === event.target) {
|
|
296
297
|
this.hoverCell = this.hitTest(event);
|
|
@@ -299,15 +300,17 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
299
300
|
this.hoverCell = null;
|
|
300
301
|
}
|
|
301
302
|
}
|
|
303
|
+
/* c8 ignore stop */
|
|
302
304
|
/**
|
|
303
305
|
* Handles when mouse moving outside element
|
|
304
306
|
* @param event mouseleave event
|
|
305
307
|
* @returns {void}
|
|
306
308
|
*/
|
|
307
|
-
/*
|
|
309
|
+
/* c8 ignore start */
|
|
308
310
|
onMouseLeave() {
|
|
309
311
|
this.hoverCell = null;
|
|
310
312
|
}
|
|
313
|
+
/* c8 ignore stop */
|
|
311
314
|
/**
|
|
312
315
|
* Handles heatmap resizes
|
|
313
316
|
* @returns {void}
|
|
@@ -359,7 +362,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
359
362
|
* @param event mouse event
|
|
360
363
|
* @returns cell
|
|
361
364
|
*/
|
|
362
|
-
/*
|
|
365
|
+
/* c8 ignore start */
|
|
363
366
|
hitTest(event) {
|
|
364
367
|
const box = this.canvas.getBoundingClientRect();
|
|
365
368
|
const x = event.clientX - box.left;
|
|
@@ -368,13 +371,14 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
368
371
|
const column = this.colTrack.hitTest(x);
|
|
369
372
|
return this.getCellByLocation(row, column);
|
|
370
373
|
}
|
|
374
|
+
/* c8 ignore stop */
|
|
371
375
|
/**
|
|
372
376
|
* Get a cell, using row and column coordinates
|
|
373
377
|
* @param row row index
|
|
374
378
|
* @param column column index
|
|
375
379
|
* @returns cell
|
|
376
380
|
*/
|
|
377
|
-
/*
|
|
381
|
+
/* c8 ignore start */
|
|
378
382
|
getCellByLocation(row, column) {
|
|
379
383
|
if (row < 0 || row >= this.rowCount) {
|
|
380
384
|
return null;
|
|
@@ -384,12 +388,13 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
384
388
|
}
|
|
385
389
|
return this.cells[row * this.columnCount + column] || null;
|
|
386
390
|
}
|
|
391
|
+
/* c8 ignore stop */
|
|
387
392
|
/**
|
|
388
393
|
* Update overlay position
|
|
389
394
|
* @param cell cell information for correct overlay
|
|
390
395
|
* @returns {void}
|
|
391
396
|
*/
|
|
392
|
-
/*
|
|
397
|
+
/* c8 ignore start */
|
|
393
398
|
updateTooltipOverlayPosition(cell) {
|
|
394
399
|
// Compensate x-axis height for overlay when x-axis is at top position
|
|
395
400
|
let marginOverlayTop = 0;
|
|
@@ -402,13 +407,14 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
402
407
|
this.tooltipOverlay.style.width = `${cell.width}px`;
|
|
403
408
|
this.tooltipOverlay.style.height = `${cell.height}px`;
|
|
404
409
|
}
|
|
410
|
+
/* c8 ignore stop */
|
|
405
411
|
/**
|
|
406
412
|
* Called upon active cell changes i.e cell hovering
|
|
407
413
|
* @param cell current active cell
|
|
408
414
|
* @param previousCell previous active cell
|
|
409
415
|
* @returns {void}
|
|
410
416
|
*/
|
|
411
|
-
/*
|
|
417
|
+
/* c8 ignore start */
|
|
412
418
|
hoverCellChanged(cell, previousCell) {
|
|
413
419
|
if (cell && cell.value !== null) {
|
|
414
420
|
if (this.tooltipCallback) {
|
|
@@ -425,6 +431,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
425
431
|
this.fade(previousCell, previousCell.backgroundColor, this.getBackgroundColor(previousCell.value), 300);
|
|
426
432
|
}
|
|
427
433
|
}
|
|
434
|
+
/* c8 ignore stop */
|
|
428
435
|
/**
|
|
429
436
|
* Called upon label-hidden attribute changes
|
|
430
437
|
* @returns {void}
|
|
@@ -458,12 +465,13 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
458
465
|
* @param {HeatmapCell} cell cell to stop the animation on
|
|
459
466
|
* @returns {void}
|
|
460
467
|
*/
|
|
461
|
-
/*
|
|
468
|
+
/* c8 ignore start */
|
|
462
469
|
stopAnimation(cell) {
|
|
463
470
|
if (cell.animationFrame) {
|
|
464
471
|
cancelAnimationFrame(cell.animationFrame);
|
|
465
472
|
}
|
|
466
473
|
}
|
|
474
|
+
/* c8 ignore stop */
|
|
467
475
|
/**
|
|
468
476
|
* Stops all animations on a cell
|
|
469
477
|
* @returns {void}
|
|
@@ -476,10 +484,11 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
476
484
|
* @param cell cell object
|
|
477
485
|
* @returns {void}
|
|
478
486
|
*/
|
|
479
|
-
/*
|
|
487
|
+
/* c8 ignore start */
|
|
480
488
|
resetCell(cell) {
|
|
481
489
|
this.canvasContext?.clearRect(cell.x, cell.y, cell.width, cell.height);
|
|
482
490
|
}
|
|
491
|
+
/* c8 ignore stop */
|
|
483
492
|
/**
|
|
484
493
|
* Fades a cell's background from one color to another
|
|
485
494
|
* @param cell to fade
|
|
@@ -489,7 +498,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
489
498
|
* @param delay fading animation delay
|
|
490
499
|
* @returns {void}
|
|
491
500
|
*/
|
|
492
|
-
/*
|
|
501
|
+
/* c8 ignore start */
|
|
493
502
|
fade(cell, from, to, duration) {
|
|
494
503
|
const start = performance.now();
|
|
495
504
|
const end = start + duration;
|
|
@@ -516,6 +525,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
516
525
|
}
|
|
517
526
|
cell.animationFrame = requestAnimationFrame(fadingAnimation);
|
|
518
527
|
}
|
|
528
|
+
/* c8 ignore stop */
|
|
519
529
|
/**
|
|
520
530
|
* Converts the input data into usable cell data
|
|
521
531
|
* @returns {void}
|
|
@@ -641,13 +651,13 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
641
651
|
* Check if the text (label / header and label) can be paint on the cell
|
|
642
652
|
* @returns true if text is within cell's boundary
|
|
643
653
|
*/
|
|
644
|
-
/*
|
|
654
|
+
/* c8 ignore start */
|
|
645
655
|
canPaintText() {
|
|
646
656
|
const canvas = this.canvasContext;
|
|
647
657
|
if (!canvas) {
|
|
648
658
|
return false;
|
|
649
659
|
}
|
|
650
|
-
const fontRatio = this.responsiveHeight ? 0.
|
|
660
|
+
const fontRatio = this.responsiveHeight ? 0.4 : 0.5;
|
|
651
661
|
const fontFamily = getComputedStyle(this).fontFamily;
|
|
652
662
|
const contentWidth = this.colTrack.getContentSize(0);
|
|
653
663
|
const contentHeight = this.rowTrack.getContentSize(0);
|
|
@@ -659,12 +669,12 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
659
669
|
canvas.textAlign = 'center';
|
|
660
670
|
canvas.textBaseline = 'middle';
|
|
661
671
|
canvas.font = `${fontSize}px ${fontFamily}`;
|
|
662
|
-
let isWithinMinCellWidth = ((this.labelWidth || getMaximumTextWidth(canvas, this.cells, this.hasCellHeader)) / contentWidth)
|
|
663
|
-
//
|
|
672
|
+
let isWithinMinCellWidth = ((this.labelWidth || getMaximumTextWidth(canvas, this.cells, this.hasCellHeader)) / contentWidth) <= CELL_MAX_TEXT_WIDTH;
|
|
673
|
+
// Tries to get the largest possible font size that is within `CELL_MAX_TEXT_WIDTH`
|
|
664
674
|
if (!isWithinMinCellWidth && fontSize !== MIN_FONT_SIZE) {
|
|
665
675
|
while (!isWithinMinCellWidth) {
|
|
666
676
|
canvas.font = `${fontSize}px ${fontFamily}`; // Should assigned new font size to canvas before calculated again.
|
|
667
|
-
isWithinMinCellWidth = ((this.labelWidth || getMaximumTextWidth(canvas, this.cells, this.hasCellHeader)) / contentWidth)
|
|
677
|
+
isWithinMinCellWidth = ((this.labelWidth || getMaximumTextWidth(canvas, this.cells, this.hasCellHeader)) / contentWidth) <= CELL_MAX_TEXT_WIDTH;
|
|
668
678
|
// Stops when reaches minimum font-size
|
|
669
679
|
if (fontSize === MIN_FONT_SIZE) {
|
|
670
680
|
break;
|
|
@@ -678,12 +688,13 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
678
688
|
this.contentWithinCellBoundary = isWithinMinCellWidth && isWithinMinCellHeight;
|
|
679
689
|
return this.contentWithinCellBoundary;
|
|
680
690
|
}
|
|
691
|
+
/* c8 ignore stop */
|
|
681
692
|
/**
|
|
682
693
|
* Calculate cell background color based on the current cell data value
|
|
683
694
|
* @param value cell value
|
|
684
695
|
* @returns calculated color
|
|
685
696
|
*/
|
|
686
|
-
/*
|
|
697
|
+
/* c8 ignore start */
|
|
687
698
|
getBackgroundColor(value) {
|
|
688
699
|
if (value === null) {
|
|
689
700
|
return this.backgroundColor;
|
|
@@ -707,13 +718,14 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
707
718
|
return interpolate(this.midPointColor, this.belowPointColor)(-factor);
|
|
708
719
|
}
|
|
709
720
|
}
|
|
721
|
+
/* c8 ignore stop */
|
|
710
722
|
/**
|
|
711
723
|
* Calculate the color mixing factor from 0 - 1
|
|
712
724
|
* @param value cell value
|
|
713
725
|
* @param saturation color saturation level
|
|
714
726
|
* @returns factor
|
|
715
727
|
*/
|
|
716
|
-
/*
|
|
728
|
+
/* c8 ignore start */
|
|
717
729
|
calculateColorFactor(value, saturation) {
|
|
718
730
|
if (value >= this.maxPoint) {
|
|
719
731
|
return 1;
|
|
@@ -732,6 +744,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
732
744
|
return ((value - this.midPoint) / (this.midPoint - this.minPoint) * saturateRatio) - saturation;
|
|
733
745
|
}
|
|
734
746
|
}
|
|
747
|
+
/* c8 ignore stop */
|
|
735
748
|
/**
|
|
736
749
|
* Get and stores canvas color from computed canvas style
|
|
737
750
|
* @returns {void}
|
|
@@ -801,7 +814,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
801
814
|
* @param cell object
|
|
802
815
|
* @returns {void}
|
|
803
816
|
*/
|
|
804
|
-
/*
|
|
817
|
+
/* c8 ignore start */
|
|
805
818
|
paintCell(cell) {
|
|
806
819
|
this.paintCellBackground(cell);
|
|
807
820
|
if (!this.labelHidden && this.contentWithinCellBoundary) {
|
|
@@ -811,6 +824,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
811
824
|
this.paintHeader(cell);
|
|
812
825
|
}
|
|
813
826
|
}
|
|
827
|
+
/* c8 ignore stop */
|
|
814
828
|
/**
|
|
815
829
|
* Paints all cells background colour
|
|
816
830
|
* @returns {void}
|
|
@@ -986,22 +1000,24 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
986
1000
|
* Tooltip renderer function
|
|
987
1001
|
* @returns tooltip template to be render
|
|
988
1002
|
*/
|
|
989
|
-
/*
|
|
1003
|
+
/* c8 ignore start */
|
|
990
1004
|
tooltipRenderer() {
|
|
991
1005
|
if (this.hoverCell && this.canvasContext && this.tooltipCallback) {
|
|
992
1006
|
return this.tooltipCallback(this.hoverCell);
|
|
993
1007
|
}
|
|
994
1008
|
return undefined;
|
|
995
1009
|
}
|
|
1010
|
+
/* c8 ignore stop */
|
|
996
1011
|
/**
|
|
997
1012
|
* Checks if the tooltip should display or not
|
|
998
1013
|
* @param target element target
|
|
999
1014
|
* @returns if the canvas target within canvas
|
|
1000
1015
|
*/
|
|
1001
|
-
/*
|
|
1016
|
+
/* c8 ignore start */
|
|
1002
1017
|
tooltipCondition(target) {
|
|
1003
1018
|
return target === this.tooltipOverlay;
|
|
1004
1019
|
}
|
|
1020
|
+
/* c8 ignore stop */
|
|
1005
1021
|
/**
|
|
1006
1022
|
* A `TemplateResult` that will be used
|
|
1007
1023
|
* to render the updated internal template.
|
|
@@ -1041,7 +1057,7 @@ __decorate([
|
|
|
1041
1057
|
], Heatmap.prototype, "axisHidden", void 0);
|
|
1042
1058
|
__decorate([
|
|
1043
1059
|
property({ type: Object, attribute: false })
|
|
1044
|
-
/*
|
|
1060
|
+
/* c8 ignore start */
|
|
1045
1061
|
], Heatmap.prototype, "hoverCell", null);
|
|
1046
1062
|
__decorate([
|
|
1047
1063
|
property({ type: Number, attribute: 'min-point' })
|
|
@@ -8,12 +8,6 @@
|
|
|
8
8
|
"name": "icon",
|
|
9
9
|
"description": "Name of a known icon to render or URL of SVG icon.",
|
|
10
10
|
"type": "string | null"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"name": "src",
|
|
14
|
-
"description": "Src location of an svg icon.",
|
|
15
|
-
"type": "string | null",
|
|
16
|
-
"deprecatedMessage": "Use `icon` instead"
|
|
17
11
|
}
|
|
18
12
|
],
|
|
19
13
|
"properties": [
|
|
@@ -22,13 +16,6 @@
|
|
|
22
16
|
"attribute": "icon",
|
|
23
17
|
"description": "Name of a known icon to render or URL of SVG icon.",
|
|
24
18
|
"type": "string | null"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"name": "src",
|
|
28
|
-
"attribute": "src",
|
|
29
|
-
"description": "Src location of an svg icon.",
|
|
30
|
-
"type": "string | null",
|
|
31
|
-
"deprecatedMessage": "Use `icon` instead"
|
|
32
19
|
}
|
|
33
20
|
]
|
|
34
21
|
}
|
|
@@ -5,4 +5,3 @@
|
|
|
5
5
|
| Property | Attribute | Type | Default | Description |
|
|
6
6
|
|----------|-----------|------------------|---------|--------------------------------------------------|
|
|
7
7
|
| `icon` | `icon` | `string \| null` | null | Name of a known icon to render or URL of SVG icon. |
|
|
8
|
-
| `src` | `src` | `string \| null` | null | Src location of an svg icon. |
|
package/lib/icon/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare class Icon extends BasicElement {
|
|
|
17
17
|
private _icon;
|
|
18
18
|
/**
|
|
19
19
|
* Name of a known icon to render or URL of SVG icon.
|
|
20
|
-
* @example
|
|
20
|
+
* @example home | https://cdn.io/icons/home.svg
|
|
21
21
|
* @default null
|
|
22
22
|
*/
|
|
23
23
|
get icon(): string | null;
|
|
@@ -25,11 +25,16 @@ export declare class Icon extends BasicElement {
|
|
|
25
25
|
private _src;
|
|
26
26
|
/**
|
|
27
27
|
* Src location of an svg icon.
|
|
28
|
-
* @
|
|
28
|
+
* @ignore
|
|
29
|
+
* @example https://cdn.io/icons/home.svg
|
|
29
30
|
* @deprecated Use `icon` instead
|
|
30
31
|
* @default null
|
|
31
32
|
*/
|
|
32
33
|
get src(): string | null;
|
|
34
|
+
/**
|
|
35
|
+
* @ignore
|
|
36
|
+
* @param value Location of an svg
|
|
37
|
+
*/
|
|
33
38
|
set src(value: string | null);
|
|
34
39
|
private _template;
|
|
35
40
|
/**
|
|
@@ -37,12 +42,25 @@ export declare class Icon extends BasicElement {
|
|
|
37
42
|
*/
|
|
38
43
|
private get template();
|
|
39
44
|
private set template(value);
|
|
45
|
+
/**
|
|
46
|
+
* A deferred promise representing icon ready.
|
|
47
|
+
* It would be resolved when the icon svg has been fetched and parsed, or
|
|
48
|
+
* when the icon svg is unavailable/invalid.
|
|
49
|
+
*/
|
|
50
|
+
private iconReady;
|
|
51
|
+
constructor();
|
|
40
52
|
/**
|
|
41
53
|
* Called after the component is first rendered
|
|
42
54
|
* @param changedProperties Properties which have changed
|
|
43
55
|
* @returns {void}
|
|
44
56
|
*/
|
|
45
57
|
protected firstUpdated(changedProperties: PropertyValues): void;
|
|
58
|
+
protected getUpdateComplete(): Promise<boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* instantiate a new deferred promise for icon ready if it's not pending already
|
|
61
|
+
* @returns {void}
|
|
62
|
+
*/
|
|
63
|
+
private deferIconReady;
|
|
46
64
|
/**
|
|
47
65
|
* Helper method, used to set the icon src.
|
|
48
66
|
* @returns {void}
|