@isoftdata/utility-dashboard-backend 1.5.7 → 1.5.8

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.
Files changed (2) hide show
  1. package/index.js +6 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -45,6 +45,11 @@ const loadChartData = async(mysqlConnection, { query: queryObject, formatting, c
45
45
  },
46
46
  }
47
47
  }
48
+
49
+ // There are area charts in the wild that need to be cumulative but aren't specifically flagged as such,
50
+ // So make area charts cumulative unless they're explicitly set not to be
51
+ cumulative = cumulative || (chartWrapper?.chartType === 'AreaChart' && cumulative !== false)
52
+
48
53
  const { dataTable, processedFormatting } = await loadDataTableAndProcessedFormatting(mysqlConnection, { query: queryObject, multiSeries, formatting, chartType: chartWrapper?.chartType, cumulative })
49
54
 
50
55
  if (chartWrapper?.chartType === 'Table') {
@@ -58,6 +63,7 @@ const loadChartData = async(mysqlConnection, { query: queryObject, formatting, c
58
63
  }
59
64
  return {
60
65
  ...theRest,
66
+ cumulative,
61
67
  supertype,
62
68
  chartWrapper: {
63
69
  ...chartWrapper,
@@ -92,10 +98,6 @@ const loadDataTableAndProcessedFormatting = async(mysqlConnection, { query: quer
92
98
 
93
99
  let dataTable = getDataTableFormat(data, fields, multiSeries) //per the Google Charts docs, the DataTable object literal format is the most performant, so we'll turn it into that format before returning
94
100
 
95
- // There are area charts in the wild that need to be cumulative but aren't specifically flagged as such,
96
- // So make area charts cumulative unless they're explicitly set not to be
97
- cumulative = cumulative || (chartType === 'AreaChart' && cumulative !== false)
98
-
99
101
  // Stacked area charts will have holes / jagged lines if there are nulls in the middle of a column,
100
102
  // so always do this for those, even if we don't need it to be cumulative.
101
103
  if (cumulative || chartType === 'AreaChart') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isoftdata/utility-dashboard-backend",
3
- "version": "1.5.7",
3
+ "version": "1.5.8",
4
4
  "description": "A utility for formatting chart and report data to be usable by the frontend dashboard component.",
5
5
  "main": "index.js",
6
6
  "scripts": {