Nodes are gathered in straight horizontal line, not human read friendly
Hello, I love the project idea. I have wasted hours before to create a knowledge graph myself with obsidian to understand parts of kernel code. I have tried generating the graph with codex before too but I've always had the same issue as here:
you can see that nodes in straight line and paths are overlapping, making it unreadable.
I am using Codex, and trying to generate a graph for https://github.com/gormanm/mmtests
I see. Do you think if we make those not active parts folded would help?
Not sure, I didn't look carefully yet. But I honestly came here hoping someone did it for me, because as I said I could generate graph for obsidian canvas through codex too, and I used to get the same results.
There should be some algorithms to reach minimal number of path crosses (to reach minimum number of edge crosses in graph data structure). The lower the number of path crosses, the more readable the graph would be.
I will have a look later.
Intesesting, I'll research on this. Thanks!
I tried the skill for the first time yesterday, on a huge codebase, and got the same hierarchical structure graph. For a large number of nodes it is probably less appropriate. After noting this to Claude it added two new graph display modes: force and radar, which are more useful and pleasing IMO. If you like I can probably add a PR with that change (I have to review it a bit first, didn't have time to do that yet).
Scattering nodes is better, but would be best if we could ensure that highest readability can be achieved. Maybe through hierarchical positioning.
Here are some function call trees I have created before. I don't say they are optimal, but idea is hierarchical might be better for codebases from top to bottom or left to right since in code as well, functions don't call other functions in higher level than them due to layer programming.
Hi @yanivby and @bsuvonov, thanks to both of you for the feedback and the great discussion!
@yanivby, I completely agree that standard hierarchical graphs can get cluttered on huge codebases with a massive number of nodes. However, regarding the force and radar display modes, I've actually found that radar types can be quite hard for a human to read and follow. Before I implemented the Understand-Anything project, I tried using some GraphRAG approaches to index the codebase; they also relied on radar-style graphs, and I found it took a bit too much time to track the paths effectively. Still, I really appreciate you taking the time to suggest it and offering a PR!
@bsuvonov, your visual examples are incredibly helpful, and I actually prefer this approach. A top-to-bottom or left-to-right hierarchical structure makes a lot of sense for visualizing code. As you pointed out, it aligns perfectly with the nature of layered programming—since lower-level functions don't typically call higher-level ones, it makes the overall flow much easier to visually digest.
Thanks again to both of you for sharing your insights!
openclaw/understand-anything/understand-anything-plugin/skills where is the files ?
how to get start this project ? i want to use it
@bsuvonov I was facing a similar issue, and after some brainstorming and tweaking managed to get a hierarchical render using dagre graphs itself. I realized we already have layers like "Service layer", "DB layer", "API layer" already created, so we can hierarchically organize the graph and make it clickable. It also shows connections across layers.
This is what it looks like (this is for a project with 200+ nodes):
Short gif of what the flow looks like with hierarchical graphs.
I essentially made it a two-layer navigation model - with breadcrumbs to tell you how much you navigated. I've also changed some of the UI elements in the sidebar. I have pushed changes in this PR if you folks wanna try it out. It works with existing graphs, too would love to hear your thoughts!