sag_components 2.0.0-beta78 → 2.0.0-beta79
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/index.esm.js +29 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +29 -15
- package/dist/index.js.map +1 -1
- package/dist/types/components/BrushChart/BrushChart.stories.d.ts +131 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31612,7 +31612,9 @@ styleInject(css_248z);
|
|
|
31612
31612
|
|
|
31613
31613
|
const BarLine = props => {
|
|
31614
31614
|
const {
|
|
31615
|
-
brushAreaBarData
|
|
31615
|
+
brushAreaBarData,
|
|
31616
|
+
color,
|
|
31617
|
+
lineColor
|
|
31616
31618
|
} = props;
|
|
31617
31619
|
const MAX_CHARS_PER_LINE = getMaxCharsPerLine(brushAreaBarData.length);
|
|
31618
31620
|
const MAX_LINES = 2;
|
|
@@ -31726,11 +31728,11 @@ const BarLine = props => {
|
|
|
31726
31728
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Line, {
|
|
31727
31729
|
type: "monotone",
|
|
31728
31730
|
dataKey: "inc_roi",
|
|
31729
|
-
stroke:
|
|
31731
|
+
stroke: lineColor,
|
|
31730
31732
|
strokeWidth: 2,
|
|
31731
31733
|
dot: {
|
|
31732
31734
|
r: 4,
|
|
31733
|
-
fill:
|
|
31735
|
+
fill: lineColor
|
|
31734
31736
|
},
|
|
31735
31737
|
activeDot: false,
|
|
31736
31738
|
name: "INC Sales ROI"
|
|
@@ -31782,7 +31784,7 @@ const BarLine = props => {
|
|
|
31782
31784
|
cursor: brushAreaBarData.length > 80
|
|
31783
31785
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
|
|
31784
31786
|
dataKey: "inc_sales",
|
|
31785
|
-
fill:
|
|
31787
|
+
fill: color,
|
|
31786
31788
|
gap: 4,
|
|
31787
31789
|
barSize: 53,
|
|
31788
31790
|
name: "INC Sales"
|
|
@@ -31805,11 +31807,11 @@ const BarLine = props => {
|
|
|
31805
31807
|
width: "100%",
|
|
31806
31808
|
height: "40px",
|
|
31807
31809
|
legendData: [{
|
|
31808
|
-
iconColor:
|
|
31810
|
+
iconColor: color,
|
|
31809
31811
|
iconType: "Square",
|
|
31810
31812
|
title: "INC Sales"
|
|
31811
31813
|
}, {
|
|
31812
|
-
iconColor:
|
|
31814
|
+
iconColor: lineColor,
|
|
31813
31815
|
iconType: "LegendUnionIcon",
|
|
31814
31816
|
title: "INC Sales ROI"
|
|
31815
31817
|
}]
|
|
@@ -31818,7 +31820,8 @@ const BarLine = props => {
|
|
|
31818
31820
|
|
|
31819
31821
|
const SingleChart = props => {
|
|
31820
31822
|
const {
|
|
31821
|
-
barData
|
|
31823
|
+
barData,
|
|
31824
|
+
color
|
|
31822
31825
|
} = props;
|
|
31823
31826
|
const MAX_CHARS_PER_LINE = getMaxCharsPerLine(barData.length);
|
|
31824
31827
|
const MAX_LINES = 2;
|
|
@@ -31920,7 +31923,7 @@ const SingleChart = props => {
|
|
|
31920
31923
|
content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
|
|
31921
31924
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
|
|
31922
31925
|
dataKey: "value",
|
|
31923
|
-
fill:
|
|
31926
|
+
fill: color,
|
|
31924
31927
|
barSize: 53,
|
|
31925
31928
|
name: "INC Sales"
|
|
31926
31929
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
|
|
@@ -31942,7 +31945,7 @@ const SingleChart = props => {
|
|
|
31942
31945
|
width: "100%",
|
|
31943
31946
|
height: "40px",
|
|
31944
31947
|
legendData: [{
|
|
31945
|
-
iconColor:
|
|
31948
|
+
iconColor: color,
|
|
31946
31949
|
iconType: "Square",
|
|
31947
31950
|
title: "INC Units"
|
|
31948
31951
|
}]
|
|
@@ -31951,7 +31954,9 @@ const SingleChart = props => {
|
|
|
31951
31954
|
|
|
31952
31955
|
const InnerBar = props => {
|
|
31953
31956
|
const {
|
|
31954
|
-
brushInnerBarData
|
|
31957
|
+
brushInnerBarData,
|
|
31958
|
+
color,
|
|
31959
|
+
backgroundColor
|
|
31955
31960
|
} = props;
|
|
31956
31961
|
const MAX_CHARS_PER_LINE = getMaxCharsPerLine(brushInnerBarData.length);
|
|
31957
31962
|
const MAX_LINES = 2;
|
|
@@ -31972,7 +31977,7 @@ const InnerBar = props => {
|
|
|
31972
31977
|
y: y,
|
|
31973
31978
|
width: width,
|
|
31974
31979
|
height: height,
|
|
31975
|
-
fill:
|
|
31980
|
+
fill: backgroundColor,
|
|
31976
31981
|
rx: 4,
|
|
31977
31982
|
ry: 4
|
|
31978
31983
|
}), /*#__PURE__*/React__default["default"].createElement("text", {
|
|
@@ -31988,7 +31993,7 @@ const InnerBar = props => {
|
|
|
31988
31993
|
y: innerY,
|
|
31989
31994
|
width: width * 0.6,
|
|
31990
31995
|
height: innerHeight,
|
|
31991
|
-
fill:
|
|
31996
|
+
fill: color,
|
|
31992
31997
|
rx: 2,
|
|
31993
31998
|
ry: 2
|
|
31994
31999
|
}), innerHeight > 16 && /*#__PURE__*/React__default["default"].createElement("text", {
|
|
@@ -32112,11 +32117,11 @@ const InnerBar = props => {
|
|
|
32112
32117
|
width: "100%",
|
|
32113
32118
|
height: "40px",
|
|
32114
32119
|
legendData: [{
|
|
32115
|
-
iconColor:
|
|
32120
|
+
iconColor: backgroundColor,
|
|
32116
32121
|
iconType: "Square",
|
|
32117
32122
|
title: "New Shoppers"
|
|
32118
32123
|
}, {
|
|
32119
|
-
iconColor:
|
|
32124
|
+
iconColor: color,
|
|
32120
32125
|
iconType: "Square",
|
|
32121
32126
|
title: "Repeaters"
|
|
32122
32127
|
}]
|
|
@@ -32132,7 +32137,10 @@ const BrushChart = props => {
|
|
|
32132
32137
|
brushBarBasketData,
|
|
32133
32138
|
brushAreaBarData,
|
|
32134
32139
|
segmentedbuttonOptions,
|
|
32135
|
-
title
|
|
32140
|
+
title,
|
|
32141
|
+
lineChartColor,
|
|
32142
|
+
innerChartColor,
|
|
32143
|
+
barChartColor
|
|
32136
32144
|
} = props;
|
|
32137
32145
|
const [selectedOption, setSelectedOption] = React$1.useState(segmentedbuttonOptions[0]);
|
|
32138
32146
|
return /*#__PURE__*/React__default["default"].createElement(Container, {
|
|
@@ -32150,12 +32158,18 @@ const BrushChart = props => {
|
|
|
32150
32158
|
return setSelectedOption(value);
|
|
32151
32159
|
}
|
|
32152
32160
|
}), /*#__PURE__*/React__default["default"].createElement(ChartContainer, null, selectedOption === "New Shoppers & Repeaters" && /*#__PURE__*/React__default["default"].createElement(InnerBar, {
|
|
32161
|
+
color: innerChartColor,
|
|
32162
|
+
backgroundColor: barChartColor,
|
|
32153
32163
|
brushInnerBarData: brushInnerBarData
|
|
32154
32164
|
}), selectedOption === "INC Sales & ROI" && /*#__PURE__*/React__default["default"].createElement(BarLine, {
|
|
32165
|
+
color: barChartColor,
|
|
32166
|
+
lineColor: lineChartColor,
|
|
32155
32167
|
brushAreaBarData: brushAreaBarData
|
|
32156
32168
|
}), selectedOption === "INC Units" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
|
|
32169
|
+
color: barChartColor,
|
|
32157
32170
|
barData: brushBarIncData
|
|
32158
32171
|
}), selectedOption === "Basket Lift" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
|
|
32172
|
+
color: barChartColor,
|
|
32159
32173
|
barData: brushBarBasketData
|
|
32160
32174
|
})));
|
|
32161
32175
|
};
|