jointjs

What is the difference between an "Element" and a "Cell"?


When I read the documentation on JointJS, I find that there are discussions on "Elements" and "Cells". What are the differences between them?


Solution

  • In JointJS, the core items on the graph (diagram) are "Elements" and "Links". Think of an element as the visualization of a node such as a rectangle or circle and a link being a "wire" connecting the two. The elements and links are the fundamental building blocks in a JointJS model. Together, these are termed "cells". So an element is an example of a cell and a link is also an example of a cell.

    For example, if we ask the diagram to find me all the cells, it will return a set of all elements and links.