@datarailsshared/dr_renderer 1.2.314 → 1.2.316-dragons
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 +1 -1
- package/src/highcharts_renderer.js +162 -123
- package/src/pivottable.js +17 -4
package/package.json
CHANGED
package/src/dr_pivottable.js
CHANGED
@@ -198,7 +198,7 @@ let initDRPivotTable = function($, window, document) {
|
|
198
198
|
let flatRowKey = rowKey.join(delim);
|
199
199
|
let flatColKey = colKey.join(delim);
|
200
200
|
|
201
|
-
if (this.keysLength === rowKey.length + colKey.length) {
|
201
|
+
if (this.keysLength === rowKey.length + colKey.length && !this.isKeysSortingDoneOnBackendSide) {
|
202
202
|
if (!this.rowKeys.some(rKey => rKey.join(delim) === flatRowKey)) {
|
203
203
|
this.rowKeys.push(rowKey);
|
204
204
|
}
|
@@ -1150,6 +1150,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
1150
1150
|
ob.name = row_n_value.join(highchartsRenderer.delimer)
|
1151
1151
|
.replace(highchartsRenderer.DR_OTHERS_KEY, othersName);
|
1152
1152
|
}
|
1153
|
+
|
1153
1154
|
lodash.forEach(col_n_keys, function (col_n_value, index) {
|
1154
1155
|
var agg = pivotData.getAggregator(row_n_value, col_n_value);
|
1155
1156
|
var val = agg.value();
|
@@ -1391,6 +1392,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
1391
1392
|
if (opts.trendLine) {
|
1392
1393
|
const a = ((ySum * squareXSum) - (xSum * xySum)) / ((n * squareXSum) - (xSum * xSum));
|
1393
1394
|
const b = ((n * xySum) - (xSum* ySum)) / ((n * squareXSum) - (xSum * xSum));
|
1395
|
+
|
1394
1396
|
const trendSeries = lodash.clone(chart_series[chart_series.length - 1]);
|
1395
1397
|
trendSeries.className = 'trendSeries';
|
1396
1398
|
trendSeries.name = highchartsRenderer.getTrendSeriesName(trendSeries);
|
@@ -1401,6 +1403,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
1401
1403
|
if (colors && colors[i]) {
|
1402
1404
|
trendSeries.color = colors[i];
|
1403
1405
|
}
|
1406
|
+
|
1404
1407
|
trendSerieses.push(trendSeries);
|
1405
1408
|
}
|
1406
1409
|
i++;
|
@@ -1417,6 +1420,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
1417
1420
|
}
|
1418
1421
|
|
1419
1422
|
let weights = { line: 2,spline: 3 ,area:-2, areaspline: -1, scatter:4, column: 1 };
|
1423
|
+
|
1420
1424
|
if (opts.comboOptions && lodash.includes(chartType,'combo') && !lodash.isEqual(row_n_keys, EMPTY_ROW_N_KEYS)) {
|
1421
1425
|
chart_series.forEach((series, seriesIndex) => {
|
1422
1426
|
const savedSeriesOption = lodash.find(opts.comboOptions.seriesOptions, {series: series.name});
|
@@ -1503,6 +1507,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
1503
1507
|
const chart_series = [];
|
1504
1508
|
const row_n_keys = pivotData.getRowKeys();
|
1505
1509
|
const col_n_keys = pivotData.getColKeys();
|
1510
|
+
const rows_by_cols = pivotData.rowKeysByCols;
|
1506
1511
|
|
1507
1512
|
let resultObject = {
|
1508
1513
|
data: [],
|
@@ -1531,7 +1536,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
1531
1536
|
});
|
1532
1537
|
|
1533
1538
|
if (col_index !== col_n_keys.length - 1) {
|
1534
|
-
|
1539
|
+
|
1540
|
+
const rowKeys = rows_by_cols ? rows_by_cols[col_index] : row_n_keys;
|
1541
|
+
lodash.forEach(rowKeys, function (row_n_value) {
|
1535
1542
|
const agg = pivotData.getAggregator(row_n_value, col_n_value);
|
1536
1543
|
let val = agg.value();
|
1537
1544
|
|
@@ -4707,17 +4714,19 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
4707
4714
|
opts.rendererOptions.onlyOptions = true;
|
4708
4715
|
}
|
4709
4716
|
|
4710
|
-
|
4711
|
-
lodash.
|
4712
|
-
|
4713
|
-
|
4714
|
-
|
4715
|
-
|
4716
|
-
|
4717
|
-
|
4718
|
-
|
4719
|
-
|
4720
|
-
|
4717
|
+
if (!highchartsRenderer.isSortingOnBackendEnabled()) {
|
4718
|
+
const sortByValueSettings = lodash.filter(
|
4719
|
+
lodash.get(widget, 'options.sortingFields', []),
|
4720
|
+
sortingField => lodash.includes(['field_values', 'variance'], lodash.get(sortingField, 'sorting.sort_by'))
|
4721
|
+
);
|
4722
|
+
|
4723
|
+
if (sortByValueSettings.length) {
|
4724
|
+
pivotData.sortByValueAttrs = lodash.map(sortByValueSettings, fieldSorting => fieldSorting.name);
|
4725
|
+
let new_sorting_function = highchartsRenderer.generateSortingFunctionByValues(sortByValueSettings, pivotData, opts, widget);
|
4726
|
+
opts.sorters = new_sorting_function;
|
4727
|
+
optsFiltered.sorters = new_sorting_function;
|
4728
|
+
pivotData.sorters = new_sorting_function;
|
4729
|
+
}
|
4721
4730
|
}
|
4722
4731
|
|
4723
4732
|
result = opts.renderer(pivotData, opts.rendererOptions);
|
@@ -4771,6 +4780,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
4771
4780
|
rows: lodash.map(pivotOptions.legendArray, 'name'),
|
4772
4781
|
rendererOptions: widget.options,
|
4773
4782
|
dateValuesDictionary: pivotOptions ? pivotOptions.dateValuesDictionary : null,
|
4783
|
+
keysObject: pivotOptions ? pivotOptions.keysObject : null,
|
4774
4784
|
};
|
4775
4785
|
|
4776
4786
|
if (!subopts.rendererOptions) {
|
@@ -8639,6 +8649,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
8639
8649
|
};
|
8640
8650
|
|
8641
8651
|
highchartsRenderer.getWidgetDataSorters = function (res, widget, defaultDateFormat) {
|
8652
|
+
let sorters;
|
8653
|
+
|
8642
8654
|
if ($.pivotUtilities && !$.pivotUtilities.additionalFieldsList) {
|
8643
8655
|
$.pivotUtilities.additionalFieldsList = [
|
8644
8656
|
{key: 'DR_Average', name: 'DR_Average'},
|
@@ -8646,32 +8658,19 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
8646
8658
|
];
|
8647
8659
|
}
|
8648
8660
|
|
8649
|
-
|
8661
|
+
let datesFields = [];
|
8650
8662
|
datesFields = lodash.filter(widget.rows, element => element.type == 'Date');
|
8651
8663
|
datesFields = datesFields.concat(lodash.filter(widget.cols, element => element.type == 'Date'));
|
8652
|
-
|
8653
|
-
const isCustomSorting = widget.options.sortingFields && Array.isArray(widget.options.sortingFields) && widget.options.sortingFields.length > 0;
|
8654
|
-
if (isCustomSorting) {
|
8655
|
-
lodash.forEach(datesFields, function (field) {
|
8656
|
-
const fieldToSort = lodash.find(
|
8657
|
-
widget.options.sortingFields, element => element.id === field.id && lodash.get(element, 'sorting.sort_by') === 'field_items'
|
8658
|
-
);
|
8659
|
-
field.sorting = fieldToSort ? fieldToSort.sorting : field.sorting;
|
8660
|
-
});
|
8661
|
-
}
|
8662
|
-
|
8663
8664
|
datesFields = lodash.map(datesFields, function (row) {
|
8664
8665
|
return { "format": highchartsRenderer.getDateFieldFormat(widget, row), "name": row.name, "type": row.type, "values": [], "sorting": row.sorting } //'MMM - yyyy' format
|
8665
8666
|
});
|
8666
8667
|
|
8667
|
-
var data = res;
|
8668
|
-
|
8669
8668
|
lodash.forEach(datesFields, function (row) {
|
8670
8669
|
row.val_not_convert = highchartsRenderer.check_values_not_for_convert(widget, row.name);
|
8671
8670
|
});
|
8672
8671
|
|
8673
8672
|
if (datesFields.length > 0) {
|
8674
|
-
lodash.forEach(
|
8673
|
+
lodash.forEach(res, function (element) {
|
8675
8674
|
for (var i in datesFields) {
|
8676
8675
|
if (element.hasOwnProperty(datesFields[i].name)) {
|
8677
8676
|
datesFields[i].values.push(element[datesFields[i].name]);
|
@@ -8689,120 +8688,144 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
8689
8688
|
}
|
8690
8689
|
}
|
8691
8690
|
});
|
8691
|
+
|
8692
|
+
const invertedDateStringMap = lodash.invert(widget.pivot.dateValuesDictionary);
|
8693
|
+
lodash.forEach([widget.pivot.keysObject.col_keys, widget.pivot.keysObject.row_keys], (widgetKeyLists, index) => {
|
8694
|
+
const widgetFields = index ? widget.rows : widget.cols;
|
8695
|
+
lodash.forEach(widgetKeyLists, keysList => {
|
8696
|
+
lodash.forEach(keysList, (key, index) => {
|
8697
|
+
if (widgetFields[index].type === 'Date') {
|
8698
|
+
keysList[index] = invertedDateStringMap[key] || key;
|
8699
|
+
}
|
8700
|
+
});
|
8701
|
+
});
|
8702
|
+
})
|
8692
8703
|
}
|
8693
|
-
lodash.forEach(datesFields, function (row) {
|
8694
|
-
row.values = lodash.uniq(row.values);
|
8695
8704
|
|
8696
|
-
|
8697
|
-
|
8698
|
-
|
8699
|
-
|
8700
|
-
|
8705
|
+
if (!highchartsRenderer.isSortingOnBackendEnabled()) {
|
8706
|
+
const isCustomSorting = widget.options.sortingFields && Array.isArray(widget.options.sortingFields) && widget.options.sortingFields.length > 0;
|
8707
|
+
if (isCustomSorting) {
|
8708
|
+
lodash.forEach(datesFields, function (field) {
|
8709
|
+
const fieldToSort = lodash.find(
|
8710
|
+
widget.options.sortingFields, element => element.id === field.id && lodash.get(element, 'sorting.sort_by') === 'field_items'
|
8711
|
+
);
|
8712
|
+
field.sorting = fieldToSort ? fieldToSort.sorting : field.sorting;
|
8713
|
+
});
|
8714
|
+
}
|
8715
|
+
|
8716
|
+
lodash.forEach(datesFields, function (row) {
|
8717
|
+
row.values = lodash.uniq(row.values);
|
8718
|
+
|
8719
|
+
const isTimestampDateField = row.type === 'Date' && lodash.some(row.values, value => typeof value ==='number');
|
8720
|
+
if (isTimestampDateField) {
|
8721
|
+
const nullValueIndex = row.values.indexOf(NULL_VALUE);
|
8722
|
+
if (~nullValueIndex) {
|
8723
|
+
row.values.splice(nullValueIndex, 1);
|
8724
|
+
}
|
8725
|
+
row.values = row.values.sort((a, b) => a - b);
|
8726
|
+
if (~nullValueIndex) {
|
8727
|
+
row.values.push(NULL_VALUE);
|
8728
|
+
}
|
8729
|
+
} else {
|
8730
|
+
row.values = row.values.sort();
|
8701
8731
|
}
|
8702
|
-
|
8703
|
-
if (
|
8704
|
-
row.values.
|
8732
|
+
|
8733
|
+
if (row.sorting && row.sorting.type == "largestToSmallest") {
|
8734
|
+
row.values = lodash.reverse(row.values);
|
8705
8735
|
}
|
8706
|
-
|
8707
|
-
row.values = row.values
|
8708
|
-
|
8736
|
+
delete row.sorting;
|
8737
|
+
row.values = lodash.map(row.values, function (val) {
|
8738
|
+
return highchartsRenderer.returnRawDataValue(row.type, val, row.format, row.name, row.val_not_convert) + "";
|
8739
|
+
})
|
8740
|
+
|
8741
|
+
});
|
8709
8742
|
|
8710
|
-
|
8711
|
-
|
8743
|
+
/* date string */
|
8744
|
+
var rowsAndCols = [];
|
8745
|
+
rowsAndCols = widget.rows.concat(widget.cols);
|
8746
|
+
|
8747
|
+
if (widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN) {
|
8748
|
+
|
8749
|
+
// if it is breakdown widget - redefine sorting according to breakdown_options
|
8750
|
+
// TODO: remove this when BE sort will be implemented
|
8751
|
+
lodash.forEach(rowsAndCols, function (field) {
|
8752
|
+
const waterfallFieldType = field.id === widget.cols[0].id ? 'totals' : 'breakdown';
|
8753
|
+
field.sorting = {
|
8754
|
+
type: 'CustomOrder',
|
8755
|
+
values: lodash.map(
|
8756
|
+
widget.options.breakdown_options.values[waterfallFieldType],
|
8757
|
+
value => value.key
|
8758
|
+
),
|
8759
|
+
};
|
8760
|
+
});
|
8761
|
+
} else if (isCustomSorting) {
|
8762
|
+
lodash.forEach(rowsAndCols, function (field) {
|
8763
|
+
const fieldToSort = lodash.find(
|
8764
|
+
widget.options.sortingFields, element => element.id === field.id && lodash.get(element, 'sorting.sort_by') === 'field_items'
|
8765
|
+
);
|
8766
|
+
field.sorting = fieldToSort ? fieldToSort.sorting : field.sorting;
|
8767
|
+
});
|
8712
8768
|
}
|
8713
|
-
delete row.sorting;
|
8714
|
-
row.values = lodash.map(row.values, function (val) {
|
8715
|
-
return highchartsRenderer.returnRawDataValue(row.type, val, row.format, row.name, row.val_not_convert) + "";
|
8716
|
-
})
|
8717
|
-
|
8718
|
-
});
|
8719
8769
|
|
8720
|
-
/* date string */
|
8721
|
-
var rowsAndCols = [];
|
8722
|
-
rowsAndCols = widget.rows.concat(widget.cols);
|
8723
|
-
|
8724
|
-
if (widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN) {
|
8725
|
-
|
8726
|
-
// if it is breakdown widget - redefine sorting according to breakdown_options
|
8727
|
-
// TODO: remove this when BE sort will be implemented
|
8728
8770
|
lodash.forEach(rowsAndCols, function (field) {
|
8729
|
-
|
8730
|
-
|
8731
|
-
|
8732
|
-
|
8733
|
-
|
8734
|
-
|
8735
|
-
|
8736
|
-
|
8737
|
-
|
8738
|
-
|
8739
|
-
|
8740
|
-
|
8741
|
-
|
8742
|
-
|
8743
|
-
field.sorting
|
8744
|
-
});
|
8745
|
-
}
|
8746
|
-
|
8747
|
-
lodash.forEach(rowsAndCols, function (field) {
|
8748
|
-
if (field.sorting && (field.sorting.type == "DateString" || field.sorting.type == "largestToSmallest")) {
|
8749
|
-
var find_field = lodash.find(datesFields, {name: field.name});
|
8750
|
-
if (find_field) {
|
8751
|
-
if (find_field.type != 'Date')
|
8752
|
-
find_field.sorting = field.sorting;
|
8753
|
-
} else {
|
8771
|
+
if (field.sorting && (field.sorting.type == "DateString" || field.sorting.type == "largestToSmallest")) {
|
8772
|
+
var find_field = lodash.find(datesFields, {name: field.name});
|
8773
|
+
if (find_field) {
|
8774
|
+
if (find_field.type != 'Date')
|
8775
|
+
find_field.sorting = field.sorting;
|
8776
|
+
} else {
|
8777
|
+
datesFields.push({
|
8778
|
+
"format": field.format,
|
8779
|
+
"name": field.name,
|
8780
|
+
"type": field.type,
|
8781
|
+
"values": [],
|
8782
|
+
"sorting": field.sorting,
|
8783
|
+
});
|
8784
|
+
}
|
8785
|
+
} else if (field.sorting && field.sorting.type == "CustomOrder" && field.sorting.values) {
|
8754
8786
|
datesFields.push({
|
8755
8787
|
"format": field.format,
|
8756
8788
|
"name": field.name,
|
8757
8789
|
"type": field.type,
|
8758
|
-
"values":
|
8759
|
-
"sorting": field.sorting,
|
8790
|
+
"values": field.sorting.values
|
8760
8791
|
});
|
8761
8792
|
}
|
8762
|
-
}
|
8763
|
-
datesFields.push({
|
8764
|
-
"format": field.format,
|
8765
|
-
"name": field.name,
|
8766
|
-
"type": field.type,
|
8767
|
-
"values": field.sorting.values
|
8768
|
-
});
|
8769
|
-
}
|
8770
|
-
});
|
8771
|
-
|
8772
|
-
if (widget.vals && widget.vals.length > 1) {
|
8773
|
-
datesFields.push({name: "DR_Values", values: lodash.map(widget.vals, 'name')});
|
8774
|
-
}
|
8793
|
+
});
|
8775
8794
|
|
8776
|
-
|
8777
|
-
|
8778
|
-
// TODO: Remove. sortingValues looks like lagacy which is not in use neither in webclient nor in renderer
|
8779
|
-
if (widget.options && widget.options.sortingValues) {
|
8780
|
-
var field = lodash.find(datesFields, {name: widget.options.sortingValues.field});
|
8781
|
-
if (field) {
|
8782
|
-
field.values = widget.options.sortingValues.values;
|
8783
|
-
field.sorting = null;
|
8784
|
-
} else {
|
8785
|
-
datesFields.push({
|
8786
|
-
name: widget.options.sortingValues.field,
|
8787
|
-
values: widget.options.sortingValues.values
|
8788
|
-
});
|
8795
|
+
if (widget.vals && widget.vals.length > 1) {
|
8796
|
+
datesFields.push({name: "DR_Values", values: lodash.map(widget.vals, 'name')});
|
8789
8797
|
}
|
8790
|
-
|
8791
|
-
|
8792
|
-
|
8793
|
-
|
8794
|
-
if (
|
8795
|
-
|
8796
|
-
|
8797
|
-
|
8798
|
-
|
8799
|
-
return $.pivotUtilities.largeToSmallSortByAbsolute;
|
8800
|
-
|
8801
|
-
return $.pivotUtilities.largeToSmallSort;
|
8798
|
+
|
8799
|
+
/****** END *******/
|
8800
|
+
|
8801
|
+
// TODO: Remove. sortingValues looks like lagacy which is not in use neither in webclient nor in renderer
|
8802
|
+
if (widget.options && widget.options.sortingValues) {
|
8803
|
+
var field = lodash.find(datesFields, {name: widget.options.sortingValues.field});
|
8804
|
+
if (field) {
|
8805
|
+
field.values = widget.options.sortingValues.values;
|
8806
|
+
field.sorting = null;
|
8802
8807
|
} else {
|
8803
|
-
|
8808
|
+
datesFields.push({
|
8809
|
+
name: widget.options.sortingValues.field,
|
8810
|
+
values: widget.options.sortingValues.values
|
8811
|
+
});
|
8804
8812
|
}
|
8805
|
-
|
8813
|
+
}
|
8814
|
+
sorters = function (attr) {
|
8815
|
+
var field = lodash.find(datesFields, {name: attr});
|
8816
|
+
if (field)
|
8817
|
+
if (field.sorting && field.sorting.type == "DateString") {
|
8818
|
+
return $.pivotUtilities.sortDateStrings(field.sorting.month_order);
|
8819
|
+
} else if (field.sorting && field.sorting.type == "largestToSmallest") {
|
8820
|
+
if (field.sorting.is_absolute)
|
8821
|
+
return $.pivotUtilities.largeToSmallSortByAbsolute;
|
8822
|
+
|
8823
|
+
return $.pivotUtilities.largeToSmallSort;
|
8824
|
+
} else {
|
8825
|
+
return $.pivotUtilities.sortAs(field.values);
|
8826
|
+
}
|
8827
|
+
};
|
8828
|
+
}
|
8806
8829
|
|
8807
8830
|
return sorters;
|
8808
8831
|
};
|
@@ -8822,6 +8845,12 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
8822
8845
|
|
8823
8846
|
//highchartsRenderer.getGraphOptions(scope.data, override_values, res, scope.dataModel.templatesWithOutData, scope.openDrillDownList, drillDownFunction)
|
8824
8847
|
highchartsRenderer.getGraphOptions = function (widget_obj, override_values, row_data, templates, openDrillDownListFunction, drillDownFunction) {
|
8848
|
+
|
8849
|
+
let keysObject;
|
8850
|
+
if (highchartsRenderer.isSortingOnBackendEnabled()) {
|
8851
|
+
keysObject = row_data.pop();
|
8852
|
+
}
|
8853
|
+
|
8825
8854
|
let res = highchartsRenderer.updateSelectedOverrideValues(widget_obj, override_values, row_data);
|
8826
8855
|
res = highchartsRenderer.convertUniqueDateValues(widget_obj, templates, res);
|
8827
8856
|
|
@@ -8833,6 +8862,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
8833
8862
|
|
8834
8863
|
let pivot = {};
|
8835
8864
|
|
8865
|
+
if (highchartsRenderer.isSortingOnBackendEnabled()) {
|
8866
|
+
pivot.keysObject = keysObject;
|
8867
|
+
}
|
8868
|
+
|
8836
8869
|
let templateNoData = lodash.find(templates, {id: widget_obj.template_id});
|
8837
8870
|
if (templateNoData) {
|
8838
8871
|
|
@@ -8869,6 +8902,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
8869
8902
|
subopts.onlyOptions = true;
|
8870
8903
|
}
|
8871
8904
|
|
8905
|
+
subopts.keysObject = keysObject;
|
8906
|
+
|
8872
8907
|
let hc_options = highchartsRenderer.rhPivotView(res, subopts, is_table, widget_obj);
|
8873
8908
|
|
8874
8909
|
return hc_options;
|
@@ -9196,6 +9231,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
9196
9231
|
}
|
9197
9232
|
}
|
9198
9233
|
|
9234
|
+
highchartsRenderer.isSortingOnBackendEnabled = function() {
|
9235
|
+
return lodash.includes(lodash.get(document, 'ReportHippo.user.features'), 'enable_server_widget_data_sorting');
|
9236
|
+
}
|
9237
|
+
|
9199
9238
|
return highchartsRenderer;
|
9200
9239
|
};
|
9201
9240
|
|
package/src/pivottable.js
CHANGED
@@ -686,8 +686,17 @@ let initPivotTable = function($, window, document) {
|
|
686
686
|
});
|
687
687
|
this.tree = {};
|
688
688
|
this.insights = [];
|
689
|
-
|
690
|
-
this.
|
689
|
+
|
690
|
+
this.isKeysSortingDoneOnBackendSide = opts.keysObject && typeof opts.keysObject === 'object';
|
691
|
+
if (this.isKeysSortingDoneOnBackendSide) {
|
692
|
+
this.rowKeys = opts.keysObject.row_keys;
|
693
|
+
this.colKeys = opts.keysObject.col_keys;
|
694
|
+
// TODO: add also for breakdown sort object when BE story is ready.
|
695
|
+
} else {
|
696
|
+
this.rowKeys = [];
|
697
|
+
this.colKeys = [];
|
698
|
+
}
|
699
|
+
|
691
700
|
this.rowTotals = {};
|
692
701
|
this.colTotals = {};
|
693
702
|
this.allTotal = this.aggregator(this, [], []);
|
@@ -852,12 +861,16 @@ let initPivotTable = function($, window, document) {
|
|
852
861
|
};
|
853
862
|
|
854
863
|
PivotData.prototype.getColKeys = function() {
|
855
|
-
this.
|
864
|
+
if (!this.isKeysSortingDoneOnBackendSide) {
|
865
|
+
this.sortKeys();
|
866
|
+
}
|
856
867
|
return this.colKeys;
|
857
868
|
};
|
858
869
|
|
859
870
|
PivotData.prototype.getRowKeys = function() {
|
860
|
-
this.
|
871
|
+
if (!this.isKeysSortingDoneOnBackendSide) {
|
872
|
+
this.sortKeys();
|
873
|
+
}
|
861
874
|
return this.rowKeys;
|
862
875
|
};
|
863
876
|
|