microsoft / microsoft/automatic-graph-layout

sugiyamaSettings and Rectilinear EdgeRoutingMode problem

Open
#48 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
1.5k
Forks
319
Avg merge
38m
Merged PRs (30d)
1

Description

Hi Lev,
Im trying to use "Rectilinear EdgeRoutingMode" in my project.

In the Editing sample I have modified the form1 creation adding sugiyamaSettings to set rectilinear edgeroutingmode:

    public Form1() {

        graphEditor = new GraphEditor();
        InitializeComponent();
        graphEditor.AddNodeType("Ellipse", Shape.Ellipse, Color.Transparent, Color.Black, 10, "user data",
                                "New Node");
        graphEditor.AddNodeType("Square", Shape.Box, Color.Transparent, Color.Black, 6, "user data", "");
        graphEditor.AddNodeType("Double Circle", Shape.DoubleCircle, Color.Transparent, Color.Black, 6, "user data",
                                "New Node");
        graphEditor.AddNodeType("Diamond", Shape.Diamond, Color.Transparent, Color.Black, 6, "user data", "New Node");
        graphEditor.Viewer.NeedToCalculateLayout = true;
        CreateGraph();

        //Added piece of code
        var sugiyamaSettings = (SugiyamaLayoutSettings)graphEditor.Viewer.Graph.LayoutAlgorithmSettings;
        sugiyamaSettings.EdgeRoutingSettings.EdgeRoutingMode = Microsoft.Msagl.Core.Routing.EdgeRoutingMode.Rectilinear;
        //End added  piece of code

        graphEditor.Viewer.NeedToCalculateLayout = false;

        SuspendLayout();
        helpButton.BringToFront();
        graphEditor.Viewer.LayoutAlgorithmSettingsButtonVisible = false;


        ResumeLayout();
        helpButton.Click += helpButton_Click;

    }   

When I execute the application appears like this. It doesn't take the SugiyamaLayoutSettings that I set.
captura1

If I drag one item the graph appearance changes ands shows me the correct rectilinear edges.
captura3

After that if I push right button and select the option "redo Layout" y recovers the firs image aspect.

The question is: what do I have to do to take my SugiyamaLayoutSettings in the graph in the first draw?

Thanks for your time!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Editing sample and the Form1 constructor shown in the report. Run the sample, inspect when GraphEditor.Viewer.Graph.LayoutAlgorithmSettings is applied relative to the initial layout, and compare the first draw with dragging or “redo Layout.” Done means the initial rendering uses the configured Rectilinear EdgeRoutingMode.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.