@datarailsshared/dr_renderer 1.2.457 → 1.2.460
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,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
|
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
|
-
|
202
|
+
.filter((v) => !_.isNaN(v))
|
203
|
+
);
|
203
204
|
|
204
205
|
let aggfunc = (a, b) => a + b;
|
205
206
|
let base = 0;
|
package/src/dataformatter.js
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
const _ = require('lodash');
|
2
|
+
|
1
3
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
2
4
|
|
3
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
@@ -350,7 +352,7 @@ var DataFormatterImpl = function () {
|
|
350
352
|
|
351
353
|
n = this.roundDecimals(n, decimals).toString().split('.');
|
352
354
|
var integerPart = n[0];
|
353
|
-
var decimalPart = String(n[1] || 0)
|
355
|
+
var decimalPart = _.padEnd(String(n[1] || 0), decimals, '0');
|
354
356
|
|
355
357
|
return this.applyNumberPattern(integerPart, patternIntegerPart) + this.locale.decimalSeparator + this.applyNumberPattern(decimalPart, patternDecimalPart, n[1] && n[1][0] == '0' ? '' : 'right');
|
356
358
|
}
|