Skip to content

[Bug]: A declared port that no edge names is not emitted #68

Open

Description

@Malcolmnixon

Description

Found while adopting 0.3.0-beta.4 in demaconsulting/SysML2Tools (Interconnection/Sequence notation, PR-D). The minimal repro follows.

Engine repro 2 — a LayoutGraphPort with no edge is never emitted as a LayoutPort

Package family: DemaConsulting.Rendering.* 0.3.0-beta.4 (net10.0). Documented as deferred in the Rendering ROADMAP
("Unconnected-port emission and a port side hint"); confirmed here so PR-D plans for it.

var g = new LayoutGraph();
g.Set(CoreOptions.Algorithm, "auto");
var a = g.AddNode("a", 150, 70); a.Label = "a : A"; a.Keyword = "part"; a.Shape = BoxShape.RoundedRectangle;
var b = g.AddNode("b", 150, 70); b.Label = "b : B"; b.Keyword = "part"; b.Shape = BoxShape.RoundedRectangle;
var p = a.Ports.AddPort("out"); p.ExternalLabel = "out : Fuel";
var q = b.Ports.AddPort("in");  q.ExternalLabel = "in : Fuel";
var spare = a.Ports.AddPort("spare"); spare.ExternalLabel = "spare : Spare";   // no edge
spare.Appearance = new PortAppearance(PortDirection.InOut, OutlineStyle: LineStyle.Dashed, LabelPlacement: PortLabelPlacement.Outward);
g.AddEdge("e", p, q);
var tree = LayoutEngine.Layout(g);

Observed: tree.Nodes.OfType<LayoutPort>() contains the connected out/in ports only; spare is absent and the box gets no side to put it on.
Expected: a LayoutPort for spare on a face of a (or at least a way to ask for a side), with its outward label reserved.

SysML2Tools impact (audit I04, "ports shown even when unconnected"): the strategy must place unconnected ports itself after layout
(planned: free slot on the Left face for in/inout/undirected, Right face for out, NotationMetrics.PortOutwardLabelBounds collision
check, box height reserved up front from the declared port count).

Tool Version

0.3.0-beta.4

Activity

  1. added
    bug
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions