Hello. I’m building a tool whose goal is to analyze a crate, and display in a graphic fashion information about it’s internal. At the moment it’s mostly the callgraph (both direct call and through function pointer / Fn traits), as well as displaying the places where a function pointer (or similar) is created. My prototype is working well. I’m using graphviz to generate the graph but this is very impractical, because I want to interactively display a very small subset of the whole graph (let say 10-30 functions and their relations among the 50k+ functions and relation of a crate). Let me give you a mock-up:
Note: the black dotted box and the big black circles are just construction traits, they shouldn’t appear in the real rendering.
- I want to be able to move (using a mouse/keyboard/trackpad) the boxes. It should make the text inside, as well as the end of the arrows move together.
- The arrow (both solid or dotted) outside of the boxes should never cross another box, and minimize superposition between themselves (ideally they should cross at 90°) for maximum readability.
- I want to be able to add an remove the set of visible functions (and this means recomputing the optimal path for the arrows).
- I need to be able to display text with colors, and access it’s exact coordinates of the substrings to create the arrows (where they start / finish / merge) as well as the collision boxes for the functions.
I’m looking for crates that could help me generates such drawing, especially for the interactive part, and the routing / collision detection of the arrows.
Given that I have never programmed any GUI or 2D graphics, I think that "obvious" things are not necessarily obvious for me . I want to be able to everything in Rust. If possible, and if it doesn’t increase the complexity too much, I’d like to be able to use webassembly to have a pre-compiled binary that is easy too share, but that’s really not a hard requirement. I never used webassembly, nor have any previous experience with javascript.