DxSankey.NodeClick Event
Fires when a user clicks a DxSankey node.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public EventCallback<SankeyNodeClickEventArgs> NodeClick { get; set; }
Event Data
The NodeClick event's data class is SankeyNodeClickEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Node | Returns the clicked node. |
Remarks
Handle the NodeClick
event to respond to clicks on nodes.
The following code snippet handles the NodeClick
event and displays information about the clicked node and associated links:
<DxSankey Data="@Data"
Width="100%"
Height="440px"
NodeClick="@OnNodeClick"
SourceFieldName="Source"
TargetFieldName="Target"
WeightFieldName="Weight">
<DxSankeyNodeSettings Width="8" Spacing="30" />
<DxSankeyLinkSettings ColorMode="SankeyLinkColorMode.Gradient" />
<DxTitleSettings Text="Commodity Turnover" />
</DxSankey>
@Message
@code {
IEnumerable<SankeyDataPoint> Data = Enumerable.Empty<SankeyDataPoint>();
protected override void OnInitialized() {
Data = GenerateData();
}
string Message { get; set; }
void OnNodeClick(SankeyNodeClickEventArgs args) {
var node = args.Node;
Message = "The clicked node: " + node.Label + ". " +
"Incoming links: " + node.LinksIn.Length + ". " +
"Outgoing links: " + node.LinksOut.Length + ".";
}
}
See Also