New to Telerik UI for BlazorStart a free 30-day trial

A component for creating interactive diagrams with shapes and connections. Configure id via Id and handle user interaction with OnShapeClick and OnConnectionClick. Provides serialization APIs: SaveAsJsonAsync() to export and LoadFromJsonAsync(string) to import diagram state. Children: DiagramShapes, DiagramConnections, DiagramShapeDefaults, DiagramConnectionDefaults, DiagramLayout.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

C#
public class TelerikDiagram : DataVizComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentDataVizComponentTelerikDiagram

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members DataVizComponent.OnInitialized()DataVizComponent.OnParametersSet()DataVizComponent.OnAfterRender(bool)DataVizComponent.Dispose()DataVizComponent.Refresh()DataVizComponent.ChildContentDataVizComponent.WidthDataVizComponent.HeightBaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.OnAfterRenderAsync(bool)BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeVoidAsyncWithoutAwait(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnParametersSetAsync()ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)ComponentBase.SetParametersAsync(ParameterView)...

Constructors

C#
public TelerikDiagram()

Methods

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

C#
public Task<string> ExportToPdfAsync(DiagramPdfExportOptions exportOptions = null)
Parameters:exportOptionsDiagramPdfExportOptionsReturns:

Task<string>

C#
public Task<string> ExportToPngAsync(DiagramPngExportOptions exportOptions = null)
Parameters:exportOptionsDiagramPngExportOptionsReturns:

Task<string>

Loads the diagram from JSON.

C#
public Task LoadFromJsonAsync(string json)
Parameters:jsonstringReturns:

Task

Saves the diagram as JSON.

C#
public Task<string> SaveAsJsonAsync()
Returns:

Task<string>

Properties

Specifies the connections data.

C#
[Parameter]
public List<DiagramConnectionDescriptor> ConnectionsData { get; set; }

Specifies the id of the component.

C#
[Parameter]
public string Id { get; set; }

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

C#
[Parameter]
public double? MaxZoom { 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#
[Parameter]
public double? MinZoom { get; set; }

Specifies the connection click event.

C#
[Parameter]
public EventCallback<DiagramConnectionClickEventArgs> OnConnectionClick { get; set; }

Fires when the user finishes dragging connections in the Diagram. Provides information about the connections that were dragged and the connection handle, if applicable.

C#
[Parameter]
public EventCallback<DiagramConnectionDragEndEventArgs> OnConnectionDragEnd { get; set; }

Fires when the user starts dragging connections in the Diagram. Provides information about the connections that started being dragged and the connection handle, if applicable.

C#
[Parameter]
public EventCallback<DiagramConnectionDragStartEventArgs> OnConnectionDragStart { get; set; }

Specifies the shape click event.

C#
[Parameter]
public EventCallback<DiagramShapeClickEventArgs> OnShapeClick { get; set; }

Fires when the user finishes dragging shapes in the Diagram. Provides information about the shapes that were dragged.

C#
[Parameter]
public EventCallback<DiagramShapeDragEndEventArgs> OnShapeDragEnd { get; set; }

Fires when the user starts dragging shapes in the Diagram. Provides information about the shapes that started being dragged.

C#
[Parameter]
public EventCallback<DiagramShapeDragStartEventArgs> OnShapeDragStart { get; set; }

Specifies the shapes data.

C#
[Parameter]
public List<DiagramShapeDescriptor> ShapesData { get; set; }

The default zoom level of the Diagram in percentages.

C#
[Parameter]
public double? Zoom { get; set; }

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

C#
[Parameter]
public double? ZoomRate { get; set; }