Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]Connection line display issue #130

Open
MachineVisionxiaotan opened this issue Aug 3, 2024 · 7 comments
Open

[Question]Connection line display issue #130

MachineVisionxiaotan opened this issue Aug 3, 2024 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@MachineVisionxiaotan
Copy link

This is my first time testing the Nodify library. When I add two nodes and place them in the editor, if there is a certain distance between them in the x direction, the connection line will not appear if I try to connect them directly without dragging the nodes first. Only after dragging the nodes will the connection line be displayed,what is the reason for this?

@MachineVisionxiaotan MachineVisionxiaotan added the question Further information is requested label Aug 3, 2024
@miroiu
Copy link
Owner

miroiu commented Aug 3, 2024

Does the following answer help you? https://github.com/miroiu/nodify/wiki/FAQ#q-why-is-the-connection-not-following-the-connectors-when-i-move-a-node

Also, make sure that the binding for the Anchor is set to OneWayToSource.

@MachineVisionxiaotan
Copy link
Author

I have already set Anchor OneWayToSource. I found that the issue of not displaying only occurs when the y coordinates of the two nodes are the same

@miroiu
Copy link
Owner

miroiu commented Aug 3, 2024

I can't reproduce it. Can you give me more details?

@MachineVisionxiaotan
Copy link
Author

20240804_112812.mp4

Video is the effect.
Initial positions of two nodes:
Location=new System.Windows.Point(200, 200),
Location = new System.Windows.Point(500, 200),

@miroiu
Copy link
Owner

miroiu commented Aug 4, 2024

It works fine for me. There must be something wrong with your setup.

Please verify that:

  1. the collection that stores the connections is observable or at least raise a PropertyChanged event when a connection is added.
  2. the Source and Target are bound to the corresponding connector Anchor in the Connection template/style
  3. the Anchor is bound in a OneWayToSource mode to the corresponding connector Anchor in NodeInput and NodeOutput
  4. the connector class is implementing INotifyPropertyChanged and the Anchor property raises PropertyChanged events

Also worth checking out: https://github.com/miroiu/nodify/wiki/Getting-Started#a-minimal-example

Move the viewport top-left a bit to check whether the connection is correctly added to the graph (it is added at 0, 0). If the Anchor binding has problems, you will see something like this:

image

@MachineVisionxiaotan
Copy link
Author

It's not related to binding, it just doesn't display when horizontal

20240822_133141.mp4

@MachineVisionxiaotan
Copy link
Author

The reason is that I wrote SourceOffsetMode="Rectangle" TargetOffsetMode="Rectangle",delete them and everything will be fine.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants