Coder Social home page Coder Social logo

graphvizanim's Introduction

GraphvizAnim

Build Status Gitter Binder

GraphvizAnim is a tool to create simple animated graph visualizations; it is just a proof of concept, aimed mainly at teaching purposes. It is based on Graphviz for the graph rendering part and on ImageMagick for the animated gif generation. You can run the heap sort animation on-line using binder.

A graph animation is just a sequence of steps, a step is in turn one or more actions such as: add, hilight, label, unlabel or remove a node, and add, hilight, or remove an edge. Animations can be built by invoking suitable methods of a gvanim.Animation object (in a Python program), or by parsing a simple text file (that, in turn, can be generated by a program in any language).

The examples folder contains few instances of such approaches. After installing the package with python setup.py install, or using

pip install https://github.com/mapio/GraphvizAnim/archive/0.2-alpha.zip

you can generate an animated depth first visit (in a 3-regular random graph of 6 nodes) by running

python examples/dfv.py

or you can generate the simple animation described in simple.txt as

python -m gvanim examples/simple.txt simple

You can generate an Erdős–Rényi graph (with 10 nodes and edge probability 1/10) by running

cd examples
gcc -o er er.c
./er | python -m gvanim er

Finally, you can obain an interactive visualization of the heap sort algorithm using Jupyter by running

cd examples
jupyter notebook heapsort.ipynb

and running all the cells in order; or you can give a try to binder and watch the above animation actually running on-line.

graphvizanim's People

Contributors

mapio avatar raphaelwimmer avatar

Watchers

James Cloos avatar Tiancheng-Luo 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.