可视化工具包
人际关系图
样例
格式
描绘
下载
返回
数据中心
查看
initGragh:function(id){ var self = this; var t = new NetChart({ container: document.getElementById("output"), area: { height: 500 }, data: { preloaded: { "nodes":self.graph.persons, "links":self.graph.links } }, navigation: { initialNodes: [id], mode: "focusnodes",focusNodeExpansionRadius: 1}, style: { node: { imageCropping: true }, nodeStyleFunction: nodeStyle, linkStyleFunction: linkStyle } }); function nodeStyle(node) { node.label = node.data.name; node.image = (node.data.avatar!="") ? node.data.avatar : "../static/cekasp/images/default-avatar.png"; //node.image = (node.data.avatar!="") ? node.data.avatar : global.appWebUrl+"/cekasp/images/default-avatar.png"; }; function linkStyle(link) { link.items = [ { // Default item places just as the regular label. text: link.data.text, backgroundStyle: { fillColor: "#f3f3f3", lineColor: "#ccc" } }, { // add a star at the source node image: "../static/cekasp/images/icons.png", //image: global.appWebUrl+"/cekasp/images/icons.png", imageSlicing: [0, 0, 16, 16], px: -1, py: 0, lx: 8, ly: 0 }, { // add a star at the target node image: "../static/cekasp/images/icons.png", //image: global.appWebUrl+"/cekasp/images/icons.png", imageSlicing: [0, 0, 16, 16], px: 1, py: 0, lx: -8, ly: 0 } ] } }
复制