@datarailsshared/dr_renderer 1.2.47 → 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.47",
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
 
@@ -3466,6 +3466,30 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3466
3466
  filter = (a) => a > bottomx;
3467
3467
  }
3468
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;
3469
3493
  default:
3470
3494
 
3471
3495
  }