sea-chart 2.0.37 → 2.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.js +20 -69
- package/dist/assets/css/sea-chart-d3-tooltip.css +0 -1
- package/dist/components/cell-factory/FormatterConfig.js +55 -62
- package/dist/components/cell-factory/SimpleCellFormatter.js +5 -12
- package/dist/components/cell-factory/SingleSelectOption.js +11 -18
- package/dist/components/cell-factory/cell-editor-factory.js +5 -12
- package/dist/components/cell-factory/cell-formatter-factory.js +4 -11
- package/dist/components/cell-factory/link-content.js +30 -38
- package/dist/components/chart-color-selector/color-selector.js +11 -18
- package/dist/components/collaborator/index.js +7 -14
- package/dist/components/color-picker/index.js +12 -19
- package/dist/components/color-popover/color-rules/color-rule.js +26 -34
- package/dist/components/color-popover/color-rules/index.js +7 -15
- package/dist/components/color-popover/color-rules/rule-filters/filter.js +27 -34
- package/dist/components/color-popover/color-rules/rule-filters/index.js +17 -25
- package/dist/components/color-popover/color-rules/rule-filters/number-input.js +9 -17
- package/dist/components/color-popover/color-rules-popover.js +31 -37
- package/dist/components/color-popover/color-selector-popover.js +12 -20
- package/dist/components/color-setting/color-group-selector.js +13 -21
- package/dist/components/common-add-tool/index.js +8 -15
- package/dist/components/data-process-setter/data-setting-header.js +7 -14
- package/dist/components/data-process-setter/hide-column-setter.js +13 -20
- package/dist/components/data-process-setter/index.js +4 -27
- package/dist/components/data-process-setter/sort-setter.js +18 -26
- package/dist/components/draggable/Draggable.js +7 -13
- package/dist/components/drill-down-settings/drill-down-fields-popover/index.js +41 -48
- package/dist/components/drill-down-settings/drill-down-fields-settings/index.js +10 -18
- package/dist/components/drill-down-settings/index.js +11 -18
- package/dist/components/dtable-popover/index.js +13 -20
- package/dist/components/dtable-search-input/index.js +13 -21
- package/dist/components/font-settings/index.js +14 -22
- package/dist/components/goal-line-setting/goal-setting-item.js +6 -14
- package/dist/components/goal-line-setting/index.js +12 -19
- package/dist/components/highlighter/highlighter.js +7 -14
- package/dist/components/icon/index.js +12 -23
- package/dist/components/index.js +7 -48
- package/dist/components/loading/index.js +6 -13
- package/dist/components/number-input/index.js +11 -24
- package/dist/components/pixel-editor/index.js +15 -23
- package/dist/components/popover/hide-column-popover/hide-column-popover-widgets/hide-column-item.js +13 -16
- package/dist/components/popover/hide-column-popover/hide-column-popover.css +5 -1
- package/dist/components/popover/hide-column-popover/hide-column-popover.js +28 -38
- package/dist/components/popover/sort-popover/sort-popover-widgets/sort-utils.js +9 -18
- package/dist/components/popover/sort-popover/sort-popover.js +58 -69
- package/dist/components/resize-handle/ResizeHandle.js +6 -13
- package/dist/components/row-card/row-card-header-cell.js +17 -24
- package/dist/components/row-card/row-card-header.js +15 -22
- package/dist/components/row-card/row-card-item.js +35 -43
- package/dist/components/row-card/row-card.js +17 -25
- package/dist/components/statistic-record-dialog/index.js +61 -68
- package/dist/components/tooltip/index.js +39 -28
- package/dist/components/types-dialog/index.js +62 -70
- package/dist/components/types-dialog/use-force-update.js +4 -10
- package/dist/constants/color-rules.js +8 -14
- package/dist/constants/common-constants.js +8 -14
- package/dist/constants/error.js +2 -8
- package/dist/constants/geolocation.js +9 -15
- package/dist/constants/index.js +142 -271
- package/dist/constants/key-codes.js +0 -2
- package/dist/constants/model.js +3 -9
- package/dist/constants/regions.js +3 -8
- package/dist/constants/style.js +6 -12
- package/dist/constants/table.js +1 -7
- package/dist/constants/type-image.js +33 -39
- package/dist/constants/type.js +3 -9
- package/dist/context.js +13 -20
- package/dist/editor/index.js +13 -16
- package/dist/index.js +13 -104
- package/dist/intl.js +10 -17
- package/dist/locale/index.js +16 -23
- package/dist/locale/lang/de.js +2 -7
- package/dist/locale/lang/en.js +2 -7
- package/dist/locale/lang/es.js +2 -7
- package/dist/locale/lang/fr.js +2 -7
- package/dist/locale/lang/pt.js +2 -7
- package/dist/locale/lang/ru.js +2 -7
- package/dist/locale/lang/zh_CN.js +2 -7
- package/dist/model/area-group.js +12 -19
- package/dist/model/area.js +12 -19
- package/dist/model/bar-custom.js +11 -18
- package/dist/model/bar-group.js +12 -19
- package/dist/model/bar-stack.js +10 -17
- package/dist/model/bar.js +11 -18
- package/dist/model/base-model.js +4 -11
- package/dist/model/basic-number-card.js +13 -20
- package/dist/model/chart.js +7 -13
- package/dist/model/combination.js +15 -22
- package/dist/model/compare-bar.js +14 -21
- package/dist/model/completeness-group.js +11 -18
- package/dist/model/completeness.js +10 -17
- package/dist/model/dashboard.js +7 -14
- package/dist/model/funnel.js +14 -21
- package/dist/model/generic-model.js +135 -143
- package/dist/model/heat-map.js +9 -16
- package/dist/model/horizontal-bar.js +11 -18
- package/dist/model/horizontal-group-bar.js +10 -17
- package/dist/model/index.js +69 -93
- package/dist/model/line-group.js +13 -20
- package/dist/model/line.js +12 -19
- package/dist/model/map-bubble.js +14 -17
- package/dist/model/map.js +12 -19
- package/dist/model/mirror.js +13 -20
- package/dist/model/pie.js +12 -19
- package/dist/model/ring.js +12 -19
- package/dist/model/scatter.js +10 -17
- package/dist/model/stacked-horizontal-bar.js +11 -18
- package/dist/model/table-element.js +5 -12
- package/dist/model/table.js +7 -14
- package/dist/model/tree-map.js +7 -14
- package/dist/model/trend.js +11 -18
- package/dist/model/user.js +1 -7
- package/dist/model/world-map-bubble.js +12 -19
- package/dist/model/world-map.js +12 -19
- package/dist/services/map-json.js +14 -17
- package/dist/settings/advance-bar-settings/data-settings.js +36 -44
- package/dist/settings/advance-bar-settings/index.js +3 -20
- package/dist/settings/advance-bar-settings/style-settings.js +66 -73
- package/dist/settings/bar-settings/data-settings.js +39 -47
- package/dist/settings/bar-settings/index.js +3 -20
- package/dist/settings/bar-settings/style-settings.js +51 -59
- package/dist/settings/basic-number-card/data-settings.js +50 -57
- package/dist/settings/basic-number-card/index.js +3 -20
- package/dist/settings/basic-number-card/style-settings.js +19 -27
- package/dist/settings/combination-settings/data-settings.js +55 -64
- package/dist/settings/combination-settings/index.js +3 -20
- package/dist/settings/combination-settings/style-settings.js +67 -75
- package/dist/settings/completeness-settings/callbacks/callbacks.js +16 -27
- package/dist/settings/completeness-settings/data-settings/completion-settings.js +21 -28
- package/dist/settings/completeness-settings/data-settings/data-settings.js +25 -32
- package/dist/settings/completeness-settings/index.js +3 -20
- package/dist/settings/completeness-settings/style-settings.js +19 -26
- package/dist/settings/dashboard-settings/data-settings.js +44 -51
- package/dist/settings/dashboard-settings/index.js +2 -13
- package/dist/settings/data-settings.js +72 -79
- package/dist/settings/funnel-settings/components/dnd-item/dnd-item.js +12 -19
- package/dist/settings/funnel-settings/components/dnd-list.js +15 -23
- package/dist/settings/funnel-settings/components/funnel-label-setting.js +32 -40
- package/dist/settings/funnel-settings/components/funnel-layer-setting.js +22 -30
- package/dist/settings/funnel-settings/data-settings.js +23 -31
- package/dist/settings/funnel-settings/index.js +3 -20
- package/dist/settings/funnel-settings/style-settings.js +11 -19
- package/dist/settings/heat-map-settings/data-settings.js +18 -26
- package/dist/settings/heat-map-settings/index.js +3 -20
- package/dist/settings/heat-map-settings/style-settings.js +18 -26
- package/dist/settings/horizontal-bar-settings/data-settings.js +12 -19
- package/dist/settings/horizontal-bar-settings/index.js +3 -20
- package/dist/settings/horizontal-bar-settings/style-settings.js +12 -19
- package/dist/settings/index.js +57 -70
- package/dist/settings/map-settings/components/location-field-selector.js +10 -17
- package/dist/settings/map-settings/components/map-level-selector.js +11 -18
- package/dist/settings/map-settings/components/map-province-city-selector.js +19 -26
- package/dist/settings/map-settings/index.js +3 -20
- package/dist/settings/map-settings/map-data-settings.js +23 -30
- package/dist/settings/map-settings/map-style-settings.js +27 -35
- package/dist/settings/mirror-settings/data-settings.js +26 -34
- package/dist/settings/mirror-settings/index.js +2 -13
- package/dist/settings/pie-settings/data-settings.js +33 -41
- package/dist/settings/pie-settings/index.js +3 -20
- package/dist/settings/pie-settings/style-settings.js +47 -55
- package/dist/settings/scatter/data-settings.js +27 -34
- package/dist/settings/scatter/index.js +3 -12
- package/dist/settings/stacks-settings/index.js +19 -27
- package/dist/settings/stacks-settings/stack-item-settings.js +19 -27
- package/dist/settings/style-settings.js +65 -73
- package/dist/settings/table-element-settings/components/data-filter.js +49 -58
- package/dist/settings/table-element-settings/data-settings.js +21 -29
- package/dist/settings/table-element-settings/index.css +1 -31
- package/dist/settings/table-element-settings/index.js +2 -13
- package/dist/settings/table-settings/data-settings.js +113 -120
- package/dist/settings/table-settings/index.js +2 -13
- package/dist/settings/time-comparison-settings/data-settings.js +43 -51
- package/dist/settings/time-comparison-settings/index.js +3 -20
- package/dist/settings/time-comparison-settings/style-settings.js +44 -52
- package/dist/settings/trend-settings/data-settings.js +24 -32
- package/dist/settings/trend-settings/index.js +3 -20
- package/dist/settings/trend-settings/style-setting.js +19 -27
- package/dist/settings/widgets/basic-summary/index.js +59 -66
- package/dist/settings/widgets/chart-type/index.js +18 -26
- package/dist/settings/widgets/color-settings/index.js +72 -80
- package/dist/settings/widgets/common-data-settings.js +27 -34
- package/dist/settings/widgets/data-filter/index.js +59 -59
- package/dist/settings/widgets/data-sort.js +16 -24
- package/dist/settings/widgets/date-summary-item.js +26 -34
- package/dist/settings/widgets/display-values-settings/index.js +14 -22
- package/dist/settings/widgets/divider/index.js +8 -16
- package/dist/settings/widgets/font-settings/font-color-settings.js +11 -19
- package/dist/settings/widgets/font-settings/font-size-settings.js +14 -22
- package/dist/settings/widgets/font-settings/font-weight-settings.js +17 -25
- package/dist/settings/widgets/font-settings/index.js +4 -27
- package/dist/settings/widgets/group-by.js +52 -59
- package/dist/settings/widgets/min-max-setting.js +10 -18
- package/dist/settings/widgets/mininum-slice-percent.js +10 -18
- package/dist/settings/widgets/numeric-summary-item.js +25 -33
- package/dist/settings/widgets/select-line-type/index.js +10 -17
- package/dist/settings/widgets/select-table/index.js +9 -16
- package/dist/settings/widgets/select-view/index.js +20 -28
- package/dist/settings/widgets/stack.js +14 -22
- package/dist/settings/widgets/summary-method-setting.js +17 -25
- package/dist/settings/widgets/summary-settings.js +75 -82
- package/dist/settings/widgets/switch/index.js +9 -16
- package/dist/settings/widgets/text-horizontal-settings.js +15 -23
- package/dist/settings/widgets/time-picker.js +29 -37
- package/dist/settings/widgets/title-settings/index.js +29 -37
- package/dist/settings/widgets/title-settings/title-text.js +5 -12
- package/dist/settings/widgets/x-axios.js +0 -1
- package/dist/settings/widgets/y-axis-group-settings.js +65 -72
- package/dist/utils/cell-format-utils.js +25 -33
- package/dist/utils/cell-value-utils.js +4 -11
- package/dist/utils/chart-utils/base-utils.js +467 -367
- package/dist/utils/chart-utils/index.js +29 -40
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +78 -85
- package/dist/utils/chart-utils/original-data-utils/card-calculator.js +20 -21
- package/dist/utils/chart-utils/original-data-utils/combination-calculator.js +45 -52
- package/dist/utils/chart-utils/original-data-utils/compare-bar-chart-calculator.js +21 -28
- package/dist/utils/chart-utils/original-data-utils/completeness-calculator.js +33 -40
- package/dist/utils/chart-utils/original-data-utils/dashboard-calculator.js +28 -26
- package/dist/utils/chart-utils/original-data-utils/index.js +50 -57
- package/dist/utils/chart-utils/original-data-utils/mirror-calculator.js +19 -26
- package/dist/utils/chart-utils/original-data-utils/pivot-table-calculator.js +94 -97
- package/dist/utils/chart-utils/original-data-utils/scatter-calculator.js +19 -25
- package/dist/utils/chart-utils/original-data-utils/trend-calculator.js +50 -36
- package/dist/utils/chart-utils/sql-statistics-utils.js +385 -388
- package/dist/utils/chart.js +9 -17
- package/dist/utils/collaborator-manager.js +3 -9
- package/dist/utils/collaborator-utils.js +19 -31
- package/dist/utils/collaborator.js +6 -15
- package/dist/utils/color-utils.js +18 -29
- package/dist/utils/column-utils.js +88 -102
- package/dist/utils/common-utils.js +28 -53
- package/dist/utils/concurrency-manager.js +1 -7
- package/dist/utils/contexts.js +7 -11
- package/dist/utils/date-translate.js +12 -20
- package/dist/utils/digital-sign-utils.js +7 -14
- package/dist/utils/event-bus.js +1 -7
- package/dist/utils/hotkey.js +5 -11
- package/dist/utils/index.js +73 -219
- package/dist/utils/key-generator.js +2 -9
- package/dist/utils/map.js +22 -31
- package/dist/utils/object-utils.js +2 -8
- package/dist/utils/options-utils.js +10 -18
- package/dist/utils/row-record-utils.js +251 -183
- package/dist/utils/row-utils.js +27 -38
- package/dist/utils/search.js +24 -32
- package/dist/utils/sql/chart-data-sql.js +106 -112
- package/dist/utils/sql/column-2-sql-column.js +162 -172
- package/dist/utils/sql/index.js +3 -27
- package/dist/utils/trend-utils.js +50 -45
- package/dist/view/index.css +2 -8
- package/dist/view/index.js +102 -103
- package/dist/view/title/index.js +16 -24
- package/dist/view/wrapper/area-group.js +57 -57
- package/dist/view/wrapper/area.js +43 -51
- package/dist/view/wrapper/bar-compare.js +56 -48
- package/dist/view/wrapper/bar-custom-stack.js +73 -55
- package/dist/view/wrapper/bar-group.js +94 -73
- package/dist/view/wrapper/bar-stack.js +49 -57
- package/dist/view/wrapper/bar.js +40 -48
- package/dist/view/wrapper/basic-number-card.js +50 -34
- package/dist/view/wrapper/chart-component.js +164 -569
- package/dist/view/wrapper/combination.js +55 -63
- package/dist/view/wrapper/completeness-group.js +140 -93
- package/dist/view/wrapper/completeness.js +36 -44
- package/dist/view/wrapper/dashboard.js +104 -59
- package/dist/view/wrapper/funnel.js +40 -43
- package/dist/view/wrapper/heat-map.js +62 -70
- package/dist/view/wrapper/horizontal-bar-group.js +70 -58
- package/dist/view/wrapper/horizontal-bar-stack.js +48 -56
- package/dist/view/wrapper/horizontal-bar.js +41 -49
- package/dist/view/wrapper/index.js +107 -115
- package/dist/view/wrapper/line-group.js +49 -52
- package/dist/view/wrapper/line.js +42 -50
- package/dist/view/wrapper/map-bubble.js +40 -48
- package/dist/view/wrapper/map-world-bubble.js +40 -47
- package/dist/view/wrapper/map-world.js +42 -49
- package/dist/view/wrapper/map.js +42 -50
- package/dist/view/wrapper/mirror.js +41 -49
- package/dist/view/wrapper/pie.js +45 -53
- package/dist/view/wrapper/ring.js +50 -58
- package/dist/view/wrapper/scatter.js +50 -56
- package/dist/view/wrapper/table/index.js +14 -22
- package/dist/view/wrapper/table/one-dimension-table-no-numeric-columns.js +49 -57
- package/dist/view/wrapper/table/one-dimension-table-with-numeric-columns.js +53 -61
- package/dist/view/wrapper/table/pivot-table-display-name.js +82 -90
- package/dist/view/wrapper/table/two-dimension-table.js +85 -92
- package/dist/view/wrapper/table-element/components/dataset-utils.js +23 -36
- package/dist/view/wrapper/table-element/components/formatter.js +90 -99
- package/dist/view/wrapper/table-element/components/formatters/FileFormatter/index.js +23 -32
- package/dist/view/wrapper/table-element/components/formatters/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/formatters/link-formatter.js +90 -97
- package/dist/view/wrapper/table-element/components/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/link-formatter.js +90 -97
- package/dist/view/wrapper/table-element/components/record.js +13 -20
- package/dist/view/wrapper/table-element/components/records-body.js +9 -17
- package/dist/view/wrapper/table-element/components/records-header/index.js +7 -16
- package/dist/view/wrapper/table-element/components/records-header/records-header-cell.js +8 -16
- package/dist/view/wrapper/table-element/components/records.js +25 -33
- package/dist/view/wrapper/table-element/components/resize-column-handle/resize-column-handle.js +8 -13
- package/dist/view/wrapper/table-element/components/utils.js +6 -16
- package/dist/view/wrapper/table-element/components/value-display-utils.js +4 -11
- package/dist/view/wrapper/table-element/components/vertical-scrollbar/index.js +6 -13
- package/dist/view/wrapper/table-element/index.js +30 -43
- package/dist/view/wrapper/treemap.js +38 -46
- package/dist/view/wrapper/trend.js +80 -65
- package/package.json +15 -12
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
16
|
-
var _constants = require("../../constants");
|
|
17
|
-
var _utils = require("../../utils");
|
|
18
|
-
var _colorRules = require("../../constants/color-rules");
|
|
19
|
-
var _tooltip = _interopRequireDefault(require("../../components/tooltip"));
|
|
20
|
-
var _chartComponent = _interopRequireDefault(require("./chart-component"));
|
|
21
|
-
class BarGroup extends _chartComponent.default {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { CellType } from 'dtable-utils';
|
|
4
|
+
import { debounce, cloneDeep } from 'lodash-es';
|
|
5
|
+
import * as d3 from 'd3';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import dayjs from 'dayjs';
|
|
8
|
+
import intl from '../../intl';
|
|
9
|
+
import { EMPTY_NAME, CHART_THEME_COLOR, CHART_STYLE_COLORS } from '../../constants';
|
|
10
|
+
import { BaseUtils, isFunction } from '../../utils';
|
|
11
|
+
import { SUPPORT_SINGLE_SELECT_THEMES_OPTIONS } from '../../constants/color-rules';
|
|
12
|
+
import ToolTip from '../../components/tooltip';
|
|
13
|
+
import ChartComponent from './chart-component';
|
|
14
|
+
class BarGroup extends ChartComponent {
|
|
22
15
|
constructor(props) {
|
|
23
16
|
super(props);
|
|
24
17
|
this.handleResize = () => {
|
|
@@ -46,16 +39,20 @@ class BarGroup extends _chartComponent.default {
|
|
|
46
39
|
};
|
|
47
40
|
this.drawChart = () => {
|
|
48
41
|
const {
|
|
49
|
-
customRender
|
|
42
|
+
customRender,
|
|
43
|
+
chart
|
|
50
44
|
} = this.props;
|
|
51
45
|
let {
|
|
52
46
|
result: data
|
|
53
47
|
} = this.props;
|
|
54
|
-
|
|
48
|
+
const {
|
|
49
|
+
column_groupby_column_key
|
|
50
|
+
} = chart.config || {};
|
|
51
|
+
data = BaseUtils.formatEmptyName(data, column_groupby_column_key, intl.get(EMPTY_NAME));
|
|
55
52
|
if (!Array.isArray(data)) return;
|
|
56
53
|
this.draw(data);
|
|
57
54
|
this.renderAxisLabel(this.props.chart, this.props.tables, this.container);
|
|
58
|
-
|
|
55
|
+
isFunction(customRender) && customRender(this.chart);
|
|
59
56
|
};
|
|
60
57
|
this.draw = data => {
|
|
61
58
|
const {
|
|
@@ -88,21 +85,20 @@ class BarGroup extends _chartComponent.default {
|
|
|
88
85
|
y_axis_min,
|
|
89
86
|
y_axis_auto_range
|
|
90
87
|
} = chart.config;
|
|
91
|
-
const theme =
|
|
88
|
+
const theme = CHART_THEME_COLOR[globalTheme];
|
|
92
89
|
const column_groupby_column = this.getColumn(tables, table_id, column_groupby_column_key);
|
|
93
|
-
const useSingleSelectColumnColor = (column_groupby_column === null || column_groupby_column === void 0 ? void 0 : column_groupby_column.type) ===
|
|
90
|
+
const useSingleSelectColumnColor = (column_groupby_column === null || column_groupby_column === void 0 ? void 0 : column_groupby_column.type) === CellType.SINGLE_SELECT && color_theme === SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
94
91
|
useSingleSelectColumnColor ? this.setSingleSelectColorMap(data) : this.setColorMap(data, chartColorTheme, 'group_name', columnGroupbyColumn, chart); // use single select column color
|
|
95
92
|
|
|
96
93
|
const y = d3.scaleLinear().domain(y_axis_auto_range ? [0, d3.max(data, d => d.value)] : [y_axis_min, y_axis_max]).range([chartHeight - insertPadding, insertPadding + marginTop]);
|
|
97
94
|
|
|
98
95
|
// Y axis
|
|
99
|
-
this.chart.append('g').attr('class', 'y-axis-wrapper').attr('transform',
|
|
100
|
-
const fx = d3.scaleBand().domain(new Set(data.map(d => d.name))).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.
|
|
101
|
-
const sortedData =
|
|
102
|
-
const x = d3.scaleBand().domain(new Set(sortedData.map(d => d.group_name))).range([0, fx.bandwidth()]).paddingInner(0).paddingOuter(0);
|
|
96
|
+
this.chart.append('g').attr('class', 'y-axis-wrapper').attr('transform', `translate(${insertPadding},0)`).call(d3.axisLeft(y).tickSizeInner(0).ticks(5).tickFormat(d => BaseUtils.getSummaryValueDisplayString(summaryColumn, d, y_axis_summary_method))).call(g => this.drawYaxis(g, theme));
|
|
97
|
+
const fx = d3.scaleBand().domain(new Set(data.map(d => d.name))).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.25).paddingOuter(0.1);
|
|
98
|
+
const sortedData = BaseUtils.sortDataByGroupName(cloneDeep(data), 'group_name', columnGroupbyColumn, chart);
|
|
103
99
|
|
|
104
100
|
// X axis
|
|
105
|
-
this.chart.append('g').attr('class', 'x-axis-wrapper').attr('transform',
|
|
101
|
+
this.chart.append('g').attr('class', 'x-axis-wrapper').attr('transform', `translate(0,${chartHeight - insertPadding})`).call(d3.axisBottom(fx).tickSizeOuter(0).tickSizeInner(5)).call(g => {
|
|
106
102
|
g.selectAll('.domain').attr('stroke', theme.XAxisColor);
|
|
107
103
|
g.selectAll('.tick line').attr('stroke', theme.XAxisColor);
|
|
108
104
|
g.selectAll('text').attr('font-size', theme.fontSize);
|
|
@@ -111,47 +107,68 @@ class BarGroup extends _chartComponent.default {
|
|
|
111
107
|
});
|
|
112
108
|
|
|
113
109
|
// Rect group
|
|
114
|
-
this.chart.append('g').attr('class', 'content-wrapper')
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
110
|
+
const contentWrapper = this.chart.append('g').attr('class', 'content-wrapper');
|
|
111
|
+
const groupedData = d3.group(sortedData, d => d.name);
|
|
112
|
+
const group = contentWrapper.selectAll().data(groupedData).join('g').attr('transform', _ref => {
|
|
113
|
+
let [name] = _ref;
|
|
114
|
+
return `translate(${fx(name)},0)`;
|
|
115
|
+
});
|
|
116
|
+
group.each((_ref2, groupIndex, groupNodes) => {
|
|
117
|
+
let [, dum] = _ref2;
|
|
118
|
+
const groupNode = groupNodes[groupIndex];
|
|
119
|
+
const localX = d3.scaleBand().domain(dum.map(d => d.group_name)).range([0, fx.bandwidth()]).paddingInner(0).paddingOuter(0);
|
|
120
|
+
const rectSelection = d3.select(groupNode).selectAll('rect').data(dum).join('rect').attr('opacity', 1).attr('x', d => localX(d.group_name)).attr('y', d => y(d.value)).attr('width', localX.bandwidth()).attr('height', d => y(0) - y(d.value)).attr('fill', d => this.colorMap[d.group_name] || CHART_STYLE_COLORS[0]).attr('data-value', d => d.value).attr('data-groupName', d => d.name).attr('data-slugid', d => d.slugId);
|
|
121
|
+
const {
|
|
122
|
+
borderRadius
|
|
123
|
+
} = this.chartBoundingClientRect;
|
|
124
|
+
const rectNodes = rectSelection.nodes();
|
|
125
|
+
const validRectNodes = rectNodes.filter(rect => {
|
|
126
|
+
const rectWidth = Number(rect.getAttribute('width'));
|
|
127
|
+
const rectHeight = Number(rect.getAttribute('height'));
|
|
128
|
+
return rectWidth > 0 && rectHeight > 0;
|
|
129
|
+
});
|
|
130
|
+
let groupBorderRadius;
|
|
131
|
+
if (validRectNodes.length > 0) {
|
|
132
|
+
groupBorderRadius = Infinity;
|
|
133
|
+
validRectNodes.forEach(rect => {
|
|
134
|
+
const rectWidth = Number(rect.getAttribute('width'));
|
|
135
|
+
const rectHeight = Number(rect.getAttribute('height'));
|
|
136
|
+
const computedBorderRadius = Math.min(rectWidth * borderRadius, rectHeight / 2, rectWidth / 2);
|
|
137
|
+
groupBorderRadius = Math.min(groupBorderRadius, computedBorderRadius);
|
|
138
|
+
});
|
|
139
|
+
if (!Number.isFinite(groupBorderRadius)) {
|
|
140
|
+
groupBorderRadius = 0;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
rectNodes.forEach(rect => {
|
|
126
144
|
const parentNode = rect.parentNode;
|
|
127
|
-
// add rect borderRadius
|
|
128
145
|
this.addClipPath({
|
|
129
146
|
rect,
|
|
130
147
|
parentNode,
|
|
131
|
-
rectId: rect.getAttribute('data-slugid')
|
|
148
|
+
rectId: rect.getAttribute('data-slugid'),
|
|
149
|
+
borderRadiusVal: Number.isFinite(groupBorderRadius) ? groupBorderRadius : undefined
|
|
132
150
|
});
|
|
133
|
-
|
|
134
|
-
// Add label
|
|
135
151
|
if (y_axis_show_value) {
|
|
136
152
|
this.addLabelToRectTop({
|
|
137
153
|
container: parentNode,
|
|
138
|
-
xWidth: Number(
|
|
154
|
+
xWidth: Number(localX.bandwidth()),
|
|
139
155
|
x: Number(rect.getAttribute('x')),
|
|
140
156
|
y: Number(rect.getAttribute('y')),
|
|
141
157
|
theme,
|
|
142
158
|
label_font_size,
|
|
143
|
-
text:
|
|
159
|
+
text: BaseUtils.getSummaryValueDisplayString(summaryColumn, Number(rect.dataset.value), y_axis_summary_method)
|
|
144
160
|
});
|
|
145
161
|
}
|
|
146
162
|
});
|
|
147
|
-
})
|
|
163
|
+
});
|
|
164
|
+
contentWrapper.selectAll('rect').on('click', (event, data) => {
|
|
148
165
|
this.props.toggleRecords(data);
|
|
149
166
|
}).on('mouseover', event => {
|
|
150
167
|
this.showTooltip(event);
|
|
151
168
|
this.handleAcitveAndInActiveState('inActive', event);
|
|
152
169
|
}).on('mousemove', event => {
|
|
153
170
|
this.moveTooltip(event);
|
|
154
|
-
}).on('mouseleave',
|
|
171
|
+
}).on('mouseleave', event => {
|
|
155
172
|
this.hiddenTooltip();
|
|
156
173
|
this.handleAcitveAndInActiveState('active', event);
|
|
157
174
|
});
|
|
@@ -168,6 +185,7 @@ class BarGroup extends _chartComponent.default {
|
|
|
168
185
|
});
|
|
169
186
|
};
|
|
170
187
|
this.showTooltip = event => {
|
|
188
|
+
var _this$props$columnGro;
|
|
171
189
|
const {
|
|
172
190
|
summaryColumn,
|
|
173
191
|
chart
|
|
@@ -175,19 +193,22 @@ class BarGroup extends _chartComponent.default {
|
|
|
175
193
|
const {
|
|
176
194
|
y_axis_summary_method
|
|
177
195
|
} = chart.config;
|
|
196
|
+
const isGroupByDate = [CellType.DATE, CellType.CTIME, CellType.MTIME].includes((_this$props$columnGro = this.props.columnGroupbyColumn) === null || _this$props$columnGro === void 0 ? void 0 : _this$props$columnGro.type);
|
|
178
197
|
const {
|
|
179
198
|
offsetX,
|
|
180
199
|
offsetY
|
|
181
200
|
} = event;
|
|
182
201
|
const curGroup = event.target.parentNode;
|
|
183
|
-
|
|
202
|
+
let [curGroupName, data] = curGroup.__data__;
|
|
184
203
|
const newTooltipData = {
|
|
185
|
-
title: !curGroupName && typeof curGroupName !== 'number' ?
|
|
204
|
+
title: !curGroupName && typeof curGroupName !== 'number' ? intl.get(EMPTY_NAME) : curGroupName,
|
|
186
205
|
items: data.map(item => {
|
|
206
|
+
const rawGroupName = item.group_name;
|
|
207
|
+
const groupName = rawGroupName === null || rawGroupName === undefined || rawGroupName === '' ? intl.get(EMPTY_NAME) : isGroupByDate ? dayjs(rawGroupName).format('YYYY-MM-DD') : rawGroupName;
|
|
187
208
|
return {
|
|
188
|
-
color: this.colorMap[
|
|
189
|
-
name:
|
|
190
|
-
value:
|
|
209
|
+
color: this.colorMap[groupName],
|
|
210
|
+
name: groupName,
|
|
211
|
+
value: BaseUtils.getSummaryValueDisplayString(summaryColumn, Number(item.value), y_axis_summary_method)
|
|
191
212
|
};
|
|
192
213
|
})
|
|
193
214
|
};
|
|
@@ -233,12 +254,12 @@ class BarGroup extends _chartComponent.default {
|
|
|
233
254
|
componentDidMount() {
|
|
234
255
|
this.createChart();
|
|
235
256
|
this.drawChart();
|
|
236
|
-
this.debouncedHandleResize =
|
|
257
|
+
this.debouncedHandleResize = debounce(this.handleResize, 300);
|
|
237
258
|
window.addEventListener('resize', this.debouncedHandleResize);
|
|
238
259
|
}
|
|
239
260
|
componentDidUpdate(prevProps) {
|
|
240
261
|
super.componentDidUpdate(prevProps);
|
|
241
|
-
if (
|
|
262
|
+
if (BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
242
263
|
this.destroyChart();
|
|
243
264
|
this.createChart();
|
|
244
265
|
this.drawChart();
|
|
@@ -256,13 +277,13 @@ class BarGroup extends _chartComponent.default {
|
|
|
256
277
|
tooltipData,
|
|
257
278
|
toolTipPosition
|
|
258
279
|
} = this.state;
|
|
259
|
-
return /*#__PURE__*/
|
|
280
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
260
281
|
ref: ref => this.container = ref,
|
|
261
|
-
className: (
|
|
282
|
+
className: classNames('sea-chart-container', {
|
|
262
283
|
'show-x-axis-label': this.isShowXAxisLabel(chart),
|
|
263
284
|
'show-y-axis-label': this.isShowYAxisLabel(chart)
|
|
264
285
|
})
|
|
265
|
-
}, /*#__PURE__*/
|
|
286
|
+
}, /*#__PURE__*/React.createElement(ToolTip, {
|
|
266
287
|
tooltipData: tooltipData,
|
|
267
288
|
toolTipPosition: toolTipPosition,
|
|
268
289
|
chart: this.chart
|
|
@@ -270,16 +291,16 @@ class BarGroup extends _chartComponent.default {
|
|
|
270
291
|
}
|
|
271
292
|
}
|
|
272
293
|
BarGroup.propTypes = {
|
|
273
|
-
canvasStyle:
|
|
274
|
-
chart:
|
|
275
|
-
groupbyColumn:
|
|
276
|
-
columnGroupbyColumn:
|
|
277
|
-
summaryColumn:
|
|
278
|
-
result:
|
|
279
|
-
tables:
|
|
280
|
-
globalTheme:
|
|
281
|
-
chartColorTheme:
|
|
282
|
-
toggleRecords:
|
|
283
|
-
customRender:
|
|
294
|
+
canvasStyle: PropTypes.object,
|
|
295
|
+
chart: PropTypes.object,
|
|
296
|
+
groupbyColumn: PropTypes.object,
|
|
297
|
+
columnGroupbyColumn: PropTypes.object,
|
|
298
|
+
summaryColumn: PropTypes.object,
|
|
299
|
+
result: PropTypes.array,
|
|
300
|
+
tables: PropTypes.array,
|
|
301
|
+
globalTheme: PropTypes.string,
|
|
302
|
+
chartColorTheme: PropTypes.string,
|
|
303
|
+
toggleRecords: PropTypes.func,
|
|
304
|
+
customRender: PropTypes.func
|
|
284
305
|
};
|
|
285
|
-
|
|
306
|
+
export default BarGroup;
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
16
|
-
var _columnUtils = require("../../utils/column-utils");
|
|
17
|
-
var _constants = require("../../constants");
|
|
18
|
-
var _utils = require("../../utils");
|
|
19
|
-
var _colorRules = require("../../constants/color-rules");
|
|
20
|
-
var _tooltip = _interopRequireDefault(require("../../components/tooltip"));
|
|
21
|
-
var _chartComponent = _interopRequireDefault(require("./chart-component"));
|
|
22
|
-
class BarStack extends _chartComponent.default {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { CellType } from 'dtable-utils';
|
|
4
|
+
import { debounce, isNaN, cloneDeep } from 'lodash-es';
|
|
5
|
+
import * as d3 from 'd3';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import intl from '../../intl';
|
|
8
|
+
import { sortDataByGroupSum } from '../../utils/column-utils';
|
|
9
|
+
import { EMPTY_NAME, CHART_THEME_COLOR, CHART_STYLE_COLORS } from '../../constants';
|
|
10
|
+
import { BaseUtils, isFunction } from '../../utils';
|
|
11
|
+
import { SUPPORT_SINGLE_SELECT_THEMES_OPTIONS } from '../../constants/color-rules';
|
|
12
|
+
import ToolTip from '../../components/tooltip';
|
|
13
|
+
import ChartComponent from './chart-component';
|
|
14
|
+
class BarStack extends ChartComponent {
|
|
23
15
|
constructor(props) {
|
|
24
16
|
super(props);
|
|
25
17
|
this.handleResize = () => {
|
|
@@ -56,12 +48,12 @@ class BarStack extends _chartComponent.default {
|
|
|
56
48
|
let {
|
|
57
49
|
result: data
|
|
58
50
|
} = this.props;
|
|
59
|
-
data =
|
|
51
|
+
data = BaseUtils.formatEmptyName(data, chart.config.column_groupby_column_key, intl.get('Empty'));
|
|
60
52
|
if (!Array.isArray(data)) return;
|
|
61
|
-
sort_type && (data =
|
|
53
|
+
sort_type && (data = sortDataByGroupSum(data, sort_type));
|
|
62
54
|
this.draw(data);
|
|
63
55
|
this.renderAxisLabel(this.props.chart, this.props.tables, this.container);
|
|
64
|
-
|
|
56
|
+
isFunction(customRender) && customRender(this.chart);
|
|
65
57
|
};
|
|
66
58
|
this.draw = data => {
|
|
67
59
|
const {
|
|
@@ -88,9 +80,9 @@ class BarStack extends _chartComponent.default {
|
|
|
88
80
|
y_axis_min,
|
|
89
81
|
y_axis_auto_range
|
|
90
82
|
} = chart.config;
|
|
91
|
-
const theme =
|
|
83
|
+
const theme = CHART_THEME_COLOR[globalTheme];
|
|
92
84
|
const column_groupby_column = this.getColumn(tables, table_id, column_groupby_column_key);
|
|
93
|
-
const useSingleSelectColumnColor = (column_groupby_column === null || column_groupby_column === void 0 ? void 0 : column_groupby_column.type) ===
|
|
85
|
+
const useSingleSelectColumnColor = (column_groupby_column === null || column_groupby_column === void 0 ? void 0 : column_groupby_column.type) === CellType.SINGLE_SELECT && color_theme === SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
94
86
|
// use single select column color
|
|
95
87
|
useSingleSelectColumnColor ? this.setSingleSelectColorMap(data) : this.setColorMap(data, chartColorTheme, 'group_name', columnGroupbyColumn, chart);
|
|
96
88
|
const {
|
|
@@ -99,21 +91,21 @@ class BarStack extends _chartComponent.default {
|
|
|
99
91
|
insertPadding,
|
|
100
92
|
marginTop
|
|
101
93
|
} = this.chartBoundingClientRect;
|
|
102
|
-
const sortedData =
|
|
94
|
+
const sortedData = BaseUtils.sortDataByGroupName(cloneDeep(data), 'group_name', columnGroupbyColumn, chart).reverse();
|
|
103
95
|
const series = d3.stack().keys(d3.union(sortedData.map(d => d.group_name))).value((_ref, key) => {
|
|
104
96
|
var _group$get;
|
|
105
97
|
let [_, group] = _ref;
|
|
106
|
-
return (_group$get = group.get(
|
|
98
|
+
return ((_group$get = group.get(key)) === null || _group$get === void 0 ? void 0 : _group$get.value) || 0;
|
|
107
99
|
})(d3.index(sortedData, d => d.name, d => d.group_name));
|
|
108
100
|
const niceEnd = d3.nice(0, d3.max(series, d => d3.max(d, d => d[1])), 5)[1];
|
|
109
101
|
const y = d3.scaleLinear().domain(y_axis_auto_range ? [0, niceEnd] : [y_axis_min, y_axis_max]).range([chartHeight - insertPadding, insertPadding + marginTop]);
|
|
110
102
|
|
|
111
103
|
// Y axis
|
|
112
|
-
this.chart.append('g').attr('class', 'y-axis-wrapper').attr('transform',
|
|
104
|
+
this.chart.append('g').attr('class', 'y-axis-wrapper').attr('transform', `translate(${insertPadding},0)`).call(d3.axisLeft(y).tickSizeInner(0).ticks(5).tickFormat(d => BaseUtils.getSummaryValueDisplayString(summaryColumn, d, y_axis_summary_method))).call(g => this.drawYaxis(g, theme));
|
|
113
105
|
const x = d3.scaleBand().domain(d3.group(data, d => d.name).keys()).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
114
106
|
|
|
115
107
|
// X axis
|
|
116
|
-
this.chart.append('g').attr('class', 'x-axis-wrapper').attr('transform',
|
|
108
|
+
this.chart.append('g').attr('class', 'x-axis-wrapper').attr('transform', `translate(0,${chartHeight - insertPadding})`).call(d3.axisBottom(x).tickSizeOuter(0).tickSizeInner(5)).call(g => {
|
|
117
109
|
g.selectAll('.domain').attr('stroke', theme.XAxisColor);
|
|
118
110
|
g.selectAll('.tick line').attr('stroke', theme.XAxisColor);
|
|
119
111
|
g.selectAll('text').attr('font-size', theme.fontSize);
|
|
@@ -131,8 +123,8 @@ class BarStack extends _chartComponent.default {
|
|
|
131
123
|
return data;
|
|
132
124
|
}).join('rect').attr('opacity', 1).attr('x', d => x(d.data[0])).attr('y', d => y(d[1])).attr('height', d => {
|
|
133
125
|
const height = y(d[0]) - y(d[1]);
|
|
134
|
-
return
|
|
135
|
-
}).attr('width', x.bandwidth()).attr('fill', d => this.colorMap[d.key] ||
|
|
126
|
+
return isNaN(height) ? 0 : height;
|
|
127
|
+
}).attr('width', x.bandwidth()).attr('fill', d => this.colorMap[d.key] || CHART_STYLE_COLORS[0]).attr('data-value', d => {
|
|
136
128
|
const {
|
|
137
129
|
data,
|
|
138
130
|
key
|
|
@@ -217,11 +209,11 @@ class BarStack extends _chartComponent.default {
|
|
|
217
209
|
const curGroup = curRect.parentNode;
|
|
218
210
|
const curGroupName = event.currentTarget.getAttribute('data-groupName');
|
|
219
211
|
const newTooltipData = {
|
|
220
|
-
title: !curGroupName && typeof curGroupName !== 'number' ?
|
|
212
|
+
title: !curGroupName && typeof curGroupName !== 'number' ? intl.get(EMPTY_NAME) : curGroupName,
|
|
221
213
|
items: [{
|
|
222
214
|
color: this.colorMap[curGroup.getAttribute('data-key')],
|
|
223
215
|
name: curGroup.getAttribute('data-key'),
|
|
224
|
-
value:
|
|
216
|
+
value: BaseUtils.getSummaryValueDisplayString(summaryColumn, Number(curRect.getAttribute('data-value')), y_axis_summary_method)
|
|
225
217
|
}]
|
|
226
218
|
};
|
|
227
219
|
this.setState({
|
|
@@ -269,7 +261,7 @@ class BarStack extends _chartComponent.default {
|
|
|
269
261
|
}).on('mouseleave', (event, data) => {
|
|
270
262
|
this.hiddenTooltip();
|
|
271
263
|
this.handleAcitveAndInActiveState('active', event);
|
|
272
|
-
}).append('xhtml:div').attr('style',
|
|
264
|
+
}).append('xhtml:div').attr('style', `width: 100%; height: 100%; background-color: ${rect.getAttribute('fill')}; border-radius: ${xWidth * borderRadius}px ${xWidth * borderRadius}px 0px 0px`);
|
|
273
265
|
|
|
274
266
|
// Remove old rect
|
|
275
267
|
d3.select(rect).remove();
|
|
@@ -284,7 +276,7 @@ class BarStack extends _chartComponent.default {
|
|
|
284
276
|
label_font_size,
|
|
285
277
|
y_axis_summary_method
|
|
286
278
|
} = chart.config;
|
|
287
|
-
const theme =
|
|
279
|
+
const theme = CHART_THEME_COLOR[globalTheme];
|
|
288
280
|
const groupData = d3.group(data, d => d.name);
|
|
289
281
|
const group_name = rect.getAttribute('data-groupName');
|
|
290
282
|
let stackSum = 0;
|
|
@@ -296,7 +288,7 @@ class BarStack extends _chartComponent.default {
|
|
|
296
288
|
y: Number(rect.getAttribute('y')),
|
|
297
289
|
theme,
|
|
298
290
|
label_font_size,
|
|
299
|
-
text:
|
|
291
|
+
text: BaseUtils.getSummaryValueDisplayString(summaryColumn, Number(stackSum), y_axis_summary_method)
|
|
300
292
|
});
|
|
301
293
|
};
|
|
302
294
|
this.handleLabelToRectCenter = (g, xWidth) => {
|
|
@@ -309,7 +301,7 @@ class BarStack extends _chartComponent.default {
|
|
|
309
301
|
label_font_size,
|
|
310
302
|
y_axis_summary_method
|
|
311
303
|
} = chart.config;
|
|
312
|
-
const theme =
|
|
304
|
+
const theme = CHART_THEME_COLOR[globalTheme];
|
|
313
305
|
g._parents.forEach(group => {
|
|
314
306
|
Array.from(group.children).forEach(rect => {
|
|
315
307
|
// The height is 0, and the label is not displayed.
|
|
@@ -322,7 +314,7 @@ class BarStack extends _chartComponent.default {
|
|
|
322
314
|
yheight: Number(rect.getAttribute('height')),
|
|
323
315
|
theme,
|
|
324
316
|
label_font_size,
|
|
325
|
-
text:
|
|
317
|
+
text: BaseUtils.getSummaryValueDisplayString(summaryColumn, Number(rect.getAttribute('data-value')), y_axis_summary_method)
|
|
326
318
|
});
|
|
327
319
|
});
|
|
328
320
|
});
|
|
@@ -336,12 +328,12 @@ class BarStack extends _chartComponent.default {
|
|
|
336
328
|
componentDidMount() {
|
|
337
329
|
this.createChart();
|
|
338
330
|
this.drawChart();
|
|
339
|
-
this.debouncedHandleResize =
|
|
331
|
+
this.debouncedHandleResize = debounce(this.handleResize, 300);
|
|
340
332
|
window.addEventListener('resize', this.debouncedHandleResize);
|
|
341
333
|
}
|
|
342
334
|
componentDidUpdate(prevProps) {
|
|
343
335
|
super.componentDidUpdate(prevProps);
|
|
344
|
-
if (
|
|
336
|
+
if (BaseUtils.shouldChartComponentUpdate(prevProps, this.props)) {
|
|
345
337
|
this.destroyChart();
|
|
346
338
|
this.createChart();
|
|
347
339
|
this.drawChart();
|
|
@@ -359,13 +351,13 @@ class BarStack extends _chartComponent.default {
|
|
|
359
351
|
tooltipData,
|
|
360
352
|
toolTipPosition
|
|
361
353
|
} = this.state;
|
|
362
|
-
return /*#__PURE__*/
|
|
354
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
363
355
|
ref: ref => this.container = ref,
|
|
364
|
-
className: (
|
|
356
|
+
className: classNames('sea-chart-container', {
|
|
365
357
|
'show-x-axis-label': this.isShowXAxisLabel(chart),
|
|
366
358
|
'show-y-axis-label': this.isShowYAxisLabel(chart)
|
|
367
359
|
})
|
|
368
|
-
}, /*#__PURE__*/
|
|
360
|
+
}, /*#__PURE__*/React.createElement(ToolTip, {
|
|
369
361
|
tooltipData: tooltipData,
|
|
370
362
|
toolTipPosition: toolTipPosition,
|
|
371
363
|
chart: this.chart
|
|
@@ -373,16 +365,16 @@ class BarStack extends _chartComponent.default {
|
|
|
373
365
|
}
|
|
374
366
|
}
|
|
375
367
|
BarStack.propTypes = {
|
|
376
|
-
canvasStyle:
|
|
377
|
-
chart:
|
|
378
|
-
groupbyColumn:
|
|
379
|
-
columnGroupbyColumn:
|
|
380
|
-
summaryColumn:
|
|
381
|
-
result:
|
|
382
|
-
tables:
|
|
383
|
-
globalTheme:
|
|
384
|
-
chartColorTheme:
|
|
385
|
-
toggleRecords:
|
|
386
|
-
customRender:
|
|
368
|
+
canvasStyle: PropTypes.object,
|
|
369
|
+
chart: PropTypes.object,
|
|
370
|
+
groupbyColumn: PropTypes.object,
|
|
371
|
+
columnGroupbyColumn: PropTypes.object,
|
|
372
|
+
summaryColumn: PropTypes.object,
|
|
373
|
+
result: PropTypes.array,
|
|
374
|
+
tables: PropTypes.array,
|
|
375
|
+
globalTheme: PropTypes.string,
|
|
376
|
+
chartColorTheme: PropTypes.string,
|
|
377
|
+
toggleRecords: PropTypes.func,
|
|
378
|
+
customRender: PropTypes.func
|
|
387
379
|
};
|
|
388
|
-
|
|
380
|
+
export default BarStack;
|