sea-chart 0.0.42 → 0.0.43
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/constants/index.js +1 -1
- package/dist/locale/lang/de.js +2 -2
- package/dist/locale/lang/fr.js +2 -2
- package/dist/locale/lang/zh_CN.js +2 -2
- package/dist/settings/widgets/select-table/index.js +1 -1
- package/dist/view/wrapper/chart-component.js +11 -7
- package/dist/view/wrapper/combination.js +27 -25
- package/dist/view/wrapper/line-group.js +27 -24
- package/dist/view/wrapper/line.js +35 -31
- package/package.json +1 -1
package/dist/constants/index.js
CHANGED
|
@@ -198,7 +198,7 @@ export const LEGEND_DIRECTION = {
|
|
|
198
198
|
export const MIRROR_COLUMN_LIST = [CellType.TEXT, CellType.NUMBER, CellType.CTIME, CellType.MTIME, CellType.DATE, CellType.COLLABORATOR, CellType.AUTO_NUMBER, CellType.FORMULA, CellType.GEOLOCATION, CellType.URL, CellType.SINGLE_SELECT, CellType.LINK, CellType.CREATOR, CellType.LAST_MODIFIER, CellType.DURATION, CellType.EMAIL];
|
|
199
199
|
export const CHART_SUPPORT_FONT_WEIGHTS = [400, 700];
|
|
200
200
|
export const DEFAULT_CHART_FONT_WEIGHT = CHART_SUPPORT_FONT_WEIGHTS[1];
|
|
201
|
-
export const DEFAULT_CHART_TITLE_FONT_SIZE =
|
|
201
|
+
export const DEFAULT_CHART_TITLE_FONT_SIZE = 18;
|
|
202
202
|
export const DEFAULT_CHART_TITLE_FONT_COLOR = '#212529';
|
|
203
203
|
export const CHART_SETTINGS_TYPE = {
|
|
204
204
|
DATA: 'data',
|
package/dist/locale/lang/de.js
CHANGED
|
@@ -20,8 +20,8 @@ const de = {
|
|
|
20
20
|
"By_city": "Nach Stadt",
|
|
21
21
|
"By_district": "Nach Bezirk",
|
|
22
22
|
"Row_count": "Anzahl der Zeilen",
|
|
23
|
-
"Left": "
|
|
24
|
-
"Right": "
|
|
23
|
+
"Left": "Links",
|
|
24
|
+
"Right": "Rechts",
|
|
25
25
|
"Center": "Zentriert",
|
|
26
26
|
"Top": "Oben",
|
|
27
27
|
"Bottom": "Unten",
|
package/dist/locale/lang/fr.js
CHANGED
|
@@ -20,8 +20,8 @@ const fr = {
|
|
|
20
20
|
"By_city": "Par ville",
|
|
21
21
|
"By_district": "Par département",
|
|
22
22
|
"Row_count": "Nombre de lignes",
|
|
23
|
-
"Left": "
|
|
24
|
-
"Right": "
|
|
23
|
+
"Left": "À gauche",
|
|
24
|
+
"Right": "À droite",
|
|
25
25
|
"Center": "Centre",
|
|
26
26
|
"Top": "En haut",
|
|
27
27
|
"Bottom": "En bas",
|
|
@@ -140,8 +140,8 @@ const zh_CN = {
|
|
|
140
140
|
"Done": "完成",
|
|
141
141
|
"Internal_server_error": "服务端错误",
|
|
142
142
|
"Network_error": "网络错误",
|
|
143
|
-
"There_are_some_problems_with_the_filters": "
|
|
144
|
-
"Please_complete_the_chart_configuration_first": "
|
|
143
|
+
"There_are_some_problems_with_the_filters": "过滤器有一些问题。",
|
|
144
|
+
"Please_complete_the_chart_configuration_first": "请先完成图表配置",
|
|
145
145
|
"Not_used": "不使用",
|
|
146
146
|
"Select_field": "选择字段",
|
|
147
147
|
"Display_total": "显示总计",
|
|
@@ -32,7 +32,7 @@ class SelectTable extends React.Component {
|
|
|
32
32
|
render() {
|
|
33
33
|
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
34
34
|
className: "sea-chart-setting-item table-setting"
|
|
35
|
-
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Table')), this.renderSelector());
|
|
35
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.lang === 'zh-cn' ? '子表' : intl.get('Table')), this.renderSelector());
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
export default SelectTable;
|
|
@@ -383,24 +383,27 @@ export default class ChartComponent extends Component {
|
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
385
|
},
|
|
386
|
-
|
|
386
|
+
itemHeight: 30,
|
|
387
387
|
marker: {
|
|
388
388
|
symbol:
|
|
389
|
+
// 'square',
|
|
389
390
|
// use cavans to custom legend,returns a path command array
|
|
390
391
|
(x, y) => {
|
|
392
|
+
x = x + 6;
|
|
393
|
+
y = y - 1;
|
|
391
394
|
// The total width of the capsule is 20px, and its height is 6px. Thus, the radius of the semi-circle is half the height, which is 3px.
|
|
392
395
|
const r = 3;
|
|
393
396
|
// The width of the rectangular part in the middle of the capsule is the total width minus the diameters of the two semi-circles, which is 14px.
|
|
394
397
|
const rectWidth = 14;
|
|
395
|
-
return [['M', x - rectWidth / 2
|
|
398
|
+
return [['M', x - rectWidth / 2, y - r],
|
|
396
399
|
// Start from the left edge of the left semi-circle
|
|
397
|
-
['L', x + rectWidth / 2
|
|
400
|
+
['L', x + rectWidth / 2, y - r],
|
|
398
401
|
// Draw the top line to the left edge of the right semi-circle
|
|
399
|
-
['A', r, r, 0, 0, 1, x + rectWidth / 2
|
|
402
|
+
['A', r, r, 0, 0, 1, x + rectWidth / 2, y + r],
|
|
400
403
|
// Draw the right semi-circle
|
|
401
|
-
['L', x - rectWidth / 2
|
|
404
|
+
['L', x - rectWidth / 2, y + r],
|
|
402
405
|
// Draw the bottom line back to the right edge of the left semi-circle
|
|
403
|
-
['A', r, r, 0, 0, 1, x - rectWidth / 2
|
|
406
|
+
['A', r, r, 0, 0, 1, x - rectWidth / 2, y - r] // Draw the left semi-circle
|
|
404
407
|
];
|
|
405
408
|
},
|
|
406
409
|
style: style => {
|
|
@@ -409,7 +412,8 @@ export default class ChartComponent extends Component {
|
|
|
409
412
|
style.fill = style.stroke;
|
|
410
413
|
}
|
|
411
414
|
return style;
|
|
412
|
-
}
|
|
415
|
+
},
|
|
416
|
+
spacing: 15
|
|
413
417
|
}
|
|
414
418
|
};
|
|
415
419
|
};
|
|
@@ -307,9 +307,16 @@ class Combination extends ChartComponent {
|
|
|
307
307
|
this.chart.on('interval:mouseenter', e => {
|
|
308
308
|
if (this.isInsideInterval) return;
|
|
309
309
|
this.isInsideInterval = true;
|
|
310
|
-
point.style({
|
|
311
|
-
|
|
312
|
-
|
|
310
|
+
// point.style({
|
|
311
|
+
// stroke: 0,
|
|
312
|
+
// fillOpacity: 0.3,
|
|
313
|
+
// });
|
|
314
|
+
interval.style('name*value_left', (name, value) => {
|
|
315
|
+
const isHovered = value === e.data.data.value_left && name === e.data.data.name;
|
|
316
|
+
return {
|
|
317
|
+
fillOpacity: isHovered ? 1 : 0.3,
|
|
318
|
+
radius: [singleBarRadius, singleBarRadius, 0, 0]
|
|
319
|
+
};
|
|
313
320
|
});
|
|
314
321
|
interval.tooltip('name*value_left', (name, value) => {
|
|
315
322
|
const {
|
|
@@ -335,9 +342,15 @@ class Combination extends ChartComponent {
|
|
|
335
342
|
this.chart.on('interval:mouseleave', e => {
|
|
336
343
|
if (!this.isInsideInterval) return;
|
|
337
344
|
this.isInsideInterval = false;
|
|
338
|
-
point.style({
|
|
339
|
-
|
|
340
|
-
|
|
345
|
+
// point.style({
|
|
346
|
+
// stroke: 0,
|
|
347
|
+
// fillOpacity: 1,
|
|
348
|
+
// });
|
|
349
|
+
interval.style('name*value_left', (name, value) => {
|
|
350
|
+
return {
|
|
351
|
+
fillOpacity: 1,
|
|
352
|
+
radius: [singleBarRadius, singleBarRadius, 0, 0]
|
|
353
|
+
};
|
|
341
354
|
});
|
|
342
355
|
interval.tooltip(false);
|
|
343
356
|
point.tooltip('name*value_right', (name, value) => {
|
|
@@ -353,10 +366,10 @@ class Combination extends ChartComponent {
|
|
|
353
366
|
this.chart.on('point:mouseenter', throttle(e => {
|
|
354
367
|
if (this.isInsidePoint) return;
|
|
355
368
|
this.isInsidePoint = true;
|
|
356
|
-
interval.style({
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
});
|
|
369
|
+
// interval.style({
|
|
370
|
+
// radius: [singleBarRadius, singleBarRadius, 0, 0],
|
|
371
|
+
// fillOpacity: 0.3,
|
|
372
|
+
// });
|
|
360
373
|
point.style('name', name => {
|
|
361
374
|
let r = 4;
|
|
362
375
|
if (name === e.data.data.name) {
|
|
@@ -373,10 +386,10 @@ class Combination extends ChartComponent {
|
|
|
373
386
|
this.chart.on('point:mouseleave', throttle(e => {
|
|
374
387
|
if (!this.isInsidePoint) return;
|
|
375
388
|
this.isInsidePoint = false;
|
|
376
|
-
interval.style({
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
});
|
|
389
|
+
// interval.style({
|
|
390
|
+
// radius: [singleBarRadius, singleBarRadius, 0, 0],
|
|
391
|
+
// fillOpacity: 1,
|
|
392
|
+
// });
|
|
380
393
|
point.style('name', name => {
|
|
381
394
|
let r = 4;
|
|
382
395
|
return {
|
|
@@ -387,17 +400,6 @@ class Combination extends ChartComponent {
|
|
|
387
400
|
});
|
|
388
401
|
this.chart.render(true);
|
|
389
402
|
}, 100));
|
|
390
|
-
this.chart.interaction('element-highlight-by-x', {
|
|
391
|
-
start: [{
|
|
392
|
-
trigger: 'element:mouseenter',
|
|
393
|
-
action: 'element-highlight-by-x:highlight'
|
|
394
|
-
}],
|
|
395
|
-
end: [{
|
|
396
|
-
trigger: 'element:mouseleave',
|
|
397
|
-
action: 'element-highlight-by-x:reset'
|
|
398
|
-
}]
|
|
399
|
-
});
|
|
400
|
-
// this.chart.interaction('custom-highlight-by-x');
|
|
401
403
|
isFunction(customRender) && customRender(this.chart);
|
|
402
404
|
this.chart.removeInteraction('legend-filter');
|
|
403
405
|
this.chart.render();
|
|
@@ -104,30 +104,33 @@ class LineGroup extends ChartComponent {
|
|
|
104
104
|
fillOpacity: 1
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
});
|
|
107
|
+
|
|
108
|
+
// this.chart.on('tooltip:show', () => {
|
|
109
|
+
// if (line.styleOption.cfg.opacity === 0.3) return;
|
|
110
|
+
// line.style({
|
|
111
|
+
// opacity: 0.3,
|
|
112
|
+
// lineWidth: 3,
|
|
113
|
+
// });
|
|
114
|
+
// if (point) point.style({
|
|
115
|
+
// fillOpacity: 0.3,
|
|
116
|
+
// stroke: 0,
|
|
117
|
+
// });
|
|
118
|
+
// this.chart.render();
|
|
119
|
+
// });
|
|
120
|
+
|
|
121
|
+
// this.chart.on('tooltip:hide', () => {
|
|
122
|
+
// if (line.styleOption.cfg.opacity === 1) return;
|
|
123
|
+
// line.style({
|
|
124
|
+
// opacity: 1,
|
|
125
|
+
// lineWidth: 3,
|
|
126
|
+
// });
|
|
127
|
+
// if (point) point.style({
|
|
128
|
+
// fillOpacity: 1,
|
|
129
|
+
// stroke: 0,
|
|
130
|
+
// });
|
|
131
|
+
// this.chart.render();
|
|
132
|
+
// });
|
|
133
|
+
|
|
131
134
|
this.setToolTipForLine();
|
|
132
135
|
this.setNameLabelAndTooltip(theme, this.labelCount);
|
|
133
136
|
this.setValueLabel(theme);
|
|
@@ -73,13 +73,15 @@ class Line extends ChartComponent {
|
|
|
73
73
|
stroke: '#fff',
|
|
74
74
|
lineWidth: 1
|
|
75
75
|
}
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
76
|
+
})
|
|
77
|
+
// .animate({
|
|
78
|
+
// appear: {
|
|
79
|
+
// animation: 'fadeIn',
|
|
80
|
+
// duration: 1000,
|
|
81
|
+
// easing: 'easeLinear'
|
|
82
|
+
// }
|
|
83
|
+
// })
|
|
84
|
+
.position('name*value').color(chartBarColor).shape(isSmooth ? 'smooth' : 'line').style({
|
|
83
85
|
lineWidth: 3,
|
|
84
86
|
opacity: 1
|
|
85
87
|
}).tooltip('name*value', (name, value) => {
|
|
@@ -102,30 +104,32 @@ class Line extends ChartComponent {
|
|
|
102
104
|
fillOpacity: 1
|
|
103
105
|
});
|
|
104
106
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
});
|
|
107
|
+
|
|
108
|
+
// this.chart.on('tooltip:show', () => {
|
|
109
|
+
// if (line.styleOption.cfg.opacity === 0.3) return;
|
|
110
|
+
// line.style({
|
|
111
|
+
// opacity: 0.3,
|
|
112
|
+
// lineWidth: 3,
|
|
113
|
+
// });
|
|
114
|
+
// if (point) point.style({
|
|
115
|
+
// fillOpacity: 0.3,
|
|
116
|
+
// stroke: 0,
|
|
117
|
+
// });
|
|
118
|
+
// this.chart.render();
|
|
119
|
+
// });
|
|
120
|
+
|
|
121
|
+
// this.chart.on('tooltip:hide', () => {
|
|
122
|
+
// if (line.styleOption.cfg.opacity === 1) return;
|
|
123
|
+
// line.style({
|
|
124
|
+
// opacity: 1,
|
|
125
|
+
// lineWidth: 3,
|
|
126
|
+
// });
|
|
127
|
+
// if (point) point.style({
|
|
128
|
+
// fillOpacity: 1,
|
|
129
|
+
// stroke: 0,
|
|
130
|
+
// });
|
|
131
|
+
// this.chart.render();
|
|
132
|
+
// });
|
|
129
133
|
this.setToolTipForLine();
|
|
130
134
|
this.setNameLabelAndTooltip(theme, this.labelCount);
|
|
131
135
|
this.setValueLabel(theme);
|