# DiagramBuilder

## Properties

### WriteAction - Func

## Methods

### DataSource(System.Action)

Defines the hierarchical DataSource of the Diagram component.

#### Parameters

##### configurator - System.Action<[DiagramDataSourceBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagramdatasourcebuilder)>

The action that configures the Kendo.Mvc.UI.Fluent.DiagramBuilder.DataSource(System.Action{Kendo.Mvc.UI.Fluent.DiagramDataSourceBuilder{}}).

#### RETURNS

A reference to the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

#### Example

```
 
             @(Html.Kendo().Diagram()
                .Name("diagram")
                .DataSource(dataSource => dataSource
                    .Read(read => read
                        .Action("_OrgChart", "Diagram")
                    )
                ))
             
```

### ConnectionsDataSource(System.Action)

Defines the DataSource of the connections.

#### Parameters

##### configurator - System.Action<[DiagramConnectionDataSourceBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagramconnectiondatasourcebuilder)>

The action that configures the Kendo.Mvc.UI.Fluent.DiagramBuilder.ConnectionsDataSource(System.Action{Kendo.Mvc.UI.Fluent.DiagramConnectionDataSourceBuilder{}}).

#### RETURNS

A reference to the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

#### Example

```
 
             @( Html.Kendo().Diagram()
                .Name("diagram")
                .ConnectionsDataSource(dataSource => dataSource
                    .Read(read => read
                        .Action("ConnectionsRead", "Diagram")
                    )
                )
             )
             
```

### AutoBind(System.Boolean)

If set to false the widget will not bind to the data source during initialization. In this case data binding will occur when the change event of the data source is fired. By default the widget will bind to the data source specified in the configuration.

#### Parameters

##### value - `System.Boolean`

The value for AutoBind

#### RETURNS

Returns the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

### Accessibility(System.Action)

Defines accessibility options for the diagram.

#### Parameters

##### configurator - System.Action<[DiagramAccessibilitySettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagramaccessibilitysettingsbuilder)>

The configurator for the accessibility setting.

#### RETURNS

Returns the current instance of [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) .

### ConnectionDefaults(System.Action)

Defines the defaults of the connections. Whenever a connection is created, the specified connectionDefaults will be used and merged with the (optional) configuration passed through the connection creation method.

#### Parameters

##### configurator - System.Action<[DiagramConnectionDefaultsSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagramconnectiondefaultssettingsbuilder)>

The configurator for the connectiondefaults setting.

#### RETURNS

Returns the current instance of [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) .

### Connections(System.Action)

Defines the connections configuration.

#### Parameters

##### configurator - System.Action<[DiagramConnectionFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagramconnectionfactory)>

The configurator for the connections setting.

#### RETURNS

Returns the current instance of [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) .

### Editable(System.Action)

A set of settings to configure the Diagram behavior when the user attempts to: edit, delete or create shapes and connections.; drag shapes.; resize shapes. or rotate shapes..

#### Parameters

##### configurator - System.Action<[DiagramEditableSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrameditablesettingsbuilder)>

The configurator for the editable setting.

#### RETURNS

Returns the current instance of [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) .

### Editable(System.Boolean)

A set of settings to configure the Diagram behavior when the user attempts to: edit, delete or create shapes and connections.; drag shapes.; resize shapes. or rotate shapes..

#### Parameters

##### enabled - `System.Boolean`

Enables or disables the editable option.

#### RETURNS

Returns the current instance of [DiagramEditableSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrameditablesettingsbuilder) .

### Layout(System.Action)

The layout of a diagram consists in arranging the shapes (sometimes also the connections) in some fashion in order to achieve an aesthetically pleasing experience to the user. It aims at giving a more direct insight in the information contained within the diagram and its relational structure.On a technical level, layout consists of a multitude of algorithms and optimizations: analysis of the relational structure (loops, multi-edge occurrence...); connectedness of the diagram and the splitting into disconnected components; crossings of connections or bends and length of links. and various ad-hoc calculations which depend on the type of layout. The criteria on which an algorithm is based vary but the common denominator is: a clean separation of connected components (subgraphs); an orderly organization of the shapes in such a way that siblings are close to another, i.e. a tight packing of shapes which belong together (parent of child relationship) or a minimum of connection crossings. Kendo diagram includes three of the most used layout algorithms which should cover most of your layout needs - tree layout, force-directed layout and layered layout. Please, check the type property for more details regarding each type.

#### Parameters

##### configurator - System.Action<[DiagramLayoutSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagramlayoutsettingsbuilder)>

The configurator for the layout setting.

#### RETURNS

Returns the current instance of [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) .

### Navigatable(System.Action)

Defines the keyboard navigation options for the diagram.

#### Parameters

##### configurator - System.Action<[DiagramNavigatableSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagramnavigatablesettingsbuilder)>

The configurator for the navigatable setting.

#### RETURNS

Returns the current instance of [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) .

### Pannable(System.Action)

Defines the pannable options. Use this setting to disable Diagram pan or change the key that activates the pan behavior.

#### Parameters

##### configurator - System.Action<[DiagramPannableSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrampannablesettingsbuilder)>

The configurator for the pannable setting.

#### RETURNS

Returns the current instance of [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) .

### Pannable(System.Boolean)

Defines the pannable options. Use this setting to disable Diagram pan or change the key that activates the pan behavior.

#### Parameters

##### enabled - `System.Boolean`

Enables or disables the pannable option.

#### RETURNS

Returns the current instance of [DiagramPannableSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrampannablesettingsbuilder) .

### Pdf(System.Action)

Configures the export settings for the saveAsPDF method.

#### Parameters

##### configurator - System.Action<[DiagramPdfSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrampdfsettingsbuilder)>

The configurator for the pdf setting.

#### RETURNS

Returns the current instance of [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) .

### Selectable(System.Action)

Defines the Diagram selection options.By default, you can select shapes in the Diagram in one of two ways: Clicking a single shape to select it and deselect any previously selected shapes. or Holding the Ctrl key while clicking multiple shapes to select them and any other shapes between them.. Using the selectable configuration, you can enable single selection only, enable selection by drawing a rectangular area with the mouse around shapes in the canvas, or disable selection altogether.

#### Parameters

##### configurator - System.Action<[DiagramSelectableSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagramselectablesettingsbuilder)>

The configurator for the selectable setting.

#### RETURNS

Returns the current instance of [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) .

### Selectable(System.Boolean)

Defines the Diagram selection options.By default, you can select shapes in the Diagram in one of two ways: Clicking a single shape to select it and deselect any previously selected shapes. or Holding the Ctrl key while clicking multiple shapes to select them and any other shapes between them.. Using the selectable configuration, you can enable single selection only, enable selection by drawing a rectangular area with the mouse around shapes in the canvas, or disable selection altogether.

#### Parameters

##### enabled - `System.Boolean`

Enables or disables the selectable option.

#### RETURNS

Returns the current instance of [DiagramSelectableSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagramselectablesettingsbuilder) .

### ShapeDefaults(System.Action)

Defines the default options that will be applied to all shapes in the Diagram.

#### Parameters

##### configurator - System.Action<[DiagramShapeDefaultsSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagramshapedefaultssettingsbuilder)>

The configurator for the shapedefaults setting.

#### RETURNS

Returns the current instance of [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) .

### Shapes(System.Action)

Defines the shape options.

#### Parameters

##### configurator - System.Action<[DiagramShapeFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagramshapefactory)>

The configurator for the shapes setting.

#### RETURNS

Returns the current instance of [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) .

### Template(System.String)

The template which renders the content of the shape when bound to a dataSource. The names you can use in the template correspond to the properties used in the dataSource. For an example, refer to the dataSource topic below.

#### Parameters

##### value - `System.String`

The value for Template

#### RETURNS

Returns the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

### TemplateId(System.String)

The template which renders the content of the shape when bound to a dataSource. The names you can use in the template correspond to the properties used in the dataSource. For an example, refer to the dataSource topic below.

#### Parameters

##### templateId - `System.String`

The ID of the template element for Template

#### RETURNS

Returns the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

### TemplateView(Microsoft.AspNetCore.Html.IHtmlContent)

The template which renders the content of the shape when bound to a dataSource. The names you can use in the template correspond to the properties used in the dataSource. For an example, refer to the dataSource topic below.

#### Parameters

##### templateView - `Microsoft.AspNetCore.Html.IHtmlContent`

The view that contains the template for Template

#### RETURNS

Returns the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

### TemplateHandler(System.String)

The template which renders the content of the shape when bound to a dataSource. The names you can use in the template correspond to the properties used in the dataSource. For an example, refer to the dataSource topic below.

#### Parameters

##### templateHandler - `System.String`

The handler that returs the template for Template

#### RETURNS

Returns the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

### Template(Kendo.Mvc.UI.Fluent.TemplateBuilder)

The template which renders the content of the shape when bound to a dataSource. The names you can use in the template correspond to the properties used in the dataSource. For an example, refer to the dataSource topic below.

#### Parameters

##### template - TemplateBuilder\<TModel>

A Template component that configures the template.

#### RETURNS

Returns the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

### Theme(System.String)

The diagram theme. With versions prior to R1 2023 this can be either the respective LESS theme from the list below or "sass". When set to "sass" the diagram will read the variables from a Sass-based theme.Note: Since Q2 2024 release, the default value for the theme property is "sass" instead of "default". It is recommended to use "sass" with version Q2 2024 or later.The supported values are: \* "sass" \* "black" \* "blueopal" \* "bootstrap" \* "bootstrap-v4" - works only with the Bootstrap-v4 Sass theme loaded in the page \* "default" \* "default-v2" - works only with the Default-v2 Sass theme loaded in the page \* "fiori" \* "flat" \* "highcontrast" \* "material" \* "materialBlack" \* "metro" \* "metroblack" \* "moonlight" \* "nova" \* "office365" \* "silver" \* "uniform"

#### Parameters

##### value - `System.String`

The value for Theme

#### RETURNS

Returns the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

### TabIndex(System.Double)

The tabIndex value to set on the diagram element.

#### Parameters

##### value - `System.Double`

The value for TabIndex

#### RETURNS

Returns the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

### Tooltip(System.Action)

Defines the tooltip settings for the diagram.

#### Parameters

##### configurator - System.Action<[DiagramTooltipSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagramtooltipsettingsbuilder)>

The configurator for the tooltip setting.

#### RETURNS

Returns the current instance of [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) .

### Tooltip(System.Boolean)

Defines the tooltip settings for the diagram.

#### Parameters

##### enabled - `System.Boolean`

Enables or disables the tooltip option.

#### RETURNS

Returns the current instance of [DiagramTooltipSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagramtooltipsettingsbuilder) .

### Zoom(System.Double)

The default zoom level of the Diagram in percentages.

#### Parameters

##### value - `System.Double`

The value for Zoom

#### RETURNS

Returns the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

### ZoomMax(System.Double)

The maximum zoom level in percentages. The user will not be allowed to zoom in past this level.

#### Parameters

##### value - `System.Double`

The value for ZoomMax

#### RETURNS

Returns the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

### ZoomMin(System.Double)

The minimum zoom level in percentages. The user will not be allowed to zoom out past this level. You can see an example in zoomMax.

#### Parameters

##### value - `System.Double`

The value for ZoomMin

#### RETURNS

Returns the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

### ZoomRate(System.Double)

The zoom step when using the mouse-wheel to zoom in or out.

#### Parameters

##### value - `System.Double`

The value for ZoomRate

#### RETURNS

Returns the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

### Events(System.Action)

Configures the client-side events.

#### Parameters

##### configurator - System.Action<[DiagramEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrameventbuilder)>

The client events action.

#### RETURNS

Returns the current [DiagramBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/diagrambuilder) instance.

#### Example

```
 
            @(Html.Kendo().Diagram()
                  .Name("Diagram")
                  .Events(events => events
                      .Add("onAdd")
                  )
            )
             
```

### ToComponent()

Returns the internal view component.

#### RETURNS

The  instance that represents the component.

### Expression(System.String)

Sets the name of the component.

#### Parameters

##### modelExpression - `System.String`

The name.

#### RETURNS

Returns the current  instance.

### Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)

Sets the name of the component.

#### Parameters

##### modelExplorer - `Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer`

The name.

#### RETURNS

Returns the current  instance.

### Name(System.String)

Sets the name of the component.

#### Parameters

##### componentName - `System.String`

The name.

#### RETURNS

Returns the current  instance.

### Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean,System.Boolean)

#### Parameters

##### deferred - `System.Boolean`

#### RETURNS

Returns a [DeferredWidgetBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/deferredwidgetbuilder) instance.

### HtmlAttributes(System.Object)

Sets the HTML attributes.

#### Parameters

##### attributes - `System.Object`

The HTML attributes.

#### RETURNS

Returns the current  instance.

### HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

#### Parameters

##### attributes - `System.Collections.Generic.IDictionary<String,Object>`

The HTML attributes.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

##### attributes - `System.Object`

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

##### attributes - `System.Collections.Generic.IDictionary<String,Object>`

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### Render()

Renders the component in place.

### ToHtmlString()

Returns the HTML representation of the component.

### WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

#### Parameters

##### writer - `System.IO.TextWriter`

##### encoder - `System.Text.Encodings.Web.HtmlEncoder`

### ToClientTemplate()

Returns the client template for the component.

### AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

#### Parameters

##### value - `System.Boolean`

#### RETURNS

Returns the current  instance.
