Skip to content

Extend connection annotation text#3854

Open
DagBruck wants to merge 1 commit intomasterfrom
DagBruck-patch-1
Open

Extend connection annotation text#3854
DagBruck wants to merge 1 commit intomasterfrom
DagBruck-patch-1

Conversation

@DagBruck
Copy link
Collaborator

@DagBruck DagBruck commented Mar 6, 2026

Today we allow a single Text annotation on a connection line. This change generalizes that to allow more than one, for example to be able to specify both %first and %second on a connection.

Today we allow a single Text annotation on a connection line. This change generalizes that to allow more than one, for example to be able to specify both %first and %second on a connection.
@DagBruck DagBruck added the enhancement New feature or request label Mar 6, 2026
Copy link
Collaborator

@henrikt-ma henrikt-ma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two main reasons why we at Wolfram don't want to go in this direction:

  • The GUI operation for moving the label to a different point on the connection line becomes complicated when there is more than one label (I'll not go into more details about why unless asked).
  • We believe that what users might actally want instead of multiple labels at the connect-equation is the possibility to attach labels to a connector of a component instance.

Also, isn't it a bit controversial to introduce more top-level annotations which may occur more than once?

A label on a component instance's connector would be placed on the component declaration:

  Modelica.Blocks.Continuous.Integrator integrator annotation(
      Placement(transformation(origin = {-70, 30}, extent = {{-10, -10}, {10, 10}})),
      labels = {
        ConnectorLabel(id = "u", label = Text(string = "a")),
        ConnectorLabel(id = "y", label = Text(string = "v"))
      }
    );

At the moment, however, we are not pushing for something like ConnectorLabel, as we'd like to get more experience with how the current connection line label is and can be used.

@HansOlsson
Copy link
Collaborator

There are two main reasons why we at Wolfram don't want to go in this direction:

  • The GUI operation for moving the label to a different point on the connection line becomes complicated when there is more than one label (I'll not go into more details about why unless asked).
  • We believe that what users might actally want instead of multiple labels at the connect-equation is the possibility to attach labels to a connector of a component instance.

Also, isn't it a bit controversial to introduce more top-level annotations which may occur more than once?

We have some, and to me there are two issues:

  • Some minor inconveniences when handling them, but here that is tied to adding a connection-line so I find it manageable.
  • Their semantics. Here they are fairly independent with (hopefully) minimal interaction, as the goal isn't to add somewhat over-lapping texts, but texts at different indices - so I don't find the semantics that problematic.

To me the current texts are clearly tied to the connection - not to the connector. Or more specifically to the connection-end-points (plural even for one label: the text is placed at one side of the connection and uses the connector-sub-part from the other side).

For those cases it doesn't make sense to move them to a different point on the connection-line - and it doesn't make sense to view them as labels for the connectors, as the label is specific to the connection not to the connector (so I don't see a case for having the labels without the connections).

However, I haven't investigated when more than one text would be super-useful. Currently they are used when connecting a sub-part to an expandable connector, and in those cases one text suffices as you connect a sub-part to the whole, not two sub-parts.

@henrikt-ma
Copy link
Collaborator

Before engaging deeper in this discussion, I would like to see some compelling real-world use cases (with pictures) fulfilling:

  • Need for multiple labels.
  • Labels need to be associated with connection line rather than the connectors at the endpoints of the line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants