sea-chart 2.0.36 → 2.0.38
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/dist/api/index.js +8 -15
- package/dist/components/cell-factory/FormatterConfig.js +55 -62
- package/dist/components/cell-factory/SimpleCellFormatter.js +5 -12
- package/dist/components/cell-factory/SingleSelectOption.js +11 -18
- package/dist/components/cell-factory/cell-editor-factory.js +5 -12
- package/dist/components/cell-factory/cell-formatter-factory.js +4 -11
- package/dist/components/cell-factory/link-content.js +30 -38
- package/dist/components/chart-color-selector/color-selector.js +11 -18
- package/dist/components/collaborator/index.js +7 -14
- package/dist/components/color-picker/index.js +12 -19
- package/dist/components/color-popover/color-rules/color-rule.js +26 -34
- package/dist/components/color-popover/color-rules/index.js +7 -15
- package/dist/components/color-popover/color-rules/rule-filters/filter.js +27 -34
- package/dist/components/color-popover/color-rules/rule-filters/index.js +17 -25
- package/dist/components/color-popover/color-rules/rule-filters/number-input.js +9 -17
- package/dist/components/color-popover/color-rules-popover.js +30 -38
- package/dist/components/color-popover/color-selector-popover.js +12 -20
- package/dist/components/color-setting/color-group-selector.js +13 -21
- package/dist/components/common-add-tool/index.js +8 -15
- package/dist/components/data-process-setter/data-setting-header.js +7 -14
- package/dist/components/data-process-setter/hide-column-setter.js +13 -20
- package/dist/components/data-process-setter/index.js +4 -27
- package/dist/components/data-process-setter/sort-setter.js +18 -26
- package/dist/components/draggable/Draggable.js +7 -13
- package/dist/components/drill-down-settings/drill-down-fields-popover/index.js +40 -48
- package/dist/components/drill-down-settings/drill-down-fields-settings/index.js +10 -18
- package/dist/components/drill-down-settings/index.js +11 -18
- package/dist/components/dtable-popover/index.js +13 -20
- package/dist/components/dtable-search-input/index.js +13 -21
- package/dist/components/font-settings/index.js +14 -22
- package/dist/components/goal-line-setting/goal-setting-item.js +6 -14
- package/dist/components/goal-line-setting/index.js +12 -19
- package/dist/components/highlighter/highlighter.js +7 -14
- package/dist/components/icon/index.js +5 -12
- package/dist/components/index.js +7 -48
- package/dist/components/loading/index.js +6 -13
- package/dist/components/number-input/index.js +4 -11
- package/dist/components/pixel-editor/index.js +15 -23
- package/dist/components/popover/hide-column-popover/hide-column-popover-widgets/hide-column-item.js +8 -15
- package/dist/components/popover/hide-column-popover/hide-column-popover.js +26 -34
- package/dist/components/popover/sort-popover/sort-popover-widgets/sort-utils.js +9 -18
- package/dist/components/popover/sort-popover/sort-popover.js +55 -65
- package/dist/components/resize-handle/ResizeHandle.js +6 -13
- package/dist/components/row-card/row-card-header-cell.js +17 -24
- package/dist/components/row-card/row-card-header.js +15 -22
- package/dist/components/row-card/row-card-item.js +35 -43
- package/dist/components/row-card/row-card.js +17 -25
- package/dist/components/statistic-record-dialog/index.js +56 -64
- package/dist/components/tooltip/index.js +14 -21
- package/dist/components/types-dialog/index.js +62 -70
- package/dist/components/types-dialog/use-force-update.js +4 -10
- package/dist/constants/color-rules.js +8 -14
- package/dist/constants/common-constants.js +8 -14
- package/dist/constants/error.js +2 -8
- package/dist/constants/geolocation.js +9 -15
- package/dist/constants/index.js +142 -271
- package/dist/constants/key-codes.js +0 -2
- package/dist/constants/model.js +3 -9
- package/dist/constants/regions.js +3 -8
- package/dist/constants/style.js +6 -12
- package/dist/constants/table.js +1 -7
- package/dist/constants/type-image.js +33 -39
- package/dist/constants/type.js +3 -9
- package/dist/context.js +13 -20
- package/dist/editor/index.js +8 -15
- package/dist/index.js +13 -104
- package/dist/intl.js +10 -17
- package/dist/locale/index.js +16 -23
- package/dist/locale/lang/de.js +1 -7
- package/dist/locale/lang/en.js +1 -7
- package/dist/locale/lang/es.js +1 -7
- package/dist/locale/lang/fr.js +1 -7
- package/dist/locale/lang/pt.js +1 -7
- package/dist/locale/lang/ru.js +1 -7
- package/dist/locale/lang/zh_CN.js +1 -7
- package/dist/model/area-group.js +12 -19
- package/dist/model/area.js +12 -19
- package/dist/model/bar-custom.js +11 -18
- package/dist/model/bar-group.js +12 -19
- package/dist/model/bar-stack.js +10 -17
- package/dist/model/bar.js +11 -18
- package/dist/model/base-model.js +4 -11
- package/dist/model/basic-number-card.js +13 -20
- package/dist/model/chart.js +7 -13
- package/dist/model/combination.js +15 -22
- package/dist/model/compare-bar.js +14 -21
- package/dist/model/completeness-group.js +11 -18
- package/dist/model/completeness.js +10 -17
- package/dist/model/dashboard.js +7 -14
- package/dist/model/funnel.js +14 -21
- package/dist/model/generic-model.js +135 -143
- package/dist/model/heat-map.js +9 -16
- package/dist/model/horizontal-bar.js +11 -18
- package/dist/model/horizontal-group-bar.js +10 -17
- package/dist/model/index.js +69 -93
- package/dist/model/line-group.js +13 -20
- package/dist/model/line.js +12 -19
- package/dist/model/map-bubble.js +12 -19
- package/dist/model/map.js +12 -19
- package/dist/model/mirror.js +13 -20
- package/dist/model/pie.js +12 -19
- package/dist/model/ring.js +12 -19
- package/dist/model/scatter.js +10 -17
- package/dist/model/stacked-horizontal-bar.js +11 -18
- package/dist/model/table-element.js +5 -12
- package/dist/model/table.js +7 -14
- package/dist/model/tree-map.js +7 -14
- package/dist/model/trend.js +11 -18
- package/dist/model/user.js +1 -7
- package/dist/model/world-map-bubble.js +12 -19
- package/dist/model/world-map.js +12 -19
- package/dist/services/map-json.js +11 -17
- package/dist/settings/advance-bar-settings/data-settings.js +36 -44
- package/dist/settings/advance-bar-settings/index.js +3 -20
- package/dist/settings/advance-bar-settings/style-settings.js +63 -71
- package/dist/settings/bar-settings/data-settings.js +39 -47
- package/dist/settings/bar-settings/index.js +3 -20
- package/dist/settings/bar-settings/style-settings.js +49 -57
- package/dist/settings/basic-number-card/data-settings.js +49 -57
- package/dist/settings/basic-number-card/index.js +3 -20
- package/dist/settings/basic-number-card/style-settings.js +19 -27
- package/dist/settings/combination-settings/data-settings.js +55 -63
- package/dist/settings/combination-settings/index.js +3 -20
- package/dist/settings/combination-settings/style-settings.js +65 -73
- package/dist/settings/completeness-settings/callbacks/callbacks.js +16 -27
- package/dist/settings/completeness-settings/data-settings/completion-settings.js +21 -28
- package/dist/settings/completeness-settings/data-settings/data-settings.js +25 -32
- package/dist/settings/completeness-settings/index.js +3 -20
- package/dist/settings/completeness-settings/style-settings.js +19 -26
- package/dist/settings/dashboard-settings/data-settings.js +43 -51
- package/dist/settings/dashboard-settings/index.js +2 -13
- package/dist/settings/data-settings.js +72 -79
- package/dist/settings/funnel-settings/components/dnd-item/dnd-item.js +12 -19
- package/dist/settings/funnel-settings/components/dnd-list.js +15 -23
- package/dist/settings/funnel-settings/components/funnel-label-setting.js +32 -40
- package/dist/settings/funnel-settings/components/funnel-layer-setting.js +20 -28
- package/dist/settings/funnel-settings/data-settings.js +23 -31
- package/dist/settings/funnel-settings/index.js +3 -20
- package/dist/settings/funnel-settings/style-settings.js +11 -19
- package/dist/settings/heat-map-settings/data-settings.js +18 -26
- package/dist/settings/heat-map-settings/index.js +3 -20
- package/dist/settings/heat-map-settings/style-settings.js +18 -26
- package/dist/settings/horizontal-bar-settings/data-settings.js +12 -19
- package/dist/settings/horizontal-bar-settings/index.js +3 -20
- package/dist/settings/horizontal-bar-settings/style-settings.js +12 -19
- package/dist/settings/index.js +52 -70
- package/dist/settings/map-settings/components/location-field-selector.js +10 -17
- package/dist/settings/map-settings/components/map-level-selector.js +11 -18
- package/dist/settings/map-settings/components/map-province-city-selector.js +19 -26
- package/dist/settings/map-settings/index.js +3 -20
- package/dist/settings/map-settings/map-data-settings.js +23 -30
- package/dist/settings/map-settings/map-style-settings.js +27 -35
- package/dist/settings/mirror-settings/data-settings.js +26 -34
- package/dist/settings/mirror-settings/index.js +2 -13
- package/dist/settings/pie-settings/data-settings.js +33 -41
- package/dist/settings/pie-settings/index.js +3 -20
- package/dist/settings/pie-settings/style-settings.js +47 -55
- package/dist/settings/scatter/data-settings.js +27 -34
- package/dist/settings/scatter/index.js +3 -12
- package/dist/settings/stacks-settings/index.js +19 -27
- package/dist/settings/stacks-settings/stack-item-settings.js +19 -27
- package/dist/settings/style-settings.js +65 -73
- package/dist/settings/table-element-settings/components/data-filter.js +30 -38
- package/dist/settings/table-element-settings/data-settings.js +21 -29
- package/dist/settings/table-element-settings/index.js +2 -13
- package/dist/settings/table-settings/data-settings.js +112 -120
- package/dist/settings/table-settings/index.js +2 -13
- package/dist/settings/time-comparison-settings/data-settings.js +43 -51
- package/dist/settings/time-comparison-settings/index.js +3 -20
- package/dist/settings/time-comparison-settings/style-settings.js +42 -50
- package/dist/settings/trend-settings/data-settings.js +24 -32
- package/dist/settings/trend-settings/index.js +3 -20
- package/dist/settings/trend-settings/style-setting.js +19 -27
- package/dist/settings/widgets/basic-summary/index.js +55 -63
- package/dist/settings/widgets/chart-type/index.js +18 -26
- package/dist/settings/widgets/color-settings/index.js +72 -80
- package/dist/settings/widgets/common-data-settings.js +21 -29
- package/dist/settings/widgets/data-filter/index.js +35 -43
- package/dist/settings/widgets/data-sort.js +16 -24
- package/dist/settings/widgets/date-summary-item.js +26 -34
- package/dist/settings/widgets/display-values-settings/index.js +14 -22
- package/dist/settings/widgets/divider/index.js +8 -16
- package/dist/settings/widgets/font-settings/font-color-settings.js +11 -19
- package/dist/settings/widgets/font-settings/font-size-settings.js +14 -22
- package/dist/settings/widgets/font-settings/font-weight-settings.js +17 -25
- package/dist/settings/widgets/font-settings/index.js +4 -27
- package/dist/settings/widgets/group-by.js +51 -59
- package/dist/settings/widgets/min-max-setting.js +10 -18
- package/dist/settings/widgets/mininum-slice-percent.js +10 -18
- package/dist/settings/widgets/numeric-summary-item.js +25 -33
- package/dist/settings/widgets/select-line-type/index.js +10 -17
- package/dist/settings/widgets/select-table/index.js +9 -16
- package/dist/settings/widgets/select-view/index.js +20 -28
- package/dist/settings/widgets/stack.js +14 -22
- package/dist/settings/widgets/summary-method-setting.js +17 -25
- package/dist/settings/widgets/summary-settings.js +74 -82
- package/dist/settings/widgets/switch/index.js +9 -16
- package/dist/settings/widgets/text-horizontal-settings.js +15 -23
- package/dist/settings/widgets/time-picker.js +29 -37
- package/dist/settings/widgets/title-settings/index.js +29 -37
- package/dist/settings/widgets/title-settings/title-text.js +5 -12
- package/dist/settings/widgets/x-axios.js +0 -1
- package/dist/settings/widgets/y-axis-group-settings.js +64 -72
- package/dist/utils/cell-format-utils.js +17 -27
- package/dist/utils/cell-value-utils.js +4 -11
- package/dist/utils/chart-utils/base-utils.js +324 -332
- package/dist/utils/chart-utils/index.js +28 -41
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +77 -84
- package/dist/utils/chart-utils/original-data-utils/card-calculator.js +13 -20
- package/dist/utils/chart-utils/original-data-utils/combination-calculator.js +45 -52
- package/dist/utils/chart-utils/original-data-utils/compare-bar-chart-calculator.js +21 -28
- package/dist/utils/chart-utils/original-data-utils/completeness-calculator.js +33 -40
- package/dist/utils/chart-utils/original-data-utils/dashboard-calculator.js +16 -23
- package/dist/utils/chart-utils/original-data-utils/index.js +50 -57
- package/dist/utils/chart-utils/original-data-utils/mirror-calculator.js +19 -26
- package/dist/utils/chart-utils/original-data-utils/pivot-table-calculator.js +90 -96
- package/dist/utils/chart-utils/original-data-utils/scatter-calculator.js +19 -26
- package/dist/utils/chart-utils/original-data-utils/trend-calculator.js +31 -38
- package/dist/utils/chart-utils/sql-statistics-utils.js +229 -237
- package/dist/utils/chart.js +9 -17
- package/dist/utils/collaborator-manager.js +3 -9
- package/dist/utils/collaborator-utils.js +19 -31
- package/dist/utils/collaborator.js +6 -15
- package/dist/utils/color-utils.js +18 -29
- package/dist/utils/column-utils.js +77 -104
- package/dist/utils/common-utils.js +28 -53
- package/dist/utils/concurrency-manager.js +1 -7
- package/dist/utils/contexts.js +5 -12
- package/dist/utils/date-translate.js +12 -20
- package/dist/utils/digital-sign-utils.js +7 -14
- package/dist/utils/event-bus.js +1 -7
- package/dist/utils/hotkey.js +5 -11
- package/dist/utils/index.js +54 -221
- package/dist/utils/key-generator.js +2 -9
- package/dist/utils/map.js +22 -31
- package/dist/utils/object-utils.js +2 -8
- package/dist/utils/options-utils.js +10 -18
- package/dist/utils/row-record-utils.js +166 -178
- package/dist/utils/row-utils.js +27 -38
- package/dist/utils/search.js +24 -32
- package/dist/utils/sql/chart-data-sql.js +106 -112
- package/dist/utils/sql/column-2-sql-column.js +158 -168
- package/dist/utils/sql/index.js +3 -27
- package/dist/utils/trend-utils.js +39 -47
- package/dist/view/index.js +90 -96
- package/dist/view/title/index.js +16 -24
- package/dist/view/wrapper/area-group.js +45 -53
- package/dist/view/wrapper/area.js +43 -51
- package/dist/view/wrapper/bar-compare.js +38 -46
- package/dist/view/wrapper/bar-custom-stack.js +39 -47
- package/dist/view/wrapper/bar-group.js +45 -53
- package/dist/view/wrapper/bar-stack.js +48 -56
- package/dist/view/wrapper/bar.js +40 -48
- package/dist/view/wrapper/basic-number-card.js +26 -34
- package/dist/view/wrapper/chart-component.js +123 -131
- package/dist/view/wrapper/combination.js +55 -63
- package/dist/view/wrapper/completeness-group.js +40 -48
- package/dist/view/wrapper/completeness.js +36 -44
- package/dist/view/wrapper/dashboard.js +39 -44
- package/dist/view/wrapper/funnel.js +40 -43
- package/dist/view/wrapper/heat-map.js +62 -70
- package/dist/view/wrapper/horizontal-bar-group.js +52 -60
- package/dist/view/wrapper/horizontal-bar-stack.js +47 -55
- package/dist/view/wrapper/horizontal-bar.js +41 -49
- package/dist/view/wrapper/index.js +107 -115
- package/dist/view/wrapper/line-group.js +43 -51
- package/dist/view/wrapper/line.js +42 -50
- package/dist/view/wrapper/map-bubble.js +40 -48
- package/dist/view/wrapper/map-world-bubble.js +39 -47
- package/dist/view/wrapper/map-world.js +41 -49
- package/dist/view/wrapper/map.js +42 -50
- package/dist/view/wrapper/mirror.js +41 -49
- package/dist/view/wrapper/pie.js +44 -52
- package/dist/view/wrapper/ring.js +49 -57
- package/dist/view/wrapper/scatter.js +42 -50
- package/dist/view/wrapper/table/index.js +14 -22
- package/dist/view/wrapper/table/one-dimension-table-no-numeric-columns.js +49 -57
- package/dist/view/wrapper/table/one-dimension-table-with-numeric-columns.js +53 -61
- package/dist/view/wrapper/table/pivot-table-display-name.js +82 -90
- package/dist/view/wrapper/table/two-dimension-table.js +85 -93
- package/dist/view/wrapper/table-element/components/dataset-utils.js +23 -36
- package/dist/view/wrapper/table-element/components/formatter.js +90 -99
- package/dist/view/wrapper/table-element/components/formatters/FileFormatter/index.js +23 -32
- package/dist/view/wrapper/table-element/components/formatters/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/formatters/link-formatter.js +90 -97
- package/dist/view/wrapper/table-element/components/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/link-formatter.js +90 -97
- package/dist/view/wrapper/table-element/components/record.js +13 -20
- package/dist/view/wrapper/table-element/components/records-body.js +9 -17
- package/dist/view/wrapper/table-element/components/records-header/index.js +7 -15
- package/dist/view/wrapper/table-element/components/records-header/records-header-cell.js +8 -16
- package/dist/view/wrapper/table-element/components/records.js +25 -33
- package/dist/view/wrapper/table-element/components/resize-column-handle/resize-column-handle.js +5 -12
- package/dist/view/wrapper/table-element/components/utils.js +6 -16
- package/dist/view/wrapper/table-element/components/value-display-utils.js +4 -11
- package/dist/view/wrapper/table-element/components/vertical-scrollbar/index.js +6 -13
- package/dist/view/wrapper/table-element/index.js +18 -26
- package/dist/view/wrapper/treemap.js +38 -46
- package/dist/view/wrapper/trend.js +58 -66
- package/package.json +5 -5
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _dtableUtils = require("dtable-utils");
|
|
12
|
-
var _commonDataSettings = _interopRequireDefault(require("../widgets/common-data-settings"));
|
|
13
|
-
var _divider = _interopRequireDefault(require("../widgets/divider"));
|
|
14
|
-
var _groupBy = _interopRequireDefault(require("../widgets/group-by"));
|
|
15
|
-
var _basicSummary = _interopRequireDefault(require("../widgets/basic-summary"));
|
|
16
|
-
var _dataSort = _interopRequireDefault(require("../widgets/data-sort"));
|
|
17
|
-
var _constants = require("../../constants");
|
|
18
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
1
|
+
import _DTableSwitch from "dtable-ui-component/lib/DTableSwitch";
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
import { CellType, DATE_COLUMN_OPTIONS } from 'dtable-utils';
|
|
4
|
+
import CommonDataSettings from '../widgets/common-data-settings';
|
|
5
|
+
import Divider from '../widgets/divider';
|
|
6
|
+
import GroupBy from '../widgets/group-by';
|
|
7
|
+
import BasicSummary from '../widgets/basic-summary';
|
|
8
|
+
import DataSort from '../widgets/data-sort';
|
|
9
|
+
import { CHART_SUMMARY_TYPE, GEOLOCATION_FORMAT_CITY, GEOLOCATION_FORMAT_MAP } from '../../constants';
|
|
10
|
+
import intl from '../../intl';
|
|
19
11
|
const DataSettings = _ref => {
|
|
20
12
|
let {
|
|
21
13
|
chart,
|
|
@@ -23,7 +15,7 @@ const DataSettings = _ref => {
|
|
|
23
15
|
tables,
|
|
24
16
|
onChange
|
|
25
17
|
} = _ref;
|
|
26
|
-
const onGroupByChange =
|
|
18
|
+
const onGroupByChange = useCallback(column => {
|
|
27
19
|
const {
|
|
28
20
|
config
|
|
29
21
|
} = chart;
|
|
@@ -43,18 +35,18 @@ const DataSettings = _ref => {
|
|
|
43
35
|
update['groupby_date_granularity'] = null;
|
|
44
36
|
update['groupby_geolocation_granularity'] = null;
|
|
45
37
|
} else {
|
|
46
|
-
if (
|
|
47
|
-
update['groupby_date_granularity'] =
|
|
38
|
+
if (DATE_COLUMN_OPTIONS.includes(type)) {
|
|
39
|
+
update['groupby_date_granularity'] = CHART_SUMMARY_TYPE.MONTH;
|
|
48
40
|
update['groupby_geolocation_granularity'] = null;
|
|
49
|
-
} else if (type ===
|
|
41
|
+
} else if (type === CellType.GEOLOCATION) {
|
|
50
42
|
const {
|
|
51
43
|
geo_format
|
|
52
44
|
} = column.data || {};
|
|
53
|
-
if (geo_format ===
|
|
54
|
-
update['groupby_geolocation_granularity'] =
|
|
55
|
-
} else if (geo_format ===
|
|
56
|
-
update['groupby_geolocation_granularity'] =
|
|
57
|
-
} else if (geo_format ===
|
|
45
|
+
if (geo_format === GEOLOCATION_FORMAT_MAP.PROVINCE) {
|
|
46
|
+
update['groupby_geolocation_granularity'] = GEOLOCATION_FORMAT_MAP.PROVINCE;
|
|
47
|
+
} else if (geo_format === GEOLOCATION_FORMAT_MAP.PROVINCE_CITY) {
|
|
48
|
+
update['groupby_geolocation_granularity'] = GEOLOCATION_FORMAT_CITY;
|
|
49
|
+
} else if (geo_format === GEOLOCATION_FORMAT_MAP.GEOLOCATION || !geo_format) {
|
|
58
50
|
update['groupby_geolocation_granularity'] = 'district';
|
|
59
51
|
} else {
|
|
60
52
|
update['groupby_geolocation_granularity'] = null;
|
|
@@ -64,7 +56,7 @@ const DataSettings = _ref => {
|
|
|
64
56
|
}
|
|
65
57
|
onChange && onChange(update);
|
|
66
58
|
}, [chart, onChange]);
|
|
67
|
-
const onGroupbyDateGranularityChange =
|
|
59
|
+
const onGroupbyDateGranularityChange = useCallback(option => {
|
|
68
60
|
const {
|
|
69
61
|
config
|
|
70
62
|
} = chart;
|
|
@@ -77,7 +69,7 @@ const DataSettings = _ref => {
|
|
|
77
69
|
groupby_date_granularity: value
|
|
78
70
|
});
|
|
79
71
|
}, [chart, onChange]);
|
|
80
|
-
const onGroupbyGeolocationGranularityChange =
|
|
72
|
+
const onGroupbyGeolocationGranularityChange = useCallback(option => {
|
|
81
73
|
const {
|
|
82
74
|
config
|
|
83
75
|
} = chart;
|
|
@@ -90,7 +82,7 @@ const DataSettings = _ref => {
|
|
|
90
82
|
groupby_geolocation_granularity: value
|
|
91
83
|
});
|
|
92
84
|
}, [chart, onChange]);
|
|
93
|
-
const onIncludeEmptyChange =
|
|
85
|
+
const onIncludeEmptyChange = useCallback(event => {
|
|
94
86
|
const {
|
|
95
87
|
config
|
|
96
88
|
} = chart;
|
|
@@ -111,15 +103,15 @@ const DataSettings = _ref => {
|
|
|
111
103
|
groupby_geolocation_granularity,
|
|
112
104
|
groupby_include_empty_cells
|
|
113
105
|
} = config;
|
|
114
|
-
return /*#__PURE__*/
|
|
106
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CommonDataSettings, {
|
|
115
107
|
chart: chart,
|
|
116
108
|
dataSources: dataSources,
|
|
117
109
|
tables: tables,
|
|
118
110
|
onChange: onChange
|
|
119
|
-
}), /*#__PURE__*/
|
|
111
|
+
}), /*#__PURE__*/React.createElement(GroupBy, {
|
|
120
112
|
tables: tables,
|
|
121
113
|
className: "selected-x-axis",
|
|
122
|
-
label:
|
|
114
|
+
label: intl.get('Group_by'),
|
|
123
115
|
selectedTableId: table_id,
|
|
124
116
|
selectedColumnKey: groupby_column_key,
|
|
125
117
|
selectedDateGranularity: groupby_date_granularity,
|
|
@@ -127,26 +119,26 @@ const DataSettings = _ref => {
|
|
|
127
119
|
onGroupByChange: onGroupByChange,
|
|
128
120
|
onGroupbyDateGranularityChange: onGroupbyDateGranularityChange,
|
|
129
121
|
onGroupbyGeolocationGranularityChange: onGroupbyGeolocationGranularityChange
|
|
130
|
-
}), /*#__PURE__*/
|
|
122
|
+
}), /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
131
123
|
checked: groupby_include_empty_cells,
|
|
132
|
-
placeholder:
|
|
124
|
+
placeholder: intl.get('Include_empty'),
|
|
133
125
|
onChange: onIncludeEmptyChange
|
|
134
|
-
}), /*#__PURE__*/
|
|
126
|
+
}), /*#__PURE__*/React.createElement(Divider, {
|
|
135
127
|
className: "mt-4"
|
|
136
|
-
}), /*#__PURE__*/
|
|
128
|
+
}), /*#__PURE__*/React.createElement(BasicSummary, {
|
|
137
129
|
className: "selected-y-axis",
|
|
138
|
-
label:
|
|
130
|
+
label: intl.get('Summary_method'),
|
|
139
131
|
chart: chart,
|
|
140
132
|
selectedTableId: table_id,
|
|
141
133
|
tables: tables,
|
|
142
134
|
summaryTypeKey: 'summary_type',
|
|
143
135
|
summaryMethodKey: 'summary_method',
|
|
144
136
|
summaryColumnKey: 'summary_column_key',
|
|
145
|
-
supportColumnTypes: [
|
|
137
|
+
supportColumnTypes: [CellType.NUMBER],
|
|
146
138
|
onChange: onChange
|
|
147
|
-
}), /*#__PURE__*/
|
|
139
|
+
}), /*#__PURE__*/React.createElement(DataSort, {
|
|
148
140
|
chart: chart,
|
|
149
141
|
onChange: onChange
|
|
150
142
|
}));
|
|
151
143
|
};
|
|
152
|
-
|
|
144
|
+
export default DataSettings;
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "PieDataSettings", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _dataSettings.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "PieStyleSettings", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return _styleSettings.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
var _dataSettings = _interopRequireDefault(require("./data-settings"));
|
|
20
|
-
var _styleSettings = _interopRequireDefault(require("./style-settings"));
|
|
1
|
+
import PieDataSettings from './data-settings';
|
|
2
|
+
import PieStyleSettings from './style-settings';
|
|
3
|
+
export { PieDataSettings, PieStyleSettings };
|
|
@@ -1,49 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _divider = _interopRequireDefault(require("../widgets/divider"));
|
|
16
|
-
var _mininumSlicePercent = _interopRequireDefault(require("../widgets/mininum-slice-percent"));
|
|
17
|
-
var _fontSettings = require("../widgets/font-settings");
|
|
18
|
-
var _utils = require("../../utils");
|
|
19
|
-
var _constants = require("../../constants");
|
|
20
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
21
|
-
var _colorRules = require("../../constants/color-rules");
|
|
22
|
-
var _colorSelector = _interopRequireDefault(require("../../components/chart-color-selector/color-selector"));
|
|
1
|
+
import _CollapsibleSettingLayout from "dtable-ui-component/lib/CollapsibleSettingLayout";
|
|
2
|
+
import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
3
|
+
import _DTableSwitch from "dtable-ui-component/lib/DTableSwitch";
|
|
4
|
+
import React, { useCallback, useMemo } from 'react';
|
|
5
|
+
import { Label, FormGroup } from 'reactstrap';
|
|
6
|
+
import { CellType } from 'dtable-utils';
|
|
7
|
+
import Divider from '../widgets/divider';
|
|
8
|
+
import MiniNumSlicePercent from '../widgets/mininum-slice-percent';
|
|
9
|
+
import { FontSizeSettings } from '../widgets/font-settings';
|
|
10
|
+
import { eventStopPropagation, getColumnByKey } from '../../utils';
|
|
11
|
+
import { CHART_LABEL_POSITIONS, CHART_LABEL_POSITION_SHOW, CHART_LABEL_FORMATS, CHART_LABEL_FORMAT_SHOW } from '../../constants';
|
|
12
|
+
import intl from '../../intl';
|
|
13
|
+
import { SUPPORT_SINGLE_SELECT_THEMES_OPTIONS } from '../../constants/color-rules';
|
|
14
|
+
import ColorSelector from '../../components/chart-color-selector/color-selector';
|
|
23
15
|
const StyleSettings = _ref => {
|
|
24
16
|
let {
|
|
25
17
|
chart,
|
|
26
18
|
onChange,
|
|
27
19
|
tables
|
|
28
20
|
} = _ref;
|
|
29
|
-
const labelPositionOptions =
|
|
30
|
-
return
|
|
21
|
+
const labelPositionOptions = useMemo(() => {
|
|
22
|
+
return CHART_LABEL_POSITIONS.map(item => {
|
|
31
23
|
return {
|
|
32
24
|
value: item,
|
|
33
|
-
label:
|
|
25
|
+
label: intl.get(CHART_LABEL_POSITION_SHOW[item])
|
|
34
26
|
};
|
|
35
27
|
});
|
|
36
28
|
}, []);
|
|
37
|
-
const labelFormatOptions =
|
|
38
|
-
return
|
|
29
|
+
const labelFormatOptions = useMemo(() => {
|
|
30
|
+
return CHART_LABEL_FORMATS.map(item => {
|
|
39
31
|
return {
|
|
40
32
|
value: item,
|
|
41
|
-
label:
|
|
33
|
+
label: intl.get(CHART_LABEL_FORMAT_SHOW[item])
|
|
42
34
|
};
|
|
43
35
|
});
|
|
44
36
|
}, []);
|
|
45
|
-
const onDisplayLegendChange =
|
|
46
|
-
|
|
37
|
+
const onDisplayLegendChange = useCallback(event => {
|
|
38
|
+
eventStopPropagation(event);
|
|
47
39
|
const {
|
|
48
40
|
config
|
|
49
41
|
} = chart;
|
|
@@ -54,7 +46,7 @@ const StyleSettings = _ref => {
|
|
|
54
46
|
show_legend: !show_legend
|
|
55
47
|
});
|
|
56
48
|
}, [chart, onChange]);
|
|
57
|
-
const onDisplayLabelChange =
|
|
49
|
+
const onDisplayLabelChange = useCallback(() => {
|
|
58
50
|
const {
|
|
59
51
|
config
|
|
60
52
|
} = chart;
|
|
@@ -65,7 +57,7 @@ const StyleSettings = _ref => {
|
|
|
65
57
|
display_label: !display_label
|
|
66
58
|
});
|
|
67
59
|
}, [chart, onChange]);
|
|
68
|
-
const onLabelPositionChange =
|
|
60
|
+
const onLabelPositionChange = useCallback(option => {
|
|
69
61
|
const value = option.value;
|
|
70
62
|
const {
|
|
71
63
|
config
|
|
@@ -78,7 +70,7 @@ const StyleSettings = _ref => {
|
|
|
78
70
|
label_position: value
|
|
79
71
|
});
|
|
80
72
|
}, [chart, onChange]);
|
|
81
|
-
const onLabelFormatChange =
|
|
73
|
+
const onLabelFormatChange = useCallback(option => {
|
|
82
74
|
const value = option.value;
|
|
83
75
|
const {
|
|
84
76
|
config
|
|
@@ -91,17 +83,17 @@ const StyleSettings = _ref => {
|
|
|
91
83
|
label_format: value
|
|
92
84
|
});
|
|
93
85
|
}, [chart, onChange]);
|
|
94
|
-
const onLabelFontSizeChange =
|
|
86
|
+
const onLabelFontSizeChange = useCallback(updatedFontSize => {
|
|
95
87
|
onChange && onChange({
|
|
96
88
|
label_font_size: updatedFontSize
|
|
97
89
|
});
|
|
98
90
|
}, [onChange]);
|
|
99
|
-
const onMinimumSlicePercentChange =
|
|
91
|
+
const onMinimumSlicePercentChange = useCallback(value => {
|
|
100
92
|
onChange && onChange({
|
|
101
93
|
minimum_slice_percent: value
|
|
102
94
|
});
|
|
103
95
|
}, [onChange]);
|
|
104
|
-
const onChartColorChange =
|
|
96
|
+
const onChartColorChange = useCallback(value => {
|
|
105
97
|
onChange && onChange({
|
|
106
98
|
color_theme: value
|
|
107
99
|
});
|
|
@@ -121,52 +113,52 @@ const StyleSettings = _ref => {
|
|
|
121
113
|
color_theme
|
|
122
114
|
} = config;
|
|
123
115
|
const table = tables.find(table => table._id === table_id);
|
|
124
|
-
const column =
|
|
125
|
-
const isGroupBySingleSelectColumn = (column === null || column === void 0 ? void 0 : column.type) ===
|
|
126
|
-
const defaultColorTheme =
|
|
116
|
+
const column = getColumnByKey(groupby_column_key, table.columns);
|
|
117
|
+
const isGroupBySingleSelectColumn = (column === null || column === void 0 ? void 0 : column.type) === CellType.SINGLE_SELECT;
|
|
118
|
+
const defaultColorTheme = SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.DEFAULT;
|
|
127
119
|
const selectedLabelOption = labelPositionOptions.find(item => item.value === label_position);
|
|
128
120
|
const selectedLabelFormat = labelFormatOptions.find(item => item.value === label_format) || labelFormatOptions[0];
|
|
129
|
-
return /*#__PURE__*/
|
|
121
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormGroup, {
|
|
130
122
|
className: "sea-chart-parameter-item"
|
|
131
|
-
}, /*#__PURE__*/
|
|
123
|
+
}, /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
132
124
|
checked: show_legend || false,
|
|
133
|
-
placeholder:
|
|
125
|
+
placeholder: intl.get('Display_legend'),
|
|
134
126
|
onChange: onDisplayLegendChange
|
|
135
|
-
})), isGroupBySingleSelectColumn && /*#__PURE__*/
|
|
127
|
+
})), isGroupBySingleSelectColumn && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(ColorSelector, {
|
|
136
128
|
colorTheme: color_theme || defaultColorTheme,
|
|
137
129
|
onChange: onChartColorChange
|
|
138
|
-
})), /*#__PURE__*/
|
|
139
|
-
title:
|
|
140
|
-
children: /*#__PURE__*/
|
|
130
|
+
})), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(_CollapsibleSettingLayout, {
|
|
131
|
+
title: intl.get('Label'),
|
|
132
|
+
children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
141
133
|
key: "display_label",
|
|
142
134
|
checked: display_label || false,
|
|
143
|
-
placeholder:
|
|
135
|
+
placeholder: intl.get('Display_label'),
|
|
144
136
|
onChange: onDisplayLabelChange
|
|
145
|
-
}), display_label && /*#__PURE__*/
|
|
137
|
+
}), display_label && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
146
138
|
className: "mt-3"
|
|
147
|
-
}, /*#__PURE__*/
|
|
139
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Label_position')), /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
148
140
|
menuPortalTarget: "#sea-chart-settings-content",
|
|
149
141
|
value: selectedLabelOption,
|
|
150
142
|
onChange: onLabelPositionChange,
|
|
151
143
|
options: labelPositionOptions
|
|
152
|
-
})), /*#__PURE__*/
|
|
144
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
153
145
|
className: "mt-3"
|
|
154
|
-
}, /*#__PURE__*/
|
|
146
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Label_format')), /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
155
147
|
menuPortalTarget: "#sea-chart-settings-content",
|
|
156
148
|
value: selectedLabelFormat,
|
|
157
149
|
onChange: onLabelFormatChange,
|
|
158
150
|
options: labelFormatOptions
|
|
159
|
-
})), /*#__PURE__*/
|
|
151
|
+
})), /*#__PURE__*/React.createElement(MiniNumSlicePercent, {
|
|
160
152
|
className: "mt-3 mb-0",
|
|
161
153
|
value: minimum_slice_percent,
|
|
162
154
|
onChange: onMinimumSlicePercentChange
|
|
163
|
-
}), /*#__PURE__*/
|
|
155
|
+
}), /*#__PURE__*/React.createElement(FontSizeSettings, {
|
|
164
156
|
className: "mt-3 mb-0",
|
|
165
|
-
title:
|
|
157
|
+
title: intl.get('Label_font_size'),
|
|
166
158
|
fontSize: label_font_size,
|
|
167
159
|
defaultFontSize: 12,
|
|
168
160
|
modifyFontSize: onLabelFontSizeChange
|
|
169
161
|
})))
|
|
170
162
|
}));
|
|
171
163
|
};
|
|
172
|
-
|
|
164
|
+
export default StyleSettings;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _dtableUtils = require("dtable-utils");
|
|
11
|
-
var _commonDataSettings = _interopRequireDefault(require("../widgets/common-data-settings"));
|
|
12
|
-
var _divider = _interopRequireDefault(require("../widgets/divider"));
|
|
13
|
-
var _groupBy = _interopRequireDefault(require("../widgets/group-by"));
|
|
14
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
15
|
-
var _constants = require("../../constants");
|
|
16
|
-
function ScatterDataSettings(_ref) {
|
|
1
|
+
import _DTableSwitch from "dtable-ui-component/lib/DTableSwitch";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CellType, DATE_COLUMN_OPTIONS } from 'dtable-utils';
|
|
4
|
+
import CommonDataSettings from '../widgets/common-data-settings';
|
|
5
|
+
import Divider from '../widgets/divider';
|
|
6
|
+
import GroupBy from '../widgets/group-by';
|
|
7
|
+
import intl from '../../intl';
|
|
8
|
+
import { CHART_SUMMARY_TYPE, GEOLOCATION_FORMAT_CITY, GEOLOCATION_FORMAT_MAP } from '../../constants';
|
|
9
|
+
export default function ScatterDataSettings(_ref) {
|
|
17
10
|
let {
|
|
18
11
|
chart,
|
|
19
12
|
dataSources,
|
|
@@ -68,18 +61,18 @@ function ScatterDataSettings(_ref) {
|
|
|
68
61
|
update['geolocation_granularity'] = null;
|
|
69
62
|
} else {
|
|
70
63
|
const type = column.type;
|
|
71
|
-
if (
|
|
72
|
-
update['date_granularity'] =
|
|
64
|
+
if (DATE_COLUMN_OPTIONS.includes(type)) {
|
|
65
|
+
update['date_granularity'] = CHART_SUMMARY_TYPE.MONTH;
|
|
73
66
|
update['geolocation_granularity'] = null;
|
|
74
|
-
} else if (type ===
|
|
67
|
+
} else if (type === CellType.GEOLOCATION) {
|
|
75
68
|
const {
|
|
76
69
|
geo_format
|
|
77
70
|
} = column.data || {};
|
|
78
|
-
if (geo_format ===
|
|
79
|
-
update['geolocation_granularity'] =
|
|
80
|
-
} else if (geo_format ===
|
|
81
|
-
update['geolocation_granularity'] =
|
|
82
|
-
} else if (geo_format ===
|
|
71
|
+
if (geo_format === GEOLOCATION_FORMAT_MAP.PROVINCE) {
|
|
72
|
+
update['geolocation_granularity'] = GEOLOCATION_FORMAT_MAP.PROVINCE;
|
|
73
|
+
} else if (geo_format === GEOLOCATION_FORMAT_MAP.PROVINCE_CITY) {
|
|
74
|
+
update['geolocation_granularity'] = GEOLOCATION_FORMAT_CITY;
|
|
75
|
+
} else if (geo_format === GEOLOCATION_FORMAT_MAP.GEOLOCATION || !geo_format) {
|
|
83
76
|
update['geolocation_granularity'] = 'district';
|
|
84
77
|
} else {
|
|
85
78
|
update['geolocation_granularity'] = null;
|
|
@@ -109,38 +102,38 @@ function ScatterDataSettings(_ref) {
|
|
|
109
102
|
geolocation_granularity: value
|
|
110
103
|
});
|
|
111
104
|
};
|
|
112
|
-
return /*#__PURE__*/
|
|
105
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CommonDataSettings, {
|
|
113
106
|
chart: chart,
|
|
114
107
|
dataSources: dataSources,
|
|
115
108
|
tables: tables,
|
|
116
109
|
onChange: onChange
|
|
117
|
-
}), /*#__PURE__*/
|
|
110
|
+
}), /*#__PURE__*/React.createElement(GroupBy, {
|
|
118
111
|
tables: tables,
|
|
119
112
|
type: type,
|
|
120
113
|
className: "selected-x-axis",
|
|
121
|
-
label:
|
|
114
|
+
label: intl.get('X_axis'),
|
|
122
115
|
selectedTableId: table_id,
|
|
123
116
|
selectedColumnKey: x_axis_column_key,
|
|
124
117
|
onGroupByChange: onXAxisColumnChange,
|
|
125
118
|
supportFormulaColumns: true
|
|
126
|
-
}), /*#__PURE__*/
|
|
119
|
+
}), /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
127
120
|
checked: x_axis_include_empty_cells,
|
|
128
|
-
placeholder:
|
|
121
|
+
placeholder: intl.get('Include_empty'),
|
|
129
122
|
onChange: onIncludeEmptyChange
|
|
130
|
-
}), /*#__PURE__*/
|
|
123
|
+
}), /*#__PURE__*/React.createElement(Divider, {
|
|
131
124
|
className: "mt-4"
|
|
132
|
-
}), /*#__PURE__*/
|
|
125
|
+
}), /*#__PURE__*/React.createElement(GroupBy, {
|
|
133
126
|
tables: tables,
|
|
134
127
|
type: type,
|
|
135
128
|
className: "selected-x-axis",
|
|
136
|
-
label:
|
|
129
|
+
label: intl.get('Y_axis'),
|
|
137
130
|
selectedTableId: table_id,
|
|
138
131
|
selectedColumnKey: y_axis_column_key,
|
|
139
132
|
onGroupByChange: onYAxisColumnChange,
|
|
140
133
|
supportFormulaColumns: true
|
|
141
|
-
}), /*#__PURE__*/
|
|
134
|
+
}), /*#__PURE__*/React.createElement(GroupBy, {
|
|
142
135
|
tables: tables,
|
|
143
|
-
label:
|
|
136
|
+
label: intl.get('Group_by'),
|
|
144
137
|
selectedTableId: table_id,
|
|
145
138
|
selectedColumnKey: column_groupby_column_key,
|
|
146
139
|
onGroupByChange: onColumnGroupbyColumnChange,
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import ScatterDataSettings from './data-settings';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "ScatterDataSettings", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _dataSettings.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
var _dataSettings = _interopRequireDefault(require("./data-settings"));
|
|
3
|
+
// data settings are different from others
|
|
4
|
+
export { ScatterDataSettings };
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
11
|
-
var _constants = require("../../constants");
|
|
12
|
-
var _stackItemSettings = _interopRequireDefault(require("./stack-item-settings"));
|
|
13
|
-
require("./index.css");
|
|
14
|
-
class StacksSettings extends _react.Component {
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import intl from '../../intl';
|
|
3
|
+
import { CHART_SUMMARY_SHOW, CHART_TYPE, CHART_SUMMARY_CALCULATION_METHOD } from '../../constants';
|
|
4
|
+
import StackItemSettings from './stack-item-settings';
|
|
5
|
+
import './index.css';
|
|
6
|
+
class StacksSettings extends Component {
|
|
15
7
|
constructor(props) {
|
|
16
8
|
super(props);
|
|
17
9
|
this.addStack = () => {
|
|
@@ -22,7 +14,7 @@ class StacksSettings extends _react.Component {
|
|
|
22
14
|
y_axises
|
|
23
15
|
} = chart.config;
|
|
24
16
|
const defaultStack = {
|
|
25
|
-
type:
|
|
17
|
+
type: CHART_TYPE.BAR_STACK,
|
|
26
18
|
column_groupby_numeric_columns: null
|
|
27
19
|
};
|
|
28
20
|
const updatedStacks = y_axises ? [...y_axises, defaultStack] : [defaultStack];
|
|
@@ -91,7 +83,7 @@ class StacksSettings extends _react.Component {
|
|
|
91
83
|
const newNumericColumnKey = availableOptions[0].value;
|
|
92
84
|
updatedNumericColumns.push({
|
|
93
85
|
column_key: newNumericColumnKey,
|
|
94
|
-
summary_method:
|
|
86
|
+
summary_method: CHART_SUMMARY_CALCULATION_METHOD[0]
|
|
95
87
|
});
|
|
96
88
|
updatedStack.column_groupby_numeric_columns = updatedNumericColumns;
|
|
97
89
|
updatedStacks[index] = updatedStack;
|
|
@@ -172,12 +164,12 @@ class StacksSettings extends _react.Component {
|
|
|
172
164
|
}));
|
|
173
165
|
};
|
|
174
166
|
this.getSummaryMethodsOptions = () => {
|
|
175
|
-
return
|
|
167
|
+
return CHART_SUMMARY_CALCULATION_METHOD.map(m => {
|
|
176
168
|
return {
|
|
177
169
|
value: m,
|
|
178
|
-
label: /*#__PURE__*/
|
|
170
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
179
171
|
className: 'select-module select-module-name'
|
|
180
|
-
},
|
|
172
|
+
}, intl.get(CHART_SUMMARY_SHOW[m]))
|
|
181
173
|
};
|
|
182
174
|
});
|
|
183
175
|
};
|
|
@@ -228,13 +220,13 @@ class StacksSettings extends _react.Component {
|
|
|
228
220
|
const {
|
|
229
221
|
currentSelectedOptions
|
|
230
222
|
} = this.state;
|
|
231
|
-
return /*#__PURE__*/
|
|
232
|
-
return /*#__PURE__*/
|
|
223
|
+
return /*#__PURE__*/React.createElement(Fragment, null, Array.isArray(y_axises) && y_axises.map((yAxis, index) => {
|
|
224
|
+
return /*#__PURE__*/React.createElement(StackItemSettings, {
|
|
233
225
|
key: index,
|
|
234
226
|
chart: chart,
|
|
235
227
|
stack: yAxis,
|
|
236
228
|
yAxisesIndex: index,
|
|
237
|
-
label:
|
|
229
|
+
label: `${intl.get('Stack')}${index + 1}`,
|
|
238
230
|
numericColumnsOptions: this.props.numericColumnsOptions,
|
|
239
231
|
summaryMethodsOptions: this.summaryMethodsOptions,
|
|
240
232
|
deleteStack: () => this.deleteStack(index),
|
|
@@ -256,14 +248,14 @@ class StacksSettings extends _react.Component {
|
|
|
256
248
|
setCurrentSelectedOptions: this.setCurrentSelectedOptions,
|
|
257
249
|
clearCurrentSelectedOptions: this.clearCurrentSelectedOptions
|
|
258
250
|
});
|
|
259
|
-
}), /*#__PURE__*/
|
|
251
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
260
252
|
className: "sea-chart-add-stack",
|
|
261
253
|
onClick: this.addStack
|
|
262
|
-
}, /*#__PURE__*/
|
|
254
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
263
255
|
className: "dtable-font dtable-icon-add-table"
|
|
264
|
-
}), /*#__PURE__*/
|
|
256
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
265
257
|
className: "add-stack-description"
|
|
266
|
-
},
|
|
258
|
+
}, intl.get('Add_new_stack'))));
|
|
267
259
|
}
|
|
268
260
|
}
|
|
269
|
-
|
|
261
|
+
export default StacksSettings;
|