Giter Site home page Giter Site logo

development's Introduction

development

CS1300 Project

NOTE: ONLY TESTED ON CHROME. IT PROBABLY WON'T WORK FOR IE < 9. IT WILL QUESTIONABLY WORK ON SAFARI OR FIREFOX

I created a widget that replaces the upvote / downvote bar with a pie chart to display the results in a different, more readable way than the existing percentage bar. Every site that I've seen uses a bar to show the percentages of upvotes and downvotes for a given submission (ex reddit, imgur, etc.). I find the pie chart more intuitive, and the upvote / downvote buttons are on top of / below each other, respectively, instead of next to each other, making the upvoting / downvoting more intuitive since one is "up" and the other is "down".

How to Use

In your html, include the following scripts:

<script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script> <script type="text/javascript" src="chartwidget.js"></script>

this style sheet:

and any identifiable div, say

Lastly, call pieChart() on your identifiable div $("#chart").pieChart(); options you can add: data_upvote --> Number of upvotes a chart should display data_downvote --> Number of downvotes a chart should display normalchart --> boolean indicating whether the chart should act as an upvote/downvote chart or a normal pie chart callback --> called after an end user has upvoted or downvoted on a chart.

TODO

Add options to change color and size

Known Bugs

None

development's People

Contributors

emcmanus11 avatar

Watchers

 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.