sea-chart 2.0.59 → 2.0.60
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/assets/icons/exact-match.svg +15 -0
- package/dist/assets/icons/field-set.svg +20 -0
- package/dist/components/dtable-search-input/index.js +15 -1
- package/dist/components/popover/hide-column-popover/hide-column-popover.js +19 -16
- package/dist/components/row-card/row-card-header.js +61 -49
- package/dist/components/row-card/row-card-item.js +15 -9
- package/dist/components/row-card/row-card.css +14 -1
- package/dist/components/row-card/row-card.js +211 -118
- package/dist/components/statistic-record-dialog/index.css +61 -3
- package/dist/components/statistic-record-dialog/index.js +170 -7
- package/dist/locale/lang/de.js +4 -0
- package/dist/locale/lang/en.js +4 -0
- package/dist/locale/lang/es.js +4 -0
- package/dist/locale/lang/fr.js +4 -0
- package/dist/locale/lang/pt.js +4 -0
- package/dist/locale/lang/ru.js +4 -0
- package/dist/locale/lang/zh_CN.js +4 -0
- package/dist/utils/search.js +36 -4
- package/dist/view/wrapper/chart-component.js +71 -37
- package/dist/view/wrapper/pie.js +15 -8
- package/dist/view/wrapper/ring.js +16 -8
- package/package.json +1 -1
package/dist/view/wrapper/pie.js
CHANGED
|
@@ -22,12 +22,9 @@ class Pie extends _chartComponent.default {
|
|
|
22
22
|
const {
|
|
23
23
|
chart
|
|
24
24
|
} = this.props;
|
|
25
|
-
const {
|
|
26
|
-
show_legend
|
|
27
|
-
} = chart.config;
|
|
28
25
|
const initConfig = {
|
|
29
26
|
insertPadding: 30,
|
|
30
|
-
rightLegendSpace:
|
|
27
|
+
rightLegendSpace: 0
|
|
31
28
|
};
|
|
32
29
|
this.initChart(this.container, chart === null || chart === void 0 ? void 0 : chart.id, initConfig);
|
|
33
30
|
};
|
|
@@ -57,8 +54,7 @@ class Pie extends _chartComponent.default {
|
|
|
57
54
|
const {
|
|
58
55
|
width: chartWidth,
|
|
59
56
|
height: chartHeight,
|
|
60
|
-
insertPadding
|
|
61
|
-
rightLegendSpace
|
|
57
|
+
insertPadding
|
|
62
58
|
} = this.chartBoundingClientRect;
|
|
63
59
|
this.isInnerLabel = !label_position || label_position === _constants.CHART_LABEL_POSITIONS[0];
|
|
64
60
|
const currentTheme = _utils.BaseUtils.getCurrentTheme(chartColorTheme);
|
|
@@ -68,6 +64,17 @@ class Pie extends _chartComponent.default {
|
|
|
68
64
|
colorMap
|
|
69
65
|
} = _utils.BaseUtils.formatPieChartData(data, chart, tables, currentTheme, useSingleSelectColumnColor);
|
|
70
66
|
if (!Array.isArray(newData) || newData.length === 0) return;
|
|
67
|
+
const {
|
|
68
|
+
rightLegendSpace = 0,
|
|
69
|
+
chartLegendGap = 0
|
|
70
|
+
} = show_legend ? this.getRightLegendLayout({
|
|
71
|
+
data: newData,
|
|
72
|
+
legendName: 'name',
|
|
73
|
+
theme
|
|
74
|
+
}) : {};
|
|
75
|
+
this.chartBoundingClientRect.rightLegendSpace = rightLegendSpace;
|
|
76
|
+
const plotWidth = Math.max(0, chartWidth - insertPadding * 2 - rightLegendSpace - chartLegendGap);
|
|
77
|
+
const radiusWidth = show_legend ? plotWidth : chartWidth;
|
|
71
78
|
|
|
72
79
|
// Only the visible categories are laid out; the legend still shows every category.
|
|
73
80
|
const visibleData = this.getVisibleLegendData(newData, 'name');
|
|
@@ -80,7 +87,7 @@ class Pie extends _chartComponent.default {
|
|
|
80
87
|
// Pie and Arc
|
|
81
88
|
const pie = d3.pie().sort(null).value(d => d.value);
|
|
82
89
|
const arcs = pie(visibleData);
|
|
83
|
-
const arc = d3.arc().innerRadius(0).outerRadius(Math.min(
|
|
90
|
+
const arc = d3.arc().innerRadius(0).outerRadius(Math.min(radiusWidth, chartHeight) / 2 * 0.7);
|
|
84
91
|
|
|
85
92
|
// Draw Pie
|
|
86
93
|
this.chart.append('g').attr('class', 'content-wrapper').attr('stroke', 'white').selectAll().data(arcs).join('path').attr('stroke-width', 2).attr('opacity', 1).attr('fill', d => color(d.data.name)).attr('d', arc).attr('data-groupName', d => d.data.name).call(g => {
|
|
@@ -91,7 +98,7 @@ class Pie extends _chartComponent.default {
|
|
|
91
98
|
} = (_g$node$parentNode = g.node().parentNode) === null || _g$node$parentNode === void 0 ? void 0 : _g$node$parentNode.getBoundingClientRect();
|
|
92
99
|
const left = width / 2 + insertPadding;
|
|
93
100
|
const top = height / 2 + insertPadding;
|
|
94
|
-
const offsetX = (
|
|
101
|
+
const offsetX = (plotWidth - width) / 2;
|
|
95
102
|
const offsetY = (chartHeight - insertPadding - insertPadding - height) / 2;
|
|
96
103
|
d3.select(g.node().parentNode).attr('transform', `translate(${left + offsetX}, ${top + offsetY})`);
|
|
97
104
|
|
|
@@ -22,12 +22,9 @@ class Ring extends _chartComponent.default {
|
|
|
22
22
|
const {
|
|
23
23
|
chart
|
|
24
24
|
} = this.props;
|
|
25
|
-
const {
|
|
26
|
-
show_legend
|
|
27
|
-
} = chart.config;
|
|
28
25
|
const initConfig = {
|
|
29
26
|
insertPadding: 30,
|
|
30
|
-
rightLegendSpace:
|
|
27
|
+
rightLegendSpace: 0
|
|
31
28
|
};
|
|
32
29
|
this.initChart(this.container, chart === null || chart === void 0 ? void 0 : chart.id, initConfig);
|
|
33
30
|
};
|
|
@@ -57,8 +54,7 @@ class Ring extends _chartComponent.default {
|
|
|
57
54
|
const {
|
|
58
55
|
width: chartWidth,
|
|
59
56
|
height: chartHeight,
|
|
60
|
-
insertPadding
|
|
61
|
-
rightLegendSpace
|
|
57
|
+
insertPadding
|
|
62
58
|
} = this.chartBoundingClientRect;
|
|
63
59
|
this.isInnerLabel = !label_position || label_position === _constants.CHART_LABEL_POSITIONS[0];
|
|
64
60
|
const currentTheme = _utils.BaseUtils.getCurrentTheme(chartColorTheme);
|
|
@@ -69,6 +65,17 @@ class Ring extends _chartComponent.default {
|
|
|
69
65
|
total: fullTotal
|
|
70
66
|
} = _utils.BaseUtils.formatPieChartData(data, chart, tables, currentTheme, useSingleSelectColumnColor);
|
|
71
67
|
if (!Array.isArray(newData) || newData.length === 0) return;
|
|
68
|
+
const {
|
|
69
|
+
rightLegendSpace = 0,
|
|
70
|
+
chartLegendGap = 0
|
|
71
|
+
} = show_legend ? this.getRightLegendLayout({
|
|
72
|
+
data: newData,
|
|
73
|
+
legendName: 'name',
|
|
74
|
+
theme
|
|
75
|
+
}) : {};
|
|
76
|
+
this.chartBoundingClientRect.rightLegendSpace = rightLegendSpace;
|
|
77
|
+
const plotWidth = Math.max(0, chartWidth - insertPadding * 2 - rightLegendSpace - chartLegendGap);
|
|
78
|
+
const radiusWidth = show_legend ? plotWidth : chartWidth;
|
|
72
79
|
|
|
73
80
|
// Only the visible categories are laid out; the legend still shows every category.
|
|
74
81
|
const visibleData = this.getVisibleLegendData(newData, 'name');
|
|
@@ -82,7 +89,8 @@ class Ring extends _chartComponent.default {
|
|
|
82
89
|
// Ring and Arc
|
|
83
90
|
const pie = d3.pie().sort(null).value(d => d.value);
|
|
84
91
|
const arcs = pie(visibleData);
|
|
85
|
-
const
|
|
92
|
+
const radius = Math.min(radiusWidth, chartHeight) / 2;
|
|
93
|
+
const arc = d3.arc().innerRadius(radius * 0.5).outerRadius(radius * 0.7);
|
|
86
94
|
|
|
87
95
|
// Draw Ring
|
|
88
96
|
this.chart.append('g').attr('class', 'content-wrapper').selectAll().data(arcs).join('path').attr('stroke', 'white').attr('stroke-width', 2).attr('opacity', 1).attr('fill', d => color(d.data.name)).attr('d', arc).attr('data-groupName', d => d.data.name).call(g => {
|
|
@@ -93,7 +101,7 @@ class Ring extends _chartComponent.default {
|
|
|
93
101
|
} = (_g$node$parentNode = g.node().parentNode) === null || _g$node$parentNode === void 0 ? void 0 : _g$node$parentNode.getBoundingClientRect();
|
|
94
102
|
const left = width / 2 + insertPadding;
|
|
95
103
|
const top = height / 2 + insertPadding;
|
|
96
|
-
const offsetX = (
|
|
104
|
+
const offsetX = (plotWidth - width) / 2;
|
|
97
105
|
const offsetY = (chartHeight - insertPadding - insertPadding - height) / 2;
|
|
98
106
|
d3.select(g.node().parentNode).attr('transform', `translate(${left + offsetX}, ${top + offsetY})`);
|
|
99
107
|
|