Class DiagramDataSource
Acts as a repository for the collection of objects to be mapped and populated in the layout of the diagram.
Inheritance
System.Object
Syncfusion.Blazor.Diagrams.Internal.SfDiagramBaseExtension
DiagramDataSource
Assembly: Syncfusion.Blazor.dll
Syntax
public class DiagramDataSource : SfDiagramBaseExtension, IBaseInit
Examples
<SfDiagram>
<DiagramDataSource Id = "Name" ParentId="Category" DataSource="@DataSource" DataMapSettings="@Datamap">
<DiagramDataMapSettings>
<DiagramDataMapSetting Property = "Annotations[0].Content" Field="Name"></DiagramDataMapSetting>
</DiagramDataMapSettings>
</DiagramDataSource>
</SfDiagram>
public class HierarchicalDetails
{
public string Name { get; set; }
public string FillColor { get; set; }
public string Category { get; set; }
{
List<DiagramDataMapSetting> Datamap { get; set; } = new List<DiagramDataMapSetting>()
new DiagramDataMapSetting() { Property = "Shape.TextContent", Field = "Name" }
};
//Create the data source with node name and fill color values.
public List<object> DataSource = new List<object>()
{
new HierarchicalDetails(){ Name ="Diagram", Category="",FillColor="#916DAF"},
};
}
Constructors
DiagramDataSource()
Declaration
public DiagramDataSource()
Properties
ChildContent
Represents a segment of UI content, implemented.
Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type |
Description |
Microsoft.AspNetCore.Components.RenderFragment |
|
ConnectionDataSource
Defines the collection of connector’s data source objects.
Declaration
public DiagramConnectionDataSource ConnectionDataSource { get; set; }
Property Value
DataMapSettings
A collection of JSON objects, where each object represents the items mapped to the specific node.
Declaration
public List<DiagramDataMapSetting> DataMapSettings { get; set; }
Property Value
DataSource
A repository for the collection of objects to be mapped and populated in the diagram.
Declaration
public object DataSource { get; set; }
Property Value
Type |
Description |
System.Object |
|
Examples
<SfDiagram>
//Set the DataSource in the DiagramDataSource
<DiagramDataSource DataSource = ”@DataSource”>
</DiagramDataSource>
</SfDiagram>
//Create the data source with node name and fill color values.
public List<object> DataSource = new List<object>()
{
new HierarchicalDetails(){ Name ="Diagram", Category="",FillColor="#916DAF"},
new HierarchicalDetails(){ Name ="Layout", Category="Diagram",FillColor=""},
};
Id
Sets a unique Id for the data source in the diagram.
Declaration
public string Id { get; set; }
Property Value
Type |
Description |
System.String |
|
jsProperty
Declaration
protected override string jsProperty { get; set; }
Property Value
Type |
Description |
System.String |
|
Overrides
Syncfusion.Blazor.Diagrams.Internal.SfDiagramBaseExtension.jsProperty
mainParent
Declaration
protected override SfDiagramBaseExtension mainParent { get; set; }
Property Value
Type |
Description |
Syncfusion.Blazor.Diagrams.Internal.SfDiagramBaseExtension |
|
Overrides
Syncfusion.Blazor.Diagrams.Internal.SfDiagramBaseExtension.mainParent
ParentId
Defines a unique Id for all the Data source items. The ParentId clubs all the data source items as a collection.
Declaration
public string ParentId { get; set; }
Property Value
Type |
Description |
System.String |
|
Root
The Root property is used to set the root (primary) node of the diagram populated from the data source.
Declaration
public string Root { get; set; }
Property Value
Type |
Description |
System.String |
|
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder |
__builder |
|
Dispose()
Declaration
public override void Dispose()
Overrides
Syncfusion.Blazor.Diagrams.Internal.SfDiagramBaseExtension.Dispose()
GetJSNamespace()
Declaration
public string GetJSNamespace()
Returns
Type |
Description |
System.String |
Get the parent namespaces
|
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
Returns asynchronous operation when the component is ready to start, having received its initial parameters from its parent in the render tree
|
Overrides
Declaration
protected override Task OnParametersSetAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
Returns asynchronous operation when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties
|
updateChildProperties(String, Object)
Declaration
public void updateChildProperties(string key, object value)
Parameters
Type |
Name |
Description |
System.String |
key |
|
System.Object |
value |
|