Unplanned
Last Updated: 30 Aug 2019 11:06 by ADMIN
RAMEL
Created on: 28 Aug 2019 13:10
Category: Diagram, DiagramRibbonBar, DiagramToolBox
Type: Bug Report
1
Layout problem with AStartRouter in the RadDiagram (WinForms)

Hello,

I'm contacting to you regarding the RadDiagram in WinForms. Currently I have an issue with the layout by using the AStartRouter (see attached picture). Please find below the code used to setup the router:

this.diagram.RoutingService.Router = new Telerik.Windows.Diagrams.Core.AStarRouter(this.diagram.DiagramElement) 

AvoidShapes = true,
WallOptimization = true
};
this.diagram.RoutingService.AutoUpdate = true;
this.diagram.RouteConnections = true;

Thanks for your help.

Regards

Attached Files:
5 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 30 Aug 2019 11:06

Hello, Ramel,  

I have followed the described steps and obtained the illustrated result from your screenshot. The AStarRouter uses a version of the A* search algorithm to find the best route between two points. However, it seems that it doesn't choose the most optimal route between two shapes when you move a RadDiagramShape.

I have logged it in our feedback portal by making this thread public. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item. A sample project is attached which incorrect behavior is illustrated in the gif file. 

 

I have also updated your Telerik points.

Currently, the possible improvement in the router that I can suggest is to increase the DiagramConstants.RouterInflationValue to 30 which controls the size of the restricted area around the shapes. In addition, set the DiagramConstants.RoutingGridSize property to 20 - a smaller value will increase the time to compute the optimal path and increase the set of possible solutions for the path constraints. On the other hand, a small value leads usually to a lot of stairs/wiggling in the connection's path.

        public RadForm1()
        {
            DiagramConstants.RouterInflationValue = 30;
            DiagramConstants.RoutingGridSize = 20;
            InitializeComponent();

            this.radDiagram1.RoutingService.Router = new Telerik.Windows.Diagrams.Core.AStarRouter(this.radDiagram1.DiagramElement)
            {
                AvoidShapes = true,
                WallOptimization = true,
            };
            this.radDiagram1.RoutingService.AutoUpdate = true;
            this.radDiagram1.RouteConnections = true;

            foreach (RadDiagramConnection c in this.radDiagram1.Connections)
            {
                c.SourceConnectorPosition = "Auto";
                c.TargetConnectorPosition = "Auto";
            }
        }

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
RAMEL
Posted on: 30 Aug 2019 06:51

Hi,

You right, if I change the zoom in the shown event, the layout is correctly loaded.

But, when I start the application, if change the zoom in the application and move some of shapes, the issue always appear (see attached picture).

Regards

Jordan GAROCHE

Attached Files:
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 30 Aug 2019 06:40

Hello, Ramel,  

Indeed, if I set the Zoom property to 1.5 immediately after specifying the AStarRouter, the connections in RadDiagram are not properly positioned. However, have in mind that the layout (affected by the AStarRouter) is not performed completely in the form's constructor yet. The appropriate place to change the zoom level is the form's Shown event. Thus, the AStarRouter algorithm will be performed and the connections will be optimized and you can zoom the diagram:

        public RadForm1()
        {
            InitializeComponent(); 
            this.radDiagram1.RoutingService.Router = new Telerik.Windows.Diagrams.Core.AStarRouter(this.radDiagram1.DiagramElement)
            {
                AvoidShapes = true,
                WallOptimization = true
            };
            this.radDiagram1.RoutingService.AutoUpdate = true;
            this.radDiagram1.RouteConnections = true; 
        }  

        private void RadForm1_Shown(object sender, EventArgs e)
        {
           this.radDiagram1.Zoom = 1.5;
        }

Should you have further questions please let me know.

 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
RAMEL
Posted on: 29 Aug 2019 15:20

Hi,

Thanks for your reply.

After investigation, the issue appear when you change the zoom. In your sample project, add the following line when initializing the radDiagram :

 

this.radDiagram1.Zoom = 1.5;

 

Now run the sample project and you will have the issue without do anything (see attached picture).

 

Regards

 

Jordan

Attached Files:
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 29 Aug 2019 05:59

Hello, Ramel,  

Following the provided information, I have prepared a sample project for testing the described case. It seems that the connections overlapping is significantly improved on my end:


I have attached my sample project. Feel free to modify it in a way to reproduce the experienced issue and get back to me with it so I can investigate the precise case. Thank you in advance. 

I am looking forward to your reply.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.