sea-chart 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +117 -1
- package/dist/api/index.js +101 -0
- package/{lib → dist}/components/collaborator/index.js +8 -6
- package/{lib → dist}/components/icon/index.css +1 -1
- package/{lib → dist}/components/icon/index.js +7 -5
- package/dist/components/index.js +8 -0
- package/{lib → dist}/components/loading/index.js +4 -2
- package/dist/components/number-input/index.js +31 -0
- package/{lib → dist}/components/pixel-editor/index.css +4 -4
- package/{lib → dist}/components/pixel-editor/index.js +11 -15
- package/{lib → dist}/components/select-group/index.css +10 -10
- package/dist/components/select-group/index.js +52 -0
- package/dist/components/types-dialog/index.css +97 -0
- package/dist/components/types-dialog/index.js +117 -0
- package/{lib → dist}/constants/geolocation.js +3 -3
- package/dist/constants/index.js +184 -0
- package/{lib → dist}/constants/model.js +25 -5
- package/dist/constants/style.js +15 -0
- package/dist/constants/type-image.js +59 -0
- package/dist/constants/type.js +124 -0
- package/dist/context.js +83 -0
- package/dist/editor/index.js +41 -0
- package/dist/index.js +9 -0
- package/dist/intl.js +37 -0
- package/dist/locale/index.js +18 -0
- package/{lib → dist}/locale/lang/de.js +1 -1
- package/{lib → dist}/locale/lang/en.js +1 -1
- package/{lib → dist}/locale/lang/es.js +1 -1
- package/{lib → dist}/locale/lang/fr.js +1 -1
- package/{lib → dist}/locale/lang/pt.js +1 -1
- package/{lib → dist}/locale/lang/ru.js +1 -1
- package/{lib → dist}/locale/lang/zh_CN.js +1 -1
- package/dist/model/area-group.js +41 -0
- package/dist/model/area.js +32 -0
- package/dist/model/bar-group.js +44 -0
- package/dist/model/bar-stack.js +41 -0
- package/dist/model/bar.js +38 -0
- package/dist/model/base-model.js +9 -0
- package/dist/model/basic-number-card.js +22 -0
- package/dist/model/chart.js +23 -0
- package/dist/model/combination.js +38 -0
- package/dist/model/compare-bar.js +39 -0
- package/dist/model/completeness-group.js +24 -0
- package/dist/model/completeness.js +18 -0
- package/dist/model/dashboard.js +16 -0
- package/dist/model/generic-model.js +224 -0
- package/dist/model/heat-map.js +23 -0
- package/dist/model/horizontal-bar.js +38 -0
- package/dist/model/horizontal-group-bar.js +43 -0
- package/dist/model/index.js +63 -0
- package/dist/model/line-group.js +44 -0
- package/dist/model/line.js +38 -0
- package/dist/model/map-bubble.js +27 -0
- package/dist/model/map.js +27 -0
- package/dist/model/mirror.js +26 -0
- package/dist/model/pie.js +26 -0
- package/dist/model/ring.js +26 -0
- package/dist/model/scatter.js +19 -0
- package/dist/model/stacked-horizontal-bar.js +32 -0
- package/dist/model/table.js +23 -0
- package/dist/model/tree-map.js +20 -0
- package/dist/model/trend.js +24 -0
- package/dist/model/user.js +15 -0
- package/dist/model/world-map-bubble.js +26 -0
- package/dist/model/world-map.js +26 -0
- package/{lib/components → dist}/settings/advance-bar-settings/data-settings.js +68 -45
- package/dist/settings/advance-bar-settings/style-settings.js +161 -0
- package/{lib/components → dist}/settings/bar-settings/data-settings.js +76 -51
- package/dist/settings/bar-settings/style-settings.js +179 -0
- package/dist/settings/basic-number-card/data-settings.js +126 -0
- package/dist/settings/basic-number-card/style-settings.js +42 -0
- package/dist/settings/combination-settings/data-settings.js +279 -0
- package/dist/settings/combination-settings/style-settings.js +174 -0
- package/dist/settings/dashboard-settings/data-settings.js +179 -0
- package/{lib/components → dist}/settings/data-settings.js +28 -22
- package/dist/settings/horizontal-bar-settings/data-settings.js +55 -0
- package/dist/settings/horizontal-bar-settings/style-settings.js +46 -0
- package/dist/settings/index.css +85 -0
- package/dist/settings/index.js +76 -0
- package/{lib/components → dist}/settings/pie-settings/data-settings.js +67 -44
- package/{lib/components → dist}/settings/pie-settings/style-settings.js +67 -49
- package/dist/settings/style-settings.js +118 -0
- package/{lib/components → dist}/settings/table-settings/data-settings.js +269 -208
- package/{lib/components → dist}/settings/time-comparison-settings/data-settings.js +82 -67
- package/dist/settings/time-comparison-settings/style-settings.js +213 -0
- package/dist/settings/widgets/basic-summary/index.css +12 -0
- package/dist/settings/widgets/basic-summary/index.js +176 -0
- package/{lib/components/settings/widgets/statistic-type → dist/settings/widgets/chart-type}/index.css +5 -5
- package/dist/settings/widgets/chart-type/index.js +59 -0
- package/{lib/components → dist}/settings/widgets/common-data-settings.js +24 -18
- package/dist/settings/widgets/data-filter/index.css +17 -0
- package/{lib/components → dist}/settings/widgets/data-filter/index.js +51 -37
- package/dist/settings/widgets/data-sort.js +44 -0
- package/dist/settings/widgets/date-summary-item.js +111 -0
- package/dist/settings/widgets/display-values-settings/index.css +13 -0
- package/{lib/components → dist}/settings/widgets/display-values-settings/index.js +19 -14
- package/{lib/components → dist}/settings/widgets/divider/index.css +1 -1
- package/dist/settings/widgets/divider/index.js +12 -0
- package/{lib/components → dist}/settings/widgets/font-settings/font-size-settings.js +14 -12
- package/{lib/components → dist}/settings/widgets/font-settings/font-weight-settings.js +14 -16
- package/dist/settings/widgets/group-by.js +160 -0
- package/{lib/components → dist}/settings/widgets/label-color.js +10 -10
- package/dist/settings/widgets/min-max-setting.js +52 -0
- package/dist/settings/widgets/mininum-slice-percent.js +63 -0
- package/dist/settings/widgets/numeric-summary-item.js +90 -0
- package/dist/settings/widgets/select-table/index.js +38 -0
- package/dist/settings/widgets/stack.js +50 -0
- package/dist/settings/widgets/summary-method-setting.js +66 -0
- package/dist/settings/widgets/summary-settings.js +411 -0
- package/dist/settings/widgets/switch/index.css +37 -0
- package/{lib/components → dist}/settings/widgets/switch/index.js +11 -8
- package/{lib/components → dist}/settings/widgets/text-horizontal-settings.js +12 -10
- package/dist/settings/widgets/time-picker.js +174 -0
- package/{lib/components → dist}/settings/widgets/title-settings/index.js +15 -13
- package/dist/settings/widgets/title-settings/title-text.js +25 -0
- package/dist/settings/widgets/x-axios.js +0 -0
- package/dist/settings/widgets/y-axis-group-settings.js +438 -0
- package/dist/utils/cell-format-utils.js +42 -0
- package/dist/utils/chart-data-sql.js +606 -0
- package/dist/utils/chart-utils.js +1803 -0
- package/dist/utils/chart.js +6 -0
- package/dist/utils/collaborator-manager.js +24 -0
- package/dist/utils/collaborator-utils.js +40 -0
- package/dist/utils/column-2-sql-column.js +551 -0
- package/dist/utils/column-utils.js +208 -0
- package/{lib → dist}/utils/custom-g2.js +11 -11
- package/{lib → dist}/utils/date-translate.js +11 -11
- package/dist/utils/index.js +48 -0
- package/dist/utils/key-generator.js +13 -0
- package/dist/utils/object-utils.js +45 -0
- package/{lib → dist}/utils/options-utils.js +17 -18
- package/dist/view/index.css +53 -0
- package/dist/view/index.js +169 -0
- package/{lib/layout → dist/view}/title/index.css +1 -1
- package/dist/view/title/index.js +46 -0
- package/dist/view/wrapper/area.js +150 -0
- package/dist/view/wrapper/bar-group.js +148 -0
- package/dist/view/wrapper/bar.js +138 -0
- package/dist/view/wrapper/basic-number-card.js +127 -0
- package/dist/view/wrapper/chart-component.js +261 -0
- package/dist/view/wrapper/combination.js +399 -0
- package/dist/view/wrapper/dashboard.js +164 -0
- package/dist/view/wrapper/horizontal-bar-group.js +149 -0
- package/dist/view/wrapper/horizontal-bar.js +140 -0
- package/dist/view/wrapper/horizontal-component.js +78 -0
- package/{lib/components/formatter → dist/view/wrapper}/index.js +90 -71
- package/dist/view/wrapper/line-group.js +145 -0
- package/dist/view/wrapper/line.js +157 -0
- package/dist/view/wrapper/pie.js +185 -0
- package/dist/view/wrapper/ring.js +264 -0
- package/{lib/components/formatter → dist/view/wrapper}/table/index.css +18 -18
- package/dist/view/wrapper/table/index.js +31 -0
- package/dist/view/wrapper/table/one-dimension-table-no-numeric-columns.js +144 -0
- package/dist/view/wrapper/table/one-dimension-table-with-numeric-columns.js +198 -0
- package/dist/view/wrapper/table/pivot-table-display-name.js +248 -0
- package/dist/view/wrapper/table/two-dimension-table.js +249 -0
- package/dist/view/wrapper/treemap.js +186 -0
- package/package.json +91 -100
- package/lib/components/formatter/area.js +0 -162
- package/lib/components/formatter/bar-group.js +0 -160
- package/lib/components/formatter/bar.js +0 -150
- package/lib/components/formatter/basic-number-card.js +0 -138
- package/lib/components/formatter/chart-component.js +0 -266
- package/lib/components/formatter/combination.js +0 -407
- package/lib/components/formatter/dashboard.js +0 -182
- package/lib/components/formatter/horizontal-bar-group.js +0 -161
- package/lib/components/formatter/horizontal-bar.js +0 -152
- package/lib/components/formatter/horizontal-component.js +0 -91
- package/lib/components/formatter/line-group.js +0 -157
- package/lib/components/formatter/line.js +0 -170
- package/lib/components/formatter/pie.js +0 -201
- package/lib/components/formatter/ring.js +0 -277
- package/lib/components/formatter/table/index.js +0 -42
- package/lib/components/formatter/table/one-dimension-table-no-numeric-columns.js +0 -145
- package/lib/components/formatter/table/one-dimension-table-with-numeric-columns.js +0 -193
- package/lib/components/formatter/table/pivot-table-display-name.js +0 -249
- package/lib/components/formatter/table/two-dimension-table.js +0 -241
- package/lib/components/formatter/treemap.js +0 -213
- package/lib/components/index.js +0 -5
- package/lib/components/number-input/index.js +0 -31
- package/lib/components/select-group/index.js +0 -63
- package/lib/components/settings/advance-bar-settings/style-settings.js +0 -149
- package/lib/components/settings/bar-settings/style-settings.js +0 -163
- package/lib/components/settings/basic-number-card/data-settings.js +0 -121
- package/lib/components/settings/basic-number-card/style-settings.js +0 -42
- package/lib/components/settings/combination-settings/data-settings.js +0 -256
- package/lib/components/settings/combination-settings/style-settings.js +0 -183
- package/lib/components/settings/dashboard-settings/data-settings.js +0 -167
- package/lib/components/settings/horizontal-bar-settings/data-settings.js +0 -45
- package/lib/components/settings/horizontal-bar-settings/style-settings.js +0 -38
- package/lib/components/settings/index.css +0 -73
- package/lib/components/settings/index.js +0 -74
- package/lib/components/settings/style-settings.js +0 -100
- package/lib/components/settings/time-comparison-settings/style-settings.js +0 -191
- package/lib/components/settings/widgets/basic-summary/index.css +0 -12
- package/lib/components/settings/widgets/basic-summary/index.js +0 -173
- package/lib/components/settings/widgets/data-filter/index.css +0 -17
- package/lib/components/settings/widgets/data-sort.js +0 -38
- package/lib/components/settings/widgets/date-summary-item.js +0 -126
- package/lib/components/settings/widgets/display-values-settings/index.css +0 -13
- package/lib/components/settings/widgets/divider/index.js +0 -10
- package/lib/components/settings/widgets/group-by.js +0 -168
- package/lib/components/settings/widgets/min-max-setting.js +0 -64
- package/lib/components/settings/widgets/mininum-slice-percent.js +0 -72
- package/lib/components/settings/widgets/numeric-summary-item.js +0 -109
- package/lib/components/settings/widgets/select-table/index.js +0 -49
- package/lib/components/settings/widgets/stack.js +0 -58
- package/lib/components/settings/widgets/statistic-type/index.js +0 -54
- package/lib/components/settings/widgets/summary-method-setting.js +0 -80
- package/lib/components/settings/widgets/summary-settings.js +0 -394
- package/lib/components/settings/widgets/switch/index.css +0 -37
- package/lib/components/settings/widgets/time-picker.js +0 -182
- package/lib/components/settings/widgets/title-settings/title-text.js +0 -31
- package/lib/components/settings/widgets/y-axis-group-settings.js +0 -399
- package/lib/components/types-dialog/index.css +0 -97
- package/lib/components/types-dialog/index.js +0 -127
- package/lib/constants/index.js +0 -164
- package/lib/constants/style.js +0 -13
- package/lib/constants/type-image.js +0 -32
- package/lib/constants/type.js +0 -97
- package/lib/context.js +0 -49
- package/lib/index.js +0 -6
- package/lib/intl.js +0 -37
- package/lib/layout/index.js +0 -4
- package/lib/layout/statistic/index.css +0 -53
- package/lib/layout/statistic/index.js +0 -190
- package/lib/layout/title/index.js +0 -41
- package/lib/locale/index.js +0 -11
- package/lib/model/area-group.js +0 -51
- package/lib/model/area.js +0 -42
- package/lib/model/bar-group.js +0 -54
- package/lib/model/bar-stack.js +0 -51
- package/lib/model/bar.js +0 -48
- package/lib/model/base-model.js +0 -11
- package/lib/model/basic-number-card.js +0 -32
- package/lib/model/combination.js +0 -48
- package/lib/model/compare-bar.js +0 -49
- package/lib/model/completeness-group.js +0 -34
- package/lib/model/completeness.js +0 -28
- package/lib/model/dashboard.js +0 -26
- package/lib/model/generic-model.js +0 -235
- package/lib/model/heat-map.js +0 -33
- package/lib/model/horizontal-bar.js +0 -48
- package/lib/model/horizontal-group-bar.js +0 -53
- package/lib/model/index.js +0 -36
- package/lib/model/line-group.js +0 -54
- package/lib/model/line.js +0 -48
- package/lib/model/map-bubble.js +0 -37
- package/lib/model/map.js +0 -37
- package/lib/model/mirror.js +0 -36
- package/lib/model/pie.js +0 -36
- package/lib/model/ring.js +0 -36
- package/lib/model/scatter.js +0 -29
- package/lib/model/stacked-horizontal-bar.js +0 -42
- package/lib/model/statistic.js +0 -22
- package/lib/model/table.js +0 -33
- package/lib/model/tree-map.js +0 -30
- package/lib/model/trend.js +0 -34
- package/lib/model/user.js +0 -22
- package/lib/model/world-map-bubble.js +0 -36
- package/lib/model/world-map.js +0 -36
- package/lib/utils/cell-format-utils.js +0 -41
- package/lib/utils/chart.js +0 -6
- package/lib/utils/collaborator-utils.js +0 -40
- package/lib/utils/column-utils.js +0 -247
- package/lib/utils/data-filter/filter-item-utils.js +0 -80
- package/lib/utils/data-filter/filters-utils.js +0 -406
- package/lib/utils/data-filter/index.js +0 -3
- package/lib/utils/index.js +0 -50
- package/lib/utils/key-generator.js +0 -13
- package/lib/utils/object-utils.js +0 -61
- package/lib/utils/statistic-column-2-sql-column-utils.js +0 -499
- package/lib/utils/statistic-utils.js +0 -1685
- /package/{lib → dist}/assets/icons/area-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/bar-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/card.svg +0 -0
- /package/{lib → dist}/assets/icons/combination-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/dtable-logo.svg +0 -0
- /package/{lib → dist}/assets/icons/facet-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/gauge.svg +0 -0
- /package/{lib → dist}/assets/icons/heat-map.svg +0 -0
- /package/{lib → dist}/assets/icons/histogram.svg +0 -0
- /package/{lib → dist}/assets/icons/line-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/map.svg +0 -0
- /package/{lib → dist}/assets/icons/pie-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/rectangular-tree-diagram.svg +0 -0
- /package/{lib → dist}/assets/icons/scatter-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/type-change.svg +0 -0
- /package/{lib → dist}/assets/img/area-chart.png +0 -0
- /package/{lib → dist}/assets/img/area-group-chart.png +0 -0
- /package/{lib → dist}/assets/img/bar-group.png +0 -0
- /package/{lib → dist}/assets/img/bar-stack.png +0 -0
- /package/{lib → dist}/assets/img/bar.png +0 -0
- /package/{lib → dist}/assets/img/combination-chart.png +0 -0
- /package/{lib → dist}/assets/img/compared-chart.png +0 -0
- /package/{lib → dist}/assets/img/completeness-chart.png +0 -0
- /package/{lib → dist}/assets/img/custom-bar.png +0 -0
- /package/{lib → dist}/assets/img/dashboard-chart.png +0 -0
- /package/{lib → dist}/assets/img/group-completeness-chart.png +0 -0
- /package/{lib → dist}/assets/img/group_line.png +0 -0
- /package/{lib → dist}/assets/img/heat-map.png +0 -0
- /package/{lib → dist}/assets/img/horizontal-bar.png +0 -0
- /package/{lib → dist}/assets/img/horizontal-group-bar.png +0 -0
- /package/{lib → dist}/assets/img/line.png +0 -0
- /package/{lib → dist}/assets/img/map-bubble.png +0 -0
- /package/{lib → dist}/assets/img/map.png +0 -0
- /package/{lib → dist}/assets/img/mirror.png +0 -0
- /package/{lib → dist}/assets/img/number-card.png +0 -0
- /package/{lib → dist}/assets/img/pie.png +0 -0
- /package/{lib → dist}/assets/img/pivot-table.png +0 -0
- /package/{lib → dist}/assets/img/ring.png +0 -0
- /package/{lib → dist}/assets/img/scatter.png +0 -0
- /package/{lib → dist}/assets/img/stacked-horizontal-bar.png +0 -0
- /package/{lib → dist}/assets/img/treemap.png +0 -0
- /package/{lib → dist}/assets/img/trend-chart.png +0 -0
- /package/{lib → dist}/assets/img/world-map-bubble.png +0 -0
- /package/{lib → dist}/assets/img/world-map.png +0 -0
- /package/{lib → dist}/components/loading/index.css +0 -0
- /package/{lib/components/settings/widgets/select-table → dist/editor}/index.css +0 -0
- /package/{lib/components → dist}/settings/advance-bar-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/bar-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/basic-number-card/index.js +0 -0
- /package/{lib/components → dist}/settings/combination-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/dashboard-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/horizontal-bar-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/pie-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/table-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/time-comparison-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/widgets/font-settings/index.js +0 -0
- /package/{lib/components/settings/widgets/x-axios.js → dist/settings/widgets/select-table/index.css} +0 -0
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
import React, { Fragment, useCallback, useMemo } from 'react';
|
|
3
|
-
import { FormGroup } from 'reactstrap';
|
|
4
|
-
import { COLUMNS_ICON_CONFIG, getTableById } from 'dtable-utils';
|
|
5
|
-
import DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
6
|
-
import CommonDataSettings from '../widgets/common-data-settings';
|
|
7
|
-
import { StatisticsUtils } from '../../../utils';
|
|
8
|
-
import { STATISTIC_SUMMARY_SHOW, STATISTIC_SUMMARY_CALCULATION_METHOD, STATISTIC_SUPPORT_COLUMNS, BASIC_NUMBER_CARD_CALCULATION_METHOD } from '../../../constants';
|
|
9
|
-
import intl from '../../../intl';
|
|
10
|
-
var DataSettings = function DataSettings(_ref) {
|
|
11
|
-
var tables = _ref.tables,
|
|
12
|
-
statistic = _ref.statistic,
|
|
13
|
-
FilterSettings = _ref.FilterSettings,
|
|
14
|
-
onChange = _ref.onChange;
|
|
15
|
-
var summaryMethodsOptions = useMemo(function () {
|
|
16
|
-
var numberCardSummaryMethod = [BASIC_NUMBER_CARD_CALCULATION_METHOD].concat(_toConsumableArray(STATISTIC_SUMMARY_CALCULATION_METHOD));
|
|
17
|
-
return numberCardSummaryMethod.map(function (method) {
|
|
18
|
-
return {
|
|
19
|
-
label: /*#__PURE__*/React.createElement("span", {
|
|
20
|
-
className: "select-option-name"
|
|
21
|
-
}, intl.get(STATISTIC_SUMMARY_SHOW[method])),
|
|
22
|
-
value: method
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
}, []);
|
|
26
|
-
var selectedTable = useMemo(function () {
|
|
27
|
-
var selectedTableId = statistic.config.table_id;
|
|
28
|
-
return getTableById(tables, selectedTableId);
|
|
29
|
-
}, [statistic.config, tables]);
|
|
30
|
-
var validColumns = useMemo(function () {
|
|
31
|
-
var columns = selectedTable && Array.isArray(selectedTable.columns) ? selectedTable.columns : [];
|
|
32
|
-
if (!columns || !Array.isArray(columns)) return [];
|
|
33
|
-
return columns.filter(function (column) {
|
|
34
|
-
return STATISTIC_SUPPORT_COLUMNS.includes(column.type);
|
|
35
|
-
});
|
|
36
|
-
}, [selectedTable]);
|
|
37
|
-
var numericColumns = useMemo(function () {
|
|
38
|
-
return validColumns.filter(function (column) {
|
|
39
|
-
return StatisticsUtils.isNumericSummaryColumn(column);
|
|
40
|
-
});
|
|
41
|
-
}, [validColumns]);
|
|
42
|
-
var numericColumnOptions = useMemo(function () {
|
|
43
|
-
var options = numericColumns.map(function (column) {
|
|
44
|
-
return {
|
|
45
|
-
value: column,
|
|
46
|
-
label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
47
|
-
className: "header-icon"
|
|
48
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
49
|
-
className: COLUMNS_ICON_CONFIG[column.type]
|
|
50
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
51
|
-
className: 'select-module select-module-name ml-0'
|
|
52
|
-
}, column.name))
|
|
53
|
-
};
|
|
54
|
-
});
|
|
55
|
-
return [{
|
|
56
|
-
value: {
|
|
57
|
-
key: 'Groupby_null'
|
|
58
|
-
},
|
|
59
|
-
label: /*#__PURE__*/React.createElement("span", {
|
|
60
|
-
className: 'select-module select-module-name null-option-name ml-0'
|
|
61
|
-
}, intl.get('Select_a_column')),
|
|
62
|
-
style: {
|
|
63
|
-
color: 'rgba(0, 0, 0, .25)'
|
|
64
|
-
}
|
|
65
|
-
}].concat(_toConsumableArray(options));
|
|
66
|
-
}, [numericColumns]);
|
|
67
|
-
var onSelectTargetValueColumn = useCallback(function (option) {
|
|
68
|
-
var config = statistic.config;
|
|
69
|
-
var target_value_column_key = config.target_value_column_key;
|
|
70
|
-
var newColumnKey = option.value.key;
|
|
71
|
-
if (target_value_column_key === newColumnKey) return;
|
|
72
|
-
onChange && onChange({
|
|
73
|
-
target_value_column_key: newColumnKey
|
|
74
|
-
});
|
|
75
|
-
}, [statistic, onChange]);
|
|
76
|
-
var onSelectTotalValueColumn = useCallback(function (option) {
|
|
77
|
-
var config = statistic.config;
|
|
78
|
-
var total_value_column_key = config.total_value_column_key;
|
|
79
|
-
var newColumnKey = option.value.key;
|
|
80
|
-
if (total_value_column_key === newColumnKey) return;
|
|
81
|
-
onChange && onChange({
|
|
82
|
-
total_value_column_key: newColumnKey
|
|
83
|
-
});
|
|
84
|
-
}, [statistic, onChange]);
|
|
85
|
-
var getSelectedMethodOption = useCallback(function (method, summaryMethodsOptions) {
|
|
86
|
-
return summaryMethodsOptions.find(function (m) {
|
|
87
|
-
return m.value === method;
|
|
88
|
-
}) || summaryMethodsOptions[0];
|
|
89
|
-
}, []);
|
|
90
|
-
var onSelectTargetValueColumnSummaryMethod = useCallback(function (option) {
|
|
91
|
-
var config = statistic.config;
|
|
92
|
-
var target_value_column_summary_method = config.target_value_column_summary_method;
|
|
93
|
-
var newSummaryMethod = option.value;
|
|
94
|
-
if (target_value_column_summary_method === newSummaryMethod) return;
|
|
95
|
-
onChange && onChange({
|
|
96
|
-
target_value_column_summary_method: newSummaryMethod
|
|
97
|
-
});
|
|
98
|
-
}, [statistic, onChange]);
|
|
99
|
-
var onSelectTotalValueColumnSummaryMethod = useCallback(function (option) {
|
|
100
|
-
var config = statistic.config;
|
|
101
|
-
var total_value_column_summary_method = config.total_value_column_summary_method;
|
|
102
|
-
var newSummaryMethod = option.value;
|
|
103
|
-
if (total_value_column_summary_method === newSummaryMethod) return;
|
|
104
|
-
onChange && onChange({
|
|
105
|
-
total_value_column_summary_method: newSummaryMethod
|
|
106
|
-
});
|
|
107
|
-
}, [statistic, onChange]);
|
|
108
|
-
var renderSummaryMethod = useCallback(function (option) {
|
|
109
|
-
var config = statistic.config;
|
|
110
|
-
var target_value_column_summary_method = config.target_value_column_summary_method,
|
|
111
|
-
total_value_column_summary_method = config.total_value_column_summary_method;
|
|
112
|
-
var summary_method, onSelectSummaryMethod;
|
|
113
|
-
if (option.targetColumn === 'target_value_column') {
|
|
114
|
-
summary_method = target_value_column_summary_method;
|
|
115
|
-
onSelectSummaryMethod = onSelectTargetValueColumnSummaryMethod;
|
|
116
|
-
} else {
|
|
117
|
-
summary_method = total_value_column_summary_method;
|
|
118
|
-
onSelectSummaryMethod = onSelectTotalValueColumnSummaryMethod;
|
|
119
|
-
}
|
|
120
|
-
var selectedMethodOption = getSelectedMethodOption(summary_method, summaryMethodsOptions);
|
|
121
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
122
|
-
className: "dtable-plugin-stat-parameter-item"
|
|
123
|
-
}, /*#__PURE__*/React.createElement("label", null, intl.get('Summary_method')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
124
|
-
value: selectedMethodOption,
|
|
125
|
-
onChange: onSelectSummaryMethod,
|
|
126
|
-
options: summaryMethodsOptions
|
|
127
|
-
}));
|
|
128
|
-
}, [statistic, summaryMethodsOptions, getSelectedMethodOption, onSelectTargetValueColumnSummaryMethod, onSelectTotalValueColumnSummaryMethod]);
|
|
129
|
-
var _statistic$config = statistic.config,
|
|
130
|
-
target_value_column_key = _statistic$config.target_value_column_key,
|
|
131
|
-
total_value_column_key = _statistic$config.total_value_column_key;
|
|
132
|
-
var selectedTargetValueColumnOption = numericColumnOptions.filter(function (option) {
|
|
133
|
-
return option.value.key === target_value_column_key;
|
|
134
|
-
})[0];
|
|
135
|
-
var selectedTotalValueColumnOption = numericColumnOptions.filter(function (option) {
|
|
136
|
-
return option.value.key === total_value_column_key;
|
|
137
|
-
})[0];
|
|
138
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(CommonDataSettings, {
|
|
139
|
-
statistic: statistic,
|
|
140
|
-
tables: tables,
|
|
141
|
-
FilterSettings: FilterSettings,
|
|
142
|
-
onChange: onChange
|
|
143
|
-
}), /*#__PURE__*/React.createElement(FormGroup, {
|
|
144
|
-
className: "seastatistic-parameter-item"
|
|
145
|
-
}, /*#__PURE__*/React.createElement("label", null, intl.get('Current_value_field')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
146
|
-
value: selectedTargetValueColumnOption,
|
|
147
|
-
options: numericColumnOptions,
|
|
148
|
-
placeholder: intl.get('Select_a_column'),
|
|
149
|
-
onChange: onSelectTargetValueColumn
|
|
150
|
-
})), /*#__PURE__*/React.createElement(FormGroup, {
|
|
151
|
-
className: "seastatistic-parameter-item"
|
|
152
|
-
}, renderSummaryMethod({
|
|
153
|
-
targetColumn: 'target_value_column'
|
|
154
|
-
})), /*#__PURE__*/React.createElement(FormGroup, {
|
|
155
|
-
className: "seastatistic-parameter-item"
|
|
156
|
-
}, /*#__PURE__*/React.createElement("label", null, intl.get('Total_value_field')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
157
|
-
value: selectedTotalValueColumnOption,
|
|
158
|
-
options: numericColumnOptions,
|
|
159
|
-
placeholder: intl.get('Select_a_column'),
|
|
160
|
-
onChange: onSelectTotalValueColumn
|
|
161
|
-
})), /*#__PURE__*/React.createElement(FormGroup, {
|
|
162
|
-
className: "seastatistic-parameter-item"
|
|
163
|
-
}, renderSummaryMethod({
|
|
164
|
-
targetColumn: 'total_value_column'
|
|
165
|
-
})));
|
|
166
|
-
};
|
|
167
|
-
export default DataSettings;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import React, { useCallback } from 'react';
|
|
3
|
-
import { BarDataSettings } from '../bar-settings';
|
|
4
|
-
import { AdvanceBarDataSettings } from '../advance-bar-settings';
|
|
5
|
-
import { StatisticsUtils } from '../../../utils';
|
|
6
|
-
import { BAR_MAP_TO_HORIZONTAL_MAP, STATISTIC_TYPE } from '../../../constants/';
|
|
7
|
-
var DataSettings = function DataSettings(_ref) {
|
|
8
|
-
var statistic = _ref.statistic,
|
|
9
|
-
tables = _ref.tables,
|
|
10
|
-
oldOnChange = _ref.onChange;
|
|
11
|
-
var onChange = useCallback(function (update) {
|
|
12
|
-
var oldConfig = statistic.config;
|
|
13
|
-
if (update.type && update.type !== oldConfig.type) {
|
|
14
|
-
oldOnChange && oldOnChange(update);
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
var updateConfig = {};
|
|
18
|
-
var newConfig = _objectSpread(_objectSpread({}, oldConfig), update);
|
|
19
|
-
Object.keys(newConfig).forEach(function (key) {
|
|
20
|
-
if (BAR_MAP_TO_HORIZONTAL_MAP[key]) {
|
|
21
|
-
updateConfig[BAR_MAP_TO_HORIZONTAL_MAP[key]] = newConfig[key];
|
|
22
|
-
} else {
|
|
23
|
-
updateConfig[key] = newConfig[key];
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
oldOnChange && oldOnChange(updateConfig);
|
|
27
|
-
}, [statistic, oldOnChange]);
|
|
28
|
-
var config = statistic.config,
|
|
29
|
-
id = statistic.id;
|
|
30
|
-
var newConfig = StatisticsUtils.convertStatisticConfig(config);
|
|
31
|
-
var newStatistic = {
|
|
32
|
-
id: id,
|
|
33
|
-
config: newConfig
|
|
34
|
-
};
|
|
35
|
-
var type = config.type;
|
|
36
|
-
var BarGroupComponent = type === STATISTIC_TYPE.HORIZONTAL_BAR ? BarDataSettings : AdvanceBarDataSettings;
|
|
37
|
-
return /*#__PURE__*/React.createElement(BarGroupComponent, {
|
|
38
|
-
xLabel: 'Vertical_axis',
|
|
39
|
-
yLabel: 'Horizontal_axis',
|
|
40
|
-
statistic: newStatistic,
|
|
41
|
-
tables: tables,
|
|
42
|
-
onChange: onChange
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
export default DataSettings;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import React, { useCallback } from 'react';
|
|
3
|
-
import { AdvanceBarStyleSettings } from '../advance-bar-settings';
|
|
4
|
-
import { BarStyleSettings } from '../bar-settings';
|
|
5
|
-
import { StatisticsUtils } from '../../../utils';
|
|
6
|
-
import { BAR_MAP_TO_HORIZONTAL_MAP, STATISTIC_TYPE } from '../../../constants';
|
|
7
|
-
var StyleSettings = function StyleSettings(_ref) {
|
|
8
|
-
var statistic = _ref.statistic,
|
|
9
|
-
oldOnChange = _ref.onChange;
|
|
10
|
-
var onChange = useCallback(function (update) {
|
|
11
|
-
var updateConfig = {};
|
|
12
|
-
var newConfig = _objectSpread(_objectSpread({}, statistic.config), update);
|
|
13
|
-
Object.keys(newConfig).forEach(function (key) {
|
|
14
|
-
if (BAR_MAP_TO_HORIZONTAL_MAP[key]) {
|
|
15
|
-
updateConfig[BAR_MAP_TO_HORIZONTAL_MAP[key]] = newConfig[key];
|
|
16
|
-
} else {
|
|
17
|
-
updateConfig[key] = newConfig[key];
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
oldOnChange && oldOnChange(updateConfig);
|
|
21
|
-
}, [statistic, oldOnChange]);
|
|
22
|
-
var config = statistic.config,
|
|
23
|
-
id = statistic.id;
|
|
24
|
-
var newConfig = StatisticsUtils.convertStatisticConfig(config);
|
|
25
|
-
var newStatistic = {
|
|
26
|
-
id: id,
|
|
27
|
-
config: newConfig
|
|
28
|
-
};
|
|
29
|
-
var type = config.type;
|
|
30
|
-
var BarStyleComponent = type === STATISTIC_TYPE.HORIZONTAL_BAR ? BarStyleSettings : AdvanceBarStyleSettings;
|
|
31
|
-
return /*#__PURE__*/React.createElement(BarStyleComponent, {
|
|
32
|
-
xLabel: 'Vertical_axis',
|
|
33
|
-
yLabel: 'Horizontal_axis',
|
|
34
|
-
statistic: newStatistic,
|
|
35
|
-
onChange: onChange
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
export default StyleSettings;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
.seastatistic-settings {
|
|
2
|
-
height: 100%;
|
|
3
|
-
width: 100%;
|
|
4
|
-
padding: 0;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.seastatistic-settings .seastatistic-settings-type {
|
|
9
|
-
height: 49px;
|
|
10
|
-
width: 100%;
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
flex-direction: row;
|
|
14
|
-
border-bottom: 1px solid #e4e4e4;
|
|
15
|
-
background: #fff;
|
|
16
|
-
padding-left: 10px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.seastatistic-settings .seastatistic-settings-type .seastatistic-settings-type-item {
|
|
20
|
-
text-align: center;
|
|
21
|
-
line-height: 48px;
|
|
22
|
-
height: 48px;
|
|
23
|
-
font-weight: 500;
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.seastatistic-settings .seastatistic-settings-type .seastatistic-settings-type-item.selected {
|
|
28
|
-
color: #ff8000;
|
|
29
|
-
border-bottom: 2px solid #ff8000;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.seastatistic-settings .statistic-settings-container {
|
|
33
|
-
height: calc(100% - 37px);
|
|
34
|
-
overflow-y: scroll;
|
|
35
|
-
padding: 16px 16px 150px;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.seastatistic-settings .statistics-add-number-columns {
|
|
39
|
-
color: #bbb;
|
|
40
|
-
line-height: 1;
|
|
41
|
-
margin-bottom: 10px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.seastatistic-settings .statistics-add-number-columns:hover {
|
|
45
|
-
cursor: pointer;
|
|
46
|
-
color: #212529;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.seastatistic-settings .statistics-add-number-columns .dtable-icon-add-table {
|
|
50
|
-
margin-right: 5px;
|
|
51
|
-
display: inline-block;
|
|
52
|
-
transform: scale(.8);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.seastatistic-settings .statistics-add-number-columns .add-number-column-description {
|
|
56
|
-
font-size: 14px;
|
|
57
|
-
line-height: 14px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.seastatistic-settings .delete-numeric-summary-item-content {
|
|
61
|
-
height: 20px;
|
|
62
|
-
width: 20px;
|
|
63
|
-
line-height: 20px;
|
|
64
|
-
font-weight: 400;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.seastatistic-settings .delete-numeric-summary-item-content:hover {
|
|
68
|
-
cursor: pointer;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.seastatistic-settings .delete-numeric-summary-item-content .delete-icon {
|
|
72
|
-
font-size: 14px;
|
|
73
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import React, { useCallback, useState } from 'react';
|
|
4
|
-
import classnames from 'classnames';
|
|
5
|
-
import { eventStopPropagation } from '../../utils';
|
|
6
|
-
import DataSettings from './data-settings';
|
|
7
|
-
import StyleSettings from './style-settings';
|
|
8
|
-
import { STATISTIC_SETTINGS_TYPE } from '../../constants';
|
|
9
|
-
import intl from '../../intl';
|
|
10
|
-
import './index.css';
|
|
11
|
-
var Settings = function Settings(_ref) {
|
|
12
|
-
var statistic = _ref.statistic,
|
|
13
|
-
tables = _ref.tables,
|
|
14
|
-
onChange = _ref.onChange,
|
|
15
|
-
FilterSettings = _ref.FilterSettings,
|
|
16
|
-
CustomStyleSettings = _ref.CustomStyleSettings;
|
|
17
|
-
var _useState = useState(STATISTIC_SETTINGS_TYPE.DATA),
|
|
18
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
-
type = _useState2[0],
|
|
20
|
-
setType = _useState2[1];
|
|
21
|
-
var onChartSettingsTypeChange = useCallback(function (event) {
|
|
22
|
-
eventStopPropagation(event);
|
|
23
|
-
var newType = event.target.getAttribute('data');
|
|
24
|
-
if (type === newType) return;
|
|
25
|
-
setType(newType);
|
|
26
|
-
}, [type]);
|
|
27
|
-
var modifyStatistic = useCallback(function (update) {
|
|
28
|
-
var newStatistic = _objectSpread(_objectSpread({}, statistic), {}, {
|
|
29
|
-
config: _objectSpread(_objectSpread({}, statistic.config), update)
|
|
30
|
-
});
|
|
31
|
-
onChange && onChange(newStatistic, STATISTIC_SETTINGS_TYPE.DATA);
|
|
32
|
-
}, [statistic, onChange]);
|
|
33
|
-
var modifyStyle = useCallback(function (update) {
|
|
34
|
-
var newStatistic = _objectSpread(_objectSpread({}, statistic), update);
|
|
35
|
-
onChange && onChange(newStatistic, STATISTIC_SETTINGS_TYPE.STYLE);
|
|
36
|
-
}, [statistic, onChange]);
|
|
37
|
-
var renderStyleSettings = useCallback(function () {
|
|
38
|
-
if (CustomStyleSettings) return /*#__PURE__*/React.createElement(CustomStyleSettings, {
|
|
39
|
-
statistic: statistic,
|
|
40
|
-
onChange: modifyStyle
|
|
41
|
-
});
|
|
42
|
-
return /*#__PURE__*/React.createElement(StyleSettings, {
|
|
43
|
-
statistic: statistic,
|
|
44
|
-
onChange: modifyStyle
|
|
45
|
-
});
|
|
46
|
-
}, [CustomStyleSettings, statistic, modifyStyle]);
|
|
47
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
className: "seastatistic-settings"
|
|
49
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
50
|
-
className: "seastatistic-settings-type",
|
|
51
|
-
onClick: onChartSettingsTypeChange
|
|
52
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
53
|
-
className: classnames('seastatistic-settings-type-item', {
|
|
54
|
-
'selected': type === STATISTIC_SETTINGS_TYPE.DATA
|
|
55
|
-
}),
|
|
56
|
-
data: STATISTIC_SETTINGS_TYPE.DATA
|
|
57
|
-
}, intl.get('Data_settings')), /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: classnames('seastatistic-settings-type-item ml-4', {
|
|
59
|
-
'selected': type === STATISTIC_SETTINGS_TYPE.STYLE
|
|
60
|
-
}),
|
|
61
|
-
data: STATISTIC_SETTINGS_TYPE.STYLE
|
|
62
|
-
}, intl.get('Style_settings'))), /*#__PURE__*/React.createElement("div", {
|
|
63
|
-
className: "statistic-settings-container position-relative"
|
|
64
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
65
|
-
className: "statistic-settings-content"
|
|
66
|
-
}, type === STATISTIC_SETTINGS_TYPE.DATA && /*#__PURE__*/React.createElement(DataSettings, {
|
|
67
|
-
statistic: statistic,
|
|
68
|
-
tables: tables,
|
|
69
|
-
FilterSettings: FilterSettings,
|
|
70
|
-
onChange: modifyStatistic
|
|
71
|
-
}), type === STATISTIC_SETTINGS_TYPE.STYLE && renderStyleSettings())));
|
|
72
|
-
};
|
|
73
|
-
export default Settings;
|
|
74
|
-
export { StyleSettings };
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import React, { useCallback } from 'react';
|
|
3
|
-
import { STATISTIC_TYPE, SUPPORT_TITLE_CHART_TYPES } from '../../constants';
|
|
4
|
-
import { BarStyleSettings } from './bar-settings';
|
|
5
|
-
import { AdvanceBarStyleSettings } from './advance-bar-settings';
|
|
6
|
-
import { TimeComparisonStyleSettings } from './time-comparison-settings';
|
|
7
|
-
import { PieStyleSettings } from './pie-settings';
|
|
8
|
-
import Divider from './widgets/divider';
|
|
9
|
-
import { HorizontalStyleSettings } from './horizontal-bar-settings';
|
|
10
|
-
import { BasicNumberCardStyleSettings } from './basic-number-card';
|
|
11
|
-
import { CombinationStyleSettings } from './combination-settings';
|
|
12
|
-
import StatisticTitleSetting from './widgets/title-settings';
|
|
13
|
-
var StyleSettings = function StyleSettings(_ref) {
|
|
14
|
-
var statistic = _ref.statistic,
|
|
15
|
-
onChange = _ref.onChange;
|
|
16
|
-
var modifyStatisticSettings = useCallback(function (update) {
|
|
17
|
-
var newUpdate = _objectSpread(_objectSpread({}, statistic.config), update);
|
|
18
|
-
onChange({
|
|
19
|
-
config: newUpdate
|
|
20
|
-
});
|
|
21
|
-
}, [statistic, onChange]);
|
|
22
|
-
var modifyCommonSettings = useCallback(function (update) {
|
|
23
|
-
var newUpdate = _objectSpread(_objectSpread({}, statistic.style_config), update);
|
|
24
|
-
onChange({
|
|
25
|
-
style_config: newUpdate
|
|
26
|
-
});
|
|
27
|
-
}, [statistic, onChange]);
|
|
28
|
-
var modifyTitle = useCallback(function (title) {
|
|
29
|
-
var style_config = statistic.style_config;
|
|
30
|
-
var update = style_config ? _objectSpread(_objectSpread({}, style_config), {}, {
|
|
31
|
-
title: title
|
|
32
|
-
}) : {
|
|
33
|
-
title: title
|
|
34
|
-
};
|
|
35
|
-
onChange({
|
|
36
|
-
style_config: update
|
|
37
|
-
});
|
|
38
|
-
}, [statistic, onChange]);
|
|
39
|
-
var renderTitleSettings = useCallback(function () {
|
|
40
|
-
var type = statistic.config.type;
|
|
41
|
-
var style_config = statistic.style_config;
|
|
42
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, SUPPORT_TITLE_CHART_TYPES.includes(type) && /*#__PURE__*/React.createElement(StatisticTitleSetting, {
|
|
43
|
-
key: "title-setting-".concat(statistic.id),
|
|
44
|
-
title: style_config && style_config.title,
|
|
45
|
-
modifyTitle: modifyTitle
|
|
46
|
-
}), type !== STATISTIC_TYPE.TREE_MAP && type !== STATISTIC_TYPE.TABLE && /*#__PURE__*/React.createElement(Divider, null));
|
|
47
|
-
}, [statistic, modifyTitle]);
|
|
48
|
-
var renderStatisticStyleSettings = useCallback(function () {
|
|
49
|
-
var config = statistic.config;
|
|
50
|
-
var type = config.type;
|
|
51
|
-
var props = {
|
|
52
|
-
statistic: statistic,
|
|
53
|
-
onChange: modifyStatisticSettings
|
|
54
|
-
};
|
|
55
|
-
switch (type) {
|
|
56
|
-
case STATISTIC_TYPE.BAR:
|
|
57
|
-
case STATISTIC_TYPE.LINE:
|
|
58
|
-
case STATISTIC_TYPE.AREA:
|
|
59
|
-
{
|
|
60
|
-
return /*#__PURE__*/React.createElement(BarStyleSettings, props);
|
|
61
|
-
}
|
|
62
|
-
case STATISTIC_TYPE.HORIZONTAL_BAR:
|
|
63
|
-
case STATISTIC_TYPE.HORIZONTAL_GROUP_BAR:
|
|
64
|
-
{
|
|
65
|
-
return /*#__PURE__*/React.createElement(HorizontalStyleSettings, props);
|
|
66
|
-
}
|
|
67
|
-
case STATISTIC_TYPE.BAR_GROUP:
|
|
68
|
-
case STATISTIC_TYPE.BAR_STACK:
|
|
69
|
-
case STATISTIC_TYPE.LINE_GROUP:
|
|
70
|
-
case STATISTIC_TYPE.AREA_GROUP:
|
|
71
|
-
{
|
|
72
|
-
return /*#__PURE__*/React.createElement(AdvanceBarStyleSettings, props);
|
|
73
|
-
}
|
|
74
|
-
case STATISTIC_TYPE.COMPARE_BAR:
|
|
75
|
-
{
|
|
76
|
-
return /*#__PURE__*/React.createElement(TimeComparisonStyleSettings, props);
|
|
77
|
-
}
|
|
78
|
-
case STATISTIC_TYPE.COMBINATION:
|
|
79
|
-
{
|
|
80
|
-
return /*#__PURE__*/React.createElement(CombinationStyleSettings, props);
|
|
81
|
-
}
|
|
82
|
-
case STATISTIC_TYPE.PIE:
|
|
83
|
-
case STATISTIC_TYPE.RING:
|
|
84
|
-
{
|
|
85
|
-
return /*#__PURE__*/React.createElement(PieStyleSettings, props);
|
|
86
|
-
}
|
|
87
|
-
case STATISTIC_TYPE.BASIC_NUMBER_CARD:
|
|
88
|
-
case STATISTIC_TYPE.DASHBOARD:
|
|
89
|
-
{
|
|
90
|
-
return /*#__PURE__*/React.createElement(BasicNumberCardStyleSettings, props);
|
|
91
|
-
}
|
|
92
|
-
default:
|
|
93
|
-
{
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}, [statistic, modifyStatisticSettings]);
|
|
98
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, renderTitleSettings(), renderStatisticStyleSettings());
|
|
99
|
-
};
|
|
100
|
-
export default StyleSettings;
|