I tried some libraries such as D3 or jsPlumb to emulate this behaviour. But there are no examples to do it.