record nodes and rankdir in graphviz

前端 未结 2 2319
情深已故
情深已故 2021-02-20 01:32

When I changed the rankdir of my graph from LR to TD, my record nodes also changed their layout direction so they no longer look like a \'record\'. I tried applying a separate r

相关标签:
2条回答
  • 2021-02-20 01:55

    You can use html table like labels instead of records. IIRC the table based labels do not rotate with the rank direction. See http://www.graphviz.org/doc/info/shapes.html#html

    0 讨论(0)
  • 2021-02-20 02:08

    Taking into account that rankdir effectively replaces the notion of "top" and "bottom" for the given graph, that's not surprising.

    I am afraid that there is no easy remedy for this, save hacking the source (and that would not be easy at all). You can surround your labels in "{}" with some kind of mass search-replace solution to get the requested effect:

    digraph sample { graph [rankdir=TD]; node [shape=record];
    
    A [label="{ShouldBeTop | ShouldBeBottom}"]; 
    B [label="{Top | Bottom}"]; A -> B; 
    }
    
    0 讨论(0)
提交回复
热议问题