I am trying to create "anchored flag" labels for nodes (see image) where the labels are essentially a different type of node with a single link to the primary node type. The label nodes allow for text editing, changing fonts, colors, etc and when a user moves a primary node the corresponding label follows. But the user can move the label independently of the node but the label will always have a link to the node. I basically have this behavior implemented, but the issue I have involves layouts.
When a layout is run, all nodes are considered equal and the label nodes are arranged as one would expect nodes to be arranged in the layout (using tree layouts). But this breaks the behavior of the anchored flag label I am trying to achieve. What I would like to do is have the layout ignore the label nodes and just affect the primary nodes. When the primary node locations are finalized, the label nodes will follow. The only way I can do this is to set the TreeLayoutSettings IgnoreInvisible flag to true, and when a layout is run, set all label nodes to Visibility = Collapsed, run the layout, then for all label nodes set Visibility = Visible.
Is there a way to customize the layout so that it can ignore nodes of a certain type, (or if they have a certain property, interface, etc)? And if that is not possible, is there a better way to handle the layout issue described above?