sag_components 1.0.735 → 1.0.737

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.
@@ -30,31 +30,17 @@ const BarChart = props => {
30
30
  barChartColor,
31
31
  showLegend,
32
32
  legendData,
33
+ showDollarSign,
33
34
  showReferenceLine,
34
35
  referenceLinePoint,
35
36
  referenceLineColor,
36
37
  referenceLineDashed
37
38
  } = props;
38
-
39
- // const [BarChartContainerWidth, setBarChartContainerWidth] = useState(0);
40
- // const [BarChartContainerHeight, setBarChartContainerHeight] = useState(0);
41
-
42
39
  const controlsContainerRef = (0, _react.useRef)();
43
-
44
- // useEffect(() => {
45
- // const { offsetWidth } = controlsContainerRef.current;
46
- // setBarChartContainerWidth(offsetWidth - 20);
47
- // }, [width]);
48
-
49
- // useEffect(() => {
50
- // const { offsetHeight } = controlsContainerRef.current;
51
- // setBarChartContainerHeight(offsetHeight - 40);
52
- // }, [height]);
53
-
54
40
  const displayFormattedValue = value => {
55
41
  if (!value) return '';
56
42
  let formattedValue = '';
57
- formattedValue = !isDollar ? ''.concat('X', value.toFixed(1)) : ''.concat('$', (0, _CommonFunctions.getFormattedValue)(value), (0, _CommonFunctions.getFormattedUnits)(value));
43
+ formattedValue = !isDollar ? ''.concat('X', value.toFixed(1)) : ''.concat(showDollarSign ? '$' : '', (0, _CommonFunctions.getFormattedValue)(value), (0, _CommonFunctions.getFormattedUnits)(value));
58
44
  return formattedValue;
59
45
  };
60
46
 
@@ -75,19 +61,13 @@ const BarChart = props => {
75
61
  const {
76
62
  x,
77
63
  y,
78
- stroke,
79
64
  payload
80
65
  } = props;
81
66
  if (barChartData && barChartData.length > 0 && payload) {
82
67
  const retailerData = barChartData.filter(item => item.title === payload.value);
83
68
  if (retailerData && retailerData.length > 0) {
84
- const {
85
- offerType
86
- } = retailerData[0];
87
69
  return /*#__PURE__*/_react.default.createElement("g", {
88
70
  transform: "translate(".concat(x, ",").concat(y, ")")
89
- // onMouseEnter={() => handleMouseEnter(offerType)}
90
- // onMouseLeave={handleMouseLeave}
91
71
  }, /*#__PURE__*/_react.default.createElement("text", {
92
72
  x: 0,
93
73
  y: 0,
@@ -140,7 +120,7 @@ const BarChart = props => {
140
120
  height: height,
141
121
  data: barChartData,
142
122
  margin: {
143
- top: 0,
123
+ top: 20,
144
124
  right: 0,
145
125
  bottom: 0,
146
126
  left: -5
@@ -200,6 +180,7 @@ BarChart.defaultProps = {
200
180
  height: '100%',
201
181
  barSize: 60,
202
182
  barChartColor: '#BD9EFF',
183
+ showDollarSign: true,
203
184
  isDollar: true,
204
185
  showLegend: true,
205
186
  legendData: [{
@@ -207,7 +188,7 @@ BarChart.defaultProps = {
207
188
  iconType: ICON_TYPE_SQUARE,
208
189
  iconColor: '#BD9EFF'
209
190
  }],
210
- showReferenceLine: true,
191
+ showReferenceLine: false,
211
192
  referenceLinePoint: 0,
212
193
  referenceLineColor: '#212121',
213
194
  referenceLineDashed: '5'
@@ -31,6 +31,7 @@ const BarChartTwoRows = props => {
31
31
  barChartColorSecond,
32
32
  showLegend,
33
33
  legendData,
34
+ showDollarSign,
34
35
  showReferenceLine,
35
36
  referenceLinePoint,
36
37
  referenceLineColor,
@@ -42,7 +43,7 @@ const BarChartTwoRows = props => {
42
43
  const displayFormattedValue = value => {
43
44
  if (!value) return '';
44
45
  let formattedValue = '';
45
- formattedValue = !isDollar ? ''.concat('X', value.toFixed(1)) : ''.concat('$', (0, _CommonFunctions.getFormattedValue)(value), (0, _CommonFunctions.getFormattedUnits)(value));
46
+ formattedValue = !isDollar ? ''.concat('X', value.toFixed(1)) : ''.concat(showDollarSign ? '$' : '', (0, _CommonFunctions.getFormattedValue)(value), (0, _CommonFunctions.getFormattedUnits)(value));
46
47
  return formattedValue;
47
48
  };
48
49
 
@@ -126,7 +127,7 @@ const BarChartTwoRows = props => {
126
127
  height: height,
127
128
  data: barChartData,
128
129
  margin: {
129
- top: 0,
130
+ top: 20,
130
131
  right: 0,
131
132
  bottom: 0,
132
133
  left: -5
@@ -192,6 +193,7 @@ BarChartTwoRows.defaultProps = {
192
193
  barSize: 60,
193
194
  barChartColorFirst: '#BD9EFF',
194
195
  barChartColorSecond: '#0b00aaF',
196
+ showDollarSign: true,
195
197
  isDollar: true,
196
198
  showLegend: true,
197
199
  legendData: [{
@@ -199,7 +201,7 @@ BarChartTwoRows.defaultProps = {
199
201
  iconType: ICON_TYPE_SQUARE,
200
202
  iconColor: '#BD9EFF'
201
203
  }],
202
- showReferenceLine: true,
204
+ showReferenceLine: false,
203
205
  referenceLinePoint: 0,
204
206
  referenceLineColor: '#212121',
205
207
  referenceLineDashed: '5',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.735",
3
+ "version": "1.0.737",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {