diff --git a/README.md b/README.md index d238d355..03849acf 100644 --- a/README.md +++ b/README.md @@ -4,23 +4,25 @@ flowchart.js is a flowchart DSL and SVG render that runs in the browser and [terminal](https://github.com/francoislaberge/diagrams/#flowchart). -Nodes and connections are defined in separately so that nodes can be reused and connections can be quickly changed. -Fine grain changes to node and connector style can also be made right in the DSL. +Nodes and connections are defined separately so that nodes can be reused and connections can be quickly changed. +Fine grain changes to node and connection style can also be made right in the DSL. ## Example ```flowchart st=>start: Start:>http://www.google.com[blank] e=>end:>http://www.google.com +getInfo=>input: Input Info op1=>operation: My Operation sub1=>subroutine: My Subroutine cond=>condition: Yes or No?:>http://www.google.com io=>inputoutput: catch something... +printInfo=>output: Print info para=>parallel: parallel tasks -st->op1->cond -cond(yes)->io->e +st->getInfo->op1->cond +cond(yes)->io->printInfo->e cond(no)->para para(path1, bottom)->sub1(right)->op1 para(path2, top)->op1 @@ -95,6 +97,24 @@ Indicates that IO happens in a flow. io=>inputoutput: inputoutput ``` +### input +Indicates that Input happens in a flow. + +![input image](imgs/input.png "input image") + +```flowchart +getInfo=>input: Input info +``` + +### output +Indicates that Output happens in a flow. + +![output image](imgs/output.png "output image") + +```flowchart +printInfo=>output: Print info +``` + ### subroutine Indicates that a subroutine happens in the flow and that there should be another flowchart that documents this subroutine. @@ -105,7 +125,7 @@ sub1=>subroutine: subroutine ``` ### condition -Allows for a conditional or logical statement to direct the flow into one of two or more paths. +Allows for a conditional or logical statement to direct the flow into one of two paths. ![condition image](imgs/condition.png "condition image") @@ -136,12 +156,12 @@ nodeVar2->nodeVar3 Connection syntax is as follows: -`[([, [[([, ]` +`[([, [[([, ]` Items in `[]` are optional. ### Directions -The following directions are availiable and define the direction the connection will leave the node from. If there are more than one specifiers, it is always the last. All nodes have a default direction making this an optional specification. `` will be used to indicate that one of the below should be used in its place. +The following directions are available and define the direction the connection will leave the node from. If there are more than one specifiers, it is always the last. All nodes have a default direction making this an optional specification. `` will be used to indicate that one of the following should be used in its place. * left * right @@ -154,7 +174,7 @@ Each node variables has optional specifiers, like direction, and some have speci ### start Optional direction -`startVar()->nextNode` +`startVar()->nextNode` ### end No specifications because connections only go to the end node and do not leave from it. @@ -218,6 +238,33 @@ If you want to emphasize a specific path in your flowchart, you can additionally st@>op1({"stroke":"Red"})@>cond({"stroke":"Red","stroke-width":6,"arrow-end":"classic-wide-long"})@>c2({"stroke":"Red"})@>op2({"stroke":"Red"})@>e({"stroke":"Red"}) ``` +## Custom names for branches + +``` +st=>start: Start:>http://www.google.com[blank] +e=>end:>http://www.google.com +op1=>operation: My Operation +sub1=>subroutine: My Subroutine +cond=>condition: linear or polynomial :>http://www.google.com +io=>inputoutput: catch something... +para=>parallel: 3 possibilities + +st->op1->cond +cond(true@linear)->io->e +cond(false@polynomial)->sub1(right) +sub1(right)->para +para(path1@an1, top)->cond +para(path2@an2, right)->op1 +para(path3@an3, bottom)->e +``` +
+ + Demonstration + + ![img](https://user-images.githubusercontent.com/1086194/137810516-0d7d7307-fc55-466f-b06d-a6ca9f6b8785.png) + +
+ ## Contributors via [GitHub](https://github.com/adrai/flowchart.js/graphs/contributors) @@ -225,25 +272,3 @@ via [GitHub](https://github.com/adrai/flowchart.js/graphs/contributors) ## Thanks Many thanks to [js-sequence-diagrams](http://bramp.github.io/js-sequence-diagrams/) which greatly inspired this project, and forms the basis for the syntax. - -## Licence - -Copyright (c) 2019 Adriano Raiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/bower.json b/bower.json deleted file mode 100644 index 5b82ba5d..00000000 --- a/bower.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "flowchart", - "version": "1.6.6", - "main": "./release/flowchart.min.js", - "dependencies": {}, - "ignore": [ - "src/", - "buildtasks/", - "example/", - ".gitignore", - "Gruntfile.js", - "package.json", - "**/*.zip" - ] -} diff --git a/imgs/example.svg b/imgs/example.svg index e652353f..19096226 100644 --- a/imgs/example.svg +++ b/imgs/example.svg @@ -1 +1 @@ -Created with Raphaël 2.2.0StartMy OperationYesor No?catch something...Endparallel tasksMy Subroutineyesno \ No newline at end of file +Created with Raphaël 2.3.0StartInput InfoMy OperationYesor No?catch something...Print infoEndparallel tasksMy Subroutineyesno \ No newline at end of file diff --git a/imgs/input.png b/imgs/input.png new file mode 100644 index 00000000..0fb8d314 Binary files /dev/null and b/imgs/input.png differ diff --git a/imgs/output.png b/imgs/output.png new file mode 100644 index 00000000..d22a99a8 Binary files /dev/null and b/imgs/output.png differ diff --git a/index.html b/index.html index aae36316..eb057b41 100644 --- a/index.html +++ b/index.html @@ -18,6 +18,8 @@ c2=>condition: Good idea|rejected io=>inputoutput: catch something...|request para=>parallel: parallel tasks + in=>input: some in + out=>output: some out st->op1(right)->cond cond(yes, right)->c2 @@ -25,8 +27,9 @@ c2(true)->io->e c2(false)->e - para(path1, bottom)->sub1(left)->op1 + para(path1, left)->sub1(top)->op1 para(path2, right)->op2->e + para(path3, bottom)->in->out->e