New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Kendo UI Diagram component

Definition

Namespace:Kendo.Mvc.UI

Assembly:Kendo.Mvc.dll

Type Parameters:

TShapeModel

TConnectionModel

Syntax:

C#
public class Diagram<TShapeModel, TConnectionModel> : WidgetBase, IHtmlAttributesContainer where TShapeModel : class where TConnectionModel : class

Inheritance: objectWidgetBaseDiagram<TShapeModel, TConnectionModel>

Implements: IHtmlAttributesContainer

Inherited Members WidgetBase.Render()WidgetBase.ToClientTemplate()WidgetBase.ToHtmlString()WidgetBase.VerifySettings()WidgetBase.WriteDeferredStyles(TextWriter)WidgetBase.DeferStyles()WidgetBase.GetHtml(bool)WidgetBase.GetInitializator()WidgetBase.RenderHtml(TextWriter)WidgetBase.GetElement()WidgetBase.WriteLicensingScript(TextWriter)WidgetBase.WriteMvvmHtml(TextWriter)WidgetBase.WriteDeferredScriptInitialization()WidgetBase.GetService<TService>()WidgetBase.EventsWidgetBase.IdWidgetBase.SanitezeIdWidgetBase.WriterWidgetBase.InitializerWidgetBase.IsInClientTemplateWidgetBase.IsSelfInitializedWidgetBase.HasDeferredInitializationWidgetBase.HtmlAttributesWidgetBase.ScriptAttributesWidgetBase.HtmlHelperWidgetBase.ModelMetadataProviderWidgetBase.NameWidgetBase.ExplorerWidgetBase.SelectorWidgetBase.IdPrefixWidgetBase.ViewContextWidgetBase.ValueProviderWidgetBase.GeneratorWidgetBase.UrlGeneratorWidgetBase.HtmlEncoderWidgetBase.HasClientComponentWidgetBase.UseMvvmInitializationobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the Diagram<TShapeModel, TConnectionModel> class.

C#
public Diagram(ViewContext viewContext)
Parameters:viewContextViewContext

Properties

Accessibility

DiagramAccessibilitySettings<TShapeModel, TConnectionModel>

Defines accessibility options for the diagram.

C#
public DiagramAccessibilitySettings<TShapeModel, TConnectionModel> Accessibility { get; }

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.

C#
public bool? AutoBind { get; set; }

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.

C#
public DiagramConnectionDefaultsSettings<TShapeModel, TConnectionModel> ConnectionDefaults { get; }

Connections

List<DiagramConnection<TShapeModel, TConnectionModel>>

Defines the connections configuration.

C#
public List<DiagramConnection<TShapeModel, TConnectionModel>> Connections { get; set; }

Gets or sets the ConnectionsDataSource.

C#
public DataSource ConnectionsDataSource { get; }

The diagram data source configuration.

C#
public DataSource DataSource { get; }

The diagram data source id.

C#
public string DataSourceId { get; set; }

Editable

DiagramEditableSettings<TShapeModel, TConnectionModel>

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..

C#
public DiagramEditableSettings<TShapeModel, TConnectionModel> Editable { get; }

Layout

DiagramLayoutSettings<TShapeModel, TConnectionModel>

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.

C#
public DiagramLayoutSettings<TShapeModel, TConnectionModel> Layout { get; }

Navigatable

DiagramNavigatableSettings<TShapeModel, TConnectionModel>

Defines the keyboard navigation options for the diagram.

C#
public DiagramNavigatableSettings<TShapeModel, TConnectionModel> Navigatable { get; }

Pannable

DiagramPannableSettings<TShapeModel, TConnectionModel>

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

C#
public DiagramPannableSettings<TShapeModel, TConnectionModel> Pannable { get; }

Pdf

DiagramPdfSettings<TShapeModel, TConnectionModel>

Configures the export settings for the saveAsPDF method.

C#
public DiagramPdfSettings<TShapeModel, TConnectionModel> Pdf { get; }

Selectable

DiagramSelectableSettings<TShapeModel, TConnectionModel>

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.

C#
public DiagramSelectableSettings<TShapeModel, TConnectionModel> Selectable { get; }

ShapeDefaults

DiagramShapeDefaultsSettings<TShapeModel, TConnectionModel>

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

C#
public DiagramShapeDefaultsSettings<TShapeModel, TConnectionModel> ShapeDefaults { get; }

Shapes

List<DiagramShape<TShapeModel, TConnectionModel>>

Defines the shape options.

C#
public List<DiagramShape<TShapeModel, TConnectionModel>> Shapes { get; set; }

The tabIndex value to set on the diagram element.

C#
public double? TabIndex { get; set; }

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.

C#
public string Template { get; set; }

The handler that returns the template used for Template

C#
public string TemplateHandler { get; set; }

The id of the script element used for Template

C#
public string TemplateId { get; set; }

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"

C#
public string Theme { get; set; }

Tooltip

DiagramTooltipSettings<TShapeModel, TConnectionModel>

Defines the tooltip settings for the diagram.

C#
public DiagramTooltipSettings<TShapeModel, TConnectionModel> Tooltip { get; }

The default zoom level of the Diagram in percentages.

C#
public double? Zoom { get; set; }

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

C#
public double? ZoomMax { get; set; }

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.

C#
public double? ZoomMin { get; set; }

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

C#
public double? ZoomRate { get; set; }

Methods

ProcessSettings method.

C#
public override void ProcessSettings()

Overrides: WidgetBase.ProcessSettings()

Serializes the component settings to a dictionary.

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

A dictionary of settings.

Overrides: WidgetBase.Serialize()

SerializeCustomSettings method.

C#
protected virtual void SerializeCustomSettings(IDictionary<string, object> settings)
Parameters:settingsIDictionary<string, object>

SerializeDataSource method.

C#
protected virtual void SerializeDataSource(IDictionary<string, object> settings)
Parameters:settingsIDictionary<string, object>

SerializeSettings method.

C#
protected override Dictionary<string, object> SerializeSettings()
Returns:

Dictionary<string, object>

Overrides: WidgetBase.SerializeSettings()

Writes the HTML.

C#
protected override void WriteHtml(TextWriter writer)
Parameters:writerTextWriter

Overrides: WidgetBase.WriteHtml(TextWriter)

Writes the initialization script.

C#
public override void WriteInitializationScript(TextWriter writer)
Parameters:writerTextWriter

The TextWriter.

Overrides: WidgetBase.WriteInitializationScript(TextWriter)