简体   繁体   English

使用多边形作为图标和文本 label 在 graphviz 中创建节点

[英]Create node in graphviz using polygon as icon and text label

Is there any way to create a node in Graphviz that looks like the below?有什么方法可以在 Graphviz 中创建一个如下所示的节点? (Placing a hexagon and text side by side inside the node instead of just placing text inside box) (将六边形和文本并排放置在节点内,而不是仅将文本放置在框内)

在此处输入图像描述

You can't easily embed nodes within other nodes, but you can insert images into nodes.您不能轻松地将节点嵌入到其他节点中,但您可以将图像插入到节点中。 Create an image (or images) with the polygon shape(s) and insert them into an HTML-style node (record-style would probably also work).创建具有多边形形状的图像(或图像)并将它们插入到 HTML 样式节点中(记录样式可能也可以工作)。
Like so:像这样:

digraph i{
 {rank=same
  n1 [shape=plaintext,label=<
  <TABLE CELLSPACING="0" CELLPADDING="0" BORDER="1" cellborder="0"> 
  <TR><TD FIXEDSIZE="true" height="20" width="20"><IMG  SRC="cow.png" scale="true"/></TD><TD>some text</TD></TR>
  </TABLE>
  >
  ]

  n2 [shape=plaintext,label=<
  <TABLE CELLSPACING="0" CELLPADDING="0" BORDER="1" cellborder="0" >
  <TR><TD colspan="2" bgcolor="green1">Step</TD></TR>
  <TR><TD FIXEDSIZE="true" height="20" width="20"><IMG  SRC="cow.png" scale="true"/></TD><TD>some text</TD></TR>
  </TABLE>
  >
  ]
  n1 -> n2
  }
} 

Giving:给予:
在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM