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

implement our own tree layout to avoid graphviz #1

Open
amueller opened this issue Sep 26, 2018 · 5 comments
Open

implement our own tree layout to avoid graphviz #1

amueller opened this issue Sep 26, 2018 · 5 comments
Labels
enhancement New feature or request

Comments

@amueller
Copy link

This might be relevant to your interests possibly:
scikit-learn/scikit-learn#9251

btw, animl is impossible to google ;)

@parrt
Copy link
Owner

parrt commented Sep 26, 2018

oh great! Yeah, the tree layout is much better. will take a look. yeah, animl is cool name, shitty search keyword :(

@amueller
Copy link
Author

amueller commented Sep 27, 2018 via email

@parrt
Copy link
Owner

parrt commented Sep 28, 2018

For my ANTLR work, I did my own tree layout (errr...donated cash to a smart German guy to do it) but it works very well; must be same algorithm. See treelayout

Oh right. It uses Walker’s algorithm with enhancements suggested by Buchheim, Jünger, and Leipert. This layout is not limited to binary trees.

Walker JQ II. A node-positioning algorithm for general trees. Software—Practice and Experience 1990; 20(7):685–705.

Buchheim C, Jünger M, Leipert S. Drawing rooted trees in linear time. Software—Practice and Experience 2006; 36(6):651–665

@parrt parrt added the enhancement New feature or request label Sep 28, 2018
@parrt parrt changed the title tree plotting implement our own tree layout to avoid graphviz Sep 28, 2018
@parrt
Copy link
Owner

parrt commented Sep 29, 2018

Seems like @amueller's tree layout impl might be the answer to avoid DOT/graphviz altogether. I'll have to do my own node sizing based up importing SVG manually, but seems workable.

@parrt
Copy link
Owner

parrt commented Sep 29, 2018

The other approach is to use dot to compute the layout but generate our own SVG for the arrows (easy). To avoid graphviz trying to load svg (the problem we're trying to solve), we can fake it by describing a node with same viewbox as SVG file and just get the layout from graphviz, then generate our own SVG with embedded SVG nodes generated from matplotlib.

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

No branches or pull requests

2 participants