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.


Group node properties change inconsistently with state

0 votes


I am seeing unexpected behavior in YEd version running on an Ubuntu 16.04 operated Thinkpad T460s.

The following simple nested graph fails to change color and shape consistently based on state.  State closed should change the group color to green and shape to hexagon. Similarly, state open should change to red and rectangle. However color and shape change inconsistently when the group is opened and closed.

<?xml version="1.0"?>
<graphml xmlns:java="http://www.yworks.com/xml/yfiles-common/1.0/java" xmlns:sys="http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
    <key id="d_name" for="node" attr.name="name" attr.type="string"/>
    <key id="d_group_realizer" for="node" yfiles.type="nodegraphics"/>
    <graph id="G" edgedefault="directed">
        <node id="g1n" yfiles.foldertype="folder">
            <data key="d_name">g1</data>
            <data key="d_group_realizer">
                    <y:Realizers active="0">
                            <y:Geometry height="50" width="50"/>
                            <y:Fill hasColor="false" transparent="false"/>
                            <y:NodeLabel visible="false"/>
                            <y:BorderStyle color="#00FF00" type="line" width="2.0"/>
                            <y:Shape type="hexagon"/>
                            <y:State closed="true"/>
                            <y:Geometry height="50" width="50"/>
                            <y:Fill hasColor="false" transparent="false"/>
                            <y:NodeLabel visible="false"/>
                            <y:BorderStyle color="#FF0000" type="line" width="2.0"/>
                            <y:Shape type="roundrectangle"/>
                            <y:State closed="false"/>
            <graph id="g1" edgedefault="directed">
                <node id="n1">
                    <data key="d_name">n1</data>

Here is an animation of the transitions I see when the graph is loaded, opened once and then closed:



in Help by

1 Answer

0 votes

The states of the container node and its proxy realizer are not consistent. If the yfiles.foldertype is set to folder for a container node, then the active attribute of the corresponding ProxyAutoBoundsNode.Realizers child element has to be 1 (instead of 0 as in the sample above).

by [yWorks] (161k points)
Thank you for the lightning quick response!

Yes, changing the active attribute to 1 and swapping the order of the group nodes fixes the problem. :)
Legal Disclosure | Privacy Policy