Closed rogereyes86 closed 1 year ago
-1 Worked using that comment.
Thanks for your help. Amazing~!
-2 Working like a charm after Import:
setTimeout(function(){
editor.import(dataToImport);
for (var i = 1, b = Object.keys(dataToImport["drawflow"]["Home"]["data"]).length; i <= b; i++)
{
for (var x = 1, c = Object.keys(dataToImport["drawflow"]["Home"]["data"][i]["inputs"]).length; x <= c; x++)
{
if ( Object.keys(dataToImport["drawflow"]["Home"]["data"][i]["inputs"]["input"+x]["connections"]).length > 0 )
{
document.querySelector('#node-'+i+' .input'+x).classList.add("filled");
}
}
}
}, 1000);
Hi, following other questions I was able to implement 2 changes that are working fine:
1- Adjust the connection to be used horizontally. 2- Add and remove a class to the input dot when a connection is successfully made.
So far so good, the problem is when I save the JSON code and then imported it, the following issues occur:
1- The curvature line is a little off the Dots:
Moving the Node it fixes it:
Is there any way to re-render all curvatures after editor.import(dataToImport)?
Maybe calling this function but not sure how to call it from the edit.drawflow:
2- When importing, the class I applied to the input dots is rolled back, any idea how can I reapply this class to each input dot that has a valid connection?:
Before the Import:
After the Import (rolled back to his default class):