Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

startSocket endSocket position 'auto' not working properly #384

Closed
zakk616 opened this issue Dec 28, 2022 · 5 comments
Closed

startSocket endSocket position 'auto' not working properly #384

zakk616 opened this issue Dec 28, 2022 · 5 comments

Comments

@zakk616
Copy link

zakk616 commented Dec 28, 2022

startSocket: 'right',
endSocket: 'left',

image

Works fine!

Problem

startSocket: 'auto',
endSocket: 'auto',

image

facing issue with line position.

@anseki
Copy link
Owner

anseki commented Dec 28, 2022

Hi @zakk616, thank you for the comment.
You have to specify {startSocket: 'bottom', endSocket: 'top'} to the line, because nobody knows where is a problem and nobody knows a correct line for you.

@zakk616
Copy link
Author

zakk616 commented Dec 28, 2022

Hi @zakk616, thank you for the comment. You have to specify {startSocket: 'bottom', endSocket: 'top'} to the line, because nobody knows where is a problem and nobody knows a correct line for you.

actually these cards are being produced dynamically and the screen size is also responsive, I can not specify {startSocket: 'bottom', endSocket: 'top'} but {startSocket: 'auto', endSocket: 'auto'} so the line should be drawn and redirected automaticaly.

{startSocket: 'bottom', endSocket: 'top'} works fine when on desktop and mobile screen.
Desktop Screen:
image

Mobile Screen:
image

but when cards are shown on medium screens the line direction does not work properly.

@anseki
Copy link
Owner

anseki commented Dec 28, 2022

Sorry, we don't know what the "properly" mean for you.
You can get coordinates of elements easily by using e.g. getBoundingClientRect, to choose a socket that you want.

@zakk616
Copy link
Author

zakk616 commented Dec 30, 2022

to provide startSocket endSocket dynamicaly when the page resizes, one needs to implement getBoundingClientRect to grab new position of the element first and then draw the line on new position and provide startSocket endSocket.

@zakk616 zakk616 closed this as completed Dec 30, 2022
@anseki
Copy link
Owner

anseki commented Dec 30, 2022

Yes. 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants