sea-chart 2.0.43 → 2.0.45
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 +4 -11
- package/dist/components/cell-factory/FormatterConfig.js +55 -62
- package/dist/components/cell-factory/SimpleCellFormatter.js +4 -11
- 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 +27 -35
- 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 +11 -18
- package/dist/components/color-popover/color-rules/color-rule.js +25 -33
- package/dist/components/color-popover/color-rules/index.js +6 -14
- 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 +10 -18
- package/dist/components/color-popover/color-rules-popover.js +26 -34
- package/dist/components/color-popover/color-selector-popover.js +10 -18
- package/dist/components/color-setting/color-group-selector.js +12 -20
- package/dist/components/common-add-tool/index.js +6 -13
- package/dist/components/data-process-setter/data-setting-header.js +7 -14
- package/dist/components/data-process-setter/hide-column-setter.js +12 -19
- package/dist/components/data-process-setter/index.js +4 -27
- package/dist/components/data-process-setter/sort-setter.js +16 -24
- package/dist/components/draggable/Draggable.js +7 -13
- package/dist/components/drill-down-settings/drill-down-fields-popover/index.js +42 -50
- 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 +4 -11
- 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 +25 -33
- package/dist/components/popover/sort-popover/sort-popover-widgets/sort-utils.js +9 -18
- package/dist/components/popover/sort-popover/sort-popover.js +54 -64
- package/dist/components/resize-handle/ResizeHandle.js +6 -13
- package/dist/components/row-card/row-card-header-cell.js +15 -22
- package/dist/components/row-card/row-card-header.js +14 -21
- package/dist/components/row-card/row-card-item.js +33 -41
- package/dist/components/row-card/row-card.js +15 -23
- package/dist/components/statistic-record-dialog/index.js +56 -64
- package/dist/components/tooltip/index.js +21 -21
- package/dist/components/types-dialog/index.js +56 -64
- 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 +149 -273
- 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 +20 -24
- 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 +8 -11
- package/dist/model/basic-number-card.js +13 -20
- package/dist/model/chart.js +7 -13
- package/dist/model/combination.js +19 -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 +15 -18
- package/dist/model/horizontal-group-bar.js +14 -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 +15 -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 +7 -13
- 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 +83 -74
- 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 +69 -60
- 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 +18 -26
- 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 +94 -77
- 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 +26 -34
- 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 +64 -72
- 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 +111 -119
- 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 +62 -53
- 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 +17 -25
- package/dist/settings/widgets/axis-title-font-settings/index.js +39 -0
- 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 +24 -32
- 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 +23 -31
- 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 +72 -80
- package/dist/settings/widgets/switch/index.js +8 -15
- 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 +63 -71
- package/dist/utils/cell-format-utils.js +18 -28
- package/dist/utils/cell-value-utils.js +5 -12
- package/dist/utils/chart-utils/base-utils.js +362 -334
- package/dist/utils/chart-utils/index.js +28 -41
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +80 -86
- 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 +19 -26
- package/dist/utils/chart-utils/original-data-utils/completeness-calculator.js +32 -39
- 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 +21 -28
- package/dist/utils/chart-utils/original-data-utils/pivot-table-calculator.js +91 -97
- 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 +284 -246
- package/dist/utils/chart.js +9 -17
- package/dist/utils/collaborator-manager.js +3 -9
- package/dist/utils/collaborator-utils.js +18 -30
- package/dist/utils/collaborator.js +4 -13
- package/dist/utils/color-utils.js +18 -29
- package/dist/utils/column-utils.js +65 -92
- package/dist/utils/common-utils.js +27 -52
- package/dist/utils/concurrency-manager.js +1 -7
- package/dist/utils/contexts.js +5 -12
- package/dist/utils/date-translate.js +11 -19
- 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 +1 -7
- package/dist/utils/options-utils.js +8 -16
- package/dist/utils/row-record-utils.js +182 -178
- package/dist/utils/row-utils.js +27 -38
- package/dist/utils/search.js +24 -32
- package/dist/utils/sql/chart-data-sql.js +49 -55
- package/dist/utils/sql/column-2-sql-column.js +146 -154
- package/dist/utils/sql/index.js +3 -27
- package/dist/utils/trend-utils.js +39 -47
- package/dist/view/index.css +0 -17
- package/dist/view/index.js +89 -95
- package/dist/view/title/index.js +15 -23
- package/dist/view/wrapper/area-group.js +57 -74
- package/dist/view/wrapper/area.js +51 -72
- package/dist/view/wrapper/bar-compare.js +47 -58
- package/dist/view/wrapper/bar-custom-stack.js +53 -121
- package/dist/view/wrapper/bar-group.js +55 -96
- package/dist/view/wrapper/bar-stack.js +58 -92
- package/dist/view/wrapper/bar.js +45 -66
- package/dist/view/wrapper/basic-number-card.js +25 -26
- package/dist/view/wrapper/chart-component.js +600 -166
- package/dist/view/wrapper/combination.js +79 -87
- package/dist/view/wrapper/completeness-group.js +46 -98
- package/dist/view/wrapper/completeness.js +45 -97
- package/dist/view/wrapper/dashboard.js +33 -47
- package/dist/view/wrapper/funnel.js +65 -64
- package/dist/view/wrapper/heat-map.js +126 -104
- package/dist/view/wrapper/horizontal-bar-group.js +61 -78
- package/dist/view/wrapper/horizontal-bar-stack.js +60 -111
- package/dist/view/wrapper/horizontal-bar.js +45 -68
- package/dist/view/wrapper/index.js +110 -115
- package/dist/view/wrapper/line-group.js +52 -68
- package/dist/view/wrapper/line.js +47 -67
- package/dist/view/wrapper/map-bubble.js +46 -59
- package/dist/view/wrapper/map-world-bubble.js +45 -58
- package/dist/view/wrapper/map-world.js +47 -60
- package/dist/view/wrapper/map.js +48 -60
- package/dist/view/wrapper/mirror.js +45 -64
- package/dist/view/wrapper/pie.js +51 -59
- package/dist/view/wrapper/ring.js +57 -64
- package/dist/view/wrapper/scatter.js +53 -69
- package/dist/view/wrapper/table/index.js +13 -21
- 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 +50 -58
- package/dist/view/wrapper/table/pivot-table-display-name.js +83 -91
- package/dist/view/wrapper/table/two-dimension-table.js +76 -84
- package/dist/view/wrapper/table-element/components/dataset-utils.js +23 -36
- package/dist/view/wrapper/table-element/components/formatter.js +96 -105
- package/dist/view/wrapper/table-element/components/formatters/FileFormatter/index.js +22 -31
- package/dist/view/wrapper/table-element/components/formatters/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/formatters/link-formatter.js +73 -80
- package/dist/view/wrapper/table-element/components/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/link-formatter.js +73 -80
- package/dist/view/wrapper/table-element/components/record.js +10 -17
- package/dist/view/wrapper/table-element/components/records-body.js +17 -19
- 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 +23 -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 +5 -15
- 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 +39 -57
- package/dist/view/wrapper/trend.js +41 -48
- package/package.json +1 -1
|
@@ -1,31 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _topojson = require("topojson");
|
|
14
|
-
var _dtableUtils = require("dtable-utils");
|
|
15
|
-
var _constants = require("../../constants");
|
|
16
|
-
var _utils = require("../../utils");
|
|
17
|
-
var _context = _interopRequireDefault(require("../../context"));
|
|
18
|
-
var _mapJson = _interopRequireDefault(require("../../services/map-json"));
|
|
19
|
-
var _tooltip = _interopRequireDefault(require("../../components/tooltip"));
|
|
20
|
-
var _chartComponent = _interopRequireDefault(require("./chart-component"));
|
|
21
|
-
class MapBubble extends _chartComponent.default {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import * as d3 from 'd3';
|
|
4
|
+
import { feature } from 'topojson';
|
|
5
|
+
import { getTableById, getTableColumnByKey } from 'dtable-utils';
|
|
6
|
+
import { CHART_SUMMARY_TYPE, MAP_LEVEL, DEFAULT_NUMBER_FORMAT_OBJECT, CHART_THEME_COLOR } from '../../constants';
|
|
7
|
+
import { BaseUtils } from '../../utils';
|
|
8
|
+
import context from '../../context';
|
|
9
|
+
import fetchMapJson from '../../services/map-json';
|
|
10
|
+
import ToolTip from '../../components/tooltip';
|
|
11
|
+
import ChartComponent from './chart-component';
|
|
12
|
+
class MapBubble extends ChartComponent {
|
|
22
13
|
constructor(props) {
|
|
23
14
|
super(props);
|
|
24
|
-
this.handleResize = () => {
|
|
25
|
-
this.destroyChart();
|
|
26
|
-
this.createChart();
|
|
27
|
-
this.drawChart();
|
|
28
|
-
};
|
|
29
15
|
this.createChart = () => {
|
|
30
16
|
const {
|
|
31
17
|
chart
|
|
@@ -43,13 +29,13 @@ class MapBubble extends _chartComponent.default {
|
|
|
43
29
|
if (!Array.isArray(data)) return;
|
|
44
30
|
const {
|
|
45
31
|
map_location,
|
|
46
|
-
map_level =
|
|
32
|
+
map_level = MAP_LEVEL.COUNTRY,
|
|
47
33
|
type
|
|
48
34
|
} = chart.config;
|
|
49
|
-
const mediaUrl =
|
|
50
|
-
const mapJson = await (
|
|
35
|
+
const mediaUrl = context.getSetting('mediaUrl');
|
|
36
|
+
const mapJson = await fetchMapJson(map_level, map_location, mediaUrl);
|
|
51
37
|
if (!mapJson) return;
|
|
52
|
-
const newMapJson = map_level ===
|
|
38
|
+
const newMapJson = map_level === MAP_LEVEL.COUNTRY ? feature(mapJson, mapJson.objects) : mapJson;
|
|
53
39
|
const statisticNewData = this.formatMapStatisticData(data, newMapJson, type);
|
|
54
40
|
this.draw(statisticNewData, newMapJson);
|
|
55
41
|
};
|
|
@@ -101,7 +87,7 @@ class MapBubble extends _chartComponent.default {
|
|
|
101
87
|
globalTheme,
|
|
102
88
|
canvasStyle
|
|
103
89
|
} = this.props;
|
|
104
|
-
const theme =
|
|
90
|
+
const theme = CHART_THEME_COLOR[globalTheme];
|
|
105
91
|
const {
|
|
106
92
|
legend_size,
|
|
107
93
|
legend_direction,
|
|
@@ -124,7 +110,7 @@ class MapBubble extends _chartComponent.default {
|
|
|
124
110
|
// 3. Rendering map
|
|
125
111
|
this.chart.append('g').attr('class', 'map-wrapper').selectAll().data(mapJson.features).join('g').append('path').attr('d', d => {
|
|
126
112
|
return pathGenerator(d);
|
|
127
|
-
}).attr('stroke-width', 1).attr('stroke', '#bdbdbd').attr('stroke-opacity', 1).attr('fill', '#e2e2e2').attr('opacity', 1).attr('data-name', d => d.properties.name);
|
|
113
|
+
}).attr('stroke-width', 1).attr('stroke', '#bdbdbd').attr('stroke-opacity', 1).attr('fill', '#e2e2e2').attr('opacity', 1).attr('data-name', d => d.properties.name).call(g => this.animateFadeIn(g));
|
|
128
114
|
|
|
129
115
|
// draw bubble circle
|
|
130
116
|
this.drawCircle(data, mapJson, pathGenerator);
|
|
@@ -136,32 +122,33 @@ class MapBubble extends _chartComponent.default {
|
|
|
136
122
|
theme,
|
|
137
123
|
legendDirection: legend_direction,
|
|
138
124
|
legendSize: legend_size,
|
|
139
|
-
legendTextRange: [
|
|
125
|
+
legendTextRange: [BaseUtils.getSummaryValueDisplayString(columnData, d3.min(data, d => d.value), summary_method), BaseUtils.getSummaryValueDisplayString(columnData, d3.max(data, d => d.value), summary_method)],
|
|
140
126
|
type,
|
|
141
127
|
bubbleColor: bubble_color
|
|
142
128
|
});
|
|
143
129
|
};
|
|
144
130
|
this.handleAcitveAndInActiveState = (state, event, highlightedBorderColor) => {
|
|
145
131
|
if (state === 'active') {
|
|
146
|
-
d3.select(event.currentTarget).transition().duration(this.
|
|
132
|
+
d3.select(event.currentTarget).transition().duration(this.interactionDuration).attr('fill-opacity', 0.9);
|
|
147
133
|
return;
|
|
148
134
|
}
|
|
149
|
-
d3.select(event.currentTarget).transition().duration(this.
|
|
135
|
+
d3.select(event.currentTarget).transition().duration(this.interactionDuration).attr('fill-opacity', 0.6);
|
|
150
136
|
};
|
|
151
137
|
this.getColumnData = () => {
|
|
152
138
|
const {
|
|
153
|
-
chart
|
|
139
|
+
chart,
|
|
140
|
+
tables
|
|
154
141
|
} = this.props;
|
|
155
142
|
const {
|
|
156
143
|
summary_type,
|
|
157
144
|
summary_column_key,
|
|
158
145
|
table_id
|
|
159
146
|
} = chart.config;
|
|
160
|
-
let columnData =
|
|
161
|
-
if (summary_type ===
|
|
162
|
-
const table = (
|
|
163
|
-
const summaryColumn =
|
|
164
|
-
columnData = summaryColumn.data ||
|
|
147
|
+
let columnData = DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
148
|
+
if (summary_type === CHART_SUMMARY_TYPE.ADVANCED) {
|
|
149
|
+
const table = getTableById(tables, table_id);
|
|
150
|
+
const summaryColumn = getTableColumnByKey(table, summary_column_key) || {};
|
|
151
|
+
columnData = summaryColumn.data || DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
165
152
|
}
|
|
166
153
|
return columnData;
|
|
167
154
|
};
|
|
@@ -212,6 +199,7 @@ class MapBubble extends _chartComponent.default {
|
|
|
212
199
|
});
|
|
213
200
|
}
|
|
214
201
|
});
|
|
202
|
+
this.animateCircleZoomIn(bubbleWrapper.selectAll('circle'));
|
|
215
203
|
};
|
|
216
204
|
this.chart = null;
|
|
217
205
|
this.state = {
|
|
@@ -222,12 +210,11 @@ class MapBubble extends _chartComponent.default {
|
|
|
222
210
|
componentDidMount() {
|
|
223
211
|
this.createChart();
|
|
224
212
|
this.drawChart();
|
|
225
|
-
|
|
226
|
-
window.addEventListener('resize', this.debouncedHandleResize);
|
|
213
|
+
super.componentDidMount();
|
|
227
214
|
}
|
|
228
215
|
componentDidUpdate(prevProps) {
|
|
229
216
|
super.componentDidUpdate(prevProps);
|
|
230
|
-
if (
|
|
217
|
+
if (BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
231
218
|
this.destroyChart();
|
|
232
219
|
this.createChart();
|
|
233
220
|
this.drawChart();
|
|
@@ -235,17 +222,17 @@ class MapBubble extends _chartComponent.default {
|
|
|
235
222
|
}
|
|
236
223
|
componentWillUnmount() {
|
|
237
224
|
this.destroyChart();
|
|
238
|
-
|
|
225
|
+
super.componentWillUnmount();
|
|
239
226
|
}
|
|
240
227
|
render() {
|
|
241
228
|
const {
|
|
242
229
|
tooltipData,
|
|
243
230
|
toolTipPosition
|
|
244
231
|
} = this.state;
|
|
245
|
-
return /*#__PURE__*/
|
|
232
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
246
233
|
ref: ref => this.container = ref,
|
|
247
234
|
className: "sea-chart-container"
|
|
248
|
-
}, /*#__PURE__*/
|
|
235
|
+
}, /*#__PURE__*/React.createElement(ToolTip, {
|
|
249
236
|
tooltipData: tooltipData,
|
|
250
237
|
toolTipPosition: toolTipPosition,
|
|
251
238
|
chart: this.chart
|
|
@@ -253,16 +240,16 @@ class MapBubble extends _chartComponent.default {
|
|
|
253
240
|
}
|
|
254
241
|
}
|
|
255
242
|
MapBubble.propTypes = {
|
|
256
|
-
canvasStyle:
|
|
257
|
-
chart:
|
|
258
|
-
groupbyColumn:
|
|
259
|
-
columnGroupbyColumn:
|
|
260
|
-
summaryColumn:
|
|
261
|
-
result:
|
|
262
|
-
tables:
|
|
263
|
-
globalTheme:
|
|
264
|
-
chartColorTheme:
|
|
265
|
-
toggleRecords:
|
|
266
|
-
customRender:
|
|
243
|
+
canvasStyle: PropTypes.object,
|
|
244
|
+
chart: PropTypes.object,
|
|
245
|
+
groupbyColumn: PropTypes.object,
|
|
246
|
+
columnGroupbyColumn: PropTypes.object,
|
|
247
|
+
summaryColumn: PropTypes.object,
|
|
248
|
+
result: PropTypes.array,
|
|
249
|
+
tables: PropTypes.array,
|
|
250
|
+
globalTheme: PropTypes.string,
|
|
251
|
+
chartColorTheme: PropTypes.string,
|
|
252
|
+
toggleRecords: PropTypes.func,
|
|
253
|
+
customRender: PropTypes.func
|
|
267
254
|
};
|
|
268
|
-
|
|
255
|
+
export default MapBubble;
|
|
@@ -1,31 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _topojson = require("topojson");
|
|
14
|
-
var _dtableUtils = require("dtable-utils");
|
|
15
|
-
var _constants = require("../../constants");
|
|
16
|
-
var _utils = require("../../utils");
|
|
17
|
-
var _context = _interopRequireDefault(require("../../context"));
|
|
18
|
-
var _mapJson = _interopRequireDefault(require("../../services/map-json"));
|
|
19
|
-
var _tooltip = _interopRequireDefault(require("../../components/tooltip"));
|
|
20
|
-
var _chartComponent = _interopRequireDefault(require("./chart-component"));
|
|
21
|
-
class MapBubble extends _chartComponent.default {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import * as d3 from 'd3';
|
|
4
|
+
import { feature } from 'topojson';
|
|
5
|
+
import { getTableById, getTableColumnByKey } from 'dtable-utils';
|
|
6
|
+
import { CHART_SUMMARY_TYPE, MAP_LEVEL, DEFAULT_NUMBER_FORMAT_OBJECT, CHART_THEME_COLOR } from '../../constants';
|
|
7
|
+
import { BaseUtils } from '../../utils';
|
|
8
|
+
import context from '../../context';
|
|
9
|
+
import fetchMapJson from '../../services/map-json';
|
|
10
|
+
import ToolTip from '../../components/tooltip';
|
|
11
|
+
import ChartComponent from './chart-component';
|
|
12
|
+
class MapBubble extends ChartComponent {
|
|
22
13
|
constructor(props) {
|
|
23
14
|
super(props);
|
|
24
|
-
this.handleResize = () => {
|
|
25
|
-
this.destroyChart();
|
|
26
|
-
this.createChart();
|
|
27
|
-
this.drawChart();
|
|
28
|
-
};
|
|
29
15
|
this.createChart = () => {
|
|
30
16
|
const {
|
|
31
17
|
chart
|
|
@@ -44,10 +30,10 @@ class MapBubble extends _chartComponent.default {
|
|
|
44
30
|
const {
|
|
45
31
|
type
|
|
46
32
|
} = chart.config;
|
|
47
|
-
const mediaUrl =
|
|
48
|
-
const mapJson = await (
|
|
33
|
+
const mediaUrl = context.getSetting('mediaUrl');
|
|
34
|
+
const mapJson = await fetchMapJson(MAP_LEVEL.WORLD, '', mediaUrl);
|
|
49
35
|
if (!mapJson) return;
|
|
50
|
-
const newMapJson =
|
|
36
|
+
const newMapJson = feature(mapJson, mapJson.objects);
|
|
51
37
|
const statisticNewData = this.formatWorldMapStatisticData(data, newMapJson, type);
|
|
52
38
|
this.draw(statisticNewData, newMapJson);
|
|
53
39
|
};
|
|
@@ -101,7 +87,7 @@ class MapBubble extends _chartComponent.default {
|
|
|
101
87
|
globalTheme,
|
|
102
88
|
canvasStyle
|
|
103
89
|
} = this.props;
|
|
104
|
-
const theme =
|
|
90
|
+
const theme = CHART_THEME_COLOR[globalTheme];
|
|
105
91
|
const {
|
|
106
92
|
legend_size,
|
|
107
93
|
legend_direction,
|
|
@@ -124,7 +110,7 @@ class MapBubble extends _chartComponent.default {
|
|
|
124
110
|
// 3. Rendering map
|
|
125
111
|
this.chart.append('g').attr('class', 'map-wrapper').selectAll().data(mapJson.features).join('g').append('path').attr('d', d => {
|
|
126
112
|
return pathGenerator(d);
|
|
127
|
-
}).attr('stroke-width', 1).attr('stroke', '#bdbdbd').attr('stroke-opacity', 1).attr('fill', '#e2e2e2').attr('opacity', 1).attr('data-name', d => d.properties.name);
|
|
113
|
+
}).attr('stroke-width', 1).attr('stroke', '#bdbdbd').attr('stroke-opacity', 1).attr('fill', '#e2e2e2').attr('opacity', 1).attr('data-name', d => d.properties.name).call(g => this.animateFadeIn(g));
|
|
128
114
|
|
|
129
115
|
// draw bubble circle
|
|
130
116
|
this.drawCircle(data, mapJson, pathGenerator);
|
|
@@ -136,32 +122,33 @@ class MapBubble extends _chartComponent.default {
|
|
|
136
122
|
theme,
|
|
137
123
|
legendDirection: legend_direction,
|
|
138
124
|
legendSize: legend_size,
|
|
139
|
-
legendTextRange: [
|
|
125
|
+
legendTextRange: [BaseUtils.getSummaryValueDisplayString(columnData, d3.min(data, d => d.value), summary_method), BaseUtils.getSummaryValueDisplayString(columnData, d3.max(data, d => d.value), summary_method)],
|
|
140
126
|
type,
|
|
141
127
|
bubbleColor: bubble_color || '#2a67d1'
|
|
142
128
|
});
|
|
143
129
|
};
|
|
144
130
|
this.handleAcitveAndInActiveState = (state, event, highlightedBorderColor) => {
|
|
145
131
|
if (state === 'active') {
|
|
146
|
-
d3.select(event.currentTarget).transition().duration(this.
|
|
132
|
+
d3.select(event.currentTarget).transition().duration(this.interactionDuration).attr('fill-opacity', 0.9);
|
|
147
133
|
return;
|
|
148
134
|
}
|
|
149
|
-
d3.select(event.currentTarget).transition().duration(this.
|
|
135
|
+
d3.select(event.currentTarget).transition().duration(this.interactionDuration).attr('fill-opacity', 0.6);
|
|
150
136
|
};
|
|
151
137
|
this.getColumnData = () => {
|
|
152
138
|
const {
|
|
153
|
-
chart
|
|
139
|
+
chart,
|
|
140
|
+
tables
|
|
154
141
|
} = this.props;
|
|
155
142
|
const {
|
|
156
143
|
summary_type,
|
|
157
144
|
summary_column_key,
|
|
158
145
|
table_id
|
|
159
146
|
} = chart.config;
|
|
160
|
-
let columnData =
|
|
161
|
-
if (summary_type ===
|
|
162
|
-
const table = (
|
|
163
|
-
const summaryColumn =
|
|
164
|
-
columnData = summaryColumn.data ||
|
|
147
|
+
let columnData = DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
148
|
+
if (summary_type === CHART_SUMMARY_TYPE.ADVANCED) {
|
|
149
|
+
const table = getTableById(tables, table_id);
|
|
150
|
+
const summaryColumn = getTableColumnByKey(table, summary_column_key) || {};
|
|
151
|
+
columnData = summaryColumn.data || DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
165
152
|
}
|
|
166
153
|
return columnData;
|
|
167
154
|
};
|
|
@@ -212,6 +199,7 @@ class MapBubble extends _chartComponent.default {
|
|
|
212
199
|
});
|
|
213
200
|
}
|
|
214
201
|
});
|
|
202
|
+
this.animateCircleZoomIn(bubbleWrapper.selectAll('circle'));
|
|
215
203
|
};
|
|
216
204
|
this.chart = null;
|
|
217
205
|
this.state = {
|
|
@@ -222,12 +210,11 @@ class MapBubble extends _chartComponent.default {
|
|
|
222
210
|
componentDidMount() {
|
|
223
211
|
this.createChart();
|
|
224
212
|
this.drawChart();
|
|
225
|
-
|
|
226
|
-
window.addEventListener('resize', this.debouncedHandleResize);
|
|
213
|
+
super.componentDidMount();
|
|
227
214
|
}
|
|
228
215
|
componentDidUpdate(prevProps) {
|
|
229
216
|
super.componentDidUpdate(prevProps);
|
|
230
|
-
if (
|
|
217
|
+
if (BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
231
218
|
this.destroyChart();
|
|
232
219
|
this.createChart();
|
|
233
220
|
this.drawChart();
|
|
@@ -235,17 +222,17 @@ class MapBubble extends _chartComponent.default {
|
|
|
235
222
|
}
|
|
236
223
|
componentWillUnmount() {
|
|
237
224
|
this.destroyChart();
|
|
238
|
-
|
|
225
|
+
super.componentWillUnmount();
|
|
239
226
|
}
|
|
240
227
|
render() {
|
|
241
228
|
const {
|
|
242
229
|
tooltipData,
|
|
243
230
|
toolTipPosition
|
|
244
231
|
} = this.state;
|
|
245
|
-
return /*#__PURE__*/
|
|
232
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
246
233
|
ref: ref => this.container = ref,
|
|
247
234
|
className: "sea-chart-container"
|
|
248
|
-
}, /*#__PURE__*/
|
|
235
|
+
}, /*#__PURE__*/React.createElement(ToolTip, {
|
|
249
236
|
tooltipData: tooltipData,
|
|
250
237
|
toolTipPosition: toolTipPosition,
|
|
251
238
|
chart: this.chart
|
|
@@ -253,16 +240,16 @@ class MapBubble extends _chartComponent.default {
|
|
|
253
240
|
}
|
|
254
241
|
}
|
|
255
242
|
MapBubble.propTypes = {
|
|
256
|
-
canvasStyle:
|
|
257
|
-
chart:
|
|
258
|
-
groupbyColumn:
|
|
259
|
-
columnGroupbyColumn:
|
|
260
|
-
summaryColumn:
|
|
261
|
-
result:
|
|
262
|
-
tables:
|
|
263
|
-
globalTheme:
|
|
264
|
-
chartColorTheme:
|
|
265
|
-
toggleRecords:
|
|
266
|
-
customRender:
|
|
243
|
+
canvasStyle: PropTypes.object,
|
|
244
|
+
chart: PropTypes.object,
|
|
245
|
+
groupbyColumn: PropTypes.object,
|
|
246
|
+
columnGroupbyColumn: PropTypes.object,
|
|
247
|
+
summaryColumn: PropTypes.object,
|
|
248
|
+
result: PropTypes.array,
|
|
249
|
+
tables: PropTypes.array,
|
|
250
|
+
globalTheme: PropTypes.string,
|
|
251
|
+
chartColorTheme: PropTypes.string,
|
|
252
|
+
toggleRecords: PropTypes.func,
|
|
253
|
+
customRender: PropTypes.func
|
|
267
254
|
};
|
|
268
|
-
|
|
255
|
+
export default MapBubble;
|
|
@@ -1,32 +1,18 @@
|
|
|
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 _utils = require("../../utils");
|
|
17
|
-
var _colorRules = require("../../constants/color-rules");
|
|
18
|
-
var _context = _interopRequireDefault(require("../../context"));
|
|
19
|
-
var _mapJson = _interopRequireDefault(require("../../services/map-json"));
|
|
20
|
-
var _tooltip = _interopRequireDefault(require("../../components/tooltip"));
|
|
21
|
-
var _chartComponent = _interopRequireDefault(require("./chart-component"));
|
|
22
|
-
class Map extends _chartComponent.default {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import * as d3 from 'd3';
|
|
4
|
+
import { feature } from 'topojson';
|
|
5
|
+
import { getTableById, getTableColumnByKey } from 'dtable-utils';
|
|
6
|
+
import { CHART_SUMMARY_TYPE, MAP_LEVEL, DEFAULT_NUMBER_FORMAT_OBJECT, CHART_THEME_COLOR } from '../../constants';
|
|
7
|
+
import { BaseUtils } from '../../utils';
|
|
8
|
+
import { COLOR_OPTIONS } from '../../constants/color-rules';
|
|
9
|
+
import context from '../../context';
|
|
10
|
+
import fetchMapJson from '../../services/map-json';
|
|
11
|
+
import ToolTip from '../../components/tooltip';
|
|
12
|
+
import ChartComponent from './chart-component';
|
|
13
|
+
class Map extends ChartComponent {
|
|
23
14
|
constructor(props) {
|
|
24
15
|
super(props);
|
|
25
|
-
this.handleResize = () => {
|
|
26
|
-
this.destroyChart();
|
|
27
|
-
this.createChart();
|
|
28
|
-
this.drawChart();
|
|
29
|
-
};
|
|
30
16
|
this.createChart = () => {
|
|
31
17
|
const {
|
|
32
18
|
chart
|
|
@@ -45,10 +31,10 @@ class Map extends _chartComponent.default {
|
|
|
45
31
|
const {
|
|
46
32
|
type
|
|
47
33
|
} = chart.config;
|
|
48
|
-
const mediaUrl =
|
|
49
|
-
const mapJson = await (
|
|
34
|
+
const mediaUrl = context.getSetting('mediaUrl');
|
|
35
|
+
const mapJson = await fetchMapJson(MAP_LEVEL.WORLD, '', mediaUrl);
|
|
50
36
|
if (!mapJson) return;
|
|
51
|
-
const newMapJson =
|
|
37
|
+
const newMapJson = feature(mapJson, mapJson.objects);
|
|
52
38
|
const statisticNewData = this.formatWorldMapStatisticData(data, newMapJson, type);
|
|
53
39
|
this.draw(statisticNewData, newMapJson);
|
|
54
40
|
};
|
|
@@ -103,7 +89,7 @@ class Map extends _chartComponent.default {
|
|
|
103
89
|
canvasStyle,
|
|
104
90
|
isCalculateByView
|
|
105
91
|
} = this.props;
|
|
106
|
-
const theme =
|
|
92
|
+
const theme = CHART_THEME_COLOR[globalTheme];
|
|
107
93
|
const {
|
|
108
94
|
data_color,
|
|
109
95
|
legend_size,
|
|
@@ -115,7 +101,7 @@ class Map extends _chartComponent.default {
|
|
|
115
101
|
height: chartHeight,
|
|
116
102
|
insertPadding
|
|
117
103
|
} = this.chartBoundingClientRect;
|
|
118
|
-
const currentColorOption =
|
|
104
|
+
const currentColorOption = COLOR_OPTIONS.filter(item => item.name === data_color)[0] || COLOR_OPTIONS[0];
|
|
119
105
|
const {
|
|
120
106
|
exampleColors,
|
|
121
107
|
highlightedBorderColor
|
|
@@ -143,7 +129,6 @@ class Map extends _chartComponent.default {
|
|
|
143
129
|
}
|
|
144
130
|
}
|
|
145
131
|
}).on('mousemove', event => {
|
|
146
|
-
console.log(data);
|
|
147
132
|
const value = Number(event.target.parentNode.getAttribute('data-value'));
|
|
148
133
|
if (this.curElement) {
|
|
149
134
|
this.handleAcitveAndInActiveState('inActive', event, highlightedBorderColor);
|
|
@@ -184,7 +169,7 @@ class Map extends _chartComponent.default {
|
|
|
184
169
|
d3.select(curGroup).attr('fill', color());
|
|
185
170
|
}
|
|
186
171
|
});
|
|
187
|
-
});
|
|
172
|
+
}).call(g => this.animateFadeIn(g));
|
|
188
173
|
const columnData = this.getColumnData();
|
|
189
174
|
this.setContinuousLegend({
|
|
190
175
|
previewType: canvasStyle.previewType,
|
|
@@ -192,7 +177,7 @@ class Map extends _chartComponent.default {
|
|
|
192
177
|
colorRange: exampleColors,
|
|
193
178
|
legendDirection: legend_direction,
|
|
194
179
|
legendSize: legend_size,
|
|
195
|
-
legendTextRange: [
|
|
180
|
+
legendTextRange: [BaseUtils.getSummaryValueDisplayString(columnData, minVal, summary_method), BaseUtils.getSummaryValueDisplayString(columnData, maxVal, summary_method)]
|
|
196
181
|
});
|
|
197
182
|
};
|
|
198
183
|
this.handleAcitveAndInActiveState = (state, event, highlightedBorderColor) => {
|
|
@@ -200,12 +185,12 @@ class Map extends _chartComponent.default {
|
|
|
200
185
|
const lastElement = Array.from(event.target.parentNode.parentNode.children).at(-1);
|
|
201
186
|
|
|
202
187
|
// Add element to the end
|
|
203
|
-
d3.select(this.curElement).transition().duration(this.
|
|
188
|
+
d3.select(this.curElement).transition().duration(this.interactionDuration).attr('stroke-opacity', 0.7).attr('stroke-width', 0.5).attr('stroke', highlightedBorderColor);
|
|
204
189
|
lastElement.after(this.curElement);
|
|
205
190
|
return;
|
|
206
191
|
}
|
|
207
192
|
if (this.curElement) {
|
|
208
|
-
d3.select(this.curElement).transition().duration(this.
|
|
193
|
+
d3.select(this.curElement).transition().duration(this.interactionDuration).attr('stroke-opacity', 1).attr('stroke-width', 1).attr('stroke', '#bdbdbd');
|
|
209
194
|
}
|
|
210
195
|
};
|
|
211
196
|
this.getColumnData = () => {
|
|
@@ -217,11 +202,14 @@ class Map extends _chartComponent.default {
|
|
|
217
202
|
summary_column_key,
|
|
218
203
|
table_id
|
|
219
204
|
} = chart.config;
|
|
220
|
-
let columnData =
|
|
221
|
-
if (summary_type ===
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
205
|
+
let columnData = DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
206
|
+
if (summary_type === CHART_SUMMARY_TYPE.ADVANCED) {
|
|
207
|
+
const {
|
|
208
|
+
tables
|
|
209
|
+
} = this.props;
|
|
210
|
+
const table = getTableById(tables, table_id);
|
|
211
|
+
const summaryColumn = getTableColumnByKey(table, summary_column_key) || {};
|
|
212
|
+
columnData = summaryColumn.data || DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
225
213
|
}
|
|
226
214
|
return columnData;
|
|
227
215
|
};
|
|
@@ -235,12 +223,11 @@ class Map extends _chartComponent.default {
|
|
|
235
223
|
componentDidMount() {
|
|
236
224
|
this.createChart();
|
|
237
225
|
this.drawChart();
|
|
238
|
-
|
|
239
|
-
window.addEventListener('resize', this.debouncedHandleResize);
|
|
226
|
+
super.componentDidMount();
|
|
240
227
|
}
|
|
241
228
|
componentDidUpdate(prevProps) {
|
|
242
229
|
super.componentDidUpdate(prevProps);
|
|
243
|
-
if (
|
|
230
|
+
if (BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
244
231
|
this.destroyChart();
|
|
245
232
|
this.createChart();
|
|
246
233
|
this.drawChart();
|
|
@@ -248,17 +235,17 @@ class Map extends _chartComponent.default {
|
|
|
248
235
|
}
|
|
249
236
|
componentWillUnmount() {
|
|
250
237
|
this.destroyChart();
|
|
251
|
-
|
|
238
|
+
super.componentWillUnmount();
|
|
252
239
|
}
|
|
253
240
|
render() {
|
|
254
241
|
const {
|
|
255
242
|
tooltipData,
|
|
256
243
|
toolTipPosition
|
|
257
244
|
} = this.state;
|
|
258
|
-
return /*#__PURE__*/
|
|
245
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
259
246
|
ref: ref => this.container = ref,
|
|
260
247
|
className: "sea-chart-container"
|
|
261
|
-
}, /*#__PURE__*/
|
|
248
|
+
}, /*#__PURE__*/React.createElement(ToolTip, {
|
|
262
249
|
tooltipData: tooltipData,
|
|
263
250
|
toolTipPosition: toolTipPosition,
|
|
264
251
|
chart: this.chart
|
|
@@ -266,16 +253,16 @@ class Map extends _chartComponent.default {
|
|
|
266
253
|
}
|
|
267
254
|
}
|
|
268
255
|
Map.propTypes = {
|
|
269
|
-
canvasStyle:
|
|
270
|
-
chart:
|
|
271
|
-
groupbyColumn:
|
|
272
|
-
columnGroupbyColumn:
|
|
273
|
-
summaryColumn:
|
|
274
|
-
result:
|
|
275
|
-
tables:
|
|
276
|
-
globalTheme:
|
|
277
|
-
chartColorTheme:
|
|
278
|
-
toggleRecords:
|
|
279
|
-
customRender:
|
|
256
|
+
canvasStyle: PropTypes.object,
|
|
257
|
+
chart: PropTypes.object,
|
|
258
|
+
groupbyColumn: PropTypes.object,
|
|
259
|
+
columnGroupbyColumn: PropTypes.object,
|
|
260
|
+
summaryColumn: PropTypes.object,
|
|
261
|
+
result: PropTypes.array,
|
|
262
|
+
tables: PropTypes.array,
|
|
263
|
+
globalTheme: PropTypes.string,
|
|
264
|
+
chartColorTheme: PropTypes.string,
|
|
265
|
+
toggleRecords: PropTypes.func,
|
|
266
|
+
customRender: PropTypes.func
|
|
280
267
|
};
|
|
281
|
-
|
|
268
|
+
export default Map;
|