Blazor-Diagrams / Blazor.Diagrams

A fully customizable and extensible all-purpose diagrams library for Blazor
https://blazor-diagrams.zhaytam.com
MIT License
919 stars 176 forks source link

Link without svg path #267

Closed elgransan closed 1 year ago

elgransan commented 1 year ago

Hi, I'm creating a link between 2 nodes and seems to be created correctly but as I can see the svg path it isn't generated

image

Any idea what I'm doing wrong?

this is my code (It's based on DatabaseDesigner project)

    foreach (var clink in columnsLink)
    {
        var parent = ...
        var child = ...

        var nodeParent = (Table)Diagram.Nodes.First(s => ((Table)s).Name == parent.Label);
        var nodeChild = (Table)Diagram.Nodes.First(s => ((Table)s).Name == child.Label);
        var childColumn = nodeChild.Columns.First(s => s.Name == clink.Label);
        var link = new LinkModel(nodeChild.GetPort(childColumn), nodeParent.GetPort(PortAlignment.Left));
        Diagram.Links.Add(link);
    }
zHaytam commented 1 year ago

Hello, please show me your code for the node widget. A link wont output anything if it can't get the positions it needs (e.g. ports not rendering, sizes not fetched)

elgransan commented 1 year ago

Ok, that hint was enough, I defined PortAligment.Right to "key" column, but I'm rendering it at the left. Thanks!!