Elements overview
Elements are the main building blocks of your diagram. JointJS provides extensive capabilities of using elements provided by the library or building your own shapes with any complexity you want.
dia.Elementβ
dia.Element
is a base model for diagram elements. It inherits from dia.Cell with a few additional model attributes and methods specific to elements.
Model attributes specific to elements described in the following section.
dia.ElementViewβ
The view for the dia.Element
model. It inherits from dia.CellView
and is responsible for:
- Rendering an element inside of a paper
- Handling the element's pointer events
- Provides various methods for working with the element (visually)
To find the view associated with a specific element (model), use the findViewByModel method of the paper.
const elementView = paper.findViewByModel(element);
Featuresβ
Elements provides additional features for diagramming.
Portsβ
Ports allow elements to create connection points for links. You can find more information in the ports section.
Nestingβ
To provide functionality for embedding and nestings elements into one another, JointJS give access to the several methods and model attributes.