Comments (6)
Just as a comment: this compactification really should be an optional feature!
I would really dislike graphs like the one from graphviz because it tends to obfuscate the hierarchy.
I see that in this case it is an improvement, but this does not reflect my typical usecase...
from grandalf.
First reason for getting a wider graph is that grandalf will put in top layer all nodes with no incoming edge. In this case, it thus naturally pushes to the right all nodes connected to the top green node that graphviz managed to put on the 4th layer (thanks to a re-ranking that tries to minimize total edge length).
I did not include such feature in grandalf because I find it more clear to have all "entrypoints" at the top layer but this feature can lead indeed to better layouts. it could be added as an option soon (once I'd have merged another layout that required a simplex method which is what is needed for this feature also).
However it does not fully explain why grandalf leads sometimes to 'wider than expected' layouts.
I believe that this is also due to the strategy of taking the mean of the 2 medians out of the 4 positions computed for each nodes (see setxy method). I need to double check this because I have already suspected it to be the cause of strange results.
Still, one "nice" effect of this is that it tends also to group nodes that are highly connected and separate those groups which, as noted by Sjoerd, can also clarify the hierarchy.
I will investigate further.
Meanwhile, you might want to test drawing without the 'median x' result by taking as x-coord for each node v the value self.grx[v].x[0] for example (or x[1], x[2], x[3] as well to see the differences) where self is your SugiyamaLayout instance, and/or increase the self.yspace to adjust the aspect-ratio.
from grandalf.
Hi, thanks for the suggestions, still, I haven't been able to make it much better... I can make it a little less wider by making the spacing smaller (but that's still too wide). In general, for my use-case (which is seeing profile results), the result I get is almost always too wide.
Also, for my use-cases, related nodes usually tend to be horizontally far away from one another... (you can see connections from 5-7 columns apart when I'd expect them to be closer -- maybe this would be solvable by the re-ranking you mentioned to minimize the total edge length).
I'd really appreciate if there was an option to improve on those situations.
from grandalf.
I'm finding that most of my layouts don't appear very well without the simplex step to minimize the edge len... do you have any idea when/if you'll be able to add that feature?
from grandalf.
I've added a simple rank optimize. Its not used by default, so you need to call sug.init_all(optimize=True).
The result after draw(N=4) is given below. For now, it's mostly a workaround but I hope it's ok until the simplex is commited (with the release of another layout class that still needs testings so not soon...hopefully in feb/march 2015).
from grandalf.
I just tested it and while there are still things to improve (which the simplex should help fixing) it's definitely a good improvement already :)
Thank you very much!
from grandalf.
Related Issues (19)
- SugiyamaLayout is sensitive to initial Vertex ordering HOT 1
- ImportError: No module named linalg HOT 2
- add `grandalf` to PyPI HOT 2
- Format code to obey pep8
- Drawing to a file? HOT 3
- Please add a simple copy and past sample on the front page
- Release a new version HOT 4
- Point interpolation by splines is badly parametrized
- Please push tests into your source distribution
- Render graph from draw HOT 2
- Deprecation warning due to invalid escape sequences
- Orthogonal Layout
- No source tarball for 0.7 on the PyPI.org site HOT 10
- Drawing graph left to right (horizontally) rather vertically (top to bottom) HOT 3
- Videos in Wiki are Private HOT 1
- AttributeError in Tarjan algorithm HOT 1
- Sugiyama layout fails with custom ranking HOT 2
- python interpreter recursion limit can't be adjusted HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grandalf.