That’s cool! I don’t have any feedback but I’m constantly neglecting my side project so props for actually building something.
programming
-
Post about programming, interesting repos, learning to program, etc. Let's try to keep free software posts in the c/libre comm unless the post is about the programming/is to the repo.
-
Do not doxx yourself by posting a repo that is yours and in any way leads to your personally identifying information. Use reports if necessary to alert mods to a potential doxxing.
-
Be kind, keep struggle sessions focused on the topic of programming.
This would have been more neglected if I didn't find a use for it at work and was able to get some time to work on it there.
Turns out management likes when things are presented in a pretty format like this
If you want to try it out for yourself, just make sure you have Python 3.10+ installed and rustworkx (I'm probably gonna update it to allow networkx or no graph library backend at some point).
The dev directory has a testing script that you can use, I have a branch I'm working on now that makes it simpler and will probably set it up so it can be run from the command line with some flags/config files.
I've pointed it at a lot of bigger projects and it hasn't taken more than 2 seconds, even for something like curl and cpython. The client side rendering in visjs is essentially dead once you cross ~600 nodes though, so I'll probably have to start pre-computing node positions instead of just letting them all start at the origin.
Would love to get some feedback on it though!
Also any contributions are welcome, just open a PR. Only rule I have is that everything has to be fully typed since it's a new project and I prefer to have typing implemented early instead of relying on discovering types later lol.
Oh I've been working on something like this, but it's a frontend/vs code extension to visualize dependency graphs of a project (it shows dependencies between files and function/classes/etc). It also includes features to filter nodes, cluster nodes, change graph layouts. It's done with typescript, svelte, d3.js and graphviz compiled to wasm
This project would probably be compatible, since the js portion is just written by a jinja template. Python is just used to build the actual graph data and format it for visjs.
The data attribute is just a dictionary though, so you could really initialize it with anything. I just wrote the schema for visjs.
Curious about the performance of d3 vs vis. I will probably end up doing some rudimentary physics calculation before I write the graph, bit being able to avoid that would be nice.
Actually when I started doing the visualizer I started making it with visjs, but the graphs were getting very messy (since I have nodes for functions / classes and edges between them) and not very informative. So decided to change to graphviz + d3 to have better control over the layout and I was much happier with the result. I also only wrote the interface for the d3 visualizer and let Claude implement it (I hadn't use d3 before), and only needed to do some small fixes.
With a lot of nodes / edges, visjs physics was also taking quite a bit until stabilising the force layout, and i had to turn physics off after because the jittering was annoying
I might end up doing that, or just disabling physics when I need to, but still use visjs.
I just had to make a PR today because the node system wont properly resolve size when using icon shapes lol.
I might need with ast stuff tomorrow and see if I can try and get a rudimentary version of what you have working with pygraph. I'd probably have it generate multiple graphs from a view (e.g. module -> class, then click a class to get class -> function, or use hidden edges for some things and put everything in different style groups based on inheritance?).
Would also be cool to keep the GitHub links in place, but instead tie the link with the symbol line number so you get a permalink
ast stuff tomorrow and see if I can try and get a rudimentary version of what you have working with pygraph.
For mine I wrote a python script walking through the ast of a python project to generate the graph, so that I had a graph on hand I could use to build and test the visualizer.
Last time I worked on it I started implementing the package for the vscode extension and wrote some typescript code to build a graph for typescript/javascript files. It is still very barebones but I managed to get the basic extension set up working. Haven't worked on it in a while though.
If you want I can dm you the git repo and the .io with the frontend
I'm down, I already dm'd you about some changes I made