The declarative element description to convert.
Attributes ready to pass to an element model.
Feed an element model:
import { ElementModel, elementAttributes } from '@joint/react';
const element = new ElementModel(
elementAttributes({
type: 'standard.Rectangle',
position: { x: 10, y: 20 },
size: { width: 120, height: 40 },
portMap: { in: { color: '#fff', cx: 0, cy: 0.5 } }, // preset shorthand
})
);
Normalizes a declarative element description into JointJS cell attributes. The
portMapshorthand is expanded into nativeportsvia elementPorts (and kept on the result asportMap); a nativeportsvalue is passed through untouched. Use it when feeding a ElementModel or building a model'sdefaults().