sag_components 1.0.519 → 1.0.521

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.
@@ -40,9 +40,16 @@ const TotalDoughnutChart = props => {
40
40
  return;
41
41
  }
42
42
  let {
43
- current
43
+ offsetWidth,
44
+ offsetHeight
44
45
  } = DoughnutChartContainerRef === null || DoughnutChartContainerRef === void 0 ? void 0 : DoughnutChartContainerRef.current;
45
- console.log("DoughnutChartContainerRef 2", current);
46
+ offsetWidth = offsetWidth / 3;
47
+ offsetHeight = offsetHeight / 3;
48
+ console.log("DoughnutChartContainerRef 2", offsetWidth, offsetHeight);
49
+ const {
50
+ current
51
+ } = DoughnutChartContainerRef;
52
+ console.log("DoughnutChartContainerRef 3", current);
46
53
 
47
54
  // console.log(
48
55
  // "DoughnutChartContainerRef 3",
@@ -61,12 +68,12 @@ const TotalDoughnutChart = props => {
61
68
  if (!current) {
62
69
  return;
63
70
  }
64
- const DoughnutChartContainerWidth = current === null || current === void 0 ? void 0 : current.clientWidth;
65
- const DoughnutChartContainerHeight = current === null || current === void 0 ? void 0 : current.clientHeight;
71
+ const DoughnutChartContainerWidth = current === null || current === void 0 ? void 0 : current.offsetWidth;
72
+ const DoughnutChartContainerHeight = current === null || current === void 0 ? void 0 : current.offsetHeight;
66
73
  console.log("DoughnutChartContainerRef 5", DoughnutChartContainerWidth, DoughnutChartContainerHeight);
67
74
  const radius = DoughnutChartContainerWidth > DoughnutChartContainerHeight ? DoughnutChartContainerHeight / 2 : DoughnutChartContainerWidth / 2;
68
75
  setDoughnutChartRadius(radius);
69
- }, [height, width, DoughnutChartContainerRef]);
76
+ }, [height, width]);
70
77
 
71
78
  // useEffect(() => {
72
79
  // console.log("DoughnutChartContainerRef 1", DoughnutChartContainerRef);
@@ -141,13 +148,12 @@ const TotalDoughnutChart = props => {
141
148
  id: "CurrencySign"
142
149
  }, 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, {
143
150
  id: "DoughnutChartAndLegendContainer"
144
- }, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.DoughnutChart, {
145
- id: "DoughnutChart",
151
+ }, /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.DoughnutChartContainer, {
152
+ id: "DoughnutChartContainer",
146
153
  width: width,
147
- height: height
148
- }, /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
154
+ height: height,
149
155
  ref: DoughnutChartContainerRef
150
- }, /*#__PURE__*/_react.default.createElement(_recharts.PieChart, null, /*#__PURE__*/_react.default.createElement(_recharts.Pie, {
156
+ }, /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, null, /*#__PURE__*/_react.default.createElement(_recharts.PieChart, null, /*#__PURE__*/_react.default.createElement(_recharts.Pie, {
151
157
  fill: "#8884d8",
152
158
  dataKey: "value",
153
159
  blendStroke: true,
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.TooltipLabel = exports.TooltipDiv = exports.TitleAndValueContainer = exports.Title = exports.LegendTitleAndFormatedValueContainer = exports.LegendTitle = exports.LegendFormattedValue = exports.LegendFormatedValueContainer = exports.LegendControlsContainer = exports.LegendContainer = exports.LegendColorRectangle = exports.FormattedValue = exports.DoughnutChartAndLegendContainer = exports.DoughnutChart = exports.CurrencySignAndFormattedValueContainer = exports.CurrencySign = exports.ControlsContainer = exports.Controls = void 0;
7
+ exports.TooltipLabel = exports.TooltipDiv = exports.TitleAndValueContainer = exports.Title = exports.LegendTitleAndFormatedValueContainer = exports.LegendTitle = exports.LegendFormattedValue = exports.LegendFormatedValueContainer = exports.LegendControlsContainer = exports.LegendContainer = exports.LegendColorRectangle = exports.FormattedValue = exports.DoughnutChartContainer = exports.DoughnutChartAndLegendContainer = exports.CurrencySignAndFormattedValueContainer = exports.CurrencySign = exports.ControlsContainer = exports.Controls = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
9
9
  var _styledComponents = _interopRequireDefault(require("styled-components"));
10
10
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18;
@@ -19,7 +19,7 @@ const CurrencySignAndFormattedValueContainer = exports.CurrencySignAndFormattedV
19
19
  const CurrencySign = exports.CurrencySign = _styledComponents.default.span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 14px;\n }\n @media (max-width: 1366px) {\n font-size: 11px;\n }\n"])));
20
20
  const FormattedValue = exports.FormattedValue = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 40px;\n @media (max-width: 1536px) {\n font-size: 24px;\n } \n @media (max-width: 1366px) {\n font-size: 20px;\n }\n"])));
21
21
  const DoughnutChartAndLegendContainer = exports.DoughnutChartAndLegendContainer = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n margin-top: auto;\n padding: 0 20px;\n"])));
22
- const DoughnutChart = exports.DoughnutChart = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n min-width: 45%;\n flex-basis: 45%;\n min-height: 6rem;\n"])));
22
+ const DoughnutChartContainer = exports.DoughnutChartContainer = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n //align-items: center;\n position: relative; \n min-width: 45%;\n flex-basis: 45%;\n min-height: 6rem;\n"])));
23
23
  const LegendContainer = exports.LegendContainer = _styledComponents.default.div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n padding-left: 10px;\n display: flex;\n flex-direction: column;\n justify-content: space-evenly;\n"])));
24
24
  const LegendControlsContainer = exports.LegendControlsContainer = _styledComponents.default.div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n gap: 0.5rem;\n align-items: center;\n margin-bottom: 0.375rem;\n"])));
25
25
  const LegendTitleAndFormatedValueContainer = exports.LegendTitleAndFormatedValueContainer = _styledComponents.default.div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n"])));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.519",
3
+ "version": "1.0.521",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {