@datarailsshared/dr_renderer 1.2.374 → 1.2.376

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.374",
3
+ "version": "1.2.376",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -24,8 +24,8 @@ const CHART_COLORS = {
24
24
  LABEL_SECOND: '#85889c',
25
25
  DRILL_UP_FILL: '#eef3f6',
26
26
  DRILL_BUTTON_COLOR_FILL: 'white',
27
- DRILL_BUTTON_COLOR: '#333333',
28
- DRILL_BUTTON_COLOR_HOVER: '#6D6E6F',
27
+ DRILL_BUTTON_COLOR: '#6D6E6F',
28
+ DRILL_BUTTON_COLOR_HOVER: '#333333',
29
29
  PLOT_BORDER: '#606063',
30
30
  MINOR_GRID_LINE: '#505053',
31
31
  TICK_COLOR: '#666',
@@ -66,7 +66,7 @@ const CHART_TYPES = {
66
66
 
67
67
  const HIGHCHARTS_CONSTANTS = {
68
68
  delimer: ' , ',
69
- DRILL_BUTTON_FONT_SIZE: '14px',
69
+ DRILL_BUTTON_FONT_SIZE: '16px',
70
70
  MAX_ROWS_FOR_AUTO_REFRESH: 100000,
71
71
  MAX_ROWS_FOR_SHOW_RESULTS: 10000,
72
72
  DR_OTHERS_KEY: 'DR_Others',
@@ -340,7 +340,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
340
340
  maskColor: CHART_COLORS.MASK,
341
341
  lang: {
342
342
  decimalPoint: '.',
343
- drillUpText: '< Back'
343
+ drillUpText: '<&nbsp;Back'
344
344
  },
345
345
  navigation: {
346
346
  buttonOptions: {
@@ -1042,13 +1042,11 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1042
1042
  };
1043
1043
  if (isNewAngular) {
1044
1044
  const isPieChart = chartOptions.chart && chartOptions.chart.type === 'pie';
1045
- const x = isPieChart ? 0 :
1046
- chartOptions.yAxis && chartOptions.yAxis.title && (chartOptions.yAxis.title.text || chartOptions.yAxis.title.autoylabel) ? -60 : -40;
1047
- const y = isPieChart ? 27 :
1048
- chartOptions.xAxis && chartOptions.xAxis.title && (chartOptions.xAxis.title.text || chartOptions.xAxis.title.autoxlabel) ? 65 : 43;
1045
+ const x = isPieChart ? 13 : 12
1046
+ const y = isPieChart ? -9 : 6
1049
1047
  chartOptions.chart.spacingBottom = lodash.get(chartOptions, 'xAxis.title') ? 34 : 30;
1050
1048
  chartOptions.drilldown.breadcrumbs = {
1051
- formatter: () => 'Back',
1049
+ formatter: () => '< &nbsp;Back',
1052
1050
  showFullPath: false,
1053
1051
  position: {
1054
1052
  align: 'left',
@@ -1057,7 +1055,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1057
1055
  y: y,
1058
1056
  },
1059
1057
  floating: true,
1060
- position: { align: 'left', x: 12, y: 6, verticalAlign: 'bottom' },
1061
1058
  relativeTo: 'spacingBox',
1062
1059
  buttonTheme: {
1063
1060
  fill: CHART_COLORS.DRILL_BUTTON_COLOR_FILL,
@@ -8922,7 +8919,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8922
8919
  }
8923
8920
 
8924
8921
  if (datesFields.length > 0) {
8925
- const invertedDateStringMap = {};
8922
+ widget.pivot.invertedDateStringMap = {};
8926
8923
  lodash.forEach(res, function (element) {
8927
8924
  for (var i in datesFields) {
8928
8925
  if (element.hasOwnProperty(datesFields[i].name)) {
@@ -8938,7 +8935,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8938
8935
  widget.pivot.dateValuesDictionary = {}
8939
8936
  }
8940
8937
  widget.pivot.dateValuesDictionary[dateStringValue] = element[datesFields[i].name];
8941
- invertedDateStringMap[element[datesFields[i].name]] = dateStringValue;
8938
+ widget.pivot.invertedDateStringMap[element[datesFields[i].name]] = dateStringValue;
8942
8939
  }
8943
8940
  element[datesFields[i].name] = dateStringValue;
8944
8941
  }
@@ -8949,7 +8946,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8949
8946
 
8950
8947
  lodash.forEach(['col_keys', 'row_keys', 'row_keys_by_cols'], (keysListName) => {
8951
8948
  const widgetFields = keysListName === 'col_keys' ? widget.cols : widget.rows;
8952
- highchartsRenderer.replaceSortingKeysWithMappedValues(lodash.get(keysObject, keysListName), invertedDateStringMap, widgetFields);
8949
+ highchartsRenderer
8950
+ .replaceSortingKeysWithMappedValues(lodash.get(keysObject, keysListName), widget.pivot.invertedDateStringMap, widgetFields);
8953
8951
  });
8954
8952
  }
8955
8953
  });
@@ -9034,12 +9032,17 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
9034
9032
  });
9035
9033
  }
9036
9034
  } else if (field.sorting && field.sorting.type == "CustomOrder" && field.sorting.values) {
9037
- datesFields.push({
9038
- "format": field.format,
9039
- "name": field.name,
9040
- "type": field.type,
9041
- "values": field.sorting.values
9042
- });
9035
+ if (field.type === 'Date' && field.sorting.values.length && widget.pivot.invertedDateStringMap) {
9036
+ const fieldInList = lodash.find(datesFields, { name: field.name });
9037
+ fieldInList.values = lodash.map(field.sorting.values, value => widget.pivot.invertedDateStringMap[value] || value);
9038
+ } else {
9039
+ datesFields.push({
9040
+ "format": field.format,
9041
+ "name": field.name,
9042
+ "type": field.type,
9043
+ "values": field.sorting.values
9044
+ });
9045
+ }
9043
9046
  }
9044
9047
  });
9045
9048