impaktapps-design 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,282 @@
1
+ const Product1 = [
2
+ { x: "a", y: 100 },
3
+ { x: "b", y: 50 },
4
+ { x: "c", y: 100 },
5
+ { x: "d", y: 80 },
6
+ { x: "f", y: 100 },
7
+ { x: "g", y: 50 },
8
+ ];
9
+ export const finalDataProvider = (type: string, value: any) => {
10
+ switch (type) {
11
+ case "BarGraph":
12
+ return {
13
+ main: {
14
+ type: "barGraph",
15
+ data: value?.main?.data || [{ x: "ASM", y: 100 }, { x: "SDM", y: 60 }, { x: "DCM", y: 40 }, { x: "RCM", y: 70 }],
16
+ // [{}] ,
17
+ header: "Bar Graph",
18
+ bottomLabel: "Name of Employe",
19
+ numTicks: 6,
20
+ leftLabel: "Value",
21
+ axisLeft: true,
22
+ axisBottom: true,
23
+
24
+ hideTicks: true,
25
+ hideLeftAxisLine: false,
26
+ hideBottomAxisLine: false,
27
+ bottomAxisWidth: "10px",
28
+ ...value.main
29
+ },
30
+ style: {
31
+ containerStyle: {
32
+ background: "white",
33
+ width: "90%",
34
+ height: "300",
35
+ borderRadius: "20px",
36
+ padding: "10px 0 2px 0",
37
+ ...value?.style?.containerStyle
38
+ },
39
+ headerStyle: {
40
+ fontWeight: 500,
41
+ textAlign: "left",
42
+ fontFamily: "inherit",
43
+ marginBottom: "20px",
44
+ padding: "15px 0 1px 20px",
45
+ width: "100%",
46
+ fontSize: "18px",
47
+ ...value?.style?.headerStyle
48
+ },
49
+ tooltipStyle: {
50
+ padding: "6px", borderRadius: "2px",
51
+ ...value?.style?.tooltipStyle
52
+ },
53
+ labelStyle: {
54
+ leftLabelMargin: "75",
55
+ topLabelMargin: "-6",
56
+ labelColor: "black",
57
+ leftLabelOffset: 50,
58
+ bottomLabelOffset: 10,
59
+ tickLabelColor: "balck",
60
+ tickFontSize: "10px",
61
+ tickColor: "black",
62
+ rightAxisWidth: "0.3px",
63
+ fontSize: "10px",
64
+ ...value?.style?.labelStyle
65
+ },
66
+ barStyle: {
67
+ mediumValueColor: "rgba(63, 81, 181, 0.85)",
68
+ highValueColor: "rgba(63, 81, 181, 0.85)",
69
+ lowValueColor: "rgba(63, 81, 181, 0.85)",
70
+ ...value?.style?.barStyle
71
+ }
72
+ }
73
+ };
74
+ case "PieGraph":
75
+ return {
76
+ main: {
77
+ data: value?.main?.data || [{ branch: "Kotak", value: 500 }, { branch: "SBI", value: 700 }, { branch: "HDFC", value: 900 }],
78
+ // [{}] ,
79
+ // || letterFrequency.slice(0, 3),
80
+ header: "Pie Graph",
81
+ bottomLabel: "Name of Employe",
82
+ leftLabel: "Value",
83
+ tooltipDataKey: ["First", "Second", "Third"],
84
+ axisLeft: true,
85
+ axisBottom: true,
86
+ legendAvailable: true,
87
+ ...value?.main,
88
+ legend: {
89
+ labelColor: "green",
90
+ legendTitle: "Our Assests",
91
+ direction: "row",
92
+ align: "right",
93
+ ...value?.main?.legend,
94
+ },
95
+ },
96
+
97
+ style: {
98
+ containerStyle: {
99
+ background: "white",
100
+ width: "100%",
101
+ height: "310",
102
+ borderRadius: "20px",
103
+ padding: "10px 0 2px 0",
104
+ ...value?.style?.containerStyle,
105
+ },
106
+ headerStyle: {
107
+ fontWeight: 500,
108
+ textAlign: "left",
109
+ fontFamily: "inherit",
110
+ marginBottom: "20px",
111
+ padding: "15px 0 1px 20px",
112
+ width: "100%",
113
+ fontSize: "18px",
114
+ ...value?.style?.headerStyle
115
+ },
116
+ tooltipStyle: {
117
+ // width: "100%",
118
+ ...value?.style?.tooltipStyle,
119
+ },
120
+ labelStyle: {
121
+ labelColor: "black",
122
+ labelOffset: 45,
123
+ leftLabelMargin: "70",
124
+ topLabelMargin: "-40",
125
+ ...value?.style?.labelStyle,
126
+ },
127
+ legendStyle: {
128
+ legend: {
129
+ lineHeight: "0.9em",
130
+ color: "black",
131
+ fontSize: "10px",
132
+
133
+ fontFamily: "arial",
134
+ padding: "10px 10px",
135
+ float: "left",
136
+ border: "1px solid rgba(255, 255, 255, 0.3)",
137
+ borderRadius: " 8px",
138
+ margin: "5px 5px",
139
+ ...value?.style?.legendStyle?.legend,
140
+ },
141
+ legendTitle: {
142
+ fontWeight: 500,
143
+ marginBottom: "5px",
144
+ fontFamily: "roboto",
145
+ fontSize: "10px",
146
+ ...value?.style?.legendStyle?.legendTitle,
147
+ },
148
+ },
149
+ pieStyle: {
150
+ colorRange: ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)"],
151
+ outerRadius: 120,
152
+ innerRadius: 60,
153
+ cornerRadius: 2,
154
+ padAngle: 0.006,
155
+ ...value?.style?.pieStyle,
156
+ },
157
+ },
158
+ }
159
+ case "LineGraph":
160
+ return {
161
+
162
+ main: {
163
+ data: value?.main?.data || [Product1],
164
+ header: "Line Graph Dynamic",
165
+ bottomLabel: "Name of Employe",
166
+ leftLabel: "Value",
167
+ gridHidden: true,
168
+ numHidden: false,
169
+ tooltipDataKey: ["MAMA New Project", "Second", "Third"],
170
+ axisLeft: true,
171
+
172
+ axisBottom: true,
173
+ hideLeftAxisLine: false,
174
+ hideBottomAxisLine: false,
175
+ ...value?.main,
176
+ legend: {
177
+ labelColor: "green",
178
+ legendTitle: "Our Assests",
179
+ direction: "row",
180
+ align: "right",
181
+ colorRectWidth: 20,
182
+ ...value?.main?.legend
183
+ },
184
+ },
185
+ style: {
186
+ containerStyle: {
187
+ background: "white",
188
+ width: "90%",
189
+ height: "300",
190
+ borderRadius: "20px",
191
+ padding: "10px 0 2px 0",
192
+ ...value?.style?.containerStyle
193
+ },
194
+ headerStyle: {
195
+ fontWeight: 500,
196
+ textAlign: "left",
197
+ fontFamily: "inherit",
198
+ marginBottom: "20px",
199
+ padding: "15px 0 1px 20px",
200
+ width: "100%",
201
+ fontSize: "18px",
202
+ ...value?.style?.headerStyle
203
+ },
204
+ labelStyle: {
205
+ labelColor: "black",
206
+ bottomLabelOffset: 20,
207
+ leftLabelOffset: 50,
208
+ leftLabelMargin: 80,
209
+ ...value?.style?.labelStyle
210
+ },
211
+ lineStyle: {
212
+ colorRange: ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)"],
213
+ lineAreaColor: "none",
214
+ lineAreaOpacity: 0.2,
215
+ ...value?.style?.lineStyle
216
+ }
217
+ }
218
+ }
219
+ case "HorizontalBarGraph":
220
+ return {
221
+ main: {
222
+ data:
223
+ value?.main?.data || [{ y: "Anant Sharma", x: 60 }, { y: "Pankaj Chauhan", x: 60 }, { y: "satendra Raghav", x: 150 }, { y: "Vivek Pahadi", x: 80 }, { y: "Siddarth verma", x: 100 }],
224
+ // [{}] ,
225
+
226
+ header: " ",
227
+ bottomLabel: "Name of Employe",
228
+ // numTicks: 6,
229
+ leftLabel: "Value",
230
+ axisLeft: true,
231
+ axisBottom: true,
232
+ hideBottomTicks: false,
233
+ hideLeftTicks: value?.main?.data ? true : false,
234
+ hideLeftAxisLine: value?.main?.data ? true : false,
235
+ hideBottomAxisLine: false,
236
+ bottomAxisWidth: "10px",
237
+ ...value.main
238
+ },
239
+ style: {
240
+ containerStyle: {
241
+ background: "white",
242
+ width: "90%",
243
+ height: "300",
244
+ borderRadius: "20px",
245
+ padding: "10px 0 2px 0",
246
+ ...value?.style?.containerStyle
247
+ },
248
+ headerStyle: {
249
+ fontWeight: 500,
250
+ textAlign: "left",
251
+ fontFamily: "inherit",
252
+ marginBottom: "20px",
253
+ padding: "15px 0 1px 20px",
254
+ width: "100%",
255
+ fontSize: "18px",
256
+ ...value?.style?.headerStyle
257
+ },
258
+ tooltipStyle: {
259
+ padding: "6px",
260
+ borderRadius: "2px",
261
+ ...value?.style?.tooltipStyle
262
+ },
263
+ labelStyle: {
264
+ margin: { top: 10, left: 110, right: 40, bottom: 40 },
265
+ tickLabelColor: "#6c5efb",
266
+ leftLabelOffset: 140,
267
+ bottomLabelOffset: 14,
268
+ tickFontSize: "10px",
269
+ tickColor: "#6c5efb",
270
+ rightAxisWidth: "0.3px",
271
+ fontSize: "10px",
272
+
273
+ ...value?.style?.labelStyle
274
+ },
275
+ barStyle: {
276
+ color: "#6c5efb",
277
+ ...value?.style?.barStyle
278
+ },
279
+ },
280
+ };
281
+ }
282
+ }