@datarailsshared/dr_renderer 1.2.459 → 1.2.461
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
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
|
}
|
@@ -1569,12 +1569,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
1569
1569
|
totalSeries.className = 'totalSeries';
|
1570
1570
|
totalSeries.name = 'Total';
|
1571
1571
|
totalSeries.data = [];
|
1572
|
-
|
1573
|
-
|
1574
|
-
if (opts.devFixDrollDownByTotal) {
|
1575
|
-
totalSeries.initialName = 'Total';
|
1576
|
-
totalSeries.isTotal = true;
|
1577
|
-
}
|
1572
|
+
totalSeries.initialName = 'Total';
|
1573
|
+
totalSeries.isTotal = true;
|
1578
1574
|
|
1579
1575
|
if (colors && colors[i]) {
|
1580
1576
|
totalSeries.color = colors[i];
|
@@ -6604,8 +6604,9 @@ describe('highcharts_renderer', () => {
|
|
6604
6604
|
fontWeight: 'normal'
|
6605
6605
|
}
|
6606
6606
|
},
|
6607
|
-
|
6608
|
-
|
6607
|
+
name: "Total",
|
6608
|
+
initialName: "Total",
|
6609
|
+
isTotal: true,
|
6609
6610
|
}
|
6610
6611
|
]);
|
6611
6612
|
});
|
@@ -7038,11 +7039,10 @@ describe('highcharts_renderer', () => {
|
|
7038
7039
|
name: 'Total'
|
7039
7040
|
}];
|
7040
7041
|
|
7041
|
-
it("should mark the series as total
|
7042
|
+
it("should mark the series as total", () => {
|
7042
7043
|
additionalOptionsMock = {};
|
7043
7044
|
opts = {
|
7044
|
-
total: true
|
7045
|
-
devFixDrollDownByTotal: true,
|
7045
|
+
total: true
|
7046
7046
|
};
|
7047
7047
|
pivotDataMock.colTotals = {
|
7048
7048
|
"col 1": { value: () => 123450 },
|
@@ -7070,31 +7070,6 @@ describe('highcharts_renderer', () => {
|
|
7070
7070
|
};
|
7071
7071
|
expect(value).toEqual(fixedResponse);
|
7072
7072
|
});
|
7073
|
-
|
7074
|
-
it("should not change the original series if the feature flag is off", () => {
|
7075
|
-
additionalOptionsMock = {};
|
7076
|
-
opts = {
|
7077
|
-
total: true,
|
7078
|
-
devFixDrollDownByTotal: false,
|
7079
|
-
};
|
7080
|
-
pivotDataMock.colTotals = {
|
7081
|
-
"col 1": { value: () => 123450 },
|
7082
|
-
"col 2": { value: () => 123451 },
|
7083
|
-
DR_Others: { value: () => 123452 },
|
7084
|
-
};
|
7085
|
-
const value = highchartsRenderer.ptCreateColumnSeries(
|
7086
|
-
pivotDataMock,
|
7087
|
-
colors,
|
7088
|
-
onlyNumbers,
|
7089
|
-
isUniqueVals,
|
7090
|
-
isNotDrillDown,
|
7091
|
-
additionalOptionsMock,
|
7092
|
-
opts,
|
7093
|
-
chartOptions,
|
7094
|
-
chartType
|
7095
|
-
);
|
7096
|
-
expect(value).toEqual(originResponse);
|
7097
|
-
});
|
7098
7073
|
});
|
7099
7074
|
});
|
7100
7075
|
describe('Function ptCreateBasicLineSeries', () => {
|