This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I have couples of question regarding implementing our own custom node that does the following: 1. When ever we drag a the node to a different position, we actually implemented our own position snapping algorithm which will snap accordingly. This works well for now. However, we do see a problem here: -- The node's connection will overlapped and covered by other node, where you can't see the connection properly. -- Is there a way to make the connection route around the nodes, instead of 'go through' other node? ---refer to the attached image, notice in the circled part how the connection from other node 'go through' my node from behind and makes it looks like it's from the current node. 2. We implemented a "slider control" for the user to "Zoom In" and "Zoom Out" by dragging the slider on the left part of the diagram. However, we notice that the 'center' of zooming in / out when using the slider isn't work very well. When dragging the slider, the diagram is being zoomed in/out on the left part (which is where the mouse is dragging the slider). Can we override this behaviour by not capturing where the mouse is and perform the zoom on the center of the diagram instead?
Thanks. |
|
|
Hello 1. This type of connection routing is not available in WPF diagrams 1.0. We have however included an A-Star pathfinder algorithm in the new WPF diagrams 2.0 which will produce the routing you need. (http://www.mindscapehq.com/products/wpfdiagrams) 2. I have improved the zooming behaviour to zoom towards the center of the viewport when changing the DiagramSurface.Zoom property. This update will be available through the nightly builds from tomorrow the 11th of May. Let me know how it goes. - Jason |
|
|
Hi Jason, Just to make sure, is the default behaviour of zooming on mouse position still there? We would like to retain the current behaviour when the mouse is on the diagram and user deliberately zooming in/out using their mouse wheel, the center of the viewport should be on the mouse position. The improved zooming behaviour should only be there IF the user is using the slider and not zooming in/out using their mouse wheel. Is this how it should behave on the new nightly build? |
|
|
Hello Yes the default zoom on mouse point is still there. Zooming will be based on the center of the viewport only when changing the Zoom property (either programmatically or using a binding). Seperate logic is used for the mouse wheel to zoom based on the mouse position. Regards |
|
|
Hi Jason, Regarding the A-Star pathfinding algorithm in the Diagram 2.0, do you mind to elaborate more on how to use it? And, is that feature available in nightly build as well? or No? Because right now, seems like I need the "Zoom" enhancement in nightly build, as well as the pathfinding algorithm in Diagram 2.0. :/ |
|
|
Hello The A star pathfinder is only available in WPF Diagrams 2.0. The zooming improvements have been included in both 1.0 and 2.0. So the nightly builds for both versions will contain the zooming feature. In WPF Diagrams 2.0, diagram connections have a Pathfinder property of type IPathfinder. This allows different types of connections to use different path routing if neccessary. One way to use the A-Star pathfinding algorithm is to create a custom connection implementation, and return AStarPathfinder.Instance when implementing the Pathfinder property. Creating a custom connection is best done by extending the DiagramConnection class. - Jason |
|
|
Hi Jason, I tried the latest nightly build for the diagram. At first, the zooming behaviour was working correctly, for eg: you click on a button, which increase / decrease the zoom value 1 by 1. However, once you try to drag the slider which also bind to the Zoom value of the diagram, it will behave strangely after a few times. The dragging will cause the diagram to be zoom off the view port area. Can you try to create a zoom slider and bind it to the zoom value, and see whether you can reproduce the issue or not?
Thanks. |
|
|
Hello I have found the cause of this bug and a fix for this will be available through the nightly builds from tomorrow the 14th of May. - Jason |
|
|
Hi Jason, I still can see the issue when I drag the slider fast from minimum to maximum. Can you verify whether you can reproduce the issue? |
|
|
I can reproduce this sometimes, but only if the minimum zoom is quite small (0.01). What minimum zoom are you using? 0.1 or higher works well. - Jason |
|
|
Hi, I am actually using 0.1 and it still gives me the issue. But nevermind then, after I set to 0.2 then it works ok now. |
|