You could try it write it yourself. Would be a two step process:
- First you have to fetch the data from the database into a appropriate data-structure.
- Second you have to visualize it
Fetch data
An first approach would be to start with a given account C upstream querying for parents. Querying one level at a time is usually trivial. You could repeat it by recursion or loops. Your final-upstream leafs are reached when there are no further parents left. Downstream you do the same but for children.
But this is not all. You want the network (or graph), and now you have it:
- A serious challenge are loops (cyclic relations). I would recommend that you disallow them by definition and validation. If you need them, you need to detect them and prevent endless loops or recursions.
- Networks starting at different nodes. In your example E could have other parents than C. I would recommend to start keeping this out-of-scope for version 1.
- The kind of data-structure you choose as target is highly dependent on your rendering solution. If you pick a JS-renderer (what you will most likely do) one possibility could be to avoid creating structures in apex but start to create only a string of JavaScript commands to be output on a page.
Rendering
Depending on having cycles banned or not, rendering can be a challenge.
A very short research brought something up - at least one with a funny name http://www.graphdracula.net/ :-) and it really looks promising. On the page there are also links to similar JS projects.
Now if you look at the example code, you also see what you basically need for this lib: edges and nodes. Try to fetch them from the database.