dtable-statistic 4.0.4 → 4.0.5

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.
Files changed (74) hide show
  1. package/es/assets/icons/switch-icon.svg +17 -0
  2. package/es/calculator/workers/basic-chart-calculator-worker.js +1 -1
  3. package/es/components/dialog/chart-addition-edit-dialog.js +1 -0
  4. package/es/components/dialog/chart-addition-widgets/chart-selector.js +2 -1
  5. package/es/components/dialog/chart-addition-widgets/statistic-chart-selector.module.css +9 -0
  6. package/es/components/dialog/statistic-types-dialog/index.css +14 -0
  7. package/es/components/dialog/statistic-types-dialog/index.js +63 -0
  8. package/es/components/icon.js +12 -0
  9. package/es/constants/index.js +17 -6
  10. package/es/constants/model.js +20 -0
  11. package/es/dashboard.js +47 -9
  12. package/es/desktop-dashboard.js +3 -2
  13. package/es/locale/lang/de.js +3 -1
  14. package/es/locale/lang/en.js +3 -1
  15. package/es/locale/lang/fr.js +3 -1
  16. package/es/locale/lang/zh_CN.js +3 -1
  17. package/es/model/bar-group.js +60 -0
  18. package/es/model/bar.js +49 -0
  19. package/es/model/base-model.js +12 -0
  20. package/es/model/basic-number-card.js +27 -0
  21. package/es/model/combination.js +50 -0
  22. package/es/model/compare-bar.js +58 -0
  23. package/es/model/completeness-group.js +33 -0
  24. package/es/model/completeness.js +27 -0
  25. package/es/model/custom-bar.js +27 -0
  26. package/es/model/dashboard.js +22 -0
  27. package/es/model/generic-model.js +219 -0
  28. package/es/model/heat-map.js +35 -0
  29. package/es/model/horizontal-bar-group.js +55 -0
  30. package/es/model/horizontal-bar.js +49 -0
  31. package/es/model/index.js +26 -0
  32. package/es/model/map.js +37 -0
  33. package/es/model/mirror.js +35 -0
  34. package/es/model/pie.js +40 -0
  35. package/es/model/ring.js +41 -0
  36. package/es/model/scatter.js +24 -0
  37. package/es/model/table.js +34 -0
  38. package/es/model/trend.js +34 -0
  39. package/es/model/world-map.js +36 -0
  40. package/es/service/chart-service.js +47 -169
  41. package/es/service/dashboard-service.js +6 -5
  42. package/es/stat-editor/index.js +2 -0
  43. package/es/stat-editor/stat-settings/advance-chart-settings/basic-number-card-settings.js +1 -0
  44. package/es/stat-editor/stat-settings/advance-chart-settings/combination-settings.js +1 -0
  45. package/es/stat-editor/stat-settings/advance-chart-settings/dashboard-chart-settings.js +1 -0
  46. package/es/stat-editor/stat-settings/advance-chart-settings/heat-map-settings.js +4 -3
  47. package/es/stat-editor/stat-settings/advance-chart-settings/index.js +9 -10
  48. package/es/stat-editor/stat-settings/advance-chart-settings/map-settings.js +7 -31
  49. package/es/stat-editor/stat-settings/advance-chart-settings/mirror-settings.js +4 -3
  50. package/es/stat-editor/stat-settings/advance-chart-settings/trend-chart-settings.js +4 -3
  51. package/es/stat-editor/stat-settings/advance-chart-settings/world-map-settings.js +5 -29
  52. package/es/stat-editor/stat-settings/basic-chart-settings/advance-bar-chart-settings.js +1 -0
  53. package/es/stat-editor/stat-settings/basic-chart-settings/bar-settings.js +1 -0
  54. package/es/stat-editor/stat-settings/basic-chart-settings/completeness-chart-settings.js +1 -0
  55. package/es/stat-editor/stat-settings/basic-chart-settings/custom-bar-settings.js +1 -0
  56. package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-bar-settings.js +1 -0
  57. package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-group-chart-settings.js +1 -0
  58. package/es/stat-editor/stat-settings/basic-chart-settings/index.js +10 -0
  59. package/es/stat-editor/stat-settings/basic-chart-settings/pie-settings.js +1 -0
  60. package/es/stat-editor/stat-settings/basic-chart-settings/pivot-table-settings.js +1 -0
  61. package/es/stat-editor/stat-settings/basic-chart-settings/scatter-settings.js +1 -0
  62. package/es/stat-editor/stat-settings/basic-chart-settings/time-comparison-settings.js +1 -0
  63. package/es/stat-editor/stat-settings/public-setting/base-settings.js +22 -1
  64. package/es/stat-editor/stat-settings/public-setting/type-settings/index.css +29 -0
  65. package/es/stat-editor/stat-settings/public-setting/type-settings/index.js +58 -0
  66. package/es/stat-view/pie-chart.js +2 -2
  67. package/es/stat-view/ring-chart.js +2 -2
  68. package/es/utils/column-utils.js +69 -2
  69. package/es/utils/common-utils.js +3 -0
  70. package/es/utils/model.js +13 -0
  71. package/es/utils/row-utils.js +1 -0
  72. package/es/utils/stat-utils.js +4 -0
  73. package/package.json +1 -1
  74. package/es/model/stat-item.js +0 -340
@@ -0,0 +1,58 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
3
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
4
+ import { TableUtils } from 'dtable-store';
5
+ import BaseModel from './base-model';
6
+ import { isBoolean } from '../utils/common-utils';
7
+ import { isStatisticDateColumn } from '../utils/column-utils';
8
+ import { DATE_GRANULARITY, SUMMARY_METHOD_MAP, SUMMARY_TYPE } from '../constants';
9
+ var CompareBar = /*#__PURE__*/function (_BaseModel) {
10
+ _inherits(CompareBar, _BaseModel);
11
+ var _super = _createSuper(CompareBar);
12
+ function CompareBar(object, table) {
13
+ var _this;
14
+ _classCallCheck(this, CompareBar);
15
+ _this = _super.call(this, object);
16
+
17
+ // x data
18
+ _this.x_axis_column_key = object.x_axis_column_key;
19
+ if (_this.x_axis_column_key) {
20
+ var column = TableUtils.getTableColumnByKey(table, _this.x_axis_column_key);
21
+ if (!isStatisticDateColumn(column)) {
22
+ _this.x_axis_column_key = null;
23
+ }
24
+ }
25
+ _this.x_axis_date_granularity = object.x_axis_date_granularity || DATE_GRANULARITY.MONTH;
26
+ _this.x_axis_date_range_start = object.x_axis_date_range_start;
27
+ _this.x_axis_date_range_end = object.x_axis_date_range_end;
28
+ _this.x_axis_compared_date_range_start = object.x_axis_compared_date_range_start;
29
+ _this.x_axis_compared_date_range_end = object.x_axis_compared_date_range_end;
30
+
31
+ // x style
32
+ _this.show_x_axis_label = isBoolean(object.show_x_axis_label) ? object.show_x_axis_label : false;
33
+ _this.x_axis_label_position = object.x_axis_label_position;
34
+
35
+ // y data
36
+ _this.y_axis_summary_type = object.y_axis_summary_type || SUMMARY_TYPE.COUNT;
37
+ _this.y_axis_column_key = object.y_axis_column_key;
38
+ _this.y_axis_summary_method = object.y_axis_summary_method;
39
+ if (_this.y_axis_summary_method === SUMMARY_METHOD_MAP.Row_count) {
40
+ _this.y_axis_summary_method = SUMMARY_METHOD_MAP.Max;
41
+ }
42
+
43
+ // y style
44
+ _this.show_y_axis_label = object.show_y_axis_label;
45
+ _this.y_axis_label_position = object.y_axis_label_position;
46
+ _this.y_axis_compare_label_color = object.y_axis_compare_label_color;
47
+ _this.y_axis_compared_label_color = object.y_axis_compared_label_color;
48
+ _this.display_increase = isBoolean(object.display_increase) ? object.display_increase : false;
49
+ _this.display_increase_percentage = isBoolean(object.display_increase_percentage) ? object.display_increase_percentage : false;
50
+ _this.increase_display_color = object.increase_display_color;
51
+ _this.label_font_size = object.label_font_size;
52
+ _this.display_data = object.display_data;
53
+ _this.increase_line_color = object.increase_line_color || '#fbd44a';
54
+ return _this;
55
+ }
56
+ return CompareBar;
57
+ }(BaseModel);
58
+ export { CompareBar as default };
@@ -0,0 +1,33 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
3
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
4
+ import BaseModel from './base-model';
5
+ import { isBoolean } from '../utils/common-utils';
6
+ import { SUMMARY_METHOD_MAP } from '../constants';
7
+ var CompletenessGroup = /*#__PURE__*/function (_BaseModel) {
8
+ _inherits(CompletenessGroup, _BaseModel);
9
+ var _super = _createSuper(CompletenessGroup);
10
+ function CompletenessGroup(object) {
11
+ var _this;
12
+ _classCallCheck(this, CompletenessGroup);
13
+ _this = _super.call(this, object);
14
+ _this.name_column = object.x_axis_column_key;
15
+ _this.target_value_column = object.target_value_column;
16
+ _this.target_value_column_summary_method = object.target_value_column_summary_method || SUMMARY_METHOD_MAP.Row_count;
17
+ _this.total_value_column = object.total_value_column;
18
+ _this.total_value_column_summary_method = object.total_value_column_summary_method || SUMMARY_METHOD_MAP.Row_count;
19
+ _this.completed_column = object.completed_column;
20
+ _this.target_column = object.target_column;
21
+ _this.display_percentage = isBoolean(object.display_percentage) ? object.display_percentage : true;
22
+ _this.group_column = object.column_groupby_column_key;
23
+ _this.date_granularity = object.column_groupby_date_granularity;
24
+ _this.geolocation_granularity = object.column_groupby_geolocation_granularity;
25
+ _this.label_font_size = object.label_font_size;
26
+ _this.y_axis_auto_range = object.y_axis_auto_range;
27
+ _this.y_axis_max = object.y_axis_max;
28
+ _this.y_axis_min = object.y_axis_min;
29
+ return _this;
30
+ }
31
+ return CompletenessGroup;
32
+ }(BaseModel);
33
+ export { CompletenessGroup as default };
@@ -0,0 +1,27 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
3
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
4
+ import BaseModel from './base-model';
5
+ import { isBoolean } from '../utils/common-utils';
6
+ var Completeness = /*#__PURE__*/function (_BaseModel) {
7
+ _inherits(Completeness, _BaseModel);
8
+ var _super = _createSuper(Completeness);
9
+ function Completeness(object) {
10
+ var _this;
11
+ _classCallCheck(this, Completeness);
12
+ _this = _super.call(this, object);
13
+ _this.name_column = object.name_column;
14
+ _this.completed_column = object.completed_column;
15
+ _this.target_column = object.target_column;
16
+ _this.total_value_column = object.total_value_column;
17
+ _this.completed_color = object.completed_color || '#2a67d1';
18
+ _this.display_percentage = isBoolean(object.display_percentage) ? object.display_percentage : true;
19
+ _this.y_axis_auto_range = object.y_axis_auto_range;
20
+ _this.y_axis_min = object.y_axis_min;
21
+ _this.y_axis_max = object.y_axis_max;
22
+ _this.label_font_size = object.label_font_size;
23
+ return _this;
24
+ }
25
+ return Completeness;
26
+ }(BaseModel);
27
+ export { Completeness as default };
@@ -0,0 +1,27 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
3
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
4
+ import BaseModel from './base-model';
5
+ import { isBoolean } from '../utils/common-utils';
6
+ var CustomBar = /*#__PURE__*/function (_BaseModel) {
7
+ _inherits(CustomBar, _BaseModel);
8
+ var _super = _createSuper(CustomBar);
9
+ function CustomBar(object) {
10
+ var _this;
11
+ _classCallCheck(this, CustomBar);
12
+ _this = _super.call(this, object);
13
+ _this.x_axis_column_key = object.x_axis_column_key;
14
+ _this.x_axis_date_granularity = object.x_axis_date_granularity;
15
+ _this.x_axis_geolocation_granularity = object.x_axis_geolocation_granularity;
16
+ _this.x_axis_include_empty = object.x_axis_include_empty;
17
+ _this.show_x_axis_label = isBoolean(object.show_x_axis_label) ? object.show_x_axis_label : false;
18
+ _this.show_y_axis_label = isBoolean(object.show_y_axis_label) ? object.show_y_axis_label : false;
19
+ _this.x_axis_label_position = object.x_axis_label_position;
20
+ _this.y_axis_label_position = object.y_axis_label_position;
21
+ _this.title_name = object.title_name;
22
+ _this.y_axises = object.y_axises;
23
+ return _this;
24
+ }
25
+ return CustomBar;
26
+ }(BaseModel);
27
+ export { CustomBar as default };
@@ -0,0 +1,22 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
3
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
4
+ import { SUMMARY_METHOD_MAP } from '../constants';
5
+ import BaseModel from './base-model';
6
+ var Dashboard = /*#__PURE__*/function (_BaseModel) {
7
+ _inherits(Dashboard, _BaseModel);
8
+ var _super = _createSuper(Dashboard);
9
+ function Dashboard(object) {
10
+ var _this;
11
+ _classCallCheck(this, Dashboard);
12
+ _this = _super.call(this, object);
13
+ _this.name = null;
14
+ _this.target_value_column = object.target_value_column;
15
+ _this.target_value_column_summary_method = object.target_value_column_summary_method || SUMMARY_METHOD_MAP.Row_count;
16
+ _this.total_value_column = object.total_value_column;
17
+ _this.total_value_column_summary_method = object.total_value_column_summary_method || SUMMARY_METHOD_MAP.Row_count;
18
+ return _this;
19
+ }
20
+ return Dashboard;
21
+ }(BaseModel);
22
+ export { Dashboard as default };
@@ -0,0 +1,219 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
3
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
4
+ import { isNumber } from 'dtable-store';
5
+ import BaseModel from './base-model';
6
+ import { getChartConfigValueFromKey, getChartConfigValueFromKeys } from '../utils/model';
7
+ import { isBoolean } from '../utils/common-utils';
8
+ import { DATE_GRANULARITY, DATE_GRANULARITY_LIST, DEFAULT_LABEL_FONT_SIZE, GEOLOCATION_GRANULARITY, GEOLOCATION_GRANULARITY_LIST } from '../constants';
9
+ import { COLUMN_DATE_GRANULARITY_KEYS, COLUMN_GEO_GRANULARITY_KEYS, COLUMN_GROUPBY_KEYS, LABEL_FRONT_SIZE_KEYS, X_DATE_GRANULARITY_KEYS, X_GEO_GRANULARITY_KEYS, X_GROUPBY_KEYS, X_INCLUDE_EMPTY_KEYS, X_LABEL_POSITION_KEYS, Y_AUTO_RANGE_KEYS, Y_AUTO_RANGE_MAX_KEYS, Y_AUTO_RANGE_MIN_KEYS, Y_LABEL_COLOR_KEYS, Y_LABEL_COLOR_RULES_KEYS, Y_LABEL_POSITION_KEYS, Y_SHOW_AXIS_LABEL_KEYS, Y_SUMMARY_BY_KEYS, Y_SUMMARY_METHOD_KEYS, Y_SUMMARY_TYPE_KEYS } from '../constants/model';
10
+ var GenericModel = /*#__PURE__*/function (_BaseModel) {
11
+ _inherits(GenericModel, _BaseModel);
12
+ var _super = _createSuper(GenericModel);
13
+ function GenericModel(object) {
14
+ var _this;
15
+ _classCallCheck(this, GenericModel);
16
+ _this = _super.call(this, object);
17
+
18
+ // x data
19
+ _this.x_axis_column_key = getChartConfigValueFromKeys(X_GROUPBY_KEYS, object);
20
+ _this.x_axis_date_granularity = getChartConfigValueFromKeys(X_DATE_GRANULARITY_KEYS, object);
21
+ _this.x_axis_geolocation_granularity = getChartConfigValueFromKeys(X_GEO_GRANULARITY_KEYS, object);
22
+ if (_this.x_axis_date_granularity && !DATE_GRANULARITY_LIST.includes(_this.x_axis_date_granularity)) {
23
+ _this.x_axis_date_granularity = DATE_GRANULARITY.MONTH;
24
+ }
25
+ if (_this.x_axis_geolocation_granularity && !GEOLOCATION_GRANULARITY_LIST.includes(_this.x_axis_geolocation_granularity)) {
26
+ _this.x_axis_geolocation_granularity = GEOLOCATION_GRANULARITY.DISTRICT;
27
+ }
28
+ _this.x_axis_include_empty = getChartConfigValueFromKeys(X_INCLUDE_EMPTY_KEYS, object);
29
+ if (!isBoolean(_this.x_axis_include_empty)) {
30
+ _this.x_axis_include_empty = false;
31
+ }
32
+ _this.x_axis_date_range_start = getChartConfigValueFromKey('x_axis_date_range_start', object);
33
+ _this.x_axis_date_range_end = getChartConfigValueFromKey('x_axis_date_range_end', object);
34
+ _this.x_axis_compared_date_range_start = getChartConfigValueFromKey('x_axis_compared_date_range_start', object);
35
+ _this.x_axis_compared_date_range_end = getChartConfigValueFromKey('x_axis_compared_date_range_end', object);
36
+
37
+ // x style
38
+ _this.show_x_axis_label = getChartConfigValueFromKeys(X_INCLUDE_EMPTY_KEYS, object);
39
+ if (!isBoolean(_this.show_x_axis_label)) {
40
+ _this.show_x_axis_label = null;
41
+ }
42
+ _this.x_axis_label_position = getChartConfigValueFromKeys(X_LABEL_POSITION_KEYS, object) || 'center';
43
+
44
+ // y data
45
+ _this.y_axis_column_key = getChartConfigValueFromKeys(Y_SUMMARY_BY_KEYS, object);
46
+ _this.y_axis_summary_method = getChartConfigValueFromKeys(Y_SUMMARY_METHOD_KEYS, object);
47
+ _this.y_axis_summary_type = getChartConfigValueFromKeys(Y_SUMMARY_TYPE_KEYS, object);
48
+
49
+ // y style
50
+ _this.color_option = getChartConfigValueFromKey('color_option', object);
51
+ _this.y_axis_label_color = getChartConfigValueFromKeys(Y_LABEL_COLOR_KEYS, object);
52
+ _this.y_axis_label_color_rules = getChartConfigValueFromKeys(Y_LABEL_COLOR_RULES_KEYS, object);
53
+ _this.show_y_axis_label = getChartConfigValueFromKeys(Y_SHOW_AXIS_LABEL_KEYS, object);
54
+ if (!isBoolean(_this.show_y_axis_label)) {
55
+ _this.show_y_axis_label = null;
56
+ }
57
+ _this.y_axis_label_position = getChartConfigValueFromKeys(Y_LABEL_POSITION_KEYS, object) || 'center';
58
+ _this.y_axis_use_stack = getChartConfigValueFromKey('y_axis_use_stack', object);
59
+ if (!isBoolean(_this.y_axis_use_stack)) {
60
+ _this.y_axis_use_stack = null;
61
+ }
62
+ _this.y_axis_compare_label_color = getChartConfigValueFromKey('y_axis_compare_label_color', object);
63
+ _this.y_axis_compared_label_color = getChartConfigValueFromKey('y_axis_compared_label_color', object);
64
+ _this.y_axis_auto_range = getChartConfigValueFromKeys(Y_AUTO_RANGE_KEYS, object);
65
+ if (!isBoolean(_this.y_axis_auto_range)) {
66
+ _this.y_axis_auto_range = null;
67
+ }
68
+ _this.y_axis_min = getChartConfigValueFromKeys(Y_AUTO_RANGE_MIN_KEYS, object);
69
+ _this.y_axis_max = getChartConfigValueFromKeys(Y_AUTO_RANGE_MAX_KEYS, object);
70
+ if (!isNumber(_this.y_axis_min)) {
71
+ _this.y_axis_min = null;
72
+ }
73
+ if (!isNumber(_this.y_axis_max)) {
74
+ _this.y_axis_max = null;
75
+ }
76
+
77
+ // group
78
+ _this.column_groupby_column_key = getChartConfigValueFromKeys(COLUMN_GROUPBY_KEYS, object);
79
+ _this.column_groupby_date_granularity = getChartConfigValueFromKeys(COLUMN_DATE_GRANULARITY_KEYS, object);
80
+ _this.column_groupby_geolocation_granularity = getChartConfigValueFromKeys(COLUMN_GEO_GRANULARITY_KEYS, object);
81
+ if (_this.column_groupby_date_granularity && !DATE_GRANULARITY_LIST.includes(_this.column_groupby_date_granularity)) {
82
+ _this.column_groupby_date_granularity = DATE_GRANULARITY.MONTH;
83
+ }
84
+ if (_this.column_groupby_geolocation_granularity && !GEOLOCATION_GRANULARITY_LIST.includes(_this.column_groupby_geolocation_granularity)) {
85
+ _this.column_groupby_geolocation_granularity = GEOLOCATION_GRANULARITY.DISTRICT;
86
+ }
87
+ _this.column_groupby_multiple_numeric_column = getChartConfigValueFromKey('column_groupby_multiple_numeric_column', object);
88
+ if (!isBoolean(_this.column_groupby_multiple_numeric_column)) {
89
+ _this.column_groupby_multiple_numeric_column = null;
90
+ }
91
+ _this.column_groupby_numeric_columns = getChartConfigValueFromKey('column_groupby_numeric_columns', object);
92
+
93
+ // other
94
+ _this.sort_type = getChartConfigValueFromKey('sort_type', object);
95
+ _this.display_each_block_data = getChartConfigValueFromKey('display_each_block_data', object);
96
+ if (!isBoolean(_this.display_each_block_data)) {
97
+ _this.display_each_block_data = null;
98
+ }
99
+ _this.title_name = getChartConfigValueFromKey('title_name', object);
100
+ _this.label_font_size = getChartConfigValueFromKeys(LABEL_FRONT_SIZE_KEYS, object);
101
+ if (!isNumber(_this.label_font_size)) {
102
+ _this.label_font_size = DEFAULT_LABEL_FONT_SIZE;
103
+ }
104
+ _this.y_axis_left_summary_type = getChartConfigValueFromKey('y_axis_left_summary_type', object);
105
+ _this.y_axis_right_summary_type = getChartConfigValueFromKey('y_axis_right_summary_type', object);
106
+ _this.y_axis_left_summary_method = getChartConfigValueFromKey('y_axis_left_summary_method', object);
107
+ _this.y_axis_right_summary_method = getChartConfigValueFromKey('y_axis_right_summary_method', object);
108
+ _this.y_axis_left_summary_column = getChartConfigValueFromKey('y_axis_left_summary_column', object);
109
+ _this.y_axis_right_summary_column = getChartConfigValueFromKey('y_axis_right_summary_column', object);
110
+ _this.y_axis_left_group_by_multiple_numeric_column = getChartConfigValueFromKey('y_axis_left_group_by_multiple_numeric_column', object);
111
+ if (!isBoolean(_this.y_axis_left_group_by_multiple_numeric_column)) {
112
+ _this.y_axis_left_group_by_multiple_numeric_column = null;
113
+ }
114
+ _this.y_axis_left_group_by_numeric_columns = getChartConfigValueFromKey('y_axis_left_group_by_numeric_columns', object);
115
+ _this.y_axis_left_color = getChartConfigValueFromKey('y_axis_left_color', object);
116
+ _this.y_axis_right_color = getChartConfigValueFromKey('y_axis_right_color', object);
117
+ _this.show_y_axis_left_label = getChartConfigValueFromKey('show_y_axis_left_label', object);
118
+ _this.show_y_axis_right_label = getChartConfigValueFromKey('show_y_axis_right_label', object);
119
+ _this.y_axis_left_label_position = getChartConfigValueFromKey('y_axis_left_label_position', object);
120
+ _this.y_axis_right_label_position = getChartConfigValueFromKey('y_axis_right_label_position', object);
121
+ _this.y_axis_auto_range_left = getChartConfigValueFromKey('y_axis_auto_range_left', object);
122
+ if (!isBoolean(_this.y_axis_auto_range_left)) {
123
+ _this.y_axis_auto_range_left = null;
124
+ }
125
+ _this.y_axis_min_left = getChartConfigValueFromKey('y_axis_min_left', object);
126
+ _this.y_axis_max_left = getChartConfigValueFromKey('y_axis_max_left', object);
127
+ if (!isNumber(_this.y_axis_min_left)) {
128
+ _this.y_axis_min_left = null;
129
+ }
130
+ if (!isNumber(_this.y_axis_max_left)) {
131
+ _this.y_axis_max_left = null;
132
+ }
133
+ _this.y_axis_auto_range_right = getChartConfigValueFromKey('y_axis_auto_range_right', object);
134
+ if (!isBoolean(_this.y_axis_auto_range_right)) {
135
+ _this.y_axis_auto_range_right = null;
136
+ }
137
+ _this.y_axis_min_right = getChartConfigValueFromKey('y_axis_min_right', object);
138
+ _this.y_axis_max_right = getChartConfigValueFromKey('y_axis_max_right', object);
139
+ if (!isNumber(_this.y_axis_min_right)) {
140
+ _this.y_axis_min_right = null;
141
+ }
142
+ if (!isNumber(_this.y_axis_max_right)) {
143
+ _this.y_axis_max_right = null;
144
+ }
145
+ _this.display_increase = getChartConfigValueFromKey('display_increase', object);
146
+ if (!isBoolean(_this.display_increase)) {
147
+ _this.display_increase = null;
148
+ }
149
+ _this.display_increase_percentage = getChartConfigValueFromKey('display_increase_percentage', object);
150
+ if (!isBoolean(_this.display_increase_percentage)) {
151
+ _this.display_increase_percentage = null;
152
+ }
153
+ _this.increase_display_color = getChartConfigValueFromKey('increase_display_color', object);
154
+ if (!isBoolean(_this.increase_display_color)) {
155
+ _this.increase_display_color = null;
156
+ }
157
+ _this.completed_column = getChartConfigValueFromKey('completed_column', object);
158
+ _this.target_column = getChartConfigValueFromKey('target_column', object);
159
+ _this.target_value_column_summary_method = getChartConfigValueFromKey('target_value_column_summary_method', object);
160
+ _this.total_value_column = getChartConfigValueFromKey('total_value_column', object);
161
+ _this.total_value_column_summary_method = getChartConfigValueFromKey('total_value_column_summary_method', object);
162
+ _this.completed_color = getChartConfigValueFromKey('completed_color', object);
163
+ _this.display_percentage = getChartConfigValueFromKey('display_percentage', object);
164
+ if (!isBoolean(_this.display_percentage)) {
165
+ _this.display_percentage = null;
166
+ }
167
+ _this.target_value_column = getChartConfigValueFromKey('target_value_column', object);
168
+ _this.legend_direction = getChartConfigValueFromKey('legend_direction', object);
169
+ _this.legend_size = getChartConfigValueFromKey('legend_size', object);
170
+ _this.is_transpose = getChartConfigValueFromKey('is_transpose', object);
171
+ if (!isBoolean(_this.is_transpose)) {
172
+ _this.is_transpose = null;
173
+ }
174
+ _this.show_legend = getChartConfigValueFromKey('show_legend', object);
175
+ if (!isBoolean(_this.show_legend)) {
176
+ _this.show_legend = null;
177
+ }
178
+ _this.display_label = getChartConfigValueFromKey('display_label', object);
179
+ if (!isBoolean(_this.display_label)) {
180
+ _this.display_label = null;
181
+ }
182
+ _this.show_percent = getChartConfigValueFromKey('show_percent', object);
183
+ if (!isBoolean(_this.show_percent)) {
184
+ _this.show_percent = null;
185
+ }
186
+ _this.minimum_slice_percent = getChartConfigValueFromKey('minimum_slice_percent', object);
187
+ if (!isNumber(_this.minimum_slice_percent)) {
188
+ _this.minimum_slice_percent = 1.5;
189
+ }
190
+ _this.display_annotation = getChartConfigValueFromKey('display_annotation', object);
191
+ if (!isBoolean(_this.display_annotation)) {
192
+ _this.display_annotation = null;
193
+ }
194
+ _this.display_total = getChartConfigValueFromKey('display_total', object);
195
+ if (!isBoolean(_this.display_total)) {
196
+ _this.display_total = null;
197
+ }
198
+ _this.summary_columns_option = getChartConfigValueFromKey('summary_columns_option', object);
199
+ _this.display_data = getChartConfigValueFromKey('display_data', object);
200
+ if (!isBoolean(_this.display_data)) {
201
+ _this.display_data = null;
202
+ }
203
+ _this.increase_line_color = getChartConfigValueFromKey('increase_line_color', object);
204
+ _this.data_color = getChartConfigValueFromKey('data_color', object);
205
+ _this.grid_distance = getChartConfigValueFromKey('grid_distance', object);
206
+ if (!isNumber(_this.grid_distance)) {
207
+ _this.grid_distance = null;
208
+ }
209
+ _this.grid_size = getChartConfigValueFromKey('grid_size', object);
210
+ if (!isNumber(_this.grid_size)) {
211
+ _this.grid_size = null;
212
+ }
213
+ _this.bubble_color = getChartConfigValueFromKey('bubble_color', object);
214
+ _this.label_format = getChartConfigValueFromKey('label_format', object);
215
+ return _this;
216
+ }
217
+ return GenericModel;
218
+ }(BaseModel);
219
+ export { GenericModel as default };
@@ -0,0 +1,35 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
3
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
4
+ import { TableUtils } from 'dtable-store';
5
+ import BaseModel from './base-model';
6
+ import { isStatisticDateColumn } from '../utils/column-utils';
7
+ import { SUMMARY_METHOD_MAP, SUMMARY_TYPE } from '../constants';
8
+ var HeatMap = /*#__PURE__*/function (_BaseModel) {
9
+ _inherits(HeatMap, _BaseModel);
10
+ var _super = _createSuper(HeatMap);
11
+ function HeatMap(object, table) {
12
+ var _this;
13
+ _classCallCheck(this, HeatMap);
14
+ _this = _super.call(this, object);
15
+ _this.time_column = object.x_axis_column_key || null;
16
+ if (_this.time_column) {
17
+ var column = TableUtils.getTableColumnByKey(table, _this.time_column);
18
+ if (!isStatisticDateColumn(column)) {
19
+ _this.time_column = null;
20
+ }
21
+ }
22
+ _this.summary_type = object.y_axis_summary_type || SUMMARY_TYPE.COUNT;
23
+ _this.summary_method = object.y_axis_summary_method;
24
+ _this.summary_column = object.y_axis_summary_column;
25
+ if (_this.summary_method === SUMMARY_METHOD_MAP.Row_count) {
26
+ _this.summary_method = SUMMARY_METHOD_MAP.Max;
27
+ }
28
+ _this.data_color = object.data_color;
29
+ _this.grid_distance = object.grid_distance;
30
+ _this.grid_size = object.grid_size;
31
+ return _this;
32
+ }
33
+ return HeatMap;
34
+ }(BaseModel);
35
+ export { HeatMap as default };
@@ -0,0 +1,55 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
3
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
4
+ import BaseModel from './base-model';
5
+ import { isBoolean } from '../utils/common-utils';
6
+ import { SUMMARY_METHOD_MAP, SUMMARY_TYPE } from '../constants';
7
+ var HorizontalBarGroup = /*#__PURE__*/function (_BaseModel) {
8
+ _inherits(HorizontalBarGroup, _BaseModel);
9
+ var _super = _createSuper(HorizontalBarGroup);
10
+ function HorizontalBarGroup(object) {
11
+ var _this;
12
+ _classCallCheck(this, HorizontalBarGroup);
13
+ _this = _super.call(this, object);
14
+
15
+ // vertical data
16
+ _this.vertical_axis_column_key = object.x_axis_column_key;
17
+ _this.vertical_axis_date_granularity = object.x_axis_date_granularity;
18
+ _this.vertical_axis_geolocation_granularity = object.x_axis_geolocation_granularity;
19
+ _this.vertical_axis_include_empty = object.x_axis_include_empty;
20
+
21
+ // vertical style
22
+ _this.show_vertical_axis_label = isBoolean(object.show_x_axis_label) ? object.show_x_axis_label : false;
23
+ _this.vertical_axis_label_position = object.x_axis_label_position;
24
+
25
+ // horizontal data
26
+ _this.horizontal_axis_column_key = object.y_axis_column_key;
27
+ _this.horizontal_axis_summary_method = object.y_axis_summary_method;
28
+ _this.horizontal_axis_summary_type = object.y_axis_summary_type || SUMMARY_TYPE.COUNT;
29
+ if (_this.horizontal_axis_summary_method === SUMMARY_METHOD_MAP.Row_count) {
30
+ _this.horizontal_axis_summary_method = SUMMARY_METHOD_MAP.Max;
31
+ }
32
+
33
+ // horizontal style
34
+ _this.show_horizontal_axis_label = isBoolean(object.show_y_axis_label) ? object.show_y_axis_label : false;
35
+ _this.horizontal_axis_label_position = object.y_axis_label_position;
36
+ _this.horizontal_axis_label_color = object.y_axis_label_color;
37
+ _this.h_axis_auto_range = object.y_axis_auto_range;
38
+ _this.h_axis_min = object.y_axis_min;
39
+ _this.h_axis_max = object.y_axis_max;
40
+
41
+ // group
42
+ _this.column_groupby_column_key = object.column_groupby_column_key;
43
+ _this.column_groupby_date_granularity = object.column_groupby_date_granularity;
44
+ _this.column_groupby_geolocation_granularity = object.column_groupby_geolocation_granularity;
45
+ _this.column_groupby_multiple_numeric_column = object.column_groupby_multiple_numeric_column;
46
+ _this.column_groupby_numeric_columns = object.column_groupby_numeric_columns;
47
+ _this.title_name = object.title_name;
48
+ _this.label_font_size = object.label_font_size;
49
+ _this.color_option = object.color_option;
50
+ _this.sort_type = object.sort_type;
51
+ return _this;
52
+ }
53
+ return HorizontalBarGroup;
54
+ }(BaseModel);
55
+ export { HorizontalBarGroup as default };
@@ -0,0 +1,49 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
3
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
4
+ import BaseModel from './base-model';
5
+ import { isBoolean } from '../utils/common-utils';
6
+ import { SUMMARY_METHOD_MAP, SUMMARY_TYPE } from '../constants';
7
+ var _default = /*#__PURE__*/function (_BaseModel) {
8
+ _inherits(_default, _BaseModel);
9
+ var _super = _createSuper(_default);
10
+ function _default(object) {
11
+ var _this;
12
+ _classCallCheck(this, _default);
13
+ _this = _super.call(this, object);
14
+
15
+ // vertical data
16
+ _this.vertical_axis_column_key = object.x_axis_column_key;
17
+ _this.vertical_axis_date_granularity = object.x_axis_date_granularity;
18
+ _this.vertical_axis_geolocation_granularity = object.x_axis_geolocation_granularity;
19
+ _this.vertical_axis_include_empty = object.x_axis_include_empty;
20
+
21
+ // vertical style
22
+ _this.show_vertical_axis_label = isBoolean(object.show_x_axis_label) ? object.show_x_axis_label : false;
23
+ _this.vertical_axis_label_position = object.x_axis_label_position;
24
+
25
+ // horizontal data
26
+ _this.horizontal_axis_column_key = object.y_axis_column_key;
27
+ _this.horizontal_axis_summary_method = object.y_axis_summary_method;
28
+ _this.horizontal_axis_summary_type = object.y_axis_summary_type || SUMMARY_TYPE.COUNT;
29
+ if (_this.horizontal_axis_summary_method === SUMMARY_METHOD_MAP.Row_count) {
30
+ _this.horizontal_axis_summary_method = SUMMARY_METHOD_MAP.Max;
31
+ }
32
+
33
+ // horizontal style
34
+ _this.color_option = object.color_option;
35
+ _this.horizontal_axis_label_position = object.y_axis_label_position;
36
+ _this.horizontal_axis_label_color = object.y_axis_label_color;
37
+ _this.show_horizontal_axis_label = isBoolean(object.show_y_axis_label) ? object.show_y_axis_label : false;
38
+ _this.horizontal_axis_label_color_rules = object.y_axis_label_color_rules;
39
+ _this.h_axis_auto_range = object.y_axis_auto_range;
40
+ _this.h_axis_min = object.y_axis_min;
41
+ _this.h_axis_max = object.y_axis_max;
42
+ _this.sort_type = object.sort_type;
43
+ _this.label_font_size = object.label_font_size;
44
+ _this.display_data = object.display_data;
45
+ return _this;
46
+ }
47
+ return _default;
48
+ }(BaseModel);
49
+ export { _default as default };
@@ -0,0 +1,26 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ var _STAT_TYPE$MAP$STAT_T;
3
+ import Map from './map';
4
+ import WorldMap from './world-map';
5
+ import HearMap from './heat-map';
6
+ import Mirror from './mirror';
7
+ import Bar from './bar';
8
+ import BarGroup from './bar-group';
9
+ import Pie from './pie';
10
+ import Ring from './ring';
11
+ import Scatter from './scatter';
12
+ import BasicNumberCard from './basic-number-card';
13
+ import HorizontalBar from './horizontal-bar';
14
+ import HorizontalBarGroup from './horizontal-bar-group';
15
+ import Combination from './combination';
16
+ import CompareBar from './compare-bar';
17
+ import CustomBar from './custom-bar';
18
+ import Trend from './trend';
19
+ import Completeness from './completeness';
20
+ import Dashboard from './dashboard';
21
+ import CompletenessGroup from './completeness-group';
22
+ import Table from './table';
23
+ import GenericModel from './generic-model';
24
+ import { STAT_TYPE } from '../constants';
25
+ export { Map, WorldMap, HearMap, Mirror, Bar, BarGroup, CustomBar, Pie, Ring, Scatter, BasicNumberCard, HorizontalBar, HorizontalBarGroup, Combination, CompareBar, Trend, Completeness, Dashboard, CompletenessGroup, Table, GenericModel };
26
+ export default (_STAT_TYPE$MAP$STAT_T = {}, _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.MAP, Map), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.MAP_BUBBLE, Map), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.WORLD_MAP, WorldMap), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.WORLD_MAP_BUBBLE, WorldMap), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.HEAT_MAP, HearMap), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.MIRROR, Mirror), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.BAR, Bar), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.LINE, Bar), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.AREA_CHART, Bar), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.BAR_GROUP, BarGroup), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.BAR_STACK, BarGroup), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.GROUP_LINE, BarGroup), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.AREA_GROUP_CHART, BarGroup), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.PIE, Pie), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.TREEMAP, Pie), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.RING, Ring), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.SCATTER, Scatter), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.BASIC_NUMBER_CARD, BasicNumberCard), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.HORIZONTAL_BAR, HorizontalBar), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.HORIZONTAL_GROUP_BAR, HorizontalBarGroup), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.STACKED_HORIZONTAL_BAR, HorizontalBarGroup), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.COMBINATION_CHART, Combination), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.COMPARE_BAR, CompareBar), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.TREND_CHART, Trend), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.COMPLETENESS_CHART, Completeness), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.DASHBOARD, Dashboard), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.GROUP_COMPLETENESS_CHART, CompletenessGroup), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.PIVOT_TABLE, Table), _defineProperty(_STAT_TYPE$MAP$STAT_T, STAT_TYPE.CUSTOM_BAR, CustomBar), _STAT_TYPE$MAP$STAT_T);
@@ -0,0 +1,37 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
3
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
4
+ import { isNumber, TableUtils } from 'dtable-store';
5
+ import BaseModel from './base-model';
6
+ import { isMapColumn } from '../utils/column-utils';
7
+ import { GEOLOCATION_GRANULARITY, LEGEND_DIRECTION_MAP, SUMMARY_METHOD_MAP, SUMMARY_TYPE } from '../constants';
8
+ var Map = /*#__PURE__*/function (_BaseModel) {
9
+ _inherits(Map, _BaseModel);
10
+ var _super = _createSuper(Map);
11
+ function Map(object, table) {
12
+ var _this;
13
+ _classCallCheck(this, Map);
14
+ _this = _super.call(this, object);
15
+ _this.geo_column = object.x_axis_column_key;
16
+ _this.geolocation_granularity = object.x_axis_geolocation_granularity || GEOLOCATION_GRANULARITY.PROVINCE;
17
+ if (_this.geo_column) {
18
+ var column = TableUtils.getTableColumnByKey(table, _this.geo_column);
19
+ if (!isMapColumn(column)) {
20
+ _this.geo_column = null;
21
+ }
22
+ }
23
+ _this.summary_type = object.y_axis_summary_type || SUMMARY_TYPE.COUNT;
24
+ _this.summary_method = object.y_summary_method;
25
+ _this.summary_column = object.y_axis_summary_column;
26
+ if (_this.summary_method === SUMMARY_METHOD_MAP.Row_count) {
27
+ _this.summary_method = SUMMARY_METHOD_MAP.Max;
28
+ }
29
+ _this.legend_direction = object.legend_direction || LEGEND_DIRECTION_MAP.VERTICAL;
30
+ _this.legend_size = isNumber(_this.legend_size) ? object.legend_size : 1;
31
+ _this.data_color = object.data_color;
32
+ _this.bubble_color = object.bubble_color;
33
+ return _this;
34
+ }
35
+ return Map;
36
+ }(BaseModel);
37
+ export { Map as default };
@@ -0,0 +1,35 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
3
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
4
+ import { TableUtils } from 'dtable-store';
5
+ import BaseModel from './base-model';
6
+ import { isBoolean } from '../utils/common-utils';
7
+ import { isMirrorColumn } from '../utils/column-utils';
8
+ import { SUMMARY_METHOD_MAP, SUMMARY_TYPE } from '../constants';
9
+ var Mirror = /*#__PURE__*/function (_BaseModel) {
10
+ _inherits(Mirror, _BaseModel);
11
+ var _super = _createSuper(Mirror);
12
+ function Mirror(object, table) {
13
+ var _this;
14
+ _classCallCheck(this, Mirror);
15
+ _this = _super.call(this, object);
16
+ _this.column = object.x_axis_column_key;
17
+ if (_this.column) {
18
+ var column = TableUtils.getTableColumnByKey(table, _this.column);
19
+ if (!isMirrorColumn(column)) {
20
+ _this.column = null;
21
+ }
22
+ }
23
+ _this.is_transpose = isBoolean(object.is_transpose) ? object.is_transpose : false;
24
+ _this.group_column = object.column_groupby_column_key;
25
+ _this.summary_type = object.y_axis_summary_type || SUMMARY_TYPE.COUNT;
26
+ _this.summary_method = object.y_summary_method;
27
+ _this.summary_column = object.y_axis_summary_column;
28
+ if (_this.summary_method === SUMMARY_METHOD_MAP.Row_count) {
29
+ _this.summary_method = SUMMARY_METHOD_MAP.Max;
30
+ }
31
+ return _this;
32
+ }
33
+ return Mirror;
34
+ }(BaseModel);
35
+ export { Mirror as default };