sea-chart 1.1.64 → 2.0.0
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 +13 -6
- package/dist/assets/css/sea-chart-d3-tooltip.css +64 -0
- package/dist/components/cell-factory/FormatterConfig.js +62 -55
- package/dist/components/cell-factory/SimpleCellFormatter.js +11 -4
- package/dist/components/cell-factory/SingleSelectOption.js +18 -11
- package/dist/components/cell-factory/cell-editor-factory.js +12 -5
- package/dist/components/cell-factory/cell-formatter-factory.js +11 -4
- package/dist/components/cell-factory/link-content.js +35 -27
- package/dist/components/chart-color-selector/color-selector.js +18 -11
- package/dist/components/collaborator/index.js +14 -7
- package/dist/components/color-picker/index.js +18 -11
- package/dist/components/color-popover/color-rules/color-rule.js +33 -25
- package/dist/components/color-popover/color-rules/index.js +14 -6
- package/dist/components/color-popover/color-rules/rule-filters/filter.js +34 -27
- package/dist/components/color-popover/color-rules/rule-filters/index.js +25 -17
- package/dist/components/color-popover/color-rules/rule-filters/number-input.js +17 -9
- package/dist/components/color-popover/color-rules-popover.js +33 -25
- package/dist/components/color-popover/color-selector-popover.js +18 -10
- package/dist/components/color-setting/color-group-selector.js +20 -12
- package/dist/components/common-add-tool/index.js +13 -6
- package/dist/components/data-process-setter/data-setting-header.js +14 -7
- package/dist/components/data-process-setter/hide-column-setter.js +19 -12
- package/dist/components/data-process-setter/index.js +27 -4
- package/dist/components/data-process-setter/sort-setter.js +24 -16
- package/dist/components/draggable/Draggable.js +13 -7
- package/dist/components/drill-down-settings/drill-down-fields-popover/index.js +48 -40
- package/dist/components/drill-down-settings/drill-down-fields-settings/index.js +18 -10
- package/dist/components/drill-down-settings/index.js +18 -11
- package/dist/components/dtable-popover/index.js +20 -13
- package/dist/components/dtable-search-input/index.js +21 -13
- package/dist/components/font-settings/index.js +22 -14
- package/dist/components/goal-line-setting/goal-setting-item.js +14 -6
- package/dist/components/goal-line-setting/index.js +19 -12
- package/dist/components/highlighter/highlighter.js +14 -7
- package/dist/components/icon/index.js +12 -5
- package/dist/components/index.js +48 -7
- package/dist/components/loading/index.js +13 -6
- package/dist/components/number-input/index.js +11 -4
- package/dist/components/pixel-editor/index.js +23 -15
- package/dist/components/popover/hide-column-popover/hide-column-popover-widgets/hide-column-item.js +14 -7
- package/dist/components/popover/hide-column-popover/hide-column-popover.js +35 -27
- package/dist/components/popover/sort-popover/sort-popover-widgets/sort-utils.js +18 -9
- package/dist/components/popover/sort-popover/sort-popover.js +65 -55
- package/dist/components/resize-handle/ResizeHandle.js +13 -6
- package/dist/components/row-card/row-card-header-cell.js +22 -15
- package/dist/components/row-card/row-card-header.js +21 -14
- package/dist/components/row-card/row-card-item.js +41 -33
- package/dist/components/row-card/row-card.js +23 -15
- package/dist/components/statistic-record-dialog/index.js +63 -55
- package/dist/components/types-dialog/index.js +63 -55
- package/dist/components/types-dialog/use-force-update.js +10 -4
- package/dist/constants/color-rules.js +14 -8
- package/dist/constants/common-constants.js +14 -8
- package/dist/constants/error.js +8 -2
- package/dist/constants/geolocation.js +15 -9
- package/dist/constants/index.js +271 -142
- package/dist/constants/key-codes.js +2 -0
- package/dist/constants/model.js +9 -3
- package/dist/constants/regions.js +8 -3
- package/dist/constants/style.js +12 -6
- package/dist/constants/table.js +7 -1
- package/dist/constants/type-image.js +39 -33
- package/dist/constants/type.js +9 -3
- package/dist/context.js +19 -12
- package/dist/editor/index.js +15 -12
- package/dist/index.js +104 -13
- package/dist/intl.js +17 -10
- package/dist/locale/index.js +23 -16
- package/dist/locale/lang/de.js +7 -1
- package/dist/locale/lang/en.js +7 -1
- package/dist/locale/lang/es.js +7 -1
- package/dist/locale/lang/fr.js +7 -1
- package/dist/locale/lang/pt.js +7 -1
- package/dist/locale/lang/ru.js +7 -1
- package/dist/locale/lang/zh_CN.js +7 -1
- package/dist/model/area-group.js +19 -12
- package/dist/model/area.js +19 -12
- package/dist/model/bar-custom.js +18 -11
- package/dist/model/bar-group.js +19 -12
- package/dist/model/bar-stack.js +17 -10
- package/dist/model/bar.js +18 -11
- package/dist/model/base-model.js +11 -4
- package/dist/model/basic-number-card.js +20 -13
- package/dist/model/chart.js +13 -7
- package/dist/model/combination.js +22 -15
- package/dist/model/compare-bar.js +21 -14
- package/dist/model/completeness-group.js +18 -11
- package/dist/model/completeness.js +17 -10
- package/dist/model/dashboard.js +14 -7
- package/dist/model/funnel.js +21 -14
- package/dist/model/generic-model.js +143 -135
- package/dist/model/heat-map.js +16 -9
- package/dist/model/horizontal-bar.js +18 -11
- package/dist/model/horizontal-group-bar.js +17 -10
- package/dist/model/index.js +93 -69
- package/dist/model/line-group.js +20 -13
- package/dist/model/line.js +19 -12
- package/dist/model/map-bubble.js +17 -10
- package/dist/model/map.js +19 -12
- package/dist/model/mirror.js +20 -13
- package/dist/model/pie.js +19 -12
- package/dist/model/ring.js +19 -12
- package/dist/model/scatter.js +17 -10
- package/dist/model/stacked-horizontal-bar.js +18 -11
- package/dist/model/table-element.js +12 -5
- package/dist/model/table.js +14 -7
- package/dist/model/tree-map.js +14 -7
- package/dist/model/trend.js +18 -11
- package/dist/model/user.js +7 -1
- package/dist/model/world-map-bubble.js +19 -12
- package/dist/model/world-map.js +19 -12
- package/dist/services/map-json.js +13 -7
- package/dist/settings/advance-bar-settings/data-settings.js +46 -42
- package/dist/settings/advance-bar-settings/index.js +20 -3
- package/dist/settings/advance-bar-settings/style-settings.js +73 -69
- package/dist/settings/bar-settings/data-settings.js +49 -45
- package/dist/settings/bar-settings/index.js +20 -3
- package/dist/settings/bar-settings/style-settings.js +59 -55
- package/dist/settings/basic-number-card/data-settings.js +57 -49
- package/dist/settings/basic-number-card/index.js +20 -3
- package/dist/settings/basic-number-card/style-settings.js +26 -18
- package/dist/settings/combination-settings/data-settings.js +65 -60
- package/dist/settings/combination-settings/index.js +20 -3
- package/dist/settings/combination-settings/style-settings.js +74 -69
- package/dist/settings/completeness-settings/callbacks/callbacks.js +27 -16
- package/dist/settings/completeness-settings/data-settings/completion-settings.js +28 -21
- package/dist/settings/completeness-settings/data-settings/data-settings.js +32 -25
- package/dist/settings/completeness-settings/index.js +20 -3
- package/dist/settings/completeness-settings/style-settings.js +26 -19
- package/dist/settings/dashboard-settings/data-settings.js +51 -43
- package/dist/settings/dashboard-settings/index.js +13 -2
- package/dist/settings/data-settings.js +79 -72
- package/dist/settings/funnel-settings/components/dnd-item/dnd-item.js +19 -12
- package/dist/settings/funnel-settings/components/dnd-list.js +23 -15
- package/dist/settings/funnel-settings/components/funnel-label-setting.js +40 -32
- package/dist/settings/funnel-settings/components/funnel-layer-setting.js +30 -22
- package/dist/settings/funnel-settings/data-settings.js +31 -23
- package/dist/settings/funnel-settings/index.js +20 -3
- package/dist/settings/funnel-settings/style-settings.js +19 -11
- package/dist/settings/heat-map-settings/data-settings.js +26 -18
- package/dist/settings/heat-map-settings/index.js +20 -3
- package/dist/settings/heat-map-settings/style-settings.js +26 -18
- package/dist/settings/horizontal-bar-settings/data-settings.js +19 -12
- package/dist/settings/horizontal-bar-settings/index.js +20 -3
- package/dist/settings/horizontal-bar-settings/style-settings.js +19 -12
- package/dist/settings/index.js +75 -58
- package/dist/settings/map-settings/components/location-field-selector.js +17 -10
- package/dist/settings/map-settings/components/map-level-selector.js +18 -11
- package/dist/settings/map-settings/components/map-province-city-selector.js +26 -19
- package/dist/settings/map-settings/index.js +20 -3
- package/dist/settings/map-settings/map-data-settings.js +30 -23
- package/dist/settings/map-settings/map-style-settings.js +34 -26
- package/dist/settings/mirror-settings/data-settings.js +34 -26
- package/dist/settings/mirror-settings/index.js +13 -2
- package/dist/settings/pie-settings/data-settings.js +41 -33
- package/dist/settings/pie-settings/index.js +20 -3
- package/dist/settings/pie-settings/style-settings.js +55 -47
- package/dist/settings/scatter/data-settings.js +34 -27
- package/dist/settings/scatter/index.js +12 -3
- package/dist/settings/stacks-settings/index.js +27 -19
- package/dist/settings/stacks-settings/stack-item-settings.js +27 -19
- package/dist/settings/style-settings.js +72 -64
- package/dist/settings/table-element-settings/components/data-filter.js +37 -29
- package/dist/settings/table-element-settings/data-settings.js +29 -21
- package/dist/settings/table-element-settings/index.js +13 -2
- package/dist/settings/table-settings/data-settings.js +119 -111
- package/dist/settings/table-settings/index.js +13 -2
- package/dist/settings/time-comparison-settings/data-settings.js +51 -43
- package/dist/settings/time-comparison-settings/index.js +20 -3
- package/dist/settings/time-comparison-settings/style-settings.js +50 -42
- package/dist/settings/trend-settings/data-settings.js +32 -24
- package/dist/settings/trend-settings/index.js +20 -3
- package/dist/settings/trend-settings/style-setting.js +25 -17
- package/dist/settings/widgets/basic-summary/index.js +66 -66
- package/dist/settings/widgets/chart-type/index.js +34 -19
- package/dist/settings/widgets/color-settings/index.js +80 -72
- package/dist/settings/widgets/common-data-settings.js +30 -25
- package/dist/settings/widgets/data-filter/index.js +40 -32
- package/dist/settings/widgets/data-sort.js +24 -16
- package/dist/settings/widgets/date-summary-item.js +32 -24
- package/dist/settings/widgets/display-values-settings/index.js +22 -14
- package/dist/settings/widgets/divider/index.js +16 -8
- package/dist/settings/widgets/font-settings/font-color-settings.js +19 -11
- package/dist/settings/widgets/font-settings/font-size-settings.js +22 -14
- package/dist/settings/widgets/font-settings/font-weight-settings.js +25 -17
- package/dist/settings/widgets/font-settings/index.js +27 -4
- package/dist/settings/widgets/group-by.js +59 -51
- package/dist/settings/widgets/min-max-setting.js +18 -10
- package/dist/settings/widgets/mininum-slice-percent.js +18 -10
- package/dist/settings/widgets/numeric-summary-item.js +31 -23
- package/dist/settings/widgets/select-line-type/index.js +17 -10
- package/dist/settings/widgets/select-table/index.js +16 -9
- package/dist/settings/widgets/select-view/index.js +28 -20
- package/dist/settings/widgets/stack.js +22 -14
- package/dist/settings/widgets/summary-method-setting.js +25 -17
- package/dist/settings/widgets/summary-settings.js +80 -72
- package/dist/settings/widgets/switch/index.js +15 -8
- package/dist/settings/widgets/text-horizontal-settings.js +23 -15
- package/dist/settings/widgets/time-picker.js +37 -29
- package/dist/settings/widgets/title-settings/index.js +37 -29
- package/dist/settings/widgets/title-settings/title-text.js +12 -5
- package/dist/settings/widgets/x-axios.js +1 -0
- package/dist/settings/widgets/y-axis-group-settings.js +71 -63
- package/dist/utils/cell-format-utils.js +29 -19
- package/dist/utils/cell-value-utils.js +11 -4
- package/dist/utils/chart-utils/base-utils.js +290 -279
- package/dist/utils/chart-utils/index.js +39 -26
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +84 -77
- package/dist/utils/chart-utils/original-data-utils/card-calculator.js +20 -13
- package/dist/utils/chart-utils/original-data-utils/combination-calculator.js +52 -45
- package/dist/utils/chart-utils/original-data-utils/compare-bar-chart-calculator.js +26 -19
- package/dist/utils/chart-utils/original-data-utils/completeness-calculator.js +39 -32
- package/dist/utils/chart-utils/original-data-utils/dashboard-calculator.js +23 -16
- package/dist/utils/chart-utils/original-data-utils/index.js +57 -50
- package/dist/utils/chart-utils/original-data-utils/mirror-calculator.js +26 -19
- package/dist/utils/chart-utils/original-data-utils/pivot-table-calculator.js +96 -90
- package/dist/utils/chart-utils/original-data-utils/scatter-calculator.js +25 -18
- package/dist/utils/chart-utils/original-data-utils/trend-calculator.js +34 -27
- package/dist/utils/chart-utils/sql-statistics-utils.js +237 -229
- package/dist/utils/chart.js +17 -9
- package/dist/utils/collaborator-manager.js +9 -3
- package/dist/utils/collaborator-utils.js +30 -18
- package/dist/utils/collaborator.js +13 -4
- package/dist/utils/color-utils.js +29 -18
- package/dist/utils/column-utils.js +88 -63
- package/dist/utils/common-utils.js +52 -27
- package/dist/utils/concurrency-manager.js +7 -1
- package/dist/utils/contexts.js +11 -4
- package/dist/utils/custom-g2.js +241 -212
- package/dist/utils/date-translate.js +19 -11
- package/dist/utils/digital-sign-utils.js +14 -7
- package/dist/utils/event-bus.js +7 -1
- package/dist/utils/hotkey.js +11 -5
- package/dist/utils/index.js +219 -53
- package/dist/utils/key-generator.js +9 -2
- package/dist/utils/map.js +31 -22
- package/dist/utils/object-utils.js +7 -1
- package/dist/utils/options-utils.js +16 -8
- package/dist/utils/row-record-utils.js +164 -152
- package/dist/utils/row-utils.js +38 -27
- package/dist/utils/search.js +32 -24
- package/dist/utils/sql/chart-data-sql.js +55 -49
- package/dist/utils/sql/column-2-sql-column.js +153 -143
- package/dist/utils/sql/index.js +27 -3
- package/dist/utils/trend-utils.js +45 -37
- package/dist/view/index.js +96 -87
- package/dist/view/title/index.js +23 -15
- package/dist/view/wrapper/area.js +46 -39
- package/dist/view/wrapper/bar-custom.js +40 -33
- package/dist/view/wrapper/bar-group.js +58 -51
- package/dist/view/wrapper/bar.js +42 -35
- package/dist/view/wrapper/basic-number-card.js +25 -17
- package/dist/view/wrapper/chart-component.js +116 -54
- package/dist/view/wrapper/combination.js +82 -75
- package/dist/view/wrapper/compare.js +57 -50
- package/dist/view/wrapper/completeness.js +32 -24
- package/dist/view/wrapper/dashboard.js +21 -14
- package/dist/view/wrapper/funnel.js +26 -19
- package/dist/view/wrapper/heat-map.js +60 -53
- package/dist/view/wrapper/horizontal-bar-group.js +48 -41
- package/dist/view/wrapper/horizontal-bar.js +39 -32
- package/dist/view/wrapper/horizontal-component.js +23 -15
- package/dist/view/wrapper/index.js +148 -96
- package/dist/view/wrapper/line-group.js +41 -34
- package/dist/view/wrapper/line.js +39 -32
- package/dist/view/wrapper/map.js +54 -46
- package/dist/view/wrapper/mirror.js +38 -31
- package/dist/view/wrapper/pie.js +50 -43
- package/dist/view/wrapper/ring.js +59 -52
- package/dist/view/wrapper/scatter.js +30 -22
- package/dist/view/wrapper/table/index.js +21 -13
- package/dist/view/wrapper/table/one-dimension-table-no-numeric-columns.js +57 -49
- package/dist/view/wrapper/table/one-dimension-table-with-numeric-columns.js +58 -50
- package/dist/view/wrapper/table/pivot-table-display-name.js +90 -82
- package/dist/view/wrapper/table/two-dimension-table.js +84 -76
- package/dist/view/wrapper/table-element/components/dataset-utils.js +36 -23
- package/dist/view/wrapper/table-element/components/formatter.js +98 -89
- package/dist/view/wrapper/table-element/components/formatters/FileFormatter/index.js +31 -22
- package/dist/view/wrapper/table-element/components/formatters/formula-formatter.js +16 -9
- package/dist/view/wrapper/table-element/components/formatters/link-formatter.js +80 -73
- package/dist/view/wrapper/table-element/components/formula-formatter.js +16 -9
- package/dist/view/wrapper/table-element/components/link-formatter.js +80 -73
- package/dist/view/wrapper/table-element/components/record.js +17 -10
- package/dist/view/wrapper/table-element/components/records-body.js +17 -9
- package/dist/view/wrapper/table-element/components/records-header/index.js +16 -8
- package/dist/view/wrapper/table-element/components/records-header/records-header-cell.js +16 -8
- package/dist/view/wrapper/table-element/components/records.js +29 -21
- package/dist/view/wrapper/table-element/components/resize-column-handle/resize-column-handle.js +13 -6
- package/dist/view/wrapper/table-element/components/utils.js +15 -5
- package/dist/view/wrapper/table-element/components/value-display-utils.js +11 -4
- package/dist/view/wrapper/table-element/components/vertical-scrollbar/index.js +13 -6
- package/dist/view/wrapper/table-element/index.js +24 -16
- package/dist/view/wrapper/treemap.js +43 -36
- package/dist/view/wrapper/trend.js +47 -39
- package/dist/view/wrapper/world-map.js +60 -52
- package/dist/view/wrapper/wrappers-d3/bar.js +262 -0
- package/package.json +15 -17
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = Completeness;
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _lodashEs = require("lodash-es");
|
|
12
|
+
var _utils = require("../../utils");
|
|
13
|
+
var _intl = _interopRequireDefault(require("../../intl"));
|
|
14
|
+
var _constants = require("../../constants");
|
|
15
|
+
var _chartComponent = _interopRequireDefault(require("./chart-component"));
|
|
16
|
+
function Completeness(_ref) {
|
|
9
17
|
var _chartRef$current, _chartRef$current2;
|
|
10
18
|
let {
|
|
11
19
|
chart,
|
|
@@ -16,11 +24,11 @@ export default function Completeness(_ref) {
|
|
|
16
24
|
globalTheme,
|
|
17
25
|
chartColorTheme
|
|
18
26
|
} = _ref;
|
|
19
|
-
const chartRef = useRef(null);
|
|
20
|
-
const chartContainerRef = useRef(null);
|
|
21
|
-
useEffect(() => {
|
|
27
|
+
const chartRef = (0, _react.useRef)(null);
|
|
28
|
+
const chartContainerRef = (0, _react.useRef)(null);
|
|
29
|
+
(0, _react.useEffect)(() => {
|
|
22
30
|
if (!chartRef.current) {
|
|
23
|
-
const chartComponent = new
|
|
31
|
+
const chartComponent = new _chartComponent.default({});
|
|
24
32
|
chartRef.current = chartComponent;
|
|
25
33
|
}
|
|
26
34
|
const currentChart = chartRef.current;
|
|
@@ -33,8 +41,8 @@ export default function Completeness(_ref) {
|
|
|
33
41
|
style_config,
|
|
34
42
|
config
|
|
35
43
|
} = chart;
|
|
36
|
-
chartPaddingTop = (
|
|
37
|
-
const chartPaddingRight =
|
|
44
|
+
chartPaddingTop = (_style_config$title = style_config.title) !== null && _style_config$title !== void 0 && _style_config$title.text ? 17 : 0;
|
|
45
|
+
const chartPaddingRight = config !== null && config !== void 0 && config.show_percentage ? 45 : 0;
|
|
38
46
|
const appendPadding = [chartPaddingTop, chartPaddingRight, 0, 0];
|
|
39
47
|
currentChart.initChart(chartContainerRef.current, {
|
|
40
48
|
appendPadding
|
|
@@ -44,7 +52,7 @@ export default function Completeness(_ref) {
|
|
|
44
52
|
});
|
|
45
53
|
}
|
|
46
54
|
function drawChart() {
|
|
47
|
-
const currentData = BaseUtils.formatEmptyName(data, '',
|
|
55
|
+
const currentData = _utils.BaseUtils.formatEmptyName(data, '', _intl.default.get('Empty'));
|
|
48
56
|
if (!Array.isArray(currentData)) return;
|
|
49
57
|
currentChart.loadData(currentData);
|
|
50
58
|
draw(currentData);
|
|
@@ -54,15 +62,15 @@ export default function Completeness(_ref) {
|
|
|
54
62
|
});
|
|
55
63
|
}
|
|
56
64
|
function draw(data) {
|
|
57
|
-
const theme = CHART_THEME_COLOR[globalTheme];
|
|
65
|
+
const theme = _constants.CHART_THEME_COLOR[globalTheme];
|
|
58
66
|
const {
|
|
59
67
|
label_font_size,
|
|
60
68
|
column_groupby_column_key,
|
|
61
69
|
type
|
|
62
70
|
} = chart.config;
|
|
63
|
-
const isGroup = type === CHART_TYPE.COMPLETENESS_GROUP ? true : false;
|
|
71
|
+
const isGroup = type === _constants.CHART_TYPE.COMPLETENESS_GROUP ? true : false;
|
|
64
72
|
let currentIdx = 0;
|
|
65
|
-
const colors = BaseUtils.getCurrentTheme(chartColorTheme).colors;
|
|
73
|
+
const colors = _utils.BaseUtils.getCurrentTheme(chartColorTheme).colors;
|
|
66
74
|
const colorMap = data.reduce((acc, cur) => {
|
|
67
75
|
if (cur.groupby && !acc[cur.groupby]) {
|
|
68
76
|
acc[cur.groupby] = colors[currentIdx++ % colors.length];
|
|
@@ -98,7 +106,7 @@ export default function Completeness(_ref) {
|
|
|
98
106
|
if (!isGroup) {
|
|
99
107
|
singleBarWidth = Math.round(chartHeight / (2 * newData.length));
|
|
100
108
|
} else {
|
|
101
|
-
const maxGroupCount = maxBy(newData, 'currentGroupCount');
|
|
109
|
+
const maxGroupCount = (0, _lodashEs.maxBy)(newData, 'currentGroupCount');
|
|
102
110
|
singleBarWidth = Math.round(chartHeight / (2 * newData.length * maxGroupCount.currentGroupCount));
|
|
103
111
|
}
|
|
104
112
|
singleBarRadius = Math.min(singleBarWidth / 5, 10);
|
|
@@ -106,7 +114,7 @@ export default function Completeness(_ref) {
|
|
|
106
114
|
let {
|
|
107
115
|
show_percentage
|
|
108
116
|
} = chart.config;
|
|
109
|
-
show_percentage = isBoolean(show_percentage) ? show_percentage : true;
|
|
117
|
+
show_percentage = (0, _utils.isBoolean)(show_percentage) ? show_percentage : true;
|
|
110
118
|
currentChart.drawLabels(newData);
|
|
111
119
|
|
|
112
120
|
// set Coord type
|
|
@@ -120,14 +128,14 @@ export default function Completeness(_ref) {
|
|
|
120
128
|
return '';
|
|
121
129
|
},
|
|
122
130
|
style: {
|
|
123
|
-
fontSize: BaseUtils.getLabelFontSize(label_font_size),
|
|
131
|
+
fontSize: _utils.BaseUtils.getLabelFontSize(label_font_size),
|
|
124
132
|
fill: theme.labelColor,
|
|
125
133
|
...currentChart.labelStroke
|
|
126
134
|
}
|
|
127
135
|
}).position('name*value').size(singleBarWidth).color(colorField, colorFieldCb).adjust(adjustType).tooltip('name*group_name*value', (name, group_name, value) => {
|
|
128
136
|
return {
|
|
129
137
|
title: name,
|
|
130
|
-
name:
|
|
138
|
+
name: _intl.default.get(group_name),
|
|
131
139
|
value: value
|
|
132
140
|
};
|
|
133
141
|
}).state({
|
|
@@ -156,8 +164,8 @@ export default function Completeness(_ref) {
|
|
|
156
164
|
};
|
|
157
165
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
158
166
|
}, [chart, chartColorTheme, data, globalTheme, summaryColumn, tables]);
|
|
159
|
-
return /*#__PURE__*/
|
|
160
|
-
className:
|
|
167
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
168
|
+
className: (0, _classnames.default)('sea-chart-completeness-chart sea-chart-container', {
|
|
161
169
|
'show-x-axis-label': (_chartRef$current = chartRef.current) === null || _chartRef$current === void 0 ? void 0 : _chartRef$current.isShowXAxisLabel(chart),
|
|
162
170
|
'show-y-axis-label': (_chartRef$current2 = chartRef.current) === null || _chartRef$current2 === void 0 ? void 0 : _chartRef$current2.isShowYAxisLabel(chart)
|
|
163
171
|
}),
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _dtableUtils = require("dtable-utils");
|
|
10
|
+
var _customG = require("../../utils/custom-g2");
|
|
11
|
+
var _utils = require("../../utils");
|
|
12
|
+
var _constants = require("../../constants");
|
|
13
|
+
class Dashboard extends _react.Component {
|
|
7
14
|
constructor() {
|
|
8
15
|
super(...arguments);
|
|
9
16
|
this.componentDidMount = () => {
|
|
@@ -17,12 +24,12 @@ class Dashboard extends Component {
|
|
|
17
24
|
result,
|
|
18
25
|
customRender
|
|
19
26
|
} = this.props;
|
|
20
|
-
const theme = CHART_THEME_COLOR[globalTheme];
|
|
21
|
-
const value = isNumber(result) ? result : 0;
|
|
27
|
+
const theme = _constants.CHART_THEME_COLOR[globalTheme];
|
|
28
|
+
const value = (0, _dtableUtils.isNumber)(result) ? result : 0;
|
|
22
29
|
const {
|
|
23
30
|
config
|
|
24
31
|
} = chart;
|
|
25
|
-
this.chart = new Chart({
|
|
32
|
+
this.chart = new _customG.Chart({
|
|
26
33
|
container: this.container,
|
|
27
34
|
autoFit: true,
|
|
28
35
|
width: '100%',
|
|
@@ -31,7 +38,7 @@ class Dashboard extends Component {
|
|
|
31
38
|
this.chart.on('interval:click', e => {
|
|
32
39
|
this.props.toggleRecords(e.data.data);
|
|
33
40
|
});
|
|
34
|
-
registerShape('point', 'pointer', {
|
|
41
|
+
(0, _customG.registerShape)('point', 'pointer', {
|
|
35
42
|
draw(cfg, container) {
|
|
36
43
|
const group = container.addGroup();
|
|
37
44
|
const center = this.parsePoint({
|
|
@@ -150,23 +157,23 @@ class Dashboard extends Component {
|
|
|
150
157
|
},
|
|
151
158
|
offsetY: 0
|
|
152
159
|
});
|
|
153
|
-
isFunction(customRender) && customRender(this.chart);
|
|
160
|
+
(0, _utils.isFunction)(customRender) && customRender(this.chart);
|
|
154
161
|
this.chart.render();
|
|
155
162
|
this.container.title = "".concat(data[0].value * 10, " %");
|
|
156
163
|
};
|
|
157
164
|
}
|
|
158
165
|
componentDidUpdate(prevProps) {
|
|
159
|
-
if (BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
166
|
+
if (_utils.BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
160
167
|
var _this$chart;
|
|
161
168
|
((_this$chart = this.chart) === null || _this$chart === void 0 ? void 0 : _this$chart.autoPadding) && this.chart.destroy();
|
|
162
169
|
this.drawChart();
|
|
163
170
|
}
|
|
164
171
|
}
|
|
165
172
|
render() {
|
|
166
|
-
return /*#__PURE__*/
|
|
173
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
167
174
|
ref: ref => this.container = ref,
|
|
168
175
|
className: "sea-chart-container "
|
|
169
176
|
});
|
|
170
177
|
}
|
|
171
178
|
}
|
|
172
|
-
|
|
179
|
+
var _default = exports.default = Dashboard;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _dataSet = require("@antv/data-set");
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _utils = require("../../utils");
|
|
12
|
+
var _constants = require("../../constants");
|
|
13
|
+
var _chartComponent = _interopRequireDefault(require("./chart-component"));
|
|
14
|
+
class Funnel extends _chartComponent.default {
|
|
8
15
|
constructor(props) {
|
|
9
16
|
super(props);
|
|
10
17
|
this.createChart = () => {
|
|
@@ -26,7 +33,7 @@ class Funnel extends ChartComponent {
|
|
|
26
33
|
funnel_accumulate_values
|
|
27
34
|
} = chart.config;
|
|
28
35
|
if (!x_axis_option_list.length) return;
|
|
29
|
-
const sortedData = getSortedDataByGivenOrder(data, x_axis_option_list);
|
|
36
|
+
const sortedData = (0, _utils.getSortedDataByGivenOrder)(data, x_axis_option_list);
|
|
30
37
|
sortedData.total = 0;
|
|
31
38
|
sortedData.forEach(item => {
|
|
32
39
|
sortedData.total += item.value;
|
|
@@ -38,7 +45,7 @@ class Funnel extends ChartComponent {
|
|
|
38
45
|
}
|
|
39
46
|
const {
|
|
40
47
|
DataView
|
|
41
|
-
} = DataSet;
|
|
48
|
+
} = _dataSet.DataSet;
|
|
42
49
|
const dv = new DataView().source(sortedData);
|
|
43
50
|
dv.transform({
|
|
44
51
|
type: 'map',
|
|
@@ -72,9 +79,9 @@ class Funnel extends ChartComponent {
|
|
|
72
79
|
funnel_show_labels,
|
|
73
80
|
funnel_show_overall_rate
|
|
74
81
|
} = chart.config;
|
|
75
|
-
const theme = CHART_THEME_COLOR[globalTheme];
|
|
82
|
+
const theme = _constants.CHART_THEME_COLOR[globalTheme];
|
|
76
83
|
const title = this.getTitle(tables, table_id, y_axis_summary_type, y_axis_column_key || y_axis_summary_column_key);
|
|
77
|
-
const isInside = funnel_label_position === FUNNEL_LABEL_POSITIONS.INSIDE;
|
|
84
|
+
const isInside = funnel_label_position === _constants.FUNNEL_LABEL_POSITIONS.INSIDE;
|
|
78
85
|
let labelStyle;
|
|
79
86
|
if (isInside) {
|
|
80
87
|
labelStyle = {
|
|
@@ -98,9 +105,9 @@ class Funnel extends ChartComponent {
|
|
|
98
105
|
};
|
|
99
106
|
}
|
|
100
107
|
const contentFormatterMap = {
|
|
101
|
-
[FUNNEL_LABEL_FORMAT.NUMBER]: obj => obj.value,
|
|
102
|
-
[FUNNEL_LABEL_FORMAT.PERCENTAGE]: obj => ((obj === null || obj === void 0 ? void 0 : obj.percent) || 0) + '%',
|
|
103
|
-
[FUNNEL_LABEL_FORMAT.NUMBER_AND_PERCENTAGE]: obj => "".concat(obj.value, " (").concat((obj === null || obj === void 0 ? void 0 : obj.percent) || 0, "%)")
|
|
108
|
+
[_constants.FUNNEL_LABEL_FORMAT.NUMBER]: obj => obj.value,
|
|
109
|
+
[_constants.FUNNEL_LABEL_FORMAT.PERCENTAGE]: obj => ((obj === null || obj === void 0 ? void 0 : obj.percent) || 0) + '%',
|
|
110
|
+
[_constants.FUNNEL_LABEL_FORMAT.NUMBER_AND_PERCENTAGE]: obj => "".concat(obj.value, " (").concat((obj === null || obj === void 0 ? void 0 : obj.percent) || 0, "%)")
|
|
104
111
|
};
|
|
105
112
|
this.chart.axis(false);
|
|
106
113
|
this.chart.coordinate('rect').transpose().scale(1, -1);
|
|
@@ -114,7 +121,7 @@ class Funnel extends ChartComponent {
|
|
|
114
121
|
}, labelStyle).tooltip('name*value', (name, value) => {
|
|
115
122
|
return {
|
|
116
123
|
title,
|
|
117
|
-
value: BaseUtils.getSummaryValueDisplayString(summaryColumn, value, y_axis_summary_method),
|
|
124
|
+
value: _utils.BaseUtils.getSummaryValueDisplayString(summaryColumn, value, y_axis_summary_method),
|
|
118
125
|
name
|
|
119
126
|
};
|
|
120
127
|
}).animate({
|
|
@@ -178,7 +185,7 @@ class Funnel extends ChartComponent {
|
|
|
178
185
|
this.drawChart();
|
|
179
186
|
}
|
|
180
187
|
componentDidUpdate(prevProps) {
|
|
181
|
-
if (BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
188
|
+
if (_utils.BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
182
189
|
var _this$chart;
|
|
183
190
|
((_this$chart = this.chart) === null || _this$chart === void 0 ? void 0 : _this$chart.autoPadding) && this.chart.destroy();
|
|
184
191
|
this.createChart();
|
|
@@ -190,10 +197,10 @@ class Funnel extends ChartComponent {
|
|
|
190
197
|
((_this$chart2 = this.chart) === null || _this$chart2 === void 0 ? void 0 : _this$chart2.autoPadding) && this.chart.destroy();
|
|
191
198
|
}
|
|
192
199
|
render() {
|
|
193
|
-
return /*#__PURE__*/
|
|
194
|
-
className:
|
|
200
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
201
|
+
className: (0, _classnames.default)('sea-chart-container'),
|
|
195
202
|
ref: ref => this.container = ref
|
|
196
203
|
});
|
|
197
204
|
}
|
|
198
205
|
}
|
|
199
|
-
|
|
206
|
+
var _default = exports.default = Funnel;
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
12
|
+
var _weekOfYear = _interopRequireDefault(require("dayjs/plugin/weekOfYear"));
|
|
13
|
+
var _dtableUtils = require("dtable-utils");
|
|
14
|
+
var _customG = require("../../utils/custom-g2");
|
|
15
|
+
var _intl = _interopRequireDefault(require("../../intl"));
|
|
16
|
+
var _utils = require("../../utils");
|
|
17
|
+
var _constants = require("../../constants");
|
|
18
|
+
var _style = require("../../constants/style");
|
|
19
|
+
var _chartComponent = _interopRequireDefault(require("./chart-component"));
|
|
20
|
+
_dayjs.default.extend(_weekOfYear.default);
|
|
21
|
+
class HeatMap extends _chartComponent.default {
|
|
15
22
|
constructor(props) {
|
|
16
23
|
super(props);
|
|
17
24
|
this.createChart = () => {
|
|
@@ -26,8 +33,8 @@ class HeatMap extends ChartComponent {
|
|
|
26
33
|
grid_size,
|
|
27
34
|
grid_distance
|
|
28
35
|
} = chart.config;
|
|
29
|
-
grid_size = grid_size || DEFAULT_GRID_SIZE;
|
|
30
|
-
grid_distance = grid_distance || DEFAULT_GRID_DISTANCE;
|
|
36
|
+
grid_size = grid_size || _constants.DEFAULT_GRID_SIZE;
|
|
37
|
+
grid_distance = grid_distance || _constants.DEFAULT_GRID_DISTANCE;
|
|
31
38
|
const yearHeight = grid_size * 7 + grid_distance * 6 + 8;
|
|
32
39
|
const height = (yearHeight + 30) * count + 30 + (count - 1) * 15;
|
|
33
40
|
const width = grid_size * 53 + grid_distance * 52 + 75; // 75: left padding + right padding
|
|
@@ -46,7 +53,7 @@ class HeatMap extends ChartComponent {
|
|
|
46
53
|
this.transformData = statData => {
|
|
47
54
|
if (statData.length !== 0) {
|
|
48
55
|
let data = {};
|
|
49
|
-
let yearFirstDate =
|
|
56
|
+
let yearFirstDate = (0, _dayjs.default)(statData[0].name);
|
|
50
57
|
this.firstDate = yearFirstDate.year() + '-01-01';
|
|
51
58
|
statData.forEach(item => {
|
|
52
59
|
data[item.name] = data[item.name] ? data[item.name] + item.value : item.value;
|
|
@@ -108,7 +115,7 @@ class HeatMap extends ChartComponent {
|
|
|
108
115
|
return Math.ceil(context.measureText(text).width);
|
|
109
116
|
};
|
|
110
117
|
this.getLabel = val => {
|
|
111
|
-
const currentDate =
|
|
118
|
+
const currentDate = (0, _dayjs.default)(this.firstDate).add(val * 7, 'days');
|
|
112
119
|
let month = currentDate.month();
|
|
113
120
|
let monthDate = currentDate.date();
|
|
114
121
|
let isFirst = monthDate <= 7 || false;
|
|
@@ -116,7 +123,7 @@ class HeatMap extends ChartComponent {
|
|
|
116
123
|
// if the week is the first week of a month
|
|
117
124
|
// mark it to axis
|
|
118
125
|
if (isFirst) {
|
|
119
|
-
return
|
|
126
|
+
return _intl.default.get(_constants.MONTH_MIRROR[month]);
|
|
120
127
|
}
|
|
121
128
|
return '';
|
|
122
129
|
};
|
|
@@ -124,7 +131,7 @@ class HeatMap extends ChartComponent {
|
|
|
124
131
|
let {
|
|
125
132
|
result: data
|
|
126
133
|
} = this.props;
|
|
127
|
-
data = BaseUtils.formatEmptyName(data.data, '',
|
|
134
|
+
data = _utils.BaseUtils.formatEmptyName(data.data, '', _intl.default.get('Empty'));
|
|
128
135
|
if (!Array.isArray(data)) return;
|
|
129
136
|
this.draw(data);
|
|
130
137
|
this.renderAxisLabel(this.props.chart, this.props.tables);
|
|
@@ -137,13 +144,13 @@ class HeatMap extends ChartComponent {
|
|
|
137
144
|
} = this.props;
|
|
138
145
|
let {
|
|
139
146
|
data_color,
|
|
140
|
-
grid_size = DEFAULT_GRID_SIZE,
|
|
141
|
-
grid_distance = DEFAULT_GRID_DISTANCE,
|
|
147
|
+
grid_size = _constants.DEFAULT_GRID_SIZE,
|
|
148
|
+
grid_distance = _constants.DEFAULT_GRID_DISTANCE,
|
|
142
149
|
table_id,
|
|
143
150
|
summary_type,
|
|
144
151
|
summary_column
|
|
145
152
|
} = chart.config;
|
|
146
|
-
const currentColorOption = COLOR_OPTIONS.filter(item => item.name === data_color)[0] || COLOR_OPTIONS[0];
|
|
153
|
+
const currentColorOption = _style.COLOR_OPTIONS.filter(item => item.name === data_color)[0] || _style.COLOR_OPTIONS[0];
|
|
147
154
|
const {
|
|
148
155
|
exampleColors
|
|
149
156
|
} = currentColorOption;
|
|
@@ -153,7 +160,7 @@ class HeatMap extends ChartComponent {
|
|
|
153
160
|
showTitle: false,
|
|
154
161
|
shared: true,
|
|
155
162
|
containerTpl: '<div class="g2-tooltip"><div class="g2-tooltip-list"></div></div>',
|
|
156
|
-
itemTpl: "<div class=\"g2-tooltip-content\"><div style=\"width: max-content; text-align: left;\" class=\"tooltip-name\">{date}<div><div style=\"word-break: keep-all;\" class=\"tooltip-item\">".concat(
|
|
163
|
+
itemTpl: "<div class=\"g2-tooltip-content\"><div style=\"width: max-content; text-align: left;\" class=\"tooltip-name\">{date}<div><div style=\"word-break: keep-all;\" class=\"tooltip-item\">".concat(_intl.default.get(_constants.TITLE_AMOUNT), " : {value}<div></div>"),
|
|
157
164
|
domStyles: {
|
|
158
165
|
'g2-tooltip': {
|
|
159
166
|
borderRadius: '2px',
|
|
@@ -168,11 +175,11 @@ class HeatMap extends ChartComponent {
|
|
|
168
175
|
this.chart.axis(false);
|
|
169
176
|
this.chart.data(data);
|
|
170
177
|
const themeColors = this.getThemeColors();
|
|
171
|
-
let columnData = DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
172
|
-
if (summary_type === CHART_SUMMARY_TYPE.ADVANCED) {
|
|
173
|
-
const table = getTableById(tables, table_id);
|
|
174
|
-
const summaryColumn = getTableColumnByKey(table, summary_column) || {};
|
|
175
|
-
columnData = summaryColumn.data || DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
178
|
+
let columnData = _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
179
|
+
if (summary_type === _constants.CHART_SUMMARY_TYPE.ADVANCED) {
|
|
180
|
+
const table = (0, _dtableUtils.getTableById)(tables, table_id);
|
|
181
|
+
const summaryColumn = (0, _dtableUtils.getTableColumnByKey)(table, summary_column) || {};
|
|
182
|
+
columnData = summaryColumn.data || _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
176
183
|
}
|
|
177
184
|
const yearHeight = grid_size * 7 + grid_distance * 6 + 8;
|
|
178
185
|
this.chart.facet('list', {
|
|
@@ -227,7 +234,7 @@ class HeatMap extends ChartComponent {
|
|
|
227
234
|
gridView.scale({
|
|
228
235
|
day: {
|
|
229
236
|
type: 'cat',
|
|
230
|
-
values: [
|
|
237
|
+
values: [_intl.default.get('Sun'), _intl.default.get('Mon'), _intl.default.get('Tue'), _intl.default.get('Wed'), _intl.default.get('Thu'), _intl.default.get('Fri'), _intl.default.get('Sat')]
|
|
231
238
|
},
|
|
232
239
|
week: {
|
|
233
240
|
type: 'cat'
|
|
@@ -252,7 +259,7 @@ class HeatMap extends ChartComponent {
|
|
|
252
259
|
}).shape('boundary-polygon').label(false).tooltip('date*value', (date, value) => {
|
|
253
260
|
return {
|
|
254
261
|
date,
|
|
255
|
-
value: getNumberDisplayString(value, columnData)
|
|
262
|
+
value: (0, _dtableUtils.getNumberDisplayString)(value, columnData)
|
|
256
263
|
};
|
|
257
264
|
});
|
|
258
265
|
gridView.coordinate().reflect('y');
|
|
@@ -277,19 +284,19 @@ class HeatMap extends ChartComponent {
|
|
|
277
284
|
this.chart.render();
|
|
278
285
|
});
|
|
279
286
|
};
|
|
280
|
-
|
|
287
|
+
_dayjs.default.locale('en');
|
|
281
288
|
this.chart = null;
|
|
282
289
|
this.maxValue = 0;
|
|
283
290
|
}
|
|
284
291
|
componentDidMount() {
|
|
285
|
-
registerShape('polygon', 'boundary-polygon', {
|
|
292
|
+
(0, _customG.registerShape)('polygon', 'boundary-polygon', {
|
|
286
293
|
draw(cfg, container) {
|
|
287
294
|
if (cfg && cfg.points && cfg.points.length > 0) {
|
|
288
295
|
const group = container.addGroup();
|
|
289
296
|
let attrs = {
|
|
290
297
|
fill: cfg.color,
|
|
291
298
|
lineWidth: 1,
|
|
292
|
-
stroke: FILL_BORDER_COLOR_MAP[cfg.color]
|
|
299
|
+
stroke: _style.FILL_BORDER_COLOR_MAP[cfg.color]
|
|
293
300
|
};
|
|
294
301
|
const {
|
|
295
302
|
points,
|
|
@@ -311,7 +318,7 @@ class HeatMap extends ChartComponent {
|
|
|
311
318
|
p3.x = p0.x + offset;
|
|
312
319
|
p3.y = p0.y;
|
|
313
320
|
// get cell path that has radius, the cell radius is 2;
|
|
314
|
-
const path = getRectWithCornerRadius(parsedPoint, this.coordinate, 2);
|
|
321
|
+
const path = (0, _customG.getRectWithCornerRadius)(parsedPoint, this.coordinate, 2);
|
|
315
322
|
attrs.path = path;
|
|
316
323
|
group.addShape('path', {
|
|
317
324
|
attrs,
|
|
@@ -327,7 +334,7 @@ class HeatMap extends ChartComponent {
|
|
|
327
334
|
}
|
|
328
335
|
componentDidUpdate(prevProps) {
|
|
329
336
|
super.componentDidUpdate(prevProps);
|
|
330
|
-
if (BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
337
|
+
if (_utils.BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
331
338
|
var _this$chart;
|
|
332
339
|
((_this$chart = this.chart) === null || _this$chart === void 0 ? void 0 : _this$chart.autoPadding) && this.chart.destroy();
|
|
333
340
|
this.createChart();
|
|
@@ -362,11 +369,11 @@ class HeatMap extends ChartComponent {
|
|
|
362
369
|
x: p0.x + 12,
|
|
363
370
|
y: p0.y
|
|
364
371
|
};
|
|
365
|
-
const path = getRectWithCornerRadius([p0, p1, p2, p3], this.chart.coordinateInstance, 2);
|
|
372
|
+
const path = (0, _customG.getRectWithCornerRadius)([p0, p1, p2, p3], this.chart.coordinateInstance, 2);
|
|
366
373
|
return path;
|
|
367
374
|
}
|
|
368
375
|
getLegendItems(colors) {
|
|
369
|
-
const text =
|
|
376
|
+
const text = _intl.default.get('Less');
|
|
370
377
|
const textWidth = this.getTextWidthInCanvas(text);
|
|
371
378
|
const items = [{
|
|
372
379
|
name: text,
|
|
@@ -389,13 +396,13 @@ class HeatMap extends ChartComponent {
|
|
|
389
396
|
style: {
|
|
390
397
|
fill: color,
|
|
391
398
|
lineWidth: 1,
|
|
392
|
-
stroke: FILL_BORDER_COLOR_MAP[color],
|
|
399
|
+
stroke: _style.FILL_BORDER_COLOR_MAP[color],
|
|
393
400
|
r: 5
|
|
394
401
|
}
|
|
395
402
|
}
|
|
396
403
|
});
|
|
397
404
|
});
|
|
398
|
-
items[9].name =
|
|
405
|
+
items[9].name = _intl.default.get('More');
|
|
399
406
|
items[9].marker.spacing = 22;
|
|
400
407
|
return items;
|
|
401
408
|
}
|
|
@@ -403,8 +410,8 @@ class HeatMap extends ChartComponent {
|
|
|
403
410
|
const {
|
|
404
411
|
chart
|
|
405
412
|
} = this.props;
|
|
406
|
-
return /*#__PURE__*/
|
|
407
|
-
className:
|
|
413
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
414
|
+
className: (0, _classnames.default)('sea-chart-container w-100', {
|
|
408
415
|
'show-x-axis-label': this.isShowXAxisLabel(chart),
|
|
409
416
|
'show-y-axis-label': this.isShowYAxisLabel(chart)
|
|
410
417
|
}),
|
|
@@ -413,15 +420,15 @@ class HeatMap extends ChartComponent {
|
|
|
413
420
|
}
|
|
414
421
|
}
|
|
415
422
|
HeatMap.propTypes = {
|
|
416
|
-
canvasStyle:
|
|
417
|
-
chart:
|
|
418
|
-
groupbyColumn:
|
|
419
|
-
columnGroupbyColumn:
|
|
420
|
-
summaryColumn:
|
|
421
|
-
result:
|
|
422
|
-
tables:
|
|
423
|
-
theme:
|
|
424
|
-
toggleRecords:
|
|
425
|
-
customRender:
|
|
423
|
+
canvasStyle: _propTypes.default.object,
|
|
424
|
+
chart: _propTypes.default.object,
|
|
425
|
+
groupbyColumn: _propTypes.default.object,
|
|
426
|
+
columnGroupbyColumn: _propTypes.default.object,
|
|
427
|
+
summaryColumn: _propTypes.default.object,
|
|
428
|
+
result: _propTypes.default.object,
|
|
429
|
+
tables: _propTypes.default.array,
|
|
430
|
+
theme: _propTypes.default.object,
|
|
431
|
+
toggleRecords: _propTypes.default.func,
|
|
432
|
+
customRender: _propTypes.default.func
|
|
426
433
|
};
|
|
427
|
-
|
|
434
|
+
var _default = exports.default = HeatMap;
|