sea-chart 2.0.36 → 2.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.js +8 -15
- package/dist/components/cell-factory/FormatterConfig.js +55 -62
- package/dist/components/cell-factory/SimpleCellFormatter.js +5 -12
- package/dist/components/cell-factory/SingleSelectOption.js +11 -18
- package/dist/components/cell-factory/cell-editor-factory.js +5 -12
- package/dist/components/cell-factory/cell-formatter-factory.js +4 -11
- package/dist/components/cell-factory/link-content.js +30 -38
- package/dist/components/chart-color-selector/color-selector.js +11 -18
- package/dist/components/collaborator/index.js +7 -14
- package/dist/components/color-picker/index.js +12 -19
- package/dist/components/color-popover/color-rules/color-rule.js +26 -34
- package/dist/components/color-popover/color-rules/index.js +7 -15
- package/dist/components/color-popover/color-rules/rule-filters/filter.js +27 -34
- package/dist/components/color-popover/color-rules/rule-filters/index.js +17 -25
- package/dist/components/color-popover/color-rules/rule-filters/number-input.js +9 -17
- package/dist/components/color-popover/color-rules-popover.js +30 -38
- package/dist/components/color-popover/color-selector-popover.js +12 -20
- package/dist/components/color-setting/color-group-selector.js +13 -21
- package/dist/components/common-add-tool/index.js +8 -15
- package/dist/components/data-process-setter/data-setting-header.js +7 -14
- package/dist/components/data-process-setter/hide-column-setter.js +13 -20
- package/dist/components/data-process-setter/index.js +4 -27
- package/dist/components/data-process-setter/sort-setter.js +18 -26
- package/dist/components/draggable/Draggable.js +7 -13
- package/dist/components/drill-down-settings/drill-down-fields-popover/index.js +40 -48
- package/dist/components/drill-down-settings/drill-down-fields-settings/index.js +10 -18
- package/dist/components/drill-down-settings/index.js +11 -18
- package/dist/components/dtable-popover/index.js +13 -20
- package/dist/components/dtable-search-input/index.js +13 -21
- package/dist/components/font-settings/index.js +14 -22
- package/dist/components/goal-line-setting/goal-setting-item.js +6 -14
- package/dist/components/goal-line-setting/index.js +12 -19
- package/dist/components/highlighter/highlighter.js +7 -14
- package/dist/components/icon/index.js +5 -12
- package/dist/components/index.js +7 -48
- package/dist/components/loading/index.js +6 -13
- package/dist/components/number-input/index.js +4 -11
- package/dist/components/pixel-editor/index.js +15 -23
- package/dist/components/popover/hide-column-popover/hide-column-popover-widgets/hide-column-item.js +8 -15
- package/dist/components/popover/hide-column-popover/hide-column-popover.js +26 -34
- package/dist/components/popover/sort-popover/sort-popover-widgets/sort-utils.js +9 -18
- package/dist/components/popover/sort-popover/sort-popover.js +55 -65
- package/dist/components/resize-handle/ResizeHandle.js +6 -13
- package/dist/components/row-card/row-card-header-cell.js +17 -24
- package/dist/components/row-card/row-card-header.js +15 -22
- package/dist/components/row-card/row-card-item.js +35 -43
- package/dist/components/row-card/row-card.js +17 -25
- package/dist/components/statistic-record-dialog/index.js +56 -64
- package/dist/components/tooltip/index.js +14 -21
- package/dist/components/types-dialog/index.js +62 -70
- package/dist/components/types-dialog/use-force-update.js +4 -10
- package/dist/constants/color-rules.js +8 -14
- package/dist/constants/common-constants.js +8 -14
- package/dist/constants/error.js +2 -8
- package/dist/constants/geolocation.js +9 -15
- package/dist/constants/index.js +142 -271
- package/dist/constants/key-codes.js +0 -2
- package/dist/constants/model.js +3 -9
- package/dist/constants/regions.js +3 -8
- package/dist/constants/style.js +6 -12
- package/dist/constants/table.js +1 -7
- package/dist/constants/type-image.js +33 -39
- package/dist/constants/type.js +3 -9
- package/dist/context.js +13 -20
- package/dist/editor/index.js +8 -15
- package/dist/index.js +13 -104
- package/dist/intl.js +10 -17
- package/dist/locale/index.js +16 -23
- package/dist/locale/lang/de.js +1 -7
- package/dist/locale/lang/en.js +1 -7
- package/dist/locale/lang/es.js +1 -7
- package/dist/locale/lang/fr.js +1 -7
- package/dist/locale/lang/pt.js +1 -7
- package/dist/locale/lang/ru.js +1 -7
- package/dist/locale/lang/zh_CN.js +1 -7
- package/dist/model/area-group.js +12 -19
- package/dist/model/area.js +12 -19
- package/dist/model/bar-custom.js +11 -18
- package/dist/model/bar-group.js +12 -19
- package/dist/model/bar-stack.js +10 -17
- package/dist/model/bar.js +11 -18
- package/dist/model/base-model.js +4 -11
- package/dist/model/basic-number-card.js +13 -20
- package/dist/model/chart.js +7 -13
- package/dist/model/combination.js +15 -22
- package/dist/model/compare-bar.js +14 -21
- package/dist/model/completeness-group.js +11 -18
- package/dist/model/completeness.js +10 -17
- package/dist/model/dashboard.js +7 -14
- package/dist/model/funnel.js +14 -21
- package/dist/model/generic-model.js +135 -143
- package/dist/model/heat-map.js +9 -16
- package/dist/model/horizontal-bar.js +11 -18
- package/dist/model/horizontal-group-bar.js +10 -17
- package/dist/model/index.js +69 -93
- package/dist/model/line-group.js +13 -20
- package/dist/model/line.js +12 -19
- package/dist/model/map-bubble.js +12 -19
- package/dist/model/map.js +12 -19
- package/dist/model/mirror.js +13 -20
- package/dist/model/pie.js +12 -19
- package/dist/model/ring.js +12 -19
- package/dist/model/scatter.js +10 -17
- package/dist/model/stacked-horizontal-bar.js +11 -18
- package/dist/model/table-element.js +5 -12
- package/dist/model/table.js +7 -14
- package/dist/model/tree-map.js +7 -14
- package/dist/model/trend.js +11 -18
- package/dist/model/user.js +1 -7
- package/dist/model/world-map-bubble.js +12 -19
- package/dist/model/world-map.js +12 -19
- package/dist/services/map-json.js +11 -17
- package/dist/settings/advance-bar-settings/data-settings.js +36 -44
- package/dist/settings/advance-bar-settings/index.js +3 -20
- package/dist/settings/advance-bar-settings/style-settings.js +63 -71
- package/dist/settings/bar-settings/data-settings.js +39 -47
- package/dist/settings/bar-settings/index.js +3 -20
- package/dist/settings/bar-settings/style-settings.js +49 -57
- package/dist/settings/basic-number-card/data-settings.js +49 -57
- package/dist/settings/basic-number-card/index.js +3 -20
- package/dist/settings/basic-number-card/style-settings.js +19 -27
- package/dist/settings/combination-settings/data-settings.js +55 -63
- package/dist/settings/combination-settings/index.js +3 -20
- package/dist/settings/combination-settings/style-settings.js +65 -73
- package/dist/settings/completeness-settings/callbacks/callbacks.js +16 -27
- package/dist/settings/completeness-settings/data-settings/completion-settings.js +21 -28
- package/dist/settings/completeness-settings/data-settings/data-settings.js +25 -32
- package/dist/settings/completeness-settings/index.js +3 -20
- package/dist/settings/completeness-settings/style-settings.js +19 -26
- package/dist/settings/dashboard-settings/data-settings.js +43 -51
- package/dist/settings/dashboard-settings/index.js +2 -13
- package/dist/settings/data-settings.js +72 -79
- package/dist/settings/funnel-settings/components/dnd-item/dnd-item.js +12 -19
- package/dist/settings/funnel-settings/components/dnd-list.js +15 -23
- package/dist/settings/funnel-settings/components/funnel-label-setting.js +32 -40
- package/dist/settings/funnel-settings/components/funnel-layer-setting.js +20 -28
- package/dist/settings/funnel-settings/data-settings.js +23 -31
- package/dist/settings/funnel-settings/index.js +3 -20
- package/dist/settings/funnel-settings/style-settings.js +11 -19
- package/dist/settings/heat-map-settings/data-settings.js +18 -26
- package/dist/settings/heat-map-settings/index.js +3 -20
- package/dist/settings/heat-map-settings/style-settings.js +18 -26
- package/dist/settings/horizontal-bar-settings/data-settings.js +12 -19
- package/dist/settings/horizontal-bar-settings/index.js +3 -20
- package/dist/settings/horizontal-bar-settings/style-settings.js +12 -19
- package/dist/settings/index.js +52 -70
- package/dist/settings/map-settings/components/location-field-selector.js +10 -17
- package/dist/settings/map-settings/components/map-level-selector.js +11 -18
- package/dist/settings/map-settings/components/map-province-city-selector.js +19 -26
- package/dist/settings/map-settings/index.js +3 -20
- package/dist/settings/map-settings/map-data-settings.js +23 -30
- package/dist/settings/map-settings/map-style-settings.js +27 -35
- package/dist/settings/mirror-settings/data-settings.js +26 -34
- package/dist/settings/mirror-settings/index.js +2 -13
- package/dist/settings/pie-settings/data-settings.js +33 -41
- package/dist/settings/pie-settings/index.js +3 -20
- package/dist/settings/pie-settings/style-settings.js +47 -55
- package/dist/settings/scatter/data-settings.js +27 -34
- package/dist/settings/scatter/index.js +3 -12
- package/dist/settings/stacks-settings/index.js +19 -27
- package/dist/settings/stacks-settings/stack-item-settings.js +19 -27
- package/dist/settings/style-settings.js +65 -73
- package/dist/settings/table-element-settings/components/data-filter.js +30 -38
- package/dist/settings/table-element-settings/data-settings.js +21 -29
- package/dist/settings/table-element-settings/index.js +2 -13
- package/dist/settings/table-settings/data-settings.js +112 -120
- package/dist/settings/table-settings/index.js +2 -13
- package/dist/settings/time-comparison-settings/data-settings.js +43 -51
- package/dist/settings/time-comparison-settings/index.js +3 -20
- package/dist/settings/time-comparison-settings/style-settings.js +42 -50
- package/dist/settings/trend-settings/data-settings.js +24 -32
- package/dist/settings/trend-settings/index.js +3 -20
- package/dist/settings/trend-settings/style-setting.js +19 -27
- package/dist/settings/widgets/basic-summary/index.js +55 -63
- package/dist/settings/widgets/chart-type/index.js +18 -26
- package/dist/settings/widgets/color-settings/index.js +72 -80
- package/dist/settings/widgets/common-data-settings.js +21 -29
- package/dist/settings/widgets/data-filter/index.js +35 -43
- package/dist/settings/widgets/data-sort.js +16 -24
- package/dist/settings/widgets/date-summary-item.js +26 -34
- package/dist/settings/widgets/display-values-settings/index.js +14 -22
- package/dist/settings/widgets/divider/index.js +8 -16
- package/dist/settings/widgets/font-settings/font-color-settings.js +11 -19
- package/dist/settings/widgets/font-settings/font-size-settings.js +14 -22
- package/dist/settings/widgets/font-settings/font-weight-settings.js +17 -25
- package/dist/settings/widgets/font-settings/index.js +4 -27
- package/dist/settings/widgets/group-by.js +51 -59
- package/dist/settings/widgets/min-max-setting.js +10 -18
- package/dist/settings/widgets/mininum-slice-percent.js +10 -18
- package/dist/settings/widgets/numeric-summary-item.js +25 -33
- package/dist/settings/widgets/select-line-type/index.js +10 -17
- package/dist/settings/widgets/select-table/index.js +9 -16
- package/dist/settings/widgets/select-view/index.js +20 -28
- package/dist/settings/widgets/stack.js +14 -22
- package/dist/settings/widgets/summary-method-setting.js +17 -25
- package/dist/settings/widgets/summary-settings.js +74 -82
- package/dist/settings/widgets/switch/index.js +9 -16
- package/dist/settings/widgets/text-horizontal-settings.js +15 -23
- package/dist/settings/widgets/time-picker.js +29 -37
- package/dist/settings/widgets/title-settings/index.js +29 -37
- package/dist/settings/widgets/title-settings/title-text.js +5 -12
- package/dist/settings/widgets/x-axios.js +0 -1
- package/dist/settings/widgets/y-axis-group-settings.js +64 -72
- package/dist/utils/cell-format-utils.js +17 -27
- package/dist/utils/cell-value-utils.js +4 -11
- package/dist/utils/chart-utils/base-utils.js +324 -332
- package/dist/utils/chart-utils/index.js +28 -41
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +77 -84
- package/dist/utils/chart-utils/original-data-utils/card-calculator.js +13 -20
- package/dist/utils/chart-utils/original-data-utils/combination-calculator.js +45 -52
- package/dist/utils/chart-utils/original-data-utils/compare-bar-chart-calculator.js +21 -28
- package/dist/utils/chart-utils/original-data-utils/completeness-calculator.js +33 -40
- package/dist/utils/chart-utils/original-data-utils/dashboard-calculator.js +16 -23
- package/dist/utils/chart-utils/original-data-utils/index.js +50 -57
- package/dist/utils/chart-utils/original-data-utils/mirror-calculator.js +19 -26
- package/dist/utils/chart-utils/original-data-utils/pivot-table-calculator.js +90 -96
- package/dist/utils/chart-utils/original-data-utils/scatter-calculator.js +19 -26
- package/dist/utils/chart-utils/original-data-utils/trend-calculator.js +31 -38
- package/dist/utils/chart-utils/sql-statistics-utils.js +229 -237
- package/dist/utils/chart.js +9 -17
- package/dist/utils/collaborator-manager.js +3 -9
- package/dist/utils/collaborator-utils.js +19 -31
- package/dist/utils/collaborator.js +6 -15
- package/dist/utils/color-utils.js +18 -29
- package/dist/utils/column-utils.js +77 -104
- package/dist/utils/common-utils.js +28 -53
- package/dist/utils/concurrency-manager.js +1 -7
- package/dist/utils/contexts.js +5 -12
- package/dist/utils/date-translate.js +12 -20
- package/dist/utils/digital-sign-utils.js +7 -14
- package/dist/utils/event-bus.js +1 -7
- package/dist/utils/hotkey.js +5 -11
- package/dist/utils/index.js +54 -221
- package/dist/utils/key-generator.js +2 -9
- package/dist/utils/map.js +22 -31
- package/dist/utils/object-utils.js +2 -8
- package/dist/utils/options-utils.js +10 -18
- package/dist/utils/row-record-utils.js +166 -178
- package/dist/utils/row-utils.js +27 -38
- package/dist/utils/search.js +24 -32
- package/dist/utils/sql/chart-data-sql.js +106 -112
- package/dist/utils/sql/column-2-sql-column.js +158 -168
- package/dist/utils/sql/index.js +3 -27
- package/dist/utils/trend-utils.js +39 -47
- package/dist/view/index.js +90 -96
- package/dist/view/title/index.js +16 -24
- package/dist/view/wrapper/area-group.js +45 -53
- package/dist/view/wrapper/area.js +43 -51
- package/dist/view/wrapper/bar-compare.js +38 -46
- package/dist/view/wrapper/bar-custom-stack.js +39 -47
- package/dist/view/wrapper/bar-group.js +45 -53
- package/dist/view/wrapper/bar-stack.js +48 -56
- package/dist/view/wrapper/bar.js +40 -48
- package/dist/view/wrapper/basic-number-card.js +26 -34
- package/dist/view/wrapper/chart-component.js +123 -131
- package/dist/view/wrapper/combination.js +55 -63
- package/dist/view/wrapper/completeness-group.js +40 -48
- package/dist/view/wrapper/completeness.js +36 -44
- package/dist/view/wrapper/dashboard.js +39 -44
- package/dist/view/wrapper/funnel.js +40 -43
- package/dist/view/wrapper/heat-map.js +62 -70
- package/dist/view/wrapper/horizontal-bar-group.js +52 -60
- package/dist/view/wrapper/horizontal-bar-stack.js +47 -55
- package/dist/view/wrapper/horizontal-bar.js +41 -49
- package/dist/view/wrapper/index.js +107 -115
- package/dist/view/wrapper/line-group.js +43 -51
- package/dist/view/wrapper/line.js +42 -50
- package/dist/view/wrapper/map-bubble.js +40 -48
- package/dist/view/wrapper/map-world-bubble.js +39 -47
- package/dist/view/wrapper/map-world.js +41 -49
- package/dist/view/wrapper/map.js +42 -50
- package/dist/view/wrapper/mirror.js +41 -49
- package/dist/view/wrapper/pie.js +44 -52
- package/dist/view/wrapper/ring.js +49 -57
- package/dist/view/wrapper/scatter.js +42 -50
- package/dist/view/wrapper/table/index.js +14 -22
- package/dist/view/wrapper/table/one-dimension-table-no-numeric-columns.js +49 -57
- package/dist/view/wrapper/table/one-dimension-table-with-numeric-columns.js +53 -61
- package/dist/view/wrapper/table/pivot-table-display-name.js +82 -90
- package/dist/view/wrapper/table/two-dimension-table.js +85 -93
- package/dist/view/wrapper/table-element/components/dataset-utils.js +23 -36
- package/dist/view/wrapper/table-element/components/formatter.js +90 -99
- package/dist/view/wrapper/table-element/components/formatters/FileFormatter/index.js +23 -32
- package/dist/view/wrapper/table-element/components/formatters/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/formatters/link-formatter.js +90 -97
- package/dist/view/wrapper/table-element/components/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/link-formatter.js +90 -97
- package/dist/view/wrapper/table-element/components/record.js +13 -20
- package/dist/view/wrapper/table-element/components/records-body.js +9 -17
- package/dist/view/wrapper/table-element/components/records-header/index.js +7 -15
- package/dist/view/wrapper/table-element/components/records-header/records-header-cell.js +8 -16
- package/dist/view/wrapper/table-element/components/records.js +25 -33
- package/dist/view/wrapper/table-element/components/resize-column-handle/resize-column-handle.js +5 -12
- package/dist/view/wrapper/table-element/components/utils.js +6 -16
- package/dist/view/wrapper/table-element/components/value-display-utils.js +4 -11
- package/dist/view/wrapper/table-element/components/vertical-scrollbar/index.js +6 -13
- package/dist/view/wrapper/table-element/index.js +18 -26
- package/dist/view/wrapper/treemap.js +38 -46
- package/dist/view/wrapper/trend.js +58 -66
- package/package.json +5 -5
|
@@ -1,27 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var _style = require("../../constants/style");
|
|
18
|
-
var _constants = require("../../constants");
|
|
19
|
-
var _utils = require("../../utils");
|
|
20
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
21
|
-
var _tooltip = _interopRequireDefault(require("../../components/tooltip"));
|
|
22
|
-
var _chartComponent = _interopRequireDefault(require("./chart-component"));
|
|
23
|
-
_dayjs.default.extend(_dayOfYear.default);
|
|
24
|
-
class HeatMap 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 dayjs from 'dayjs';
|
|
7
|
+
import { getTableById, getTableColumnByKey, getNumberDisplayString } from 'dtable-utils';
|
|
8
|
+
import dayOfYear from 'dayjs/plugin/dayOfYear';
|
|
9
|
+
import { FILL_BORDER_COLOR_MAP, COLOR_OPTIONS } from '../../constants/style';
|
|
10
|
+
import { DEFAULT_GRID_SIZE, DEFAULT_GRID_DISTANCE, DEFAULT_NUMBER_FORMAT_OBJECT, CHART_SUMMARY_TYPE, TITLE_AMOUNT } from '../../constants';
|
|
11
|
+
import { BaseUtils } from '../../utils';
|
|
12
|
+
import intl from '../../intl';
|
|
13
|
+
import ToolTip from '../../components/tooltip';
|
|
14
|
+
import ChartComponent from './chart-component';
|
|
15
|
+
dayjs.extend(dayOfYear);
|
|
16
|
+
class HeatMap extends ChartComponent {
|
|
25
17
|
constructor(props) {
|
|
26
18
|
super(props);
|
|
27
19
|
this.handleResize = () => {
|
|
@@ -65,8 +57,8 @@ class HeatMap extends _chartComponent.default {
|
|
|
65
57
|
grid_size,
|
|
66
58
|
grid_distance
|
|
67
59
|
} = chartConfig;
|
|
68
|
-
grid_size = grid_size ||
|
|
69
|
-
grid_distance = grid_distance ||
|
|
60
|
+
grid_size = grid_size || DEFAULT_GRID_SIZE;
|
|
61
|
+
grid_distance = grid_distance || DEFAULT_GRID_DISTANCE;
|
|
70
62
|
const yearHeight = grid_size * 7 + grid_distance * 6; // height for 1 year
|
|
71
63
|
const height = (yearHeight + monthAxisHeight) * count + (insertPadding + insertPadding); // monthAxisHeight is axis height, insertPadding is top and bottm height
|
|
72
64
|
const width = grid_size * 53 + grid_distance * 52 + (insertPadding + insertPadding); // insertPadding is left and right width
|
|
@@ -84,8 +76,8 @@ class HeatMap extends _chartComponent.default {
|
|
|
84
76
|
title: data.name,
|
|
85
77
|
items: [{
|
|
86
78
|
color: '',
|
|
87
|
-
name:
|
|
88
|
-
value:
|
|
79
|
+
name: intl.get(TITLE_AMOUNT),
|
|
80
|
+
value: getNumberDisplayString(data.value, columnData)
|
|
89
81
|
}]
|
|
90
82
|
};
|
|
91
83
|
this.setState({
|
|
@@ -138,17 +130,17 @@ class HeatMap extends _chartComponent.default {
|
|
|
138
130
|
summary_type,
|
|
139
131
|
summary_column
|
|
140
132
|
} = chart.config;
|
|
141
|
-
grid_size = grid_size ? grid_size :
|
|
142
|
-
const currentColorOption =
|
|
133
|
+
grid_size = grid_size ? grid_size : DEFAULT_GRID_SIZE;
|
|
134
|
+
const currentColorOption = COLOR_OPTIONS.filter(item => item.name === data_color)[0] || COLOR_OPTIONS[0];
|
|
143
135
|
const {
|
|
144
136
|
exampleColors
|
|
145
137
|
} = currentColorOption;
|
|
146
138
|
const themeColors = this.getThemeColors();
|
|
147
|
-
let columnData =
|
|
148
|
-
if (summary_type ===
|
|
149
|
-
const table =
|
|
150
|
-
const summaryColumn =
|
|
151
|
-
columnData = summaryColumn.data ||
|
|
139
|
+
let columnData = DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
140
|
+
if (summary_type === CHART_SUMMARY_TYPE.ADVANCED) {
|
|
141
|
+
const table = getTableById(tables, table_id);
|
|
142
|
+
const summaryColumn = getTableColumnByKey(table, summary_column) || {};
|
|
143
|
+
columnData = summaryColumn.data || DEFAULT_NUMBER_FORMAT_OBJECT;
|
|
152
144
|
}
|
|
153
145
|
const yAxisWrapper = this.chart.append('g').attr('class', 'y-axis-wrapper');
|
|
154
146
|
const xAxisWrapper = this.chart.append('g').attr('class', 'x-axis-wrapper');
|
|
@@ -161,7 +153,7 @@ class HeatMap extends _chartComponent.default {
|
|
|
161
153
|
Array.from(fyDomain).forEach((year, index) => {
|
|
162
154
|
// Y axis
|
|
163
155
|
const y = d3.scaleBand().domain(this.weeks).range([fy(year), fy(year) + (fy.bandwidth() - monthAxisHeight)]).paddingInner(0).paddingOuter(0);
|
|
164
|
-
yAxisWrapper.append('g').attr('class',
|
|
156
|
+
yAxisWrapper.append('g').attr('class', `y-axis-${year}`).attr('transform', `translate(${insertPadding}, 0)`).call(d3.axisLeft(y).tickSizeInner(0).tickSizeOuter(0).tickFormat(d => intl.get(d))).call(g => {
|
|
165
157
|
g.select('.domain').remove();
|
|
166
158
|
g.selectAll('text').attr('font-size', 12);
|
|
167
159
|
g.selectAll('text').attr('fill', themeColors.textColor);
|
|
@@ -176,15 +168,15 @@ class HeatMap extends _chartComponent.default {
|
|
|
176
168
|
const weekScale = d3.scaleBand().domain(weekDomain).range([insertPadding, chartWidth - insertPadding]).paddingInner(0).paddingOuter(0);
|
|
177
169
|
|
|
178
170
|
// year
|
|
179
|
-
const yearWrapper = contentWrapper.append('g').attr('class',
|
|
171
|
+
const yearWrapper = contentWrapper.append('g').attr('class', `year-wrapper-${year}`);
|
|
180
172
|
dates.forEach(_ref => {
|
|
181
173
|
let [monthIndex, days] = _ref;
|
|
182
174
|
// month
|
|
183
|
-
const monthWrapper = yearWrapper.append('g').attr('class',
|
|
175
|
+
const monthWrapper = yearWrapper.append('g').attr('class', `month-${this.months[monthIndex]}`);
|
|
184
176
|
// day
|
|
185
177
|
days.forEach((d, index) => {
|
|
186
|
-
monthWrapper.append('rect').attr('class', () =>
|
|
187
|
-
let curWeek = (
|
|
178
|
+
monthWrapper.append('rect').attr('class', () => `day-${dayjs(d).dayOfYear()}`).attr('x', () => {
|
|
179
|
+
let curWeek = dayjs(d).week();
|
|
188
180
|
// The last few days are the first week of the next year
|
|
189
181
|
if (monthIndex === 11 && curWeek === 1) {
|
|
190
182
|
curWeek = weekCount;
|
|
@@ -194,20 +186,20 @@ class HeatMap extends _chartComponent.default {
|
|
|
194
186
|
} // Record the x position of the first day of each month
|
|
195
187
|
return weekScale(curWeek);
|
|
196
188
|
}).attr('y', () => {
|
|
197
|
-
const curWeek = this.weeks[(
|
|
189
|
+
const curWeek = this.weeks[dayjs(d).day()];
|
|
198
190
|
return y(curWeek);
|
|
199
191
|
}).attr('width', grid_size).attr('height', grid_size).attr('rx', grid_size * borderRadius).attr('fill', () => this.getRectColor(d, data, 'fill', exampleColors)).attr('stroke', () => this.getRectColor(d, data, 'stroke', exampleColors)).attr('stroke-width', 1).on('click', () => {
|
|
200
|
-
const curDate = data.find(item => item.name === (
|
|
192
|
+
const curDate = data.find(item => item.name === dayjs(d).format('YYYY-MM-DD'));
|
|
201
193
|
if (curDate) {
|
|
202
194
|
this.props.toggleRecords(curDate);
|
|
203
195
|
}
|
|
204
196
|
}).on('mouseover', event => {
|
|
205
|
-
const curDate = data.find(item => item.name === (
|
|
197
|
+
const curDate = data.find(item => item.name === dayjs(d).format('YYYY-MM-DD'));
|
|
206
198
|
if (curDate) {
|
|
207
199
|
this.showTooltip(event, curDate, columnData);
|
|
208
200
|
}
|
|
209
201
|
}).on('mousemove', event => {
|
|
210
|
-
const curDate = data.find(item => item.name === (
|
|
202
|
+
const curDate = data.find(item => item.name === dayjs(d).format('YYYY-MM-DD'));
|
|
211
203
|
if (curDate) {
|
|
212
204
|
this.moveTooltip(event);
|
|
213
205
|
}
|
|
@@ -219,18 +211,18 @@ class HeatMap extends _chartComponent.default {
|
|
|
219
211
|
|
|
220
212
|
// X axis
|
|
221
213
|
const x = d3.scalePoint().domain(this.months).range([insertPadding, chartWidth - insertPadding]);
|
|
222
|
-
xAxisWrapper.append('g').attr('class',
|
|
214
|
+
xAxisWrapper.append('g').attr('class', `x-axis-${year}`).attr('transform', `translate(0, ${fy(year) + fy.bandwidth() - monthAxisHeight})`).call(d3.axisBottom(x).tickSizeInner(0).tickSizeOuter(0).tickFormat(d => intl.get(d))).call(g => {
|
|
223
215
|
g.select('.domain').remove();
|
|
224
216
|
g.selectAll('.tick').nodes().forEach((item, index) => {
|
|
225
217
|
const curTranslateX = monthTranslateX[index] + weekScale.bandwidth() / 2;
|
|
226
|
-
d3.select(item).attr('transform',
|
|
218
|
+
d3.select(item).attr('transform', `translate(${curTranslateX}, 0)`);
|
|
227
219
|
});
|
|
228
220
|
g.selectAll('text').attr('font-size', 12);
|
|
229
221
|
g.selectAll('text').attr('fill', themeColors.textColor);
|
|
230
222
|
});
|
|
231
223
|
|
|
232
224
|
// Title
|
|
233
|
-
titleWrapper.append('text').attr('class',
|
|
225
|
+
titleWrapper.append('text').attr('class', `text-${year}`).attr('x', 0).attr('y', fy(year) + fy.bandwidth()).attr('fill', '#000').attr('font-size', 12).attr('font-weight', 500).text(year);
|
|
234
226
|
});
|
|
235
227
|
this.setLegendForHeatMap({
|
|
236
228
|
exampleColors: ['#EBEDF0', ...exampleColors],
|
|
@@ -239,27 +231,27 @@ class HeatMap extends _chartComponent.default {
|
|
|
239
231
|
};
|
|
240
232
|
this.generateYearDates = year => {
|
|
241
233
|
const dates = [];
|
|
242
|
-
let current = (
|
|
234
|
+
let current = dayjs(`${year}-01-01`);
|
|
243
235
|
while (current.year() === year) {
|
|
244
236
|
dates.push(current);
|
|
245
237
|
current = current.add(1, 'day');
|
|
246
238
|
}
|
|
247
239
|
const weekCount = Math.ceil(dates.length / 7);
|
|
248
|
-
return [d3.groups(dates, d => (
|
|
240
|
+
return [d3.groups(dates, d => dayjs(d).month()), weekCount];
|
|
249
241
|
};
|
|
250
242
|
this.getRectColor = (d, data, type, exampleColors) => {
|
|
251
243
|
const maxVal = d3.max(data, d => d.value);
|
|
252
244
|
const defaultColor = type === 'stroke' ? '#E1E3E6' : '#EBEDF0';
|
|
253
|
-
const curDate = data.find(item => item.name === (
|
|
245
|
+
const curDate = data.find(item => item.name === dayjs(d).format('YYYY-MM-DD'));
|
|
254
246
|
if (curDate) {
|
|
255
247
|
if (curDate.value <= 0) return defaultColor;
|
|
256
|
-
if (curDate.value === maxVal) return type === 'stroke' ?
|
|
248
|
+
if (curDate.value === maxVal) return type === 'stroke' ? FILL_BORDER_COLOR_MAP[exampleColors[8]] : exampleColors[8];
|
|
257
249
|
const curColor = Math.floor(curDate.value / (maxVal / 9));
|
|
258
|
-
return type === 'stroke' ?
|
|
250
|
+
return type === 'stroke' ? FILL_BORDER_COLOR_MAP[exampleColors[curColor]] : exampleColors[curColor];
|
|
259
251
|
}
|
|
260
252
|
return defaultColor;
|
|
261
253
|
};
|
|
262
|
-
|
|
254
|
+
dayjs.locale('en');
|
|
263
255
|
this.weeks = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
264
256
|
this.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
265
257
|
this.chart = null;
|
|
@@ -271,12 +263,12 @@ class HeatMap extends _chartComponent.default {
|
|
|
271
263
|
componentDidMount() {
|
|
272
264
|
this.createChart();
|
|
273
265
|
this.drawChart();
|
|
274
|
-
this.debouncedHandleResize =
|
|
266
|
+
this.debouncedHandleResize = debounce(this.handleResize, 300);
|
|
275
267
|
window.addEventListener('resize', this.debouncedHandleResize);
|
|
276
268
|
}
|
|
277
269
|
componentDidUpdate(prevProps) {
|
|
278
270
|
super.componentDidUpdate(prevProps);
|
|
279
|
-
if (
|
|
271
|
+
if (BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
280
272
|
this.destroyChart();
|
|
281
273
|
this.createChart();
|
|
282
274
|
this.drawChart();
|
|
@@ -294,13 +286,13 @@ class HeatMap extends _chartComponent.default {
|
|
|
294
286
|
tooltipData,
|
|
295
287
|
toolTipPosition
|
|
296
288
|
} = this.state;
|
|
297
|
-
return /*#__PURE__*/
|
|
289
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
298
290
|
ref: ref => this.container = ref,
|
|
299
|
-
className: (
|
|
291
|
+
className: classNames('sea-chart-container', {
|
|
300
292
|
'show-x-axis-label': this.isShowXAxisLabel(chart),
|
|
301
293
|
'show-y-axis-label': this.isShowYAxisLabel(chart)
|
|
302
294
|
})
|
|
303
|
-
}, /*#__PURE__*/
|
|
295
|
+
}, /*#__PURE__*/React.createElement(ToolTip, {
|
|
304
296
|
tooltipData: tooltipData,
|
|
305
297
|
toolTipPosition: toolTipPosition,
|
|
306
298
|
chart: this.chart
|
|
@@ -308,16 +300,16 @@ class HeatMap extends _chartComponent.default {
|
|
|
308
300
|
}
|
|
309
301
|
}
|
|
310
302
|
HeatMap.propTypes = {
|
|
311
|
-
canvasStyle:
|
|
312
|
-
chart:
|
|
313
|
-
groupbyColumn:
|
|
314
|
-
columnGroupbyColumn:
|
|
315
|
-
summaryColumn:
|
|
316
|
-
result:
|
|
317
|
-
tables:
|
|
318
|
-
globalTheme:
|
|
319
|
-
chartColorTheme:
|
|
320
|
-
toggleRecords:
|
|
321
|
-
customRender:
|
|
303
|
+
canvasStyle: PropTypes.object,
|
|
304
|
+
chart: PropTypes.object,
|
|
305
|
+
groupbyColumn: PropTypes.object,
|
|
306
|
+
columnGroupbyColumn: PropTypes.object,
|
|
307
|
+
summaryColumn: PropTypes.object,
|
|
308
|
+
result: PropTypes.object,
|
|
309
|
+
tables: PropTypes.array,
|
|
310
|
+
globalTheme: PropTypes.string,
|
|
311
|
+
chartColorTheme: PropTypes.string,
|
|
312
|
+
toggleRecords: PropTypes.func,
|
|
313
|
+
customRender: PropTypes.func
|
|
322
314
|
};
|
|
323
|
-
|
|
315
|
+
export default HeatMap;
|
|
@@ -1,29 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _constants = require("../../constants");
|
|
17
|
-
var _utils = require("../../utils");
|
|
18
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
19
|
-
var _colorRules = require("../../constants/color-rules");
|
|
20
|
-
var _columnUtils = require("../../utils/column-utils");
|
|
21
|
-
var _tooltip = _interopRequireDefault(require("../../components/tooltip"));
|
|
22
|
-
var _chartComponent = _interopRequireDefault(require("./chart-component"));
|
|
23
|
-
class HorizontalBarGroup extends _chartComponent.default {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { debounce, cloneDeep } from 'lodash-es';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import * as d3 from 'd3';
|
|
6
|
+
import { CellType } from 'dtable-utils';
|
|
7
|
+
import dayjs from 'dayjs';
|
|
8
|
+
import { CHART_TYPE, EMPTY_NAME, CHART_THEME_COLOR, CHART_STYLE_COLORS } from '../../constants';
|
|
9
|
+
import { BaseUtils, isFunction } from '../../utils';
|
|
10
|
+
import intl from '../../intl';
|
|
11
|
+
import { SUPPORT_SINGLE_SELECT_THEMES_OPTIONS } from '../../constants/color-rules';
|
|
12
|
+
import { sortDataByGroupSum } from '../../utils/column-utils';
|
|
13
|
+
import ToolTip from '../../components/tooltip';
|
|
14
|
+
import ChartComponent from './chart-component';
|
|
15
|
+
class HorizontalBarGroup extends ChartComponent {
|
|
24
16
|
constructor(props) {
|
|
25
17
|
super(props);
|
|
26
|
-
this.handleResize =
|
|
18
|
+
this.handleResize = debounce(() => {
|
|
27
19
|
this.destroyChart();
|
|
28
20
|
this.createChart();
|
|
29
21
|
this.drawChart();
|
|
@@ -55,17 +47,17 @@ class HorizontalBarGroup extends _chartComponent.default {
|
|
|
55
47
|
const {
|
|
56
48
|
column_groupby_column_key
|
|
57
49
|
} = chart.config || {};
|
|
58
|
-
data =
|
|
50
|
+
data = BaseUtils.formatEmptyName(data, column_groupby_column_key, intl.get(EMPTY_NAME));
|
|
59
51
|
if (!Array.isArray(data)) return;
|
|
60
52
|
const {
|
|
61
53
|
sort_type,
|
|
62
54
|
type
|
|
63
55
|
} = chart.config;
|
|
64
|
-
if (type ===
|
|
65
|
-
data =
|
|
56
|
+
if (type === CHART_TYPE.STACKED_HORIZONTAL_BAR && sort_type) {
|
|
57
|
+
data = sortDataByGroupSum(data, sort_type);
|
|
66
58
|
}
|
|
67
59
|
this.draw(data);
|
|
68
|
-
|
|
60
|
+
isFunction(customRender) && customRender(this.chart);
|
|
69
61
|
this.renderHorizontalLabel(this.props.chart, this.props.tables, this.container);
|
|
70
62
|
};
|
|
71
63
|
this.draw = data => {
|
|
@@ -77,7 +69,7 @@ class HorizontalBarGroup extends _chartComponent.default {
|
|
|
77
69
|
columnGroupbyColumn,
|
|
78
70
|
summaryColumn
|
|
79
71
|
} = this.props;
|
|
80
|
-
const theme =
|
|
72
|
+
const theme = CHART_THEME_COLOR[globalTheme];
|
|
81
73
|
const {
|
|
82
74
|
display_data,
|
|
83
75
|
label_font_size,
|
|
@@ -96,14 +88,14 @@ class HorizontalBarGroup extends _chartComponent.default {
|
|
|
96
88
|
marginRight
|
|
97
89
|
} = this.chartBoundingClientRect;
|
|
98
90
|
const groupByColumn = this.getColumn(tables, table_id, column_groupby_column_key);
|
|
99
|
-
const isGroupByDate = [
|
|
91
|
+
const isGroupByDate = [CellType.DATE, CellType.CTIME, CellType.MTIME].includes(groupByColumn === null || groupByColumn === void 0 ? void 0 : groupByColumn.type);
|
|
100
92
|
if (isGroupByDate) {
|
|
101
|
-
const emptyName =
|
|
93
|
+
const emptyName = intl.get(EMPTY_NAME);
|
|
102
94
|
data = data.map(item => {
|
|
103
95
|
const rawGroupName = item.group_name;
|
|
104
96
|
if (rawGroupName === null || rawGroupName === undefined || rawGroupName === '') return item;
|
|
105
97
|
if (rawGroupName === emptyName) return item;
|
|
106
|
-
const dateValue = (
|
|
98
|
+
const dateValue = dayjs(rawGroupName);
|
|
107
99
|
if (!dateValue.isValid()) return item;
|
|
108
100
|
return {
|
|
109
101
|
...item,
|
|
@@ -111,10 +103,10 @@ class HorizontalBarGroup extends _chartComponent.default {
|
|
|
111
103
|
};
|
|
112
104
|
});
|
|
113
105
|
}
|
|
114
|
-
const useSingleSelectColumnColor = (groupByColumn === null || groupByColumn === void 0 ? void 0 : groupByColumn.type) ===
|
|
106
|
+
const useSingleSelectColumnColor = (groupByColumn === null || groupByColumn === void 0 ? void 0 : groupByColumn.type) === CellType.SINGLE_SELECT && color_theme === SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
115
107
|
useSingleSelectColumnColor ? this.setSingleSelectColorMap(data) : this.setColorMap(data, chartColorTheme);
|
|
116
108
|
const fy = d3.scaleBand().domain(new Set(data.map(d => d.name))).range([chartHeight - insertPadding, insertPadding]).paddingInner(0.3).paddingOuter(0.1);
|
|
117
|
-
const sortedData =
|
|
109
|
+
const sortedData = BaseUtils.sortDataByGroupName(cloneDeep(data), 'group_name', columnGroupbyColumn, chart);
|
|
118
110
|
const y = d3.scaleBand().domain(new Set(sortedData.map(d => d.group_name))).range([0, fy.bandwidth()]).paddingInner(0).paddingOuter(0);
|
|
119
111
|
|
|
120
112
|
// Y axis
|
|
@@ -127,14 +119,14 @@ class HorizontalBarGroup extends _chartComponent.default {
|
|
|
127
119
|
const {
|
|
128
120
|
width: axisWidth
|
|
129
121
|
} = g.node().getBoundingClientRect();
|
|
130
|
-
g.attr('transform',
|
|
122
|
+
g.attr('transform', `translate(${axisWidth}, 0)`).attr('data-axisWidth', axisWidth);
|
|
131
123
|
this.checkTickOverlap(g, 'yAxis');
|
|
132
124
|
});
|
|
133
125
|
const niceEnd = d3.nice(0, d3.max(data, d => d.value), 5)[1];
|
|
134
126
|
const x = d3.scaleLinear().domain(horizontal_axis_auto_range ? [0, niceEnd] : [horizontal_axis_min || 0, horizontal_axis_max || niceEnd]).range([Number(yAxis.node().getAttribute('data-axisWidth')), chartWidth - insertPadding - marginRight]);
|
|
135
127
|
|
|
136
128
|
// X axis
|
|
137
|
-
this.chart.append('g').attr('class', 'x-axis-wrapper').attr('transform',
|
|
129
|
+
this.chart.append('g').attr('class', 'x-axis-wrapper').attr('transform', `translate(0, ${chartHeight - insertPadding})`).call(d3.axisBottom(x).tickSizeInner(0).ticks(5).tickFormat(d => BaseUtils.getSummaryValueDisplayString(summaryColumn, d, horizontal_axis_summary_method))).call(g => {
|
|
138
130
|
g.selectAll('.domain').remove();
|
|
139
131
|
g.selectAll('.tick line').node() && g.selectAll('.tick line').node().remove(); // delete the first line
|
|
140
132
|
g.selectAll('.tick line').attr('y2', -(chartHeight - insertPadding * 2)).attr('stroke', theme.gridColor).attr('stroke-dasharray', '8,3');
|
|
@@ -143,18 +135,18 @@ class HorizontalBarGroup extends _chartComponent.default {
|
|
|
143
135
|
});
|
|
144
136
|
|
|
145
137
|
// Rect group
|
|
146
|
-
const contentWrapper = this.chart.append('g').attr('class', 'content-wrapper').attr('transform',
|
|
138
|
+
const contentWrapper = this.chart.append('g').attr('class', 'content-wrapper').attr('transform', `translate(${Number(yAxis.node().getAttribute('data-axisWidth'))}, 0)`);
|
|
147
139
|
contentWrapper.selectAll().data(d3.group(sortedData, d => d.name)).join('g').attr('transform', _ref => {
|
|
148
140
|
let [name, dum] = _ref;
|
|
149
141
|
const offset = (fy.bandwidth() - dum.length * y.bandwidth()) / 2;
|
|
150
|
-
return
|
|
142
|
+
return `translate(0, ${fy(name) + offset})`;
|
|
151
143
|
})
|
|
152
144
|
// rect item
|
|
153
145
|
.selectAll().data(_ref2 => {
|
|
154
146
|
let [_, d] = _ref2;
|
|
155
147
|
return d;
|
|
156
148
|
}).join('rect').attr('opacity', 1).attr('x', 0).attr('y', (d, index) => index * y.bandwidth()).attr('width', d => x(d.value) - x(0)).attr('height', y.bandwidth()).attr('fill', d => {
|
|
157
|
-
return this.colorMap[d.group_name] ||
|
|
149
|
+
return this.colorMap[d.group_name] || CHART_STYLE_COLORS[0];
|
|
158
150
|
}).attr('value', d => d.value).attr('data-slugid', d => d.slugId).attr('data-groupName', d => d.name).call(g => {
|
|
159
151
|
// add rect borderRadius
|
|
160
152
|
g.nodes().forEach(rect => {
|
|
@@ -177,7 +169,7 @@ class HorizontalBarGroup extends _chartComponent.default {
|
|
|
177
169
|
y: Number(rect.getAttribute('y')),
|
|
178
170
|
theme,
|
|
179
171
|
label_font_size,
|
|
180
|
-
text:
|
|
172
|
+
text: BaseUtils.getSummaryValueDisplayString(summaryColumn, Number(rect.getAttribute('value')), horizontal_axis_summary_method)
|
|
181
173
|
});
|
|
182
174
|
}
|
|
183
175
|
});
|
|
@@ -221,14 +213,14 @@ class HorizontalBarGroup extends _chartComponent.default {
|
|
|
221
213
|
const title = event.currentTarget.getAttribute('data-groupName');
|
|
222
214
|
const children = Array.from(event.currentTarget.parentNode.children).filter(item => item.tagName === 'rect');
|
|
223
215
|
const newTooltipData = {
|
|
224
|
-
title: !title && typeof title !== 'number' ?
|
|
216
|
+
title: !title && typeof title !== 'number' ? intl.get(EMPTY_NAME) : title,
|
|
225
217
|
items: children.map(child => {
|
|
226
218
|
const data = child.__data__;
|
|
227
|
-
const groupName = data.group_name === null || data.group_name === undefined || data.group_name === '' ?
|
|
219
|
+
const groupName = data.group_name === null || data.group_name === undefined || data.group_name === '' ? intl.get(EMPTY_NAME) : data.group_name;
|
|
228
220
|
return {
|
|
229
|
-
color: this.colorMap[groupName] ||
|
|
221
|
+
color: this.colorMap[groupName] || CHART_STYLE_COLORS[0],
|
|
230
222
|
name: groupName,
|
|
231
|
-
value:
|
|
223
|
+
value: BaseUtils.getSummaryValueDisplayString(summaryColumn, Number(child.getAttribute('value')), horizontal_axis_summary_method)
|
|
232
224
|
};
|
|
233
225
|
})
|
|
234
226
|
};
|
|
@@ -272,7 +264,7 @@ class HorizontalBarGroup extends _chartComponent.default {
|
|
|
272
264
|
}
|
|
273
265
|
componentDidUpdate(prevProps) {
|
|
274
266
|
super.componentDidUpdate(prevProps);
|
|
275
|
-
if (
|
|
267
|
+
if (BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
276
268
|
this.destroyChart();
|
|
277
269
|
this.createChart();
|
|
278
270
|
this.drawChart();
|
|
@@ -290,13 +282,13 @@ class HorizontalBarGroup extends _chartComponent.default {
|
|
|
290
282
|
tooltipData,
|
|
291
283
|
toolTipPosition
|
|
292
284
|
} = this.state;
|
|
293
|
-
return /*#__PURE__*/
|
|
285
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
294
286
|
ref: ref => this.container = ref,
|
|
295
|
-
className: (
|
|
287
|
+
className: classNames('sea-chart-container', {
|
|
296
288
|
'show-x-axis-label': this.isShowHorizontalAxisLabel(chart),
|
|
297
289
|
'show-y-axis-label': this.isShowVerticalAxisLabel(chart)
|
|
298
290
|
})
|
|
299
|
-
}, /*#__PURE__*/
|
|
291
|
+
}, /*#__PURE__*/React.createElement(ToolTip, {
|
|
300
292
|
tooltipData: tooltipData,
|
|
301
293
|
toolTipPosition: toolTipPosition,
|
|
302
294
|
chart: this.chart
|
|
@@ -304,16 +296,16 @@ class HorizontalBarGroup extends _chartComponent.default {
|
|
|
304
296
|
}
|
|
305
297
|
}
|
|
306
298
|
HorizontalBarGroup.propTypes = {
|
|
307
|
-
canvasStyle:
|
|
308
|
-
chart:
|
|
309
|
-
groupbyColumn:
|
|
310
|
-
columnGroupbyColumn:
|
|
311
|
-
summaryColumn:
|
|
312
|
-
result:
|
|
313
|
-
tables:
|
|
314
|
-
globalTheme:
|
|
315
|
-
chartColorTheme:
|
|
316
|
-
toggleRecords:
|
|
317
|
-
customRender:
|
|
299
|
+
canvasStyle: PropTypes.object,
|
|
300
|
+
chart: PropTypes.object,
|
|
301
|
+
groupbyColumn: PropTypes.object,
|
|
302
|
+
columnGroupbyColumn: PropTypes.object,
|
|
303
|
+
summaryColumn: PropTypes.object,
|
|
304
|
+
result: PropTypes.array,
|
|
305
|
+
tables: PropTypes.array,
|
|
306
|
+
globalTheme: PropTypes.string,
|
|
307
|
+
chartColorTheme: PropTypes.string,
|
|
308
|
+
toggleRecords: PropTypes.func,
|
|
309
|
+
customRender: PropTypes.func
|
|
318
310
|
};
|
|
319
|
-
|
|
311
|
+
export default HorizontalBarGroup;
|