currently i am doing is represent relation ships of data using d3.js. need to represent it in a tree. My data stored at Neo4j server. And application is design under Express frame work.
var cypher = [
"match (b:Binary)-[r*..1]->(a:Binary)",
"where a.Key = '" + data + "'",
"return collect( distinct b) as dep"].join("\n");
execute this query and put the result in to a queue and sequentially execute it. this is for getting all children of the node. But I need to make this not as flat json something like depth. like `
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
{"name": "CommunityStructure", "size": 3812},
{"name": "HierarchicalCluster", "size": 6714},
{"name": "MergeEdge", "size": 743}
]
},
...... how can i do it?