@j2inn/fin5-ui-utils 8.2.0 → 9.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fantomProps/createFin5Props/index.d.ts +12 -12
- package/dist/fantomProps/createFin5Props/index.js +146 -146
- package/dist/fantomProps/createFin5Props/index.js.map +1 -1
- package/dist/fantomProps/createFin5Props/runCreateFin5Props.d.ts +2 -2
- package/dist/fantomProps/createFin5Props/runCreateFin5Props.js +20 -20
- package/dist/fantomProps/createFin5Props/runCreateFin5Props.js.map +1 -1
- package/dist/fantomProps/fantomPropsToObject.d.ts +8 -8
- package/dist/fantomProps/fantomPropsToObject.js +182 -183
- package/dist/fantomProps/fantomPropsToObject.js.map +1 -1
- package/dist/fantomProps/generateJsonFromFantomPropsFile.d.ts +4 -4
- package/dist/fantomProps/generateJsonFromFantomPropsFile.js +51 -41
- package/dist/fantomProps/generateJsonFromFantomPropsFile.js.map +1 -1
- package/dist/fantomProps/localePropsToJson.d.ts +1 -1
- package/dist/fantomProps/localePropsToJson.js +60 -50
- package/dist/fantomProps/localePropsToJson.js.map +1 -1
- package/dist/fantomProps/readFantomPropsFile.d.ts +5 -5
- package/dist/fantomProps/readFantomPropsFile.js +74 -65
- package/dist/fantomProps/readFantomPropsFile.js.map +1 -1
- package/dist/fin5Top/fin5FileUpload.d.ts +24 -24
- package/dist/fin5Top/fin5FileUpload.js +51 -51
- package/dist/fin5Top/fin5FileUpload.js.map +1 -1
- package/dist/fin5Top/fin5Top.d.ts +188 -188
- package/dist/fin5Top/fin5Top.js +86 -86
- package/dist/fin5Top/fin5Top.js.map +1 -1
- package/dist/fin5Top/finEdge2Cloud.d.ts +6 -6
- package/dist/fin5Top/finEdge2Cloud.js +15 -15
- package/dist/fin5Top/getFin5BinUrl.d.ts +2 -2
- package/dist/fin5Top/getFin5BinUrl.js +9 -9
- package/dist/fin5Top/openFin5Alarm.d.ts +22 -22
- package/dist/fin5Top/openFin5Alarm.js +23 -23
- package/dist/fin5Top/openFin5Alarm.js.map +1 -1
- package/dist/fin5Top/openFin5Historian.d.ts +3 -3
- package/dist/fin5Top/openFin5Historian.js +19 -19
- package/dist/fin5Top/openFin5Historian.js.map +1 -1
- package/dist/fin5Top/useFin5AppURLHashParameter.d.ts +18 -18
- package/dist/fin5Top/useFin5AppURLHashParameter.js +133 -133
- package/dist/fin5Top/useFin5AppURLHashParameter.js.map +1 -1
- package/dist/index.d.ts +35 -35
- package/dist/index.js +69 -69
- package/dist/jobs/jobUtils.d.ts +14 -14
- package/dist/jobs/jobUtils.js +15 -15
- package/dist/jobs/jobUtils.js.map +1 -1
- package/dist/react/app/Fin5AppContainer.d.ts +36 -36
- package/dist/react/app/Fin5AppContainer.js +171 -161
- package/dist/react/app/Fin5AppContainer.js.map +1 -1
- package/dist/react/app/Fin5AppRootStore.d.ts +42 -42
- package/dist/react/app/Fin5AppRootStore.js +114 -114
- package/dist/react/app/Fin5AppRootStore.js.map +1 -1
- package/dist/react/components/ErrorBoundary.d.ts +57 -57
- package/dist/react/components/ErrorBoundary.js +160 -150
- package/dist/react/components/ErrorBoundary.js.map +1 -1
- package/dist/react/components/ErrorDisplayer.d.ts +19 -19
- package/dist/react/components/ErrorDisplayer.js +36 -36
- package/dist/react/components/ErrorDisplayer.js.map +1 -1
- package/dist/react/components/Loader.d.ts +9 -9
- package/dist/react/components/Loader.js +17 -17
- package/dist/react/components/LoadingSpinner.d.ts +2 -2
- package/dist/react/components/LoadingSpinner.js +27 -27
- package/dist/react/components/RecordImage.d.ts +20 -20
- package/dist/react/components/RecordImage.js +61 -51
- package/dist/react/components/RecordImage.js.map +1 -1
- package/dist/react/components/charts/QRCode.d.ts +25 -25
- package/dist/react/components/charts/QRCode.js +92 -82
- package/dist/react/components/charts/QRCode.js.map +1 -1
- package/dist/react/components/charts/line-bar/Chart.d.ts +166 -166
- package/dist/react/components/charts/line-bar/Chart.js +452 -442
- package/dist/react/components/charts/line-bar/Chart.js.map +1 -1
- package/dist/react/components/charts/line-bar/HGridChart.d.ts +58 -58
- package/dist/react/components/charts/line-bar/HGridChart.js +295 -285
- package/dist/react/components/charts/line-bar/HGridChart.js.map +1 -1
- package/dist/react/components/charts/pie/PieChart.d.ts +94 -94
- package/dist/react/components/charts/pie/PieChart.js +214 -204
- package/dist/react/components/charts/pie/PieChart.js.map +1 -1
- package/dist/react/components/charts/pie/SimplePieChart.d.ts +21 -21
- package/dist/react/components/charts/pie/SimplePieChart.js +65 -55
- package/dist/react/components/charts/pie/SimplePieChart.js.map +1 -1
- package/dist/react/components/graphics/GraphicViewer.d.ts +10 -10
- package/dist/react/components/graphics/GraphicViewer.js +29 -29
- package/dist/react/components/graphics/GraphicsTabViewer.d.ts +17 -17
- package/dist/react/components/graphics/GraphicsTabViewer.js +100 -90
- package/dist/react/components/graphics/GraphicsTabViewer.js.map +1 -1
- package/dist/react/components/makeCustomElement.d.ts +16 -16
- package/dist/react/components/makeCustomElement.js +150 -150
- package/dist/react/components/makeCustomElement.js.map +1 -1
- package/dist/react/components/navigation/BasicLayout.d.ts +41 -41
- package/dist/react/components/navigation/BasicLayout.js +165 -155
- package/dist/react/components/navigation/BasicLayout.js.map +1 -1
- package/dist/react/components/navigation/HeaderSiderLayout.d.ts +13 -13
- package/dist/react/components/navigation/HeaderSiderLayout.js +119 -110
- package/dist/react/components/navigation/HeaderSiderLayout.js.map +1 -1
- package/dist/react/components/navigation/MenuPage.d.ts +37 -37
- package/dist/react/components/navigation/MenuPage.js +35 -36
- package/dist/react/components/navigation/MenuPage.js.map +1 -1
- package/dist/react/components/navigation/MenuTrigger.d.ts +9 -9
- package/dist/react/components/navigation/MenuTrigger.js +33 -33
- package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.d.ts +11 -11
- package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.js +25 -25
- package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.js.map +1 -1
- package/dist/react/components/navigation/ReactRouterLayout.d.ts +45 -46
- package/dist/react/components/navigation/ReactRouterLayout.js +142 -132
- package/dist/react/components/navigation/ReactRouterLayout.js.map +1 -1
- package/dist/react/components/navigation/customRouting/Router.d.ts +12 -12
- package/dist/react/components/navigation/customRouting/Router.js +54 -45
- package/dist/react/components/navigation/customRouting/Router.js.map +1 -1
- package/dist/react/components/navigation/customRouting/RouterLayout.d.ts +11 -11
- package/dist/react/components/navigation/customRouting/RouterLayout.js +71 -61
- package/dist/react/components/navigation/customRouting/RouterLayout.js.map +1 -1
- package/dist/react/components/resolvable/configurationForm/ConfigurationForm.d.ts +26 -27
- package/dist/react/components/resolvable/configurationForm/ConfigurationForm.js +105 -95
- package/dist/react/components/resolvable/configurationForm/ConfigurationForm.js.map +1 -1
- package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.d.ts +15 -16
- package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.js +98 -88
- package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.js.map +1 -1
- package/dist/react/components/resolvable/configurationForm/getSectionDefault.d.ts +16 -16
- package/dist/react/components/resolvable/configurationForm/getSectionDefault.js +99 -99
- package/dist/react/components/resolvable/configurationForm/getSectionDefault.js.map +1 -1
- package/dist/react/hooks/useFin5BinUrl.d.ts +6 -6
- package/dist/react/hooks/useFin5BinUrl.js +15 -15
- package/dist/react/hooks/useFin5ColorScheme.d.ts +2 -2
- package/dist/react/hooks/useFin5ColorScheme.js +55 -56
- package/dist/react/hooks/useFin5ColorScheme.js.map +1 -1
- package/dist/react/hooks/useScreenSize.d.ts +7 -7
- package/dist/react/hooks/useScreenSize.js +31 -31
- package/dist_es/fantomProps/createFin5Props/index.d.ts +12 -12
- package/dist_es/fantomProps/createFin5Props/index.js +140 -140
- package/dist_es/fantomProps/createFin5Props/index.js.map +1 -1
- package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.d.ts +2 -2
- package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.js +15 -15
- package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.js.map +1 -1
- package/dist_es/fantomProps/fantomPropsToObject.d.ts +8 -8
- package/dist_es/fantomProps/fantomPropsToObject.js +178 -178
- package/dist_es/fantomProps/fantomPropsToObject.js.map +1 -1
- package/dist_es/fantomProps/generateJsonFromFantomPropsFile.d.ts +4 -4
- package/dist_es/fantomProps/generateJsonFromFantomPropsFile.js +12 -12
- package/dist_es/fantomProps/localePropsToJson.d.ts +1 -1
- package/dist_es/fantomProps/localePropsToJson.js +21 -21
- package/dist_es/fantomProps/localePropsToJson.js.map +1 -1
- package/dist_es/fantomProps/readFantomPropsFile.d.ts +5 -5
- package/dist_es/fantomProps/readFantomPropsFile.js +38 -39
- package/dist_es/fantomProps/readFantomPropsFile.js.map +1 -1
- package/dist_es/fin5Top/fin5FileUpload.d.ts +24 -24
- package/dist_es/fin5Top/fin5FileUpload.js +47 -47
- package/dist_es/fin5Top/fin5FileUpload.js.map +1 -1
- package/dist_es/fin5Top/fin5Top.d.ts +188 -188
- package/dist_es/fin5Top/fin5Top.js +81 -81
- package/dist_es/fin5Top/fin5Top.js.map +1 -1
- package/dist_es/fin5Top/finEdge2Cloud.d.ts +6 -6
- package/dist_es/fin5Top/finEdge2Cloud.js +11 -11
- package/dist_es/fin5Top/getFin5BinUrl.d.ts +2 -2
- package/dist_es/fin5Top/getFin5BinUrl.js +5 -5
- package/dist_es/fin5Top/openFin5Alarm.d.ts +22 -22
- package/dist_es/fin5Top/openFin5Alarm.js +19 -19
- package/dist_es/fin5Top/openFin5Alarm.js.map +1 -1
- package/dist_es/fin5Top/openFin5Historian.d.ts +3 -3
- package/dist_es/fin5Top/openFin5Historian.js +15 -15
- package/dist_es/fin5Top/openFin5Historian.js.map +1 -1
- package/dist_es/fin5Top/useFin5AppURLHashParameter.d.ts +18 -18
- package/dist_es/fin5Top/useFin5AppURLHashParameter.js +124 -124
- package/dist_es/fin5Top/useFin5AppURLHashParameter.js.map +1 -1
- package/dist_es/index.d.ts +35 -35
- package/dist_es/index.js +53 -53
- package/dist_es/jobs/jobUtils.d.ts +14 -14
- package/dist_es/jobs/jobUtils.js +9 -9
- package/dist_es/react/app/Fin5AppContainer.d.ts +36 -36
- package/dist_es/react/app/Fin5AppContainer.js +132 -132
- package/dist_es/react/app/Fin5AppContainer.js.map +1 -1
- package/dist_es/react/app/Fin5AppRootStore.d.ts +42 -42
- package/dist_es/react/app/Fin5AppRootStore.js +110 -110
- package/dist_es/react/app/Fin5AppRootStore.js.map +1 -1
- package/dist_es/react/components/ErrorBoundary.d.ts +57 -57
- package/dist_es/react/components/ErrorBoundary.js +123 -123
- package/dist_es/react/components/ErrorDisplayer.d.ts +19 -19
- package/dist_es/react/components/ErrorDisplayer.js +28 -28
- package/dist_es/react/components/ErrorDisplayer.js.map +1 -1
- package/dist_es/react/components/Loader.d.ts +9 -9
- package/dist_es/react/components/Loader.js +12 -12
- package/dist_es/react/components/LoadingSpinner.d.ts +2 -2
- package/dist_es/react/components/LoadingSpinner.js +20 -20
- package/dist_es/react/components/RecordImage.d.ts +20 -20
- package/dist_es/react/components/RecordImage.js +24 -24
- package/dist_es/react/components/RecordImage.js.map +1 -1
- package/dist_es/react/components/charts/QRCode.d.ts +25 -25
- package/dist_es/react/components/charts/QRCode.js +52 -52
- package/dist_es/react/components/charts/QRCode.js.map +1 -1
- package/dist_es/react/components/charts/line-bar/Chart.d.ts +166 -166
- package/dist_es/react/components/charts/line-bar/Chart.js +415 -415
- package/dist_es/react/components/charts/line-bar/Chart.js.map +1 -1
- package/dist_es/react/components/charts/line-bar/HGridChart.d.ts +58 -58
- package/dist_es/react/components/charts/line-bar/HGridChart.js +250 -250
- package/dist_es/react/components/charts/line-bar/HGridChart.js.map +1 -1
- package/dist_es/react/components/charts/pie/PieChart.d.ts +94 -94
- package/dist_es/react/components/charts/pie/PieChart.js +177 -177
- package/dist_es/react/components/charts/pie/PieChart.js.map +1 -1
- package/dist_es/react/components/charts/pie/SimplePieChart.d.ts +21 -21
- package/dist_es/react/components/charts/pie/SimplePieChart.js +25 -25
- package/dist_es/react/components/graphics/GraphicViewer.d.ts +10 -10
- package/dist_es/react/components/graphics/GraphicViewer.js +22 -22
- package/dist_es/react/components/graphics/GraphicsTabViewer.d.ts +17 -17
- package/dist_es/react/components/graphics/GraphicsTabViewer.js +60 -60
- package/dist_es/react/components/graphics/GraphicsTabViewer.js.map +1 -1
- package/dist_es/react/components/makeCustomElement.d.ts +16 -16
- package/dist_es/react/components/makeCustomElement.js +142 -142
- package/dist_es/react/components/makeCustomElement.js.map +1 -1
- package/dist_es/react/components/navigation/BasicLayout.d.ts +41 -41
- package/dist_es/react/components/navigation/BasicLayout.js +124 -124
- package/dist_es/react/components/navigation/BasicLayout.js.map +1 -1
- package/dist_es/react/components/navigation/HeaderSiderLayout.d.ts +13 -13
- package/dist_es/react/components/navigation/HeaderSiderLayout.js +80 -80
- package/dist_es/react/components/navigation/HeaderSiderLayout.js.map +1 -1
- package/dist_es/react/components/navigation/MenuPage.d.ts +37 -37
- package/dist_es/react/components/navigation/MenuPage.js +30 -30
- package/dist_es/react/components/navigation/MenuPage.js.map +1 -1
- package/dist_es/react/components/navigation/MenuTrigger.d.ts +9 -9
- package/dist_es/react/components/navigation/MenuTrigger.js +28 -28
- package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.d.ts +11 -11
- package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.js +18 -18
- package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.js.map +1 -1
- package/dist_es/react/components/navigation/ReactRouterLayout.d.ts +45 -46
- package/dist_es/react/components/navigation/ReactRouterLayout.js +99 -99
- package/dist_es/react/components/navigation/ReactRouterLayout.js.map +1 -1
- package/dist_es/react/components/navigation/customRouting/Router.d.ts +12 -12
- package/dist_es/react/components/navigation/customRouting/Router.js +18 -18
- package/dist_es/react/components/navigation/customRouting/Router.js.map +1 -1
- package/dist_es/react/components/navigation/customRouting/RouterLayout.d.ts +11 -11
- package/dist_es/react/components/navigation/customRouting/RouterLayout.js +34 -34
- package/dist_es/react/components/navigation/customRouting/RouterLayout.js.map +1 -1
- package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.d.ts +26 -27
- package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.js +64 -64
- package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.js.map +1 -1
- package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.d.ts +15 -16
- package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.js +58 -58
- package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.js.map +1 -1
- package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.d.ts +16 -16
- package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.js +94 -94
- package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.js.map +1 -1
- package/dist_es/react/hooks/useFin5BinUrl.d.ts +6 -6
- package/dist_es/react/hooks/useFin5BinUrl.js +11 -11
- package/dist_es/react/hooks/useFin5ColorScheme.d.ts +2 -2
- package/dist_es/react/hooks/useFin5ColorScheme.js +52 -52
- package/dist_es/react/hooks/useFin5ColorScheme.js.map +1 -1
- package/dist_es/react/hooks/useScreenSize.d.ts +7 -7
- package/dist_es/react/hooks/useScreenSize.js +27 -27
- package/package.json +26 -49
|
@@ -1,205 +1,215 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2023, J2 Innovations. All Rights Reserved
|
|
4
|
-
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
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
|
-
theme.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
theme.palette.
|
|
62
|
-
theme.palette.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
// Chart
|
|
87
|
-
(0, react_1.
|
|
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
|
-
// Setup
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
// Setup series
|
|
166
|
-
if (
|
|
167
|
-
series.
|
|
168
|
-
}
|
|
169
|
-
// Setup
|
|
170
|
-
if (
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023, J2 Innovations. All Rights Reserved
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.PieChart = void 0;
|
|
40
|
+
const am5 = __importStar(require("@amcharts/amcharts5"));
|
|
41
|
+
const am5percent = __importStar(require("@amcharts/amcharts5/percent"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
|
+
const react_jss_1 = require("react-jss");
|
|
44
|
+
const useStyles = (0, react_jss_1.createUseStyles)({
|
|
45
|
+
root: {
|
|
46
|
+
width: '100%',
|
|
47
|
+
height: '100%',
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* Returns a color palette selecting some colors from the theme.
|
|
52
|
+
* @param theme The theme
|
|
53
|
+
* @returns An array of colors
|
|
54
|
+
*/
|
|
55
|
+
const getDefaultChartColors = (theme) => {
|
|
56
|
+
return {
|
|
57
|
+
interfaceColors: {
|
|
58
|
+
text: theme.textColor,
|
|
59
|
+
},
|
|
60
|
+
series: [
|
|
61
|
+
theme.palette.lime,
|
|
62
|
+
theme.palette.cyan,
|
|
63
|
+
theme.palette.red,
|
|
64
|
+
theme.palette.volcano,
|
|
65
|
+
theme.palette.orange,
|
|
66
|
+
theme.palette.gold,
|
|
67
|
+
theme.palette.yellow,
|
|
68
|
+
theme.palette.green,
|
|
69
|
+
theme.palette.purple,
|
|
70
|
+
theme.palette.magenta,
|
|
71
|
+
theme.palette.blue,
|
|
72
|
+
theme.palette.grey,
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Highly customizable pie chart component based on amcharts5
|
|
78
|
+
* @see https://www.amcharts.com/docs/v5/charts/percent-charts/pie-chart/
|
|
79
|
+
*
|
|
80
|
+
* This component wraps some of the chart configuration trying to make it more react-friendly
|
|
81
|
+
*/
|
|
82
|
+
const PieChart = ({ DOMtargetId, data, colorPalette, numberFormat, chartThemes, chartSettingsProvider, legendSettingsProvider, legendLabelsSettings, legendValueLabelsSettings, legendMarkersSettings, seriesSettings, seriesLabelsSettings, centerLabelSettings, slicesSettings, sliceAdapters, }) => {
|
|
83
|
+
// Colors configuration
|
|
84
|
+
const theme = (0, react_jss_1.useTheme)();
|
|
85
|
+
const colors = { ...getDefaultChartColors(theme), ...colorPalette };
|
|
86
|
+
// Chart lifecycle
|
|
87
|
+
const [id, setId] = (0, react_1.useState)(DOMtargetId ?? `amchart-${Math.random()}`);
|
|
88
|
+
const rootRef = (0, react_1.useRef)(null);
|
|
89
|
+
const chartRef = (0, react_1.useRef)(null);
|
|
90
|
+
const legendRef = (0, react_1.useRef)(null);
|
|
91
|
+
(0, react_1.useEffect)(() => {
|
|
92
|
+
if (DOMtargetId && DOMtargetId !== id) {
|
|
93
|
+
setId(DOMtargetId);
|
|
94
|
+
}
|
|
95
|
+
}, [DOMtargetId]);
|
|
96
|
+
// Chart setup
|
|
97
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
98
|
+
const root = am5.Root.new(id);
|
|
99
|
+
// Setup amcharts theme
|
|
100
|
+
if (chartThemes) {
|
|
101
|
+
root.setThemes(chartThemes.map((t) => t.new(root)));
|
|
102
|
+
}
|
|
103
|
+
// Setup interface colors, see https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/#Interface_colors
|
|
104
|
+
if (colors.interfaceColors) {
|
|
105
|
+
// Remap settings to use amcharts Color objects
|
|
106
|
+
for (const setting in colors.interfaceColors) {
|
|
107
|
+
const color = colors.interfaceColors[setting];
|
|
108
|
+
// Apply defined interfaceColor on the chart
|
|
109
|
+
root.interfaceColors.set(setting, am5.color(color));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Setup chart settings
|
|
113
|
+
const chart = root.container.children.push(am5percent.PieChart.new(root, {
|
|
114
|
+
layout: root.verticalLayout,
|
|
115
|
+
...chartSettingsProvider?.(root),
|
|
116
|
+
}));
|
|
117
|
+
// Setup legend
|
|
118
|
+
const legend = chart.children.push(am5.Legend.new(root, {
|
|
119
|
+
layout: root.horizontalLayout,
|
|
120
|
+
...legendSettingsProvider?.(root),
|
|
121
|
+
}));
|
|
122
|
+
if (legendLabelsSettings) {
|
|
123
|
+
legend.labels.template.setAll(legendLabelsSettings);
|
|
124
|
+
}
|
|
125
|
+
if (legendValueLabelsSettings) {
|
|
126
|
+
legend.valueLabels.template.setAll(legendValueLabelsSettings);
|
|
127
|
+
}
|
|
128
|
+
if (legendMarkersSettings) {
|
|
129
|
+
legend.markers.template.setAll(legendMarkersSettings);
|
|
130
|
+
}
|
|
131
|
+
rootRef.current = root;
|
|
132
|
+
chartRef.current = chart;
|
|
133
|
+
legendRef.current = legend;
|
|
134
|
+
// clean up before component removal from the DOM
|
|
135
|
+
return () => {
|
|
136
|
+
legendRef.current?.dispose();
|
|
137
|
+
legendRef.current = null;
|
|
138
|
+
chartRef.current?.dispose();
|
|
139
|
+
chartRef.current = null;
|
|
140
|
+
root?.dispose();
|
|
141
|
+
rootRef.current = null;
|
|
142
|
+
};
|
|
143
|
+
}, [
|
|
144
|
+
id,
|
|
145
|
+
colors,
|
|
146
|
+
chartThemes,
|
|
147
|
+
chartSettingsProvider,
|
|
148
|
+
legendSettingsProvider,
|
|
149
|
+
legendValueLabelsSettings,
|
|
150
|
+
legendMarkersSettings,
|
|
151
|
+
]);
|
|
152
|
+
// Set data
|
|
153
|
+
(0, react_1.useEffect)(() => {
|
|
154
|
+
const root = rootRef.current;
|
|
155
|
+
const chart = chartRef.current;
|
|
156
|
+
if (chart && root) {
|
|
157
|
+
chart.series.clear();
|
|
158
|
+
if (data?.length) {
|
|
159
|
+
// Setup series
|
|
160
|
+
const series = chart.series.push(am5percent.PieSeries.new(root, {
|
|
161
|
+
valueField: 'value',
|
|
162
|
+
categoryField: 'category',
|
|
163
|
+
...seriesSettings,
|
|
164
|
+
}));
|
|
165
|
+
// Setup series labels
|
|
166
|
+
if (seriesLabelsSettings) {
|
|
167
|
+
series.labels.template.setAll(seriesLabelsSettings);
|
|
168
|
+
}
|
|
169
|
+
// Setup center label
|
|
170
|
+
if (centerLabelSettings) {
|
|
171
|
+
series.children.push(am5.Label.new(root, {
|
|
172
|
+
...centerLabelSettings,
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
// Setup series slices
|
|
176
|
+
if (slicesSettings) {
|
|
177
|
+
series.slices.template.setAll(slicesSettings);
|
|
178
|
+
}
|
|
179
|
+
// Setup slice adapters
|
|
180
|
+
if (sliceAdapters) {
|
|
181
|
+
sliceAdapters.forEach(([key, callbackMaker]) => series.slices.template.adapters.add(key, callbackMaker({
|
|
182
|
+
root: root,
|
|
183
|
+
chart: chart,
|
|
184
|
+
series,
|
|
185
|
+
})));
|
|
186
|
+
}
|
|
187
|
+
// Setup series colors
|
|
188
|
+
if (colors?.series) {
|
|
189
|
+
series.get('colors')?.set('colors', colors.series.map((c) => am5.color(c)));
|
|
190
|
+
}
|
|
191
|
+
series.data.setAll(data);
|
|
192
|
+
legendRef.current?.data.setAll(series.dataItems);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}, [
|
|
196
|
+
data,
|
|
197
|
+
chartRef.current,
|
|
198
|
+
colors?.series,
|
|
199
|
+
seriesSettings,
|
|
200
|
+
slicesSettings,
|
|
201
|
+
seriesLabelsSettings,
|
|
202
|
+
sliceAdapters,
|
|
203
|
+
]);
|
|
204
|
+
(0, react_1.useEffect)(() => {
|
|
205
|
+
if (numberFormat) {
|
|
206
|
+
rootRef.current?.numberFormatter.set('numberFormat', numberFormat);
|
|
207
|
+
}
|
|
208
|
+
}, [rootRef.current, numberFormat]);
|
|
209
|
+
const classes = useStyles();
|
|
210
|
+
return typeof id === 'string' ? (react_1.default.createElement("div", { id: id, className: classes.root })) : (
|
|
211
|
+
// If the DOM target is an HTML element, do not render another div. The chart will be attached to the existing element.
|
|
212
|
+
react_1.default.createElement(react_1.default.Fragment, null));
|
|
213
|
+
};
|
|
214
|
+
exports.PieChart = PieChart;
|
|
205
215
|
//# sourceMappingURL=PieChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PieChart.js","sourceRoot":"","sources":["../../../../../src/react/components/charts/pie/PieChart.tsx"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"PieChart.js","sourceRoot":"","sources":["../../../../../src/react/components/charts/pie/PieChart.tsx"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yDAA0C;AAC1C,wEAAyD;AAEzD,+CAA2E;AAC3E,yCAAqD;AAErD,MAAM,SAAS,GAAG,IAAA,2BAAe,EAAC;IACjC,IAAI,EAAE;QACL,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;KACd;CACD,CAAC,CAAA;AAWF;;;;GAIG;AACH,MAAM,qBAAqB,GAAG,CAAC,KAAe,EAAwB,EAAE;IACvE,OAAO;QACN,eAAe,EAAE;YAChB,IAAI,EAAE,KAAK,CAAC,SAAS;SACrB;QACD,MAAM,EAAE;YACP,KAAK,CAAC,OAAO,CAAC,IAAI;YAClB,KAAK,CAAC,OAAO,CAAC,IAAI;YAClB,KAAK,CAAC,OAAO,CAAC,GAAG;YACjB,KAAK,CAAC,OAAO,CAAC,OAAO;YACrB,KAAK,CAAC,OAAO,CAAC,MAAM;YACpB,KAAK,CAAC,OAAO,CAAC,IAAI;YAClB,KAAK,CAAC,OAAO,CAAC,MAAM;YACpB,KAAK,CAAC,OAAO,CAAC,KAAK;YACnB,KAAK,CAAC,OAAO,CAAC,MAAM;YACpB,KAAK,CAAC,OAAO,CAAC,OAAO;YACrB,KAAK,CAAC,OAAO,CAAC,IAAI;YAClB,KAAK,CAAC,OAAO,CAAC,IAAI;SAClB;KACD,CAAA;AACF,CAAC,CAAA;AAwFD;;;;;GAKG;AACI,MAAM,QAAQ,GAA4B,CAAC,EACjD,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB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C,CAAA;IAEnC,MAAM,OAAO,GAAG,SAAS,EAAE,CAAA;IAC3B,OAAO,OAAO,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,CAC/B,uCAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,IAAI,GAAQ,CAC5C,CAAC,CAAC,CAAC;IACH,uHAAuH;IACvH,6DAAK,CACL,CAAA;AACF,CAAC,CAAA;AAnMY,QAAA,QAAQ,YAmMpB"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PieChartColorPalette, PieChartSliceData } from './PieChart';
|
|
3
|
-
export interface SimplePieChartProps {
|
|
4
|
-
data: PieChartSliceData[];
|
|
5
|
-
donut?: boolean;
|
|
6
|
-
animated?: boolean;
|
|
7
|
-
colorPalette?: Partial<PieChartColorPalette>;
|
|
8
|
-
tooltipFormat?: string;
|
|
9
|
-
numberFormat?: Intl.NumberFormatOptions;
|
|
10
|
-
hideLabels?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Optional DOM id for the chart container, if not specified it will be automatically generated.
|
|
13
|
-
* It can also be an HTMLElement, in that case the element will be used as a parent.
|
|
14
|
-
*/
|
|
15
|
-
DOMtargetId?: string | HTMLElement;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Simplified version of the pie chart for quick usage and easy configuration.
|
|
19
|
-
* Serves also as an example of how to use the underlying PieChart component.
|
|
20
|
-
*/
|
|
21
|
-
export declare const SimplePieChart: React.FC<SimplePieChartProps>;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PieChartColorPalette, PieChartSliceData } from './PieChart';
|
|
3
|
+
export interface SimplePieChartProps {
|
|
4
|
+
data: PieChartSliceData[];
|
|
5
|
+
donut?: boolean;
|
|
6
|
+
animated?: boolean;
|
|
7
|
+
colorPalette?: Partial<PieChartColorPalette>;
|
|
8
|
+
tooltipFormat?: string;
|
|
9
|
+
numberFormat?: Intl.NumberFormatOptions;
|
|
10
|
+
hideLabels?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Optional DOM id for the chart container, if not specified it will be automatically generated.
|
|
13
|
+
* It can also be an HTMLElement, in that case the element will be used as a parent.
|
|
14
|
+
*/
|
|
15
|
+
DOMtargetId?: string | HTMLElement;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Simplified version of the pie chart for quick usage and easy configuration.
|
|
19
|
+
* Serves also as an example of how to use the underlying PieChart component.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SimplePieChart: React.FC<SimplePieChartProps>;
|
|
@@ -1,56 +1,66 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2023, J2 Innovations. All Rights Reserved
|
|
4
|
-
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023, J2 Innovations. All Rights Reserved
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.SimplePieChart = void 0;
|
|
43
|
+
const am5 = __importStar(require("@amcharts/amcharts5"));
|
|
44
|
+
const Animated_1 = __importDefault(require("@amcharts/amcharts5/themes/Animated"));
|
|
45
|
+
const react_1 = __importDefault(require("react"));
|
|
46
|
+
const PieChart_1 = require("./PieChart");
|
|
47
|
+
/**
|
|
48
|
+
* Simplified version of the pie chart for quick usage and easy configuration.
|
|
49
|
+
* Serves also as an example of how to use the underlying PieChart component.
|
|
50
|
+
*/
|
|
51
|
+
const SimplePieChart = ({ data, donut, animated, colorPalette, tooltipFormat, numberFormat = {
|
|
52
|
+
style: 'decimal',
|
|
53
|
+
minimumFractionDigits: 0,
|
|
54
|
+
maximumFractionDigits: 1,
|
|
55
|
+
}, hideLabels, DOMtargetId, }) => {
|
|
56
|
+
return (react_1.default.createElement(PieChart_1.PieChart, { DOMtargetId: DOMtargetId, colorPalette: colorPalette, data: data, chartThemes: animated ? [Animated_1.default] : undefined, chartSettingsProvider: () => ({
|
|
57
|
+
innerRadius: donut ? am5.percent(55) : undefined,
|
|
58
|
+
}), numberFormat: numberFormat, legendSettingsProvider: () => ({
|
|
59
|
+
centerX: am5.percent(50),
|
|
60
|
+
x: am5.percent(50),
|
|
61
|
+
}), seriesLabelsSettings: { forceHidden: hideLabels }, seriesSettings: { alignLabels: false }, slicesSettings: {
|
|
62
|
+
tooltipText: tooltipFormat,
|
|
63
|
+
} }));
|
|
64
|
+
};
|
|
65
|
+
exports.SimplePieChart = SimplePieChart;
|
|
56
66
|
//# sourceMappingURL=SimplePieChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimplePieChart.js","sourceRoot":"","sources":["../../../../../src/react/components/charts/pie/SimplePieChart.tsx"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"SimplePieChart.js","sourceRoot":"","sources":["../../../../../src/react/components/charts/pie/SimplePieChart.tsx"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yDAA0C;AAC1C,mFAAoE;AACpE,kDAAyB;AACzB,yCAA8E;AAiB9E;;;GAGG;AACI,MAAM,cAAc,GAAkC,CAAC,EAC7D,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,YAAY,GAAG;IACd,KAAK,EAAE,SAAS;IAChB,qBAAqB,EAAE,CAAC;IACxB,qBAAqB,EAAE,CAAC;CACxB,EACD,UAAU,EACV,WAAW,GACX,EAAe,EAAE;IACjB,OAAO,CACN,8BAAC,mBAAQ,IACR,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,SAAS,EACxD,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC;YAC7B,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;SAChD,CAAC,EACF,YAAY,EAAE,YAAY,EAC1B,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC;YAC9B,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YACxB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;SAClB,CAAC,EACF,oBAAoB,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,EACjD,cAAc,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,EACtC,cAAc,EAAE;YACf,WAAW,EAAE,aAAa;SAC1B,GACA,CACF,CAAA;AACF,CAAC,CAAA;AAnCY,QAAA,cAAc,kBAmC1B"}
|