0๐
โ
I got the Object by doing this
var connections = [];
$.each(instance.getAllConnections(), function (idx, connection) {
connections.push({
connectionId: connection.id,
pageSourceId: connection.sourceId,
pageTargetId: connection.targetId,
arrowendpoint1:connection.endpoints[0].anchor.x,
arrowendpoint2:connection.endpoints[0].anchor.y,
arrownendpoint3:connection.endpoints[1].anchor.x,
arrownendpoint4:connection.endpoints[1].anchor.y,
// anchors: $.map(connection.endpoints, function(endpoint) {
// return [[endpoint.anchor.x,
// endpoint.anchor.y,
// endpoint.anchor.getOrientation()[0],
// endpoint.anchor.getOrientation()[1],
// endpoint.anchor.offsets[0],
// endpoint.anchor.offsets[1]
// ]];
// })
});
});
console.log(util.inspect(connections));
Source:stackexchange.com