@datarailsshared/dr_renderer 1.2.382 → 1.2.384

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.382",
3
+ "version": "1.2.384",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -1864,7 +1864,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1864
1864
 
1865
1865
  ob.name = highchartsRenderer.getFormattedColKey(ob.initialName, pivotData);
1866
1866
 
1867
- ob.y = val;
1867
+ // change negative to 0 - fix for highcharts v8.2.2 used in export widget service
1868
+ // it displays negative values as empty segments in version <= 8.2.2
1869
+ ob.y = val >= 0 || chartOptions.chart.type !== 'pie' ? val : 0;
1870
+
1868
1871
  if (!isNaN(key))
1869
1872
  key = Number(key)
1870
1873
  ob.drilldown = key;
@@ -2090,7 +2093,13 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
2090
2093
  } else {
2091
2094
  agg = pivotData.getAggregator([], key);
2092
2095
  }
2093
- ob.y = agg.value();
2096
+
2097
+ const val = agg.value();
2098
+
2099
+ // change negative to 0 - fix for highcharts v8.2.2 used in export widget service
2100
+ // it displays negative values as empty segments in version <= 8.2.2
2101
+ ob.y = val >= 0 ? val : 0;
2102
+
2094
2103
  ob.name = highchartsRenderer.getFormattedColKey(ob.initialName, pivotData);
2095
2104
  pie_series.push(ob);
2096
2105
  });
@@ -2575,7 +2584,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
2575
2584
  chartOptions.legend = highchartsRenderer.getOptionsForLegends(additionOptions, 1, false, true);
2576
2585
  if (drilldownFunc)
2577
2586
  chartOptions.drilldown = {}
2578
- else
2587
+ else if (!pivotData.isDrillDownDisabled)
2579
2588
  chartOptions.drilldown = highchartsRenderer.ptCreateDrillDownSeriesToDrilldownChart(pivotData, chartOptions, additionOptions, opts);
2580
2589
 
2581
2590
  return highchartsRenderer.ptCreateElementAndDraw(chartOptions, opts);
@@ -3102,7 +3111,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3102
3111
 
3103
3112
  highchartsRenderer.handleGridLines(additionOptions, chartOptions);
3104
3113
 
3105
- var isNotDrilldown = !(colAttrs && colAttrs.length > 1);
3114
+ var isNotDrilldown = !(colAttrs && colAttrs.length > 1) || pivotData.isDrillDownDisabled;
3106
3115
  if (lodash.get(opts, 'paletteOptions.widgetPalette', null)) {
3107
3116
  const mc_palette = lodash.find(lodash.get(opts.paletteOptions, 'monochromePalettes', []), { selected: true });
3108
3117
  chartOptions.colors = mc_palette ? mc_palette.colors : opts.paletteOptions.widgetPalette;
@@ -4881,6 +4890,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4881
4890
  rendererOptions: widget.options,
4882
4891
  dateValuesDictionary: pivotOptions ? pivotOptions.dateValuesDictionary : null,
4883
4892
  keysObject: pivotOptions ? pivotOptions.keysObject : null,
4893
+ isDrillDownDisabled: pivotOptions ? pivotOptions.isDrillDownDisabled : false,
4884
4894
  };
4885
4895
 
4886
4896
  if (!subopts.rendererOptions) {
package/src/pivottable.js CHANGED
@@ -711,6 +711,7 @@ let initPivotTable = function($, window, document) {
711
711
  this.isFormattingAxisLabels = opts.rendererOptions && opts.rendererOptions.isFormattingAxisLabels;
712
712
  this.getFormattedColKeys = (keys) => opts.getFormattedColKeys(this, keys);
713
713
  this.getFormattedRowKeys = (keys) => opts.getFormattedRowKeys(this, keys);
714
+ this.isDrillDownDisabled = opts.isDrillDownDisabled;
714
715
 
715
716
  PivotData.forEachRecord(this.input, this.derivedAttributes, (function(_this) {
716
717
  return function(record) {