impaktapps-design 0.2.75 → 0.2.76
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/impaktapps-design.es.js +137 -96
- package/dist/impaktapps-design.umd.js +10 -10
- package/dist/src/component/LineGraph/DrawLineGraph.d.ts +1 -1
- package/dist/src/utils/finalDataProvider.d.ts +4 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/Style/style.css +20 -0
- package/src/component/BottomAxis.tsx +38 -0
- package/src/component/Legend.tsx +3 -2
- package/src/component/LineGraph/DrawLineGraph.tsx +6 -5
- package/src/component/LineGraph/LineGraph.tsx +18 -2
- package/src/component/PieGraph/DrawPieGraph.tsx +5 -1
- package/src/component/PieGraph/PieGraph.tsx +3 -1
- package/src/component/ProgressBar/ProgressBar.tsx +59 -63
- package/src/component/SpeedoMeter/SpeedoMeter.tsx +39 -9
- package/src/utils/finalDataProvider.ts +28 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const DrawGraph: ({ value }: any) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
declare const DrawGraph: ({ value, parentWidth, parentHeight }: any) => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default DrawGraph;
|
|
@@ -30,11 +30,14 @@ export declare const finalDataProvider: (type: string, value: any, theme?: any)
|
|
|
30
30
|
style: {
|
|
31
31
|
containerStyle: any;
|
|
32
32
|
headerStyle: any;
|
|
33
|
+
legendStyle: {
|
|
34
|
+
legend: any;
|
|
35
|
+
legendTitle: any;
|
|
36
|
+
};
|
|
33
37
|
labelStyle: any;
|
|
34
38
|
lineStyle: any;
|
|
35
39
|
tooltipStyle?: undefined;
|
|
36
40
|
barStyle?: undefined;
|
|
37
|
-
legendStyle?: undefined;
|
|
38
41
|
pieStyle?: undefined;
|
|
39
42
|
};
|
|
40
43
|
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Roboto;600&display=swap";.container{margin:0;box-sizing:border-box;font-family:Roboto,sans-serif}
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Roboto;600&display=swap";.axisBottom{display:block}@media (max-width: 768px){.axisBottom{display:none}}.container{margin:0;box-sizing:border-box;font-family:Roboto,sans-serif}
|
package/package.json
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { AxisBottom } from "@visx/axis";
|
|
3
3
|
import { bottomAxisProps } from '../interface/interface';
|
|
4
|
+
import "../Style/style.css"
|
|
4
5
|
const BottomAxis = ({data,yMax,value,xScale,parentWidth,left}:bottomAxisProps) => {
|
|
5
6
|
|
|
6
7
|
return (
|
|
8
|
+
<>
|
|
9
|
+
{/* <BrowserView> */}
|
|
7
10
|
<AxisBottom
|
|
8
11
|
numTicks={data?.length}
|
|
9
12
|
top={yMax}
|
|
10
13
|
left={left}
|
|
14
|
+
labelClassName='axisBottom'
|
|
15
|
+
tickClassName='axisBottom'
|
|
16
|
+
axisClassName='axisBottom'
|
|
17
|
+
// className="axisBottom"
|
|
11
18
|
hideTicks={value.main?.hideTicks}
|
|
12
19
|
hideAxisLine={value.main?.hideBottomAxisLine}
|
|
13
20
|
strokeWidth={value.style?.labelStyle?.bottomAxisWidth}
|
|
@@ -23,11 +30,42 @@ const BottomAxis = ({data,yMax,value,xScale,parentWidth,left}:bottomAxisProps) =
|
|
|
23
30
|
}}
|
|
24
31
|
tickStroke={value.style?.labelStyle?.tickColor}
|
|
25
32
|
tickLabelProps={() => ({
|
|
33
|
+
// display:"none",
|
|
26
34
|
fill: value.style?.labelStyle?.tickLabelColor,
|
|
27
35
|
fontSize: value.style?.labelStyle?.tickFontSize ||11,
|
|
28
36
|
textAnchor: "middle",
|
|
29
37
|
})}
|
|
30
38
|
/>
|
|
39
|
+
{/* </BrowserView> */}
|
|
40
|
+
{/* <MobileView>
|
|
41
|
+
<AxisBottom
|
|
42
|
+
numTicks={data?.length}
|
|
43
|
+
top={yMax}
|
|
44
|
+
left={left}
|
|
45
|
+
hideTicks={true||value.main?.hideTicks}
|
|
46
|
+
|
|
47
|
+
hideAxisLine={true||value.main?.hideBottomAxisLine}
|
|
48
|
+
strokeWidth={value.style?.labelStyle?.bottomAxisWidth}
|
|
49
|
+
scale={xScale}
|
|
50
|
+
stroke={value.style?.labelStyle?.tickColor}
|
|
51
|
+
labelOffset={value.style?.labelStyle?.bottomLabelOffset}
|
|
52
|
+
label={value.main?.bottomLabel}
|
|
53
|
+
labelProps={{
|
|
54
|
+
fill: value.style?.labelStyle?.labelColor,
|
|
55
|
+
fontSize: value.style?.labelStyle?.fontSize,
|
|
56
|
+
fontWeight: value.style?.labelStyle?.fontWeight,
|
|
57
|
+
fontFamily: value.style?.labelStyle?.fontWeight,
|
|
58
|
+
}}
|
|
59
|
+
tickStroke={value.style?.labelStyle?.tickColor}
|
|
60
|
+
tickLabelProps={() => ({
|
|
61
|
+
display:"none",
|
|
62
|
+
fill: value.style?.labelStyle?.tickLabelColor,
|
|
63
|
+
fontSize: value.style?.labelStyle?.tickFontSize ||11,
|
|
64
|
+
textAnchor: "middle",
|
|
65
|
+
})}
|
|
66
|
+
/>
|
|
67
|
+
</MobileView> */}
|
|
68
|
+
</>
|
|
31
69
|
)
|
|
32
70
|
}
|
|
33
71
|
export default BottomAxis
|
package/src/component/Legend.tsx
CHANGED
|
@@ -5,7 +5,8 @@ export function Legend({ value ,colorRange,dataKeyArray}: any) {
|
|
|
5
5
|
const legendGlyphSize = value?.main?.legend?.colorRectWidth || 15;
|
|
6
6
|
const ordinalColorScale = scaleOrdinal({
|
|
7
7
|
domain:dataKeyArray||value?.main?.tooltipDataKey,
|
|
8
|
-
range:colorRange|| value?.style?.pieStyle?.colorRange,
|
|
8
|
+
range: colorRange|| value?.style?.pieStyle?.colorRange,
|
|
9
|
+
|
|
9
10
|
});
|
|
10
11
|
return (
|
|
11
12
|
<div className="legend" style={{paddingLeft:"40px",paddingRight:"40px",...value?.style?.legendStyle?.legend}}>
|
|
@@ -28,7 +29,7 @@ export function Legend({ value ,colorRange,dataKeyArray}: any) {
|
|
|
28
29
|
key={`legend-quantile-${i}`}
|
|
29
30
|
margin="0 5px"
|
|
30
31
|
onClick={(events) => {
|
|
31
|
-
|
|
32
|
+
|
|
32
33
|
}}
|
|
33
34
|
>
|
|
34
35
|
<svg width={legendGlyphSize} height={legendGlyphSize}>
|
|
@@ -7,18 +7,19 @@ import {
|
|
|
7
7
|
AnimatedGrid
|
|
8
8
|
} from "@visx/xychart";
|
|
9
9
|
import Legend from "../Legend";
|
|
10
|
-
const DrawGraph = ({ value }:any) => {
|
|
10
|
+
const DrawGraph = ({ value,parentWidth, parentHeight }:any) => {
|
|
11
11
|
const data = value?.main?.data;
|
|
12
12
|
const arr = (value.main.xAxisValue && value.main.yAxisValue) ? [value.main.xAxisValue,value.main.yAxisValue] : Object.keys(data[0][0]);
|
|
13
13
|
const accessors = { xAccessor: (d:any) => d[arr[0]], yAccessor: (d:any) => d[arr[1]] };
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
|
-
|
|
17
|
+
<div>
|
|
18
18
|
{value.main.legendAvailable &&
|
|
19
|
-
<Legend value={value}
|
|
19
|
+
<Legend value={value}
|
|
20
|
+
colorRange={value?.style?.lineStyle?.colorRange}/>
|
|
20
21
|
}
|
|
21
|
-
<XYChart height={
|
|
22
|
+
<XYChart width={parentWidth} height={parentHeight} xScale={{ type: "band" }} yScale={{ type: "linear" }}>
|
|
22
23
|
<AnimatedAxis orientation="left" hideAxisLine={value.main.hideLeftAxisLine}
|
|
23
24
|
label={value.main.leftLabel}
|
|
24
25
|
left={value.style?.labelStyle?.leftLabelMargin||70}
|
|
@@ -79,7 +80,7 @@ const DrawGraph = ({ value }:any) => {
|
|
|
79
80
|
</div>
|
|
80
81
|
)}
|
|
81
82
|
/>
|
|
82
|
-
</XYChart
|
|
83
|
+
</XYChart></div>
|
|
83
84
|
);
|
|
84
85
|
};
|
|
85
86
|
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import DrawLineGraph from "./DrawLineGraph";
|
|
3
3
|
import { finalDataProvider } from "../../utils/finalDataProvider";
|
|
4
|
+
import { ParentSize } from "@visx/responsive";
|
|
4
5
|
|
|
5
6
|
const LineGraph = ({ value,theme }:any) => {
|
|
6
7
|
const lineData = finalDataProvider("LineGraph", value,theme);
|
|
8
|
+
let LineRender = (
|
|
9
|
+
<ParentSize>
|
|
10
|
+
{(parent) => (
|
|
11
|
+
<DrawLineGraph
|
|
12
|
+
parentWidth={parent.width}
|
|
13
|
+
parentHeight={parseInt(lineData.style.containerStyle.height)}
|
|
14
|
+
//@ts-ignore
|
|
15
|
+
parentRef={parent.ref}
|
|
16
|
+
resizeParent={parent.resize}
|
|
17
|
+
value={lineData}
|
|
18
|
+
/>
|
|
19
|
+
)}
|
|
20
|
+
</ParentSize>
|
|
21
|
+
);
|
|
7
22
|
return (
|
|
8
|
-
<div style={lineData?.style?.containerStyle}>
|
|
23
|
+
<div style={{...lineData?.style?.containerStyle}}>
|
|
9
24
|
{lineData?.main?.header && (
|
|
10
25
|
<div style={lineData?.style?.headerStyle}>{lineData?.main?.header}</div>
|
|
11
26
|
)}
|
|
12
|
-
|
|
27
|
+
{LineRender}
|
|
28
|
+
{/* <DrawLineGraph value={lineData} /> */}
|
|
13
29
|
</div>
|
|
14
30
|
);
|
|
15
31
|
};
|
|
@@ -9,13 +9,15 @@ import ToolTip from "../ToolTip";
|
|
|
9
9
|
|
|
10
10
|
const DrawPieGraph = ({ value, parentWidth, parentHeight }: any) => {
|
|
11
11
|
const letters = value?.main?.data;
|
|
12
|
+
// ["branch","value"]
|
|
12
13
|
const arr =
|
|
13
14
|
value?.main?.xAxisValue && value?.main?.yAxisValue
|
|
14
15
|
? [value?.main?.xAxisValue, value?.main?.yAxisValue]
|
|
15
16
|
: Object.keys(letters[0]);
|
|
16
17
|
const frequency = (d: any) => d[arr[1]];
|
|
18
|
+
const labelArray = letters.map((l:[any]) => l[arr[0]]);
|
|
17
19
|
const getLetterFrequencyColor = scaleOrdinal({
|
|
18
|
-
domain:
|
|
20
|
+
domain:labelArray,
|
|
19
21
|
range: value?.style?.pieStyle?.colorRange,
|
|
20
22
|
});
|
|
21
23
|
|
|
@@ -47,6 +49,8 @@ const DrawPieGraph = ({ value, parentWidth, parentHeight }: any) => {
|
|
|
47
49
|
{value?.main?.legendAvailable && (
|
|
48
50
|
<Legend
|
|
49
51
|
value={value}
|
|
52
|
+
colorRange={value?.style?.pieStyle?.colorRange}
|
|
53
|
+
dataKeyArray={labelArray}
|
|
50
54
|
/>
|
|
51
55
|
)}
|
|
52
56
|
<svg
|
|
@@ -21,7 +21,9 @@ const PieGraph = ({ value,theme }: any) => {
|
|
|
21
21
|
);
|
|
22
22
|
return (
|
|
23
23
|
<div style={pieData.style.containerStyle}>
|
|
24
|
-
{pieData?.main?.header &&
|
|
24
|
+
{pieData?.main?.header && <>
|
|
25
|
+
<div style={pieData.style.headerStyle}>{pieData?.main?.header}</div>
|
|
26
|
+
</>}
|
|
25
27
|
{PieRender}
|
|
26
28
|
</div>
|
|
27
29
|
);
|
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import React, { useState
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
2
|
import "./style.css";
|
|
3
3
|
|
|
4
|
-
const ProgressBar = ({value,theme}
|
|
4
|
+
const ProgressBar = ({ value, theme }: any) => {
|
|
5
5
|
const [progress, setProgress] = useState(
|
|
6
|
-
|
|
7
|
-
100
|
|
6
|
+
(value?.main?.data?.achieved / value?.main?.data?.total) * 100
|
|
8
7
|
);
|
|
9
|
-
useEffect(()=>{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},[value.main.data])
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
setProgress((value?.main?.data?.achieved / value?.main?.data?.total) * 100);
|
|
10
|
+
}, [value.main.data]);
|
|
13
11
|
const getColor = () => {
|
|
14
12
|
if (progress < 40) {
|
|
15
|
-
return ["#e2b6b6","#ff0000"];
|
|
13
|
+
return ["#e2b6b6", "#ff0000"];
|
|
16
14
|
}
|
|
17
15
|
if (progress < 70) {
|
|
18
|
-
|
|
16
|
+
return ["#b6bce2", "#3f51b5"];
|
|
19
17
|
} else {
|
|
20
|
-
return ["#b6e2c2","#2ecc71"];
|
|
18
|
+
return ["#b6e2c2", "#2ecc71"];
|
|
21
19
|
}
|
|
22
20
|
};
|
|
23
|
-
if(value?.main?.developOnlyProgresBar){
|
|
24
|
-
return (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
if (value?.main?.developOnlyProgresBar) {
|
|
22
|
+
return (
|
|
23
|
+
<div
|
|
24
|
+
style={{
|
|
25
|
+
height: "6px",
|
|
26
|
+
margin: "auto",
|
|
27
|
+
borderRadius: "10px",
|
|
28
|
+
backgroundColor: value?.style?.progressBarColor || getColor()[1],
|
|
29
|
+
|
|
30
|
+
marginBottom: "20px",
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
<div
|
|
34
|
+
className="progress-bar-fill"
|
|
35
|
+
style={{
|
|
36
|
+
width: `${progress < 100 ? progress : 100}%`,
|
|
37
|
+
backgroundColor:
|
|
38
|
+
value?.style?.progressBarFillColor || getColor()[1],
|
|
39
|
+
height: "100%",
|
|
40
|
+
borderRadius: "10px",
|
|
41
|
+
marginBottom: "20px",
|
|
42
|
+
transition: "width 0.5 ease-out",
|
|
43
|
+
}}
|
|
44
|
+
></div>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
46
47
|
}
|
|
47
48
|
return (
|
|
48
49
|
<div
|
|
49
50
|
className="container"
|
|
50
51
|
style={{
|
|
51
|
-
backgroundColor:theme?.palette?.secondary.main
|
|
52
|
+
backgroundColor: theme?.palette?.secondary.main,
|
|
52
53
|
color: theme?.palette?.text?.primary,
|
|
53
54
|
borderRadius: "20px",
|
|
54
55
|
width: "auto",
|
|
@@ -66,7 +67,7 @@ const ProgressBar = ({value,theme} : any) => {
|
|
|
66
67
|
textAlign: "left",
|
|
67
68
|
fontFamily: "inherit",
|
|
68
69
|
fontSize: "18px",
|
|
69
|
-
color: theme?.palette?.text?.primary||"#121926",
|
|
70
|
+
color: theme?.palette?.text?.primary || "#121926",
|
|
70
71
|
}}
|
|
71
72
|
>
|
|
72
73
|
{value?.main?.heading}
|
|
@@ -90,7 +91,7 @@ const ProgressBar = ({value,theme} : any) => {
|
|
|
90
91
|
fontWeight: 700,
|
|
91
92
|
marginBottom: "20px",
|
|
92
93
|
fontSize: "24px",
|
|
93
|
-
color:"inherit"
|
|
94
|
+
color: "inherit",
|
|
94
95
|
}}
|
|
95
96
|
>
|
|
96
97
|
{progress.toFixed(2)}%
|
|
@@ -103,14 +104,14 @@ const ProgressBar = ({value,theme} : any) => {
|
|
|
103
104
|
margin: "auto",
|
|
104
105
|
borderRadius: "10px",
|
|
105
106
|
backgroundColor: getColor()[0],
|
|
106
|
-
|
|
107
|
+
|
|
107
108
|
marginBottom: "20px",
|
|
108
109
|
}}
|
|
109
110
|
>
|
|
110
111
|
<div
|
|
111
112
|
className="progress-bar-fill"
|
|
112
113
|
style={{
|
|
113
|
-
width: `${progress<100?progress:100}%`,
|
|
114
|
+
width: `${progress < 100 ? progress : 100}%`,
|
|
114
115
|
backgroundColor: getColor()[1],
|
|
115
116
|
// backgroundColor: "#3f51b5",
|
|
116
117
|
height: "100%",
|
|
@@ -134,69 +135,66 @@ const ProgressBar = ({value,theme} : any) => {
|
|
|
134
135
|
<div style={{ width: "33.33%" }}>
|
|
135
136
|
<div
|
|
136
137
|
style={{
|
|
137
|
-
textAlign:"left",
|
|
138
|
+
textAlign: "left",
|
|
138
139
|
fontSize: "10px",
|
|
139
140
|
color: theme?.palette?.text?.inputLabel,
|
|
140
141
|
marginBottom: "10px",
|
|
141
142
|
}}
|
|
142
143
|
>
|
|
143
|
-
|
|
144
|
+
{value?.main?.bottomLabel_1 || "Target"}
|
|
144
145
|
</div>
|
|
145
146
|
<div
|
|
146
147
|
style={{
|
|
147
|
-
color: theme?.palette?.text?.primary||"#121926",
|
|
148
|
-
textAlign:"left",
|
|
148
|
+
color: theme?.palette?.text?.primary || "#121926",
|
|
149
|
+
textAlign: "left",
|
|
149
150
|
fontWeight: 500,
|
|
150
151
|
}}
|
|
151
152
|
>
|
|
152
|
-
{value?.main?.data?.total||
|
|
153
|
+
{value?.main?.data?.total ||
|
|
154
|
+
value?.main?.data?.bottomLabel_1_value}
|
|
153
155
|
</div>
|
|
154
156
|
</div>
|
|
155
157
|
<div style={{ width: "33.33%" }}>
|
|
156
158
|
<div
|
|
157
159
|
style={{
|
|
158
|
-
textAlign:"center",
|
|
159
|
-
color: theme?.palette?.text?.inputLabel||"#697586",
|
|
160
|
+
textAlign: "center",
|
|
161
|
+
color: theme?.palette?.text?.inputLabel || "#697586",
|
|
160
162
|
fontSize: "10px",
|
|
161
163
|
marginBottom: "10px",
|
|
162
164
|
}}
|
|
163
165
|
>
|
|
164
|
-
|
|
166
|
+
{value?.main?.bottomLabel_2 || "Achieved"}
|
|
165
167
|
</div>
|
|
166
168
|
<div
|
|
167
169
|
style={{
|
|
168
|
-
textAlign:"center",
|
|
169
|
-
color: theme?.palette?.text?.primary|| "#121926",
|
|
170
|
+
textAlign: "center",
|
|
171
|
+
color: theme?.palette?.text?.primary || "#121926",
|
|
170
172
|
fontWeight: 500,
|
|
171
173
|
}}
|
|
172
174
|
>
|
|
173
|
-
{value?.main?.data?.achieved||
|
|
175
|
+
{value?.main?.data?.achieved ||
|
|
176
|
+
value?.main?.data?.bottomLabel_2_value}
|
|
174
177
|
</div>
|
|
175
178
|
</div>
|
|
176
179
|
<div style={{ width: "33.33%" }}>
|
|
177
180
|
<div
|
|
178
181
|
style={{
|
|
179
|
-
textAlign:"right",
|
|
180
|
-
color: theme?.palette?.text?.inputLabel||"#697586",
|
|
182
|
+
textAlign: "right",
|
|
183
|
+
color: theme?.palette?.text?.inputLabel || "#697586",
|
|
181
184
|
fontSize: "10px",
|
|
182
185
|
marginBottom: "10px",
|
|
183
186
|
}}
|
|
184
187
|
>
|
|
185
|
-
|
|
188
|
+
{value?.main?.bottomLabel_3 || "Remaining"}
|
|
186
189
|
</div>
|
|
187
190
|
<div
|
|
188
191
|
style={{
|
|
189
|
-
textAlign:"right",
|
|
190
|
-
color: theme?.palette?.text?.primary||"#121926",
|
|
192
|
+
textAlign: "right",
|
|
193
|
+
color: theme?.palette?.text?.primary || "#121926",
|
|
191
194
|
fontWeight: 500,
|
|
192
195
|
}}
|
|
193
196
|
>
|
|
194
|
-
{value?.main?.
|
|
195
|
-
Math.round(
|
|
196
|
-
(value?.main?.data?.achieved / value?.main?.daysCount)
|
|
197
|
-
)+ value?.main?.bottomLabel_3_averageLabel||"/day"
|
|
198
|
-
:value?.main?.data?.bottomLabel_3_value
|
|
199
|
-
}
|
|
197
|
+
{value?.main?.data?.bottomLabel_3_value}
|
|
200
198
|
</div>
|
|
201
199
|
</div>
|
|
202
200
|
</div>
|
|
@@ -206,5 +204,3 @@ const ProgressBar = ({value,theme} : any) => {
|
|
|
206
204
|
};
|
|
207
205
|
|
|
208
206
|
export default ProgressBar;
|
|
209
|
-
|
|
210
|
-
|
|
@@ -3,11 +3,30 @@ import ReactSpeedometer from "react-d3-speedometer";
|
|
|
3
3
|
|
|
4
4
|
const SpeedoMeter = ({ value,theme }: any) => {
|
|
5
5
|
return (
|
|
6
|
-
<div style={{
|
|
7
|
-
|
|
6
|
+
<div style={{
|
|
7
|
+
...value?.style?.containerStyle,
|
|
8
|
+
width:"100%",
|
|
9
|
+
// position:"relative",
|
|
10
|
+
display:"flex",
|
|
11
|
+
justifyContent:"center",
|
|
12
|
+
alignItems:"center",
|
|
13
|
+
paddingTop:"50px",
|
|
14
|
+
paddingBottom:"50px",
|
|
15
|
+
marginLeft:"auto",
|
|
16
|
+
marginRight:"auto",
|
|
17
|
+
height:'auto',
|
|
18
|
+
// minWidth:window.innerWidth-30,
|
|
19
|
+
// width:"100vw",
|
|
20
|
+
|
|
21
|
+
// maxWidth:"600%",
|
|
22
|
+
background:theme.palette.secondary.main ,
|
|
23
|
+
// height:window.innerWidth>750?400:300,
|
|
24
|
+
}}>
|
|
25
|
+
{/* {value?.main?.header && (
|
|
8
26
|
<div
|
|
9
27
|
style={{
|
|
10
28
|
fontWeight: 700,
|
|
29
|
+
|
|
11
30
|
textAlign: "left",
|
|
12
31
|
fontFamily: "inherit",
|
|
13
32
|
fontSize: "18px",
|
|
@@ -17,28 +36,39 @@ const SpeedoMeter = ({ value,theme }: any) => {
|
|
|
17
36
|
>
|
|
18
37
|
{value.main.header}
|
|
19
38
|
</div>
|
|
20
|
-
)}
|
|
21
|
-
<div style={{ width:"100%",
|
|
39
|
+
)} */}
|
|
40
|
+
<div style={{ width:"100%",
|
|
41
|
+
// position:"absolute",'
|
|
42
|
+
// top:"10%",
|
|
43
|
+
display:"flex",
|
|
44
|
+
justifyContent:"center",
|
|
45
|
+
alignItems:"center"
|
|
46
|
+
|
|
47
|
+
// left:window.innerWidth>750?"calc(50% - 225px)":"calc(50% - 140px)"
|
|
48
|
+
,overflowX:"auto"}}>
|
|
22
49
|
<ReactSpeedometer
|
|
50
|
+
|
|
23
51
|
forceRender={true}
|
|
24
52
|
segmentColors={value?.style?.segmentColors}
|
|
25
53
|
maxValue={value?.main?.data?.maxValue || 500}
|
|
26
|
-
width={
|
|
54
|
+
width={window.innerWidth>750?450:280
|
|
55
|
+
// value?.style?.width || 350
|
|
56
|
+
}
|
|
27
57
|
needleHeightRatio={value?.style?.needleHeightRatio || 0.7}
|
|
28
|
-
currentValueText={value?.main?.currentValueText}
|
|
29
|
-
customSegmentLabels={value?.main?.
|
|
58
|
+
currentValueText={value?.main?.currentValueText||"Your Score"}
|
|
59
|
+
customSegmentLabels={value?.main?.customSegmentLabels}
|
|
30
60
|
ringWidth={value?.style?.ringWidth || 37}
|
|
31
61
|
needleTransitionDuration={
|
|
32
62
|
value?.style?.needleTransitionDuration || 5333
|
|
33
63
|
}
|
|
34
64
|
// fluidWidth={true}
|
|
35
|
-
height={value?.style?.height}
|
|
65
|
+
// height={window.innerWidth>750?(value?.style?.height||400):300}
|
|
36
66
|
needleTransition={value?.style?.needleTransition || "easeElastic"}
|
|
37
67
|
value={value?.main?.data?.value || 473}
|
|
38
68
|
needleColor={value?.style?.needleColor || "red"}
|
|
39
69
|
minValue={value?.main?.data?.minValue || 0}
|
|
40
70
|
startColor={value?.style?.startColor || "red"}
|
|
41
|
-
segments={value?.main?.segments || 5}
|
|
71
|
+
segments={+value?.main?.segments || 5}
|
|
42
72
|
endColor={value?.style?.endColor || "green"}
|
|
43
73
|
textColor={value?.style?.textColor || "black"}
|
|
44
74
|
/>
|
|
@@ -6,6 +6,7 @@ const Product1 = [
|
|
|
6
6
|
{ x: "f", y: 100 },
|
|
7
7
|
{ x: "g", y: 50 },
|
|
8
8
|
];
|
|
9
|
+
|
|
9
10
|
export const finalDataProvider = (type: string, value: any,theme?:any) => {
|
|
10
11
|
switch (type) {
|
|
11
12
|
case "BarGraph":
|
|
@@ -84,6 +85,7 @@ export const finalDataProvider = (type: string, value: any,theme?:any) => {
|
|
|
84
85
|
}
|
|
85
86
|
};
|
|
86
87
|
case "PieGraph":
|
|
88
|
+
|
|
87
89
|
return {
|
|
88
90
|
main: {
|
|
89
91
|
data: value?.main?.data || [{ branch: "Kotak", value: 500 }, { branch: "SBI", value: 700 }, { branch: "HDFC", value: 900 }],
|
|
@@ -160,7 +162,7 @@ export const finalDataProvider = (type: string, value: any,theme?:any) => {
|
|
|
160
162
|
},
|
|
161
163
|
},
|
|
162
164
|
pieStyle: {
|
|
163
|
-
colorRange: ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)"],
|
|
165
|
+
colorRange: ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)","#3f84b5","#b5993f","#fc6f6f"],
|
|
164
166
|
outerRadius: 120,
|
|
165
167
|
innerRadius: 60,
|
|
166
168
|
cornerRadius: 2,
|
|
@@ -181,7 +183,7 @@ export const finalDataProvider = (type: string, value: any,theme?:any) => {
|
|
|
181
183
|
numHidden: false,
|
|
182
184
|
tooltipDataKey: ["MAMA New Project", "Second", "Third"],
|
|
183
185
|
axisLeft: true,
|
|
184
|
-
|
|
186
|
+
legendAvailable:true,
|
|
185
187
|
axisBottom: true,
|
|
186
188
|
hideLeftAxisLine: false,
|
|
187
189
|
hideBottomAxisLine: false,
|
|
@@ -191,14 +193,14 @@ export const finalDataProvider = (type: string, value: any,theme?:any) => {
|
|
|
191
193
|
legendTitle: "Our Assests",
|
|
192
194
|
direction: "row",
|
|
193
195
|
align: "right",
|
|
194
|
-
colorRectWidth: 20,
|
|
196
|
+
// colorRectWidth: 20,
|
|
195
197
|
...value?.main?.legend
|
|
196
198
|
},
|
|
197
199
|
},
|
|
198
200
|
style: {
|
|
199
201
|
containerStyle: {
|
|
200
202
|
background:theme.palette.secondary.main,
|
|
201
|
-
width: "
|
|
203
|
+
width: "100%",
|
|
202
204
|
height: "300",
|
|
203
205
|
borderRadius: "20px",
|
|
204
206
|
padding: "10px 0 2px 0",
|
|
@@ -215,6 +217,28 @@ export const finalDataProvider = (type: string, value: any,theme?:any) => {
|
|
|
215
217
|
color:theme.palette.text.primary,
|
|
216
218
|
...value?.style?.headerStyle
|
|
217
219
|
},
|
|
220
|
+
legendStyle: {
|
|
221
|
+
legend: {
|
|
222
|
+
lineHeight: "0.9em",
|
|
223
|
+
color: theme.palette.text.primary,
|
|
224
|
+
fontSize: "10px",
|
|
225
|
+
|
|
226
|
+
fontFamily: "arial",
|
|
227
|
+
padding: "10px 10px",
|
|
228
|
+
float: "left",
|
|
229
|
+
border: "1px solid rgba(255, 255, 255, 0.3)",
|
|
230
|
+
borderRadius: " 8px",
|
|
231
|
+
margin: "5px 5px",
|
|
232
|
+
...value?.style?.legendStyle?.legend,
|
|
233
|
+
},
|
|
234
|
+
legendTitle: {
|
|
235
|
+
fontWeight: 500,
|
|
236
|
+
marginBottom: "5px",
|
|
237
|
+
fontFamily: "roboto",
|
|
238
|
+
fontSize: "10px",
|
|
239
|
+
...value?.style?.legendStyle?.legendTitle,
|
|
240
|
+
},
|
|
241
|
+
},
|
|
218
242
|
labelStyle: {
|
|
219
243
|
labelColor:theme.palette.text.primary,
|
|
220
244
|
bottomLabelOffset: 20,
|