DiagramBuilder
Properties
WriteAction - Func
Methods
DataSource(System.Action)
Defines the hierarchical DataSource of the Diagram component.
Parameters
configurator - System.Action<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 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>
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 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 instance.
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>
The configurator for the connectiondefaults setting.
RETURNS
Returns the current instance of DiagramBuilder .
Connections(System.Action)
Defines the connections configuration.
Parameters
configurator - System.Action<DiagramConnectionFactory>
The configurator for the connections setting.
RETURNS
Returns the current instance of 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>
The configurator for the editable setting.
RETURNS
Returns the current instance of 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 .
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.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<DiagramLayoutSettingsBuilder>
The configurator for the layout setting.
RETURNS
Returns the current instance of 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>
The configurator for the pannable setting.
RETURNS
Returns the current instance of 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 .
Pdf(System.Action)
Configures the export settings for the saveAsPDF method.
Parameters
configurator - System.Action<DiagramPdfSettingsBuilder>
The configurator for the pdf setting.
RETURNS
Returns the current instance of 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>
The configurator for the selectable setting.
RETURNS
Returns the current instance of 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 .
ShapeDefaults(System.Action)
Defines the default options that will be applied to all shapes in the Diagram.
Parameters
configurator - System.Action<DiagramShapeDefaultsSettingsBuilder>
The configurator for the shapedefaults setting.
RETURNS
Returns the current instance of DiagramBuilder .
Shapes(System.Action)
Defines the shape options.
Parameters
configurator - System.Action<DiagramShapeFactory>
The configurator for the shapes setting.
RETURNS
Returns the current instance of 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 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 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 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 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 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 instance.
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 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 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 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 instance.
Events(System.Action)
Configures the client-side events.
Parameters
configurator - System.Action<DiagramEventBuilder>
The client events action.
RETURNS
Returns the current 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
RETURNS
Returns the current instance.
Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)
Sets the name of the component.
Parameters
modelExplorer - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer
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
Parameters
deferred - System.Boolean
RETURNS
Returns a 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.