This project is read-only.

Setting Horizontal and Vertical gap parameters

Mar 29, 2010 at 9:25 AM

Hi. Can anyone please indicate to me how to change the horizontal and vertical gap parameters?

I get the following error: Property or indexer 'GraphSharp.Algorithms.OverlapRemoval.IOverlapRemovalParameters.HorizontalGap' cannot be assigned to -- it is read only

Here is my codes:

public class TaggedGraphLayout : GraphLayout<object, TaggedEdge<object, object>, BidirectionalGraph<object, TaggedEdge<object, object>>>

graphLayout.OverlapRemovalParameters.HorizontalGap = float.Parse(HorizontalSpacingSlider.Value.ToString());
graphLayout.OverlapRemovalParameters.VerticalGap =  float.Parse(VerticalSpacingSlider.Value.ToString());
Thank you.

Apr 28, 2010 at 12:55 PM
Sep 12, 2011 at 12:18 AM

Please, share the solution, or if you can give some tips on how to change does values. I would be greateful! Regards.

Sep 15, 2011 at 11:20 AM
Edited Sep 15, 2011 at 11:27 AM

Ok, I managed to solve it by myself and for future generations I will share my own solution. To change does params we need to edit the constructor of the window, to make it look this way:

public MainWindow()

      // Add this section
      SimpleTreeLayoutParameters a = new SimpleTreeLayoutParameters();
      a.LayerGap = 100;
      a.VertexGap = 100;
      graphLayout.LayoutParameters = a;

And, that would be it. I hope you find it quite helpful. Regards.

Feb 20, 2013 at 11:44 AM
Thank you very much mikoay