@datarailsshared/dr_renderer 1.2.306-dragons → 1.2.307-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.306-dragons",
3
+ "version": "1.2.307-dragons",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -105,11 +105,16 @@ let initDRPivotTable = function($, window, document) {
105
105
  return function(a, b) {
106
106
  var comparison, i, sorter;
107
107
  for (i in sortersArr) {
108
- sorter = sortersArr[i];
109
- if (sortByValueAttrs.indexOf(attrs[parseInt(i)]) !== -1) {
110
- comparison = sorter(a.slice(0, parseInt(i) + 1).join(','), b.slice(0, parseInt(i) + 1).join(','));
108
+ const index = parseInt(i);
109
+ sorter = sortersArr[index];
110
+ if (sortByValueAttrs.indexOf(attrs[index]) !== -1) {
111
+
112
+ // For case current Field attrs[index] is sorted by value we are concatenating values passed to sorter function
113
+ // Concatenation is done from first field in a block (first axis or first series) until current field index.
114
+ // Cause for this case sorting will be as list of these concatenated strings (which is prepared in getSortingByValueOrderList)
115
+ comparison = sorter(a.slice(0, index + 1).join(','), b.slice(0, index + 1).join(','));
111
116
  } else {
112
- comparison = sorter(a[i], b[i]);
117
+ comparison = sorter(a[index], b[index]);
113
118
  }
114
119
  if (comparison !== 0) {
115
120
  return comparison;
@@ -4442,7 +4442,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4442
4442
  }
4443
4443
  }
4444
4444
 
4445
- if (typeof valueForComparison !== 'undefined') {
4445
+ if (!lodash.isNil(valueForComparison)) {
4446
4446
  if (sortingOptions && sortingOptions.is_absolute && !isNaN(parseFloat(valueForComparison))) {
4447
4447
  valueForComparison = Math.abs(valueForComparison);
4448
4448
  }