Skip to main content
All docs
V24.2

DxSankey.SortOrder Property

Specifies the sort order of Sankey nodes in corresponding columns.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public Dictionary<string, int> SortOrder { get; set; }

Property Value

Type Description
Dictionary<String, Int32>

A collection of nodes and their weights.

Remarks

The Sankey component arranges nodes in columns based on node weights: the heavier the weight, the lower the node appears in the corresponding column. The default weight of all Sankey nodes is 1 – the component displays nodes in the order they are declared in the data source.

The Sankey component allows you to change the default node arrangement: assign a collection of nodes and their new weights to the SortOrder property.

DxSankey - Custom Node Sorting

<DxSankey Data="@Data"
          Width="100%"
          Height="440px"
          SortOrder="@SortOrder"
          SourceFieldName="Source"
          TargetFieldName="Target"
          WeightFieldName="Weight">
   @* ... *@
</DxSankey>

@code {
    IEnumerable<SankeyDataPoint> Data = Enumerable.Empty<SankeyDataPoint>();
    protected override void OnInitialized() {
        Data = GenerateData();
    }
    Dictionary<string, int> SortOrder = new Dictionary<string, int>() {
        { "Spain", 3 },
        { "France", 2 },
        { "New Zealand", 3 }
    };
}
See Also