getShape

returns the data object of a specified shape

void getShape(string id);
idstringshape ID

Example

// get config object of the "dot" type
const dotConfig = $$("diagram1").getShape("dot");

Details

The method returns the configuration object of a type specified as a parameter.

webix.ui({
  view: "diagram",
  id: "diagram1",
  shapes: [
    {
      id: "dot", 
      name: "Final node",
      fontColor: "white", 
      lineColor: "#65C0B7", 
      backgroundColor: "#fff", 
      altBackgroundColor: "#65C0B7"
    },
    // other shapes
  ],
});
 
const dotConfig = $$("diagram1").getShape("dot");
 
/*
{
  id: "dot", 
  name: "Final node",
  fontColor: "white", 
  lineColor: "#65C0B7", 
  backgroundColor: "#fff", 
  altBackgroundColor: "#65C0B7"
}
*/

You can also get a collection of all the shapes (custom and built-in) via the getShapes method.

See also
Back to top