-
Notifications
You must be signed in to change notification settings - Fork 29
Iongraph article #203
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
Iongraph article #203
Conversation
|
(Ben has asked that this not get merged until after he gets back) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very exciting.
One broad suggestion I'd give is: Perhaps indicate in some way which are -interactive- diagrams, and which are -not-.
_posts/2025-10-28-iongraph-web.md
Outdated
| }); | ||
| </script> | ||
|
|
||
| We are not the first to visualize our compiler's internal graphs, of course, nor the first to make them interactive. But we were not satisfied with the output of common tools like [Graphviz](https://graphviz.org/) or [Mermaid](https://mermaid.js.org/), so we decided to create our own layout algorithm specifically tailored to our needs. The resulting algorithm is simple, fast, produces surprisingly high-quality output, and can be implemented in less than a thousand lines of code. The purpose of this article is to walk you through this algorithm and the design concepts behind it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you're using the 'royal-we'... but this is all you! IMO it's OK to take credit here that you were the one who did all this work who built this, who created a new algorithm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll think about it, but in this quasi-academic context it feels weird to use the first person.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very excited for this to go up.
|
|
||
| It is important to note that dummy nodes participate fully in this system. If for example you have two side-by-side loops, straightening the left loop's backedge will push the right loop to the side, avoiding overlaps and preserving the graph's visual structure. | ||
|
|
||
| We do not reach a fixed point with this strategy, nor do we attempt to. I find that if you continue to repeatedly apply these particular layout passes, nodes will wander to the right forever. Instead, the layout passes are hand-tuned to produce decent-looking results for most of the graphs we look at on a regular basis. That said, this could certainly be improved, especially for larger graphs which do benefit from more iterations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: fixed-point (slight preference)
You'll definitely want to squash the commits on this one :)