-
Notifications
You must be signed in to change notification settings - Fork 69
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
Anchor directionality flips to go "short way" #131
Comments
Hi, thanks for the issue! Indeed this is related to #109. The library is quite limited right now when it comes to drawing shapes 😞 As for the second screenshot, it is related to the other issue that you posted with the portals. |
I have a similar issue with side-anchored arrows. A colleague of mine made a tool for displaying relations between words in a sentence, which are mostly top-down tree-like schemes. I wanted to modify it, so that equal-level relations appear as horizontal arrows - bumping into the issue. Unlike top/down-anchored arrows, side-anchors seem to be nudged by style properties (marginLeft/marginRight). When these overlap in calculation of the anchor position, the arrow is reversed. Compare the results with two variants of justifyContent: |
Thank you for the answer. Yes, it appears, when I define margin for the square box, e.g.:
When I remove the margin entries from the style definition, the arrow looks well, as long as I use the "space-between" for justifyContent in the style for the row. Editing margin here does not seem to affect the arrow.
However, I would rather prefer "center" justification, which is otherwise more neat. I'm just not able to use horizontal arrows. When I define margins, it moves the arrow anchor, as in my first post; when I do not, all the elements are stuffed together like this (ignoring even the 10px defined in rowStyle): |
OK! Can you reproduce your example in a codesandbox so that I can play with it? I wonder if it's a styling tweak or if it should an option in the lib. |
The script uses PHP-generated variables to work, it does not work in Sandbox at all... But here is the source of the resulting web page (contain links to styles), if it helps - e5-6.txt |
May be related to #109.
Anchor flips to the opposite side if target is closer to that side. E.g. for
targetAnchor: 'left', sourceAnchor: 'right'
:And this is how it shows in react portal (without arrowheads):
The text was updated successfully, but these errors were encountered: