item

an object with defaults for Diagram elements

object|string item;

Example

webix.ui({
  view: "diagram",
  item: {
    width: 100,
    height: 50,
    type: "heptagon",
  }
});

Related samples

Details

The settings defined in the object are applied to all the elements providing that the elements do not have the corresponding settings of their own. Individual settings of an element override those defined in the item object.

Attributes of the item as object:

  • width (number) - width of the block
  • height (number) - height of the block
  • x (number) - defines the horizontal position of the block. Applicable if autoplacement is disabled
  • y (number) - defines the vertical position of the block. Applicable if autoplacement is disabled
  • template (string, function) - template for the block content
  • type (string) - type of the block shape
  • css (string, function) - CSS class name or a template function that returns class name for blocks.

Named item

It is possible to create an item object separately and then refer to it by its name:

webix.type(webix.ui.diagram, {
    name:"defaults",
    width: 260,
    height: 90
});
 
webix.ui({
    view:"diagram",
    item:"defaults"
});
See also
Back to top