Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

Group nodes render a different fill color than what is specified in the gml

0 votes
For a project, I am building a GML file using my own code that takes some user input and  builds a graph. The graph typically has many levels of nesting and edges between nodes across different levels of nesting. The problem is this: if a node X is nested within another group node, and if the fill color of X is set in the GML to #FFFFFF, then yED graph editor renders it as  #FFFFFF if X is not a group node and as #EBEBEB if X is a group node. I've attached a simple GML which replicates the problem (see rendering of nodes named 'a' and 'b')

 

graph
[
 directed 1
node [id "0" label "A" isGroup 1  graphics [ type "roundrectangle" fill "#D2D2D2" outline "#000000"  ] LabelGraphics [ text "A" anchor "t" fontStyle "bold"  ] ]
node [id "1" label "a" isGroup 1 gid "0"  graphics [ type "roundrectangle" fill "#FFFFFF" outline "#000000"  ] LabelGraphics [ text "a" anchor "t"  ] ]
node [id "2" label "x" gid "1"  graphics [ type "roundrectangle" fill "#FFCC00" outline "#000000"  ] LabelGraphics [ text "x" anchor "c"  ] ]
node [id "3" label "B" isGroup 1  graphics [ type "roundrectangle" fill "#D2D2D2" outline "#000000"  ] LabelGraphics [ text "B" anchor "t" fontStyle "bold"  ] ]
node [id "4" label "b" gid "3"  graphics [ type "roundrectangle" fill "#FFFFFF" outline "#000000"  ] LabelGraphics [ text "b" anchor "c"  ] ]
edge [ source "1" target "4"  graphics [ fill "#000000"  ] ]
]
 

Thanks,

John
in Help by

1 Answer

0 votes

The display color of group nodes is calculated based on their fill color and their nesting depth. (For top-level groups the display color is the specified fill color, for all other groups  the display color gets darker the more ancestor nodes the group has.)

Unfortunately, yEd's graphical user interface currently does not provide a  means for turning this feature off.

Since you are programmatically creating graph files for yEd, acquiring yFiles for Java might be an option for you. yFiles for Java is the commercial programming library upon which yEd was built. Aside from lots of other things, its API offers the possibility to turn off the depth-dependent group node coloring. (You will need to use GraphML as graph exchange format between your yFiles for Java based application and yEd for yEd to be able to notice the group coloring change, though.)

by [yWorks] (160k points)
Legal Disclosure | Privacy Policy
...