Table of Contents

Class EdgeStyle

Namespace
FlowGraph.Core.Models
Assembly
FlowGraph.Core.dll

Declarative styling for edge appearance including colors, dash patterns, and effects.

public sealed record EdgeStyle : IEquatable<EdgeStyle>
Inheritance
EdgeStyle
Implements
Inherited Members

Examples

// Create a styled edge
var edge = new Edge(...)
{
    Definition = new EdgeDefinition
    {
        // ... connection info ...
        Style = new EdgeStyle
        {
            StrokeColor = "#E53935",
            StrokeWidth = 3,
            DashPattern = EdgeDashPattern.Dashed,
            AnimatedFlow = true,
            FlowSpeed = 2.0
        }
    }
};

// Use a preset
edge.Definition = edge.Definition with { Style = EdgeStyle.Error };

Remarks

EdgeStyle allows per-edge customization of visual appearance without requiring custom renderers. Styles can be applied directly to edges or used as presets.

Common use cases: - Color-coding edges by data type (red for errors, green for success) - Dashed lines for optional/conditional connections - Animated flow to show data direction - Glow effects to highlight active connections

Properties

ActiveFlow

Active/live data flow style (blue with animation).

public static EdgeStyle ActiveFlow { get; }

Property Value

EdgeStyle

AnimatedFlow

Whether to animate the edge with a flowing effect.

public bool AnimatedFlow { get; init; }

Property Value

bool

Bidirectional

Bidirectional communication style (purple, bidirectional flow).

public static EdgeStyle Bidirectional { get; }

Property Value

EdgeStyle

CustomDashArray

Custom dash array when DashPattern is Custom. Values are dash length, gap length, repeating.

public double[]? CustomDashArray { get; init; }

Property Value

double[]

DashPattern

The dash pattern for the edge stroke.

public EdgeDashPattern DashPattern { get; init; }

Property Value

EdgeDashPattern

DataStream

Fast-paced data transfer style (green, fast animation).

public static EdgeStyle DataStream { get; }

Property Value

EdgeStyle

Debug

Debug/trace style (pink, visible animation).

public static EdgeStyle Debug { get; }

Property Value

EdgeStyle

Default

Default edge style (uses theme defaults).

public static EdgeStyle Default { get; }

Property Value

EdgeStyle

Disabled

Disabled/inactive connection style (gray, dotted).

public static EdgeStyle Disabled { get; }

Property Value

EdgeStyle

Electric

Pulsing electric style (yellow with glow and animation).

public static EdgeStyle Electric { get; }

Property Value

EdgeStyle

Error

Error/invalid connection style (red).

public static EdgeStyle Error { get; }

Property Value

EdgeStyle

FlowDirection

Direction of the animated flow.

public EdgeFlowDirection FlowDirection { get; init; }

Property Value

EdgeFlowDirection

FlowSpeed

Speed of the animated flow effect (1.0 = normal, 2.0 = double speed). Only used when AnimatedFlow is true.

public double FlowSpeed { get; init; }

Property Value

double

Gentle

Slow, gentle flow style (light blue, slow animation).

public static EdgeStyle Gentle { get; }

Property Value

EdgeStyle

Glow

Whether to show a glow effect around the edge.

public bool Glow { get; init; }

Property Value

bool

GlowColor

The glow color as a hex string. If null, uses StrokeColor.

public string? GlowColor { get; init; }

Property Value

string

GlowIntensity

The glow intensity/radius (1.0 = subtle, 3.0 = strong).

public double GlowIntensity { get; init; }

Property Value

double

Heartbeat

Fast heartbeat-style pulse effect (red, quick pulses).

public static EdgeStyle Heartbeat { get; }

Property Value

EdgeStyle

Highlighted

Highlighted/selected style (cyan with glow).

public static EdgeStyle Highlighted { get; }

Property Value

EdgeStyle

Neon

Neon glow style (bright cyan with strong glow and flow).

public static EdgeStyle Neon { get; }

Property Value

EdgeStyle

Opacity

Opacity of the edge (0.0 to 1.0).

public double Opacity { get; init; }

Property Value

double

Pulse

Pulsing glow effect (breathing opacity).

public static EdgeStyle Pulse { get; }

Property Value

EdgeStyle

PulseEffect

Whether to enable pulsing opacity effect.

public bool PulseEffect { get; init; }

Property Value

bool

PulseFrequency

Frequency of pulse effect in Hz (cycles per second).

public double PulseFrequency { get; init; }

Property Value

double

PulseMinOpacity

Minimum opacity during pulse (0.0 to 1.0).

public double PulseMinOpacity { get; init; }

Property Value

double

Rainbow

Rainbow color cycling effect (cycles through all hues).

public static EdgeStyle Rainbow { get; }

Property Value

EdgeStyle

RainbowEffect

Whether to enable rainbow color cycling effect.

public bool RainbowEffect { get; init; }

Property Value

bool

RainbowSpeed

Speed of rainbow color cycling (1.0 = one full cycle per second).

public double RainbowSpeed { get; init; }

Property Value

double

ReverseFlow

Reverse flow style (orange, reverse direction).

public static EdgeStyle ReverseFlow { get; }

Property Value

EdgeStyle

Signal

Signal transmission style (fast-moving pulses).

public static EdgeStyle Signal { get; }

Property Value

EdgeStyle

StrokeColor

The stroke color as a hex string (#RRGGBB or #AARRGGBB). Null means use theme default.

public string? StrokeColor { get; init; }

Property Value

string

StrokeWidth

The stroke width in logical pixels. Null means use settings default.

public double? StrokeWidth { get; init; }

Property Value

double?

Success

Success/valid connection style (green).

public static EdgeStyle Success { get; }

Property Value

EdgeStyle

Warning

Warning/conditional connection style (orange, dashed).

public static EdgeStyle Warning { get; }

Property Value

EdgeStyle

Methods

WithColor(string)

Creates a copy with the specified stroke color.

public EdgeStyle WithColor(string color)

Parameters

color string

Returns

EdgeStyle

WithDash(EdgeDashPattern)

Creates a copy with the specified dash pattern.

public EdgeStyle WithDash(EdgeDashPattern pattern)

Parameters

pattern EdgeDashPattern

Returns

EdgeStyle

WithFlow(double, EdgeFlowDirection)

Creates a copy with animated flow enabled.

public EdgeStyle WithFlow(double speed = 1, EdgeFlowDirection direction = EdgeFlowDirection.Forward)

Parameters

speed double
direction EdgeFlowDirection

Returns

EdgeStyle

WithGlow(double, string?)

Creates a copy with glow effect enabled.

public EdgeStyle WithGlow(double intensity = 1.5, string? color = null)

Parameters

intensity double
color string

Returns

EdgeStyle

WithOpacity(double)

Creates a copy with specified opacity.

public EdgeStyle WithOpacity(double opacity)

Parameters

opacity double

Returns

EdgeStyle

WithPulse(double, double)

Creates a copy with pulsing opacity effect enabled.

public EdgeStyle WithPulse(double frequency = 1, double minOpacity = 0.3)

Parameters

frequency double
minOpacity double

Returns

EdgeStyle

WithRainbow(double)

Creates a copy with rainbow color cycling enabled.

public EdgeStyle WithRainbow(double speed = 0.5)

Parameters

speed double

Returns

EdgeStyle

WithWidth(double)

Creates a copy with specified stroke width.

public EdgeStyle WithWidth(double width)

Parameters

width double

Returns

EdgeStyle