Table of Contents

Class EdgeVisualManager

Namespace
FlowGraph.Avalonia.Rendering
Assembly
FlowGraph.Avalonia.dll

Manages rendering and tracking of edge visuals including paths, markers, and labels. Responsible for creating, updating, and removing edge UI elements.

public class EdgeVisualManager
Inheritance
EdgeVisualManager
Inherited Members

Constructors

EdgeVisualManager(RenderContext, NodeVisualManager, EdgeRendererRegistry?)

Creates a new edge visual manager.

public EdgeVisualManager(RenderContext renderContext, NodeVisualManager nodeVisualManager, EdgeRendererRegistry? edgeRendererRegistry = null)

Parameters

renderContext RenderContext

Shared render context.

nodeVisualManager NodeVisualManager

Node visual manager for port position calculations.

edgeRendererRegistry EdgeRendererRegistry

Optional registry for custom edge renderers.

Methods

Clear()

Clears all tracked edge visuals. Note: This does not remove them from the canvas.

public void Clear()

GetEdgeEndpointHandles(string)

Gets the endpoint handles for an edge.

public (Ellipse? source, Ellipse? target) GetEdgeEndpointHandles(string edgeId)

Parameters

edgeId string

The edge ID.

Returns

(Ellipse source, Ellipse target)

Tuple of source and target endpoint handles.

GetEdgeGlowPath(string)

Gets the glow path for an edge.

public Path? GetEdgeGlowPath(string edgeId)

Parameters

edgeId string

The edge ID.

Returns

Path

The edge's glow path, or null if not found.

GetEdgeLabel(string)

Gets the label for an edge.

public TextBlock? GetEdgeLabel(string edgeId)

Parameters

edgeId string

The edge ID.

Returns

TextBlock

The edge's label, or null if not found.

GetEdgeMarkers(string)

Gets the markers (arrows) for an edge.

public IReadOnlyList<Path>? GetEdgeMarkers(string edgeId)

Parameters

edgeId string

The edge ID.

Returns

IReadOnlyList<Path>

The edge's markers, or null if not found.

GetEdgeVisiblePath(string)

Gets the visible path for an edge.

public Path? GetEdgeVisiblePath(string edgeId)

Parameters

edgeId string

The edge ID.

Returns

Path

The edge's visible path, or null if not found.

GetEdgeVisual(string)

Gets the hit area path for an edge.

public Path? GetEdgeVisual(string edgeId)

Parameters

edgeId string

The edge ID.

Returns

Path

The edge's hit area path, or null if not found.

HasEdgeVisual(string)

Checks if an edge visual exists in tracking.

public bool HasEdgeVisual(string edgeId)

Parameters

edgeId string

The edge ID to check.

Returns

bool

True if the edge visual exists.

RemoveEdgeVisual(Canvas, Edge)

Removes an edge visual and all its components from the canvas and tracking.

public bool RemoveEdgeVisual(Canvas canvas, Edge edge)

Parameters

canvas Canvas

The canvas containing the visual.

edge Edge

The edge to remove.

Returns

bool

True if the visual was found and removed.

RenderEdge(Canvas, Edge, Graph, ThemeResources)

Renders a single edge with its markers and optional label.

public Path? RenderEdge(Canvas canvas, Edge edge, Graph graph, ThemeResources theme)

Parameters

canvas Canvas

The canvas to render to.

edge Edge

The edge to render.

graph Graph

The graph containing the edge.

theme ThemeResources

Theme resources for styling.

Returns

Path

The created hit area path, or null if rendering failed.

RenderEdges(Canvas, Graph, ThemeResources, Path?)

Renders all edges in the graph to the canvas.

public void RenderEdges(Canvas canvas, Graph graph, ThemeResources theme, Path? excludePath = null)

Parameters

canvas Canvas

The canvas to render to.

graph Graph

The graph containing edges.

theme ThemeResources

Theme resources for styling.

excludePath Path

Optional path to exclude from cleanup.

UpdateEdgeSelection(Edge, ThemeResources)

Updates the selection visual state of an edge. Uses logical (unscaled) dimensions - MatrixTransform handles zoom.

public void UpdateEdgeSelection(Edge edge, ThemeResources theme)

Parameters

edge Edge

The edge to update.

theme ThemeResources

Theme resources for styling.