Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direction of reactions in the diagrams #1936

Open
cmnrd opened this issue Aug 9, 2023 · 3 comments
Open

Direction of reactions in the diagrams #1936

cmnrd opened this issue Aug 9, 2023 · 3 comments
Assignees
Labels
diagrams Problems with diagram synthesis enhancement Enhancement of existing feature

Comments

@cmnrd
Copy link
Collaborator

cmnrd commented Aug 9, 2023

The adjustable port side feature implemented in #1807 is a great addition to LF. However, I find it a bit challenging to use in conjunction with reactions. For instance, I would like to have the dataflow for requests to go from left to right, and the dataflow for responses to go from right to left in this reactor:

ClientMethodTransactor

Would it be possible to add an annotation that changes the direction of reactions?

@cmnrd cmnrd added enhancement Enhancement of existing feature diagrams Problems with diagram synthesis labels Aug 9, 2023
@soerendomroes
Copy link
Collaborator

Can you please add a model to your ticket such that I can try out different layout algorithm with it?

@cmnrd
Copy link
Collaborator Author

cmnrd commented Aug 14, 2023

Sure. Here is the code used to produce the diagram from above.

target Python

reactor ClientMethodTransactor {
  @side("west")
  input request
  @side("west")
  output response

  physical action p
  logical action l

  @label("send request")
  reaction(request) {==}

  @label("receive response")
  @side("west")
  reaction(p) -> l {==}

  @label("forward response")
  reaction(l) -> response {==}
}

@a-sr
Copy link
Collaborator

a-sr commented Aug 24, 2023

The manual adjustment of port sides was and is an experimental feature.
Nothing else in the diagram synthesis was adjusted to account for ports disregarding the left-to-right direction. That means reactions still have fixed port sides and a respective shape.
Yes, it would be possible to extend the synthesis to support both directions for the LF elements but this will require a bigger rework because some elements would only be turned around due to the layout and not an explicit annotation, and hence require a post-processing outside the synthesis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagrams Problems with diagram synthesis enhancement Enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

3 participants