WouterSpekkink / gephi-plugins

Repository for Gephi Plugins maintained by the team. Each plugin has it's branch.
4 stars 2 forks source link

Alignment of unconnected components #9

Closed BazilSansom closed 3 years ago

BazilSansom commented 3 years ago

Currently we put lowest trophic level at zero, so when we plot unconnected components, lowest nodes are aligned. Alternative approaches include: setting average node height to zero; or putting mid-point between lowest and highest node at zero. We should either consider choice of how we align components, or include options on this. There is an argument to be made that since the method allows source and sink nodes to float, it would make sense to centre components rather than bottom or top nodes. On the other hand the best approach will undoubtedly depend on the application/use case - an argument for optionality!

h=h-min(h) h=h-mean(h) h=h-(1/2)*(min(h)+max(h))

Choice of centering illustrated by following examples:

centering

WouterSpekkink commented 3 years ago

Ok, this makes sense. It should definitely be a matter of choice, because I can imagine that trophic levels are easier to interpret if there is an absolute zero point. But making 0 the average also makes a lot of sense, I guess, in some situations.

WouterSpekkink commented 3 years ago

I added an option to the starting panel. It is a checkbox that allows you to set the average trophic level to 0, which will centralize the components. Probably this needs a better explanation on the panel, but it works. Checking the box will set a boolean in the plugin that will run after the regular operations to recalculate the h-values according to your example. Just tested it and everything seems to work fine.