@datarailsshared/dr_renderer 1.2.252 → 1.2.254-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.252",
3
+ "version": "1.2.254-dragons",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -1042,6 +1042,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1042
1042
  if (row_n_value && row_n_value.length > 0) {
1043
1043
  ob.name = row_n_value.join(highchartsRenderer.delimer).replace('DR_Others', othersName);
1044
1044
  }
1045
+
1045
1046
  lodash.forEach(col_n_keys, function (col_n_value, index) {
1046
1047
  var agg = pivotData.getAggregator(row_n_value, col_n_value);
1047
1048
  var val = agg.value();
@@ -1258,6 +1259,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1258
1259
  if (opts.trendLine) {
1259
1260
  const a = ((ySum * squareXSum) - (xSum * xySum)) / ((n * squareXSum) - (xSum * xSum));
1260
1261
  const b = ((n * xySum) - (xSum* ySum)) / ((n * squareXSum) - (xSum * xSum));
1262
+
1261
1263
  const trendSeries = lodash.clone(chart_series[chart_series.length - 1]);
1262
1264
  trendSeries.className = 'trendSeries';
1263
1265
  trendSeries.name = highchartsRenderer.getTrendSeriesName(trendSeries);
@@ -1268,6 +1270,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1268
1270
  if (colors && colors[i]) {
1269
1271
  trendSeries.color = colors[i];
1270
1272
  }
1273
+
1271
1274
  trendSerieses.push(trendSeries);
1272
1275
  }
1273
1276
  i++;
@@ -1284,6 +1287,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1284
1287
  }
1285
1288
 
1286
1289
  let weights = { line: 2,spline: 3 ,area:-2, areaspline: -1, scatter:4, column: 1 };
1290
+
1287
1291
  if (opts.comboOptions && lodash.includes(chartType,'combo') && !lodash.isEqual(row_n_keys, EMPTY_ROW_N_KEYS)) {
1288
1292
  chart_series.forEach((series, seriesIndex) => {
1289
1293
  const savedSeriesOption = lodash.find(opts.comboOptions.seriesOptions, {series: series.name});
@@ -1455,7 +1459,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1455
1459
  keys = value.key;
1456
1460
  } else {
1457
1461
  _.forEach(value.key, (item) => {
1458
- const findKeyByValue = Object.keys(pivotData.dateValuesDictionary || {}).find(key => pivotData.dateValuesDictionary[key] === item);
1462
+ const findKeyByValue = lodash.find(
1463
+ Object.keys(pivotData.dateValuesDictionary || {}),
1464
+ key => pivotData.dateValuesDictionary[key] === item
1465
+ );
1459
1466
  keys.push(findKeyByValue ? findKeyByValue : item);
1460
1467
  })
1461
1468
  }
@@ -1493,7 +1500,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1493
1500
 
1494
1501
  resultObject.data.push({
1495
1502
  y: val,
1496
- name: lodash.unescape(name).replace('DR_Others', highchartsRenderer.getOthersName(opts)),
1503
+ name: lodash.replace(lodash.unescape(name), 'DR_Others', highchartsRenderer.getOthersName(opts)),
1497
1504
  totalIndex: value.trend === 'total' ? index : undefined,
1498
1505
  isSum: value.trend === 'total',
1499
1506
  isTotal: value.trend === 'total',
@@ -7253,13 +7260,15 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7253
7260
  [highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH]: {
7254
7261
  name: 'Walkthrough Chart',
7255
7262
  label: 'Walkthrough Chart',
7256
- title: 'Describe and explain changes in your financial outcomes.',
7257
- titleInEditor: 'TODO: add text',
7258
- description: 'For example, describe the gaps between income and your gross profit.',
7263
+ title: 'Drag one or more fields to configure your x-axis.',
7264
+ description: 'The category is shown on the x-axis and should be between 2 to 10 columns.',
7265
+ titleInEditor: 'Waterfall walkthrough widget.',
7266
+ descriptionInEditor: 'This chart visualizes the cumulative effect of positive and negative changes on an initial value, ultimately showing the net value. You can change the trend of each item and add new totals columns using the Walkthrough options button.',
7259
7267
  axisName: 'Category',
7260
- startedMessage: 'TODO: add text',
7261
- axisTooltipTitle: 'TODO: add text',
7262
- legendTooltipTitle: 'TODO: add text',
7268
+ startedMessage: '',
7269
+ axisTooltipTitle: 'Drag one or more fields to configure your x-axis.',
7270
+ axisTooltipDescription: 'The category is shown on the x-axis and should be between 2 to 10 columns.',
7271
+ legendTooltipTitle: '',
7263
7272
  },
7264
7273
  'combo-chart': {
7265
7274
  name: 'Combo Chart ',
@@ -8426,7 +8435,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8426
8435
  colFilter.value_to_show = labels.join(', ');
8427
8436
  filters.push(colFilter);
8428
8437
  } else if (widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH) {
8429
- lodash.forEach(col_key, function (colKeyElement, index) {
8438
+ lodash.forEach(col_key, function (colKeyElement, index) {
8430
8439
  const field = lodash.get(widget, `cols[${ index }]`);
8431
8440
  if (field) {
8432
8441
  let filter = highchartsRenderer.createFilterObject(field);
@@ -8915,12 +8924,21 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8915
8924
  }
8916
8925
 
8917
8926
  let pivot = {};
8927
+
8928
+ let templateNoData = lodash.find(templates, {id: widget_obj.template_id});
8929
+ if (templateNoData) {
8930
+
8931
+ // we need to assign this before calling getWidgetDataSorters method
8932
+ // other way we won't get dateValuesDictionary
8933
+ // preserved condition templateNoData == true - not to interfere with further logic
8934
+ widget_obj.pivot = pivot;
8935
+ }
8936
+
8918
8937
  pivot.sorters = highchartsRenderer.getWidgetDataSorters(res, widget_obj);
8919
8938
  pivot.rowData = res;
8920
8939
  widget_obj.options = highchartsRenderer.parseOptionsToObject(widget_obj.options);
8921
- let templateNoData = lodash.find(templates, {id: widget_obj.template_id});
8940
+
8922
8941
  if (templateNoData) {
8923
- widget_obj.pivot = pivot;
8924
8942
  let hasServerDrill = widget_obj.chart_type.indexOf("column-chart") > -1 && widget_obj.cols && widget_obj.cols.length >= 1;
8925
8943
  if (hasServerDrill)
8926
8944
  highchartsRenderer.addPivotOptions(templateNoData, widget_obj, drillDownFunction, openDrillDownListFunction);
@@ -9236,7 +9254,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
9236
9254
  highchartsRenderer.buildFilterValuesFromWalkthroughColKey = function(widget, field, filter, colKey) {
9237
9255
  const isTotal = lodash.isArray(colKey);
9238
9256
  colKey = isTotal ? colKey : [colKey];
9239
-
9257
+
9240
9258
  lodash.forEach(colKey, function (colValue) {
9241
9259
  let value = colValue;
9242
9260
  if (field.type === 'Date' && !isTotal) {
package/src/pivot.css CHANGED
@@ -420,7 +420,7 @@ table.pvtTable thead tr th.pvtTotalLabel {
420
420
  table.pvtTable.numbers-to-right tbody tr td.pvtVal,
421
421
  table.pvtTable.numbers-to-right tbody tr td.rowTotal.rowTotal,
422
422
  table.pvtTable.numbers-to-right tbody tr td.pvtGrandTotal {
423
- text-align: right !important;
423
+ text-align: right;
424
424
  padding-right: 9px;
425
425
  line-height: 15px;
426
426
  }