NetworkMark<T> Class
Draws a network graph (a node-link diagram) with a row per link: the nodes are placed by the force-directed layout of d3-force, where the links are springs and the nodes repel each other, then the drawing is fitted to the plot area. The layout is deterministic: it runs a fixed number of ticks from fixed starting positions.
public sealed class NetworkMark<T> : Mark<T>Type parameters
T- The type of the rows: the links.
Remarks
The nodes are the names that the links reference, in the order they appear. NetworkMark<T>.NodeFill colors them with the color scale; Mark<T>.Stroke colors the links.
- Inheritance
Mark<T>NetworkMark<T>
Constructors
| Name | Description |
|---|---|
| NetworkMark(IEnumerable<T>, Func<T, object?>, Func<T, object?>) | Initializes a new instance of the NetworkMark<T> class. |
NetworkMark(IEnumerable<T>, Func<T, object?>, Func<T, object?>)
NetworkMark.csInitializes a new instance of the NetworkMark<T> class.
public NetworkMark(IEnumerable<T> data, Func<T, object?> source, Func<T, object?> target)Parameters
dataIEnumerable<T>- The rows: the links.
sourceFunc<T, object?>- The channel of the name of a node of the link.
targetFunc<T, object?>- The channel of the name of the other node of the link.
Properties
| Name | Description |
|---|---|
| Charge | Gets or sets the strength of the force between every pair of nodes: negative values repel, positive values attract. The default is -30, as d3. |
| Iterations | Gets or sets the number of ticks of the simulation. The default is 300, as d3: the number of ticks until the simulation cools down. |
| LinkDistance | Gets or sets the length of the springs of the links, before the drawing is fitted to the plot area. The default is 30, as d3. |
| LinkOpacity | Gets or sets the opacity of the links, from 0 to 1. The default is 0.6. |
| NodeFill | Gets or sets the channel of the fill color of a node, from its name, mapped by the color scale, or null to use Mark<T>.FillColor. |
| NodeRadius | Gets or sets the radius of the nodes. The default is 5. |
| ShowLabels | Gets or sets a value that indicates whether the names of the nodes are drawn on their right. The default is true. |
| Source | Gets the channel of the name of a node of the link. |
| Target | Gets the channel of the name of the other node of the link. |
Charge
NetworkMark.csIterations
NetworkMark.csGets or sets the number of ticks of the simulation. The default is 300, as d3: the number of ticks until the simulation cools down.
public int Iterations { get; set; }LinkDistance
NetworkMark.csLinkOpacity
NetworkMark.csNodeFill
NetworkMark.csGets or sets the channel of the fill color of a node, from its name, mapped by the color scale, or null to use Mark<T>.FillColor.
Property value
NodeRadius
NetworkMark.csShowLabels
NetworkMark.csSource
NetworkMark.csGets the channel of the name of a node of the link.
Property value
Target
NetworkMark.csGets the channel of the name of the other node of the link.