Specify compass point port with cgraph


I'd like to know how can I specify compass point ports using the cgraph library.

My desired dot graph:

digraph MyGraph {
A:nw -> B:se

The C code I currently have:

Aggraph_t *g = agopen("MyGraph", Agdirected, NULL);
Agnode_t *a = agnode(g, "A", TRUE);
Agnode_t *b = agnode(g, "B", TRUE);
Agedge_t *e = agedge(g, a, b, NULL, TRUE);

Should be done at "low level" or can it be done with the cgraph API?


Ports in the Dot language are

Ports in the Dot language are just syntactic sugar for setting the headport and tailport attributes of an edge. Thus, to get

A:nw -> B:se

once you've created the edge e using agedge, you would just add the lines


or something comparable.

Exactly what I was looking

Exactly what I was looking for.


Recent comments