@aclymatepackages/modules 1.0.26 → 1.0.28

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.
@@ -140,8 +140,6 @@ const ReferenceLineLabelChips = _ref8 => {
140
140
  top: y - CHIP_HEIGHT_PX / 2,
141
141
  left: x - chipWidth / 2,
142
142
  background: (0, _converters.hexToRgba)(palette.backgroundGray.main, 0.85)
143
- // boxShadow:
144
- // "0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)",
145
143
  },
146
144
  size: "small"
147
145
  });
@@ -321,12 +319,11 @@ const EmissionsChart = _ref14 => {
321
319
  graphPeriod,
322
320
  showTrendline,
323
321
  displayUnit,
324
- unitConverter,
325
322
  aspect,
326
323
  isPercentageChart,
327
324
  showTooltip = true,
328
325
  startDate,
329
- convertCarbonUnits,
326
+ convertCarbonUnits = tons => tons,
330
327
  displayUnitLabel,
331
328
  branding,
332
329
  netZeroPercentage
@@ -384,7 +381,7 @@ const EmissionsChart = _ref14 => {
384
381
  });
385
382
  return labelChartData(percentageConvertedChartData);
386
383
  }
387
- const unitConvertedChartData = preliminaryChartData.map(chartDataObj => convertChartDataObject(chartDataObj, value => unitConverter ? unitConverter(value) : convertCarbonUnits(value)));
384
+ const unitConvertedChartData = preliminaryChartData.map(chartDataObj => convertChartDataObject(chartDataObj, convertCarbonUnits));
388
385
  const labeledChartData = labelChartData(unitConvertedChartData);
389
386
  if (showTrendline) {
390
387
  return addTrendlineToChartData(labeledChartData);
@@ -403,14 +400,14 @@ const EmissionsChart = _ref14 => {
403
400
  const firstYearMonthlyEmissionsSum = firstYearMonthlyGroupedEmissions.map(emissions => ({
404
401
  tonsCo2e: (0, _otherHelpers.sumTonsCo2e)(emissions)
405
402
  }));
406
- const monthlyBaseline = (0, _otherHelpers.sumTonsCo2e)(firstYearMonthlyEmissionsSum) / 12;
403
+ const monthlyBaselineTons = (0, _otherHelpers.sumTonsCo2e)(firstYearMonthlyEmissionsSum) / 12;
407
404
  if (graphPeriod === "year") {
408
- return monthlyBaseline * 12;
405
+ return convertCarbonUnits(monthlyBaselineTons * 12);
409
406
  }
410
407
  if (graphPeriod === "quarter") {
411
- return monthlyBaseline * 3;
408
+ return convertCarbonUnits(monthlyBaselineTons * 3);
412
409
  }
413
- return monthlyBaseline;
410
+ return convertCarbonUnits(monthlyBaselineTons);
414
411
  };
415
412
  const chartArray = viewMode === "scopes" ? scopesArray : subcategoriesArray;
416
413
  return /*#__PURE__*/_react.default.createElement(_material.Grid, {
@@ -52,7 +52,6 @@ const ReportGraphContentLayout = _ref => {
52
52
  viewMode: chartViewMode,
53
53
  graphPeriod: interval,
54
54
  displayUnit: "tons",
55
- unitConverter: tons => tons,
56
55
  aspect: 2,
57
56
  isPercentageChart: isPercentageChart,
58
57
  showTooltip: showTooltip,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aclymatepackages/modules",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "description": "Aclymate modules",
5
5
  "author": "William Loopesko",
6
6
  "main": "dist/index.js",
@@ -132,8 +132,6 @@ const ReferenceLineLabelChips = ({ x, y, label }) => {
132
132
  top: y - CHIP_HEIGHT_PX / 2,
133
133
  left: x - chipWidth / 2,
134
134
  background: hexToRgba(palette.backgroundGray.main, 0.85),
135
- // boxShadow:
136
- // "0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)",
137
135
  }}
138
136
  size="small"
139
137
  />
@@ -336,12 +334,11 @@ const EmissionsChart = ({
336
334
  graphPeriod,
337
335
  showTrendline,
338
336
  displayUnit,
339
- unitConverter,
340
337
  aspect,
341
338
  isPercentageChart,
342
339
  showTooltip = true,
343
340
  startDate,
344
- convertCarbonUnits,
341
+ convertCarbonUnits = (tons) => tons,
345
342
  displayUnitLabel,
346
343
  branding,
347
344
  netZeroPercentage,
@@ -414,9 +411,7 @@ const EmissionsChart = ({
414
411
  }
415
412
 
416
413
  const unitConvertedChartData = preliminaryChartData.map((chartDataObj) =>
417
- convertChartDataObject(chartDataObj, (value) =>
418
- unitConverter ? unitConverter(value) : convertCarbonUnits(value)
419
- )
414
+ convertChartDataObject(chartDataObj, convertCarbonUnits)
420
415
  );
421
416
 
422
417
  const labeledChartData = labelChartData(unitConvertedChartData);
@@ -444,17 +439,17 @@ const EmissionsChart = ({
444
439
  const firstYearMonthlyEmissionsSum = firstYearMonthlyGroupedEmissions.map(
445
440
  (emissions) => ({ tonsCo2e: sumTonsCo2e(emissions) })
446
441
  );
447
- const monthlyBaseline = sumTonsCo2e(firstYearMonthlyEmissionsSum) / 12;
442
+ const monthlyBaselineTons = sumTonsCo2e(firstYearMonthlyEmissionsSum) / 12;
448
443
 
449
444
  if (graphPeriod === "year") {
450
- return monthlyBaseline * 12;
445
+ return convertCarbonUnits(monthlyBaselineTons * 12);
451
446
  }
452
447
 
453
448
  if (graphPeriod === "quarter") {
454
- return monthlyBaseline * 3;
449
+ return convertCarbonUnits(monthlyBaselineTons * 3);
455
450
  }
456
451
 
457
- return monthlyBaseline;
452
+ return convertCarbonUnits(monthlyBaselineTons);
458
453
  };
459
454
 
460
455
  const chartArray = viewMode === "scopes" ? scopesArray : subcategoriesArray;
@@ -36,7 +36,6 @@ const ReportGraphContentLayout = ({
36
36
  viewMode={chartViewMode}
37
37
  graphPeriod={interval}
38
38
  displayUnit="tons"
39
- unitConverter={(tons) => tons}
40
39
  aspect={2}
41
40
  isPercentageChart={isPercentageChart}
42
41
  showTooltip={showTooltip}