Skip to content

Commit

Permalink
Merge pull request #105 from neuroglia-io/fix-dagre-edge-template
Browse files Browse the repository at this point in the history
Fixed edges template using their own width and height instead of their bounding box's in Blazor.Dagre
  • Loading branch information
JBBianchi authored Aug 14, 2024
2 parents b2e551f + 88d5708 commit ee14b98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Neuroglia.Blazor.Dagre/Templates/ClusterTemplate.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@implements IDisposable

<g class="cluster @Cluster.CssClass" transform="translate(@Cluster.X.ToInvariantString(), @Cluster.Y.ToInvariantString())">
<g id="@Cluster.Id" class="cluster @Cluster.CssClass" transform="translate(@Cluster.X.ToInvariantString(), @Cluster.Y.ToInvariantString())">
<g class="cluster-shape">
@if (Cluster.Shape == NodeShape.Circle)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Neuroglia.Blazor.Dagre/Templates/EdgeTemplate.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<g class="edge-path @Edge.CssClass">
<g id="@($"{Edge.SourceId}-{Edge.TargetId}{(!string.IsNullOrEmpty(Edge.Label) ? $"-{Edge.Label}" : "")}")" class="edge-path @Edge.CssClass">
<path
d="@GetPath(Edge)"
marker-start="@GetDefinitionUrl(Edge.StartMarkerId)"
Expand All @@ -9,8 +9,8 @@
<foreignObject
x="@(LabelCenter.X.ToInvariantString())"
y="@(LabelCenter.Y.ToInvariantString())"
width="@Edge.Bounds.Width.ToInvariantString()"
height="@Edge.Bounds.Height.ToInvariantString()"
width="@Edge.Width.ToInvariantString()"
height="@Edge.Height.ToInvariantString()"
>
<div title="@Edge.Label" class="label-content">@Edge.Label</div>
</foreignObject>
Expand Down
2 changes: 1 addition & 1 deletion src/Neuroglia.Blazor.Dagre/Templates/NodeTemplate.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@implements IDisposable

<g class="node @Node.CssClass" transform="translate(@(Node.X.ToInvariantString()), @(Node.Y.ToInvariantString()))">
<g id="@Node.Id" class="node @Node.CssClass" transform="translate(@(Node.X.ToInvariantString()), @(Node.Y.ToInvariantString()))">
<g class="node-shape">
@if (Node.Shape == NodeShape.Circle)
{
Expand Down

0 comments on commit ee14b98

Please sign in to comment.