Is it possible to fill a subgraph of digraph dot with a colour? [answered]

Fist of all. Thanks for making graphviz. It is an amazing piece of software. Great!

I made Python package graphviz (0.4.10) on WinPython installation Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 20:20:57) [MSC v.1600 64 bit (AMD64)] on win32 generate the following dot gv which Graphviz 2.38 renders to a attached svg in which the subgraph does not get shown with its fill colour in batik 1.8 and Firefox 46.0.1. Is this not possible? [graphviz]digraph m_MAPPING1 { label = "m_MAPPING1 {M}" rankdir = "LR" style = "filled" color = "black" fillcolor = "#FF9999" fontcolor = "black" bgcolor = "#FF9999" "m_MAPPING1>ARTIFICIAL<START" [label="m_MAPPING1 {M} [start]" color="#FF9999" fillcolor="#FF9999" fontcolor=black shape=box style=filled] "m_MAPPING1>ARTIFICIAL<END" [label="m_MAPPING1 {M} [end]" color="#FF9999" fillcolor="#FF9999" fontcolor=black shape=box style=filled] "m_MAPPING1>TABLE_out" [label="TABLE_out {TGT}" fillcolor="#CCCCCC" fontcolor=black shape=box style=filled] "m_MAPPING1>TABLE_out" -> "m_MAPPING1>ARTIFICIAL<END" "m_MAPPING1>FILE_out" [label="FILE_out {TGT}" fillcolor="#CCCCCC" fontcolor=black shape=box style=filled] "m_MAPPING1>FILE_out" -> "m_MAPPING1>ARTIFICIAL<END" "m_MAPPING1>UPDTRANS" [label="UPDTRANS {UPD}" fillcolor="#CCCCCC" fontcolor=black shape=box style=filled] "m_MAPPING1>SEQTRANS" [label="SEQTRANS {SEQ}" fillcolor="#CCCCCC" fontcolor=black shape=box style=filled] "m_MAPPING1>ARTIFICIAL<START" -> "m_MAPPING1>SEQTRANS" "m_MAPPING1>FILE_in" [label="FILE_in {SRC}" fillcolor="#CCCCCC" fontcolor=black shape=box style=filled] "m_MAPPING1>ARTIFICIAL<START" -> "m_MAPPING1>FILE_in" "m_MAPPING1>SQ_FILE_in" [label="SQ_FILE_in {SQ}" fillcolor="#CCCCCC" fontcolor=black shape=box style=filled] "m_MAPPING1>TABLE_in" [label="TABLE_in {SRC}" fillcolor="#CCCCCC" fontcolor=black shape=box style=filled] "m_MAPPING1>ARTIFICIAL<START" -> "m_MAPPING1>TABLE_in" "m_MAPPING1>SQ_TABLE_in" [label="SQ_TABLE_in {SQ}" fillcolor="#CCCCCC" fontcolor=black shape=box style=filled] "m_MAPPING1>UPDTRANS" -> "m_MAPPING1>TABLE_out" subgraph mpl_MAPPLET1 { label = "mpl_MAPPLET1 {MPL}" rankdir = "LR" style = "filled" color = "black" fillcolor = "#99FFFF" fontcolor = "black" bgcolor = "#99FFFF" "mpl_MAPPLET1>ARTIFICIAL<START" [label="mpl_MAPPLET1 {MPL} [start]" color="#99FFFF" fillcolor="#99FFFF" fontcolor=black shape=box style=filled] "mpl_MAPPLET1>ARTIFICIAL<END" [label="mpl_MAPPLET1 {MPL} [end]" color="#99FFFF" fillcolor="#99FFFF" fontcolor=black shape=box style=filled] "mpl_MAPPLET1>SEQTRANS_r" [label="SEQTRANS_r {SEQ} (r)" fillcolor="#CCCCCC" fontcolor=black shape=box style=filled] "mpl_MAPPLET1>ARTIFICIAL<START" -> "mpl_MAPPLET1>SEQTRANS_r" "mpl_MAPPLET1>INPUT" [label="INPUT {INP}" fillcolor="#CCCCCC" fontcolor=black shape=box style=filled] "mpl_MAPPLET1>ARTIFICIAL<START" -> "mpl_MAPPLET1>INPUT" "mpl_MAPPLET1>OUTPUT" [label="OUTPUT {OUP}" fillcolor="#CCCCCC" fontcolor=black shape=box style=filled] "mpl_MAPPLET1>OUTPUT" -> "mpl_MAPPLET1>ARTIFICIAL<END" "mpl_MAPPLET1>UPDTRANS_r" [label="UPDTRANS_r {UPD} (r)" fillcolor="#CCCCCC" fontcolor=black shape=box style=filled] "mpl_MAPPLET1>SEQTRANS_r" -> "mpl_MAPPLET1>UPDTRANS_r" "mpl_MAPPLET1>INPUT" -> "mpl_MAPPLET1>UPDTRANS_r" "mpl_MAPPLET1>UPDTRANS_r" -> "mpl_MAPPLET1>OUTPUT" } "mpl_MAPPLET1>ARTIFICIAL<END" -> "m_MAPPING1>FILE_out" "m_MAPPING1>SEQTRANS" -> "m_MAPPING1>UPDTRANS" "m_MAPPING1>SQ_FILE_in" -> "m_MAPPING1>UPDTRANS" "m_MAPPING1>FILE_in" -> "m_MAPPING1>SQ_FILE_in" "m_MAPPING1>SQ_TABLE_in" -> "mpl_MAPPLET1>ARTIFICIAL<START" "m_MAPPING1>TABLE_in" -> "m_MAPPING1>SQ_TABLE_in" }[/graphviz]

AttachmentSize
m_MAPPING1.gv_.svg_.txt13.08 KB

Is it possible to fill a subgraph of digraph dot with a colour?

Yes it is, as E.R. Gansner point out to me. The point there is that the name of the subgraph must begin with 'cluster', e.g. 'cluster_m_MAPPING1'  in my case. However, it feels wrong to me to put a functional meaning into a name. Why has there not been introduced an appropriate attribute?

I believe the original

I believe the original intention was to keep the Dot language independent of any drawing or layout properties, so there was no cluster keyword. But it seemed natural to specify the property as part of the subgraph header rather than as an attribute.

 In any case, the use of the cluster prefix to indicate the special subgraph semantics has been around since the beginning and is well-documented (http://www.graphviz.org/content/dot-language, http://www.graphviz.org/p...) and can be found in many examples.

I am afraid, I am unable to

I am afraid, I am unable to see your points. In my opinion, the dot language is full of drawing and layout properties as fontcolor, shape, rankdir, style. And more, the documentation sais literally: Note that, for good and bad, cluster subgraphs are not part of the DOT language, but solely a syntactic convention adhered to by certain of the layout engines.

I mean no rant or accusation or so, I just wished to express my astonishment.

No, fontcolor, shape, etc.

No, fontcolor, shape, etc. are not part of the dot language. See the language definition under Documentation. These names are just conventional attribute names used by the layout programs, as is the use of the cluster prefix to denote cluster subgraphs.

Recent comments