Closed ghost closed 1 year ago
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.
Hi,
Thanks, will give those a look and see if I can find what's causing the conflict
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)
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
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
Use for fix adding points:
editor.reroute_fix_curvature = true;
Shot, thanks
Keep up the good work :)
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/
Experienced Behavior
On my app
This behavior can also be replicated on the CodePen example site: https://codepen.io/KikePuma/pen/OJXXXdb
Version: Css: 0.0.59 JS: 0.0.59
Environment: Babel JSX React TailwindCss Jquery