sea-chart 0.0.1
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/README.md +4 -0
- package/lib/assets/icons/area-chart.svg +10 -0
- package/lib/assets/icons/bar-chart.svg +12 -0
- package/lib/assets/icons/card.svg +22 -0
- package/lib/assets/icons/combination-chart.svg +17 -0
- package/lib/assets/icons/dtable-logo.svg +16 -0
- package/lib/assets/icons/facet-chart.svg +12 -0
- package/lib/assets/icons/gauge.svg +18 -0
- package/lib/assets/icons/heat-map.svg +14 -0
- package/lib/assets/icons/histogram.svg +12 -0
- package/lib/assets/icons/line-chart.svg +12 -0
- package/lib/assets/icons/map.svg +20 -0
- package/lib/assets/icons/pie-chart.svg +11 -0
- package/lib/assets/icons/rectangular-tree-diagram.svg +10 -0
- package/lib/assets/icons/scatter-chart.svg +15 -0
- package/lib/assets/icons/type-change.svg +17 -0
- package/lib/assets/img/area-chart.png +0 -0
- package/lib/assets/img/area-group-chart.png +0 -0
- package/lib/assets/img/bar-group.png +0 -0
- package/lib/assets/img/bar-stack.png +0 -0
- package/lib/assets/img/bar.png +0 -0
- package/lib/assets/img/combination-chart.png +0 -0
- package/lib/assets/img/compared-chart.png +0 -0
- package/lib/assets/img/completeness-chart.png +0 -0
- package/lib/assets/img/custom-bar.png +0 -0
- package/lib/assets/img/dashboard-chart.png +0 -0
- package/lib/assets/img/group-completeness-chart.png +0 -0
- package/lib/assets/img/group_line.png +0 -0
- package/lib/assets/img/heat-map.png +0 -0
- package/lib/assets/img/horizontal-bar.png +0 -0
- package/lib/assets/img/horizontal-group-bar.png +0 -0
- package/lib/assets/img/line.png +0 -0
- package/lib/assets/img/map-bubble.png +0 -0
- package/lib/assets/img/map.png +0 -0
- package/lib/assets/img/mirror.png +0 -0
- package/lib/assets/img/number-card.png +0 -0
- package/lib/assets/img/pie.png +0 -0
- package/lib/assets/img/pivot-table.png +0 -0
- package/lib/assets/img/ring.png +0 -0
- package/lib/assets/img/scatter.png +0 -0
- package/lib/assets/img/stacked-horizontal-bar.png +0 -0
- package/lib/assets/img/treemap.png +0 -0
- package/lib/assets/img/trend-chart.png +0 -0
- package/lib/assets/img/world-map-bubble.png +0 -0
- package/lib/assets/img/world-map.png +0 -0
- package/lib/components/collaborator/index.js +24 -0
- package/lib/components/formatter/area.js +162 -0
- package/lib/components/formatter/bar-group.js +160 -0
- package/lib/components/formatter/bar.js +150 -0
- package/lib/components/formatter/basic-number-card.js +138 -0
- package/lib/components/formatter/chart-component.js +266 -0
- package/lib/components/formatter/combination.js +407 -0
- package/lib/components/formatter/dashboard.js +182 -0
- package/lib/components/formatter/horizontal-bar-group.js +161 -0
- package/lib/components/formatter/horizontal-bar.js +152 -0
- package/lib/components/formatter/horizontal-component.js +91 -0
- package/lib/components/formatter/index.js +181 -0
- package/lib/components/formatter/line-group.js +157 -0
- package/lib/components/formatter/line.js +170 -0
- package/lib/components/formatter/pie.js +201 -0
- package/lib/components/formatter/ring.js +277 -0
- package/lib/components/formatter/table/index.css +103 -0
- package/lib/components/formatter/table/index.js +42 -0
- package/lib/components/formatter/table/one-dimension-table-no-numeric-columns.js +145 -0
- package/lib/components/formatter/table/one-dimension-table-with-numeric-columns.js +193 -0
- package/lib/components/formatter/table/pivot-table-display-name.js +249 -0
- package/lib/components/formatter/table/two-dimension-table.js +241 -0
- package/lib/components/formatter/treemap.js +213 -0
- package/lib/components/icon/index.css +5 -0
- package/lib/components/icon/index.js +22 -0
- package/lib/components/index.js +5 -0
- package/lib/components/loading/index.css +54 -0
- package/lib/components/loading/index.js +10 -0
- package/lib/components/number-input/index.js +31 -0
- package/lib/components/pixel-editor/index.css +29 -0
- package/lib/components/pixel-editor/index.js +42 -0
- package/lib/components/select-group/index.css +67 -0
- package/lib/components/select-group/index.js +63 -0
- package/lib/components/settings/advance-bar-settings/data-settings.js +120 -0
- package/lib/components/settings/advance-bar-settings/index.js +3 -0
- package/lib/components/settings/advance-bar-settings/style-settings.js +149 -0
- package/lib/components/settings/bar-settings/data-settings.js +137 -0
- package/lib/components/settings/bar-settings/index.js +3 -0
- package/lib/components/settings/bar-settings/style-settings.js +163 -0
- package/lib/components/settings/basic-number-card/data-settings.js +121 -0
- package/lib/components/settings/basic-number-card/index.js +3 -0
- package/lib/components/settings/basic-number-card/style-settings.js +42 -0
- package/lib/components/settings/combination-settings/data-settings.js +256 -0
- package/lib/components/settings/combination-settings/index.js +3 -0
- package/lib/components/settings/combination-settings/style-settings.js +183 -0
- package/lib/components/settings/dashboard-settings/data-settings.js +167 -0
- package/lib/components/settings/dashboard-settings/index.js +2 -0
- package/lib/components/settings/data-settings.js +67 -0
- package/lib/components/settings/horizontal-bar-settings/data-settings.js +45 -0
- package/lib/components/settings/horizontal-bar-settings/index.js +3 -0
- package/lib/components/settings/horizontal-bar-settings/style-settings.js +38 -0
- package/lib/components/settings/index.css +73 -0
- package/lib/components/settings/index.js +74 -0
- package/lib/components/settings/pie-settings/data-settings.js +123 -0
- package/lib/components/settings/pie-settings/index.js +3 -0
- package/lib/components/settings/pie-settings/style-settings.js +123 -0
- package/lib/components/settings/style-settings.js +100 -0
- package/lib/components/settings/table-settings/data-settings.js +488 -0
- package/lib/components/settings/table-settings/index.js +2 -0
- package/lib/components/settings/time-comparison-settings/data-settings.js +157 -0
- package/lib/components/settings/time-comparison-settings/index.js +3 -0
- package/lib/components/settings/time-comparison-settings/style-settings.js +191 -0
- package/lib/components/settings/widgets/basic-summary/index.css +12 -0
- package/lib/components/settings/widgets/basic-summary/index.js +173 -0
- package/lib/components/settings/widgets/common-data-settings.js +42 -0
- package/lib/components/settings/widgets/data-filter/index.css +17 -0
- package/lib/components/settings/widgets/data-filter/index.js +76 -0
- package/lib/components/settings/widgets/data-sort.js +38 -0
- package/lib/components/settings/widgets/date-summary-item.js +126 -0
- package/lib/components/settings/widgets/display-values-settings/index.css +13 -0
- package/lib/components/settings/widgets/display-values-settings/index.js +37 -0
- package/lib/components/settings/widgets/divider/index.css +4 -0
- package/lib/components/settings/widgets/divider/index.js +10 -0
- package/lib/components/settings/widgets/font-settings/font-size-settings.js +31 -0
- package/lib/components/settings/widgets/font-settings/font-weight-settings.js +46 -0
- package/lib/components/settings/widgets/font-settings/index.js +3 -0
- package/lib/components/settings/widgets/group-by.js +168 -0
- package/lib/components/settings/widgets/label-color.js +30 -0
- package/lib/components/settings/widgets/min-max-setting.js +64 -0
- package/lib/components/settings/widgets/mininum-slice-percent.js +72 -0
- package/lib/components/settings/widgets/numeric-summary-item.js +109 -0
- package/lib/components/settings/widgets/select-table/index.css +0 -0
- package/lib/components/settings/widgets/select-table/index.js +49 -0
- package/lib/components/settings/widgets/stack.js +58 -0
- package/lib/components/settings/widgets/statistic-type/index.css +31 -0
- package/lib/components/settings/widgets/statistic-type/index.js +54 -0
- package/lib/components/settings/widgets/summary-method-setting.js +80 -0
- package/lib/components/settings/widgets/summary-settings.js +394 -0
- package/lib/components/settings/widgets/switch/index.css +37 -0
- package/lib/components/settings/widgets/switch/index.js +21 -0
- package/lib/components/settings/widgets/text-horizontal-settings.js +23 -0
- package/lib/components/settings/widgets/time-picker.js +182 -0
- package/lib/components/settings/widgets/title-settings/index.js +58 -0
- package/lib/components/settings/widgets/title-settings/title-text.js +31 -0
- package/lib/components/settings/widgets/x-axios.js +0 -0
- package/lib/components/settings/widgets/y-axis-group-settings.js +399 -0
- package/lib/components/types-dialog/index.css +97 -0
- package/lib/components/types-dialog/index.js +127 -0
- package/lib/constants/geolocation.js +11 -0
- package/lib/constants/index.js +164 -0
- package/lib/constants/model.js +167 -0
- package/lib/constants/style.js +13 -0
- package/lib/constants/type-image.js +32 -0
- package/lib/constants/type.js +97 -0
- package/lib/context.js +49 -0
- package/lib/index.js +6 -0
- package/lib/intl.js +37 -0
- package/lib/layout/index.js +4 -0
- package/lib/layout/statistic/index.css +53 -0
- package/lib/layout/statistic/index.js +190 -0
- package/lib/layout/title/index.css +3 -0
- package/lib/layout/title/index.js +41 -0
- package/lib/locale/index.js +11 -0
- package/lib/locale/lang/de.js +141 -0
- package/lib/locale/lang/en.js +143 -0
- package/lib/locale/lang/es.js +141 -0
- package/lib/locale/lang/fr.js +141 -0
- package/lib/locale/lang/pt.js +141 -0
- package/lib/locale/lang/ru.js +141 -0
- package/lib/locale/lang/zh_CN.js +143 -0
- package/lib/model/area-group.js +51 -0
- package/lib/model/area.js +42 -0
- package/lib/model/bar-group.js +54 -0
- package/lib/model/bar-stack.js +51 -0
- package/lib/model/bar.js +48 -0
- package/lib/model/base-model.js +11 -0
- package/lib/model/basic-number-card.js +32 -0
- package/lib/model/combination.js +48 -0
- package/lib/model/compare-bar.js +49 -0
- package/lib/model/completeness-group.js +34 -0
- package/lib/model/completeness.js +28 -0
- package/lib/model/dashboard.js +26 -0
- package/lib/model/generic-model.js +235 -0
- package/lib/model/heat-map.js +33 -0
- package/lib/model/horizontal-bar.js +48 -0
- package/lib/model/horizontal-group-bar.js +53 -0
- package/lib/model/index.js +36 -0
- package/lib/model/line-group.js +54 -0
- package/lib/model/line.js +48 -0
- package/lib/model/map-bubble.js +37 -0
- package/lib/model/map.js +37 -0
- package/lib/model/mirror.js +36 -0
- package/lib/model/pie.js +36 -0
- package/lib/model/ring.js +36 -0
- package/lib/model/scatter.js +29 -0
- package/lib/model/stacked-horizontal-bar.js +42 -0
- package/lib/model/statistic.js +22 -0
- package/lib/model/table.js +33 -0
- package/lib/model/tree-map.js +30 -0
- package/lib/model/trend.js +34 -0
- package/lib/model/user.js +22 -0
- package/lib/model/world-map-bubble.js +36 -0
- package/lib/model/world-map.js +36 -0
- package/lib/utils/cell-format-utils.js +41 -0
- package/lib/utils/chart.js +6 -0
- package/lib/utils/collaborator-utils.js +40 -0
- package/lib/utils/column-utils.js +247 -0
- package/lib/utils/custom-g2.js +612 -0
- package/lib/utils/data-filter/filter-item-utils.js +80 -0
- package/lib/utils/data-filter/filters-utils.js +406 -0
- package/lib/utils/data-filter/index.js +3 -0
- package/lib/utils/date-translate.js +66 -0
- package/lib/utils/index.js +50 -0
- package/lib/utils/key-generator.js +13 -0
- package/lib/utils/object-utils.js +61 -0
- package/lib/utils/options-utils.js +61 -0
- package/lib/utils/statistic-column-2-sql-column-utils.js +499 -0
- package/lib/utils/statistic-utils.js +1685 -0
- package/package.json +160 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import { isDateColumn, getTableById, getTableColumnByKey } from 'dtable-utils';
|
|
7
|
+
import BaseModel from './base-model';
|
|
8
|
+
import { isBoolean } from '../utils';
|
|
9
|
+
import { STATISTIC_TYPE } from '../constants';
|
|
10
|
+
var CompareBar = /*#__PURE__*/function (_BaseModel) {
|
|
11
|
+
_inherits(CompareBar, _BaseModel);
|
|
12
|
+
var _super = _createSuper(CompareBar);
|
|
13
|
+
function CompareBar(options, tables) {
|
|
14
|
+
var _this;
|
|
15
|
+
_classCallCheck(this, CompareBar);
|
|
16
|
+
_this = _super.call(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
17
|
+
type: STATISTIC_TYPE.COMPARE_BAR
|
|
18
|
+
}));
|
|
19
|
+
_this.x_axis_column_key = options.x_axis_column_key;
|
|
20
|
+
if (_this.x_axis_column_key && _this.table_id && tables) {
|
|
21
|
+
var table = getTableById(tables, _this.table_id);
|
|
22
|
+
var column = getTableColumnByKey(table, _this.x_axis_column_key);
|
|
23
|
+
if (!column || !isDateColumn(column)) {
|
|
24
|
+
_this.x_axis_column_key = null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
_this.x_axis_date_granularity = options.x_axis_date_granularity;
|
|
28
|
+
_this.x_axis_date_range_start = options.x_axis_date_range_start;
|
|
29
|
+
_this.x_axis_date_range_end = options.x_axis_date_range_end;
|
|
30
|
+
_this.x_axis_compared_date_range_start = options.x_axis_compared_date_range_start;
|
|
31
|
+
_this.x_axis_compared_date_range_end = options.x_axis_compared_date_range_end;
|
|
32
|
+
_this.x_axis_show_label = isBoolean(options.x_axis_show_label) ? options.x_axis_show_label : false;
|
|
33
|
+
_this.y_axis_show_label = isBoolean(options.y_axis_show_label) ? options.y_axis_show_label : false;
|
|
34
|
+
_this.x_axis_label_position = options.x_axis_label_position;
|
|
35
|
+
_this.y_axis_label_position = options.y_axis_label_position;
|
|
36
|
+
_this.y_axis_compare_label_color = options.y_axis_compare_label_color;
|
|
37
|
+
_this.y_axis_compared_label_color = options.y_axis_compared_label_color;
|
|
38
|
+
_this.y_axis_summary_column_key = options.y_axis_summary_column_key;
|
|
39
|
+
_this.y_axis_summary_type = options.y_axis_summary_type;
|
|
40
|
+
_this.y_axis_summary_method = options.y_axis_summary_method;
|
|
41
|
+
_this.display_increase = isBoolean(options.display_increase) ? options.display_increase : false;
|
|
42
|
+
_this.display_increase_percentage = isBoolean(options.display_increase_percentage) ? options.display_increase_percentage : false;
|
|
43
|
+
_this.increase_display_color = options.increase_display_color;
|
|
44
|
+
_this.label_font_size = options.label_font_size;
|
|
45
|
+
return _this;
|
|
46
|
+
}
|
|
47
|
+
return _createClass(CompareBar);
|
|
48
|
+
}(BaseModel);
|
|
49
|
+
export default CompareBar;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import BaseModel from './base-model';
|
|
7
|
+
import { isBoolean } from '../utils';
|
|
8
|
+
import { STATISTIC_TYPE, STATISTIC_SUMMARY_TYPE } from '../constants';
|
|
9
|
+
var CompletenessGroup = /*#__PURE__*/function (_BaseModel) {
|
|
10
|
+
_inherits(CompletenessGroup, _BaseModel);
|
|
11
|
+
var _super = _createSuper(CompletenessGroup);
|
|
12
|
+
function CompletenessGroup(options) {
|
|
13
|
+
var _this;
|
|
14
|
+
_classCallCheck(this, CompletenessGroup);
|
|
15
|
+
_this = _super.call(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
16
|
+
type: STATISTIC_TYPE.COMPLETENESS_GROUP
|
|
17
|
+
}));
|
|
18
|
+
_this.name_column_key = options.x_axis_column_key;
|
|
19
|
+
_this.target_value_column_key = options.target_value_column_key;
|
|
20
|
+
_this.target_value_column_summary_method = options.target_value_column_summary_method || STATISTIC_SUMMARY_TYPE.ROW_COUNT;
|
|
21
|
+
_this.total_value_column_key = options.total_value_column_key;
|
|
22
|
+
_this.total_value_column_summary_method = options.total_value_column_summary_method || STATISTIC_SUMMARY_TYPE.ROW_COUNT;
|
|
23
|
+
_this.completed_column_key = options.completed_column_key;
|
|
24
|
+
_this.target_column_key = options.target_column_key;
|
|
25
|
+
_this.display_percentage = isBoolean(options.display_percentage) ? options.display_percentage : true;
|
|
26
|
+
_this.group_column_key = options.column_groupby_column_key;
|
|
27
|
+
_this.date_granularity = options.column_groupby_date_granularity;
|
|
28
|
+
_this.geolocation_granularity = options.column_groupby_geolocation_granularity;
|
|
29
|
+
_this.label_font_size = options.label_font_size;
|
|
30
|
+
return _this;
|
|
31
|
+
}
|
|
32
|
+
return _createClass(CompletenessGroup);
|
|
33
|
+
}(BaseModel);
|
|
34
|
+
export default CompletenessGroup;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import BaseModel from './base-model';
|
|
7
|
+
import { isBoolean } from '../utils';
|
|
8
|
+
import { LABEL_COLORS, STATISTIC_TYPE } from '../constants';
|
|
9
|
+
var Completeness = /*#__PURE__*/function (_BaseModel) {
|
|
10
|
+
_inherits(Completeness, _BaseModel);
|
|
11
|
+
var _super = _createSuper(Completeness);
|
|
12
|
+
function Completeness(options) {
|
|
13
|
+
var _this;
|
|
14
|
+
_classCallCheck(this, Completeness);
|
|
15
|
+
_this = _super.call(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
16
|
+
type: STATISTIC_TYPE.COMPLETENESS
|
|
17
|
+
}));
|
|
18
|
+
_this.name_column_key = options.x_axis_column_key;
|
|
19
|
+
_this.completed_column_key = options.completed_column_key;
|
|
20
|
+
_this.target_column_key = options.target_column_key;
|
|
21
|
+
_this.completed_color = options.completed_color || LABEL_COLORS[0];
|
|
22
|
+
_this.display_percentage = isBoolean(options.display_percentage) ? options.display_percentage : true;
|
|
23
|
+
_this.label_font_size = options.label_font_size;
|
|
24
|
+
return _this;
|
|
25
|
+
}
|
|
26
|
+
return _createClass(Completeness);
|
|
27
|
+
}(BaseModel);
|
|
28
|
+
export default Completeness;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import BaseModel from './base-model';
|
|
7
|
+
import { STATISTIC_SUMMARY_TYPE, STATISTIC_TYPE } from '../constants';
|
|
8
|
+
var Dashboard = /*#__PURE__*/function (_BaseModel) {
|
|
9
|
+
_inherits(Dashboard, _BaseModel);
|
|
10
|
+
var _super = _createSuper(Dashboard);
|
|
11
|
+
function Dashboard(options) {
|
|
12
|
+
var _this;
|
|
13
|
+
_classCallCheck(this, Dashboard);
|
|
14
|
+
_this = _super.call(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
15
|
+
type: STATISTIC_TYPE.DASHBOARD
|
|
16
|
+
}));
|
|
17
|
+
_this.name = '';
|
|
18
|
+
_this.target_value_column_key = options.target_value_column_key;
|
|
19
|
+
_this.target_value_column_summary_method = options.target_value_column_summary_method || STATISTIC_SUMMARY_TYPE.ROW_COUNT;
|
|
20
|
+
_this.total_value_column_key = options.total_value_column_key;
|
|
21
|
+
_this.total_value_column_summary_method = options.total_value_column_summary_method || STATISTIC_SUMMARY_TYPE.ROW_COUNT;
|
|
22
|
+
return _this;
|
|
23
|
+
}
|
|
24
|
+
return _createClass(Dashboard);
|
|
25
|
+
}(BaseModel);
|
|
26
|
+
export default Dashboard;
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
+
import { isNumber } from 'dtable-utils';
|
|
6
|
+
import BaseModel from './base-model';
|
|
7
|
+
import { isBoolean, getChartConfigValueByKey } from '../utils';
|
|
8
|
+
import { DATE_GRANULATES, DEFAULT_LABEL_FONT_SIZE, GEOLOCATION_GRANULATES, LABEL_POSITION_TYPE, STATISTIC_SUMMARY_TYPE, GENERIC_KEY, CHART_KEY, LEGEND_DIRECTION } from '../constants';
|
|
9
|
+
var GenericModel = /*#__PURE__*/function (_BaseModel) {
|
|
10
|
+
_inherits(GenericModel, _BaseModel);
|
|
11
|
+
var _super = _createSuper(GenericModel);
|
|
12
|
+
function GenericModel(object) {
|
|
13
|
+
var _this;
|
|
14
|
+
_classCallCheck(this, GenericModel);
|
|
15
|
+
var options = object || {};
|
|
16
|
+
_this = _super.call(this, options);
|
|
17
|
+
|
|
18
|
+
// x data
|
|
19
|
+
_this.x_axis_column_key = getChartConfigValueByKey(GENERIC_KEY.X_AXIS_COLUMN_KEY, options);
|
|
20
|
+
_this.x_axis_include_empty_cells = getChartConfigValueByKey(GENERIC_KEY.X_AXIS_INCLUDE_EMPTY_CELLS, options);
|
|
21
|
+
_this.x_axis_date_granularity = getChartConfigValueByKey(GENERIC_KEY.X_AXIS_DATE_GRANULARITY, options);
|
|
22
|
+
_this.x_axis_geolocation_granularity = getChartConfigValueByKey(GENERIC_KEY.X_AXIS_GEOLOCATION_GRANULARITY, options);
|
|
23
|
+
|
|
24
|
+
// set default value
|
|
25
|
+
if (!isBoolean(_this.x_axis_include_empty_cells)) {
|
|
26
|
+
_this.x_axis_include_empty_cells = false;
|
|
27
|
+
}
|
|
28
|
+
if (_this.x_axis_date_granularity && !DATE_GRANULATES.includes(_this.x_axis_date_granularity)) {
|
|
29
|
+
_this.x_axis_date_granularity = STATISTIC_SUMMARY_TYPE.MONTH;
|
|
30
|
+
}
|
|
31
|
+
if (_this.x_axis_geolocation_granularity && !GEOLOCATION_GRANULATES.includes(_this.x_axis_geolocation_granularity)) {
|
|
32
|
+
_this.x_axis_geolocation_granularity = STATISTIC_SUMMARY_TYPE.DISTRICT;
|
|
33
|
+
}
|
|
34
|
+
_this.x_axis_date_range_start = getChartConfigValueByKey(CHART_KEY.X_AXIS_DATE_RANGE_START, options);
|
|
35
|
+
_this.x_axis_date_range_end = getChartConfigValueByKey(CHART_KEY.X_AXIS_DATE_RANGE_END, options);
|
|
36
|
+
_this.x_axis_compared_date_range_start = getChartConfigValueByKey(CHART_KEY.X_AXIS_COMPARED_DATE_RANGE_START, options);
|
|
37
|
+
_this.x_axis_compared_date_range_end = getChartConfigValueByKey(CHART_KEY.X_AXIS_COMPARED_DATE_RANGE_END, options);
|
|
38
|
+
|
|
39
|
+
// x style
|
|
40
|
+
_this.x_axis_show_label = getChartConfigValueByKey(GENERIC_KEY.X_AXIS_SHOW_LABEL, options);
|
|
41
|
+
_this.x_axis_label_position = getChartConfigValueByKey(GENERIC_KEY.X_AXIS_LABEL_POSITION, options) || LABEL_POSITION_TYPE.CENTER;
|
|
42
|
+
if (!isBoolean(_this.x_axis_show_label)) {
|
|
43
|
+
_this.x_axis_show_label = null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// y data
|
|
47
|
+
_this.y_axis_summary_column_key = getChartConfigValueByKey(GENERIC_KEY.Y_AXIS_SUMMARY_COLUMN_KEY, options);
|
|
48
|
+
_this.y_axis_summary_type = getChartConfigValueByKey(GENERIC_KEY.Y_AXIS_SUMMARY_TYPE, options);
|
|
49
|
+
_this.y_axis_summary_method = getChartConfigValueByKey(GENERIC_KEY.Y_AXIS_SUMMARY_METHOD, options);
|
|
50
|
+
if (_this.y_axis_summary_method === STATISTIC_SUMMARY_TYPE.ROW_COUNT) {
|
|
51
|
+
_this.y_axis_summary_method = STATISTIC_SUMMARY_TYPE.MAX;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// y style
|
|
55
|
+
_this.color_option = getChartConfigValueByKey(CHART_KEY.COLOR_OPTION, options);
|
|
56
|
+
_this.y_axis_label_color = getChartConfigValueByKey(GENERIC_KEY.Y_AXIS_LABEL_COLOR, options);
|
|
57
|
+
_this.y_axis_label_color_rules = getChartConfigValueByKey(GENERIC_KEY.Y_AXIS_LABEL_COLOR_RULES, options);
|
|
58
|
+
_this.y_axis_show_value = getChartConfigValueByKey(GENERIC_KEY.Y_AXIS_SHOW_VALUE, options);
|
|
59
|
+
_this.y_axis_show_label = getChartConfigValueByKey(GENERIC_KEY.Y_AXIS_SHOW_LABEL, options);
|
|
60
|
+
if (!isBoolean(_this.y_axis_show_value)) {
|
|
61
|
+
_this.y_axis_show_value = null;
|
|
62
|
+
}
|
|
63
|
+
if (!isBoolean(_this.y_axis_show_label)) {
|
|
64
|
+
_this.y_axis_show_label = null;
|
|
65
|
+
}
|
|
66
|
+
_this.y_axis_label_position = getChartConfigValueByKey(GENERIC_KEY.Y_AXIS_LABEL_POSITION, options) || LABEL_POSITION_TYPE.CENTER;
|
|
67
|
+
_this.y_axis_auto_range = getChartConfigValueByKey(GENERIC_KEY.Y_AXIS_AUTO_RANGE, options);
|
|
68
|
+
_this.y_axis_min = getChartConfigValueByKey(GENERIC_KEY.Y_AXIS_MIN, options);
|
|
69
|
+
_this.y_axis_max = getChartConfigValueByKey(GENERIC_KEY.Y_AXIS_MAX, options);
|
|
70
|
+
if (!isBoolean(_this.y_axis_auto_range)) {
|
|
71
|
+
_this.y_axis_auto_range = true;
|
|
72
|
+
}
|
|
73
|
+
if (!isNumber(_this.y_axis_min)) {
|
|
74
|
+
_this.y_axis_min = null;
|
|
75
|
+
}
|
|
76
|
+
if (!isNumber(_this.y_axis_max)) {
|
|
77
|
+
_this.y_axis_max = null;
|
|
78
|
+
}
|
|
79
|
+
_this.y_axis_use_stack = getChartConfigValueByKey(CHART_KEY.Y_AXIS_USE_STACK, options);
|
|
80
|
+
if (!isBoolean(_this.y_axis_use_stack)) {
|
|
81
|
+
_this.y_axis_use_stack = null;
|
|
82
|
+
}
|
|
83
|
+
_this.y_axis_compare_label_color = getChartConfigValueByKey(CHART_KEY.Y_AXIS_COMPARE_LABEL_COLOR, options);
|
|
84
|
+
_this.y_axis_compared_label_color = getChartConfigValueByKey(CHART_KEY.Y_AXIS_COMPARED_LABEL_COLOR, options);
|
|
85
|
+
|
|
86
|
+
// column-group
|
|
87
|
+
_this.column_groupby_column_key = getChartConfigValueByKey(GENERIC_KEY.COLUMN_GROUPBY_COLUMN_KEY, options);
|
|
88
|
+
_this.column_groupby_date_granularity = getChartConfigValueByKey(GENERIC_KEY.COLUMN_GROUPBY_DATE_GRANULARITY, options);
|
|
89
|
+
_this.column_groupby_geolocation_granularity = getChartConfigValueByKey(GENERIC_KEY.COLUMN_GROUPBY_GEOLOCATION_GRANULARITY, options);
|
|
90
|
+
if (_this.column_groupby_date_granularity && !DATE_GRANULATES.includes(_this.column_groupby_date_granularity)) {
|
|
91
|
+
_this.column_groupby_date_granularity = STATISTIC_SUMMARY_TYPE.MONTH;
|
|
92
|
+
}
|
|
93
|
+
if (_this.column_groupby_geolocation_granularity && !GEOLOCATION_GRANULATES.includes(_this.column_groupby_geolocation_granularity)) {
|
|
94
|
+
_this.column_groupby_geolocation_granularity = STATISTIC_SUMMARY_TYPE.DISTRICT;
|
|
95
|
+
}
|
|
96
|
+
_this.column_groupby_multiple_numeric_column = getChartConfigValueByKey(CHART_KEY.COLUMN_GROUPBY_MULTIPLE_NUMERIC_COLUMN, options);
|
|
97
|
+
if (!isBoolean(_this.column_groupby_multiple_numeric_column)) {
|
|
98
|
+
_this.column_groupby_multiple_numeric_column = null;
|
|
99
|
+
}
|
|
100
|
+
_this.column_groupby_numeric_columns = getChartConfigValueByKey(CHART_KEY.COLUMN_GROUPBY_NUMERIC_COLUMNS, options);
|
|
101
|
+
_this.summary_columns = getChartConfigValueByKey(CHART_KEY.SUMMARY_COLUMNS, options);
|
|
102
|
+
if (!Array.isArray(_this.summary_columns)) {
|
|
103
|
+
_this.summary_columns = [];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// other
|
|
107
|
+
_this.sort_type = getChartConfigValueByKey(CHART_KEY.SORT_TYPE, options);
|
|
108
|
+
_this.display_each_block_data = getChartConfigValueByKey(CHART_KEY.DISPLAY_EACH_BLOCK_DATA, options);
|
|
109
|
+
if (!isBoolean(_this.display_each_block_data)) {
|
|
110
|
+
_this.display_each_block_data = null;
|
|
111
|
+
}
|
|
112
|
+
_this.title_name = getChartConfigValueByKey(CHART_KEY.TITLE_NAME, options);
|
|
113
|
+
_this.label_font_size = getChartConfigValueByKey(GENERIC_KEY.LABEL_FONT_SIZE, options);
|
|
114
|
+
if (!isNumber(_this.label_font_size)) {
|
|
115
|
+
_this.label_font_size = DEFAULT_LABEL_FONT_SIZE;
|
|
116
|
+
}
|
|
117
|
+
_this.y_axis_left_summary_type = getChartConfigValueByKey(CHART_KEY.Y_AXIS_LEFT_SUMMARY_TYPE, options);
|
|
118
|
+
_this.y_axis_right_summary_type = getChartConfigValueByKey(CHART_KEY.Y_AXIS_RIGHT_SUMMARY_TYPE, options);
|
|
119
|
+
_this.y_axis_left_summary_method = getChartConfigValueByKey(CHART_KEY.Y_AXIS_LEFT_SUMMARY_METHOD, options);
|
|
120
|
+
_this.y_axis_right_summary_method = getChartConfigValueByKey(CHART_KEY.Y_AXIS_RIGHT_SUMMARY_METHOD, options);
|
|
121
|
+
_this.y_axis_left_summary_column = getChartConfigValueByKey(CHART_KEY.Y_AXIS_LEFT_SUMMARY_COLUMN, options);
|
|
122
|
+
_this.y_axis_right_summary_column = getChartConfigValueByKey(CHART_KEY.Y_AXIS_RIGHT_SUMMARY_COLUMN, options);
|
|
123
|
+
_this.y_axis_left_group_by_multiple_numeric_column = getChartConfigValueByKey(CHART_KEY.Y_AXIS_LEFT_GROUP_BY_MULTIPLE_NUMERIC_COLUMN, options);
|
|
124
|
+
_this.y_axis_left_group_by_numeric_columns = getChartConfigValueByKey(CHART_KEY.Y_AXIS_LEFT_GROUP_BY_NUMERIC_COLUMNS, options);
|
|
125
|
+
if (!isBoolean(_this.y_axis_left_group_by_multiple_numeric_column)) {
|
|
126
|
+
_this.y_axis_left_group_by_multiple_numeric_column = null;
|
|
127
|
+
}
|
|
128
|
+
if (!Array.isArray(_this.y_axis_left_group_by_numeric_columns)) {
|
|
129
|
+
_this.y_axis_left_group_by_numeric_columns = [];
|
|
130
|
+
}
|
|
131
|
+
_this.y_axis_left_color = getChartConfigValueByKey(CHART_KEY.Y_AXIS_LEFT_COLOR, options);
|
|
132
|
+
_this.y_axis_right_color = getChartConfigValueByKey(CHART_KEY.Y_AXIS_RIGHT_COLOR, options);
|
|
133
|
+
_this.show_y_axis_left_label = getChartConfigValueByKey(CHART_KEY.SHOW_Y_AXIS_LEFT_LABEL, options);
|
|
134
|
+
_this.show_y_axis_right_label = getChartConfigValueByKey(CHART_KEY.SHOW_Y_AXIS_RIGHT_LABEL, options);
|
|
135
|
+
_this.y_axis_left_label_position = getChartConfigValueByKey(CHART_KEY.Y_AXIS_LEFT_LABEL_POSITION, options) || LABEL_POSITION_TYPE.CENTER;
|
|
136
|
+
_this.y_axis_right_label_position = getChartConfigValueByKey(CHART_KEY.Y_AXIS_RIGHT_LABEL_POSITION, options) || LABEL_POSITION_TYPE.CENTER;
|
|
137
|
+
_this.y_axis_auto_range_left = getChartConfigValueByKey(CHART_KEY.Y_AXIS_AUTO_RANGE_LEFT, options);
|
|
138
|
+
_this.y_axis_min_left = getChartConfigValueByKey(CHART_KEY.Y_AXIS_MIN_LEFT, options);
|
|
139
|
+
_this.y_axis_max_left = getChartConfigValueByKey(CHART_KEY.Y_AXIS_MAX_LEFT, options);
|
|
140
|
+
if (!isBoolean(_this.y_axis_auto_range_left)) {
|
|
141
|
+
_this.y_axis_auto_range_left = true;
|
|
142
|
+
}
|
|
143
|
+
if (!isNumber(_this.y_axis_min_left)) {
|
|
144
|
+
_this.y_axis_min_left = null;
|
|
145
|
+
}
|
|
146
|
+
if (!isNumber(_this.y_axis_max_left)) {
|
|
147
|
+
_this.y_axis_max_left = null;
|
|
148
|
+
}
|
|
149
|
+
_this.y_axis_auto_range_right = getChartConfigValueByKey(CHART_KEY.Y_AXIS_AUTO_RANGE_RIGHT, options);
|
|
150
|
+
_this.y_axis_min_right = getChartConfigValueByKey(CHART_KEY.Y_AXIS_MIN_RIGHT, options);
|
|
151
|
+
_this.y_axis_max_right = getChartConfigValueByKey(CHART_KEY.Y_AXIS_MAX_RIGHT, options);
|
|
152
|
+
if (!isBoolean(_this.y_axis_auto_range_right)) {
|
|
153
|
+
_this.y_axis_auto_range_right = true;
|
|
154
|
+
}
|
|
155
|
+
if (!isNumber(_this.y_axis_min_right)) {
|
|
156
|
+
_this.y_axis_min_right = null;
|
|
157
|
+
}
|
|
158
|
+
if (!isNumber(_this.y_axis_max_right)) {
|
|
159
|
+
_this.y_axis_max_right = null;
|
|
160
|
+
}
|
|
161
|
+
_this.display_increase = getChartConfigValueByKey(CHART_KEY.DISPLAY_INCREASE, options);
|
|
162
|
+
_this.display_increase_percentage = getChartConfigValueByKey(CHART_KEY.DISPLAY_INCREASE_PERCENTAGE, options);
|
|
163
|
+
if (!isBoolean(_this.display_increase)) {
|
|
164
|
+
_this.display_increase = null;
|
|
165
|
+
}
|
|
166
|
+
if (!isBoolean(_this.display_increase_percentage)) {
|
|
167
|
+
_this.display_increase_percentage = null;
|
|
168
|
+
}
|
|
169
|
+
_this.increase_display_color = getChartConfigValueByKey(CHART_KEY.INCREASE_DISPLAY_COLOR, options);
|
|
170
|
+
if (!isBoolean(_this.increase_display_color)) {
|
|
171
|
+
_this.increase_display_color = null;
|
|
172
|
+
}
|
|
173
|
+
_this.completed_column_key = getChartConfigValueByKey(CHART_KEY.COMPLETED_COLUMN_KEY, options);
|
|
174
|
+
_this.target_column_key = getChartConfigValueByKey(CHART_KEY.TARGET_COLUMN_KEY, options);
|
|
175
|
+
_this.target_value_column_summary_method = getChartConfigValueByKey(CHART_KEY.TARGET_VALUE_COLUMN_SUMMARY_METHOD, options);
|
|
176
|
+
_this.total_value_column_key = getChartConfigValueByKey(CHART_KEY.TOTAL_VALUE_COLUMN_KEY, options);
|
|
177
|
+
_this.total_value_column_summary_method = getChartConfigValueByKey(CHART_KEY.TOTAL_VALUE_COLUMN_SUMMARY_METHOD, options);
|
|
178
|
+
_this.completed_color = getChartConfigValueByKey(CHART_KEY.COMPLETED_COLOR, options);
|
|
179
|
+
_this.display_percentage = getChartConfigValueByKey(CHART_KEY.DISPLAY_PERCENTAGE, options);
|
|
180
|
+
if (!isBoolean(_this.display_percentage)) {
|
|
181
|
+
_this.display_percentage = null;
|
|
182
|
+
}
|
|
183
|
+
_this.target_value_column_key = getChartConfigValueByKey(CHART_KEY.TARGET_VALUE_COLUMN_KEY, options);
|
|
184
|
+
_this.legend_direction = getChartConfigValueByKey(CHART_KEY.LEGEND_DIRECTION, options) || LEGEND_DIRECTION.VERTICAL;
|
|
185
|
+
_this.legend_size = getChartConfigValueByKey(CHART_KEY.LEGEND_SIZE, options);
|
|
186
|
+
if (!isNumber(_this.legend_size)) {
|
|
187
|
+
_this.legend_size = 1;
|
|
188
|
+
}
|
|
189
|
+
_this.is_transpose = getChartConfigValueByKey(CHART_KEY.IS_TRANSPOSE, options);
|
|
190
|
+
if (!isBoolean(_this.is_transpose)) {
|
|
191
|
+
_this.is_transpose = null;
|
|
192
|
+
}
|
|
193
|
+
_this.show_legend = getChartConfigValueByKey(CHART_KEY.SHOW_LEGEND, options);
|
|
194
|
+
if (!isBoolean(_this.show_legend)) {
|
|
195
|
+
_this.show_legend = null;
|
|
196
|
+
}
|
|
197
|
+
_this.display_label = getChartConfigValueByKey(CHART_KEY.DISPLAY_LABEL, options);
|
|
198
|
+
if (!isBoolean(_this.display_label)) {
|
|
199
|
+
_this.display_label = null;
|
|
200
|
+
}
|
|
201
|
+
_this.show_percent = getChartConfigValueByKey(CHART_KEY.SHOW_PERCENT, options);
|
|
202
|
+
if (!isBoolean(_this.show_percent)) {
|
|
203
|
+
_this.show_percent = null;
|
|
204
|
+
}
|
|
205
|
+
_this.minimum_slice_percent = getChartConfigValueByKey(CHART_KEY.MINIMUM_SLICE_PERCENT, options);
|
|
206
|
+
if (!isNumber(_this.minimum_slice_percent)) {
|
|
207
|
+
_this.minimum_slice_percent = 1.5;
|
|
208
|
+
}
|
|
209
|
+
_this.display_annotation = getChartConfigValueByKey(CHART_KEY.DISPLAY_ANNOTATION, options);
|
|
210
|
+
if (!isBoolean(_this.display_annotation)) {
|
|
211
|
+
_this.display_annotation = null;
|
|
212
|
+
}
|
|
213
|
+
_this.display_total = getChartConfigValueByKey(CHART_KEY.DISPLAY_TOTAL, options);
|
|
214
|
+
if (!isBoolean(_this.display_total)) {
|
|
215
|
+
_this.display_total = null;
|
|
216
|
+
}
|
|
217
|
+
_this.summary_columns_option = getChartConfigValueByKey(CHART_KEY.SUMMARY_COLUMNS_OPTION, options);
|
|
218
|
+
_this.increase_line_color = getChartConfigValueByKey(CHART_KEY.INCREASE_LINE_COLOR, options);
|
|
219
|
+
_this.data_color = getChartConfigValueByKey(CHART_KEY.DATA_COLOR, options);
|
|
220
|
+
_this.grid_distance = getChartConfigValueByKey(CHART_KEY.GRID_DISTANCE, options);
|
|
221
|
+
_this.grid_size = getChartConfigValueByKey(CHART_KEY.GRID_SIZE, options);
|
|
222
|
+
if (!isNumber(_this.grid_distance)) {
|
|
223
|
+
_this.grid_distance = null;
|
|
224
|
+
}
|
|
225
|
+
if (!isNumber(_this.grid_size)) {
|
|
226
|
+
_this.grid_size = null;
|
|
227
|
+
}
|
|
228
|
+
_this.bubble_color = getChartConfigValueByKey(CHART_KEY.BUBBLE_COLOR, options);
|
|
229
|
+
_this.label_position = getChartConfigValueByKey(CHART_KEY.LABEL_POSITION, options);
|
|
230
|
+
_this.label_format = getChartConfigValueByKey(CHART_KEY.LABEL_FORMAT, options);
|
|
231
|
+
return _this;
|
|
232
|
+
}
|
|
233
|
+
return _createClass(GenericModel);
|
|
234
|
+
}(BaseModel);
|
|
235
|
+
export { GenericModel as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import { isDateColumn, getTableById, getTableColumnByKey } from 'dtable-utils';
|
|
7
|
+
import BaseModel from './base-model';
|
|
8
|
+
import { STATISTIC_TYPE } from '../constants';
|
|
9
|
+
var HeatMap = /*#__PURE__*/function (_BaseModel) {
|
|
10
|
+
_inherits(HeatMap, _BaseModel);
|
|
11
|
+
var _super = _createSuper(HeatMap);
|
|
12
|
+
function HeatMap(options, tables) {
|
|
13
|
+
var _this;
|
|
14
|
+
_classCallCheck(this, HeatMap);
|
|
15
|
+
_this = _super.call(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
16
|
+
type: STATISTIC_TYPE.HEAT_MAP
|
|
17
|
+
}));
|
|
18
|
+
_this.time_column_key = options.x_axis_column_key;
|
|
19
|
+
if (_this.time_column_key && _this.table_id && tables) {
|
|
20
|
+
var table = getTableById(tables, _this.table_id);
|
|
21
|
+
var column = getTableColumnByKey(table, _this.time_column_key);
|
|
22
|
+
if (!column || !isDateColumn(column)) {
|
|
23
|
+
_this.time_column_key = null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
_this.summary_type = options.y_axis_summary_type;
|
|
27
|
+
_this.summary_column_key = options.y_axis_summary_column_key;
|
|
28
|
+
_this.summary_method = options.y_axis_summary_method;
|
|
29
|
+
return _this;
|
|
30
|
+
}
|
|
31
|
+
return _createClass(HeatMap);
|
|
32
|
+
}(BaseModel);
|
|
33
|
+
export default HeatMap;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import BaseModel from './base-model';
|
|
7
|
+
import { isBoolean } from '../utils';
|
|
8
|
+
import { LABEL_COLORS, STATISTIC_TYPE, STATISTIC_SUMMARY_TYPE } from '../constants';
|
|
9
|
+
var HorizontalBar = /*#__PURE__*/function (_BaseModel) {
|
|
10
|
+
_inherits(HorizontalBar, _BaseModel);
|
|
11
|
+
var _super = _createSuper(HorizontalBar);
|
|
12
|
+
function HorizontalBar(options) {
|
|
13
|
+
var _this;
|
|
14
|
+
_classCallCheck(this, HorizontalBar);
|
|
15
|
+
_this = _super.call(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
16
|
+
type: STATISTIC_TYPE.HORIZONTAL_BAR
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
// vertical axis data
|
|
20
|
+
_this.vertical_axis_column_key = options.x_axis_column_key;
|
|
21
|
+
_this.vertical_axis_date_granularity = options.x_axis_date_granularity;
|
|
22
|
+
_this.vertical_axis_geolocation_granularity = options.x_axis_geolocation_granularity;
|
|
23
|
+
_this.vertical_axis_include_empty = options.x_axis_include_empty_cells;
|
|
24
|
+
|
|
25
|
+
// vertical axis style
|
|
26
|
+
_this.show_vertical_axis_label = isBoolean(options.x_axis_show_label) ? options.x_axis_show_label : false;
|
|
27
|
+
_this.vertical_axis_label_position = options.x_axis_label_position;
|
|
28
|
+
|
|
29
|
+
// horizontal axis data
|
|
30
|
+
_this.horizontal_axis_summary_type = options.y_axis_summary_type || STATISTIC_SUMMARY_TYPE.COUNT;
|
|
31
|
+
_this.horizontal_axis_column_key = options.y_axis_summary_column_key;
|
|
32
|
+
_this.horizontal_axis_summary_method = options.y_axis_summary_method || STATISTIC_SUMMARY_TYPE.SUM;
|
|
33
|
+
|
|
34
|
+
// horizontal axis style
|
|
35
|
+
_this.horizontal_axis_label_color = options.y_axis_label_color || LABEL_COLORS[0];
|
|
36
|
+
_this.show_horizontal_axis_label = isBoolean(options.y_axis_show_label) ? options.y_axis_show_label : false;
|
|
37
|
+
_this.horizontal_axis_label_position = options.y_axis_label_position;
|
|
38
|
+
_this.display_data = isBoolean(options.y_axis_show_value) ? options.y_axis_show_value : false;
|
|
39
|
+
_this.horizontal_axis_auto_range = options.y_axis_auto_range;
|
|
40
|
+
_this.horizontal_axis_min = options.y_axis_min;
|
|
41
|
+
_this.horizontal_axis_max = options.y_axis_max;
|
|
42
|
+
_this.sort_type = options.sort_type;
|
|
43
|
+
_this.label_font_size = options.label_font_size;
|
|
44
|
+
return _this;
|
|
45
|
+
}
|
|
46
|
+
return _createClass(HorizontalBar);
|
|
47
|
+
}(BaseModel);
|
|
48
|
+
export default HorizontalBar;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import BaseModel from './base-model';
|
|
7
|
+
import { isBoolean } from '../utils';
|
|
8
|
+
import { STATISTIC_TYPE, LABEL_COLORS, STATISTIC_SUMMARY_TYPE } from '../constants';
|
|
9
|
+
var HorizontalGroupBar = /*#__PURE__*/function (_BaseModel) {
|
|
10
|
+
_inherits(HorizontalGroupBar, _BaseModel);
|
|
11
|
+
var _super = _createSuper(HorizontalGroupBar);
|
|
12
|
+
function HorizontalGroupBar(options) {
|
|
13
|
+
var _this;
|
|
14
|
+
_classCallCheck(this, HorizontalGroupBar);
|
|
15
|
+
_this = _super.call(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
16
|
+
type: STATISTIC_TYPE.HORIZONTAL_GROUP_BAR
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
// vertical axis data
|
|
20
|
+
_this.vertical_axis_column_key = options.x_axis_column_key;
|
|
21
|
+
_this.vertical_axis_date_granularity = options.x_axis_date_granularity;
|
|
22
|
+
_this.vertical_axis_geolocation_granularity = options.x_axis_geolocation_granularity;
|
|
23
|
+
_this.vertical_axis_include_empty = options.x_axis_include_empty_cells;
|
|
24
|
+
|
|
25
|
+
// vertical axis style
|
|
26
|
+
_this.show_vertical_axis_label = isBoolean(options.x_axis_show_label) ? options.x_axis_show_label : false;
|
|
27
|
+
_this.vertical_axis_label_position = options.x_axis_label_position;
|
|
28
|
+
|
|
29
|
+
// horizontal axis data
|
|
30
|
+
_this.horizontal_axis_summary_type = options.y_axis_summary_type || STATISTIC_SUMMARY_TYPE.COUNT;
|
|
31
|
+
_this.horizontal_axis_column_key = options.y_axis_summary_column_key;
|
|
32
|
+
_this.horizontal_axis_summary_method = options.y_axis_summary_method || STATISTIC_SUMMARY_TYPE.SUM;
|
|
33
|
+
|
|
34
|
+
// horizontal axis style
|
|
35
|
+
_this.horizontal_axis_label_color = options.y_axis_label_color || LABEL_COLORS[0];
|
|
36
|
+
_this.show_horizontal_axis_label = isBoolean(options.y_axis_show_label) ? options.y_axis_show_label : false;
|
|
37
|
+
_this.horizontal_axis_label_position = options.y_axis_label_position;
|
|
38
|
+
_this.horizontal_axis_auto_range = options.y_axis_auto_range;
|
|
39
|
+
_this.horizontal_axis_min = options.y_axis_min;
|
|
40
|
+
_this.horizontal_axis_max = options.y_axis_max;
|
|
41
|
+
|
|
42
|
+
// column-group
|
|
43
|
+
_this.column_groupby_column_key = options.column_groupby_column_key;
|
|
44
|
+
_this.column_groupby_date_granularity = options.column_groupby_date_granularity;
|
|
45
|
+
_this.column_groupby_geolocation_granularity = options.column_groupby_geolocation_granularity;
|
|
46
|
+
_this.column_groupby_multiple_numeric_column = options.column_groupby_multiple_numeric_column;
|
|
47
|
+
_this.summary_columns = options.summary_columns;
|
|
48
|
+
_this.label_font_size = options.label_font_size;
|
|
49
|
+
return _this;
|
|
50
|
+
}
|
|
51
|
+
return _createClass(HorizontalGroupBar);
|
|
52
|
+
}(BaseModel);
|
|
53
|
+
export default HorizontalGroupBar;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
var _STATISTIC_MAP;
|
|
3
|
+
import StatisticModel from './statistic';
|
|
4
|
+
import { STATISTIC_TYPE } from '../constants';
|
|
5
|
+
import GenericModel from './generic-model';
|
|
6
|
+
import Map from './map';
|
|
7
|
+
import MapBubble from './map-bubble';
|
|
8
|
+
import WorldMap from './world-map';
|
|
9
|
+
import WorldMapBubble from './world-map-bubble';
|
|
10
|
+
import HeatMap from './heat-map';
|
|
11
|
+
import Mirror from './mirror';
|
|
12
|
+
import Bar from './bar';
|
|
13
|
+
import Line from './line';
|
|
14
|
+
import BarGroup from './bar-group';
|
|
15
|
+
import BarStack from './bar-stack';
|
|
16
|
+
import LineGroup from './line-group';
|
|
17
|
+
import AreaGroup from './area-group';
|
|
18
|
+
import Pie from './pie';
|
|
19
|
+
import Ring from './ring';
|
|
20
|
+
import TreeMap from './tree-map';
|
|
21
|
+
import Scatter from './scatter';
|
|
22
|
+
import BasicNumberCard from './basic-number-card';
|
|
23
|
+
import HorizontalBar from './horizontal-bar';
|
|
24
|
+
import HorizontalGroupBar from './horizontal-group-bar';
|
|
25
|
+
import StackedHorizontalBar from './stacked-horizontal-bar';
|
|
26
|
+
import Combination from './combination';
|
|
27
|
+
import CompareBar from './compare-bar';
|
|
28
|
+
import Trend from './trend';
|
|
29
|
+
import Completeness from './completeness';
|
|
30
|
+
import CompletenessGroup from './completeness-group';
|
|
31
|
+
import Dashboard from './dashboard';
|
|
32
|
+
import Table from './table';
|
|
33
|
+
import Area from './area';
|
|
34
|
+
import User from './user';
|
|
35
|
+
var STATISTIC_MAP = (_STATISTIC_MAP = {}, _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.BAR, Bar), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.BAR_GROUP, BarGroup), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.BAR_STACK, BarStack), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.COMPARE_BAR, CompareBar), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.HORIZONTAL_BAR, HorizontalBar), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.HORIZONTAL_GROUP_BAR, HorizontalGroupBar), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.STACKED_HORIZONTAL_BAR, StackedHorizontalBar), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.COMPLETENESS, Completeness), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.COMPLETENESS_GROUP, CompletenessGroup), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.LINE, Line), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.LINE_GROUP, LineGroup), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.AREA, Area), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.AREA_GROUP, AreaGroup), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.PIE, Pie), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.RING, Ring), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.SCATTER, Scatter), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.COMBINATION, Combination), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.MAP, Map), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.MAP_BUBBLE, MapBubble), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.WORLD_MAP, WorldMap), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.WORLD_MAP_BUBBLE, WorldMapBubble), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.HEAT_MAP, HeatMap), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.MIRROR, Mirror), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.BASIC_NUMBER_CARD, BasicNumberCard), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.TREND, Trend), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.DASHBOARD, Dashboard), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.TREE_MAP, TreeMap), _defineProperty(_STATISTIC_MAP, STATISTIC_TYPE.TABLE, Table), _STATISTIC_MAP);
|
|
36
|
+
export { StatisticModel, GenericModel, STATISTIC_MAP, User };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import BaseModel from './base-model';
|
|
7
|
+
import { isBoolean } from '../utils';
|
|
8
|
+
import { LABEL_COLORS, STATISTIC_TYPE, STATISTIC_SUMMARY_TYPE } from '../constants';
|
|
9
|
+
var LineGroup = /*#__PURE__*/function (_BaseModel) {
|
|
10
|
+
_inherits(LineGroup, _BaseModel);
|
|
11
|
+
var _super = _createSuper(LineGroup);
|
|
12
|
+
function LineGroup(options) {
|
|
13
|
+
var _this;
|
|
14
|
+
_classCallCheck(this, LineGroup);
|
|
15
|
+
_this = _super.call(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
16
|
+
type: STATISTIC_TYPE.LINE_GROUP
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
// x axis data
|
|
20
|
+
_this.x_axis_column_key = options.x_axis_column_key;
|
|
21
|
+
_this.x_axis_include_empty_cells = options.x_axis_include_empty_cells;
|
|
22
|
+
_this.x_axis_date_granularity = options.x_axis_date_granularity;
|
|
23
|
+
_this.x_axis_geolocation_granularity = options.x_axis_geolocation_granularity;
|
|
24
|
+
|
|
25
|
+
// x axis style
|
|
26
|
+
_this.x_axis_show_label = isBoolean(options.x_axis_show_label) ? options.x_axis_show_label : false;
|
|
27
|
+
_this.x_axis_label_position = options.x_axis_label_position;
|
|
28
|
+
|
|
29
|
+
// y axis data
|
|
30
|
+
_this.y_axis_summary_column_key = options.y_axis_summary_column_key;
|
|
31
|
+
_this.y_axis_summary_type = options.y_axis_summary_type || STATISTIC_SUMMARY_TYPE.COUNT;
|
|
32
|
+
_this.y_axis_summary_method = options.y_axis_summary_method || STATISTIC_SUMMARY_TYPE.SUM;
|
|
33
|
+
|
|
34
|
+
// y axis style
|
|
35
|
+
_this.y_axis_show_value = isBoolean(options.y_axis_show_value) ? options.y_axis_show_value : false;
|
|
36
|
+
_this.y_axis_show_label = isBoolean(options.y_axis_show_label) ? options.y_axis_show_label : false;
|
|
37
|
+
_this.y_axis_label_position = options.y_axis_label_position;
|
|
38
|
+
_this.y_axis_auto_range = options.y_axis_auto_range;
|
|
39
|
+
_this.y_axis_min = options.y_axis_min;
|
|
40
|
+
_this.y_axis_max = options.y_axis_max;
|
|
41
|
+
_this.y_axis_label_color = options.y_axis_label_color || LABEL_COLORS[0];
|
|
42
|
+
|
|
43
|
+
// column group
|
|
44
|
+
_this.column_groupby_column_key = options.column_groupby_column_key;
|
|
45
|
+
_this.column_groupby_date_granularity = options.column_groupby_date_granularity;
|
|
46
|
+
_this.column_groupby_geolocation_granularity = options.column_groupby_geolocation_granularity;
|
|
47
|
+
_this.column_groupby_multiple_numeric_column = isBoolean(options.column_groupby_multiple_numeric_column) ? options.column_groupby_multiple_numeric_column : false;
|
|
48
|
+
_this.summary_columns = options.summary_columns;
|
|
49
|
+
_this.label_font_size = options.label_font_size;
|
|
50
|
+
return _this;
|
|
51
|
+
}
|
|
52
|
+
return _createClass(LineGroup);
|
|
53
|
+
}(BaseModel);
|
|
54
|
+
export default LineGroup;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import BaseModel from './base-model';
|
|
7
|
+
import { isBoolean } from '../utils';
|
|
8
|
+
import { LABEL_COLORS, STATISTIC_TYPE, STATISTIC_SUMMARY_TYPE } from '../constants';
|
|
9
|
+
var Line = /*#__PURE__*/function (_BaseModel) {
|
|
10
|
+
_inherits(Line, _BaseModel);
|
|
11
|
+
var _super = _createSuper(Line);
|
|
12
|
+
function Line(options) {
|
|
13
|
+
var _this;
|
|
14
|
+
_classCallCheck(this, Line);
|
|
15
|
+
_this = _super.call(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
16
|
+
type: STATISTIC_TYPE.LINE
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
// x axis data
|
|
20
|
+
_this.x_axis_column_key = options.x_axis_column_key;
|
|
21
|
+
_this.x_axis_include_empty_cells = options.x_axis_include_empty_cells;
|
|
22
|
+
_this.x_axis_date_granularity = options.x_axis_date_granularity;
|
|
23
|
+
_this.x_axis_geolocation_granularity = options.x_axis_geolocation_granularity;
|
|
24
|
+
|
|
25
|
+
// x axis style
|
|
26
|
+
_this.x_axis_show_label = isBoolean(options.x_axis_show_label) ? options.x_axis_show_label : false;
|
|
27
|
+
_this.x_axis_label_position = options.x_axis_label_position;
|
|
28
|
+
|
|
29
|
+
// y axis data
|
|
30
|
+
_this.y_axis_summary_column_key = options.y_axis_summary_column_key;
|
|
31
|
+
_this.y_axis_summary_type = options.y_axis_summary_type || STATISTIC_SUMMARY_TYPE.COUNT;
|
|
32
|
+
_this.y_axis_summary_method = options.y_axis_summary_method || STATISTIC_SUMMARY_TYPE.SUM;
|
|
33
|
+
|
|
34
|
+
// y axis style
|
|
35
|
+
_this.y_axis_show_value = isBoolean(options.y_axis_show_value) ? options.y_axis_show_value : false;
|
|
36
|
+
_this.y_axis_show_label = isBoolean(options.y_axis_show_label) ? options.y_axis_show_label : false;
|
|
37
|
+
_this.y_axis_label_position = options.y_axis_label_position;
|
|
38
|
+
_this.y_axis_auto_range = options.y_axis_auto_range;
|
|
39
|
+
_this.y_axis_min = options.y_axis_min;
|
|
40
|
+
_this.y_axis_max = options.y_axis_max;
|
|
41
|
+
_this.y_axis_label_color = options.y_axis_label_color || LABEL_COLORS[0];
|
|
42
|
+
_this.sort_type = options.sort_type;
|
|
43
|
+
_this.label_font_size = options.label_font_size;
|
|
44
|
+
return _this;
|
|
45
|
+
}
|
|
46
|
+
return _createClass(Line);
|
|
47
|
+
}(BaseModel);
|
|
48
|
+
export default Line;
|