Link , Node Overlap problem

i have some problem

set link.rout routing = “AvoidsNodes” and not working avoid nodes…

1

123132 -> 12 link is pass node [대조군 생성]

2

this is my link data template code

That’s odd. If you do not set Route.Adjusting, are the results better?

No… same result…

What is your layout?

I’m use treeLayout

I haven’t tried this, but you could implement a Diagram.LayoutCompleted event that iterates over all of the PartManager.Nodes, and for each Node checks whether the Node.LinksInto Count > 1. If so, iterate over those Links and call Route.InvalidateRoute on each one.

i tried this, but there is no change.

1

Here’s what I tried:

  <Window.Resources>
    <DataTemplate x:Key="NodeTemplate">
      <Border Background="LightGray" go:Part.SelectionAdorned="True">
        <TextBlock Text="{Binding Path=Data}" Margin="20" />
      </Border>
    </DataTemplate>
    <DataTemplate x:Key="LinkTemplate">
      <go:LinkPanel go:Part.SelectionAdorned="True">
        <go:Link.Route>
          <go:Route Routing="AvoidsNodes" />
        </go:Link.Route>
        <go:LinkShape x:Name="Path" Stroke="Black" StrokeThickness="2"></go:LinkShape>
      </go:LinkPanel>
    </DataTemplate>
  </Window.Resources>

  <Grid>
    <go:Diagram x:Name="myDiagram" Padding="10"
                HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
                NodeTemplate="{StaticResource NodeTemplate}"
                LinkTemplate="{StaticResource LinkTemplate}">
      <go:Diagram.Layout>
        <go:TreeLayout Alignment="Start" />
      </go:Diagram.Layout>
    </go:Diagram>
  </Grid>

and initialized with:

      var m = new GraphLinksModel<string, string, string, UniversalLinkData>();
      m.Modifiable = true;
      // these two properties were just to make it easier for me to create the model data:
      m.NodeKeyIsNodeData = true;
      m.NodeKeyReferenceAutoInserts = true;
      m.LinksSource = new ObservableCollection<UniversalLinkData>() {
        new UniversalLinkData() { From="1", To="2" },
        new UniversalLinkData() { From="2", To="3" },
        new UniversalLinkData() { From="3", To="4" },
        new UniversalLinkData() { From="2", To="5" },
        new UniversalLinkData() { From="5", To="6" },
        new UniversalLinkData() { From="5", To="7" },
        new UniversalLinkData() { From="1", To="7" },
      };
      myDiagram.Model = m;

This produced:
image

Isn’t this the behavior you were expecting all along? There must be something going on in your app that is preventing this default behavior from occurring.

Thanks Walter, i’m changed layout another reason…