Skip to content

Commit 4748222

Browse files
authored
Update README.md
1 parent 2729d58 commit 4748222

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,53 @@ It use an XML format to output the flowcharts. The XML is saved in files with th
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

7+
## Include library
8+
```js
9+
<script src="lib/jquery-3.3.1.min.js"></script>
10+
<script src="flowgorithm.js"></script>
11+
```
12+
13+
## Using
14+
15+
```js
16+
drawFlowchartFromSource(xmlString,tagId,options);
17+
```
18+
or
19+
20+
```js
21+
drawFlowchartFromUrl(fprgUrl,tagId,options);
22+
```
23+
24+
## Example
25+
```html
26+
<!DOCTYPE html>
27+
<html>
28+
<head>
29+
<script src="lib/jquery-3.3.1.min.js"></script>
30+
<script src="flowgorithm.js"></script>
31+
<script>
32+
var xml = '<?xml version="1.0"?>
33+
<flowgorithm fileversion="2.6">
34+
<attributes>
35+
<attribute name="name" value="Next number"/>
36+
<attribute name="authors" value="Andrea Vallorani"/>
37+
<attribute name="about" value="Print the next of a given number"/>
38+
</attributes>
39+
<function name="Main" type="None" variable="">
40+
<parameters/>
41+
<body>
42+
<declare name="N, NEXT" type="Integer" array="False" size=""/>
43+
<input variable="N"/>
44+
<assign variable="NEXT" expression="N+1"/>
45+
<output expression="&quot;Next is &quot; &amp; NEXT"/>
46+
</body>
47+
</function>
48+
</flowgorithm>';
49+
drawFlowchartFromSource(xml,'#f');
50+
</script>
51+
</head>
52+
<body>
53+
<div id="f"></div>
54+
</body>
55+
</html>
56+
```

0 commit comments

Comments
 (0)