dtable-statistic 4.0.6 → 4.0.8

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 (67) hide show
  1. package/es/assets/css/dashboard.css +22 -0
  2. package/es/calculator/basic-chart-calculator.js +27 -18
  3. package/es/calculator/combination-calculator.js +34 -9
  4. package/es/calculator/compare-bar-calculator.js +37 -30
  5. package/es/calculator/heat-map-calculator.js +25 -14
  6. package/es/calculator/map-calculator.js +25 -14
  7. package/es/calculator/mirror-calculator.js +29 -14
  8. package/es/calculator/pivot-table-calculator.js +132 -76
  9. package/es/calculator/workers/basic-chart-calculator-worker.js +21 -6
  10. package/es/calculator/workers/combination-calculator-worker.js +20 -5
  11. package/es/calculator/workers/compare-bar-chart-calculator-worker.js +12 -6
  12. package/es/calculator/workers/mirror-calculator-worker.js +15 -6
  13. package/es/calculator/workers/pivot-table-calculator-worker.js +97 -44
  14. package/es/calculator/world-map-calculator.js +25 -14
  15. package/es/components/dialog/enlarged-chart-dialog.js +2 -2
  16. package/es/components/dialog/statistic-record-dialog/index.css +2 -0
  17. package/es/components/dialog/statistic-record-dialog/index.js +80 -52
  18. package/es/constants/index.js +30 -29
  19. package/es/dashboard.js +57 -43
  20. package/es/desktop-dashboard.js +21 -56
  21. package/es/index.js +34 -2
  22. package/es/locale/lang/de.js +7 -3
  23. package/es/locale/lang/en.js +5 -1
  24. package/es/locale/lang/fr.js +7 -3
  25. package/es/locale/lang/zh_CN.js +5 -1
  26. package/es/mobile-dashboard.js +5 -5
  27. package/es/model/horizontal-bar-group.js +2 -0
  28. package/es/stat-editor/stat-settings/advance-chart-settings/index.js +1 -2
  29. package/es/stat-editor/stat-settings/advance-chart-settings/summary-settings.js +1 -1
  30. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/horizontal-bar-chart-style.js +20 -3
  31. package/es/stat-editor/stat-settings/basic-chart-settings/summary-settings.js +2 -8
  32. package/es/stat-editor/stat-settings/public-setting/type-settings/index.js +23 -2
  33. package/es/stat-list/chart-preview.js +3 -4
  34. package/es/stat-list/index.js +10 -4
  35. package/es/stat-view/area-chart.js +177 -162
  36. package/es/stat-view/bar-chart.js +221 -222
  37. package/es/stat-view/base-chart.js +79 -7
  38. package/es/stat-view/basic-number-card.js +11 -19
  39. package/es/stat-view/combination-chart.js +100 -83
  40. package/es/stat-view/compare-chart.js +133 -144
  41. package/es/stat-view/completeness-chart.js +108 -102
  42. package/es/stat-view/custom-bar.js +79 -99
  43. package/es/stat-view/dashboard-chart.js +57 -57
  44. package/es/stat-view/heat-map.js +13 -32
  45. package/es/stat-view/horizontal-bar-chart.js +200 -230
  46. package/es/stat-view/index.js +2 -2
  47. package/es/stat-view/line-chart.js +162 -158
  48. package/es/stat-view/map.js +26 -40
  49. package/es/stat-view/mirror.js +88 -94
  50. package/es/stat-view/pie-chart.js +11 -39
  51. package/es/stat-view/pivot-table/index.js +4 -16
  52. package/es/stat-view/pivot-table/one-dimension-table-no-numeric-columns.js +36 -23
  53. package/es/stat-view/pivot-table/one-dimension-table-with-numeric-columns.js +11 -5
  54. package/es/stat-view/pivot-table/pivot-table-display-name.js +206 -0
  55. package/es/stat-view/pivot-table/two-dimension-table.js +104 -60
  56. package/es/stat-view/ring-chart.js +24 -42
  57. package/es/stat-view/scatter-chart.js +4 -21
  58. package/es/stat-view/treemap-chart.js +3 -12
  59. package/es/stat-view/trend-chart.js +6 -17
  60. package/es/stat-view/world-map.js +39 -50
  61. package/es/tabs/tab.js +2 -1
  62. package/es/utils/collaborator.js +9 -0
  63. package/es/utils/common-utils.js +24 -6
  64. package/es/utils/index.js +1 -1
  65. package/es/utils/sql-utils.js +10 -9
  66. package/es/utils/stat-utils.js +8 -5
  67. package/package.json +1 -1
@@ -6,15 +6,13 @@ import React, { Component } from 'react';
6
6
  import classnames from 'classnames';
7
7
  import { UncontrolledTooltip } from 'reactstrap';
8
8
  import intl from 'react-intl-universal';
9
- import { Views } from 'dtable-store';
10
- import dtableDbAPI from './api/dtable-db-api';
11
9
  import Tabs from './tabs';
12
10
  import StatList from './stat-list';
13
11
  import ColorThemeDialog from './components/dialog/color-theme-dialog';
14
12
  import ChartAdditionEditDialog from './components/dialog/chart-addition-edit-dialog';
15
13
  import StatisticRecordDialog from './components/dialog/statistic-record-dialog';
16
14
  import ChartService from './service/chart-service';
17
- import { getSqlString } from './utils/sql-utils';
15
+ import { THEME_NAME_MAP } from './constants';
18
16
  import logo from './assets/images/icon.png';
19
17
  var KEY_LOCAL_THEME_MODE = 'statistics-theme-mode';
20
18
  var DesktopDashboard = /*#__PURE__*/function (_Component) {
@@ -41,7 +39,7 @@ var DesktopDashboard = /*#__PURE__*/function (_Component) {
41
39
  });
42
40
  };
43
41
  _this.toggleThemeMode = function () {
44
- var theme = _this.state.theme === 'dark' ? 'light' : 'dark';
42
+ var theme = _this.state.theme === THEME_NAME_MAP.DARK ? THEME_NAME_MAP.LIGHT : THEME_NAME_MAP.DARK;
45
43
  _this.setState({
46
44
  theme: theme
47
45
  }, function () {
@@ -93,47 +91,17 @@ var DesktopDashboard = /*#__PURE__*/function (_Component) {
93
91
  _this.setState({
94
92
  chartRecordsParams: null
95
93
  });
96
- return;
97
- }
98
- var statisticRecords = statisticRecord.rows;
99
- if (!Array.isArray(statisticRecords) || statisticRecords.length === 0) return;
100
- var getTableById = _this.props.getTableById;
101
- var table_id = chart.table_id,
102
- view_id = chart.view_id;
103
- var table = getTableById(table_id);
104
- var view = Views.getViewById(table.views, view_id);
105
- var isArchiveView = Views.isArchiveView(view);
106
- var chartRecordsParams = {
107
- isLoading: true,
108
- currentDate: statisticRecord.name,
109
- chart: chart
110
- };
111
- _this.setState({
112
- chartRecordsParams: chartRecordsParams
113
- }, function () {
114
- if (isArchiveView || !statisticRecords) {
115
- var sqlString = getSqlString(chart, statisticRecord, {
94
+ } else {
95
+ _this.setState({
96
+ chartRecordsParams: {
97
+ statisticRecord: statisticRecord,
98
+ chart: chart,
116
99
  isColumn: isColumn,
117
100
  isCurrentView: isCurrentView,
118
- isRow: isRow,
119
- getTableById: getTableById
120
- });
121
- dtableDbAPI.sqlQuery(sqlString).then(function (res) {
122
- var rows = res.data.results;
123
- chartRecordsParams.rows = rows;
124
- chartRecordsParams.isLoading = false;
125
- _this.setState({
126
- chartRecordsParams: chartRecordsParams
127
- });
128
- });
129
- return;
130
- }
131
- chartRecordsParams.rows = statisticRecord.rows;
132
- chartRecordsParams.isLoading = false;
133
- _this.setState({
134
- chartRecordsParams: chartRecordsParams
101
+ isRow: isRow
102
+ }
135
103
  });
136
- });
104
+ }
137
105
  };
138
106
  _this.generateChart = function (chartType) {
139
107
  var _this$props2 = _this.props,
@@ -169,7 +137,7 @@ var DesktopDashboard = /*#__PURE__*/function (_Component) {
169
137
  var _this$props3 = this.props,
170
138
  getTableById = _this$props3.getTableById,
171
139
  isTableReadOnly = _this$props3.isTableReadOnly,
172
- refresh = _this$props3.refresh,
140
+ dtableChangedTime = _this$props3.dtableChangedTime,
173
141
  colorThemeName = _this$props3.colorThemeName,
174
142
  statistics = _this$props3.statistics,
175
143
  selectedDashboardIdx = _this$props3.selectedDashboardIdx,
@@ -181,7 +149,7 @@ var DesktopDashboard = /*#__PURE__*/function (_Component) {
181
149
  isFullScreen = _this$state.isFullScreen,
182
150
  editingChart = _this$state.editingChart,
183
151
  chartRecordsParams = _this$state.chartRecordsParams;
184
- var darkMode = theme === 'dark';
152
+ var darkMode = theme === THEME_NAME_MAP.DARK;
185
153
  var statistic = statistics[selectedDashboardIdx];
186
154
  var _ref2 = statistic || {},
187
155
  statItems = _ref2.stat_items;
@@ -213,19 +181,19 @@ var DesktopDashboard = /*#__PURE__*/function (_Component) {
213
181
  }), /*#__PURE__*/React.createElement("div", {
214
182
  className: "statistic-header-operators d-flex align-items-center"
215
183
  }, !isTableReadOnly && /*#__PURE__*/React.createElement("button", {
216
- className: "btn btn-secondary op-item add-stat mr-4",
184
+ className: "btn btn-secondary op-item add-stat",
217
185
  onClick: this.onToggleChartAddition
218
186
  }, /*#__PURE__*/React.createElement("i", {
219
187
  className: "op-item-icon add-chart-icon dtable-font dtable-icon-add-table"
220
188
  }), /*#__PURE__*/React.createElement("span", {
221
189
  className: "add-new-option"
222
190
  }, intl.get('New_chart'))), /*#__PURE__*/React.createElement("div", {
223
- className: "op-item op-item-icon-wrapper mr-4",
191
+ className: "op-item op-item-icon-wrapper",
224
192
  onClick: this.onToggleColorThemeDialog
225
193
  }, /*#__PURE__*/React.createElement("span", {
226
194
  className: "op-item-icon dtable-font dtable-icon-set-up"
227
195
  })), /*#__PURE__*/React.createElement("div", {
228
- className: "op-item op-item-icon-wrapper mr-4",
196
+ className: "op-item op-item-icon-wrapper",
229
197
  id: "btn-statistic-full-screen",
230
198
  onClick: this.onToggleFullScreen
231
199
  }, /*#__PURE__*/React.createElement("span", {
@@ -234,10 +202,10 @@ var DesktopDashboard = /*#__PURE__*/function (_Component) {
234
202
  placement: "bottom",
235
203
  target: "btn-statistic-full-screen"
236
204
  }, isFullScreen ? intl.get('Cancel_full_screen') : intl.get('Full_screen'))), /*#__PURE__*/React.createElement("div", {
237
- className: "op-item op-item-icon-wrapper mr-4",
205
+ className: "op-item op-item-icon-wrapper",
238
206
  id: "btn-statistic-theme-setting"
239
207
  }, /*#__PURE__*/React.createElement("span", {
240
- className: "op-item-icon dtable-font ".concat(theme === 'dark' ? 'dtable-icon-day-mode' : 'dtable-icon-night-mode'),
208
+ className: "op-item-icon dtable-font ".concat(theme === THEME_NAME_MAP.DARK ? 'dtable-icon-day-mode' : 'dtable-icon-night-mode'),
241
209
  onClick: this.toggleThemeMode
242
210
  }), /*#__PURE__*/React.createElement(UncontrolledTooltip, {
243
211
  placement: "bottom",
@@ -247,12 +215,12 @@ var DesktopDashboard = /*#__PURE__*/function (_Component) {
247
215
  className: "op-item op-item-icon-wrapper"
248
216
  }, /*#__PURE__*/React.createElement("span", {
249
217
  title: intl.get('Close'),
250
- className: "op-item-icon dtable-font dtable-icon-fork-number"
218
+ className: "op-item-icon btn-close dtable-font dtable-icon-x"
251
219
  })))), /*#__PURE__*/React.createElement("main", {
252
220
  className: "statistic-main"
253
221
  }, /*#__PURE__*/React.createElement(StatList, {
254
222
  isTableReadOnly: isTableReadOnly,
255
- refresh: refresh,
223
+ dtableChangedTime: dtableChangedTime,
256
224
  theme: theme,
257
225
  colorThemeName: colorThemeName,
258
226
  statItems: statItems,
@@ -285,11 +253,8 @@ var DesktopDashboard = /*#__PURE__*/function (_Component) {
285
253
  colorThemeName: colorThemeName,
286
254
  onToggleColorThemeDialog: this.onToggleColorThemeDialog,
287
255
  modifyColorTheme: this.props.modifyColorTheme
288
- }), !!this.state.chartRecordsParams && /*#__PURE__*/React.createElement(StatisticRecordDialog, {
289
- isLoading: chartRecordsParams.isLoading,
290
- rows: chartRecordsParams.rows,
291
- statistic: chartRecordsParams.chart,
292
- currentDate: chartRecordsParams.currentDate,
256
+ }), !!chartRecordsParams && /*#__PURE__*/React.createElement(StatisticRecordDialog, {
257
+ chartRecordsParams: chartRecordsParams,
293
258
  getTableById: getTableById,
294
259
  toggleStatisticRecordsDialog: this.toggleStatisticRecordsDialog
295
260
  }));
package/es/index.js CHANGED
@@ -7,10 +7,42 @@ var Statistic = /*#__PURE__*/function () {
7
7
  _classCallCheck(this, Statistic);
8
8
  }
9
9
  _createClass(Statistic, null, [{
10
+ key: "getInitProps",
11
+ value: function getInitProps() {
12
+ if (!window || !window.app) {
13
+ return null;
14
+ }
15
+ var _window$app = window.app,
16
+ state = _window$app.state,
17
+ dtableStore = _window$app.dtableStore;
18
+ var value = state.value,
19
+ selectedTableIdx = state.selectedTableIdx,
20
+ selectedViewId = state.selectedViewId;
21
+ return {
22
+ value: value,
23
+ eventBus: dtableStore.eventBus,
24
+ activeTableIdx: selectedTableIdx,
25
+ activeViewId: selectedViewId,
26
+ updateStatistics: this.updateStatistics.bind(this, dtableStore),
27
+ deletePluginSettings: this.deletePluginSettings.bind(this, dtableStore)
28
+ };
29
+ }
30
+ }, {
31
+ key: "updateStatistics",
32
+ value: function updateStatistics(dtableStore, statistics) {
33
+ dtableStore.updateStatisticsList(statistics);
34
+ }
35
+ }, {
36
+ key: "deletePluginSettings",
37
+ value: function deletePluginSettings(dtableStore, plugin_name) {
38
+ dtableStore.deletePluginSettings(plugin_name);
39
+ }
40
+ }, {
10
41
  key: "mount",
11
42
  value: function mount(props) {
12
- if (!window.app) return;
13
- window.app.mountWidget( /*#__PURE__*/React.createElement(DashBoard, props));
43
+ var customProps = this.getInitProps();
44
+ if (!customProps) return;
45
+ window.app.mountWidget( /*#__PURE__*/React.createElement(DashBoard, Object.assign({}, props, customProps)));
14
46
  }
15
47
  }, {
16
48
  key: "unmount",
@@ -51,7 +51,7 @@ var de = {
51
51
  'Untitled': 'Ohne Titel',
52
52
  'Settings': 'Einstellungen',
53
53
  'Table': 'Tabelle',
54
- 'Views': 'Views',
54
+ 'Views': 'Ansichten',
55
55
  'Display_title': 'Anzeigetitel',
56
56
  'X-axis': 'X-Achse',
57
57
  'Y-axis': 'Y-Achse',
@@ -138,6 +138,8 @@ var de = {
138
138
  'Oct': 'Okt',
139
139
  'Nov': 'Nov',
140
140
  'Dec': 'Dez',
141
+ 'Enter_date': 'Enter date',
142
+ 'Please_select': 'Please select',
141
143
  'Total': 'Gesamt',
142
144
  'Amount': 'Menge',
143
145
  'Empty': 'Leer',
@@ -233,7 +235,9 @@ var de = {
233
235
  'Line_color': 'Linienfarbe',
234
236
  'Stack': 'Stapel',
235
237
  'Add_new_stack': 'Neuen Stapel hinzufügen',
236
- 'Chart_type': 'Chart type',
237
- 'Edit_type': 'Edit type'
238
+ 'Chart_type': 'Diagrammtyp',
239
+ 'Edit_type': 'Typ ändern',
240
+ 'Update_to_a_table': 'Update to a table',
241
+ 'Export_to_a_new_table': 'In neue Tabelle exportieren'
238
242
  };
239
243
  export default de;
@@ -138,6 +138,8 @@ var en = {
138
138
  'Oct': 'Oct',
139
139
  'Nov': 'Nov',
140
140
  'Dec': 'Dec',
141
+ 'Enter_date': 'Enter date',
142
+ 'Please_select': 'Please select',
141
143
  'Total': 'Total',
142
144
  'Amount': 'Amount',
143
145
  'Empty': 'Empty',
@@ -234,6 +236,8 @@ var en = {
234
236
  'Stack': 'Stack',
235
237
  'Add_new_stack': 'Add new stack',
236
238
  'Chart_type': 'Chart type',
237
- 'Edit_type': 'Edit type'
239
+ 'Edit_type': 'Edit type',
240
+ 'Update_to_a_table': 'Update to a table',
241
+ 'Export_to_a_new_table': 'Export to a new table'
238
242
  };
239
243
  export default en;
@@ -51,7 +51,7 @@ var fr = {
51
51
  'Untitled': 'Sans titre',
52
52
  'Settings': 'Paramètres',
53
53
  'Table': 'Tableau',
54
- 'Views': 'Views',
54
+ 'Views': 'Vues',
55
55
  'Display_title': 'Titre à afficher',
56
56
  'X-axis': 'Axe des x',
57
57
  'Y-axis': 'Axe des y',
@@ -138,6 +138,8 @@ var fr = {
138
138
  'Oct': 'octobre',
139
139
  'Nov': 'novembre',
140
140
  'Dec': 'décembre',
141
+ 'Enter_date': 'Enter date',
142
+ 'Please_select': 'Please select',
141
143
  'Total': 'Total',
142
144
  'Amount': 'Nombre',
143
145
  'Empty': 'Vide',
@@ -233,7 +235,9 @@ var fr = {
233
235
  'Line_color': 'Couleur de courbe',
234
236
  'Stack': 'Pile',
235
237
  'Add_new_stack': 'Ajouter une nouvelle pile',
236
- 'Chart_type': 'Chart type',
237
- 'Edit_type': 'Edit type'
238
+ 'Chart_type': 'Type de diagramme',
239
+ 'Edit_type': 'Modifier le type',
240
+ 'Update_to_a_table': 'Update to a table',
241
+ 'Export_to_a_new_table': 'Exporter dans un nouveau tableau'
238
242
  };
239
243
  export default fr;
@@ -138,6 +138,8 @@ var zh_CN = {
138
138
  'Oct': '十月',
139
139
  'Nov': '十一月',
140
140
  'Dec': '十二月',
141
+ 'Enter_date': '输入日期',
142
+ 'Please_select': '请选择',
141
143
  'Total': '总计',
142
144
  'Amount': '数量',
143
145
  'Empty': '空',
@@ -234,6 +236,8 @@ var zh_CN = {
234
236
  'Stack': '堆叠',
235
237
  'Add_new_stack': '添加新的堆叠',
236
238
  'Chart_type': '图表类型',
237
- 'Edit_type': '编辑类型'
239
+ 'Edit_type': '编辑类型',
240
+ 'Update_to_a_table': '更新到子表',
241
+ 'Export_to_a_new_table': '导出到新的子表'
238
242
  };
239
243
  export default zh_CN;
@@ -6,7 +6,7 @@ import React, { Component } from 'react';
6
6
  import intl from 'react-intl-universal';
7
7
  import Tabs from './tabs';
8
8
  import StatView from './stat-view';
9
- import { STAT_TYPE } from './constants';
9
+ import { STAT_TYPE, THEME_NAME_MAP } from './constants';
10
10
  import logo from './assets/images/icon.png';
11
11
  import styles from './assets/css/mobile-dashboard.module.css';
12
12
  var MobileDashboard = /*#__PURE__*/function (_Component) {
@@ -31,7 +31,7 @@ var MobileDashboard = /*#__PURE__*/function (_Component) {
31
31
  value: function render() {
32
32
  var _this$props = this.props,
33
33
  getTableById = _this$props.getTableById,
34
- refresh = _this$props.refresh,
34
+ dtableChangedTime = _this$props.dtableChangedTime,
35
35
  colorThemeName = _this$props.colorThemeName,
36
36
  statistics = _this$props.statistics,
37
37
  selectedDashboardIdx = _this$props.selectedDashboardIdx,
@@ -54,7 +54,7 @@ var MobileDashboard = /*#__PURE__*/function (_Component) {
54
54
  }), /*#__PURE__*/React.createElement("span", {
55
55
  className: styles['mobile-statistic-name']
56
56
  }, intl.get('Statistics'))), /*#__PURE__*/React.createElement(Tabs, {
57
- theme: 'light',
57
+ theme: THEME_NAME_MAP.LIGHT,
58
58
  isMobile: true,
59
59
  statistics: statistics,
60
60
  selectedDashboardIdx: selectedDashboardIdx,
@@ -86,8 +86,8 @@ var MobileDashboard = /*#__PURE__*/function (_Component) {
86
86
  }, /*#__PURE__*/React.createElement(StatView, {
87
87
  isPreview: true,
88
88
  isEnlarge: false,
89
- refresh: refresh,
90
- theme: "light",
89
+ dtableChangedTime: dtableChangedTime,
90
+ theme: THEME_NAME_MAP.LIGHT,
91
91
  colorThemeName: colorThemeName,
92
92
  statItem: statItem,
93
93
  chartCalculator: chartCalculator,
@@ -48,6 +48,8 @@ var HorizontalBarGroup = /*#__PURE__*/function (_BaseModel) {
48
48
  _this.label_font_size = object.label_font_size;
49
49
  _this.color_option = object.color_option;
50
50
  _this.sort_type = object.sort_type;
51
+ _this.display_each_block_data = object.display_each_block_data;
52
+ _this.display_data = object.display_data;
51
53
  return _this;
52
54
  }
53
55
  return HorizontalBarGroup;
@@ -240,8 +240,7 @@ var AdvancedChartSettings = /*#__PURE__*/function (_React$Component) {
240
240
  summary_method = _this$props$statItem.summary_method;
241
241
  if (summaryType === summary_type) return;
242
242
  if (summaryType === GROUP_TYPES.SINGLE_NUMERIC_COLUMN) {
243
- var defaultColumn = _this.numericColumns[0];
244
- summary_column = defaultColumn ? defaultColumn.key : null;
243
+ summary_column = null;
245
244
  summary_method = SUMMARY_METHOD[0];
246
245
  summary_type = SUMMARY_TYPE.ADVANCED;
247
246
  } else {
@@ -138,7 +138,7 @@ var SummarySettings = /*#__PURE__*/function (_Component) {
138
138
  var summaryColumn = _this.props.summaryColumn;
139
139
  var selectedColumnOption = _this.numericColumnsOptions.find(function (o) {
140
140
  return o.value.key === summaryColumn;
141
- });
141
+ }) || null;
142
142
  return /*#__PURE__*/React.createElement("div", {
143
143
  className: "statistic-chart-parameter-item"
144
144
  }, /*#__PURE__*/React.createElement("label", null, intl.get('Numeric_column')), /*#__PURE__*/React.createElement(DTableSelect, {
@@ -94,6 +94,15 @@ var HorizontalBarChartStyle = /*#__PURE__*/function (_Component) {
94
94
  };
95
95
  _this.props.updateStatItem(Object.assign({}, statItem, updated));
96
96
  };
97
+ _this.onToggleDisplayEachBlockData = function () {
98
+ var statItem = _this.props.statItem;
99
+ var _ref5 = statItem || {},
100
+ display_each_block_data = _ref5.display_each_block_data;
101
+ var updated = {
102
+ display_each_block_data: !display_each_block_data
103
+ };
104
+ _this.props.updateStatItem(Object.assign({}, statItem, updated));
105
+ };
97
106
  _this.onChangeLabelFontSize = function (label_font_size) {
98
107
  var statItem = _this.props.statItem;
99
108
  _this.props.updateStatItem(Object.assign({}, statItem, {
@@ -102,8 +111,8 @@ var HorizontalBarChartStyle = /*#__PURE__*/function (_Component) {
102
111
  };
103
112
  _this.onToggleHAxisAutoRange = function () {
104
113
  var statItem = _this.props.statItem;
105
- var _ref5 = statItem || {},
106
- h_axis_auto_range = _ref5.h_axis_auto_range;
114
+ var _ref6 = statItem || {},
115
+ h_axis_auto_range = _ref6.h_axis_auto_range;
107
116
  var updated = {
108
117
  h_axis_auto_range: h_axis_auto_range == undefined ? false : !h_axis_auto_range
109
118
  };
@@ -235,7 +244,15 @@ var HorizontalBarChartStyle = /*#__PURE__*/function (_Component) {
235
244
  chart: statItem,
236
245
  labelColorConfigs: labelColorConfigs,
237
246
  updateChart: this.props.updateStatItem
238
- })));
247
+ })), chartType === STAT_TYPE.STACKED_HORIZONTAL_BAR && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
248
+ className: "statistic-chart-parameter-divider"
249
+ }), /*#__PURE__*/React.createElement("div", {
250
+ className: "statistic-chart-parameter-item"
251
+ }, /*#__PURE__*/React.createElement(IndToggleSetting, {
252
+ isChecked: !!statItem.display_each_block_data,
253
+ label: intl.get('Display_value_of_each_block'),
254
+ handleToggleChange: this.onToggleDisplayEachBlockData
255
+ }))));
239
256
  }
240
257
  }]);
241
258
  return HorizontalBarChartStyle;
@@ -107,18 +107,12 @@ var SummarySettings = /*#__PURE__*/function (_Component) {
107
107
  };
108
108
  _this.onChangeSummaryType = function (option) {
109
109
  var type = option.value;
110
- var _this$props3 = _this.props,
111
- summaryType = _this$props3.summaryType,
112
- numericColumnsOptions = _this$props3.numericColumnsOptions;
110
+ var summaryType = _this.props.summaryType;
113
111
  if (type === summaryType) {
114
112
  return;
115
113
  }
116
114
  var summaryColumnKey = null;
117
- var summaryMethod = null;
118
- if (type === STATISTICS_COUNT_TYPE.ADVANCED && Array.isArray(numericColumnsOptions) && numericColumnsOptions.length > 0) {
119
- summaryColumnKey = numericColumnsOptions[0].value.key;
120
- summaryMethod = SUMMARY_METHOD[0];
121
- }
115
+ var summaryMethod = type === STATISTICS_COUNT_TYPE.ADVANCED ? SUMMARY_METHOD[0] : null;
122
116
  _this.props.onChangeSummaryType(type, summaryColumnKey, summaryMethod);
123
117
  };
124
118
  _this.onSelectNumericColumn = function (columnOption) {
@@ -6,7 +6,7 @@ import React, { Component } from 'react';
6
6
  import intl from 'react-intl-universal';
7
7
  import Icon from '../../../../components/icon';
8
8
  import StatisticTypesDialog from '../../../../components/dialog/statistic-types-dialog';
9
- import { STATISTIC_TYPE_SHOW } from '../../../../constants';
9
+ import { STATISTIC_TYPE_SHOW, STAT_TYPE } from '../../../../constants';
10
10
  import './index.css';
11
11
  var TypeSettings = /*#__PURE__*/function (_Component) {
12
12
  _inherits(TypeSettings, _Component);
@@ -25,6 +25,27 @@ var TypeSettings = /*#__PURE__*/function (_Component) {
25
25
  isShowDialog: false
26
26
  });
27
27
  };
28
+ _this.getChartTypeName = function () {
29
+ var chartType = _this.props.chart.type;
30
+ switch (chartType) {
31
+ case STAT_TYPE.MAP:
32
+ {
33
+ return '中国地图';
34
+ }
35
+ case STAT_TYPE.MAP_BUBBLE:
36
+ {
37
+ return '中国地图(气泡图)';
38
+ }
39
+ case STAT_TYPE.WORLD_MAP_BUBBLE:
40
+ {
41
+ return "".concat(intl.get(STATISTIC_TYPE_SHOW[STAT_TYPE.WORLD_MAP]), "(").concat(intl.get('Bubble'), ")");
42
+ }
43
+ default:
44
+ {
45
+ return intl.get(STATISTIC_TYPE_SHOW[chartType]);
46
+ }
47
+ }
48
+ };
28
49
  _this.state = {
29
50
  isShowDialog: false
30
51
  };
@@ -40,7 +61,7 @@ var TypeSettings = /*#__PURE__*/function (_Component) {
40
61
  className: "statistic-chart-parameter-item"
41
62
  }, /*#__PURE__*/React.createElement("label", null, intl.get('Chart_type')), /*#__PURE__*/React.createElement("div", {
42
63
  className: "statistic-selected-type-container d-flex align-items-center"
43
- }, /*#__PURE__*/React.createElement("span", null, intl.get(STATISTIC_TYPE_SHOW[chartType]) || STATISTIC_TYPE_SHOW[chartType]), /*#__PURE__*/React.createElement("div", {
64
+ }, /*#__PURE__*/React.createElement("span", null, this.getChartTypeName()), /*#__PURE__*/React.createElement("div", {
44
65
  className: "statistic-switch-type-container",
45
66
  onClick: this.openTypesDialog
46
67
  }, /*#__PURE__*/React.createElement(Icon, {
@@ -1,4 +1,3 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
1
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
4
3
  import _inherits from "@babel/runtime/helpers/esm/inherits";
@@ -70,7 +69,7 @@ var ChartPreview = /*#__PURE__*/function (_Component) {
70
69
  };
71
70
  _this.renderChart = function (statItem) {
72
71
  var _this$props = _this.props,
73
- refresh = _this$props.refresh,
72
+ dtableChangedTime = _this$props.dtableChangedTime,
74
73
  chartCalculator = _this$props.chartCalculator,
75
74
  theme = _this$props.theme,
76
75
  colorThemeName = _this$props.colorThemeName,
@@ -80,11 +79,11 @@ var ChartPreview = /*#__PURE__*/function (_Component) {
80
79
  return _this.chartView = _ref;
81
80
  },
82
81
  isPreview: true,
83
- refresh: refresh,
82
+ dtableChangedTime: dtableChangedTime,
84
83
  isEnlarge: false,
85
84
  theme: theme,
86
85
  colorThemeName: colorThemeName,
87
- statItem: _objectSpread({}, statItem),
86
+ statItem: statItem,
88
87
  chartCalculator: chartCalculator,
89
88
  eventBus: eventBus,
90
89
  getTableById: _this.props.getTableById,
@@ -24,6 +24,12 @@ var StatList = /*#__PURE__*/function (_Component) {
24
24
  _this = _super.call(this, props);
25
25
  _this.getStatItemsLayout = function (statItems) {
26
26
  return Array.isArray(statItems) ? statItems.map(function (chart) {
27
+ // eslint-disable-next-line
28
+ if (chart.layout.y == null) {
29
+ return _objectSpread(_objectSpread({}, chart.layout), {}, {
30
+ y: Infinity
31
+ });
32
+ }
27
33
  return chart.layout;
28
34
  }) : [];
29
35
  };
@@ -183,7 +189,7 @@ var StatList = /*#__PURE__*/function (_Component) {
183
189
  var _this2 = this;
184
190
  var _this$props = this.props,
185
191
  isTableReadOnly = _this$props.isTableReadOnly,
186
- refresh = _this$props.refresh,
192
+ dtableChangedTime = _this$props.dtableChangedTime,
187
193
  theme = _this$props.theme,
188
194
  colorThemeName = _this$props.colorThemeName,
189
195
  statItems = _this$props.statItems,
@@ -219,10 +225,10 @@ var StatList = /*#__PURE__*/function (_Component) {
219
225
  className: "statistic-chart-preview"
220
226
  }, /*#__PURE__*/React.createElement(ChartPreview, {
221
227
  isTableReadOnly: isTableReadOnly,
222
- refresh: refresh,
228
+ dtableChangedTime: dtableChangedTime,
223
229
  theme: theme,
224
230
  colorThemeName: colorThemeName,
225
- statItem: _objectSpread({}, statItem),
231
+ statItem: statItem,
226
232
  chartCalculator: chartCalculator,
227
233
  eventBus: eventBus,
228
234
  getTableById: _this2.props.getTableById,
@@ -245,7 +251,7 @@ var StatList = /*#__PURE__*/function (_Component) {
245
251
  toggleStatisticRecordsDialog: _this2.props.toggleStatisticRecordsDialog
246
252
  }));
247
253
  })), enlargedChart && /*#__PURE__*/React.createElement(EnlargeChartDialog, {
248
- refresh: refresh,
254
+ dtableChangedTime: dtableChangedTime,
249
255
  colorThemeName: colorThemeName,
250
256
  statItem: enlargedChart,
251
257
  eventBus: eventBus,