-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Sequence diagram arrows only go left to right #825
Comments
If you read the docs carefully this is supported, you just need to write B-> A: Return instead. |
@alarobric if you read what I wrote carefully you'd see that I know that. 😆
B -> A is left to right. I just wanted to suggest this as a portability improvement. |
That makes sense for compatability. Ideally mermaid should handle the PlantUML syntax. I will add this to the "backlog" but I cant promise any release date. This is a good starter task. |
I'd be happy to work on this. I need some validation in how the right to left arrows will stack with the shortcut for activation. PlantUML does not have shorcuts like mermaid, that I could find. Currently, the shortcut is documented as a "suffix to the arrow". Keeping the shortcut as a suffix might cause issues in cases like a deactivation: I believe we should also use it as a prefix to the right to left arrows. Like so: Does this make sense? |
What you posted makes sense. I don't know about expanding the syntax like that though. Would that prefix be required? What about regular left to right arrows? I'd be more curious about the shortcut functionality. If it's not used maybe we should get rid of it in favor of this feature? |
Sorry, thought it would be a bit easier. I have some work in this branch but can't finish. Returned the issue to the pool. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you are still interested in it, and it is still relevant, you can comment or remove the label to revive it. |
@dunning-kruger could you make a PR for your progress? The GitHub Actions bot is gonna close this one eventually. |
@philsturgeon I'd rather not do a PR for something that does not work. My work in progress was left here: https://github.com/Dunning-Kruger/mermaid/tree/feature/right-to-left-arrows |
Picking this up if no objections. |
Hi! I was actually trying in a flow chart to have an arrow in the opposite direction, and finally found this issue. My view and suggestion is that "logically" it could be a forward arrow, in how the layout and internal logic is handled, but the feature could perhaps simply be to enable ability to render an arrow in the opposite direction? |
@sesm Any update? |
Also interested in an update on this. |
No time to work on this right now, sorry for not providing a timely update. |
Sounds trivial, but this is holding me back from migrating PlantUML to Mermaid. It's not only the effort for replacing the arrows, it's also much harder to read than PlantUML syntax - even though ltr and rtl are logically the same. |
I'm afraid I don't understand your actual need, but I've found something interesting on Mermaid.
and the result is sequenceDiagram
participant Account
actor Teller
actor Customer
Customer -->> +Teller : Deposit some money
Teller -->> Customer : please wait...
Teller -->> +Account : add money
Account -->> -Teller : return balance
Teller -->> -Customer : It's your balance
|
Hi @koson, this request is about the definition syntax, not the visualization. In the code you can only use ltr arrows. |
I know that this issue is mainly about compatibility/portability. But as I initially found this discussion only for mermaid feature reasons, and for others that do, I found the following syntax for also controlling order of things in graphs (in addition to what @koson highlighted above):
flowchart LR
B ~~~ A
A --> B
|
Arrows must be left to right, trying to do right to left causes errors:
This is something I was using in my PlantUML diagrams but it seems like Mermaid doesn't like it. Is this something you'd like to see added?
The text was updated successfully, but these errors were encountered: