Dynamic line drawing

I’d like to draw a line connecting two elements. Which two elements is not known until the user has chosen them meaning that the line needs to be drawn dynamically.

I’m considering inserting an SVG or DIV element into the dom and setting the size and position accordingly.

However, as Saola adds the elements on loading the scene, I was wondering if there is anything already built-in that would make this easier?


Hi mackavi,

In any way, you must insert line connectors when editing the project.
After that, you can show/hide, and use script to adjust their size and position dynamically to connect elements.
We also want to allow adding elements dynamically, but it’s still not available in the upcoming version 3 due to some technical limitations.


Thanks Toan,

It’s not a necessary feature of the project and I’m going to leave it out for now. The project can be seen in today’s post.