Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to hide links between layers when one layer is not visible. (Read 1481 times)
deinterest
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 1
Joined: Jan 29th, 2014
How to hide links between layers when one layer is not visible.
Jan 29th, 2014 at 10:41pm
Print Post  
I have some nodes on layer 1 and some nodes on layer 2.  Many links are between nodes of the same layer but some are across layers.  I would like a way to easily hide links between layer 1 & layer 2 nodes so that when I hide a layer the broken links are not shown.

[1] -> 1 -> [1] -> ? -> [2] -> 2 -> [2] -> ? -> [1]
where:
[] are nodes with a layer index
-> -> is a link with a layer index

Turning off layer 1 will continue to show nodes with layerindex 1 and the links marked with a question.

The links marked with a ? are neither layerindex 1 or 2 since either may be hidden.

Many layers exist so the combinations will become very tricky (layer index n = outgoingindex -> incomingindex ).
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to hide links between layers when one layer is not visible.
Reply #1 - Jan 30th, 2014 at 9:20am
Print Post  
By layers you mean ones specified via LayerIndex and not vertical layout (TreeLayout / LayeredLayout) layers, right? You could call the Diagram.IsItemVisible method to determine whether an item is hidden, either because its own or its Layer's Visible property == false. So after changing a Layer's visibility, you could loop over all links in diagram.Links collection and set:

link.Visible = diagram.IsItemVisible(link.Origin) && diagram.IsItemVisible(link.Destination);

to make sure the control does not draw any links to hidden nodes.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint