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

Not drawing to Target #69

Open
hellochar opened this issue Oct 17, 2019 · 1 comment
Open

Not drawing to Target #69

hellochar opened this issue Oct 17, 2019 · 1 comment
Labels
bug Something isn't working drawing shape enhancement New feature or request

Comments

@hellochar
Copy link

hellochar commented Oct 17, 2019

Nice library. I'm trying to get an arrow to connect the tops of two adjacent elements:

const relations = [{
  targetId: "element" + (i+1),
  sourceAnchor: "top",
  targetAnchor: "top"
}]

But it seems to misunderstand where "top" is on the target:

image

I'd like for the line to come out the top and curve back down into the top of the target. Weirdly it works if I actually put the elements below each other:

image

But if I then try to go from the right->top or bottom->top, it still breaks:

image

image

It seems the library is calculating arrowhead direction based on the vertical offset of start and end points, when it should be instead dictated by the anchor itself (a "top" anchor should always have an arrowhead pointing down into it at the top)

Full code at: https://codesandbox.io/s/dynamic-number-and-ticker-and-lookatmouseelement-jy8uv , scroll down in the page and look at Arrows.tsx

@pierpo
Copy link
Owner

pierpo commented Oct 24, 2019

Hi @hellochar!

Thank you for reporting this. I had not anticipated this kind of layout when I implemented the position computation algorithm.

I need to think this through. No ETA yet, sorry 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working drawing shape enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants