sea-chart 2.0.37 → 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 +20 -69
- package/dist/assets/css/sea-chart-d3-tooltip.css +0 -1
- 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 +31 -37
- 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 +41 -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 +12 -23
- package/dist/components/index.js +7 -48
- package/dist/components/loading/index.js +6 -13
- package/dist/components/number-input/index.js +11 -24
- package/dist/components/pixel-editor/index.js +15 -23
- package/dist/components/popover/hide-column-popover/hide-column-popover-widgets/hide-column-item.js +13 -16
- package/dist/components/popover/hide-column-popover/hide-column-popover.css +5 -1
- package/dist/components/popover/hide-column-popover/hide-column-popover.js +28 -38
- package/dist/components/popover/sort-popover/sort-popover-widgets/sort-utils.js +9 -18
- package/dist/components/popover/sort-popover/sort-popover.js +58 -69
- 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 +61 -68
- package/dist/components/tooltip/index.js +39 -28
- 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 +13 -16
- 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 +2 -7
- package/dist/locale/lang/en.js +2 -7
- package/dist/locale/lang/es.js +2 -7
- package/dist/locale/lang/fr.js +2 -7
- package/dist/locale/lang/pt.js +2 -7
- package/dist/locale/lang/ru.js +2 -7
- package/dist/locale/lang/zh_CN.js +2 -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 +14 -17
- 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 +14 -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 +66 -73
- 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 +51 -59
- package/dist/settings/basic-number-card/data-settings.js +50 -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 -64
- package/dist/settings/combination-settings/index.js +3 -20
- package/dist/settings/combination-settings/style-settings.js +67 -75
- 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 +44 -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 +22 -30
- 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 +57 -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 +49 -58
- package/dist/settings/table-element-settings/data-settings.js +21 -29
- package/dist/settings/table-element-settings/index.css +1 -31
- package/dist/settings/table-element-settings/index.js +2 -13
- package/dist/settings/table-settings/data-settings.js +113 -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 +44 -52
- 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 +59 -66
- 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 +27 -34
- package/dist/settings/widgets/data-filter/index.js +59 -59
- 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 +52 -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 +75 -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 +65 -72
- package/dist/utils/cell-format-utils.js +25 -33
- package/dist/utils/cell-value-utils.js +4 -11
- package/dist/utils/chart-utils/base-utils.js +467 -367
- package/dist/utils/chart-utils/index.js +29 -40
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +78 -85
- package/dist/utils/chart-utils/original-data-utils/card-calculator.js +20 -21
- 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 +28 -26
- 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 +94 -97
- package/dist/utils/chart-utils/original-data-utils/scatter-calculator.js +19 -25
- package/dist/utils/chart-utils/original-data-utils/trend-calculator.js +50 -36
- package/dist/utils/chart-utils/sql-statistics-utils.js +385 -388
- 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 +88 -102
- package/dist/utils/common-utils.js +28 -53
- package/dist/utils/concurrency-manager.js +1 -7
- package/dist/utils/contexts.js +7 -11
- 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 +73 -219
- 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 +251 -183
- 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 +162 -172
- package/dist/utils/sql/index.js +3 -27
- package/dist/utils/trend-utils.js +50 -45
- package/dist/view/index.css +2 -8
- package/dist/view/index.js +102 -103
- package/dist/view/title/index.js +16 -24
- package/dist/view/wrapper/area-group.js +57 -57
- package/dist/view/wrapper/area.js +43 -51
- package/dist/view/wrapper/bar-compare.js +56 -48
- package/dist/view/wrapper/bar-custom-stack.js +73 -55
- package/dist/view/wrapper/bar-group.js +94 -73
- package/dist/view/wrapper/bar-stack.js +49 -57
- package/dist/view/wrapper/bar.js +40 -48
- package/dist/view/wrapper/basic-number-card.js +50 -34
- package/dist/view/wrapper/chart-component.js +164 -569
- package/dist/view/wrapper/combination.js +55 -63
- package/dist/view/wrapper/completeness-group.js +140 -93
- package/dist/view/wrapper/completeness.js +36 -44
- package/dist/view/wrapper/dashboard.js +104 -59
- 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 +70 -58
- package/dist/view/wrapper/horizontal-bar-stack.js +48 -56
- package/dist/view/wrapper/horizontal-bar.js +41 -49
- package/dist/view/wrapper/index.js +107 -115
- package/dist/view/wrapper/line-group.js +49 -52
- 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 +40 -47
- package/dist/view/wrapper/map-world.js +42 -49
- package/dist/view/wrapper/map.js +42 -50
- package/dist/view/wrapper/mirror.js +41 -49
- package/dist/view/wrapper/pie.js +45 -53
- package/dist/view/wrapper/ring.js +50 -58
- package/dist/view/wrapper/scatter.js +50 -56
- 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 -92
- 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 -16
- 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 +8 -13
- 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 +30 -43
- package/dist/view/wrapper/treemap.js +38 -46
- package/dist/view/wrapper/trend.js +80 -65
- package/package.json +15 -12
|
@@ -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,15 +108,20 @@ 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 => {
|
|
114
|
+
const groupName = circle.getAttribute('data-groupName') || intl.get(EMPTY_NAME);
|
|
122
115
|
return {
|
|
123
|
-
color: this.colorMap[
|
|
124
|
-
name:
|
|
125
|
-
value:
|
|
116
|
+
color: this.colorMap[groupName],
|
|
117
|
+
name: groupName,
|
|
118
|
+
value: BaseUtils.getSummaryValueDisplayString(summaryColumn, Number(circle.getAttribute('data-text')), y_axis_summary_method)
|
|
126
119
|
};
|
|
127
120
|
});
|
|
121
|
+
items.sort((a, b) => String(a.name).localeCompare(String(b.name), undefined, {
|
|
122
|
+
numeric: true,
|
|
123
|
+
sensitivity: 'base'
|
|
124
|
+
}));
|
|
128
125
|
return {
|
|
129
126
|
title,
|
|
130
127
|
items
|
|
@@ -138,7 +135,7 @@ class LineGroup extends _chartComponent.default {
|
|
|
138
135
|
chartColorTheme,
|
|
139
136
|
summaryColumn
|
|
140
137
|
} = this.props;
|
|
141
|
-
const theme =
|
|
138
|
+
const theme = CHART_THEME_COLOR[globalTheme];
|
|
142
139
|
const {
|
|
143
140
|
display_goal_line,
|
|
144
141
|
goal_value,
|
|
@@ -160,18 +157,18 @@ class LineGroup extends _chartComponent.default {
|
|
|
160
157
|
insertPadding,
|
|
161
158
|
marginTop
|
|
162
159
|
} = this.chartBoundingClientRect;
|
|
163
|
-
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;
|
|
164
161
|
useSingleSelectColumnColor ? this.setSingleSelectColorMap(data) : this.setColorMap(data, chartColorTheme, 'group_name', columnGroupbyColumn, chart);
|
|
165
162
|
|
|
166
163
|
// Y axis
|
|
167
164
|
const niceEnd = d3.nice(0, d3.max(data, d => d.value), 5)[1];
|
|
168
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]);
|
|
169
|
-
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));
|
|
170
167
|
|
|
171
168
|
// X axis
|
|
172
169
|
const xDomain = data.map(item => item.name);
|
|
173
170
|
const x = d3.scaleBand().domain(xDomain).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.4).paddingOuter(0.1);
|
|
174
|
-
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 => {
|
|
175
172
|
this.ticksAddName(g);
|
|
176
173
|
g.selectAll('.domain').attr('stroke', theme.XAxisColor);
|
|
177
174
|
g.selectAll('.tick line').attr('stroke', theme.XAxisColor);
|
|
@@ -196,7 +193,7 @@ class LineGroup extends _chartComponent.default {
|
|
|
196
193
|
circleData[index]['y'] = yVal;
|
|
197
194
|
circleData[index]['value'] = d.value;
|
|
198
195
|
return yVal;
|
|
199
|
-
}).curve(line_type ===
|
|
196
|
+
}).curve(line_type === CHART_LINE_TYPES[1] ? d3.curveBumpX : d3.curveLinear);
|
|
200
197
|
const group_name = item[0];
|
|
201
198
|
const data = item[1];
|
|
202
199
|
contentWrapper.append('path').attr('fill', 'none').attr('stroke', this.colorMap[group_name]).attr('stroke-width', 2).attr('d', () => line(data));
|
|
@@ -218,13 +215,13 @@ class LineGroup extends _chartComponent.default {
|
|
|
218
215
|
// circle label
|
|
219
216
|
if (y_axis_show_value) {
|
|
220
217
|
const curCircleEl = g.node();
|
|
221
|
-
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 => {
|
|
222
219
|
const {
|
|
223
220
|
width
|
|
224
221
|
} = g.node().getBoundingClientRect();
|
|
225
222
|
const translateX = Number(curCircleEl.getAttribute('cx')) - width / 2;
|
|
226
223
|
const translateY = Number(curCircleEl.getAttribute('cy')) - 10;
|
|
227
|
-
g.attr('transform',
|
|
224
|
+
g.attr('transform', `translate(${translateX}, ${translateY})`);
|
|
228
225
|
});
|
|
229
226
|
}
|
|
230
227
|
}).on('click', (event, data) => {
|
|
@@ -314,7 +311,7 @@ class LineGroup extends _chartComponent.default {
|
|
|
314
311
|
}
|
|
315
312
|
});
|
|
316
313
|
// line
|
|
317
|
-
const theme =
|
|
314
|
+
const theme = CHART_THEME_COLOR[globalTheme];
|
|
318
315
|
this.clearOldVerticalAnnotation(contentWrapper);
|
|
319
316
|
this.addVerticalAnnotation(contentWrapper, minDistanceItem, theme);
|
|
320
317
|
} else {
|
|
@@ -347,12 +344,12 @@ class LineGroup extends _chartComponent.default {
|
|
|
347
344
|
componentDidMount() {
|
|
348
345
|
this.createChart();
|
|
349
346
|
this.drawChart();
|
|
350
|
-
this.debouncedHandleResize =
|
|
347
|
+
this.debouncedHandleResize = debounce(this.handleResize, 300);
|
|
351
348
|
window.addEventListener('resize', this.debouncedHandleResize);
|
|
352
349
|
}
|
|
353
350
|
componentDidUpdate(prevProps) {
|
|
354
351
|
super.componentDidUpdate(prevProps);
|
|
355
|
-
if (
|
|
352
|
+
if (BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
356
353
|
this.destroyChart();
|
|
357
354
|
this.createChart();
|
|
358
355
|
this.drawChart();
|
|
@@ -370,13 +367,13 @@ class LineGroup extends _chartComponent.default {
|
|
|
370
367
|
tooltipData,
|
|
371
368
|
toolTipPosition
|
|
372
369
|
} = this.state;
|
|
373
|
-
return /*#__PURE__*/
|
|
370
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
374
371
|
ref: ref => this.container = ref,
|
|
375
|
-
className: (
|
|
372
|
+
className: classNames('sea-chart-container', {
|
|
376
373
|
'show-x-axis-label': this.isShowXAxisLabel(chart),
|
|
377
374
|
'show-y-axis-label': this.isShowYAxisLabel(chart)
|
|
378
375
|
})
|
|
379
|
-
}, /*#__PURE__*/
|
|
376
|
+
}, /*#__PURE__*/React.createElement(ToolTip, {
|
|
380
377
|
tooltipData: tooltipData,
|
|
381
378
|
toolTipPosition: toolTipPosition,
|
|
382
379
|
chart: this.chart
|
|
@@ -384,16 +381,16 @@ class LineGroup extends _chartComponent.default {
|
|
|
384
381
|
}
|
|
385
382
|
}
|
|
386
383
|
LineGroup.propTypes = {
|
|
387
|
-
canvasStyle:
|
|
388
|
-
chart:
|
|
389
|
-
groupbyColumn:
|
|
390
|
-
columnGroupbyColumn:
|
|
391
|
-
summaryColumn:
|
|
392
|
-
result:
|
|
393
|
-
tables:
|
|
394
|
-
globalTheme:
|
|
395
|
-
chartColorTheme:
|
|
396
|
-
toggleRecords:
|
|
397
|
-
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
|
|
398
395
|
};
|
|
399
|
-
|
|
396
|
+
export default LineGroup;
|