Skip to content

Commit edd02af

Browse files
committed
2 parents 99761d6 + 9a05c62 commit edd02af

File tree

1 file changed

+48
-4
lines changed

1 file changed

+48
-4
lines changed

README.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# FlowgorithmJS
22
[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.
44

55
FlowgorithmJS is a **_third-party_** tool written in Javascript that can read and display the .fprg files on a web page using SVG format.
66

@@ -20,8 +20,50 @@ or
2020
```js
2121
drawFlowchartFromUrl(fprgUrl,tagId,options);
2222
```
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+
```
2365

24-
## Example
66+
## Example 2
2567
```html
2668
<!DOCTYPE html>
2769
<html>
@@ -42,11 +84,13 @@ drawFlowchartFromUrl(fprgUrl,tagId,options);
4284
<declare name="N, NEXT" type="Integer" array="False" size=""/>
4385
<input variable="N"/>
4486
<assign variable="NEXT" expression="N+1"/>
45-
<output expression="&quot;Next is &quot; &amp; NEXT"/>
87+
<output expression="NEXT"/>
4688
</body>
4789
</function>
4890
</flowgorithm>`;
49-
drawFlowchartFromSource(xml,'#f');
91+
$(function(){
92+
drawFlowchartFromSource(xml,'#f');
93+
});
5094
</script>
5195
</head>
5296
<body>

0 commit comments

Comments
 (0)