代码拉取完成,页面将自动刷新
同步操作将从 白利华/leaflet-book 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<!DOCTYPE html>
<html style="height: 100%">
<head>
<meta charset="utf-8">
</head>
<body style="height: 100%; margin: 0">
<div id="container" style="height: 100%"></div>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts.min.js"></script>
<script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
option = null;
var graph = [];
var categories = [];
for (var i = 0; i < 9; i++) {
categories[i] = {
name: '类目' + i
};
}
console.log(graph);
graph = {
nodes: [
{
attributes: {
modularity_class: 1
},
category: 0,
id: "0",
itemStyle: null,
label: {
normal: {
show: false
}
},
name: "Myriel",
symbolSize: 19.12381,
value: 28.685715,
},
{
attributes: {
modularity_class: 1
},
category: 0,//图例
id: "1",
itemStyle: null,
label: {
normal: {
show: false
}
},
name: "Myriel",
symbolSize: 19.12381,
value: 28.685715,
// x: -266.82776,
// y: 399.6904 //位置一定要动
},
{
attributes: {
modularity_class: 1
},
category: 0,//图例
id: "2",
itemStyle: null,
label: {
normal: {
show: false
}
},
name: "Myriel",
symbolSize: 19.12381,
value: 28.685715,
// x: -266.82776,
// y: 399.6904 //位置一定要动
}
],
links: [
{
id: "0",
lineStyle: {normal: {}},
name: null,
source: "1",
target: "0",
},
{
id: "1",
lineStyle: {normal: {}},
name: null,
source: "1",
target: "2",
}
]
};
option = {
title: {
text: 'Les Miserables',
subtext: 'Default layout',
top: 'bottom',
left: 'right'
},
tooltip: {},
legend: [{
// selectedMode: 'single',
data: categories.map(function (a) {
return a.name;
})
}],
animationDuration: 1500,
animationEasingUpdate: 'quinticInOut',
series: [
{
name: '',
type: 'graph',
layout: 'force', //力图生效
data: graph.nodes,
links: graph.links,
categories: categories,
roam: true,
focusNodeAdjacency: true,
itemStyle: {
normal: {
borderColor: '#fff',
borderWidth: 1,
shadowBlur: 10,
shadowColor: 'rgba(0, 0, 0, 0.3)'
}
},
label: {
position: 'right',
formatter: '{b}'
},
lineStyle: {
color: 'source',
curveness: 0.3
},
emphasis: {
lineStyle: {
width: 10
}
},
force: {
repulsion: 2500,
edgeLength: [10, 50]
},
draggable: true,
}
]
};
myChart.setOption(option);
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。