@datarailsshared/dr_renderer 1.2.174-dragons → 1.2.176-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/dr_renderer",
3
- "version": "1.2.174-dragons",
3
+ "version": "1.2.176-dragons",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -5,6 +5,7 @@ const SERIES_CLASSNAMES = {
5
5
  };
6
6
 
7
7
  const EMPTY_ROW_N_KEYS = [[]];
8
+ const NULL_VALUE = '[null]';
8
9
 
9
10
  let getHighchartsRenderer = function ($, document, Highcharts, default_colors, highchartsRenderer,
10
11
  DataFormatter, lodash, moment_lib, isNewAngular) {
@@ -1406,7 +1407,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1406
1407
 
1407
1408
  resultObject.data.push({
1408
1409
  y: pivotData.colTotals[col_n_value].sum,
1409
- name: lodash.unescape(col_n_value),
1410
+ name: lodash.unescape(col_n_value).replace('DR_Others', highchartsRenderer.getOthersName(opts)),
1410
1411
  isSum: !!col_index,
1411
1412
  isTotal: true,
1412
1413
  color: colorOptions.total,
@@ -8211,9 +8212,16 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8211
8212
  lodash.forEach(datesFields, function (row) {
8212
8213
  row.values = lodash.uniq(row.values);
8213
8214
 
8214
- const isTimestampDateField = row.type === 'Date' && typeof row.values[0] === 'number';
8215
+ const isTimestampDateField = row.type === 'Date' && lodash.some(row.values, value => typeof value ==='number');
8215
8216
  if (isTimestampDateField) {
8217
+ const nullValueIndex = row.values.indexOf(NULL_VALUE);
8218
+ if (~nullValueIndex) {
8219
+ row.values.splice(nullValueIndex, 1);
8220
+ }
8216
8221
  row.values = row.values.sort((a, b) => a - b);
8222
+ if (~nullValueIndex) {
8223
+ row.values.push(NULL_VALUE);
8224
+ }
8217
8225
  } else {
8218
8226
  row.values = row.values.sort();
8219
8227
  }