You need to use group nodes to create a node hierarchy with parent and child nodes to achieve the desired visualization:
Corresponding GraphML.
Unfortunately, using shape node styles for group nodes is quite involved:
- Create a shape node with the desired shape and colors.
- Right-click the shape node to open its context menu and choose "Style" -> "Copy Node Style".
- Create a group node with the "Panel Group" template from the "Groups" palette section.
Do not use any other group node template. - Right-click the group node to open its context menu and choose "Style" -> "Paste Node Style".
Now that you have a group node that looks like a shape node, you can assign other nodes as child nodes for that group node. There are two ways to assign a child node to a group node:
- Drag a new node from yEd Live's palette into the editor area and drop it inside the group node.
- Click a node to select it.
Press and hold the left mouse button and start moving the mouse (and the selected node).
While still pressing the left mouse button, press and hold the SHIFT key.
Move the node inside the group node.
Release SHIFT and mouse button.
If you connect a child node to a node outside the group, the corresponding edge will be drawn over the group node but below the child node (and below all other child nodes of the group node).