Mercurial > hg > Members > nobuyasu > html > graphViewer
changeset 6:a4323051f7af draft
output to traverseDisplay
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 20 Mar 2013 04:58:35 +0900 |
parents | db93a718f393 |
children | 29db6ff1d63e |
files | index.html |
diffstat | 1 files changed, 2 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/index.html Wed Mar 20 04:54:45 2013 +0900 +++ b/index.html Wed Mar 20 04:58:35 2013 +0900 @@ -188,6 +188,7 @@ var kind = edgeInfo[i].kind; var dir = edgeInfo[i].direction; var num = edgeInfo[i].num; + info[kind] = {}; info[kind][dir] = num; } var viewHTML = createTraverseView(info); @@ -367,20 +368,6 @@ memory.nodes[node.id].both = []; memory.nodes[node.id].property = node; } - var edges = jsonObj.edges; - for (var i=0; i<edges.length; i++) { - var edge = edges[i]; - var edgeId = edge.id; - memory.edges[edgeId] = {}; - memory.edges[edgeId].property = edge; - if (edge.kind == "both") { - memory.nodes[edge.from].both.push(edgeId); - memory.nodes[edge.to].both.push(edgeId); - } else { - memory.nodes[edge.from].out.push(edgeId); - memory.nodes[edge.to].in.push(edgeId); - } - } return memory; } @@ -580,7 +567,7 @@ var rootNode = {}; function testStart() { init(); - var graphData = parseJSONGraphData(GRAPH_DATA, sampleJSONData); + var graphData = parseJSONGraphData(GRAPH_DATA, sampleData); var rootNodeId = "1"; rootNode = graphData.nodes[rootNodeId]; recursiveCalcPosition(graphData, rootNode);