Skip to content
Merged
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
1 change: 1 addition & 0 deletions changes/unreleased/drawio-grid-gap.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- The `drawio` rendering form lays unplaced nodes, and the members inside a container, out with a corridor between neighbours that the edge router can use: twice its clearance, the two half port squares, and one nudging lane (50 px instead of 40), so two parts with ports on their facing sides route instead of being left for draw.io to route under a notice.
3 changes: 2 additions & 1 deletion docs/project/view-rendering-forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,8 @@ obstacles and the ancestors an end lies in reduced to their headers; an edge fro
its own member leaves the header's underside above the member. Containers are padded by more than
twice the clearance so a path fits between neighbours. A stated `Route` is never re-routed, and
an edge the router finds no path for (two boxes nearer than twice the clearance plus their
port squares, as the default layout's 40 px between siblings can be) is written without
port squares; the grid and the members of a container keep that distance plus a nudging lane,
50 px) is written without
waypoints under `edgeStyle=orthogonalEdgeStyle`, for draw.io to route as before, under a notice
naming the edge and its cells; an end at a port keeps its face as the anchor, the inner face when
the edge leads into the port's owner. A member drawn outside its container is routed in the
Expand Down
10 changes: 6 additions & 4 deletions internal/ir/view/drawio.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@ func (b drawioBox) contains(o drawioBox) bool {
// The spacing the grid lays unplaced nodes out with, and the padding a
// container keeps about its nested children, in draw.io pixels.
const (
drawioGridGap = 40
// drawioNestedGap also parts a header from its members: more than twice
// the router's clearance, so a path can pass between neighbours.
drawioNestedGap = 2*route.Clearance + 8
// drawioGridGap leaves a corridor between neighbours for the router: its
// clearance on both sides, the two half port squares, and one nudging lane.
drawioGridGap = 2*route.Clearance + route.PortSize + route.Nudging
// drawioNestedGap parts nested members from each other and from their
// header by the same corridor.
drawioNestedGap = drawioGridGap
drawioNestedPad = 16
drawioPortSize = 12
drawioMinWidth = 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,36 @@
<mxCell id="1" parent="0"/>
<object id="n0" label="«abstract part»&#xA;vehicleFamily" fqn="AbstractViews::vehicleFamily" kind="abstract part" view="AbstractViews::familyLinks" link="abstract.sysml:14">
<mxCell style="swimlane;html=0;whiteSpace=wrap;fontStyle=1;align=center;verticalAlign=top;startSize=42;collapsible=1;rounded=1;arcSize=10;" vertex="1" parent="1">
<mxGeometry x="40" y="40" width="284" height="212" as="geometry"/>
<mxGeometry x="50" y="50" width="294" height="232" as="geometry"/>
</mxCell>
</object>
<object id="n1" label="«abstract port»&#xA;fuel" fqn="AbstractViews::vehicleFamily::fuel" kind="abstract port" view="AbstractViews::familyLinks" link="abstract.sysml:15">
<mxCell style="rounded=1;arcSize=10;html=0;whiteSpace=wrap;align=center;verticalAlign=middle;" vertex="1" parent="n0">
<mxGeometry x="16" y="82" width="106" height="37" as="geometry"/>
<mxGeometry x="16" y="92" width="106" height="37" as="geometry"/>
</mxCell>
</object>
<object id="n2" label="«abstract part»&#xA;engine" fqn="AbstractViews::vehicleFamily::engine" kind="abstract part" view="AbstractViews::familyLinks" link="abstract.sysml:16">
<mxCell style="rounded=1;arcSize=10;html=0;whiteSpace=wrap;align=center;verticalAlign=middle;" vertex="1" parent="n0">
<mxGeometry x="162" y="82" width="106" height="37" as="geometry"/>
<mxGeometry x="172" y="92" width="106" height="37" as="geometry"/>
</mxCell>
</object>
<object id="n3" label="«part»&#xA;chassis" fqn="AbstractViews::vehicleFamily::chassis" kind="part" view="AbstractViews::familyLinks" link="abstract.sysml:17">
<mxCell style="rounded=1;arcSize=10;html=0;whiteSpace=wrap;align=center;verticalAlign=middle;" vertex="1" parent="n0">
<mxGeometry x="16" y="159" width="81" height="37" as="geometry"/>
<mxGeometry x="16" y="179" width="81" height="37" as="geometry"/>
</mxCell>
</object>
<object id="n4" label="«attribute»&#xA;^mass" fqn="AbstractViews::Vehicle::mass" kind="attribute" view="AbstractViews::familyLinks" link="abstract.sysml:8">
<mxCell style="rounded=1;arcSize=10;html=0;whiteSpace=wrap;align=center;verticalAlign=middle;" vertex="1" parent="n0">
<mxGeometry x="137" y="159" width="82" height="37" as="geometry"/>
<mxGeometry x="147" y="179" width="82" height="37" as="geometry"/>
</mxCell>
</object>
<object id="e0" label="" kind="connection" view="AbstractViews::familyLinks" link="abstract.sysml:18">
<mxCell style="edgeStyle=none;exitX=0.5;exitY=1;exitPerimeter=0;entryX=1;entryY=0.2432;entryPerimeter=0;rounded=0;html=0;endArrow=none;strokeWidth=3;" edge="1" parent="1" source="n2" target="n3">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="255" y="179"/>
<mxPoint x="157" y="179"/>
<mxPoint x="157" y="208"/>
<mxPoint x="275" y="204"/>
<mxPoint x="172" y="204"/>
<mxPoint x="172" y="238"/>
</Array>
</mxGeometry>
</mxCell>
Expand Down
55 changes: 27 additions & 28 deletions internal/ir/view/testdata/abstract-mixed.drawio.golden
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,59 @@
<mxCell id="1" parent="0"/>
<object id="n1" label="«abstract part def»&#xA;Vehicle" fqn="AbstractViews::Vehicle" kind="abstract part def" view="AbstractViews::familyMixed" link="abstract.sysml:7">
<mxCell style="swimlane;html=0;whiteSpace=wrap;fontStyle=1;align=center;verticalAlign=top;startSize=42;collapsible=1;" vertex="1" parent="1">
<mxGeometry x="40" y="40" width="307" height="135" as="geometry"/>
<mxGeometry x="50" y="50" width="307" height="145" as="geometry"/>
</mxCell>
</object>
<object id="n0" label="«attribute»&#xA;AbstractViews::Vehicle::mass" fqn="AbstractViews::Vehicle::mass" kind="attribute" view="AbstractViews::familyMixed" link="abstract.sysml:8">
<mxCell style="rounded=1;arcSize=10;html=0;whiteSpace=wrap;align=center;verticalAlign=middle;" vertex="1" parent="n1">
<mxGeometry x="347" width="275" height="37" as="geometry"/>
<mxGeometry x="357" width="275" height="37" as="geometry"/>
</mxCell>
</object>
<object id="n2" label="«abstract part»&#xA;vehicleFamily" fqn="AbstractViews::vehicleFamily" kind="abstract part" view="AbstractViews::familyMixed" link="abstract.sysml:14">
<mxCell style="swimlane;html=0;whiteSpace=wrap;fontStyle=1;align=center;verticalAlign=top;startSize=42;collapsible=1;rounded=1;arcSize=10;" vertex="1" parent="1">
<mxGeometry x="40" y="215" width="284" height="212" as="geometry"/>
<mxGeometry x="50" y="245" width="294" height="232" as="geometry"/>
</mxCell>
</object>
<object id="n3" label="«abstract port»&#xA;fuel" fqn="AbstractViews::vehicleFamily::fuel" kind="abstract port" view="AbstractViews::familyMixed" link="abstract.sysml:15">
<mxCell style="rounded=1;arcSize=10;html=0;whiteSpace=wrap;align=center;verticalAlign=middle;" vertex="1" parent="n2">
<mxGeometry x="16" y="82" width="106" height="37" as="geometry"/>
<mxGeometry x="16" y="92" width="106" height="37" as="geometry"/>
</mxCell>
</object>
<object id="n4" label="«abstract part»&#xA;engine" fqn="AbstractViews::vehicleFamily::engine" kind="abstract part" view="AbstractViews::familyMixed" link="abstract.sysml:16">
<mxCell style="rounded=1;arcSize=10;html=0;whiteSpace=wrap;align=center;verticalAlign=middle;" vertex="1" parent="n2">
<mxGeometry x="162" y="82" width="106" height="37" as="geometry"/>
<mxGeometry x="172" y="92" width="106" height="37" as="geometry"/>
</mxCell>
</object>
<object id="n5" label="«part»&#xA;chassis" fqn="AbstractViews::vehicleFamily::chassis" kind="part" view="AbstractViews::familyMixed" link="abstract.sysml:17">
<mxCell style="rounded=1;arcSize=10;html=0;whiteSpace=wrap;align=center;verticalAlign=middle;" vertex="1" parent="n2">
<mxGeometry x="16" y="159" width="81" height="37" as="geometry"/>
<mxGeometry x="16" y="179" width="81" height="37" as="geometry"/>
</mxCell>
</object>
<object id="n6" label="«variation part def»&#xA;Models" fqn="AbstractViews::Models" kind="variation part def" view="AbstractViews::familyMixed" link="abstract.sysml:21">
<mxCell style="swimlane;html=0;whiteSpace=wrap;fontStyle=1;align=center;verticalAlign=top;startSize=42;collapsible=1;" vertex="1" parent="1">
<mxGeometry x="364" y="215" width="300" height="233" as="geometry"/>
<mxGeometry x="394" y="245" width="310" height="253" as="geometry"/>
</mxCell>
</object>
<object id="n7" label="«variant»&#xA;sedan" fqn="AbstractViews::Models::sedan" kind="variant" view="AbstractViews::familyMixed" link="abstract.sysml:22">
<mxCell style="swimlane;html=0;whiteSpace=wrap;fontStyle=1;align=center;verticalAlign=top;startSize=42;collapsible=1;rounded=1;arcSize=10;" vertex="1" parent="n6">
<mxGeometry x="16" y="82" width="268" height="135" as="geometry"/>
<mxGeometry x="16" y="92" width="278" height="145" as="geometry"/>
</mxCell>
</object>
<object id="n8" label="«abstract part»&#xA;^engine" fqn="AbstractViews::vehicleFamily::engine" kind="abstract part" view="AbstractViews::familyMixed" link="abstract.sysml:16">
<mxCell style="rounded=1;arcSize=10;html=0;whiteSpace=wrap;align=center;verticalAlign=middle;" vertex="1" parent="n7">
<mxGeometry x="16" y="82" width="106" height="37" as="geometry"/>
<mxGeometry x="16" y="92" width="106" height="37" as="geometry"/>
</mxCell>
</object>
<object id="n9" label="«part»&#xA;^chassis" fqn="AbstractViews::vehicleFamily::chassis" kind="part" view="AbstractViews::familyMixed" link="abstract.sysml:17">
<mxCell style="rounded=1;arcSize=10;html=0;whiteSpace=wrap;align=center;verticalAlign=middle;" vertex="1" parent="n7">
<mxGeometry x="162" y="82" width="90" height="37" as="geometry"/>
<mxGeometry x="172" y="92" width="90" height="37" as="geometry"/>
</mxCell>
</object>
<object id="e0" label="" kind="connection" view="AbstractViews::familyMixed" link="abstract.sysml:18">
<mxCell style="edgeStyle=none;exitX=0.5;exitY=1;exitPerimeter=0;entryX=1;entryY=0.5135;entryPerimeter=0;rounded=0;html=0;endArrow=none;strokeWidth=3;" edge="1" parent="1" source="n4" target="n5">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="255" y="393"/>
<mxPoint x="275" y="443"/>
</Array>
</mxGeometry>
</mxCell>
Expand All @@ -72,58 +72,57 @@
</mxCell>
</object>
<object id="e2" label="" kind="reference" view="AbstractViews::familyMixed" link="abstract.sysml:8">
<mxCell style="edgeStyle=none;exitX=1;exitY=0.1556;exitPerimeter=0;entryX=0;entryY=0.5135;entryPerimeter=0;rounded=0;html=0;startArrow=diamondThin;startFill=0;endArrow=none;" edge="1" parent="1" source="n1" target="n0">
<mxCell style="edgeStyle=none;exitX=1;exitY=0.1448;exitPerimeter=0;entryX=0;entryY=0.5135;entryPerimeter=0;rounded=0;html=0;startArrow=diamondThin;startFill=0;endArrow=none;" edge="1" parent="1" source="n1" target="n0">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="367" y="61"/>
<mxPoint x="367" y="59"/>
<mxPoint x="382" y="71"/>
<mxPoint x="382" y="69"/>
</Array>
</mxGeometry>
</mxCell>
</object>
<object id="e3" label="" kind="reference" view="AbstractViews::familyMixed" link="abstract.sysml:15">
<mxCell style="edgeStyle=none;exitX=0.243;exitY=0.1981;exitPerimeter=0;entryX=0.5;entryY=0;entryPerimeter=0;rounded=0;html=0;startArrow=diamondThin;startFill=0;endArrow=none;" edge="1" parent="1" source="n2" target="n3">
<mxCell style="edgeStyle=none;exitX=0.2347;exitY=0.181;exitPerimeter=0;entryX=0.5;entryY=0;entryPerimeter=0;rounded=0;html=0;startArrow=diamondThin;startFill=0;endArrow=none;" edge="1" parent="1" source="n2" target="n3">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
</object>
<object id="e4" label="" kind="composition" view="AbstractViews::familyMixed" link="abstract.sysml:16">
<mxCell style="edgeStyle=none;exitX=0.757;exitY=0.1981;exitPerimeter=0;entryX=0.5;entryY=0;entryPerimeter=0;rounded=0;html=0;startArrow=diamondThin;startFill=1;endArrow=none;" edge="1" parent="1" source="n2" target="n4">
<mxCell style="edgeStyle=none;exitX=0.7653;exitY=0.181;exitPerimeter=0;entryX=0.5;entryY=0;entryPerimeter=0;rounded=0;html=0;startArrow=diamondThin;startFill=1;endArrow=none;" edge="1" parent="1" source="n2" target="n4">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
</object>
<object id="e5" label="" kind="composition" view="AbstractViews::familyMixed" link="abstract.sysml:17">
<mxCell style="edgeStyle=none;exitX=0.1989;exitY=0.1981;exitPerimeter=0;entryX=1;entryY=0.25;entryPerimeter=0;rounded=0;html=0;startArrow=diamondThin;startFill=1;endArrow=none;" edge="1" parent="1" source="n2" target="n5">
<mxCell style="edgeStyle=none;exitX=0.1922;exitY=0.181;exitPerimeter=0;entryX=1;entryY=0.25;entryPerimeter=0;rounded=0;html=0;startArrow=diamondThin;startFill=1;endArrow=none;" edge="1" parent="1" source="n2" target="n5">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="96.5" y="277"/>
<mxPoint x="178" y="277"/>
<mxPoint x="178" y="383.25"/>
<mxPoint x="106.5" y="312"/>
<mxPoint x="188" y="312"/>
<mxPoint x="188" y="433.25"/>
</Array>
</mxGeometry>
</mxCell>
</object>
<object id="e6" label="" kind="reference" view="AbstractViews::familyMixed" link="abstract.sysml:22">
<mxCell style="edgeStyle=none;exitX=0.5;exitY=0.1803;exitPerimeter=0;entryX=0.5;entryY=0;entryPerimeter=0;rounded=0;html=0;startArrow=diamondThin;startFill=0;endArrow=none;" edge="1" parent="1" source="n6" target="n7">
<mxCell style="edgeStyle=none;exitX=0.5;exitY=0.166;exitPerimeter=0;entryX=0.5;entryY=0;entryPerimeter=0;rounded=0;html=0;startArrow=diamondThin;startFill=0;endArrow=none;" edge="1" parent="1" source="n6" target="n7">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
</object>
<object id="e7" label="" kind="typing" view="AbstractViews::familyMixed" link="abstract.sysml:14">
<mxCell style="edgeStyle=none;exitX=0.5;exitY=0;exitPerimeter=0;entryX=0.5016;entryY=0.3111;entryPerimeter=0;rounded=0;html=0;dashed=1;endArrow=block;endFill=0;" edge="1" parent="1" source="n2" target="n1">
<mxCell style="edgeStyle=none;exitX=0.5;exitY=0;exitPerimeter=0;entryX=0.5016;entryY=0.2897;entryPerimeter=0;rounded=0;html=0;dashed=1;endArrow=block;endFill=0;" edge="1" parent="1" source="n2" target="n1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="182" y="149"/>
<mxPoint x="194" y="149"/>
<mxPoint x="197" y="169"/>
<mxPoint x="204" y="169"/>
</Array>
</mxGeometry>
</mxCell>
</object>
<object id="e8" label="" kind="specialization" view="AbstractViews::familyMixed" link="abstract.sysml:21">
<mxCell style="edgeStyle=none;exitX=0.5;exitY=0;exitPerimeter=0;entryX=1;entryY=0.237;entryPerimeter=0;rounded=0;html=0;endArrow=block;endFill=0;" edge="1" parent="1" source="n6" target="n1">
<mxCell style="edgeStyle=none;exitX=0;exitY=0.502;exitPerimeter=0;entryX=1;entryY=0.2207;entryPerimeter=0;rounded=0;html=0;endArrow=block;endFill=0;" edge="1" parent="1" source="n6" target="n1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="514" y="146"/>
<mxPoint x="367" y="146"/>
<mxPoint x="367" y="72"/>
<mxPoint x="376" y="372"/>
<mxPoint x="376" y="82"/>
</Array>
</mxGeometry>
</mxCell>
Expand Down
Loading
Loading