Skip to content

andreaval/FlowgorithmJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlowgorithmJS

Flowgorithm is an excellent software for drawing flowcharts. To save the work, it use an XML format stored in files with the .fprg extension.

FlowgorithmJS is a third-party tool written in Javascript that can read and display the .fprg files on a web page using SVG format.

Include library

<script src="lib/jquery-3.3.1.min.js"></script>
<script src="flowgorithm.js"></script>

Using

drawFlowchartFromSource(xmlString,tagId,options);

or

drawFlowchartFromUrl(fprgUrl,tagId,options);

Example

<!DOCTYPE html>
<html>
<head>
  <script src="lib/jquery-3.3.1.min.js"></script>
  <script src="flowgorithm.js"></script>
  <script>
    var xml = `<?xml version="1.0"?>
    <flowgorithm fileversion="2.6">
      <attributes>
        <attribute name="name" value="Next number"/>
        <attribute name="authors" value="Andrea Vallorani"/>
        <attribute name="about" value="Print the next of a given number"/>
      </attributes>
      <function name="Main" type="None" variable="">
        <parameters/>
        <body>
          <declare name="N, NEXT" type="Integer" array="False" size=""/>
          <input variable="N"/>
          <assign variable="NEXT" expression="N+1"/>
          <output expression="&quot;Next is &quot; &amp; NEXT"/>
        </body>
      </function>
    </flowgorithm>`;
    drawFlowchartFromSource(xml,'#f');
  </script>
</head>
<body>
    <div id="f"></div>
</body>
</html>

Demo

About

*.fprg file viewer for the Web

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors