sea-chart 2.0.16 → 2.0.17
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/view/wrapper/area-group.js +2 -2
- package/dist/view/wrapper/area.js +2 -2
- package/dist/view/wrapper/bar-compare.js +4 -4
- package/dist/view/wrapper/bar-custom-stack.js +2 -2
- package/dist/view/wrapper/bar-group.js +5 -47
- package/dist/view/wrapper/bar-stack.js +1 -1
- package/dist/view/wrapper/bar.js +1 -1
- package/dist/view/wrapper/chart-component.js +5 -5
- package/dist/view/wrapper/completeness-group.js +2 -2
- package/dist/view/wrapper/completeness.js +1 -1
- package/dist/view/wrapper/horizontal-bar-group.js +2 -2
- package/dist/view/wrapper/horizontal-bar-stack.js +1 -1
- package/dist/view/wrapper/horizontal-bar.js +1 -1
- package/dist/view/wrapper/line-group.js +1 -1
- package/dist/view/wrapper/line.js +1 -1
- package/dist/view/wrapper/pie.js +1 -1
- package/dist/view/wrapper/ring.js +1 -1
- package/package.json +1 -1
|
@@ -98,7 +98,7 @@ class AreaGroup extends _chartComponent.default {
|
|
|
98
98
|
|
|
99
99
|
// X axis
|
|
100
100
|
const xDomain = data.map(item => item.name);
|
|
101
|
-
const x = d3.scaleBand().domain(xDomain).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.
|
|
101
|
+
const x = d3.scaleBand().domain(xDomain).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
102
102
|
this.ticksWrapper = this.chart.append('g').attr('transform', "translate(0, ".concat(chartHeight - insertPadding, ")")).call(d3.axisBottom(x).tickSizeOuter(0).tickSizeInner(5)).call(g => {
|
|
103
103
|
this.ticksAddName(g);
|
|
104
104
|
g.selectAll('.domain').attr('stroke', theme.XAxisColor);
|
|
@@ -155,7 +155,7 @@ class AreaGroup extends _chartComponent.default {
|
|
|
155
155
|
// circle label
|
|
156
156
|
if (y_axis_show_value) {
|
|
157
157
|
const curCircleEl = g.node();
|
|
158
|
-
rectsWrapper.append('text').attr('fill', theme.labelColor).attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(curCircleEl.getAttribute('data-text')).call(g => {
|
|
158
|
+
rectsWrapper.append('text').attr('stroke', '#fff').attr('stroke-width', 1).attr('paint-order', 'stroke').attr('fill', theme.labelColor).attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(curCircleEl.getAttribute('data-text')).call(g => {
|
|
159
159
|
const {
|
|
160
160
|
width
|
|
161
161
|
} = g.node().getBoundingClientRect();
|
|
@@ -91,7 +91,7 @@ class Area extends _chartComponent.default {
|
|
|
91
91
|
|
|
92
92
|
// X axis
|
|
93
93
|
const xDomain = data.map(item => item.name);
|
|
94
|
-
const x = d3.scaleBand().domain(xDomain).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.
|
|
94
|
+
const x = d3.scaleBand().domain(xDomain).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
95
95
|
this.ticksWrapper = this.chart.append('g').attr('transform', "translate(0, ".concat(chartHeight - insertPadding, ")")).call(d3.axisBottom(x).tickSizeOuter(0).tickSizeInner(5)).call(g => {
|
|
96
96
|
this.ticksAddName(g);
|
|
97
97
|
g.selectAll('.domain').attr('stroke', theme.XAxisColor);
|
|
@@ -130,7 +130,7 @@ class Area extends _chartComponent.default {
|
|
|
130
130
|
// circle label
|
|
131
131
|
if (y_axis_show_value) {
|
|
132
132
|
const curCircleEl = g.node();
|
|
133
|
-
rectsWrapper.append('text').attr('fill', theme.labelColor).attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(curCircleEl.getAttribute('data-text')).call(g => {
|
|
133
|
+
rectsWrapper.append('text').attr('stroke', '#fff').attr('stroke-width', 1).attr('paint-order', 'stroke').attr('fill', theme.labelColor).attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(curCircleEl.getAttribute('data-text')).call(g => {
|
|
134
134
|
const {
|
|
135
135
|
width
|
|
136
136
|
} = g.node().getBoundingClientRect();
|
|
@@ -67,9 +67,9 @@ class BarCompare extends _chartComponent.default {
|
|
|
67
67
|
|
|
68
68
|
// Y axis
|
|
69
69
|
this.chart.append('g').attr('transform', "translate(".concat(insertPadding, ",0)")).call(d3.axisLeft(y).tickSizeInner(0).ticks(5).tickFormat(d => d)).call(g => this.drawYaxis(g, theme));
|
|
70
|
-
const fx = d3.scaleBand().domain(d3.group(data, d => d.name).keys()).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.
|
|
70
|
+
const fx = d3.scaleBand().domain(d3.group(data, d => d.name).keys()).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
71
71
|
const color = d3.scaleOrdinal().domain(d3.group(data, d => d.group_name).keys()).range(_chartUtils.BaseUtils.getCurrentTheme(chartColorTheme).colors).unknown('#ccc');
|
|
72
|
-
const x = d3.scaleBand().domain(d3.group(data, d => d.group_name).keys()).range([0, fx.bandwidth()]);
|
|
72
|
+
const x = d3.scaleBand().domain(d3.group(data, d => d.group_name).keys()).range([0, fx.bandwidth()]).paddingInner(0).paddingOuter(0);
|
|
73
73
|
|
|
74
74
|
// X axis
|
|
75
75
|
this.chart.append('g').attr('transform', "translate(0,".concat(chartHeight - insertPadding, ")")).call(d3.axisBottom(fx).tickSizeOuter(0).tickSizeInner(5)).call(g => {
|
|
@@ -206,7 +206,7 @@ class BarCompare extends _chartComponent.default {
|
|
|
206
206
|
insertPadding
|
|
207
207
|
} = this.chartBoundingClientRect;
|
|
208
208
|
const circleData = increaseData.map(() => ({}));
|
|
209
|
-
const lineX = d3.scaleBand().domain(increaseData.map(d => d.name)).range([insertPadding, chartWidth - insertPadding]).paddingInner(0.
|
|
209
|
+
const lineX = d3.scaleBand().domain(increaseData.map(d => d.name)).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
210
210
|
const lineY = d3.scaleLinear().domain(y_axis_auto_range ? [d3.min(increaseData, d => d.value), d3.max(increaseData, d => d.value)] : [y_axis_min, y_axis_max]).range([chartHeight - insertPadding, insertPadding]);
|
|
211
211
|
const line = d3.line().x((d, index) => {
|
|
212
212
|
const x = lineX(d.name) + lineX.bandwidth() / 2;
|
|
@@ -230,7 +230,7 @@ class BarCompare extends _chartComponent.default {
|
|
|
230
230
|
// circle label
|
|
231
231
|
if (display_increase_percentage) {
|
|
232
232
|
const curCircleEl = g.node();
|
|
233
|
-
wrapper.append('text').attr('fill', theme.labelColor).attr('font-size', _chartUtils.BaseUtils.getLabelFontSize(label_font_size)).text(curCircleEl.getAttribute('data-text')).call(g => {
|
|
233
|
+
wrapper.append('text').attr('stroke', '#fff').attr('stroke-width', 1).attr('paint-order', 'stroke').attr('fill', theme.labelColor).attr('font-size', _chartUtils.BaseUtils.getLabelFontSize(label_font_size)).text(curCircleEl.getAttribute('data-text')).call(g => {
|
|
234
234
|
const {
|
|
235
235
|
width
|
|
236
236
|
} = g.node().getBoundingClientRect();
|
|
@@ -147,8 +147,8 @@ class BarCustom extends _chartComponent.default {
|
|
|
147
147
|
|
|
148
148
|
// Y axis
|
|
149
149
|
this.chart.append('g').attr('transform', "translate(".concat(insertPadding, ",0)")).call(d3.axisLeft(y).tickSizeInner(0).ticks(5).tickFormat(d => d)).call(g => this.drawYaxis(g, theme));
|
|
150
|
-
const fx = d3.scaleBand().domain(new Set(organizedData.map(d => d.name))).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.
|
|
151
|
-
const x = d3.scaleBand().domain(new Set(data.map(d => d.y_axis_type))).range([0, fx.bandwidth()]);
|
|
150
|
+
const fx = d3.scaleBand().domain(new Set(organizedData.map(d => d.name))).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
151
|
+
const x = d3.scaleBand().domain(new Set(data.map(d => d.y_axis_type))).range([0, fx.bandwidth()]).paddingInner(0).paddingOuter(0);
|
|
152
152
|
|
|
153
153
|
// X axis
|
|
154
154
|
this.chart.append('g').attr('transform', "translate(0,".concat(chartHeight - insertPadding, ")")).call(d3.axisBottom(fx).tickSizeOuter(0).tickSizeInner(5)).call(g => {
|
|
@@ -13,7 +13,6 @@ var _lodashEs = require("lodash-es");
|
|
|
13
13
|
var d3 = _interopRequireWildcard(require("d3"));
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
var _intl = _interopRequireDefault(require("../../intl"));
|
|
16
|
-
var _columnUtils = require("../../utils/column-utils");
|
|
17
16
|
var _constants = require("../../constants");
|
|
18
17
|
var _utils = require("../../utils");
|
|
19
18
|
var _colorRules = require("../../constants/color-rules");
|
|
@@ -34,16 +33,14 @@ class BarGroup extends _chartComponent.default {
|
|
|
34
33
|
const {
|
|
35
34
|
y_axis_show_label,
|
|
36
35
|
x_axis_show_label,
|
|
37
|
-
y_axis_show_value
|
|
38
|
-
display_each_block_data,
|
|
39
|
-
type
|
|
36
|
+
y_axis_show_value
|
|
40
37
|
} = chart.config;
|
|
41
38
|
const initConfig = {
|
|
42
39
|
insertPadding: 30,
|
|
43
40
|
borderRadius: 0.2,
|
|
44
41
|
marginLeft: y_axis_show_label ? 20 : 0,
|
|
45
42
|
marginBottom: x_axis_show_label ? 20 : 0,
|
|
46
|
-
marginTop: y_axis_show_value
|
|
43
|
+
marginTop: y_axis_show_value ? 15 : 0
|
|
47
44
|
};
|
|
48
45
|
this.initChart(this.container, chart === null || chart === void 0 ? void 0 : chart.id, initConfig);
|
|
49
46
|
};
|
|
@@ -56,16 +53,6 @@ class BarGroup extends _chartComponent.default {
|
|
|
56
53
|
} = this.props;
|
|
57
54
|
data = _utils.BaseUtils.formatEmptyName(data, '', _intl.default.get('Empty'));
|
|
58
55
|
if (!Array.isArray(data)) return;
|
|
59
|
-
const {
|
|
60
|
-
chart
|
|
61
|
-
} = this.props;
|
|
62
|
-
const {
|
|
63
|
-
sort_type,
|
|
64
|
-
type
|
|
65
|
-
} = chart.config;
|
|
66
|
-
if (type === _constants.CHART_TYPE.BAR_STACK && sort_type) {
|
|
67
|
-
data = (0, _columnUtils.sortDataByGroupSum)(data, sort_type);
|
|
68
|
-
}
|
|
69
56
|
this.draw(data);
|
|
70
57
|
this.renderAxisLabel(this.props.chart, this.props.tables, this.container);
|
|
71
58
|
(0, _utils.isFunction)(customRender) && customRender(this.chart);
|
|
@@ -89,7 +76,6 @@ class BarGroup extends _chartComponent.default {
|
|
|
89
76
|
marginTop
|
|
90
77
|
} = this.chartBoundingClientRect;
|
|
91
78
|
const {
|
|
92
|
-
type,
|
|
93
79
|
y_axis_show_value,
|
|
94
80
|
label_font_size,
|
|
95
81
|
table_id,
|
|
@@ -97,8 +83,7 @@ class BarGroup extends _chartComponent.default {
|
|
|
97
83
|
color_theme,
|
|
98
84
|
y_axis_max,
|
|
99
85
|
y_axis_min,
|
|
100
|
-
y_axis_auto_range
|
|
101
|
-
display_each_block_data
|
|
86
|
+
y_axis_auto_range
|
|
102
87
|
} = chart.config;
|
|
103
88
|
const theme = _constants.CHART_THEME_COLOR[globalTheme];
|
|
104
89
|
const column_groupby_column = this.getColumn(tables, table_id, column_groupby_column_key);
|
|
@@ -109,8 +94,8 @@ class BarGroup extends _chartComponent.default {
|
|
|
109
94
|
|
|
110
95
|
// Y axis
|
|
111
96
|
this.chart.append('g').attr('transform', "translate(".concat(insertPadding, ",0)")).call(d3.axisLeft(y).tickSizeInner(0).ticks(5).tickFormat(d => d)).call(g => this.drawYaxis(g, theme));
|
|
112
|
-
const fx = d3.scaleBand().domain(new Set(data.map(d => d.name))).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.
|
|
113
|
-
const x = d3.scaleBand().domain(new Set(data.map(d => d.group_name))).range([0, fx.bandwidth()]);
|
|
97
|
+
const fx = d3.scaleBand().domain(new Set(data.map(d => d.name))).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
98
|
+
const x = d3.scaleBand().domain(new Set(data.map(d => d.group_name))).range([0, fx.bandwidth()]).paddingInner(0).paddingOuter(0);
|
|
114
99
|
|
|
115
100
|
// X axis
|
|
116
101
|
this.chart.append('g').attr('transform', "translate(0,".concat(chartHeight - insertPadding, ")")).call(d3.axisBottom(fx).tickSizeOuter(0).tickSizeInner(5)).call(g => {
|
|
@@ -143,33 +128,6 @@ class BarGroup extends _chartComponent.default {
|
|
|
143
128
|
});
|
|
144
129
|
|
|
145
130
|
// Add label
|
|
146
|
-
if (type === _constants.CHART_TYPE.BAR_STACK) {
|
|
147
|
-
if (y_axis_show_value) {
|
|
148
|
-
this.addLabelToRectCenter({
|
|
149
|
-
chartType: _constants.CHART_TYPE.BAR_STACK,
|
|
150
|
-
container: parentNode,
|
|
151
|
-
x: Number(rect.getAttribute('x')),
|
|
152
|
-
y: Number(rect.getAttribute('y')),
|
|
153
|
-
xWidth: x.bandwidth(),
|
|
154
|
-
yheight: Number(rect.getAttribute('height')),
|
|
155
|
-
theme,
|
|
156
|
-
label_font_size,
|
|
157
|
-
text: rect.getAttribute('data-value')
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
if (display_each_block_data) {
|
|
161
|
-
this.addLabelToRectTop({
|
|
162
|
-
container: parentNode,
|
|
163
|
-
xWidth: Number(x.bandwidth()),
|
|
164
|
-
x: Number(rect.getAttribute('x')),
|
|
165
|
-
y: Number(rect.getAttribute('y')),
|
|
166
|
-
theme,
|
|
167
|
-
label_font_size,
|
|
168
|
-
text: rect.dataset.value
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
131
|
if (y_axis_show_value) {
|
|
174
132
|
this.addLabelToRectTop({
|
|
175
133
|
container: parentNode,
|
|
@@ -111,7 +111,7 @@ class BarStack extends _chartComponent.default {
|
|
|
111
111
|
|
|
112
112
|
// Y axis
|
|
113
113
|
this.chart.append('g').attr('transform', "translate(".concat(insertPadding, ",0)")).call(d3.axisLeft(y).tickSizeInner(0).ticks(5).tickFormat(d => d)).call(g => this.drawYaxis(g, theme));
|
|
114
|
-
const x = d3.scaleBand().domain(d3.group(data, d => d.name).keys()).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.
|
|
114
|
+
const x = d3.scaleBand().domain(d3.group(data, d => d.name).keys()).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
115
115
|
|
|
116
116
|
// X axis
|
|
117
117
|
this.chart.append('g').attr('transform', "translate(0,".concat(chartHeight - insertPadding, ")")).call(d3.axisBottom(x).tickSizeOuter(0).tickSizeInner(5)).call(g => {
|
package/dist/view/wrapper/bar.js
CHANGED
|
@@ -155,7 +155,7 @@ class Bar extends _chartComponent.default {
|
|
|
155
155
|
} = this.chartBoundingClientRect;
|
|
156
156
|
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]);
|
|
157
157
|
this.chart.append('g').attr('transform', "translate(".concat(insertPadding, ", 0)")).call(d3.axisLeft(y).tickSizeInner(0).ticks(5).tickFormat(d => d)).call(g => this.drawYaxis(g, theme));
|
|
158
|
-
const x = d3.scaleBand().domain(data.map(item => item.name)).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.
|
|
158
|
+
const x = d3.scaleBand().domain(data.map(item => item.name)).range([insertPadding + this.horizontalOverflowOffset, chartWidth - insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
159
159
|
this.chart.append('g').attr('transform', "translate(0, ".concat(chartHeight - insertPadding, ")")).call(d3.axisBottom(x).tickSizeOuter(0).tickSizeInner(5)).call(g => {
|
|
160
160
|
g.selectAll('.domain').attr('stroke', theme.XAxisColor);
|
|
161
161
|
g.selectAll('.tick line').attr('stroke', theme.XAxisColor);
|
|
@@ -258,11 +258,11 @@ class ChartComponent extends _react.Component {
|
|
|
258
258
|
div.className = 'chart-axis-label';
|
|
259
259
|
const column = (0, _dtableUtils.getTableColumnByKey)(table, x_axis_column_key);
|
|
260
260
|
div.innerHTML = "".concat(column ? column.name : '');
|
|
261
|
-
div.setAttribute('style', "color:".concat(textColor, "; width: ").concat(containerWidth, "px; text-align: ").concat(x_axis_label_position, "; position: absolute"));
|
|
261
|
+
div.setAttribute('style', "color:".concat(textColor, "; width: ").concat(containerWidth, "px; text-align: ").concat(x_axis_label_position, "; position: absolute; bottom: 0;"));
|
|
262
262
|
chartContainer.appendChild(div);
|
|
263
263
|
}
|
|
264
264
|
if (xLabel && x_axis_show_label) {
|
|
265
|
-
xLabel.setAttribute('style', "color:".concat(textColor, "; width: ").concat(containerWidth, "px; text-align: ").concat(x_axis_label_position, "; position: absolute"));
|
|
265
|
+
xLabel.setAttribute('style', "color:".concat(textColor, "; width: ").concat(containerWidth, "px; text-align: ").concat(x_axis_label_position, "; position: absolute; bottom: 0;"));
|
|
266
266
|
}
|
|
267
267
|
if (xLabel && !x_axis_show_label) {
|
|
268
268
|
xLabel.parentNode.removeChild(xLabel);
|
|
@@ -1143,7 +1143,7 @@ class ChartComponent extends _react.Component {
|
|
|
1143
1143
|
label_font_size,
|
|
1144
1144
|
text
|
|
1145
1145
|
} = _ref6;
|
|
1146
|
-
d3.select(container).append('text').attr('y', Number(y) - 10).attr('fill', theme.labelColor).attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(text).call(g => {
|
|
1146
|
+
d3.select(container).append('text').attr('stroke', '#fff').attr('stroke-width', 1).attr('paint-order', 'stroke').attr('y', Number(y) - 10).attr('fill', theme.labelColor).attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(text).call(g => {
|
|
1147
1147
|
const {
|
|
1148
1148
|
width
|
|
1149
1149
|
} = g.node().getBoundingClientRect();
|
|
@@ -1161,7 +1161,7 @@ class ChartComponent extends _react.Component {
|
|
|
1161
1161
|
label_font_size,
|
|
1162
1162
|
text
|
|
1163
1163
|
} = _ref7;
|
|
1164
|
-
d3.select(container).append('text').attr('x', Number(x) + Number(xWidth) + 10).attr('y', Number(y)).attr('fill', theme.labelColor).attr('dominant-baseline', 'hanging').attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(text).call(g => {
|
|
1164
|
+
d3.select(container).append('text').attr('stroke', '#fff').attr('stroke-width', 1).attr('paint-order', 'stroke').attr('x', Number(x) + Number(xWidth) + 10).attr('y', Number(y)).attr('fill', theme.labelColor).attr('dominant-baseline', 'hanging').attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(text).call(g => {
|
|
1165
1165
|
if (g.node()) {
|
|
1166
1166
|
var _g$node;
|
|
1167
1167
|
const {
|
|
@@ -1183,7 +1183,7 @@ class ChartComponent extends _react.Component {
|
|
|
1183
1183
|
label_font_size,
|
|
1184
1184
|
text
|
|
1185
1185
|
} = _ref8;
|
|
1186
|
-
d3.select(container).append('text').attr('fill', theme.labelColor).attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(text).call(g => {
|
|
1186
|
+
d3.select(container).append('text').attr('stroke', '#fff').attr('stroke-width', 1).attr('paint-order', 'stroke').attr('fill', theme.labelColor).attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(text).call(g => {
|
|
1187
1187
|
const {
|
|
1188
1188
|
width,
|
|
1189
1189
|
height
|
|
@@ -73,8 +73,8 @@ class Completeness extends _chartComponent.default {
|
|
|
73
73
|
const newSeries = this.getGroupSeries(data);
|
|
74
74
|
|
|
75
75
|
// Y axis
|
|
76
|
-
const fy = d3.scaleBand().domain(newSeries.map(item => item[0])).range([chartHeight - insertPadding, insertPadding]).paddingInner(0.
|
|
77
|
-
const y = d3.scaleBand().domain(new Set(data.map(d => d.groupby))).range([0, fy.bandwidth()]);
|
|
76
|
+
const fy = d3.scaleBand().domain(newSeries.map(item => item[0])).range([chartHeight - insertPadding, insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
77
|
+
const y = d3.scaleBand().domain(new Set(data.map(d => d.groupby))).range([0, fy.bandwidth()]).paddingInner(0).paddingOuter(0);
|
|
78
78
|
const yAxis = this.chart.append('g').call(d3.axisLeft(fy).tickSizeOuter(0).tickPadding(0).tickSizeInner(5)).call(g => {
|
|
79
79
|
g.selectAll('.domain').attr('stroke', theme.XAxisColor);
|
|
80
80
|
g.selectAll('.tick line').attr('stroke', theme.XAxisColor);
|
|
@@ -76,7 +76,7 @@ class Completeness extends _chartComponent.default {
|
|
|
76
76
|
const newSeries = this.handleSeries(series, data);
|
|
77
77
|
|
|
78
78
|
// Y axis
|
|
79
|
-
const y = d3.scaleBand().domain(new Set(data.map(d => d.name))).range([chartHeight - insertPadding, insertPadding]).paddingInner(0.
|
|
79
|
+
const y = d3.scaleBand().domain(new Set(data.map(d => d.name))).range([chartHeight - insertPadding, insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
80
80
|
const yAxis = this.chart.append('g').call(d3.axisLeft(y).tickSizeOuter(0).tickPadding(0).tickSizeInner(5)).call(g => {
|
|
81
81
|
g.selectAll('.domain').attr('stroke', theme.XAxisColor);
|
|
82
82
|
g.selectAll('.tick line').attr('stroke', theme.XAxisColor);
|
|
@@ -91,8 +91,8 @@ class HorizontalBarGroup extends _chartComponent.default {
|
|
|
91
91
|
const groupByColumn = this.getColumn(tables, table_id, column_groupby_column_key);
|
|
92
92
|
const useSingleSelectColumnColor = (groupByColumn === null || groupByColumn === void 0 ? void 0 : groupByColumn.type) === _dtableUtils.CellType.SINGLE_SELECT && color_theme === _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS;
|
|
93
93
|
useSingleSelectColumnColor ? this.setSingleSelectColorMap(data) : this.setColorMap(data, chartColorTheme);
|
|
94
|
-
const fy = d3.scaleBand().domain(new Set(data.map(d => d.name))).range([chartHeight - insertPadding, insertPadding]).paddingInner(0.1);
|
|
95
|
-
const y = d3.scaleBand().domain(new Set(data.map(d => d.group_name))).range([0, fy.bandwidth()]);
|
|
94
|
+
const fy = d3.scaleBand().domain(new Set(data.map(d => d.name))).range([chartHeight - insertPadding, insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
95
|
+
const y = d3.scaleBand().domain(new Set(data.map(d => d.group_name))).range([0, fy.bandwidth()]).paddingInner(0).paddingOuter(0);
|
|
96
96
|
const yAxis = this.chart.append('g').call(d3.axisLeft(fy).tickSizeOuter(0).tickPadding(0).tickSizeInner(5)).call(g => {
|
|
97
97
|
g.selectAll('.domain').attr('stroke', theme.XAxisColor);
|
|
98
98
|
g.selectAll('.tick line').attr('stroke', theme.XAxisColor);
|
|
@@ -94,7 +94,7 @@ class HorizontalBarStack extends _chartComponent.default {
|
|
|
94
94
|
return ((_group$get = group.get(String(key))) === null || _group$get === void 0 ? void 0 : _group$get.value) || 0;
|
|
95
95
|
})(d3.index(data, d => d.name, d => d.group_name));
|
|
96
96
|
const newSeries = this.handleSeries(series, data);
|
|
97
|
-
const y = d3.scaleBand().domain(new Set(data.map(d => d.name))).range([chartHeight - insertPadding, insertPadding]).paddingInner(0.
|
|
97
|
+
const y = d3.scaleBand().domain(new Set(data.map(d => d.name))).range([chartHeight - insertPadding, insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
98
98
|
|
|
99
99
|
// Y axis
|
|
100
100
|
const yAxis = this.chart.append('g').call(d3.axisLeft(y).tickSizeOuter(0).tickPadding(0).tickSizeInner(5)).call(g => {
|
|
@@ -88,7 +88,7 @@ class HorizontalBar extends _chartComponent.default {
|
|
|
88
88
|
const colorRules = color_option === _constants.TYPE_COLOR_USING.USE_RULES && horizontal_axis_label_color_rules && (0, _colorUtils.getConvertedColorRules)(horizontal_axis_label_color_rules);
|
|
89
89
|
const tooltipTitle = this.getTitle(tables, table_id, horizontal_axis_summary_type, horizontal_axis_column_key);
|
|
90
90
|
data.reverse();
|
|
91
|
-
const y = d3.scaleBand().domain(data.map(item => item.name)).range([chartHeight - insertPadding, insertPadding]).paddingInner(0.
|
|
91
|
+
const y = d3.scaleBand().domain(data.map(item => item.name)).range([chartHeight - insertPadding, insertPadding]).paddingInner(0.5).paddingOuter(0.1);
|
|
92
92
|
const yAxis = this.chart.append('g').call(d3.axisLeft(y).tickSizeOuter(0).tickPadding(0).tickSizeInner(5)).call(g => {
|
|
93
93
|
g.selectAll('.domain').attr('stroke', theme.XAxisColor);
|
|
94
94
|
g.selectAll('.tick line').attr('stroke', theme.XAxisColor);
|
|
@@ -209,7 +209,7 @@ class LineGroup extends _chartComponent.default {
|
|
|
209
209
|
// circle label
|
|
210
210
|
if (y_axis_show_value) {
|
|
211
211
|
const curCircleEl = g.node();
|
|
212
|
-
rectsWrapper.append('text').attr('fill', theme.labelColor).attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(curCircleEl.getAttribute('data-text')).call(g => {
|
|
212
|
+
rectsWrapper.append('text').attr('stroke', '#fff').attr('stroke-width', 1).attr('paint-order', 'stroke').attr('fill', theme.labelColor).attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(curCircleEl.getAttribute('data-text')).call(g => {
|
|
213
213
|
const {
|
|
214
214
|
width
|
|
215
215
|
} = g.node().getBoundingClientRect();
|
|
@@ -177,7 +177,7 @@ class Line extends _chartComponent.default {
|
|
|
177
177
|
// circle label
|
|
178
178
|
if (y_axis_show_value) {
|
|
179
179
|
const curCircleEl = g.node();
|
|
180
|
-
rectsWrapper.append('text').attr('fill', theme.labelColor).attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(curCircleEl.getAttribute('data-text')).call(g => {
|
|
180
|
+
rectsWrapper.append('text').attr('stroke', '#fff').attr('stroke-width', 1).attr('paint-order', 'stroke').attr('fill', theme.labelColor).attr('font-size', _utils.BaseUtils.getLabelFontSize(label_font_size)).text(curCircleEl.getAttribute('data-text')).call(g => {
|
|
181
181
|
const {
|
|
182
182
|
width
|
|
183
183
|
} = g.node().getBoundingClientRect();
|
package/dist/view/wrapper/pie.js
CHANGED
|
@@ -102,7 +102,7 @@ class Pie extends _chartComponent.default {
|
|
|
102
102
|
if (display_label) {
|
|
103
103
|
const labelRadius = this.isInnerLabel ? arc.outerRadius()() * 0.7 : arc.outerRadius()() * 1.2;
|
|
104
104
|
const arcLabel = d3.arc().innerRadius(labelRadius).outerRadius(labelRadius);
|
|
105
|
-
this.chart.append('g').attr('transform', "translate(".concat(left + offsetX, ", ").concat(top + offsetY, ")")).attr('text-anchor', 'middle').selectAll().data(arcs).join('text').attr('transform', d => "translate(".concat(arcLabel.centroid(d), ")")).text(d => {
|
|
105
|
+
this.chart.append('g').attr('transform', "translate(".concat(left + offsetX, ", ").concat(top + offsetY, ")")).attr('text-anchor', 'middle').selectAll().data(arcs).join('text').attr('stroke', '#fff').attr('stroke-width', 1).attr('paint-order', 'stroke').attr('transform', d => "translate(".concat(arcLabel.centroid(d), ")")).text(d => {
|
|
106
106
|
const {
|
|
107
107
|
value,
|
|
108
108
|
percent
|
|
@@ -108,7 +108,7 @@ class Ring extends _chartComponent.default {
|
|
|
108
108
|
if (display_label) {
|
|
109
109
|
const labelRadius = this.isInnerLabel ? arc.outerRadius()() * 1.2 : arc.outerRadius()() * 1.65;
|
|
110
110
|
const arcLabel = d3.arc().innerRadius(labelRadius).outerRadius(labelRadius);
|
|
111
|
-
this.chart.append('g').attr('transform', "translate(".concat(left + offsetX, ", ").concat(top + offsetY, ")")).attr('text-anchor', 'middle').selectAll().data(arcs).join('text').attr('class', 'label').attr('transform', d => "translate(".concat(arcLabel.centroid(d), ")")).text(d => {
|
|
111
|
+
this.chart.append('g').attr('transform', "translate(".concat(left + offsetX, ", ").concat(top + offsetY, ")")).attr('text-anchor', 'middle').selectAll().data(arcs).join('text').attr('class', 'label').attr('stroke', '#fff').attr('stroke-width', 1).attr('paint-order', 'stroke').attr('transform', d => "translate(".concat(arcLabel.centroid(d), ")")).text(d => {
|
|
112
112
|
const {
|
|
113
113
|
value,
|
|
114
114
|
percent
|