Skip to content
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

Compatibility with directed Graphs.jl #23

Open
filchristou opened this issue Apr 13, 2022 · 2 comments
Open

Compatibility with directed Graphs.jl #23

filchristou opened this issue Apr 13, 2022 · 2 comments

Comments

@filchristou
Copy link

Is there any reason why this wouldn't play with DiGraphs ?
If you are interested I can push a branch with a constructor D3Tree(::DiGraph)
I will actually just transform the Graph in an AbstractTree implementation, where the directed edges lead to children.
Maybe some constraints need to apply (e.g. only graphs that can be transformed to trees).
I don't know what would happen to the library if there was to be cyclic graphs and multiple parents per node.
I am not familiar with the original javascript library.

@zsunberg
Copy link
Member

I think this is a good idea - the only issue is that you somehow need to specify a root node. Perhaps it would make more sense to create a DiGraphTreeView or something that stores a DiGraph and a root node and then call D3Tree(::DiGraphTreeView)?

Also, what information would you display at each node?

@zsunberg
Copy link
Member

Maybe some constraints need to apply (e.g. only graphs that can be transformed to trees).

I think this does not need to be the case necessarily since D3Trees only displays some nodes at first - you can expand the d3 "tree" infinitely if it actually is a graph with cycles (i.e. not strictly a tree). On the other hand, it may be somewhat confusing for users if the same node is displayed in different places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants