Port pos center

I would like an edge (arrow) to go from one table cell in a node (html style label) to another one in a different node. But I would like the line to start from the center of the cell (i.e. not on one of its edges.) Is that possible? nodeport Center doesn’t seem to do it.

You need headclip and/or tailclip in addition to nodename:portname:compasspoint

digraph top {
    node[shape=none]
    i [label=<<TABLE CELLSPACING="5" CELLPADDING="4" BORDER="0" CELLBORDER="1">
    <TR>
      <TD port="am">top of the morning</TD>
    </TR>  
    <TR>
      <TD port="cow">cattle crossing</TD>
    </TR>  
    <TR>
      <TD>d</TD>
    </TR>  
    </TABLE>> ]
    
  j [label=<<TABLE CELLSPACING="5" CELLPADDING="4" BORDER="0" CELLBORDER="1">
    <TR>
      <TD port="pm">afternoon</TD>
    </TR>  
    <TR>
      <TD>d</TD>
    </TR>  
    </TABLE>> ]

    p -> i:am:c [headclip=false]
    j:pm:c -> i:cow:c [headclip=false tailclip=false]
}

Giving:
htmlFont2

Thanks! Can you explain why it works?

Also I found that if I set a global property that headclip=false, then if there are any edges which don’t have :c in the head, something weird happens. I am not sure but I think I saw that.

Section 3.1 of https://www.graphviz.org/pdf/dotguide.pdf says

When an edge is not attached to a port, it is aimed at 
the node’s center and the edge is clipped at the 
node’s boundary.

And the headclip documentations says:

If true, the head of an edge is clipped to the boundary of the head node
Otherwise, the end of the edge goes to the center of the node, or the center of a port, if applicable.

And :c is the default.

My experience is that even if I say headclip=false, it is ineffective unless I also specify :c in the x:y:c notation when I create the edge. Maybe I misunderstood your point.

And this is very random but it also seems like when I have :c and headclip=false the edges more often are straight lines vs. splines.
xdiagsample5.pdf (21.0 KB)
diagsample5.pdf (21.1 KB)

If you think you have encountered a bug, please report it here: Issues · graphviz / graphviz · GitLab