dtable-statistic 4.3.3 → 4.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/es/api/dtable-db-api.js +3 -10
  2. package/es/calculator/base-calculator.js +12 -20
  3. package/es/calculator/basic-chart-calculator.js +65 -72
  4. package/es/calculator/combination-calculator.js +57 -64
  5. package/es/calculator/compare-bar-calculator.js +26 -33
  6. package/es/calculator/completeness-calculator.js +30 -37
  7. package/es/calculator/copy-value.js +1 -7
  8. package/es/calculator/dashboard-calculator.js +13 -20
  9. package/es/calculator/heat-map-calculator.js +18 -25
  10. package/es/calculator/horizontal-bar-calculator.js +8 -15
  11. package/es/calculator/index.js +35 -42
  12. package/es/calculator/map-calculator.js +22 -29
  13. package/es/calculator/mirror-calculator.js +20 -27
  14. package/es/calculator/number-card-calculator.js +10 -17
  15. package/es/calculator/pivot-table-calculator.js +58 -65
  16. package/es/calculator/scatter-calculator.js +14 -21
  17. package/es/calculator/thread-manager.js +1 -7
  18. package/es/calculator/trend-calculator.js +22 -29
  19. package/es/calculator/workers/basic-chart-calculator-worker.js +76 -83
  20. package/es/calculator/workers/calculator.worker.js +30 -33
  21. package/es/calculator/workers/card-calculator-worker.js +13 -19
  22. package/es/calculator/workers/combination-calculator-worker.js +46 -53
  23. package/es/calculator/workers/compare-bar-chart-calculator-worker.js +22 -29
  24. package/es/calculator/workers/completeness-calculator-worker.js +34 -41
  25. package/es/calculator/workers/dashboard-calculator-worker.js +18 -24
  26. package/es/calculator/workers/mirror-calculator-worker.js +22 -29
  27. package/es/calculator/workers/pivot-table-calculator-worker.js +77 -84
  28. package/es/calculator/workers/scatter-calculator-worker.js +20 -27
  29. package/es/calculator/workers/trend-calculator-worker.js +27 -34
  30. package/es/calculator/world-map-calculator.js +17 -24
  31. package/es/components/common-add-tool.js +5 -12
  32. package/es/components/dialog/chart-addition-edit-dialog.js +12 -20
  33. package/es/components/dialog/chart-addition-widgets/chart-selector.js +101 -108
  34. package/es/components/dialog/color-theme-dialog.js +15 -22
  35. package/es/components/dialog/delete-confirmation-dialog.js +11 -18
  36. package/es/components/dialog/enlarged-chart-dialog.js +20 -28
  37. package/es/components/dialog/new-table-dialog.js +16 -23
  38. package/es/components/dialog/new-view-dialog.js +14 -21
  39. package/es/components/dialog/rename-view-dialog.js +14 -22
  40. package/es/components/dialog/statistic-record-dialog/index.js +37 -45
  41. package/es/components/dialog/statistic-types-dialog/index.js +14 -22
  42. package/es/components/dialog/table-select-dialog.js +15 -23
  43. package/es/components/dropdown-menu/statistic-dropdown-menu.js +41 -49
  44. package/es/components/dtable-popover.js +12 -19
  45. package/es/components/dtable-search-input.js +13 -21
  46. package/es/components/dtable-select.js +15 -21
  47. package/es/components/icon.js +4 -11
  48. package/es/components/index.js +11 -76
  49. package/es/components/loading.js +3 -10
  50. package/es/components/modal-portal.js +5 -12
  51. package/es/components/popover/color-rules/color-rule.js +25 -33
  52. package/es/components/popover/color-rules/index.js +6 -14
  53. package/es/components/popover/color-rules/rule-filters/filter.js +27 -34
  54. package/es/components/popover/color-rules/rule-filters/index.js +17 -25
  55. package/es/components/popover/color-rules/rule-filters/number-input.js +9 -17
  56. package/es/components/popover/color-rules-popover.js +24 -32
  57. package/es/components/popover/color-selector-popover.js +10 -17
  58. package/es/components/seatable-radio/index.js +9 -16
  59. package/es/components/select/index.js +2 -9
  60. package/es/components/select/option-group.js +19 -27
  61. package/es/components/select/option.js +6 -14
  62. package/es/components/select/select.js +17 -25
  63. package/es/components/toast/alert.js +24 -31
  64. package/es/components/toast/index.js +3 -10
  65. package/es/components/toast/toast.js +12 -20
  66. package/es/components/toast/toastManager.js +9 -17
  67. package/es/components/toast/toaster.js +6 -14
  68. package/es/constants/color-rules.js +6 -12
  69. package/es/constants/dtable-select-style.js +4 -9
  70. package/es/constants/event-types.js +4 -10
  71. package/es/constants/index.js +67 -96
  72. package/es/constants/key-codes.js +0 -2
  73. package/es/constants/map.js +2 -8
  74. package/es/constants/model.js +20 -26
  75. package/es/constants/regions.js +3 -8
  76. package/es/constants/zIndexes.js +1 -7
  77. package/es/custom-g2.js +208 -236
  78. package/es/dashboard.js +50 -58
  79. package/es/desktop-dashboard.js +47 -55
  80. package/es/index.js +3 -6
  81. package/es/locale/index.js +10 -13
  82. package/es/locale/lang/de.js +1 -7
  83. package/es/locale/lang/en.js +1 -7
  84. package/es/locale/lang/fr.js +1 -7
  85. package/es/locale/lang/zh_CN.js +1 -7
  86. package/es/mobile-dashboard.js +38 -46
  87. package/es/model/bar-group.js +11 -19
  88. package/es/model/bar.js +10 -18
  89. package/es/model/base-model.js +2 -9
  90. package/es/model/basic-number-card.js +8 -16
  91. package/es/model/collaborators.js +2 -9
  92. package/es/model/combination.js +12 -20
  93. package/es/model/compare-bar.js +16 -24
  94. package/es/model/completeness-group.js +8 -16
  95. package/es/model/completeness.js +5 -13
  96. package/es/model/custom-bar.js +6 -14
  97. package/es/model/dashboard.js +6 -14
  98. package/es/model/generic-model.js +133 -141
  99. package/es/model/heat-map.js +11 -19
  100. package/es/model/horizontal-bar-group.js +10 -18
  101. package/es/model/horizontal-bar.js +10 -18
  102. package/es/model/index.js +53 -185
  103. package/es/model/map.js +15 -23
  104. package/es/model/mirror.js +13 -21
  105. package/es/model/pie.js +10 -18
  106. package/es/model/ring.js +11 -19
  107. package/es/model/scatter.js +6 -14
  108. package/es/model/statistic-dashboard.js +2 -9
  109. package/es/model/table.js +10 -18
  110. package/es/model/trend.js +12 -20
  111. package/es/model/world-map.js +13 -21
  112. package/es/service/chart-service.js +7 -14
  113. package/es/service/dashboard-service.js +34 -41
  114. package/es/service/map-json.js +8 -14
  115. package/es/stat-editor/chart-name-editor.js +8 -15
  116. package/es/stat-editor/index.js +16 -24
  117. package/es/stat-editor/stat-settings/advance-chart-settings/basic-number-card-settings.js +21 -29
  118. package/es/stat-editor/stat-settings/advance-chart-settings/combination-settings.js +49 -57
  119. package/es/stat-editor/stat-settings/advance-chart-settings/dashboard-chart-settings.js +23 -31
  120. package/es/stat-editor/stat-settings/advance-chart-settings/geo-granularity-settings.js +4 -11
  121. package/es/stat-editor/stat-settings/advance-chart-settings/heat-map-settings.js +19 -27
  122. package/es/stat-editor/stat-settings/advance-chart-settings/index.js +43 -51
  123. package/es/stat-editor/stat-settings/advance-chart-settings/map-settings.js +23 -31
  124. package/es/stat-editor/stat-settings/advance-chart-settings/mirror-settings.js +23 -31
  125. package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/combination-style-setting.js +37 -45
  126. package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/heat-map-settings.js +19 -27
  127. package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/map-setting.js +26 -34
  128. package/es/stat-editor/stat-settings/advance-chart-settings/summary-settings.js +47 -55
  129. package/es/stat-editor/stat-settings/advance-chart-settings/trend-chart-settings.js +22 -30
  130. package/es/stat-editor/stat-settings/advance-chart-settings/world-map-settings.js +18 -26
  131. package/es/stat-editor/stat-settings/basic-chart-settings/advance-bar-chart-settings.js +27 -35
  132. package/es/stat-editor/stat-settings/basic-chart-settings/bar-settings.js +24 -32
  133. package/es/stat-editor/stat-settings/basic-chart-settings/completeness-chart-settings.js +33 -41
  134. package/es/stat-editor/stat-settings/basic-chart-settings/custom-bar-settings.js +22 -30
  135. package/es/stat-editor/stat-settings/basic-chart-settings/groupby-settings.js +27 -26
  136. package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-axis-group-settings.js +46 -54
  137. package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-bar-settings.js +23 -31
  138. package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-group-chart-settings.js +26 -34
  139. package/es/stat-editor/stat-settings/basic-chart-settings/index.js +77 -85
  140. package/es/stat-editor/stat-settings/basic-chart-settings/pie-settings.js +21 -29
  141. package/es/stat-editor/stat-settings/basic-chart-settings/pivot-table-settings.js +73 -81
  142. package/es/stat-editor/stat-settings/basic-chart-settings/scatter-settings.js +16 -24
  143. package/es/stat-editor/stat-settings/basic-chart-settings/stack-item-settings.js +19 -27
  144. package/es/stat-editor/stat-settings/basic-chart-settings/stacks-settings.js +18 -26
  145. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/bar-chart-style-setting.js +49 -57
  146. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/completeness-style.js +17 -25
  147. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/horizontal-bar-chart-style.js +47 -55
  148. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/label-font-size-editor.js +11 -19
  149. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/pie-chart-style-settings.js +45 -53
  150. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/time-compare-style.js +9 -17
  151. package/es/stat-editor/stat-settings/basic-chart-settings/summary-method-setting.js +20 -28
  152. package/es/stat-editor/stat-settings/basic-chart-settings/summary-settings.js +30 -38
  153. package/es/stat-editor/stat-settings/basic-chart-settings/time-comparison-settings.js +50 -58
  154. package/es/stat-editor/stat-settings/basic-chart-settings/timer-picker.js +17 -25
  155. package/es/stat-editor/stat-settings/basic-chart-settings/y-axis-group-settings.js +47 -55
  156. package/es/stat-editor/stat-settings/color-setting/color-group-selector.js +11 -19
  157. package/es/stat-editor/stat-settings/color-setting/color-picker.js +12 -19
  158. package/es/stat-editor/stat-settings/color-setting/color-use-type-selector.js +62 -70
  159. package/es/stat-editor/stat-settings/map/map-level.js +13 -20
  160. package/es/stat-editor/stat-settings/map/map-province-city.js +20 -27
  161. package/es/stat-editor/stat-settings/public-setting/axis-label-position-setting.js +11 -19
  162. package/es/stat-editor/stat-settings/public-setting/base-settings.js +20 -28
  163. package/es/stat-editor/stat-settings/public-setting/calender.js +22 -29
  164. package/es/stat-editor/stat-settings/public-setting/column-settings.js +6 -13
  165. package/es/stat-editor/stat-settings/public-setting/custom-title-setting.js +9 -16
  166. package/es/stat-editor/stat-settings/public-setting/data-sort-setting.js +13 -21
  167. package/es/stat-editor/stat-settings/public-setting/ind-toggle-setting.js +8 -15
  168. package/es/stat-editor/stat-settings/public-setting/min-max-setting.js +11 -19
  169. package/es/stat-editor/stat-settings/public-setting/numeric-summary-item.js +27 -35
  170. package/es/stat-editor/stat-settings/public-setting/toggle-setting.js +8 -15
  171. package/es/stat-editor/stat-settings/public-setting/type-settings/index.js +18 -26
  172. package/es/stat-list/chart-preview.js +20 -28
  173. package/es/stat-list/index.js +27 -35
  174. package/es/stat-view/area-chart.js +43 -50
  175. package/es/stat-view/bar-chart.js +47 -54
  176. package/es/stat-view/base-chart.js +24 -32
  177. package/es/stat-view/basic-number-card.js +19 -26
  178. package/es/stat-view/combination-chart.js +49 -56
  179. package/es/stat-view/compare-chart.js +39 -46
  180. package/es/stat-view/completeness-chart.js +28 -35
  181. package/es/stat-view/custom-bar.js +31 -38
  182. package/es/stat-view/dashboard-chart.js +15 -22
  183. package/es/stat-view/heat-map.js +43 -50
  184. package/es/stat-view/horizontal-bar-chart.js +51 -58
  185. package/es/stat-view/index.js +73 -80
  186. package/es/stat-view/line-chart.js +39 -46
  187. package/es/stat-view/map.js +33 -40
  188. package/es/stat-view/mirror.js +21 -28
  189. package/es/stat-view/pie-chart.js +29 -36
  190. package/es/stat-view/pivot-table/index.js +32 -39
  191. package/es/stat-view/pivot-table/one-dimension-table-no-numeric-columns.js +31 -39
  192. package/es/stat-view/pivot-table/one-dimension-table-with-numeric-columns.js +29 -37
  193. package/es/stat-view/pivot-table/pivot-table-display-name.js +46 -54
  194. package/es/stat-view/pivot-table/two-dimension-table.js +62 -70
  195. package/es/stat-view/ring-chart.js +38 -45
  196. package/es/stat-view/scatter-chart.js +30 -37
  197. package/es/stat-view/treemap-chart.js +37 -44
  198. package/es/stat-view/trend-chart.js +32 -39
  199. package/es/stat-view/world-map.js +33 -40
  200. package/es/tabs/index.js +32 -40
  201. package/es/tabs/tab.js +26 -34
  202. package/es/utils/basic-chart-utils.js +2 -9
  203. package/es/utils/cell-format.js +14 -22
  204. package/es/utils/cell-value.js +7 -14
  205. package/es/utils/collaborator.js +4 -13
  206. package/es/utils/color-utils.js +18 -29
  207. package/es/utils/column-utils.js +18 -29
  208. package/es/utils/column.js +4 -11
  209. package/es/utils/common-utils.js +41 -65
  210. package/es/utils/date-format.js +2 -8
  211. package/es/utils/export-table-utils.js +82 -91
  212. package/es/utils/index.js +11 -100
  213. package/es/utils/map.js +26 -36
  214. package/es/utils/model.js +6 -14
  215. package/es/utils/object.js +6 -15
  216. package/es/utils/pivot-table.js +16 -23
  217. package/es/utils/row-utils.js +23 -33
  218. package/es/utils/search.js +21 -29
  219. package/es/utils/sql-utils.js +65 -75
  220. package/es/utils/stat-utils.js +60 -66
  221. package/es/utils/trend-utils.js +32 -40
  222. package/package.json +1 -1
@@ -1,32 +1,25 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _propTypes = _interopRequireDefault(require("prop-types"));
10
- var _dataSet = _interopRequireDefault(require("@antv/data-set"));
11
- var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
12
- var _dtableStore = require("dtable-store");
13
- var _baseChart = _interopRequireDefault(require("./base-chart"));
14
- var _customG = require("../custom-g2");
15
- var _commonUtils = require("../utils/common-utils");
16
- var _basicChartUtils = require("../utils/basic-chart-utils");
17
- var _colorUtils = require("../utils/color-utils");
18
- var _constants = require("../constants");
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import DataSet from '@antv/data-set';
4
+ import intl from 'react-intl-universal';
5
+ import { TableUtils } from 'dtable-store';
6
+ import BaseChart from './base-chart';
7
+ import { Chart } from '../custom-g2';
8
+ import { getCurrentTheme, sortDataByGroupSum } from '../utils/common-utils';
9
+ import { getChartGroups } from '../utils/basic-chart-utils';
10
+ import { getConvertedColorRules, getLabelColor } from '../utils/color-utils';
11
+ import { DATA_SORT_TYPE, DEFAULT_NUMBER_FORMAT_OBJECT, EMPTY_NAME, LABEL_CONFIG_CHANGED, STATISTICS_COUNT_SHOW, STAT_TYPE, SUMMARY_TYPE, TITLE_AMOUNT, TYPE_COLOR_USING, USEABLE_COLOR_TYPES } from '../constants';
19
12
  const propTypes = {
20
- isPreview: _propTypes.default.bool,
21
- isEdit: _propTypes.default.bool,
22
- colorThemeName: _propTypes.default.string,
23
- statItem: _propTypes.default.object,
24
- chartCalculator: _propTypes.default.object,
25
- eventBus: _propTypes.default.object,
26
- getTableById: _propTypes.default.func,
27
- toggleStatisticRecordsDialog: _propTypes.default.func
13
+ isPreview: PropTypes.bool,
14
+ isEdit: PropTypes.bool,
15
+ colorThemeName: PropTypes.string,
16
+ statItem: PropTypes.object,
17
+ chartCalculator: PropTypes.object,
18
+ eventBus: PropTypes.object,
19
+ getTableById: PropTypes.func,
20
+ toggleStatisticRecordsDialog: PropTypes.func
28
21
  };
29
- class HorizontalBarChart extends _baseChart.default {
22
+ class HorizontalBarChart extends BaseChart {
30
23
  constructor(props) {
31
24
  super(props);
32
25
  this.drawChart = originalData => {
@@ -46,26 +39,26 @@ class HorizontalBarChart extends _baseChart.default {
46
39
  } = statItem;
47
40
  this.initChartHandler();
48
41
  let data = originalData;
49
- if (type === _constants.STAT_TYPE.STACKED_HORIZONTAL_BAR && sort_type) {
42
+ if (type === STAT_TYPE.STACKED_HORIZONTAL_BAR && sort_type) {
50
43
  let convertedSortType = sort_type;
51
- if (sort_type === _constants.DATA_SORT_TYPE.ASCENDING) {
52
- convertedSortType = _constants.DATA_SORT_TYPE.DESCENDING;
53
- } else if (sort_type === _constants.DATA_SORT_TYPE.DESCENDING) {
54
- convertedSortType = _constants.DATA_SORT_TYPE.ASCENDING;
44
+ if (sort_type === DATA_SORT_TYPE.ASCENDING) {
45
+ convertedSortType = DATA_SORT_TYPE.DESCENDING;
46
+ } else if (sort_type === DATA_SORT_TYPE.DESCENDING) {
47
+ convertedSortType = DATA_SORT_TYPE.ASCENDING;
55
48
  }
56
- data = (0, _commonUtils.sortDataByGroupSum)(originalData, convertedSortType);
49
+ data = sortDataByGroupSum(originalData, convertedSortType);
57
50
  }
58
51
  this.chart.on('interval:click', e => {
59
52
  this.props.toggleStatisticRecordsDialog(e.data.data, statItem);
60
53
  });
61
- const currentTheme = (0, _commonUtils.getCurrentTheme)(colorThemeName);
54
+ const currentTheme = getCurrentTheme(colorThemeName);
62
55
  const isGroup = column_groupby_column_key || column_groupby_multiple_numeric_column;
63
56
  let chartBarColor = '#2a67d1';
64
- let summaryColumnData = _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
65
- if (horizontal_axis_summary_type === _constants.SUMMARY_TYPE.ADVANCED) {
57
+ let summaryColumnData = DEFAULT_NUMBER_FORMAT_OBJECT;
58
+ if (horizontal_axis_summary_type === SUMMARY_TYPE.ADVANCED) {
66
59
  const table = getTableById(table_id);
67
- const summaryColumn = _dtableStore.TableUtils.getTableColumnByKey(table, horizontal_axis_column_key) || {};
68
- summaryColumnData = summaryColumn.data || _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
60
+ const summaryColumn = TableUtils.getTableColumnByKey(table, horizontal_axis_column_key) || {};
61
+ summaryColumnData = summaryColumn.data || DEFAULT_NUMBER_FORMAT_OBJECT;
69
62
  }
70
63
  if (isGroup) {
71
64
  chartBarColor = 'group_name';
@@ -85,7 +78,7 @@ class HorizontalBarChart extends _baseChart.default {
85
78
  const {
86
79
  width
87
80
  } = this.chart.coordinateBBox;
88
- const chartData = isGroup ? (0, _basicChartUtils.getChartGroups)(data) : data;
81
+ const chartData = isGroup ? getChartGroups(data) : data;
89
82
  const ticks = this.getTicks(chartData, width);
90
83
  if (ticks.length > 0) {
91
84
  this.chart.scale('name', {
@@ -130,7 +123,7 @@ class HorizontalBarChart extends _baseChart.default {
130
123
  config.height = 400;
131
124
  config.width = 700;
132
125
  }
133
- this.chart = new _customG.Chart(config);
126
+ this.chart = new Chart(config);
134
127
  };
135
128
  this.handleAutoRange = (data, summaryColumnData) => {
136
129
  // set scale options for 'value'
@@ -185,7 +178,7 @@ class HorizontalBarChart extends _baseChart.default {
185
178
  color_option,
186
179
  horizontal_axis_label_color_rules
187
180
  } = statItem;
188
- const colorRules = color_option === _constants.TYPE_COLOR_USING.USE_RULES && horizontal_axis_label_color_rules && (0, _colorUtils.getConvertedColorRules)(horizontal_axis_label_color_rules);
181
+ const colorRules = color_option === TYPE_COLOR_USING.USE_RULES && horizontal_axis_label_color_rules && getConvertedColorRules(horizontal_axis_label_color_rules);
189
182
  this.chart.interval().label(display_data ? 'formatted_value' : false, {
190
183
  offset: 5,
191
184
  position: () => {
@@ -198,8 +191,8 @@ class HorizontalBarChart extends _baseChart.default {
198
191
  }).position('name*value').tooltip('name*formatted_value', (name, value) => {
199
192
  return {
200
193
  value,
201
- title: horizontal_axis_summary_type === 'count' ? _reactIntlUniversal.default.get(_constants.TITLE_AMOUNT) : _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW[horizontal_axis_summary_method]),
202
- name: !name && typeof name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name
194
+ title: horizontal_axis_summary_type === 'count' ? intl.get(TITLE_AMOUNT) : intl.get(STATISTICS_COUNT_SHOW[horizontal_axis_summary_method]),
195
+ name: !name && typeof name !== 'number' ? intl.get(EMPTY_NAME) : name
203
196
  };
204
197
  }).state({
205
198
  active: {
@@ -208,7 +201,7 @@ class HorizontalBarChart extends _baseChart.default {
208
201
  }
209
202
  }
210
203
  }).style('value', value => {
211
- const color = (0, _colorUtils.getLabelColor)({
204
+ const color = getLabelColor({
212
205
  chart: statItem,
213
206
  colorRules,
214
207
  value
@@ -250,7 +243,7 @@ class HorizontalBarChart extends _baseChart.default {
250
243
  }
251
244
  };
252
245
  let displayData = display_data;
253
- if (statItem.type === _constants.STAT_TYPE.STACKED_HORIZONTAL_BAR) {
246
+ if (statItem.type === STAT_TYPE.STACKED_HORIZONTAL_BAR) {
254
247
  const {
255
248
  display_each_block_data
256
249
  } = statItem;
@@ -260,7 +253,7 @@ class HorizontalBarChart extends _baseChart.default {
260
253
  }
261
254
 
262
255
  // get the total value of each stack
263
- const dv = new _dataSet.default.DataView().source(data);
256
+ const dv = new DataSet.DataView().source(data);
264
257
  dv.transform({
265
258
  type: 'aggregate',
266
259
  fields: ['value'],
@@ -285,7 +278,7 @@ class HorizontalBarChart extends _baseChart.default {
285
278
  let groupColorCallback = currentTheme && currentTheme.colors;
286
279
  // when the 'Group by' column is a 'single-select' column,
287
280
  // and the user chooses to use the colors from the column.
288
- if (color_option === _constants.USEABLE_COLOR_TYPES[1]) {
281
+ if (color_option === USEABLE_COLOR_TYPES[1]) {
289
282
  const groupColorMapping = {};
290
283
  data.forEach(item => {
291
284
  if (!groupColorMapping[item.group_name]) {
@@ -299,13 +292,13 @@ class HorizontalBarChart extends _baseChart.default {
299
292
  this.chart.interval().label(displayData ? 'formatted_value' : false, labelCfg).position('name*value').color('group_name', groupColorCallback).tooltip('name*formatted_value*group_name', (name, value, group_name) => {
300
293
  return {
301
294
  value,
302
- title: !name && typeof name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name,
303
- name: !group_name && typeof group_name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : group_name
295
+ title: !name && typeof name !== 'number' ? intl.get(EMPTY_NAME) : name,
296
+ name: !group_name && typeof group_name !== 'number' ? intl.get(EMPTY_NAME) : group_name
304
297
  };
305
298
  }).adjust([{
306
299
  reverseOrder: true,
307
300
  // for 'stack'. It only work for 'stack'.
308
- type: statItem.type === _constants.STAT_TYPE.STACKED_HORIZONTAL_BAR ? 'stack' : 'dodge'
301
+ type: statItem.type === STAT_TYPE.STACKED_HORIZONTAL_BAR ? 'stack' : 'dodge'
309
302
  }]).state({
310
303
  active: {
311
304
  style: {
@@ -363,7 +356,7 @@ class HorizontalBarChart extends _baseChart.default {
363
356
  fill: themeColors.textColor
364
357
  },
365
358
  formatter: name => {
366
- return !name && typeof name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name;
359
+ return !name && typeof name !== 'number' ? intl.get(EMPTY_NAME) : name;
367
360
  }
368
361
  }
369
362
  });
@@ -404,9 +397,9 @@ class HorizontalBarChart extends _baseChart.default {
404
397
  div.id = horizontalAxisID;
405
398
  div.className = 'statistic-chart-axis-label';
406
399
  if (horizontal_axis_summary_type === 'count') {
407
- div.innerHTML = _reactIntlUniversal.default.get(_constants.TITLE_AMOUNT);
400
+ div.innerHTML = intl.get(TITLE_AMOUNT);
408
401
  } else {
409
- const column = _dtableStore.TableUtils.getTableColumnByKey(table, horizontal_axis_column_key) || {};
402
+ const column = TableUtils.getTableColumnByKey(table, horizontal_axis_column_key) || {};
410
403
  div.innerHTML = column.name || '';
411
404
  }
412
405
  div.setAttribute('style', "color:".concat(textColor, "; width: 100%; padding-left: ").concat(autoPadding.left, "px; text-align: ").concat(horizontal_axis_label_position, "; bottom: -20px"));
@@ -424,9 +417,9 @@ class HorizontalBarChart extends _baseChart.default {
424
417
  const div = document.createElement('div');
425
418
  div.id = verticalAxisID;
426
419
  div.className = 'statistic-chart-axis-label';
427
- const column = _dtableStore.TableUtils.getTableColumnByKey(table, vertical_axis_column_key);
420
+ const column = TableUtils.getTableColumnByKey(table, vertical_axis_column_key);
428
421
  div.innerHTML = "".concat(column ? column.name : '');
429
- if (type === _constants.STAT_TYPE.STACKED_HORIZONTAL_BAR) {
422
+ if (type === STAT_TYPE.STACKED_HORIZONTAL_BAR) {
430
423
  div.innerHTML = title_name;
431
424
  }
432
425
  const containerHeight = chartContainer.offsetHeight;
@@ -463,7 +456,7 @@ class HorizontalBarChart extends _baseChart.default {
463
456
  chartCalculator,
464
457
  eventBus
465
458
  } = this.props;
466
- this.unsubscribeStyleChange = eventBus.subscribe(_constants.LABEL_CONFIG_CHANGED, newStatItem => {
459
+ this.unsubscribeStyleChange = eventBus.subscribe(LABEL_CONFIG_CHANGED, newStatItem => {
467
460
  this.renderAxisLabel(newStatItem);
468
461
  });
469
462
  chartCalculator.calculate(statItem).then(data => {
@@ -549,7 +542,7 @@ class HorizontalBarChart extends _baseChart.default {
549
542
  show_horizontal_axis_label,
550
543
  show_vertical_axis_label
551
544
  } = statItem;
552
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isCalculatingData && this.renderLoading(), showResultDescription && this.renderEmpty(), /*#__PURE__*/_react.default.createElement("div", {
545
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isCalculatingData && this.renderLoading(), showResultDescription && this.renderEmpty(), /*#__PURE__*/React.createElement("div", {
553
546
  ref: ref => this.container = ref,
554
547
  style: {
555
548
  padding: show_vertical_axis_label || show_horizontal_axis_label ? 30 : 20
@@ -559,4 +552,4 @@ class HorizontalBarChart extends _baseChart.default {
559
552
  }
560
553
  }
561
554
  HorizontalBarChart.propTypes = propTypes;
562
- var _default = exports.default = HorizontalBarChart;
555
+ export default HorizontalBarChart;
@@ -1,33 +1,26 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _pivotTable = _interopRequireDefault(require("./pivot-table"));
10
- var _barChart = _interopRequireDefault(require("./bar-chart"));
11
- var _compareChart = _interopRequireDefault(require("./compare-chart"));
12
- var _horizontalBarChart = _interopRequireDefault(require("./horizontal-bar-chart"));
13
- var _completenessChart = _interopRequireDefault(require("./completeness-chart"));
14
- var _lineChart = _interopRequireDefault(require("./line-chart"));
15
- var _areaChart = _interopRequireDefault(require("./area-chart"));
16
- var _pieChart = _interopRequireDefault(require("./pie-chart"));
17
- var _ringChart = _interopRequireDefault(require("./ring-chart"));
18
- var _scatterChart = _interopRequireDefault(require("./scatter-chart"));
19
- var _combinationChart = _interopRequireDefault(require("./combination-chart"));
20
- var _map = _interopRequireDefault(require("./map"));
21
- var _worldMap = _interopRequireDefault(require("./world-map"));
22
- var _heatMap = _interopRequireDefault(require("./heat-map"));
23
- var _mirror = _interopRequireDefault(require("./mirror"));
24
- var _basicNumberCard = _interopRequireDefault(require("./basic-number-card"));
25
- var _trendChart = _interopRequireDefault(require("./trend-chart"));
26
- var _dashboardChart = _interopRequireDefault(require("./dashboard-chart"));
27
- var _treemapChart = _interopRequireDefault(require("./treemap-chart"));
28
- var _customBar = _interopRequireDefault(require("./custom-bar"));
29
- var _constants = require("../constants");
30
- class StatView extends _react.default.Component {
1
+ import React from 'react';
2
+ import PivotTable from './pivot-table';
3
+ import BarChart from './bar-chart';
4
+ import CompareChart from './compare-chart';
5
+ import HorizontalBarChart from './horizontal-bar-chart';
6
+ import CompletenessChart from './completeness-chart';
7
+ import LineChart from './line-chart';
8
+ import AreaChart from './area-chart';
9
+ import PieChart from './pie-chart';
10
+ import RingChart from './ring-chart';
11
+ import ScatterChart from './scatter-chart';
12
+ import CombinationChart from './combination-chart';
13
+ import Map from './map';
14
+ import WorldMap from './world-map';
15
+ import HeatMap from './heat-map';
16
+ import Mirror from './mirror';
17
+ import BasicNumberCard from './basic-number-card';
18
+ import TrendChart from './trend-chart';
19
+ import DashboardChart from './dashboard-chart';
20
+ import TreeMap from './treemap-chart';
21
+ import CustomBar from './custom-bar';
22
+ import { STAT_TYPE } from '../constants';
23
+ class StatView extends React.Component {
31
24
  constructor() {
32
25
  super(...arguments);
33
26
  this.getStatData = () => {
@@ -67,98 +60,98 @@ class StatView extends _react.default.Component {
67
60
  }
68
61
  };
69
62
  switch (statItem.type) {
70
- case _constants.STAT_TYPE.BAR:
71
- case _constants.STAT_TYPE.BAR_GROUP:
72
- case _constants.STAT_TYPE.BAR_STACK:
63
+ case STAT_TYPE.BAR:
64
+ case STAT_TYPE.BAR_GROUP:
65
+ case STAT_TYPE.BAR_STACK:
73
66
  {
74
- return /*#__PURE__*/_react.default.createElement(_barChart.default, viewProps);
67
+ return /*#__PURE__*/React.createElement(BarChart, viewProps);
75
68
  }
76
- case _constants.STAT_TYPE.COMPARE_BAR:
69
+ case STAT_TYPE.COMPARE_BAR:
77
70
  {
78
- return /*#__PURE__*/_react.default.createElement(_compareChart.default, viewProps);
71
+ return /*#__PURE__*/React.createElement(CompareChart, viewProps);
79
72
  }
80
- case _constants.STAT_TYPE.HORIZONTAL_BAR:
81
- case _constants.STAT_TYPE.HORIZONTAL_GROUP_BAR:
82
- case _constants.STAT_TYPE.STACKED_HORIZONTAL_BAR:
73
+ case STAT_TYPE.HORIZONTAL_BAR:
74
+ case STAT_TYPE.HORIZONTAL_GROUP_BAR:
75
+ case STAT_TYPE.STACKED_HORIZONTAL_BAR:
83
76
  {
84
- return /*#__PURE__*/_react.default.createElement(_horizontalBarChart.default, viewProps);
77
+ return /*#__PURE__*/React.createElement(HorizontalBarChart, viewProps);
85
78
  }
86
- case _constants.STAT_TYPE.COMPLETENESS_CHART:
87
- case _constants.STAT_TYPE.GROUP_COMPLETENESS_CHART:
79
+ case STAT_TYPE.COMPLETENESS_CHART:
80
+ case STAT_TYPE.GROUP_COMPLETENESS_CHART:
88
81
  {
89
- return /*#__PURE__*/_react.default.createElement(_completenessChart.default, viewProps);
82
+ return /*#__PURE__*/React.createElement(CompletenessChart, viewProps);
90
83
  }
91
- case _constants.STAT_TYPE.LINE:
92
- case _constants.STAT_TYPE.GROUP_LINE:
84
+ case STAT_TYPE.LINE:
85
+ case STAT_TYPE.GROUP_LINE:
93
86
  {
94
- return /*#__PURE__*/_react.default.createElement(_lineChart.default, viewProps);
87
+ return /*#__PURE__*/React.createElement(LineChart, viewProps);
95
88
  }
96
- case _constants.STAT_TYPE.AREA_CHART:
97
- case _constants.STAT_TYPE.AREA_GROUP_CHART:
89
+ case STAT_TYPE.AREA_CHART:
90
+ case STAT_TYPE.AREA_GROUP_CHART:
98
91
  {
99
- return /*#__PURE__*/_react.default.createElement(_areaChart.default, viewProps);
92
+ return /*#__PURE__*/React.createElement(AreaChart, viewProps);
100
93
  }
101
- case _constants.STAT_TYPE.PIE:
94
+ case STAT_TYPE.PIE:
102
95
  {
103
- return /*#__PURE__*/_react.default.createElement(_pieChart.default, viewProps);
96
+ return /*#__PURE__*/React.createElement(PieChart, viewProps);
104
97
  }
105
- case _constants.STAT_TYPE.RING:
98
+ case STAT_TYPE.RING:
106
99
  {
107
- return /*#__PURE__*/_react.default.createElement(_ringChart.default, viewProps);
100
+ return /*#__PURE__*/React.createElement(RingChart, viewProps);
108
101
  }
109
- case _constants.STAT_TYPE.SCATTER:
102
+ case STAT_TYPE.SCATTER:
110
103
  {
111
- return /*#__PURE__*/_react.default.createElement(_scatterChart.default, viewProps);
104
+ return /*#__PURE__*/React.createElement(ScatterChart, viewProps);
112
105
  }
113
- case _constants.STAT_TYPE.COMBINATION_CHART:
106
+ case STAT_TYPE.COMBINATION_CHART:
114
107
  {
115
- return /*#__PURE__*/_react.default.createElement(_combinationChart.default, viewProps);
108
+ return /*#__PURE__*/React.createElement(CombinationChart, viewProps);
116
109
  }
117
- case _constants.STAT_TYPE.MAP:
118
- case _constants.STAT_TYPE.MAP_BUBBLE:
110
+ case STAT_TYPE.MAP:
111
+ case STAT_TYPE.MAP_BUBBLE:
119
112
  {
120
113
  viewProps.isPreview = viewProps.isEnlarge ? false : viewProps.isPreview;
121
- return /*#__PURE__*/_react.default.createElement(_map.default, viewProps);
114
+ return /*#__PURE__*/React.createElement(Map, viewProps);
122
115
  }
123
- case _constants.STAT_TYPE.WORLD_MAP:
124
- case _constants.STAT_TYPE.WORLD_MAP_BUBBLE:
116
+ case STAT_TYPE.WORLD_MAP:
117
+ case STAT_TYPE.WORLD_MAP_BUBBLE:
125
118
  {
126
119
  viewProps.isPreview = viewProps.isEnlarge ? false : viewProps.isPreview;
127
- return /*#__PURE__*/_react.default.createElement(_worldMap.default, viewProps);
120
+ return /*#__PURE__*/React.createElement(WorldMap, viewProps);
128
121
  }
129
- case _constants.STAT_TYPE.HEAT_MAP:
122
+ case STAT_TYPE.HEAT_MAP:
130
123
  {
131
124
  viewProps.isPreview = viewProps.isEnlarge ? false : viewProps.isPreview;
132
- return /*#__PURE__*/_react.default.createElement(_heatMap.default, viewProps);
125
+ return /*#__PURE__*/React.createElement(HeatMap, viewProps);
133
126
  }
134
- case _constants.STAT_TYPE.MIRROR:
127
+ case STAT_TYPE.MIRROR:
135
128
  {
136
129
  viewProps.isPreview = viewProps.isEnlarge ? false : viewProps.isPreview;
137
- return /*#__PURE__*/_react.default.createElement(_mirror.default, viewProps);
130
+ return /*#__PURE__*/React.createElement(Mirror, viewProps);
138
131
  }
139
- case _constants.STAT_TYPE.BASIC_NUMBER_CARD:
132
+ case STAT_TYPE.BASIC_NUMBER_CARD:
140
133
  {
141
- return /*#__PURE__*/_react.default.createElement(_basicNumberCard.default, viewProps);
134
+ return /*#__PURE__*/React.createElement(BasicNumberCard, viewProps);
142
135
  }
143
- case _constants.STAT_TYPE.TREND_CHART:
136
+ case STAT_TYPE.TREND_CHART:
144
137
  {
145
- return /*#__PURE__*/_react.default.createElement(_trendChart.default, viewProps);
138
+ return /*#__PURE__*/React.createElement(TrendChart, viewProps);
146
139
  }
147
- case _constants.STAT_TYPE.DASHBOARD:
140
+ case STAT_TYPE.DASHBOARD:
148
141
  {
149
- return /*#__PURE__*/_react.default.createElement(_dashboardChart.default, viewProps);
142
+ return /*#__PURE__*/React.createElement(DashboardChart, viewProps);
150
143
  }
151
- case _constants.STAT_TYPE.TREEMAP:
144
+ case STAT_TYPE.TREEMAP:
152
145
  {
153
- return /*#__PURE__*/_react.default.createElement(_treemapChart.default, viewProps);
146
+ return /*#__PURE__*/React.createElement(TreeMap, viewProps);
154
147
  }
155
- case _constants.STAT_TYPE.PIVOT_TABLE:
148
+ case STAT_TYPE.PIVOT_TABLE:
156
149
  {
157
- return /*#__PURE__*/_react.default.createElement(_pivotTable.default, viewProps);
150
+ return /*#__PURE__*/React.createElement(PivotTable, viewProps);
158
151
  }
159
- case _constants.STAT_TYPE.CUSTOM_BAR:
152
+ case STAT_TYPE.CUSTOM_BAR:
160
153
  {
161
- return /*#__PURE__*/_react.default.createElement(_customBar.default, viewProps);
154
+ return /*#__PURE__*/React.createElement(CustomBar, viewProps);
162
155
  }
163
156
  default:
164
157
  {
@@ -172,4 +165,4 @@ StatView.defaultProps = {
172
165
  isEnlarge: false,
173
166
  isEdit: false
174
167
  };
175
- var _default = exports.default = StatView;
168
+ export default StatView;
@@ -1,30 +1,23 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _propTypes = _interopRequireDefault(require("prop-types"));
10
- var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
11
- var _dtableStore = require("dtable-store");
12
- var _baseChart = _interopRequireDefault(require("./base-chart"));
13
- var _customG = require("../custom-g2");
14
- var _commonUtils = require("../utils/common-utils");
15
- var _basicChartUtils = require("../utils/basic-chart-utils");
16
- var _constants = require("../constants");
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import intl from 'react-intl-universal';
4
+ import { TableUtils } from 'dtable-store';
5
+ import BaseChart from './base-chart';
6
+ import { Chart } from '../custom-g2';
7
+ import { getCurrentTheme } from '../utils/common-utils';
8
+ import { getChartGroups } from '../utils/basic-chart-utils';
9
+ import { DEFAULT_NUMBER_FORMAT_OBJECT, EMPTY_NAME, LABEL_CONFIG_CHANGED, STATISTICS_COUNT_SHOW, SUMMARY_TYPE, TITLE_AMOUNT, USEABLE_COLOR_TYPES } from '../constants';
17
10
  const propTypes = {
18
- isPreview: _propTypes.default.bool,
19
- isEdit: _propTypes.default.bool,
20
- colorThemeName: _propTypes.default.string,
21
- statItem: _propTypes.default.object,
22
- chartCalculator: _propTypes.default.object,
23
- eventBus: _propTypes.default.object,
24
- getTableById: _propTypes.default.func,
25
- toggleStatisticRecordsDialog: _propTypes.default.func
11
+ isPreview: PropTypes.bool,
12
+ isEdit: PropTypes.bool,
13
+ colorThemeName: PropTypes.string,
14
+ statItem: PropTypes.object,
15
+ chartCalculator: PropTypes.object,
16
+ eventBus: PropTypes.object,
17
+ getTableById: PropTypes.func,
18
+ toggleStatisticRecordsDialog: PropTypes.func
26
19
  };
27
- class LineChart extends _baseChart.default {
20
+ class LineChart extends BaseChart {
28
21
  constructor(props) {
29
22
  super(props);
30
23
  this.drawChart = data => {
@@ -51,19 +44,19 @@ class LineChart extends _baseChart.default {
51
44
  });
52
45
  let summaryType = summary_type;
53
46
  let summaryMethod = summary_method;
54
- let summaryColumnData = _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
47
+ let summaryColumnData = DEFAULT_NUMBER_FORMAT_OBJECT;
55
48
  if (!summaryType && y_axis_summary_type) {
56
49
  summaryType = y_axis_summary_type;
57
50
  }
58
51
  if (!summaryMethod && y_axis_summary_method) {
59
52
  summaryMethod = y_axis_summary_method;
60
53
  }
61
- if (y_axis_summary_type === _constants.SUMMARY_TYPE.ADVANCED) {
54
+ if (y_axis_summary_type === SUMMARY_TYPE.ADVANCED) {
62
55
  const table = getTableById(table_id);
63
- const summaryColumn = _dtableStore.TableUtils.getTableColumnByKey(table, y_axis_column_key) || {};
64
- summaryColumnData = summaryColumn.data || _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
56
+ const summaryColumn = TableUtils.getTableColumnByKey(table, y_axis_column_key) || {};
57
+ summaryColumnData = summaryColumn.data || DEFAULT_NUMBER_FORMAT_OBJECT;
65
58
  }
66
- const currentTheme = (0, _commonUtils.getCurrentTheme)(colorThemeName);
59
+ const currentTheme = getCurrentTheme(colorThemeName);
67
60
  const chartBarColor = currentTheme && currentTheme.colors[0] || '#2a67d1';
68
61
  const isGroup = column_groupby_column_key || column_groupby_multiple_numeric_column;
69
62
  if (isGroup) {
@@ -80,7 +73,7 @@ class LineChart extends _baseChart.default {
80
73
  const {
81
74
  width
82
75
  } = this.chart.coordinateBBox;
83
- const chartData = isGroup ? (0, _basicChartUtils.getChartGroups)(data) : data;
76
+ const chartData = isGroup ? getChartGroups(data) : data;
84
77
  const ticks = this.getTicks(chartData, width);
85
78
  const labelCount = this.getLabelCount(ticks, chartData);
86
79
  if (ticks.length > 0) {
@@ -128,7 +121,7 @@ class LineChart extends _baseChart.default {
128
121
  config.height = 400;
129
122
  config.width = 700;
130
123
  }
131
- this.chart = new _customG.Chart(config);
124
+ this.chart = new Chart(config);
132
125
  };
133
126
  this.handleAutoRange = (data, summaryColumnData, summaryMethod) => {
134
127
  const {
@@ -178,7 +171,7 @@ class LineChart extends _baseChart.default {
178
171
  this.chart.line().position('name*value').color(chartBarColor).tooltip('name*formatted_value', (name, value) => {
179
172
  return {
180
173
  value,
181
- name: summaryType === 'count' ? _reactIntlUniversal.default.get(_constants.TITLE_AMOUNT) : _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW[summaryMethod])
174
+ name: summaryType === 'count' ? intl.get(TITLE_AMOUNT) : intl.get(STATISTICS_COUNT_SHOW[summaryMethod])
182
175
  };
183
176
  });
184
177
  this.chart.point().label(display_data ? 'value' : false, {
@@ -192,8 +185,8 @@ class LineChart extends _baseChart.default {
192
185
  }).tooltip('name*formatted_value', (name, value) => {
193
186
  return {
194
187
  value,
195
- name: !name && typeof name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name,
196
- title: summaryType === 'count' ? _reactIntlUniversal.default.get(_constants.TITLE_AMOUNT) : _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW[summaryMethod])
188
+ name: !name && typeof name !== 'number' ? intl.get(EMPTY_NAME) : name,
189
+ title: summaryType === 'count' ? intl.get(TITLE_AMOUNT) : intl.get(STATISTICS_COUNT_SHOW[summaryMethod])
197
190
  };
198
191
  });
199
192
  };
@@ -210,7 +203,7 @@ class LineChart extends _baseChart.default {
210
203
  let groupColorCallback = currentTheme && currentTheme.colors;
211
204
  // when the 'Group by' column is a 'single-select' column,
212
205
  // and the user chooses to use the colors from the column.
213
- if (color_option === _constants.USEABLE_COLOR_TYPES[1]) {
206
+ if (color_option === USEABLE_COLOR_TYPES[1]) {
214
207
  const groupColorMapping = {};
215
208
  data.forEach(item => {
216
209
  if (!groupColorMapping[item.group_name]) {
@@ -235,8 +228,8 @@ class LineChart extends _baseChart.default {
235
228
  }).position('name*value').size(3).color('group_name', groupColorCallback).tooltip('name*formatted_value*group_name', (name, value, group_name) => {
236
229
  return {
237
230
  value,
238
- title: !name && typeof name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name,
239
- name: !group_name && typeof group_name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : group_name
231
+ title: !name && typeof name !== 'number' ? intl.get(EMPTY_NAME) : name,
232
+ name: !group_name && typeof group_name !== 'number' ? intl.get(EMPTY_NAME) : group_name
240
233
  };
241
234
  }).shape('circle').style({
242
235
  lineWidth: 1,
@@ -309,7 +302,7 @@ class LineChart extends _baseChart.default {
309
302
  fill: themeColors.textColor
310
303
  },
311
304
  formatter: name => {
312
- return !name && typeof name !== 'number' ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name;
305
+ return !name && typeof name !== 'number' ? intl.get(EMPTY_NAME) : name;
313
306
  }
314
307
  },
315
308
  pageNavigator: {
@@ -358,7 +351,7 @@ class LineChart extends _baseChart.default {
358
351
  const div = document.createElement('div');
359
352
  div.id = xAxisID;
360
353
  div.className = 'statistic-chart-axis-label';
361
- const column = _dtableStore.TableUtils.getTableColumnByKey(table, x_axis_column_key);
354
+ const column = TableUtils.getTableColumnByKey(table, x_axis_column_key);
362
355
  div.innerHTML = "".concat(column ? column.name : '');
363
356
  div.setAttribute('style', "color:".concat(textColor, "; width: 100%; padding-left: ").concat(autoPadding.left, "px; text-align: ").concat(x_axis_label_position, "; bottom: -20px"));
364
357
  chartContainer.appendChild(div);
@@ -376,10 +369,10 @@ class LineChart extends _baseChart.default {
376
369
  const div = document.createElement('div');
377
370
  div.id = yAxisID;
378
371
  div.className = 'statistic-chart-axis-label';
379
- if (y_axis_summary_type === _constants.SUMMARY_TYPE.COUNT) {
380
- div.innerHTML = _reactIntlUniversal.default.get(_constants.TITLE_AMOUNT);
372
+ if (y_axis_summary_type === SUMMARY_TYPE.COUNT) {
373
+ div.innerHTML = intl.get(TITLE_AMOUNT);
381
374
  } else {
382
- const column = _dtableStore.TableUtils.getTableColumnByKey(table, y_axis_column_key) || {};
375
+ const column = TableUtils.getTableColumnByKey(table, y_axis_column_key) || {};
383
376
  div.innerHTML = column.name || '';
384
377
  }
385
378
  const containerHeight = chartContainer.offsetHeight;
@@ -416,7 +409,7 @@ class LineChart extends _baseChart.default {
416
409
  chartCalculator,
417
410
  eventBus
418
411
  } = this.props;
419
- this.unsubscribeStyleChange = eventBus.subscribe(_constants.LABEL_CONFIG_CHANGED, newStatItem => {
412
+ this.unsubscribeStyleChange = eventBus.subscribe(LABEL_CONFIG_CHANGED, newStatItem => {
420
413
  this.renderAxisLabel(newStatItem);
421
414
  });
422
415
  if (this.container) {
@@ -507,7 +500,7 @@ class LineChart extends _baseChart.default {
507
500
  const style = {
508
501
  padding: show_y_axis_label || show_x_axis_label ? 30 : 20
509
502
  };
510
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isCalculatingData && this.renderLoading(), showResultDescription && this.renderEmpty(), /*#__PURE__*/_react.default.createElement("div", {
503
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isCalculatingData && this.renderLoading(), showResultDescription && this.renderEmpty(), /*#__PURE__*/React.createElement("div", {
511
504
  ref: ref => this.container = ref,
512
505
  style: style,
513
506
  className: "statistic-chart-container"
@@ -515,4 +508,4 @@ class LineChart extends _baseChart.default {
515
508
  }
516
509
  }
517
510
  LineChart.propTypes = propTypes;
518
- var _default = exports.default = LineChart;
511
+ export default LineChart;