@datarailsshared/dr_renderer 1.2.44 → 1.2.48

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.44",
3
+ "version": "1.2.48",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -1003,6 +1003,10 @@ var DataFormatterImpl = function () {
1003
1003
 
1004
1004
  // Call function
1005
1005
  result = this.memoized[pattern].call(this, n, type);
1006
+
1007
+ if (result.value === result.pattern) {
1008
+ result.value = n;
1009
+ }
1006
1010
  }
1007
1011
  catch (e) {
1008
1012
 
@@ -384,6 +384,7 @@ let initDRPivotTable = function($, window, document) {
384
384
  pvtData.rowKeys = [];
385
385
  pvtData.colKeys = [];
386
386
  tooMuch = true;
387
+ opts.error_has_occurred = true;
387
388
  }
388
389
  return SubtotalRenderer(pvtData, opts, charttype, tooMuch);
389
390
  }
@@ -822,6 +822,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
822
822
  result = highchartsRenderer.getNoDataResult(chartOptions);
823
823
  } else if (!chartOptions.onlyText && chartOptions.series && toMatch) {
824
824
  result = highchartsRenderer.getNoDataResult(chartOptions, toMatch);
825
+ opts.error_has_occurred = true;
825
826
  } else {
826
827
  chartOptions = highchartsRenderer.updateChartOptions(chartOptions, opts);
827
828
  chartOptions = highchartsRenderer.updateChartOptions(chartOptions, {credits: {enabled: false}});
@@ -3465,6 +3466,30 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3465
3466
  filter = (a) => a > bottomx;
3466
3467
  }
3467
3468
  break;
3469
+ case "filter_smallest":
3470
+ const smallest_sumOfFields = lodash.reduce(totals, (acc, curr) => acc += curr.sum, 0);
3471
+ const smallest = Math.floor((smallest_sumOfFields * vals[0])/100);
3472
+
3473
+ if (is_absolute)
3474
+ filter = (a) => Math.abs(a) > smallest;
3475
+ else
3476
+ filter = (a) => a > smallest;
3477
+ break;
3478
+ case "filter_largest":
3479
+ const largest_sumOfFields = lodash.reduce(totals, (acc, curr) => acc += curr.sum, 0);
3480
+ const largest = Math.floor((largest_sumOfFields * vals[0])/100);
3481
+
3482
+ if (is_absolute)
3483
+ filter = (a) => Math.abs(a) < largest;
3484
+ else
3485
+ filter = (a) => a < largest;
3486
+ break;
3487
+ case "filter_out_zero":
3488
+ if (is_absolute)
3489
+ filter = (a) => Math.abs(a) == 0;
3490
+ else
3491
+ filter = (a) => a == 0;
3492
+ break;
3468
3493
  default:
3469
3494
 
3470
3495
  }
@@ -3716,9 +3741,14 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3716
3741
  };
3717
3742
 
3718
3743
  highchartsRenderer.checkFreezePanesAvaliable = function (pivotView) {
3744
+ if (!pivotView || !pivotView.querySelector) {
3745
+ return;
3746
+ }
3747
+
3719
3748
  const tableContainer = pivotView.querySelector('.pivot-div');
3720
- const tableHeadChildren = pivotView.querySelector('table.pvtTable.newPvtTable thead').children[0];
3721
- const trChildren = tableHeadChildren.children;
3749
+ const tableHead = pivotView.querySelector('table.pvtTable thead');
3750
+ const tableHeadChildren = tableHead ? tableHead.children[0] : null;
3751
+ const trChildren = tableHeadChildren ? tableHeadChildren.children : [];
3722
3752
  let thWidth = 0;
3723
3753
 
3724
3754
  for (let th of trChildren) {