Suggestion for how to do this diagram? #7277
-
Or for an image, something like this. In words: Each devices has 2 lines labelled Rx, Tx connected to the opposite (Rx to Tx). What I've checked is the flowcharts and transitions but I don't quite see a way. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
|
I do know about the sequence diagrams for Alice and Bob; I don't like for my purposes because I can't represent well the hard-wired connection in the real world. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
This diagram sets up two devices side by side flowchart LR
subgraph D1["Device 1"]
direction TB
D1RX["RX"]
D1TX["TX"]
end
subgraph D2["Device 2"]
direction TB
D2RX["RX"]
D2TX["TX"]
end
D1TX -->|Tx to Rx| D2RX
D2TX -->|Tx to Rx| D1RX
|
Beta Was this translation helpful? Give feedback.

Yeah, mermaid’s layout is a bit of a black box, especially on GitHub, so small tweaks to direction are basically your main lever.
Try this: I put the whole diagram left‑to‑right, but inside each UART box I switch to top‑to‑bottom. That makes Tx and Rx stack vertically inside each UART. Then I draw the crossed lines (Tx1 → Rx2 and Tx2 → Rx1) and connect each UART to its data bus.
flowchart LR subgraph uart1 [UART 1] direction TB Tx1 Rx1 end subgraph uart2 [UART 2] direction TB Tx2 Rx2 end Tx1 -->|Tx1 to Rx2| Rx2 Tx2 -->|Tx2 to Rx1| Rx1 DB1[Data Bus 1] <--> uart1 DB2[Data Bus 2] <--> uart2