Element model attributes
Beside the model attributes which are common for all shapes, elements have its own set of unique model attributes.
Geometry attributes​
position
- coordinates of the element, provided as an object withx
andy
keys. The property may be accessed or set directly using regular mvc.Modelset('position')
/get('position')
methods or through Element'stranslate()
method.angle
- angle of rotation of the element in degrees. The rotation origin is always the center of the element. The property may be accessed or set directly using regular mvc.Modelset('angle')
/get('angle')
methods or through element'srotate()
method.size
- size of the element, provided as an object withwidth
andheight
keys. The property may be accessed or set directly using regular mvc.Modelset('size')
/get('size')
methods or through Element'sresize()
method.
Ports​
You may define and group ports on the element with the ports
attribute. Each can have its own markup and attrs, and its own label. Grouped ports may share properties and behaviors. See the element ports documentation for more information.
Nesting​
Another two model attributes of elements are embeds
and parent
. These two are related to elements that contain or are contained within other elements, forming a hierarchical structure.
embeds
- a list ofid
's of the shapes (cells) that are embedded inside this element.parent
- theid
of the element that is the parent of this element. When a parent element is translated, all its children get translated too.