Graphviz:仅对基于记录的节点中的字段着色 [英] Graphviz: Color only a field in a Record-based Node
问题描述
有没有一种方法可以将颜色仅添加到基于记录的节点中的字段中.像下面的示例一样,字段struct2:f0可以单独使用不同的颜色吗?
Is there a way to add color to only a field in a record-based node. Like in the following example, can the field struct2:f0 alone be in different color?
digraph structs {
node [shape=record];
struct1 [label="<f0> left|<f1> mid\ dle|<f2> right"];
struct2 [label="<f0> one|<f1> two"];
struct3 [label="hello\nworld |{ b |{c|<here> d|e}| f}| g | h"];
struct1:f1 -> struct2:f0;
struct1:f2 -> struct3:here;
}
Thx
推荐答案
我认为这不可能.
您可以考虑使用 类似HTML的标签 -您应该能够使用基于记录的节点以及更多功能来完成所有工作.
You may consider using HTML-like labels - you should be able to do everything you can do with record-based nodes, and more.
在上面链接的文档页面上:
From the above linked documentation page:
基于记录的形状在很大程度上已被取代,并且在很大程度上 由类似HTML的标签概括.也就是说,代替使用
shape=record
,可能会考虑使用shape=none
和类似HTML的格式 标签.
The record-based shape has largely been superseded and greatly generalized by HTML-like labels. That is, instead of using
shape=record
, one might consider usingshape=none
and an HTML-like label.
和
严格来说,尽管HTML标签不是形状,但它们可以是 被视为上述记录形状的概括.在 特别是,如果节点已将其shape属性设置为
none
或plaintext
,HTML标签将是节点的形状.
Although HTML labels are not, strictly speaking, a shape, they can be viewed as a generalization of the record shapes described above. In particular, if a node has set its shape attribute to
none
orplaintext
, the HTML label will be the node's shape.
这篇关于Graphviz:仅对基于记录的节点中的字段着色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!