Skip to main content
All docs
V25.1
  • DxSankey.GetAllLinksAsync() Method

    Returns all DxSankey links.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    public ValueTask<IEnumerable<SankeyLinkConnectionInfo>> GetAllLinksAsync()

    Returns

    Type Description
    ValueTask<IEnumerable<SankeyLinkConnectionInfo>>

    A structure that stores an awaitable result of an asynchronous operation. The awaitable result is a collection of Sankey links.

    Remarks

    The following code snippet retrieves information about all Sankey nodes and links, and displays their number on a custom button click:

    DxSankey - Display Information About Nodes and Links

    <DxSankey Data="@Data"
              Width="100%"
              Height="440px"
              @ref=@Sankey
              SourceFieldName="Source"
              TargetFieldName="Target"
              WeightFieldName="Weight">
        <DxSankeyNodeSettings Width="8" Spacing="30" />
        <DxSankeyLinkSettings ColorMode="SankeyLinkColorMode.Gradient" />
        <DxTitleSettings Text="Commodity Turnover" />
    </DxSankey>
    
    <DxButton Text="Count nodes and links" Click="@CountNodesAndLinks" />
    
    @Message
    
    @code {
        IEnumerable<SankeyDataPoint> Data = Enumerable.Empty<SankeyDataPoint>();
        protected override void OnInitialized() {
            Data = GenerateData();
        }
    
        DxSankey Sankey;
        string Message { get; set; }
        async Task CountNodesAndLinks() {
            var nodes = await Sankey.GetAllNodesAsync();
            var links = await Sankey.GetAllLinksAsync();
            Message = "The Sankey component contains " + nodes.Count() + " nodes and " +
                      links.Count() + " links.";
        }
    }
    
    See Also