Add shape with automatic connection in pure diagram.js

I’d like to add option to create shape (start as a context pad of other element) with automatic connection between those 2 shapes (new one and the one with context pad).
I’ve found that that there are stuff like hints.connection and hints.connectionTarget in dragging module, but I’m not sure if this is the way how should I go with?
Could you please advice me. Maybe you have similar stuff in other projects.
Thanks in advance.

You can use Modeling#appendShape. The connection should be created automatically (cf. diagram-js/AppendShapeHandler.js at develop · bpmn-io/diagram-js · GitHub) unless you specify otherwise.

Thanks @philippfromme That was the thing that I was looking for :+1:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.