|
@@ -70,13 +70,20 @@ export default {
|
|
|
defaultNode: {
|
|
|
size: 40,
|
|
|
labelCfg: {
|
|
|
+ position: 'bottom', // 标签显示在节点下方
|
|
|
style: {
|
|
|
fill: '#000',
|
|
|
fontSize: 12
|
|
|
}
|
|
|
+ },
|
|
|
+ style: {
|
|
|
+ fill: '#4B9EFF', // 圆圈填充色
|
|
|
+ stroke: '#4B9EFF', // 圆圈边框色(与填充色一致,实现无边框效果)
|
|
|
+ lineWidth: 0 // 边框宽度为0,彻底去掉边框
|
|
|
}
|
|
|
},
|
|
|
defaultEdge: {
|
|
|
+ type: 'cubic', // 贝塞尔曲线
|
|
|
style: {
|
|
|
endArrow: true,
|
|
|
},
|
|
@@ -111,7 +118,8 @@ export default {
|
|
|
if (!this.$refs.container) return;
|
|
|
|
|
|
const container = this.$refs.container;
|
|
|
- this.graph.changeSize(container.scrollWidth, container.scrollHeight || 600);
|
|
|
+ this.graph.changeSize(container.offsetWidth, container.scrollHeight || 600);
|
|
|
+ this.graph.fitView();
|
|
|
}
|
|
|
}
|
|
|
}
|