score:0
You could do a recursive tree traversal and render the nodes step by step. This means also that your data has to be linked or you will be searching childs over and over in your dataset which is inperformant if the amount of nodes increases.
I've written a tree traversal which i used for process several tree structures in order to render the (in our case from bottom up - but traversal can be used in both sides). Unfortunately it's written in c# and i'm not in Office right now so i can't post the renderer. If you're interested i can outline the principal the renderer works.
score:0
I guess what you need is to draw a general graph (not tree structure), but don't know how to layout the nodes and edges so that they don't look like a total mess.
There are some graph layout algorithms out there. The basic idea is to treat the nodes as objects that repel each other (like in physics), so that the graph is expanded to the largest extent possbile.
I found this SO question relevant: Graph auto-layout algorithm
And if you want to dig deeper, here is some research papers on the subject: https://graphics.stanford.edu/wikis/cs448b-12-fall/Graph_Layout_and_Network_Analysis
Hope this helps!
Source: stackoverflow.com
Related Query
- How do I visualize a relationship without a parent/child data structure?
- how to encode this data to parent / children structure in JSON
- How to expand child from JSON, load data after click parent - D3.Js - force directed layout
- How to generate parent child relation data from networkx to work with d3.js?
- How to get data of parent node in d3.js
- d3js: make new parent data descend into child nodes
- How do I create a tree layout using JSON data in d3.v4 - without stratify()
- How to pull data from mysql database and visualize with D3.JS?
- d3.js: Passing data from parent to child nodes
- How can I connect two parent node into one child node and how to make a tooltip for each node in the tree pragmatically? in D3 js (SVG)
- How to visualize mysql data in d3js using django?
- d3.js: Passing data from parent node to child node onclick event
- How to get SVG path data of TopoJSON feature without adding it to the DOM?
- how to visualize data from mysql database in force layout of d3 tool
- Stratify flat data without directly specifying parent
- How to add data to selectAll placeholder whose data is in a parent's parent object?
- How would I be able to convert table structured data to a dict/graph structure in python/pandas, to be used for force graphs in D3?
- How to reshaping Data in Javascript from array to object without losing some of the data
- How to pass subselection of data to child node?
- How to append path from data inside nested structure in d3.js?
- How to update a single data point in d3 without touching other elements?
- d3.js: how to use data from the parent node? (to show the grouped bar name at the individual bar tooltip)
- How can I use crossfilter to filter graph data and visualize them on a force directed graph?
- How can I group data to be filtered without losing crossfilter functionality using dc.js?
- Create D3-friendly JSON out of Parent Child table of data
- How do I structure the Data array for the following d3 chart, in order to populate with real data
- How do I update this data without redrawing datapoints that are already there?
- How to visualize JSON data as tree diagrams using D3.js?
- How can I prepend data to a D3 stacked area graph without weird animation glitches?
- How to update data elements within a transition without deleting a re-creating everything?
More Query from same tag
- Show all dates between starting date and ending date on the x-axis
- Adding clickable links or onClick handler in a D3 force directed diagram?
- how to reference d3js object on hover and click
- D3.js - How to map continuous domains to discrete ranges with scales?
- d3.js : attribute setting not working after binding data and entering elements
- how can I make the shape of a medition using d3.js?
- D3 dashboard chart data bind from json or csv
- Uncaught TypeError: d3.arc(...).outerRadius(...).innerRadius(...).text is not a function
- Import a iPython Custom Widget Function (File Structure?)
- d3 node labeling: how to display JSON data formatted with HTML?
- D3.js - Making legend use descriptive strings for legend instead of data values
- How to create a common area between elements in d3.js?
- Javascript / D3 --- Conditional Format for Label
- Set origin on d3 graph
- Search into a node ID in D3
- Create hashtable/dictionary from csv data
- Find distance of drag in D3
- on hover increase node radius
- D3.js patterns for managing multiple elements bound to same data
- How to set count to zero for missing keys in D3 nest()
- Initial "jumpy" dragging behavior
- d3.js Bar chart supporting negative values
- Line Generator not working
- Filter a DC.js table with a link?
- Add constant horizontal line
- How to set domain by word length for bar graph?
- require "d3-select-multi" as node module not working
- d3 - how to format xAxis ticks depending on weeks
- curved text around D3.js pie chart
- Parsing a dataset of time in the format "Y-M-D H:M:S.MS" gives me 0NaN-NaN-NaNTNaN:NaN:NaN.NaNZ