-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is it possible to create a tree with nodes on either side #379
Comments
I believe the technique I’ve seen using straight d3.js is to render 2 trees with each root at the middle/overlapping. For example: http://bl.ocks.org/jdarling/2503502 You should be able to use 2 |
@techniq the 2 trees approach did not work for me because I need zooming and panning which was difficult to keep the trees together so I ended up with 1 tree: https://codesandbox.io/s/znj3ykqwj3 I ended up doing the calculations for the nodes in the
My animation is a bit wrong also. |
Hmm, I've not done this myself so I can't be of much more help right now. You might be able get away using a Polar coordinate system and adjust the size and separation props. See: #162 (comment) for some experimentation with |
@aoloo Sorry I haven't had this use case myself thus far. When I'm looking for new examples / approaches I'll typically look at d3 observables and port to React / visx. This NCAA Bracket example might give you a start, I just quickly read through it but it does use d3.hierarchy / d3.tree: It appears to be well written and has some good notes. I think it's rendering 4 trees (for each quadrant) and blending them together as 1, but I didn't analyze it deeply. With hierarchies/trees, you need to have a single root node. You can sometimes work around this by creating a "pseudo" root that you hide visually. You could try that approach, but you'd have to create a tree left to right, as opposed to inside out (with the center being at the This layout might be better represented as a graph structure made of nodes and links, but I think searching for "bracket" helps to identify this type of layout. Sorry I can't be of more help. |
I am looking to create something like this:
I need a tree but with the nodes on either side. I've had create success with vxtree but that has one root node.
Is there a way I could spread them out like the diagram below?
The text was updated successfully, but these errors were encountered: