Repository navigation
Description
Description
Found while adopting 0.3.0-beta.4 in demaconsulting/SysML2Tools (Interconnection/Sequence notation, PR-D). The minimal repro follows.
Engine repro 1 — one LayoutGraphPort shared by two edges is split into two LayoutPorts
Package family: DemaConsulting.Rendering.* 0.3.0-beta.4 (net10.0). Found while planning SysML2Tools PR-D.
Image: engine-repro-shared-port-fanout.png (rendered by CanvasNet PngRenderer, Light theme, scale 2).
A SysML port with several connectors is ONE port. Beta.4 draws one glyph per edge instead
(two out : Fuel glyphs at different Y on a), each with its own copy of the label.
var g = new LayoutGraph();
g.Set(CoreOptions.Algorithm, "auto");
g.Set(CoreOptions.MergeParallelEdges, false);
LayoutGraphNode Part(string id, string label) { var n = g.AddNode(id, 150, 70); n.Label = label; n.Keyword = "part"; n.Shape = BoxShape.RoundedRectangle; return n; }
var a = Part("a", "a : A"); var b = Part("b", "b : B"); var c = Part("c", "c : C");
var aOut = a.Ports.AddPort("out"); aOut.ExternalLabel = "out : Fuel";
aOut.Appearance = new PortAppearance(PortDirection.Out, LabelPlacement: PortLabelPlacement.Outward);
var bIn = b.Ports.AddPort("in"); bIn.ExternalLabel = "in : Fuel";
bIn.Appearance = new PortAppearance(PortDirection.In, LabelPlacement: PortLabelPlacement.Outward);
var cIn = c.Ports.AddPort("in"); cIn.ExternalLabel = "in : ~Fuel";
cIn.Appearance = new PortAppearance(PortDirection.In, LabelPlacement: PortLabelPlacement.Outward);
g.AddEdge("e1", aOut, bIn).TargetEnd = EndMarkerStyle.OpenChevron;
g.AddEdge("e2", aOut, cIn).TargetEnd = EndMarkerStyle.OpenChevron; // same LayoutGraphPort instance
var tree = LayoutEngine.Layout(g);Observed: tree.Nodes holds 4 LayoutPorts — out : Fuel at (170, 75) and again at (170, 175), plus the two in ports.
Expected: one out : Fuel LayoutPort on a, with both connectors leaving from it (the Rendering ROADMAP calls true fan-out
"deferred", so this is a known gap, not a regression).
SysML2Tools impact: a declared port with N connectors renders N glyphs. Planned mitigation: keep one LayoutGraphPort per declared
port, then on the result keep the label on the first LayoutPort per SourcePort only. Ask the engine for shared-port fan-out.
Tool Version
0.3.0-beta.4
Activity
Sync agents/template and calm the README hero (#79)