@datarailsshared/dr_renderer 1.2.292 → 1.2.295

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.292",
3
+ "version": "1.2.295",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -171,13 +171,30 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
171
171
  }
172
172
  lodash.assign(highchartsRenderer, HIGHCHARTS_CONSTANTS);
173
173
 
174
- let useTotalsCalculation = false;
174
+ highchartsRenderer.useTotalsCalculation = false;
175
175
  let disableAnimation = false;
176
176
  if (document.ReportHippo && document.ReportHippo && document.ReportHippo.user) {
177
- useTotalsCalculation = lodash.includes(document.ReportHippo.user.features, 'enable_server_totals_calculation');
177
+ highchartsRenderer.useTotalsCalculation = lodash.includes(document.ReportHippo.user.features, 'enable_server_totals_calculation');
178
178
  disableAnimation = document.ReportHippo.user.organization && document.ReportHippo.user.organization.settings && document.ReportHippo.user.organization.settings.disable_animation
179
179
  }
180
180
 
181
+ // fix issue of use tootip.stickOnContact with tooltip.outside , source: https://github.com/highcharts/highcharts/pull/15960
182
+ // TODO: remove it after it is fixed in highcharts library new version
183
+ if (lodash.get(Highcharts, 'Pointer')) {
184
+ Highcharts.Pointer.prototype.onContainerMouseLeave = function (e) {
185
+
186
+ const {charts, pick, Pointer} = Highcharts;
187
+ const chart = charts[pick(Pointer.hoverChartIndex, -1)];
188
+
189
+ e = this.normalize(e);
190
+
191
+ if (chart && e.relatedTarget && !this.inClass(e.relatedTarget, 'highcharts-tooltip')) {
192
+ chart.pointer.reset();
193
+ chart.pointer.chartPosition = void 0;
194
+ }
195
+ }
196
+ }
197
+
181
198
  // in lib it will not work
182
199
  highchartsRenderer.elem1 = document.createElement('textarea');
183
200
 
@@ -3866,7 +3883,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3866
3883
  this.ignoreValue = true;
3867
3884
  }
3868
3885
 
3869
- if (useTotalsCalculation && !isNaN(parseFloat(record[attr]))) {
3886
+ if (highchartsRenderer.useTotalsCalculation && !isNaN(parseFloat(record[attr]))) {
3870
3887
  return this.sum = parseFloat(record[attr]);
3871
3888
  } else if (!isNaN(parseFloat(record[attr]))) {
3872
3889
  return this.sum += parseFloat(record[attr]);
@@ -4020,7 +4037,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4020
4037
  this.ignoreValue = true;
4021
4038
  }
4022
4039
 
4023
- if (useTotalsCalculation) {
4040
+ if (highchartsRenderer.useTotalsCalculation) {
4024
4041
  return this.sum = val;
4025
4042
  } else {
4026
4043
  return this.sum += val;
@@ -4108,7 +4125,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4108
4125
  if (highchartsRenderer.ignoreIfCalculatedValue(data, rowKey, colKey, record, calculated_info.associated_fields, render_options, is_graph)) {
4109
4126
  this.ignoreValue = true;
4110
4127
  }
4111
- if (useTotalsCalculation) {
4128
+ if (highchartsRenderer.useTotalsCalculation) {
4112
4129
  return this.val = x;
4113
4130
  } else {
4114
4131
  return this.val = Math.min(x, (ref = this.val) != null ? ref : x);
@@ -4195,11 +4212,12 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4195
4212
  this.ignoreValue = true;
4196
4213
  }
4197
4214
 
4198
- if (useTotalsCalculation) {
4215
+ if (highchartsRenderer.useTotalsCalculation) {
4199
4216
  return this.val = x;
4200
4217
  } else {
4201
- return this.val = Math.min(x, (ref = this.val) != null ? ref : x);
4202
- } }
4218
+ return this.val = Math.max(x, (ref = this.val) != null ? ref : x);
4219
+ }
4220
+ }
4203
4221
  },
4204
4222
  value: function () {
4205
4223
  if (this.ignoreValue) {
@@ -4283,7 +4301,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4283
4301
  }
4284
4302
 
4285
4303
 
4286
- if (useTotalsCalculation) {
4304
+ if (highchartsRenderer.useTotalsCalculation) {
4287
4305
  this.sum = parseFloat(x);
4288
4306
  } else {
4289
4307
  this.sum += parseFloat(x);
@@ -4296,7 +4314,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4296
4314
  if (this.ignoreValue) {
4297
4315
  return null;
4298
4316
  }
4299
- if (useTotalsCalculation) {
4317
+ if (highchartsRenderer.useTotalsCalculation) {
4300
4318
  return this.sum;
4301
4319
  }
4302
4320
  return this.sum / this.len;
@@ -8252,7 +8270,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8252
8270
  highchartsRenderer.createDateTypeFromValue = function (fieldnametoFilter, format, colName) {
8253
8271
 
8254
8272
  const fiscalYearMonthsModifier = highchartsRenderer.getFiscalYearMonthModifier();
8255
-
8273
+
8256
8274
  const initialDateString = fieldnametoFilter;
8257
8275
  if (format) {
8258
8276
  format = format.replace(/y/g, 'Y');
@@ -8613,7 +8631,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8613
8631
  };
8614
8632
 
8615
8633
  highchartsRenderer.setNewFieldNames = function (res) {
8616
- if (useTotalsCalculation) {
8634
+ if (highchartsRenderer.useTotalsCalculation) {
8617
8635
  return res;
8618
8636
  }
8619
8637