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,46 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var _mapWorldBubble = _interopRequireDefault(require("./map-world-bubble"));
|
|
37
|
-
var _heatMap = _interopRequireDefault(require("./heat-map"));
|
|
38
|
-
var _mirror = _interopRequireDefault(require("./mirror"));
|
|
39
|
-
var _dashboard = _interopRequireDefault(require("./dashboard"));
|
|
40
|
-
var _treemap = _interopRequireDefault(require("./treemap"));
|
|
41
|
-
var _funnel = _interopRequireDefault(require("./funnel"));
|
|
42
|
-
var _trend = _interopRequireDefault(require("./trend"));
|
|
43
|
-
var _tableElement = _interopRequireDefault(require("./table-element"));
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import { CHART_TYPE } from '../../constants';
|
|
3
|
+
import { BaseUtils } from '../../utils';
|
|
4
|
+
import StatisticRecordDialog from '../../components/statistic-record-dialog';
|
|
5
|
+
import Table from './table';
|
|
6
|
+
import Bar from './bar';
|
|
7
|
+
import BarGroup from './bar-group';
|
|
8
|
+
import BarStack from './bar-stack';
|
|
9
|
+
import BarCompare from './bar-compare';
|
|
10
|
+
import BarCustomStack from './bar-custom-stack';
|
|
11
|
+
import HorizontalBar from './horizontal-bar';
|
|
12
|
+
import HorizontalBarGroup from './horizontal-bar-group';
|
|
13
|
+
import HorizontalBarStack from './horizontal-bar-stack';
|
|
14
|
+
import Completeness from './completeness';
|
|
15
|
+
import CompletenessGroup from './completeness-group';
|
|
16
|
+
import Line from './line';
|
|
17
|
+
import LineGroup from './line-group';
|
|
18
|
+
import Area from './area';
|
|
19
|
+
import AreaGroup from './area-group';
|
|
20
|
+
import Pie from './pie';
|
|
21
|
+
import Ring from './ring';
|
|
22
|
+
import Scatter from './scatter';
|
|
23
|
+
import BasicNumericCard from './basic-number-card';
|
|
24
|
+
import Combination from './combination';
|
|
25
|
+
import Map from './map';
|
|
26
|
+
import MapBubble from './map-bubble';
|
|
27
|
+
import WorldMap from './map-world';
|
|
28
|
+
import WorldMapBubble from './map-world-bubble';
|
|
29
|
+
import HeatMap from './heat-map';
|
|
30
|
+
import Mirror from './mirror';
|
|
31
|
+
import Dashboard from './dashboard';
|
|
32
|
+
import Treemap from './treemap';
|
|
33
|
+
import Funnel from './funnel';
|
|
34
|
+
import Trend from './trend';
|
|
35
|
+
import TableElement from './table-element';
|
|
44
36
|
const Wrapper = _ref => {
|
|
45
37
|
let {
|
|
46
38
|
dtableStoreValue,
|
|
@@ -57,10 +49,10 @@ const Wrapper = _ref => {
|
|
|
57
49
|
isBigScreenPlugin,
|
|
58
50
|
resizeSignal
|
|
59
51
|
} = _ref;
|
|
60
|
-
const [statisticRecords, setStatisticRecords] =
|
|
61
|
-
const [pivotTableColumnRow, setPivotTableColumnRow] =
|
|
62
|
-
const [isStatisticRecordsDialogShow, setIsStatisticRecordsDialogShow] =
|
|
63
|
-
const toggleStatisticRecordsDialog =
|
|
52
|
+
const [statisticRecords, setStatisticRecords] = useState({});
|
|
53
|
+
const [pivotTableColumnRow, setPivotTableColumnRow] = useState({});
|
|
54
|
+
const [isStatisticRecordsDialogShow, setIsStatisticRecordsDialogShow] = useState(false);
|
|
55
|
+
const toggleStatisticRecordsDialog = useCallback((statisticRecords, tableColumnRow) => {
|
|
64
56
|
setStatisticRecords(statisticRecords);
|
|
65
57
|
if (tableColumnRow) {
|
|
66
58
|
setPivotTableColumnRow({
|
|
@@ -101,35 +93,35 @@ const Wrapper = _ref => {
|
|
|
101
93
|
isBigScreenPlugin
|
|
102
94
|
};
|
|
103
95
|
switch (type) {
|
|
104
|
-
case
|
|
96
|
+
case CHART_TYPE.TABLE_ELEMENT:
|
|
105
97
|
{
|
|
106
|
-
return /*#__PURE__*/
|
|
98
|
+
return /*#__PURE__*/React.createElement(TableElement, Object.assign({}, baseProps, {
|
|
107
99
|
canvasStyle: canvasStyle
|
|
108
100
|
}));
|
|
109
101
|
}
|
|
110
|
-
case
|
|
102
|
+
case CHART_TYPE.TABLE:
|
|
111
103
|
{
|
|
112
104
|
if (!result) return null;
|
|
113
|
-
return /*#__PURE__*/
|
|
105
|
+
return /*#__PURE__*/React.createElement(Table, Object.assign({}, baseProps, {
|
|
114
106
|
summaryColumns: summary_columns,
|
|
115
107
|
columnGroupbyColumn: columnGroupbyColumn,
|
|
116
108
|
summaryMethod: summary_method,
|
|
117
109
|
chartTableColumns: chartTableColumns
|
|
118
110
|
}));
|
|
119
111
|
}
|
|
120
|
-
case
|
|
112
|
+
case CHART_TYPE.BAR:
|
|
121
113
|
{
|
|
122
|
-
return /*#__PURE__*/
|
|
114
|
+
return /*#__PURE__*/React.createElement(Bar, Object.assign({}, baseProps, {
|
|
123
115
|
canvasStyle: canvasStyle
|
|
124
116
|
}));
|
|
125
117
|
}
|
|
126
|
-
case
|
|
118
|
+
case CHART_TYPE.BAR_GROUP:
|
|
127
119
|
{
|
|
128
|
-
return /*#__PURE__*/
|
|
120
|
+
return /*#__PURE__*/React.createElement(BarGroup, Object.assign({}, baseProps, {
|
|
129
121
|
canvasStyle: canvasStyle
|
|
130
122
|
}));
|
|
131
123
|
}
|
|
132
|
-
case
|
|
124
|
+
case CHART_TYPE.BAR_STACK:
|
|
133
125
|
{
|
|
134
126
|
const {
|
|
135
127
|
config
|
|
@@ -138,55 +130,55 @@ const Wrapper = _ref => {
|
|
|
138
130
|
column_groupby_multiple_numeric_column,
|
|
139
131
|
column_groupby_column_key
|
|
140
132
|
} = config;
|
|
141
|
-
const BarGroupComponent = column_groupby_column_key || column_groupby_multiple_numeric_column ?
|
|
142
|
-
return /*#__PURE__*/
|
|
133
|
+
const BarGroupComponent = column_groupby_column_key || column_groupby_multiple_numeric_column ? BarStack : Bar;
|
|
134
|
+
return /*#__PURE__*/React.createElement(BarGroupComponent, Object.assign({}, baseProps, {
|
|
143
135
|
canvasStyle: canvasStyle
|
|
144
136
|
}));
|
|
145
137
|
}
|
|
146
|
-
case
|
|
138
|
+
case CHART_TYPE.COMPARE_BAR:
|
|
147
139
|
{
|
|
148
|
-
return /*#__PURE__*/
|
|
140
|
+
return /*#__PURE__*/React.createElement(BarCompare, Object.assign({}, baseProps, {
|
|
149
141
|
canvasStyle: canvasStyle
|
|
150
142
|
}));
|
|
151
143
|
}
|
|
152
|
-
case
|
|
144
|
+
case CHART_TYPE.BAR_CUSTOM:
|
|
153
145
|
{
|
|
154
|
-
return /*#__PURE__*/
|
|
146
|
+
return /*#__PURE__*/React.createElement(BarCustomStack, Object.assign({}, baseProps, {
|
|
155
147
|
canvasStyle: canvasStyle
|
|
156
148
|
}));
|
|
157
149
|
}
|
|
158
|
-
case
|
|
150
|
+
case CHART_TYPE.HORIZONTAL_BAR:
|
|
159
151
|
{
|
|
160
|
-
return /*#__PURE__*/
|
|
152
|
+
return /*#__PURE__*/React.createElement(HorizontalBar, Object.assign({}, baseProps, {
|
|
161
153
|
canvasStyle: canvasStyle
|
|
162
154
|
}));
|
|
163
155
|
}
|
|
164
|
-
case
|
|
156
|
+
case CHART_TYPE.HORIZONTAL_GROUP_BAR:
|
|
165
157
|
{
|
|
166
158
|
const {
|
|
167
159
|
config,
|
|
168
160
|
id,
|
|
169
161
|
style_config
|
|
170
162
|
} = chart;
|
|
171
|
-
const newConfig =
|
|
163
|
+
const newConfig = BaseUtils.convertConfig(config);
|
|
172
164
|
const newChart = {
|
|
173
165
|
id,
|
|
174
166
|
config: newConfig,
|
|
175
167
|
style_config
|
|
176
168
|
};
|
|
177
|
-
return /*#__PURE__*/
|
|
169
|
+
return /*#__PURE__*/React.createElement(HorizontalBarGroup, Object.assign({}, baseProps, {
|
|
178
170
|
canvasStyle: canvasStyle,
|
|
179
171
|
chart: newChart
|
|
180
172
|
}));
|
|
181
173
|
}
|
|
182
|
-
case
|
|
174
|
+
case CHART_TYPE.STACKED_HORIZONTAL_BAR:
|
|
183
175
|
{
|
|
184
176
|
const {
|
|
185
177
|
config,
|
|
186
178
|
id,
|
|
187
179
|
style_config
|
|
188
180
|
} = chart;
|
|
189
|
-
const newConfig =
|
|
181
|
+
const newConfig = BaseUtils.convertConfig(config);
|
|
190
182
|
const newChart = {
|
|
191
183
|
id,
|
|
192
184
|
config: newConfig,
|
|
@@ -196,135 +188,135 @@ const Wrapper = _ref => {
|
|
|
196
188
|
column_groupby_column_key,
|
|
197
189
|
column_groupby_multiple_numeric_column
|
|
198
190
|
} = config;
|
|
199
|
-
const HorizontalComponent = column_groupby_column_key || column_groupby_multiple_numeric_column ?
|
|
200
|
-
return /*#__PURE__*/
|
|
191
|
+
const HorizontalComponent = column_groupby_column_key || column_groupby_multiple_numeric_column ? HorizontalBarStack : HorizontalBar;
|
|
192
|
+
return /*#__PURE__*/React.createElement(HorizontalComponent, Object.assign({}, baseProps, {
|
|
201
193
|
canvasStyle: canvasStyle,
|
|
202
194
|
chart: newChart
|
|
203
195
|
}));
|
|
204
196
|
}
|
|
205
|
-
case
|
|
197
|
+
case CHART_TYPE.COMPLETENESS:
|
|
206
198
|
{
|
|
207
|
-
return /*#__PURE__*/
|
|
199
|
+
return /*#__PURE__*/React.createElement(Completeness, Object.assign({}, baseProps, {
|
|
208
200
|
canvasStyle: canvasStyle
|
|
209
201
|
}));
|
|
210
202
|
}
|
|
211
|
-
case
|
|
203
|
+
case CHART_TYPE.COMPLETENESS_GROUP:
|
|
212
204
|
{
|
|
213
|
-
return /*#__PURE__*/
|
|
205
|
+
return /*#__PURE__*/React.createElement(CompletenessGroup, Object.assign({}, baseProps, {
|
|
214
206
|
canvasStyle: canvasStyle
|
|
215
207
|
}));
|
|
216
208
|
}
|
|
217
|
-
case
|
|
209
|
+
case CHART_TYPE.LINE:
|
|
218
210
|
{
|
|
219
|
-
return /*#__PURE__*/
|
|
211
|
+
return /*#__PURE__*/React.createElement(Line, Object.assign({}, baseProps, {
|
|
220
212
|
canvasStyle: canvasStyle
|
|
221
213
|
}));
|
|
222
214
|
}
|
|
223
|
-
case
|
|
215
|
+
case CHART_TYPE.LINE_GROUP:
|
|
224
216
|
{
|
|
225
|
-
return /*#__PURE__*/
|
|
217
|
+
return /*#__PURE__*/React.createElement(LineGroup, Object.assign({}, baseProps, {
|
|
226
218
|
canvasStyle: canvasStyle
|
|
227
219
|
}));
|
|
228
220
|
}
|
|
229
|
-
case
|
|
221
|
+
case CHART_TYPE.AREA:
|
|
230
222
|
{
|
|
231
|
-
return /*#__PURE__*/
|
|
223
|
+
return /*#__PURE__*/React.createElement(Area, Object.assign({}, baseProps, {
|
|
232
224
|
canvasStyle: canvasStyle
|
|
233
225
|
}));
|
|
234
226
|
}
|
|
235
|
-
case
|
|
227
|
+
case CHART_TYPE.AREA_GROUP:
|
|
236
228
|
{
|
|
237
|
-
return /*#__PURE__*/
|
|
229
|
+
return /*#__PURE__*/React.createElement(AreaGroup, Object.assign({}, baseProps, {
|
|
238
230
|
canvasStyle: canvasStyle
|
|
239
231
|
}));
|
|
240
232
|
}
|
|
241
|
-
case
|
|
233
|
+
case CHART_TYPE.PIE:
|
|
242
234
|
{
|
|
243
|
-
return /*#__PURE__*/
|
|
235
|
+
return /*#__PURE__*/React.createElement(Pie, Object.assign({}, baseProps, {
|
|
244
236
|
canvasStyle: canvasStyle
|
|
245
237
|
}));
|
|
246
238
|
}
|
|
247
|
-
case
|
|
239
|
+
case CHART_TYPE.RING:
|
|
248
240
|
{
|
|
249
|
-
return /*#__PURE__*/
|
|
241
|
+
return /*#__PURE__*/React.createElement(Ring, Object.assign({}, baseProps, {
|
|
250
242
|
canvasStyle: canvasStyle
|
|
251
243
|
}));
|
|
252
244
|
}
|
|
253
|
-
case
|
|
245
|
+
case CHART_TYPE.SCATTER:
|
|
254
246
|
{
|
|
255
|
-
return /*#__PURE__*/
|
|
247
|
+
return /*#__PURE__*/React.createElement(Scatter, Object.assign({}, baseProps, {
|
|
256
248
|
canvasStyle: canvasStyle
|
|
257
249
|
}));
|
|
258
250
|
}
|
|
259
|
-
case
|
|
251
|
+
case CHART_TYPE.COMBINATION:
|
|
260
252
|
{
|
|
261
|
-
return /*#__PURE__*/
|
|
253
|
+
return /*#__PURE__*/React.createElement(Combination, Object.assign({}, baseProps, {
|
|
262
254
|
canvasStyle: canvasStyle
|
|
263
255
|
}));
|
|
264
256
|
}
|
|
265
|
-
case
|
|
257
|
+
case CHART_TYPE.MAP:
|
|
266
258
|
{
|
|
267
|
-
return /*#__PURE__*/
|
|
259
|
+
return /*#__PURE__*/React.createElement(Map, Object.assign({}, baseProps, {
|
|
268
260
|
canvasStyle: canvasStyle
|
|
269
261
|
}));
|
|
270
262
|
}
|
|
271
|
-
case
|
|
263
|
+
case CHART_TYPE.MAP_BUBBLE:
|
|
272
264
|
{
|
|
273
|
-
return /*#__PURE__*/
|
|
265
|
+
return /*#__PURE__*/React.createElement(MapBubble, Object.assign({}, baseProps, {
|
|
274
266
|
canvasStyle: canvasStyle
|
|
275
267
|
}));
|
|
276
268
|
}
|
|
277
|
-
case
|
|
269
|
+
case CHART_TYPE.WORLD_MAP:
|
|
278
270
|
{
|
|
279
|
-
return /*#__PURE__*/
|
|
271
|
+
return /*#__PURE__*/React.createElement(WorldMap, Object.assign({}, baseProps, {
|
|
280
272
|
canvasStyle: canvasStyle
|
|
281
273
|
}));
|
|
282
274
|
}
|
|
283
|
-
case
|
|
275
|
+
case CHART_TYPE.WORLD_MAP_BUBBLE:
|
|
284
276
|
{
|
|
285
|
-
return /*#__PURE__*/
|
|
277
|
+
return /*#__PURE__*/React.createElement(WorldMapBubble, Object.assign({}, baseProps, {
|
|
286
278
|
canvasStyle: canvasStyle
|
|
287
279
|
}));
|
|
288
280
|
}
|
|
289
|
-
case
|
|
281
|
+
case CHART_TYPE.HEAT_MAP:
|
|
290
282
|
{
|
|
291
|
-
return /*#__PURE__*/
|
|
283
|
+
return /*#__PURE__*/React.createElement(HeatMap, Object.assign({}, baseProps, {
|
|
292
284
|
canvasStyle: canvasStyle
|
|
293
285
|
}));
|
|
294
286
|
}
|
|
295
|
-
case
|
|
287
|
+
case CHART_TYPE.MIRROR:
|
|
296
288
|
{
|
|
297
|
-
return /*#__PURE__*/
|
|
289
|
+
return /*#__PURE__*/React.createElement(Mirror, Object.assign({}, baseProps, {
|
|
298
290
|
canvasStyle: canvasStyle
|
|
299
291
|
}));
|
|
300
292
|
}
|
|
301
|
-
case
|
|
293
|
+
case CHART_TYPE.DASHBOARD:
|
|
302
294
|
{
|
|
303
|
-
return /*#__PURE__*/
|
|
295
|
+
return /*#__PURE__*/React.createElement(Dashboard, Object.assign({}, baseProps, {
|
|
304
296
|
canvasStyle: canvasStyle
|
|
305
297
|
}));
|
|
306
298
|
}
|
|
307
|
-
case
|
|
299
|
+
case CHART_TYPE.TREE_MAP:
|
|
308
300
|
{
|
|
309
|
-
return /*#__PURE__*/
|
|
301
|
+
return /*#__PURE__*/React.createElement(Treemap, Object.assign({}, baseProps, {
|
|
310
302
|
canvasStyle: canvasStyle
|
|
311
303
|
}));
|
|
312
304
|
}
|
|
313
|
-
case
|
|
305
|
+
case CHART_TYPE.FUNNEL:
|
|
314
306
|
{
|
|
315
|
-
return /*#__PURE__*/
|
|
307
|
+
return /*#__PURE__*/React.createElement(Funnel, Object.assign({}, baseProps, {
|
|
316
308
|
canvasStyle: canvasStyle
|
|
317
309
|
}));
|
|
318
310
|
}
|
|
319
|
-
case
|
|
311
|
+
case CHART_TYPE.BASIC_NUMBER_CARD:
|
|
320
312
|
{
|
|
321
|
-
return /*#__PURE__*/
|
|
313
|
+
return /*#__PURE__*/React.createElement(BasicNumericCard, Object.assign({}, baseProps, {
|
|
322
314
|
canvasStyle: canvasStyle
|
|
323
315
|
}));
|
|
324
316
|
}
|
|
325
|
-
case
|
|
317
|
+
case CHART_TYPE.TREND:
|
|
326
318
|
{
|
|
327
|
-
return /*#__PURE__*/
|
|
319
|
+
return /*#__PURE__*/React.createElement(Trend, Object.assign({}, baseProps, {
|
|
328
320
|
canvasStyle: canvasStyle
|
|
329
321
|
}));
|
|
330
322
|
}
|
|
@@ -343,7 +335,7 @@ const Wrapper = _ref => {
|
|
|
343
335
|
const drillDownStatus = drill_down_status !== undefined && drill_down_status !== null ? drill_down_status : true;
|
|
344
336
|
// in dtable-statistics always support drill down
|
|
345
337
|
const supportDrillDown = isCalculateByView ? true : drillDownStatus;
|
|
346
|
-
return /*#__PURE__*/
|
|
338
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderChart(), isStatisticRecordsDialogShow && supportDrillDown && /*#__PURE__*/React.createElement(StatisticRecordDialog, {
|
|
347
339
|
chartRecordsParams: {
|
|
348
340
|
statisticRecord: {
|
|
349
341
|
...statisticRecords
|
|
@@ -360,4 +352,4 @@ const Wrapper = _ref => {
|
|
|
360
352
|
toggleStatisticRecordsDialog: toggleStatisticRecordsDialog
|
|
361
353
|
}));
|
|
362
354
|
};
|
|
363
|
-
|
|
355
|
+
export default Wrapper;
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _dtableUtils = require("dtable-utils");
|
|
15
|
-
var _constants = require("../../constants");
|
|
16
|
-
var _colorRules = require("../../constants/color-rules");
|
|
17
|
-
var _utils = require("../../utils");
|
|
18
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
19
|
-
var _tooltip = _interopRequireDefault(require("../../components/tooltip"));
|
|
20
|
-
var _chartComponent = _interopRequireDefault(require("./chart-component"));
|
|
21
|
-
class LineGroup extends _chartComponent.default {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { debounce } from 'lodash-es';
|
|
4
|
+
import * as d3 from 'd3';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import { CellType } from 'dtable-utils';
|
|
7
|
+
import { EMPTY_NAME, CHART_THEME_COLOR, CHART_LINE_TYPES } from '../../constants';
|
|
8
|
+
import { SUPPORT_SINGLE_SELECT_THEMES_OPTIONS } from '../../constants/color-rules';
|
|
9
|
+
import { BaseUtils, isFunction } from '../../utils';
|
|
10
|
+
import intl from '../../intl';
|
|
11
|
+
import ToolTip from '../../components/tooltip';
|
|
12
|
+
import ChartComponent from './chart-component';
|
|
13
|
+
class LineGroup extends ChartComponent {
|
|
22
14
|
constructor(props) {
|
|
23
15
|
super(props);
|
|
24
16
|
this.handleResize = () => {
|
|
@@ -50,11 +42,11 @@ class LineGroup extends _chartComponent.default {
|
|
|
50
42
|
let {
|
|
51
43
|
result: data
|
|
52
44
|
} = this.props;
|
|
53
|
-
data =
|
|
45
|
+
data = BaseUtils.formatEmptyName(data, 'group_name', intl.get('Empty'));
|
|
54
46
|
if (!Array.isArray(data)) return;
|
|
55
47
|
this.draw(data);
|
|
56
48
|
this.renderAxisLabel(this.props.chart, this.props.tables, this.container);
|
|
57
|
-
|
|
49
|
+
isFunction(customRender) && customRender(this.chart);
|
|
58
50
|
};
|
|
59
51
|
this.showTooltip = (event, data, contentWrapper) => {
|
|
60
52
|
const {
|
|
@@ -116,14 +108,14 @@ class LineGroup extends _chartComponent.default {
|
|
|
116
108
|
const {
|
|
117
109
|
y_axis_summary_method
|
|
118
110
|
} = chart.config;
|
|
119
|
-
const title = !data.name && typeof data.name !== 'number' ?
|
|
111
|
+
const title = !data.name && typeof data.name !== 'number' ? intl.get(EMPTY_NAME) : data.name;
|
|
120
112
|
const circleList = (_contentWrapper$selec = contentWrapper.selectAll('circle')) === null || _contentWrapper$selec === void 0 ? void 0 : _contentWrapper$selec.nodes();
|
|
121
113
|
const items = circleList.filter(circle => circle.getAttribute('data-name') === title).map(circle => {
|
|
122
|
-
const groupName = circle.getAttribute('data-groupName') ||
|
|
114
|
+
const groupName = circle.getAttribute('data-groupName') || intl.get(EMPTY_NAME);
|
|
123
115
|
return {
|
|
124
116
|
color: this.colorMap[groupName],
|
|
125
117
|
name: groupName,
|
|
126
|
-
value:
|
|
118
|
+
value: BaseUtils.getSummaryValueDisplayString(summaryColumn, Number(circle.getAttribute('data-text')), y_axis_summary_method)
|
|
127
119
|
};
|
|
128
120
|
});
|
|
129
121
|
items.sort((a, b) => String(a.name).localeCompare(String(b.name), undefined, {
|
|
@@ -143,7 +135,7 @@ class LineGroup extends _chartComponent.default {
|
|
|
143
135
|
chartColorTheme,
|
|
144
136
|
summaryColumn
|
|
145
137
|
} = this.props;
|
|
146
|
-
const theme =
|
|
138
|
+
const theme = CHART_THEME_COLOR[globalTheme];
|
|
147
139
|
const {
|
|
148
140
|
display_goal_line,
|
|
149
141
|
goal_value,
|
|
@@ -165,18 +157,18 @@ class LineGroup extends _chartComponent.default {
|
|
|
165
157
|
insertPadding,
|
|
166
158
|
marginTop
|
|
167
159
|
} = this.chartBoundingClientRect;
|
|
168
|
-
const useSingleSelectColumnColor = (columnGroupbyColumn === null || columnGroupbyColumn === void 0 ? void 0 : columnGroupbyColumn.type) ===
|
|
160
|
+
const useSingleSelectColumnColor = (columnGroupbyColumn === null || columnGroupbyColumn === void 0 ? void 0 : columnGroupbyColumn.type) === CellType.SINGLE_SELECT && color_theme === SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
169
161
|
useSingleSelectColumnColor ? this.setSingleSelectColorMap(data) : this.setColorMap(data, chartColorTheme, 'group_name', columnGroupbyColumn, chart);
|
|
170
162
|
|
|
171
163
|
// Y axis
|
|
172
164
|
const niceEnd = d3.nice(0, d3.max(data, d => d.value), 5)[1];
|
|
173
165
|
const y = d3.scaleLinear().domain(y_axis_auto_range ? [0, niceEnd] : [y_axis_min || 0, y_axis_max || niceEnd]).range([chartHeight - insertPadding, insertPadding + marginTop]);
|
|
174
|
-
this.chart.append('g').attr('class', 'y-axis-wrapper').attr('transform',
|
|
166
|
+
this.chart.append('g').attr('class', 'y-axis-wrapper').attr('transform', `translate(${insertPadding}, 0)`).call(d3.axisLeft(y).tickSizeInner(0).ticks(5).tickFormat(d => BaseUtils.getSummaryValueDisplayString(summaryColumn, d, y_axis_summary_method))).call(g => this.drawYaxis(g, theme));
|
|
175
167
|
|
|
176
168
|
// X axis
|
|
177
169
|
const xDomain = data.map(item => item.name);
|
|
178
170
|
const x = d3.scaleBand().domain(xDomain).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.4).paddingOuter(0.1);
|
|
179
|
-
this.chart.append('g').attr('class', 'x-axis-wrapper').attr('transform',
|
|
171
|
+
this.chart.append('g').attr('class', 'x-axis-wrapper').attr('transform', `translate(0, ${chartHeight - insertPadding})`).call(d3.axisBottom(x).tickSizeOuter(0).tickSizeInner(5)).call(g => {
|
|
180
172
|
this.ticksAddName(g);
|
|
181
173
|
g.selectAll('.domain').attr('stroke', theme.XAxisColor);
|
|
182
174
|
g.selectAll('.tick line').attr('stroke', theme.XAxisColor);
|
|
@@ -201,7 +193,7 @@ class LineGroup extends _chartComponent.default {
|
|
|
201
193
|
circleData[index]['y'] = yVal;
|
|
202
194
|
circleData[index]['value'] = d.value;
|
|
203
195
|
return yVal;
|
|
204
|
-
}).curve(line_type ===
|
|
196
|
+
}).curve(line_type === CHART_LINE_TYPES[1] ? d3.curveBumpX : d3.curveLinear);
|
|
205
197
|
const group_name = item[0];
|
|
206
198
|
const data = item[1];
|
|
207
199
|
contentWrapper.append('path').attr('fill', 'none').attr('stroke', this.colorMap[group_name]).attr('stroke-width', 2).attr('d', () => line(data));
|
|
@@ -223,13 +215,13 @@ class LineGroup extends _chartComponent.default {
|
|
|
223
215
|
// circle label
|
|
224
216
|
if (y_axis_show_value) {
|
|
225
217
|
const curCircleEl = g.node();
|
|
226
|
-
contentWrapper.append('text').attr('stroke', '#fff').attr('stroke-width', 1).attr('paint-order', 'stroke').attr('fill', theme.labelColor).attr('font-size',
|
|
218
|
+
contentWrapper.append('text').attr('stroke', '#fff').attr('stroke-width', 1).attr('paint-order', 'stroke').attr('fill', theme.labelColor).attr('font-size', BaseUtils.getLabelFontSize(label_font_size)).text(BaseUtils.getSummaryValueDisplayString(summaryColumn, Number(curCircleEl.getAttribute('data-text')), y_axis_summary_method)).call(g => {
|
|
227
219
|
const {
|
|
228
220
|
width
|
|
229
221
|
} = g.node().getBoundingClientRect();
|
|
230
222
|
const translateX = Number(curCircleEl.getAttribute('cx')) - width / 2;
|
|
231
223
|
const translateY = Number(curCircleEl.getAttribute('cy')) - 10;
|
|
232
|
-
g.attr('transform',
|
|
224
|
+
g.attr('transform', `translate(${translateX}, ${translateY})`);
|
|
233
225
|
});
|
|
234
226
|
}
|
|
235
227
|
}).on('click', (event, data) => {
|
|
@@ -319,7 +311,7 @@ class LineGroup extends _chartComponent.default {
|
|
|
319
311
|
}
|
|
320
312
|
});
|
|
321
313
|
// line
|
|
322
|
-
const theme =
|
|
314
|
+
const theme = CHART_THEME_COLOR[globalTheme];
|
|
323
315
|
this.clearOldVerticalAnnotation(contentWrapper);
|
|
324
316
|
this.addVerticalAnnotation(contentWrapper, minDistanceItem, theme);
|
|
325
317
|
} else {
|
|
@@ -352,12 +344,12 @@ class LineGroup extends _chartComponent.default {
|
|
|
352
344
|
componentDidMount() {
|
|
353
345
|
this.createChart();
|
|
354
346
|
this.drawChart();
|
|
355
|
-
this.debouncedHandleResize =
|
|
347
|
+
this.debouncedHandleResize = debounce(this.handleResize, 300);
|
|
356
348
|
window.addEventListener('resize', this.debouncedHandleResize);
|
|
357
349
|
}
|
|
358
350
|
componentDidUpdate(prevProps) {
|
|
359
351
|
super.componentDidUpdate(prevProps);
|
|
360
|
-
if (
|
|
352
|
+
if (BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
361
353
|
this.destroyChart();
|
|
362
354
|
this.createChart();
|
|
363
355
|
this.drawChart();
|
|
@@ -375,13 +367,13 @@ class LineGroup extends _chartComponent.default {
|
|
|
375
367
|
tooltipData,
|
|
376
368
|
toolTipPosition
|
|
377
369
|
} = this.state;
|
|
378
|
-
return /*#__PURE__*/
|
|
370
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
379
371
|
ref: ref => this.container = ref,
|
|
380
|
-
className: (
|
|
372
|
+
className: classNames('sea-chart-container', {
|
|
381
373
|
'show-x-axis-label': this.isShowXAxisLabel(chart),
|
|
382
374
|
'show-y-axis-label': this.isShowYAxisLabel(chart)
|
|
383
375
|
})
|
|
384
|
-
}, /*#__PURE__*/
|
|
376
|
+
}, /*#__PURE__*/React.createElement(ToolTip, {
|
|
385
377
|
tooltipData: tooltipData,
|
|
386
378
|
toolTipPosition: toolTipPosition,
|
|
387
379
|
chart: this.chart
|
|
@@ -389,16 +381,16 @@ class LineGroup extends _chartComponent.default {
|
|
|
389
381
|
}
|
|
390
382
|
}
|
|
391
383
|
LineGroup.propTypes = {
|
|
392
|
-
canvasStyle:
|
|
393
|
-
chart:
|
|
394
|
-
groupbyColumn:
|
|
395
|
-
columnGroupbyColumn:
|
|
396
|
-
summaryColumn:
|
|
397
|
-
result:
|
|
398
|
-
tables:
|
|
399
|
-
globalTheme:
|
|
400
|
-
chartColorTheme:
|
|
401
|
-
toggleRecords:
|
|
402
|
-
customRender:
|
|
384
|
+
canvasStyle: PropTypes.object,
|
|
385
|
+
chart: PropTypes.object,
|
|
386
|
+
groupbyColumn: PropTypes.object,
|
|
387
|
+
columnGroupbyColumn: PropTypes.object,
|
|
388
|
+
summaryColumn: PropTypes.object,
|
|
389
|
+
result: PropTypes.array,
|
|
390
|
+
tables: PropTypes.array,
|
|
391
|
+
globalTheme: PropTypes.string,
|
|
392
|
+
chartColorTheme: PropTypes.string,
|
|
393
|
+
toggleRecords: PropTypes.func,
|
|
394
|
+
customRender: PropTypes.func
|
|
403
395
|
};
|
|
404
|
-
|
|
396
|
+
export default LineGroup;
|