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,23 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _commonDataSettings = _interopRequireDefault(require("../widgets/common-data-settings"));
|
|
14
|
-
var _divider = _interopRequireDefault(require("../widgets/divider"));
|
|
15
|
-
var _groupBy = _interopRequireDefault(require("../widgets/group-by"));
|
|
16
|
-
var _basicSummary = _interopRequireDefault(require("../widgets/basic-summary"));
|
|
17
|
-
var _timePicker = _interopRequireDefault(require("../widgets/time-picker"));
|
|
18
|
-
var _constants = require("../../constants");
|
|
19
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
20
|
-
require("../../assets/css/time-picker.css");
|
|
1
|
+
import _DTableSwitch from "dtable-ui-component/lib/DTableSwitch";
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
import { FormGroup, Label } from 'reactstrap';
|
|
4
|
+
import { CellType, DATE_COLUMN_OPTIONS } from 'dtable-utils';
|
|
5
|
+
import CommonDataSettings from '../widgets/common-data-settings';
|
|
6
|
+
import Divider from '../widgets/divider';
|
|
7
|
+
import GroupBy from '../widgets/group-by';
|
|
8
|
+
import BasicSummary from '../widgets/basic-summary';
|
|
9
|
+
import TimePicker from '../widgets/time-picker';
|
|
10
|
+
import { CHART_SUMMARY_TYPE, GEOLOCATION_FORMAT_CITY, GEOLOCATION_FORMAT_MAP } from '../../constants';
|
|
11
|
+
import intl from '../../intl';
|
|
12
|
+
import '../../assets/css/time-picker.css';
|
|
21
13
|
const DataSettings = _ref => {
|
|
22
14
|
let {
|
|
23
15
|
chart,
|
|
@@ -25,7 +17,7 @@ const DataSettings = _ref => {
|
|
|
25
17
|
tables,
|
|
26
18
|
onChange
|
|
27
19
|
} = _ref;
|
|
28
|
-
const onXAxisColumnChange =
|
|
20
|
+
const onXAxisColumnChange = useCallback(column => {
|
|
29
21
|
const {
|
|
30
22
|
config
|
|
31
23
|
} = chart;
|
|
@@ -45,18 +37,18 @@ const DataSettings = _ref => {
|
|
|
45
37
|
update['x_axis_date_granularity'] = null;
|
|
46
38
|
update['x_axis_geolocation_granularity'] = null;
|
|
47
39
|
} else {
|
|
48
|
-
if (
|
|
49
|
-
update['x_axis_date_granularity'] =
|
|
40
|
+
if (DATE_COLUMN_OPTIONS.includes(type)) {
|
|
41
|
+
update['x_axis_date_granularity'] = CHART_SUMMARY_TYPE.MONTH;
|
|
50
42
|
update['x_axis_geolocation_granularity'] = null;
|
|
51
|
-
} else if (type ===
|
|
43
|
+
} else if (type === CellType.GEOLOCATION) {
|
|
52
44
|
const {
|
|
53
45
|
geo_format
|
|
54
46
|
} = column.data || {};
|
|
55
|
-
if (geo_format ===
|
|
56
|
-
update['x_axis_geolocation_granularity'] =
|
|
57
|
-
} else if (geo_format ===
|
|
58
|
-
update['x_axis_geolocation_granularity'] =
|
|
59
|
-
} else if (geo_format ===
|
|
47
|
+
if (geo_format === GEOLOCATION_FORMAT_MAP.PROVINCE) {
|
|
48
|
+
update['x_axis_geolocation_granularity'] = GEOLOCATION_FORMAT_MAP.PROVINCE;
|
|
49
|
+
} else if (geo_format === GEOLOCATION_FORMAT_MAP.PROVINCE_CITY) {
|
|
50
|
+
update['x_axis_geolocation_granularity'] = GEOLOCATION_FORMAT_CITY;
|
|
51
|
+
} else if (geo_format === GEOLOCATION_FORMAT_MAP.GEOLOCATION || !geo_format) {
|
|
60
52
|
update['x_axis_geolocation_granularity'] = 'district';
|
|
61
53
|
} else {
|
|
62
54
|
update['x_axis_geolocation_granularity'] = null;
|
|
@@ -66,7 +58,7 @@ const DataSettings = _ref => {
|
|
|
66
58
|
}
|
|
67
59
|
onChange && onChange(update);
|
|
68
60
|
}, [chart, onChange]);
|
|
69
|
-
const onGroupbyDateGranularityChange =
|
|
61
|
+
const onGroupbyDateGranularityChange = useCallback(option => {
|
|
70
62
|
const {
|
|
71
63
|
config
|
|
72
64
|
} = chart;
|
|
@@ -79,7 +71,7 @@ const DataSettings = _ref => {
|
|
|
79
71
|
x_axis_date_granularity: value
|
|
80
72
|
});
|
|
81
73
|
}, [chart, onChange]);
|
|
82
|
-
const onGroupbyGeolocationGranularityChange =
|
|
74
|
+
const onGroupbyGeolocationGranularityChange = useCallback(option => {
|
|
83
75
|
const {
|
|
84
76
|
config
|
|
85
77
|
} = chart;
|
|
@@ -92,7 +84,7 @@ const DataSettings = _ref => {
|
|
|
92
84
|
x_axis_geolocation_granularity: value
|
|
93
85
|
});
|
|
94
86
|
}, [chart, onChange]);
|
|
95
|
-
const onDateChange =
|
|
87
|
+
const onDateChange = useCallback((key, value) => {
|
|
96
88
|
const {
|
|
97
89
|
config
|
|
98
90
|
} = chart;
|
|
@@ -102,7 +94,7 @@ const DataSettings = _ref => {
|
|
|
102
94
|
[key]: value
|
|
103
95
|
});
|
|
104
96
|
}, [chart, onChange]);
|
|
105
|
-
const onDisplayIncreaseChange =
|
|
97
|
+
const onDisplayIncreaseChange = useCallback(event => {
|
|
106
98
|
onChange && onChange({
|
|
107
99
|
display_increase: event.target.checked
|
|
108
100
|
});
|
|
@@ -124,15 +116,15 @@ const DataSettings = _ref => {
|
|
|
124
116
|
x_axis_compared_date_range_end,
|
|
125
117
|
display_increase
|
|
126
118
|
} = chart.config;
|
|
127
|
-
return /*#__PURE__*/
|
|
119
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CommonDataSettings, {
|
|
128
120
|
chart: chart,
|
|
129
121
|
dataSources: dataSources,
|
|
130
122
|
tables: tables,
|
|
131
123
|
onChange: onChange
|
|
132
|
-
}), /*#__PURE__*/
|
|
124
|
+
}), /*#__PURE__*/React.createElement(GroupBy, {
|
|
133
125
|
tables: tables,
|
|
134
126
|
className: "selected-x-axis",
|
|
135
|
-
label:
|
|
127
|
+
label: intl.get('X_axis'),
|
|
136
128
|
selectedTableId: table_id,
|
|
137
129
|
selectedColumnKey: x_axis_column_key,
|
|
138
130
|
selectedDateGranularity: x_axis_date_granularity,
|
|
@@ -141,41 +133,41 @@ const DataSettings = _ref => {
|
|
|
141
133
|
onGroupByChange: onXAxisColumnChange,
|
|
142
134
|
onGroupbyDateGranularityChange: onGroupbyDateGranularityChange,
|
|
143
135
|
onGroupbyGeolocationGranularityChange: onGroupbyGeolocationGranularityChange
|
|
144
|
-
}), /*#__PURE__*/
|
|
136
|
+
}), /*#__PURE__*/React.createElement(FormGroup, {
|
|
145
137
|
className: "sea-chart-parameter-item"
|
|
146
|
-
}, /*#__PURE__*/
|
|
138
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Date_range')), /*#__PURE__*/React.createElement("div", {
|
|
147
139
|
className: "sea-chart-time-input-container"
|
|
148
|
-
}, /*#__PURE__*/
|
|
140
|
+
}, /*#__PURE__*/React.createElement(TimePicker, {
|
|
149
141
|
onChange: value => onDateChange('x_axis_date_range_start', value),
|
|
150
142
|
value: x_axis_date_range_start
|
|
151
|
-
}), /*#__PURE__*/
|
|
143
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
152
144
|
className: "sea-chart-concat"
|
|
153
|
-
}, ' - '), /*#__PURE__*/
|
|
145
|
+
}, ' - '), /*#__PURE__*/React.createElement(TimePicker, {
|
|
154
146
|
onChange: value => onDateChange('x_axis_date_range_end', value),
|
|
155
147
|
value: x_axis_date_range_end
|
|
156
|
-
}))), /*#__PURE__*/
|
|
148
|
+
}))), /*#__PURE__*/React.createElement(FormGroup, {
|
|
157
149
|
className: "sea-chart-parameter-item"
|
|
158
|
-
}, /*#__PURE__*/
|
|
150
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Compare_to_date_range')), /*#__PURE__*/React.createElement("div", {
|
|
159
151
|
className: "sea-chart-time-input-container"
|
|
160
|
-
}, /*#__PURE__*/
|
|
152
|
+
}, /*#__PURE__*/React.createElement(TimePicker, {
|
|
161
153
|
onChange: value => onDateChange('x_axis_compared_date_range_start', value),
|
|
162
154
|
value: x_axis_compared_date_range_start
|
|
163
|
-
}), /*#__PURE__*/
|
|
155
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
164
156
|
className: "sea-chart-concat"
|
|
165
|
-
}, ' - '), /*#__PURE__*/
|
|
157
|
+
}, ' - '), /*#__PURE__*/React.createElement(TimePicker, {
|
|
166
158
|
onChange: value => onDateChange('x_axis_compared_date_range_end', value),
|
|
167
159
|
value: x_axis_compared_date_range_end
|
|
168
|
-
}))), /*#__PURE__*/
|
|
160
|
+
}))), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(BasicSummary, {
|
|
169
161
|
className: "selected-y-axis",
|
|
170
|
-
label:
|
|
162
|
+
label: intl.get('Y_axis'),
|
|
171
163
|
chart: chart,
|
|
172
164
|
selectedTableId: table_id,
|
|
173
165
|
tables: tables,
|
|
174
166
|
onChange: onChange
|
|
175
|
-
}), /*#__PURE__*/
|
|
167
|
+
}), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
176
168
|
checked: display_increase,
|
|
177
|
-
placeholder:
|
|
169
|
+
placeholder: intl.get('Display_increase'),
|
|
178
170
|
onChange: onDisplayIncreaseChange
|
|
179
171
|
}));
|
|
180
172
|
};
|
|
181
|
-
|
|
173
|
+
export default DataSettings;
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "TimeComparisonDataSettings", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _dataSettings.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "TimeComparisonStyleSettings", {
|
|
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 TimeComparisonDataSettings from './data-settings';
|
|
2
|
+
import TimeComparisonStyleSettings from './style-settings';
|
|
3
|
+
export { TimeComparisonDataSettings, TimeComparisonStyleSettings };
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _reactstrap = require("reactstrap");
|
|
14
|
-
var _divider = _interopRequireDefault(require("../widgets/divider"));
|
|
15
|
-
var _minMaxSetting = _interopRequireDefault(require("../widgets/min-max-setting"));
|
|
16
|
-
var _displayValuesSettings = _interopRequireDefault(require("../widgets/display-values-settings"));
|
|
17
|
-
var _utils = require("../../utils");
|
|
18
|
-
var _constants = require("../../constants");
|
|
19
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
1
|
+
import _CollapsibleSettingLayout from "dtable-ui-component/lib/CollapsibleSettingLayout";
|
|
2
|
+
import _DTableRadioGroup from "dtable-ui-component/lib/DTableRadioGroup";
|
|
3
|
+
import _DTableSwitch from "dtable-ui-component/lib/DTableSwitch";
|
|
4
|
+
import React, { useCallback } from 'react';
|
|
5
|
+
import { Label, Row } from 'reactstrap';
|
|
6
|
+
import Divider from '../widgets/divider';
|
|
7
|
+
import MinMaxSetting from '../widgets/min-max-setting';
|
|
8
|
+
import DisplayValuesSettings from '../widgets/display-values-settings';
|
|
9
|
+
import { eventStopPropagation } from '../../utils';
|
|
10
|
+
import { X_LABEL_POSITIONS, Y_LABEL_POSITIONS, LABEL_POSITION_TYPE_SHOW, LABEL_COLORS } from '../../constants';
|
|
11
|
+
import intl from '../../intl';
|
|
20
12
|
const StyleSettings = _ref => {
|
|
21
13
|
let {
|
|
22
14
|
chart,
|
|
23
15
|
onChange
|
|
24
16
|
} = _ref;
|
|
25
|
-
const xAxisLabelOptions =
|
|
26
|
-
const yAxisLabelOptions =
|
|
27
|
-
const onAxisLabelShowChange =
|
|
17
|
+
const xAxisLabelOptions = X_LABEL_POSITIONS;
|
|
18
|
+
const yAxisLabelOptions = Y_LABEL_POSITIONS;
|
|
19
|
+
const onAxisLabelShowChange = useCallback(labelKey => {
|
|
28
20
|
const {
|
|
29
21
|
config
|
|
30
22
|
} = chart;
|
|
@@ -33,7 +25,7 @@ const StyleSettings = _ref => {
|
|
|
33
25
|
[labelKey]: !value
|
|
34
26
|
});
|
|
35
27
|
}, [chart, onChange]);
|
|
36
|
-
const onAxisLabelPositionChange =
|
|
28
|
+
const onAxisLabelPositionChange = useCallback((position, positionKey) => {
|
|
37
29
|
const {
|
|
38
30
|
config
|
|
39
31
|
} = chart;
|
|
@@ -43,7 +35,7 @@ const StyleSettings = _ref => {
|
|
|
43
35
|
[positionKey]: position
|
|
44
36
|
});
|
|
45
37
|
}, [chart, onChange]);
|
|
46
|
-
const onYAxisAutoRangeChange =
|
|
38
|
+
const onYAxisAutoRangeChange = useCallback(() => {
|
|
47
39
|
const {
|
|
48
40
|
config
|
|
49
41
|
} = chart;
|
|
@@ -54,7 +46,7 @@ const StyleSettings = _ref => {
|
|
|
54
46
|
y_axis_auto_range: !y_axis_auto_range
|
|
55
47
|
});
|
|
56
48
|
}, [chart, onChange]);
|
|
57
|
-
const onYAxisMinChange =
|
|
49
|
+
const onYAxisMinChange = useCallback(min => {
|
|
58
50
|
const newMin = parseFloat(min);
|
|
59
51
|
if (Number.isNaN(newMin)) return;
|
|
60
52
|
const {
|
|
@@ -68,7 +60,7 @@ const StyleSettings = _ref => {
|
|
|
68
60
|
y_axis_min: newMin
|
|
69
61
|
});
|
|
70
62
|
}, [chart, onChange]);
|
|
71
|
-
const onYAxisMaxChange =
|
|
63
|
+
const onYAxisMaxChange = useCallback(max => {
|
|
72
64
|
const newMax = parseFloat(max);
|
|
73
65
|
if (Number.isNaN(newMax)) return;
|
|
74
66
|
const {
|
|
@@ -82,11 +74,11 @@ const StyleSettings = _ref => {
|
|
|
82
74
|
y_axis_max: newMax
|
|
83
75
|
});
|
|
84
76
|
}, [chart, onChange]);
|
|
85
|
-
const onDisplayValueChange =
|
|
77
|
+
const onDisplayValueChange = useCallback(update => {
|
|
86
78
|
onChange && onChange(update);
|
|
87
79
|
}, [onChange]);
|
|
88
|
-
const onDisplayPercentageIncreaseChange =
|
|
89
|
-
|
|
80
|
+
const onDisplayPercentageIncreaseChange = useCallback(event => {
|
|
81
|
+
eventStopPropagation(event);
|
|
90
82
|
const {
|
|
91
83
|
config
|
|
92
84
|
} = chart;
|
|
@@ -97,8 +89,8 @@ const StyleSettings = _ref => {
|
|
|
97
89
|
display_increase: !display_increase
|
|
98
90
|
});
|
|
99
91
|
}, [chart, onChange]);
|
|
100
|
-
const onIncreaseDisplayColorChang =
|
|
101
|
-
|
|
92
|
+
const onIncreaseDisplayColorChang = useCallback((event, value) => {
|
|
93
|
+
eventStopPropagation(event);
|
|
102
94
|
const {
|
|
103
95
|
config
|
|
104
96
|
} = chart;
|
|
@@ -114,7 +106,7 @@ const StyleSettings = _ref => {
|
|
|
114
106
|
return options.reduce((optionDisplayMap, position) => {
|
|
115
107
|
return {
|
|
116
108
|
...optionDisplayMap,
|
|
117
|
-
[position]:
|
|
109
|
+
[position]: intl.get(LABEL_POSITION_TYPE_SHOW[position])
|
|
118
110
|
};
|
|
119
111
|
}, {});
|
|
120
112
|
};
|
|
@@ -137,50 +129,50 @@ const StyleSettings = _ref => {
|
|
|
137
129
|
} = config;
|
|
138
130
|
const xAxisLabelPosition = x_axis_label_position || xAxisLabelOptions[0];
|
|
139
131
|
const yAxisLabelPosition = y_axis_label_position || yAxisLabelOptions[0];
|
|
140
|
-
return /*#__PURE__*/
|
|
141
|
-
title:
|
|
142
|
-
children: /*#__PURE__*/
|
|
132
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_CollapsibleSettingLayout, {
|
|
133
|
+
title: intl.get('X_axis'),
|
|
134
|
+
children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
143
135
|
key: "x_axis_show_label",
|
|
144
136
|
checked: x_axis_show_label || false,
|
|
145
|
-
placeholder:
|
|
137
|
+
placeholder: intl.get('Display_title'),
|
|
146
138
|
onChange: () => onAxisLabelShowChange('x_axis_show_label')
|
|
147
|
-
}), x_axis_show_label && /*#__PURE__*/
|
|
139
|
+
}), x_axis_show_label && /*#__PURE__*/React.createElement(Row, {
|
|
148
140
|
className: "mt-3 ml-0 mr-0 settings-text-horizontal-align sea-chart-select-group"
|
|
149
|
-
}, /*#__PURE__*/
|
|
141
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Alignment')), /*#__PURE__*/React.createElement(_DTableRadioGroup, {
|
|
150
142
|
activeOption: xAxisLabelPosition,
|
|
151
143
|
options: xAxisLabelOptions,
|
|
152
144
|
optionsDisplay: getLabelOptionsDisplay(xAxisLabelOptions),
|
|
153
145
|
onSelectChanged: position => onAxisLabelPositionChange(position, 'x_axis_label_position')
|
|
154
146
|
})))
|
|
155
|
-
}), /*#__PURE__*/
|
|
156
|
-
title:
|
|
157
|
-
children: /*#__PURE__*/
|
|
147
|
+
}), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(_CollapsibleSettingLayout, {
|
|
148
|
+
title: intl.get('Y_axis'),
|
|
149
|
+
children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
158
150
|
key: "y_axis_show_label",
|
|
159
151
|
checked: y_axis_show_label || false,
|
|
160
|
-
placeholder:
|
|
152
|
+
placeholder: intl.get('Display_title'),
|
|
161
153
|
onChange: () => onAxisLabelShowChange('y_axis_show_label')
|
|
162
|
-
}), y_axis_show_label && /*#__PURE__*/
|
|
154
|
+
}), y_axis_show_label && /*#__PURE__*/React.createElement(Row, {
|
|
163
155
|
className: "mt-3 ml-0 mr-0 settings-text-horizontal-align sea-chart-select-group"
|
|
164
|
-
}, /*#__PURE__*/
|
|
156
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Alignment')), /*#__PURE__*/React.createElement(_DTableRadioGroup, {
|
|
165
157
|
activeOption: yAxisLabelPosition,
|
|
166
158
|
options: yAxisLabelOptions,
|
|
167
159
|
optionsDisplay: getLabelOptionsDisplay(yAxisLabelOptions),
|
|
168
160
|
onSelectChanged: position => onAxisLabelPositionChange(position, 'y_axis_label_position')
|
|
169
|
-
})), /*#__PURE__*/
|
|
161
|
+
})), /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
170
162
|
key: "y_axis_auto_range",
|
|
171
163
|
switchClassName: "mt-3",
|
|
172
164
|
checked: y_axis_auto_range,
|
|
173
|
-
placeholder:
|
|
165
|
+
placeholder: intl.get('Auto_range'),
|
|
174
166
|
onChange: onYAxisAutoRangeChange
|
|
175
|
-
}), !y_axis_auto_range && /*#__PURE__*/
|
|
167
|
+
}), !y_axis_auto_range && /*#__PURE__*/React.createElement("div", {
|
|
176
168
|
className: "mt-3"
|
|
177
|
-
}, /*#__PURE__*/
|
|
169
|
+
}, /*#__PURE__*/React.createElement(MinMaxSetting, {
|
|
178
170
|
min: y_axis_min,
|
|
179
171
|
max: y_axis_max,
|
|
180
172
|
onMinChange: onYAxisMinChange,
|
|
181
173
|
onMaxChange: onYAxisMaxChange
|
|
182
174
|
})))
|
|
183
|
-
}), /*#__PURE__*/
|
|
175
|
+
}), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(DisplayValuesSettings, {
|
|
184
176
|
isShowValueKey: "display_increase_percentage",
|
|
185
177
|
isShowValue: display_increase_percentage,
|
|
186
178
|
fontSizeKey: "label_font_size",
|
|
@@ -188,4 +180,4 @@ const StyleSettings = _ref => {
|
|
|
188
180
|
onChange: onDisplayValueChange
|
|
189
181
|
}));
|
|
190
182
|
};
|
|
191
|
-
|
|
183
|
+
export default StyleSettings;
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _dtableUtils = require("dtable-utils");
|
|
12
|
-
var _reactstrap = require("reactstrap");
|
|
13
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
14
|
-
var _commonDataSettings = _interopRequireDefault(require("../widgets/common-data-settings"));
|
|
15
|
-
var _divider = _interopRequireDefault(require("../widgets/divider"));
|
|
16
|
-
var _groupBy = _interopRequireDefault(require("../widgets/group-by"));
|
|
17
|
-
var _basicSummary = _interopRequireDefault(require("../widgets/basic-summary"));
|
|
18
|
-
var _constants = require("../../constants");
|
|
1
|
+
import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
import { CellType } from 'dtable-utils';
|
|
4
|
+
import { Label, FormGroup } from 'reactstrap';
|
|
5
|
+
import intl from '../../intl';
|
|
6
|
+
import CommonDataSettings from '../widgets/common-data-settings';
|
|
7
|
+
import Divider from '../widgets/divider';
|
|
8
|
+
import GroupBy from '../widgets/group-by';
|
|
9
|
+
import BasicSummary from '../widgets/basic-summary';
|
|
10
|
+
import { CHART_SUMMARY_TYPES } from '../../constants';
|
|
19
11
|
const COMPARE_GRANULARITY = ['day', 'week', 'quarter', 'month', 'year', 'days_7', 'days_30'];
|
|
20
12
|
const COMPARED_LIST = {
|
|
21
13
|
[COMPARE_GRANULARITY[0]]: 'Yesterday_vs_the_day_before_yesterday',
|
|
@@ -33,17 +25,17 @@ const DataSettings = _ref => {
|
|
|
33
25
|
tables,
|
|
34
26
|
onChange
|
|
35
27
|
} = _ref;
|
|
36
|
-
const getOptions =
|
|
28
|
+
const getOptions = useCallback(() => {
|
|
37
29
|
return COMPARE_GRANULARITY.map(item => {
|
|
38
30
|
const value = item;
|
|
39
|
-
const label = /*#__PURE__*/
|
|
31
|
+
const label = /*#__PURE__*/React.createElement("span", null, intl.get(COMPARED_LIST[item]));
|
|
40
32
|
return {
|
|
41
33
|
value,
|
|
42
34
|
label
|
|
43
35
|
};
|
|
44
36
|
});
|
|
45
37
|
}, []);
|
|
46
|
-
const onXAxisColumnChange =
|
|
38
|
+
const onXAxisColumnChange = useCallback(column => {
|
|
47
39
|
const {
|
|
48
40
|
config
|
|
49
41
|
} = chart;
|
|
@@ -60,7 +52,7 @@ const DataSettings = _ref => {
|
|
|
60
52
|
};
|
|
61
53
|
onChange && onChange(update);
|
|
62
54
|
}, [chart, onChange]);
|
|
63
|
-
const onGroupbyDateGranularityChange =
|
|
55
|
+
const onGroupbyDateGranularityChange = useCallback(option => {
|
|
64
56
|
const {
|
|
65
57
|
config
|
|
66
58
|
} = chart;
|
|
@@ -82,40 +74,40 @@ const DataSettings = _ref => {
|
|
|
82
74
|
date_granularity
|
|
83
75
|
} = config;
|
|
84
76
|
const selectedGeolocationGranularity = date_granularity ? getOptions().find(option => option.value === date_granularity) : null;
|
|
85
|
-
return /*#__PURE__*/
|
|
77
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CommonDataSettings, {
|
|
86
78
|
dataSources: dataSources,
|
|
87
79
|
chart: chart,
|
|
88
80
|
tables: tables,
|
|
89
81
|
onChange: onChange
|
|
90
|
-
}), /*#__PURE__*/
|
|
82
|
+
}), /*#__PURE__*/React.createElement(GroupBy, {
|
|
91
83
|
chart: chart,
|
|
92
84
|
tables: tables,
|
|
93
85
|
className: "selected-x-axis",
|
|
94
|
-
label:
|
|
86
|
+
label: intl.get('Time_field'),
|
|
95
87
|
selectedTableId: table_id,
|
|
96
88
|
selectedColumnKey: date_column_key,
|
|
97
89
|
onlySupportDate: true,
|
|
98
90
|
isRenderGroupBy: false,
|
|
99
91
|
onGroupByChange: onXAxisColumnChange
|
|
100
|
-
}), /*#__PURE__*/
|
|
92
|
+
}), /*#__PURE__*/React.createElement(FormGroup, null, /*#__PURE__*/React.createElement(Label, null, intl.get('Comparison_mode')), /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
101
93
|
menuPortalTarget: '#wrapper',
|
|
102
94
|
value: selectedGeolocationGranularity,
|
|
103
95
|
options: getOptions(),
|
|
104
96
|
onChange: onGroupbyDateGranularityChange
|
|
105
|
-
})), /*#__PURE__*/
|
|
97
|
+
})), /*#__PURE__*/React.createElement(Divider, {
|
|
106
98
|
className: "mt-4"
|
|
107
|
-
}), /*#__PURE__*/
|
|
99
|
+
}), /*#__PURE__*/React.createElement(BasicSummary, {
|
|
108
100
|
className: "selected-y-axis",
|
|
109
|
-
label:
|
|
101
|
+
label: intl.get('Summary_type'),
|
|
110
102
|
summaryTypeKey: 'summary_type',
|
|
111
103
|
summaryMethodKey: 'summary_method',
|
|
112
104
|
summaryColumnKey: 'summary_column_key',
|
|
113
105
|
chart: chart,
|
|
114
106
|
selectedTableId: table_id,
|
|
115
107
|
tables: tables,
|
|
116
|
-
supportColumnTypes: [
|
|
117
|
-
summaryTypeOptions:
|
|
108
|
+
supportColumnTypes: [CellType.NUMBER],
|
|
109
|
+
summaryTypeOptions: CHART_SUMMARY_TYPES,
|
|
118
110
|
onChange: onChange
|
|
119
111
|
}));
|
|
120
112
|
};
|
|
121
|
-
|
|
113
|
+
export default DataSettings;
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "TrendDataSettings", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _dataSettings.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "TrendStyleSettings", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return _styleSetting.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
var _dataSettings = _interopRequireDefault(require("./data-settings"));
|
|
20
|
-
var _styleSetting = _interopRequireDefault(require("./style-setting"));
|
|
1
|
+
import TrendDataSettings from './data-settings';
|
|
2
|
+
import TrendStyleSettings from './style-setting';
|
|
3
|
+
export { TrendDataSettings, TrendStyleSettings };
|
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
var _CollapsibleSettingLayout2 = _interopRequireDefault(require("dtable-ui-component/lib/CollapsibleSettingLayout"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
12
|
-
var _divider = _interopRequireDefault(require("../widgets/divider"));
|
|
13
|
-
var _fontSettings = _interopRequireDefault(require("../../components/font-settings"));
|
|
14
|
-
var _contexts = require("../../utils/contexts");
|
|
15
|
-
var _constants = require("../../constants");
|
|
16
|
-
function StyleSettings(_ref) {
|
|
1
|
+
import _CollapsibleSettingLayout from "dtable-ui-component/lib/CollapsibleSettingLayout";
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import intl from '../../intl';
|
|
4
|
+
import Divider from '../widgets/divider';
|
|
5
|
+
import GeneralFontSetting from '../../components/font-settings';
|
|
6
|
+
import { GlobalThemeContext } from '../../utils/contexts';
|
|
7
|
+
import { DEFAULT_CARD_LABEL_FONT_COLOR_LIGHT, DEFAULT_CHART_TITLE_FONT_COLOR_LIGHT, LABEL_FONT_COLOR_MAP, TITLE_FONT_COLOR_MAP } from '../../constants';
|
|
8
|
+
export default function StyleSettings(_ref) {
|
|
17
9
|
let {
|
|
18
10
|
chart,
|
|
19
11
|
onChange
|
|
20
12
|
} = _ref;
|
|
21
13
|
const {
|
|
22
14
|
globalTheme
|
|
23
|
-
} =
|
|
15
|
+
} = useContext(GlobalThemeContext);
|
|
24
16
|
const {
|
|
25
17
|
config
|
|
26
18
|
} = chart;
|
|
@@ -42,7 +34,7 @@ function StyleSettings(_ref) {
|
|
|
42
34
|
};
|
|
43
35
|
const defaultNumConfig = {
|
|
44
36
|
font_size: 34,
|
|
45
|
-
font_color:
|
|
37
|
+
font_color: TITLE_FONT_COLOR_MAP[globalTheme] || DEFAULT_CHART_TITLE_FONT_COLOR_LIGHT,
|
|
46
38
|
text_align: 'left',
|
|
47
39
|
font_weight: 700
|
|
48
40
|
};
|
|
@@ -54,18 +46,18 @@ function StyleSettings(_ref) {
|
|
|
54
46
|
};
|
|
55
47
|
const defaultLabelConfig = {
|
|
56
48
|
font_size: 14,
|
|
57
|
-
font_color:
|
|
49
|
+
font_color: LABEL_FONT_COLOR_MAP[globalTheme] || DEFAULT_CARD_LABEL_FONT_COLOR_LIGHT,
|
|
58
50
|
text_align: 'left',
|
|
59
51
|
font_weight: 400
|
|
60
52
|
};
|
|
61
53
|
const handleNumChange = (key, value) => {
|
|
62
|
-
key =
|
|
54
|
+
key = `num_${key}`;
|
|
63
55
|
onChange({
|
|
64
56
|
[key]: value
|
|
65
57
|
});
|
|
66
58
|
};
|
|
67
59
|
const handleLabelChange = (key, value) => {
|
|
68
|
-
key =
|
|
60
|
+
key = `label_${key}`;
|
|
69
61
|
if (key === 'label_font_size') {
|
|
70
62
|
key = 'card_label_font_size';
|
|
71
63
|
}
|
|
@@ -73,16 +65,16 @@ function StyleSettings(_ref) {
|
|
|
73
65
|
[key]: value
|
|
74
66
|
});
|
|
75
67
|
};
|
|
76
|
-
return /*#__PURE__*/
|
|
77
|
-
title:
|
|
78
|
-
children: /*#__PURE__*/
|
|
68
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_CollapsibleSettingLayout, {
|
|
69
|
+
title: intl.get('Number'),
|
|
70
|
+
children: /*#__PURE__*/React.createElement(GeneralFontSetting, {
|
|
79
71
|
config: numConfig,
|
|
80
72
|
defaultConfig: defaultNumConfig,
|
|
81
73
|
onChange: handleNumChange
|
|
82
74
|
})
|
|
83
|
-
}), /*#__PURE__*/
|
|
84
|
-
title:
|
|
85
|
-
children: /*#__PURE__*/
|
|
75
|
+
}), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(_CollapsibleSettingLayout, {
|
|
76
|
+
title: intl.get('Label'),
|
|
77
|
+
children: /*#__PURE__*/React.createElement(GeneralFontSetting, {
|
|
86
78
|
config: labelConfig,
|
|
87
79
|
defaultConfig: defaultLabelConfig,
|
|
88
80
|
onChange: handleLabelChange
|