arbor.js

add nodes and edges through loop in cytoscape arbor layout

China☆狼群 提交于 2019-12-11 02:28:34
问题 I want to add more than 10 nodes in arbor.js layout.This code adds nodes and edges in arbor layout for cytoscape elements: { nodes: [ { data : { id: b[0], faveBorderColor: "#AAAAAA", name: b[0], faveColor: "#EEB211", faveFontColor: "#ffffff" ,'link':'http://www.yahoo.com'} }, { data : { id: a[0], name: a[0], faveColor: "#21526a", faveFontColor: "#fff"} }, { data : { id: a[1], name: a[1], faveColor: "#21526a", faveFontColor: "#fff"} }, { data : { id: a[2], name: a[2], faveColor: "#21526a",

Add label to edges in arbor.js (Query plugin)

安稳与你 提交于 2019-12-03 13:34:22
问题 How do I add labels to edges in arbor.js It is a graph visualization library. Suppose A and B are nodes and E is the edge One crude way would be insert a "text node" T and join A-T and T-B But i don't want to this, is there any other way? Here's the sample code var theUI = { nodes:{A:{color:"red", shape:"dot", alpha:1}, B:{color:"#b2b19d", shape:"dot", alpha:1}, C:{color:"#b2b19d", shape:"dot", alpha:1}, D:{color:"#b2b19d", shape:"dot", alpha:1}, }, edges:{ A:{ B:{length:.8}, C:{length:.8}, D

Arbor Js - Node Onclick?

时间秒杀一切 提交于 2019-12-03 07:33:35
问题 I'm using arbor.js to create a graph. How do I create an onclick event for a node, or make a node link somewhere upon being clicked? The Arborjs.org homepage has nodes which link to external pages upon being clicked, how do I replicate this, or make the node call javascript function upon being clicked? My current node and edges listing is in this format: var data = { nodes:{ threadstarter:{'color':'red','shape':'dot','label':'Animals'}, reply1:{'color':'green','shape':'dot','label':'dog'},

Arbor Js - Node Onclick?

会有一股神秘感。 提交于 2019-12-02 21:04:34
I'm using arbor.js to create a graph. How do I create an onclick event for a node, or make a node link somewhere upon being clicked? The Arborjs.org homepage has nodes which link to external pages upon being clicked, how do I replicate this, or make the node call javascript function upon being clicked? My current node and edges listing is in this format: var data = { nodes:{ threadstarter:{'color':'red','shape':'dot','label':'Animals'}, reply1:{'color':'green','shape':'dot','label':'dog'}, reply2:{'color':'blue','shape':'dot','label':'cat'} }, edges:{ threadstarter:{ reply1:{}, reply2:{} } } }