dtable-statistic 4.3.3 → 4.3.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/api/dtable-db-api.js +3 -10
- package/es/calculator/base-calculator.js +12 -20
- package/es/calculator/basic-chart-calculator.js +65 -72
- package/es/calculator/combination-calculator.js +57 -64
- package/es/calculator/compare-bar-calculator.js +26 -33
- package/es/calculator/completeness-calculator.js +30 -37
- package/es/calculator/copy-value.js +1 -7
- package/es/calculator/dashboard-calculator.js +13 -20
- package/es/calculator/heat-map-calculator.js +18 -25
- package/es/calculator/horizontal-bar-calculator.js +8 -15
- package/es/calculator/index.js +35 -42
- package/es/calculator/map-calculator.js +22 -29
- package/es/calculator/mirror-calculator.js +20 -27
- package/es/calculator/number-card-calculator.js +10 -17
- package/es/calculator/pivot-table-calculator.js +58 -65
- package/es/calculator/scatter-calculator.js +14 -21
- package/es/calculator/thread-manager.js +1 -7
- package/es/calculator/trend-calculator.js +22 -29
- package/es/calculator/workers/basic-chart-calculator-worker.js +76 -83
- package/es/calculator/workers/calculator.worker.js +30 -33
- package/es/calculator/workers/card-calculator-worker.js +13 -19
- package/es/calculator/workers/combination-calculator-worker.js +46 -53
- package/es/calculator/workers/compare-bar-chart-calculator-worker.js +22 -29
- package/es/calculator/workers/completeness-calculator-worker.js +34 -41
- package/es/calculator/workers/dashboard-calculator-worker.js +18 -24
- package/es/calculator/workers/mirror-calculator-worker.js +22 -29
- package/es/calculator/workers/pivot-table-calculator-worker.js +77 -84
- package/es/calculator/workers/scatter-calculator-worker.js +20 -27
- package/es/calculator/workers/trend-calculator-worker.js +27 -34
- package/es/calculator/world-map-calculator.js +17 -24
- package/es/components/common-add-tool.js +5 -12
- package/es/components/dialog/chart-addition-edit-dialog.js +12 -20
- package/es/components/dialog/chart-addition-widgets/chart-selector.js +101 -108
- package/es/components/dialog/color-theme-dialog.js +15 -22
- package/es/components/dialog/delete-confirmation-dialog.js +11 -18
- package/es/components/dialog/enlarged-chart-dialog.js +20 -28
- package/es/components/dialog/new-table-dialog.js +16 -23
- package/es/components/dialog/new-view-dialog.js +14 -21
- package/es/components/dialog/rename-view-dialog.js +14 -22
- package/es/components/dialog/statistic-record-dialog/index.js +37 -45
- package/es/components/dialog/statistic-types-dialog/index.js +14 -22
- package/es/components/dialog/table-select-dialog.js +15 -23
- package/es/components/dropdown-menu/statistic-dropdown-menu.js +41 -49
- package/es/components/dtable-popover.js +12 -19
- package/es/components/dtable-search-input.js +13 -21
- package/es/components/dtable-select.js +15 -21
- package/es/components/icon.js +4 -11
- package/es/components/index.js +11 -76
- package/es/components/loading.js +3 -10
- package/es/components/modal-portal.js +5 -12
- package/es/components/popover/color-rules/color-rule.js +25 -33
- package/es/components/popover/color-rules/index.js +6 -14
- package/es/components/popover/color-rules/rule-filters/filter.js +27 -34
- package/es/components/popover/color-rules/rule-filters/index.js +17 -25
- package/es/components/popover/color-rules/rule-filters/number-input.js +9 -17
- package/es/components/popover/color-rules-popover.js +24 -32
- package/es/components/popover/color-selector-popover.js +10 -17
- package/es/components/seatable-radio/index.js +9 -16
- package/es/components/select/index.js +2 -9
- package/es/components/select/option-group.js +19 -27
- package/es/components/select/option.js +6 -14
- package/es/components/select/select.js +17 -25
- package/es/components/toast/alert.js +24 -31
- package/es/components/toast/index.js +3 -10
- package/es/components/toast/toast.js +12 -20
- package/es/components/toast/toastManager.js +9 -17
- package/es/components/toast/toaster.js +6 -14
- package/es/constants/color-rules.js +6 -12
- package/es/constants/dtable-select-style.js +4 -9
- package/es/constants/event-types.js +4 -10
- package/es/constants/index.js +67 -96
- package/es/constants/key-codes.js +0 -2
- package/es/constants/map.js +2 -8
- package/es/constants/model.js +20 -26
- package/es/constants/regions.js +3 -8
- package/es/constants/zIndexes.js +1 -7
- package/es/custom-g2.js +208 -236
- package/es/dashboard.js +50 -58
- package/es/desktop-dashboard.js +47 -55
- package/es/index.js +3 -6
- package/es/locale/index.js +10 -13
- package/es/locale/lang/de.js +1 -7
- package/es/locale/lang/en.js +1 -7
- package/es/locale/lang/fr.js +1 -7
- package/es/locale/lang/zh_CN.js +1 -7
- package/es/mobile-dashboard.js +38 -46
- package/es/model/bar-group.js +11 -19
- package/es/model/bar.js +10 -18
- package/es/model/base-model.js +2 -9
- package/es/model/basic-number-card.js +8 -16
- package/es/model/collaborators.js +2 -9
- package/es/model/combination.js +12 -20
- package/es/model/compare-bar.js +16 -24
- package/es/model/completeness-group.js +8 -16
- package/es/model/completeness.js +5 -13
- package/es/model/custom-bar.js +6 -14
- package/es/model/dashboard.js +6 -14
- package/es/model/generic-model.js +133 -141
- package/es/model/heat-map.js +11 -19
- package/es/model/horizontal-bar-group.js +10 -18
- package/es/model/horizontal-bar.js +10 -18
- package/es/model/index.js +53 -185
- package/es/model/map.js +15 -23
- package/es/model/mirror.js +13 -21
- package/es/model/pie.js +10 -18
- package/es/model/ring.js +11 -19
- package/es/model/scatter.js +6 -14
- package/es/model/statistic-dashboard.js +2 -9
- package/es/model/table.js +10 -18
- package/es/model/trend.js +12 -20
- package/es/model/world-map.js +13 -21
- package/es/service/chart-service.js +7 -14
- package/es/service/dashboard-service.js +34 -41
- package/es/service/map-json.js +8 -14
- package/es/stat-editor/chart-name-editor.js +8 -15
- package/es/stat-editor/index.js +16 -24
- package/es/stat-editor/stat-settings/advance-chart-settings/basic-number-card-settings.js +21 -29
- package/es/stat-editor/stat-settings/advance-chart-settings/combination-settings.js +49 -57
- package/es/stat-editor/stat-settings/advance-chart-settings/dashboard-chart-settings.js +23 -31
- package/es/stat-editor/stat-settings/advance-chart-settings/geo-granularity-settings.js +4 -11
- package/es/stat-editor/stat-settings/advance-chart-settings/heat-map-settings.js +19 -27
- package/es/stat-editor/stat-settings/advance-chart-settings/index.js +43 -51
- package/es/stat-editor/stat-settings/advance-chart-settings/map-settings.js +23 -31
- package/es/stat-editor/stat-settings/advance-chart-settings/mirror-settings.js +23 -31
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/combination-style-setting.js +37 -45
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/heat-map-settings.js +19 -27
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/map-setting.js +26 -34
- package/es/stat-editor/stat-settings/advance-chart-settings/summary-settings.js +47 -55
- package/es/stat-editor/stat-settings/advance-chart-settings/trend-chart-settings.js +22 -30
- package/es/stat-editor/stat-settings/advance-chart-settings/world-map-settings.js +18 -26
- package/es/stat-editor/stat-settings/basic-chart-settings/advance-bar-chart-settings.js +27 -35
- package/es/stat-editor/stat-settings/basic-chart-settings/bar-settings.js +24 -32
- package/es/stat-editor/stat-settings/basic-chart-settings/completeness-chart-settings.js +33 -41
- package/es/stat-editor/stat-settings/basic-chart-settings/custom-bar-settings.js +22 -30
- package/es/stat-editor/stat-settings/basic-chart-settings/groupby-settings.js +27 -26
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-axis-group-settings.js +46 -54
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-bar-settings.js +23 -31
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-group-chart-settings.js +26 -34
- package/es/stat-editor/stat-settings/basic-chart-settings/index.js +77 -85
- package/es/stat-editor/stat-settings/basic-chart-settings/pie-settings.js +21 -29
- package/es/stat-editor/stat-settings/basic-chart-settings/pivot-table-settings.js +73 -81
- package/es/stat-editor/stat-settings/basic-chart-settings/scatter-settings.js +16 -24
- package/es/stat-editor/stat-settings/basic-chart-settings/stack-item-settings.js +19 -27
- package/es/stat-editor/stat-settings/basic-chart-settings/stacks-settings.js +18 -26
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/bar-chart-style-setting.js +49 -57
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/completeness-style.js +17 -25
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/horizontal-bar-chart-style.js +47 -55
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/label-font-size-editor.js +11 -19
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/pie-chart-style-settings.js +45 -53
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/time-compare-style.js +9 -17
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-method-setting.js +20 -28
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-settings.js +30 -38
- package/es/stat-editor/stat-settings/basic-chart-settings/time-comparison-settings.js +50 -58
- package/es/stat-editor/stat-settings/basic-chart-settings/timer-picker.js +17 -25
- package/es/stat-editor/stat-settings/basic-chart-settings/y-axis-group-settings.js +47 -55
- package/es/stat-editor/stat-settings/color-setting/color-group-selector.js +11 -19
- package/es/stat-editor/stat-settings/color-setting/color-picker.js +12 -19
- package/es/stat-editor/stat-settings/color-setting/color-use-type-selector.js +62 -70
- package/es/stat-editor/stat-settings/map/map-level.js +13 -20
- package/es/stat-editor/stat-settings/map/map-province-city.js +20 -27
- package/es/stat-editor/stat-settings/public-setting/axis-label-position-setting.js +11 -19
- package/es/stat-editor/stat-settings/public-setting/base-settings.js +20 -28
- package/es/stat-editor/stat-settings/public-setting/calender.js +22 -29
- package/es/stat-editor/stat-settings/public-setting/column-settings.js +6 -13
- package/es/stat-editor/stat-settings/public-setting/custom-title-setting.js +9 -16
- package/es/stat-editor/stat-settings/public-setting/data-sort-setting.js +13 -21
- package/es/stat-editor/stat-settings/public-setting/ind-toggle-setting.js +8 -15
- package/es/stat-editor/stat-settings/public-setting/min-max-setting.js +11 -19
- package/es/stat-editor/stat-settings/public-setting/numeric-summary-item.js +27 -35
- package/es/stat-editor/stat-settings/public-setting/toggle-setting.js +8 -15
- package/es/stat-editor/stat-settings/public-setting/type-settings/index.js +18 -26
- package/es/stat-list/chart-preview.js +20 -28
- package/es/stat-list/index.js +27 -35
- package/es/stat-view/area-chart.js +43 -50
- package/es/stat-view/bar-chart.js +47 -54
- package/es/stat-view/base-chart.js +24 -32
- package/es/stat-view/basic-number-card.js +19 -26
- package/es/stat-view/combination-chart.js +49 -56
- package/es/stat-view/compare-chart.js +39 -46
- package/es/stat-view/completeness-chart.js +28 -35
- package/es/stat-view/custom-bar.js +31 -38
- package/es/stat-view/dashboard-chart.js +15 -22
- package/es/stat-view/heat-map.js +43 -50
- package/es/stat-view/horizontal-bar-chart.js +51 -58
- package/es/stat-view/index.js +73 -80
- package/es/stat-view/line-chart.js +39 -46
- package/es/stat-view/map.js +33 -40
- package/es/stat-view/mirror.js +21 -28
- package/es/stat-view/pie-chart.js +29 -36
- package/es/stat-view/pivot-table/index.js +32 -39
- package/es/stat-view/pivot-table/one-dimension-table-no-numeric-columns.js +31 -39
- package/es/stat-view/pivot-table/one-dimension-table-with-numeric-columns.js +29 -37
- package/es/stat-view/pivot-table/pivot-table-display-name.js +46 -54
- package/es/stat-view/pivot-table/two-dimension-table.js +62 -70
- package/es/stat-view/ring-chart.js +38 -45
- package/es/stat-view/scatter-chart.js +30 -37
- package/es/stat-view/treemap-chart.js +37 -44
- package/es/stat-view/trend-chart.js +32 -39
- package/es/stat-view/world-map.js +33 -40
- package/es/tabs/index.js +32 -40
- package/es/tabs/tab.js +26 -34
- package/es/utils/basic-chart-utils.js +2 -9
- package/es/utils/cell-format.js +14 -22
- package/es/utils/cell-value.js +7 -14
- package/es/utils/collaborator.js +4 -13
- package/es/utils/color-utils.js +18 -29
- package/es/utils/column-utils.js +18 -29
- package/es/utils/column.js +4 -11
- package/es/utils/common-utils.js +41 -65
- package/es/utils/date-format.js +2 -8
- package/es/utils/export-table-utils.js +82 -91
- package/es/utils/index.js +11 -100
- package/es/utils/map.js +26 -36
- package/es/utils/model.js +6 -14
- package/es/utils/object.js +6 -15
- package/es/utils/pivot-table.js +16 -23
- package/es/utils/row-utils.js +23 -33
- package/es/utils/search.js +21 -29
- package/es/utils/sql-utils.js +65 -75
- package/es/utils/stat-utils.js +60 -66
- package/es/utils/trend-utils.js +32 -40
- package/package.json +1 -1
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _dtableStore = require("dtable-store");
|
|
9
|
-
var _baseCalculator = _interopRequireDefault(require("./base-calculator"));
|
|
10
|
-
var _commonUtils = require("../utils/common-utils");
|
|
11
|
-
var _constants = require("../constants");
|
|
12
|
-
var _statUtils = _interopRequireDefault(require("../utils/stat-utils"));
|
|
13
|
-
class WorldMapCalculator extends _baseCalculator.default {
|
|
1
|
+
import { filter2SqlCondition, TableUtils } from 'dtable-store';
|
|
2
|
+
import BaseCalculator from './base-calculator';
|
|
3
|
+
import { formatNumericValue, getSummaryColumnMethod } from '../utils/common-utils';
|
|
4
|
+
import { DTABLE_DB_SUMMARY_METHOD } from '../constants';
|
|
5
|
+
import StatUtils from '../utils/stat-utils';
|
|
6
|
+
class WorldMapCalculator extends BaseCalculator {
|
|
14
7
|
constructor(_ref) {
|
|
15
8
|
let {
|
|
16
9
|
value,
|
|
@@ -35,11 +28,11 @@ class WorldMapCalculator extends _baseCalculator.default {
|
|
|
35
28
|
summary_column
|
|
36
29
|
} = chart;
|
|
37
30
|
const table = this.getTableById(table_id);
|
|
38
|
-
const selectedColumn = column &&
|
|
31
|
+
const selectedColumn = column && TableUtils.getTableColumnByKey(table, column);
|
|
39
32
|
if (column && !selectedColumn) {
|
|
40
33
|
return false;
|
|
41
34
|
}
|
|
42
|
-
if (summary_column && !
|
|
35
|
+
if (summary_column && !TableUtils.getTableColumnByKey(table, summary_column)) {
|
|
43
36
|
return false;
|
|
44
37
|
}
|
|
45
38
|
return true;
|
|
@@ -63,22 +56,22 @@ class WorldMapCalculator extends _baseCalculator.default {
|
|
|
63
56
|
} = chart;
|
|
64
57
|
const selectedTable = this.getTableById(table_id);
|
|
65
58
|
const selectedView = this.getViewById(view_id, selectedTable);
|
|
66
|
-
const selectedColumn =
|
|
59
|
+
const selectedColumn = TableUtils.getTableColumnByKey(selectedTable, column);
|
|
67
60
|
if (!selectedColumn) return [];
|
|
68
61
|
const columnName = selectedColumn.name;
|
|
69
62
|
const isAdvanced = summary_type === 'advanced';
|
|
70
|
-
const method = isAdvanced ?
|
|
71
|
-
const sqlCondition =
|
|
63
|
+
const method = isAdvanced ? DTABLE_DB_SUMMARY_METHOD[summary_method] : 'COUNT';
|
|
64
|
+
const sqlCondition = filter2SqlCondition(selectedTable, selectedView);
|
|
72
65
|
let summaryColumnName = '';
|
|
73
66
|
let summaryColumn;
|
|
74
67
|
let sqlString = '';
|
|
75
68
|
if (isAdvanced) {
|
|
76
|
-
summaryColumn =
|
|
69
|
+
summaryColumn = TableUtils.getTableColumnByKey(selectedTable, summary_column);
|
|
77
70
|
if (!summaryColumn) {
|
|
78
71
|
return [];
|
|
79
72
|
}
|
|
80
73
|
summaryColumnName = summaryColumn.name;
|
|
81
|
-
const summaryColumnMethod =
|
|
74
|
+
const summaryColumnMethod = getSummaryColumnMethod(method, summaryColumnName);
|
|
82
75
|
sqlString = "select `".concat(columnName, "`, ").concat(summaryColumnMethod, " from ").concat(selectedTable.name, " ").concat(sqlCondition, " group by ").concat(columnName, " limit 5000");
|
|
83
76
|
} else {
|
|
84
77
|
sqlString = "select `".concat(columnName, "`, ").concat(method, "(").concat(columnName, ") from ").concat(selectedTable.name, " ").concat(sqlCondition, " group by ").concat(columnName, " limit 5000");
|
|
@@ -88,15 +81,15 @@ class WorldMapCalculator extends _baseCalculator.default {
|
|
|
88
81
|
const data = result.data;
|
|
89
82
|
if (!data.results) return [];
|
|
90
83
|
const newResult = [];
|
|
91
|
-
const summaryColumnMethod =
|
|
84
|
+
const summaryColumnMethod = getSummaryColumnMethod(method, summaryColumnName);
|
|
92
85
|
const valueKey = isAdvanced ? "".concat(summaryColumnMethod) : "".concat(method, "(").concat(columnName, ")");
|
|
93
86
|
data.results.forEach(item => {
|
|
94
87
|
const currentValue = item[column];
|
|
95
88
|
let value = item[valueKey];
|
|
96
89
|
let formatted_value = value;
|
|
97
90
|
if (isAdvanced) {
|
|
98
|
-
value =
|
|
99
|
-
formatted_value =
|
|
91
|
+
value = formatNumericValue(value, summaryColumn);
|
|
92
|
+
formatted_value = StatUtils.getFormattedValue(value, summaryColumn, summary_method);
|
|
100
93
|
}
|
|
101
94
|
if (currentValue) {
|
|
102
95
|
const name = typeof currentValue === 'string' ? currentValue : currentValue.country_region;
|
|
@@ -135,4 +128,4 @@ class WorldMapCalculator extends _baseCalculator.default {
|
|
|
135
128
|
};
|
|
136
129
|
}
|
|
137
130
|
}
|
|
138
|
-
|
|
131
|
+
export default WorldMapCalculator;
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
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"));
|
|
1
|
+
import React from 'react';
|
|
9
2
|
function CommonAddTool(props) {
|
|
10
3
|
const {
|
|
11
4
|
callBack,
|
|
@@ -13,16 +6,16 @@ function CommonAddTool(props) {
|
|
|
13
6
|
className,
|
|
14
7
|
addIconClassName
|
|
15
8
|
} = props;
|
|
16
|
-
return /*#__PURE__*/
|
|
9
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
17
10
|
className: "add-item-btn ".concat(className ? className : ''),
|
|
18
11
|
onClick: e => {
|
|
19
12
|
callBack(e);
|
|
20
13
|
}
|
|
21
|
-
}, /*#__PURE__*/
|
|
14
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
22
15
|
className: "dtable-font dtable-icon-add-table ".concat(addIconClassName || '')
|
|
23
|
-
}), /*#__PURE__*/
|
|
16
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
24
17
|
className: "add-new-option text-truncate",
|
|
25
18
|
title: footerName
|
|
26
19
|
}, footerName));
|
|
27
20
|
}
|
|
28
|
-
|
|
21
|
+
export default CommonAddTool;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
11
|
-
var _reactstrap = require("reactstrap");
|
|
12
|
-
var _chartSelector = _interopRequireDefault(require("./chart-addition-widgets/chart-selector"));
|
|
13
|
-
var _statEditor = _interopRequireDefault(require("../../stat-editor"));
|
|
14
|
-
class ChartAdditionEditDialog extends _react.Component {
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import intl from 'react-intl-universal';
|
|
3
|
+
import { Modal, ModalHeader, ModalBody } from 'reactstrap';
|
|
4
|
+
import ChartSelector from './chart-addition-widgets/chart-selector';
|
|
5
|
+
import StatEditor from '../../stat-editor';
|
|
6
|
+
class ChartAdditionEditDialog extends Component {
|
|
15
7
|
constructor(props) {
|
|
16
8
|
super(props);
|
|
17
9
|
this.addChart = chartType => {
|
|
@@ -58,16 +50,16 @@ class ChartAdditionEditDialog extends _react.Component {
|
|
|
58
50
|
chart
|
|
59
51
|
} = this.state;
|
|
60
52
|
const editMode = !!chart;
|
|
61
|
-
return /*#__PURE__*/
|
|
53
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
62
54
|
isOpen: true,
|
|
63
55
|
toggle: this.props.hideChartAdditionDialog,
|
|
64
56
|
className: "statistic-chart-addition-dialog",
|
|
65
57
|
zIndex: 1048
|
|
66
|
-
}, /*#__PURE__*/
|
|
58
|
+
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
67
59
|
toggle: this.props.hideChartAdditionDialog
|
|
68
|
-
},
|
|
60
|
+
}, intl.get(editMode ? 'Edit_the_chart' : 'Choose_a_chart')), /*#__PURE__*/React.createElement(ModalBody, {
|
|
69
61
|
className: "statistic-modal-body"
|
|
70
|
-
}, editMode ? /*#__PURE__*/
|
|
62
|
+
}, editMode ? /*#__PURE__*/React.createElement(StatEditor, {
|
|
71
63
|
dtableChangedTime: this.props.dtableChangedTime,
|
|
72
64
|
colorThemeName: colorThemeName,
|
|
73
65
|
statItem: chart,
|
|
@@ -82,9 +74,9 @@ class ChartAdditionEditDialog extends _react.Component {
|
|
|
82
74
|
modifyChartName: this.modifyChartName,
|
|
83
75
|
modifyChart: this.modifyChart,
|
|
84
76
|
toggleStatisticRecordsDialog: this.props.toggleStatisticRecordsDialog
|
|
85
|
-
}) : /*#__PURE__*/
|
|
77
|
+
}) : /*#__PURE__*/React.createElement(ChartSelector, {
|
|
86
78
|
addEditingChart: this.addChart
|
|
87
79
|
})));
|
|
88
80
|
}
|
|
89
81
|
}
|
|
90
|
-
|
|
82
|
+
export default ChartAdditionEditDialog;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _reactstrap = require("reactstrap");
|
|
10
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
11
|
-
var _constants = require("../../../constants");
|
|
12
|
-
var _commonUtils = require("../../../utils/common-utils");
|
|
13
|
-
var _statisticChartSelectorModule = _interopRequireDefault(require("./statistic-chart-selector.module.css"));
|
|
14
|
-
class ChartSelector extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UncontrolledTooltip } from 'reactstrap';
|
|
3
|
+
import intl from 'react-intl-universal';
|
|
4
|
+
import { STAT_TYPE } from '../../../constants';
|
|
5
|
+
import { getImageUrl } from '../../../utils/common-utils';
|
|
6
|
+
import styles from './statistic-chart-selector.module.css';
|
|
7
|
+
class ChartSelector extends React.Component {
|
|
15
8
|
constructor(props) {
|
|
16
9
|
super(props);
|
|
17
10
|
this.setCurrentCatIndex = (index, e) => {
|
|
@@ -28,177 +21,177 @@ class ChartSelector extends _react.default.Component {
|
|
|
28
21
|
};
|
|
29
22
|
const lang = window.dtable && window.dtable.lang || 'zh-cn';
|
|
30
23
|
this.chartTypes = [{
|
|
31
|
-
catTitle:
|
|
24
|
+
catTitle: intl.get('Histogram'),
|
|
32
25
|
icon: 'dtable-icon-histogram',
|
|
33
26
|
items: [{
|
|
34
|
-
type:
|
|
35
|
-
title:
|
|
27
|
+
type: STAT_TYPE.BAR,
|
|
28
|
+
title: intl.get('Basic_histogram'),
|
|
36
29
|
image: 'bar.png'
|
|
37
30
|
}, {
|
|
38
|
-
type:
|
|
39
|
-
title:
|
|
31
|
+
type: STAT_TYPE.BAR_GROUP,
|
|
32
|
+
title: intl.get('Grouped_histogram'),
|
|
40
33
|
image: 'bar-group.png'
|
|
41
34
|
}, {
|
|
42
|
-
type:
|
|
43
|
-
title:
|
|
35
|
+
type: STAT_TYPE.BAR_STACK,
|
|
36
|
+
title: intl.get('Stacked_histogram'),
|
|
44
37
|
image: 'bar-stack.png'
|
|
45
38
|
}, {
|
|
46
|
-
type:
|
|
47
|
-
title:
|
|
39
|
+
type: STAT_TYPE.COMPARE_BAR,
|
|
40
|
+
title: intl.get('Time_comparison_histogram'),
|
|
48
41
|
image: 'compared-chart.png'
|
|
49
42
|
}, {
|
|
50
|
-
type:
|
|
51
|
-
title:
|
|
43
|
+
type: STAT_TYPE.CUSTOM_BAR,
|
|
44
|
+
title: intl.get('Custom_histogram'),
|
|
52
45
|
image: 'custom-bar.png'
|
|
53
46
|
}]
|
|
54
47
|
}, {
|
|
55
|
-
catTitle:
|
|
48
|
+
catTitle: intl.get('Bar_chart'),
|
|
56
49
|
icon: 'dtable-icon-bar-chart',
|
|
57
50
|
items: [{
|
|
58
|
-
type:
|
|
59
|
-
title:
|
|
51
|
+
type: STAT_TYPE.HORIZONTAL_BAR,
|
|
52
|
+
title: intl.get('Basic_bar_chart'),
|
|
60
53
|
image: 'horizontal-bar.png'
|
|
61
54
|
}, {
|
|
62
|
-
type:
|
|
63
|
-
title:
|
|
55
|
+
type: STAT_TYPE.HORIZONTAL_GROUP_BAR,
|
|
56
|
+
title: intl.get('Grouped_bar_chart'),
|
|
64
57
|
image: 'horizontal-group-bar.png'
|
|
65
58
|
}, {
|
|
66
|
-
type:
|
|
67
|
-
title:
|
|
59
|
+
type: STAT_TYPE.STACKED_HORIZONTAL_BAR,
|
|
60
|
+
title: intl.get('Stacked_bar_chart'),
|
|
68
61
|
image: 'stacked-horizontal-bar.png'
|
|
69
62
|
}, {
|
|
70
|
-
type:
|
|
71
|
-
title:
|
|
63
|
+
type: STAT_TYPE.COMPLETENESS_CHART,
|
|
64
|
+
title: intl.get('Completeness_chart'),
|
|
72
65
|
image: 'completeness-chart.png'
|
|
73
66
|
}, {
|
|
74
|
-
type:
|
|
75
|
-
title:
|
|
67
|
+
type: STAT_TYPE.GROUP_COMPLETENESS_CHART,
|
|
68
|
+
title: intl.get('Grouped_completeness_chart'),
|
|
76
69
|
image: 'group-completeness-chart.png'
|
|
77
70
|
}]
|
|
78
71
|
}, {
|
|
79
|
-
catTitle:
|
|
72
|
+
catTitle: intl.get('Line_chart'),
|
|
80
73
|
icon: 'dtable-icon-line-chart',
|
|
81
74
|
items: [{
|
|
82
|
-
type:
|
|
83
|
-
title:
|
|
75
|
+
type: STAT_TYPE.LINE,
|
|
76
|
+
title: intl.get('Basic_line_chart'),
|
|
84
77
|
image: 'line.png'
|
|
85
78
|
}, {
|
|
86
|
-
type:
|
|
87
|
-
title:
|
|
79
|
+
type: STAT_TYPE.GROUP_LINE,
|
|
80
|
+
title: intl.get('Grouped_line_chart'),
|
|
88
81
|
image: 'group_line.png'
|
|
89
82
|
}]
|
|
90
83
|
}, {
|
|
91
|
-
catTitle:
|
|
84
|
+
catTitle: intl.get('Area_chart'),
|
|
92
85
|
icon: 'dtable-icon-area-chart',
|
|
93
86
|
items: [{
|
|
94
|
-
type:
|
|
95
|
-
title:
|
|
87
|
+
type: STAT_TYPE.AREA_CHART,
|
|
88
|
+
title: intl.get('Area_chart'),
|
|
96
89
|
image: 'area-chart.png'
|
|
97
90
|
}, {
|
|
98
|
-
type:
|
|
99
|
-
title:
|
|
91
|
+
type: STAT_TYPE.AREA_GROUP_CHART,
|
|
92
|
+
title: intl.get('Grouped_area_chart'),
|
|
100
93
|
image: 'area-group-chart.png'
|
|
101
94
|
}]
|
|
102
95
|
}, {
|
|
103
|
-
catTitle:
|
|
96
|
+
catTitle: intl.get('Pie_chart'),
|
|
104
97
|
icon: 'dtable-icon-pie-chart',
|
|
105
98
|
items: [{
|
|
106
|
-
type:
|
|
107
|
-
title:
|
|
99
|
+
type: STAT_TYPE.PIE,
|
|
100
|
+
title: intl.get('Basic_pie_chart'),
|
|
108
101
|
image: 'pie.png'
|
|
109
102
|
}, {
|
|
110
|
-
type:
|
|
111
|
-
title:
|
|
103
|
+
type: STAT_TYPE.RING,
|
|
104
|
+
title: intl.get('Ring_chart'),
|
|
112
105
|
image: 'ring.png'
|
|
113
106
|
}]
|
|
114
107
|
}, {
|
|
115
|
-
catTitle:
|
|
108
|
+
catTitle: intl.get('Scatter_chart'),
|
|
116
109
|
icon: 'dtable-icon-scatter-chart',
|
|
117
110
|
items: [{
|
|
118
|
-
type:
|
|
119
|
-
title:
|
|
111
|
+
type: STAT_TYPE.SCATTER,
|
|
112
|
+
title: intl.get('Scatter_chart'),
|
|
120
113
|
image: 'scatter.png'
|
|
121
114
|
}]
|
|
122
115
|
}, {
|
|
123
|
-
catTitle:
|
|
116
|
+
catTitle: intl.get('Combination_chart'),
|
|
124
117
|
icon: 'dtable-icon-combination-chart',
|
|
125
118
|
items: [{
|
|
126
|
-
type:
|
|
127
|
-
title:
|
|
119
|
+
type: STAT_TYPE.COMBINATION_CHART,
|
|
120
|
+
title: intl.get('Combination_chart'),
|
|
128
121
|
image: 'combination-chart.png'
|
|
129
122
|
}]
|
|
130
123
|
}, {
|
|
131
|
-
catTitle:
|
|
124
|
+
catTitle: intl.get('Map'),
|
|
132
125
|
icon: 'dtable-icon-map',
|
|
133
126
|
items: [{
|
|
134
|
-
type:
|
|
127
|
+
type: STAT_TYPE.MAP,
|
|
135
128
|
title: '中国地图',
|
|
136
129
|
image: 'map.png',
|
|
137
130
|
hide: lang !== 'zh-cn'
|
|
138
131
|
}, {
|
|
139
|
-
type:
|
|
132
|
+
type: STAT_TYPE.MAP_BUBBLE,
|
|
140
133
|
title: '中国地图(气泡图)',
|
|
141
134
|
image: 'map-bubble.png',
|
|
142
135
|
hide: lang !== 'zh-cn'
|
|
143
136
|
}, {
|
|
144
|
-
type:
|
|
145
|
-
title:
|
|
137
|
+
type: STAT_TYPE.WORLD_MAP,
|
|
138
|
+
title: intl.get('World_map'),
|
|
146
139
|
image: 'world-map.png'
|
|
147
140
|
}, {
|
|
148
|
-
type:
|
|
149
|
-
title: "".concat(
|
|
141
|
+
type: STAT_TYPE.WORLD_MAP_BUBBLE,
|
|
142
|
+
title: "".concat(intl.get('World_map'), "(").concat(intl.get('Bubble'), ")"),
|
|
150
143
|
image: 'world-map-bubble.png'
|
|
151
144
|
}]
|
|
152
145
|
}, {
|
|
153
|
-
catTitle:
|
|
146
|
+
catTitle: intl.get('Heat_map'),
|
|
154
147
|
icon: 'dtable-icon-heat-map',
|
|
155
148
|
items: [{
|
|
156
|
-
type:
|
|
157
|
-
title:
|
|
149
|
+
type: STAT_TYPE.HEAT_MAP,
|
|
150
|
+
title: intl.get('Heat_map'),
|
|
158
151
|
image: 'heat-map.png'
|
|
159
152
|
}]
|
|
160
153
|
}, {
|
|
161
|
-
catTitle:
|
|
154
|
+
catTitle: intl.get('Facet_chart'),
|
|
162
155
|
icon: 'dtable-icon-facet-chart',
|
|
163
156
|
items: [{
|
|
164
|
-
type:
|
|
165
|
-
title:
|
|
157
|
+
type: STAT_TYPE.MIRROR,
|
|
158
|
+
title: intl.get('Mirror_chart'),
|
|
166
159
|
image: 'mirror.png'
|
|
167
160
|
}]
|
|
168
161
|
}, {
|
|
169
|
-
catTitle:
|
|
162
|
+
catTitle: intl.get('Card'),
|
|
170
163
|
icon: 'dtable-icon-card',
|
|
171
164
|
items: [{
|
|
172
|
-
type:
|
|
173
|
-
title:
|
|
165
|
+
type: STAT_TYPE.BASIC_NUMBER_CARD,
|
|
166
|
+
title: intl.get('Basic_number_card'),
|
|
174
167
|
image: 'number-card.png'
|
|
175
168
|
}, {
|
|
176
|
-
type:
|
|
177
|
-
title:
|
|
169
|
+
type: STAT_TYPE.TREND_CHART,
|
|
170
|
+
title: intl.get('Trend_chart'),
|
|
178
171
|
image: 'trend-chart.png'
|
|
179
172
|
}]
|
|
180
173
|
}, {
|
|
181
|
-
catTitle:
|
|
174
|
+
catTitle: intl.get('Gauge'),
|
|
182
175
|
icon: 'dtable-icon-gauge',
|
|
183
176
|
items: [{
|
|
184
|
-
type:
|
|
185
|
-
title:
|
|
177
|
+
type: STAT_TYPE.DASHBOARD,
|
|
178
|
+
title: intl.get('Gauge'),
|
|
186
179
|
image: 'dashboard-chart.png'
|
|
187
180
|
}]
|
|
188
181
|
}, {
|
|
189
|
-
catTitle:
|
|
182
|
+
catTitle: intl.get('Treemap'),
|
|
190
183
|
icon: 'dtable-icon-rectangular-tree-diagram',
|
|
191
184
|
items: [{
|
|
192
|
-
type:
|
|
193
|
-
title:
|
|
185
|
+
type: STAT_TYPE.TREEMAP,
|
|
186
|
+
title: intl.get('Treemap'),
|
|
194
187
|
image: 'treemap.png'
|
|
195
188
|
}]
|
|
196
189
|
}, {
|
|
197
|
-
catTitle:
|
|
190
|
+
catTitle: intl.get('Pivot_table'),
|
|
198
191
|
icon: 'dtable-icon-dtable-logo',
|
|
199
192
|
items: [{
|
|
200
|
-
type:
|
|
201
|
-
title:
|
|
193
|
+
type: STAT_TYPE.PIVOT_TABLE,
|
|
194
|
+
title: intl.get('Pivot_table'),
|
|
202
195
|
image: 'pivot-table.png'
|
|
203
196
|
}]
|
|
204
197
|
}];
|
|
@@ -210,50 +203,50 @@ class ChartSelector extends _react.default.Component {
|
|
|
210
203
|
const {
|
|
211
204
|
currentCatIndex
|
|
212
205
|
} = this.state;
|
|
213
|
-
return /*#__PURE__*/
|
|
214
|
-
className: "".concat(
|
|
215
|
-
}, /*#__PURE__*/
|
|
216
|
-
className: "".concat(
|
|
206
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
207
|
+
className: "".concat(styles['statistic-types-container'], " d-flex flex-column h-100")
|
|
208
|
+
}, /*#__PURE__*/React.createElement("ul", {
|
|
209
|
+
className: "".concat(styles['chart-categories-nav'], " flex-shrink-0 d-flex flex-wrap align-items-center list-unstyled")
|
|
217
210
|
}, this.chartTypes.map((item, index) => {
|
|
218
|
-
return /*#__PURE__*/
|
|
211
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
219
212
|
key: index,
|
|
220
213
|
className: 'px-4 py-2 chart-cat-nav-item'
|
|
221
|
-
}, /*#__PURE__*/
|
|
214
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
222
215
|
id: item.icon,
|
|
223
|
-
className: "".concat(
|
|
216
|
+
className: "".concat(styles['chart-icon'], " dtable-font ").concat(item.icon, " ").concat(currentCatIndex === index ? "".concat(styles['icon-highlight']) : ''),
|
|
224
217
|
onClick: this.setCurrentCatIndex.bind(this, index)
|
|
225
|
-
}), /*#__PURE__*/
|
|
218
|
+
}), /*#__PURE__*/React.createElement(UncontrolledTooltip, {
|
|
226
219
|
placement: "bottom",
|
|
227
220
|
target: item.icon
|
|
228
221
|
}, item.catTitle));
|
|
229
|
-
})), /*#__PURE__*/
|
|
222
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
230
223
|
id: "chart-types-container",
|
|
231
|
-
className: "flex-fill o-auto ".concat(
|
|
224
|
+
className: "flex-fill o-auto ".concat(styles['statistic-type'])
|
|
232
225
|
}, this.chartTypes.map((item, index) => {
|
|
233
|
-
return /*#__PURE__*/
|
|
226
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
234
227
|
key: "chart-type-".concat(index),
|
|
235
228
|
className: "mb-7"
|
|
236
|
-
}, /*#__PURE__*/
|
|
237
|
-
className: "".concat(
|
|
229
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
230
|
+
className: "".concat(styles['statistic-type-title'], " m-0"),
|
|
238
231
|
id: "chart-type-".concat(index + 1)
|
|
239
|
-
}, item.catTitle), /*#__PURE__*/
|
|
232
|
+
}, item.catTitle), /*#__PURE__*/React.createElement("div", {
|
|
240
233
|
className: 'd-flex flex-wrap'
|
|
241
234
|
}, item.items.map((chart, index) => {
|
|
242
|
-
return /*#__PURE__*/
|
|
235
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
243
236
|
key: index,
|
|
244
237
|
onClick: this.props.addEditingChart.bind(this, chart.type),
|
|
245
|
-
className: "".concat(
|
|
246
|
-
}, /*#__PURE__*/
|
|
247
|
-
className: "".concat(
|
|
248
|
-
}, chart.title), /*#__PURE__*/
|
|
249
|
-
className: "".concat(
|
|
250
|
-
}, /*#__PURE__*/
|
|
251
|
-
src:
|
|
238
|
+
className: "".concat(styles['statistic-type-item'], " ").concat(selectedType === chart.type ? styles['statistic-type-item-selected'] : '', " ").concat(chart.hide ? 'd-none' : '')
|
|
239
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
240
|
+
className: "".concat(styles['statistic-type-description'])
|
|
241
|
+
}, chart.title), /*#__PURE__*/React.createElement("div", {
|
|
242
|
+
className: "".concat(styles['statistic-type-image-container'])
|
|
243
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
244
|
+
src: getImageUrl(chart.image),
|
|
252
245
|
alt: "",
|
|
253
|
-
className: "".concat(
|
|
246
|
+
className: "".concat(styles['statistic-type-demo-chart-image'])
|
|
254
247
|
})));
|
|
255
248
|
})));
|
|
256
249
|
})));
|
|
257
250
|
}
|
|
258
251
|
}
|
|
259
|
-
|
|
252
|
+
export default ChartSelector;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
11
|
-
var _reactstrap = require("reactstrap");
|
|
12
|
-
var _constants = require("../../constants");
|
|
13
|
-
require("../../assets/css/color-theme-dialog.css");
|
|
14
|
-
class ColorThemeDialog extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import intl from 'react-intl-universal';
|
|
4
|
+
import { Modal, ModalBody, ModalHeader } from 'reactstrap';
|
|
5
|
+
import { CHART_STYLE_COLORS } from '../../constants';
|
|
6
|
+
import '../../assets/css/color-theme-dialog.css';
|
|
7
|
+
class ColorThemeDialog extends React.Component {
|
|
15
8
|
constructor() {
|
|
16
9
|
super(...arguments);
|
|
17
10
|
this.onColorItemClick = colorThemeName => {
|
|
@@ -27,16 +20,16 @@ class ColorThemeDialog extends _react.default.Component {
|
|
|
27
20
|
colors
|
|
28
21
|
} = item;
|
|
29
22
|
const isActive = name === colorThemeName;
|
|
30
|
-
return /*#__PURE__*/
|
|
23
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
24
|
key: name,
|
|
32
|
-
className: (
|
|
25
|
+
className: classnames('color-theme-item', {
|
|
33
26
|
'active': isActive
|
|
34
27
|
}),
|
|
35
28
|
onClick: () => {
|
|
36
29
|
this.onColorItemClick(name);
|
|
37
30
|
}
|
|
38
31
|
}, colors.map((color, index) => {
|
|
39
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
40
33
|
className: "statistic-color-block",
|
|
41
34
|
key: "color-theme-".concat(index),
|
|
42
35
|
style: {
|
|
@@ -47,19 +40,19 @@ class ColorThemeDialog extends _react.default.Component {
|
|
|
47
40
|
};
|
|
48
41
|
}
|
|
49
42
|
render() {
|
|
50
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
51
44
|
isOpen: true,
|
|
52
45
|
autoFocus: false,
|
|
53
46
|
className: "color-theme-setting-dialog",
|
|
54
47
|
zIndex: 1048,
|
|
55
48
|
toggle: this.props.onToggleColorThemeDialog
|
|
56
|
-
}, /*#__PURE__*/
|
|
49
|
+
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
57
50
|
toggle: this.props.onToggleColorThemeDialog
|
|
58
|
-
},
|
|
51
|
+
}, intl.get('Settings')), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("label", null, intl.get('Chart_color_scheme')), /*#__PURE__*/React.createElement("div", {
|
|
59
52
|
className: "color-theme-container"
|
|
60
|
-
},
|
|
53
|
+
}, CHART_STYLE_COLORS.map(item => {
|
|
61
54
|
return this.renderColorItem(item);
|
|
62
55
|
}))));
|
|
63
56
|
}
|
|
64
57
|
}
|
|
65
|
-
|
|
58
|
+
export default ColorThemeDialog;
|