@datarailsshared/dr_renderer 1.2.232-dragons → 1.2.233-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.232-dragons",
3
+ "version": "1.2.233-dragons",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -653,9 +653,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
653
653
  if (variant_name && rows && rows[0] && variant_name == rows[0]) {
654
654
  rows[0] = variant_name_default_name;
655
655
  }
656
- if (isWaterfallWalkthrough) {
657
- cols = [this.key]
658
- }
659
656
  try {
660
657
  if (is_drill_down_pie && !highchartsRenderer.selfStartsWith(series_name,"Series ")) {
661
658
  let temp = cols;
@@ -664,7 +661,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
664
661
  }
665
662
 
666
663
  var category_text = `<span style="font-weight: bold;">
667
- ${ lodash.get(this, 'point.options.colsForTotal') ? cols[0] : cols } ${ isWaterfallBreakdown ? ': ' : ' ' }
664
+ ${ lodash.get(this, 'point.options.colsForTotal') ? isWaterfallWalkthrough ? this.key : cols[0] : cols } ${ isWaterfallBreakdown ? ': ' : ' ' }
668
665
  </span>`;
669
666
  if (this.category) {
670
667
  category_text = '';
@@ -689,7 +686,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
689
686
  let formatted_value_to_return = $.pivotUtilities.getFormattedNumber(y, null, opts);
690
687
  if (aggr.value() || isWaterfallBreakdown) {
691
688
  formatted_value_to_return = $.pivotUtilities.getFormattedNumber(
692
- isWaterfallBreakdown || isTrendSeries ? y : aggr.value(), aggr, opts
689
+ isWaterfallBreakdown || isWaterfallWalkthrough || isTrendSeries ? y : aggr.value(), aggr, opts
693
690
  );
694
691
  }
695
692
 
@@ -4569,26 +4566,31 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4569
4566
  return null;
4570
4567
  }
4571
4568
 
4572
- const isWaterfall = widget
4573
- && (
4574
- widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN
4575
- || widget.chart_type === highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH
4576
- );
4569
+ const isWalktrough = lodash.get(widget, 'chart_type') === highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH;
4570
+ const isBreakdown = lodash.get(widget, 'chart_type')=== highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN;
4571
+ const isWaterfall = isWalktrough || isBreakdown;
4577
4572
 
4578
4573
  if (isWaterfall) {
4579
4574
  const maxCategories = highchartsRenderer.waterfallConstants[widget.chart_type].maxCategoriesCount;
4580
4575
  const minCategories = highchartsRenderer.waterfallConstants[widget.chart_type].minCategoriesCount;
4581
- const uniqueCategories = lodash.filter(
4582
- lodash.uniq(
4583
- lodash.map(rowData, row => row[widget.cols[0].name])
4584
- ),
4585
- value => !!value
4586
- );
4576
+ let uniqueCategories = [];
4577
+
4578
+ if (isBreakdown) {
4579
+ uniqueCategories = lodash.filter(
4580
+ lodash.uniq(
4581
+ lodash.map(rowData, row => row[widget.cols[0].name])
4582
+ ),
4583
+ value => !!value
4584
+ );
4585
+ } else {
4586
+ uniqueCategories = lodash.filter(
4587
+ lodash.get(widget, 'options.walkthrough_options.values.walkthrough'),
4588
+ (category) => category.trend !== 'total'
4589
+ );
4590
+ }
4587
4591
 
4588
4592
  if (uniqueCategories && (uniqueCategories.length > maxCategories || uniqueCategories.length < minCategories )) {
4589
4593
  options.error_has_occurred = true;
4590
- const isDateField = widget.cols[0].type === 'Date';
4591
- const commonMessagePart = `This chart support a selection of ${minCategories}-${maxCategories} items from the category section. `;
4592
4594
  options.error_params = {
4593
4595
  title: 'Data Conflict',
4594
4596
  text: `Please adjust your dashboard's reference date and filter selections as \