节点间的距离受什么因素影响?,可以怎么设置改变节点之间的距离?
配置项如下
var uploadedDataURL = "/asset/get/s/data-1499235712572-BkKKrbcNZ.gexf";
myChart.showLoading();
$.get(uploadedDataURL, function(xml) {
console.log(1111);
myChart.hideLoading();
var graph = echarts.dataTool.gexf.parse(xml);
var categories = [];
for (var i = 0; i < 9; i++) {
categories[i] = {
name: '类目' + i
};
}
// console.log(graph.links);
graph.nodes.forEach(function(node) {
node.itemStyle = null;
node.value = node.symbolSize;
// node.symbolSize /= 1.5;
node.label = {
normal: {
show: node.symbolSize > 0,
// textStyle:{
// fontSize:node.symbolSize>30?node.symbolSize/3:(node.symbolSize>10?node.symbolSize/2:node.symbolSize*2)
// }
}
};
node.category = node.attributes.modularity_class;
node.draggable = true;
});
option = {
//color:
title: {
text: 'test',
subtext: 'Default layout',
top: 'bottom',
left: 'left'
},
tooltip: {},
legend: [{
// selectedMode: 'single',
data: categories.map(function(a) {
return a.name;
})
}],
animationDuration: 1500,
animationEasingUpdate: 'quinticInOut',
series: [{
name: 'test',
type: 'graph',
layout: 'force',
data: graph.nodes,
links: graph.links,
categories: categories,
focusNodeAdjacency: true,
roam: true,
label: {
normal: {
position: 'right',
formatter: '{b}'
}
},
lineStyle: {
normal: {
color: 'source',
curveness: 0.3
}
},
force: {
repulsion: 650,
gravity: 0.25,
edgeLength: [100, 150]
}
}]
};
myChart.setOption(option);
}, 'xml');