I am looking to draw binary tree and want it to maintain the node position. When the tree is mostly full (that is all (actually almost) non-leaf nodes have 2 children. So using HTML node type seems to get the best visual. Unfortunately, when adding an edge between the nodes, the edge goes out of the table loops around and comes back to the the head node instead of following the shortest straight route.
splines=false
or constraint=false
doesn’t help. adding weight doesn’t help
digraph {
splines=false
tree [shape=plaintext class="fizzbee binarytree" label=<<table cellspacing="16" cellpadding="0" border="0" cellborder="0">
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td port="0">0</td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td port="1">1</td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td>2</td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td>3</td><td> </td><td> </td><td> </td><td>4</td><td> </td><td> </td><td> </td><td>5</td><td> </td><td> </td><td> </td><td>6</td><td> </td></tr>
<tr><td>7</td><td> </td><td>8</td><td> </td><td>9</td><td> </td><td>10</td><td> </td><td> 11</td><td> </td><td>12</td><td> </td><td>13</td><td> </td><td>14</td></tr>
</table>>]
tree:0:sw -> tree:1:ne [constraint="false" class="fizzbee binarytree edge" weight="100" ]
}
Is there a way to force the a straight line between these two cells? Although I could write a javascript code to do that, I want to avoid and would prefer a native way of doing this.