@datarailsshared/dr_renderer 1.5.59 → 1.5.63

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.5.59",
3
+ "version": "1.5.63",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -54,6 +54,7 @@ const CHART_COLORS = {
54
54
  const CHART_TYPES = {
55
55
  LINE_CHART: 'line-chart',
56
56
  LINE_CHART_SMOOTH: 'line-chart-smooth',
57
+ LINE_CHART_FORECAST: 'line-chart-forecast',
57
58
  COLUMN_CHART: 'column-chart',
58
59
  COLUMN_CHART_STACKED: 'column-chart-stacked',
59
60
  COMBO_CHART: 'combo-chart',
@@ -436,22 +437,6 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
436
437
  return {};
437
438
  };
438
439
 
439
- const isChartTypeSupportedForSmartQuery = (type) => {
440
- if (!type) return null;
441
- return lodash.includes([
442
- 'line',
443
- 'line-chart-forecast',
444
- 'spline',
445
- 'area',
446
- 'areaspline',
447
- highchartsRenderer.CHART_TYPES.LINE_CHART,
448
- highchartsRenderer.CHART_TYPES.LINE_CHART_SMOOTH,
449
- highchartsRenderer.CHART_TYPES.AREA_CHART,
450
- highchartsRenderer.CHART_TYPES.AREA_CHART_SMOOTH,
451
- ], type);
452
- };
453
-
454
-
455
440
  const chartHasVerticalDataLabelsOption = (type) => {
456
441
  return ![
457
442
  highchartsRenderer.CHART_TYPES.LINE_CHART,
@@ -1248,11 +1233,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1248
1233
  var chart_series = [],
1249
1234
  row_n_keys = pivotData.getRowKeys(),
1250
1235
  col_n_keys = pivotData.getColKeys();
1251
- const chartType = chartOptions && chartOptions.chart && chartOptions.chart.type ? chartOptions.chart.type : null;
1252
1236
  const indexOfScenarioCycleFilter = lodash.findIndex(pivotData.rowAttrs, (rowAttr) => rowAttr === 'Scenario Cycle');
1253
1237
  const withExtraScenarioCycle = pivotData.rowAttrs && row_n_keys[0] && pivotData.rowAttrs.length < row_n_keys[0].length
1254
1238
 
1255
- if (isChartTypeSupportedForSmartQuery(chartType) && withExtraScenarioCycle && indexOfScenarioCycleFilter > -1) {
1239
+ if (pivotData.isSmartQueriesEnabled && withExtraScenarioCycle && indexOfScenarioCycleFilter > -1) {
1256
1240
  const indexOfScenarioFilter = row_n_keys[0].length - 1;
1257
1241
  for (let i = 0; i < row_n_keys?.length; i++) {
1258
1242
  row_n_keys[i].splice(indexOfScenarioFilter, 1);
@@ -6639,43 +6623,68 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6639
6623
  value_name: 'dislay_empty_values',
6640
6624
  element_label: 'Display empty values',
6641
6625
  default_value: false
6642
- },
6643
- {
6644
- element_type: 'devider',
6645
- element_label: 'Chart Patterns',
6646
- showFn: isChartTypeSupportedForSmartQuery
6647
- },
6648
- {
6649
- element_type: 'toggle',
6650
- element_label: 'Forecast Chart',
6651
- value_name: 'smart_query',
6652
- default_value: true,
6653
- showFn: isChartTypeSupportedForSmartQuery
6654
- },
6655
- {
6656
- element_type: 'select',
6657
- value_name: 'actuals',
6658
- element_label: 'Actuals',
6659
- element_options: [
6660
- {label: 'Solid', value: 'solid'},
6661
- {label: 'Dash', value: 'dash'},
6662
- ],
6663
- default_value: 'Solid',
6664
- showFn: isChartTypeSupportedForSmartQuery
6665
- },
6666
- {
6667
- element_type: 'select',
6668
- value_name: 'forecast',
6669
- element_label: 'Forecast',
6670
- element_options: [
6671
- {label: 'Solid', value: 'solid'},
6672
- {label: 'Dash', value: 'dash'},
6673
- ],
6674
- default_value: 'Dash',
6675
- showFn: isChartTypeSupportedForSmartQuery
6676
6626
  }
6677
6627
  ]
6678
6628
  },
6629
+ 'chart_forecast': {
6630
+ category_class: 'google-visualization-charteditor-mini-more',
6631
+ category_label: 'Chart',
6632
+ category_type: 'chart',
6633
+ elements: [
6634
+ {
6635
+ element_type: 'input',
6636
+ value_name: 'colors_offset',
6637
+ element_label: 'Colors offset',
6638
+ default_value: 0
6639
+ }, {
6640
+ element_type: 'checkbox',
6641
+ value_name: 'show',
6642
+ element_label: 'Show grid',
6643
+ default_value: true
6644
+ }, {
6645
+ element_type: 'checkbox',
6646
+ value_name: 'showAllLegends',
6647
+ element_label: 'Show legends over 10',
6648
+ default_value: false
6649
+ },
6650
+ {
6651
+ element_type: 'checkbox',
6652
+ value_name: 'dislay_empty_values',
6653
+ element_label: 'Display empty values',
6654
+ default_value: false
6655
+ },
6656
+ {
6657
+ element_type: 'devider',
6658
+ element_label: 'Chart Patterns',
6659
+ },
6660
+ {
6661
+ element_type: 'text',
6662
+ element_label: 'Forecast Chart',
6663
+ value_name: 'smart_query',
6664
+ default_value: true,
6665
+ },
6666
+ {
6667
+ element_type: 'select',
6668
+ value_name: 'actuals',
6669
+ element_label: 'Actuals',
6670
+ element_options: [
6671
+ {label: 'Solid', value: 'solid'},
6672
+ {label: 'Dash', value: 'dash'},
6673
+ ],
6674
+ default_value: 'Solid',
6675
+ },
6676
+ {
6677
+ element_type: 'select',
6678
+ value_name: 'forecast',
6679
+ element_label: 'Forecast',
6680
+ element_options: [
6681
+ {label: 'Solid', value: 'solid'},
6682
+ {label: 'Dash', value: 'dash'},
6683
+ ],
6684
+ default_value: 'Dash',
6685
+ }
6686
+ ]
6687
+ },
6679
6688
  'total_value_label_donut': {
6680
6689
  category_class: 'google-visualization-charteditor-mini-more',
6681
6690
  category_label: 'Total Value Label',
@@ -7985,7 +7994,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7985
7994
  highchartsRenderer.suboptions["widget_library"],
7986
7995
  highchartsRenderer.suboptions["table_options_transpose"],
7987
7996
  highchartsRenderer.suboptions["table_design_options"],
7988
- highchartsRenderer.suboptions["chart_grid"],
7997
+ highchartsRenderer.suboptions["chart_forecast"],
7989
7998
  highchartsRenderer.suboptions["negative_number_format"],
7990
7999
  highchartsRenderer.suboptions["delta_column"],
7991
8000
  highchartsRenderer.suboptions["advanced"],