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
package/es/mobile-dashboard.js
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
11
|
-
var _tabs = _interopRequireDefault(require("./tabs"));
|
|
12
|
-
var _statView = _interopRequireDefault(require("./stat-view"));
|
|
13
|
-
var _constants = require("./constants");
|
|
14
|
-
var _icon = _interopRequireDefault(require("./assets/images/icon.png"));
|
|
15
|
-
var _mobileDashboardModule = _interopRequireDefault(require("./assets/css/mobile-dashboard.module.css"));
|
|
16
|
-
class MobileDashboard extends _react.Component {
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import intl from 'react-intl-universal';
|
|
3
|
+
import Tabs from './tabs';
|
|
4
|
+
import StatView from './stat-view';
|
|
5
|
+
import { STAT_TYPE, THEME_NAME_MAP } from './constants';
|
|
6
|
+
import logo from './assets/images/icon.png';
|
|
7
|
+
import styles from './assets/css/mobile-dashboard.module.css';
|
|
8
|
+
class MobileDashboard extends Component {
|
|
17
9
|
constructor() {
|
|
18
10
|
super(...arguments);
|
|
19
11
|
this.onCloseDashboard = () => {
|
|
@@ -37,20 +29,20 @@ class MobileDashboard extends _react.Component {
|
|
|
37
29
|
const {
|
|
38
30
|
stat_items: statItems
|
|
39
31
|
} = statistic || {};
|
|
40
|
-
return /*#__PURE__*/
|
|
41
|
-
className: "".concat(
|
|
42
|
-
}, /*#__PURE__*/
|
|
43
|
-
className: "".concat(
|
|
44
|
-
}, /*#__PURE__*/
|
|
45
|
-
className:
|
|
46
|
-
}, /*#__PURE__*/
|
|
47
|
-
className:
|
|
48
|
-
src:
|
|
32
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "".concat(styles['mobile-statistic-container'], " statistic-panel mobile-statistic-panel statistic-light")
|
|
34
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: "".concat(styles['mobile-statistic-header'])
|
|
36
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: styles['mobile-statistic-title']
|
|
38
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
39
|
+
className: styles['mobile-statistic-logo'],
|
|
40
|
+
src: logo,
|
|
49
41
|
alt: ""
|
|
50
|
-
}), /*#__PURE__*/
|
|
51
|
-
className:
|
|
52
|
-
},
|
|
53
|
-
theme:
|
|
42
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
43
|
+
className: styles['mobile-statistic-name']
|
|
44
|
+
}, intl.get('Statistics'))), /*#__PURE__*/React.createElement(Tabs, {
|
|
45
|
+
theme: THEME_NAME_MAP.LIGHT,
|
|
54
46
|
isMobile: true,
|
|
55
47
|
statistics: statistics,
|
|
56
48
|
selectedDashboardIdx: selectedDashboardIdx,
|
|
@@ -58,34 +50,34 @@ class MobileDashboard extends _react.Component {
|
|
|
58
50
|
addDashboard: this.props.addDashboard,
|
|
59
51
|
renameDashboard: this.props.renameDashboard,
|
|
60
52
|
deleteDashboard: this.props.deleteDashboard
|
|
61
|
-
}), /*#__PURE__*/
|
|
62
|
-
className:
|
|
63
|
-
}, /*#__PURE__*/
|
|
64
|
-
className: "close ".concat(
|
|
53
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: styles['mobile-statistic-tool-container']
|
|
55
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
56
|
+
className: "close ".concat(styles['mobile-statistic-header-button']),
|
|
65
57
|
onClick: this.onCloseDashboard
|
|
66
|
-
}, /*#__PURE__*/
|
|
58
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
67
59
|
className: 'dtable-font dtable-icon-x'
|
|
68
|
-
})))), /*#__PURE__*/
|
|
69
|
-
className:
|
|
60
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: styles['mobile-statistic-dashboard-wrapper']
|
|
70
62
|
}, statItems.map(statItem => {
|
|
71
63
|
const {
|
|
72
64
|
_id,
|
|
73
65
|
type,
|
|
74
66
|
name
|
|
75
67
|
} = statItem;
|
|
76
|
-
const showStatName = !(type ===
|
|
77
|
-
return /*#__PURE__*/
|
|
68
|
+
const showStatName = !(type === STAT_TYPE.BASIC_NUMBER_CARD || type === STAT_TYPE.DASHBOARD);
|
|
69
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
78
70
|
key: "mobile-statistic-chart-".concat(_id),
|
|
79
|
-
className:
|
|
80
|
-
}, /*#__PURE__*/
|
|
81
|
-
className: "".concat(
|
|
82
|
-
}, showStatName && name), /*#__PURE__*/
|
|
83
|
-
className:
|
|
84
|
-
}, /*#__PURE__*/
|
|
71
|
+
className: styles['mobile-statistic-chart-wrapper']
|
|
72
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
73
|
+
className: "".concat(styles['mobile-statistic-chart-header'], " text-truncate")
|
|
74
|
+
}, showStatName && name), /*#__PURE__*/React.createElement("div", {
|
|
75
|
+
className: styles['mobile-statistic-chart-container']
|
|
76
|
+
}, /*#__PURE__*/React.createElement(StatView, {
|
|
85
77
|
isPreview: true,
|
|
86
78
|
isEnlarge: false,
|
|
87
79
|
dtableChangedTime: dtableChangedTime,
|
|
88
|
-
theme:
|
|
80
|
+
theme: THEME_NAME_MAP.LIGHT,
|
|
89
81
|
colorThemeName: colorThemeName,
|
|
90
82
|
statItem: statItem,
|
|
91
83
|
chartCalculator: chartCalculator,
|
|
@@ -97,4 +89,4 @@ class MobileDashboard extends _react.Component {
|
|
|
97
89
|
})));
|
|
98
90
|
}
|
|
99
91
|
}
|
|
100
|
-
|
|
92
|
+
export default MobileDashboard;
|
package/es/model/bar-group.js
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
9
|
-
var _commonUtils = require("../utils/common-utils");
|
|
10
|
-
var _constants = require("../constants");
|
|
11
|
-
class BarGroup extends _baseModel.default {
|
|
1
|
+
import BaseModel from './base-model';
|
|
2
|
+
import { isBoolean } from '../utils/common-utils';
|
|
3
|
+
import { STAT_TYPE, SUMMARY_METHOD_MAP, SUMMARY_TYPE } from '../constants';
|
|
4
|
+
export default class BarGroup extends BaseModel {
|
|
12
5
|
constructor(object) {
|
|
13
6
|
super(object);
|
|
14
7
|
|
|
@@ -19,23 +12,23 @@ class BarGroup extends _baseModel.default {
|
|
|
19
12
|
this.x_axis_include_empty = object.x_axis_include_empty;
|
|
20
13
|
|
|
21
14
|
// x style
|
|
22
|
-
this.show_x_axis_label =
|
|
15
|
+
this.show_x_axis_label = isBoolean(object.show_x_axis_label) ? object.show_x_axis_label : false;
|
|
23
16
|
this.x_axis_label_position = object.x_axis_label_position;
|
|
24
17
|
|
|
25
18
|
// y data
|
|
26
|
-
this.y_axis_summary_type = object.y_axis_summary_type ||
|
|
19
|
+
this.y_axis_summary_type = object.y_axis_summary_type || SUMMARY_TYPE.COUNT;
|
|
27
20
|
this.y_axis_column_key = object.y_axis_column_key;
|
|
28
21
|
this.y_axis_summary_method = object.y_axis_summary_method;
|
|
29
|
-
if (this.y_axis_summary_method ===
|
|
30
|
-
this.y_axis_summary_method =
|
|
22
|
+
if (this.y_axis_summary_method === SUMMARY_METHOD_MAP.Row_count) {
|
|
23
|
+
this.y_axis_summary_method = SUMMARY_METHOD_MAP.Max;
|
|
31
24
|
}
|
|
32
25
|
|
|
33
26
|
// y style
|
|
34
|
-
this.y_axis_label_position =
|
|
27
|
+
this.y_axis_label_position = isBoolean(object.y_axis_label_position) ? object.y_axis_label_position : false;
|
|
35
28
|
this.show_y_axis_label = object.show_y_axis_label;
|
|
36
29
|
this.y_axis_label_color = object.y_axis_label_color;
|
|
37
30
|
this.y_axis_use_stack = object.y_axis_use_stack;
|
|
38
|
-
if (this.type ===
|
|
31
|
+
if (this.type === STAT_TYPE.BAR_STACK) {
|
|
39
32
|
this.y_axis_use_stack = true;
|
|
40
33
|
}
|
|
41
34
|
this.y_axis_auto_range = object.y_axis_auto_range;
|
|
@@ -54,5 +47,4 @@ class BarGroup extends _baseModel.default {
|
|
|
54
47
|
this.display_data = object.display_data;
|
|
55
48
|
this.sort_type = object.sort_type;
|
|
56
49
|
}
|
|
57
|
-
}
|
|
58
|
-
exports.default = BarGroup;
|
|
50
|
+
}
|
package/es/model/bar.js
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
9
|
-
var _commonUtils = require("../utils/common-utils");
|
|
10
|
-
var _constants = require("../constants");
|
|
11
|
-
class Bar extends _baseModel.default {
|
|
1
|
+
import BaseModel from './base-model';
|
|
2
|
+
import { isBoolean } from '../utils/common-utils';
|
|
3
|
+
import { SUMMARY_METHOD_MAP, SUMMARY_TYPE } from '../constants';
|
|
4
|
+
export default class Bar extends BaseModel {
|
|
12
5
|
constructor(object) {
|
|
13
6
|
super(object);
|
|
14
7
|
|
|
@@ -19,22 +12,22 @@ class Bar extends _baseModel.default {
|
|
|
19
12
|
this.x_axis_include_empty = object.x_axis_include_empty;
|
|
20
13
|
|
|
21
14
|
// x style
|
|
22
|
-
this.show_x_axis_label =
|
|
15
|
+
this.show_x_axis_label = isBoolean(object.show_x_axis_label) ? object.show_x_axis_label : false;
|
|
23
16
|
this.x_axis_label_position = object.x_axis_label_position;
|
|
24
17
|
|
|
25
18
|
// y data
|
|
26
|
-
this.y_axis_summary_type = object.y_axis_summary_type ||
|
|
19
|
+
this.y_axis_summary_type = object.y_axis_summary_type || SUMMARY_TYPE.COUNT;
|
|
27
20
|
this.y_axis_column_key = object.y_axis_column_key;
|
|
28
21
|
this.y_axis_summary_method = object.y_axis_summary_method;
|
|
29
|
-
if (this.y_axis_summary_method ===
|
|
30
|
-
this.y_axis_summary_method =
|
|
22
|
+
if (this.y_axis_summary_method === SUMMARY_METHOD_MAP.Row_count) {
|
|
23
|
+
this.y_axis_summary_method = SUMMARY_METHOD_MAP.Max;
|
|
31
24
|
}
|
|
32
25
|
|
|
33
26
|
// y style
|
|
34
27
|
this.color_option = object.color_option;
|
|
35
28
|
this.y_axis_label_color = object.y_axis_label_color;
|
|
36
29
|
this.y_axis_label_color_rules = object.y_axis_label_color_rules;
|
|
37
|
-
this.show_y_axis_label =
|
|
30
|
+
this.show_y_axis_label = isBoolean(object.show_y_axis_label) ? object.show_y_axis_label : false;
|
|
38
31
|
this.y_axis_label_position = object.y_axis_label_position;
|
|
39
32
|
this.y_axis_auto_range = object.y_axis_auto_range;
|
|
40
33
|
this.y_axis_min = object.y_axis_min;
|
|
@@ -43,5 +36,4 @@ class Bar extends _baseModel.default {
|
|
|
43
36
|
this.label_font_size = object.label_font_size;
|
|
44
37
|
this.display_data = object.display_data;
|
|
45
38
|
}
|
|
46
|
-
}
|
|
47
|
-
exports.default = Bar;
|
|
39
|
+
}
|
package/es/model/base-model.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
class BaseModel {
|
|
1
|
+
export default class BaseModel {
|
|
8
2
|
constructor(object) {
|
|
9
3
|
this._id = object._id || null;
|
|
10
4
|
this.name = object.name || null;
|
|
@@ -14,5 +8,4 @@ class BaseModel {
|
|
|
14
8
|
this.layout = object.layout;
|
|
15
9
|
this.chart_color_theme = object.chart_color_theme || 'theme0';
|
|
16
10
|
}
|
|
17
|
-
}
|
|
18
|
-
exports.default = BaseModel;
|
|
11
|
+
}
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _dtableStore = require("dtable-store");
|
|
9
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
10
|
-
var _constants = require("../constants");
|
|
11
|
-
class BasicNumberCard extends _baseModel.default {
|
|
1
|
+
import { isNumericColumn, TableUtils } from 'dtable-store';
|
|
2
|
+
import BaseModel from './base-model';
|
|
3
|
+
import { SUMMARY_METHOD_MAP } from '../constants';
|
|
4
|
+
export default class BasicNumberCard extends BaseModel {
|
|
12
5
|
constructor(object, table) {
|
|
13
6
|
super(object);
|
|
14
7
|
this.name = null;
|
|
15
8
|
this.numeric_column = object.x_axis_column_key;
|
|
16
9
|
if (this.numeric_column) {
|
|
17
|
-
const column =
|
|
18
|
-
if (!
|
|
10
|
+
const column = TableUtils.getTableColumnByKey(table, this.numeric_column);
|
|
11
|
+
if (!isNumericColumn(column)) {
|
|
19
12
|
this.numeric_column = null;
|
|
20
13
|
}
|
|
21
14
|
}
|
|
22
|
-
this.summary_method = object.y_axis_summary_method ||
|
|
15
|
+
this.summary_method = object.y_axis_summary_method || SUMMARY_METHOD_MAP.Row_count;
|
|
23
16
|
}
|
|
24
|
-
}
|
|
25
|
-
exports.default = BasicNumberCard;
|
|
17
|
+
}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
class Collaborators {
|
|
1
|
+
export default class Collaborators {
|
|
8
2
|
constructor(object) {
|
|
9
3
|
this.avatar_url = object.avatar_url || '';
|
|
10
4
|
this.contact_email = object.contact_email || '';
|
|
@@ -13,5 +7,4 @@ class Collaborators {
|
|
|
13
7
|
this.name_pinyin = object.name_pinyin || '';
|
|
14
8
|
this.id = object.id_in_org || '';
|
|
15
9
|
}
|
|
16
|
-
}
|
|
17
|
-
exports.default = Collaborators;
|
|
10
|
+
}
|
package/es/model/combination.js
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
9
|
-
var _commonUtils = require("../utils/common-utils");
|
|
10
|
-
var _constants = require("../constants");
|
|
11
|
-
class Combination extends _baseModel.default {
|
|
1
|
+
import BaseModel from './base-model';
|
|
2
|
+
import { isBoolean } from '../utils/common-utils';
|
|
3
|
+
import { LABEL_COLORS, STATISTICS_COUNT_TYPE } from '../constants';
|
|
4
|
+
export default class Combination extends BaseModel {
|
|
12
5
|
constructor(object) {
|
|
13
6
|
super(object);
|
|
14
7
|
|
|
@@ -19,20 +12,20 @@ class Combination extends _baseModel.default {
|
|
|
19
12
|
this.x_axis_include_empty = object.x_axis_include_empty;
|
|
20
13
|
|
|
21
14
|
// y left/right data/style
|
|
22
|
-
this.y_axis_left_summary_type = object.y_axis_left_summary_type ||
|
|
23
|
-
this.y_axis_right_summary_type = object.y_axis_right_summary_type ||
|
|
15
|
+
this.y_axis_left_summary_type = object.y_axis_left_summary_type || STATISTICS_COUNT_TYPE.COUNT;
|
|
16
|
+
this.y_axis_right_summary_type = object.y_axis_right_summary_type || STATISTICS_COUNT_TYPE.COUNT;
|
|
24
17
|
this.y_axis_left_summary_method = object.y_axis_left_summary_method;
|
|
25
18
|
this.y_axis_right_summary_method = object.y_axis_right_summary_method;
|
|
26
19
|
this.y_axis_left_summary_column = object.y_axis_left__summary_column;
|
|
27
20
|
this.y_axis_right_summary_column = object.y_axis_right_summary_column;
|
|
28
|
-
this.y_axis_left_group_by_multiple_numeric_column =
|
|
21
|
+
this.y_axis_left_group_by_multiple_numeric_column = isBoolean(object.y_axis_left_group_by_multiple_numeric_column) ? object.y_axis_left_group_by_multiple_numeric_column : false;
|
|
29
22
|
this.y_axis_left_group_by_numeric_columns = object.y_axis_left_group_by_numeric_columns;
|
|
30
|
-
this.y_axis_left_color = object.y_axis_left_color ||
|
|
31
|
-
this.y_axis_right_color = object.y_axis_right_color ||
|
|
23
|
+
this.y_axis_left_color = object.y_axis_left_color || LABEL_COLORS[0];
|
|
24
|
+
this.y_axis_right_color = object.y_axis_right_color || LABEL_COLORS[1];
|
|
32
25
|
this.show_x_axis_label = object.show_x_axis_label;
|
|
33
26
|
this.x_axis_label_position = object.x_axis_label_position;
|
|
34
|
-
this.show_y_axis_left_label =
|
|
35
|
-
this.show_y_axis_right_label =
|
|
27
|
+
this.show_y_axis_left_label = isBoolean(object.show_y_axis_left_label) ? object.show_y_axis_left_label : false;
|
|
28
|
+
this.show_y_axis_right_label = isBoolean(object.show_y_axis_right_label) ? object.show_y_axis_right_label : false;
|
|
36
29
|
this.y_axis_left_label_position = object.y_axis_left_label_position;
|
|
37
30
|
this.y_axis_right_label_position = object.y_axis_right_label_position;
|
|
38
31
|
this.y_axis_auto_range_left = object.y_axis_auto_range_left;
|
|
@@ -44,5 +37,4 @@ class Combination extends _baseModel.default {
|
|
|
44
37
|
this.display_data = object.display_data;
|
|
45
38
|
this.label_font_size = object.label_font_size;
|
|
46
39
|
}
|
|
47
|
-
}
|
|
48
|
-
exports.default = Combination;
|
|
40
|
+
}
|
package/es/model/compare-bar.js
CHANGED
|
@@ -1,43 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _dtableStore = require("dtable-store");
|
|
9
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
10
|
-
var _commonUtils = require("../utils/common-utils");
|
|
11
|
-
var _columnUtils = require("../utils/column-utils");
|
|
12
|
-
var _constants = require("../constants");
|
|
13
|
-
class CompareBar extends _baseModel.default {
|
|
1
|
+
import { TableUtils } from 'dtable-store';
|
|
2
|
+
import BaseModel from './base-model';
|
|
3
|
+
import { isBoolean } from '../utils/common-utils';
|
|
4
|
+
import { isStatisticDateColumn } from '../utils/column-utils';
|
|
5
|
+
import { DATE_GRANULARITY, SUMMARY_METHOD_MAP, SUMMARY_TYPE } from '../constants';
|
|
6
|
+
export default class CompareBar extends BaseModel {
|
|
14
7
|
constructor(object, table) {
|
|
15
8
|
super(object);
|
|
16
9
|
|
|
17
10
|
// x data
|
|
18
11
|
this.x_axis_column_key = object.x_axis_column_key;
|
|
19
12
|
if (this.x_axis_column_key) {
|
|
20
|
-
const column =
|
|
21
|
-
if (!
|
|
13
|
+
const column = TableUtils.getTableColumnByKey(table, this.x_axis_column_key);
|
|
14
|
+
if (!isStatisticDateColumn(column)) {
|
|
22
15
|
this.x_axis_column_key = null;
|
|
23
16
|
}
|
|
24
17
|
}
|
|
25
|
-
this.x_axis_date_granularity = object.x_axis_date_granularity ||
|
|
18
|
+
this.x_axis_date_granularity = object.x_axis_date_granularity || DATE_GRANULARITY.MONTH;
|
|
26
19
|
this.x_axis_date_range_start = object.x_axis_date_range_start;
|
|
27
20
|
this.x_axis_date_range_end = object.x_axis_date_range_end;
|
|
28
21
|
this.x_axis_compared_date_range_start = object.x_axis_compared_date_range_start;
|
|
29
22
|
this.x_axis_compared_date_range_end = object.x_axis_compared_date_range_end;
|
|
30
23
|
|
|
31
24
|
// x style
|
|
32
|
-
this.show_x_axis_label =
|
|
25
|
+
this.show_x_axis_label = isBoolean(object.show_x_axis_label) ? object.show_x_axis_label : false;
|
|
33
26
|
this.x_axis_label_position = object.x_axis_label_position;
|
|
34
27
|
|
|
35
28
|
// y data
|
|
36
|
-
this.y_axis_summary_type = object.y_axis_summary_type ||
|
|
29
|
+
this.y_axis_summary_type = object.y_axis_summary_type || SUMMARY_TYPE.COUNT;
|
|
37
30
|
this.y_axis_column_key = object.y_axis_column_key;
|
|
38
31
|
this.y_axis_summary_method = object.y_axis_summary_method;
|
|
39
|
-
if (this.y_axis_summary_method ===
|
|
40
|
-
this.y_axis_summary_method =
|
|
32
|
+
if (this.y_axis_summary_method === SUMMARY_METHOD_MAP.Row_count) {
|
|
33
|
+
this.y_axis_summary_method = SUMMARY_METHOD_MAP.Max;
|
|
41
34
|
}
|
|
42
35
|
|
|
43
36
|
// y style
|
|
@@ -45,12 +38,11 @@ class CompareBar extends _baseModel.default {
|
|
|
45
38
|
this.y_axis_label_position = object.y_axis_label_position;
|
|
46
39
|
this.y_axis_compare_label_color = object.y_axis_compare_label_color;
|
|
47
40
|
this.y_axis_compared_label_color = object.y_axis_compared_label_color;
|
|
48
|
-
this.display_increase =
|
|
49
|
-
this.display_increase_percentage =
|
|
41
|
+
this.display_increase = isBoolean(object.display_increase) ? object.display_increase : false;
|
|
42
|
+
this.display_increase_percentage = isBoolean(object.display_increase_percentage) ? object.display_increase_percentage : false;
|
|
50
43
|
this.increase_display_color = object.increase_display_color;
|
|
51
44
|
this.label_font_size = object.label_font_size;
|
|
52
45
|
this.display_data = object.display_data;
|
|
53
46
|
this.increase_line_color = object.increase_line_color || '#fbd44a';
|
|
54
47
|
}
|
|
55
|
-
}
|
|
56
|
-
exports.default = CompareBar;
|
|
48
|
+
}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
9
|
-
var _commonUtils = require("../utils/common-utils");
|
|
10
|
-
var _constants = require("../constants");
|
|
11
|
-
class CompletenessGroup extends _baseModel.default {
|
|
1
|
+
import BaseModel from './base-model';
|
|
2
|
+
import { isBoolean } from '../utils/common-utils';
|
|
3
|
+
import { SUMMARY_METHOD_MAP } from '../constants';
|
|
4
|
+
export default class CompletenessGroup extends BaseModel {
|
|
12
5
|
constructor(object) {
|
|
13
6
|
super(object);
|
|
14
7
|
this.name_column = object.x_axis_column_key;
|
|
15
8
|
this.target_value_column = object.target_value_column;
|
|
16
|
-
this.target_value_column_summary_method = object.target_value_column_summary_method ||
|
|
9
|
+
this.target_value_column_summary_method = object.target_value_column_summary_method || SUMMARY_METHOD_MAP.Row_count;
|
|
17
10
|
this.total_value_column = object.total_value_column;
|
|
18
|
-
this.total_value_column_summary_method = object.total_value_column_summary_method ||
|
|
11
|
+
this.total_value_column_summary_method = object.total_value_column_summary_method || SUMMARY_METHOD_MAP.Row_count;
|
|
19
12
|
this.completed_column = object.completed_column;
|
|
20
13
|
this.target_column = object.target_column;
|
|
21
|
-
this.display_percentage =
|
|
14
|
+
this.display_percentage = isBoolean(object.display_percentage) ? object.display_percentage : true;
|
|
22
15
|
this.group_column = object.column_groupby_column_key;
|
|
23
16
|
this.date_granularity = object.column_groupby_date_granularity;
|
|
24
17
|
this.geolocation_granularity = object.column_groupby_geolocation_granularity;
|
|
@@ -27,5 +20,4 @@ class CompletenessGroup extends _baseModel.default {
|
|
|
27
20
|
this.y_axis_max = object.y_axis_max;
|
|
28
21
|
this.y_axis_min = object.y_axis_min;
|
|
29
22
|
}
|
|
30
|
-
}
|
|
31
|
-
exports.default = CompletenessGroup;
|
|
23
|
+
}
|
package/es/model/completeness.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
9
|
-
var _commonUtils = require("../utils/common-utils");
|
|
10
|
-
class Completeness extends _baseModel.default {
|
|
1
|
+
import BaseModel from './base-model';
|
|
2
|
+
import { isBoolean } from '../utils/common-utils';
|
|
3
|
+
export default class Completeness extends BaseModel {
|
|
11
4
|
constructor(object) {
|
|
12
5
|
super(object);
|
|
13
6
|
this.name_column = object.name_column;
|
|
@@ -15,11 +8,10 @@ class Completeness extends _baseModel.default {
|
|
|
15
8
|
this.target_column = object.target_column;
|
|
16
9
|
this.total_value_column = object.total_value_column;
|
|
17
10
|
this.completed_color = object.completed_color || '#2a67d1';
|
|
18
|
-
this.display_percentage =
|
|
11
|
+
this.display_percentage = isBoolean(object.display_percentage) ? object.display_percentage : true;
|
|
19
12
|
this.y_axis_auto_range = object.y_axis_auto_range;
|
|
20
13
|
this.y_axis_min = object.y_axis_min;
|
|
21
14
|
this.y_axis_max = object.y_axis_max;
|
|
22
15
|
this.label_font_size = object.label_font_size;
|
|
23
16
|
}
|
|
24
|
-
}
|
|
25
|
-
exports.default = Completeness;
|
|
17
|
+
}
|
package/es/model/custom-bar.js
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
9
|
-
var _commonUtils = require("../utils/common-utils");
|
|
10
|
-
class CustomBar extends _baseModel.default {
|
|
1
|
+
import BaseModel from './base-model';
|
|
2
|
+
import { isBoolean } from '../utils/common-utils';
|
|
3
|
+
export default class CustomBar extends BaseModel {
|
|
11
4
|
constructor(object) {
|
|
12
5
|
super(object);
|
|
13
6
|
this.x_axis_column_key = object.x_axis_column_key;
|
|
14
7
|
this.x_axis_date_granularity = object.x_axis_date_granularity;
|
|
15
8
|
this.x_axis_geolocation_granularity = object.x_axis_geolocation_granularity;
|
|
16
9
|
this.x_axis_include_empty = object.x_axis_include_empty;
|
|
17
|
-
this.show_x_axis_label =
|
|
18
|
-
this.show_y_axis_label =
|
|
10
|
+
this.show_x_axis_label = isBoolean(object.show_x_axis_label) ? object.show_x_axis_label : false;
|
|
11
|
+
this.show_y_axis_label = isBoolean(object.show_y_axis_label) ? object.show_y_axis_label : false;
|
|
19
12
|
this.x_axis_label_position = object.x_axis_label_position;
|
|
20
13
|
this.y_axis_label_position = object.y_axis_label_position;
|
|
21
14
|
this.title_name = object.title_name;
|
|
22
15
|
this.y_axises = object.y_axises;
|
|
23
16
|
}
|
|
24
|
-
}
|
|
25
|
-
exports.default = CustomBar;
|
|
17
|
+
}
|
package/es/model/dashboard.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _constants = require("../constants");
|
|
9
|
-
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
10
|
-
class Dashboard extends _baseModel.default {
|
|
1
|
+
import { SUMMARY_METHOD_MAP } from '../constants';
|
|
2
|
+
import BaseModel from './base-model';
|
|
3
|
+
export default class Dashboard extends BaseModel {
|
|
11
4
|
constructor(object) {
|
|
12
5
|
super(object);
|
|
13
6
|
this.name = null;
|
|
14
7
|
this.target_value_column = object.target_value_column;
|
|
15
|
-
this.target_value_column_summary_method = object.target_value_column_summary_method ||
|
|
8
|
+
this.target_value_column_summary_method = object.target_value_column_summary_method || SUMMARY_METHOD_MAP.Row_count;
|
|
16
9
|
this.total_value_column = object.total_value_column;
|
|
17
|
-
this.total_value_column_summary_method = object.total_value_column_summary_method ||
|
|
10
|
+
this.total_value_column_summary_method = object.total_value_column_summary_method || SUMMARY_METHOD_MAP.Row_count;
|
|
18
11
|
}
|
|
19
|
-
}
|
|
20
|
-
exports.default = Dashboard;
|
|
12
|
+
}
|