Class EdgeStyle
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
AnimatedFlow
Whether to animate the edge with a flowing effect.
public bool AnimatedFlow { get; init; }
Property Value
Bidirectional
Bidirectional communication style (purple, bidirectional flow).
public static EdgeStyle Bidirectional { get; }
Property Value
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
DataStream
Fast-paced data transfer style (green, fast animation).
public static EdgeStyle DataStream { get; }
Property Value
Debug
Debug/trace style (pink, visible animation).
public static EdgeStyle Debug { get; }
Property Value
Default
Default edge style (uses theme defaults).
public static EdgeStyle Default { get; }
Property Value
Disabled
Disabled/inactive connection style (gray, dotted).
public static EdgeStyle Disabled { get; }
Property Value
Electric
Pulsing electric style (yellow with glow and animation).
public static EdgeStyle Electric { get; }
Property Value
Error
Error/invalid connection style (red).
public static EdgeStyle Error { get; }
Property Value
FlowDirection
Direction of the animated flow.
public EdgeFlowDirection FlowDirection { get; init; }
Property Value
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
Gentle
Slow, gentle flow style (light blue, slow animation).
public static EdgeStyle Gentle { get; }
Property Value
Glow
Whether to show a glow effect around the edge.
public bool Glow { get; init; }
Property Value
GlowColor
The glow color as a hex string. If null, uses StrokeColor.
public string? GlowColor { get; init; }
Property Value
GlowIntensity
The glow intensity/radius (1.0 = subtle, 3.0 = strong).
public double GlowIntensity { get; init; }
Property Value
Heartbeat
Fast heartbeat-style pulse effect (red, quick pulses).
public static EdgeStyle Heartbeat { get; }
Property Value
Highlighted
Highlighted/selected style (cyan with glow).
public static EdgeStyle Highlighted { get; }
Property Value
Neon
Neon glow style (bright cyan with strong glow and flow).
public static EdgeStyle Neon { get; }
Property Value
Opacity
Opacity of the edge (0.0 to 1.0).
public double Opacity { get; init; }
Property Value
Pulse
Pulsing glow effect (breathing opacity).
public static EdgeStyle Pulse { get; }
Property Value
PulseEffect
Whether to enable pulsing opacity effect.
public bool PulseEffect { get; init; }
Property Value
PulseFrequency
Frequency of pulse effect in Hz (cycles per second).
public double PulseFrequency { get; init; }
Property Value
PulseMinOpacity
Minimum opacity during pulse (0.0 to 1.0).
public double PulseMinOpacity { get; init; }
Property Value
Rainbow
Rainbow color cycling effect (cycles through all hues).
public static EdgeStyle Rainbow { get; }
Property Value
RainbowEffect
Whether to enable rainbow color cycling effect.
public bool RainbowEffect { get; init; }
Property Value
RainbowSpeed
Speed of rainbow color cycling (1.0 = one full cycle per second).
public double RainbowSpeed { get; init; }
Property Value
ReverseFlow
Reverse flow style (orange, reverse direction).
public static EdgeStyle ReverseFlow { get; }
Property Value
Signal
Signal transmission style (fast-moving pulses).
public static EdgeStyle Signal { get; }
Property Value
StrokeColor
The stroke color as a hex string (#RRGGBB or #AARRGGBB). Null means use theme default.
public string? StrokeColor { get; init; }
Property Value
StrokeWidth
The stroke width in logical pixels. Null means use settings default.
public double? StrokeWidth { get; init; }
Property Value
Success
Success/valid connection style (green).
public static EdgeStyle Success { get; }
Property Value
Warning
Warning/conditional connection style (orange, dashed).
public static EdgeStyle Warning { get; }
Property Value
Methods
WithColor(string)
Creates a copy with the specified stroke color.
public EdgeStyle WithColor(string color)
Parameters
colorstring
Returns
WithDash(EdgeDashPattern)
Creates a copy with the specified dash pattern.
public EdgeStyle WithDash(EdgeDashPattern pattern)
Parameters
patternEdgeDashPattern
Returns
WithFlow(double, EdgeFlowDirection)
Creates a copy with animated flow enabled.
public EdgeStyle WithFlow(double speed = 1, EdgeFlowDirection direction = EdgeFlowDirection.Forward)
Parameters
speeddoubledirectionEdgeFlowDirection
Returns
WithGlow(double, string?)
Creates a copy with glow effect enabled.
public EdgeStyle WithGlow(double intensity = 1.5, string? color = null)
Parameters
Returns
WithOpacity(double)
Creates a copy with specified opacity.
public EdgeStyle WithOpacity(double opacity)
Parameters
opacitydouble
Returns
WithPulse(double, double)
Creates a copy with pulsing opacity effect enabled.
public EdgeStyle WithPulse(double frequency = 1, double minOpacity = 0.3)
Parameters
Returns
WithRainbow(double)
Creates a copy with rainbow color cycling enabled.
public EdgeStyle WithRainbow(double speed = 0.5)
Parameters
speeddouble
Returns
WithWidth(double)
Creates a copy with specified stroke width.
public EdgeStyle WithWidth(double width)
Parameters
widthdouble