@wavemaker-ai/app-ng-runtime 12.0.2-rc.647771 → 12.1.0-rc.647821
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/build-task/bundles/index.umd.js +2489 -2963
- package/build-task/fesm2022/index.mjs +2307 -2786
- package/build-task/fesm2022/index.mjs.map +1 -1
- package/build-task/types/index.d.ts +401 -844
- package/components/advanced/carousel/bundles/index.umd.js +387 -344
- package/components/advanced/carousel/fesm2022/index.mjs +363 -325
- package/components/advanced/carousel/fesm2022/index.mjs.map +1 -1
- package/components/advanced/carousel/types/index.d.ts +85 -86
- package/components/advanced/custom/bundles/index.umd.js +298 -249
- package/components/advanced/custom/fesm2022/index.mjs +280 -236
- package/components/advanced/custom/fesm2022/index.mjs.map +1 -1
- package/components/advanced/custom/types/index.d.ts +49 -49
- package/components/advanced/login/bundles/index.umd.js +177 -127
- package/components/advanced/login/fesm2022/index.mjs +162 -117
- package/components/advanced/login/fesm2022/index.mjs.map +1 -1
- package/components/advanced/login/types/index.d.ts +33 -34
- package/components/advanced/marquee/bundles/index.umd.js +93 -63
- package/components/advanced/marquee/fesm2022/index.mjs +73 -48
- package/components/advanced/marquee/fesm2022/index.mjs.map +1 -1
- package/components/advanced/marquee/types/index.d.ts +11 -12
- package/components/base/bundles/index.umd.js +5515 -6359
- package/components/base/fesm2022/index.mjs +5169 -6027
- package/components/base/fesm2022/index.mjs.map +1 -1
- package/components/base/types/index.d.ts +1198 -1154
- package/components/basic/anchor/bundles/index.umd.js +273 -195
- package/components/basic/anchor/fesm2022/index.mjs +251 -178
- package/components/basic/anchor/fesm2022/index.mjs.map +1 -1
- package/components/basic/anchor/types/index.d.ts +40 -41
- package/components/basic/audio/bundles/index.umd.js +124 -75
- package/components/basic/audio/fesm2022/index.mjs +104 -60
- package/components/basic/audio/fesm2022/index.mjs.map +1 -1
- package/components/basic/audio/types/index.d.ts +22 -23
- package/components/basic/html/bundles/index.umd.js +144 -113
- package/components/basic/html/fesm2022/index.mjs +125 -99
- package/components/basic/html/fesm2022/index.mjs.map +1 -1
- package/components/basic/html/types/index.d.ts +20 -17
- package/components/basic/icon/bundles/index.umd.js +144 -72
- package/components/basic/icon/fesm2022/index.mjs +124 -57
- package/components/basic/icon/fesm2022/index.mjs.map +1 -1
- package/components/basic/icon/types/index.d.ts +18 -19
- package/components/basic/iframe/bundles/index.umd.js +143 -93
- package/components/basic/iframe/fesm2022/index.mjs +124 -79
- package/components/basic/iframe/fesm2022/index.mjs.map +1 -1
- package/components/basic/iframe/types/index.d.ts +28 -29
- package/components/basic/label/bundles/index.umd.js +136 -120
- package/components/basic/label/fesm2022/index.mjs +118 -107
- package/components/basic/label/fesm2022/index.mjs.map +1 -1
- package/components/basic/label/types/index.d.ts +14 -15
- package/components/basic/picture/bundles/index.umd.js +171 -130
- package/components/basic/picture/fesm2022/index.mjs +152 -116
- package/components/basic/picture/fesm2022/index.mjs.map +1 -1
- package/components/basic/picture/types/index.d.ts +21 -22
- package/components/basic/progress/progress-bar/bundles/index.umd.js +211 -160
- package/components/basic/progress/progress-bar/fesm2022/index.mjs +193 -147
- package/components/basic/progress/progress-bar/fesm2022/index.mjs.map +1 -1
- package/components/basic/progress/progress-bar/types/index.d.ts +45 -41
- package/components/basic/progress/progress-circle/bundles/index.umd.js +294 -165
- package/components/basic/progress/progress-circle/fesm2022/index.mjs +274 -150
- package/components/basic/progress/progress-circle/fesm2022/index.mjs.map +1 -1
- package/components/basic/progress/progress-circle/types/index.d.ts +41 -42
- package/components/basic/progress/progress-utils/bundles/index.umd.js +27 -29
- package/components/basic/progress/progress-utils/fesm2022/index.mjs +18 -25
- package/components/basic/progress/progress-utils/fesm2022/index.mjs.map +1 -1
- package/components/basic/progress/progress-utils/types/index.d.ts +3 -5
- package/components/basic/rich-text-editor/bundles/index.umd.js +294 -228
- package/components/basic/rich-text-editor/fesm2022/index.mjs +275 -214
- package/components/basic/rich-text-editor/fesm2022/index.mjs.map +1 -1
- package/components/basic/rich-text-editor/types/index.d.ts +55 -56
- package/components/basic/search/bundles/index.umd.js +1129 -1090
- package/components/basic/search/fesm2022/index.mjs +1117 -1083
- package/components/basic/search/fesm2022/index.mjs.map +1 -1
- package/components/basic/search/types/index.d.ts +132 -130
- package/components/basic/spinner/bundles/index.umd.js +216 -120
- package/components/basic/spinner/fesm2022/index.mjs +201 -110
- package/components/basic/spinner/fesm2022/index.mjs.map +1 -1
- package/components/basic/spinner/types/index.d.ts +30 -31
- package/components/basic/tree/bundles/index.umd.js +756 -756
- package/components/basic/tree/fesm2022/index.mjs +740 -745
- package/components/basic/tree/fesm2022/index.mjs.map +1 -1
- package/components/basic/tree/types/index.d.ts +106 -97
- package/components/basic/video/bundles/index.umd.js +164 -108
- package/components/basic/video/fesm2022/index.mjs +145 -94
- package/components/basic/video/fesm2022/index.mjs.map +1 -1
- package/components/basic/video/types/index.d.ts +29 -30
- package/components/chart/bundles/index.umd.js +1768 -1737
- package/components/chart/fesm2022/index.mjs +1713 -1728
- package/components/chart/fesm2022/index.mjs.map +1 -1
- package/components/chart/types/index.d.ts +102 -104
- package/components/containers/accordion/bundles/index.umd.js +522 -494
- package/components/containers/accordion/fesm2022/index.mjs +502 -479
- package/components/containers/accordion/fesm2022/index.mjs.map +1 -1
- package/components/containers/accordion/types/index.d.ts +116 -116
- package/components/containers/layout-grid/bundles/index.umd.js +260 -164
- package/components/containers/layout-grid/fesm2022/index.mjs +231 -140
- package/components/containers/layout-grid/fesm2022/index.mjs.map +1 -1
- package/components/containers/layout-grid/types/index.d.ts +30 -27
- package/components/containers/linear-layout/bundles/index.umd.js +220 -178
- package/components/containers/linear-layout/fesm2022/index.mjs +193 -156
- package/components/containers/linear-layout/fesm2022/index.mjs.map +1 -1
- package/components/containers/linear-layout/types/index.d.ts +26 -26
- package/components/containers/panel/bundles/index.umd.js +343 -215
- package/components/containers/panel/fesm2022/index.mjs +330 -207
- package/components/containers/panel/fesm2022/index.mjs.map +1 -1
- package/components/containers/panel/types/index.d.ts +48 -49
- package/components/containers/tabs/bundles/index.umd.js +832 -779
- package/components/containers/tabs/fesm2022/index.mjs +811 -763
- package/components/containers/tabs/fesm2022/index.mjs.map +1 -1
- package/components/containers/tabs/types/index.d.ts +134 -126
- package/components/containers/tile/bundles/index.umd.js +93 -60
- package/components/containers/tile/fesm2022/index.mjs +75 -47
- package/components/containers/tile/fesm2022/index.mjs.map +1 -1
- package/components/containers/tile/types/index.d.ts +11 -12
- package/components/containers/wizard/bundles/index.umd.js +1096 -1078
- package/components/containers/wizard/fesm2022/index.mjs +1069 -1056
- package/components/containers/wizard/fesm2022/index.mjs.map +1 -1
- package/components/containers/wizard/types/index.d.ts +258 -252
- package/components/data/card/bundles/index.umd.js +439 -229
- package/components/data/card/fesm2022/index.mjs +408 -203
- package/components/data/card/fesm2022/index.mjs.map +1 -1
- package/components/data/card/types/index.d.ts +50 -48
- package/components/data/form/bundles/index.umd.js +3392 -3339
- package/components/data/form/fesm2022/index.mjs +3350 -3304
- package/components/data/form/fesm2022/index.mjs.map +1 -1
- package/components/data/form/types/index.d.ts +561 -482
- package/components/data/list/bundles/index.umd.js +1523 -1601
- package/components/data/list/fesm2022/index.mjs +1507 -1590
- package/components/data/list/fesm2022/index.mjs.map +1 -1
- package/components/data/list/types/index.d.ts +300 -283
- package/components/data/live-table/bundles/index.umd.js +299 -280
- package/components/data/live-table/fesm2022/index.mjs +284 -270
- package/components/data/live-table/fesm2022/index.mjs.map +1 -1
- package/components/data/live-table/types/index.d.ts +42 -39
- package/components/data/pagination/bundles/index.umd.js +848 -881
- package/components/data/pagination/fesm2022/index.mjs +835 -879
- package/components/data/pagination/fesm2022/index.mjs.map +1 -1
- package/components/data/pagination/types/index.d.ts +110 -106
- package/components/data/table/bundles/index.umd.js +4977 -5042
- package/components/data/table/fesm2022/index.mjs +4937 -5007
- package/components/data/table/fesm2022/index.mjs.map +1 -1
- package/components/data/table/types/index.d.ts +770 -736
- package/components/dialogs/alert-dialog/bundles/index.umd.js +259 -118
- package/components/dialogs/alert-dialog/fesm2022/index.mjs +243 -109
- package/components/dialogs/alert-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/alert-dialog/types/index.d.ts +31 -26
- package/components/dialogs/confirm-dialog/bundles/index.umd.js +250 -121
- package/components/dialogs/confirm-dialog/fesm2022/index.mjs +236 -114
- package/components/dialogs/confirm-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/confirm-dialog/types/index.d.ts +34 -29
- package/components/dialogs/default/bundles/index.umd.js +509 -373
- package/components/dialogs/default/fesm2022/index.mjs +485 -354
- package/components/dialogs/default/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/default/types/index.d.ts +129 -86
- package/components/dialogs/design-dialog/bundles/index.umd.js +320 -142
- package/components/dialogs/design-dialog/fesm2022/index.mjs +305 -132
- package/components/dialogs/design-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/design-dialog/types/index.d.ts +31 -20
- package/components/dialogs/iframe-dialog/bundles/index.umd.js +258 -111
- package/components/dialogs/iframe-dialog/fesm2022/index.mjs +245 -105
- package/components/dialogs/iframe-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/iframe-dialog/types/index.d.ts +27 -22
- package/components/dialogs/login-dialog/bundles/index.umd.js +139 -106
- package/components/dialogs/login-dialog/fesm2022/index.mjs +125 -97
- package/components/dialogs/login-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/login-dialog/types/index.d.ts +27 -26
- package/components/dialogs/partial-dialog/bundles/index.umd.js +302 -149
- package/components/dialogs/partial-dialog/fesm2022/index.mjs +289 -143
- package/components/dialogs/partial-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/partial-dialog/types/index.d.ts +37 -32
- package/components/input/base-form/bundles/index.umd.js +143 -139
- package/components/input/base-form/fesm2022/index.mjs +129 -130
- package/components/input/base-form/fesm2022/index.mjs.map +1 -1
- package/components/input/base-form/types/index.d.ts +28 -29
- package/components/input/base-form-custom/bundles/index.umd.js +107 -121
- package/components/input/base-form-custom/fesm2022/index.mjs +88 -107
- package/components/input/base-form-custom/fesm2022/index.mjs.map +1 -1
- package/components/input/base-form-custom/types/index.d.ts +23 -26
- package/components/input/button/bundles/index.umd.js +177 -89
- package/components/input/button/fesm2022/index.mjs +158 -75
- package/components/input/button/fesm2022/index.mjs.map +1 -1
- package/components/input/button/types/index.d.ts +24 -25
- package/components/input/button-group/bundles/index.umd.js +110 -72
- package/components/input/button-group/fesm2022/index.mjs +90 -57
- package/components/input/button-group/fesm2022/index.mjs.map +1 -1
- package/components/input/button-group/types/index.d.ts +13 -14
- package/components/input/calendar/bundles/index.umd.js +615 -647
- package/components/input/calendar/fesm2022/index.mjs +596 -649
- package/components/input/calendar/fesm2022/index.mjs.map +1 -1
- package/components/input/calendar/types/index.d.ts +130 -131
- package/components/input/caption-position/bundles/index.umd.js +175 -188
- package/components/input/caption-position/fesm2022/index.mjs +159 -177
- package/components/input/caption-position/fesm2022/index.mjs.map +1 -1
- package/components/input/caption-position/types/index.d.ts +31 -34
- package/components/input/checkbox/bundles/index.umd.js +339 -200
- package/components/input/checkbox/fesm2022/index.mjs +319 -185
- package/components/input/checkbox/fesm2022/index.mjs.map +1 -1
- package/components/input/checkbox/types/index.d.ts +46 -41
- package/components/input/checkboxset/bundles/index.umd.js +256 -170
- package/components/input/checkboxset/fesm2022/index.mjs +242 -161
- package/components/input/checkboxset/fesm2022/index.mjs.map +1 -1
- package/components/input/checkboxset/types/index.d.ts +26 -27
- package/components/input/chips/bundles/index.umd.js +721 -733
- package/components/input/chips/fesm2022/index.mjs +706 -723
- package/components/input/chips/fesm2022/index.mjs.map +1 -1
- package/components/input/chips/types/index.d.ts +101 -90
- package/components/input/color-picker/bundles/index.umd.js +312 -137
- package/components/input/color-picker/fesm2022/index.mjs +296 -126
- package/components/input/color-picker/fesm2022/index.mjs.map +1 -1
- package/components/input/color-picker/types/index.d.ts +35 -36
- package/components/input/composite/bundles/index.umd.js +127 -112
- package/components/input/composite/fesm2022/index.mjs +106 -96
- package/components/input/composite/fesm2022/index.mjs.map +1 -1
- package/components/input/composite/types/index.d.ts +26 -27
- package/components/input/currency/bundles/index.umd.js +237 -104
- package/components/input/currency/fesm2022/index.mjs +219 -91
- package/components/input/currency/fesm2022/index.mjs.map +1 -1
- package/components/input/currency/types/index.d.ts +30 -31
- package/components/input/dataset-aware-form/bundles/index.umd.js +298 -346
- package/components/input/dataset-aware-form/fesm2022/index.mjs +286 -339
- package/components/input/dataset-aware-form/fesm2022/index.mjs.map +1 -1
- package/components/input/dataset-aware-form/types/index.d.ts +80 -80
- package/components/input/epoch/base-date-time/bundles/index.umd.js +809 -1081
- package/components/input/epoch/base-date-time/fesm2022/index.mjs +796 -1073
- package/components/input/epoch/base-date-time/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/base-date-time/types/index.d.ts +244 -247
- package/components/input/epoch/date/bundles/index.umd.js +619 -513
- package/components/input/epoch/date/fesm2022/index.mjs +604 -503
- package/components/input/epoch/date/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/date/types/index.d.ts +63 -64
- package/components/input/epoch/date-time/bundles/index.umd.js +682 -511
- package/components/input/epoch/date-time/fesm2022/index.mjs +672 -506
- package/components/input/epoch/date-time/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/date-time/types/index.d.ts +111 -112
- package/components/input/epoch/date-time-picker/bundles/index.umd.js +417 -321
- package/components/input/epoch/date-time-picker/fesm2022/index.mjs +405 -314
- package/components/input/epoch/date-time-picker/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/date-time-picker/types/index.d.ts +135 -80
- package/components/input/epoch/picker/bundles/index.umd.js +201 -148
- package/components/input/epoch/picker/fesm2022/index.mjs +183 -135
- package/components/input/epoch/picker/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/picker/types/index.d.ts +46 -38
- package/components/input/epoch/time/bundles/index.umd.js +534 -392
- package/components/input/epoch/time/fesm2022/index.mjs +523 -386
- package/components/input/epoch/time/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/time/types/index.d.ts +107 -108
- package/components/input/file-upload/bundles/index.umd.js +500 -477
- package/components/input/file-upload/fesm2022/index.mjs +484 -466
- package/components/input/file-upload/fesm2022/index.mjs.map +1 -1
- package/components/input/file-upload/types/index.d.ts +110 -109
- package/components/input/number/bundles/index.umd.js +241 -101
- package/components/input/number/fesm2022/index.mjs +224 -89
- package/components/input/number/fesm2022/index.mjs.map +1 -1
- package/components/input/number/types/index.d.ts +28 -29
- package/components/input/radioset/bundles/index.umd.js +240 -156
- package/components/input/radioset/fesm2022/index.mjs +226 -147
- package/components/input/radioset/fesm2022/index.mjs.map +1 -1
- package/components/input/radioset/types/index.d.ts +25 -26
- package/components/input/rating/bundles/index.umd.js +353 -266
- package/components/input/rating/fesm2022/index.mjs +337 -255
- package/components/input/rating/fesm2022/index.mjs.map +1 -1
- package/components/input/rating/types/index.d.ts +52 -53
- package/components/input/select/bundles/index.umd.js +295 -217
- package/components/input/select/fesm2022/index.mjs +280 -207
- package/components/input/select/fesm2022/index.mjs.map +1 -1
- package/components/input/select/types/index.d.ts +38 -39
- package/components/input/slider/bundles/index.umd.js +316 -197
- package/components/input/slider/fesm2022/index.mjs +297 -183
- package/components/input/slider/fesm2022/index.mjs.map +1 -1
- package/components/input/slider/types/index.d.ts +43 -44
- package/components/input/switch/bundles/index.umd.js +257 -219
- package/components/input/switch/fesm2022/index.mjs +243 -210
- package/components/input/switch/fesm2022/index.mjs.map +1 -1
- package/components/input/switch/types/index.d.ts +34 -35
- package/components/input/text/bundles/index.umd.js +1585 -1120
- package/components/input/text/fesm2022/index.mjs +1542 -1082
- package/components/input/text/fesm2022/index.mjs.map +1 -1
- package/components/input/text/types/index.d.ts +313 -310
- package/components/input/textarea/bundles/index.umd.js +224 -100
- package/components/input/textarea/fesm2022/index.mjs +207 -88
- package/components/input/textarea/fesm2022/index.mjs.map +1 -1
- package/components/input/textarea/types/index.d.ts +32 -33
- package/components/navigation/breadcrumb/bundles/index.umd.js +205 -131
- package/components/navigation/breadcrumb/fesm2022/index.mjs +188 -118
- package/components/navigation/breadcrumb/fesm2022/index.mjs.map +1 -1
- package/components/navigation/breadcrumb/types/index.d.ts +29 -28
- package/components/navigation/menu/bundles/index.umd.js +1461 -950
- package/components/navigation/menu/fesm2022/index.mjs +1416 -910
- package/components/navigation/menu/fesm2022/index.mjs.map +1 -1
- package/components/navigation/menu/types/index.d.ts +220 -193
- package/components/navigation/navbar/bundles/index.umd.js +172 -79
- package/components/navigation/navbar/fesm2022/index.mjs +155 -67
- package/components/navigation/navbar/fesm2022/index.mjs.map +1 -1
- package/components/navigation/navbar/types/index.d.ts +19 -20
- package/components/navigation/popover/bundles/index.umd.js +543 -519
- package/components/navigation/popover/fesm2022/index.mjs +524 -505
- package/components/navigation/popover/fesm2022/index.mjs.map +1 -1
- package/components/navigation/popover/types/index.d.ts +86 -86
- package/components/page/default/bundles/index.umd.js +634 -451
- package/components/page/default/fesm2022/index.mjs +600 -422
- package/components/page/default/fesm2022/index.mjs.map +1 -1
- package/components/page/default/types/index.d.ts +123 -119
- package/components/page/footer/bundles/index.umd.js +91 -63
- package/components/page/footer/fesm2022/index.mjs +71 -48
- package/components/page/footer/fesm2022/index.mjs.map +1 -1
- package/components/page/footer/types/index.d.ts +11 -12
- package/components/page/header/bundles/index.umd.js +96 -59
- package/components/page/header/fesm2022/index.mjs +76 -44
- package/components/page/header/fesm2022/index.mjs.map +1 -1
- package/components/page/header/types/index.d.ts +12 -13
- package/components/page/left-panel/bundles/index.umd.js +405 -407
- package/components/page/left-panel/fesm2022/index.mjs +386 -393
- package/components/page/left-panel/fesm2022/index.mjs.map +1 -1
- package/components/page/left-panel/types/index.d.ts +47 -40
- package/components/page/right-panel/bundles/index.umd.js +115 -78
- package/components/page/right-panel/fesm2022/index.mjs +96 -64
- package/components/page/right-panel/fesm2022/index.mjs.map +1 -1
- package/components/page/right-panel/types/index.d.ts +14 -13
- package/components/page/top-nav/bundles/index.umd.js +91 -60
- package/components/page/top-nav/fesm2022/index.mjs +73 -47
- package/components/page/top-nav/fesm2022/index.mjs.map +1 -1
- package/components/page/top-nav/types/index.d.ts +11 -12
- package/components/prefab/bundles/index.umd.js +253 -173
- package/components/prefab/fesm2022/index.mjs +233 -158
- package/components/prefab/fesm2022/index.mjs.map +1 -1
- package/components/prefab/types/index.d.ts +35 -33
- package/core/bundles/index.umd.js +4466 -5642
- package/core/fesm2022/index.mjs +3997 -5202
- package/core/fesm2022/index.mjs.map +1 -1
- package/core/types/index.d.ts +1785 -1808
- package/http/bundles/index.umd.js +339 -413
- package/http/fesm2022/index.mjs +323 -402
- package/http/fesm2022/index.mjs.map +1 -1
- package/http/types/index.d.ts +107 -112
- package/locales/moment/am-et.js +73 -0
- package/locales/moment/bm.js +2 -0
- package/locales/moment/ca.js +1 -1
- package/locales/moment/de-at.js +29 -1
- package/locales/moment/de-ch.js +29 -1
- package/locales/moment/de.js +29 -1
- package/locales/moment/hu.js +3 -3
- package/locales/moment/id.js +12 -1
- package/locales/moment/ka.js +1 -1
- package/locales/moment/mk.js +0 -1
- package/locales/moment/nl-be.js +1 -1
- package/locales/moment/pl.js +1 -1
- package/locales/moment/ps.js +188 -0
- package/locales/moment/pt-br.js +14 -6
- package/locales/moment/sv.js +1 -1
- package/locales/moment/sw.js +56 -14
- package/locales/moment/uk.js +5 -4
- package/locales/moment/uz-latn.js +1 -1
- package/locales/moment/uz.js +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/oAuth/bundles/index.umd.js +326 -483
- package/oAuth/fesm2022/index.mjs +267 -429
- package/oAuth/fesm2022/index.mjs.map +1 -1
- package/oAuth/types/index.d.ts +22 -26
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/runtime/base/bundles/index.umd.js +6380 -6093
- package/runtime/base/fesm2022/index.mjs +6368 -6107
- package/runtime/base/fesm2022/index.mjs.map +1 -1
- package/runtime/base/types/index.d.ts +1336 -1359
- package/runtime/dynamic/bundles/index.umd.js +1215 -851
- package/runtime/dynamic/fesm2022/index.mjs +1253 -898
- package/runtime/dynamic/fesm2022/index.mjs.map +1 -1
- package/runtime/dynamic/types/index.d.ts +140 -128
- package/scripts/datatable/datatable.js +20 -30
- package/security/bundles/index.umd.js +297 -438
- package/security/fesm2022/index.mjs +282 -443
- package/security/fesm2022/index.mjs.map +1 -1
- package/security/types/index.d.ts +127 -130
- package/swipey/bundles/index.umd.js +57 -48
- package/swipey/fesm2022/index.mjs +55 -50
- package/swipey/fesm2022/index.mjs.map +1 -1
- package/swipey/types/index.d.ts +19 -21
- package/transpiler/bundles/index.umd.js +1174 -811
- package/transpiler/fesm2022/index.mjs +1109 -757
- package/transpiler/fesm2022/index.mjs.map +1 -1
- package/transpiler/types/index.d.ts +32 -36
- package/variables/bundles/index.umd.js +2226 -3245
- package/variables/fesm2022/index.mjs +2117 -3237
- package/variables/fesm2022/index.mjs.map +1 -1
- package/variables/types/index.d.ts +410 -393
- package/build-task/.npmignore +0 -2
- package/components/advanced/carousel/.npmignore +0 -2
- package/components/advanced/custom/.npmignore +0 -2
- package/components/advanced/login/.npmignore +0 -2
- package/components/advanced/marquee/.npmignore +0 -2
- package/components/base/.npmignore +0 -2
- package/components/basic/anchor/.npmignore +0 -2
- package/components/basic/audio/.npmignore +0 -2
- package/components/basic/html/.npmignore +0 -2
- package/components/basic/icon/.npmignore +0 -2
- package/components/basic/iframe/.npmignore +0 -2
- package/components/basic/label/.npmignore +0 -2
- package/components/basic/picture/.npmignore +0 -2
- package/components/basic/progress/progress-bar/.npmignore +0 -2
- package/components/basic/progress/progress-circle/.npmignore +0 -2
- package/components/basic/progress/progress-utils/.npmignore +0 -2
- package/components/basic/rich-text-editor/.npmignore +0 -2
- package/components/basic/search/.npmignore +0 -2
- package/components/basic/spinner/.npmignore +0 -2
- package/components/basic/tree/.npmignore +0 -2
- package/components/basic/video/.npmignore +0 -2
- package/components/chart/.npmignore +0 -2
- package/components/containers/accordion/.npmignore +0 -2
- package/components/containers/layout-grid/.npmignore +0 -2
- package/components/containers/linear-layout/.npmignore +0 -2
- package/components/containers/panel/.npmignore +0 -2
- package/components/containers/tabs/.npmignore +0 -2
- package/components/containers/tile/.npmignore +0 -2
- package/components/containers/wizard/.npmignore +0 -2
- package/components/data/card/.npmignore +0 -2
- package/components/data/form/.npmignore +0 -2
- package/components/data/list/.npmignore +0 -2
- package/components/data/live-table/.npmignore +0 -2
- package/components/data/pagination/.npmignore +0 -2
- package/components/data/table/.npmignore +0 -2
- package/components/dialogs/alert-dialog/.npmignore +0 -2
- package/components/dialogs/confirm-dialog/.npmignore +0 -2
- package/components/dialogs/default/.npmignore +0 -2
- package/components/dialogs/design-dialog/.npmignore +0 -2
- package/components/dialogs/iframe-dialog/.npmignore +0 -2
- package/components/dialogs/login-dialog/.npmignore +0 -2
- package/components/dialogs/partial-dialog/.npmignore +0 -2
- package/components/input/base-form/.npmignore +0 -2
- package/components/input/base-form-custom/.npmignore +0 -2
- package/components/input/button/.npmignore +0 -2
- package/components/input/button-group/.npmignore +0 -2
- package/components/input/calendar/.npmignore +0 -2
- package/components/input/caption-position/.npmignore +0 -2
- package/components/input/checkbox/.npmignore +0 -2
- package/components/input/checkboxset/.npmignore +0 -2
- package/components/input/chips/.npmignore +0 -2
- package/components/input/color-picker/.npmignore +0 -2
- package/components/input/composite/.npmignore +0 -2
- package/components/input/currency/.npmignore +0 -2
- package/components/input/dataset-aware-form/.npmignore +0 -2
- package/components/input/epoch/base-date-time/.npmignore +0 -2
- package/components/input/epoch/date/.npmignore +0 -2
- package/components/input/epoch/date-time/.npmignore +0 -2
- package/components/input/epoch/date-time-picker/.npmignore +0 -2
- package/components/input/epoch/picker/.npmignore +0 -2
- package/components/input/epoch/time/.npmignore +0 -2
- package/components/input/file-upload/.npmignore +0 -2
- package/components/input/number/.npmignore +0 -2
- package/components/input/radioset/.npmignore +0 -2
- package/components/input/rating/.npmignore +0 -2
- package/components/input/select/.npmignore +0 -2
- package/components/input/slider/.npmignore +0 -2
- package/components/input/switch/.npmignore +0 -2
- package/components/input/text/.npmignore +0 -2
- package/components/input/textarea/.npmignore +0 -2
- package/components/navigation/breadcrumb/.npmignore +0 -2
- package/components/navigation/menu/.npmignore +0 -2
- package/components/navigation/navbar/.npmignore +0 -2
- package/components/navigation/popover/.npmignore +0 -2
- package/components/page/default/.npmignore +0 -2
- package/components/page/footer/.npmignore +0 -2
- package/components/page/header/.npmignore +0 -2
- package/components/page/left-panel/.npmignore +0 -2
- package/components/page/right-panel/.npmignore +0 -2
- package/components/page/top-nav/.npmignore +0 -2
- package/components/prefab/.npmignore +0 -2
- package/core/.npmignore +0 -2
- package/http/.npmignore +0 -2
- package/oAuth/.npmignore +0 -2
- package/runtime/base/.npmignore +0 -2
- package/runtime/dynamic/.npmignore +0 -2
- package/security/.npmignore +0 -2
- package/swipey/.npmignore +0 -2
- package/transpiler/.npmignore +0 -2
- package/variables/.npmignore +0 -2
|
@@ -1,1772 +1,1757 @@
|
|
|
1
|
-
import * as i2 from
|
|
2
|
-
import { CommonModule } from
|
|
3
|
-
import { SpinnerComponent } from
|
|
4
|
-
import * as i0 from
|
|
5
|
-
import { HostBinding, Inject, Optional, ViewEncapsulation
|
|
6
|
-
import * as i1 from
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import * as momentLib from
|
|
11
|
-
|
|
1
|
+
import * as i2 from "@angular/common";
|
|
2
|
+
import { CommonModule } from "@angular/common";
|
|
3
|
+
import { SpinnerComponent } from "@wm/components/basic/spinner";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { ChangeDetectionStrategy, Component, HostBinding, Inject, Optional, ViewEncapsulation } from "@angular/core";
|
|
6
|
+
import * as i1 from "@wm/core";
|
|
7
|
+
import { DataSource, getClonedObject, isDataSourceEqual, isEmptyObject, isNumberType, prettifyLabels, removeAttr, triggerFn } from "@wm/core";
|
|
8
|
+
import { APPLY_STYLES_TYPE, PROP_ANY, PROP_BOOLEAN, PROP_NUMBER, PROP_STRING, StylableComponent, WmAppIconComponent, provideAsWidgetRef, register, styler } from "@wm/components/base";
|
|
9
|
+
import { concat, debounce, fill, first, forEach, forEachRight, get, groupBy, includes, intersection, invert, isArray, isFinite, isObject, isString, isUndefined, keys, map, max, maxBy, minBy, orderBy, replace, split, uniq } from "lodash-es";
|
|
10
|
+
import * as momentLib from "moment";
|
|
12
11
|
const registerProps = () => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
12
|
+
register("wm-chart", /* @__PURE__ */ new Map([
|
|
13
|
+
["aggregation", {
|
|
14
|
+
value: "none",
|
|
15
|
+
...PROP_STRING
|
|
16
|
+
}],
|
|
17
|
+
["aggregationcolumn", PROP_STRING],
|
|
18
|
+
["areaviewtype", {
|
|
19
|
+
value: "stack",
|
|
20
|
+
...PROP_STRING
|
|
21
|
+
}],
|
|
22
|
+
["barspacing", {
|
|
23
|
+
value: "medium",
|
|
24
|
+
...PROP_STRING
|
|
25
|
+
}],
|
|
26
|
+
["bubblesize", PROP_STRING],
|
|
27
|
+
["centerlabel", PROP_STRING],
|
|
28
|
+
["class", PROP_STRING],
|
|
29
|
+
["customcolors", PROP_ANY],
|
|
30
|
+
["dataset", PROP_ANY],
|
|
31
|
+
["datasource", PROP_STRING],
|
|
32
|
+
["donutratio", {
|
|
33
|
+
value: "medium",
|
|
34
|
+
...PROP_STRING
|
|
35
|
+
}],
|
|
36
|
+
["formattype", {
|
|
37
|
+
value: "",
|
|
38
|
+
PROP_STRING
|
|
39
|
+
}],
|
|
40
|
+
["groupby", PROP_STRING],
|
|
41
|
+
["height", {
|
|
42
|
+
value: "210px",
|
|
43
|
+
PROP_STRING
|
|
44
|
+
}],
|
|
45
|
+
["highlightpoints", PROP_BOOLEAN],
|
|
46
|
+
["iconclass", PROP_STRING],
|
|
47
|
+
["iconurl", PROP_STRING],
|
|
48
|
+
["interpolation", {
|
|
49
|
+
value: "linear",
|
|
50
|
+
...PROP_STRING
|
|
51
|
+
}],
|
|
52
|
+
["labelthreshold", {
|
|
53
|
+
value: .01,
|
|
54
|
+
...PROP_NUMBER
|
|
55
|
+
}],
|
|
56
|
+
["labeltype", {
|
|
57
|
+
value: "percent",
|
|
58
|
+
...PROP_STRING
|
|
59
|
+
}],
|
|
60
|
+
["legendtype", {
|
|
61
|
+
value: "furious",
|
|
62
|
+
...PROP_STRING
|
|
63
|
+
}],
|
|
64
|
+
["linethickness", PROP_STRING],
|
|
65
|
+
["loadingdatamsg", {
|
|
66
|
+
value: "Loading...",
|
|
67
|
+
...PROP_STRING
|
|
68
|
+
}],
|
|
69
|
+
["name", PROP_STRING],
|
|
70
|
+
["nodatamessage", {
|
|
71
|
+
value: "No Data Available.",
|
|
72
|
+
...PROP_STRING
|
|
73
|
+
}],
|
|
74
|
+
["offset", PROP_STRING],
|
|
75
|
+
["offsetbottom", {
|
|
76
|
+
value: 55,
|
|
77
|
+
...PROP_NUMBER
|
|
78
|
+
}],
|
|
79
|
+
["offsetleft", {
|
|
80
|
+
value: 75,
|
|
81
|
+
...PROP_NUMBER
|
|
82
|
+
}],
|
|
83
|
+
["offsetright", {
|
|
84
|
+
value: 25,
|
|
85
|
+
...PROP_NUMBER
|
|
86
|
+
}],
|
|
87
|
+
["offsettop", {
|
|
88
|
+
value: 25,
|
|
89
|
+
...PROP_NUMBER
|
|
90
|
+
}],
|
|
91
|
+
["orderby", PROP_STRING],
|
|
92
|
+
["reducexticks", {
|
|
93
|
+
value: true,
|
|
94
|
+
...PROP_BOOLEAN
|
|
95
|
+
}],
|
|
96
|
+
["shape", {
|
|
97
|
+
value: "circle",
|
|
98
|
+
...PROP_STRING
|
|
99
|
+
}],
|
|
100
|
+
["show", {
|
|
101
|
+
value: true,
|
|
102
|
+
...PROP_BOOLEAN
|
|
103
|
+
}],
|
|
104
|
+
["showlabels", {
|
|
105
|
+
value: "outside",
|
|
106
|
+
...PROP_STRING
|
|
107
|
+
}],
|
|
108
|
+
["showlabelsoutside", {
|
|
109
|
+
value: true,
|
|
110
|
+
...PROP_BOOLEAN
|
|
111
|
+
}],
|
|
112
|
+
["showlegend", {
|
|
113
|
+
value: "top",
|
|
114
|
+
...PROP_STRING
|
|
115
|
+
}],
|
|
116
|
+
["showvalues", {
|
|
117
|
+
value: false,
|
|
118
|
+
...PROP_BOOLEAN
|
|
119
|
+
}],
|
|
120
|
+
["showxaxis", {
|
|
121
|
+
value: true,
|
|
122
|
+
...PROP_BOOLEAN
|
|
123
|
+
}],
|
|
124
|
+
["showxdistance", {
|
|
125
|
+
value: false,
|
|
126
|
+
...PROP_BOOLEAN
|
|
127
|
+
}],
|
|
128
|
+
["showyaxis", {
|
|
129
|
+
value: true,
|
|
130
|
+
...PROP_BOOLEAN
|
|
131
|
+
}],
|
|
132
|
+
["showydistance", {
|
|
133
|
+
value: false,
|
|
134
|
+
...PROP_BOOLEAN
|
|
135
|
+
}],
|
|
136
|
+
["staggerlabels", {
|
|
137
|
+
value: false,
|
|
138
|
+
...PROP_BOOLEAN
|
|
139
|
+
}],
|
|
140
|
+
["subheading", PROP_STRING],
|
|
141
|
+
["theme", PROP_STRING],
|
|
142
|
+
["title", PROP_STRING],
|
|
143
|
+
["tooltips", {
|
|
144
|
+
value: true,
|
|
145
|
+
...PROP_BOOLEAN
|
|
146
|
+
}],
|
|
147
|
+
["type", PROP_STRING],
|
|
148
|
+
["viewtype", {
|
|
149
|
+
value: "Grouped",
|
|
150
|
+
...PROP_STRING
|
|
151
|
+
}],
|
|
152
|
+
["xaxisdatakey", PROP_STRING],
|
|
153
|
+
["xaxislabel", PROP_STRING],
|
|
154
|
+
["xaxislabeldistance", {
|
|
155
|
+
value: 12,
|
|
156
|
+
...PROP_NUMBER
|
|
157
|
+
}],
|
|
158
|
+
["xdateformat", PROP_STRING],
|
|
159
|
+
["xdomain", {
|
|
160
|
+
value: "Default",
|
|
161
|
+
...PROP_STRING
|
|
162
|
+
}],
|
|
163
|
+
["xnumberformat", PROP_STRING],
|
|
164
|
+
["xunits", PROP_STRING],
|
|
165
|
+
["yaxisdatakey", PROP_STRING],
|
|
166
|
+
["yaxislabel", PROP_STRING],
|
|
167
|
+
["yaxislabeldistance", {
|
|
168
|
+
value: 12,
|
|
169
|
+
...PROP_NUMBER
|
|
170
|
+
}],
|
|
171
|
+
["ydomain", {
|
|
172
|
+
value: "Default",
|
|
173
|
+
...PROP_STRING
|
|
174
|
+
}],
|
|
175
|
+
["ynumberformat", PROP_STRING],
|
|
176
|
+
["yunits", PROP_STRING]
|
|
177
|
+
]));
|
|
77
178
|
};
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
179
|
+
const moment = momentLib.default || window["moment"];
|
|
180
|
+
const chartTypes = [
|
|
181
|
+
"Column",
|
|
182
|
+
"Line",
|
|
183
|
+
"Area",
|
|
184
|
+
"Cumulative Line",
|
|
185
|
+
"Bar",
|
|
186
|
+
"Pie",
|
|
187
|
+
"Donut",
|
|
188
|
+
"Bubble"
|
|
189
|
+
];
|
|
190
|
+
const allShapes = [
|
|
191
|
+
"circle",
|
|
192
|
+
"square",
|
|
193
|
+
"diamond",
|
|
194
|
+
"cross",
|
|
195
|
+
"triangle-up",
|
|
196
|
+
"triangle-down"
|
|
197
|
+
];
|
|
198
|
+
const dateList = [
|
|
199
|
+
"01/01/2001",
|
|
200
|
+
"01/01/2002",
|
|
201
|
+
"01/01/2003"
|
|
202
|
+
];
|
|
203
|
+
const themes = {
|
|
204
|
+
"Terrestrial": {
|
|
205
|
+
colors: [
|
|
206
|
+
"#1f77b4",
|
|
207
|
+
"#aec7e8",
|
|
208
|
+
"#ff7f0e",
|
|
209
|
+
"#ffbb78",
|
|
210
|
+
"#2ca02c",
|
|
211
|
+
"#98df8a",
|
|
212
|
+
"#d62728",
|
|
213
|
+
"#ff9896",
|
|
214
|
+
"#9467bd",
|
|
215
|
+
"#c5b0d5",
|
|
216
|
+
"#8c564b",
|
|
217
|
+
"#c49c94",
|
|
218
|
+
"#e377c2",
|
|
219
|
+
"#f7b6d2",
|
|
220
|
+
"#7f7f7f",
|
|
221
|
+
"#c7c7c7",
|
|
222
|
+
"#bcbd22",
|
|
223
|
+
"#dbdb8d",
|
|
224
|
+
"#17becf",
|
|
225
|
+
"#9edae5"
|
|
226
|
+
],
|
|
227
|
+
tooltip: {
|
|
228
|
+
"backgroundColor": "#de7d28",
|
|
229
|
+
"textColor": "#FFFFFF"
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"Annabelle": {
|
|
233
|
+
colors: [
|
|
234
|
+
"#393b79",
|
|
235
|
+
"#5254a3",
|
|
236
|
+
"#6b6ecf",
|
|
237
|
+
"#9c9ede",
|
|
238
|
+
"#637939",
|
|
239
|
+
"#8ca252",
|
|
240
|
+
"#b5cf6b",
|
|
241
|
+
"#cedb9c",
|
|
242
|
+
"#8c6d31",
|
|
243
|
+
"#bd9e39",
|
|
244
|
+
"#e7ba52",
|
|
245
|
+
"#e7cb94",
|
|
246
|
+
"#843c39",
|
|
247
|
+
"#ad494a",
|
|
248
|
+
"#d6616b",
|
|
249
|
+
"#e7969c",
|
|
250
|
+
"#7b4173",
|
|
251
|
+
"#a55194",
|
|
252
|
+
"#ce6dbd",
|
|
253
|
+
"#de9ed6"
|
|
254
|
+
],
|
|
255
|
+
tooltip: {
|
|
256
|
+
"backgroundColor": "#2e306f",
|
|
257
|
+
"textColor": "#FFFFFF"
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"Azure": {
|
|
261
|
+
colors: [
|
|
262
|
+
"#3182bd",
|
|
263
|
+
"#6baed6",
|
|
264
|
+
"#9ecae1",
|
|
265
|
+
"#c6dbef",
|
|
266
|
+
"#e6550d",
|
|
267
|
+
"#fd8d3c",
|
|
268
|
+
"#fdae6b",
|
|
269
|
+
"#fdd0a2",
|
|
270
|
+
"#31a354",
|
|
271
|
+
"#74c476",
|
|
272
|
+
"#a1d99b",
|
|
273
|
+
"#c7e9c0",
|
|
274
|
+
"#756bb1",
|
|
275
|
+
"#9e9ac8",
|
|
276
|
+
"#bcbddc",
|
|
277
|
+
"#dadaeb",
|
|
278
|
+
"#636363",
|
|
279
|
+
"#969696",
|
|
280
|
+
"#bdbdbd",
|
|
281
|
+
"#d9d9d9"
|
|
282
|
+
],
|
|
283
|
+
tooltip: {
|
|
284
|
+
"backgroundColor": "#3182bd",
|
|
285
|
+
"textColor": "#FFFFFF"
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"Retro": {
|
|
289
|
+
colors: [
|
|
290
|
+
"#0ca7a1",
|
|
291
|
+
"#ffa615",
|
|
292
|
+
"#334957",
|
|
293
|
+
"#acc5c2",
|
|
294
|
+
"#988f90",
|
|
295
|
+
"#8accc9",
|
|
296
|
+
"#515151",
|
|
297
|
+
"#f27861",
|
|
298
|
+
"#36c9fd",
|
|
299
|
+
"#794668",
|
|
300
|
+
"#0f709d",
|
|
301
|
+
"#0d2738",
|
|
302
|
+
"#44be78",
|
|
303
|
+
"#4a1839",
|
|
304
|
+
"#6a393f",
|
|
305
|
+
"#557d8b",
|
|
306
|
+
"#6c331c",
|
|
307
|
+
"#1c1c1c",
|
|
308
|
+
"#861500",
|
|
309
|
+
"#09562a"
|
|
310
|
+
],
|
|
311
|
+
tooltip: {
|
|
312
|
+
"backgroundColor": "#80513a",
|
|
313
|
+
"textColor": "#FFFFFF"
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
"Mellow": {
|
|
317
|
+
colors: [
|
|
318
|
+
"#f0dcbf",
|
|
319
|
+
"#88c877",
|
|
320
|
+
"#aeb918",
|
|
321
|
+
"#2e2c23",
|
|
322
|
+
"#ddddd2",
|
|
323
|
+
"#dfe956",
|
|
324
|
+
"#4c963b",
|
|
325
|
+
"#5d3801",
|
|
326
|
+
"#e1eec3",
|
|
327
|
+
"#cd8472",
|
|
328
|
+
"#fcfab3",
|
|
329
|
+
"#9a4635",
|
|
330
|
+
"#9295ad",
|
|
331
|
+
"#2e3f12",
|
|
332
|
+
"#565677",
|
|
333
|
+
"#557d8b",
|
|
334
|
+
"#4f4d02",
|
|
335
|
+
"#0c0c1b",
|
|
336
|
+
"#833324",
|
|
337
|
+
"#24120e"
|
|
338
|
+
],
|
|
339
|
+
tooltip: {
|
|
340
|
+
"backgroundColor": "#7c9e73",
|
|
341
|
+
"textColor": "#FFFFFF"
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
"Orient": {
|
|
345
|
+
colors: [
|
|
346
|
+
"#a80000",
|
|
347
|
+
"#cc6c3c",
|
|
348
|
+
"#f0e400",
|
|
349
|
+
"#000084",
|
|
350
|
+
"#fccc6c",
|
|
351
|
+
"#009c6c",
|
|
352
|
+
"#cc309c",
|
|
353
|
+
"#78cc00",
|
|
354
|
+
"#fc84e4",
|
|
355
|
+
"#48e4fc",
|
|
356
|
+
"#4878d8",
|
|
357
|
+
"#186c0c",
|
|
358
|
+
"#606060",
|
|
359
|
+
"#a8a8a8",
|
|
360
|
+
"#000000",
|
|
361
|
+
"#d7d7d7",
|
|
362
|
+
"#75a06e",
|
|
363
|
+
"#190d0b",
|
|
364
|
+
"#888888",
|
|
365
|
+
"#694b84"
|
|
366
|
+
],
|
|
367
|
+
tooltip: {
|
|
368
|
+
"backgroundColor": "#c14242",
|
|
369
|
+
"textColor": "#FFFFFF"
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
"GrayScale": {
|
|
373
|
+
colors: [
|
|
374
|
+
"#141414",
|
|
375
|
+
"#353535",
|
|
376
|
+
"#5b5b5b",
|
|
377
|
+
"#848484",
|
|
378
|
+
"#a8a8a8",
|
|
379
|
+
"#c3c3c3",
|
|
380
|
+
"#e0e0e0",
|
|
381
|
+
"#c8c8c8",
|
|
382
|
+
"#a5a5a5",
|
|
383
|
+
"#878787",
|
|
384
|
+
"#656565",
|
|
385
|
+
"#4e4e4e",
|
|
386
|
+
"#303030",
|
|
387
|
+
"#1c1c1c",
|
|
388
|
+
"#4f4f4f",
|
|
389
|
+
"#3b3b3b",
|
|
390
|
+
"#757575",
|
|
391
|
+
"#606060",
|
|
392
|
+
"#868686",
|
|
393
|
+
"#c1c1c1"
|
|
394
|
+
],
|
|
395
|
+
tooltip: {
|
|
396
|
+
"backgroundColor": "#575757",
|
|
397
|
+
"textColor": "#FFFFFF"
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
"Flyer": {
|
|
401
|
+
colors: [
|
|
402
|
+
"#3f454c",
|
|
403
|
+
"#5a646e",
|
|
404
|
+
"#848778",
|
|
405
|
+
"#cededf",
|
|
406
|
+
"#74c4dd",
|
|
407
|
+
"#0946ed",
|
|
408
|
+
"#380bb1",
|
|
409
|
+
"#000ff0",
|
|
410
|
+
"#f54a23",
|
|
411
|
+
"#1db262",
|
|
412
|
+
"#bca3aa",
|
|
413
|
+
"#ffa500",
|
|
414
|
+
"#a86b32",
|
|
415
|
+
"#63a18c",
|
|
416
|
+
"#56795e",
|
|
417
|
+
"#934343",
|
|
418
|
+
"#b75f5f",
|
|
419
|
+
"#752d2d",
|
|
420
|
+
"#4e1111",
|
|
421
|
+
"#920606"
|
|
422
|
+
],
|
|
423
|
+
tooltip: {
|
|
424
|
+
"backgroundColor": "#47637c",
|
|
425
|
+
"textColor": "#FFFFFF"
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
"Luminosity": {
|
|
429
|
+
colors: [
|
|
430
|
+
"#FFFFFF",
|
|
431
|
+
"#e4e4e4",
|
|
432
|
+
"#00bcd4",
|
|
433
|
+
"#f0dd2f",
|
|
434
|
+
"#00aabf",
|
|
435
|
+
"#018376",
|
|
436
|
+
"#e91e63",
|
|
437
|
+
"#39e5d4",
|
|
438
|
+
"#ff6d6d",
|
|
439
|
+
"#00ff76",
|
|
440
|
+
"#ff9800",
|
|
441
|
+
"#969696",
|
|
442
|
+
"#ff4200",
|
|
443
|
+
"#e00000",
|
|
444
|
+
"#95cbe5",
|
|
445
|
+
"#5331ff",
|
|
446
|
+
"#fff4a7",
|
|
447
|
+
"#e7a800",
|
|
448
|
+
"#0061e4",
|
|
449
|
+
"#d5e7ff"
|
|
450
|
+
],
|
|
451
|
+
tooltip: {
|
|
452
|
+
"backgroundColor": "#47637c",
|
|
453
|
+
"textColor": "#FFFFFF"
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
const basicProperties = [
|
|
458
|
+
"xaxislabel",
|
|
459
|
+
"yaxislabel",
|
|
460
|
+
"xunits",
|
|
461
|
+
"yunits",
|
|
462
|
+
"xnumberformat",
|
|
463
|
+
"xdateformat",
|
|
464
|
+
"ynumberformat",
|
|
465
|
+
"showvalues",
|
|
466
|
+
"showlabels",
|
|
467
|
+
"viewtype",
|
|
468
|
+
"areaviewtype",
|
|
469
|
+
"staggerlabels",
|
|
470
|
+
"reducexticks",
|
|
471
|
+
"offsettop",
|
|
472
|
+
"offsetbottom",
|
|
473
|
+
"offsetright",
|
|
474
|
+
"offsetleft",
|
|
475
|
+
"barspacing",
|
|
476
|
+
"xaxislabeldistance",
|
|
477
|
+
"yaxislabeldistance",
|
|
478
|
+
"theme",
|
|
479
|
+
"labeltype",
|
|
480
|
+
"donutratio",
|
|
481
|
+
"showlabelsoutside",
|
|
482
|
+
"showxdistance",
|
|
483
|
+
"showydistance",
|
|
484
|
+
"shape",
|
|
485
|
+
"nodatamessage",
|
|
486
|
+
"captions",
|
|
487
|
+
"showxaxis",
|
|
488
|
+
"showyaxis",
|
|
489
|
+
"centerlabel",
|
|
490
|
+
"customcolors",
|
|
491
|
+
"showlegend",
|
|
492
|
+
"legendtype",
|
|
493
|
+
"xdomain",
|
|
494
|
+
"ydomain",
|
|
495
|
+
"tooltips",
|
|
496
|
+
"linethickness",
|
|
497
|
+
"highlightpoints",
|
|
498
|
+
"interpolation",
|
|
499
|
+
"labelthreshold"
|
|
500
|
+
];
|
|
501
|
+
const barSpacingMap = {
|
|
502
|
+
"small": .3,
|
|
503
|
+
"medium": .5,
|
|
504
|
+
"large": .8
|
|
505
|
+
};
|
|
506
|
+
const donutRatioMap = {
|
|
507
|
+
"small": .3,
|
|
508
|
+
"medium": .6,
|
|
509
|
+
"large": .7
|
|
510
|
+
};
|
|
511
|
+
const barSpacingMapInvert = invert(barSpacingMap);
|
|
512
|
+
const donutRatioMapInvert = invert(donutRatioMap);
|
|
513
|
+
const tickformats = {
|
|
514
|
+
"Thousand": {
|
|
515
|
+
"prefix": "K",
|
|
516
|
+
"divider": 1e3
|
|
517
|
+
},
|
|
518
|
+
"Million": {
|
|
519
|
+
"prefix": "M",
|
|
520
|
+
"divider": 1e6
|
|
521
|
+
},
|
|
522
|
+
"Billion": {
|
|
523
|
+
"prefix": "B",
|
|
524
|
+
"divider": 1e9
|
|
525
|
+
}
|
|
177
526
|
};
|
|
178
|
-
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
527
|
+
const chartId = "#preview-chart";
|
|
528
|
+
const dataTypeJSON = [
|
|
529
|
+
"Column",
|
|
530
|
+
"Line",
|
|
531
|
+
"Pie",
|
|
532
|
+
"Bar",
|
|
533
|
+
"Donut",
|
|
534
|
+
"Bubble"
|
|
535
|
+
];
|
|
536
|
+
const lineTypeCharts = [
|
|
537
|
+
"Line",
|
|
538
|
+
"Area",
|
|
539
|
+
"Cumulative Line"
|
|
540
|
+
];
|
|
541
|
+
const SAMPLE_DATA = {
|
|
542
|
+
"group1": "Europe",
|
|
543
|
+
"group2": "Asia",
|
|
544
|
+
"group3": "America",
|
|
545
|
+
"group4": "Australia"
|
|
546
|
+
};
|
|
547
|
+
const isPieChart = (type) => type === "Pie";
|
|
548
|
+
const isLineChart = (type) => type === "Line";
|
|
549
|
+
const isBarChart = (type) => type === "Bar";
|
|
550
|
+
const isDonutChart = (type) => type === "Donut";
|
|
551
|
+
const isBubbleChart = (type) => type === "Bubble";
|
|
552
|
+
const isColumnChart = (type) => type === "Column";
|
|
553
|
+
const isAreaChart = (type) => type === "Area";
|
|
554
|
+
const isPieType = (type) => isPieChart(type) || isDonutChart(type);
|
|
555
|
+
const isChartDataJSON = (type) => includes(dataTypeJSON, type) || !includes(chartTypes, type);
|
|
556
|
+
const isLineTypeChart = (type) => includes(lineTypeCharts, type);
|
|
557
|
+
const isAxisDomainSupported = (type) => isColumnChart(type) || isAreaChart(type);
|
|
203
558
|
const getBarSpacingValue = (value, prop) => {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
if (prop === 'key') {
|
|
208
|
-
return barSpacingMapInvert[value];
|
|
209
|
-
}
|
|
559
|
+
if (prop === "value") return barSpacingMap[value];
|
|
560
|
+
if (prop === "key") return barSpacingMapInvert[value];
|
|
210
561
|
};
|
|
211
|
-
// Returns radius value
|
|
212
562
|
const getRadiusValue = (value, prop) => {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
if (prop === 'key') {
|
|
217
|
-
return donutRatioMapInvert[value];
|
|
218
|
-
}
|
|
563
|
+
if (prop === "value") return donutRatioMap[value];
|
|
564
|
+
if (prop === "key") return donutRatioMapInvert[value];
|
|
219
565
|
};
|
|
220
|
-
// Returns labels config
|
|
221
566
|
const getLabelValues = (showlabels, showlabelsoutside, prop) => {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
return labelsConfig;
|
|
567
|
+
const labelsConfig = {};
|
|
568
|
+
switch (showlabels) {
|
|
569
|
+
case "hide":
|
|
570
|
+
labelsConfig.showlabels = false;
|
|
571
|
+
break;
|
|
572
|
+
case "inside":
|
|
573
|
+
labelsConfig.showlabels = true;
|
|
574
|
+
labelsConfig.showlabelsoutside = false;
|
|
575
|
+
break;
|
|
576
|
+
case "outside":
|
|
577
|
+
labelsConfig.showlabels = true;
|
|
578
|
+
labelsConfig.showlabelsoutside = true;
|
|
579
|
+
}
|
|
580
|
+
return labelsConfig;
|
|
237
581
|
};
|
|
238
|
-
// Construct the sample data
|
|
239
582
|
const constructSampleData = (dataType, yaxisLength, shape) => {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
583
|
+
let first_series = [], second_series = [], third_series = [], first_series_array = [], second_series_array = [], third_series_array = [], first_series_bubble = [], second_series_bubble = [], third_series_bubble = [], data = [];
|
|
584
|
+
switch (dataType) {
|
|
585
|
+
case "jsonFormat":
|
|
586
|
+
first_series = [
|
|
587
|
+
{
|
|
588
|
+
"x": "01/01/2001",
|
|
589
|
+
"y": 4e6
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"x": "01/01/2002",
|
|
593
|
+
"y": 1e6
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
"x": "01/01/2003",
|
|
597
|
+
"y": 5e6
|
|
598
|
+
}
|
|
599
|
+
];
|
|
600
|
+
second_series = [
|
|
601
|
+
{
|
|
602
|
+
"x": "01/01/2001",
|
|
603
|
+
"y": 3e6
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"x": "01/01/2002",
|
|
607
|
+
"y": 4e6
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"x": "01/01/2003",
|
|
611
|
+
"y": 7e6
|
|
612
|
+
}
|
|
613
|
+
];
|
|
614
|
+
third_series = [
|
|
615
|
+
{
|
|
616
|
+
"x": "01/01/2001",
|
|
617
|
+
"y": 2e6
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
"x": "01/01/2002",
|
|
621
|
+
"y": 8e6
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"x": "01/01/2003",
|
|
625
|
+
"y": 6e6
|
|
626
|
+
}
|
|
627
|
+
];
|
|
628
|
+
data[0] = {
|
|
629
|
+
values: first_series,
|
|
630
|
+
key: SAMPLE_DATA.group1
|
|
631
|
+
};
|
|
632
|
+
if (yaxisLength >= 2) data[1] = {
|
|
633
|
+
values: second_series,
|
|
634
|
+
key: SAMPLE_DATA.group2
|
|
635
|
+
};
|
|
636
|
+
if (yaxisLength >= 3) data[2] = {
|
|
637
|
+
values: third_series,
|
|
638
|
+
key: SAMPLE_DATA.group3
|
|
639
|
+
};
|
|
640
|
+
break;
|
|
641
|
+
case "lineChartFormat":
|
|
642
|
+
first_series = [
|
|
643
|
+
{
|
|
644
|
+
"x": 1,
|
|
645
|
+
"y": 4e6
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"x": 2,
|
|
649
|
+
"y": 1e6
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"x": 3,
|
|
653
|
+
"y": 5e6
|
|
654
|
+
}
|
|
655
|
+
];
|
|
656
|
+
second_series = [
|
|
657
|
+
{
|
|
658
|
+
"x": 1,
|
|
659
|
+
"y": 3e6
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"x": 2,
|
|
663
|
+
"y": 4e6
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"x": 3,
|
|
667
|
+
"y": 7e6
|
|
668
|
+
}
|
|
669
|
+
];
|
|
670
|
+
third_series = [
|
|
671
|
+
{
|
|
672
|
+
"x": 1,
|
|
673
|
+
"y": 2e6
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
"x": 2,
|
|
677
|
+
"y": 8e6
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"x": 3,
|
|
681
|
+
"y": 6e6
|
|
682
|
+
}
|
|
683
|
+
];
|
|
684
|
+
data[0] = {
|
|
685
|
+
values: first_series,
|
|
686
|
+
key: SAMPLE_DATA.group1
|
|
687
|
+
};
|
|
688
|
+
if (yaxisLength >= 2) data[1] = {
|
|
689
|
+
values: second_series,
|
|
690
|
+
key: SAMPLE_DATA.group2
|
|
691
|
+
};
|
|
692
|
+
if (yaxisLength >= 3) data[2] = {
|
|
693
|
+
values: third_series,
|
|
694
|
+
key: SAMPLE_DATA.group3
|
|
695
|
+
};
|
|
696
|
+
break;
|
|
697
|
+
case "arrayFormat":
|
|
698
|
+
first_series_array = [
|
|
699
|
+
[1, 4e6],
|
|
700
|
+
[2, 1e6],
|
|
701
|
+
[3, 5e6]
|
|
702
|
+
];
|
|
703
|
+
second_series_array = [
|
|
704
|
+
[1, 3e6],
|
|
705
|
+
[2, 4e6],
|
|
706
|
+
[3, 7e6]
|
|
707
|
+
];
|
|
708
|
+
third_series_array = [
|
|
709
|
+
[1, 2e6],
|
|
710
|
+
[2, 8e6],
|
|
711
|
+
[3, 6e6]
|
|
712
|
+
];
|
|
713
|
+
data[0] = {
|
|
714
|
+
values: first_series_array,
|
|
715
|
+
key: SAMPLE_DATA.group1
|
|
716
|
+
};
|
|
717
|
+
if (yaxisLength >= 2) data[1] = {
|
|
718
|
+
values: second_series_array,
|
|
719
|
+
key: SAMPLE_DATA.group2
|
|
720
|
+
};
|
|
721
|
+
if (yaxisLength >= 3) data[2] = {
|
|
722
|
+
values: third_series_array,
|
|
723
|
+
key: SAMPLE_DATA.group3
|
|
724
|
+
};
|
|
725
|
+
break;
|
|
726
|
+
case "bubbleFormat":
|
|
727
|
+
shape = shape === "random" ? allShapes[Math.floor(Math.random() * allShapes.length)] : shape;
|
|
728
|
+
first_series_bubble = [
|
|
729
|
+
{
|
|
730
|
+
"x": 80.66,
|
|
731
|
+
"y": 33739900,
|
|
732
|
+
"size": 78,
|
|
733
|
+
"shape": shape
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
"x": 79.84,
|
|
737
|
+
"y": 81902300,
|
|
738
|
+
"size": 90,
|
|
739
|
+
"shape": shape
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"x": 78.6,
|
|
743
|
+
"y": 5523100,
|
|
744
|
+
"size": 45,
|
|
745
|
+
"shape": shape
|
|
746
|
+
}
|
|
747
|
+
];
|
|
748
|
+
second_series_bubble = [
|
|
749
|
+
{
|
|
750
|
+
"x": 72.73,
|
|
751
|
+
"y": 79716200,
|
|
752
|
+
"size": 98,
|
|
753
|
+
"shape": shape
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
"x": 80.05,
|
|
757
|
+
"y": 61801600,
|
|
758
|
+
"size": 20,
|
|
759
|
+
"shape": shape
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"x": 72.49,
|
|
763
|
+
"y": 73137200,
|
|
764
|
+
"size": 34,
|
|
765
|
+
"shape": shape
|
|
766
|
+
}
|
|
767
|
+
];
|
|
768
|
+
third_series_bubble = [
|
|
769
|
+
{
|
|
770
|
+
"x": 68.09,
|
|
771
|
+
"y": 33739900,
|
|
772
|
+
"size": 45,
|
|
773
|
+
"shape": shape
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
"x": 81.55,
|
|
777
|
+
"y": 7485600,
|
|
778
|
+
"size": 78,
|
|
779
|
+
"shape": shape
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
"x": 68.6,
|
|
783
|
+
"y": 14185e4,
|
|
784
|
+
"size": 56,
|
|
785
|
+
"shape": shape
|
|
786
|
+
}
|
|
787
|
+
];
|
|
788
|
+
data[0] = {
|
|
789
|
+
values: first_series_bubble,
|
|
790
|
+
key: SAMPLE_DATA.group1
|
|
791
|
+
};
|
|
792
|
+
if (yaxisLength >= 2) data[1] = {
|
|
793
|
+
values: second_series_bubble,
|
|
794
|
+
key: SAMPLE_DATA.group2
|
|
795
|
+
};
|
|
796
|
+
if (yaxisLength >= 3) data[2] = {
|
|
797
|
+
values: third_series_bubble,
|
|
798
|
+
key: SAMPLE_DATA.group3
|
|
799
|
+
};
|
|
800
|
+
break;
|
|
801
|
+
case "pieChartFormat": data = [
|
|
802
|
+
{
|
|
803
|
+
"x": SAMPLE_DATA.group1,
|
|
804
|
+
"y": 1e6
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"x": SAMPLE_DATA.group2,
|
|
808
|
+
"y": 2e6
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
"x": SAMPLE_DATA.group3,
|
|
812
|
+
"y": 3e6
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"x": SAMPLE_DATA.group4,
|
|
816
|
+
"y": 4e6
|
|
817
|
+
}
|
|
818
|
+
];
|
|
819
|
+
}
|
|
820
|
+
return data;
|
|
385
821
|
};
|
|
386
|
-
const getDataType = widgetContext => {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
return 'pieChartFormat';
|
|
393
|
-
}
|
|
394
|
-
if (isBubbleChart(type)) {
|
|
395
|
-
return 'bubbleFormat';
|
|
396
|
-
}
|
|
397
|
-
return isChartDataJSON(type) ? 'jsonFormat' : 'arrayFormat';
|
|
822
|
+
const getDataType = (widgetContext) => {
|
|
823
|
+
const type = widgetContext.type;
|
|
824
|
+
if (isLineChart(type)) return "lineChartFormat";
|
|
825
|
+
if (isPieType(type)) return "pieChartFormat";
|
|
826
|
+
if (isBubbleChart(type)) return "bubbleFormat";
|
|
827
|
+
return isChartDataJSON(type) ? "jsonFormat" : "arrayFormat";
|
|
398
828
|
};
|
|
399
|
-
|
|
400
|
-
const getSampleData = widgetContext => constructSampleData(getDataType(widgetContext), split(widgetContext.yaxisdatakey, ',').length, widgetContext.shape);
|
|
401
|
-
// Check whether X/Y Domain was set to Min and is supported for the present chart
|
|
829
|
+
const getSampleData = (widgetContext) => constructSampleData(getDataType(widgetContext), split(widgetContext.yaxisdatakey, ",").length, widgetContext.shape);
|
|
402
830
|
const isAxisDomainValid = (widgetContext, axis) => {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}
|
|
406
|
-
return false;
|
|
831
|
+
if (widgetContext[axis + "domain"] === "Min" && isAxisDomainSupported(widgetContext.type)) return true;
|
|
832
|
+
return false;
|
|
407
833
|
};
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
return true;
|
|
412
|
-
}
|
|
413
|
-
return false;
|
|
834
|
+
const areMinMaxValuesValid = (values) => {
|
|
835
|
+
if (isFinite(values.min) && isFinite(values.max)) return true;
|
|
836
|
+
return false;
|
|
414
837
|
};
|
|
415
|
-
const getYScaleMinValue = value => {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
b) no decimal part returning floor value - 1 */
|
|
419
|
-
return Math.abs(value) - _min > 0 ? value - 0.1 : _min - 1;
|
|
838
|
+
const getYScaleMinValue = (value) => {
|
|
839
|
+
const _min = Math.floor(value);
|
|
840
|
+
return Math.abs(value) - _min > 0 ? value - .1 : _min - 1;
|
|
420
841
|
};
|
|
421
|
-
// Chooses the data points of line/cumulative line/area chart and highlights them
|
|
422
842
|
const highlightPoints = (id, highlightpoints) => {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
.style('stroke-width', '6px')
|
|
427
|
-
.style('fill-opacity', '0.95')
|
|
428
|
-
.style('stroke-opacity', '0.95');
|
|
429
|
-
}
|
|
430
|
-
else {
|
|
431
|
-
chartSvg.selectAll('.nv-point')
|
|
432
|
-
.style('stroke-width', '0px')
|
|
433
|
-
.style('fill-opacity', '0');
|
|
434
|
-
}
|
|
843
|
+
const chartSvg = id ? d3.select("#wmChart" + id + " svg") : d3.select(chartId + " svg");
|
|
844
|
+
if (highlightpoints) chartSvg.selectAll(".nv-point").style("stroke-width", "6px").style("fill-opacity", "0.95").style("stroke-opacity", "0.95");
|
|
845
|
+
else chartSvg.selectAll(".nv-point").style("stroke-width", "0px").style("fill-opacity", "0");
|
|
435
846
|
};
|
|
436
|
-
// Chooses the line of line/cumulative line and increases the thickness of it
|
|
437
847
|
const setLineThickness = (id, thickness) => {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
lines.style('stroke-width', thickness);
|
|
443
|
-
}
|
|
848
|
+
const chartSvg = id ? d3.select("#wmChart" + id + " svg") : d3.select(chartId + " svg");
|
|
849
|
+
thickness = thickness || 1.5;
|
|
850
|
+
const lines = chartSvg.selectAll(".nv-line");
|
|
851
|
+
if (lines.size() !== 0) lines.style("stroke-width", thickness);
|
|
444
852
|
};
|
|
445
|
-
// Constructing a common key value map for preview and canvas mode
|
|
446
853
|
const initProperties = (widgetContext, propertyValueMap) => {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
propertyValueMap[prop] = widgetContext[prop];
|
|
453
|
-
}
|
|
454
|
-
});
|
|
455
|
-
return propertyValueMap;
|
|
854
|
+
if (!propertyValueMap || isEmptyObject(propertyValueMap)) propertyValueMap = {};
|
|
855
|
+
forEach(basicProperties, (prop) => {
|
|
856
|
+
if (isUndefined(propertyValueMap[prop])) propertyValueMap[prop] = widgetContext[prop];
|
|
857
|
+
});
|
|
858
|
+
return propertyValueMap;
|
|
456
859
|
};
|
|
457
860
|
const getNumberValue = (value, callback) => {
|
|
458
|
-
|
|
861
|
+
return isNaN(parseInt(value, 10)) ? callback(value, "value") : value;
|
|
459
862
|
};
|
|
460
|
-
// Formats the given value according to date format
|
|
461
863
|
const getDateFormatedData = (dateFormat, d) => {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
* whereas this will return 19May2019 with time lagging for few hours.
|
|
466
|
-
* This is because it returns UTC time i.e. Coordinated Universal Time (UTC).
|
|
467
|
-
* To create date in local time use moment
|
|
468
|
-
*/
|
|
469
|
-
if (dateFormat == '%c') {
|
|
470
|
-
dateFormat = '%a %b %e %X %Y';
|
|
471
|
-
}
|
|
472
|
-
return d3.timeFormat(dateFormat)(new Date(moment(moment(d).format()).valueOf()));
|
|
864
|
+
dateFormat = dateFormat || "%x";
|
|
865
|
+
if (dateFormat == "%c") dateFormat = "%a %b %e %X %Y";
|
|
866
|
+
return d3.timeFormat(dateFormat)(new Date(moment(moment(d).format()).valueOf()));
|
|
473
867
|
};
|
|
474
|
-
const removeTrailingZeros = value => {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
}
|
|
478
|
-
// Convert value to a string if it's a number
|
|
479
|
-
const stringValue = typeof value === 'number' ? value.toString() : value;
|
|
480
|
-
// Remove trailing zeros
|
|
481
|
-
return stringValue.replace(/\.0+([A-Za-z]*)$/, '$1').replace(/\.([1-9]+)0+([A-Za-z]*)$/, '.$1$2');
|
|
868
|
+
const removeTrailingZeros = (value) => {
|
|
869
|
+
if (!value) return value;
|
|
870
|
+
return (typeof value === "number" ? value.toString() : value).replace(/\.0+([A-Za-z]*)$/, "$1").replace(/\.([1-9]+)0+([A-Za-z]*)$/, ".$1$2");
|
|
482
871
|
};
|
|
483
|
-
// Formats the given value according to number format
|
|
484
872
|
const getNumberFormatedData = (numberFormat, d) => {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
numberFormatter = d3.format(numberFormat);
|
|
500
|
-
}
|
|
501
|
-
formattedData = numberFormatter(d);
|
|
502
|
-
// Getting the respective divider[1000,1000000,1000000000] based on the number format choosen
|
|
503
|
-
divider = (tickformats[numberFormat]?.divider) || 0;
|
|
504
|
-
prefix = tickformats[numberFormat]?.prefix;
|
|
505
|
-
if (prefix && divider !== 0) {
|
|
506
|
-
formattedData = d3.format('.2f')(d / divider) + prefix;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
else {
|
|
510
|
-
// Auto formatting the data when no formating option is chosen
|
|
511
|
-
formattedData = d >= 1000 ? d3.format('.1s')(d) : d;
|
|
512
|
-
}
|
|
513
|
-
formattedData = removeTrailingZeros(formattedData);
|
|
514
|
-
return formattedData;
|
|
515
|
-
};
|
|
516
|
-
// Set the visibility property of the chart x,y axis due to a bug in the nvd3
|
|
517
|
-
const toggleAxisShow = (property, value) => {
|
|
518
|
-
const $xAxis = d3.select(chartId + ' g.nv-axis.nv-x'), $yAxis = d3.select(chartId + ' g.nv-axis.nv-y');
|
|
519
|
-
if (property === 'showxaxis') {
|
|
520
|
-
$xAxis.style('visibility', value ? 'visible' : 'hidden');
|
|
521
|
-
}
|
|
522
|
-
else {
|
|
523
|
-
$yAxis.style('visibility', value ? 'visible' : 'hidden');
|
|
524
|
-
}
|
|
873
|
+
let formattedData, divider, prefix;
|
|
874
|
+
if (numberFormat) {
|
|
875
|
+
let numberFormatter;
|
|
876
|
+
if (numberFormat == "Thousand" || numberFormat == "Million" || numberFormat == "Billion") numberFormatter = d3.format(",.2s");
|
|
877
|
+
else if (numberFormat == "%") numberFormatter = d3.format(".2%");
|
|
878
|
+
else if (numberFormat == ".f") numberFormatter = d3.format(".2f");
|
|
879
|
+
else numberFormatter = d3.format(numberFormat);
|
|
880
|
+
formattedData = numberFormatter(d);
|
|
881
|
+
divider = tickformats[numberFormat]?.divider || 0;
|
|
882
|
+
prefix = tickformats[numberFormat]?.prefix;
|
|
883
|
+
if (prefix && divider !== 0) formattedData = d3.format(".2f")(d / divider) + prefix;
|
|
884
|
+
} else formattedData = d >= 1e3 ? d3.format(".1s")(d) : d;
|
|
885
|
+
formattedData = removeTrailingZeros(formattedData);
|
|
886
|
+
return formattedData;
|
|
525
887
|
};
|
|
526
|
-
const
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
return;
|
|
531
|
-
}
|
|
532
|
-
if (position === 'bottom') {
|
|
533
|
-
const legendWrapHeight = legendWrap['_groups'][0][0].getBoundingClientRect().height, wrap = d3.select(chart_Id + ' .nv-wrap'), wrapTransform = (wrap?.attr('transform')) ? wrap.attr('transform').replace(/, /g, ',') : '', coordinates = /translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(wrapTransform), getChartHeight = () => {
|
|
534
|
-
let chartHeight = $(chart_Id + ' svg>.nvd3.nv-wrap')[0].getBoundingClientRect().height;
|
|
535
|
-
if (chartHeight === 0) { // fix for IE
|
|
536
|
-
chartHeight = ($(chart_Id + ' svg')[0].getBoundingClientRect().height - (legendWrapHeight + 15));
|
|
537
|
-
}
|
|
538
|
-
return chartHeight;
|
|
539
|
-
};
|
|
540
|
-
legendWrap.attr('transform', 'translate(0 , ' + (getChartHeight() - legendWrapHeight - legendPadding) + ')');
|
|
541
|
-
if (coordinates) {
|
|
542
|
-
wrap.attr('transform', 'translate(' + coordinates[1] + ',' + legendPadding + ')');
|
|
543
|
-
}
|
|
544
|
-
}
|
|
888
|
+
const isShowLegend = (value) => {
|
|
889
|
+
if (value === "false" || value === false) return false;
|
|
890
|
+
if (value === "true" || value === true) return true;
|
|
891
|
+
return value === "hide" ? false : true;
|
|
545
892
|
};
|
|
546
|
-
// Returns value if legend need to shown or not
|
|
547
|
-
const isShowLegend = value => {
|
|
548
|
-
// Old projects will have either true or false
|
|
549
|
-
if (value === 'false' || value === false) {
|
|
550
|
-
return false;
|
|
551
|
-
}
|
|
552
|
-
if (value === 'true' || value === true) {
|
|
553
|
-
return true;
|
|
554
|
-
}
|
|
555
|
-
// New projects will have either 'Hide Legend', 'Show Top', 'Show Bottom'
|
|
556
|
-
return value === 'hide' ? false : true;
|
|
557
|
-
};
|
|
558
|
-
/**
|
|
559
|
-
* Customise the tooltip for donut & pie charts and also for charts having only one value attached to yaxis
|
|
560
|
-
* @param key
|
|
561
|
-
* @param label
|
|
562
|
-
*/
|
|
563
893
|
const customiseTooltip = (chart, propertyValueMap, widgetContext, label) => {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
'<tr class="value"><b>' + xValue +
|
|
575
|
-
'</b></tr>' +
|
|
576
|
-
'<tr>' +
|
|
577
|
-
'<td class="legend-color-guide"><div style="background-color:' + key.color + ';"></div></td>' +
|
|
578
|
-
'<td class="key">' + label + '</td>' +
|
|
579
|
-
'<td class="value">' + yValue + '</td>' +
|
|
580
|
-
'</tr>' +
|
|
581
|
-
'</tbody>' +
|
|
582
|
-
'</table>';
|
|
583
|
-
});
|
|
894
|
+
d3.selectAll(".nvtooltip").style("opacity", 0);
|
|
895
|
+
chart.tooltip.contentGenerator((key, propValueMap) => {
|
|
896
|
+
let xValue = key.data.x, yValue;
|
|
897
|
+
yValue = getNumberFormatedData(propValueMap?.ynumberformat || widgetContext?.ynumberformat || propertyValueMap?.ynumberformat, key.data.y);
|
|
898
|
+
if (isPieType(widgetContext.type)) {
|
|
899
|
+
label = key.data.x;
|
|
900
|
+
xValue = "";
|
|
901
|
+
}
|
|
902
|
+
return "<table><tbody><tr class=\"value\"><b>" + xValue + "</b></tr><tr><td class=\"legend-color-guide\"><div style=\"background-color:" + key.color + ";\"></div></td><td class=\"key\">" + label + "</td><td class=\"value\">" + yValue + "</td></tr></tbody></table>";
|
|
903
|
+
});
|
|
584
904
|
};
|
|
585
|
-
// intializes the chart obejct
|
|
586
905
|
const initChart = (widgetContext, xDomainValues, yDomainValues, propertyValueMap, isPreview) => {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
if (areMinMaxValuesValid(yValue)) {
|
|
680
|
-
// Reducing the min value to 1 so the min value is not missed out
|
|
681
|
-
yValue.min = getYScaleMinValue(yValue.min);
|
|
682
|
-
chart.yDomain([yValue.min, yValue.max]);
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
// Setting the legend type choosen by user or default it will be furious
|
|
686
|
-
chart.legend.vers((propertyValueMap.legendtype?.toLowerCase()) || 'furious');
|
|
687
|
-
if (!includes(chartTypes, widgetContext.type)) {
|
|
688
|
-
chart = nv.models.multiBarChart()
|
|
689
|
-
.x(d => d.x)
|
|
690
|
-
.y(d => d.y);
|
|
691
|
-
}
|
|
692
|
-
if (isPieType(widgetContext.type)) {
|
|
693
|
-
// In case of pie/donut chart formatting the values of it
|
|
694
|
-
if (propertyValueMap.labeltype === 'percent') {
|
|
695
|
-
chart.valueFormat(d3.format('%'));
|
|
696
|
-
}
|
|
697
|
-
else {
|
|
698
|
-
chart.valueFormat(d => getNumberFormatedData(propertyValueMap.ynumberformat, d));
|
|
699
|
-
}
|
|
700
|
-
// Customizing the tooltips in case of the pie and donut when labelType is value
|
|
701
|
-
customiseTooltip(chart, propertyValueMap, widgetContext);
|
|
702
|
-
}
|
|
703
|
-
else {
|
|
704
|
-
chart.showXAxis(propertyValueMap.showxaxis)
|
|
705
|
-
.showYAxis(propertyValueMap.showyaxis);
|
|
706
|
-
chart.legendPosition(propertyValueMap.showlegend);
|
|
707
|
-
// Setting the labels if they are specified explicitly or taking the axiskeys chosen
|
|
708
|
-
xaxislabel = propertyValueMap.xaxislabel || prettifyLabels(widgetContext.xaxisdatakey) || 'x caption';
|
|
709
|
-
yaxislabel = propertyValueMap.yaxislabel || prettifyLabels(widgetContext.yaxisdatakey) || 'y caption';
|
|
710
|
-
// Checking if y axis has multiple values
|
|
711
|
-
if (widgetContext.yaxisdatakey && widgetContext.yaxisdatakey.split(',').length > 1) {
|
|
712
|
-
hasMultipleYValues = true;
|
|
713
|
-
}
|
|
714
|
-
// Customizing the tooltip to show yaxislabel, only if the y axis contains one value
|
|
715
|
-
if (!hasMultipleYValues && !isBubbleChart(widgetContext.type)) {
|
|
716
|
-
customiseTooltip(chart, propertyValueMap, widgetContext, yaxislabel);
|
|
717
|
-
}
|
|
718
|
-
// Adding the units to the captions if they are specified
|
|
719
|
-
xaxislabel += propertyValueMap.xunits ? '(' + propertyValueMap.xunits + ')' : '';
|
|
720
|
-
yaxislabel += propertyValueMap.yunits ? '(' + propertyValueMap.yunits + ')' : '';
|
|
721
|
-
chart.xAxis
|
|
722
|
-
.axisLabel(xaxislabel)
|
|
723
|
-
.axisLabelDistance(propertyValueMap.xaxislabeldistance)
|
|
724
|
-
.staggerLabels(propertyValueMap.staggerlabels);
|
|
725
|
-
// If date format set format based date format
|
|
726
|
-
if (propertyValueMap.xdateformat || (isPreview && !isBubbleChart(widgetContext.type))) {
|
|
727
|
-
if (isLineTypeChart(widgetContext.type)) {
|
|
728
|
-
chart.xAxis.tickFormat(d => {
|
|
729
|
-
// get the actual value
|
|
730
|
-
xAxisValue = isPreview ? dateList[d - 1] : widgetContext.xDataKeyArr[d];
|
|
731
|
-
return getDateFormatedData(propertyValueMap.xdateformat, xAxisValue);
|
|
732
|
-
});
|
|
733
|
-
}
|
|
734
|
-
else {
|
|
735
|
-
chart.xAxis.tickFormat(d => getDateFormatedData(propertyValueMap.xdateformat, d));
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
else if (propertyValueMap.xnumberformat) {
|
|
739
|
-
chart.xAxis.tickFormat(d => getNumberFormatedData(propertyValueMap.xnumberformat, d));
|
|
740
|
-
}
|
|
741
|
-
else if (isLineTypeChart(widgetContext.type)) {
|
|
742
|
-
// get the actual value
|
|
743
|
-
chart.xAxis.tickFormat(d => widgetContext.xDataKeyArr[d]);
|
|
744
|
-
}
|
|
745
|
-
chart.yAxis
|
|
746
|
-
.axisLabel(yaxislabel)
|
|
747
|
-
.axisLabelDistance(propertyValueMap.yaxislabeldistance)
|
|
748
|
-
.staggerLabels(propertyValueMap.staggerlabels)
|
|
749
|
-
.tickFormat(d => getNumberFormatedData(propertyValueMap?.ynumberformat, d));
|
|
750
|
-
if (isBarChart(widgetContext.type)) {
|
|
751
|
-
chart.valueFormat(d => getNumberFormatedData(propertyValueMap?.ynumberformat, d));
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
// Support for custom colors if user gives direct string of colors in text box
|
|
755
|
-
if (isString(propertyValueMap.customcolors) && propertyValueMap.customcolors) {
|
|
756
|
-
colors = split(propertyValueMap.customcolors, ',');
|
|
757
|
-
}
|
|
758
|
-
if (isArray(propertyValueMap.customcolors)) {
|
|
759
|
-
colors = propertyValueMap.customcolors;
|
|
760
|
-
}
|
|
761
|
-
showLegend = isShowLegend(propertyValueMap.showlegend);
|
|
762
|
-
chart.showLegend(showLegend)
|
|
763
|
-
.margin({ top: propertyValueMap.offsettop, right: propertyValueMap.offsetright, bottom: propertyValueMap.offsetbottom, left: propertyValueMap.offsetleft })
|
|
764
|
-
.color(colors.length ? colors : themes[propertyValueMap.theme].colors);
|
|
765
|
-
chart.tooltip.enabled(propertyValueMap.tooltips);
|
|
766
|
-
widgetContext.message = propertyValueMap.nodatamessage || 'No data found';
|
|
767
|
-
// setting the no data message
|
|
768
|
-
chart.noData(widgetContext.message);
|
|
769
|
-
if (isLineTypeChart(widgetContext.type) && widgetContext.highlightpoints) {
|
|
770
|
-
chart.dispatch.on('stateChange', () => {
|
|
771
|
-
setTimeout(() => postPlotChartProcess(widgetContext), 100);
|
|
772
|
-
});
|
|
773
|
-
}
|
|
774
|
-
if (widgetContext.showlegend && (widgetContext.type === 'Donut' || widgetContext.type === 'Pie')) {
|
|
775
|
-
if (widgetContext.showlegend === 'right') {
|
|
776
|
-
chart.legendPosition('right');
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
return chart;
|
|
906
|
+
propertyValueMap = initProperties(widgetContext, propertyValueMap);
|
|
907
|
+
let chart, colors = [], xaxislabel, yaxislabel, labelConfig, radius, barSpacing, showLegend, xAxisValue, hasMultipleYValues;
|
|
908
|
+
const xValue = {}, yValue = {};
|
|
909
|
+
switch (widgetContext.type) {
|
|
910
|
+
case "Column":
|
|
911
|
+
barSpacing = getNumberValue(propertyValueMap.barspacing, getBarSpacingValue) || barSpacingMap.medium;
|
|
912
|
+
chart = nv.models.multiBarChart().x((d) => d.x).y((d) => d.y).reduceXTicks(propertyValueMap.reducexticks).rotateLabels(0).showControls(false).stacked(propertyValueMap.viewtype === "Stacked" ? true : false).groupSpacing(barSpacing);
|
|
913
|
+
break;
|
|
914
|
+
case "Cumulative Line":
|
|
915
|
+
chart = nv.models.cumulativeLineChart().x((d) => d[0]).y((d) => d[1]).showControls(false).useInteractiveGuideline(propertyValueMap.tooltips).interpolate(propertyValueMap.interpolation);
|
|
916
|
+
break;
|
|
917
|
+
case "Line":
|
|
918
|
+
chart = nv.models.lineChart().useInteractiveGuideline(propertyValueMap.tooltips).interpolate(propertyValueMap.interpolation);
|
|
919
|
+
break;
|
|
920
|
+
case "Area":
|
|
921
|
+
chart = nv.models.stackedAreaChart().x((d) => d.x).y((d) => d.y).clipEdge(true).showControls(false).style(propertyValueMap.areaviewtype).useInteractiveGuideline(propertyValueMap.tooltips).interpolate(propertyValueMap.interpolation);
|
|
922
|
+
break;
|
|
923
|
+
case "Bar":
|
|
924
|
+
barSpacing = getNumberValue(propertyValueMap.barspacing, getBarSpacingValue) || barSpacingMap.medium;
|
|
925
|
+
chart = nv.models.multiBarHorizontalChart().x((d) => d.x).y((d) => d.y).showControls(false).stacked(propertyValueMap.viewtype === "Stacked" ? true : false).showValues(propertyValueMap.showvalues).groupSpacing(barSpacing);
|
|
926
|
+
break;
|
|
927
|
+
case "Pie":
|
|
928
|
+
case "Donut":
|
|
929
|
+
labelConfig = getLabelValues(propertyValueMap.showlabels, propertyValueMap.showlabelsoutside, "value");
|
|
930
|
+
radius = getNumberValue(propertyValueMap.donutratio, getRadiusValue) || donutRatioMap.medium;
|
|
931
|
+
chart = nv.models.pieChart().x((d) => d.x).y((d) => d.y).showLabels(labelConfig.showlabels).labelType(propertyValueMap.labeltype).valueFormat(d3.format("%")).title(propertyValueMap.centerlabel).labelThreshold(propertyValueMap.labelthreshold || .01).labelsOutside(labelConfig.showlabelsoutside);
|
|
932
|
+
if (isDonutChart(widgetContext.type)) chart.donut(true).donutRatio(radius);
|
|
933
|
+
if (propertyValueMap.labeltype === "key-value") chart.labelType((d) => d.data.x + " " + d.data.y);
|
|
934
|
+
break;
|
|
935
|
+
case "Bubble": chart = nv.models.scatterChart().x((d) => d.x).y((d) => d.y).showDistX(propertyValueMap.showxdistance).showDistY(propertyValueMap.showydistance);
|
|
936
|
+
}
|
|
937
|
+
if (xDomainValues) {
|
|
938
|
+
xValue.min = xDomainValues.min.x || xDomainValues.min[0];
|
|
939
|
+
xValue.max = xDomainValues.max.x || xDomainValues.max[0];
|
|
940
|
+
if (areMinMaxValuesValid(xValue)) {
|
|
941
|
+
xValue.min = getYScaleMinValue(xValue.min);
|
|
942
|
+
chart.xDomain([xValue.min, xValue.max]);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
if (yDomainValues) {
|
|
946
|
+
yValue.min = yDomainValues.min.y || yDomainValues.min[1];
|
|
947
|
+
yValue.max = yDomainValues.max.y || yDomainValues.max[1];
|
|
948
|
+
if (areMinMaxValuesValid(yValue)) {
|
|
949
|
+
yValue.min = getYScaleMinValue(yValue.min);
|
|
950
|
+
chart.yDomain([yValue.min, yValue.max]);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
chart.legend.vers(propertyValueMap.legendtype?.toLowerCase() || "furious");
|
|
954
|
+
if (isPieType(widgetContext.type)) {
|
|
955
|
+
if (propertyValueMap.labeltype === "percent") chart.valueFormat(d3.format("%"));
|
|
956
|
+
else chart.valueFormat((d) => getNumberFormatedData(propertyValueMap.ynumberformat, d));
|
|
957
|
+
customiseTooltip(chart, propertyValueMap, widgetContext);
|
|
958
|
+
} else {
|
|
959
|
+
chart.showXAxis(propertyValueMap.showxaxis).showYAxis(propertyValueMap.showyaxis);
|
|
960
|
+
chart.legendPosition(propertyValueMap.showlegend);
|
|
961
|
+
xaxislabel = propertyValueMap.xaxislabel || prettifyLabels(widgetContext.xaxisdatakey) || "x caption";
|
|
962
|
+
yaxislabel = propertyValueMap.yaxislabel || prettifyLabels(widgetContext.yaxisdatakey) || "y caption";
|
|
963
|
+
if (widgetContext.yaxisdatakey && widgetContext.yaxisdatakey.split(",").length > 1) hasMultipleYValues = true;
|
|
964
|
+
if (!hasMultipleYValues && !isBubbleChart(widgetContext.type)) customiseTooltip(chart, propertyValueMap, widgetContext, yaxislabel);
|
|
965
|
+
xaxislabel += propertyValueMap.xunits ? "(" + propertyValueMap.xunits + ")" : "";
|
|
966
|
+
yaxislabel += propertyValueMap.yunits ? "(" + propertyValueMap.yunits + ")" : "";
|
|
967
|
+
chart.xAxis.axisLabel(xaxislabel).axisLabelDistance(propertyValueMap.xaxislabeldistance).staggerLabels(propertyValueMap.staggerlabels);
|
|
968
|
+
if (propertyValueMap.xdateformat || isPreview && !isBubbleChart(widgetContext.type)) {
|
|
969
|
+
if (isLineTypeChart(widgetContext.type)) chart.xAxis.tickFormat((d) => {
|
|
970
|
+
xAxisValue = isPreview ? dateList[d - 1] : widgetContext.xDataKeyArr[d];
|
|
971
|
+
return getDateFormatedData(propertyValueMap.xdateformat, xAxisValue);
|
|
972
|
+
});
|
|
973
|
+
else chart.xAxis.tickFormat((d) => getDateFormatedData(propertyValueMap.xdateformat, d));
|
|
974
|
+
} else if (propertyValueMap.xnumberformat) chart.xAxis.tickFormat((d) => getNumberFormatedData(propertyValueMap.xnumberformat, d));
|
|
975
|
+
else if (isLineTypeChart(widgetContext.type)) chart.xAxis.tickFormat((d) => widgetContext.xDataKeyArr[d]);
|
|
976
|
+
chart.yAxis.axisLabel(yaxislabel).axisLabelDistance(propertyValueMap.yaxislabeldistance).staggerLabels(propertyValueMap.staggerlabels).tickFormat((d) => getNumberFormatedData(propertyValueMap?.ynumberformat, d));
|
|
977
|
+
if (isBarChart(widgetContext.type)) chart.valueFormat((d) => getNumberFormatedData(propertyValueMap?.ynumberformat, d));
|
|
978
|
+
}
|
|
979
|
+
if (isString(propertyValueMap.customcolors) && propertyValueMap.customcolors) colors = split(propertyValueMap.customcolors, ",");
|
|
980
|
+
if (isArray(propertyValueMap.customcolors)) colors = propertyValueMap.customcolors;
|
|
981
|
+
showLegend = isShowLegend(propertyValueMap.showlegend);
|
|
982
|
+
chart.showLegend(showLegend).margin({
|
|
983
|
+
top: propertyValueMap.offsettop,
|
|
984
|
+
right: propertyValueMap.offsetright,
|
|
985
|
+
bottom: propertyValueMap.offsetbottom,
|
|
986
|
+
left: propertyValueMap.offsetleft
|
|
987
|
+
}).color(colors.length ? colors : themes[propertyValueMap.theme].colors);
|
|
988
|
+
chart.tooltip.enabled(propertyValueMap.tooltips);
|
|
989
|
+
widgetContext.message = propertyValueMap.nodatamessage || "No data found";
|
|
990
|
+
chart.noData(widgetContext.message);
|
|
991
|
+
if (isLineTypeChart(widgetContext.type) && widgetContext.highlightpoints) chart.dispatch.on("stateChange", () => {
|
|
992
|
+
setTimeout(() => postPlotChartProcess(widgetContext), 100);
|
|
993
|
+
});
|
|
994
|
+
if (widgetContext.showlegend && (widgetContext.type === "Donut" || widgetContext.type === "Pie")) {
|
|
995
|
+
if (widgetContext.showlegend === "right") chart.legendPosition("right");
|
|
996
|
+
}
|
|
997
|
+
return chart;
|
|
780
998
|
};
|
|
781
|
-
// @ts-ignore
|
|
782
999
|
const postPlotChartProcess = (widgetContext, isPreview) => {
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
}
|
|
789
|
-
// Modifying the legend position only when legend is shown
|
|
790
|
-
// if (widgetContext.showlegend) {
|
|
791
|
-
// modifyLegendPosition(widgetContext, widgetContext.showlegend, id);
|
|
792
|
-
// }
|
|
1000
|
+
const id = isPreview ? null : widgetContext.$id;
|
|
1001
|
+
if (isLineTypeChart(widgetContext.type)) {
|
|
1002
|
+
setLineThickness(id, widgetContext.linethickness);
|
|
1003
|
+
highlightPoints(id, widgetContext.highlightpoints);
|
|
1004
|
+
}
|
|
793
1005
|
};
|
|
794
|
-
// @ts-ignore
|
|
795
1006
|
const getDateList = () => dateList;
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
'Bubble': ['bubblesize', 'shape']
|
|
800
|
-
}, NONE = 'none', advanceDataProps = ['aggregation', 'aggregationcolumn', 'groupby', 'orderby'],
|
|
801
|
-
// XPaths to get actual data of data points in charts
|
|
802
|
-
chartDataPointXpath = {
|
|
803
|
-
'Column': 'rect.nv-bar',
|
|
804
|
-
'Bar': 'g.nv-bar',
|
|
805
|
-
'Area': '.nv-stackedarea .nv-point',
|
|
806
|
-
'Cumulative Line': '.nv-cumulativeLine .nv-scatterWrap path.nv-point',
|
|
807
|
-
'Line': '.nv-lineChart .nv-scatterWrap path.nv-point',
|
|
808
|
-
'Pie': '.nv-pieChart .nv-slice path',
|
|
809
|
-
'Donut': '.nv-pieChart .nv-slice path',
|
|
810
|
-
'Bubble': '.nv-scatterChart .nv-point-paths path'
|
|
811
|
-
},
|
|
812
|
-
// all properties of the chart
|
|
813
|
-
allOptions = ['bubblesize', 'shape'], styleProps = {
|
|
814
|
-
'fontunit': 'font-size',
|
|
815
|
-
'fontsize': 'font-size',
|
|
816
|
-
'color': 'fill',
|
|
817
|
-
'fontfamily': 'font-family',
|
|
818
|
-
'fontweight': 'font-weight',
|
|
819
|
-
'fontstyle': 'font-style',
|
|
820
|
-
'textdecoration': 'text-decoration'
|
|
821
|
-
},
|
|
822
|
-
// Getting the relevant aggregation function based on the selected option
|
|
823
|
-
aggregationFnMap = {
|
|
824
|
-
'average': 'AVG',
|
|
825
|
-
'count': 'COUNT',
|
|
826
|
-
'maximum': 'MAX',
|
|
827
|
-
'minimum': 'MIN',
|
|
828
|
-
'sum': 'SUM'
|
|
1007
|
+
const WIDGET_CONFIG = {
|
|
1008
|
+
widgetType: "wm-chart",
|
|
1009
|
+
hostClass: "app-chart"
|
|
829
1010
|
};
|
|
830
|
-
const
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
1011
|
+
const NONE = "none";
|
|
1012
|
+
const advanceDataProps = [
|
|
1013
|
+
"aggregation",
|
|
1014
|
+
"aggregationcolumn",
|
|
1015
|
+
"groupby",
|
|
1016
|
+
"orderby"
|
|
1017
|
+
];
|
|
1018
|
+
const chartDataPointXpath = {
|
|
1019
|
+
"Column": "rect.nv-bar",
|
|
1020
|
+
"Bar": "g.nv-bar",
|
|
1021
|
+
"Area": ".nv-stackedarea .nv-point",
|
|
1022
|
+
"Cumulative Line": ".nv-cumulativeLine .nv-scatterWrap path.nv-point",
|
|
1023
|
+
"Line": ".nv-lineChart .nv-scatterWrap path.nv-point",
|
|
1024
|
+
"Pie": ".nv-pieChart .nv-slice path",
|
|
1025
|
+
"Donut": ".nv-pieChart .nv-slice path",
|
|
1026
|
+
"Bubble": ".nv-scatterChart .nv-point-paths path"
|
|
838
1027
|
};
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
});
|
|
848
|
-
return {
|
|
849
|
-
'columns': orderByColumns,
|
|
850
|
-
'orders': orders
|
|
851
|
-
};
|
|
1028
|
+
const styleProps = {
|
|
1029
|
+
"fontunit": "font-size",
|
|
1030
|
+
"fontsize": "font-size",
|
|
1031
|
+
"color": "fill",
|
|
1032
|
+
"fontfamily": "font-family",
|
|
1033
|
+
"fontweight": "font-weight",
|
|
1034
|
+
"fontstyle": "font-style",
|
|
1035
|
+
"textdecoration": "text-decoration"
|
|
852
1036
|
};
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
1037
|
+
const aggregationFnMap = {
|
|
1038
|
+
"average": "AVG",
|
|
1039
|
+
"count": "COUNT",
|
|
1040
|
+
"maximum": "MAX",
|
|
1041
|
+
"minimum": "MIN",
|
|
1042
|
+
"sum": "SUM"
|
|
1043
|
+
};
|
|
1044
|
+
const getBooleanValue = (val) => {
|
|
1045
|
+
if (val === true || val === "true") return true;
|
|
1046
|
+
if (val === false || val === "false") return false;
|
|
1047
|
+
return val;
|
|
1048
|
+
};
|
|
1049
|
+
const getLodashOrderByFormat = (orderby) => {
|
|
1050
|
+
let columns;
|
|
1051
|
+
const orderByColumns = [], orders = [];
|
|
1052
|
+
forEach(split(orderby, ","), function(col) {
|
|
1053
|
+
columns = split(col, ":");
|
|
1054
|
+
orderByColumns.push(columns[0]);
|
|
1055
|
+
orders.push(columns[1]);
|
|
1056
|
+
});
|
|
1057
|
+
return {
|
|
1058
|
+
"columns": orderByColumns,
|
|
1059
|
+
"orders": orders
|
|
1060
|
+
};
|
|
1061
|
+
};
|
|
1062
|
+
const getValidAliasName = (aliasName) => aliasName ? aliasName.replace(/\./g, "$") : null;
|
|
856
1063
|
const setTextStyle = (properties, id) => {
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
charttext.style(properties);
|
|
860
|
-
}
|
|
1064
|
+
const charttext = d3.select("#wmChart" + id + " svg").selectAll("text");
|
|
1065
|
+
if (!charttext.empty()) charttext.style(properties);
|
|
861
1066
|
};
|
|
862
|
-
const angle = d => {
|
|
863
|
-
|
|
864
|
-
|
|
1067
|
+
const angle = (d) => {
|
|
1068
|
+
const a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;
|
|
1069
|
+
return a > 90 ? a - 180 : a;
|
|
865
1070
|
};
|
|
866
|
-
class ChartComponent extends StylableComponent {
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
if (this.dataset && !isEmpty(propertiesMap)) {
|
|
1551
|
-
columns = []; // TODO: fetchPropertiesMapColumns(propertiesMap);
|
|
1552
|
-
}
|
|
1553
|
-
if (columns) {
|
|
1554
|
-
// Iterating through all the columns and fetching the numeric and non primary key columns
|
|
1555
|
-
forEach(Object.keys(columns), (key) => {
|
|
1556
|
-
type = columns[key].type;
|
|
1557
|
-
if (isNumberType(type)) {
|
|
1558
|
-
this.numericColumns.push(key);
|
|
1559
|
-
}
|
|
1560
|
-
// Hiding only table's primary key
|
|
1561
|
-
if (columns[key].isRelatedPk === 'true' || !columns[key].isPrimaryKey) {
|
|
1562
|
-
this.nonPrimaryColumns.push(key);
|
|
1563
|
-
}
|
|
1564
|
-
});
|
|
1565
|
-
this.numericColumns = this.numericColumns.sort();
|
|
1566
|
-
this.nonPrimaryColumns = this.nonPrimaryColumns.sort();
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
// plot the chart
|
|
1570
|
-
handleDataSet(newVal) {
|
|
1571
|
-
this.errMsg = '';
|
|
1572
|
-
// Resetting the flag to false when the binding was removed
|
|
1573
|
-
if (!newVal && !this.binddataset) {
|
|
1574
|
-
this.isVisuallyGrouped = false;
|
|
1575
|
-
this.axisoptions = null;
|
|
1576
|
-
}
|
|
1577
|
-
// liveVariables contain data in 'data' property' of the variable
|
|
1578
|
-
this.chartData = this.isLiveVariable ? newVal || '' : (newVal && newVal.dataValue === '' && keys(newVal).length === 1) ? '' : newVal;
|
|
1579
|
-
// if the data returned is an object make it an array of object
|
|
1580
|
-
if (!isArray(this.chartData) && isObject(this.chartData)) {
|
|
1581
|
-
this.chartData = [this.chartData];
|
|
1582
|
-
}
|
|
1583
|
-
if (newVal?.filterFields) {
|
|
1584
|
-
this.filterFields = newVal.filterFields;
|
|
1585
|
-
}
|
|
1586
|
-
// plotchart for only valid data and only after bound variable returns data
|
|
1587
|
-
if (this.chartData) {
|
|
1588
|
-
this._plotChartProxy();
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
// sets the center label for donut chart type
|
|
1592
|
-
setDonutCenterLabel(labelValue) {
|
|
1593
|
-
let chartSvg, pieGroups;
|
|
1594
|
-
chartSvg = d3.select('#wmChart' + this.$id + ' svg');
|
|
1595
|
-
pieGroups = chartSvg.select('.nv-wrap.nv-pie').select('.nv-pie');
|
|
1596
|
-
pieGroups.text('');
|
|
1597
|
-
pieGroups.append('text')
|
|
1598
|
-
.attr('dy', '.35em')
|
|
1599
|
-
.attr('text-anchor', 'middle')
|
|
1600
|
-
.attr('class', 'nv-pie-title')
|
|
1601
|
-
.text(labelValue)
|
|
1602
|
-
.each(function (d) {
|
|
1603
|
-
const d3text = d3.select(this), circ = d3.select(this.parentElement), totalWidth = Number(circ.node().getBoundingClientRect().width),
|
|
1604
|
-
// minus the ring width from total width
|
|
1605
|
-
availWidth = totalWidth - 30, textWidth = this.getComputedTextLength();
|
|
1606
|
-
d3text.attr("data-scale", availWidth / textWidth);
|
|
1607
|
-
}).style("font-size", function () {
|
|
1608
|
-
// 16 is the default font size to multiply with the scaled value and 24 is the maximum font size that can be applied
|
|
1609
|
-
const fontSize = 16 * d3.select(this).attr("data-scale");
|
|
1610
|
-
return fontSize > 24 ? 24 : fontSize + "px";
|
|
1611
|
-
});
|
|
1612
|
-
}
|
|
1613
|
-
onPropertyChange(key, newVal, oldVal) {
|
|
1614
|
-
super.onPropertyChange(key, newVal, oldVal);
|
|
1615
|
-
switch (key) {
|
|
1616
|
-
case 'dataset':
|
|
1617
|
-
this.handleDataSet(newVal);
|
|
1618
|
-
break;
|
|
1619
|
-
case 'centerlabel':
|
|
1620
|
-
if (this.chart) {
|
|
1621
|
-
this.chart.title(newVal);
|
|
1622
|
-
this.setDonutCenterLabel(newVal);
|
|
1623
|
-
}
|
|
1624
|
-
break;
|
|
1625
|
-
case 'type':
|
|
1626
|
-
// Based on the change in type deciding the default margins
|
|
1627
|
-
if (isPieType(this.type)) {
|
|
1628
|
-
this.offsettop = 20;
|
|
1629
|
-
this.offsetright = 0;
|
|
1630
|
-
this.offsetbottom = 0;
|
|
1631
|
-
this.offsetleft = 0;
|
|
1632
|
-
}
|
|
1633
|
-
else if (oldVal === 'Pie' || oldVal === 'Donut') {
|
|
1634
|
-
this.offsettop = 25;
|
|
1635
|
-
this.offsetright = 25;
|
|
1636
|
-
this.offsetbottom = 55;
|
|
1637
|
-
this.offsetleft = 75;
|
|
1638
|
-
}
|
|
1639
|
-
if (oldVal !== newVal) {
|
|
1640
|
-
this.clearCanvas = true;
|
|
1641
|
-
}
|
|
1642
|
-
// In studio mode, configure properties dependent on chart type
|
|
1643
|
-
this._plotChartProxy();
|
|
1644
|
-
break;
|
|
1645
|
-
default:
|
|
1646
|
-
// In RunMode, the plotchart method will not be called for all property change
|
|
1647
|
-
this._plotChartProxy();
|
|
1648
|
-
break;
|
|
1649
|
-
}
|
|
1650
|
-
if (includes(advanceDataProps, key)) {
|
|
1651
|
-
this._plotChartProxy();
|
|
1652
|
-
}
|
|
1653
|
-
}
|
|
1654
|
-
handleLoading(data) {
|
|
1655
|
-
const dataSource = this.datasource;
|
|
1656
|
-
if (dataSource?.execute(DataSource.Operation.IS_API_AWARE) && isDataSourceEqual(data.variable, dataSource)) {
|
|
1657
|
-
this.variableInflight = data.active;
|
|
1658
|
-
this.isLoadInProgress = data.active;
|
|
1659
|
-
}
|
|
1660
|
-
}
|
|
1661
|
-
hideTooltip() {
|
|
1662
|
-
d3.selectAll('.nvtooltip').style('opacity', 0);
|
|
1663
|
-
}
|
|
1664
|
-
onStyleChange(key, newVal, oldVal) {
|
|
1665
|
-
const styleObj = {};
|
|
1666
|
-
super.onStyleChange(key, newVal, oldVal);
|
|
1667
|
-
switch (key) {
|
|
1668
|
-
case 'fontsize':
|
|
1669
|
-
case 'fontunit':
|
|
1670
|
-
case 'color':
|
|
1671
|
-
case 'fontfamily':
|
|
1672
|
-
case 'fontweight':
|
|
1673
|
-
case 'fontstyle':
|
|
1674
|
-
case 'textdecoration':
|
|
1675
|
-
styleObj[styleProps[key]] = (key === 'fontsize' || key === 'fontunit') ? this.fontsize + this.fontunit : newVal;
|
|
1676
|
-
setTextStyle(styleObj, this.$id);
|
|
1677
|
-
break;
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
constructor(inj, app, explicitContext) {
|
|
1681
|
-
super(inj, WIDGET_CONFIG, explicitContext);
|
|
1682
|
-
this.app = app;
|
|
1683
|
-
this.iconclass = '';
|
|
1684
|
-
this.nonPrimaryColumns = [];
|
|
1685
|
-
this.xDataKeyArr = [];
|
|
1686
|
-
this.chartData = [];
|
|
1687
|
-
this._processedData = [];
|
|
1688
|
-
this._subsciptions = [];
|
|
1689
|
-
this._plotChartProxy = debounce(this.plotChartProxy.bind(this), 100);
|
|
1690
|
-
this.redraw = this._plotChartProxy.bind(this);
|
|
1691
|
-
styler(this.nativeElement, this, APPLY_STYLES_TYPE.CONTAINER, ['fontsize', 'fontunit', 'color', 'fontfamily', 'fontweight', 'fontstyle', 'textdecoration']);
|
|
1692
|
-
// generate unique id for the component
|
|
1693
|
-
this.$id = this.widgetId || Math.random();
|
|
1694
|
-
// remove title attribute as the element on hover shows you the hint through-out the element
|
|
1695
|
-
removeAttr(this.nativeElement, 'title');
|
|
1696
|
-
this.chartReady = false;
|
|
1697
|
-
this.binddataset = this.nativeElement.getAttribute('dataset.bind');
|
|
1698
|
-
// Show loading status based on the variable life cycle
|
|
1699
|
-
this._subsciptions.push(this.app.subscribe('toggle-variable-state', this.handleLoading.bind(this)));
|
|
1700
|
-
// Will hide tolltip of a chart in mobile when the user scrolls.
|
|
1701
|
-
this._subsciptions.push(this.app.subscribe('iscroll-start', () => { this.hideTooltip(); }));
|
|
1702
|
-
}
|
|
1703
|
-
ngAfterViewInit() {
|
|
1704
|
-
super.ngAfterViewInit();
|
|
1705
|
-
// For old projects
|
|
1706
|
-
if (!includes(['outside', 'inside', 'hide'], this.showlabels)) {
|
|
1707
|
-
this.showlabels = getBooleanValue(this.showlabels);
|
|
1708
|
-
this.showlabelsoutside = getBooleanValue(this.showlabelsoutside);
|
|
1709
|
-
this.showlabels = this.showlabels ? (this.showlabelsoutside ? 'outside' : 'inside') : 'hide';
|
|
1710
|
-
}
|
|
1711
|
-
if (!this.theme) {
|
|
1712
|
-
// Default theme for pie/donut is Azure and for other it is Terrestrial
|
|
1713
|
-
this.theme = isPieType(this.type) ? 'Azure' : 'Terrestrial';
|
|
1714
|
-
}
|
|
1715
|
-
this.nativeElement.setAttribute('id', 'wmChart' + this.$id);
|
|
1716
|
-
// When there is not value binding, then plot the chart with sample data
|
|
1717
|
-
if (!this.binddataset && !this.nativeElement.getAttribute('scopedataset')) {
|
|
1718
|
-
this._plotChartProxy();
|
|
1719
|
-
}
|
|
1720
|
-
}
|
|
1721
|
-
ngOnDestroy() {
|
|
1722
|
-
// destroy all subscriptions to prevent memory leak.
|
|
1723
|
-
this.hideTooltip();
|
|
1724
|
-
// MEMORY LEAK FIX: Unsubscribe from all subscriptions
|
|
1725
|
-
if (this._subsciptions) {
|
|
1726
|
-
this._subsciptions.forEach((subscription) => {
|
|
1727
|
-
subscription();
|
|
1728
|
-
});
|
|
1729
|
-
this._subsciptions = [];
|
|
1730
|
-
}
|
|
1731
|
-
// MEMORY LEAK FIX: Clear chart instance
|
|
1732
|
-
if (this.chart) {
|
|
1733
|
-
this.chart = null;
|
|
1734
|
-
}
|
|
1735
|
-
// MEMORY LEAK FIX: Remove resize handler if exists
|
|
1736
|
-
if (this._resizeFn) {
|
|
1737
|
-
this._resizeFn = null;
|
|
1738
|
-
}
|
|
1739
|
-
// MEMORY LEAK FIX: Clear array references
|
|
1740
|
-
this.chartData = [];
|
|
1741
|
-
this._processedData = [];
|
|
1742
|
-
this.sampleData = [];
|
|
1743
|
-
this.xDataKeyArr = [];
|
|
1744
|
-
this.nonPrimaryColumns = [];
|
|
1745
|
-
super.ngOnDestroy();
|
|
1746
|
-
}
|
|
1747
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: ChartComponent, deps: [{ token: i0.Injector }, { token: i1.App }, { token: 'EXPLICIT_CONTEXT', optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1748
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.21", type: ChartComponent, isStandalone: true, selector: "div[wmChart]", host: { properties: { "class.panel": "this.title" } }, providers: [
|
|
1749
|
-
provideAsWidgetRef(ChartComponent)
|
|
1750
|
-
], usesInheritance: true, ngImport: i0, template: "@if (title) {\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">\n <div class=\"pull-left\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" iconClasses=\"panel-icon\" alt=\"Chart icon\"></wm-app-icon>\n </div>\n <div class=\"heading\" [innerHTML]=\"title\"></div>\n @if (subheading) {\n <div class=\"description\" [innerHTML]=\"subheading\"></div>\n }\n </h3>\n </div>\n}\n<div class=\"app-chart-inner\" [ngClass]=\"{'loading':isLoadInProgress, 'panel-body': title}\">\n <svg></svg>\n @if (showContentLoadError && showNoDataMsg) {\n <div class=\"wm-content-info readonly-wrapper\">\n <p class=\"wm-message\" [title]=\"hintMsg\" [ngClass]=\"{'error': invalidConfig}\" [innerText]=\"errMsg\"></p>\n </div>\n }\n <div wmSpinner show.bind=\"isLoadInProgress\" caption.bind=\"loadingdatamsg\"></div>\n</div>\n", styles: [".nvtooltip h3,.nvtooltip p{margin:0;text-align:center}.nv-distx,.nv-disty,.nv-noninteractive,.nvd3 .nv-axis,.nvd3 .nv-interactiveGuideLine,.nvd3.nv-pie .nv-label,.nvd3.nv-sparklineplus g.nv-hoverValue,.nvtooltip{pointer-events:none}.nvd3 .nv-axis{opacity:1}.nvd3 .nv-axis path{fill:none;stroke:#000;stroke-opacity:.75;shape-rendering:crispEdges}.nvd3 .nv-axis .zero line,.nvd3 .nv-axis line.zero,.nvd3 .nv-axis path.domain{stroke-opacity:.75}.nvd3 .nv-axis.nv-x path.domain{stroke-opacity:0}.nvd3 .nv-axis line{fill:none;stroke:#e5e5e5;shape-rendering:crispEdges}.nvd3 .nv-axis .nv-axisMaxMin text,.nvtooltip table td.key.total{font-weight:700}.nvd3 .x .nv-axis .nv-axisMaxMin text,.nvd3 .x2 .nv-axis .nv-axisMaxMin text,.nvd3 .x3 .nv-axis .nv-axisMaxMin text{text-anchor:middle}.nvd3 .nv-axis.nv-disabled,.nvd3 .nv-controlsWrap .nv-legend .nv-check-box .nv-check{opacity:0}.nvd3 .nv-bars rect{fill-opacity:.75;-webkit-transition:fill-opacity .25s linear;transition:fill-opacity .25s linear}.nvd3 .nv-bars rect.hover,.nvd3 .nv-boxplot circle:hover,.nvd3 .nv-boxplot rect:hover,.nvd3 .nv-candlestickBar .nv-ticks rect:hover,.nvd3 .nv-discretebar .nv-groups rect:hover,.nvd3 .nv-multibar .nv-groups rect:hover,.nvd3 .nv-multibarHorizontal .nv-groups rect:hover,.nvd3 .nv-scatter .nv-point.hover,.nvd3.nv-bullet .nv-measure:hover,.nvd3.nv-linePlusBar .nv-bar rect:hover,.nvd3.nv-pie .hover path{fill-opacity:1}.nvd3 .nv-bars .hover rect{fill:#add8e6}.nvd3 .nv-bars text{fill:#0000}.nvd3 .nv-bars .hover text{fill:#000}.nvd3 .nv-discretebar .nv-groups rect,.nvd3 .nv-multibar .nv-groups rect,.nvd3 .nv-multibarHorizontal .nv-groups rect{stroke-opacity:0;-webkit-transition:fill-opacity .25s linear;transition:fill-opacity .25s linear}.nvd3 .nv-discretebar .nv-groups text,.nvd3 .nv-multibarHorizontal .nv-groups text{font-weight:700;fill:#000;stroke:#0000}.nvd3 .nv-boxplot circle{fill-opacity:.5}.nvd3 line.nv-boxplot-median{stroke:#000}.nv-boxplot-tick:hover{stroke-width:2.5px}.nvd3.nv-bullet{font:10px sans-serif}.nvd3.nv-bullet .nv-measure{fill-opacity:.8}.nvd3.nv-bullet .nv-marker{stroke:#000;stroke-width:2px}.nvd3.nv-bullet .nv-markerTriangle{stroke:#000;fill:#fff;stroke-width:1.5px}.nvd3.nv-bullet .nv-markerLine{stroke:#000;stroke-width:1.5px}.nvd3.nv-bullet .nv-tick line{stroke:#666;stroke-width:.5px}.nvd3.nv-bullet .nv-range.nv-s0{fill:#eee}.nvd3.nv-bullet .nv-range.nv-s1{fill:#ddd}.nvd3.nv-bullet .nv-range.nv-s2{fill:#ccc}.nvd3.nv-bullet .nv-title{font-size:14px;font-weight:700}.nvd3.nv-bullet .nv-subtitle{fill:#999}.nvd3.nv-bullet .nv-range{fill:#bababa;fill-opacity:.4}.nvd3.nv-bullet .nv-range:hover{fill-opacity:.7}.nvd3.nv-candlestickBar .nv-ticks .nv-tick,.nvd3.nv-ohlcBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.hover,.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.positive rect,.nvd3.nv-sparklineplus .nv-maxValue{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.negative rect,.nvd3.nv-sparklineplus .nv-minValue{stroke:#d62728;fill:#d62728}.with-transitions .nv-candlestickBar .nv-ticks .nv-tick,.with-transitions .nvd3 .nv-groups .nv-point{-webkit-transition:stroke-width .25s linear,stroke-opacity .25s linear;transition:stroke-width .25s linear,stroke-opacity .25s linear}.nvd3.nv-candlestickBar .nv-ticks line{stroke:#333}.nv-force-node{stroke:#fff;stroke-width:1.5px}.nv-force-link{stroke:#999;stroke-opacity:.6}.nv-force-node text{stroke-width:0}.nvd3 .nv-check-box .nv-box{fill-opacity:0;stroke-width:2}.nvd3 .nv-check-box .nv-check{fill-opacity:0;stroke-width:4}.nvd3 .nv-hoverArea,.nvd3 .nv-series.nv-disabled .nv-check-box .nv-check,.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point,.nvd3.nv-pie .nv-label rect{fill-opacity:0;stroke-opacity:0}.nvd3.nv-linePlusBar .nv-bar rect{fill-opacity:.75}.nvd3 .nv-groups path.nv-line,.nvd3.nv-sparkline path{fill:none}.nvd3 .nv-groups path.nv-area{stroke:none}.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point{fill-opacity:.5!important;stroke-opacity:.5!important}.nvd3 .nv-groups .nv-point.hover,.nvd3.nv-scatter .nv-groups .nv-point.hover{stroke-width:7px;fill-opacity:.95!important;stroke-opacity:.95!important}.nvd3 .nv-point-paths path{stroke:#aaa;stroke-opacity:0;fill:#eee;fill-opacity:0}.nvd3 .nv-indexLine{cursor:ew-resize}svg.nvd3-svg{-webkit-user-select:none;-ms-user-select:none;user-select:none;display:block;width:100%;height:100%}.nvtooltip.with-3d-shadow,.with-3d-shadow .nvtooltip{-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px #0003;border-radius:5px}.nvd3 text{font:12px Arial,sans-serif}.nvtooltip h3,.nvtooltip table td.key{font-weight:400}.nvd3 .title{font:700 14px Arial,sans-serif}.nvd3 .nv-background{fill:#fff;fill-opacity:0}.nvd3.nv-noData{font-size:18px;font-weight:700}.nv-brush .selection{fill-opacity:.125;shape-rendering:crispEdges}.nv-brush .handle path{fill:#eee;stroke:#666}.nvd3 .nv-legend .nv-series{cursor:pointer}.nvd3 .nv-legend .nv-disabled circle{fill-opacity:0}.nvd3 .nv-brush .selection{fill-opacity:0!important}.nvd3 .nv-brushBackground rect{stroke:#000;stroke-width:.4;fill:#fff;fill-opacity:.7}@media print{.nvd3 text{stroke-width:0;fill-opacity:1}}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive{stroke:#2ca02c}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative{stroke:#d62728}.nvd3 .background path{fill:none;stroke:#eee;stroke-opacity:.4;shape-rendering:crispEdges}.nvd3 .foreground path{fill:none;stroke-opacity:.7}.nvd3 .nv-parallelCoordinates-brush .selection{fill:#fff;fill-opacity:.6;stroke:gray;shape-rendering:crispEdges}.nvd3 .nv-parallelCoordinates .hover{fill-opacity:1;stroke-width:3px}.nvd3 .missingValuesline line{fill:none;stroke:#000;stroke-width:1;stroke-opacity:1;stroke-dasharray:5,5}.nvd3.nv-pie path{stroke-opacity:0;-webkit-transition:fill-opacity .25s linear,stroke-width .25s linear,stroke-opacity .25s linear;transition:fill-opacity .25s linear,stroke-width .25s linear,stroke-opacity .25s linear;stroke:#fff;stroke-width:1px;stroke-opacity:1;fill-opacity:.7}.nvd3.nv-pie .nv-pie-title{font-size:24px;fill:#13c4f996}.nvd3.nv-pie .nv-slice text{stroke:#000;stroke-width:0}.nvd3 .nv-groups .nv-point.hover{stroke-width:20px;stroke-opacity:.5}.nvd3.nv-sparklineplus .nv-hoverValue line{stroke:#333;stroke-width:1.5px}.nvd3.nv-sparklineplus,.nvd3.nv-sparklineplus g{pointer-events:all}.nvd3.nv-sparklineplus .nv-xValue,.nvd3.nv-sparklineplus .nv-yValue{stroke-width:0;font-size:.9em;font-weight:400}.nvd3.nv-sparklineplus .nv-yValue{stroke:#f66}.nvd3.nv-sparklineplus .nv-currentValue{font-weight:700;font-size:1.1em}.nvd3.nv-stackedarea path.nv-area{fill-opacity:.7;stroke-opacity:0;-webkit-transition:fill-opacity .25s linear,stroke-opacity .25s linear;transition:fill-opacity .25s linear,stroke-opacity .25s linear}.nvd3.nv-stackedarea path.nv-area.hover{fill-opacity:.9}.nvd3.nv-stackedarea .nv-groups .nv-point{stroke-opacity:0;fill-opacity:0}.nvtooltip{position:absolute;background-color:#fff;color:#000;padding:1px;border:1px solid rgba(0,0,0,.5);z-index:10000;display:block;font-family:Arial,sans-serif;font-size:13px;text-align:left;white-space:nowrap;-webkit-user-select:none;-ms-user-select:none;user-select:none;background:#fffc;border-radius:4px}.nvtooltip.with-transitions,.with-transitions .nvtooltip{-webkit-transition:opacity 50ms linear .2s;transition:opacity 50ms linear .2s}.nvtooltip.x-nvtooltip,.nvtooltip.y-nvtooltip{padding:8px}.nvtooltip h3{padding:4px 14px;line-height:18px;background-color:#f7f7f7bf;color:#000;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.nvtooltip p{padding:5px 14px}.nvtooltip span{display:inline-block;margin:2px 0}.nvtooltip table{margin:6px;border-spacing:0}.nvtooltip table td{padding:2px 9px 2px 0;vertical-align:middle}.nvtooltip table td.value{text-align:right;font-weight:700}.nvtooltip table td.percent{color:#a9a9a9}.nvtooltip table tr.highlight td{padding:1px 9px 1px 0;border-bottom-style:solid;border-bottom-width:1px;border-top-style:solid;border-top-width:1px}.nvtooltip table td.legend-color-guide div{vertical-align:middle;width:12px;height:12px;border:1px solid #999}.nvtooltip .footer{padding:3px;text-align:center}.nvtooltip-pending-removal{pointer-events:none;display:none}.nvd3 line.nv-guideline{stroke:#ccc}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: SpinnerComponent, selector: "[wmSpinner]", exportAs: ["wmSpinner"] }, { kind: "component", type: WmAppIconComponent, selector: "wm-app-icon", inputs: ["icon", "iconclass", "iconurl", "defaultIconClass", "defaultClasses", "iconStyle", "alt"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1751
|
-
}
|
|
1752
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: ChartComponent, decorators: [{
|
|
1753
|
-
type: Component,
|
|
1754
|
-
args: [{ standalone: true, imports: [CommonModule, SpinnerComponent, WmAppIconComponent], selector: 'div[wmChart]', providers: [
|
|
1755
|
-
provideAsWidgetRef(ChartComponent)
|
|
1756
|
-
], encapsulation: ViewEncapsulation.None, template: "@if (title) {\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">\n <div class=\"pull-left\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" iconClasses=\"panel-icon\" alt=\"Chart icon\"></wm-app-icon>\n </div>\n <div class=\"heading\" [innerHTML]=\"title\"></div>\n @if (subheading) {\n <div class=\"description\" [innerHTML]=\"subheading\"></div>\n }\n </h3>\n </div>\n}\n<div class=\"app-chart-inner\" [ngClass]=\"{'loading':isLoadInProgress, 'panel-body': title}\">\n <svg></svg>\n @if (showContentLoadError && showNoDataMsg) {\n <div class=\"wm-content-info readonly-wrapper\">\n <p class=\"wm-message\" [title]=\"hintMsg\" [ngClass]=\"{'error': invalidConfig}\" [innerText]=\"errMsg\"></p>\n </div>\n }\n <div wmSpinner show.bind=\"isLoadInProgress\" caption.bind=\"loadingdatamsg\"></div>\n</div>\n", styles: [".nvtooltip h3,.nvtooltip p{margin:0;text-align:center}.nv-distx,.nv-disty,.nv-noninteractive,.nvd3 .nv-axis,.nvd3 .nv-interactiveGuideLine,.nvd3.nv-pie .nv-label,.nvd3.nv-sparklineplus g.nv-hoverValue,.nvtooltip{pointer-events:none}.nvd3 .nv-axis{opacity:1}.nvd3 .nv-axis path{fill:none;stroke:#000;stroke-opacity:.75;shape-rendering:crispEdges}.nvd3 .nv-axis .zero line,.nvd3 .nv-axis line.zero,.nvd3 .nv-axis path.domain{stroke-opacity:.75}.nvd3 .nv-axis.nv-x path.domain{stroke-opacity:0}.nvd3 .nv-axis line{fill:none;stroke:#e5e5e5;shape-rendering:crispEdges}.nvd3 .nv-axis .nv-axisMaxMin text,.nvtooltip table td.key.total{font-weight:700}.nvd3 .x .nv-axis .nv-axisMaxMin text,.nvd3 .x2 .nv-axis .nv-axisMaxMin text,.nvd3 .x3 .nv-axis .nv-axisMaxMin text{text-anchor:middle}.nvd3 .nv-axis.nv-disabled,.nvd3 .nv-controlsWrap .nv-legend .nv-check-box .nv-check{opacity:0}.nvd3 .nv-bars rect{fill-opacity:.75;-webkit-transition:fill-opacity .25s linear;transition:fill-opacity .25s linear}.nvd3 .nv-bars rect.hover,.nvd3 .nv-boxplot circle:hover,.nvd3 .nv-boxplot rect:hover,.nvd3 .nv-candlestickBar .nv-ticks rect:hover,.nvd3 .nv-discretebar .nv-groups rect:hover,.nvd3 .nv-multibar .nv-groups rect:hover,.nvd3 .nv-multibarHorizontal .nv-groups rect:hover,.nvd3 .nv-scatter .nv-point.hover,.nvd3.nv-bullet .nv-measure:hover,.nvd3.nv-linePlusBar .nv-bar rect:hover,.nvd3.nv-pie .hover path{fill-opacity:1}.nvd3 .nv-bars .hover rect{fill:#add8e6}.nvd3 .nv-bars text{fill:#0000}.nvd3 .nv-bars .hover text{fill:#000}.nvd3 .nv-discretebar .nv-groups rect,.nvd3 .nv-multibar .nv-groups rect,.nvd3 .nv-multibarHorizontal .nv-groups rect{stroke-opacity:0;-webkit-transition:fill-opacity .25s linear;transition:fill-opacity .25s linear}.nvd3 .nv-discretebar .nv-groups text,.nvd3 .nv-multibarHorizontal .nv-groups text{font-weight:700;fill:#000;stroke:#0000}.nvd3 .nv-boxplot circle{fill-opacity:.5}.nvd3 line.nv-boxplot-median{stroke:#000}.nv-boxplot-tick:hover{stroke-width:2.5px}.nvd3.nv-bullet{font:10px sans-serif}.nvd3.nv-bullet .nv-measure{fill-opacity:.8}.nvd3.nv-bullet .nv-marker{stroke:#000;stroke-width:2px}.nvd3.nv-bullet .nv-markerTriangle{stroke:#000;fill:#fff;stroke-width:1.5px}.nvd3.nv-bullet .nv-markerLine{stroke:#000;stroke-width:1.5px}.nvd3.nv-bullet .nv-tick line{stroke:#666;stroke-width:.5px}.nvd3.nv-bullet .nv-range.nv-s0{fill:#eee}.nvd3.nv-bullet .nv-range.nv-s1{fill:#ddd}.nvd3.nv-bullet .nv-range.nv-s2{fill:#ccc}.nvd3.nv-bullet .nv-title{font-size:14px;font-weight:700}.nvd3.nv-bullet .nv-subtitle{fill:#999}.nvd3.nv-bullet .nv-range{fill:#bababa;fill-opacity:.4}.nvd3.nv-bullet .nv-range:hover{fill-opacity:.7}.nvd3.nv-candlestickBar .nv-ticks .nv-tick,.nvd3.nv-ohlcBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.hover,.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.positive rect,.nvd3.nv-sparklineplus .nv-maxValue{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.negative rect,.nvd3.nv-sparklineplus .nv-minValue{stroke:#d62728;fill:#d62728}.with-transitions .nv-candlestickBar .nv-ticks .nv-tick,.with-transitions .nvd3 .nv-groups .nv-point{-webkit-transition:stroke-width .25s linear,stroke-opacity .25s linear;transition:stroke-width .25s linear,stroke-opacity .25s linear}.nvd3.nv-candlestickBar .nv-ticks line{stroke:#333}.nv-force-node{stroke:#fff;stroke-width:1.5px}.nv-force-link{stroke:#999;stroke-opacity:.6}.nv-force-node text{stroke-width:0}.nvd3 .nv-check-box .nv-box{fill-opacity:0;stroke-width:2}.nvd3 .nv-check-box .nv-check{fill-opacity:0;stroke-width:4}.nvd3 .nv-hoverArea,.nvd3 .nv-series.nv-disabled .nv-check-box .nv-check,.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point,.nvd3.nv-pie .nv-label rect{fill-opacity:0;stroke-opacity:0}.nvd3.nv-linePlusBar .nv-bar rect{fill-opacity:.75}.nvd3 .nv-groups path.nv-line,.nvd3.nv-sparkline path{fill:none}.nvd3 .nv-groups path.nv-area{stroke:none}.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point{fill-opacity:.5!important;stroke-opacity:.5!important}.nvd3 .nv-groups .nv-point.hover,.nvd3.nv-scatter .nv-groups .nv-point.hover{stroke-width:7px;fill-opacity:.95!important;stroke-opacity:.95!important}.nvd3 .nv-point-paths path{stroke:#aaa;stroke-opacity:0;fill:#eee;fill-opacity:0}.nvd3 .nv-indexLine{cursor:ew-resize}svg.nvd3-svg{-webkit-user-select:none;-ms-user-select:none;user-select:none;display:block;width:100%;height:100%}.nvtooltip.with-3d-shadow,.with-3d-shadow .nvtooltip{-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px #0003;border-radius:5px}.nvd3 text{font:12px Arial,sans-serif}.nvtooltip h3,.nvtooltip table td.key{font-weight:400}.nvd3 .title{font:700 14px Arial,sans-serif}.nvd3 .nv-background{fill:#fff;fill-opacity:0}.nvd3.nv-noData{font-size:18px;font-weight:700}.nv-brush .selection{fill-opacity:.125;shape-rendering:crispEdges}.nv-brush .handle path{fill:#eee;stroke:#666}.nvd3 .nv-legend .nv-series{cursor:pointer}.nvd3 .nv-legend .nv-disabled circle{fill-opacity:0}.nvd3 .nv-brush .selection{fill-opacity:0!important}.nvd3 .nv-brushBackground rect{stroke:#000;stroke-width:.4;fill:#fff;fill-opacity:.7}@media print{.nvd3 text{stroke-width:0;fill-opacity:1}}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive{stroke:#2ca02c}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative{stroke:#d62728}.nvd3 .background path{fill:none;stroke:#eee;stroke-opacity:.4;shape-rendering:crispEdges}.nvd3 .foreground path{fill:none;stroke-opacity:.7}.nvd3 .nv-parallelCoordinates-brush .selection{fill:#fff;fill-opacity:.6;stroke:gray;shape-rendering:crispEdges}.nvd3 .nv-parallelCoordinates .hover{fill-opacity:1;stroke-width:3px}.nvd3 .missingValuesline line{fill:none;stroke:#000;stroke-width:1;stroke-opacity:1;stroke-dasharray:5,5}.nvd3.nv-pie path{stroke-opacity:0;-webkit-transition:fill-opacity .25s linear,stroke-width .25s linear,stroke-opacity .25s linear;transition:fill-opacity .25s linear,stroke-width .25s linear,stroke-opacity .25s linear;stroke:#fff;stroke-width:1px;stroke-opacity:1;fill-opacity:.7}.nvd3.nv-pie .nv-pie-title{font-size:24px;fill:#13c4f996}.nvd3.nv-pie .nv-slice text{stroke:#000;stroke-width:0}.nvd3 .nv-groups .nv-point.hover{stroke-width:20px;stroke-opacity:.5}.nvd3.nv-sparklineplus .nv-hoverValue line{stroke:#333;stroke-width:1.5px}.nvd3.nv-sparklineplus,.nvd3.nv-sparklineplus g{pointer-events:all}.nvd3.nv-sparklineplus .nv-xValue,.nvd3.nv-sparklineplus .nv-yValue{stroke-width:0;font-size:.9em;font-weight:400}.nvd3.nv-sparklineplus .nv-yValue{stroke:#f66}.nvd3.nv-sparklineplus .nv-currentValue{font-weight:700;font-size:1.1em}.nvd3.nv-stackedarea path.nv-area{fill-opacity:.7;stroke-opacity:0;-webkit-transition:fill-opacity .25s linear,stroke-opacity .25s linear;transition:fill-opacity .25s linear,stroke-opacity .25s linear}.nvd3.nv-stackedarea path.nv-area.hover{fill-opacity:.9}.nvd3.nv-stackedarea .nv-groups .nv-point{stroke-opacity:0;fill-opacity:0}.nvtooltip{position:absolute;background-color:#fff;color:#000;padding:1px;border:1px solid rgba(0,0,0,.5);z-index:10000;display:block;font-family:Arial,sans-serif;font-size:13px;text-align:left;white-space:nowrap;-webkit-user-select:none;-ms-user-select:none;user-select:none;background:#fffc;border-radius:4px}.nvtooltip.with-transitions,.with-transitions .nvtooltip{-webkit-transition:opacity 50ms linear .2s;transition:opacity 50ms linear .2s}.nvtooltip.x-nvtooltip,.nvtooltip.y-nvtooltip{padding:8px}.nvtooltip h3{padding:4px 14px;line-height:18px;background-color:#f7f7f7bf;color:#000;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.nvtooltip p{padding:5px 14px}.nvtooltip span{display:inline-block;margin:2px 0}.nvtooltip table{margin:6px;border-spacing:0}.nvtooltip table td{padding:2px 9px 2px 0;vertical-align:middle}.nvtooltip table td.value{text-align:right;font-weight:700}.nvtooltip table td.percent{color:#a9a9a9}.nvtooltip table tr.highlight td{padding:1px 9px 1px 0;border-bottom-style:solid;border-bottom-width:1px;border-top-style:solid;border-top-width:1px}.nvtooltip table td.legend-color-guide div{vertical-align:middle;width:12px;height:12px;border:1px solid #999}.nvtooltip .footer{padding:3px;text-align:center}.nvtooltip-pending-removal{pointer-events:none;display:none}.nvd3 line.nv-guideline{stroke:#ccc}\n"] }]
|
|
1757
|
-
}], ctorParameters: () => [{ type: i0.Injector }, { type: i1.App }, { type: undefined, decorators: [{
|
|
1758
|
-
type: Inject,
|
|
1759
|
-
args: ['EXPLICIT_CONTEXT']
|
|
1760
|
-
}, {
|
|
1761
|
-
type: Optional
|
|
1762
|
-
}] }], propDecorators: { title: [{
|
|
1763
|
-
type: HostBinding,
|
|
1764
|
-
args: ['class.panel']
|
|
1765
|
-
}] } });
|
|
1766
|
-
|
|
1767
|
-
/**
|
|
1768
|
-
* Generated bundle index. Do not edit.
|
|
1769
|
-
*/
|
|
1770
|
-
|
|
1071
|
+
var ChartComponent = class ChartComponent extends StylableComponent {
|
|
1072
|
+
static {
|
|
1073
|
+
this.initializeProps = registerProps();
|
|
1074
|
+
}
|
|
1075
|
+
isGroupByEnabled() {
|
|
1076
|
+
return !!(this.groupby && this.groupby !== NONE);
|
|
1077
|
+
}
|
|
1078
|
+
isValidAxis() {
|
|
1079
|
+
return this.binddataset ? this.xaxisdatakey && this.yaxisdatakey : true;
|
|
1080
|
+
}
|
|
1081
|
+
isAggregationEnabled() {
|
|
1082
|
+
return !!(this.isGroupByEnabled() && this.aggregation !== NONE && this.aggregationcolumn);
|
|
1083
|
+
}
|
|
1084
|
+
isDataFilteringEnabled() {
|
|
1085
|
+
return this.isAggregationEnabled() || !this.isVisuallyGrouped && this.orderby;
|
|
1086
|
+
}
|
|
1087
|
+
getxAxisVal(dataObj, xKey, index) {
|
|
1088
|
+
const value = get(dataObj, xKey);
|
|
1089
|
+
if (isLineTypeChart(this.type) && !isNumberType(this.xAxisDataType)) {
|
|
1090
|
+
this.xDataKeyArr.push(value);
|
|
1091
|
+
if (value instanceof Date) return value;
|
|
1092
|
+
else return index;
|
|
1093
|
+
}
|
|
1094
|
+
return value;
|
|
1095
|
+
}
|
|
1096
|
+
getXMinMaxValues(datum) {
|
|
1097
|
+
if (!datum) return;
|
|
1098
|
+
const xValues = {};
|
|
1099
|
+
xValues.min = minBy(datum.values, (dataObject) => dataObject.x || dataObject[0]);
|
|
1100
|
+
xValues.max = maxBy(datum.values, (dataObject) => dataObject.x || dataObject[0]);
|
|
1101
|
+
return xValues;
|
|
1102
|
+
}
|
|
1103
|
+
getYMinMaxValues(datum) {
|
|
1104
|
+
const yValues = {}, minValues = [], maxValues = [];
|
|
1105
|
+
if (!datum) return;
|
|
1106
|
+
forEach(datum, (data) => {
|
|
1107
|
+
minValues.push(minBy(data.values, function(dataObject) {
|
|
1108
|
+
return dataObject.y || dataObject[1];
|
|
1109
|
+
}));
|
|
1110
|
+
maxValues.push(maxBy(data.values, function(dataObject) {
|
|
1111
|
+
return dataObject.y || dataObject[1];
|
|
1112
|
+
}));
|
|
1113
|
+
});
|
|
1114
|
+
yValues.min = minBy(minValues, (dataObject) => dataObject.y || dataObject[1]);
|
|
1115
|
+
yValues.max = maxBy(maxValues, (dataObject) => dataObject.y || dataObject[1]);
|
|
1116
|
+
return yValues;
|
|
1117
|
+
}
|
|
1118
|
+
getValidData(values) {
|
|
1119
|
+
return values.length === 1 && values[0] === void 0 ? [] : values;
|
|
1120
|
+
}
|
|
1121
|
+
valueFinder(dataObj, xKey, yKey, index, shape) {
|
|
1122
|
+
const xVal = this.getxAxisVal(dataObj, xKey, index), value = get(dataObj, yKey), yVal = parseFloat(value) || value, size = parseFloat(dataObj[this.bubblesize]) || 2;
|
|
1123
|
+
let dataPoint = {};
|
|
1124
|
+
if (isChartDataJSON(this.type)) {
|
|
1125
|
+
dataPoint.x = xVal;
|
|
1126
|
+
dataPoint.y = yVal;
|
|
1127
|
+
if (isBubbleChart(this.type)) {
|
|
1128
|
+
dataPoint.size = size;
|
|
1129
|
+
dataPoint.shape = shape || "circle";
|
|
1130
|
+
}
|
|
1131
|
+
} else dataPoint = [xVal, yVal];
|
|
1132
|
+
dataPoint._dataObj = dataObj;
|
|
1133
|
+
return dataPoint;
|
|
1134
|
+
}
|
|
1135
|
+
setErrMsg(message) {
|
|
1136
|
+
if (this.showNoDataMsg) {
|
|
1137
|
+
this.showContentLoadError = true;
|
|
1138
|
+
this.invalidConfig = true;
|
|
1139
|
+
this.errMsg = "";
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
processChartData() {
|
|
1143
|
+
this.sampleData = getSampleData(this);
|
|
1144
|
+
this.xDataKeyArr = [];
|
|
1145
|
+
if (!this.binddataset) {
|
|
1146
|
+
this.xDataKeyArr = getDateList();
|
|
1147
|
+
return this.sampleData;
|
|
1148
|
+
}
|
|
1149
|
+
if (!this.chartData?.length) return [];
|
|
1150
|
+
let datum = [], yAxisKey, shapes = [], values = [];
|
|
1151
|
+
const xAxisKey = this.xaxisdatakey, yAxisKeys = this.yaxisdatakey ? this.yaxisdatakey.split(",") : [], dataSet = this.chartData;
|
|
1152
|
+
if (isArray(dataSet)) {
|
|
1153
|
+
if (isPieType(this.type)) {
|
|
1154
|
+
yAxisKey = yAxisKeys[0];
|
|
1155
|
+
datum = map(dataSet, (dataObj, index) => {
|
|
1156
|
+
if (!isEmptyObject(dataSet[index])) return this.valueFinder(dataSet[index], xAxisKey, yAxisKey);
|
|
1157
|
+
});
|
|
1158
|
+
datum = this.getValidData(datum);
|
|
1159
|
+
} else {
|
|
1160
|
+
if (isBubbleChart(this.type)) shapes = this.shape === "random" ? allShapes : this.shape;
|
|
1161
|
+
yAxisKeys.forEach((yAxisKey, series) => {
|
|
1162
|
+
values = map(dataSet, (dataObj, index) => {
|
|
1163
|
+
if (!isEmptyObject(dataSet[index])) return this.valueFinder(dataSet[index], xAxisKey, yAxisKey, index, isArray(shapes) && shapes[series] || this.shape);
|
|
1164
|
+
});
|
|
1165
|
+
values = this.getValidData(values);
|
|
1166
|
+
datum.push({
|
|
1167
|
+
values,
|
|
1168
|
+
key: prettifyLabels(yAxisKey)
|
|
1169
|
+
});
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
return datum;
|
|
1174
|
+
}
|
|
1175
|
+
setChartData(data) {
|
|
1176
|
+
if (data) this._processedData = data;
|
|
1177
|
+
}
|
|
1178
|
+
getChartData() {
|
|
1179
|
+
return this._processedData;
|
|
1180
|
+
}
|
|
1181
|
+
getVisuallyGroupedData(queryResponse, groupingColumn) {
|
|
1182
|
+
let groupData = {}, groupValues = [], orderByDetails, maxLength;
|
|
1183
|
+
const chartData = [], _isAreaChart = isAreaChart(this.type), yAxisKey = first(split(this.yaxisdatakey, ","));
|
|
1184
|
+
this.xDataKeyArr = [];
|
|
1185
|
+
queryResponse = orderBy(queryResponse, split(this.groupby, ","));
|
|
1186
|
+
if (this.orderby) {
|
|
1187
|
+
orderByDetails = getLodashOrderByFormat(this.orderby);
|
|
1188
|
+
queryResponse = orderBy(queryResponse, orderByDetails.columns, orderByDetails.orders);
|
|
1189
|
+
}
|
|
1190
|
+
queryResponse = groupBy(queryResponse, groupingColumn);
|
|
1191
|
+
if (_isAreaChart) maxLength = max(map(queryResponse, (obj) => obj.length));
|
|
1192
|
+
forEach(queryResponse, (values, groupKey) => {
|
|
1193
|
+
groupValues = _isAreaChart ? fill(new Array(maxLength), [0, 0]) : [];
|
|
1194
|
+
forEachRight(values, (value, index) => {
|
|
1195
|
+
groupValues[index] = this.valueFinder(value, this.xaxisdatakey, yAxisKey, index);
|
|
1196
|
+
});
|
|
1197
|
+
groupData = {
|
|
1198
|
+
key: groupKey,
|
|
1199
|
+
values: groupValues
|
|
1200
|
+
};
|
|
1201
|
+
chartData.push(groupData);
|
|
1202
|
+
});
|
|
1203
|
+
return chartData;
|
|
1204
|
+
}
|
|
1205
|
+
getGroupingDetails() {
|
|
1206
|
+
if (this.isGroupByEnabled() && !this.isAggregationEnabled()) {
|
|
1207
|
+
let isVisuallyGrouped = false, visualGroupingColumn, groupingExpression, columns = [], groupingColumnIndex;
|
|
1208
|
+
const groupbyColumns = this.groupby.split(","), yAxisKeys = this.yaxisdatakey ? this.yaxisdatakey.split(",") : [];
|
|
1209
|
+
if (groupbyColumns.length > 1) {
|
|
1210
|
+
groupbyColumns.every((column, index) => {
|
|
1211
|
+
if (this.xaxisdatakey !== column && $.inArray(column, yAxisKeys) === -1) {
|
|
1212
|
+
isVisuallyGrouped = true;
|
|
1213
|
+
visualGroupingColumn = column;
|
|
1214
|
+
groupingColumnIndex = index;
|
|
1215
|
+
groupbyColumns.splice(groupingColumnIndex, 1);
|
|
1216
|
+
return false;
|
|
1217
|
+
}
|
|
1218
|
+
return true;
|
|
1219
|
+
});
|
|
1220
|
+
if (visualGroupingColumn) columns.push(visualGroupingColumn);
|
|
1221
|
+
columns = concat(columns, groupbyColumns);
|
|
1222
|
+
}
|
|
1223
|
+
if (this.xaxisdatakey !== this.aggregationcolumn) columns.push(this.xaxisdatakey);
|
|
1224
|
+
forEach(yAxisKeys, (key) => {
|
|
1225
|
+
if (key !== this.aggregationcolumn) columns.push(key);
|
|
1226
|
+
});
|
|
1227
|
+
groupingExpression = columns.join(",");
|
|
1228
|
+
this.isVisuallyGrouped = isVisuallyGrouped;
|
|
1229
|
+
return {
|
|
1230
|
+
expression: groupingExpression,
|
|
1231
|
+
isVisuallyGrouped,
|
|
1232
|
+
visualGroupingColumn
|
|
1233
|
+
};
|
|
1234
|
+
}
|
|
1235
|
+
return {
|
|
1236
|
+
expression: "",
|
|
1237
|
+
isVisuallyGrouped: false,
|
|
1238
|
+
visualGroupingColumn: ""
|
|
1239
|
+
};
|
|
1240
|
+
}
|
|
1241
|
+
getAggregatedData(callback) {
|
|
1242
|
+
const variable = this.datasource, yAxisKeys = this.yaxisdatakey ? this.yaxisdatakey.split(",") : [], data = {};
|
|
1243
|
+
let sortExpr, columns = [], colAlias, orderByColumns, groupByFields = [];
|
|
1244
|
+
if (!variable) return;
|
|
1245
|
+
if (this.isGroupByEnabled()) groupByFields = split(this.groupby, ",");
|
|
1246
|
+
if (this.orderby) {
|
|
1247
|
+
sortExpr = replace(this.orderby, /:/g, " ");
|
|
1248
|
+
columns = uniq(concat(columns, groupByFields, [this.aggregationcolumn]));
|
|
1249
|
+
orderByColumns = getLodashOrderByFormat(this.orderby).columns;
|
|
1250
|
+
forEach(intersection(columns, orderByColumns), (col) => {
|
|
1251
|
+
colAlias = getValidAliasName(col);
|
|
1252
|
+
sortExpr = replace(sortExpr, col, colAlias);
|
|
1253
|
+
});
|
|
1254
|
+
}
|
|
1255
|
+
if (this.isAggregationEnabled()) {
|
|
1256
|
+
data.groupByFields = groupByFields;
|
|
1257
|
+
data.aggregations = [{
|
|
1258
|
+
"field": this.aggregationcolumn,
|
|
1259
|
+
"type": aggregationFnMap[this.aggregation],
|
|
1260
|
+
"alias": getValidAliasName(this.aggregationcolumn)
|
|
1261
|
+
}];
|
|
1262
|
+
}
|
|
1263
|
+
variable.execute("getAggregatedData", {
|
|
1264
|
+
"aggregations": data,
|
|
1265
|
+
"sort": sortExpr
|
|
1266
|
+
}).then((response) => {
|
|
1267
|
+
const chartData = [], aggregationAlias = getValidAliasName(this.aggregationcolumn), xAxisAliasKey = getValidAliasName(this.xaxisdatakey), yAxisAliasKeys = [];
|
|
1268
|
+
yAxisKeys.forEach((yAxisKey) => yAxisAliasKeys.push(getValidAliasName(yAxisKey)));
|
|
1269
|
+
forEach(response.body.content, (responseContent) => {
|
|
1270
|
+
const obj = {};
|
|
1271
|
+
if (this.isAggregationEnabled()) {
|
|
1272
|
+
obj[this.aggregationcolumn] = responseContent[aggregationAlias];
|
|
1273
|
+
obj[this.aggregationcolumn] = get(responseContent, aggregationAlias) || get(responseContent, this.aggregationcolumn);
|
|
1274
|
+
}
|
|
1275
|
+
obj[this.xaxisdatakey] = get(responseContent, xAxisAliasKey) || get(responseContent, this.xaxisdatakey);
|
|
1276
|
+
yAxisKeys.forEach((yAxisKey, index) => {
|
|
1277
|
+
obj[yAxisKey] = get(responseContent, yAxisAliasKeys[index]) || get(responseContent, yAxisKey);
|
|
1278
|
+
});
|
|
1279
|
+
chartData.push(obj);
|
|
1280
|
+
});
|
|
1281
|
+
this.chartData = chartData;
|
|
1282
|
+
triggerFn(callback);
|
|
1283
|
+
}, () => {
|
|
1284
|
+
this.chartData = [];
|
|
1285
|
+
this.setErrMsg("MESSAGE_ERROR_FETCH_DATA");
|
|
1286
|
+
triggerFn(callback);
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1289
|
+
setLabelsMaxWidth() {
|
|
1290
|
+
let xTicks, tickWidth, maxLength, xDist, yDist, totalHeight, maxNoLabels, nthElement, labelsAvailableWidth, barWrapper, yAxisWrapper, svgWrapper;
|
|
1291
|
+
const fontsize = parseInt(this.fontsize, 10) || 12, isBarchart = isBarChart(this.type);
|
|
1292
|
+
xTicks = $("#wmChart" + this.$id + " svg").find("g.nv-x").find("g.tick").find("text");
|
|
1293
|
+
xTicks.each(function() {
|
|
1294
|
+
const xTick = $(this);
|
|
1295
|
+
let xTransform, tickDist;
|
|
1296
|
+
if (xTick.text() && xTick.css("opacity") === "1") {
|
|
1297
|
+
xTransform = xTick.parent().attr("transform").split(",");
|
|
1298
|
+
xDist = parseFloat(xTransform[0].substr(10));
|
|
1299
|
+
yDist = parseFloat(xTransform[1] || "0");
|
|
1300
|
+
if (!isBarchart && xDist > 0) tickDist = xDist;
|
|
1301
|
+
else if (yDist > 0) tickDist = yDist;
|
|
1302
|
+
if (tickWidth) {
|
|
1303
|
+
tickWidth = tickDist - tickWidth;
|
|
1304
|
+
return false;
|
|
1305
|
+
}
|
|
1306
|
+
tickWidth = tickDist;
|
|
1307
|
+
return true;
|
|
1308
|
+
}
|
|
1309
|
+
});
|
|
1310
|
+
if (isBarchart) {
|
|
1311
|
+
barWrapper = $("#wmChart" + this.$id + " svg>g.nv-wrap>g>g.nv-barsWrap")[0];
|
|
1312
|
+
yAxisWrapper = $("#wmChart" + this.$id + " svg>g.nv-wrap>g>g.nv-y")[0];
|
|
1313
|
+
svgWrapper = $("#wmChart" + this.$id + " svg")[0];
|
|
1314
|
+
totalHeight = barWrapper ? barWrapper.getBoundingClientRect().height : 0;
|
|
1315
|
+
labelsAvailableWidth = yAxisWrapper ? svgWrapper.getBoundingClientRect().width - yAxisWrapper.getBoundingClientRect().width : svgWrapper.getBoundingClientRect().width;
|
|
1316
|
+
maxLength = Math.round(labelsAvailableWidth / fontsize);
|
|
1317
|
+
if (tickWidth < fontsize) {
|
|
1318
|
+
maxNoLabels = totalHeight / fontsize;
|
|
1319
|
+
nthElement = Math.ceil(this.chartData.length / maxNoLabels);
|
|
1320
|
+
d3.select("#wmChart" + this.$id + " svg").select("g.nv-x").selectAll("g.tick").select("text").each(function(text, i) {
|
|
1321
|
+
if (i % nthElement !== 0) d3.select(this).attr("opacity", 0);
|
|
1322
|
+
});
|
|
1323
|
+
}
|
|
1324
|
+
} else maxLength = Math.round(tickWidth / fontsize);
|
|
1325
|
+
maxLength = Math.abs(maxLength);
|
|
1326
|
+
xTicks.each(function() {
|
|
1327
|
+
if (this.textContent.length > maxLength) this.textContent = this.textContent.substr(0, maxLength) + "...";
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1330
|
+
getDefaultColumns() {
|
|
1331
|
+
let type, stringColumn, i, temp;
|
|
1332
|
+
const defaultColumns = [], columns = this.datasource.execute(DataSource.Operation.GET_PROPERTIES_MAP) || [];
|
|
1333
|
+
for (i = 0; i < columns.length && defaultColumns.length <= 2; i += 1) {
|
|
1334
|
+
type = columns[i].type;
|
|
1335
|
+
if (!columns[i].isRelated && isNumberType(type)) defaultColumns.push(columns[i].fieldName);
|
|
1336
|
+
else if (type === "string" && !stringColumn) stringColumn = columns[i].fieldName;
|
|
1337
|
+
}
|
|
1338
|
+
if (stringColumn && defaultColumns.length > 0 && !isBubbleChart(this.type)) {
|
|
1339
|
+
temp = defaultColumns[0];
|
|
1340
|
+
defaultColumns[0] = stringColumn;
|
|
1341
|
+
defaultColumns[1] = temp;
|
|
1342
|
+
}
|
|
1343
|
+
return defaultColumns;
|
|
1344
|
+
}
|
|
1345
|
+
attachClickEvent() {
|
|
1346
|
+
let dataObj;
|
|
1347
|
+
d3.select("#wmChart" + this.$id + " svg").selectAll(chartDataPointXpath[this.type]).style("pointer-events", "all").on("click", (event, data, index) => {
|
|
1348
|
+
switch (this.type) {
|
|
1349
|
+
case "Column":
|
|
1350
|
+
case "Bar":
|
|
1351
|
+
dataObj = data._dataObj;
|
|
1352
|
+
break;
|
|
1353
|
+
case "Pie":
|
|
1354
|
+
case "Donut":
|
|
1355
|
+
dataObj = data.data._dataObj;
|
|
1356
|
+
break;
|
|
1357
|
+
case "Area":
|
|
1358
|
+
case "Cumulative Line":
|
|
1359
|
+
case "Line":
|
|
1360
|
+
dataObj = data[0]._dataObj;
|
|
1361
|
+
break;
|
|
1362
|
+
case "Bubble": dataObj = data;
|
|
1363
|
+
}
|
|
1364
|
+
this.selecteditem = dataObj;
|
|
1365
|
+
this.invokeEventCallback("select", {
|
|
1366
|
+
$event: event,
|
|
1367
|
+
selectedChartItem: data,
|
|
1368
|
+
selectedItem: this.selecteditem
|
|
1369
|
+
});
|
|
1370
|
+
});
|
|
1371
|
+
}
|
|
1372
|
+
postPlotProcess(chart) {
|
|
1373
|
+
let chartSvg, pieLabels, pieGroups, angleArray;
|
|
1374
|
+
const styleObj = {};
|
|
1375
|
+
const element = this.$element;
|
|
1376
|
+
postPlotChartProcess(this);
|
|
1377
|
+
if (!isPieType(this.type)) this.setLabelsMaxWidth();
|
|
1378
|
+
else if (!this.showlabelsoutside) {
|
|
1379
|
+
chartSvg = d3.select("#wmChart" + this.$id + " svg");
|
|
1380
|
+
pieLabels = chartSvg.select(".nv-pieLabels").selectAll(".nv-label");
|
|
1381
|
+
pieGroups = chartSvg.select(".nv-pie").selectAll(".nv-slice");
|
|
1382
|
+
angleArray = [];
|
|
1383
|
+
if (pieGroups?.length) {
|
|
1384
|
+
pieGroups.each(function() {
|
|
1385
|
+
d3.select(this).attr("transform", function(d) {
|
|
1386
|
+
angleArray.push(angle(d));
|
|
1387
|
+
});
|
|
1388
|
+
});
|
|
1389
|
+
pieLabels.each(function(d, i) {
|
|
1390
|
+
const group = d3.select(this);
|
|
1391
|
+
$(group[0][0]).find("text").attr("transform", "rotate(" + angleArray[i] + ")");
|
|
1392
|
+
});
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
forEach(styleProps, (value, key) => {
|
|
1396
|
+
if (key === "fontsize" || key === "fontunit") styleObj[value] = this.fontsize + this.fontunit;
|
|
1397
|
+
else styleObj[value] = this[key];
|
|
1398
|
+
});
|
|
1399
|
+
setTextStyle(styleObj, this.$id);
|
|
1400
|
+
triggerFn(this._resizeFn?.clear);
|
|
1401
|
+
this._resizeFn = nv.utils.windowResize(() => {
|
|
1402
|
+
if (element[0].getBoundingClientRect().height) {
|
|
1403
|
+
chart.update();
|
|
1404
|
+
postPlotChartProcess(this);
|
|
1405
|
+
if (!isPieType(this.type)) this.setLabelsMaxWidth();
|
|
1406
|
+
}
|
|
1407
|
+
});
|
|
1408
|
+
}
|
|
1409
|
+
configureChart() {
|
|
1410
|
+
let xDomainValues;
|
|
1411
|
+
let yDomainValues;
|
|
1412
|
+
let chart;
|
|
1413
|
+
let beforeRenderVal;
|
|
1414
|
+
if (this._processedData.length > 0) {
|
|
1415
|
+
if (isAxisDomainValid(this, "x")) xDomainValues = this.binddataset ? this.getXMinMaxValues(this._processedData[0]) : {
|
|
1416
|
+
"min": { "x": 1 },
|
|
1417
|
+
"max": { "x": 5 }
|
|
1418
|
+
};
|
|
1419
|
+
if (isAxisDomainValid(this, "y")) yDomainValues = this.binddataset ? this.getYMinMaxValues(this._processedData) : {
|
|
1420
|
+
"min": { "y": 1 },
|
|
1421
|
+
"max": { "y": 5 }
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
if (isPieType(this.type) && (!this.binddataset || !this.scopedataset)) this._processedData = getClonedObject(this.scopedataset || this._processedData);
|
|
1425
|
+
chart = initChart(this, xDomainValues, yDomainValues, null, !this.binddataset);
|
|
1426
|
+
if (isArray(this._processedData)) {
|
|
1427
|
+
const oldgTicks = $("#wmChart" + this.$id + " svg").find("g.nv-x").find("g.tick");
|
|
1428
|
+
if (oldgTicks?.length) oldgTicks.remove();
|
|
1429
|
+
beforeRenderVal = this.invokeEventCallback("beforerender", { "chartInstance": chart });
|
|
1430
|
+
if (beforeRenderVal) chart = beforeRenderVal;
|
|
1431
|
+
this.chart = chart;
|
|
1432
|
+
d3.select("#wmChart" + this.$id + " svg").datum(this._processedData).call(this.chart);
|
|
1433
|
+
this.postPlotProcess(chart);
|
|
1434
|
+
return chart;
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
plotChart() {
|
|
1438
|
+
const element = this.$element;
|
|
1439
|
+
this.chartData = this.invokeEventCallback("transform") || this.chartData;
|
|
1440
|
+
if (this.isVisuallyGrouped && !isPieType(this.type)) this._processedData = this.chartData;
|
|
1441
|
+
else this._processedData = this.processChartData();
|
|
1442
|
+
if (!element[0].getBoundingClientRect().height) return;
|
|
1443
|
+
if (this.clearCanvas) {
|
|
1444
|
+
element.find("svg").replaceWith("<svg></svg>");
|
|
1445
|
+
this.clearCanvas = false;
|
|
1446
|
+
}
|
|
1447
|
+
if (!this.isValidAxis()) this._processedData = [];
|
|
1448
|
+
nv.addGraph(() => this.configureChart(), () => {
|
|
1449
|
+
setTimeout(() => {
|
|
1450
|
+
this.attachClickEvent();
|
|
1451
|
+
}, 600);
|
|
1452
|
+
});
|
|
1453
|
+
this.isLoadInProgress = false;
|
|
1454
|
+
}
|
|
1455
|
+
get isLiveVariable() {
|
|
1456
|
+
const variableObj = this.datasource;
|
|
1457
|
+
return variableObj && variableObj.category === "wm.LiveVariable";
|
|
1458
|
+
}
|
|
1459
|
+
plotChartProxy() {
|
|
1460
|
+
this.showContentLoadError = false;
|
|
1461
|
+
this.invalidConfig = false;
|
|
1462
|
+
this.isLoadInProgress = true;
|
|
1463
|
+
const groupingDetails = this.getGroupingDetails();
|
|
1464
|
+
if (this.binddataset && this.isLiveVariable && (this.filterFields || this.isDataFilteringEnabled())) this.getAggregatedData(() => this.plotChart());
|
|
1465
|
+
else {
|
|
1466
|
+
if (this.dataset && this.isLiveVariable) {
|
|
1467
|
+
this.chartData = this.dataset;
|
|
1468
|
+
if (this.isGroupByEnabled() && groupingDetails.isVisuallyGrouped) this.chartData = this.getVisuallyGroupedData(this.chartData, groupingDetails.visualGroupingColumn);
|
|
1469
|
+
}
|
|
1470
|
+
this.plotChart();
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
setDefaultAxisOptions() {
|
|
1474
|
+
const defaultColumns = this.getDefaultColumns();
|
|
1475
|
+
this.xaxisdatakey = defaultColumns[0] || null;
|
|
1476
|
+
this.yaxisdatakey = defaultColumns[1] || null;
|
|
1477
|
+
}
|
|
1478
|
+
getCutomizedOptions(prop, fields) {
|
|
1479
|
+
const groupByColumns = split(this.groupby, ","), aggColumns = split(this.aggregationcolumn, ",");
|
|
1480
|
+
if (!this.binddataset) return fields;
|
|
1481
|
+
if (!this.axisoptions) this.axisoptions = fields;
|
|
1482
|
+
let newOptions;
|
|
1483
|
+
switch (prop) {
|
|
1484
|
+
case "xaxisdatakey":
|
|
1485
|
+
if (this.isGroupByEnabled()) newOptions = groupByColumns;
|
|
1486
|
+
break;
|
|
1487
|
+
case "yaxisdatakey":
|
|
1488
|
+
if (this.isAggregationEnabled()) newOptions = aggColumns;
|
|
1489
|
+
else if (this.isLiveVariable) newOptions = this.numericColumns;
|
|
1490
|
+
break;
|
|
1491
|
+
case "groupby":
|
|
1492
|
+
if (this.isLiveVariable && this.nonPrimaryColumns?.length) newOptions = this.nonPrimaryColumns;
|
|
1493
|
+
break;
|
|
1494
|
+
case "aggregationcolumn":
|
|
1495
|
+
if (this.isLiveVariable && this.isAggregationEnabled() && this.aggregation !== "count") newOptions = this.numericColumns;
|
|
1496
|
+
break;
|
|
1497
|
+
case "orderby":
|
|
1498
|
+
if (this.isLiveVariable && this.isAggregationEnabled()) newOptions = uniq(concat(groupByColumns, aggColumns));
|
|
1499
|
+
break;
|
|
1500
|
+
case "bubblesize": if (this.numericColumns?.length) newOptions = this.numericColumns;
|
|
1501
|
+
}
|
|
1502
|
+
return newOptions || fields || this.axisoptions;
|
|
1503
|
+
}
|
|
1504
|
+
setNumericandNonPrimaryColumns() {
|
|
1505
|
+
this.datasource.execute(DataSource.Operation.GET_PROPERTIES_MAP);
|
|
1506
|
+
this.numericColumns = [];
|
|
1507
|
+
this.nonPrimaryColumns = [];
|
|
1508
|
+
}
|
|
1509
|
+
handleDataSet(newVal) {
|
|
1510
|
+
this.errMsg = "";
|
|
1511
|
+
if (!newVal && !this.binddataset) {
|
|
1512
|
+
this.isVisuallyGrouped = false;
|
|
1513
|
+
this.axisoptions = null;
|
|
1514
|
+
}
|
|
1515
|
+
this.chartData = this.isLiveVariable ? newVal || "" : newVal && newVal.dataValue === "" && keys(newVal).length === 1 ? "" : newVal;
|
|
1516
|
+
if (!isArray(this.chartData) && isObject(this.chartData)) this.chartData = [this.chartData];
|
|
1517
|
+
if (newVal?.filterFields) this.filterFields = newVal.filterFields;
|
|
1518
|
+
if (this.chartData) this._plotChartProxy();
|
|
1519
|
+
}
|
|
1520
|
+
setDonutCenterLabel(labelValue) {
|
|
1521
|
+
let chartSvg, pieGroups;
|
|
1522
|
+
chartSvg = d3.select("#wmChart" + this.$id + " svg");
|
|
1523
|
+
pieGroups = chartSvg.select(".nv-wrap.nv-pie").select(".nv-pie");
|
|
1524
|
+
pieGroups.text("");
|
|
1525
|
+
pieGroups.append("text").attr("dy", ".35em").attr("text-anchor", "middle").attr("class", "nv-pie-title").text(labelValue).each(function(d) {
|
|
1526
|
+
const d3text = d3.select(this), circ = d3.select(this.parentElement), availWidth = Number(circ.node().getBoundingClientRect().width) - 30, textWidth = this.getComputedTextLength();
|
|
1527
|
+
d3text.attr("data-scale", availWidth / textWidth);
|
|
1528
|
+
}).style("font-size", function() {
|
|
1529
|
+
const fontSize = 16 * d3.select(this).attr("data-scale");
|
|
1530
|
+
return fontSize > 24 ? 24 : fontSize + "px";
|
|
1531
|
+
});
|
|
1532
|
+
}
|
|
1533
|
+
onPropertyChange(key, newVal, oldVal) {
|
|
1534
|
+
super.onPropertyChange(key, newVal, oldVal);
|
|
1535
|
+
switch (key) {
|
|
1536
|
+
case "dataset":
|
|
1537
|
+
this.handleDataSet(newVal);
|
|
1538
|
+
break;
|
|
1539
|
+
case "centerlabel":
|
|
1540
|
+
if (this.chart) {
|
|
1541
|
+
this.chart.title(newVal);
|
|
1542
|
+
this.setDonutCenterLabel(newVal);
|
|
1543
|
+
}
|
|
1544
|
+
break;
|
|
1545
|
+
case "type":
|
|
1546
|
+
if (isPieType(this.type)) {
|
|
1547
|
+
this.offsettop = 20;
|
|
1548
|
+
this.offsetright = 0;
|
|
1549
|
+
this.offsetbottom = 0;
|
|
1550
|
+
this.offsetleft = 0;
|
|
1551
|
+
} else if (oldVal === "Pie" || oldVal === "Donut") {
|
|
1552
|
+
this.offsettop = 25;
|
|
1553
|
+
this.offsetright = 25;
|
|
1554
|
+
this.offsetbottom = 55;
|
|
1555
|
+
this.offsetleft = 75;
|
|
1556
|
+
}
|
|
1557
|
+
if (oldVal !== newVal) this.clearCanvas = true;
|
|
1558
|
+
this._plotChartProxy();
|
|
1559
|
+
break;
|
|
1560
|
+
default: this._plotChartProxy();
|
|
1561
|
+
}
|
|
1562
|
+
if (includes(advanceDataProps, key)) this._plotChartProxy();
|
|
1563
|
+
}
|
|
1564
|
+
handleLoading(data) {
|
|
1565
|
+
const dataSource = this.datasource;
|
|
1566
|
+
if (dataSource?.execute(DataSource.Operation.IS_API_AWARE) && isDataSourceEqual(data.variable, dataSource)) {
|
|
1567
|
+
this.variableInflight = data.active;
|
|
1568
|
+
this.isLoadInProgress = data.active;
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
hideTooltip() {
|
|
1572
|
+
d3.selectAll(".nvtooltip").style("opacity", 0);
|
|
1573
|
+
}
|
|
1574
|
+
onStyleChange(key, newVal, oldVal) {
|
|
1575
|
+
const styleObj = {};
|
|
1576
|
+
super.onStyleChange(key, newVal, oldVal);
|
|
1577
|
+
switch (key) {
|
|
1578
|
+
case "fontsize":
|
|
1579
|
+
case "fontunit":
|
|
1580
|
+
case "color":
|
|
1581
|
+
case "fontfamily":
|
|
1582
|
+
case "fontweight":
|
|
1583
|
+
case "fontstyle":
|
|
1584
|
+
case "textdecoration":
|
|
1585
|
+
styleObj[styleProps[key]] = key === "fontsize" || key === "fontunit" ? this.fontsize + this.fontunit : newVal;
|
|
1586
|
+
setTextStyle(styleObj, this.$id);
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
constructor(inj, app, explicitContext) {
|
|
1590
|
+
super(inj, WIDGET_CONFIG, explicitContext);
|
|
1591
|
+
this.app = app;
|
|
1592
|
+
this.iconclass = "";
|
|
1593
|
+
this.nonPrimaryColumns = [];
|
|
1594
|
+
this.xDataKeyArr = [];
|
|
1595
|
+
this.chartData = [];
|
|
1596
|
+
this._processedData = [];
|
|
1597
|
+
this._subsciptions = [];
|
|
1598
|
+
this._plotChartProxy = debounce(this.plotChartProxy.bind(this), 100);
|
|
1599
|
+
this.redraw = this._plotChartProxy.bind(this);
|
|
1600
|
+
styler(this.nativeElement, this, APPLY_STYLES_TYPE.CONTAINER, [
|
|
1601
|
+
"fontsize",
|
|
1602
|
+
"fontunit",
|
|
1603
|
+
"color",
|
|
1604
|
+
"fontfamily",
|
|
1605
|
+
"fontweight",
|
|
1606
|
+
"fontstyle",
|
|
1607
|
+
"textdecoration"
|
|
1608
|
+
]);
|
|
1609
|
+
this.$id = this.widgetId;
|
|
1610
|
+
removeAttr(this.nativeElement, "title");
|
|
1611
|
+
this.chartReady = false;
|
|
1612
|
+
this.binddataset = this.nativeElement.getAttribute("dataset.bind");
|
|
1613
|
+
this._subsciptions.push(this.app.subscribe("toggle-variable-state", this.handleLoading.bind(this)));
|
|
1614
|
+
this._subsciptions.push(this.app.subscribe("iscroll-start", () => {
|
|
1615
|
+
this.hideTooltip();
|
|
1616
|
+
}));
|
|
1617
|
+
}
|
|
1618
|
+
ngAfterViewInit() {
|
|
1619
|
+
super.ngAfterViewInit();
|
|
1620
|
+
if (!includes([
|
|
1621
|
+
"outside",
|
|
1622
|
+
"inside",
|
|
1623
|
+
"hide"
|
|
1624
|
+
], this.showlabels)) {
|
|
1625
|
+
this.showlabels = getBooleanValue(this.showlabels);
|
|
1626
|
+
this.showlabelsoutside = getBooleanValue(this.showlabelsoutside);
|
|
1627
|
+
this.showlabels = this.showlabels ? this.showlabelsoutside ? "outside" : "inside" : "hide";
|
|
1628
|
+
}
|
|
1629
|
+
if (!this.theme) this.theme = isPieType(this.type) ? "Azure" : "Terrestrial";
|
|
1630
|
+
this.nativeElement.setAttribute("id", "wmChart" + this.$id);
|
|
1631
|
+
if (!this.binddataset && !this.nativeElement.getAttribute("scopedataset")) this._plotChartProxy();
|
|
1632
|
+
}
|
|
1633
|
+
ngOnDestroy() {
|
|
1634
|
+
this.hideTooltip();
|
|
1635
|
+
if (this._subsciptions) {
|
|
1636
|
+
this._subsciptions.forEach((subscription) => {
|
|
1637
|
+
subscription();
|
|
1638
|
+
});
|
|
1639
|
+
this._subsciptions = [];
|
|
1640
|
+
}
|
|
1641
|
+
if (this.chart) this.chart = null;
|
|
1642
|
+
if (this._resizeFn) this._resizeFn = null;
|
|
1643
|
+
this.chartData = [];
|
|
1644
|
+
this._processedData = [];
|
|
1645
|
+
this.sampleData = [];
|
|
1646
|
+
this.xDataKeyArr = [];
|
|
1647
|
+
this.nonPrimaryColumns = [];
|
|
1648
|
+
super.ngOnDestroy();
|
|
1649
|
+
}
|
|
1650
|
+
static {
|
|
1651
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1652
|
+
minVersion: "12.0.0",
|
|
1653
|
+
version: "22.2.1",
|
|
1654
|
+
ngImport: i0,
|
|
1655
|
+
type: ChartComponent,
|
|
1656
|
+
deps: [
|
|
1657
|
+
{ token: i0.Injector },
|
|
1658
|
+
{ token: i1.App },
|
|
1659
|
+
{
|
|
1660
|
+
token: "EXPLICIT_CONTEXT",
|
|
1661
|
+
optional: true
|
|
1662
|
+
}
|
|
1663
|
+
],
|
|
1664
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1665
|
+
});
|
|
1666
|
+
}
|
|
1667
|
+
static {
|
|
1668
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1669
|
+
minVersion: "17.0.0",
|
|
1670
|
+
version: "22.2.1",
|
|
1671
|
+
type: ChartComponent,
|
|
1672
|
+
isStandalone: true,
|
|
1673
|
+
selector: "div[wmChart]",
|
|
1674
|
+
host: { properties: { "class.panel": "this.title" } },
|
|
1675
|
+
providers: [provideAsWidgetRef(ChartComponent)],
|
|
1676
|
+
usesInheritance: true,
|
|
1677
|
+
ngImport: i0,
|
|
1678
|
+
template: "@if (title) {\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">\n <div class=\"pull-left\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" iconClasses=\"panel-icon\" alt=\"Chart icon\"></wm-app-icon>\n </div>\n <div class=\"heading\" [innerHTML]=\"title\"></div>\n @if (subheading) {\n <div class=\"description\" [innerHTML]=\"subheading\"></div>\n }\n </h3>\n </div>\n}\n<div class=\"app-chart-inner\" [ngClass]=\"{'loading':isLoadInProgress, 'panel-body': title}\">\n <svg></svg>\n @if (showContentLoadError && showNoDataMsg) {\n <div class=\"wm-content-info readonly-wrapper\">\n <p class=\"wm-message\" [title]=\"hintMsg\" [ngClass]=\"{'error': invalidConfig}\" [innerText]=\"errMsg\"></p>\n </div>\n }\n <div wmSpinner show.bind=\"isLoadInProgress\" caption.bind=\"loadingdatamsg\"></div>\n</div>\n",
|
|
1679
|
+
styles: [".nvtooltip h3,.nvtooltip p{margin:0;text-align:center}.nv-distx,.nv-disty,.nv-noninteractive,.nvd3 .nv-axis,.nvd3 .nv-interactiveGuideLine,.nvd3.nv-pie .nv-label,.nvd3.nv-sparklineplus g.nv-hoverValue,.nvtooltip{pointer-events:none}.nvd3 .nv-axis{opacity:1}.nvd3 .nv-axis path{fill:none;stroke:#000;stroke-opacity:.75;shape-rendering:crispEdges}.nvd3 .nv-axis .zero line,.nvd3 .nv-axis line.zero,.nvd3 .nv-axis path.domain{stroke-opacity:.75}.nvd3 .nv-axis.nv-x path.domain{stroke-opacity:0}.nvd3 .nv-axis line{fill:none;stroke:#e5e5e5;shape-rendering:crispEdges}.nvd3 .nv-axis .nv-axisMaxMin text,.nvtooltip table td.key.total{font-weight:700}.nvd3 .x .nv-axis .nv-axisMaxMin text,.nvd3 .x2 .nv-axis .nv-axisMaxMin text,.nvd3 .x3 .nv-axis .nv-axisMaxMin text{text-anchor:middle}.nvd3 .nv-axis.nv-disabled,.nvd3 .nv-controlsWrap .nv-legend .nv-check-box .nv-check{opacity:0}.nvd3 .nv-bars rect{fill-opacity:.75;-webkit-transition:fill-opacity .25s linear;transition:fill-opacity .25s linear}.nvd3 .nv-bars rect.hover,.nvd3 .nv-boxplot circle:hover,.nvd3 .nv-boxplot rect:hover,.nvd3 .nv-candlestickBar .nv-ticks rect:hover,.nvd3 .nv-discretebar .nv-groups rect:hover,.nvd3 .nv-multibar .nv-groups rect:hover,.nvd3 .nv-multibarHorizontal .nv-groups rect:hover,.nvd3 .nv-scatter .nv-point.hover,.nvd3.nv-bullet .nv-measure:hover,.nvd3.nv-linePlusBar .nv-bar rect:hover,.nvd3.nv-pie .hover path{fill-opacity:1}.nvd3 .nv-bars .hover rect{fill:#add8e6}.nvd3 .nv-bars text{fill:#0000}.nvd3 .nv-bars .hover text{fill:#000}.nvd3 .nv-discretebar .nv-groups rect,.nvd3 .nv-multibar .nv-groups rect,.nvd3 .nv-multibarHorizontal .nv-groups rect{stroke-opacity:0;-webkit-transition:fill-opacity .25s linear;transition:fill-opacity .25s linear}.nvd3 .nv-discretebar .nv-groups text,.nvd3 .nv-multibarHorizontal .nv-groups text{font-weight:700;fill:#000;stroke:#0000}.nvd3 .nv-boxplot circle{fill-opacity:.5}.nvd3 line.nv-boxplot-median{stroke:#000}.nv-boxplot-tick:hover{stroke-width:2.5px}.nvd3.nv-bullet{font:10px sans-serif}.nvd3.nv-bullet .nv-measure{fill-opacity:.8}.nvd3.nv-bullet .nv-marker{stroke:#000;stroke-width:2px}.nvd3.nv-bullet .nv-markerTriangle{stroke:#000;fill:#fff;stroke-width:1.5px}.nvd3.nv-bullet .nv-markerLine{stroke:#000;stroke-width:1.5px}.nvd3.nv-bullet .nv-tick line{stroke:#666;stroke-width:.5px}.nvd3.nv-bullet .nv-range.nv-s0{fill:#eee}.nvd3.nv-bullet .nv-range.nv-s1{fill:#ddd}.nvd3.nv-bullet .nv-range.nv-s2{fill:#ccc}.nvd3.nv-bullet .nv-title{font-size:14px;font-weight:700}.nvd3.nv-bullet .nv-subtitle{fill:#999}.nvd3.nv-bullet .nv-range{fill:#bababa;fill-opacity:.4}.nvd3.nv-bullet .nv-range:hover{fill-opacity:.7}.nvd3.nv-candlestickBar .nv-ticks .nv-tick,.nvd3.nv-ohlcBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.hover,.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.positive rect,.nvd3.nv-sparklineplus .nv-maxValue{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.negative rect,.nvd3.nv-sparklineplus .nv-minValue{stroke:#d62728;fill:#d62728}.with-transitions .nv-candlestickBar .nv-ticks .nv-tick,.with-transitions .nvd3 .nv-groups .nv-point{-webkit-transition:stroke-width .25s linear,stroke-opacity .25s linear;transition:stroke-width .25s linear,stroke-opacity .25s linear}.nvd3.nv-candlestickBar .nv-ticks line{stroke:#333}.nv-force-node{stroke:#fff;stroke-width:1.5px}.nv-force-link{stroke:#999;stroke-opacity:.6}.nv-force-node text{stroke-width:0}.nvd3 .nv-check-box .nv-box{fill-opacity:0;stroke-width:2}.nvd3 .nv-check-box .nv-check{fill-opacity:0;stroke-width:4}.nvd3 .nv-hoverArea,.nvd3 .nv-series.nv-disabled .nv-check-box .nv-check,.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point,.nvd3.nv-pie .nv-label rect{fill-opacity:0;stroke-opacity:0}.nvd3.nv-linePlusBar .nv-bar rect{fill-opacity:.75}.nvd3 .nv-groups path.nv-line,.nvd3.nv-sparkline path{fill:none}.nvd3 .nv-groups path.nv-area{stroke:none}.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point{fill-opacity:.5!important;stroke-opacity:.5!important}.nvd3 .nv-groups .nv-point.hover,.nvd3.nv-scatter .nv-groups .nv-point.hover{stroke-width:7px;fill-opacity:.95!important;stroke-opacity:.95!important}.nvd3 .nv-point-paths path{stroke:#aaa;stroke-opacity:0;fill:#eee;fill-opacity:0}.nvd3 .nv-indexLine{cursor:ew-resize}svg.nvd3-svg{-webkit-user-select:none;-ms-user-select:none;user-select:none;display:block;width:100%;height:100%}.nvtooltip.with-3d-shadow,.with-3d-shadow .nvtooltip{-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px #0003;border-radius:5px}.nvd3 text{font:12px Arial,sans-serif}.nvtooltip h3,.nvtooltip table td.key{font-weight:400}.nvd3 .title{font:700 14px Arial,sans-serif}.nvd3 .nv-background{fill:#fff;fill-opacity:0}.nvd3.nv-noData{font-size:18px;font-weight:700}.nv-brush .selection{fill-opacity:.125;shape-rendering:crispEdges}.nv-brush .handle path{fill:#eee;stroke:#666}.nvd3 .nv-legend .nv-series{cursor:pointer}.nvd3 .nv-legend .nv-disabled circle{fill-opacity:0}.nvd3 .nv-brush .selection{fill-opacity:0!important}.nvd3 .nv-brushBackground rect{stroke:#000;stroke-width:.4;fill:#fff;fill-opacity:.7}@media print{.nvd3 text{stroke-width:0;fill-opacity:1}}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive{stroke:#2ca02c}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative{stroke:#d62728}.nvd3 .background path{fill:none;stroke:#eee;stroke-opacity:.4;shape-rendering:crispEdges}.nvd3 .foreground path{fill:none;stroke-opacity:.7}.nvd3 .nv-parallelCoordinates-brush .selection{fill:#fff;fill-opacity:.6;stroke:gray;shape-rendering:crispEdges}.nvd3 .nv-parallelCoordinates .hover{fill-opacity:1;stroke-width:3px}.nvd3 .missingValuesline line{fill:none;stroke:#000;stroke-width:1;stroke-opacity:1;stroke-dasharray:5,5}.nvd3.nv-pie path{stroke-opacity:0;-webkit-transition:fill-opacity .25s linear,stroke-width .25s linear,stroke-opacity .25s linear;transition:fill-opacity .25s linear,stroke-width .25s linear,stroke-opacity .25s linear;stroke:#fff;stroke-width:1px;stroke-opacity:1;fill-opacity:.7}.nvd3.nv-pie .nv-pie-title{font-size:24px;fill:#13c4f996}.nvd3.nv-pie .nv-slice text{stroke:#000;stroke-width:0}.nvd3 .nv-groups .nv-point.hover{stroke-width:20px;stroke-opacity:.5}.nvd3.nv-sparklineplus .nv-hoverValue line{stroke:#333;stroke-width:1.5px}.nvd3.nv-sparklineplus,.nvd3.nv-sparklineplus g{pointer-events:all}.nvd3.nv-sparklineplus .nv-xValue,.nvd3.nv-sparklineplus .nv-yValue{stroke-width:0;font-size:.9em;font-weight:400}.nvd3.nv-sparklineplus .nv-yValue{stroke:#f66}.nvd3.nv-sparklineplus .nv-currentValue{font-weight:700;font-size:1.1em}.nvd3.nv-stackedarea path.nv-area{fill-opacity:.7;stroke-opacity:0;-webkit-transition:fill-opacity .25s linear,stroke-opacity .25s linear;transition:fill-opacity .25s linear,stroke-opacity .25s linear}.nvd3.nv-stackedarea path.nv-area.hover{fill-opacity:.9}.nvd3.nv-stackedarea .nv-groups .nv-point{stroke-opacity:0;fill-opacity:0}.nvtooltip{position:absolute;background-color:#fff;color:#000;padding:1px;border:1px solid rgba(0,0,0,.5);z-index:10000;display:block;font-family:Arial,sans-serif;font-size:13px;text-align:left;white-space:nowrap;-webkit-user-select:none;-ms-user-select:none;user-select:none;background:#fffc;border-radius:4px}.nvtooltip.with-transitions,.with-transitions .nvtooltip{-webkit-transition:opacity 50ms linear .2s;transition:opacity 50ms linear .2s}.nvtooltip.x-nvtooltip,.nvtooltip.y-nvtooltip{padding:8px}.nvtooltip h3{padding:4px 14px;line-height:18px;background-color:#f7f7f7bf;color:#000;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.nvtooltip p{padding:5px 14px}.nvtooltip span{display:inline-block;margin:2px 0}.nvtooltip table{margin:6px;border-spacing:0}.nvtooltip table td{padding:2px 9px 2px 0;vertical-align:middle}.nvtooltip table td.value{text-align:right;font-weight:700}.nvtooltip table td.percent{color:#a9a9a9}.nvtooltip table tr.highlight td{padding:1px 9px 1px 0;border-bottom-style:solid;border-bottom-width:1px;border-top-style:solid;border-top-width:1px}.nvtooltip table td.legend-color-guide div{vertical-align:middle;width:12px;height:12px;border:1px solid #999}.nvtooltip .footer{padding:3px;text-align:center}.nvtooltip-pending-removal{pointer-events:none;display:none}.nvd3 line.nv-guideline{stroke:#ccc}\n"],
|
|
1680
|
+
dependencies: [
|
|
1681
|
+
{
|
|
1682
|
+
kind: "ngmodule",
|
|
1683
|
+
type: CommonModule
|
|
1684
|
+
},
|
|
1685
|
+
{
|
|
1686
|
+
kind: "directive",
|
|
1687
|
+
type: i2.NgClass,
|
|
1688
|
+
selector: "[ngClass]",
|
|
1689
|
+
inputs: ["class", "ngClass"]
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
kind: "component",
|
|
1693
|
+
type: SpinnerComponent,
|
|
1694
|
+
selector: "[wmSpinner]",
|
|
1695
|
+
exportAs: ["wmSpinner"]
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
kind: "component",
|
|
1699
|
+
type: WmAppIconComponent,
|
|
1700
|
+
selector: "wm-app-icon",
|
|
1701
|
+
inputs: [
|
|
1702
|
+
"icon",
|
|
1703
|
+
"iconclass",
|
|
1704
|
+
"iconurl",
|
|
1705
|
+
"defaultIconClass",
|
|
1706
|
+
"defaultClasses",
|
|
1707
|
+
"iconStyle",
|
|
1708
|
+
"alt"
|
|
1709
|
+
]
|
|
1710
|
+
}
|
|
1711
|
+
],
|
|
1712
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager,
|
|
1713
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
};
|
|
1717
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1718
|
+
minVersion: "12.0.0",
|
|
1719
|
+
version: "22.2.1",
|
|
1720
|
+
ngImport: i0,
|
|
1721
|
+
type: ChartComponent,
|
|
1722
|
+
decorators: [{
|
|
1723
|
+
type: Component,
|
|
1724
|
+
args: [{
|
|
1725
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
1726
|
+
standalone: true,
|
|
1727
|
+
imports: [
|
|
1728
|
+
CommonModule,
|
|
1729
|
+
SpinnerComponent,
|
|
1730
|
+
WmAppIconComponent
|
|
1731
|
+
],
|
|
1732
|
+
selector: "div[wmChart]",
|
|
1733
|
+
providers: [provideAsWidgetRef(ChartComponent)],
|
|
1734
|
+
encapsulation: ViewEncapsulation.None,
|
|
1735
|
+
template: "@if (title) {\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">\n <div class=\"pull-left\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" iconClasses=\"panel-icon\" alt=\"Chart icon\"></wm-app-icon>\n </div>\n <div class=\"heading\" [innerHTML]=\"title\"></div>\n @if (subheading) {\n <div class=\"description\" [innerHTML]=\"subheading\"></div>\n }\n </h3>\n </div>\n}\n<div class=\"app-chart-inner\" [ngClass]=\"{'loading':isLoadInProgress, 'panel-body': title}\">\n <svg></svg>\n @if (showContentLoadError && showNoDataMsg) {\n <div class=\"wm-content-info readonly-wrapper\">\n <p class=\"wm-message\" [title]=\"hintMsg\" [ngClass]=\"{'error': invalidConfig}\" [innerText]=\"errMsg\"></p>\n </div>\n }\n <div wmSpinner show.bind=\"isLoadInProgress\" caption.bind=\"loadingdatamsg\"></div>\n</div>\n",
|
|
1736
|
+
styles: [".nvtooltip h3,.nvtooltip p{margin:0;text-align:center}.nv-distx,.nv-disty,.nv-noninteractive,.nvd3 .nv-axis,.nvd3 .nv-interactiveGuideLine,.nvd3.nv-pie .nv-label,.nvd3.nv-sparklineplus g.nv-hoverValue,.nvtooltip{pointer-events:none}.nvd3 .nv-axis{opacity:1}.nvd3 .nv-axis path{fill:none;stroke:#000;stroke-opacity:.75;shape-rendering:crispEdges}.nvd3 .nv-axis .zero line,.nvd3 .nv-axis line.zero,.nvd3 .nv-axis path.domain{stroke-opacity:.75}.nvd3 .nv-axis.nv-x path.domain{stroke-opacity:0}.nvd3 .nv-axis line{fill:none;stroke:#e5e5e5;shape-rendering:crispEdges}.nvd3 .nv-axis .nv-axisMaxMin text,.nvtooltip table td.key.total{font-weight:700}.nvd3 .x .nv-axis .nv-axisMaxMin text,.nvd3 .x2 .nv-axis .nv-axisMaxMin text,.nvd3 .x3 .nv-axis .nv-axisMaxMin text{text-anchor:middle}.nvd3 .nv-axis.nv-disabled,.nvd3 .nv-controlsWrap .nv-legend .nv-check-box .nv-check{opacity:0}.nvd3 .nv-bars rect{fill-opacity:.75;-webkit-transition:fill-opacity .25s linear;transition:fill-opacity .25s linear}.nvd3 .nv-bars rect.hover,.nvd3 .nv-boxplot circle:hover,.nvd3 .nv-boxplot rect:hover,.nvd3 .nv-candlestickBar .nv-ticks rect:hover,.nvd3 .nv-discretebar .nv-groups rect:hover,.nvd3 .nv-multibar .nv-groups rect:hover,.nvd3 .nv-multibarHorizontal .nv-groups rect:hover,.nvd3 .nv-scatter .nv-point.hover,.nvd3.nv-bullet .nv-measure:hover,.nvd3.nv-linePlusBar .nv-bar rect:hover,.nvd3.nv-pie .hover path{fill-opacity:1}.nvd3 .nv-bars .hover rect{fill:#add8e6}.nvd3 .nv-bars text{fill:#0000}.nvd3 .nv-bars .hover text{fill:#000}.nvd3 .nv-discretebar .nv-groups rect,.nvd3 .nv-multibar .nv-groups rect,.nvd3 .nv-multibarHorizontal .nv-groups rect{stroke-opacity:0;-webkit-transition:fill-opacity .25s linear;transition:fill-opacity .25s linear}.nvd3 .nv-discretebar .nv-groups text,.nvd3 .nv-multibarHorizontal .nv-groups text{font-weight:700;fill:#000;stroke:#0000}.nvd3 .nv-boxplot circle{fill-opacity:.5}.nvd3 line.nv-boxplot-median{stroke:#000}.nv-boxplot-tick:hover{stroke-width:2.5px}.nvd3.nv-bullet{font:10px sans-serif}.nvd3.nv-bullet .nv-measure{fill-opacity:.8}.nvd3.nv-bullet .nv-marker{stroke:#000;stroke-width:2px}.nvd3.nv-bullet .nv-markerTriangle{stroke:#000;fill:#fff;stroke-width:1.5px}.nvd3.nv-bullet .nv-markerLine{stroke:#000;stroke-width:1.5px}.nvd3.nv-bullet .nv-tick line{stroke:#666;stroke-width:.5px}.nvd3.nv-bullet .nv-range.nv-s0{fill:#eee}.nvd3.nv-bullet .nv-range.nv-s1{fill:#ddd}.nvd3.nv-bullet .nv-range.nv-s2{fill:#ccc}.nvd3.nv-bullet .nv-title{font-size:14px;font-weight:700}.nvd3.nv-bullet .nv-subtitle{fill:#999}.nvd3.nv-bullet .nv-range{fill:#bababa;fill-opacity:.4}.nvd3.nv-bullet .nv-range:hover{fill-opacity:.7}.nvd3.nv-candlestickBar .nv-ticks .nv-tick,.nvd3.nv-ohlcBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.hover,.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.positive rect,.nvd3.nv-sparklineplus .nv-maxValue{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.negative rect,.nvd3.nv-sparklineplus .nv-minValue{stroke:#d62728;fill:#d62728}.with-transitions .nv-candlestickBar .nv-ticks .nv-tick,.with-transitions .nvd3 .nv-groups .nv-point{-webkit-transition:stroke-width .25s linear,stroke-opacity .25s linear;transition:stroke-width .25s linear,stroke-opacity .25s linear}.nvd3.nv-candlestickBar .nv-ticks line{stroke:#333}.nv-force-node{stroke:#fff;stroke-width:1.5px}.nv-force-link{stroke:#999;stroke-opacity:.6}.nv-force-node text{stroke-width:0}.nvd3 .nv-check-box .nv-box{fill-opacity:0;stroke-width:2}.nvd3 .nv-check-box .nv-check{fill-opacity:0;stroke-width:4}.nvd3 .nv-hoverArea,.nvd3 .nv-series.nv-disabled .nv-check-box .nv-check,.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point,.nvd3.nv-pie .nv-label rect{fill-opacity:0;stroke-opacity:0}.nvd3.nv-linePlusBar .nv-bar rect{fill-opacity:.75}.nvd3 .nv-groups path.nv-line,.nvd3.nv-sparkline path{fill:none}.nvd3 .nv-groups path.nv-area{stroke:none}.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point{fill-opacity:.5!important;stroke-opacity:.5!important}.nvd3 .nv-groups .nv-point.hover,.nvd3.nv-scatter .nv-groups .nv-point.hover{stroke-width:7px;fill-opacity:.95!important;stroke-opacity:.95!important}.nvd3 .nv-point-paths path{stroke:#aaa;stroke-opacity:0;fill:#eee;fill-opacity:0}.nvd3 .nv-indexLine{cursor:ew-resize}svg.nvd3-svg{-webkit-user-select:none;-ms-user-select:none;user-select:none;display:block;width:100%;height:100%}.nvtooltip.with-3d-shadow,.with-3d-shadow .nvtooltip{-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px #0003;border-radius:5px}.nvd3 text{font:12px Arial,sans-serif}.nvtooltip h3,.nvtooltip table td.key{font-weight:400}.nvd3 .title{font:700 14px Arial,sans-serif}.nvd3 .nv-background{fill:#fff;fill-opacity:0}.nvd3.nv-noData{font-size:18px;font-weight:700}.nv-brush .selection{fill-opacity:.125;shape-rendering:crispEdges}.nv-brush .handle path{fill:#eee;stroke:#666}.nvd3 .nv-legend .nv-series{cursor:pointer}.nvd3 .nv-legend .nv-disabled circle{fill-opacity:0}.nvd3 .nv-brush .selection{fill-opacity:0!important}.nvd3 .nv-brushBackground rect{stroke:#000;stroke-width:.4;fill:#fff;fill-opacity:.7}@media print{.nvd3 text{stroke-width:0;fill-opacity:1}}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive{stroke:#2ca02c}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative{stroke:#d62728}.nvd3 .background path{fill:none;stroke:#eee;stroke-opacity:.4;shape-rendering:crispEdges}.nvd3 .foreground path{fill:none;stroke-opacity:.7}.nvd3 .nv-parallelCoordinates-brush .selection{fill:#fff;fill-opacity:.6;stroke:gray;shape-rendering:crispEdges}.nvd3 .nv-parallelCoordinates .hover{fill-opacity:1;stroke-width:3px}.nvd3 .missingValuesline line{fill:none;stroke:#000;stroke-width:1;stroke-opacity:1;stroke-dasharray:5,5}.nvd3.nv-pie path{stroke-opacity:0;-webkit-transition:fill-opacity .25s linear,stroke-width .25s linear,stroke-opacity .25s linear;transition:fill-opacity .25s linear,stroke-width .25s linear,stroke-opacity .25s linear;stroke:#fff;stroke-width:1px;stroke-opacity:1;fill-opacity:.7}.nvd3.nv-pie .nv-pie-title{font-size:24px;fill:#13c4f996}.nvd3.nv-pie .nv-slice text{stroke:#000;stroke-width:0}.nvd3 .nv-groups .nv-point.hover{stroke-width:20px;stroke-opacity:.5}.nvd3.nv-sparklineplus .nv-hoverValue line{stroke:#333;stroke-width:1.5px}.nvd3.nv-sparklineplus,.nvd3.nv-sparklineplus g{pointer-events:all}.nvd3.nv-sparklineplus .nv-xValue,.nvd3.nv-sparklineplus .nv-yValue{stroke-width:0;font-size:.9em;font-weight:400}.nvd3.nv-sparklineplus .nv-yValue{stroke:#f66}.nvd3.nv-sparklineplus .nv-currentValue{font-weight:700;font-size:1.1em}.nvd3.nv-stackedarea path.nv-area{fill-opacity:.7;stroke-opacity:0;-webkit-transition:fill-opacity .25s linear,stroke-opacity .25s linear;transition:fill-opacity .25s linear,stroke-opacity .25s linear}.nvd3.nv-stackedarea path.nv-area.hover{fill-opacity:.9}.nvd3.nv-stackedarea .nv-groups .nv-point{stroke-opacity:0;fill-opacity:0}.nvtooltip{position:absolute;background-color:#fff;color:#000;padding:1px;border:1px solid rgba(0,0,0,.5);z-index:10000;display:block;font-family:Arial,sans-serif;font-size:13px;text-align:left;white-space:nowrap;-webkit-user-select:none;-ms-user-select:none;user-select:none;background:#fffc;border-radius:4px}.nvtooltip.with-transitions,.with-transitions .nvtooltip{-webkit-transition:opacity 50ms linear .2s;transition:opacity 50ms linear .2s}.nvtooltip.x-nvtooltip,.nvtooltip.y-nvtooltip{padding:8px}.nvtooltip h3{padding:4px 14px;line-height:18px;background-color:#f7f7f7bf;color:#000;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.nvtooltip p{padding:5px 14px}.nvtooltip span{display:inline-block;margin:2px 0}.nvtooltip table{margin:6px;border-spacing:0}.nvtooltip table td{padding:2px 9px 2px 0;vertical-align:middle}.nvtooltip table td.value{text-align:right;font-weight:700}.nvtooltip table td.percent{color:#a9a9a9}.nvtooltip table tr.highlight td{padding:1px 9px 1px 0;border-bottom-style:solid;border-bottom-width:1px;border-top-style:solid;border-top-width:1px}.nvtooltip table td.legend-color-guide div{vertical-align:middle;width:12px;height:12px;border:1px solid #999}.nvtooltip .footer{padding:3px;text-align:center}.nvtooltip-pending-removal{pointer-events:none;display:none}.nvd3 line.nv-guideline{stroke:#ccc}\n"]
|
|
1737
|
+
}]
|
|
1738
|
+
}],
|
|
1739
|
+
ctorParameters: () => [
|
|
1740
|
+
{ type: i0.Injector },
|
|
1741
|
+
{ type: i1.App },
|
|
1742
|
+
{
|
|
1743
|
+
type: void 0,
|
|
1744
|
+
decorators: [{
|
|
1745
|
+
type: Inject,
|
|
1746
|
+
args: ["EXPLICIT_CONTEXT"]
|
|
1747
|
+
}, { type: Optional }]
|
|
1748
|
+
}
|
|
1749
|
+
],
|
|
1750
|
+
propDecorators: { title: [{
|
|
1751
|
+
type: HostBinding,
|
|
1752
|
+
args: ["class.panel"]
|
|
1753
|
+
}] }
|
|
1754
|
+
});
|
|
1771
1755
|
export { ChartComponent };
|
|
1772
|
-
|
|
1756
|
+
|
|
1757
|
+
//# sourceMappingURL=index.mjs.map
|