@datarailsshared/dr_renderer 1.2.88 → 1.2.91
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 +8 -3
- package/src/highcharts_renderer.js +11 -3
package/package.json
CHANGED
package/src/dr_pivottable.js
CHANGED
|
@@ -4,6 +4,8 @@ let initDRPivotTable = function($, window, document) {
|
|
|
4
4
|
var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
|
5
5
|
|
|
6
6
|
var DRPivotData, sortDateStrings, getSort, processKey, SubtotalRenderer, getFormattedNumber, largeToSmallSort, largeToSmallSortByAbsolute, NovixRenderer;
|
|
7
|
+
const newTableColors = ['rgb(127, 196, 255)', 'rgb(200, 243,243)', 'rgb(247, 161, 173)', 'rgb(255, 237, 178)', 'rgb(221, 239, 255)',
|
|
8
|
+
'rgb(171, 216, 255)', 'rgb(174, 231, 220)', 'rgb(227, 255, 236)', 'rgb(162, 215, 227)', 'rgb(223, 239, 236)'];
|
|
7
9
|
|
|
8
10
|
var delim = " , ";
|
|
9
11
|
const useNewUx = document.ReportHippo && document.ReportHippo && document.ReportHippo.user &&
|
|
@@ -259,8 +261,9 @@ let initDRPivotTable = function($, window, document) {
|
|
|
259
261
|
|
|
260
262
|
DRPivotData.prototype.getAggregator = function(rowKey, colKey) {
|
|
261
263
|
var agg, flatColKey, flatRowKey;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
+
let hebrewMarkRegex = new RegExp(String.fromCharCode(8206), 'g');
|
|
265
|
+
flatRowKey = rowKey.join(delim).replace(hebrewMarkRegex, '');
|
|
266
|
+
flatColKey = colKey.join(delim).replace(hebrewMarkRegex, '');
|
|
264
267
|
if (rowKey.length === 0 && colKey.length === 0) {
|
|
265
268
|
agg = this.allTotal;
|
|
266
269
|
} else if (rowKey.length === 0) {
|
|
@@ -646,8 +649,10 @@ let initDRPivotTable = function($, window, document) {
|
|
|
646
649
|
if (opts.paletteOptions.widgetPalette) {
|
|
647
650
|
const mc_palette = _.find(_.get(opts.paletteOptions, 'monochromePalettes', []), { selected: true });
|
|
648
651
|
colors = mc_palette ? mc_palette.colors : opts.paletteOptions.widgetPalette;
|
|
649
|
-
} else if (opts.paletteOptions.dashboardPalette.colors) {
|
|
652
|
+
} else if (opts.paletteOptions.dashboardPalette && opts.paletteOptions.dashboardPalette.colors) {
|
|
650
653
|
colors = opts.paletteOptions.dashboardPalette.colors;
|
|
654
|
+
} else {
|
|
655
|
+
colors = newTableColors;
|
|
651
656
|
}
|
|
652
657
|
|
|
653
658
|
var isNewDesign = useNewUx && opts.chartOptions.table_options.use_new_table_design;
|
|
@@ -7188,7 +7188,15 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
7188
7188
|
return filters;
|
|
7189
7189
|
};
|
|
7190
7190
|
|
|
7191
|
-
highchartsRenderer.prepareDrillDownGraphFilters = function (
|
|
7191
|
+
highchartsRenderer.prepareDrillDownGraphFilters = function (r_key, c_key, widget) {
|
|
7192
|
+
let rowKey = r_key;
|
|
7193
|
+
let colKey = c_key;
|
|
7194
|
+
let widgetOptions = typeof widget.options === 'string' ? JSON.parse(widget.options) : widget.options;
|
|
7195
|
+
if (lodash.get(widgetOptions, 'chartOptions.table_options.transpose_table', false)) {
|
|
7196
|
+
rowKey = c_key;
|
|
7197
|
+
colKey = r_key;
|
|
7198
|
+
}
|
|
7199
|
+
|
|
7192
7200
|
let filters = lodash.cloneDeep(widget.filters);
|
|
7193
7201
|
for (let i = 0; i < rowKey.length; i++) {
|
|
7194
7202
|
let filter = lodash.find(filters, {name: widget.rows[i].name});
|
|
@@ -7643,7 +7651,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
7643
7651
|
verticalAlign: 'top',
|
|
7644
7652
|
borderWidth: 0,
|
|
7645
7653
|
itemMarginTop: 10,
|
|
7646
|
-
y: additionOptions.hideChartHeader ? -25 : (additionOptions.subtitle.subtitle ? 30 : 13)
|
|
7654
|
+
y: additionOptions.hideChartHeader ? -25 : (additionOptions.subtitle && additionOptions.subtitle.subtitle ? 30 : 13)
|
|
7647
7655
|
} : {
|
|
7648
7656
|
layout: 'vertical',
|
|
7649
7657
|
align: 'right',
|
|
@@ -7659,7 +7667,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
7659
7667
|
verticalAlign: 'top',
|
|
7660
7668
|
borderWidth: 0,
|
|
7661
7669
|
itemMarginTop: 10,
|
|
7662
|
-
y: additionOptions.hideChartHeader ? -25 : (additionOptions.subtitle.subtitle ? 30 : 13)
|
|
7670
|
+
y: additionOptions.hideChartHeader ? -25 : (additionOptions.subtitle && additionOptions.subtitle.subtitle ? 30 : 13)
|
|
7663
7671
|
} : {
|
|
7664
7672
|
enabled: rowAttrsLength > 0,
|
|
7665
7673
|
layout: 'vertical',
|