getShapes

returns a collection of shapes

void getShapes();

Example

// get an array of all the shapes
$$("diagram").getShapes().serialize();
/*
  [
    {
      backgroundColor: "#fff",
      group: "Extra",
      id: "laptop",
      name: "Laptop",
      template: /* svg code*/
    },
    // other shapes
  ]
*/

Details

The method returns a collection of shapes (incl. custom and predefined shapes). You can serialize the collection to get an array of the shape objects as in the examble above.

If you need to retrieve a single shape, use the getShape method.

See also
Back to top