@datarailsshared/dr_renderer 1.2.167 → 1.2.168-tigers
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 +1 -1
- package/src/dr_pivottable.js +4 -4
- package/src/highcharts_renderer.js +11 -3
- package/src/pivottable.js +1 -0
package/package.json
CHANGED
package/src/dr_pivottable.js
CHANGED
|
@@ -2604,7 +2604,7 @@ let initDRPivotTable = function($, window, document) {
|
|
|
2604
2604
|
headerRow.push(colAttrs[i]);
|
|
2605
2605
|
// Add row keys
|
|
2606
2606
|
_.forEach(colKeys, function (keys) {
|
|
2607
|
-
headerRow.push(utils.getHeaderValue(keys[i], colFields[i].type));
|
|
2607
|
+
headerRow.push(utils.getHeaderValue(keys[i], colFields[i].type, opts.dateValuesDictionary));
|
|
2608
2608
|
// Calc formulas in first time
|
|
2609
2609
|
if (i === 0) {
|
|
2610
2610
|
colFormulas.push(utils.createKeysFormula(colFields, keys, colFormulas.length + 1, true));
|
|
@@ -2622,7 +2622,7 @@ let initDRPivotTable = function($, window, document) {
|
|
|
2622
2622
|
// Formatting row keys
|
|
2623
2623
|
let keysFormatted = [];
|
|
2624
2624
|
for (let k = 0; k < rowKeys[i].length; k++) {
|
|
2625
|
-
keysFormatted.push(utils.getHeaderValue(rowKeys[i][k], rowFields[k].type))
|
|
2625
|
+
keysFormatted.push(utils.getHeaderValue(rowKeys[i][k], rowFields[k].type, opts.dateValuesDictionary))
|
|
2626
2626
|
}
|
|
2627
2627
|
// Add row keys
|
|
2628
2628
|
matrix.push(keysFormatted.concat(null));
|
|
@@ -2646,7 +2646,7 @@ let initDRPivotTable = function($, window, document) {
|
|
|
2646
2646
|
let headerRow = [colAttrs[i]];
|
|
2647
2647
|
// Add keys
|
|
2648
2648
|
_.forEach(colKeys, function (keys) {
|
|
2649
|
-
headerRow.push(utils.getHeaderValue(keys[i], colFields[i].type));
|
|
2649
|
+
headerRow.push(utils.getHeaderValue(keys[i], colFields[i].type, opts.dateValuesDictionary));
|
|
2650
2650
|
// Calc formulas in first time
|
|
2651
2651
|
if (i === 0) {
|
|
2652
2652
|
colFormulas.push(utils.createKeysFormula(colFields, keys, colFormulas.length + 1, true));
|
|
@@ -2676,7 +2676,7 @@ let initDRPivotTable = function($, window, document) {
|
|
|
2676
2676
|
// Formatting row keys
|
|
2677
2677
|
let keysFormatted = [];
|
|
2678
2678
|
for (let k = 0; k < rowKeys[i].length; k++) {
|
|
2679
|
-
keysFormatted.push(utils.getHeaderValue(rowKeys[i][k], rowFields[k].type))
|
|
2679
|
+
keysFormatted.push(utils.getHeaderValue(rowKeys[i][k], rowFields[k].type, opts.dateValuesDictionary))
|
|
2680
2680
|
}
|
|
2681
2681
|
// Add row keys
|
|
2682
2682
|
matrix.push(keysFormatted);
|
|
@@ -4227,7 +4227,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
4227
4227
|
sorters: pivotOptions ? pivotOptions.sorters : null,
|
|
4228
4228
|
cols: lodash.map(pivotOptions.axisArray, 'name'),
|
|
4229
4229
|
rows: lodash.map(pivotOptions.legendArray, 'name'),
|
|
4230
|
-
rendererOptions: widget.options
|
|
4230
|
+
rendererOptions: widget.options,
|
|
4231
|
+
dateValuesDictionary: pivotOptions ? pivotOptions.dateValuesDictionary : null,
|
|
4231
4232
|
};
|
|
4232
4233
|
|
|
4233
4234
|
if (!subopts.rendererOptions) {
|
|
@@ -7843,10 +7844,17 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
7843
7844
|
for (var i in datesFields) {
|
|
7844
7845
|
if (element.hasOwnProperty(datesFields[i].name)) {
|
|
7845
7846
|
datesFields[i].values.push(element[datesFields[i].name]);
|
|
7846
|
-
|
|
7847
|
+
const dateStringValue = highchartsRenderer.returnRawDataValue(
|
|
7847
7848
|
datesFields[i].type, element[datesFields[i].name],
|
|
7848
7849
|
defaultDateFormat ? defaultDateFormat : datesFields[i].format,
|
|
7849
|
-
datesFields[i].name, datesFields[i].val_not_convert)
|
|
7850
|
+
datesFields[i].name, datesFields[i].val_not_convert);
|
|
7851
|
+
if (widget.pivot) {
|
|
7852
|
+
if (!widget.pivot.dateValuesDictionary) {
|
|
7853
|
+
widget.pivot.dateValuesDictionary = {}
|
|
7854
|
+
}
|
|
7855
|
+
widget.pivot.dateValuesDictionary[dateStringValue] = element[datesFields[i].name];
|
|
7856
|
+
}
|
|
7857
|
+
element[datesFields[i].name] = dateStringValue;
|
|
7850
7858
|
}
|
|
7851
7859
|
}
|
|
7852
7860
|
});
|
package/src/pivottable.js
CHANGED
|
@@ -690,6 +690,7 @@ let initPivotTable = function($, window, document) {
|
|
|
690
690
|
this.colTotals = {};
|
|
691
691
|
this.allTotal = this.aggregator(this, [], []);
|
|
692
692
|
this.sorted = false;
|
|
693
|
+
this.dateValuesDictionary = opts.dateValuesDictionary;
|
|
693
694
|
PivotData.forEachRecord(this.input, this.derivedAttributes, (function(_this) {
|
|
694
695
|
return function(record) {
|
|
695
696
|
if (_this.filter(record)) {
|