yav/graphmod

Odd behavior for collapsing

Closed this issue · 4 comments

pacak commented

Given following modules

module C where

module A.A1 where
import B

module A.A2 where
import C

module B where

module A where
import A.A1
import A.A2

module D
import A

we get a nice looking structure:
1

When running with -C A this produces following - modules B and C seems unconnected.

2

But what I'd like to see is something like this instead.

3

yav commented

Hi, I think I've fixed this. Would you mind trying it out (from the github repo) on your example, and let me know if it seems to work as expected.

pacak commented

1

Much better. Does it makes sense to add some decoration that A is collapsed node? Like make it a double circle or something? Or a box?

yav commented

Collapsed nodes are colored using the background color of the cluster that got collapsed---notice that A is gray. The shape of the collapsed node is round If there is a module with the same name as the cluster (e.g., in this example there is both a module A and a directory A). If you drew the graph so that only the directory is collapsed, but not the module, then the collapsed node should look like a rectangle (e.g., try it with --no-module-in-cluster --collapse=A).

I am open to changing the styles if you have suggestions for improvements.

pacak commented

I see. In this case it's good enough, I'll make a new issue if I come up with a better way of representing it.