Select node in the overview

Hi,
I have a split screen: at the top part located a diagram (lets call it A) and below it location overview of the diagram A:


After I click on an area in the overview the diagram at the top is focusing on the same area as in the overview.
How can I achieve next functionality: when I click on a specific node in the overview - the same node will be focused and selected (adorned) in the diagram?
I will appreciate if you can upload an example of the answer.

      myOverview.MouseDown += (s, e) => {
        Point viewpos = e.GetPosition(this);
        Point docpos = myOverview.Panel.TransformViewToModel(viewpos);
        Node node = myDiagram.Panel.FindPartAt<Node>(docpos, null, SearchLayers.Nodes);
        if (node != null) node.IsSelected = true;
      };

Hello Walter,

Thank you for the quick response.
We have tried your solution but unfortunately :

Node node = myDiagram.Panel.FindPartAt(docpos, null, SearchLayers.Nodes);

node == null

Waiting for your suggestions …

Best Regards,

It worked when I tried it. Remember that the precision of the mouse is only one pixel, which at the scale of the Overview may be many pixels in the normally scaled Observed Diagram.

Maybe you could improve it by replacing the call to FindPartAt with a call to FindPartsIn, with a Rect centered at the point and with SearchInclusion.Intersects, and then choosing the Node that is closest to the point.

Hi, I got it working with a little change to your code:

myOverview.MouseDown += (s, e) => {
Point viewpos = e.GetPosition(myOverview);
Point docpos = myOverview.Panel.TransformViewToModel(viewpos);
Node node = myDiagram.Panel.FindPartAt<Node>(docpos, null, SearchLayers.Nodes);
if (node != null) node.IsSelected = true;
};

Thanks.

You’re right. It worked for me because the Org Chart sample has the Overview in the top left corner.