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.
- package/es/calculator/workers/basic-chart-calculator-worker.js +6 -2
- package/es/calculator/world-map-calculator.js +5 -1
- package/es/constants/regions.js +1147 -333
- package/es/stat-editor/stat-settings/advance-chart-settings/map-settings.js +0 -61
- package/es/stat-view/map.js +22 -18
- package/es/stat-view/world-map.js +5 -10
- package/es/utils/map.js +44 -0
- package/package.json +2 -2
|
@@ -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
|
|
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 =
|
|
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
|
});
|