I use jointJS for my academic project, I have this question: how does an element access the position, inPorts, outPorts? For example, we create such an element,
var m1 = new joint.shapes.devs.Model({
position: { x: 50, y: 50 },
size: { width: 90, height: 90 },
inPorts: ['in1','in2'],
outPorts: ['out'],
attrs: {
'.label': { text: 'Model', 'ref-x': .4, 'ref-y': .2 },
rect: { fill: '#2ECC71' },
'.inPorts circle': { fill: '#16A085' },
'.outPorts circle': { fill: '#E74C3C' }
}
});
graph.addCell(m1);
I want to get in positionand inPortsout m1, I tried m1( 'position' )
and m1.position()
, but it didn't work.
Can someone solve this problem? Thank you in advance.
source
share