jonascarpay / calligraphy

haskell source code visualizer
BSD 3-Clause "New" or "Revised" License
97 stars 13 forks source link

Let users select nodes to exclude from the generated graph #39

Open glocq opened 4 days ago

glocq commented 4 days ago

As far as I know, there is no option that would allow me to selectively exclude nodes, i.e. display all nodes but those I manually excluded. Am I right? If so, could such an option be added?

My use case: I am trying to make sense of a messy module. The module features a couple of utility functions used a lot, which clutter the graph with arrows that come from everywhere, and whose role I understand well anyway.

Using --exports-only would hide those, but also a number of functions which are not exported, but are still part of the meat of the module, i.e. they are more than just utility functions and I need Calligraphy's help to understand their exact role.

jonascarpay commented 4 days ago

This is currently not supported, but adding a name-based filter to the NodeFilter phase should only take a few lines. PR's welcome.

As a potentially better solution I'm imagining changing the dependency filtering to have rsync-style chained forward/backward include/exclude rules, but that would be a much more significant change.

glocq commented 3 days ago

Ok, thank you for pointing me to the relevant lines, I'll look into it when I have some time.

I am not familiar with rsync, so I don't understand what you have in mind for the more significant change, though I understand the benefits that a more flexible system would bring.