@3t-transform/threeteeui 1.9.101 → 1.9.103
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/{auto-be8ad100.js → auto-356ad09b.js} +177 -177
- package/dist/cjs/{domsanitiser.options-55ce2d65.js → domsanitiser.options-065dbed8.js} +12 -12
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{tttx-action-dropdown_1_9_101.cjs.entry.js → tttx-action-dropdown_1_9_103.cjs.entry.js} +51 -51
- package/dist/cjs/{tttx-button-v2_1_9_101.cjs.entry.js → tttx-button-v2_1_9_103.cjs.entry.js} +147 -147
- package/dist/cjs/{tttx-button_1_9_101.cjs.entry.js → tttx-button_1_9_103.cjs.entry.js} +26 -26
- package/dist/cjs/{tttx-chart_1_9_101.cjs.entry.js → tttx-chart_1_9_103.cjs.entry.js} +524 -524
- package/dist/cjs/{tttx-checkbox-group-caption_1_9_101.cjs.entry.js → tttx-checkbox-group-caption_1_9_103.cjs.entry.js} +9 -9
- package/dist/cjs/{tttx-checkbox-group-heading_1_9_101.cjs.entry.js → tttx-checkbox-group-heading_1_9_103.cjs.entry.js} +9 -9
- package/dist/cjs/{tttx-checkbox-group_1_9_101.cjs.entry.js → tttx-checkbox-group_1_9_103.cjs.entry.js} +9 -9
- package/dist/cjs/{tttx-checkbox_1_9_101.cjs.entry.js → tttx-checkbox_1_9_103.cjs.entry.js} +33 -33
- package/dist/cjs/{tttx-comments_1_9_101.cjs.entry.js → tttx-comments_1_9_103.cjs.entry.js} +204 -204
- package/dist/cjs/{tttx-data-pattern_1_9_101.cjs.entry.js → tttx-data-pattern_1_9_103.cjs.entry.js} +20 -20
- package/dist/cjs/{tttx-datacard_1_9_101.cjs.entry.js → tttx-datacard_1_9_103.cjs.entry.js} +43 -43
- package/dist/cjs/tttx-date-range-picker.cjs.entry.js +212 -212
- package/dist/cjs/{tttx-dialog-box_1_9_101.cjs.entry.js → tttx-dialog-box_1_9_103.cjs.entry.js} +94 -94
- package/dist/cjs/{tttx-dialog_1_9_101.cjs.entry.js → tttx-dialog_1_9_103.cjs.entry.js} +69 -69
- package/dist/cjs/{tttx-expander_1_9_101.cjs.entry.js → tttx-expander_1_9_103.cjs.entry.js} +28 -28
- package/dist/cjs/{tttx-filter_1_9_101_4.cjs.entry.js → tttx-filter_1_9_103_4.cjs.entry.js} +386 -386
- package/dist/cjs/{tttx-form_1_9_101.cjs.entry.js → tttx-form_1_9_103.cjs.entry.js} +985 -985
- package/dist/cjs/{tttx-graph_1_9_101.cjs.entry.js → tttx-graph_1_9_103.cjs.entry.js} +124 -124
- package/dist/cjs/{tttx-icon_1_9_101.cjs.entry.js → tttx-icon_1_9_103.cjs.entry.js} +24 -24
- package/dist/cjs/{tttx-keyvalue-block_1_9_101.cjs.entry.js → tttx-keyvalue-block_1_9_103.cjs.entry.js} +62 -62
- package/dist/cjs/{tttx-loading-spinner_1_9_101_3.cjs.entry.js → tttx-loading-spinner_1_9_103_3.cjs.entry.js} +172 -172
- package/dist/cjs/{tttx-multiselect-box_1_9_101.cjs.entry.js → tttx-multiselect-box_1_9_103.cjs.entry.js} +175 -175
- package/dist/cjs/{tttx-percentage-bar_1_9_101.cjs.entry.js → tttx-percentage-bar_1_9_103.cjs.entry.js} +56 -56
- package/dist/cjs/{tttx-qrcode_1_9_101.cjs.entry.js → tttx-qrcode_1_9_103.cjs.entry.js} +28 -28
- package/dist/cjs/{tttx-range-slider_1_9_101.cjs.entry.js → tttx-range-slider_1_9_103.cjs.entry.js} +185 -185
- package/dist/cjs/{tttx-select-box_1_9_101.cjs.entry.js → tttx-select-box_1_9_103.cjs.entry.js} +239 -239
- package/dist/cjs/{tttx-skeleton_loader_1_9_101.cjs.entry.js → tttx-skeleton_loader_1_9_103.cjs.entry.js} +30 -30
- package/dist/cjs/{tttx-table_1_9_101.cjs.entry.js → tttx-table_1_9_103.cjs.entry.js} +72 -72
- package/dist/cjs/{tttx-tabs_1_9_101.cjs.entry.js → tttx-tabs_1_9_103.cjs.entry.js} +103 -103
- package/dist/cjs/{tttx-tag-v2_1_9_101.cjs.entry.js → tttx-tag-v2_1_9_103.cjs.entry.js} +72 -72
- package/dist/cjs/{tttx-textarea_1_9_101.cjs.entry.js → tttx-textarea_1_9_103.cjs.entry.js} +50 -50
- package/dist/cjs/{tttx-toggle_1_9_101.cjs.entry.js → tttx-toggle_1_9_103.cjs.entry.js} +30 -30
- package/dist/cjs/{tttx-tooltip_1_9_101.cjs.entry.js → tttx-tooltip_1_9_103.cjs.entry.js} +87 -87
- package/dist/cjs/{tttx-tree-view_1_9_101.cjs.entry.js → tttx-tree-view_1_9_103.cjs.entry.js} +342 -342
- package/dist/cjs/tttx.cjs.js +1 -1
- package/dist/collection/components/atoms/tttx-button/tttx-button.js +129 -129
- package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +40 -40
- package/dist/collection/components/atoms/tttx-button-v2/tttx-button-v2.css +1 -1
- package/dist/collection/components/atoms/tttx-button-v2/tttx-button-v2.js +436 -436
- package/dist/collection/components/atoms/tttx-button-v2/tttx-button-v2.stories.js +143 -143
- package/dist/collection/components/atoms/tttx-checkbox/tttx-checkbox.js +154 -154
- package/dist/collection/components/atoms/tttx-checkbox/tttx-checkbox.stories.js +58 -58
- package/dist/collection/components/atoms/tttx-datacard/tttx-datacard.js +186 -186
- package/dist/collection/components/atoms/tttx-datacard/tttx-datacard.stories.js +92 -92
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +92 -92
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +26 -26
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +137 -137
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +94 -94
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +194 -194
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +53 -53
- package/dist/collection/components/atoms/tttx-percentage-bar/tttx-percentage-bar.js +168 -168
- package/dist/collection/components/atoms/tttx-percentage-bar/tttx-percentage-bar.stories.js +52 -52
- package/dist/collection/components/atoms/tttx-qrcode/tttx-qrcode.js +81 -81
- package/dist/collection/components/atoms/tttx-qrcode/tttx-qrcode.stories.js +22 -22
- package/dist/collection/components/atoms/tttx-skeleton-loader/tttx-skeleton-loader.js +225 -225
- package/dist/collection/components/atoms/tttx-skeleton-loader/tttx-skeleton-loader.stories.js +44 -44
- package/dist/collection/components/atoms/tttx-tag/tttx-tag.js +157 -157
- package/dist/collection/components/atoms/tttx-tag/tttx-tag.stories.js +53 -53
- package/dist/collection/components/atoms/tttx-tag-v2/tttx-tag-v2.js +281 -281
- package/dist/collection/components/atoms/tttx-tag-v2/tttx-tag-v2.stories.js +84 -84
- package/dist/collection/components/atoms/tttx-toggle/tttx-toggle.js +84 -84
- package/dist/collection/components/atoms/tttx-toggle/tttx-toggle.stories.js +8 -8
- package/dist/collection/components/domsanitiser.options.js +14 -14
- package/dist/collection/components/molecules/tttx-action-dropdown/tttx-action-dropdown.js +213 -213
- package/dist/collection/components/molecules/tttx-action-dropdown/tttx-action-dropdown.stories.js +55 -55
- package/dist/collection/components/molecules/tttx-chart/tttx-chart.js +793 -793
- package/dist/collection/components/molecules/tttx-chart/tttx-chart.stories.js +209 -209
- package/dist/collection/components/molecules/tttx-checkbox-group/components/tttx-checkbox-group-caption.js +17 -17
- package/dist/collection/components/molecules/tttx-checkbox-group/components/tttx-checkbox-group-heading.js +17 -17
- package/dist/collection/components/molecules/tttx-checkbox-group/tttx-checkbox-group.js +18 -18
- package/dist/collection/components/molecules/tttx-checkbox-group/tttx-checkbox-group.stories.js +62 -62
- package/dist/collection/components/molecules/tttx-comments/tttx-comments.js +536 -536
- package/dist/collection/components/molecules/tttx-comments/tttx-comments.stories.js +151 -151
- package/dist/collection/components/molecules/tttx-date-range-picker/tttx-date-range-picker.js +292 -292
- package/dist/collection/components/molecules/tttx-date-range-picker/tttx-date-range-picker.stories.js +48 -48
- package/dist/collection/components/molecules/tttx-dialog/icon-types.js +6 -6
- package/dist/collection/components/molecules/tttx-dialog/tttx-dialog.js +218 -218
- package/dist/collection/components/molecules/tttx-dialog/tttx-dialog.stories.js +50 -50
- package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.js +246 -246
- package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.stories.js +314 -314
- package/dist/collection/components/molecules/tttx-expander/tttx-expander.js +134 -134
- package/dist/collection/components/molecules/tttx-expander/tttx-expander.stories.js +46 -46
- package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +416 -416
- package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +81 -81
- package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +49 -49
- package/dist/collection/components/molecules/tttx-form/lib/timecomparatorChecks.js +64 -64
- package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +76 -76
- package/dist/collection/components/molecules/tttx-form/tttx-form.js +1267 -1267
- package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +595 -595
- package/dist/collection/components/molecules/tttx-graph/gauge-label-plugin.js +14 -14
- package/dist/collection/components/molecules/tttx-graph/tttx-graph.js +184 -184
- package/dist/collection/components/molecules/tttx-graph/tttx-graph.stories.js +32 -32
- package/dist/collection/components/molecules/tttx-list/tttx-list.js +165 -165
- package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +134 -134
- package/dist/collection/components/molecules/tttx-multiselect-box/tttx-multiselect-box.js +499 -499
- package/dist/collection/components/molecules/tttx-multiselect-box/tttx-multiselect-box.stories.js +151 -151
- package/dist/collection/components/molecules/tttx-range-slider/tttx-range-slider.js +304 -304
- package/dist/collection/components/molecules/tttx-range-slider/tttx-range-slider.stories.js +22 -22
- package/dist/collection/components/molecules/tttx-select-box/tttx-select-box.js +671 -671
- package/dist/collection/components/molecules/tttx-select-box/tttx-select-box.stories.js +140 -140
- package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.js +253 -253
- package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.stories.js +43 -43
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +764 -764
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +191 -191
- package/dist/collection/components/molecules/tttx-table/tttx-table.css +1 -1
- package/dist/collection/components/molecules/tttx-table/tttx-table.js +318 -318
- package/dist/collection/components/molecules/tttx-table/tttx-table.stories.js +191 -191
- package/dist/collection/components/molecules/tttx-table/tttx-table.types.js +1 -1
- package/dist/collection/components/molecules/tttx-tabs/tttx-tabs.js +253 -253
- package/dist/collection/components/molecules/tttx-tabs/tttx-tabs.stories.js +82 -82
- package/dist/collection/components/molecules/tttx-textarea/tttx-textarea.js +420 -420
- package/dist/collection/components/molecules/tttx-textarea/tttx-textarea.stories.js +81 -81
- package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +73 -73
- package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +97 -97
- package/dist/collection/components/molecules/tttx-tooltip/tttx-tooltip.js +253 -253
- package/dist/collection/components/molecules/tttx-tooltip/tttx-tootip.stories.js +117 -117
- package/dist/collection/components/molecules/tttx-tree-view/helper/helper.js +1 -1
- package/dist/collection/components/molecules/tttx-tree-view/tttx-tree-view.css +1 -1
- package/dist/collection/components/molecules/tttx-tree-view/tttx-tree-view.js +463 -463
- package/dist/collection/components/molecules/tttx-tree-view/tttx-tree-view.stories.js +402 -402
- package/dist/collection/components/organisms/tttx-data-pattern/tttx-data-pattern.js +176 -176
- package/dist/collection/components/organisms/tttx-data-pattern/tttx-data-pattern.stories.js +28 -28
- package/dist/collection/components/palette.stories.js +7 -7
- package/dist/collection/icons.js +2838 -2838
- package/dist/collection/index.js +1 -1
- package/dist/collection/shared/domsanitiser.options.js +14 -14
- package/dist/components/auto.js +177 -177
- package/dist/components/domsanitiser.options.js +12 -12
- package/dist/components/index.d.ts +38 -38
- package/dist/components/index.js +38 -38
- package/dist/components/tttx-action-dropdown_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-action-dropdown_1_9_101.js → tttx-action-dropdown_1_9_103.js} +81 -81
- package/dist/components/tttx-button-v2.js +182 -182
- package/dist/components/tttx-button-v2_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-button-v2_1_9_101.js → tttx-button-v2_1_9_103.js} +2 -2
- package/dist/components/tttx-button.js +51 -51
- package/dist/components/{tttx-dialog_1_9_101.d.ts → tttx-button_1_9_103.d.ts} +4 -4
- package/dist/components/{tttx-button_1_9_101.js → tttx-button_1_9_103.js} +2 -2
- package/dist/components/{tttx-table_1_9_101.d.ts → tttx-chart_1_9_103.d.ts} +4 -4
- package/dist/components/{tttx-chart_1_9_101.js → tttx-chart_1_9_103.js} +574 -574
- package/dist/components/tttx-checkbox-group-caption_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-checkbox-group-caption_1_9_101.js → tttx-checkbox-group-caption_1_9_103.js} +24 -24
- package/dist/components/tttx-checkbox-group-heading_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-checkbox-group-heading_1_9_101.js → tttx-checkbox-group-heading_1_9_103.js} +24 -24
- package/dist/components/tttx-checkbox-group_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-checkbox-group_1_9_101.js → tttx-checkbox-group_1_9_103.js} +25 -25
- package/dist/components/tttx-checkbox_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-checkbox_1_9_101.js → tttx-checkbox_1_9_103.js} +59 -59
- package/dist/components/tttx-comments_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-comments_1_9_101.js → tttx-comments_1_9_103.js} +241 -241
- package/dist/components/tttx-data-pattern_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-data-pattern_1_9_101.js → tttx-data-pattern_1_9_103.js} +80 -80
- package/dist/components/tttx-datacard_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-datacard_1_9_101.js → tttx-datacard_1_9_103.js} +79 -79
- package/dist/components/tttx-date-range-picker.js +242 -242
- package/dist/components/tttx-dialog-box_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-dialog-box_1_9_101.js → tttx-dialog-box_1_9_103.js} +125 -125
- package/dist/components/{tttx-filter_1_9_101.d.ts → tttx-dialog_1_9_103.d.ts} +4 -4
- package/dist/components/{tttx-dialog_1_9_101.js → tttx-dialog_1_9_103.js} +103 -103
- package/dist/components/tttx-expander_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-expander_1_9_101.js → tttx-expander_1_9_103.js} +55 -55
- package/dist/components/tttx-filter.js +217 -217
- package/dist/components/{tttx-button_1_9_101.d.ts → tttx-filter_1_9_103.d.ts} +4 -4
- package/dist/components/{tttx-filter_1_9_101.js → tttx-filter_1_9_103.js} +2 -2
- package/dist/components/{tttx-form_1_9_101.d.ts → tttx-form_1_9_103.d.ts} +4 -4
- package/dist/components/{tttx-form_1_9_101.js → tttx-form_1_9_103.js} +1039 -1039
- package/dist/components/tttx-graph.js +143 -143
- package/dist/components/{tttx-graph_1_9_101.d.ts → tttx-graph_1_9_103.d.ts} +4 -4
- package/dist/components/{tttx-graph_1_9_101.js → tttx-graph_1_9_103.js} +2 -2
- package/dist/components/tttx-icon.js +42 -42
- package/dist/components/{tttx-list_1_9_101.d.ts → tttx-icon_1_9_103.d.ts} +4 -4
- package/dist/components/{tttx-icon_1_9_101.js → tttx-icon_1_9_103.js} +2 -2
- package/dist/components/tttx-keyvalue-block_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-keyvalue-block_1_9_101.js → tttx-keyvalue-block_1_9_103.js} +83 -83
- package/dist/components/tttx-list.js +92 -92
- package/dist/components/{tttx-tabs_1_9_101.d.ts → tttx-list_1_9_103.d.ts} +4 -4
- package/dist/components/{tttx-list_1_9_101.js → tttx-list_1_9_103.js} +2 -2
- package/dist/components/tttx-loading-spinner.js +92 -92
- package/dist/components/tttx-loading-spinner_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-loading-spinner_1_9_101.js → tttx-loading-spinner_1_9_103.js} +2 -2
- package/dist/components/tttx-multiselect-box_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-multiselect-box_1_9_101.js → tttx-multiselect-box_1_9_103.js} +231 -231
- package/dist/components/tttx-percentage-bar_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-percentage-bar_1_9_101.js → tttx-percentage-bar_1_9_103.js} +80 -80
- package/dist/components/tttx-qrcode_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-qrcode_1_9_101.js → tttx-qrcode_1_9_103.js} +47 -47
- package/dist/components/tttx-range-slider_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-range-slider_1_9_101.js → tttx-range-slider_1_9_103.js} +208 -208
- package/dist/components/tttx-select-box.js +295 -295
- package/dist/components/tttx-select-box_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-select-box_1_9_101.js → tttx-select-box_1_9_103.js} +2 -2
- package/dist/components/tttx-skeleton_loader_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-skeleton_loader_1_9_101.js → tttx-skeleton_loader_1_9_103.js} +57 -57
- package/dist/components/tttx-sorter.js +136 -136
- package/dist/components/tttx-sorter_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-sorter_1_9_101.js → tttx-sorter_1_9_103.js} +2 -2
- package/dist/components/tttx-standalone-input.js +136 -136
- package/dist/components/tttx-standalone-input_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-standalone-input_1_9_101.js → tttx-standalone-input_1_9_103.js} +2 -2
- package/dist/components/{tttx-chart_1_9_101.d.ts → tttx-table_1_9_103.d.ts} +4 -4
- package/dist/components/{tttx-table_1_9_101.js → tttx-table_1_9_103.js} +109 -109
- package/dist/components/{tttx-icon_1_9_101.d.ts → tttx-tabs_1_9_103.d.ts} +4 -4
- package/dist/components/{tttx-tabs_1_9_101.js → tttx-tabs_1_9_103.js} +128 -128
- package/dist/components/{tttx-tag-v2_1_9_101.d.ts → tttx-tag-v2_1_9_103.d.ts} +4 -4
- package/dist/components/{tttx-tag-v2_1_9_101.js → tttx-tag-v2_1_9_103.js} +105 -105
- package/dist/components/tttx-tag.js +44 -44
- package/dist/components/{tttx-tag_1_9_101.d.ts → tttx-tag_1_9_103.d.ts} +4 -4
- package/dist/components/{tttx-tag_1_9_101.js → tttx-tag_1_9_103.js} +2 -2
- package/dist/components/tttx-textarea_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-textarea_1_9_101.js → tttx-textarea_1_9_103.js} +83 -83
- package/dist/components/tttx-toggle_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-toggle_1_9_101.js → tttx-toggle_1_9_103.js} +49 -49
- package/dist/components/tttx-toolbar.js +42 -42
- package/dist/components/tttx-toolbar_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-toolbar_1_9_101.js → tttx-toolbar_1_9_103.js} +2 -2
- package/dist/components/tttx-tooltip_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-tooltip_1_9_101.js → tttx-tooltip_1_9_103.js} +114 -114
- package/dist/components/tttx-tree-view_1_9_103.d.ts +11 -0
- package/dist/components/{tttx-tree-view_1_9_101.js → tttx-tree-view_1_9_103.js} +371 -371
- package/dist/esm/{auto-421f2656.js → auto-a07ee1b1.js} +177 -177
- package/dist/esm/{domsanitiser.options-38a67458.js → domsanitiser.options-2c1ef894.js} +12 -12
- package/dist/esm/loader.js +1 -1
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/{tttx-action-dropdown_1_9_101.entry.js → tttx-action-dropdown_1_9_103.entry.js} +51 -51
- package/dist/esm/{tttx-button-v2_1_9_101.entry.js → tttx-button-v2_1_9_103.entry.js} +147 -147
- package/dist/esm/{tttx-button_1_9_101.entry.js → tttx-button_1_9_103.entry.js} +26 -26
- package/dist/esm/{tttx-chart_1_9_101.entry.js → tttx-chart_1_9_103.entry.js} +524 -524
- package/dist/esm/{tttx-checkbox-group-caption_1_9_101.entry.js → tttx-checkbox-group-caption_1_9_103.entry.js} +9 -9
- package/dist/esm/{tttx-checkbox-group-heading_1_9_101.entry.js → tttx-checkbox-group-heading_1_9_103.entry.js} +9 -9
- package/dist/esm/{tttx-checkbox-group_1_9_101.entry.js → tttx-checkbox-group_1_9_103.entry.js} +9 -9
- package/dist/esm/{tttx-checkbox_1_9_101.entry.js → tttx-checkbox_1_9_103.entry.js} +33 -33
- package/dist/esm/{tttx-comments_1_9_101.entry.js → tttx-comments_1_9_103.entry.js} +204 -204
- package/dist/esm/{tttx-data-pattern_1_9_101.entry.js → tttx-data-pattern_1_9_103.entry.js} +20 -20
- package/dist/esm/{tttx-datacard_1_9_101.entry.js → tttx-datacard_1_9_103.entry.js} +43 -43
- package/dist/esm/tttx-date-range-picker.entry.js +212 -212
- package/dist/esm/{tttx-dialog-box_1_9_101.entry.js → tttx-dialog-box_1_9_103.entry.js} +94 -94
- package/dist/esm/{tttx-dialog_1_9_101.entry.js → tttx-dialog_1_9_103.entry.js} +69 -69
- package/dist/esm/{tttx-expander_1_9_101.entry.js → tttx-expander_1_9_103.entry.js} +28 -28
- package/dist/esm/{tttx-filter_1_9_101_4.entry.js → tttx-filter_1_9_103_4.entry.js} +383 -383
- package/dist/esm/{tttx-form_1_9_101.entry.js → tttx-form_1_9_103.entry.js} +985 -985
- package/dist/esm/{tttx-graph_1_9_101.entry.js → tttx-graph_1_9_103.entry.js} +124 -124
- package/dist/esm/{tttx-icon_1_9_101.entry.js → tttx-icon_1_9_103.entry.js} +24 -24
- package/dist/esm/{tttx-keyvalue-block_1_9_101.entry.js → tttx-keyvalue-block_1_9_103.entry.js} +62 -62
- package/dist/esm/{tttx-loading-spinner_1_9_101_3.entry.js → tttx-loading-spinner_1_9_103_3.entry.js} +170 -170
- package/dist/esm/{tttx-multiselect-box_1_9_101.entry.js → tttx-multiselect-box_1_9_103.entry.js} +175 -175
- package/dist/esm/{tttx-percentage-bar_1_9_101.entry.js → tttx-percentage-bar_1_9_103.entry.js} +56 -56
- package/dist/esm/{tttx-qrcode_1_9_101.entry.js → tttx-qrcode_1_9_103.entry.js} +28 -28
- package/dist/esm/{tttx-range-slider_1_9_101.entry.js → tttx-range-slider_1_9_103.entry.js} +185 -185
- package/dist/esm/{tttx-select-box_1_9_101.entry.js → tttx-select-box_1_9_103.entry.js} +239 -239
- package/dist/esm/{tttx-skeleton_loader_1_9_101.entry.js → tttx-skeleton_loader_1_9_103.entry.js} +30 -30
- package/dist/esm/{tttx-table_1_9_101.entry.js → tttx-table_1_9_103.entry.js} +72 -72
- package/dist/esm/{tttx-tabs_1_9_101.entry.js → tttx-tabs_1_9_103.entry.js} +103 -103
- package/dist/esm/{tttx-tag-v2_1_9_101.entry.js → tttx-tag-v2_1_9_103.entry.js} +72 -72
- package/dist/esm/{tttx-textarea_1_9_101.entry.js → tttx-textarea_1_9_103.entry.js} +50 -50
- package/dist/esm/{tttx-toggle_1_9_101.entry.js → tttx-toggle_1_9_103.entry.js} +30 -30
- package/dist/esm/{tttx-tooltip_1_9_101.entry.js → tttx-tooltip_1_9_103.entry.js} +87 -87
- package/dist/esm/{tttx-tree-view_1_9_101.entry.js → tttx-tree-view_1_9_103.entry.js} +342 -342
- package/dist/esm/tttx.js +1 -1
- package/dist/tttx/{p-b3f49d83.entry.js → p-0c5bc253.entry.js} +1 -1
- package/dist/tttx/{p-82b4e575.entry.js → p-10d2d044.entry.js} +1 -1
- package/dist/tttx/p-1623f3cf.entry.js +1 -1
- package/dist/tttx/{p-b161205b.entry.js → p-16aa3f67.entry.js} +1 -1
- package/dist/tttx/p-21707b8d.entry.js +1 -1
- package/dist/tttx/p-2251ab85.entry.js +1 -1
- package/dist/tttx/p-2d19c46c.entry.js +1 -1
- package/dist/tttx/p-358eaa44.entry.js +1 -1
- package/dist/tttx/p-362999b3.entry.js +1 -1
- package/dist/tttx/p-3ec67d75.entry.js +1 -1
- package/dist/tttx/p-44f0af69.entry.js +1 -1
- package/dist/tttx/p-4664d065.entry.js +1 -1
- package/dist/tttx/{p-00a849cf.entry.js → p-486ca932.entry.js} +1 -1
- package/dist/tttx/{p-e21e3a9c.entry.js → p-59115c8f.entry.js} +1 -1
- package/dist/tttx/p-5d289334.entry.js +1 -1
- package/dist/tttx/p-6ec18b4a.entry.js +1 -1
- package/dist/tttx/{p-a59ad197.entry.js → p-700c2816.entry.js} +1 -1
- package/dist/tttx/p-7b5b0670.entry.js +1 -1
- package/dist/tttx/p-7d1712fe.entry.js +1 -1
- package/dist/tttx/{p-41b69e01.entry.js → p-8f85ab3e.entry.js} +1 -1
- package/dist/tttx/p-a1b8ecda.entry.js +1 -1
- package/dist/tttx/p-a43e2c5e.entry.js +1 -1
- package/dist/tttx/p-b8cc0cb2.entry.js +1 -1
- package/dist/tttx/p-b9003a76.entry.js +1 -1
- package/dist/tttx/p-bb59054f.entry.js +1 -1
- package/dist/tttx/p-c66bc14c.entry.js +1 -1
- package/dist/tttx/p-c8051143.entry.js +1 -1
- package/dist/tttx/p-ca93f786.entry.js +1 -1
- package/dist/tttx/p-d21b0507.entry.js +1 -1
- package/dist/tttx/p-d945d492.entry.js +1 -1
- package/dist/tttx/{p-34e0e487.entry.js → p-df708b75.entry.js} +2 -2
- package/dist/tttx/p-f0c1380f.entry.js +1 -1
- package/dist/tttx/{p-0bb158ce.js → p-f411d1e5.js} +2 -2
- package/dist/tttx/{p-d4c4edbd.entry.js → p-fa25ee03.entry.js} +1 -1
- package/dist/tttx/{p-41f0bf7f.entry.js → p-fbdd1046.entry.js} +1 -1
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +11 -11
- package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +11 -11
- package/dist/types/components/atoms/tttx-button-v2/tttx-button-v2.d.ts +36 -36
- package/dist/types/components/atoms/tttx-button-v2/tttx-button-v2.stories.d.ts +68 -68
- package/dist/types/components/atoms/tttx-checkbox/tttx-checkbox.d.ts +17 -17
- package/dist/types/components/atoms/tttx-datacard/tttx-datacard.d.ts +21 -21
- package/dist/types/components/atoms/tttx-datacard/tttx-datacard.stories.d.ts +44 -44
- package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +9 -9
- package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +25 -25
- package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +13 -13
- package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +11 -11
- package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +23 -23
- package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +47 -47
- package/dist/types/components/atoms/tttx-percentage-bar/tttx-percentage-bar.d.ts +22 -22
- package/dist/types/components/atoms/tttx-percentage-bar/tttx-percentage-bar.stories.d.ts +10 -10
- package/dist/types/components/atoms/tttx-qrcode/tttx-qrcode.d.ts +8 -8
- package/dist/types/components/atoms/tttx-qrcode/tttx-qrcode.stories.d.ts +23 -23
- package/dist/types/components/atoms/tttx-skeleton-loader/tttx-skeleton-loader.d.ts +14 -14
- package/dist/types/components/atoms/tttx-tag/tttx-tag.d.ts +10 -10
- package/dist/types/components/atoms/tttx-tag/tttx-tag.stories.d.ts +51 -51
- package/dist/types/components/atoms/tttx-tag-v2/tttx-tag-v2.d.ts +15 -15
- package/dist/types/components/atoms/tttx-tag-v2/tttx-tag-v2.stories.d.ts +48 -48
- package/dist/types/components/atoms/tttx-toggle/tttx-toggle.d.ts +11 -11
- package/dist/types/components/atoms/tttx-toggle/tttx-toggle.stories.d.ts +6 -6
- package/dist/types/components/domsanitiser.options.d.ts +10 -10
- package/dist/types/components/molecules/tttx-action-dropdown/tttx-action-dropdown.d.ts +21 -21
- package/dist/types/components/molecules/tttx-chart/tttx-chart.d.ts +60 -60
- package/dist/types/components/molecules/tttx-chart/tttx-chart.stories.d.ts +38 -38
- package/dist/types/components/molecules/tttx-checkbox-group/components/tttx-checkbox-group-caption.d.ts +3 -3
- package/dist/types/components/molecules/tttx-checkbox-group/components/tttx-checkbox-group-heading.d.ts +3 -3
- package/dist/types/components/molecules/tttx-checkbox-group/tttx-checkbox-group.d.ts +3 -3
- package/dist/types/components/molecules/tttx-checkbox-group/tttx-checkbox-group.stories.d.ts +15 -15
- package/dist/types/components/molecules/tttx-comments/tttx-comments.d.ts +68 -68
- package/dist/types/components/molecules/tttx-date-range-picker/tttx-date-range-picker.d.ts +42 -42
- package/dist/types/components/molecules/tttx-dialog/icon-types.d.ts +18 -18
- package/dist/types/components/molecules/tttx-dialog/tttx-dialog.d.ts +27 -27
- package/dist/types/components/molecules/tttx-dialog-box/tttx-dialog-box.d.ts +26 -26
- package/dist/types/components/molecules/tttx-dialog-box/tttx-dialog-box.stories.d.ts +24 -24
- package/dist/types/components/molecules/tttx-expander/tttx-expander.d.ts +16 -16
- package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +44 -44
- package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +14 -14
- package/dist/types/components/molecules/tttx-form/lib/timecomparatorChecks.d.ts +4 -4
- package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +15 -15
- package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +297 -297
- package/dist/types/components/molecules/tttx-graph/gauge-label-plugin.d.ts +4 -4
- package/dist/types/components/molecules/tttx-graph/tttx-graph.d.ts +13 -13
- package/dist/types/components/molecules/tttx-graph/tttx-graph.stories.d.ts +26 -26
- package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +23 -23
- package/dist/types/components/molecules/tttx-multiselect-box/tttx-multiselect-box.d.ts +50 -50
- package/dist/types/components/molecules/tttx-range-slider/tttx-range-slider.d.ts +45 -45
- package/dist/types/components/molecules/tttx-range-slider/tttx-range-slider.stories.d.ts +7 -7
- package/dist/types/components/molecules/tttx-select-box/tttx-select-box.d.ts +55 -55
- package/dist/types/components/molecules/tttx-select-box/tttx-select-box.stories.d.ts +28 -28
- package/dist/types/components/molecules/tttx-sorter/tttx-sorter.d.ts +21 -21
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +69 -69
- package/dist/types/components/molecules/tttx-table/tttx-table.d.ts +32 -32
- package/dist/types/components/molecules/tttx-table/tttx-table.types.d.ts +6 -6
- package/dist/types/components/molecules/tttx-tabs/tttx-tabs.d.ts +25 -25
- package/dist/types/components/molecules/tttx-textarea/tttx-textarea.d.ts +42 -42
- package/dist/types/components/molecules/tttx-textarea/tttx-textarea.stories.d.ts +89 -89
- package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +8 -8
- package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +19 -19
- package/dist/types/components/molecules/tttx-tooltip/tttx-tooltip.d.ts +37 -37
- package/dist/types/components/molecules/tttx-tooltip/tttx-tootip.stories.d.ts +12 -12
- package/dist/types/components/molecules/tttx-tree-view/helper/helper.d.ts +24 -24
- package/dist/types/components/molecules/tttx-tree-view/tttx-tree-view.d.ts +57 -57
- package/dist/types/components/organisms/tttx-data-pattern/tttx-data-pattern.d.ts +11 -11
- package/dist/types/components/organisms/tttx-data-pattern/tttx-data-pattern.stories.d.ts +13 -13
- package/dist/types/components/palette.stories.d.ts +6 -6
- package/dist/types/components.d.ts +451 -451
- package/dist/types/icons.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/shared/domsanitiser.options.d.ts +10 -10
- package/package.json +1 -1
- package/dist/components/tttx-action-dropdown_1_9_101.d.ts +0 -11
- package/dist/components/tttx-button-v2_1_9_101.d.ts +0 -11
- package/dist/components/tttx-checkbox-group-caption_1_9_101.d.ts +0 -11
- package/dist/components/tttx-checkbox-group-heading_1_9_101.d.ts +0 -11
- package/dist/components/tttx-checkbox-group_1_9_101.d.ts +0 -11
- package/dist/components/tttx-checkbox_1_9_101.d.ts +0 -11
- package/dist/components/tttx-comments_1_9_101.d.ts +0 -11
- package/dist/components/tttx-data-pattern_1_9_101.d.ts +0 -11
- package/dist/components/tttx-datacard_1_9_101.d.ts +0 -11
- package/dist/components/tttx-dialog-box_1_9_101.d.ts +0 -11
- package/dist/components/tttx-expander_1_9_101.d.ts +0 -11
- package/dist/components/tttx-keyvalue-block_1_9_101.d.ts +0 -11
- package/dist/components/tttx-loading-spinner_1_9_101.d.ts +0 -11
- package/dist/components/tttx-multiselect-box_1_9_101.d.ts +0 -11
- package/dist/components/tttx-percentage-bar_1_9_101.d.ts +0 -11
- package/dist/components/tttx-qrcode_1_9_101.d.ts +0 -11
- package/dist/components/tttx-range-slider_1_9_101.d.ts +0 -11
- package/dist/components/tttx-select-box_1_9_101.d.ts +0 -11
- package/dist/components/tttx-skeleton_loader_1_9_101.d.ts +0 -11
- package/dist/components/tttx-sorter_1_9_101.d.ts +0 -11
- package/dist/components/tttx-standalone-input_1_9_101.d.ts +0 -11
- package/dist/components/tttx-textarea_1_9_101.d.ts +0 -11
- package/dist/components/tttx-toggle_1_9_101.d.ts +0 -11
- package/dist/components/tttx-toolbar_1_9_101.d.ts +0 -11
- package/dist/components/tttx-tooltip_1_9_101.d.ts +0 -11
- package/dist/components/tttx-tree-view_1_9_101.d.ts +0 -11
- package/dist/types/components/atoms/tttx-checkbox/tttx-checkbox.stories.d.ts +0 -47
- package/dist/types/components/atoms/tttx-skeleton-loader/tttx-skeleton-loader.stories.d.ts +0 -58
- package/dist/types/components/molecules/tttx-action-dropdown/tttx-action-dropdown.stories.d.ts +0 -36
- package/dist/types/components/molecules/tttx-comments/tttx-comments.stories.d.ts +0 -8
- package/dist/types/components/molecules/tttx-date-range-picker/tttx-date-range-picker.stories.d.ts +0 -28
- package/dist/types/components/molecules/tttx-dialog/tttx-dialog.stories.d.ts +0 -42
- package/dist/types/components/molecules/tttx-expander/tttx-expander.stories.d.ts +0 -27
- package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +0 -76
- package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +0 -718
- package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +0 -15
- package/dist/types/components/molecules/tttx-multiselect-box/tttx-multiselect-box.stories.d.ts +0 -17
- package/dist/types/components/molecules/tttx-sorter/tttx-sorter.stories.d.ts +0 -30
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +0 -150
- package/dist/types/components/molecules/tttx-table/tttx-table.stories.d.ts +0 -79
- package/dist/types/components/molecules/tttx-tabs/tttx-tabs.stories.d.ts +0 -13
- package/dist/types/components/molecules/tttx-tree-view/tttx-tree-view.stories.d.ts +0 -15
- /package/dist/tttx/{p-55799798.js → p-62d92a44.js} +0 -0
|
@@ -1,793 +1,793 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import Chart from 'chart.js/auto';
|
|
3
|
-
import 'chartjs-adapter-date-fns';
|
|
4
|
-
export class TttxChart {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.chartType = undefined;
|
|
7
|
-
this.chartData = undefined;
|
|
8
|
-
this.chartOptions = undefined;
|
|
9
|
-
this.loading = false;
|
|
10
|
-
this.error = undefined;
|
|
11
|
-
this.fallbackText = 'No data available';
|
|
12
|
-
this.width = '100%';
|
|
13
|
-
this.height = 'auto';
|
|
14
|
-
this.isYAxisPercentageValues = false;
|
|
15
|
-
this.showActiveSegmentLabel = false;
|
|
16
|
-
this.initialActiveIndex = 0;
|
|
17
|
-
this.activeSegmentChangeCallback = undefined;
|
|
18
|
-
this.exportable = false;
|
|
19
|
-
this.chartInstance = undefined;
|
|
20
|
-
this.showPngSvgExport = false;
|
|
21
|
-
this.selectedSegmentIndex = null;
|
|
22
|
-
this.hoverSegmentIndex = null;
|
|
23
|
-
}
|
|
24
|
-
handleUpdate(newData) {
|
|
25
|
-
if (!newData || !newData.datasets || newData.datasets.length === 0) {
|
|
26
|
-
this.destroyChart();
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
if (this.chartType === 'line') {
|
|
30
|
-
setTimeout(() => {
|
|
31
|
-
this.renderChart();
|
|
32
|
-
}, 0);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (this.chartType === 'doughnut-v2') {
|
|
36
|
-
if (this.hasChartDataChanged()) {
|
|
37
|
-
this.renderChart();
|
|
38
|
-
this.previousChartData = this.deepClone(this.chartData);
|
|
39
|
-
}
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
this.renderChart();
|
|
43
|
-
}
|
|
44
|
-
componentDidLoad() {
|
|
45
|
-
if (this.chartType === 'doughnut-v2') {
|
|
46
|
-
this.previousChartData = this.deepClone(this.chartData);
|
|
47
|
-
}
|
|
48
|
-
this.renderChart();
|
|
49
|
-
this.notifyActiveSegment();
|
|
50
|
-
}
|
|
51
|
-
hasChartDataChanged() {
|
|
52
|
-
if (!this.previousChartData)
|
|
53
|
-
return true;
|
|
54
|
-
try {
|
|
55
|
-
return JSON.stringify(this.previousChartData) !== JSON.stringify(this.chartData);
|
|
56
|
-
}
|
|
57
|
-
catch (_a) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
deepClone(obj) {
|
|
62
|
-
try {
|
|
63
|
-
return JSON.parse(JSON.stringify(obj));
|
|
64
|
-
}
|
|
65
|
-
catch (_a) {
|
|
66
|
-
return obj;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
disconnectedCallback() {
|
|
70
|
-
this.destroyChart();
|
|
71
|
-
}
|
|
72
|
-
renderChart() {
|
|
73
|
-
var _a, _b, _c;
|
|
74
|
-
if (!this.canvasEl || !this.chartData || !this.chartType)
|
|
75
|
-
return;
|
|
76
|
-
this.destroyChart();
|
|
77
|
-
const chartData = Object.assign(Object.assign({}, this.chartData), { datasets: ((_a = this.chartData.datasets) === null || _a === void 0 ? void 0 : _a.map(d => (Object.assign({}, d)))) || [] });
|
|
78
|
-
const config = {
|
|
79
|
-
type: this.getChartJsType(),
|
|
80
|
-
data: chartData,
|
|
81
|
-
options: this.getChartOptions(),
|
|
82
|
-
plugins: []
|
|
83
|
-
};
|
|
84
|
-
if (this.chartType === 'doughnut' || this.chartType === 'semi-gauge' || this.chartType === 'doughnut-v2') {
|
|
85
|
-
const total = ((_c = (_b = chartData.datasets[0]) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.map((d) => Number(d) || 0).reduce((a, b) => a + b, 0)) || 0;
|
|
86
|
-
config.plugins.push(this.getCenterTextPlugin(total.toLocaleString()));
|
|
87
|
-
}
|
|
88
|
-
if (this.chartType === 'doughnut-v2') {
|
|
89
|
-
config.plugins.push(this.getLegendHoverPlugin());
|
|
90
|
-
}
|
|
91
|
-
// create chart
|
|
92
|
-
this.chartInstance = new Chart(this.canvasEl, config);
|
|
93
|
-
// Initialize colors for doughnut-v2
|
|
94
|
-
if (this.chartType === 'doughnut-v2') {
|
|
95
|
-
this.chartInstance.setDatasetVisibility(0, true);
|
|
96
|
-
this.updateChartColors();
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
destroyChart() {
|
|
100
|
-
if (this.chartInstance) {
|
|
101
|
-
this.chartInstance.destroy();
|
|
102
|
-
this.chartInstance = undefined;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
getChartJsType() {
|
|
106
|
-
if (this.chartType === 'semi-gauge' || this.chartType === 'doughnut-v2')
|
|
107
|
-
return 'doughnut';
|
|
108
|
-
return this.chartType;
|
|
109
|
-
}
|
|
110
|
-
getBaseOptions() {
|
|
111
|
-
return {
|
|
112
|
-
responsive: true,
|
|
113
|
-
maintainAspectRatio: false,
|
|
114
|
-
plugins: {
|
|
115
|
-
legend: {
|
|
116
|
-
display: true,
|
|
117
|
-
position: 'bottom',
|
|
118
|
-
labels: {
|
|
119
|
-
usePointStyle: true,
|
|
120
|
-
pointStyle: 'circle',
|
|
121
|
-
font: {
|
|
122
|
-
size: 14
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
tooltip: {
|
|
127
|
-
callbacks: {
|
|
128
|
-
label: (ctx) => {
|
|
129
|
-
const label = ctx.label || ctx.dataset.label || '';
|
|
130
|
-
// Convert value to number and fix to 2 decimal places
|
|
131
|
-
const value = Number(ctx.raw);
|
|
132
|
-
const formattedValue = isNaN(value) ? ctx.formattedValue : value.toFixed(2);
|
|
133
|
-
return `${label}: ${formattedValue}`;
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
backgroundColor: '#17272B'
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
getLineChartConfig() {
|
|
142
|
-
const startOfCurrentMonth = new Date();
|
|
143
|
-
startOfCurrentMonth.setDate(1);
|
|
144
|
-
startOfCurrentMonth.setHours(0, 0, 0, 0);
|
|
145
|
-
return {
|
|
146
|
-
responsive: true,
|
|
147
|
-
maintainAspectRatio: false,
|
|
148
|
-
animation: { duration: 0 },
|
|
149
|
-
elements: {
|
|
150
|
-
point: { radius: 0, hoverRadius: 4 },
|
|
151
|
-
},
|
|
152
|
-
plugins: {
|
|
153
|
-
legend: {
|
|
154
|
-
labels: {
|
|
155
|
-
padding: 20,
|
|
156
|
-
generateLabels: (chart) => {
|
|
157
|
-
return chart.data.datasets.map((dataset, i) => ({
|
|
158
|
-
text: dataset.label || '',
|
|
159
|
-
strokeStyle: dataset.borderColor,
|
|
160
|
-
fillStyle: dataset.backgroundColor || 'transparent',
|
|
161
|
-
lineDash: dataset.borderDash || [],
|
|
162
|
-
lineWidth: dataset.borderWidth || 2,
|
|
163
|
-
hidden: !chart.isDatasetVisible(i),
|
|
164
|
-
datasetIndex: i,
|
|
165
|
-
pointStyle: 'line',
|
|
166
|
-
}));
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
tooltip: {
|
|
171
|
-
mode: 'index',
|
|
172
|
-
intersect: false,
|
|
173
|
-
backgroundColor: '#17272B',
|
|
174
|
-
titleFont: { size: 14, weight: 'bold' },
|
|
175
|
-
bodyFont: { size: 12 },
|
|
176
|
-
callbacks: {
|
|
177
|
-
title: (context) => {
|
|
178
|
-
var _a, _b;
|
|
179
|
-
if (!context || !context.length)
|
|
180
|
-
return '';
|
|
181
|
-
const date = new Date((_b = (_a = context[0].parsed) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : context[0].label);
|
|
182
|
-
return date.toLocaleDateString(undefined, {
|
|
183
|
-
day: '2-digit',
|
|
184
|
-
month: 'short',
|
|
185
|
-
year: 'numeric',
|
|
186
|
-
});
|
|
187
|
-
},
|
|
188
|
-
label: (ctx) => {
|
|
189
|
-
const rawValue = ctx.parsed && ctx.parsed.y !== undefined ? ctx.parsed.y : ctx.raw;
|
|
190
|
-
// Format to max 2 decimal places
|
|
191
|
-
const value = Number(rawValue);
|
|
192
|
-
const formattedValue = isNaN(value) ? rawValue : value.toFixed(2);
|
|
193
|
-
return `${ctx.dataset.label}: ${formattedValue}${this.isYAxisPercentageValues ? '%' : ''}`;
|
|
194
|
-
},
|
|
195
|
-
labelColor: (ctx) => {
|
|
196
|
-
if (ctx.dataset.label !== 'Overall') {
|
|
197
|
-
return {
|
|
198
|
-
borderWidth: 2
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
return {
|
|
202
|
-
borderWidth: 2,
|
|
203
|
-
borderColor: ctx.dataset.borderColor,
|
|
204
|
-
backgroundColor: ctx.dataset.borderColor,
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
interaction: {
|
|
211
|
-
mode: 'index',
|
|
212
|
-
intersect: false,
|
|
213
|
-
},
|
|
214
|
-
scales: {
|
|
215
|
-
x: {
|
|
216
|
-
type: 'time',
|
|
217
|
-
time: {
|
|
218
|
-
unit: 'month',
|
|
219
|
-
displayFormats: {
|
|
220
|
-
month: 'MMM yyyy',
|
|
221
|
-
},
|
|
222
|
-
tooltipFormat: 'dd MMM yyyy',
|
|
223
|
-
},
|
|
224
|
-
grid: { color: '#E5E5E5' },
|
|
225
|
-
border: { dash: [4, 4] },
|
|
226
|
-
ticks: {
|
|
227
|
-
autoSkip: true,
|
|
228
|
-
maxRotation: 0,
|
|
229
|
-
},
|
|
230
|
-
},
|
|
231
|
-
y: {
|
|
232
|
-
min: 0,
|
|
233
|
-
max: 100,
|
|
234
|
-
beginAtZero: true,
|
|
235
|
-
ticks: {
|
|
236
|
-
stepSize: 20,
|
|
237
|
-
callback: (value) => {
|
|
238
|
-
const numValue = Number(value);
|
|
239
|
-
const formatted = isNaN(numValue) ? value : (Number.isInteger(numValue) ? numValue : numValue.toFixed(2));
|
|
240
|
-
return this.isYAxisPercentageValues ? `${formatted}%` : formatted;
|
|
241
|
-
},
|
|
242
|
-
},
|
|
243
|
-
grid: { color: '#E5E5E5' },
|
|
244
|
-
border: { dash: [4, 4] },
|
|
245
|
-
},
|
|
246
|
-
},
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
getDoughnutChartConfig() {
|
|
250
|
-
return {
|
|
251
|
-
plugins: {
|
|
252
|
-
legend: { labels: { pointStyle: 'circle', padding: 16, } },
|
|
253
|
-
},
|
|
254
|
-
cutout: '60%'
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
getDoughnutV2ChartConfig() {
|
|
258
|
-
return {
|
|
259
|
-
plugins: {
|
|
260
|
-
legend: {
|
|
261
|
-
labels: {
|
|
262
|
-
pointStyle: 'circle',
|
|
263
|
-
padding: 16
|
|
264
|
-
},
|
|
265
|
-
onClick: (e, legendItem) => {
|
|
266
|
-
e.stopPropagation();
|
|
267
|
-
const index = legendItem.index;
|
|
268
|
-
if (this.selectedSegmentIndex !== index) {
|
|
269
|
-
this.selectedSegmentIndex = index;
|
|
270
|
-
this.updateChartColors();
|
|
271
|
-
this.notifyActiveSegment();
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
tooltip: {
|
|
276
|
-
enabled: false
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
cutout: '60%',
|
|
280
|
-
onHover: (_event, activeElements) => {
|
|
281
|
-
if (activeElements && activeElements.length > 0) {
|
|
282
|
-
this.hoverSegmentIndex = activeElements[0].index;
|
|
283
|
-
this.updateChartColors();
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
this.hoverSegmentIndex = null;
|
|
287
|
-
this.updateChartColors();
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
onClick: (_event, activeElements) => {
|
|
291
|
-
if (activeElements && activeElements.length > 0) {
|
|
292
|
-
const clickedIndex = activeElements[0].index;
|
|
293
|
-
if (this.selectedSegmentIndex !== clickedIndex) {
|
|
294
|
-
this.selectedSegmentIndex = clickedIndex;
|
|
295
|
-
this.updateChartColors();
|
|
296
|
-
this.notifyActiveSegment();
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
updateChartColors() {
|
|
303
|
-
var _a, _b, _c, _d;
|
|
304
|
-
if (!this.chartInstance || this.chartType !== 'doughnut-v2')
|
|
305
|
-
return;
|
|
306
|
-
const dataset = this.chartInstance.data.datasets[0];
|
|
307
|
-
const chartDataDataset = (_b = (_a = this.chartData) === null || _a === void 0 ? void 0 : _a.datasets) === null || _b === void 0 ? void 0 : _b[0];
|
|
308
|
-
if (this.chartType === 'doughnut-v2' && this.chartInstance.isDatasetVisible(0) === false) {
|
|
309
|
-
this.chartInstance.setDatasetVisibility(0, true);
|
|
310
|
-
}
|
|
311
|
-
// Default color for doughnut-v2
|
|
312
|
-
const defaultSelectedColor = '#45C9B0';
|
|
313
|
-
const defaultHoverColor = '#A3A3A3';
|
|
314
|
-
const defaultInactiveColor = '#E5E5E5';
|
|
315
|
-
const selectedColors = chartDataDataset === null || chartDataDataset === void 0 ? void 0 : chartDataDataset.selectedColors;
|
|
316
|
-
const hoverColors = chartDataDataset === null || chartDataDataset === void 0 ? void 0 : chartDataDataset.hoverColors;
|
|
317
|
-
const inactiveColors = chartDataDataset === null || chartDataDataset === void 0 ? void 0 : chartDataDataset.inactiveColors;
|
|
318
|
-
let newColors = [];
|
|
319
|
-
if (this.selectedSegmentIndex !== null) {
|
|
320
|
-
newColors = dataset.data.map((_, index) => {
|
|
321
|
-
if (index === this.hoverSegmentIndex) {
|
|
322
|
-
return (hoverColors === null || hoverColors === void 0 ? void 0 : hoverColors[index]) || defaultHoverColor;
|
|
323
|
-
}
|
|
324
|
-
else if (index === this.selectedSegmentIndex) {
|
|
325
|
-
return (selectedColors === null || selectedColors === void 0 ? void 0 : selectedColors[index]) || defaultSelectedColor;
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
return (inactiveColors === null || inactiveColors === void 0 ? void 0 : inactiveColors[index]) || defaultInactiveColor;
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
else if (this.hoverSegmentIndex !== null) {
|
|
333
|
-
const activeIndex = (_c = this.initialActiveIndex) !== null && _c !== void 0 ? _c : 0;
|
|
334
|
-
newColors = dataset.data.map((_, index) => {
|
|
335
|
-
if (index === this.hoverSegmentIndex) {
|
|
336
|
-
return (hoverColors === null || hoverColors === void 0 ? void 0 : hoverColors[index]) || defaultHoverColor;
|
|
337
|
-
}
|
|
338
|
-
else if (index === activeIndex) {
|
|
339
|
-
return (selectedColors === null || selectedColors === void 0 ? void 0 : selectedColors[index]) || defaultSelectedColor;
|
|
340
|
-
}
|
|
341
|
-
else {
|
|
342
|
-
return (inactiveColors === null || inactiveColors === void 0 ? void 0 : inactiveColors[index]) || defaultInactiveColor;
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
else {
|
|
347
|
-
// No hover or selection: show initial active state
|
|
348
|
-
const activeIndex = (_d = this.initialActiveIndex) !== null && _d !== void 0 ? _d : 0;
|
|
349
|
-
newColors = dataset.data.map((_, index) => {
|
|
350
|
-
if (index === activeIndex) {
|
|
351
|
-
return (selectedColors === null || selectedColors === void 0 ? void 0 : selectedColors[index]) || defaultSelectedColor;
|
|
352
|
-
}
|
|
353
|
-
return (inactiveColors === null || inactiveColors === void 0 ? void 0 : inactiveColors[index]) || defaultInactiveColor;
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
dataset.backgroundColor = newColors;
|
|
357
|
-
this.chartInstance.update('active');
|
|
358
|
-
}
|
|
359
|
-
lightenColor(color, percent) {
|
|
360
|
-
if (!color || !color.startsWith('#'))
|
|
361
|
-
return color;
|
|
362
|
-
const num = parseInt(color.replace('#', ''), 16);
|
|
363
|
-
const r = Math.min(255, ((num >> 16) & 0xFF) + percent);
|
|
364
|
-
const g = Math.min(255, ((num >> 8) & 0xFF) + percent);
|
|
365
|
-
const b = Math.min(255, (num & 0xFF) + percent);
|
|
366
|
-
return `#${((r << 16) | (g << 8) | b).toString(16).padStart(6, '0')}`;
|
|
367
|
-
}
|
|
368
|
-
getCenterTextPlugin(value) {
|
|
369
|
-
return {
|
|
370
|
-
id: 'centerText',
|
|
371
|
-
afterDatasetsDraw: (chart) => {
|
|
372
|
-
var _a, _b;
|
|
373
|
-
const { ctx } = chart;
|
|
374
|
-
ctx.save();
|
|
375
|
-
const x = chart.getDatasetMeta(0).data[0].x;
|
|
376
|
-
let y = chart.getDatasetMeta(0).data[0].y;
|
|
377
|
-
if (this.chartType === 'semi-gauge') {
|
|
378
|
-
y -= 20;
|
|
379
|
-
}
|
|
380
|
-
let displayValue = value;
|
|
381
|
-
if (this.chartType === 'doughnut-v2') {
|
|
382
|
-
const activeIndex = this.selectedSegmentIndex !== null
|
|
383
|
-
? this.selectedSegmentIndex
|
|
384
|
-
: ((_a = this.initialActiveIndex) !== null && _a !== void 0 ? _a : 0);
|
|
385
|
-
const segmentValue = (_b = this.chartData.datasets[0]) === null || _b === void 0 ? void 0 : _b.data[activeIndex];
|
|
386
|
-
displayValue = Number(segmentValue || 0).toLocaleString();
|
|
387
|
-
}
|
|
388
|
-
ctx.font = 'bold 20px Roboto';
|
|
389
|
-
ctx.fillStyle = '#111';
|
|
390
|
-
ctx.textAlign = 'center';
|
|
391
|
-
ctx.textBaseline = 'middle';
|
|
392
|
-
ctx.fillText(displayValue, x, y);
|
|
393
|
-
},
|
|
394
|
-
};
|
|
395
|
-
}
|
|
396
|
-
getLegendHoverPlugin() {
|
|
397
|
-
return {
|
|
398
|
-
id: 'legendHover',
|
|
399
|
-
afterDraw: (chart) => {
|
|
400
|
-
if (this.hoverSegmentIndex === null)
|
|
401
|
-
return;
|
|
402
|
-
const legend = chart.legend;
|
|
403
|
-
if (!legend || !legend.legendItems)
|
|
404
|
-
return;
|
|
405
|
-
const ctx = chart.ctx;
|
|
406
|
-
const legendItem = legend.legendItems[this.hoverSegmentIndex];
|
|
407
|
-
if (!legendItem)
|
|
408
|
-
return;
|
|
409
|
-
const boxes = legend.legendHitBoxes;
|
|
410
|
-
if (!boxes || !boxes[this.hoverSegmentIndex])
|
|
411
|
-
return;
|
|
412
|
-
const box = boxes[this.hoverSegmentIndex];
|
|
413
|
-
const padding = 8;
|
|
414
|
-
const borderRadius = 4;
|
|
415
|
-
ctx.save();
|
|
416
|
-
ctx.fillStyle = '#f5f5f5';
|
|
417
|
-
ctx.beginPath();
|
|
418
|
-
ctx.roundRect(box.left - padding, box.top - padding, box.width + padding * 2, box.height + padding * 2, borderRadius);
|
|
419
|
-
ctx.fill();
|
|
420
|
-
const pointRadius = 8;
|
|
421
|
-
const pointX = box.left + pointRadius;
|
|
422
|
-
const pointY = box.top + box.height / 2;
|
|
423
|
-
ctx.fillStyle = '#D1D5DB';
|
|
424
|
-
ctx.beginPath();
|
|
425
|
-
ctx.arc(pointX, pointY, pointRadius, 0, 2 * Math.PI);
|
|
426
|
-
ctx.fill();
|
|
427
|
-
ctx.fillStyle = '#9CA3AF';
|
|
428
|
-
ctx.font = '14px Roboto, sans-serif';
|
|
429
|
-
ctx.textBaseline = 'middle';
|
|
430
|
-
ctx.textAlign = 'left';
|
|
431
|
-
ctx.fillText(legendItem.text, box.left + pointRadius * 2 + 4, pointY);
|
|
432
|
-
ctx.restore();
|
|
433
|
-
},
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
getSemiGaugeChartConfig() {
|
|
437
|
-
return {
|
|
438
|
-
plugins: {
|
|
439
|
-
legend: { labels: { pointStyle: 'circle', padding: 16, } },
|
|
440
|
-
},
|
|
441
|
-
rotation: -90,
|
|
442
|
-
circumference: 180,
|
|
443
|
-
cutout: '70%',
|
|
444
|
-
};
|
|
445
|
-
}
|
|
446
|
-
merge(target, source) {
|
|
447
|
-
if (typeof target !== 'object' || typeof source !== 'object')
|
|
448
|
-
return source;
|
|
449
|
-
for (const key of Object.keys(source)) {
|
|
450
|
-
if (source[key] instanceof Object && key in target) {
|
|
451
|
-
target[key] = this.merge(Object.assign({}, target[key]), source[key]);
|
|
452
|
-
}
|
|
453
|
-
else {
|
|
454
|
-
target[key] = source[key];
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
return target;
|
|
458
|
-
}
|
|
459
|
-
getChartOptions() {
|
|
460
|
-
const base = this.getBaseOptions();
|
|
461
|
-
let specific = {};
|
|
462
|
-
if (this.chartType === 'line')
|
|
463
|
-
specific = this.getLineChartConfig();
|
|
464
|
-
else if (this.chartType === 'doughnut')
|
|
465
|
-
specific = this.getDoughnutChartConfig();
|
|
466
|
-
else if (this.chartType === 'semi-gauge')
|
|
467
|
-
specific = this.getSemiGaugeChartConfig();
|
|
468
|
-
else if (this.chartType === 'doughnut-v2')
|
|
469
|
-
specific = this.getDoughnutV2ChartConfig();
|
|
470
|
-
return this.merge(this.merge(base, specific), this.chartOptions || {});
|
|
471
|
-
}
|
|
472
|
-
exportChart(format) {
|
|
473
|
-
if (!this.chartInstance)
|
|
474
|
-
return;
|
|
475
|
-
const link = document.createElement('a');
|
|
476
|
-
link.download = `chart-export.${format}`;
|
|
477
|
-
if (format === 'png') {
|
|
478
|
-
link.href = this.chartInstance.toBase64Image('image/png');
|
|
479
|
-
}
|
|
480
|
-
else {
|
|
481
|
-
const svgData = new XMLSerializer().serializeToString(this.canvasEl);
|
|
482
|
-
const blob = new Blob([svgData], { type: 'image/svg+xml' });
|
|
483
|
-
link.href = URL.createObjectURL(blob);
|
|
484
|
-
}
|
|
485
|
-
link.click();
|
|
486
|
-
}
|
|
487
|
-
getErrorContent() {
|
|
488
|
-
return this.commonContent('warning', 'Something went wrong', 'We ran into an issue while trying to load this widget.', '#DC0000', true);
|
|
489
|
-
}
|
|
490
|
-
getNoDataContent() {
|
|
491
|
-
return this.commonContent('ssid_chart', 'No data available', 'There is currently no data available to show performance trends.', '#111');
|
|
492
|
-
}
|
|
493
|
-
commonContent(iconName, heading, message, iconColor, showActions = false) {
|
|
494
|
-
return (h("div", { class: "error-content" }, h("tttx-
|
|
495
|
-
}
|
|
496
|
-
notifyActiveSegment() {
|
|
497
|
-
var _a, _b;
|
|
498
|
-
if (this.chartType !== 'doughnut-v2' || !this.chartData)
|
|
499
|
-
return;
|
|
500
|
-
const activeIndex = this.selectedSegmentIndex !== null
|
|
501
|
-
? this.selectedSegmentIndex
|
|
502
|
-
: ((_a = this.initialActiveIndex) !== null && _a !== void 0 ? _a : 0);
|
|
503
|
-
const label = ((_b = this.chartData.labels) === null || _b === void 0 ? void 0 : _b[activeIndex]) || '';
|
|
504
|
-
if (this.activeSegmentChangeCallback) {
|
|
505
|
-
this.activeSegmentChangeCallback(label);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
render() {
|
|
509
|
-
var _a, _b, _c;
|
|
510
|
-
return (h("div", { class: "chart-wrapper", style: { width: this.width, height: this.height } }, this.loading && h("div", { class: "chart-loading" }, h("tttx-loading-
|
|
511
|
-
width: '100%',
|
|
512
|
-
height: '100%',
|
|
513
|
-
cursor: this.chartType === 'doughnut-v2' ? 'pointer' : 'default'
|
|
514
|
-
} }))), this.exportable && !this.loading && !this.error && (h("div", { class: "export-buttons" }, this.showPngSvgExport && h("tttx-
|
|
515
|
-
}
|
|
516
|
-
static get is() { return "tttx-
|
|
517
|
-
static get encapsulation() { return "shadow"; }
|
|
518
|
-
static get originalStyleUrls() {
|
|
519
|
-
return {
|
|
520
|
-
"$": ["tttx-chart.scss"]
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
static get styleUrls() {
|
|
524
|
-
return {
|
|
525
|
-
"$": ["tttx-chart.css"]
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
static get properties() {
|
|
529
|
-
return {
|
|
530
|
-
"chartType": {
|
|
531
|
-
"type": "string",
|
|
532
|
-
"mutable": false,
|
|
533
|
-
"complexType": {
|
|
534
|
-
"original": "'line' | 'doughnut' | 'semi-gauge' | 'doughnut-v2'",
|
|
535
|
-
"resolved": "\"doughnut\" | \"doughnut-v2\" | \"line\" | \"semi-gauge\"",
|
|
536
|
-
"references": {}
|
|
537
|
-
},
|
|
538
|
-
"required": false,
|
|
539
|
-
"optional": false,
|
|
540
|
-
"docs": {
|
|
541
|
-
"tags": [],
|
|
542
|
-
"text": ""
|
|
543
|
-
},
|
|
544
|
-
"attribute": "chart-type",
|
|
545
|
-
"reflect": false
|
|
546
|
-
},
|
|
547
|
-
"chartData": {
|
|
548
|
-
"type": "unknown",
|
|
549
|
-
"mutable": false,
|
|
550
|
-
"complexType": {
|
|
551
|
-
"original": "ChartData",
|
|
552
|
-
"resolved": "ChartData<keyof ChartTypeRegistry, (number | Point | [number, number] | BubbleDataPoint)[], unknown>",
|
|
553
|
-
"references": {
|
|
554
|
-
"ChartData": {
|
|
555
|
-
"location": "import",
|
|
556
|
-
"path": "chart.js"
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
},
|
|
560
|
-
"required": false,
|
|
561
|
-
"optional": false,
|
|
562
|
-
"docs": {
|
|
563
|
-
"tags": [],
|
|
564
|
-
"text": ""
|
|
565
|
-
}
|
|
566
|
-
},
|
|
567
|
-
"chartOptions": {
|
|
568
|
-
"type": "unknown",
|
|
569
|
-
"mutable": false,
|
|
570
|
-
"complexType": {
|
|
571
|
-
"original": "ChartOptions",
|
|
572
|
-
"resolved": "{ datasets?: _DeepPartialObject<{ line: LineControllerDatasetOptions & FillerControllerDatasetOptions; bar: BarControllerDatasetOptions; radar: RadarControllerDatasetOptions & FillerControllerDatasetOptions; doughnut: DoughnutControllerDatasetOptions; scatter: LineControllerDatasetOptions; bubble: BubbleControllerDatasetOptions; pie: DoughnutControllerDatasetOptions; polarArea: PolarAreaControllerDatasetOptions; }>; indexAxis?: \"x\" | \"y\"; clip?: number | false | _DeepPartialObject<ChartArea>; color?: string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern> | ((ctx: ScriptableContext<keyof ChartTypeRegistry>, options: AnyObject) => Color); backgroundColor?: string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern> | readonly (string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern>)[] | ((ctx: ScriptableContext<keyof ChartTypeRegistry>, options: AnyObject) => Color); hoverBackgroundColor?: string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern> | readonly (string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern>)[] | ((ctx: ScriptableContext<keyof ChartTypeRegistry>, options: AnyObject) => Color); borderColor?: string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern> | readonly (string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern>)[] | ((ctx: ScriptableContext<keyof ChartTypeRegistry>, options: AnyObject) => Color); hoverBorderColor?: string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern> | readonly (string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern>)[] | ((ctx: ScriptableContext<keyof ChartTypeRegistry>, options: AnyObject) => Color); font?: _DeepPartialObject<Partial<FontSpec>>; responsive?: boolean; maintainAspectRatio?: boolean; resizeDelay?: number; aspectRatio?: number; locale?: string; onResize?: (chart: Chart<keyof ChartTypeRegistry, (number | Point | [number, number] | BubbleDataPoint)[], unknown>, size: { width: number; height: number; }) => void; devicePixelRatio?: number; interaction?: _DeepPartialObject<CoreInteractionOptions>; hover?: _DeepPartialObject<CoreInteractionOptions>; events?: _DeepPartialArray<keyof HTMLElementEventMap>; onHover?: (event: ChartEvent, elements: ActiveElement[], chart: Chart<keyof ChartTypeRegistry, (number | Point | [number, number] | BubbleDataPoint)[], unknown>) => void; onClick?: (event: ChartEvent, elements: ActiveElement[], chart: Chart<keyof ChartTypeRegistry, (number | Point | [number, number] | BubbleDataPoint)[], unknown>) => void; layout?: _DeepPartialObject<Partial<{ autoPadding: boolean; padding: Scriptable<Padding, ScriptableContext<keyof ChartTypeRegistry>>; }>>; parsing?: false | _DeepPartialObject<{ [key: string]: string; }>; normalized?: boolean; animation?: false | _DeepPartialObject<AnimationSpec<keyof ChartTypeRegistry> & { onProgress?: (this: Chart<keyof ChartTypeRegistry, (number | Point | [number, number] | BubbleDataPoint)[], unknown>, event: AnimationEvent) => void; onComplete?: (this: Chart<keyof ChartTypeRegistry, (number | Point | [number, number] | BubbleDataPoint)[], unknown>, event: AnimationEvent) => void; }>; animations?: _DeepPartialObject<AnimationsSpec<keyof ChartTypeRegistry>>; transitions?: _DeepPartialObject<TransitionsSpec<keyof ChartTypeRegistry>>; elements?: _DeepPartialObject<ElementOptionsByType<keyof ChartTypeRegistry>>; plugins?: _DeepPartialObject<PluginOptionsByType<keyof ChartTypeRegistry>>; line?: _DeepPartialObject<{ datasets: LineControllerDatasetOptions & FillerControllerDatasetOptions; }>; bar?: _DeepPartialObject<{ datasets: BarControllerDatasetOptions; }>; radar?: _DeepPartialObject<{ datasets: RadarControllerDatasetOptions & FillerControllerDatasetOptions; }>; doughnut?: _DeepPartialObject<{ datasets: DoughnutControllerDatasetOptions; }>; scatter?: _DeepPartialObject<{ datasets: LineControllerDatasetOptions; }>; bubble?: _DeepPartialObject<{ datasets: BubbleControllerDatasetOptions; }>; pie?: _DeepPartialObject<{ datasets: DoughnutControllerDatasetOptions; }>; polarArea?: _DeepPartialObject<{ datasets: PolarAreaControllerDatasetOptions; }>; scales?: _DeepPartialObject<{ [key: string]: ScaleOptionsByType<\"radialLinear\" | keyof CartesianScaleTypeRegistry>; }>; }",
|
|
573
|
-
"references": {
|
|
574
|
-
"ChartOptions": {
|
|
575
|
-
"location": "import",
|
|
576
|
-
"path": "chart.js"
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
},
|
|
580
|
-
"required": false,
|
|
581
|
-
"optional": true,
|
|
582
|
-
"docs": {
|
|
583
|
-
"tags": [],
|
|
584
|
-
"text": ""
|
|
585
|
-
}
|
|
586
|
-
},
|
|
587
|
-
"loading": {
|
|
588
|
-
"type": "boolean",
|
|
589
|
-
"mutable": false,
|
|
590
|
-
"complexType": {
|
|
591
|
-
"original": "boolean",
|
|
592
|
-
"resolved": "boolean",
|
|
593
|
-
"references": {}
|
|
594
|
-
},
|
|
595
|
-
"required": false,
|
|
596
|
-
"optional": true,
|
|
597
|
-
"docs": {
|
|
598
|
-
"tags": [],
|
|
599
|
-
"text": ""
|
|
600
|
-
},
|
|
601
|
-
"attribute": "loading",
|
|
602
|
-
"reflect": false,
|
|
603
|
-
"defaultValue": "false"
|
|
604
|
-
},
|
|
605
|
-
"error": {
|
|
606
|
-
"type": "boolean",
|
|
607
|
-
"mutable": false,
|
|
608
|
-
"complexType": {
|
|
609
|
-
"original": "boolean",
|
|
610
|
-
"resolved": "boolean",
|
|
611
|
-
"references": {}
|
|
612
|
-
},
|
|
613
|
-
"required": false,
|
|
614
|
-
"optional": true,
|
|
615
|
-
"docs": {
|
|
616
|
-
"tags": [],
|
|
617
|
-
"text": ""
|
|
618
|
-
},
|
|
619
|
-
"attribute": "error",
|
|
620
|
-
"reflect": false
|
|
621
|
-
},
|
|
622
|
-
"fallbackText": {
|
|
623
|
-
"type": "string",
|
|
624
|
-
"mutable": false,
|
|
625
|
-
"complexType": {
|
|
626
|
-
"original": "string",
|
|
627
|
-
"resolved": "string",
|
|
628
|
-
"references": {}
|
|
629
|
-
},
|
|
630
|
-
"required": false,
|
|
631
|
-
"optional": true,
|
|
632
|
-
"docs": {
|
|
633
|
-
"tags": [],
|
|
634
|
-
"text": ""
|
|
635
|
-
},
|
|
636
|
-
"attribute": "fallback-text",
|
|
637
|
-
"reflect": false,
|
|
638
|
-
"defaultValue": "'No data available'"
|
|
639
|
-
},
|
|
640
|
-
"width": {
|
|
641
|
-
"type": "string",
|
|
642
|
-
"mutable": false,
|
|
643
|
-
"complexType": {
|
|
644
|
-
"original": "string",
|
|
645
|
-
"resolved": "string",
|
|
646
|
-
"references": {}
|
|
647
|
-
},
|
|
648
|
-
"required": false,
|
|
649
|
-
"optional": false,
|
|
650
|
-
"docs": {
|
|
651
|
-
"tags": [],
|
|
652
|
-
"text": ""
|
|
653
|
-
},
|
|
654
|
-
"attribute": "width",
|
|
655
|
-
"reflect": false,
|
|
656
|
-
"defaultValue": "'100%'"
|
|
657
|
-
},
|
|
658
|
-
"height": {
|
|
659
|
-
"type": "string",
|
|
660
|
-
"mutable": false,
|
|
661
|
-
"complexType": {
|
|
662
|
-
"original": "string",
|
|
663
|
-
"resolved": "string",
|
|
664
|
-
"references": {}
|
|
665
|
-
},
|
|
666
|
-
"required": false,
|
|
667
|
-
"optional": false,
|
|
668
|
-
"docs": {
|
|
669
|
-
"tags": [],
|
|
670
|
-
"text": ""
|
|
671
|
-
},
|
|
672
|
-
"attribute": "height",
|
|
673
|
-
"reflect": false,
|
|
674
|
-
"defaultValue": "'auto'"
|
|
675
|
-
},
|
|
676
|
-
"isYAxisPercentageValues": {
|
|
677
|
-
"type": "boolean",
|
|
678
|
-
"mutable": false,
|
|
679
|
-
"complexType": {
|
|
680
|
-
"original": "boolean",
|
|
681
|
-
"resolved": "boolean",
|
|
682
|
-
"references": {}
|
|
683
|
-
},
|
|
684
|
-
"required": false,
|
|
685
|
-
"optional": false,
|
|
686
|
-
"docs": {
|
|
687
|
-
"tags": [],
|
|
688
|
-
"text": ""
|
|
689
|
-
},
|
|
690
|
-
"attribute": "is-y-axis-percentage-values",
|
|
691
|
-
"reflect": false,
|
|
692
|
-
"defaultValue": "false"
|
|
693
|
-
},
|
|
694
|
-
"showActiveSegmentLabel": {
|
|
695
|
-
"type": "boolean",
|
|
696
|
-
"mutable": false,
|
|
697
|
-
"complexType": {
|
|
698
|
-
"original": "boolean",
|
|
699
|
-
"resolved": "boolean",
|
|
700
|
-
"references": {}
|
|
701
|
-
},
|
|
702
|
-
"required": false,
|
|
703
|
-
"optional": false,
|
|
704
|
-
"docs": {
|
|
705
|
-
"tags": [],
|
|
706
|
-
"text": ""
|
|
707
|
-
},
|
|
708
|
-
"attribute": "show-active-segment-label",
|
|
709
|
-
"reflect": false,
|
|
710
|
-
"defaultValue": "false"
|
|
711
|
-
},
|
|
712
|
-
"initialActiveIndex": {
|
|
713
|
-
"type": "number",
|
|
714
|
-
"mutable": false,
|
|
715
|
-
"complexType": {
|
|
716
|
-
"original": "number",
|
|
717
|
-
"resolved": "number",
|
|
718
|
-
"references": {}
|
|
719
|
-
},
|
|
720
|
-
"required": false,
|
|
721
|
-
"optional": true,
|
|
722
|
-
"docs": {
|
|
723
|
-
"tags": [],
|
|
724
|
-
"text": ""
|
|
725
|
-
},
|
|
726
|
-
"attribute": "initial-active-index",
|
|
727
|
-
"reflect": false,
|
|
728
|
-
"defaultValue": "0"
|
|
729
|
-
},
|
|
730
|
-
"activeSegmentChangeCallback": {
|
|
731
|
-
"type": "unknown",
|
|
732
|
-
"mutable": false,
|
|
733
|
-
"complexType": {
|
|
734
|
-
"original": "(label: string) => void",
|
|
735
|
-
"resolved": "(label: string) => void",
|
|
736
|
-
"references": {}
|
|
737
|
-
},
|
|
738
|
-
"required": false,
|
|
739
|
-
"optional": true,
|
|
740
|
-
"docs": {
|
|
741
|
-
"tags": [],
|
|
742
|
-
"text": ""
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
};
|
|
746
|
-
}
|
|
747
|
-
static get states() {
|
|
748
|
-
return {
|
|
749
|
-
"exportable": {},
|
|
750
|
-
"chartInstance": {},
|
|
751
|
-
"showPngSvgExport": {},
|
|
752
|
-
"selectedSegmentIndex": {},
|
|
753
|
-
"hoverSegmentIndex": {}
|
|
754
|
-
};
|
|
755
|
-
}
|
|
756
|
-
static get events() {
|
|
757
|
-
return [{
|
|
758
|
-
"method": "exportCSV",
|
|
759
|
-
"name": "exportCSV",
|
|
760
|
-
"bubbles": true,
|
|
761
|
-
"cancelable": true,
|
|
762
|
-
"composed": true,
|
|
763
|
-
"docs": {
|
|
764
|
-
"tags": [],
|
|
765
|
-
"text": ""
|
|
766
|
-
},
|
|
767
|
-
"complexType": {
|
|
768
|
-
"original": "{ name: string }",
|
|
769
|
-
"resolved": "{ name: string; }",
|
|
770
|
-
"references": {}
|
|
771
|
-
}
|
|
772
|
-
}];
|
|
773
|
-
}
|
|
774
|
-
static get elementRef() { return "el"; }
|
|
775
|
-
static get watchers() {
|
|
776
|
-
return [{
|
|
777
|
-
"propName": "chartData",
|
|
778
|
-
"methodName": "handleUpdate"
|
|
779
|
-
}, {
|
|
780
|
-
"propName": "chartOptions",
|
|
781
|
-
"methodName": "handleUpdate"
|
|
782
|
-
}, {
|
|
783
|
-
"propName": "selectedSegmentIndex",
|
|
784
|
-
"methodName": "notifyActiveSegment"
|
|
785
|
-
}, {
|
|
786
|
-
"propName": "chartData",
|
|
787
|
-
"methodName": "notifyActiveSegment"
|
|
788
|
-
}, {
|
|
789
|
-
"propName": "initialActiveIndex",
|
|
790
|
-
"methodName": "notifyActiveSegment"
|
|
791
|
-
}];
|
|
792
|
-
}
|
|
793
|
-
}
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import Chart from 'chart.js/auto';
|
|
3
|
+
import 'chartjs-adapter-date-fns';
|
|
4
|
+
export class TttxChart {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.chartType = undefined;
|
|
7
|
+
this.chartData = undefined;
|
|
8
|
+
this.chartOptions = undefined;
|
|
9
|
+
this.loading = false;
|
|
10
|
+
this.error = undefined;
|
|
11
|
+
this.fallbackText = 'No data available';
|
|
12
|
+
this.width = '100%';
|
|
13
|
+
this.height = 'auto';
|
|
14
|
+
this.isYAxisPercentageValues = false;
|
|
15
|
+
this.showActiveSegmentLabel = false;
|
|
16
|
+
this.initialActiveIndex = 0;
|
|
17
|
+
this.activeSegmentChangeCallback = undefined;
|
|
18
|
+
this.exportable = false;
|
|
19
|
+
this.chartInstance = undefined;
|
|
20
|
+
this.showPngSvgExport = false;
|
|
21
|
+
this.selectedSegmentIndex = null;
|
|
22
|
+
this.hoverSegmentIndex = null;
|
|
23
|
+
}
|
|
24
|
+
handleUpdate(newData) {
|
|
25
|
+
if (!newData || !newData.datasets || newData.datasets.length === 0) {
|
|
26
|
+
this.destroyChart();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (this.chartType === 'line') {
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
this.renderChart();
|
|
32
|
+
}, 0);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (this.chartType === 'doughnut-v2') {
|
|
36
|
+
if (this.hasChartDataChanged()) {
|
|
37
|
+
this.renderChart();
|
|
38
|
+
this.previousChartData = this.deepClone(this.chartData);
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.renderChart();
|
|
43
|
+
}
|
|
44
|
+
componentDidLoad() {
|
|
45
|
+
if (this.chartType === 'doughnut-v2') {
|
|
46
|
+
this.previousChartData = this.deepClone(this.chartData);
|
|
47
|
+
}
|
|
48
|
+
this.renderChart();
|
|
49
|
+
this.notifyActiveSegment();
|
|
50
|
+
}
|
|
51
|
+
hasChartDataChanged() {
|
|
52
|
+
if (!this.previousChartData)
|
|
53
|
+
return true;
|
|
54
|
+
try {
|
|
55
|
+
return JSON.stringify(this.previousChartData) !== JSON.stringify(this.chartData);
|
|
56
|
+
}
|
|
57
|
+
catch (_a) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
deepClone(obj) {
|
|
62
|
+
try {
|
|
63
|
+
return JSON.parse(JSON.stringify(obj));
|
|
64
|
+
}
|
|
65
|
+
catch (_a) {
|
|
66
|
+
return obj;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
disconnectedCallback() {
|
|
70
|
+
this.destroyChart();
|
|
71
|
+
}
|
|
72
|
+
renderChart() {
|
|
73
|
+
var _a, _b, _c;
|
|
74
|
+
if (!this.canvasEl || !this.chartData || !this.chartType)
|
|
75
|
+
return;
|
|
76
|
+
this.destroyChart();
|
|
77
|
+
const chartData = Object.assign(Object.assign({}, this.chartData), { datasets: ((_a = this.chartData.datasets) === null || _a === void 0 ? void 0 : _a.map(d => (Object.assign({}, d)))) || [] });
|
|
78
|
+
const config = {
|
|
79
|
+
type: this.getChartJsType(),
|
|
80
|
+
data: chartData,
|
|
81
|
+
options: this.getChartOptions(),
|
|
82
|
+
plugins: []
|
|
83
|
+
};
|
|
84
|
+
if (this.chartType === 'doughnut' || this.chartType === 'semi-gauge' || this.chartType === 'doughnut-v2') {
|
|
85
|
+
const total = ((_c = (_b = chartData.datasets[0]) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.map((d) => Number(d) || 0).reduce((a, b) => a + b, 0)) || 0;
|
|
86
|
+
config.plugins.push(this.getCenterTextPlugin(total.toLocaleString()));
|
|
87
|
+
}
|
|
88
|
+
if (this.chartType === 'doughnut-v2') {
|
|
89
|
+
config.plugins.push(this.getLegendHoverPlugin());
|
|
90
|
+
}
|
|
91
|
+
// create chart
|
|
92
|
+
this.chartInstance = new Chart(this.canvasEl, config);
|
|
93
|
+
// Initialize colors for doughnut-v2
|
|
94
|
+
if (this.chartType === 'doughnut-v2') {
|
|
95
|
+
this.chartInstance.setDatasetVisibility(0, true);
|
|
96
|
+
this.updateChartColors();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
destroyChart() {
|
|
100
|
+
if (this.chartInstance) {
|
|
101
|
+
this.chartInstance.destroy();
|
|
102
|
+
this.chartInstance = undefined;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
getChartJsType() {
|
|
106
|
+
if (this.chartType === 'semi-gauge' || this.chartType === 'doughnut-v2')
|
|
107
|
+
return 'doughnut';
|
|
108
|
+
return this.chartType;
|
|
109
|
+
}
|
|
110
|
+
getBaseOptions() {
|
|
111
|
+
return {
|
|
112
|
+
responsive: true,
|
|
113
|
+
maintainAspectRatio: false,
|
|
114
|
+
plugins: {
|
|
115
|
+
legend: {
|
|
116
|
+
display: true,
|
|
117
|
+
position: 'bottom',
|
|
118
|
+
labels: {
|
|
119
|
+
usePointStyle: true,
|
|
120
|
+
pointStyle: 'circle',
|
|
121
|
+
font: {
|
|
122
|
+
size: 14
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
tooltip: {
|
|
127
|
+
callbacks: {
|
|
128
|
+
label: (ctx) => {
|
|
129
|
+
const label = ctx.label || ctx.dataset.label || '';
|
|
130
|
+
// Convert value to number and fix to 2 decimal places
|
|
131
|
+
const value = Number(ctx.raw);
|
|
132
|
+
const formattedValue = isNaN(value) ? ctx.formattedValue : value.toFixed(2);
|
|
133
|
+
return `${label}: ${formattedValue}`;
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
backgroundColor: '#17272B'
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
getLineChartConfig() {
|
|
142
|
+
const startOfCurrentMonth = new Date();
|
|
143
|
+
startOfCurrentMonth.setDate(1);
|
|
144
|
+
startOfCurrentMonth.setHours(0, 0, 0, 0);
|
|
145
|
+
return {
|
|
146
|
+
responsive: true,
|
|
147
|
+
maintainAspectRatio: false,
|
|
148
|
+
animation: { duration: 0 },
|
|
149
|
+
elements: {
|
|
150
|
+
point: { radius: 0, hoverRadius: 4 },
|
|
151
|
+
},
|
|
152
|
+
plugins: {
|
|
153
|
+
legend: {
|
|
154
|
+
labels: {
|
|
155
|
+
padding: 20,
|
|
156
|
+
generateLabels: (chart) => {
|
|
157
|
+
return chart.data.datasets.map((dataset, i) => ({
|
|
158
|
+
text: dataset.label || '',
|
|
159
|
+
strokeStyle: dataset.borderColor,
|
|
160
|
+
fillStyle: dataset.backgroundColor || 'transparent',
|
|
161
|
+
lineDash: dataset.borderDash || [],
|
|
162
|
+
lineWidth: dataset.borderWidth || 2,
|
|
163
|
+
hidden: !chart.isDatasetVisible(i),
|
|
164
|
+
datasetIndex: i,
|
|
165
|
+
pointStyle: 'line',
|
|
166
|
+
}));
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
tooltip: {
|
|
171
|
+
mode: 'index',
|
|
172
|
+
intersect: false,
|
|
173
|
+
backgroundColor: '#17272B',
|
|
174
|
+
titleFont: { size: 14, weight: 'bold' },
|
|
175
|
+
bodyFont: { size: 12 },
|
|
176
|
+
callbacks: {
|
|
177
|
+
title: (context) => {
|
|
178
|
+
var _a, _b;
|
|
179
|
+
if (!context || !context.length)
|
|
180
|
+
return '';
|
|
181
|
+
const date = new Date((_b = (_a = context[0].parsed) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : context[0].label);
|
|
182
|
+
return date.toLocaleDateString(undefined, {
|
|
183
|
+
day: '2-digit',
|
|
184
|
+
month: 'short',
|
|
185
|
+
year: 'numeric',
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
label: (ctx) => {
|
|
189
|
+
const rawValue = ctx.parsed && ctx.parsed.y !== undefined ? ctx.parsed.y : ctx.raw;
|
|
190
|
+
// Format to max 2 decimal places
|
|
191
|
+
const value = Number(rawValue);
|
|
192
|
+
const formattedValue = isNaN(value) ? rawValue : value.toFixed(2);
|
|
193
|
+
return `${ctx.dataset.label}: ${formattedValue}${this.isYAxisPercentageValues ? '%' : ''}`;
|
|
194
|
+
},
|
|
195
|
+
labelColor: (ctx) => {
|
|
196
|
+
if (ctx.dataset.label !== 'Overall') {
|
|
197
|
+
return {
|
|
198
|
+
borderWidth: 2
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
return {
|
|
202
|
+
borderWidth: 2,
|
|
203
|
+
borderColor: ctx.dataset.borderColor,
|
|
204
|
+
backgroundColor: ctx.dataset.borderColor,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
interaction: {
|
|
211
|
+
mode: 'index',
|
|
212
|
+
intersect: false,
|
|
213
|
+
},
|
|
214
|
+
scales: {
|
|
215
|
+
x: {
|
|
216
|
+
type: 'time',
|
|
217
|
+
time: {
|
|
218
|
+
unit: 'month',
|
|
219
|
+
displayFormats: {
|
|
220
|
+
month: 'MMM yyyy',
|
|
221
|
+
},
|
|
222
|
+
tooltipFormat: 'dd MMM yyyy',
|
|
223
|
+
},
|
|
224
|
+
grid: { color: '#E5E5E5' },
|
|
225
|
+
border: { dash: [4, 4] },
|
|
226
|
+
ticks: {
|
|
227
|
+
autoSkip: true,
|
|
228
|
+
maxRotation: 0,
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
y: {
|
|
232
|
+
min: 0,
|
|
233
|
+
max: 100,
|
|
234
|
+
beginAtZero: true,
|
|
235
|
+
ticks: {
|
|
236
|
+
stepSize: 20,
|
|
237
|
+
callback: (value) => {
|
|
238
|
+
const numValue = Number(value);
|
|
239
|
+
const formatted = isNaN(numValue) ? value : (Number.isInteger(numValue) ? numValue : numValue.toFixed(2));
|
|
240
|
+
return this.isYAxisPercentageValues ? `${formatted}%` : formatted;
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
grid: { color: '#E5E5E5' },
|
|
244
|
+
border: { dash: [4, 4] },
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
getDoughnutChartConfig() {
|
|
250
|
+
return {
|
|
251
|
+
plugins: {
|
|
252
|
+
legend: { labels: { pointStyle: 'circle', padding: 16, } },
|
|
253
|
+
},
|
|
254
|
+
cutout: '60%'
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
getDoughnutV2ChartConfig() {
|
|
258
|
+
return {
|
|
259
|
+
plugins: {
|
|
260
|
+
legend: {
|
|
261
|
+
labels: {
|
|
262
|
+
pointStyle: 'circle',
|
|
263
|
+
padding: 16
|
|
264
|
+
},
|
|
265
|
+
onClick: (e, legendItem) => {
|
|
266
|
+
e.stopPropagation();
|
|
267
|
+
const index = legendItem.index;
|
|
268
|
+
if (this.selectedSegmentIndex !== index) {
|
|
269
|
+
this.selectedSegmentIndex = index;
|
|
270
|
+
this.updateChartColors();
|
|
271
|
+
this.notifyActiveSegment();
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
tooltip: {
|
|
276
|
+
enabled: false
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
cutout: '60%',
|
|
280
|
+
onHover: (_event, activeElements) => {
|
|
281
|
+
if (activeElements && activeElements.length > 0) {
|
|
282
|
+
this.hoverSegmentIndex = activeElements[0].index;
|
|
283
|
+
this.updateChartColors();
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
this.hoverSegmentIndex = null;
|
|
287
|
+
this.updateChartColors();
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
onClick: (_event, activeElements) => {
|
|
291
|
+
if (activeElements && activeElements.length > 0) {
|
|
292
|
+
const clickedIndex = activeElements[0].index;
|
|
293
|
+
if (this.selectedSegmentIndex !== clickedIndex) {
|
|
294
|
+
this.selectedSegmentIndex = clickedIndex;
|
|
295
|
+
this.updateChartColors();
|
|
296
|
+
this.notifyActiveSegment();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
updateChartColors() {
|
|
303
|
+
var _a, _b, _c, _d;
|
|
304
|
+
if (!this.chartInstance || this.chartType !== 'doughnut-v2')
|
|
305
|
+
return;
|
|
306
|
+
const dataset = this.chartInstance.data.datasets[0];
|
|
307
|
+
const chartDataDataset = (_b = (_a = this.chartData) === null || _a === void 0 ? void 0 : _a.datasets) === null || _b === void 0 ? void 0 : _b[0];
|
|
308
|
+
if (this.chartType === 'doughnut-v2' && this.chartInstance.isDatasetVisible(0) === false) {
|
|
309
|
+
this.chartInstance.setDatasetVisibility(0, true);
|
|
310
|
+
}
|
|
311
|
+
// Default color for doughnut-v2
|
|
312
|
+
const defaultSelectedColor = '#45C9B0';
|
|
313
|
+
const defaultHoverColor = '#A3A3A3';
|
|
314
|
+
const defaultInactiveColor = '#E5E5E5';
|
|
315
|
+
const selectedColors = chartDataDataset === null || chartDataDataset === void 0 ? void 0 : chartDataDataset.selectedColors;
|
|
316
|
+
const hoverColors = chartDataDataset === null || chartDataDataset === void 0 ? void 0 : chartDataDataset.hoverColors;
|
|
317
|
+
const inactiveColors = chartDataDataset === null || chartDataDataset === void 0 ? void 0 : chartDataDataset.inactiveColors;
|
|
318
|
+
let newColors = [];
|
|
319
|
+
if (this.selectedSegmentIndex !== null) {
|
|
320
|
+
newColors = dataset.data.map((_, index) => {
|
|
321
|
+
if (index === this.hoverSegmentIndex) {
|
|
322
|
+
return (hoverColors === null || hoverColors === void 0 ? void 0 : hoverColors[index]) || defaultHoverColor;
|
|
323
|
+
}
|
|
324
|
+
else if (index === this.selectedSegmentIndex) {
|
|
325
|
+
return (selectedColors === null || selectedColors === void 0 ? void 0 : selectedColors[index]) || defaultSelectedColor;
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
return (inactiveColors === null || inactiveColors === void 0 ? void 0 : inactiveColors[index]) || defaultInactiveColor;
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
else if (this.hoverSegmentIndex !== null) {
|
|
333
|
+
const activeIndex = (_c = this.initialActiveIndex) !== null && _c !== void 0 ? _c : 0;
|
|
334
|
+
newColors = dataset.data.map((_, index) => {
|
|
335
|
+
if (index === this.hoverSegmentIndex) {
|
|
336
|
+
return (hoverColors === null || hoverColors === void 0 ? void 0 : hoverColors[index]) || defaultHoverColor;
|
|
337
|
+
}
|
|
338
|
+
else if (index === activeIndex) {
|
|
339
|
+
return (selectedColors === null || selectedColors === void 0 ? void 0 : selectedColors[index]) || defaultSelectedColor;
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
return (inactiveColors === null || inactiveColors === void 0 ? void 0 : inactiveColors[index]) || defaultInactiveColor;
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
// No hover or selection: show initial active state
|
|
348
|
+
const activeIndex = (_d = this.initialActiveIndex) !== null && _d !== void 0 ? _d : 0;
|
|
349
|
+
newColors = dataset.data.map((_, index) => {
|
|
350
|
+
if (index === activeIndex) {
|
|
351
|
+
return (selectedColors === null || selectedColors === void 0 ? void 0 : selectedColors[index]) || defaultSelectedColor;
|
|
352
|
+
}
|
|
353
|
+
return (inactiveColors === null || inactiveColors === void 0 ? void 0 : inactiveColors[index]) || defaultInactiveColor;
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
dataset.backgroundColor = newColors;
|
|
357
|
+
this.chartInstance.update('active');
|
|
358
|
+
}
|
|
359
|
+
lightenColor(color, percent) {
|
|
360
|
+
if (!color || !color.startsWith('#'))
|
|
361
|
+
return color;
|
|
362
|
+
const num = parseInt(color.replace('#', ''), 16);
|
|
363
|
+
const r = Math.min(255, ((num >> 16) & 0xFF) + percent);
|
|
364
|
+
const g = Math.min(255, ((num >> 8) & 0xFF) + percent);
|
|
365
|
+
const b = Math.min(255, (num & 0xFF) + percent);
|
|
366
|
+
return `#${((r << 16) | (g << 8) | b).toString(16).padStart(6, '0')}`;
|
|
367
|
+
}
|
|
368
|
+
getCenterTextPlugin(value) {
|
|
369
|
+
return {
|
|
370
|
+
id: 'centerText',
|
|
371
|
+
afterDatasetsDraw: (chart) => {
|
|
372
|
+
var _a, _b;
|
|
373
|
+
const { ctx } = chart;
|
|
374
|
+
ctx.save();
|
|
375
|
+
const x = chart.getDatasetMeta(0).data[0].x;
|
|
376
|
+
let y = chart.getDatasetMeta(0).data[0].y;
|
|
377
|
+
if (this.chartType === 'semi-gauge') {
|
|
378
|
+
y -= 20;
|
|
379
|
+
}
|
|
380
|
+
let displayValue = value;
|
|
381
|
+
if (this.chartType === 'doughnut-v2') {
|
|
382
|
+
const activeIndex = this.selectedSegmentIndex !== null
|
|
383
|
+
? this.selectedSegmentIndex
|
|
384
|
+
: ((_a = this.initialActiveIndex) !== null && _a !== void 0 ? _a : 0);
|
|
385
|
+
const segmentValue = (_b = this.chartData.datasets[0]) === null || _b === void 0 ? void 0 : _b.data[activeIndex];
|
|
386
|
+
displayValue = Number(segmentValue || 0).toLocaleString();
|
|
387
|
+
}
|
|
388
|
+
ctx.font = 'bold 20px Roboto';
|
|
389
|
+
ctx.fillStyle = '#111';
|
|
390
|
+
ctx.textAlign = 'center';
|
|
391
|
+
ctx.textBaseline = 'middle';
|
|
392
|
+
ctx.fillText(displayValue, x, y);
|
|
393
|
+
},
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
getLegendHoverPlugin() {
|
|
397
|
+
return {
|
|
398
|
+
id: 'legendHover',
|
|
399
|
+
afterDraw: (chart) => {
|
|
400
|
+
if (this.hoverSegmentIndex === null)
|
|
401
|
+
return;
|
|
402
|
+
const legend = chart.legend;
|
|
403
|
+
if (!legend || !legend.legendItems)
|
|
404
|
+
return;
|
|
405
|
+
const ctx = chart.ctx;
|
|
406
|
+
const legendItem = legend.legendItems[this.hoverSegmentIndex];
|
|
407
|
+
if (!legendItem)
|
|
408
|
+
return;
|
|
409
|
+
const boxes = legend.legendHitBoxes;
|
|
410
|
+
if (!boxes || !boxes[this.hoverSegmentIndex])
|
|
411
|
+
return;
|
|
412
|
+
const box = boxes[this.hoverSegmentIndex];
|
|
413
|
+
const padding = 8;
|
|
414
|
+
const borderRadius = 4;
|
|
415
|
+
ctx.save();
|
|
416
|
+
ctx.fillStyle = '#f5f5f5';
|
|
417
|
+
ctx.beginPath();
|
|
418
|
+
ctx.roundRect(box.left - padding, box.top - padding, box.width + padding * 2, box.height + padding * 2, borderRadius);
|
|
419
|
+
ctx.fill();
|
|
420
|
+
const pointRadius = 8;
|
|
421
|
+
const pointX = box.left + pointRadius;
|
|
422
|
+
const pointY = box.top + box.height / 2;
|
|
423
|
+
ctx.fillStyle = '#D1D5DB';
|
|
424
|
+
ctx.beginPath();
|
|
425
|
+
ctx.arc(pointX, pointY, pointRadius, 0, 2 * Math.PI);
|
|
426
|
+
ctx.fill();
|
|
427
|
+
ctx.fillStyle = '#9CA3AF';
|
|
428
|
+
ctx.font = '14px Roboto, sans-serif';
|
|
429
|
+
ctx.textBaseline = 'middle';
|
|
430
|
+
ctx.textAlign = 'left';
|
|
431
|
+
ctx.fillText(legendItem.text, box.left + pointRadius * 2 + 4, pointY);
|
|
432
|
+
ctx.restore();
|
|
433
|
+
},
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
getSemiGaugeChartConfig() {
|
|
437
|
+
return {
|
|
438
|
+
plugins: {
|
|
439
|
+
legend: { labels: { pointStyle: 'circle', padding: 16, } },
|
|
440
|
+
},
|
|
441
|
+
rotation: -90,
|
|
442
|
+
circumference: 180,
|
|
443
|
+
cutout: '70%',
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
merge(target, source) {
|
|
447
|
+
if (typeof target !== 'object' || typeof source !== 'object')
|
|
448
|
+
return source;
|
|
449
|
+
for (const key of Object.keys(source)) {
|
|
450
|
+
if (source[key] instanceof Object && key in target) {
|
|
451
|
+
target[key] = this.merge(Object.assign({}, target[key]), source[key]);
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
target[key] = source[key];
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
return target;
|
|
458
|
+
}
|
|
459
|
+
getChartOptions() {
|
|
460
|
+
const base = this.getBaseOptions();
|
|
461
|
+
let specific = {};
|
|
462
|
+
if (this.chartType === 'line')
|
|
463
|
+
specific = this.getLineChartConfig();
|
|
464
|
+
else if (this.chartType === 'doughnut')
|
|
465
|
+
specific = this.getDoughnutChartConfig();
|
|
466
|
+
else if (this.chartType === 'semi-gauge')
|
|
467
|
+
specific = this.getSemiGaugeChartConfig();
|
|
468
|
+
else if (this.chartType === 'doughnut-v2')
|
|
469
|
+
specific = this.getDoughnutV2ChartConfig();
|
|
470
|
+
return this.merge(this.merge(base, specific), this.chartOptions || {});
|
|
471
|
+
}
|
|
472
|
+
exportChart(format) {
|
|
473
|
+
if (!this.chartInstance)
|
|
474
|
+
return;
|
|
475
|
+
const link = document.createElement('a');
|
|
476
|
+
link.download = `chart-export.${format}`;
|
|
477
|
+
if (format === 'png') {
|
|
478
|
+
link.href = this.chartInstance.toBase64Image('image/png');
|
|
479
|
+
}
|
|
480
|
+
else {
|
|
481
|
+
const svgData = new XMLSerializer().serializeToString(this.canvasEl);
|
|
482
|
+
const blob = new Blob([svgData], { type: 'image/svg+xml' });
|
|
483
|
+
link.href = URL.createObjectURL(blob);
|
|
484
|
+
}
|
|
485
|
+
link.click();
|
|
486
|
+
}
|
|
487
|
+
getErrorContent() {
|
|
488
|
+
return this.commonContent('warning', 'Something went wrong', 'We ran into an issue while trying to load this widget.', '#DC0000', true);
|
|
489
|
+
}
|
|
490
|
+
getNoDataContent() {
|
|
491
|
+
return this.commonContent('ssid_chart', 'No data available', 'There is currently no data available to show performance trends.', '#111');
|
|
492
|
+
}
|
|
493
|
+
commonContent(iconName, heading, message, iconColor, showActions = false) {
|
|
494
|
+
return (h("div", { class: "error-content" }, h("tttx-icon_1_9_103", { icon: iconName, color: iconColor, size: 48 }), h("span", { class: 'error-heading' }, heading), h("span", { class: 'error-message' }, message), showActions && h("div", { class: "error-actions" }, h("tttx-button_1_9_103", { class: 'support-btn', icon: "help", design: "primary", onClick: () => this.renderChart() }, "Contact support"))));
|
|
495
|
+
}
|
|
496
|
+
notifyActiveSegment() {
|
|
497
|
+
var _a, _b;
|
|
498
|
+
if (this.chartType !== 'doughnut-v2' || !this.chartData)
|
|
499
|
+
return;
|
|
500
|
+
const activeIndex = this.selectedSegmentIndex !== null
|
|
501
|
+
? this.selectedSegmentIndex
|
|
502
|
+
: ((_a = this.initialActiveIndex) !== null && _a !== void 0 ? _a : 0);
|
|
503
|
+
const label = ((_b = this.chartData.labels) === null || _b === void 0 ? void 0 : _b[activeIndex]) || '';
|
|
504
|
+
if (this.activeSegmentChangeCallback) {
|
|
505
|
+
this.activeSegmentChangeCallback(label);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
render() {
|
|
509
|
+
var _a, _b, _c;
|
|
510
|
+
return (h("div", { class: "chart-wrapper", style: { width: this.width, height: this.height } }, this.loading && h("div", { class: "chart-loading" }, h("tttx-loading-spinner_1_9_103", { size: 'large', color: '#2b9ab7' })), this.error && this.getErrorContent(), !this.loading && !this.error && (!this.chartData || !((_a = this.chartData.datasets) === null || _a === void 0 ? void 0 : _a.length)) && (this.getNoDataContent()), !this.loading && !this.error && ((_c = (_b = this.chartData) === null || _b === void 0 ? void 0 : _b.datasets) === null || _c === void 0 ? void 0 : _c.length) > 0 && (h("div", { class: "chart-canvas-container", style: { width: '100%', height: '100%' } }, h("canvas", { ref: el => (this.canvasEl = el), "aria-label": "Chart canvas", role: "img", style: {
|
|
511
|
+
width: '100%',
|
|
512
|
+
height: '100%',
|
|
513
|
+
cursor: this.chartType === 'doughnut-v2' ? 'pointer' : 'default'
|
|
514
|
+
} }))), this.exportable && !this.loading && !this.error && (h("div", { class: "export-buttons" }, this.showPngSvgExport && h("tttx-button_1_9_103", { class: 'export-png', design: "primary", onClick: () => this.exportChart('png') }, "Export PNG"), this.showPngSvgExport && h("tttx-button_1_9_103", { class: 'export-svg', design: "primary", onClick: () => this.exportChart('svg') }, "Export SVG"), h("tttx-button_1_9_103", { class: 'export-csv', design: "primary", onClick: () => this.exportCSV.emit({ name: this.chartType }) }, "Export CSV")))));
|
|
515
|
+
}
|
|
516
|
+
static get is() { return "tttx-chart_1_9_103"; }
|
|
517
|
+
static get encapsulation() { return "shadow"; }
|
|
518
|
+
static get originalStyleUrls() {
|
|
519
|
+
return {
|
|
520
|
+
"$": ["tttx-chart.scss"]
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
static get styleUrls() {
|
|
524
|
+
return {
|
|
525
|
+
"$": ["tttx-chart.css"]
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
static get properties() {
|
|
529
|
+
return {
|
|
530
|
+
"chartType": {
|
|
531
|
+
"type": "string",
|
|
532
|
+
"mutable": false,
|
|
533
|
+
"complexType": {
|
|
534
|
+
"original": "'line' | 'doughnut' | 'semi-gauge' | 'doughnut-v2'",
|
|
535
|
+
"resolved": "\"doughnut\" | \"doughnut-v2\" | \"line\" | \"semi-gauge\"",
|
|
536
|
+
"references": {}
|
|
537
|
+
},
|
|
538
|
+
"required": false,
|
|
539
|
+
"optional": false,
|
|
540
|
+
"docs": {
|
|
541
|
+
"tags": [],
|
|
542
|
+
"text": ""
|
|
543
|
+
},
|
|
544
|
+
"attribute": "chart-type",
|
|
545
|
+
"reflect": false
|
|
546
|
+
},
|
|
547
|
+
"chartData": {
|
|
548
|
+
"type": "unknown",
|
|
549
|
+
"mutable": false,
|
|
550
|
+
"complexType": {
|
|
551
|
+
"original": "ChartData",
|
|
552
|
+
"resolved": "ChartData<keyof ChartTypeRegistry, (number | Point | [number, number] | BubbleDataPoint)[], unknown>",
|
|
553
|
+
"references": {
|
|
554
|
+
"ChartData": {
|
|
555
|
+
"location": "import",
|
|
556
|
+
"path": "chart.js"
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
"required": false,
|
|
561
|
+
"optional": false,
|
|
562
|
+
"docs": {
|
|
563
|
+
"tags": [],
|
|
564
|
+
"text": ""
|
|
565
|
+
}
|
|
566
|
+
},
|
|
567
|
+
"chartOptions": {
|
|
568
|
+
"type": "unknown",
|
|
569
|
+
"mutable": false,
|
|
570
|
+
"complexType": {
|
|
571
|
+
"original": "ChartOptions",
|
|
572
|
+
"resolved": "{ datasets?: _DeepPartialObject<{ line: LineControllerDatasetOptions & FillerControllerDatasetOptions; bar: BarControllerDatasetOptions; radar: RadarControllerDatasetOptions & FillerControllerDatasetOptions; doughnut: DoughnutControllerDatasetOptions; scatter: LineControllerDatasetOptions; bubble: BubbleControllerDatasetOptions; pie: DoughnutControllerDatasetOptions; polarArea: PolarAreaControllerDatasetOptions; }>; indexAxis?: \"x\" | \"y\"; clip?: number | false | _DeepPartialObject<ChartArea>; color?: string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern> | ((ctx: ScriptableContext<keyof ChartTypeRegistry>, options: AnyObject) => Color); backgroundColor?: string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern> | readonly (string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern>)[] | ((ctx: ScriptableContext<keyof ChartTypeRegistry>, options: AnyObject) => Color); hoverBackgroundColor?: string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern> | readonly (string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern>)[] | ((ctx: ScriptableContext<keyof ChartTypeRegistry>, options: AnyObject) => Color); borderColor?: string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern> | readonly (string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern>)[] | ((ctx: ScriptableContext<keyof ChartTypeRegistry>, options: AnyObject) => Color); hoverBorderColor?: string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern> | readonly (string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern>)[] | ((ctx: ScriptableContext<keyof ChartTypeRegistry>, options: AnyObject) => Color); font?: _DeepPartialObject<Partial<FontSpec>>; responsive?: boolean; maintainAspectRatio?: boolean; resizeDelay?: number; aspectRatio?: number; locale?: string; onResize?: (chart: Chart<keyof ChartTypeRegistry, (number | Point | [number, number] | BubbleDataPoint)[], unknown>, size: { width: number; height: number; }) => void; devicePixelRatio?: number; interaction?: _DeepPartialObject<CoreInteractionOptions>; hover?: _DeepPartialObject<CoreInteractionOptions>; events?: _DeepPartialArray<keyof HTMLElementEventMap>; onHover?: (event: ChartEvent, elements: ActiveElement[], chart: Chart<keyof ChartTypeRegistry, (number | Point | [number, number] | BubbleDataPoint)[], unknown>) => void; onClick?: (event: ChartEvent, elements: ActiveElement[], chart: Chart<keyof ChartTypeRegistry, (number | Point | [number, number] | BubbleDataPoint)[], unknown>) => void; layout?: _DeepPartialObject<Partial<{ autoPadding: boolean; padding: Scriptable<Padding, ScriptableContext<keyof ChartTypeRegistry>>; }>>; parsing?: false | _DeepPartialObject<{ [key: string]: string; }>; normalized?: boolean; animation?: false | _DeepPartialObject<AnimationSpec<keyof ChartTypeRegistry> & { onProgress?: (this: Chart<keyof ChartTypeRegistry, (number | Point | [number, number] | BubbleDataPoint)[], unknown>, event: AnimationEvent) => void; onComplete?: (this: Chart<keyof ChartTypeRegistry, (number | Point | [number, number] | BubbleDataPoint)[], unknown>, event: AnimationEvent) => void; }>; animations?: _DeepPartialObject<AnimationsSpec<keyof ChartTypeRegistry>>; transitions?: _DeepPartialObject<TransitionsSpec<keyof ChartTypeRegistry>>; elements?: _DeepPartialObject<ElementOptionsByType<keyof ChartTypeRegistry>>; plugins?: _DeepPartialObject<PluginOptionsByType<keyof ChartTypeRegistry>>; line?: _DeepPartialObject<{ datasets: LineControllerDatasetOptions & FillerControllerDatasetOptions; }>; bar?: _DeepPartialObject<{ datasets: BarControllerDatasetOptions; }>; radar?: _DeepPartialObject<{ datasets: RadarControllerDatasetOptions & FillerControllerDatasetOptions; }>; doughnut?: _DeepPartialObject<{ datasets: DoughnutControllerDatasetOptions; }>; scatter?: _DeepPartialObject<{ datasets: LineControllerDatasetOptions; }>; bubble?: _DeepPartialObject<{ datasets: BubbleControllerDatasetOptions; }>; pie?: _DeepPartialObject<{ datasets: DoughnutControllerDatasetOptions; }>; polarArea?: _DeepPartialObject<{ datasets: PolarAreaControllerDatasetOptions; }>; scales?: _DeepPartialObject<{ [key: string]: ScaleOptionsByType<\"radialLinear\" | keyof CartesianScaleTypeRegistry>; }>; }",
|
|
573
|
+
"references": {
|
|
574
|
+
"ChartOptions": {
|
|
575
|
+
"location": "import",
|
|
576
|
+
"path": "chart.js"
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
"required": false,
|
|
581
|
+
"optional": true,
|
|
582
|
+
"docs": {
|
|
583
|
+
"tags": [],
|
|
584
|
+
"text": ""
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
"loading": {
|
|
588
|
+
"type": "boolean",
|
|
589
|
+
"mutable": false,
|
|
590
|
+
"complexType": {
|
|
591
|
+
"original": "boolean",
|
|
592
|
+
"resolved": "boolean",
|
|
593
|
+
"references": {}
|
|
594
|
+
},
|
|
595
|
+
"required": false,
|
|
596
|
+
"optional": true,
|
|
597
|
+
"docs": {
|
|
598
|
+
"tags": [],
|
|
599
|
+
"text": ""
|
|
600
|
+
},
|
|
601
|
+
"attribute": "loading",
|
|
602
|
+
"reflect": false,
|
|
603
|
+
"defaultValue": "false"
|
|
604
|
+
},
|
|
605
|
+
"error": {
|
|
606
|
+
"type": "boolean",
|
|
607
|
+
"mutable": false,
|
|
608
|
+
"complexType": {
|
|
609
|
+
"original": "boolean",
|
|
610
|
+
"resolved": "boolean",
|
|
611
|
+
"references": {}
|
|
612
|
+
},
|
|
613
|
+
"required": false,
|
|
614
|
+
"optional": true,
|
|
615
|
+
"docs": {
|
|
616
|
+
"tags": [],
|
|
617
|
+
"text": ""
|
|
618
|
+
},
|
|
619
|
+
"attribute": "error",
|
|
620
|
+
"reflect": false
|
|
621
|
+
},
|
|
622
|
+
"fallbackText": {
|
|
623
|
+
"type": "string",
|
|
624
|
+
"mutable": false,
|
|
625
|
+
"complexType": {
|
|
626
|
+
"original": "string",
|
|
627
|
+
"resolved": "string",
|
|
628
|
+
"references": {}
|
|
629
|
+
},
|
|
630
|
+
"required": false,
|
|
631
|
+
"optional": true,
|
|
632
|
+
"docs": {
|
|
633
|
+
"tags": [],
|
|
634
|
+
"text": ""
|
|
635
|
+
},
|
|
636
|
+
"attribute": "fallback-text",
|
|
637
|
+
"reflect": false,
|
|
638
|
+
"defaultValue": "'No data available'"
|
|
639
|
+
},
|
|
640
|
+
"width": {
|
|
641
|
+
"type": "string",
|
|
642
|
+
"mutable": false,
|
|
643
|
+
"complexType": {
|
|
644
|
+
"original": "string",
|
|
645
|
+
"resolved": "string",
|
|
646
|
+
"references": {}
|
|
647
|
+
},
|
|
648
|
+
"required": false,
|
|
649
|
+
"optional": false,
|
|
650
|
+
"docs": {
|
|
651
|
+
"tags": [],
|
|
652
|
+
"text": ""
|
|
653
|
+
},
|
|
654
|
+
"attribute": "width",
|
|
655
|
+
"reflect": false,
|
|
656
|
+
"defaultValue": "'100%'"
|
|
657
|
+
},
|
|
658
|
+
"height": {
|
|
659
|
+
"type": "string",
|
|
660
|
+
"mutable": false,
|
|
661
|
+
"complexType": {
|
|
662
|
+
"original": "string",
|
|
663
|
+
"resolved": "string",
|
|
664
|
+
"references": {}
|
|
665
|
+
},
|
|
666
|
+
"required": false,
|
|
667
|
+
"optional": false,
|
|
668
|
+
"docs": {
|
|
669
|
+
"tags": [],
|
|
670
|
+
"text": ""
|
|
671
|
+
},
|
|
672
|
+
"attribute": "height",
|
|
673
|
+
"reflect": false,
|
|
674
|
+
"defaultValue": "'auto'"
|
|
675
|
+
},
|
|
676
|
+
"isYAxisPercentageValues": {
|
|
677
|
+
"type": "boolean",
|
|
678
|
+
"mutable": false,
|
|
679
|
+
"complexType": {
|
|
680
|
+
"original": "boolean",
|
|
681
|
+
"resolved": "boolean",
|
|
682
|
+
"references": {}
|
|
683
|
+
},
|
|
684
|
+
"required": false,
|
|
685
|
+
"optional": false,
|
|
686
|
+
"docs": {
|
|
687
|
+
"tags": [],
|
|
688
|
+
"text": ""
|
|
689
|
+
},
|
|
690
|
+
"attribute": "is-y-axis-percentage-values",
|
|
691
|
+
"reflect": false,
|
|
692
|
+
"defaultValue": "false"
|
|
693
|
+
},
|
|
694
|
+
"showActiveSegmentLabel": {
|
|
695
|
+
"type": "boolean",
|
|
696
|
+
"mutable": false,
|
|
697
|
+
"complexType": {
|
|
698
|
+
"original": "boolean",
|
|
699
|
+
"resolved": "boolean",
|
|
700
|
+
"references": {}
|
|
701
|
+
},
|
|
702
|
+
"required": false,
|
|
703
|
+
"optional": false,
|
|
704
|
+
"docs": {
|
|
705
|
+
"tags": [],
|
|
706
|
+
"text": ""
|
|
707
|
+
},
|
|
708
|
+
"attribute": "show-active-segment-label",
|
|
709
|
+
"reflect": false,
|
|
710
|
+
"defaultValue": "false"
|
|
711
|
+
},
|
|
712
|
+
"initialActiveIndex": {
|
|
713
|
+
"type": "number",
|
|
714
|
+
"mutable": false,
|
|
715
|
+
"complexType": {
|
|
716
|
+
"original": "number",
|
|
717
|
+
"resolved": "number",
|
|
718
|
+
"references": {}
|
|
719
|
+
},
|
|
720
|
+
"required": false,
|
|
721
|
+
"optional": true,
|
|
722
|
+
"docs": {
|
|
723
|
+
"tags": [],
|
|
724
|
+
"text": ""
|
|
725
|
+
},
|
|
726
|
+
"attribute": "initial-active-index",
|
|
727
|
+
"reflect": false,
|
|
728
|
+
"defaultValue": "0"
|
|
729
|
+
},
|
|
730
|
+
"activeSegmentChangeCallback": {
|
|
731
|
+
"type": "unknown",
|
|
732
|
+
"mutable": false,
|
|
733
|
+
"complexType": {
|
|
734
|
+
"original": "(label: string) => void",
|
|
735
|
+
"resolved": "(label: string) => void",
|
|
736
|
+
"references": {}
|
|
737
|
+
},
|
|
738
|
+
"required": false,
|
|
739
|
+
"optional": true,
|
|
740
|
+
"docs": {
|
|
741
|
+
"tags": [],
|
|
742
|
+
"text": ""
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
static get states() {
|
|
748
|
+
return {
|
|
749
|
+
"exportable": {},
|
|
750
|
+
"chartInstance": {},
|
|
751
|
+
"showPngSvgExport": {},
|
|
752
|
+
"selectedSegmentIndex": {},
|
|
753
|
+
"hoverSegmentIndex": {}
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
static get events() {
|
|
757
|
+
return [{
|
|
758
|
+
"method": "exportCSV",
|
|
759
|
+
"name": "exportCSV",
|
|
760
|
+
"bubbles": true,
|
|
761
|
+
"cancelable": true,
|
|
762
|
+
"composed": true,
|
|
763
|
+
"docs": {
|
|
764
|
+
"tags": [],
|
|
765
|
+
"text": ""
|
|
766
|
+
},
|
|
767
|
+
"complexType": {
|
|
768
|
+
"original": "{ name: string }",
|
|
769
|
+
"resolved": "{ name: string; }",
|
|
770
|
+
"references": {}
|
|
771
|
+
}
|
|
772
|
+
}];
|
|
773
|
+
}
|
|
774
|
+
static get elementRef() { return "el"; }
|
|
775
|
+
static get watchers() {
|
|
776
|
+
return [{
|
|
777
|
+
"propName": "chartData",
|
|
778
|
+
"methodName": "handleUpdate"
|
|
779
|
+
}, {
|
|
780
|
+
"propName": "chartOptions",
|
|
781
|
+
"methodName": "handleUpdate"
|
|
782
|
+
}, {
|
|
783
|
+
"propName": "selectedSegmentIndex",
|
|
784
|
+
"methodName": "notifyActiveSegment"
|
|
785
|
+
}, {
|
|
786
|
+
"propName": "chartData",
|
|
787
|
+
"methodName": "notifyActiveSegment"
|
|
788
|
+
}, {
|
|
789
|
+
"propName": "initialActiveIndex",
|
|
790
|
+
"methodName": "notifyActiveSegment"
|
|
791
|
+
}];
|
|
792
|
+
}
|
|
793
|
+
}
|