StellaOps.ElkSharp
Layered layout of directed graphs: layer assignment, node ordering and placement, and edge routing. Lays out workflow diagrams. Install Installing Stella Ops packagesWorkflow downloads and signaturesnet10.01.0.1-20261118T121708Zdotnet add package StellaOps.
Namespaces
| Namespace | Types |
|---|---|
StellaOps. | 20 |
namespace StellaOps.ElkSharp
| Type | Kind | Description |
|---|---|---|
EdgeRefinementOptions | record | Settings of the pass that reroutes problem edges after the first routing. |
ElkEdge | record | An edge of a graph to lay out. |
ElkEdgeSection | record | A routed section of an edge. |
ElkGraph | record | A graph to lay out: nodes and edges. |
ElkLayoutDirection | enum | The direction of the layers. |
ElkLayoutEffort | enum | How hard the layout works on node order and placement. |
ElkLayoutOptions | record | Settings of an ElkSharp layered layout. |
ElkLayoutResult | record | A laid-out graph: positioned nodes and routed edges. |
ElkNode | record | A node of a graph to lay out. |
ElkPoint | record | A point of a laid-out graph. |
ElkPort | record | A port of a node to lay out. |
ElkPositionedNode | record | A positioned node. |
ElkPositionedPort | record | A positioned port. |
ElkRoutedEdge | record | A routed edge. |
ElkSharpLayeredLayoutEngine | class | The ElkSharp layered layout engine. |
ElkSharpSourceAnalyzer | class | Counts the constructs of a compiled ELK JavaScript source. |
ElkSharpSourceProfile | record | The construct counts of a compiled ELK JavaScript source. |
IElkLayoutEngine | interface | Lays out graphs. |
IterativeRoutingMode | enum | The strategy of the iterative edge routing. |
IterativeRoutingOptions | record | Settings of the iterative edge routing. |
record EdgeRefinementOptions
public sealed record EdgeRefinementOptions
Settings of the pass that reroutes problem edges after the first routing.
Members
| Member | Kind | Summary |
|---|---|---|
EdgeRefinementOptions( | constructor | Creates an instance of Edge. |
BaseObstacleMargin | property | The margin kept around nodes, at least 8 layout units. |
Enabled | property | Whether edges are refined after routing; when not set, on with ElkLayoutEffort.effort and off otherwise. |
MaxGlobalPasses | property | The refinement passes over the whole graph; not negative. |
MaxProblemEdgesPerPass | property | The problem edges refined in one pass, at least 1. |
MaxTrialsPerProblemEdge | property | The reroute trials per problem edge, at least 1. |
SoftObstacleClearance | property | The clearance kept from soft obstacles, at least 8 layout units. |
SoftObstacleWeight | property | The weight of soft obstacles in route costs; not negative. |
constructor EdgeRefinementOptions() #
EdgeRefinementOptions() #public EdgeRefinementOptions()
Creates an instance of Edge.
property BaseObstacleMargin #
BaseObstacleMargin #public double BaseObstacleMargin { get; init; }
The margin kept around nodes, at least 8 layout units. The default is 18.
property Enabled #
Enabled #public bool? Enabled { get; init; }
Whether edges are refined after routing; when not set, on with ElkLayoutEffort.effort and off otherwise.
property MaxGlobalPasses #
MaxGlobalPasses #public int MaxGlobalPasses { get; init; }
The refinement passes over the whole graph; not negative. The default is 2.
property MaxProblemEdgesPerPass #
MaxProblemEdgesPerPass #public int MaxProblemEdgesPerPass { get; init; }
The problem edges refined in one pass, at least 1. The default is 12.
property MaxTrialsPerProblemEdge #
MaxTrialsPerProblemEdge #public int MaxTrialsPerProblemEdge { get; init; }
The reroute trials per problem edge, at least 1. The default is 4.
property SoftObstacleClearance #
SoftObstacleClearance #public double SoftObstacleClearance { get; init; }
The clearance kept from soft obstacles, at least 8 layout units. The default is 14.
property SoftObstacleWeight #
SoftObstacleWeight #public double SoftObstacleWeight { get; init; }
The weight of soft obstacles in route costs; not negative. The default is 0.4.
record ElkEdge
public sealed record ElkEdge
An edge of a graph to lay out.
Members
| Member | Kind | Summary |
|---|---|---|
ElkEdge( | constructor | Creates an instance of ElkEdge. |
Id | property | The edge identifier. |
Kind | property | The edge kind. |
Label | property | The label. |
SourceNodeId | property | The source node. |
SourcePortId | property | The source port, when the edge leaves a port. |
TargetNodeId | property | The target node. |
TargetPortId | property | The target port, when the edge enters a port. |
constructor ElkEdge() #
ElkEdge() #public ElkEdge()
Creates an instance of ElkEdge.
property Id #
Id #public required string Id { get; init; }
The edge identifier.
property Kind #
Kind #public string? Kind { get; init; }
The edge kind.
property Label #
Label #public string? Label { get; init; }
The label.
property SourceNodeId #
SourceNodeId #public required string SourceNodeId { get; init; }
The source node.
property SourcePortId #
SourcePortId #public string? SourcePortId { get; init; }
The source port, when the edge leaves a port.
property TargetNodeId #
TargetNodeId #public required string TargetNodeId { get; init; }
The target node.
property TargetPortId #
TargetPortId #public string? TargetPortId { get; init; }
The target port, when the edge enters a port.
record ElkEdgeSection
public sealed record ElkEdgeSection
A routed section of an edge.
Members
| Member | Kind | Summary |
|---|---|---|
ElkEdgeSection( | constructor | Creates an instance of ElkEdgeSection. |
BendPoints | property | The bends between them. |
EndPoint | property | Where the section ends. |
StartPoint | property | Where the section starts. |
constructor ElkEdgeSection() #
ElkEdgeSection() #public ElkEdgeSection()
Creates an instance of ElkEdgeSection.
property BendPoints #
BendPoints #public IReadOnlyCollection<ElkPoint> BendPoints { get; init; }
The bends between them.
property EndPoint #
EndPoint #public required ElkPoint EndPoint { get; init; }
Where the section ends.
property StartPoint #
StartPoint #public required ElkPoint StartPoint { get; init; }
Where the section starts.
record ElkGraph
public sealed record ElkGraph
A graph to lay out: nodes and edges.
Members
| Member | Kind | Summary |
|---|---|---|
ElkGraph( | constructor | Creates an instance of ElkGraph. |
Edges | property | The edges. |
Id | property | The graph identifier. |
Nodes | property | The nodes. |
constructor ElkGraph() #
ElkGraph() #public ElkGraph()
Creates an instance of ElkGraph.
property Edges #
Edges #public required IReadOnlyCollection<ElkEdge> Edges { get; init; }
The edges.
property Id #
Id #public required string Id { get; init; }
The graph identifier.
property Nodes #
Nodes #public required IReadOnlyCollection<ElkNode> Nodes { get; init; }
The nodes.
enum ElkLayoutDirection
public enum ElkLayoutDirection
The direction of the layers.
| Value | Description |
|---|---|
TopToBottom = 0 | From top to bottom. |
LeftToRight = 1 | From left to right. |
enum ElkLayoutEffort
public enum ElkLayoutEffort
How hard the layout works on node order and placement.
record ElkLayoutOptions
public sealed record ElkLayoutOptions
Settings of an ElkSharp layered layout.
Members
| Member | Kind | Summary |
|---|---|---|
ElkLayoutOptions( | constructor | Creates an instance of ElkLayoutOptions. |
CompoundHeaderHeight | property | The height of a compound node’s header, in layout units. |
CompoundPadding | property | The padding inside a compound node, in layout units. |
Direction | property | The direction of the layers. |
EdgeRefinement | property | The edge refinement pass; the defaults apply when not set. |
Effort | property | How much work the layout spends on quality. |
IterativeRouting | property | The iterative edge routing; the defaults apply when not set. |
LayerSpacing | property | The space between layers, in layout units. |
NodeSpacing | property | The space between nodes of one layer, in layout units. |
OrderingIterations | property | The node ordering iterations, at least 2; when not set, derived from the graph size and the effort. |
PlacementIterations | property | The node placement iterations, at least 1; when not set, derived from the graph size and the effort. |
constructor ElkLayoutOptions() #
ElkLayoutOptions() #public ElkLayoutOptions()
Creates an instance of ElkLayoutOptions.
property CompoundHeaderHeight #
CompoundHeaderHeight #public double CompoundHeaderHeight { get; init; }
The height of a compound node’s header, in layout units. The default is 28.
property CompoundPadding #
CompoundPadding #public double CompoundPadding { get; init; }
The padding inside a compound node, in layout units. The default is 30.
property Direction #
Direction #public ElkLayoutDirection Direction { get; init; }
The direction of the layers. The default is ElkLayoutDirection..
property EdgeRefinement #
EdgeRefinement #public EdgeRefinementOptions? EdgeRefinement { get; init; }
The edge refinement pass; the defaults apply when not set.
property Effort #
Effort #public ElkLayoutEffort Effort { get; init; }
How much work the layout spends on quality. The default is ElkLayoutEffort..
property IterativeRouting #
IterativeRouting #public IterativeRoutingOptions? IterativeRouting { get; init; }
The iterative edge routing; the defaults apply when not set.
property LayerSpacing #
LayerSpacing #public double LayerSpacing { get; init; }
The space between layers, in layout units. The default is 80.
property NodeSpacing #
NodeSpacing #public double NodeSpacing { get; init; }
The space between nodes of one layer, in layout units. The default is 40.
property OrderingIterations #
OrderingIterations #public int? OrderingIterations { get; init; }
The node ordering iterations, at least 2; when not set, derived from the graph size and the effort.
property PlacementIterations #
PlacementIterations #public int? PlacementIterations { get; init; }
The node placement iterations, at least 1; when not set, derived from the graph size and the effort.
record ElkLayoutResult
public sealed record ElkLayoutResult
A laid-out graph: positioned nodes and routed edges.
Members
| Member | Kind | Summary |
|---|---|---|
ElkLayoutResult( | constructor | Creates an instance of ElkLayoutResult. |
Edges | property | The routed edges. |
GraphId | property | The graph identifier. |
Nodes | property | The positioned nodes. |
constructor ElkLayoutResult() #
ElkLayoutResult() #public ElkLayoutResult()
Creates an instance of ElkLayoutResult.
property Edges #
Edges #public required IReadOnlyCollection<ElkRoutedEdge> Edges { get; init; }
The routed edges.
property GraphId #
GraphId #public required string GraphId { get; init; }
The graph identifier.
property Nodes #
Nodes #public required IReadOnlyCollection<ElkPositionedNode> Nodes { get; init; }
The positioned nodes.
record ElkNode
public sealed record ElkNode
A node of a graph to lay out.
Members
| Member | Kind | Summary |
|---|---|---|
ElkNode( | constructor | Creates an instance of ElkNode. |
Height | property | The node height. |
IconKey | property | The icon of the node. |
Id | property | The node identifier. |
Kind | property | The node kind. |
Label | property | The label. |
ParentNodeId | property | The node that contains this one, when it is nested. |
Ports | property | The ports. |
Route | property | The route of a task node. |
SemanticKey | property | The name of what the node stands for. |
SemanticType | property | What the node stands for. |
TaskType | property | The task type of a task node. |
Width | property | The node width. |
constructor ElkNode() #
ElkNode() #public ElkNode()
Creates an instance of ElkNode.
property Height #
Height #public double Height { get; init; }
The node height.
property IconKey #
IconKey #public string? IconKey { get; init; }
The icon of the node.
property Id #
Id #public required string Id { get; init; }
The node identifier.
property Kind #
Kind #public required string Kind { get; init; }
The node kind.
property Label #
Label #public required string Label { get; init; }
The label.
property ParentNodeId #
ParentNodeId #public string? ParentNodeId { get; init; }
The node that contains this one, when it is nested.
property Ports #
Ports #public IReadOnlyCollection<ElkPort> Ports { get; init; }
The ports.
property Route #
Route #public string? Route { get; init; }
The route of a task node.
property SemanticKey #
SemanticKey #public string? SemanticKey { get; init; }
The name of what the node stands for.
property SemanticType #
SemanticType #public string? SemanticType { get; init; }
What the node stands for.
property TaskType #
TaskType #public string? TaskType { get; init; }
The task type of a task node.
property Width #
Width #public double Width { get; init; }
The node width.
record ElkPoint
public sealed record ElkPoint
A point of a laid-out graph.
Members
| Member | Kind | Summary |
|---|---|---|
ElkPoint( | constructor | Creates an instance of ElkPoint. |
X | property | The horizontal position. |
Y | property | The vertical position. |
constructor ElkPoint() #
ElkPoint() #public ElkPoint()
Creates an instance of ElkPoint.
property X #
X #public required double X { get; init; }
The horizontal position.
property Y #
Y #public required double Y { get; init; }
The vertical position.
record ElkPort
public sealed record ElkPort
A port of a node to lay out.
Members
| Member | Kind | Summary |
|---|---|---|
ElkPort( | constructor | Creates an instance of ElkPort. |
Height | property | The port height. |
Id | property | The port identifier. |
Side | property | The side of the node the port is on. |
Width | property | The port width. |
constructor ElkPort() #
ElkPort() #public ElkPort()
Creates an instance of ElkPort.
property Height #
Height #public double Height { get; init; }
The port height.
property Id #
Id #public required string Id { get; init; }
The port identifier.
property Side #
Side #public string? Side { get; init; }
The side of the node the port is on.
property Width #
Width #public double Width { get; init; }
The port width.
record ElkPositionedNode
public sealed record ElkPositionedNode
A positioned node.
Members
| Member | Kind | Summary |
|---|---|---|
ElkPositionedNode( | constructor | Creates an instance of ElkPositionedNode. |
Height | property | The node height. |
IconKey | property | The icon of the node. |
Id | property | The node identifier. |
Kind | property | The node kind. |
Label | property | The label. |
ParentNodeId | property | The node that contains this one, when it is nested. |
Ports | property | The positioned ports. |
Route | property | The route of a task node. |
SemanticKey | property | The name of what the node stands for. |
SemanticType | property | What the node stands for. |
TaskType | property | The task type of a task node. |
Width | property | The node width. |
X | property | The left edge of the node. |
Y | property | The top edge of the node. |
constructor ElkPositionedNode() #
ElkPositionedNode() #public ElkPositionedNode()
Creates an instance of ElkPositionedNode.
property Height #
Height #public double Height { get; init; }
The node height.
property IconKey #
IconKey #public string? IconKey { get; init; }
The icon of the node.
property Id #
Id #public required string Id { get; init; }
The node identifier.
property Kind #
Kind #public required string Kind { get; init; }
The node kind.
property Label #
Label #public required string Label { get; init; }
The label.
property ParentNodeId #
ParentNodeId #public string? ParentNodeId { get; init; }
The node that contains this one, when it is nested.
property Ports #
Ports #public IReadOnlyCollection<ElkPositionedPort> Ports { get; init; }
The positioned ports.
property Route #
Route #public string? Route { get; init; }
The route of a task node.
property SemanticKey #
SemanticKey #public string? SemanticKey { get; init; }
The name of what the node stands for.
property SemanticType #
SemanticType #public string? SemanticType { get; init; }
What the node stands for.
property TaskType #
TaskType #public string? TaskType { get; init; }
The task type of a task node.
property Width #
Width #public double Width { get; init; }
The node width.
property X #
X #public double X { get; init; }
The left edge of the node.
property Y #
Y #public double Y { get; init; }
The top edge of the node.
record ElkPositionedPort
public sealed record ElkPositionedPort
A positioned port.
Members
| Member | Kind | Summary |
|---|---|---|
ElkPositionedPort( | constructor | Creates an instance of ElkPositionedPort. |
Height | property | The port height. |
Id | property | The port identifier. |
Side | property | The side of the node the port is on. |
Width | property | The port width. |
X | property | The left edge of the port. |
Y | property | The top edge of the port. |
constructor ElkPositionedPort() #
ElkPositionedPort() #public ElkPositionedPort()
Creates an instance of ElkPositionedPort.
property Height #
Height #public double Height { get; init; }
The port height.
property Id #
Id #public required string Id { get; init; }
The port identifier.
property Side #
Side #public string? Side { get; init; }
The side of the node the port is on.
property Width #
Width #public double Width { get; init; }
The port width.
property X #
X #public double X { get; init; }
The left edge of the port.
property Y #
Y #public double Y { get; init; }
The top edge of the port.
record ElkRoutedEdge
public sealed record ElkRoutedEdge
A routed edge.
Members
| Member | Kind | Summary |
|---|---|---|
ElkRoutedEdge( | constructor | Creates an instance of ElkRoutedEdge. |
Id | property | The edge identifier. |
Kind | property | The edge kind. |
Label | property | The label. |
Sections | property | The routed sections. |
SourceNodeId | property | The source node. |
SourcePortId | property | The source port, when the edge leaves a port. |
TargetNodeId | property | The target node. |
TargetPortId | property | The target port, when the edge enters a port. |
constructor ElkRoutedEdge() #
ElkRoutedEdge() #public ElkRoutedEdge()
Creates an instance of ElkRoutedEdge.
property Id #
Id #public required string Id { get; init; }
The edge identifier.
property Kind #
Kind #public string? Kind { get; init; }
The edge kind.
property Label #
Label #public string? Label { get; init; }
The label.
property Sections #
Sections #public IReadOnlyCollection<ElkEdgeSection> Sections { get; init; }
The routed sections.
property SourceNodeId #
SourceNodeId #public required string SourceNodeId { get; init; }
The source node.
property SourcePortId #
SourcePortId #public string? SourcePortId { get; init; }
The source port, when the edge leaves a port.
property TargetNodeId #
TargetNodeId #public required string TargetNodeId { get; init; }
The target node.
property TargetPortId #
TargetPortId #public string? TargetPortId { get; init; }
The target port, when the edge enters a port.
class ElkSharpLayeredLayoutEngine
public sealed class ElkSharpLayeredLayoutEngine : IElkLayoutEngine
The ElkSharp layered layout engine.
Members
| Member | Kind | Summary |
|---|---|---|
ElkSharpLayeredLayoutEngine( | constructor | Creates an instance of Elk. |
LayoutAsync( | method | Lays out a graph. |
constructor ElkSharpLayeredLayoutEngine() #
ElkSharpLayeredLayoutEngine() #public ElkSharpLayeredLayoutEngine()
Creates an instance of Elk.
method LayoutAsync(ElkGraph, ElkLayoutOptions, CancellationToken) #
LayoutAsync(ElkGraph, ElkLayoutOptions, CancellationToken) #public Task<ElkLayoutResult> LayoutAsync(ElkGraph graph, ElkLayoutOptions? options = null, CancellationToken cancellationToken = default)
Lays out a graph.
Parameters
graph: The graph.options: The layout options; the defaults when not set.cancellationToken: Cancels the layout.
Returns
The positioned nodes and routed edges.
class ElkSharpSourceAnalyzer
public static class ElkSharpSourceAnalyzer
Counts the constructs of a compiled ELK JavaScript source.
Members
| Member | Kind | Summary |
|---|---|---|
Analyze( | method | Profiles source text. |
AnalyzeFileAsync( | method | Profiles a source file. |
method Analyze(string, string) #
Analyze(string, string) #public static ElkSharpSourceProfile Analyze(string sourceName, string sourceText)
Profiles source text.
Parameters
sourceName: The source name.sourceText: The source text.
Returns
The profile.
method AnalyzeFileAsync(string, CancellationToken) #
AnalyzeFileAsync(string, CancellationToken) #public static Task<ElkSharpSourceProfile> AnalyzeFileAsync(string path, CancellationToken cancellationToken = default)
Profiles a source file.
Parameters
path: The file.cancellationToken: Cancels the read.
Returns
The profile.
record ElkSharpSourceProfile
public sealed record ElkSharpSourceProfile
The construct counts of a compiled ELK JavaScript source.
Members
| Member | Kind | Summary |
|---|---|---|
ElkSharpSourceProfile( | constructor | Creates an instance of Elk. |
CharacterCount | property | The characters. |
CreateForClassCount | property | The createForClass calls. |
DefineClassCount | property | The defineClass calls. |
FunctionCount | property | The function declarations. |
InternConstantCount | property | The $intern_ constants. |
LayoutCommandCount | property | The layout commands. |
LineCount | property | The lines. |
RegisterAlgorithmCount | property | The register calls. |
SourceName | property | The source name. |
constructor ElkSharpSourceProfile() #
ElkSharpSourceProfile() #public ElkSharpSourceProfile()
Creates an instance of Elk.
property CharacterCount #
CharacterCount #public int CharacterCount { get; init; }
The characters.
property CreateForClassCount #
CreateForClassCount #public int CreateForClassCount { get; init; }
The createForClass calls.
property DefineClassCount #
DefineClassCount #public int DefineClassCount { get; init; }
The defineClass calls.
property FunctionCount #
FunctionCount #public int FunctionCount { get; init; }
The function declarations.
property InternConstantCount #
InternConstantCount #public int InternConstantCount { get; init; }
The $intern_ constants.
property LayoutCommandCount #
LayoutCommandCount #public int LayoutCommandCount { get; init; }
The layout commands.
property LineCount #
LineCount #public int LineCount { get; init; }
The lines.
property RegisterAlgorithmCount #
RegisterAlgorithmCount #public int RegisterAlgorithmCount { get; init; }
The register calls.
property SourceName #
SourceName #public required string SourceName { get; init; }
The source name.
interface IElkLayoutEngine
public interface IElkLayoutEngine
Lays out graphs.
Members
| Member | Kind | Summary |
|---|---|---|
LayoutAsync( | method | Lays out a graph. |
method LayoutAsync(ElkGraph, ElkLayoutOptions, CancellationToken) #
LayoutAsync(ElkGraph, ElkLayoutOptions, CancellationToken) #Task<ElkLayoutResult> LayoutAsync(ElkGraph graph, ElkLayoutOptions? options = null, CancellationToken cancellationToken = default)
Lays out a graph.
Parameters
graph: The graph.options: The layout options; the defaults when not set.cancellationToken: Cancels the layout.
Returns
The positioned nodes and routed edges.
enum IterativeRoutingMode
public enum IterativeRoutingMode
The strategy of the iterative edge routing.
| Value | Description |
|---|---|
Legacy | The multi-strategy routing, the default. |
Hybrid | The deterministic hybrid routing. |
record IterativeRoutingOptions
public sealed record IterativeRoutingOptions
Settings of the iterative edge routing.
Members
| Member | Kind | Summary |
|---|---|---|
IterativeRoutingOptions( | constructor | Creates an instance of Iterative. |
Enabled | property | Whether edges are routed iteratively; when not set, on with ElkLayoutEffort.effort and off otherwise. |
MaxAdaptationsPerStrategy | property | The adaptations tried per strategy, from 1 to 100. |
MaxParallelRepairBuilds | property | The repair builds that run in parallel, from 1 to the processor count. |
MaxRepairWaves | property | The repair waves, from 1 to 12. |
Mode | property | The iterative routing strategy. |
RequiredValidSolutions | property | The valid-solution budget of the iterative router, at least 1. |
constructor IterativeRoutingOptions() #
IterativeRoutingOptions() #public IterativeRoutingOptions()
Creates an instance of Iterative.
property Enabled #
Enabled #public bool? Enabled { get; init; }
Whether edges are routed iteratively; when not set, on with ElkLayoutEffort.effort and off otherwise.
property MaxAdaptationsPerStrategy #
MaxAdaptationsPerStrategy #public int MaxAdaptationsPerStrategy { get; init; }
The adaptations tried per strategy, from 1 to 100. The default is 100.
property MaxParallelRepairBuilds #
MaxParallelRepairBuilds #public int MaxParallelRepairBuilds { get; init; }
The repair builds that run in parallel, from 1 to the processor count. The default is 4.
property MaxRepairWaves #
MaxRepairWaves #public int MaxRepairWaves { get; init; }
The repair waves, from 1 to 12. The default is 4.
property Mode #
Mode #public IterativeRoutingMode Mode { get; init; }
The iterative routing strategy. The default is IterativeRoutingMode..
property RequiredValidSolutions #
RequiredValidSolutions #public int RequiredValidSolutions { get; init; }
The valid-solution budget of the iterative router, at least 1. The default is 10.