bramp / js-sequence-diagrams

Draws simple SVG sequence diagrams from textual representation of the diagram
https://bramp.github.io/js-sequence-diagrams/
BSD 2-Clause "Simplified" License
7.81k stars 1.08k forks source link

Add grammar for alternative flow #167

Open havard024 opened 7 years ago

havard024 commented 7 years ago

Hi,

I'm interested in using alternative flow in this project and I'm willing to contribute to get there. I know there's an enhancement to add support to group signals together (#160), but I don't think I'll be able to solve that generic case as of yet. I'm thinking, by solving alternative flow, we'll have something that can be built on to solve the more generic case.

Below I've just tried to add grammar for supporting alternative flow, I would love some input on the grammar.

I'm trying to achive the following:

alt text1
    A->B: text
    B->A: text
else text2
    A->B: text
else text3
    A->B: text
end
screen shot 2017-01-08 at 11 12 49 am
bramp commented 7 years ago

Sorry for the slow reply!

Yes, that grammar looks fine to me. Please go ahead and update grammar.jison and add some tests

(the grammar.ebnf is used for drawing this diagram only)

KeishaW commented 3 years ago

Will this be added soon?