Giter VIP home page Giter VIP logo

animpie.js's Introduction

AnimPie.js

An animated pie chart using canvas only.

Given a canvas like this: <div style="position:absolute;top:20px;left:0px;width:500px;height:500px"> <canvas id="c" width="500" height="500">blah</canvas> </div>

You can then create a pie chart that looks really cool just by calling it with your data and the id of the canvas element.

AnimPie.makePie([30, 50, 40, 20, 10, 32], "c");

Here's an example: http://jsfiddle.net/8qh9X/91/

See Anim.js for licence and more details (MIT)

animpie.js's People

Contributors

gilesdmiddleton avatar

Stargazers

Jonathan Barratt avatar Lucas avatar Luís Rudge avatar

Watchers

 avatar  avatar

animpie.js's Issues

Use requestAnimationFrame

Change the code so that it uses requestAnimation frame
Also make a list of animation objects which have a finite lifetime and a processing function
and a generic draw routine where the context tells it if things need to be drawn or not.

This should greatly simplify the code and its readability.

Add a more solid example to extract further improvements

Just showing a graph isn't enough - we haven't yet dealt with tying it in to other systems, dismissing the pie chart in an animated way, or animating it, or showing the real data tied to it.
What about a legend?
What about a title?
By encompassing a more rich example, we might get an idea of what's really left to do.

Clockwise/Anticlockwise rotation wrong

AnimPie.makePie([1,2,3,4,5,6], 'c');

The code intends that arc 1 rotates clockwise, 2 anticlockwise, 3 clockwise ad infin item.
Yet demonstrably arc 1 is clockwise, 2&3 anti clockwise 4&5 clockwise!

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.