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

Connection Reroute #657

Closed
ghost opened this issue Feb 10, 2023 · 5 comments
Closed

Connection Reroute #657

ghost opened this issue Feb 10, 2023 · 5 comments
Assignees
Labels
question Further information is requested Style

Comments

@ghost
Copy link

ghost commented Feb 10, 2023

Problem:

Strange behavior when adding a retoute point on a connection.

The reroute point seems to be placed incorrectly but can't seem to see any obvious reasons why that would happen

Expected Behavior

Taken from Drawflow example site: https://jerosoler.github.io/Drawflow/

image

Experienced Behavior

On my app

image

This behavior can also be replicated on the CodePen example site: https://codepen.io/KikePuma/pen/OJXXXdb

image

Version:
Css: 0.0.59
JS: 0.0.59

Environment:
Babel
JSX
React
TailwindCss
Jquery

@jerosoler
Copy link
Owner

Hello,

It seems to be a css problem.
Surely some class is interfering.

Example with the minimum of operation.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/gh/jerosoler/Drawflow/dist/drawflow.min.css"
    />
    <script src="https://cdn.jsdelivr.net/gh/jerosoler/Drawflow/dist/drawflow.min.js"></script>
    <style>
      #drawflow {
        position: relative;
        width: 100%;
        height: 800px;
        border: 1px solid red;
      }
      </style>
  </head>
  <body>
    <div>
        <div id="drawflow"></div>  
    </div>
    <script>

    var id = document.getElementById("drawflow");

    const editor = new Drawflow(id);
    editor.reroute  =  true;
   
    editor.start();
    


    editor.addNode('test1', 1, 1, 440, 300, 'test1', {}, '<textarea></textarea><div id="content"></div>');
    editor.addNode('test1', 1, 1, 200, 300, 'test1', {}, '<textarea></textarea><div id="content"></div>');
    
    const nodeA = editor.addNode('NodeA', 1, 1, 440, 300, 'NodeA', {}, 'NodeA');
    const nodeB = editor.addNode('NodeB', 1, 1, 840, 300, 'NodeB', {}, 'NodeB');
    const nodeC = editor.addNode('NodeC', 1, 1, 840, 500, 'NodeC', {}, 'NodeC');
    editor.addConnection(nodeA, nodeB, "output_1", "input_1");	
    editor.addConnection(nodeA, nodeC, "output_1", "input_1");
   
</script> 
  </body>
</html>

It reminds me of one of these issues, see if any of them solve the problem.

@jerosoler jerosoler self-assigned this Feb 11, 2023
@jerosoler jerosoler added question Further information is requested Style labels Feb 11, 2023
@ghost
Copy link
Author

ghost commented Feb 12, 2023

Hi,

Thanks, will give those a look and see if I can find what's causing the conflict

@ghost
Copy link
Author

ghost commented Feb 12, 2023

I my goodness I am so dumb, I completely forgot that I actually copied my drawflow style sheet from that code pen site, when I disable that sheet it works as expected

Vanilla style with all other style sheets enabled (Working)
image

So that works, I found another issue with the adding of reroutes, it seems that when you add a reroute point it adds the point in the right place but the incorrect segment of the svg path is adjusted

image

I will go through the open issues and see if there is already an issue logged for that, if not I'll make a new one

@jerosoler
Copy link
Owner

Use for fix adding points:

editor.reroute_fix_curvature = true;

@ghost
Copy link
Author

ghost commented Feb 12, 2023

Shot, thanks

Keep up the good work :)

@ghost ghost closed this as completed Feb 12, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Style
Projects
None yet
Development

No branches or pull requests

1 participant