@datarailsshared/dr_renderer 1.5.46 → 1.5.52
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/dr_pivottable.js
CHANGED
|
@@ -1273,9 +1273,6 @@ let initDRPivotTable = function($, window, document) {
|
|
|
1273
1273
|
"rowspan": rowHeader.descendants + 1,
|
|
1274
1274
|
"colspan": colspan
|
|
1275
1275
|
});
|
|
1276
|
-
if (pivotData.isSmartQueriesEnabled) {
|
|
1277
|
-
th.textContent = th.textContent.replace(DR_SCENARIO.Forecast, 'Forecast Smart Query');
|
|
1278
|
-
}
|
|
1279
1276
|
if (opts.chartOptions.table_options.hide_nulls_in_headers) {
|
|
1280
1277
|
th.textContent = th.textContent.replace('[null]', '');
|
|
1281
1278
|
}
|
|
@@ -1521,7 +1521,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1521
1521
|
if ($.isNumeric(val)) {
|
|
1522
1522
|
val = parseFloat(val);
|
|
1523
1523
|
}
|
|
1524
|
-
} else
|
|
1524
|
+
} else {
|
|
1525
|
+
// don't check helpers.isShowingEmptyValues as e2e rely on empty values being present in the DOM for column charts
|
|
1525
1526
|
if (onlyNumbers)
|
|
1526
1527
|
val = NaN;
|
|
1527
1528
|
else
|
|
@@ -6639,7 +6640,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6639
6640
|
element_type: 'checkbox',
|
|
6640
6641
|
value_name: 'dislay_empty_values',
|
|
6641
6642
|
element_label: 'Display empty values',
|
|
6642
|
-
default_value:
|
|
6643
|
+
default_value: false
|
|
6643
6644
|
},
|
|
6644
6645
|
]
|
|
6645
6646
|
},
|
|
@@ -6667,7 +6668,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6667
6668
|
element_type: 'checkbox',
|
|
6668
6669
|
value_name: 'dislay_empty_values',
|
|
6669
6670
|
element_label: 'Display empty values',
|
|
6670
|
-
default_value:
|
|
6671
|
+
default_value: false
|
|
6671
6672
|
},
|
|
6672
6673
|
{
|
|
6673
6674
|
element_type: 'devider',
|
|
@@ -9320,11 +9321,11 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
9320
9321
|
for (let i = 0; i < nestedKeys.length; i++) {
|
|
9321
9322
|
if (Array.isArray(nestedKeys[i])) {
|
|
9322
9323
|
replaceNestedKeys(nestedKeys[i]);
|
|
9323
|
-
}
|
|
9324
|
+
}
|
|
9324
9325
|
else if (invertedDateStringMap[nestedKeys[i]] && widgetFields[i] && widgetFields[i].type === 'Date') {
|
|
9325
9326
|
const getFormat = (obj) => (lodash.get(obj, 'format') ?? '').toUpperCase();
|
|
9326
9327
|
const isSameDateFormats = lodash.every(dateWidgetFields, obj => getFormat(obj) === getFormat(dateWidgetFields[0]));
|
|
9327
|
-
|
|
9328
|
+
|
|
9328
9329
|
if (isSameDateFormats) {
|
|
9329
9330
|
nestedKeys[i] = invertedDateStringMap[nestedKeys[i]];
|
|
9330
9331
|
continue;
|
|
@@ -30,21 +30,29 @@ function getSqAggregator(tree, rowKey, flatColKey) {
|
|
|
30
30
|
|
|
31
31
|
function handleForecastSeries(chart_series, chartOptions, pivotData) {
|
|
32
32
|
const midMonthOffset = 0.5;
|
|
33
|
-
const sqInput = _.filter(pivotData.input, item => item['Scenario'] === DR_SCENARIO.SQ_Actuals);
|
|
33
|
+
const sqInput = _.filter(pivotData.input, item => item['Scenario'] === DR_SCENARIO.SQ_Actuals && !!item['Reporting Month']);
|
|
34
34
|
const noSqSeries = _.filter(chart_series, (s) => !_.includes(s.name, DR_SCENARIO.SQ_Actuals)); // SQ_Actuals are just base for forecast
|
|
35
35
|
|
|
36
36
|
return _.map(noSqSeries, series => {
|
|
37
37
|
const itemScenario = getSqScenarioCycle(series.name);
|
|
38
|
-
const
|
|
38
|
+
const sqItems = _.filter(sqInput, item => {
|
|
39
|
+
const itemRowKey = pivotData.getFlatKey(item, pivotData.rowAttrs);
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
if(itemRowKey.includes(DR_SCENARIO.SQ_Actuals)) {
|
|
42
|
+
return _.startsWith(itemRowKey, itemScenario);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return series.name === itemRowKey;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if(!sqItems.length) return series;
|
|
41
49
|
|
|
42
50
|
return {
|
|
43
51
|
name: series.name,
|
|
44
52
|
data: series.data,
|
|
45
53
|
zoneAxis: "x",
|
|
46
54
|
zones: [
|
|
47
|
-
{ value:
|
|
55
|
+
{ value: sqItems.length - midMonthOffset, dashStyle: chartOptions.chart.actuals },
|
|
48
56
|
{ dashStyle: chartOptions.chart.forecast },
|
|
49
57
|
],
|
|
50
58
|
}
|