Coder Social home page Coder Social logo

renpy-parliamentdiagram's Introduction

renpy-ParliamentDiagram

A tool based upon https://github.com/slashme/parliamentdiagram, to create parliament diagrams showing the distribution of seats among the forces in presence, also called "election apportionment diagrams" on Wikimedia. This creates renpy Displayables to show such diagrams in renpy.

Howto

There are two styles of diagrams, Newarch ones are like an hemicycle, while the Westminster ones arrange seats in rows like in the british or australian parliaments.

Newarch

newarch(the_list, bg=None, **kwargs)

  • the_list takes a list containing a sublist for each party having seats. Each sublist must contain (in that order) a number of seats and a color. Other elements in that sublist will be ignored.

  • bg can take a color, which will fill the background of the chart.

Other keyword arguments will be passed to the Displayable constructor.

Warning ! Be careful to use the newarch function and not directly the Newarch displayable.

As this displays circles, some measure of anti-aliasing is necessary to render it as smooth as it deserves. That's why the Newarch displayable is rendered bigger than required, and then zoomed down to fit the requested size. The anti-aliasing factor can be found as the aafactor attribute of the Newarch class. 1 will do nothing, 2 will render it twice as wide and high as it finally needs.

Example : newarch([(3, '#f00'), (23, '#090'), (24, '#009')])

renpy-parliamentdiagram's People

Contributors

gouvernathor avatar

Stargazers

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