dtable-statistic 5.0.33 → 5.0.35

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.
@@ -153,14 +153,7 @@
153
153
  align-items: center;
154
154
  overflow: hidden;
155
155
  position: relative;
156
- }
157
-
158
- .statistic-list .statistic-chart-preview-container .sea-chart-table-formatter-container {
159
- padding-right: 15px;
160
- }
161
-
162
- .statistic-list .statistic-chart-preview-container .sea-chart-table-formatter-container .sea-chart-one-table-wrapper {
163
- padding-left: 15px;
156
+ padding: 0px 20px 20px 20px
164
157
  }
165
158
 
166
159
  .statistic-list .statistic-chart-preview-container .sea-chart-formatter-tip {
@@ -191,6 +184,11 @@
191
184
  height: 100%;
192
185
  }
193
186
 
187
+ .statistic-chart-container .sea-chart-formatter .sea-chart-container {
188
+ left: 0;
189
+ top: 0;
190
+ }
191
+
194
192
  .statistic-chart-container.map {
195
193
  padding: 20px;
196
194
  }
@@ -262,7 +260,6 @@
262
260
 
263
261
  .statistic-list .statistic-chart-preview-name {
264
262
  color: var(--common-font-color);
265
- font-size: 18px;
266
263
  }
267
264
 
268
265
  .statistic-list .statistic-chart-preview-microscope {
package/es/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
4
  var _react = _interopRequireDefault(require("react"));
5
5
  var _dtableStore = require("dtable-store");
6
+ var _seaChart = require("sea-chart");
6
7
  var _dashboard = _interopRequireDefault(require("./dashboard"));
7
8
  var _converStatItem = require("./model/conver-statItem");
8
9
  class Statistic {
@@ -36,6 +37,7 @@ class Statistic {
36
37
  static convertStatistics(value) {
37
38
  value.statistics.forEach(dashboard => {
38
39
  const new_stat_items = dashboard.stat_items.map(item => {
40
+ var _item$config, _item$config2, _item$config3;
39
41
  if (!item.config) {
40
42
  const newItem = {
41
43
  config: {
@@ -52,6 +54,63 @@ class Statistic {
52
54
  };
53
55
  return newItem;
54
56
  }
57
+ const {
58
+ summary_columns
59
+ } = item.config || {};
60
+ if ((item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.type) === _seaChart.CHART_TYPE.TABLE && Array.isArray(summary_columns) && (summary_columns === null || summary_columns === void 0 ? void 0 : summary_columns.length) !== 0) {
61
+ const new_summary_columns = [];
62
+ summary_columns.forEach(item => {
63
+ if (Object.keys(item).length !== 0) {
64
+ new_summary_columns.push({
65
+ column_key: (item === null || item === void 0 ? void 0 : item.column_key) || (item === null || item === void 0 ? void 0 : item.key),
66
+ summary_method: (item === null || item === void 0 ? void 0 : item.summary_method) || (item === null || item === void 0 ? void 0 : item.method)
67
+ });
68
+ }
69
+ });
70
+ item.config.summary_columns = [...new_summary_columns];
71
+ }
72
+ if ((item === null || item === void 0 ? void 0 : (_item$config2 = item.config) === null || _item$config2 === void 0 ? void 0 : _item$config2.type) === _seaChart.CHART_TYPE.BASIC_NUMBER_CARD) {
73
+ const {
74
+ font_size,
75
+ font_weight,
76
+ font_color,
77
+ text_align,
78
+ card_label_font_size,
79
+ label_font_color,
80
+ label_font_weight,
81
+ label_text_align
82
+ } = item.config || {};
83
+ if (!font_size && !font_weight && !font_color && !text_align && !card_label_font_size && !label_font_color && !label_font_weight && !label_text_align) {
84
+ item.config = {
85
+ ...item.config,
86
+ font_size: 34,
87
+ font_weight: 700,
88
+ card_label_font_size: 14,
89
+ label_font_weight: 400
90
+ };
91
+ }
92
+ }
93
+ if ((item === null || item === void 0 ? void 0 : (_item$config3 = item.config) === null || _item$config3 === void 0 ? void 0 : _item$config3.type) === _seaChart.CHART_TYPE.TREND) {
94
+ const {
95
+ num_font_size,
96
+ num_font_weight,
97
+ num_font_color,
98
+ num_text_align,
99
+ card_label_font_size,
100
+ label_font_color,
101
+ label_font_weight,
102
+ label_text_align
103
+ } = item.config || {};
104
+ if (!num_font_size && !num_font_weight && !num_font_color && !num_text_align && !card_label_font_size && !label_font_color && !label_font_weight && !label_text_align) {
105
+ item.config = {
106
+ ...item.config,
107
+ num_font_size: 34,
108
+ num_font_weight: 700,
109
+ card_label_font_size: 14,
110
+ label_font_weight: 400
111
+ };
112
+ }
113
+ }
55
114
  return item;
56
115
  });
57
116
  dashboard.stat_items = new_stat_items;
@@ -52,10 +52,12 @@ const convertByType = statItem => {
52
52
  newStatItem['x_axis_include_empty_cells'] = (statItem === null || statItem === void 0 ? void 0 : statItem.x_axis_include_empty) || false;
53
53
  newStatItem['x_axis_show_label'] = (statItem === null || statItem === void 0 ? void 0 : statItem.show_x_axis_label) || false;
54
54
  newStatItem['y_axis_show_label'] = (statItem === null || statItem === void 0 ? void 0 : statItem.show_y_axis_label) || false;
55
- newStatItem['y_axises'] = statItem === null || statItem === void 0 ? void 0 : statItem.y_axises.map(item => ({
56
- ...item,
57
- type: 'bar_stack'
58
- }));
55
+ if (statItem !== null && statItem !== void 0 && statItem.y_axises) {
56
+ newStatItem['y_axises'] = statItem === null || statItem === void 0 ? void 0 : statItem.y_axises.map(item => ({
57
+ ...item,
58
+ type: 'bar_stack'
59
+ }));
60
+ }
59
61
  }
60
62
  if (type === 'completeness_chart' || type === 'group_completeness_chart') {
61
63
  newStatItem['type'] = typeMapping[type];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-statistic",
3
- "version": "5.0.33",
3
+ "version": "5.0.35",
4
4
  "description": "statistics",
5
5
  "main": "dist/dtable-statistic.js",
6
6
  "author": "seafile",