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

createCurvature calculation options based on node input/output #773

Closed
DannyV14 opened this issue Oct 10, 2023 · 4 comments
Closed

createCurvature calculation options based on node input/output #773

DannyV14 opened this issue Oct 10, 2023 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@DannyV14
Copy link

I have read through this issue multiple times:
#20
I have implemented a switch case very similar to code found in that issue.

I have three different options of curvature.

  1. No center calculation
  2. Center_X calculation
  3. Center_Y calculation

The problem I am facing is that the optimal route of the curve depends heavily on the input/output port being used.
As I have four ports that are input/output ambiguous (stacked on top of each with x-index changing).
Sometimes the horizontal port connecting to a top port should have no curve as the best line.
Or a port across from another would be best with a center_x approach.

I have attached a very poorly drawn guide trying to demonstrate the issue.
Where the curve line runs along the side of the node.
DrawflowConnecitonNodeLogic

All of this to say, what do you think the best approach is here?
I have looked into connection start/connection end/node moved events to try to determine the ports in use.
But the createCurvature function only uses (start_x, start_y, end_x, end_y) so there are null reference possibilities by using variables existing outside of the curve function.

It is possible this is an unsolvable request. But just wanted to reach out for any potential advice!

Thanks!

@jerosoler
Copy link
Owner

Review this PR:

@jerosoler jerosoler self-assigned this Oct 10, 2023
@jerosoler jerosoler added the question Further information is requested label Oct 10, 2023
@DannyV14
Copy link
Author

Looks like that should work! I’ll give it a try.
As always thank you so much for the quick response!

@DannyV14
Copy link
Author

The changes in this PR, can I override the drawflow default functions with these changes in my implementation?

@DannyV14 DannyV14 reopened this Oct 11, 2023
@jerosoler
Copy link
Owner

My recommendation is that you directly copy the file https://github.com/jerosoler/Drawflow/blob/master/src/drawflow.js

And add changes manualy.

You can add it to your project like this:
#526 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants