@datarailsshared/dr_renderer 1.2.457 → 1.2.459

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/dr_renderer",
3
- "version": "1.2.457",
3
+ "version": "1.2.459",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -1,3 +1,4 @@
1
+ const _ = require('lodash');
1
2
  const { DrChartTooltip } = require("../dr_chart_tooltip");
2
3
  const helpers = require("../dr-renderer-helpers");
3
4
 
@@ -109,7 +110,7 @@ function DrGaugeChart(pivotData, opts) {
109
110
  };
110
111
 
111
112
  this.createTicks = function (plotBands, options) {
112
- return [...new Set([plotBands[0].from || 0, ...plotBands.map((b) => b.to), options.goal.value])].sort((a, b) => a - b);
113
+ return _.uniq([plotBands[0].from || 0, ...plotBands.map((b) => b.to), options.goal.value]).sort((a, b) => a - b);
113
114
  };
114
115
 
115
116
  this.mergeOptions = function (options) {
@@ -196,10 +197,10 @@ function DrGaugeChart(pivotData, opts) {
196
197
  this.getValue = function (pivotData, opts) {
197
198
  const lineSeries = this.ptCreateBasicLineSeries(pivotData, null, true, null, null, opts, {});
198
199
 
199
- let total = lineSeries
200
+ let total = _.flatten(lineSeries
200
201
  .map((s) => s.data.map((v) => v))
201
- .filter((v) => !isNaN(v))
202
- .flat();
202
+ .filter((v) => !_.isNaN(v))
203
+ );
203
204
 
204
205
  let aggfunc = (a, b) => a + b;
205
206
  let base = 0;