Code Monkey home page Code Monkey logo

pynode's Introduction

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

  • 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 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.
    • 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.

Publishing

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 alexsocha.github.io/pynode.

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.

pynode's People

Contributors

alexsocha avatar shaunakg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.