Search code examples
mermaid

Draw arrow from node to nothing


I want to draw a mermaid diagram containing arrows that do not join with nodes:

graph LR
    A(Sample Text)
    -->A
    A-->B
    B-->A 
    B-->

-->A and B--> fails, likely because the arrow requires both input and output nodes. Is there a workaround? Can I make the node invisible or blank?


Solution

  • How about this?

    graph LR
        START[ ]-->A[Sample Text]
        A-->B
        B-->A 
        B-->STOP[ ]
        
        style START fill:#FFFFFF00, stroke:#FFFFFF00;
        style STOP  fill:#FFFFFF00, stroke:#FFFFFF00;
    

    Output diagram is:

    --> sample text <--> B -->