impaktapps-design 0.2.993-alpha.251 → 0.2.993-alpha.252
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/package.json +1 -1
- package/src/utils/finalDataProvider.ts +0 -149
package/package.json
CHANGED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
export const finalDataProvider = (type: string, value, theme?) => {
|
|
2
|
-
switch (type) {
|
|
3
|
-
case "BarGraph":
|
|
4
|
-
case "StackBarGraph":
|
|
5
|
-
case "HorizontalBarGraph":
|
|
6
|
-
case "HorizontalStackBarGraph":
|
|
7
|
-
return {
|
|
8
|
-
main: {
|
|
9
|
-
legendAvailable: true,
|
|
10
|
-
xAxisValue: "label",
|
|
11
|
-
...value.main,
|
|
12
|
-
data: value.main.data?.length ? value.main.data : [],
|
|
13
|
-
legend: {
|
|
14
|
-
direction: "row",
|
|
15
|
-
...value.main.legend,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
style: {
|
|
19
|
-
containerStyle: {
|
|
20
|
-
background: theme.myTheme.palette.background.default,
|
|
21
|
-
height: "300",
|
|
22
|
-
...value.style?.containerStyle,
|
|
23
|
-
},
|
|
24
|
-
labelStyle: {
|
|
25
|
-
...value.style?.labelStyle,
|
|
26
|
-
},
|
|
27
|
-
barStyle: {
|
|
28
|
-
...value.style?.barStyle,
|
|
29
|
-
colorMap: value.style?.colorMap
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
case "PieGraph":
|
|
34
|
-
return {
|
|
35
|
-
main: {
|
|
36
|
-
legendAvailable: true,
|
|
37
|
-
xAxisValue: "label",
|
|
38
|
-
outerRadius: 117,
|
|
39
|
-
innerRadius: 63,
|
|
40
|
-
...value.main,
|
|
41
|
-
data: value.main.data?.length > 0 ? value.main.data : [{ label: "No Data", value: 100 }],
|
|
42
|
-
legend: {
|
|
43
|
-
direction: "column",
|
|
44
|
-
...value.main.legend,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
style: {
|
|
49
|
-
containerStyle: {
|
|
50
|
-
height: "300",
|
|
51
|
-
...value.style?.containerStyle,
|
|
52
|
-
},
|
|
53
|
-
pieStyle: {
|
|
54
|
-
...value.style?.pieStyle,
|
|
55
|
-
colorMap: value.style?.colorMap
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
case "LineGraph":
|
|
61
|
-
return {
|
|
62
|
-
main: {
|
|
63
|
-
legendAvailable: true,
|
|
64
|
-
xAxisValue: "label",
|
|
65
|
-
...value.main,
|
|
66
|
-
data: value.main.data?.length ? value.main.data : [{ "No Data": 0 }],
|
|
67
|
-
legend: {
|
|
68
|
-
direction: "row",
|
|
69
|
-
...value.main.legend,
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
style: {
|
|
73
|
-
containerStyle: {
|
|
74
|
-
background: theme.myTheme.palette.background.default,
|
|
75
|
-
height: "300",
|
|
76
|
-
...value.style?.containerStyle,
|
|
77
|
-
},
|
|
78
|
-
labelStyle: {
|
|
79
|
-
...value.style?.labelStyle,
|
|
80
|
-
},
|
|
81
|
-
lineStyle: {
|
|
82
|
-
...value.style?.lineStyle,
|
|
83
|
-
colorMap: value.style?.colorMap
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
case "AreaGraph":
|
|
90
|
-
return {
|
|
91
|
-
main: {
|
|
92
|
-
legendAvailable: true,
|
|
93
|
-
xAxisValue: value.main?.xAxisValue || "label",
|
|
94
|
-
xAxisType: value.main?.xAxisType || "date",
|
|
95
|
-
...value.main,
|
|
96
|
-
xAxisFormatType: value.main?.xAxisSchemaFormat || value.main?.xAxisFormatType || "Date and Month",
|
|
97
|
-
data: value.main.data?.length ? value.main.data : [{ label: "", total: 0 }],
|
|
98
|
-
legend: {
|
|
99
|
-
direction: "row",
|
|
100
|
-
...value.main.legend,
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
style: {
|
|
104
|
-
containerStyle: {
|
|
105
|
-
background: theme.myTheme.palette.background.default,
|
|
106
|
-
height: "300",
|
|
107
|
-
...value.style?.containerStyle,
|
|
108
|
-
},
|
|
109
|
-
labelStyle: {
|
|
110
|
-
...value.style?.labelStyle,
|
|
111
|
-
},
|
|
112
|
-
areaStyle: {
|
|
113
|
-
...value.style?.areaStyle,
|
|
114
|
-
colorMap: value.style?.colorMap
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
case 'StackBarLineGraph':
|
|
121
|
-
return {
|
|
122
|
-
main: {
|
|
123
|
-
legendAvailable: true,
|
|
124
|
-
xAxisValue: value.main?.xAxisValue || 'label',
|
|
125
|
-
...value.main,
|
|
126
|
-
data: value.main.data?.length ? value.main.data : [{}],
|
|
127
|
-
legend: {
|
|
128
|
-
direction: 'row',
|
|
129
|
-
...value.main.legend,
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
style: {
|
|
133
|
-
containerStyle: {
|
|
134
|
-
background: theme.myTheme.palette.background.default,
|
|
135
|
-
height: '300',
|
|
136
|
-
...value.style?.containerStyle,
|
|
137
|
-
},
|
|
138
|
-
labelStyle: {
|
|
139
|
-
...value.style?.labelStyle,
|
|
140
|
-
},
|
|
141
|
-
stackBarLineStyle: {
|
|
142
|
-
...value.style?.stackBarLineStyle,
|
|
143
|
-
colorMap: value.style?.colorMap
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
|