Reputation: 1953
I need to develop a functionality wherein a user can add/edit/delete child nodes and the change is displayed as a tree structure in a different panel. To display the tree structure I am planning to use the D3js tree layout.
But I am completely new to these technologies: d3.js, json, svg, canvas... Can anyone tell me:
How can I manipulate the tree?
How can I get the click event when a node is clicked?
How can I dynamically show the new node add/edit/delete?
Any tutorial for beginners is also appreciated.
Thanks.
Upvotes: 1
Views: 2864
Reputation: 311
The d3.JS site has a great deal of pretty good tutorials which you can find by navigating the site. There are also a great deal of example visualizations there too.
Here's a good place to start though. Scott Murray has both a deep understanding of the subject as well as an innate ability to communicate this understanding to others.
http://alignedleft.com/tutorials/
Try reading through his tutorial as it will explain SVG, .data() and JSON.
Here's a non-interactive tree map code: http://msug.vn.ua/content/d3js/examples/tree/ You'll find it under tree.js.
If you have any questions about that code or the tutorial, comment below and I'll try to answer it.
Upvotes: 3