Code Monkey home page Code Monkey logo

jsanimation's Introduction

JSAnimation

NOTE: this package is part of matplotlib as of version 2.1. The code here is maintained only for historical purposes.

Copyright (c) 2013, Jake Vanderplas

License: BSD

This package implements an HTML/Javascript writer for Matplotlib animations. The result can be embedded in a web page, or an IPython notebook.

Example

See a rendered example: please note the browser requirements listedbelow.

Testing it Out

There are several scripts which demonstrate this. make_animation.py creates a basic animation, with the frame data embedded within the HTML document. Run this using

python make_animation.py

and then open the resulting file, animation.html using your web browser. This file is created using the option embed = True, which means that the image data is embedded directly in the html file in base64-representation. This means that the animation is entirely self-contained in the file.

A more sophisticated animation can be created using

python make_lorenz_animation.py

(adapted from this blog post The resulting file, lorenz_animation.html, can be opened in your web browser. This animation is created using the option embed = False, which means that the frames are individually stored in the directory lorenz_animation_frames. This prevents the html file from being too large.

If you have IPython notebook installed, you can open animation_example.ipynb to see the automatic animation representation within the notebook. Simply import the IPython_display submodule, create the animation, and the javascript widget will appear embedded in your notebook window.

Browser Compatibility

Because the animation widget uses an HTML5 slider element, it does not work in some browsers. For a comprehensive list of supported browsers, see this list.

jsanimation's People

Contributors

garrison avatar jakevdp avatar minrk avatar

Watchers

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