绘制力学图总结为如下步骤:
一、确定数据源:
绘制力学图,你需要知道定点和边,如下:
var nodes = [
{name:"GuiLin"},
{name:"GuangZhou"},
{name:"XiaMen"},
{name:"HangZhou"},
{name:"ShangHai"},
{name:"QingDao"},
{name:"TianJin"},
{name:"BeiJing"},
{name:"ChangChun"},
{name:"XiAn"},
{name:"WuLuMuQi"},
{name:"LaSa"},
{name:"ChengDu"}];
var edges = [
{source:0,target: 1 },
{source:1,target: 2 },
{source:3,target: 4 } ,
{source:4,target: 5 } ,
{source:5,target: 6 } ,
{source:6,target: 7 } ,
{source:7,target: 8 } ,
{source:8,target: 9 } ,
{source:9,target:10 } ,
{source:10,target:11} ,
{source:11,target:12} ,
{source:12,target: 0} ];