Skip to content
PyNode: Graph Theory Visualizer
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

PyNode: Graph Theory Visualizer

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.

How It Works

Online Version

  • When the 'Play' button is pressed, the Python code written in the editor (provided by Ace) 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).

Project Structure

Online Version

  •* - 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.
  • - Handles the internal functions of the API, and acts as a bridge between 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 Version

  • 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.
    • - 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.
    •,, 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 and changes should be made to the master branch. Once thoroughly tested, changes in the master branch should be pushed to the gh-pages branch, and can be viewed at

Offline Version

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.

You can’t perform that action at this time.