@aclymatepackages/modules 1.0.11 → 1.0.13

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.
@@ -348,7 +348,8 @@ const EmissionsChart = _ref13 => {
348
348
  showTooltip,
349
349
  startDate,
350
350
  convertCarbonUnits,
351
- displayUnitLabel
351
+ displayUnitLabel,
352
+ scopes
352
353
  } = _ref13;
353
354
  const {
354
355
  chartLabelsArray,
@@ -357,7 +358,7 @@ const EmissionsChart = _ref13 => {
357
358
  subcategoriesArray,
358
359
  period,
359
360
  groupedEmissions
360
- } = (0, _chartHelpers.buildEmissionGroupData)(emissions, graphPeriod, startDate);
361
+ } = (0, _chartHelpers.buildEmissionGroupData)(emissions, graphPeriod, startDate, scopes);
361
362
  const isDataProjected = findIsDataProjected(latestEmissionDate);
362
363
  const isFirstPeriodEstimated = findIsFirstPeriodEstimated(chartLabelsArray, graphPeriod);
363
364
  const buildProjectionObj = viewMode === "subcategories" ? buildSubcategoriesProjectionObj : buildScopesProjectionObj;
@@ -63,10 +63,11 @@ const EmissionsPieChart = _ref2 => {
63
63
  let {
64
64
  dataArray: emissions,
65
65
  viewMode = "subcategories",
66
- pieChartRef
66
+ pieChartRef,
67
+ scopes
67
68
  } = _ref2;
68
69
  const subcategoriesArray = (0, _subcategories.buildSubcategoriesArray)(emissions);
69
- const scopesArray = (0, _subcategories.buildScopesArray)();
70
+ const scopesArray = scopes || (0, _subcategories.buildScopesArray)();
70
71
  const emissionsSum = (0, _otherHelpers.sumTonsCo2e)(emissions);
71
72
  const formatChartPieSlices = () => {
72
73
  const filterFunction = subcategory => emission => {
@@ -17,7 +17,8 @@ const ReportGraphContentLayout = _ref => {
17
17
  emissions,
18
18
  interval = "quarter",
19
19
  isPercentageChart,
20
- height
20
+ height,
21
+ scopes
21
22
  } = _ref;
22
23
  return /*#__PURE__*/_react.default.createElement(_material.Box, {
23
24
  p: 2,
@@ -52,7 +53,8 @@ const ReportGraphContentLayout = _ref => {
52
53
  unitConverter: tons => tons,
53
54
  aspect: 2,
54
55
  isPercentageChart: isPercentageChart,
55
- showTooltip: false
56
+ showTooltip: false,
57
+ scopes: scopes
56
58
  }))));
57
59
  };
58
60
  var _default = exports.default = ReportGraphContentLayout;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@aclymatepackages/modules",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Aclymate modules",
5
5
  "author": "William Loopesko",
6
6
  "main": "dist/index.js",
7
7
  "dependencies": {
8
8
  "@aclymatepackages/array-immutability-helpers": "^1.0.0",
9
9
  "@aclymatepackages/atoms": "^1.0.0",
10
- "@aclymatepackages/chart-helpers": "^1.0.5",
10
+ "@aclymatepackages/chart-helpers": "^1.0.6",
11
11
  "@aclymatepackages/constants": "^1.0.0",
12
12
  "@aclymatepackages/converters": "^1.0.0",
13
13
  "@aclymatepackages/date-helpers": "^1.0.0",
@@ -412,6 +412,7 @@ const EmissionsChart = ({
412
412
  startDate,
413
413
  convertCarbonUnits,
414
414
  displayUnitLabel,
415
+ scopes,
415
416
  }) => {
416
417
  const {
417
418
  chartLabelsArray,
@@ -420,7 +421,7 @@ const EmissionsChart = ({
420
421
  subcategoriesArray,
421
422
  period,
422
423
  groupedEmissions,
423
- } = buildEmissionGroupData(emissions, graphPeriod, startDate);
424
+ } = buildEmissionGroupData(emissions, graphPeriod, startDate, scopes);
424
425
 
425
426
  const isDataProjected = findIsDataProjected(latestEmissionDate);
426
427
  const isFirstPeriodEstimated = findIsFirstPeriodEstimated(
@@ -49,9 +49,10 @@ const EmissionsPieChart = ({
49
49
  dataArray: emissions,
50
50
  viewMode = "subcategories",
51
51
  pieChartRef,
52
+ scopes,
52
53
  }) => {
53
54
  const subcategoriesArray = buildSubcategoriesArray(emissions);
54
- const scopesArray = buildScopesArray();
55
+ const scopesArray = scopes || buildScopesArray();
55
56
 
56
57
  const emissionsSum = sumTonsCo2e(emissions);
57
58
 
@@ -13,6 +13,7 @@ const ReportGraphContentLayout = ({
13
13
  interval = "quarter",
14
14
  isPercentageChart,
15
15
  height,
16
+ scopes,
16
17
  }) => {
17
18
  return (
18
19
  <Box p={2} style={{ height: height || "auto" }}>
@@ -38,6 +39,7 @@ const ReportGraphContentLayout = ({
38
39
  aspect={2}
39
40
  isPercentageChart={isPercentageChart}
40
41
  showTooltip={false}
42
+ scopes={scopes}
41
43
  />
42
44
  </Grid>
43
45
  </Grid>