Arrows must be left to right, trying to do right to left causes errors:
A -> B: Thing
A <- B: Return
Parse error on line 3:
... A -> B: Thing A <- B: Return
----------------------^
Expecting 'NL', 'AS', ',', 'SOLID_OPEN_ARROW', 'DOTTED_OPEN_ARROW', 'SOLID_ARROW', 'DOTTED_ARROW', 'SOLID_CROSS', 'DOTTED_CROSS', 'TXT', got '-'
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?
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. 馃槅
Arrows must be left to right
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:
Actor1<--Actor2: Is this a dotted line or a deactivation?
I believe we should also use it as a prefix to the right to left arrows. Like so:
Actor1+<--Actor2: Activation of Actor1
Actor2-<--Actor1: Deactivation of Actor1
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.
Given arrows like x--, some of the corner cases that kicked my butt are:
Alex --> Xena
Alex x-- Xena
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?
Most helpful comment
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.