Repository navigation
enhancement: group owned features into compartments in automatically laid-out %viz diagrams #1418
Description
Feature request
Please provide an opt-in way to display eligible owned features as compartment rows inside their owning part definition/usage in automatically laid-out %viz tree diagrams, rather than drawing each feature as a separate node. Pilot-compatible --style=COMPMOST would be a useful spelling, but a native rendering option would also meet the need.
This is an enhancement request, not a specification-conformance claim or a report that all compartment support is missing.
Motivation
When several definitions each own attributes, parts, or ports, drawing every feature as a separate node quickly makes the diagram wide and difficult to read. Keeping feature names and types inside their owner's box would preserve useful detail without so many containment edges. The desired workflow is a notebook cell with automatic layout, without manually positioning each definition.
Minimal standalone reproduction
The following example is independently authored and requires only the standard library. Submit it in an OpenSysML Jupyter notebook cell:
package CompartmentDemo {
part def Sensor {
attribute label : ScalarValues::String;
attribute reading : ScalarValues::Real;
}
part def Controller {
attribute enabled : ScalarValues::Boolean;
part sensor : Sensor;
}
}
Then run each command in a separate cell:
%viz --view=tree CompartmentDemo::Sensor CompartmentDemo::Controller
%viz --view=tree --style=COMPMOST CompartmentDemo::Sensor CompartmentDemo::Controller
Observed in v0.10.1
Both commands complete successfully and produce an SVG with 6 nodes and 5 edges: the two part definitions and four owned features remain separate nodes. The second rendering's text representation explicitly notes:
not represented: style COMPMOST (show as many memberships in a compartment as possible) is not drawn
This appears consistent with the documented handling of unsupported pilot styles. Changing to --style=cameo does not provide the requested feature grouping either.
Requested behavior
With a compartment-grouping option enabled:
- Show
label : Stringandreading : Realin an attributes compartment ofSensor. - Show
enabled : Booleanin an attributes compartment ofController, and eligible part features such assensor : Sensorin a parts compartment. - Preserve meaningful relationships between the displayed definitions, such as the composition relationship represented by
sensor, while avoiding redundant standalone feature nodes and their containment edges. - Keep the current expanded-node rendering available; this need not change the default.
- Ideally make the option usable directly from
%vizwithout a declared view or explicitDiagramLayoutpositions.
Existing related work
- fix(view): list a positioned tree's layout-less members in compartments #1139 folds layout-less members into compartments in positioned tree diagrams. This request is about making equivalent grouping available in an automatically laid-out diagram.
- feat(migrate): honour the compartments a Cameo symbol suppresses as per-symbol DiagramLayout switches #1197 controls compartment visibility for migrated Cameo symbols.
- Request: limiting depth and drawn elements #1212 / feat(view): bound what a view draws by its filters, depth and collapsed layout #1213 address depth, filtering, and collapsed layout. Those are useful complementary controls; here the goal is to retain the feature information as rows, not simply hide it or cut the containment walk.
- feat(vscode): show a node's related elements in the diagram panel without editing the view #1320 adds interactive related-element controls in the VS Code diagram panel, whereas this request also concerns native Jupyter
%vizoutput.
Could the existing compartment-folding behavior be exposed as an automatic-layout rendering option? If a newer build already supports this workflow, guidance on the appropriate command would also be welcome.
Tested environment
- OpenSysML CLI/native Jupyter kernel: v0.10.1
- Build commit:
1c45b6e1749fc8adc9b82d4af22fbe180b56a0e2 - Linux AMD64 dev container; Graphviz 2.43.0
- Reproduced through the native Jupyter kernel; no API server or external model libraries required
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
HuiJun commentedon Oct 23, 2026
Thank you for submitting this request! I completely agree, we should provide this and as you pointed out, it would be really easy to do at this point. Unfortunately, it may not make the cut off for the release tomorrow, but we'll definitely have this out in a following nightly. PR links to follow.