The declarative port description to expand.
A JointJS port object ready to drop into an element's ports.items.
import { elementPort } from '@joint/react';
// Absolute placement via calc() expressions, relative to the element size.
const outlet = elementPort({ cx: 'calc(w)', cy: 'calc(h/2)', color: 'red' });
// No cx/cy: the port group decides where it sits.
const inlet = elementPort({ shape: 'rect', width: 12, height: 12 });
Builds a full
dia.Element.Portfrom a declarative ElementPort. Whencx/cyare set the port is placed absolutely; when they are omitted the port relies on the positioning of whatever group it is placed in.