Graphviz: Node internal orientation

时光总嘲笑我的痴心妄想 提交于 2019-12-08 07:09:11

问题


The following graphviz code:

digraph g {

labelloc="t";
label="Feed creation process";

graph [
rankdir = "LR"
];
node [
fontsize = "16"
shape = "record"
];
edge [];


abc [shape=none, margin=0, rankdir=""
label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
<TR><TD ROWSPAN="3"><FONT COLOR="red">hello</FONT><BR/>world</TD>
<TD COLSPAN="3">b</TD>
<TD ROWSPAN="3" BGCOLOR="lightgrey">g</TD>
<TD ROWSPAN="3">h</TD>
</TR>
<TR><TD>c</TD>
<TD PORT="here">d</TD>
<TD>e</TD>
</TR>
<TR><TD COLSPAN="3">f</TD>
</TR>
</TABLE>>];
}

Gives:

I'd like to rotate the table orientation 90° clockwise, so that the rows will be:

  • hello world will be on top
  • f, 'c|d|eandbon the row below, 'c|d|e aligned vertically
  • g
  • h

For example (with the text wrongly oriented!):

Is there a way to rotate the node internals without affecting the order of the nodes in the graph?


回答1:


I've played with the HTML COLSPAN and ROWSPAN and got:

abc2 [shape=none, margin=0, orientation=120.0,
label=
    <
    <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
       <TR>
          <TD COLSPAN="3"><FONT COLOR="red">HELLO</FONT><BR/>world</TD>
       </TR>
       <TR>
          <TD ROWSPAN="3">b</TD>
          <TD>c</TD>
          <TD ROWSPAN="3">f</TD>
        </TR>
        <TR>
          <TD PORT="here">d</TD>
        </TR>
        <TR>
          <TD>e</TD>
       </TR>
       <TR>
          <TD COLSPAN="3" BGCOLOR="lightgrey">g</TD>
       </TR>
       <TR>
          <TD COLSPAN="3">h</TD>
       </TR>

    </TABLE>
    >
];



来源:https://stackoverflow.com/questions/16062673/graphviz-node-internal-orientation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!