1
1
# FlowgorithmJS
2
2
[ Flowgorithm] ( http://www.flowgorithm.org ) is an excellent software for drawing flowcharts.
3
- To save the work , it use an XML format stored in files with the ** .fprg** extension.
3
+ To save the data , it use an XML format stored in files with the ** .fprg** extension.
4
4
5
5
FlowgorithmJS is a ** _ third-party_ ** tool written in Javascript that can read and display the .fprg files on a web page using SVG format.
6
6
20
20
``` js
21
21
drawFlowchartFromUrl (fprgUrl,tagId,options);
22
22
```
23
+ ## Example 1
24
+ * http://domain/file.fprg *
25
+ ``` xml
26
+ <?xml version =" 1.0" ?>
27
+ <flowgorithm fileversion =" 2.11" >
28
+ <attributes >
29
+ <attribute name =" name" value =" Next number" />
30
+ <attribute name =" authors" value =" Andrea Vallorani" />
31
+ <attribute name =" about" value =" Print the next of a given number" />
32
+ <attribute name =" saved" value =" 2018-01-23 06:36:28 PM" />
33
+ <attribute name =" created" value =" YW5kcmVhO3VidW50dTsyMDE4LTAxLTIzOzA1OjMxOjMxIFBNOzI1Njg=" />
34
+ <attribute name =" edited" value =" YW5kcmVhO3VidW50dTsyMDE4LTAxLTIzOzA2OjM2OjI4IFBNOzQ7MjY5MQ==" />
35
+ </attributes >
36
+ <function name =" Main" type =" None" variable =" " >
37
+ <parameters />
38
+ <body >
39
+ <declare name =" N, NEXT" type =" Integer" array =" False" size =" " />
40
+ <input variable =" N" />
41
+ <assign variable =" NEXT" expression =" N+1" />
42
+ <output expression =" NEXT" />
43
+ </body >
44
+ </function >
45
+ </flowgorithm >
46
+ ```
47
+ * http://domain/home.html *
48
+ ``` html
49
+ <!DOCTYPE html>
50
+ <html >
51
+ <head >
52
+ <script src =" lib/jquery-3.3.1.min.js" ></script >
53
+ <script src =" flowgorithm.js" ></script >
54
+ <script >
55
+ $ (function (){
56
+ drawFlowchartFromUrl (' http://domain/file.fprg' ,' #f' );
57
+ });
58
+ </script >
59
+ </head >
60
+ <body >
61
+ <div id =" f" ></div >
62
+ </body >
63
+ </html >
64
+ ```
23
65
24
- ## Example
66
+ ## Example 2
25
67
``` html
26
68
<!DOCTYPE html>
27
69
<html >
@@ -42,11 +84,13 @@ drawFlowchartFromUrl(fprgUrl,tagId,options);
42
84
<declare name="N, NEXT" type="Integer" array="False" size=""/>
43
85
<input variable="N"/>
44
86
<assign variable="NEXT" expression="N+1"/>
45
- <output expression=""Next is " & NEXT"/>
87
+ <output expression="NEXT"/>
46
88
</body>
47
89
</function>
48
90
</flowgorithm>` ;
49
- drawFlowchartFromSource (xml,' #f' );
91
+ $ (function (){
92
+ drawFlowchartFromSource (xml,' #f' );
93
+ });
50
94
</script >
51
95
</head >
52
96
<body >
0 commit comments