getShape

returns the data object of a specified shape

void getShape(string id);

Parameters

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"
}
*/
See also
Back to top