2
我正在使用graphviz/dot來生成一個圖。級聯或繼承Graphviz中多個節點聲明的屬性
我想將圖中的節點和/或邊組合成語義類,每個類都有一組類似於CSS的級聯或繼承的節點和/或邊緣屬性。但是,如果將單個節點分組到多個類中,則後面的屬性聲明將覆蓋較早的屬性聲明,即使該屬性未在稍後的聲明中指定。特別是,它會將值恢復爲默認/更高範圍的值。
例如:
node [shape="hexagon", style="filled", fillcolor="lightskyblue1"];
{ node [shape="box"]; a; b; }
{ node [fillcolor="red"]; b; c; }
我想要什麼:
a [shape="box", style="filled", fillcolor="lightskyblue1"];
b [shape="box", style="filled", fillcolor="red"];
c [shape="hexagon", style="filled", fillcolor="red"];
我能得到什麼:
a [shape="box", style="filled", fillcolor="lightskyblue1"];
b [shape="hexagon", style="filled", fillcolor="red"];
c [shape="hexagon", style="filled", fillcolor="red"];
這可能嗎?