This is a migrated thread and some comments may be shown as answers.

How to custom the diagram connection that contains few connector.

11 Answers 319 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Walliam
Top achievements
Rank 1
Walliam asked on 25 Aug 2014, 01:28 PM
Hey, Guys
This tough to describe. In Brief, I want the RadDiagram has the circuit diagram feature like the attached picture. The certain connector can connect to line (or named as RadDiagram connection).  Is any approaching to this feature?

Thanks a lot, By William

11 Answers, 1 is accepted

Sort by
0
Fredrik
Top achievements
Rank 1
answered on 26 Aug 2014, 01:52 PM
Not shure if i understand you correctly william but i think we have the same question.
I am currently building an application that makes a circuit diagram from components. Some of the components attach directly to each other whilst others connect via cables. I found this in the documenation that seems to answer the question about how to make custom connectors
http://www.telerik.com/help/wpf/raddiagram-features-custom-connectors.html
however i have one more question.
Is connecting component to component directly possible ? How would i detect when two connectors are touching and make a connection programatically when this occurs ?
0
Walliam
Top achievements
Rank 1
answered on 27 Aug 2014, 10:47 AM
Hi, Fredrik
Actually, I have read the docu of custom connector in the RadDiagramShape Class, and My Program has already used this feature. But I can't custom connector in the RadDiagramConnection Class. I ideally approaching to this issue is that an Event (add some Connector automatically while I drag a line from certain connector to a DiagramConnection) will be activate when the mouse is near the DiagramConnection.

By William
0
Walliam
Top achievements
Rank 1
answered on 27 Aug 2014, 10:56 AM
I Think your issue is not that much same with mine. I Think you can try to fetch all connectors' coordinate of All RadDiagramShape Class in the RadDiagram. You can write some code in RadDiagram Class's Event (the event is itemschanged(sender, args) ) to programatically connect the nearby connector. 
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 28 Aug 2014, 07:57 AM
Hello guys,

@William,
Thank you for providing us with a picture of your requirements. It helped us to better understand what you need to achieve. Unfortunately, creating a RadDiagramConnector in the middle of a RadDiagramConnection is not possible.

However, you can achieve the same by using a customized RadDiagramShape. That shape will contain no geometry (or the geometry can define the look of a connection point), it will have small fixed size (e.g. 10x10 pixels) and will define only one connector in the middle. This will allow you to position the shape where you need to connect other connections and use that only connector.

@Fredrik
We understand your requirement for connecting two RadDiagramShapes. Unfortunately, the RadDiagramConnectors are designed to be used in combination with RadDiagramConnections. This means that directly connecting two RadDiagramConnectors is not supported. 

As for your second question, you cannot detect if two connectors are near one another, out of the box. The reason for that is the fact that the connectors of only one shape are visualized at a time.
Hence, in order to achieve your requirement you will need to implement big customizations into the RadDiagram.

One, possible approach which will be easier to achieve is that you can always connect two shapes that are positioned so that the space between them is less than 10 pixels.

Regards,
Pavel R. Pavlov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Kevin
Top achievements
Rank 1
answered on 08 Nov 2014, 07:22 AM
How did you go about routing your connections?  I'm trying to design an application that behaves just like a schematic capture program, meaning when the user clicks on a shape's connector, it makes the connection and draws a line until they click again, which creates a point and allows the line to pivot 90 degrees and then make a connection to another shape (or another point).

It appears the Path Tool is close to what I want, but I want it to draw a connection and not a shape.  Any thoughts on how to achieve this?  Thanks,
0
Pavel R. Pavlov
Telerik team
answered on 13 Nov 2014, 06:40 AM
Hi Brent,

I understand your requirement. I have seen and worked with such applications. I will search through our history and will try to find such application. If I find one I will attach it to this thread.

Regards,
Pavel R. Pavlov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Kevin
Top achievements
Rank 1
answered on 21 Nov 2014, 05:58 PM
Hi Pavel,

Were you able to find anything?  I'm thinking I need an orthogonal router.
0
Pavel R. Pavlov
Telerik team
answered on 26 Nov 2014, 09:23 AM
Hi Brent,

I searched through our resources but I could not find any ready to run application that is close to your requirement.

However, you can take advantage of the custom tools of the RadDiagram to implement your customization. You can create a custom connection tool that will draw the connections for you as you require. As a startup project you can refer to our SDK project. It demonstrates how a custom tool can be created. Based on it you can start to create the required tool.

I hope this will help you.
 
Regards,
Pavel R. Pavlov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Robert
Top achievements
Rank 1
answered on 03 May 2017, 06:25 AM

Hi,

are there any news to this topic? Is it already possible to route from Connector to Connector? For Example if i have a Custom Shape with 3 custom input Connectors on the left side and 3 custom output Connectors on the right side, can i somehow route  from Shape1 output1 to Shape2 input1.

If it is not possible what would be the best workaround? Use a Shape with Shapes instead of a Shape with Connectors(replace every Connector with a small Shape) so that i can use the build in routing algorithm. Should i create my own routing algorithm based on some events? Any other possible ways?

Regards

Robert

0
Robert
Top achievements
Rank 1
answered on 03 May 2017, 06:39 AM

For better Understanding of my Application i added some Screenshots of the current Situation.

The first picture shows how it should look like(it looks like this if i arrange the shapes in a good way)
The second and third picture are how the elements behave at the moment.

0
Robert
Top achievements
Rank 1
answered on 03 May 2017, 08:44 AM
Ok I think I found the solution. I had to set the TargetConnectorPosition in my Connection :)
Tags
Diagram
Asked by
Walliam
Top achievements
Rank 1
Answers by
Fredrik
Top achievements
Rank 1
Walliam
Top achievements
Rank 1
Pavel R. Pavlov
Telerik team
Kevin
Top achievements
Rank 1
Robert
Top achievements
Rank 1
Share this question
or