PyNode is a Python library for visualizing Graph Theory. It can be used to develop algorithm prototypes, or to demonstrate how algorithms work in a visual, interactive way. It is available in both an online version (current directory) and offline version (/offline_src). The official website can be found here.
- When the 'Play' button is pressed, the Python code written in the editor (provided by Monarco) is transpiled to JavaScript (using Brython).
- The code is then executed instantaneously, and all API calls are added to a queue, ready to be executed sequentially.
- The API calls trigger visual animations (using a modified version of Greuler, built on D3 and WebCola).
- pynode_graphlib.py* - The PyNode Graphlib API, which provides all Graph-related functions. This file maintains the current state of the graph, and informs graph_api.js of all the events that need to be visually displayed.
- pynode_core.py - Handles the internal functions of the API, and acts as a bridge between pynode_graphlib.py and graph_api.js, allowing the API to be compatible with both the online and offline versions of PyNode.
- index.html - The main page of the online version, which includes the editor, console, and output window. Also provides documentation for all features.
- pynode_editor.html, pynode_console.html, pynode_output.html - Detachable editor/console/output windows.
- pynode_pojects/ - Contains the Python code for the examples provided on the website.
- /css/* - Contains custom fonts and the main style sheet.
- /images/pynode* - Contains all icons used in the interface.
- /js/* - Contains all JavaScript code.
- graph_api.js - Visually updates the graph, in parallel with the calls that were made to the GraphLib API.
- d3_controls.js - Handles interface events such as panning and zooming.
- resize.js - Handles resizing of the window, and includes functions which manage node layout/positioning.
- /greuler - The (modified) Greuler API.
- /cola - The WebCola API.
- /d3 - The D3 API.
- offline_src/ - Contains the source code for the offline version of PyNode. Further details are provided within the directory.
- offline_downloads/ - Contains packaged downloads for the offline version.
- latest_version.zip - Contains the latest version of the /offline_src/pynode/src folder packaged in a zip file, allowing for automatic updates.
- latest_version.txt - Specifies the current version number.
- pynode_win64.zip, pynode_macosx.zip, etc. - Contains the fully packaged offline versions of PyNode for various operating systems.
* These files should be kept in sync between the online and offline versions.
All pull requests should be made to the master branch. Once merged, the changes will be automatically deployed to the gh-pages branch, and can be viewed at alexsocha.github.io/pynode.
If changes are made to files that are also used in the offline version (indicated by a '*'), the corresponding files in the /offline_src folder should also be updated, and the procedure for publishing the offline version (specifically the "PyNode Files" section) should be followed.