sag_components 1.0.522 → 1.0.524

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.
@@ -39,98 +39,25 @@ const TotalDoughnutChart = props => {
39
39
  if (!DoughnutChartContainerRef) {
40
40
  return;
41
41
  }
42
-
43
- // let { offsetWidth, offsetHeight } = DoughnutChartContainerRef?.current;
44
-
45
- // offsetWidth = offsetWidth / 3;
46
- // offsetHeight = offsetHeight / 3;
47
- // console.log("DoughnutChartContainerRef 2", offsetWidth, offsetHeight);
48
-
49
42
  const {
50
43
  current
51
44
  } = DoughnutChartContainerRef;
52
- console.log("DoughnutChartContainerRef 3", current);
53
-
54
- // console.log(
55
- // "DoughnutChartContainerRef 3",
56
- // Object.values(DoughnutChartContainerRef)
57
- // );
58
-
59
- // if (!current) {
60
- // const currentArray = Object.values(DoughnutChartContainerRef);
61
- // if (currentArray?.length > 0) {
62
- // current = currentArray[0];
63
- // }
64
-
65
- // console.log("DoughnutChartContainerRef 4", current);
66
- // }
67
-
45
+ console.log("DoughnutChartContainerRef 2", current);
68
46
  if (!current) {
69
47
  return;
70
48
  }
71
49
  const DoughnutChartContainerWidth = current === null || current === void 0 ? void 0 : current.offsetWidth;
72
50
  const DoughnutChartContainerHeight = current === null || current === void 0 ? void 0 : current.offsetHeight;
73
- console.log("DoughnutChartContainerRef 5", DoughnutChartContainerWidth, DoughnutChartContainerHeight);
51
+ console.log("DoughnutChartContainerRef 3", DoughnutChartContainerWidth, DoughnutChartContainerHeight);
74
52
  const radius = DoughnutChartContainerWidth > DoughnutChartContainerHeight ? DoughnutChartContainerHeight / 2 : DoughnutChartContainerWidth / 2;
75
53
  setDoughnutChartRadius(radius);
76
54
  }, [height, width]);
77
-
78
- // useEffect(() => {
79
- // console.log("DoughnutChartContainerRef 1", DoughnutChartContainerRef);
80
-
81
- // if (!DoughnutChartContainerRef) {
82
- // return;
83
- // }
84
-
85
- // const currentWidthHeght = Object.values(DoughnutChartContainerRef)?.map(
86
- // (item) => (
87
- // {
88
- // offsetHeight: item.offsetHeight,
89
- // offsetWidth: item.offsetWidth,
90
- // }
91
- // )
92
- // );
93
-
94
- // if (!currentWidthHeght || currentWidthHeght.length === 0) {
95
- // return;
96
- // }
97
- // const offsetWidth = currentWidthHeght[0].offsetWidth;
98
- // const offsetHeight = currentWidthHeght[0].offsetHeight;
99
-
100
- // console.log(
101
- // "DoughnutChartContainerRef 2",
102
- // currentWidthHeght,
103
- // offsetWidth,
104
- // offsetHeight
105
- // );
106
-
107
- // const radius =
108
- // offsetWidth > offsetHeight ? offsetHeight / 2 : offsetWidth / 2;
109
-
110
- // setDoughnutChartRadius(radius);
111
- // }, [ DoughnutChartContainerRef?.current?.offsetWidth, DoughnutChartContainerRef?.current?.offsetHeight]);
112
-
113
- // const getRadius = () => {
114
- // if (
115
- // !DoughnutChartContainerRef?.current?.offsetWidth ||
116
- // !DoughnutChartContainerRef?.current?.offsetHeight
117
- // )
118
- // return 0;
119
-
120
- // const offsetWidth = DoughnutChartContainerRef?.current?.offsetWidth;
121
- // const offsetHeight = DoughnutChartContainerRef?.current?.offsetHeight;
122
-
123
- // const radius =
124
- // offsetWidth > offsetHeight ? offsetHeight / 2 : offsetWidth / 2;
125
- // return radius;
126
- // };
127
-
128
55
  return /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.ControlsContainer, {
129
56
  id: "ControlsContainer",
130
57
  height: height,
131
58
  width: width,
132
59
  textcolor: textcolor
133
- }, (legendData === null || legendData === void 0 ? void 0 : legendData.length) > 0 ? /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.Controls, {
60
+ }, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.Controls, {
134
61
  id: "Controls",
135
62
  height: height,
136
63
  width: width
@@ -147,12 +74,12 @@ const TotalDoughnutChart = props => {
147
74
  }, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.CurrencySign, {
148
75
  id: "CurrencySign"
149
76
  }, currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, value) : ""), dotCut ? (0, _CommonFunctions.getFormattedValue)(value) : (0, _CommonFunctions.getNumberWithCommas)(value), dotCut ? (0, _CommonFunctions.getFormattedUnits)(value) : ""), addingBenchmark && /*#__PURE__*/_react.default.createElement(_Benchmark.Benchmark, null))), /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.DoughnutChartAndLegendContainer, {
150
- id: "DoughnutChartAndLegendContainer",
151
- ref: DoughnutChartContainerRef
77
+ id: "DoughnutChartAndLegendContainer"
152
78
  }, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.DoughnutChartContainer, {
153
79
  id: "DoughnutChartContainer",
154
80
  width: width,
155
- height: height
81
+ height: height,
82
+ ref: DoughnutChartContainerRef
156
83
  }, /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, null, /*#__PURE__*/_react.default.createElement(_recharts.PieChart, null, /*#__PURE__*/_react.default.createElement(_recharts.Pie, {
157
84
  fill: "#8884d8",
158
85
  dataKey: "value",
@@ -192,9 +119,7 @@ const TotalDoughnutChart = props => {
192
119
  style: {
193
120
  fontWeight: itemsBoldedValues ? "700" : "500"
194
121
  }
195
- }, currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, row.value) : "", row.value !== undefined && row.value !== null ? dotCutTrenty(row) : "No Data", row.value !== undefined && row.value !== null && dotCut ? (0, _CommonFunctions.getFormattedUnits)(row.value) : "", itemsPercentagesValueAside && " (".concat(Math.round(row.value / value * 100), "%)"))))))))) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
196
- noDataText: noDataText
197
- }));
122
+ }, currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, row.value) : "", row.value !== undefined && row.value !== null ? dotCutTrenty(row) : "No Data", row.value !== undefined && row.value !== null && dotCut ? (0, _CommonFunctions.getFormattedUnits)(row.value) : "", itemsPercentagesValueAside && " (".concat(Math.round(row.value / value * 100), "%)"))))))))));
198
123
  };
199
124
  exports.TotalDoughnutChart = TotalDoughnutChart;
200
125
  var _default = exports.default = TotalDoughnutChart;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.522",
3
+ "version": "1.0.524",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {