Class
TelerikDiagram

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:

cs-api-definition
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

TelerikDiagram()

Declaration

cs-api-definition
public TelerikDiagram()

Properties

ConnectionsData

Specifies the connections data.

Declaration

cs-api-definition
[Parameter]
public List<DiagramConnectionDescriptor> ConnectionsData { get; set; }

Property Value

List<DiagramConnectionDescriptor>

Id

Specifies the id of the component.

Declaration

cs-api-definition
[Parameter]
public string Id { get; set; }

Property Value

string

MaxZoom

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

Declaration

cs-api-definition
[Parameter]
public double? MaxZoom { get; set; }

Property Value

double?

MinZoom

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.

Declaration

cs-api-definition
[Parameter]
public double? MinZoom { get; set; }

Property Value

double?

OnConnectionClick

Specifies the connection click event.

Declaration

cs-api-definition
[Parameter]
public EventCallback<DiagramConnectionClickEventArgs> OnConnectionClick { get; set; }

Property Value

EventCallback<DiagramConnectionClickEventArgs>

OnConnectionDragEnd

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

Declaration

cs-api-definition
[Parameter]
public EventCallback<DiagramConnectionDragEndEventArgs> OnConnectionDragEnd { get; set; }

Property Value

EventCallback<DiagramConnectionDragEndEventArgs>

OnConnectionDragStart

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.

Declaration

cs-api-definition
[Parameter]
public EventCallback<DiagramConnectionDragStartEventArgs> OnConnectionDragStart { get; set; }

Property Value

EventCallback<DiagramConnectionDragStartEventArgs>

OnShapeClick

Specifies the shape click event.

Declaration

cs-api-definition
[Parameter]
public EventCallback<DiagramShapeClickEventArgs> OnShapeClick { get; set; }

Property Value

EventCallback<DiagramShapeClickEventArgs>

OnShapeDragEnd

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

Declaration

cs-api-definition
[Parameter]
public EventCallback<DiagramShapeDragEndEventArgs> OnShapeDragEnd { get; set; }

Property Value

EventCallback<DiagramShapeDragEndEventArgs>

OnShapeDragStart

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

Declaration

cs-api-definition
[Parameter]
public EventCallback<DiagramShapeDragStartEventArgs> OnShapeDragStart { get; set; }

Property Value

EventCallback<DiagramShapeDragStartEventArgs>

ShapesData

Specifies the shapes data.

Declaration

cs-api-definition
[Parameter]
public List<DiagramShapeDescriptor> ShapesData { get; set; }

Property Value

List<DiagramShapeDescriptor>

Zoom

The default zoom level of the Diagram in percentages.

Declaration

cs-api-definition
[Parameter]
public double? Zoom { get; set; }

Property Value

double?

ZoomRate

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

Declaration

cs-api-definition
[Parameter]
public double? ZoomRate { get; set; }

Property Value

double?

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

LoadFromJsonAsync(string)

Loads the diagram from JSON.

Declaration

cs-api-definition
public Task LoadFromJsonAsync(string json)

Parameters

json

string

Returns

Task

SaveAsJsonAsync()

Saves the diagram as JSON.

Declaration

cs-api-definition
public Task<string> SaveAsJsonAsync()

Returns

Task<string>