Sockets

Sockets are used to determine which inputs and outputs can be connected. This can indicate the type of data that can be transferred from one node to another.

First of all you should declare all sockets that will be used in the editor

var numSocket = new D3NE.Socket('number', 'Number value', 'hint');
var strSocket = new D3NE.Socket('string', 'String', 'hint');

First parameter id must be unique. With the same class name, styles must be defined to make the sockets visually different (not only background)

.socket.number{
    background: #96b38a
}

As a result you can connect only the inputs and outputs with the same sockets. Although there may be situations when you need to connect different sockets. To do this, there is a method combineWith:

var anyTypeSocket = new D3NE.Socket('any', 'Any type', 'hint');
numSocket.combineWith(anyTypeSocket);

Now you can connect numSocket to anyTypeSocket, but not vice versa