GraphRecipes.jl icon indicating copy to clipboard operation
GraphRecipes.jl copied to clipboard

Ability to set nodesize independent of `name`

Open oxinabox opened this issue 5 years ago • 4 comments

I generally want my nodes to have there size not determined by the length of the name. Either i want to use the size to indicate some property of the node, or I want to have everything the same size, even if the name is very short on some, and long on others (so my plots to look regular)

oxinabox avatar Jul 01 '20 18:07 oxinabox

So if you have one long name, then should all of the nodes increase in size, or is your preference to just let the names not fit in the nodes?

The function that calculates the nodesize based on the length of the name is quite approximate, so I can see how it might not work very well for you all of the time.

Maybe we could have an option that tells graphplot to not scale the node sizes based on the length of the names?

JackDevine avatar Jul 02 '20 08:07 JackDevine

So if you have one long name, then should all of the nodes increase in size, or is your preference to just let the names not fit in the nodes?

Just let it overflow.

Maybe we could have an option that tells graphplot to not scale the node sizes based on the length of the names?

Something like that.

Could look at what Tikz does here. I know it has several settings for size and can do both i think

oxinabox avatar Jul 02 '20 19:07 oxinabox

I am suffering from the same issue.

In my humble opinion, I think that sizes should not be adaptive to the length of names by default and have an option that tells graphplot to not scale adaptively.

I observe that adaptive scaling is needed only in some kinds of graphical usage like plotting some diagrams, or mind map, for example in AST example in the galleries. In this kind of usage, the size of node are usually not going to convey anything. And there are many alternative way to do such plotting.

But when doing data analysis on graph, the size of nodes are meaningful. Names are often only labels and do not indicate any properties of nodes. Moreover fine tuning of graph is needed in this case. Making the sizes nodes independent of names will make more convenient to do that.

In fact, I have a different opinions with @oxinabox and I think that when long names appears, nodes should cover the texts but not overflow, which will give a better appearance.

ChasingZenith avatar Dec 12 '20 04:12 ChasingZenith

I dealt with this by padding the names with spaces to make them all have the same length.

lienkaemper avatar Apr 25 '22 18:04 lienkaemper