dtable-statistic 4.1.3 → 4.1.4

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.
@@ -307,13 +307,17 @@ function getGroupbyNumericColumnsChartResults(rows, formulaRows, groupbyColumn,
307
307
  return getGroupChartStatResult(table, value, groupbyColumn, numericSummaryColumnKey, rows, formulaRows, includeEmpty, groupbyDateGranularity, groupbyGeolocationGranularity, columnGroupbyDateGranularity, columnGroupbyGeolocationGranularity, summaryColumn, summaryType, summaryMethod, columnGroupbyMultipleNumericColumn, yAxisType);
308
308
  }
309
309
  function calculateGeolocationBasicChart(chart, value, username, userId) {
310
- var table_id = chart.table_id,
310
+ var type = chart.type,
311
+ table_id = chart.table_id,
311
312
  view_id = chart.view_id,
312
313
  geo_column = chart.geo_column,
313
314
  summary_type = chart.summary_type,
314
315
  summary_column = chart.summary_column,
315
316
  summary_method = chart.summary_method;
316
- var geolocationGranularity = fixMapGeoGranularity(chart);
317
+ var geolocationGranularity = null;
318
+ if (type && !type.includes('world')) {
319
+ geolocationGranularity = fixMapGeoGranularity(chart);
320
+ }
317
321
  var table = TableUtils.getTableById(value.tables, table_id);
318
322
  var view = table && Views.getViewById(table.views, view_id);
319
323
  if (!view) {
@@ -8,6 +8,7 @@ import { filter2SqlCondition, TableUtils } from 'dtable-store';
8
8
  import BaseCalculator from './base-calculator';
9
9
  import { formatNumericValue, getSummaryColumnMethod } from '../utils/common-utils';
10
10
  import { DTABLE_DB_SUMMARY_METHOD } from '../constants';
11
+ import StatUtils from '../utils/stat-utils';
11
12
  var WorldMapCalculator = /*#__PURE__*/function (_BaseCalculator) {
12
13
  _inherits(WorldMapCalculator, _BaseCalculator);
13
14
  var _super = _createSuper(WorldMapCalculator);
@@ -149,14 +150,17 @@ var WorldMapCalculator = /*#__PURE__*/function (_BaseCalculator) {
149
150
  data.results.forEach(function (item) {
150
151
  var currentValue = item[column];
151
152
  var value = item[valueKey];
153
+ var formatted_value = value;
152
154
  if (isAdvanced) {
153
155
  value = formatNumericValue(value, summaryColumn);
156
+ formatted_value = StatUtils.getFormattedValue(value, summaryColumn, summary_method);
154
157
  }
155
158
  if (currentValue) {
156
159
  var name = typeof currentValue === 'string' ? currentValue : currentValue.country_region;
157
160
  newResult.push({
158
161
  name: name,
159
- value: value
162
+ value: value,
163
+ formatted_value: formatted_value
160
164
  });
161
165
  }
162
166
  });