dtable-statistic 4.3.2 → 4.3.3
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/api/dtable-db-api.js +10 -3
- package/es/calculator/base-calculator.js +20 -12
- package/es/calculator/basic-chart-calculator.js +72 -65
- package/es/calculator/combination-calculator.js +64 -57
- package/es/calculator/compare-bar-calculator.js +33 -26
- package/es/calculator/completeness-calculator.js +37 -30
- package/es/calculator/copy-value.js +7 -1
- package/es/calculator/dashboard-calculator.js +20 -13
- package/es/calculator/heat-map-calculator.js +25 -18
- package/es/calculator/horizontal-bar-calculator.js +15 -8
- package/es/calculator/index.js +42 -35
- package/es/calculator/map-calculator.js +29 -22
- package/es/calculator/mirror-calculator.js +27 -20
- package/es/calculator/number-card-calculator.js +17 -10
- package/es/calculator/pivot-table-calculator.js +65 -58
- package/es/calculator/scatter-calculator.js +21 -14
- package/es/calculator/thread-manager.js +7 -1
- package/es/calculator/trend-calculator.js +29 -22
- package/es/calculator/workers/basic-chart-calculator-worker.js +83 -76
- package/es/calculator/workers/calculator.worker.js +33 -30
- package/es/calculator/workers/card-calculator-worker.js +19 -13
- package/es/calculator/workers/combination-calculator-worker.js +53 -46
- package/es/calculator/workers/compare-bar-chart-calculator-worker.js +29 -22
- package/es/calculator/workers/completeness-calculator-worker.js +41 -34
- package/es/calculator/workers/dashboard-calculator-worker.js +24 -18
- package/es/calculator/workers/mirror-calculator-worker.js +29 -22
- package/es/calculator/workers/pivot-table-calculator-worker.js +84 -77
- package/es/calculator/workers/scatter-calculator-worker.js +27 -20
- package/es/calculator/workers/trend-calculator-worker.js +34 -27
- package/es/calculator/world-map-calculator.js +24 -17
- package/es/components/common-add-tool.js +12 -5
- package/es/components/dialog/chart-addition-edit-dialog.js +20 -12
- package/es/components/dialog/chart-addition-widgets/chart-selector.js +110 -103
- package/es/components/dialog/color-theme-dialog.js +22 -15
- package/es/components/dialog/delete-confirmation-dialog.js +18 -11
- package/es/components/dialog/enlarged-chart-dialog.js +28 -20
- package/es/components/dialog/new-table-dialog.js +23 -16
- package/es/components/dialog/new-view-dialog.js +22 -15
- package/es/components/dialog/rename-view-dialog.js +22 -14
- package/es/components/dialog/statistic-record-dialog/index.js +45 -37
- package/es/components/dialog/statistic-types-dialog/index.js +22 -14
- package/es/components/dialog/table-select-dialog.js +23 -15
- package/es/components/dropdown-menu/statistic-dropdown-menu.js +56 -43
- package/es/components/dtable-popover.js +19 -12
- package/es/components/dtable-search-input.js +21 -13
- package/es/components/dtable-select.js +20 -12
- package/es/components/icon.js +11 -4
- package/es/components/index.js +76 -11
- package/es/components/loading.js +10 -3
- package/es/components/modal-portal.js +12 -5
- package/es/components/popover/color-rules/color-rule.js +33 -25
- package/es/components/popover/color-rules/index.js +14 -6
- package/es/components/popover/color-rules/rule-filters/filter.js +35 -28
- package/es/components/popover/color-rules/rule-filters/index.js +25 -17
- package/es/components/popover/color-rules/rule-filters/number-input.js +17 -9
- package/es/components/popover/color-rules-popover.js +32 -24
- package/es/components/popover/color-selector-popover.js +17 -10
- package/es/components/seatable-radio/index.js +16 -9
- package/es/components/select/index.js +9 -2
- package/es/components/select/option-group.js +27 -19
- package/es/components/select/option.js +14 -6
- package/es/components/select/select.js +25 -17
- package/es/components/toast/alert.js +31 -24
- package/es/components/toast/index.js +10 -3
- package/es/components/toast/toast.js +20 -12
- package/es/components/toast/toastManager.js +17 -9
- package/es/components/toast/toaster.js +14 -6
- package/es/constants/color-rules.js +12 -6
- package/es/constants/dtable-select-style.js +9 -4
- package/es/constants/event-types.js +10 -4
- package/es/constants/index.js +96 -67
- package/es/constants/key-codes.js +2 -0
- package/es/constants/map.js +8 -2
- package/es/constants/model.js +26 -20
- package/es/constants/regions.js +8 -3
- package/es/constants/zIndexes.js +7 -1
- package/es/custom-g2.js +236 -208
- package/es/dashboard.js +58 -50
- package/es/desktop-dashboard.js +55 -47
- package/es/index.js +6 -3
- package/es/locale/index.js +13 -10
- package/es/locale/lang/de.js +7 -1
- package/es/locale/lang/en.js +7 -1
- package/es/locale/lang/fr.js +7 -1
- package/es/locale/lang/zh_CN.js +7 -1
- package/es/mobile-dashboard.js +46 -38
- package/es/model/bar-group.js +19 -11
- package/es/model/bar.js +18 -10
- package/es/model/base-model.js +9 -2
- package/es/model/basic-number-card.js +16 -8
- package/es/model/collaborators.js +9 -2
- package/es/model/combination.js +20 -12
- package/es/model/compare-bar.js +24 -16
- package/es/model/completeness-group.js +16 -8
- package/es/model/completeness.js +13 -5
- package/es/model/custom-bar.js +14 -6
- package/es/model/dashboard.js +14 -6
- package/es/model/generic-model.js +141 -133
- package/es/model/heat-map.js +19 -11
- package/es/model/horizontal-bar-group.js +18 -10
- package/es/model/horizontal-bar.js +18 -10
- package/es/model/index.js +185 -53
- package/es/model/map.js +23 -15
- package/es/model/mirror.js +21 -13
- package/es/model/pie.js +18 -10
- package/es/model/ring.js +19 -11
- package/es/model/scatter.js +14 -6
- package/es/model/statistic-dashboard.js +9 -2
- package/es/model/table.js +18 -10
- package/es/model/trend.js +20 -12
- package/es/model/world-map.js +21 -13
- package/es/service/chart-service.js +14 -7
- package/es/service/dashboard-service.js +42 -35
- package/es/service/map-json.js +14 -8
- package/es/stat-editor/chart-name-editor.js +15 -8
- package/es/stat-editor/index.js +24 -16
- package/es/stat-editor/stat-settings/advance-chart-settings/basic-number-card-settings.js +30 -22
- package/es/stat-editor/stat-settings/advance-chart-settings/combination-settings.js +57 -49
- package/es/stat-editor/stat-settings/advance-chart-settings/dashboard-chart-settings.js +32 -24
- package/es/stat-editor/stat-settings/advance-chart-settings/geo-granularity-settings.js +11 -4
- package/es/stat-editor/stat-settings/advance-chart-settings/heat-map-settings.js +27 -19
- package/es/stat-editor/stat-settings/advance-chart-settings/index.js +51 -43
- package/es/stat-editor/stat-settings/advance-chart-settings/map-settings.js +31 -23
- package/es/stat-editor/stat-settings/advance-chart-settings/mirror-settings.js +31 -23
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/combination-style-setting.js +48 -40
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/heat-map-settings.js +29 -21
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/map-setting.js +34 -26
- package/es/stat-editor/stat-settings/advance-chart-settings/summary-settings.js +55 -47
- package/es/stat-editor/stat-settings/advance-chart-settings/trend-chart-settings.js +30 -22
- package/es/stat-editor/stat-settings/advance-chart-settings/world-map-settings.js +26 -18
- package/es/stat-editor/stat-settings/basic-chart-settings/advance-bar-chart-settings.js +35 -27
- package/es/stat-editor/stat-settings/basic-chart-settings/bar-settings.js +32 -24
- package/es/stat-editor/stat-settings/basic-chart-settings/completeness-chart-settings.js +41 -33
- package/es/stat-editor/stat-settings/basic-chart-settings/custom-bar-settings.js +30 -22
- package/es/stat-editor/stat-settings/basic-chart-settings/groupby-settings.js +25 -17
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-axis-group-settings.js +54 -46
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-bar-settings.js +31 -23
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-group-chart-settings.js +34 -26
- package/es/stat-editor/stat-settings/basic-chart-settings/index.js +85 -77
- package/es/stat-editor/stat-settings/basic-chart-settings/pie-settings.js +29 -21
- package/es/stat-editor/stat-settings/basic-chart-settings/pivot-table-settings.js +81 -73
- package/es/stat-editor/stat-settings/basic-chart-settings/scatter-settings.js +24 -16
- package/es/stat-editor/stat-settings/basic-chart-settings/stack-item-settings.js +27 -19
- package/es/stat-editor/stat-settings/basic-chart-settings/stacks-settings.js +26 -18
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/bar-chart-style-setting.js +59 -51
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/completeness-style.js +27 -19
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/horizontal-bar-chart-style.js +57 -49
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/label-font-size-editor.js +20 -12
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/pie-chart-style-settings.js +56 -48
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/time-compare-style.js +17 -9
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-method-setting.js +29 -21
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-settings.js +38 -30
- package/es/stat-editor/stat-settings/basic-chart-settings/time-comparison-settings.js +58 -50
- package/es/stat-editor/stat-settings/basic-chart-settings/timer-picker.js +25 -17
- package/es/stat-editor/stat-settings/basic-chart-settings/y-axis-group-settings.js +56 -47
- package/es/stat-editor/stat-settings/color-setting/color-group-selector.js +20 -12
- package/es/stat-editor/stat-settings/color-setting/color-picker.js +19 -12
- package/es/stat-editor/stat-settings/color-setting/color-use-type-selector.js +70 -62
- package/es/stat-editor/stat-settings/map/map-level.js +20 -13
- package/es/stat-editor/stat-settings/map/map-province-city.js +27 -20
- package/es/stat-editor/stat-settings/public-setting/axis-label-position-setting.js +19 -11
- package/es/stat-editor/stat-settings/public-setting/base-settings.js +28 -20
- package/es/stat-editor/stat-settings/public-setting/calender.js +29 -22
- package/es/stat-editor/stat-settings/public-setting/column-settings.js +13 -6
- package/es/stat-editor/stat-settings/public-setting/custom-title-setting.js +16 -9
- package/es/stat-editor/stat-settings/public-setting/data-sort-setting.js +21 -13
- package/es/stat-editor/stat-settings/public-setting/ind-toggle-setting.js +15 -8
- package/es/stat-editor/stat-settings/public-setting/min-max-setting.js +19 -11
- package/es/stat-editor/stat-settings/public-setting/numeric-summary-item.js +35 -27
- package/es/stat-editor/stat-settings/public-setting/toggle-setting.js +15 -8
- package/es/stat-editor/stat-settings/public-setting/type-settings/index.js +26 -18
- package/es/stat-list/chart-preview.js +33 -20
- package/es/stat-list/index.js +36 -28
- package/es/stat-view/area-chart.js +51 -44
- package/es/stat-view/bar-chart.js +55 -48
- package/es/stat-view/base-chart.js +32 -24
- package/es/stat-view/basic-number-card.js +26 -19
- package/es/stat-view/combination-chart.js +57 -50
- package/es/stat-view/compare-chart.js +47 -40
- package/es/stat-view/completeness-chart.js +37 -30
- package/es/stat-view/custom-bar.js +38 -31
- package/es/stat-view/dashboard-chart.js +22 -15
- package/es/stat-view/heat-map.js +50 -43
- package/es/stat-view/horizontal-bar-chart.js +59 -52
- package/es/stat-view/index.js +80 -73
- package/es/stat-view/line-chart.js +47 -40
- package/es/stat-view/map.js +40 -33
- package/es/stat-view/mirror.js +28 -21
- package/es/stat-view/pie-chart.js +36 -29
- package/es/stat-view/pivot-table/index.js +39 -32
- package/es/stat-view/pivot-table/one-dimension-table-no-numeric-columns.js +39 -31
- package/es/stat-view/pivot-table/one-dimension-table-with-numeric-columns.js +37 -29
- package/es/stat-view/pivot-table/pivot-table-display-name.js +54 -46
- package/es/stat-view/pivot-table/two-dimension-table.js +70 -62
- package/es/stat-view/ring-chart.js +46 -39
- package/es/stat-view/scatter-chart.js +37 -30
- package/es/stat-view/treemap-chart.js +45 -38
- package/es/stat-view/trend-chart.js +39 -32
- package/es/stat-view/world-map.js +40 -33
- package/es/tabs/index.js +40 -32
- package/es/tabs/tab.js +35 -27
- package/es/utils/basic-chart-utils.js +9 -2
- package/es/utils/cell-format.js +22 -14
- package/es/utils/cell-value.js +14 -7
- package/es/utils/collaborator.js +13 -4
- package/es/utils/color-utils.js +29 -18
- package/es/utils/column-utils.js +29 -18
- package/es/utils/column.js +11 -4
- package/es/utils/common-utils.js +67 -43
- package/es/utils/date-format.js +8 -2
- package/es/utils/export-table-utils.js +91 -82
- package/es/utils/index.js +100 -11
- package/es/utils/map.js +36 -26
- package/es/utils/model.js +14 -6
- package/es/utils/object.js +15 -6
- package/es/utils/pivot-table.js +23 -16
- package/es/utils/row-utils.js +34 -24
- package/es/utils/search.js +29 -21
- package/es/utils/sql-utils.js +75 -65
- package/es/utils/stat-utils.js +67 -60
- package/es/utils/trend-utils.js +40 -32
- package/package.json +82 -125
|
@@ -1,23 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
11
|
+
var _dtableStore = require("dtable-store");
|
|
12
|
+
var _baseChart = _interopRequireDefault(require("./base-chart"));
|
|
13
|
+
var _customG = require("../custom-g2");
|
|
14
|
+
var _commonUtils = require("../utils/common-utils");
|
|
15
|
+
var _constants = require("../constants");
|
|
9
16
|
const propTypes = {
|
|
10
|
-
isPreview:
|
|
11
|
-
isEdit:
|
|
12
|
-
theme:
|
|
13
|
-
colorThemeName:
|
|
14
|
-
statItem:
|
|
15
|
-
chartCalculator:
|
|
16
|
-
eventBus:
|
|
17
|
-
getTableById:
|
|
18
|
-
toggleStatisticRecordsDialog:
|
|
17
|
+
isPreview: _propTypes.default.bool,
|
|
18
|
+
isEdit: _propTypes.default.bool,
|
|
19
|
+
theme: _propTypes.default.string,
|
|
20
|
+
colorThemeName: _propTypes.default.string,
|
|
21
|
+
statItem: _propTypes.default.object,
|
|
22
|
+
chartCalculator: _propTypes.default.object,
|
|
23
|
+
eventBus: _propTypes.default.object,
|
|
24
|
+
getTableById: _propTypes.default.func,
|
|
25
|
+
toggleStatisticRecordsDialog: _propTypes.default.func
|
|
19
26
|
};
|
|
20
|
-
class CombinationChart extends
|
|
27
|
+
class CombinationChart extends _baseChart.default {
|
|
21
28
|
constructor(props) {
|
|
22
29
|
super(props);
|
|
23
30
|
this.componentDidMount = async () => {
|
|
@@ -26,7 +33,7 @@ class CombinationChart extends BaseChart {
|
|
|
26
33
|
chartCalculator,
|
|
27
34
|
eventBus
|
|
28
35
|
} = this.props;
|
|
29
|
-
this.unsubscribeStyleChange = eventBus.subscribe(LABEL_CONFIG_CHANGED, newStatItem => {
|
|
36
|
+
this.unsubscribeStyleChange = eventBus.subscribe(_constants.LABEL_CONFIG_CHANGED, newStatItem => {
|
|
30
37
|
this.renderAxisLabel(newStatItem);
|
|
31
38
|
});
|
|
32
39
|
if (!this.container) return;
|
|
@@ -114,7 +121,7 @@ class CombinationChart extends BaseChart {
|
|
|
114
121
|
const div = document.createElement('div');
|
|
115
122
|
div.id = xAxisID;
|
|
116
123
|
div.className = 'statistic-chart-axis-label';
|
|
117
|
-
const column = TableUtils.getTableColumnByKey(table, x_axis_column_key);
|
|
124
|
+
const column = _dtableStore.TableUtils.getTableColumnByKey(table, x_axis_column_key);
|
|
118
125
|
div.innerHTML = "".concat(column ? column.name : '');
|
|
119
126
|
div.setAttribute('style', "color:".concat(themeColors.textColor, "; width: 100%; padding-left: ").concat(autoPadding.left, "px; text-align: ").concat(x_axis_label_position, "; bottom: -20px"));
|
|
120
127
|
chartContainer.appendChild(div);
|
|
@@ -131,8 +138,8 @@ class CombinationChart extends BaseChart {
|
|
|
131
138
|
const div = document.createElement('div');
|
|
132
139
|
div.id = yAxisLeftID;
|
|
133
140
|
div.className = 'statistic-chart-axis-label';
|
|
134
|
-
const yAxisColumn = TableUtils.getTableColumnByKey(table, y_axis_left_summary_column);
|
|
135
|
-
const labeContent = yAxisColumn ?
|
|
141
|
+
const yAxisColumn = _dtableStore.TableUtils.getTableColumnByKey(table, y_axis_left_summary_column);
|
|
142
|
+
const labeContent = yAxisColumn ? _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW[y_axis_left_summary_method]) : _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW.count);
|
|
136
143
|
div.innerHTML = labeContent;
|
|
137
144
|
const containerHeight = chartContainer.offsetHeight;
|
|
138
145
|
let textAlign = 'center';
|
|
@@ -157,8 +164,8 @@ class CombinationChart extends BaseChart {
|
|
|
157
164
|
const div = document.createElement('div');
|
|
158
165
|
div.id = yAxisRightID;
|
|
159
166
|
div.className = 'statistic-chart-axis-label';
|
|
160
|
-
const yAxisColumn = TableUtils.getTableColumnByKey(table, y_axis_right_summary_column);
|
|
161
|
-
const labeContent = yAxisColumn ?
|
|
167
|
+
const yAxisColumn = _dtableStore.TableUtils.getTableColumnByKey(table, y_axis_right_summary_column);
|
|
168
|
+
const labeContent = yAxisColumn ? _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW[y_axis_right_summary_method]) : _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW.count);
|
|
162
169
|
div.innerHTML = labeContent;
|
|
163
170
|
const containerHeight = chartContainer.offsetHeight;
|
|
164
171
|
let textAlign = 'center';
|
|
@@ -198,11 +205,11 @@ class CombinationChart extends BaseChart {
|
|
|
198
205
|
}
|
|
199
206
|
});
|
|
200
207
|
const table = getTableById(table_id);
|
|
201
|
-
const leftColumn = TableUtils.getTableColumnByKey(table, y_axis_left_summary_column) || {};
|
|
202
|
-
const rightColumn = TableUtils.getTableColumnByKey(table, y_axis_right_summary_column) || {};
|
|
208
|
+
const leftColumn = _dtableStore.TableUtils.getTableColumnByKey(table, y_axis_left_summary_column) || {};
|
|
209
|
+
const rightColumn = _dtableStore.TableUtils.getTableColumnByKey(table, y_axis_right_summary_column) || {};
|
|
203
210
|
this.handleAutoRange(leftColumn, rightColumn);
|
|
204
211
|
const themeColors = this.getThemeColors();
|
|
205
|
-
const currentTheme = getCurrentTheme(colorThemeName);
|
|
212
|
+
const currentTheme = (0, _commonUtils.getCurrentTheme)(colorThemeName);
|
|
206
213
|
this.setNameAxis(themeColors);
|
|
207
214
|
this.setValueAxis(themeColors);
|
|
208
215
|
this.setLegend(themeColors, table, currentTheme);
|
|
@@ -234,7 +241,7 @@ class CombinationChart extends BaseChart {
|
|
|
234
241
|
config.height = 400;
|
|
235
242
|
config.width = 700;
|
|
236
243
|
}
|
|
237
|
-
this.chart = new Chart(config);
|
|
244
|
+
this.chart = new _customG.Chart(config);
|
|
238
245
|
};
|
|
239
246
|
this.handleAutoRange = (leftColumn, rightColumn) => {
|
|
240
247
|
const {
|
|
@@ -250,8 +257,8 @@ class CombinationChart extends BaseChart {
|
|
|
250
257
|
y_axis_min_right = 0,
|
|
251
258
|
y_axis_max_right = 0
|
|
252
259
|
} = statItem;
|
|
253
|
-
const leftColumnData = leftColumn.data || DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
254
|
-
const rightColumnData = rightColumn.data || DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
260
|
+
const leftColumnData = leftColumn.data || _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
261
|
+
const rightColumnData = rightColumn.data || _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
255
262
|
let leftValueScaleOptions = {
|
|
256
263
|
formatter: value => {
|
|
257
264
|
return this.getNumberDisplayString(value, leftColumnData, y_axis_left_summary_method);
|
|
@@ -291,8 +298,8 @@ class CombinationChart extends BaseChart {
|
|
|
291
298
|
fill: themeColors.textColor
|
|
292
299
|
},
|
|
293
300
|
formatter: name => {
|
|
294
|
-
if (name === '' || name
|
|
295
|
-
return
|
|
301
|
+
if (name === '' || name === null || name === undefined) {
|
|
302
|
+
return _reactIntlUniversal.default.get(_constants.EMPTY_NAME);
|
|
296
303
|
}
|
|
297
304
|
return name;
|
|
298
305
|
}
|
|
@@ -359,8 +366,8 @@ class CombinationChart extends BaseChart {
|
|
|
359
366
|
}).adjust('dodge').tooltip('name*formatted_value_left', (name, value) => {
|
|
360
367
|
return {
|
|
361
368
|
value,
|
|
362
|
-
title: y_axis_left_summary_type
|
|
363
|
-
name: !name && typeof name !== 'number' ?
|
|
369
|
+
title: y_axis_left_summary_type === _constants.SUMMARY_TYPE.COUNT ? _reactIntlUniversal.default.get(_constants.TITLE_AMOUNT) : _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW[y_axis_left_summary_method]),
|
|
370
|
+
name: !name && typeof name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name
|
|
364
371
|
};
|
|
365
372
|
});
|
|
366
373
|
this.chart.tooltip({
|
|
@@ -385,8 +392,8 @@ class CombinationChart extends BaseChart {
|
|
|
385
392
|
this.chart.line().position('name*value_right').color(currentTheme && currentTheme.colors[1]).size(3).tooltip('name*formatted_value_right', (name, value) => {
|
|
386
393
|
return {
|
|
387
394
|
value,
|
|
388
|
-
title: y_axis_right_summary_type
|
|
389
|
-
name: !name && typeof name !== 'number' ?
|
|
395
|
+
title: y_axis_right_summary_type === _constants.SUMMARY_TYPE.COUNT ? _reactIntlUniversal.default.get(_constants.TITLE_AMOUNT) : _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW[y_axis_right_summary_method]),
|
|
396
|
+
name: !name && typeof name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name
|
|
390
397
|
};
|
|
391
398
|
});
|
|
392
399
|
|
|
@@ -399,8 +406,8 @@ class CombinationChart extends BaseChart {
|
|
|
399
406
|
}).tooltip('name*formatted_value_right', (name, value) => {
|
|
400
407
|
return {
|
|
401
408
|
value,
|
|
402
|
-
title: y_axis_right_summary_type
|
|
403
|
-
name: !name && typeof name !== 'number' ?
|
|
409
|
+
title: y_axis_right_summary_type === _constants.SUMMARY_TYPE.COUNT ? _reactIntlUniversal.default.get(_constants.TITLE_AMOUNT) : _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW[y_axis_right_summary_method]),
|
|
410
|
+
name: !name && typeof name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name
|
|
404
411
|
};
|
|
405
412
|
});
|
|
406
413
|
};
|
|
@@ -415,12 +422,12 @@ class CombinationChart extends BaseChart {
|
|
|
415
422
|
y_axis_left_group_by_numeric_columns
|
|
416
423
|
} = statItem;
|
|
417
424
|
const legendItems = [];
|
|
418
|
-
const column1 = TableUtils.getTableColumnByKey(table, y_axis_left_summary_column) || {};
|
|
419
|
-
const column2 = TableUtils.getTableColumnByKey(table, y_axis_right_summary_column) || {};
|
|
425
|
+
const column1 = _dtableStore.TableUtils.getTableColumnByKey(table, y_axis_left_summary_column) || {};
|
|
426
|
+
const column2 = _dtableStore.TableUtils.getTableColumnByKey(table, y_axis_right_summary_column) || {};
|
|
420
427
|
if (!y_axis_left_group_by_multiple_numeric_column) {
|
|
421
428
|
legendItems.push({
|
|
422
429
|
value: 'value_left',
|
|
423
|
-
name: column1.name ||
|
|
430
|
+
name: column1.name || _reactIntlUniversal.default.get(_constants.LEGEND_LEFT),
|
|
424
431
|
marker: {
|
|
425
432
|
symbol: 'square',
|
|
426
433
|
style: {
|
|
@@ -430,7 +437,7 @@ class CombinationChart extends BaseChart {
|
|
|
430
437
|
}
|
|
431
438
|
}, {
|
|
432
439
|
value: 'value_right',
|
|
433
|
-
name: column2.name ||
|
|
440
|
+
name: column2.name || _reactIntlUniversal.default.get(_constants.LEGEND_RIGHT),
|
|
434
441
|
marker: {
|
|
435
442
|
symbol: 'hyphen',
|
|
436
443
|
style: {
|
|
@@ -443,9 +450,9 @@ class CombinationChart extends BaseChart {
|
|
|
443
450
|
} else {
|
|
444
451
|
legendItems.push({
|
|
445
452
|
value: 'value_left',
|
|
446
|
-
name: column1.name ||
|
|
453
|
+
name: column1.name || _reactIntlUniversal.default.get(_constants.LEGEND_LEFT),
|
|
447
454
|
marker: {
|
|
448
|
-
fill: LABEL_COLORS[0],
|
|
455
|
+
fill: _constants.LABEL_COLORS[0],
|
|
449
456
|
symbol: 'square',
|
|
450
457
|
style: {
|
|
451
458
|
r: 5
|
|
@@ -453,14 +460,14 @@ class CombinationChart extends BaseChart {
|
|
|
453
460
|
}
|
|
454
461
|
});
|
|
455
462
|
y_axis_left_group_by_numeric_columns.forEach((item, index) => {
|
|
456
|
-
const column = TableUtils.getTableColumnByKey(table, item.column_key) || {};
|
|
463
|
+
const column = _dtableStore.TableUtils.getTableColumnByKey(table, item.column_key) || {};
|
|
457
464
|
legendItems.push({
|
|
458
465
|
value: 'group_name',
|
|
459
|
-
name: column.name ||
|
|
466
|
+
name: column.name || _reactIntlUniversal.default.get(_constants.LEGEND_LEFT),
|
|
460
467
|
marker: {
|
|
461
468
|
symbol: 'square',
|
|
462
469
|
style: {
|
|
463
|
-
fill: LABEL_COLORS[(index + 1) % 12],
|
|
470
|
+
fill: _constants.LABEL_COLORS[(index + 1) % 12],
|
|
464
471
|
r: 5
|
|
465
472
|
}
|
|
466
473
|
}
|
|
@@ -468,7 +475,7 @@ class CombinationChart extends BaseChart {
|
|
|
468
475
|
});
|
|
469
476
|
legendItems.push({
|
|
470
477
|
value: 'value_right',
|
|
471
|
-
name: column2.name ||
|
|
478
|
+
name: column2.name || _reactIntlUniversal.default.get(_constants.LEGEND_RIGHT),
|
|
472
479
|
marker: {
|
|
473
480
|
symbol: 'hyphen',
|
|
474
481
|
style: {
|
|
@@ -526,7 +533,7 @@ class CombinationChart extends BaseChart {
|
|
|
526
533
|
show_y_axis_left_label,
|
|
527
534
|
show_x_axis_label
|
|
528
535
|
} = statItem;
|
|
529
|
-
return /*#__PURE__*/
|
|
536
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isCalculatingData && this.renderLoading(), showResultDescription && this.renderEmpty(), /*#__PURE__*/_react.default.createElement("div", {
|
|
530
537
|
ref: ref => this.container = ref,
|
|
531
538
|
style: {
|
|
532
539
|
padding: show_y_axis_left_label || show_x_axis_label ? 30 : 20
|
|
@@ -536,4 +543,4 @@ class CombinationChart extends BaseChart {
|
|
|
536
543
|
}
|
|
537
544
|
}
|
|
538
545
|
CombinationChart.propTypes = propTypes;
|
|
539
|
-
|
|
546
|
+
var _default = exports.default = CombinationChart;
|
|
@@ -1,23 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
11
|
+
var _dtableStore = require("dtable-store");
|
|
12
|
+
var _baseChart = _interopRequireDefault(require("./base-chart"));
|
|
13
|
+
var _customG = require("../custom-g2");
|
|
14
|
+
var _commonUtils = require("../utils/common-utils");
|
|
15
|
+
var _basicChartUtils = require("../utils/basic-chart-utils");
|
|
16
|
+
var _constants = require("../constants");
|
|
10
17
|
const propTypes = {
|
|
11
|
-
isPreview:
|
|
12
|
-
isEdit:
|
|
13
|
-
colorThemeName:
|
|
14
|
-
statItem:
|
|
15
|
-
chartCalculator:
|
|
16
|
-
eventBus:
|
|
17
|
-
getTableById:
|
|
18
|
-
toggleStatisticRecordsDialog:
|
|
18
|
+
isPreview: _propTypes.default.bool,
|
|
19
|
+
isEdit: _propTypes.default.bool,
|
|
20
|
+
colorThemeName: _propTypes.default.string,
|
|
21
|
+
statItem: _propTypes.default.object,
|
|
22
|
+
chartCalculator: _propTypes.default.object,
|
|
23
|
+
eventBus: _propTypes.default.object,
|
|
24
|
+
getTableById: _propTypes.default.func,
|
|
25
|
+
toggleStatisticRecordsDialog: _propTypes.default.func
|
|
19
26
|
};
|
|
20
|
-
class CompareChart extends
|
|
27
|
+
class CompareChart extends _baseChart.default {
|
|
21
28
|
constructor(props) {
|
|
22
29
|
super(props);
|
|
23
30
|
this.drawChart = data => {
|
|
@@ -36,11 +43,11 @@ class CompareChart extends BaseChart {
|
|
|
36
43
|
this.chart.on('interval:click', e => {
|
|
37
44
|
this.props.toggleStatisticRecordsDialog(e.data.data, statItem);
|
|
38
45
|
});
|
|
39
|
-
let summaryColumnData = DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
40
|
-
if (y_axis_summary_type === SUMMARY_TYPE.ADVANCED) {
|
|
46
|
+
let summaryColumnData = _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
47
|
+
if (y_axis_summary_type === _constants.SUMMARY_TYPE.ADVANCED) {
|
|
41
48
|
const table = getTableById(table_id);
|
|
42
|
-
const summaryColumn = TableUtils.getTableColumnByKey(table, y_axis_column_key) || {};
|
|
43
|
-
summaryColumnData = summaryColumn.data || DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
49
|
+
const summaryColumn = _dtableStore.TableUtils.getTableColumnByKey(table, y_axis_column_key) || {};
|
|
50
|
+
summaryColumnData = summaryColumn.data || _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
44
51
|
}
|
|
45
52
|
this.chart.data(data, {
|
|
46
53
|
'name': {
|
|
@@ -51,7 +58,7 @@ class CompareChart extends BaseChart {
|
|
|
51
58
|
const {
|
|
52
59
|
width
|
|
53
60
|
} = this.chart.coordinateBBox;
|
|
54
|
-
const chartData = getChartGroups(data);
|
|
61
|
+
const chartData = (0, _basicChartUtils.getChartGroups)(data);
|
|
55
62
|
const ticks = this.getTicks(chartData, width);
|
|
56
63
|
if (ticks.length > 0) {
|
|
57
64
|
this.chart.scale('name', {
|
|
@@ -67,7 +74,7 @@ class CompareChart extends BaseChart {
|
|
|
67
74
|
type: 'cat'
|
|
68
75
|
}
|
|
69
76
|
});
|
|
70
|
-
const currentTheme = getCurrentTheme(colorThemeName);
|
|
77
|
+
const currentTheme = (0, _commonUtils.getCurrentTheme)(colorThemeName);
|
|
71
78
|
const themeColors = this.getThemeColors();
|
|
72
79
|
this.drawBar({
|
|
73
80
|
currentTheme,
|
|
@@ -104,7 +111,7 @@ class CompareChart extends BaseChart {
|
|
|
104
111
|
config.height = 400;
|
|
105
112
|
config.width = 700;
|
|
106
113
|
}
|
|
107
|
-
this.chart = new Chart(config);
|
|
114
|
+
this.chart = new _customG.Chart(config);
|
|
108
115
|
};
|
|
109
116
|
this.handleAutoRange = (data, summaryColumnData) => {
|
|
110
117
|
const {
|
|
@@ -120,7 +127,7 @@ class CompareChart extends BaseChart {
|
|
|
120
127
|
};
|
|
121
128
|
|
|
122
129
|
// eslint-disable-next-line
|
|
123
|
-
if (y_axis_auto_range
|
|
130
|
+
if (y_axis_auto_range === undefined || y_axis_auto_range === null || y_axis_auto_range) {
|
|
124
131
|
valueScaleOptions = Object.assign(valueScaleOptions, {
|
|
125
132
|
nice: true
|
|
126
133
|
});
|
|
@@ -162,8 +169,8 @@ class CompareChart extends BaseChart {
|
|
|
162
169
|
fill: themeColors.textColor
|
|
163
170
|
}
|
|
164
171
|
}).position('name*value').color('group_name', currentTheme && currentTheme.colors).tooltip('name*formatted_value*raw_name', (name, value, raw_name) => {
|
|
165
|
-
const nameContent = !raw_name && typeof raw_name !== 'number' ?
|
|
166
|
-
const titleContent = y_axis_summary_type === 'count' ?
|
|
172
|
+
const nameContent = !raw_name && typeof raw_name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : raw_name;
|
|
173
|
+
const titleContent = y_axis_summary_type === 'count' ? _reactIntlUniversal.default.get(_constants.TITLE_AMOUNT) : _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW[y_axis_summary_method]);
|
|
167
174
|
return {
|
|
168
175
|
value,
|
|
169
176
|
title: titleContent,
|
|
@@ -199,11 +206,11 @@ class CompareChart extends BaseChart {
|
|
|
199
206
|
} = this.props.statItem;
|
|
200
207
|
this.chart.line().position('name*increase_value').size(3).color(increase_line_color || '#fbd44a').shape('smooth').tooltip('name*increase_value', (name, value) => {
|
|
201
208
|
return {
|
|
202
|
-
title:
|
|
209
|
+
title: _reactIntlUniversal.default.get(_constants.TITLE_INCREASE),
|
|
203
210
|
value: this.getNumberDisplayString(value || 0, {
|
|
204
211
|
format: 'percent'
|
|
205
212
|
}),
|
|
206
|
-
name: !name && typeof name !== 'number' ?
|
|
213
|
+
name: !name && typeof name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name
|
|
207
214
|
};
|
|
208
215
|
});
|
|
209
216
|
this.chart.point().label(display_increase_percentage ? 'increase_value' : false, value => {
|
|
@@ -217,11 +224,11 @@ class CompareChart extends BaseChart {
|
|
|
217
224
|
};
|
|
218
225
|
}).color(increase_line_color || '#fbd44a').position('name*increase_value').size(3).tooltip('name*increase_value', (name, value) => {
|
|
219
226
|
return {
|
|
220
|
-
title:
|
|
227
|
+
title: _reactIntlUniversal.default.get(_constants.TITLE_INCREASE),
|
|
221
228
|
value: this.getNumberDisplayString(value || 0, {
|
|
222
229
|
format: 'percent'
|
|
223
230
|
}),
|
|
224
|
-
name: !name && typeof name !== 'number' ?
|
|
231
|
+
name: !name && typeof name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name
|
|
225
232
|
};
|
|
226
233
|
});
|
|
227
234
|
this.chart.axis('increase_value', {
|
|
@@ -266,7 +273,7 @@ class CompareChart extends BaseChart {
|
|
|
266
273
|
fill: themeColors.textColor
|
|
267
274
|
},
|
|
268
275
|
formatter: name => {
|
|
269
|
-
return !name && typeof name !== 'number' ?
|
|
276
|
+
return !name && typeof name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name;
|
|
270
277
|
}
|
|
271
278
|
},
|
|
272
279
|
pageNavigator: {
|
|
@@ -315,7 +322,7 @@ class CompareChart extends BaseChart {
|
|
|
315
322
|
const div = document.createElement('div');
|
|
316
323
|
div.id = xAxisID;
|
|
317
324
|
div.className = 'statistic-chart-axis-label';
|
|
318
|
-
const column = TableUtils.getTableColumnByKey(table, x_axis_column_key);
|
|
325
|
+
const column = _dtableStore.TableUtils.getTableColumnByKey(table, x_axis_column_key);
|
|
319
326
|
div.innerHTML = "".concat(column ? column.name : '');
|
|
320
327
|
div.setAttribute('style', "color:".concat(textColor, "; width: 100%; padding-left: ").concat(autoPadding.left, "px; text-align: ").concat(x_axis_label_position, "; bottom: -20px"));
|
|
321
328
|
chartContainer.appendChild(div);
|
|
@@ -333,10 +340,10 @@ class CompareChart extends BaseChart {
|
|
|
333
340
|
const div = document.createElement('div');
|
|
334
341
|
div.id = yAxisID;
|
|
335
342
|
div.className = 'statistic-chart-axis-label';
|
|
336
|
-
if (y_axis_summary_type === SUMMARY_TYPE.COUNT) {
|
|
337
|
-
div.innerHTML =
|
|
343
|
+
if (y_axis_summary_type === _constants.SUMMARY_TYPE.COUNT) {
|
|
344
|
+
div.innerHTML = _reactIntlUniversal.default.get(_constants.TITLE_AMOUNT);
|
|
338
345
|
} else {
|
|
339
|
-
const column = TableUtils.getTableColumnByKey(table, y_axis_column_key) || {};
|
|
346
|
+
const column = _dtableStore.TableUtils.getTableColumnByKey(table, y_axis_column_key) || {};
|
|
340
347
|
div.innerHTML = column.name || '';
|
|
341
348
|
}
|
|
342
349
|
const containerHeight = chartContainer.offsetHeight;
|
|
@@ -373,7 +380,7 @@ class CompareChart extends BaseChart {
|
|
|
373
380
|
chartCalculator,
|
|
374
381
|
eventBus
|
|
375
382
|
} = this.props;
|
|
376
|
-
this.unsubscribeStyleChange = eventBus.subscribe(LABEL_CONFIG_CHANGED, newStatItem => {
|
|
383
|
+
this.unsubscribeStyleChange = eventBus.subscribe(_constants.LABEL_CONFIG_CHANGED, newStatItem => {
|
|
377
384
|
this.renderAxisLabel(newStatItem);
|
|
378
385
|
});
|
|
379
386
|
if (this.container) {
|
|
@@ -463,7 +470,7 @@ class CompareChart extends BaseChart {
|
|
|
463
470
|
show_y_axis_label,
|
|
464
471
|
show_x_axis_label
|
|
465
472
|
} = statItem;
|
|
466
|
-
return /*#__PURE__*/
|
|
473
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isCalculatingData && this.renderLoading(), showResultDescription && this.renderEmpty(), /*#__PURE__*/_react.default.createElement("div", {
|
|
467
474
|
ref: ref => this.container = ref,
|
|
468
475
|
style: {
|
|
469
476
|
padding: show_y_axis_label || show_x_axis_label ? 30 : 20
|
|
@@ -473,4 +480,4 @@ class CompareChart extends BaseChart {
|
|
|
473
480
|
}
|
|
474
481
|
}
|
|
475
482
|
CompareChart.propTypes = propTypes;
|
|
476
|
-
|
|
483
|
+
var _default = exports.default = CompareChart;
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
11
|
+
var _dtableStore = require("dtable-store");
|
|
12
|
+
var _baseChart = _interopRequireDefault(require("./base-chart"));
|
|
13
|
+
var _customG = require("../custom-g2");
|
|
14
|
+
var _commonUtils = require("../utils/common-utils");
|
|
15
|
+
var _constants = require("../constants");
|
|
9
16
|
const propTypes = {
|
|
10
|
-
isPreview:
|
|
11
|
-
isEdit:
|
|
12
|
-
colorThemeName:
|
|
13
|
-
statItem:
|
|
14
|
-
chartCalculator:
|
|
15
|
-
getTableById:
|
|
16
|
-
toggleStatisticRecordsDialog:
|
|
17
|
+
isPreview: _propTypes.default.bool,
|
|
18
|
+
isEdit: _propTypes.default.bool,
|
|
19
|
+
colorThemeName: _propTypes.default.string,
|
|
20
|
+
statItem: _propTypes.default.object,
|
|
21
|
+
chartCalculator: _propTypes.default.object,
|
|
22
|
+
getTableById: _propTypes.default.func,
|
|
23
|
+
toggleStatisticRecordsDialog: _propTypes.default.func
|
|
17
24
|
};
|
|
18
|
-
class CompletenessChart extends
|
|
25
|
+
class CompletenessChart extends _baseChart.default {
|
|
19
26
|
constructor(props) {
|
|
20
27
|
super(props);
|
|
21
28
|
this.destroyChart = () => {
|
|
@@ -23,14 +30,14 @@ class CompletenessChart extends BaseChart {
|
|
|
23
30
|
this.chart = null;
|
|
24
31
|
};
|
|
25
32
|
this.sortData = (data, sortType) => {
|
|
26
|
-
const compareCompleteness = sortType
|
|
33
|
+
const compareCompleteness = sortType === 'ascending' ? function (a, b) {
|
|
27
34
|
return a - b;
|
|
28
35
|
} : function (a, b) {
|
|
29
36
|
return b - a;
|
|
30
37
|
};
|
|
31
38
|
const sortBy = (a, b) => {
|
|
32
39
|
if (a.name === b.name) {
|
|
33
|
-
return a.type
|
|
40
|
+
return a.type === 'completed' ? -1 : 1;
|
|
34
41
|
}
|
|
35
42
|
const aCompleteness = a.current_value / a.target_value;
|
|
36
43
|
const bCompleteness = b.current_value / b.target_value;
|
|
@@ -50,12 +57,12 @@ class CompletenessChart extends BaseChart {
|
|
|
50
57
|
target_column,
|
|
51
58
|
table_id
|
|
52
59
|
} = statItem;
|
|
53
|
-
const isGroupChart = statItem.type === STAT_TYPE.GROUP_COMPLETENESS_CHART;
|
|
54
|
-
const currentTheme = getCurrentTheme(colorThemeName);
|
|
60
|
+
const isGroupChart = statItem.type === _constants.STAT_TYPE.GROUP_COMPLETENESS_CHART;
|
|
61
|
+
const currentTheme = (0, _commonUtils.getCurrentTheme)(colorThemeName);
|
|
55
62
|
this.initChartHandler();
|
|
56
63
|
const selectedTable = getTableById(table_id);
|
|
57
|
-
const completedColumn = TableUtils.getTableColumnByKey(selectedTable, completed_column);
|
|
58
|
-
const targetColumn = TableUtils.getTableColumnByKey(selectedTable, target_column);
|
|
64
|
+
const completedColumn = _dtableStore.TableUtils.getTableColumnByKey(selectedTable, completed_column);
|
|
65
|
+
const targetColumn = _dtableStore.TableUtils.getTableColumnByKey(selectedTable, target_column);
|
|
59
66
|
|
|
60
67
|
// 数据颜色映射value设置当前主题色
|
|
61
68
|
if (isGroupChart) {
|
|
@@ -114,7 +121,7 @@ class CompletenessChart extends BaseChart {
|
|
|
114
121
|
config.height = 400;
|
|
115
122
|
config.width = 700;
|
|
116
123
|
}
|
|
117
|
-
this.chart = new Chart(config);
|
|
124
|
+
this.chart = new _customG.Chart(config);
|
|
118
125
|
};
|
|
119
126
|
this.handleAutoRange = targetColumn => {
|
|
120
127
|
const {
|
|
@@ -188,17 +195,17 @@ class CompletenessChart extends BaseChart {
|
|
|
188
195
|
}
|
|
189
196
|
return data.colorMap[group_label];
|
|
190
197
|
}).adjust(adjustType).tooltip('name*current_value*target_value*type', (name, current_value, target_value, type) => {
|
|
191
|
-
let tooltipName =
|
|
198
|
+
let tooltipName = _reactIntlUniversal.default.get('Completed');
|
|
192
199
|
let value;
|
|
193
200
|
if (type === 'uncompleted') {
|
|
194
|
-
tooltipName =
|
|
201
|
+
tooltipName = _reactIntlUniversal.default.get('Uncompleted');
|
|
195
202
|
value = this.getNumberDisplayString(target_value - current_value, targetColumn.data);
|
|
196
203
|
} else {
|
|
197
204
|
value = this.getNumberDisplayString(current_value, completedColumn.data);
|
|
198
205
|
}
|
|
199
206
|
let tooltipTitle = name;
|
|
200
207
|
if (!tooltipTitle && typeof tooltipTitle !== 'number') {
|
|
201
|
-
tooltipTitle =
|
|
208
|
+
tooltipTitle = _reactIntlUniversal.default.get(_constants.EMPTY_NAME);
|
|
202
209
|
}
|
|
203
210
|
return {
|
|
204
211
|
title: tooltipTitle,
|
|
@@ -231,7 +238,7 @@ class CompletenessChart extends BaseChart {
|
|
|
231
238
|
formatter: name => {
|
|
232
239
|
let label = name;
|
|
233
240
|
if (!name && typeof name !== 'number') {
|
|
234
|
-
label =
|
|
241
|
+
label = _reactIntlUniversal.default.get(_constants.EMPTY_NAME);
|
|
235
242
|
}
|
|
236
243
|
return label;
|
|
237
244
|
},
|
|
@@ -265,7 +272,7 @@ class CompletenessChart extends BaseChart {
|
|
|
265
272
|
fill: themeColors.textColor
|
|
266
273
|
},
|
|
267
274
|
formatter: name => {
|
|
268
|
-
return !name && typeof name !== 'number' ?
|
|
275
|
+
return !name && typeof name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name;
|
|
269
276
|
}
|
|
270
277
|
},
|
|
271
278
|
pageNavigator: {
|
|
@@ -370,7 +377,7 @@ class CompletenessChart extends BaseChart {
|
|
|
370
377
|
isCalculatingData,
|
|
371
378
|
showResultDescription
|
|
372
379
|
} = this.state;
|
|
373
|
-
return /*#__PURE__*/
|
|
380
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isCalculatingData && this.renderLoading(), showResultDescription && this.renderEmpty(), /*#__PURE__*/_react.default.createElement("div", {
|
|
374
381
|
ref: ref => this.container = ref,
|
|
375
382
|
style: {
|
|
376
383
|
padding: 20
|
|
@@ -380,4 +387,4 @@ class CompletenessChart extends BaseChart {
|
|
|
380
387
|
}
|
|
381
388
|
}
|
|
382
389
|
CompletenessChart.propTypes = propTypes;
|
|
383
|
-
|
|
390
|
+
var _default = exports.default = CompletenessChart;
|