From the API for joint.dia.Graph:
joint.dia.Graph is the model holding all the cells (elements and links) of the diagram. It's a Backbone model. The collection of all the cells is stored in the property cells.
So the expected JSON should be in this form: { cells: [] }
. Where cells
is an array of both elements and links. Each element should have the form:
{
id: <string>,
type: '<type of shape>',
attrs: { <attrs> },
position: { x: <int>, y: <int> },
angle: <deg>,
size: { width: <int>, height: <int> },
z: <int>,
... and some other, maybe custom, data properties
}
Reference: Using Server Data with JointJS