2

I want to add childnodes on click of a node in forcelayout pattern d3js application, here is my jsfiddle example. Here is childData for childnodes

var childData = [
                {   
                    "name": "x",
                     "size": 1983
                }, {
                    "name": "y",
                      "size": 2047
                }, {
                    "name": "z",
                     "size": 1375
                }, {
                    "name": "t",
                     "size": 1375
                }]

in the example. I did something like this in tree layput pattern but for forcelayout pattern i am facing issue to plot the nodes. Please help me out.

RCS
  • 1,370
  • 11
  • 27
  • how is node like name x/y/z/t related to a particular node. can you please explain this in teh question – Cyril Cherian Dec 28 '15 at 12:09
  • x/y/z/t is data of child node, which we will fetched on click any node using ajax call. – RCS Dec 28 '15 at 12:23
  • On click of a node, say we get 4 nodes which is x/y/z/t. We have to link these 4 nodes with the clicked node(parent node). – RCS Dec 28 '15 at 13:57
  • @Cyril still i am not able to resolve this. Please let me know how to do it. – RCS Apr 02 '16 at 07:43
  • Sorry Bro! i am not able to fix this but i think this is very close to what you want http://stackoverflow.com/questions/34857054/collapsible-d3-force-directed-graph-with-non-tree-data please check this out. – Cyril Cherian Apr 03 '16 at 11:34
  • 1
    Thanks Cyril for the link, it is helpful. Will try this. – RCS Apr 04 '16 at 07:38

0 Answers0