seflless / diagrams

Generate Flowcharts, Network Sequence Diagrams, GraphViz Dot Diagrams, and Railroad Diagrams
MIT License
764 stars 112 forks source link

*.Flowchart parsing seems to be broken #3

Closed robins closed 8 years ago

robins commented 8 years ago

Hi,

A simple *.flowchart program doesn't compile... although .sequence seems to be working okay. Any idea how can I get this going? I see flowchart.js.org seems to be broken (or is it just me?) so is it more a problem with the upstream?

Unrelated, the sample .flowchart code on your site isn't what the image should be. Probably the code below has a better chance of looking like the image on your website.

st=>start: Start
e=>end
op1=>operation: My Operation
st=>operation: Stuff
sub1=>subroutine: My Subroutine
cond1=>condition: Yes or No?
cond2=>condition: Good Idea?
io=>inputoutput: catch something
e=>end: End

st->op1->cond1
cond1(yes)->cond2(yes)->io->e
cond2(no)->st->e
cond1(no)->sub1(right)->op1
seflless commented 8 years ago

Hey @robins. I'm seeing flowchart.js.org down for sure. I did a quick test locally of the following .flowchart file to check if it worked and I didn't have an issue.

simple.flowchart's content

st=>start: Start|past:>http://www.google.com[blank]
e=>end: End:>http://www.google.com
op1=>operation: My Operation|past
op2=>operation: Stuff
sub1=>subroutine: My Awesome Subroutine|invalid
cond=>condition: Yes
or No?|approved:>http://www.google.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|request

st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e

I ran: diagrams flowchart simple.flowchart simple.svg and got the following svg (screenshot): screen shot 2016-10-28 at 2 30 54 pm.

seflless commented 8 years ago

I just wrapped that lib's syntax. I've definitely been considering modifying it to use my own syntax that is compatible with the .sequence one as well. It could easily be similar.

seflless commented 8 years ago

Filed a ticket to flowchart.js' issue tracker: https://github.com/adrai/flowchart.js/issues/92

robins commented 8 years ago

Guess it was about bad pseudocode from me then. Your code works well here. Thanks for a prompt response.

seflless commented 8 years ago

This is fixed up stream now too.