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

Feature request: reverse arrow style #77

Closed
jamesdbrock opened this issue Jan 10, 2020 · 5 comments
Closed

Feature request: reverse arrow style #77

jamesdbrock opened this issue Jan 10, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@jamesdbrock
Copy link

Thanks for this library @pierpo , it's very nice.

The way element relations work, all relations to a source element must be known at the time the source element is rendered. Sometimes it would be programmatically convenient to express all relations to a target element instead of a source element. We could accomplish this by adding a single flag to the arrow style that indicates that instead of being drawn forward, with the arrowhead pointing at the target, the arrow should be draw backward, with the arrowhead pointing at the source.

Style
{
  strokeColor: string,
  strokeWidth: number,
  strokeDasharray: number,
  arrowLength: number,
  arrowThickness: number,
  noCurves: boolean,
  arrowForward?: boolean    // New property. Defaults to True.
}

Then in generateAllArrowMarkers draw the arrowhead pointing at the source if the arrowForward property is False.

@pierpo pierpo added the enhancement New feature or request label Mar 12, 2020
@pierpo
Copy link
Owner

pierpo commented Mar 12, 2020

It makes sense indeed. I'll have a look when I find some time!
Thank you for the suggestion 🤗

(sorry I took so long to answer, I guess I missed the notification!)

@viztor
Copy link
Contributor

viztor commented Sep 16, 2020

solution should be the same as #79

@mstykow
Copy link

mstykow commented Oct 11, 2020

Any update on this? This would be very nice to have: i just had to write a whole bunch of logic (useState, useEffect) in order to pass the children's ids back up to the parent component from whence arrows are drawn when a simple switch in direction would have been a one-liner.

@jfo84
Copy link
Contributor

jfo84 commented Oct 12, 2020

@mstykow This is not a particularly simple piece of work. You can always fork the library and put up a PR

@pierpo
Copy link
Owner

pierpo commented May 13, 2021

Should be solved by #139 😉

@pierpo pierpo closed this as completed May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants