Overview links do not match diagram


I’m running into a problem where the links in the Overview window do not display as shown in the diagram. In the Overview, the routing is either has more bends or the links are disconnected from the nodes. I’m not sure I’m doing anything out of the ordinary here. I am using (eval) version GoWPF Any idea what could be missing?


Extra bends in overview:

Disconnected links in overview:

The XAML is below:

<go:Overview x:Name=“OverviewWindow”
Observed="{Binding ElementName=JobChainDiagram}">


That’s odd. By default the Overview uses the same DataTemplates that the observed Diagram does, and yet that is obviously not the case for you, for neither the Node template nor the Link template. Furthermore the link routes normally come from the observed diagram’s links, so the Overview ought to be showing the same routes.

And yet the results are very similar to what the Overview should be showing.

What is your (main) Diagram’s Node template and what is its Link template? I assume there’s some TreeLayout for the Diagram?

I am using the TreeLayout. The node and link templates are below.

Node Template:

<DataTemplate x:Key="NodeTemplate">
    <Border BorderBrush="Black"
            Background="{Binding Path=Data.Color}"
            go:Part.SelectionAdornmentTemplate="{StaticResource AdornmentTemplate}"
            go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}"

        <TextBlock Text="{Binding Path=Data.Key}" />
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=Data.Key}" Margin="10,0,0,0"/>
                <TextBlock Text="{Binding Path=Data.MasterJobData.MasterJobName}" Margin="10,0,0,0"/>
        <!-- Dropshadow degrades performance!! 
            <DropShadowEffect ShadowDepth="10" Opacity="50" Color="LightGray"/>

Link Template:

<DataTemplate x:Key="LinkTemplate">
    <go:LinkPanel go:Part.SelectionElementName="Path"
                    go:Part.SelectionAdornmentTemplate="{StaticResource AdornmentTemplate}"
                    go:Part.Reshapable="True" >
            <go:Route Routing="AvoidsNodes" Curve="JumpOver" Corner="5" />
        <!-- Arrow head -->
        <Path Fill="Black" go:LinkPanel.ToArrow="{Binding Path=Data.ToArrowhead}" go:LinkPanel.FromArrow="{Binding Path=Data.FromArrowhead}"/>
        <!-- Link line -->
        <go:LinkShape x:Name="Path" Stroke="Black" StrokeThickness="3" StrokeDashArray="{Binding Path=Data.DashArray}"/>

        <!-- this is the label that is only shown when connected to a Decision node -->
        <TextBlock Text="{Binding Path=Data.Text, Mode=TwoWay}"
                    go:LinkPanel.Alignment="0 0 -2 0"/>
            <TextBlock Text="{Binding Path=Data.ToolTip}"/>

I’ll look into this later.

In the meantime, try setting these two properties on your Link’s Route:
FromSpot=“BottomCenter” ToSpot=“TopCenter”

Thanks Walter.

I reversed the values of the 2 properties you posted and that seemed to solve the bending issue.

As before, I am still able to make the links disconnect from the nodes when I redraw the diagram.

I made a new observation. This may be a different issue but also may be a clue. When I print with the overview matching the diagram, the overview links pop out of the nodes as shown in my original post. The printout matches the new distorted overview.

I just tried using your two templates along with your Overview, with some name changes, and I removed the references to static resources that I couldn’t resolve.

I was unable to produce any problems, even during or after printing.

Also you could try using version 2.1.6 to see if that makes any difference. I cannot think of any reason that it would, but one never knows until one tries…

Installing 2.1.6 did not help. I did set Animated=“False” on the Diagrams’ layout manager. This stopped the links from disconnecting during the reload. But if I move a node in the diagram, nodes get disconnected from the links. It looks like whenever there is movement on the diagram, be it animation or manual manipulation, the overview does not refresh correctly. Unfortunately none of these changes helped the printing problems.

I’m still unable to reproduce or explain the problem using your Node and Link templates and your definition of the Overview. Maybe there’s something about your main Diagram? But that’s unlikely.

I suppose you could experiment with setting Overview.UsesObservedNodeLocation to false.

It was in fact something in my main Diagram. I had set the Font property to 28 to better visualize complex diagrams. I didn’t really need this since I can zoom in if needed. I removed the property and things are displayed properly in the Overview and printing. Setting a font seems pretty innocuous to me. Is this bug?

Many thanks for you suggestions and attempts.

If the Nodes are actually different sizes (not just scaled in the viewport, but in model coordinates) in the observed Diagram and in the Overview, it should make sense that the Link routes would not connect up in the same way. You could set Overview.UsesObservedLinkRoute to false so that links in the overview would do their own routing, to adapt to the changed sizes of the nodes. But that duplicated work would of course be slower.