Draw lines between UI elements

I was looking for a while how I could rely between my UI elements image or buttons.
And I found recently a good example for what I want to do:

Please could any body tell me the way on how I could arrive at a similar result ?

Thank you.

depend on Unity version :

I’m using Unity 5.1.3f1

here is where to start

I don’t see the utility of the script, I attach it to the scene and nothing happen.
Sorry I’m newbies.

add en empty gameobject wit the script attached as a child of a UI canvas

you can add more vertices, and change the positions that way you can have your line

The script draw an image in the canvas and nothing else…

The goal is to draw an hierarchy of UI elements !

yes it’s true!!

you have to change it as you need

What’s mean I change it as I need, I mean I could create it using graphics what’s the advantage?

I mean it depend on the application

for example relying between my UI elements image or buttons

if the buttons and the UI elements are in static position yes you can use a static graphics line

if your UI elements change there positions (by drag or any other events) maybe using graphics is not appropriate

I see. If I do static position for example to avoid problems. Could I arrive at the end to get a flexible hierarchy ?

static position / flexible hierarchy ?!

if you can give a simple example, would be better

Sorry, it would be flexible not static…
The example would be the video above