Why is handle limited to one type #1142
Unanswered
Royce-DaDaDa
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, i'm using vue-flow to develop something and a question came up to my mind.
In vue-flow, each node may have several handles, responsible for creating and updating edges. There are two types of handles, "source" and "target", if I create a default node, the top handle is the target and the bottom handle is the source, which means if I want to create a directed edge, the edge must start at the bottom handle of one node and ends at the top handle of another node, if I try to create the directed edge the other way around, due to the following logic https://github.com/bcakmakoglu/vue-flow/blob/master/packages/core/src/utils/handle.ts#L177
the source and target node will be switched(like the picture below), this can be confusing. This problem can be solved by updating the type of those handles when the connect event is emitted. But if those handles are already connected to other handles, their type should not be changed.
![iShot_2023-10-23_21 06 31](https://private-user-images.githubusercontent.com/35479112/277350659-bd823217-cd0c-47d4-a5c1-c984a740c8e1.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5OTI1MzIsIm5iZiI6MTcxODk5MjIzMiwicGF0aCI6Ii8zNTQ3OTExMi8yNzczNTA2NTktYmQ4MjMyMTctY2QwYy00N2Q0LWE1YzEtYzk4NGE3NDBjOGUxLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIxVDE3NTAzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE2MTE4MGNjMmNlYWUxYWY5OTkyNzk3NjdmZTdmNjliMGYyZGI3ZTcwZTU4MTQxYjA1MDdlYTc0NWQ2MGFjNGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Gh6sIZNjbHT-b0F8XqYf1dHyeY27dBCGnlM2hhjqH6Y)
So I'm wondering why you restrict handle’s type to one of source and target, but not both? Is it a technical reason or a design reason?
Beta Was this translation helpful? Give feedback.
All reactions