A JS library for connecting graphical nodes


I am looking for a JS libary allowing all major features for connecting complex cardlike nodes.

This is an example node I am talking about:

I need any number of connecting ports (represented by colorful circles in the picture), any number of captions with ability to dynamically change them, ability to add buttons. Fully customizable. And then pan, zoom, drag and drop ability.

I am looking into vis.js Network library but it seems to offer only simple shapes, just one caption is possible, all the connections go to the center of the object and not to ports. An object in this library is not HTML but a canvas object.