sag_components 1.0.26 → 1.0.28
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/stories/Benchmark.stories.js +122 -0
- package/dist/stories/Benchmark.style.js +50 -0
- package/dist/stories/TotalDoughnutChart.stories.js +2 -2
- package/dist/stories/TotalDoughnutChart.style.js +5 -5
- package/dist/stories/components/Benchmark.js +80 -0
- package/dist/stories/components/TotalDoughnutChart.js +4 -4
- package/package.json +1 -1
- package/src/stories/Benchmark.stories.jsx +111 -0
- package/src/stories/Benchmark.style.js +82 -0
- package/src/stories/TotalDoughnutChart.stories.js +2 -2
- package/src/stories/TotalDoughnutChart.style.js +8 -8
- package/src/stories/components/Benchmark.jsx +75 -0
- package/src/stories/components/TotalDoughnutChart.jsx +4 -4
- package/storybook-static/256.47510a7e.iframe.bundle.js +0 -2
- package/storybook-static/256.47510a7e.iframe.bundle.js.LICENSE.txt +0 -9
- package/storybook-static/333.c94a363a.iframe.bundle.js +0 -1
- package/storybook-static/383.2aff9f43.iframe.bundle.js +0 -1
- package/storybook-static/385.7e265f0d.iframe.bundle.js +0 -402
- package/storybook-static/385.7e265f0d.iframe.bundle.js.LICENSE.txt +0 -53
- package/storybook-static/385.7e265f0d.iframe.bundle.js.map +0 -1
- package/storybook-static/433.06d7c436.iframe.bundle.js +0 -1
- package/storybook-static/446.dd9a0d77.iframe.bundle.js +0 -1
- package/storybook-static/463.60fe9b8e.iframe.bundle.js +0 -44
- package/storybook-static/463.60fe9b8e.iframe.bundle.js.map +0 -1
- package/storybook-static/537.29807a20.iframe.bundle.js +0 -121
- package/storybook-static/537.29807a20.iframe.bundle.js.map +0 -1
- package/storybook-static/55.d0744d52.iframe.bundle.js +0 -76
- package/storybook-static/55.d0744d52.iframe.bundle.js.LICENSE.txt +0 -26
- package/storybook-static/55.d0744d52.iframe.bundle.js.map +0 -1
- package/storybook-static/58.676f9d84.iframe.bundle.js +0 -1
- package/storybook-static/661.14a42934.iframe.bundle.js +0 -1
- package/storybook-static/720.f79ea110.iframe.bundle.js +0 -1
- package/storybook-static/923.47c94418.iframe.bundle.js +0 -1
- package/storybook-static/ButtonText-stories.ac096281.iframe.bundle.js +0 -1
- package/storybook-static/Dropdown-stories.825dde1a.iframe.bundle.js +0 -8
- package/storybook-static/Dropdown-stories.825dde1a.iframe.bundle.js.map +0 -1
- package/storybook-static/Introduction-mdx.f8264230.iframe.bundle.js +0 -2
- package/storybook-static/Introduction-mdx.f8264230.iframe.bundle.js.LICENSE.txt +0 -9
- package/storybook-static/OneColumnContainer-stories.65049871.iframe.bundle.js +0 -36
- package/storybook-static/OneColumnContainer-stories.65049871.iframe.bundle.js.LICENSE.txt +0 -18
- package/storybook-static/OneColumnContainer-stories.65049871.iframe.bundle.js.map +0 -1
- package/storybook-static/favicon.svg +0 -7
- package/storybook-static/iframe.html +0 -355
- package/storybook-static/index.html +0 -138
- package/storybook-static/index.json +0 -1
- package/storybook-static/main.612c6447.iframe.bundle.js +0 -1
- package/storybook-static/project.json +0 -1
- package/storybook-static/runtime~main.55585f00.iframe.bundle.js +0 -1
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +0 -4
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js.map +0 -7
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js +0 -13
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js.map +0 -7
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +0 -117
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +0 -18
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.map +0 -7
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js +0 -4
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js.map +0 -7
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js +0 -4
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js.map +0 -7
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js +0 -4
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js.map +0 -7
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js +0 -4
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js.map +0 -7
- package/storybook-static/sb-addons/interactions-8/manager-bundle.js +0 -31
- package/storybook-static/sb-addons/interactions-8/manager-bundle.js.LEGAL.txt +0 -18
- package/storybook-static/sb-addons/interactions-8/manager-bundle.js.map +0 -7
- package/storybook-static/sb-addons/links-0/manager-bundle.js +0 -4
- package/storybook-static/sb-addons/links-0/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/links-0/manager-bundle.js.map +0 -7
- package/storybook-static/sb-addons/storybook-10/manager-bundle.js +0 -4
- package/storybook-static/sb-addons/storybook-10/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/storybook-10/manager-bundle.js.map +0 -7
- package/storybook-static/sb-addons/storysource-9/manager-bundle.js +0 -23
- package/storybook-static/sb-addons/storysource-9/manager-bundle.js.LEGAL.txt +0 -14
- package/storybook-static/sb-addons/storysource-9/manager-bundle.js.map +0 -7
- package/storybook-static/sb-common-assets/fonts.css +0 -31
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/GlobalScrollAreaStyles-XIHNDKUY-F4JIPIHL.js +0 -1
- package/storybook-static/sb-manager/OverlayScrollbars-VAV6LJAB-K3TMPSMY.js +0 -6
- package/storybook-static/sb-manager/WithTooltip-FBT32F6Q-7QJ37TCY.js +0 -1
- package/storybook-static/sb-manager/chunk-3FAXWWKG.js +0 -15
- package/storybook-static/sb-manager/chunk-54KM6K5Z.js +0 -7
- package/storybook-static/sb-manager/chunk-AS2AMEUR.js +0 -1
- package/storybook-static/sb-manager/chunk-F3MVQVF6.js +0 -207
- package/storybook-static/sb-manager/chunk-FENICTK6.js +0 -1
- package/storybook-static/sb-manager/chunk-GQDEE62S.js +0 -406
- package/storybook-static/sb-manager/chunk-PUVLCKJJ.js +0 -140
- package/storybook-static/sb-manager/chunk-QPL63VNK.js +0 -1
- package/storybook-static/sb-manager/formatter-S4K5WUZV-4LPR5OBX.js +0 -156
- package/storybook-static/sb-manager/globals.js +0 -1
- package/storybook-static/sb-manager/index.js +0 -1
- package/storybook-static/sb-manager/runtime.js +0 -1
- package/storybook-static/sb-manager/syntaxhighlighter-QTQ2UBB4-F5YUFYAB.js +0 -1
- package/storybook-static/sb-preview/globals.js +0 -1
- package/storybook-static/sb-preview/runtime.js +0 -105
- package/storybook-static/static/media/code-brackets.2e1112d7.svg +0 -1
- package/storybook-static/static/media/colors.a4bd0486.svg +0 -1
- package/storybook-static/static/media/comments.a3859089.svg +0 -1
- package/storybook-static/static/media/direction.b770f9af.svg +0 -1
- package/storybook-static/static/media/flow.edad2ac1.svg +0 -1
- package/storybook-static/static/media/plugin.d494b228.svg +0 -1
- package/storybook-static/static/media/repo.6d496322.svg +0 -1
- package/storybook-static/static/media/stackalt.dba9fbb3.svg +0 -1
- package/storybook-static/stories.json +0 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.LessAvarage = exports.GreaterAvarage = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Benchmark = require("./components/Benchmark");
|
|
10
|
+
var _default = {
|
|
11
|
+
title: "SAG BI/Benchmark",
|
|
12
|
+
component: _Benchmark.Benchmark,
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
argTypes: {
|
|
15
|
+
currentValue: {
|
|
16
|
+
name: "currentValue",
|
|
17
|
+
control: {
|
|
18
|
+
type: "number",
|
|
19
|
+
min: 0,
|
|
20
|
+
max: 100000000000000
|
|
21
|
+
},
|
|
22
|
+
description: "curent value (<=100%) "
|
|
23
|
+
},
|
|
24
|
+
totalValue: {
|
|
25
|
+
name: "totalValue",
|
|
26
|
+
control: {
|
|
27
|
+
type: "number",
|
|
28
|
+
min: 0,
|
|
29
|
+
max: 100000000000000
|
|
30
|
+
},
|
|
31
|
+
description: "total value (100%) "
|
|
32
|
+
},
|
|
33
|
+
width: {
|
|
34
|
+
name: "width",
|
|
35
|
+
control: {
|
|
36
|
+
type: "number",
|
|
37
|
+
min: 0,
|
|
38
|
+
max: 600
|
|
39
|
+
},
|
|
40
|
+
description: "width of the control (in px)"
|
|
41
|
+
},
|
|
42
|
+
height: {
|
|
43
|
+
name: "height",
|
|
44
|
+
control: {
|
|
45
|
+
type: "number",
|
|
46
|
+
min: 0,
|
|
47
|
+
max: 600
|
|
48
|
+
},
|
|
49
|
+
description: "height of the control (in px)"
|
|
50
|
+
},
|
|
51
|
+
color: {
|
|
52
|
+
name: "color",
|
|
53
|
+
description: "Sets the color of current value when it is greater then 50% of total value",
|
|
54
|
+
control: {
|
|
55
|
+
type: "color",
|
|
56
|
+
presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
linearGradientColor: {
|
|
60
|
+
name: "linearGradientColor",
|
|
61
|
+
description: "Sets the linear-Gradient color of current value when it is greater then 50% of total value",
|
|
62
|
+
control: {
|
|
63
|
+
type: "color",
|
|
64
|
+
presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
underAvarageColor: {
|
|
68
|
+
name: "underAvarageColor",
|
|
69
|
+
description: "Sets the color of current value when it is under 50% of total value",
|
|
70
|
+
control: {
|
|
71
|
+
type: "color",
|
|
72
|
+
presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
linearGradientUnderAvarageColor: {
|
|
76
|
+
name: "linearGradientUnderAvarageColor",
|
|
77
|
+
description: "Sets the linear-Gradient color of current value when it is under 50% of total value",
|
|
78
|
+
control: {
|
|
79
|
+
type: "color",
|
|
80
|
+
presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
backgroundColor: {
|
|
84
|
+
name: "backgroundColor",
|
|
85
|
+
description: "Sets the background color of the control",
|
|
86
|
+
control: {
|
|
87
|
+
type: "color",
|
|
88
|
+
presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
exports.default = _default;
|
|
94
|
+
var Template = function Template(args) {
|
|
95
|
+
return /*#__PURE__*/_react.default.createElement(_Benchmark.Benchmark, args);
|
|
96
|
+
};
|
|
97
|
+
var GreaterAvarage = Template.bind({});
|
|
98
|
+
exports.GreaterAvarage = GreaterAvarage;
|
|
99
|
+
GreaterAvarage.args = {
|
|
100
|
+
totalValue: 100000,
|
|
101
|
+
currentValue: 60000,
|
|
102
|
+
width: 100,
|
|
103
|
+
height: 12,
|
|
104
|
+
color: "#79DB95",
|
|
105
|
+
linearGradientColor: "#C3EFD0",
|
|
106
|
+
underAvarageColor: "#FD5959",
|
|
107
|
+
linearGradientUnderAvarageColor: "#FDB1B1",
|
|
108
|
+
backgroundColor: "#F2F2F2"
|
|
109
|
+
};
|
|
110
|
+
var LessAvarage = Template.bind({});
|
|
111
|
+
exports.LessAvarage = LessAvarage;
|
|
112
|
+
LessAvarage.args = {
|
|
113
|
+
totalValue: 1000,
|
|
114
|
+
currentValue: 400,
|
|
115
|
+
width: 100,
|
|
116
|
+
height: 12,
|
|
117
|
+
color: "#79DB95",
|
|
118
|
+
linearGradientColor: "#C3EFD0",
|
|
119
|
+
underAvarageColor: "#FD5959",
|
|
120
|
+
linearGradientUnderAvarageColor: "#FDB1B1",
|
|
121
|
+
backgroundColor: "#F2F2F2"
|
|
122
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.CurrentValueRectangle = exports.ControlsContainer = exports.Controls = exports.BackgroundValueRectangle = exports.AvarageDelimiter = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
11
|
+
var ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n position: relative;\n margin: 0px 0 0px;\n font-family: \"Lato\", sans-serif;\n font-style: normal;\n width: ", ";\n height: ", ";\n //box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);\n border-radius: 100px;\n //border: 1px solid red;\n"])), function (props) {
|
|
12
|
+
return props.width.toString().concat("", "px");
|
|
13
|
+
}, function (props) {
|
|
14
|
+
return props.height.toString().concat("", "px");
|
|
15
|
+
});
|
|
16
|
+
exports.ControlsContainer = ControlsContainer;
|
|
17
|
+
var Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n border-radius: 100px;\n width: ", ";\n height: ", ";\n //background: #ffffff;\n //border: 1px solid blue;\n"])), function (props) {
|
|
18
|
+
return props.width.toString().concat("", "px");
|
|
19
|
+
}, function (props) {
|
|
20
|
+
return props.height.toString().concat("", "px");
|
|
21
|
+
});
|
|
22
|
+
exports.Controls = Controls;
|
|
23
|
+
var BackgroundValueRectangle = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: ", ";\n height: ", ";\n top: 0px;\n left: 0px;\n border-radius: 100px;\n background: ", ";\n //border: 1px solid orange;\n"])), function (props) {
|
|
24
|
+
return props.width.toString().concat("", "px");
|
|
25
|
+
}, function (props) {
|
|
26
|
+
return props.height.toString().concat("", "px");
|
|
27
|
+
}, function (props) {
|
|
28
|
+
return props.color;
|
|
29
|
+
});
|
|
30
|
+
exports.BackgroundValueRectangle = BackgroundValueRectangle;
|
|
31
|
+
var CurrentValueRectangle = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: ", ";\n height: ", ";\n top: 0px;\n left: 0px;\n border-radius: 100px;\n background: linear-gradient(\n 90deg,\n ", " 0%,\n ", " 100%\n );\n //border: 1px solid green;\n"])), function (props) {
|
|
32
|
+
return props.width.toString().concat("", "px");
|
|
33
|
+
}, function (props) {
|
|
34
|
+
return props.height.toString().concat("", "px");
|
|
35
|
+
}, function (props) {
|
|
36
|
+
return props.linearGradientColor;
|
|
37
|
+
}, function (props) {
|
|
38
|
+
return props.color;
|
|
39
|
+
});
|
|
40
|
+
exports.CurrentValueRectangle = CurrentValueRectangle;
|
|
41
|
+
var AvarageDelimiter = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n height: ", ";\n width: ", ";\n top: ", ";\n left: ", ";\n border: 1px solid #212121;\n"])), function (props) {
|
|
42
|
+
return props.height.toString().concat("", "px");
|
|
43
|
+
}, function (props) {
|
|
44
|
+
return props.width.toString().concat("", "px");
|
|
45
|
+
}, function (props) {
|
|
46
|
+
return props.top.toString().concat("", "px");
|
|
47
|
+
}, function (props) {
|
|
48
|
+
return props.left.toString().concat("", "px");
|
|
49
|
+
});
|
|
50
|
+
exports.AvarageDelimiter = AvarageDelimiter;
|
|
@@ -21,7 +21,7 @@ var arrLegendDat3rows = [{
|
|
|
21
21
|
value: 30000,
|
|
22
22
|
color: "#85A1D2"
|
|
23
23
|
}, {
|
|
24
|
-
name: "
|
|
24
|
+
name: "Existing Redeemers",
|
|
25
25
|
value: 6500,
|
|
26
26
|
color: "#9AE6FF"
|
|
27
27
|
}, {
|
|
@@ -32,7 +32,7 @@ var arrLegendDat3rows = [{
|
|
|
32
32
|
// { name: "My test 2", value: 35000, color: "#79DB95"},
|
|
33
33
|
];
|
|
34
34
|
var _default = {
|
|
35
|
-
title: "SAG/TotalDoughnutChart",
|
|
35
|
+
title: "SAG BI/TotalDoughnutChart",
|
|
36
36
|
component: _TotalDoughnutChart.TotalDoughnutChart,
|
|
37
37
|
tags: ["autodocs"],
|
|
38
38
|
argTypes: {
|
|
@@ -28,7 +28,7 @@ var CurrencySign = _styledComponents.default.div(_templateObject4 || (_templateO
|
|
|
28
28
|
exports.CurrencySign = CurrencySign;
|
|
29
29
|
var FormattedValue = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 200px;\n height: 48px;\n left: 57px;\n top: 115px;\n font-weight: 500;\n font-size: 40px;\n line-height: 48px;\n //border: 1px solid red;\n"])));
|
|
30
30
|
exports.FormattedValue = FormattedValue;
|
|
31
|
-
var DoughnutChart = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width:
|
|
31
|
+
var DoughnutChart = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 90px;\n height: 90px;\n left: ", ";\n top: ", "; \n //border: 1px solid red;\n"])), function (props) {
|
|
32
32
|
return props.left.toString().concat("", "px"); //10px
|
|
33
33
|
}, function (props) {
|
|
34
34
|
return props.top.toString().concat("", "px"); //top: 221px;
|
|
@@ -40,13 +40,13 @@ var LegendControls = _styledComponents.default.div(_templateObject7 || (_templat
|
|
|
40
40
|
return props.top.toString().concat("", "px"); //top: 221px;
|
|
41
41
|
});
|
|
42
42
|
exports.LegendControls = LegendControls;
|
|
43
|
-
var LegendColorRectangle = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 16px;\n height: 16px;\n left:
|
|
43
|
+
var LegendColorRectangle = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 16px;\n height: 16px;\n left: 8px;\n top: 14px;\n background: ", ";\n"])), function (props) {
|
|
44
44
|
return props.color;
|
|
45
45
|
});
|
|
46
46
|
exports.LegendColorRectangle = LegendColorRectangle;
|
|
47
|
-
var LegendTitle = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width:
|
|
47
|
+
var LegendTitle = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 150px;\n height: 18px;\n left: 30px;\n top: 1px;\n font-weight: 400;\n font-size: 14px;\n line-height: 17px;\n //border: 1px solid red;\n"])));
|
|
48
48
|
exports.LegendTitle = LegendTitle;
|
|
49
|
-
var LegendCurrencySign = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 11px;\n height: 19px;\n left:
|
|
49
|
+
var LegendCurrencySign = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 11px;\n height: 19px;\n left: 30px;\n top: 21px;\n font-weight: 600;\n font-size: 16px;\n line-height: 19px;\n //border: 1px solid red;\n"])));
|
|
50
50
|
exports.LegendCurrencySign = LegendCurrencySign;
|
|
51
|
-
var LegendFormattedValue = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width:
|
|
51
|
+
var LegendFormattedValue = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 120px;\n height: 19px;\n left: 40px;\n top: 21px;\n font-weight: 600;\n font-size: 16px;\n line-height: 19px;\n //border: 1px solid red;\n"])));
|
|
52
52
|
exports.LegendFormattedValue = LegendFormattedValue;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.Benchmark = void 0;
|
|
8
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _BenchmarkStyle = require("../Benchmark.style.js");
|
|
11
|
+
var _excluded = ["totalValue", "currentValue", "width", "height", "color", "linearGradientColor", "underAvarageColor", "linearGradientUnderAvarageColor", "backgroundColor"];
|
|
12
|
+
/*Benchmark*/
|
|
13
|
+
var Benchmark = function Benchmark(_ref) {
|
|
14
|
+
var _ref$totalValue = _ref.totalValue,
|
|
15
|
+
totalValue = _ref$totalValue === void 0 ? 100 : _ref$totalValue,
|
|
16
|
+
_ref$currentValue = _ref.currentValue,
|
|
17
|
+
currentValue = _ref$currentValue === void 0 ? 60 : _ref$currentValue,
|
|
18
|
+
_ref$width = _ref.width,
|
|
19
|
+
width = _ref$width === void 0 ? 100 : _ref$width,
|
|
20
|
+
_ref$height = _ref.height,
|
|
21
|
+
height = _ref$height === void 0 ? 12 : _ref$height,
|
|
22
|
+
_ref$color = _ref.color,
|
|
23
|
+
color = _ref$color === void 0 ? "#79DB95" : _ref$color,
|
|
24
|
+
_ref$linearGradientCo = _ref.linearGradientColor,
|
|
25
|
+
linearGradientColor = _ref$linearGradientCo === void 0 ? "#C3EFD0" : _ref$linearGradientCo,
|
|
26
|
+
_ref$underAvarageColo = _ref.underAvarageColor,
|
|
27
|
+
underAvarageColor = _ref$underAvarageColo === void 0 ? "#FD5959" : _ref$underAvarageColo,
|
|
28
|
+
_ref$linearGradientUn = _ref.linearGradientUnderAvarageColor,
|
|
29
|
+
linearGradientUnderAvarageColor = _ref$linearGradientUn === void 0 ? "#FDB1B1" : _ref$linearGradientUn,
|
|
30
|
+
_ref$backgroundColor = _ref.backgroundColor,
|
|
31
|
+
backgroundColor = _ref$backgroundColor === void 0 ? "#F2F2F2" : _ref$backgroundColor,
|
|
32
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
33
|
+
var getCurrentValueRectangleWidth = function getCurrentValueRectangleWidth() {
|
|
34
|
+
if (!totalValue) return 0;
|
|
35
|
+
if (currentValue > totalValue) return width;
|
|
36
|
+
return currentValue / totalValue * width;
|
|
37
|
+
};
|
|
38
|
+
var getUnderAvarageColor = function getUnderAvarageColor() {
|
|
39
|
+
if (!totalValue) return backgroundColor;
|
|
40
|
+
if (currentValue > totalValue) return color;
|
|
41
|
+
if (currentValue / totalValue <= 0.5) {
|
|
42
|
+
return underAvarageColor;
|
|
43
|
+
} else {
|
|
44
|
+
return color;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var getUnderAvaragelinearGradientColor = function getUnderAvaragelinearGradientColor() {
|
|
48
|
+
if (!totalValue) return backgroundColor;
|
|
49
|
+
if (currentValue > totalValue) return linearGradientColor;
|
|
50
|
+
if (currentValue / totalValue <= 0.5) {
|
|
51
|
+
return linearGradientUnderAvarageColor;
|
|
52
|
+
} else {
|
|
53
|
+
return linearGradientColor;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement(_BenchmarkStyle.ControlsContainer, {
|
|
57
|
+
height: height,
|
|
58
|
+
width: width
|
|
59
|
+
}, /*#__PURE__*/_react.default.createElement(_BenchmarkStyle.Controls, {
|
|
60
|
+
height: height,
|
|
61
|
+
width: width
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement(_BenchmarkStyle.BackgroundValueRectangle, {
|
|
63
|
+
height: height,
|
|
64
|
+
width: width,
|
|
65
|
+
color: backgroundColor
|
|
66
|
+
}), /*#__PURE__*/_react.default.createElement(_BenchmarkStyle.CurrentValueRectangle, {
|
|
67
|
+
height: height,
|
|
68
|
+
width: getCurrentValueRectangleWidth(),
|
|
69
|
+
color: getUnderAvarageColor(),
|
|
70
|
+
linearGradientColor: getUnderAvaragelinearGradientColor()
|
|
71
|
+
}), /*#__PURE__*/_react.default.createElement(_BenchmarkStyle.AvarageDelimiter, {
|
|
72
|
+
height: height + 4,
|
|
73
|
+
width: 0,
|
|
74
|
+
top: -2,
|
|
75
|
+
left: width / 2
|
|
76
|
+
})));
|
|
77
|
+
};
|
|
78
|
+
exports.Benchmark = Benchmark;
|
|
79
|
+
var _default = Benchmark;
|
|
80
|
+
exports.default = _default;
|
|
@@ -149,13 +149,13 @@ var TotalDoughnutChart = function TotalDoughnutChart(_ref) {
|
|
|
149
149
|
left: getDoughnutChartLeft(),
|
|
150
150
|
top: getDoughnutChartTop()
|
|
151
151
|
}, /*#__PURE__*/_react.default.createElement(_recharts.PieChart, {
|
|
152
|
-
width:
|
|
153
|
-
height:
|
|
152
|
+
width: 90,
|
|
153
|
+
height: 90,
|
|
154
154
|
onMouseEnter: onPieEnterHandler
|
|
155
155
|
}, /*#__PURE__*/_react.default.createElement(_recharts.Pie, {
|
|
156
156
|
data: legendData,
|
|
157
|
-
innerRadius:
|
|
158
|
-
outerRadius:
|
|
157
|
+
innerRadius: 30,
|
|
158
|
+
outerRadius: 45,
|
|
159
159
|
fill: "#8884d8",
|
|
160
160
|
dataKey: "value"
|
|
161
161
|
}, legendData.map(function (row, index) {
|
package/package.json
CHANGED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Benchmark } from "./components/Benchmark";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "SAG BI/Benchmark",
|
|
6
|
+
component: Benchmark,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
|
|
9
|
+
argTypes: {
|
|
10
|
+
currentValue: {
|
|
11
|
+
name: "currentValue",
|
|
12
|
+
control: { type: "number", min: 0, max: 100000000000000 },
|
|
13
|
+
description: "curent value (<=100%) ",
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
totalValue: {
|
|
17
|
+
name: "totalValue",
|
|
18
|
+
control: { type: "number", min: 0, max: 100000000000000 },
|
|
19
|
+
description: "total value (100%) ",
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
width: {
|
|
23
|
+
name: "width",
|
|
24
|
+
control: { type: "number", min: 0, max: 600 },
|
|
25
|
+
description: "width of the control (in px)",
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
height: {
|
|
29
|
+
name: "height",
|
|
30
|
+
control: { type: "number", min: 0, max: 600 },
|
|
31
|
+
description: "height of the control (in px)",
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
color: {
|
|
35
|
+
name: "color",
|
|
36
|
+
description:
|
|
37
|
+
"Sets the color of current value when it is greater then 50% of total value",
|
|
38
|
+
control: {
|
|
39
|
+
type: "color",
|
|
40
|
+
presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
linearGradientColor: {
|
|
45
|
+
name: "linearGradientColor",
|
|
46
|
+
description:
|
|
47
|
+
"Sets the linear-Gradient color of current value when it is greater then 50% of total value",
|
|
48
|
+
control: {
|
|
49
|
+
type: "color",
|
|
50
|
+
presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
underAvarageColor: {
|
|
55
|
+
name: "underAvarageColor",
|
|
56
|
+
description:
|
|
57
|
+
"Sets the color of current value when it is under 50% of total value",
|
|
58
|
+
control: {
|
|
59
|
+
type: "color",
|
|
60
|
+
presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
linearGradientUnderAvarageColor: {
|
|
65
|
+
name: "linearGradientUnderAvarageColor",
|
|
66
|
+
description:
|
|
67
|
+
"Sets the linear-Gradient color of current value when it is under 50% of total value",
|
|
68
|
+
control: {
|
|
69
|
+
type: "color",
|
|
70
|
+
presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"],
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
backgroundColor: {
|
|
75
|
+
name: "backgroundColor",
|
|
76
|
+
description: "Sets the background color of the control",
|
|
77
|
+
control: {
|
|
78
|
+
type: "color",
|
|
79
|
+
presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const Template = (args) => <Benchmark {...args} />;
|
|
86
|
+
|
|
87
|
+
export const GreaterAvarage = Template.bind({});
|
|
88
|
+
GreaterAvarage.args = {
|
|
89
|
+
totalValue: 100000,
|
|
90
|
+
currentValue: 60000,
|
|
91
|
+
width: 100,
|
|
92
|
+
height: 12,
|
|
93
|
+
color: "#79DB95",
|
|
94
|
+
linearGradientColor: "#C3EFD0",
|
|
95
|
+
underAvarageColor: "#FD5959",
|
|
96
|
+
linearGradientUnderAvarageColor: "#FDB1B1",
|
|
97
|
+
backgroundColor: "#F2F2F2",
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const LessAvarage = Template.bind({});
|
|
101
|
+
LessAvarage.args = {
|
|
102
|
+
totalValue: 1000,
|
|
103
|
+
currentValue: 400,
|
|
104
|
+
width: 100,
|
|
105
|
+
height: 12,
|
|
106
|
+
color: "#79DB95",
|
|
107
|
+
linearGradientColor: "#C3EFD0",
|
|
108
|
+
underAvarageColor: "#FD5959",
|
|
109
|
+
linearGradientUnderAvarageColor: "#FDB1B1",
|
|
110
|
+
backgroundColor: "#F2F2F2",
|
|
111
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const ControlsContainer = styled.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
position: relative;
|
|
6
|
+
margin: 0px 0 0px;
|
|
7
|
+
font-family: "Lato", sans-serif;
|
|
8
|
+
font-style: normal;
|
|
9
|
+
width: ${(props) => {
|
|
10
|
+
return props.width.toString().concat("", "px");
|
|
11
|
+
}};
|
|
12
|
+
height: ${(props) => {
|
|
13
|
+
return props.height.toString().concat("", "px");
|
|
14
|
+
}};
|
|
15
|
+
//box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
|
|
16
|
+
border-radius: 100px;
|
|
17
|
+
//border: 1px solid red;
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export const Controls = styled.div`
|
|
21
|
+
position: relative;
|
|
22
|
+
border-radius: 100px;
|
|
23
|
+
width: ${(props) => {
|
|
24
|
+
return props.width.toString().concat("", "px");
|
|
25
|
+
}};
|
|
26
|
+
height: ${(props) => {
|
|
27
|
+
return props.height.toString().concat("", "px");
|
|
28
|
+
}};
|
|
29
|
+
//background: #ffffff;
|
|
30
|
+
//border: 1px solid blue;
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
export const BackgroundValueRectangle = styled.div`
|
|
34
|
+
position: absolute;
|
|
35
|
+
width: ${(props) => {
|
|
36
|
+
return props.width.toString().concat("", "px");
|
|
37
|
+
}};
|
|
38
|
+
height: ${(props) => {
|
|
39
|
+
return props.height.toString().concat("", "px");
|
|
40
|
+
}};
|
|
41
|
+
top: 0px;
|
|
42
|
+
left: 0px;
|
|
43
|
+
border-radius: 100px;
|
|
44
|
+
background: ${(props) => props.color};
|
|
45
|
+
//border: 1px solid orange;
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
export const CurrentValueRectangle = styled.div`
|
|
49
|
+
position: absolute;
|
|
50
|
+
width: ${(props) => {
|
|
51
|
+
return props.width.toString().concat("", "px");
|
|
52
|
+
}};
|
|
53
|
+
height: ${(props) => {
|
|
54
|
+
return props.height.toString().concat("", "px");
|
|
55
|
+
}};
|
|
56
|
+
top: 0px;
|
|
57
|
+
left: 0px;
|
|
58
|
+
border-radius: 100px;
|
|
59
|
+
background: linear-gradient(
|
|
60
|
+
90deg,
|
|
61
|
+
${(props) => props.linearGradientColor} 0%,
|
|
62
|
+
${(props) => props.color} 100%
|
|
63
|
+
);
|
|
64
|
+
//border: 1px solid green;
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
export const AvarageDelimiter = styled.div`
|
|
68
|
+
position: absolute;
|
|
69
|
+
height: ${(props) => {
|
|
70
|
+
return props.height.toString().concat("", "px");
|
|
71
|
+
}};
|
|
72
|
+
width: ${(props) => {
|
|
73
|
+
return props.width.toString().concat("", "px");
|
|
74
|
+
}};
|
|
75
|
+
top: ${(props) => {
|
|
76
|
+
return props.top.toString().concat("", "px");
|
|
77
|
+
}};
|
|
78
|
+
left: ${(props) => {
|
|
79
|
+
return props.left.toString().concat("", "px");
|
|
80
|
+
}};
|
|
81
|
+
border: 1px solid #212121;
|
|
82
|
+
`;
|
|
@@ -8,14 +8,14 @@ const arrLegendData = [
|
|
|
8
8
|
|
|
9
9
|
const arrLegendDat3rows = [
|
|
10
10
|
{ name: "Package Cost", value: 30000, color: "#85A1D2"},
|
|
11
|
-
{ name: "
|
|
11
|
+
{ name: "Existing Redeemers", value: 6500,color: "#9AE6FF"},
|
|
12
12
|
{ name: "Others", value: 20000, color: "#FD5959"},
|
|
13
13
|
// { name: "My test 2", value: 35000, color: "#79DB95"},
|
|
14
14
|
];
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
export default {
|
|
18
|
-
title: "SAG/TotalDoughnutChart",
|
|
18
|
+
title: "SAG BI/TotalDoughnutChart",
|
|
19
19
|
component: TotalDoughnutChart,
|
|
20
20
|
tags: ["autodocs"],
|
|
21
21
|
|
|
@@ -71,8 +71,8 @@ export const FormattedValue = styled.div`
|
|
|
71
71
|
|
|
72
72
|
export const DoughnutChart = styled.div`
|
|
73
73
|
position: absolute;
|
|
74
|
-
width:
|
|
75
|
-
height:
|
|
74
|
+
width: 90px;
|
|
75
|
+
height: 90px;
|
|
76
76
|
left: ${(props) => {
|
|
77
77
|
return props.left.toString().concat("", "px"); //10px
|
|
78
78
|
}};
|
|
@@ -101,16 +101,16 @@ export const LegendColorRectangle = styled.div`
|
|
|
101
101
|
position: absolute;
|
|
102
102
|
width: 16px;
|
|
103
103
|
height: 16px;
|
|
104
|
-
left:
|
|
104
|
+
left: 8px;
|
|
105
105
|
top: 14px;
|
|
106
106
|
background: ${(props) => props.color};
|
|
107
107
|
`;
|
|
108
108
|
|
|
109
109
|
export const LegendTitle = styled.div`
|
|
110
110
|
position: absolute;
|
|
111
|
-
width:
|
|
111
|
+
width: 150px;
|
|
112
112
|
height: 18px;
|
|
113
|
-
left:
|
|
113
|
+
left: 30px;
|
|
114
114
|
top: 1px;
|
|
115
115
|
font-weight: 400;
|
|
116
116
|
font-size: 14px;
|
|
@@ -122,7 +122,7 @@ export const LegendCurrencySign = styled.div`
|
|
|
122
122
|
position: absolute;
|
|
123
123
|
width: 11px;
|
|
124
124
|
height: 19px;
|
|
125
|
-
left:
|
|
125
|
+
left: 30px;
|
|
126
126
|
top: 21px;
|
|
127
127
|
font-weight: 600;
|
|
128
128
|
font-size: 16px;
|
|
@@ -132,9 +132,9 @@ export const LegendCurrencySign = styled.div`
|
|
|
132
132
|
|
|
133
133
|
export const LegendFormattedValue = styled.div`
|
|
134
134
|
position: absolute;
|
|
135
|
-
width:
|
|
135
|
+
width: 120px;
|
|
136
136
|
height: 19px;
|
|
137
|
-
left:
|
|
137
|
+
left: 40px;
|
|
138
138
|
top: 21px;
|
|
139
139
|
font-weight: 600;
|
|
140
140
|
font-size: 16px;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
ControlsContainer,
|
|
5
|
+
Controls,
|
|
6
|
+
BackgroundValueRectangle,
|
|
7
|
+
CurrentValueRectangle,
|
|
8
|
+
AvarageDelimiter,
|
|
9
|
+
} from "../Benchmark.style.js";
|
|
10
|
+
|
|
11
|
+
/*Benchmark*/
|
|
12
|
+
export const Benchmark = ({
|
|
13
|
+
totalValue = 100,
|
|
14
|
+
currentValue = 60,
|
|
15
|
+
width = 100,
|
|
16
|
+
height = 12,
|
|
17
|
+
color = "#79DB95",
|
|
18
|
+
linearGradientColor = "#C3EFD0",
|
|
19
|
+
underAvarageColor = "#FD5959",
|
|
20
|
+
linearGradientUnderAvarageColor = "#FDB1B1",
|
|
21
|
+
backgroundColor = "#F2F2F2",
|
|
22
|
+
...props
|
|
23
|
+
}) => {
|
|
24
|
+
const getCurrentValueRectangleWidth = () => {
|
|
25
|
+
if (!totalValue) return 0;
|
|
26
|
+
if (currentValue > totalValue) return width;
|
|
27
|
+
return (currentValue / totalValue) * width;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const getUnderAvarageColor = () => {
|
|
31
|
+
if (!totalValue) return backgroundColor;
|
|
32
|
+
if (currentValue > totalValue) return color;
|
|
33
|
+
if (currentValue / totalValue <= 0.5) {
|
|
34
|
+
return underAvarageColor;
|
|
35
|
+
} else {
|
|
36
|
+
return color;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const getUnderAvaragelinearGradientColor = () => {
|
|
41
|
+
if (!totalValue) return backgroundColor;
|
|
42
|
+
if (currentValue > totalValue) return linearGradientColor;
|
|
43
|
+
if (currentValue / totalValue <= 0.5) {
|
|
44
|
+
return linearGradientUnderAvarageColor;
|
|
45
|
+
} else {
|
|
46
|
+
return linearGradientColor;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<ControlsContainer height={height} width={width}>
|
|
52
|
+
<Controls height={height} width={width}>
|
|
53
|
+
<BackgroundValueRectangle
|
|
54
|
+
height={height}
|
|
55
|
+
width={width}
|
|
56
|
+
color={backgroundColor}
|
|
57
|
+
/>
|
|
58
|
+
<CurrentValueRectangle
|
|
59
|
+
height={height}
|
|
60
|
+
width={getCurrentValueRectangleWidth()}
|
|
61
|
+
color={getUnderAvarageColor()}
|
|
62
|
+
linearGradientColor={getUnderAvaragelinearGradientColor()}
|
|
63
|
+
/>
|
|
64
|
+
<AvarageDelimiter
|
|
65
|
+
height={height + 4}
|
|
66
|
+
width={0}
|
|
67
|
+
top={-2}
|
|
68
|
+
left={width / 2}
|
|
69
|
+
/>
|
|
70
|
+
</Controls>
|
|
71
|
+
</ControlsContainer>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default Benchmark;
|