Kendo.Mvc.UI.Fluent.DiagramBuilder

Defines the fluent API for configuring the Kendo UI Diagram

Methods

DataSource(System.Action<Kendo.Mvc.UI.Diagram.Fluent.DiagramDataSourceBuilder<T>>)

Configure the HierarchicalDataSource of the component

Parameters

configurator System.Action<Kendo.Mvc.UI.Diagram.Fluent.DiagramDataSourceBuilder>

The action that configures the M:Kendo.Mvc.UI.Fluent.DiagramBuilder2.DataSource(System.Action{Kendo.Mvc.UI.Diagram.Fluent.DiagramDataSourceBuilder{0}}).

Example (ASPX)

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

ConnectionsDataSource(System.Action<Kendo.Mvc.UI.Diagram.Fluent.DiagramConnectionDataSourceBuilder<T>>)

Configure the DataSource of the component

Parameters

configurator System.Action<Kendo.Mvc.UI.Diagram.Fluent.DiagramConnectionDataSourceBuilder>

The action that configures the M:Kendo.Mvc.UI.Fluent.DiagramBuilder2.ConnectionsDataSource(System.Action{Kendo.Mvc.UI.Diagram.Fluent.DiagramConnectionDataSourceBuilder{1}}).

Example (ASPX)

<%= Html.Kendo().Diagram()
    .Name("diagram")
    .DataSource(dataSource => dataSource
        .Read(read => read
            .Action("_OrgChart", "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

ConnectionDefaults(System.Action<Kendo.Mvc.UI.Fluent.DiagramConnectionDefaultsSettingsBuilder<T,T>>)

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<Kendo.Mvc.UI.Fluent.DiagramConnectionDefaultsSettingsBuilder>

The configurator for the connectiondefaults setting.

Connections(System.Action<Kendo.Mvc.UI.Fluent.DiagramConnectionFactory<T,T>>)

Defines the connections configuration.

Parameters

configurator System.Action<Kendo.Mvc.UI.Fluent.DiagramConnectionFactory>

The configurator for the connections setting.

Editable(System.Action<Kendo.Mvc.UI.Fluent.DiagramEditableSettingsBuilder<T,T>>)

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<Kendo.Mvc.UI.Fluent.DiagramEditableSettingsBuilder>

The configurator for the editable setting.

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.

Layout(System.Action<Kendo.Mvc.UI.Fluent.DiagramLayoutSettingsBuilder<T,T>>)

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.The generic way to apply a layout is by calling the layout() method on the diagram. The method has a single parameter options. It is an object, which can contain parameters which are specific to the layout as well as parameters customizing the global grid layout. Parameters which apply to other layout algorithms can be included but are overlooked if not applicable to the chose layout type. This means that you can define a set of parameters which cover all possible layout types and simply pass it in the method whatever the layout define in the first parameter.

Parameters

configurator System.Action<Kendo.Mvc.UI.Fluent.DiagramLayoutSettingsBuilder>

The configurator for the layout setting.

Pannable(System.Action<Kendo.Mvc.UI.Fluent.DiagramPannableSettingsBuilder<T,T>>)

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

Parameters

configurator System.Action<Kendo.Mvc.UI.Fluent.DiagramPannableSettingsBuilder>

The configurator for the pannable setting.

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.

Pdf(System.Action<Kendo.Mvc.UI.Fluent.DiagramPdfSettingsBuilder<T,T>>)

Configures the export settings for the saveAsPDF method.

Parameters

configurator System.Action<Kendo.Mvc.UI.Fluent.DiagramPdfSettingsBuilder>

The configurator for the pdf setting.

Selectable(System.Action<Kendo.Mvc.UI.Fluent.DiagramSelectableSettingsBuilder<T,T>>)

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<Kendo.Mvc.UI.Fluent.DiagramSelectableSettingsBuilder>

The configurator for the selectable setting.

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.

ShapeDefaults(System.Action<Kendo.Mvc.UI.Fluent.DiagramShapeDefaultsSettingsBuilder<T,T>>)

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

Parameters

configurator System.Action<Kendo.Mvc.UI.Fluent.DiagramShapeDefaultsSettingsBuilder>

The configurator for the shapedefaults setting.

Shapes(System.Action<Kendo.Mvc.UI.Fluent.DiagramShapeFactory<T,T>>)

Defines the shape options.

Parameters

configurator System.Action<Kendo.Mvc.UI.Fluent.DiagramShapeFactory>

The configurator for the shapes setting.

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

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

Theme(System.String)

The diagram theme. This can be either a built-in theme or "sass". When set to "sass" the diagram will read the variables from a Sass-based theme.The supported values are: * "sass" - works only when a custom Sass theme is loaded in the page * "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

Zoom(System.Double)

The default zoom level of the Diagram in percentages.

Parameters

value System.Double

The value for Zoom

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

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

ZoomRate(System.Double)

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

Parameters

value System.Double

The value for ZoomRate

Events(System.Action<Kendo.Mvc.UI.Fluent.DiagramEventBuilder>)

Configures the client-side events.

Parameters

configurator System.Action<Kendo.Mvc.UI.Fluent.DiagramEventBuilder>

The client events action.

Example (ASPX)

@(Html.Kendo().Diagram()
    .Name("Diagram")
    .Events(events => events
        .Add("onAdd")
    )
)
In this article
Not finding the help you need?