Skip to content
ChartForgeX
Class

GraphClusterRule

ChartForgeX.Interactivity

Namespace
ChartForgeX.Interactivity
Assembly
ChartForgeX.Interactivity
Modifiers
sealed

Describes one structural or host-defined clustering step. Rules run in list order when the scene is rendered, after declared clusters, and each rule only takes nodes that no earlier cluster already holds.

Inheritance

  • object
  • GraphClusterRule

Usage

Explore 21 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 10

Methods

public static GraphClusterRule Connections(string nodeId, Func<GraphSceneNode, bool>? neighbourFilter = null, string idPrefix = "connection") #

Creates a rule that clusters one node with its not yet clustered neighbours.

Parameters

nodeId string required
The node to start from.
neighbourFilter System.Func<ChartForgeX.Interactivity.GraphSceneNode, bool>? = null optional
Optional test a neighbour must pass to join.
idPrefix string = "connection" optional
The cluster id prefix.
public static GraphClusterRule Hubs(int minimumConnections = 3, Func<GraphSceneNode, bool>? neighbourFilter = null, string idPrefix = "hub") #

Creates a rule that clusters each node with at least minimumConnections distinct neighbours together with those neighbours. Hubs are taken from the most connected down, ties by id.

Parameters

minimumConnections int = 3 optional
The connection count that makes a node a hub. Must be at least two.
neighbourFilter System.Func<ChartForgeX.Interactivity.GraphSceneNode, bool>? = null optional
Optional test a neighbour must pass to join its hub.
idPrefix string = "hub" optional
The cluster id prefix.
public static GraphClusterRule Outliers(Func<GraphSceneNode, bool>? leafFilter = null, string idPrefix = "outliers") #

Creates a rule that clusters leaf nodes (exactly one distinct neighbour) with that neighbour, one cluster per neighbour.

Parameters

leafFilter System.Func<ChartForgeX.Interactivity.GraphSceneNode, bool>? = null optional
Optional test a leaf must pass to join.
idPrefix string = "outliers" optional
The cluster id prefix.
public static GraphClusterRule Where(string id, string label, Func<GraphSceneNode, bool> predicate) #

Creates a rule that groups every not yet clustered node the predicate accepts into one cluster. The predicate runs in .NET while the page is built, so the result is part of the static document.

Parameters

id string required
The stable cluster id.
label string required
The cluster label.
predicate System.Func<ChartForgeX.Interactivity.GraphSceneNode, bool> required
The membership test.

Properties

public GraphClusterRuleKind RuleKind { get; } #

Gets what the rule groups.

public string Id { get; } #

Gets the rule id. Predicate rules use it as the cluster id; hub, outlier and connection rules use it as the prefix of ids such as hub-dc01, so the same graph always produces the same cluster ids.

public int MinimumConnections { get; } #

Gets the connection count a node needs to become a hub. Only used by GraphClusterRuleKind.Hubs.

public string? NodeId { get; private set; } #

Gets the node id a connection rule starts from. Only used by GraphClusterRuleKind.Connections.

public Func<GraphSceneNode, bool>? Predicate { get; } #

Gets the node test. Predicate rules use it for membership; the structural rules use it, when set, to decide which neighbours may join (the hub, anchor or start node itself always joins).

public string? Label { get; set; } #

Gets or sets the cluster label. Predicate rules default to the rule id; structural rules default to the hub, anchor or start node label.

public string? Kind { get; set; } #

Gets or sets the cluster kind written to the produced clusters. Defaults to hub, outlier, connection or group.

public bool Collapsed { get; set; } #

Gets or sets whether the produced clusters start collapsed.

Extension Methods

public static GraphClusterRule Collapsed(GraphClusterRule graphClusterRule, bool value = true) #

Sets GraphClusterRule.Collapsed: Gets or sets whether the produced clusters start collapsed.

Parameters

graphClusterRule ChartForgeX.Interactivity.GraphClusterRule required
The instance.
value bool = true optional
The value; true when omitted.

Returns

GraphClusterRule The same instance.

Examples

// C# initializer or property          // C# fluent
graphClusterRule.Collapsed = value;    graphClusterRule.Collapsed(value);
public static GraphClusterRule Kind(GraphClusterRule graphClusterRule, string? value) #

Sets GraphClusterRule.Kind: Gets or sets the cluster kind written to the produced clusters. Defaults to hub, outlier, connection or group.

Parameters

graphClusterRule ChartForgeX.Interactivity.GraphClusterRule required
The instance.
value string? required
The value.

Returns

GraphClusterRule The same instance.

Examples

// C# initializer or property     // C# fluent
graphClusterRule.Kind = value;    graphClusterRule.Kind(value);
public static GraphClusterRule Label(GraphClusterRule graphClusterRule, string? value) #

Sets GraphClusterRule.Label: Gets or sets the cluster label. Predicate rules default to the rule id; structural rules default to the hub, anchor or start node label.

Parameters

graphClusterRule ChartForgeX.Interactivity.GraphClusterRule required
The instance.
value string? required
The value.

Returns

GraphClusterRule The same instance.

Examples

// C# initializer or property      // C# fluent
graphClusterRule.Label = value;    graphClusterRule.Label(value);