Skip to content

Enhance interconnection views with distinct connectors and port labels#22

Merged
Malcolmnixon merged 5 commits into
mainfrom
feature/interconnection-ports-parallel-edges
Jul 10, 2026
Merged

Enhance interconnection views with distinct connectors and port labels#22
Malcolmnixon merged 5 commits into
mainfrom
feature/interconnection-ports-parallel-edges

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

This pull request introduces significant improvements to the interconnection view layout strategy, focusing on more accurate cross-boundary connector labeling, improved port handling, and the preservation of parallel connections. It also updates the underlying layout engine interface to better support port-aware routing and labeling. Documentation has been updated to reflect these changes, clarifying both new behaviors and remaining limitations.

Interconnection View: Cross-boundary Labeling and Port Handling

  • InterconnectionViewLayoutStrategy now resolves the full dotted reference for connection endpoints (e.g., board.cpu) and uses the nested segment as a port label, so connectors display the true target name at the port, even for cross-boundary references. The connector itself still terminates at the container boundary (not the inner part), and the limitation is documented. [1] [2] [3]
  • Port handling is enhanced: endpoints with a nested reference are rendered with a labeled port (using LayeredPlacement.EdgePortRef and LayoutGraphPort.ExternalLabel), and endpoints without a nested segment remain unlabeled, preserving prior behavior.
  • Parallel connections between the same two parts are now always preserved and routed independently (not merged), ensuring all distinct SysML connections remain visible. [1] [2] [3]

Layout Engine Interface and Data Model

  • The LayeredPlacement helper now exposes port-aware placement via PlaceWithPorts, returning both placed rectangles and port locations, and disables parallel-edge merging by default for interconnection views. The data model and documentation are updated to describe new types (PlacedPortLayout, EdgePortRef, PortEdge). [1] [2]

Documentation and Minor Updates

  • Documentation is revised throughout to clarify the new behaviors, limitations, and data model changes, including accurate descriptions of container box nesting, port labeling, and edge routing. [1] [2] [3]
  • The spelling word list in .cspell.yaml is updated to include "opto"/"Opto".

Malcolm Nixon and others added 5 commits July 9, 2026 22:56
…n views

Bump DemaConsulting.Rendering.* packages from 0.1.0-beta.4 to 0.1.0-beta.5
and adopt the new port and parallel-edge APIs:

- InterconnectionViewLayoutStrategy now sets CoreOptions.MergeParallelEdges
  to false, so multiple distinct connect usages between the same two parts
  each render as their own routed, individually labeled connector instead
  of collapsing into a single aggregated line.
- Connector endpoints now carry real SysML port names (e.g. J40, encoder)
  as LayoutPort ExternalLabel text instead of always being null.
- ResolveEndpoint now resolves the full dotted endpoint path instead of
  only the head segment, so nested/cross-boundary references resolve to
  the correct port label at any depth. Note: the connector line itself
  still terminates at the containing box's boundary rather than routing
  into the nested part; this remaining limitation is documented honestly
  in the design doc and ROADMAP.md.
- LayeredPlacement.Place gained an additive, default-true
  mergeParallelEdges parameter; existing callers (ActionFlowViewLayoutStrategy,
  StateTransitionViewLayoutStrategy) are unaffected.
- GeneralViewLayoutStrategy now explicitly sets MergeParallelEdges = false
  to preserve its prior parallel-edge behavior after the beta.5 bump changed
  the underlying algorithm's default.

Updated design docs, verification docs, reqstream requirements, the user
guide, and tests (including new coverage for parallel connections, port
labeling, and cross-boundary label resolution).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Beta.6 fixes the root-container leaf-box title-centering regression
(title now correctly stays pinned at the top instead of centering
mid-canvas and overlapping connector lines). Verified via re-render
of the 3-axis gantry interconnection view.

Port-label/title collisions on individual part boxes remain, as
expected - InterconnectionViewLayoutStrategy still constructs raw
LayoutPort records instead of using Rendering's LayoutGraphPort
object model, so the new ContentInset collision-avoidance does not
yet apply to those labels.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Two integration fixes for InterconnectionViewLayoutStrategy that were
never adapted to newer DemaConsulting.Rendering.Layout (beta.5+)
capabilities:

1. Root container box now nests its content as Children (matching the
   existing MakePartBox pattern for nested containers) instead of
   appending interior.Content as flat sibling nodes. This resolves the
   underlying inconsistency that caused beta.6's leaf-title-centering
   heuristic to require a workaround for the root box specifically.

2. LayeredPlacement gains an additive PlaceWithPorts method that uses
   Rendering's first-class LayoutGraphPort object model (LayoutGraphNode
   .Ports.AddPort + ExternalLabel, LayoutGraph.AddEdge accepting node or
   port) instead of manually computing port positions and part box
   heights from the stale MinPortSlot/ConnectorClearance constants
   (removed). The engine now auto-sizes boxes and auto-positions ports,
   eliminating port-label/title collisions (e.g. "encoder"/"OptoSensor"
   overlapping "StepperMotorX : StepperMotor", J67/J40 hidden under
   "LBO3AxisGantry" title) and cramped port spacing on high-degree boxes
   (9-port LBO3AxisGantry). Port placement requires setting HasLabel/
   HasKeyword on graph nodes so the engine's title-vs-port reservation
   activates (keyed on Label/Keyword nullness, not a TitleHeight
   property). Port-to-connector correlation uses LayoutPort.SourcePort
   reference identity, correctly handling parallel edges between the
   same two boxes.

LayeredPlacement.Place(...) remains byte-for-byte unchanged; Action
FlowViewLayoutStrategy, StateTransitionViewLayoutStrategy, and
GeneralViewLayoutStrategy are unaffected.

Verified via build.ps1 (0 warnings/errors, all tests green across
net8.0/9.0/10.0), lint.ps1, fix.ps1, and rendering
C:\temp\3AxisGantry_test.sysml to SVG/PNG with direct coordinate
inspection confirming no port-label/title overlaps, adequate port
spacing, correct root title pinning, and distinct parallel connectors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Showcases the newly-fixed interconnection-view capability: three
independent, named-port connections between the same two parts, each
routed as its own distinct connector rather than collapsing onto a
shared route, with labels on both ends and boxes auto-sized to keep
port labels clear of their own titles.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
'multiport' (no hyphen) in the filename tripped the spell-checker;
rename to the hyphenated 09-motor-controller-multi-port.sysml
consistent with the gallery README's already-hyphenated prose, and
update the README's cross-reference link.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Malcolmnixon Malcolmnixon merged commit ce6a029 into main Jul 10, 2026
15 checks passed
@Malcolmnixon Malcolmnixon deleted the feature/interconnection-ports-parallel-edges branch July 10, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant