Webix Diagram is a powerful tool for creating diagrams of any complexity. Besides settings via the corresponding API, the widget includes a special interface for managing blocks and their links. To open the Diagram editor, there is a special control in the application interface.
Diagram editor allows you to manage blocks and links via the corresponding interface, namely:
Visually Diagram editor consists of 4 parts:
Toolbar is at the top of the screen and includes special controls for managing the Diagram editor.
Here you can find the following controls:
The Shapes panel is on the left part of the screen. Here you can find shapes divided into special groups. To collapse or expand a group, you can click on its name above. Depending on the configuration, the groups and their shapes may differ.
The Workspace panel is in the center of the screen. It contains blocks and links that make up the diagram. Depending on the mode set (via the icon for switching editor modes), the panel can be displayed with a grid (in setting mode) or without it (in display mode).
In the Workspace panel you can:
All of these operations are covered further in this article.
Scroll the workspace panel with the mouse wheel or by dragging while holding the Ctrl key.
The Settings panel allows you to configure blocks and links. Here you can set both the default settings (for all diagram elements) and individual settings for each particular block and link.
Note that individual settings have a higher priority in comparison with the default ones.
Depending on the selected element, the functionality of the Settings panel will differ.
To set the default settings for all blocks and links at once, click on the free space in the Workspace panel. The Settings panel will display an interface for changing the default settings.
In the Block settings section, you can set the default width and height for all the diagram blocks. The initial width and height of the block are 100 and 45 pixels (if the other dimensions are not specified).
To set the default width or height for all blocks, click on the corresponding input field and type the desired value. You can also use the special arrows (up/down) on the right part of each field (they appear when the mouse pointer is over the field or when the field is in focus).
In the Link arrow section, you can set the type and size for all arrows.
By default, all links are displayed without arrows (the none option).
To set the default arrows type, click on the type selector and select the desired option from the drop-down list.
To set the default arrows size, click on a special input field on the right part of the section and specify the desired value. You can also use the special arrows (up/down) on the right part of this input (they appear when the mouse pointer is over the field or when the field is in focus).
In the Link mode section, you can set the default displaying type for all the diagram links. There are three types of links: "edges", "direct" and "curve". To set either, click on the corresponding icon in the section.
The Diagram editor allows working with blocks, namely:
To add a new block, you need to select a desired shape in the Shapes panel and drag it to any place inside the Workspace.
To copy a block, you need to click on it in the Workspace. A small menu with three icons will be displayed above the top part of the selected block. Click on the clone icon of this menu to copy the block and place its instance from the right side of the original block. The focus moves to the copied instance. All the block parameters and its content will be also copied.
To delete a block, you need to click on it in the Workspace. A small menu with three icons will be displayed above the top part of the selected block. Click on the bin icon to delete the block.
Note that you can also delete the selected block by pressing the "Delete" key.
There are three ways to place blocks:
To use the auto-placement, click on the "Autoplace" button in the Toolbar. This button launches an algorithm that arranges the blocks in the most optimal way, depending on their links.
You can arrange blocks using drag-n-drop.
You can rotate blocks on the workspace using a special control on the right side of a selected block.
To rotate a block around its axis, hold down the rotation control with the left mouse button and move it clockwise or counterclockwise. During block rotation, the arrows will be replaced with the current angle degree.
There are several ways to manage block sizes:
To resize a block, click on it in the Workspace. A rectangular frame with round markers at each corner will be displayed around the selected block. You need to press down any of these markers with the left mouse button, drag it to the desired size and release it.
To define individual settings for a particular block, you need to click on it in the Workspace. The Settings panel will display the individual settings of the block:
Here you can specify:
In the Block settings section you can set the following parameters:
To change any of these parameters, click on the corresponding input field and type in the desired value. You can also use the special arrows (up/down) on the right part of these inputs (they appear when the mouse pointer is over the field or when the field is in focus).
In the Content section you can specify the text that will be displayed in the current block.
In the Fill section you can set the fill color of the current block.
To set the fill color, you need to click on the color selector, select the desired color or specify its HEX code and confirm the selection.
In the Border style section you can set the color, type and thickness of the block border.
To set the border color, click on the color selector, select the desired color or specify its HEX code and confirm the selection.
To set the border type, click on the type selector and select the desired option from the drop-down list.
To set the border thickness, click on the input field on the right part of this section and specify the desired value. You can also use the special arrows (up/down) on the right part of this input (they appear when the mouse pointer is over the field or when the field is in focus).
In the Font section you can set the font parameters for the block content.
Here you can specify:
Note that you cannot set fill color and border style for the text block (Common-Text). These parameters are not provided for this block.
The Diagram editor allows working with links, namely:
To establish a link between blocks, click on the selected block in the Workspace. A small menu with three icons will be displayed above the top part of the selected block. Click on the add link icon to display a rectangular frame with round markers in the middle of each side around the selected block. The same marker will appear in the center of the block itself.
To connect two blocks, press down any block marker with the left mouse button, drag it to one of markers of another block and release the button.
To establish a link with default parameters, you need to connect any of the block markers to one of the side markers of another block.
The result will be as follows:
If you connect the central markers, you will establish the "direct" link between blocks.
The result will be as follows:
To delete a link between blocks, you need to click on this link in the Workspace. A small bin icon will be displayed next to the selected link. Click on this icon to remove the link.
You can move links on the workspace using drag-n-drop. When clicking on a link, the dedicated handles will come up on it.
The oval handles allow you to move the link horizontally and vertically. To do this, hold down the handle with the left mouse button and drag it in the needed direction.
Note, if you move the link with the direct type, it will get the edges type. If such a link has an arrow, you need to make sure that the handle with this arrow is connected to the nearest edge marker of the block. Otherwise, the arrow will be overlapped by the block.
You can change the start and end points of a link dragging it by the round handles on the link edges. You can connect these handles to any marker of the current or any other block, as well as leave them on an empty space of the workspace. To do this, hold down the handle with the left mouse button and drag it to the desired place.
Note, if you leave the handle on an empty space and change the link type or apply the auto-placement, it will return back to the block it was connected to before moving.
You can move the bends of the link with the edges type using the round handles on these bends. To do this, hold down the handle with the left mouse button and drag it to the desired place.
To define individual settings for a particular link, you need to click on it in the Workspace. The Settings panel will display the individual settings of the link:
Here you can specify:
In the Link arrow section you can set the type, direction and size of the current link arrow.
By default, all links are displayed without arrows (the none option).
To set the arrow type, click on the type selector and select the desired option from the drop-down list.
To change the arrow direction, click on the special icon with two arrows.
To set the arrow size, click on the input field on the right part of the section and specify the required value. You can also use the special arrows (up/down) on the right part of this input (they appear when the mouse pointer is over the field or when the field is in focus).
In the Link mode section you can set the current link type. There are special icons to switch between the "edges" and "direct" types.
In the Line style section you can set the color, type and thickness of the current link line.
To set the line color, click on the color selector, select the desired color or specify its HEX code, and confirm the selection.
To set the line type, click on the type selector and select the desired option from the drop-down list.
To set the line thickness, click on the input field on the right part of this section and specify the desired value. You can also use the special arrows (up/down) on the right part of this input (they appear when the mouse pointer is over the field or when the field is in focus).
You can use the Diagram editor to perform the following operations with link labels:
To add a label to a link, you should take the following steps:
You can add multiple labels to one link.
To delete a label, you should take the following steps:
Also, if you delete a link, all the labels connected to it will be deleted too.
You can move the label along the corresponding link using drag-n-drop.
To define individual settings for a label, you need to click on it to open the Settings panel:
For each label you can specify the following settings:
In the Block settings section you can set the following parameters:
In the Position shift section you can define the horizontal (x) and vertical (y) offsets relative to the label position. Starting coordinates are calculated depending on the alignment style: "center", "start" or "end".
In the Alignment relative to link section you can define the position of a label:
By default, a label is aligned in the middle of a corresponding link.
In the Content section you can edit the text of the label.
In the Font section you can set the font parameters for the block content.
Here you can specify:
In the Background section you can enable/disable transparent background for the label.
Back to top