How to force edge ports to be different

Hi all,

I am writing a utility to take the output from a freeware profiler (Sleepy) and to convert it to input for dot, so I can get a visual comparison of runs of my program.

On the whole it seems to be working, but I have a list of things I'd like to be able to do that I can't immediately see how. I've googled around and read the FAQ and couldn't see answers to these, but please bear with me if there is something I've missed.

Firstly, and most importantly, is it possible to tell dot that the ports used for each edge on a node should be distinct? Currently the same port gets used for several edges, and that makes it hard to read - the head/tail labels overlap, but even without this it's a pain.

Ideally I'd like the code to distribute the ports used evenly around the edge of the nodes (ovals currently, but I'm not wedded to this). I don't care which edge goes to which port, but they should be distinct for readability.

Other things I'd like to be able to do, and can't see how (but which are less important):

2) I'd like to be able to vary the width of the edges; currently I'm using dotted/dashed/solid lines, but being able to specify a width would be nicer.

3) Could head and tail labels be (optionally) written 'along' the edge as it joins the nodes rather than 'across' it? That, coupled with them using separate ports would vastly improve readability.

Thanks, and congratulations on what's already an excellent tool!

Robin

[graphviz-interest] How to force edge ports to be different

On Mar 18, 2011, at 21:04, [email protected] wrote:

> Hi all, I am writing a utility to take the output from a freeware profiler
> (Sleepy) and to convert it to input for dot, so I can get a visual comparison
> of runs of my program. On the whole it seems to be working, but I have a list
> of things I'd like to be able to do that I can't immediately see how. I've
> googled around and read the FAQ and couldn't see answers to these, but please
> bear with me if there is something I've missed. Firstly, and most
> importantly, is it possible to tell dot that the ports used for each edge on
> a node should be distinct? Currently the same port gets used for several
> edges, and that makes it hard to read - the head/tail labels overlap, but
> even without this it's a pain. Ideally I'd like the code to distribute the
> ports used evenly around the edge of the nodes (ovals currently, but I'm not
> wedded to this). I don't care which edge goes to which port, but they should
> be distinct for readability.

I don't think this is currently possible.

> Other things I'd like to be able to do, and
> can't see how (but which are less important): 2) I'd like to be able to vary
> the width of the edges; currently I'm using dotted/dashed/solid lines, but
> being able to specify a width would be nicer.

This is easy: it's the penwidth edge attribute.

http://www.graphviz.org/content/attrs#dpenwidth

> 3) Could head and tail labels
> be (optionally) written 'along' the edge as it joins the nodes rather than
> 'across' it? That, coupled with them using separate ports would vastly
> improve readability.

That specifically isn't possible. You can play with labelangle and labeldistance but possibly once you've adjusted those to make one edge look nice, it'll make another edge that looked nice before look not so nice anymore.

http://www.graphviz.org/content/attrs#dlabelangle

_______________________________________________
[email protected]
https://mailman.research.att.com/mailman/listinfo/graphviz-interest

[graphviz-interest] How to force edge ports to be different

On 3/19/11 7:56 AM, Ryan Schmidt wrote:
> On Mar 18, 2011, at 21:04,[email protected] wrote:
>
>> > Hi all, I am writing a utility to take the output from a freeware profiler
>> > (Sleepy) and to convert it to input for dot, so I can get a visual comparison
>> > of runs of my program. On the whole it seems to be working, but I have a list
>> > of things I'd like to be able to do that I can't immediately see how. I've
>> > googled around and read the FAQ and couldn't see answers to these, but please
>> > bear with me if there is something I've missed. Firstly, and most
>> > importantly, is it possible to tell dot that the ports used for each edge on
>> > a node should be distinct? Currently the same port gets used for several
>> > edges, and that makes it hard to read - the head/tail labels overlap, but
>> > even without this it's a pain. Ideally I'd like the code to distribute the
>> > ports used evenly around the edge of the nodes (ovals currently, but I'm not
>> > wedded to this). I don't care which edge goes to which port, but they should
>> > be distinct for readability.
> I don't think this is currently possible.
>
This feature has been requested occasionally. I'm not sure how to
implement it, but it
probably would require a fair amount of bookkeeping.

For fine tuning, you can employ compass point ports to some separation.

Emden

_______________________________________________
[email protected]
https://mailman.research.att.com/mailman/listinfo/graphviz-interest

[graphviz-interest] How to force edge ports to be different

Thanks to Ryan and Emden for their replies.
The penwidth attribute does indeed help me out.
The ability to force all ports to be different would be a good one, I feel, but I can't immediately give you a smart algorithm to do it. I cannot assign port values within my dot generating code (at least, not with any reasonable expectation of correctness), as the layout is completely unknown to me.
Thanks,
Robin
 

Recent comments