Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Two Diagrams for different views of the same data (Read 3362 times)
AR
Junior Member
**
Offline


I Love MindFusion!

Posts: 65
Joined: Jan 23rd, 2015
Two Diagrams for different views of the same data
Apr 22nd, 2015 at 3:33pm
Print Post  
I have a new requirement to display my data in two slightly different ways.

View A - Nodes can have multiple links in the same direction, all with labels (i.e. Node X can have 3 links to Node Y, and Node Y can have 2 links to Node X, all with different labels)

View B - Same Nodes as View A, but only allow single link in each direction, different labels on the links (i.e. Node X can have 1 link to Node Y and Node Y can have one link to Node X). The 'single link' in this view is a sum of the (possibly) multiple links in view A.

I'm thinking that the best way to do this is to have two different Diagrams, one for each View.

The problems come from the fact that the user must be able to switch views. And edit the diagram in either view, and changes such as added/removed/changed Nodes and links must be reflected in the other view.

Do you think that having 2 diagrams is the right way to go about this?

Have you any comments on how easy it would be to replicate changes on one View within the other if they are separate Diagrams?
  

AlternateViews.PNG ( 24 KB | 133 Downloads )
AlternateViews.PNG
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Two Diagrams for different views of the same data
Reply #1 - Apr 23rd, 2015 at 10:34am
Print Post  
If nodes' positions would not change between views, try implementing this using layers. Set link.LayerIndex to either 0 or 1 for the different kinds of links, and add two Layer objects to the diagram.getLayers() collections. Keep the Layer.Visible property for one of the layers set to false, and when switching between views toggle its value for both layers.

If you need to keep both views visible at same time, you might have to derive from the Layer class and override its getVisible method to determine whether it should be visible dynamically depending on the view.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
AR
Junior Member
**
Offline


I Love MindFusion!

Posts: 65
Joined: Jan 23rd, 2015
Re: Two Diagrams for different views of the same data
Reply #2 - Apr 24th, 2015 at 2:22pm
Print Post  
The layers method you outlined is looking really good and will be much easier to maintain Smiley

Thank you for your help.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint