@aclymatepackages/modules 2.1.5 → 2.1.6

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.
@@ -61,7 +61,8 @@ const EmissionsPieChart = _ref2 => {
61
61
  viewMode = "subcategories",
62
62
  pieChartRef,
63
63
  branding,
64
- showTooltip = true
64
+ showTooltip = true,
65
+ CustomTooltip
65
66
  } = _ref2;
66
67
  const subcategoriesArray = (0, _subcategories.buildSubcategoriesArray)(emissions);
67
68
  const scopesArray = (0, _subcategories.buildScopesWithColors)(branding);
@@ -88,6 +89,7 @@ const EmissionsPieChart = _ref2 => {
88
89
  });
89
90
  };
90
91
  const pieSlicesWithPercentages = formatChartPieSlices();
92
+ const TooltipComponent = CustomTooltip || PieChartCustomTooltip;
91
93
  return /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
92
94
  height: "100%",
93
95
  aspect: 1.5
@@ -115,7 +117,7 @@ const EmissionsPieChart = _ref2 => {
115
117
  wrapperStyle: {
116
118
  zIndex: 99
117
119
  },
118
- content: /*#__PURE__*/_react.default.createElement(PieChartCustomTooltip, null)
120
+ content: /*#__PURE__*/_react.default.createElement(TooltipComponent, null)
119
121
  })));
120
122
  };
121
123
  var _default = exports.default = EmissionsPieChart;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aclymatepackages/modules",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "Aclymate modules",
5
5
  "author": "William Loopesko",
6
6
  "main": "dist/index.js",
@@ -54,6 +54,7 @@ const EmissionsPieChart = ({
54
54
  pieChartRef,
55
55
  branding,
56
56
  showTooltip = true,
57
+ CustomTooltip,
57
58
  }) => {
58
59
  const subcategoriesArray = buildSubcategoriesArray(emissions);
59
60
  const scopesArray = buildScopesWithColors(branding);
@@ -91,6 +92,8 @@ const EmissionsPieChart = ({
91
92
 
92
93
  const pieSlicesWithPercentages = formatChartPieSlices();
93
94
 
95
+ const TooltipComponent = CustomTooltip || PieChartCustomTooltip;
96
+
94
97
  return (
95
98
  <ResponsiveContainer height="100%" aspect={1.5}>
96
99
  <PieChart ref={pieChartRef}>
@@ -113,7 +116,7 @@ const EmissionsPieChart = ({
113
116
  {showTooltip && (
114
117
  <ChartTooltip
115
118
  wrapperStyle={{ zIndex: 99 }}
116
- content={<PieChartCustomTooltip />}
119
+ content={<TooltipComponent />}
117
120
  />
118
121
  )}
119
122
  </PieChart>