Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Blazor.Diagrams.Core/Models/LinkModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,11 @@ public LinkModel(string id, NodeModel sourceNode, NodeModel targetNode)

public string? Color { get; set; }
public string? SelectedColor { get; set; }

/// <summary>
/// Set a value equal to values accepted by SVG's 'stroke-dasharray' attribute.
/// For example '5,5' will result in patter where the line is drawn for 5px and not drawn for another 5px.
/// </summary>
public string? DashPattern { get; set; }
public double Width { get; set; } = 2;
}
9 changes: 8 additions & 1 deletion src/Blazor.Diagrams/Components/LinkWidget.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@
var d = result.FullPath.ToString();
}

@{
var extraPathAttributes = new Dictionary<string, object>();
if (!string.IsNullOrEmpty(Link.DashPattern))
extraPathAttributes["stroke-dasharray"] = Link.DashPattern;
}

<path d="@d"
stroke-width="@Link.Width.ToInvariantString()"
fill="none"
stroke="@color" />
stroke="@color"
@attributes="extraPathAttributes"/>

@if (dnlb?.OngoingLink == null || dnlb.OngoingLink != Link)
{
Expand Down