All Projects → juliuste → Parliament Svg

juliuste / Parliament Svg

Licence: isc
Generate parliament charts as virtual-dom SVG

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Parliament Svg

Campcotcollectionview
Collapse and expand UICollectionView sections with one method call.
Stars: ✭ 161 (-2.42%)
Mutual labels:  library
Brackeys Ide
👨‍💻 Brackeys IDE is a fast and free multi-language code editor for Android.
Stars: ✭ 154 (-6.67%)
Mutual labels:  library
Angular Google Maps
Angular 2+ Google Maps Components
Stars: ✭ 1,982 (+1101.21%)
Mutual labels:  library
React Timelines
React Timelines Library
Stars: ✭ 161 (-2.42%)
Mutual labels:  library
Blurimage
This Android Project help you to make your image blur in fastest way
Stars: ✭ 162 (-1.82%)
Mutual labels:  library
Uriparser
🔪 Strictly RFC 3986 compliant URI parsing and handling library written in C89; moved from SourceForge to GitHub
Stars: ✭ 163 (-1.21%)
Mutual labels:  library
Npf
NPF: packet filter with stateful inspection, NAT, IP sets, etc.
Stars: ✭ 160 (-3.03%)
Mutual labels:  library
Slidingsquareloaderview
Marvelous sliding square loader view
Stars: ✭ 166 (+0.61%)
Mutual labels:  library
Pysnow
Python library for the ServiceNow REST API
Stars: ✭ 162 (-1.82%)
Mutual labels:  library
Qpid Proton
Mirror of Apache Qpid Proton
Stars: ✭ 164 (-0.61%)
Mutual labels:  library
Mahout
Mirror of Apache Mahout
Stars: ✭ 1,960 (+1087.88%)
Mutual labels:  library
Raz
Modern & multiplatform game engine in C++17
Stars: ✭ 161 (-2.42%)
Mutual labels:  library
Gifenc
small C GIF encoder
Stars: ✭ 164 (-0.61%)
Mutual labels:  library
Kethereum
Kotlin library for Ethereum
Stars: ✭ 161 (-2.42%)
Mutual labels:  library
Cdt
C++ library for constrained Delaunay triangulation (CDT)
Stars: ✭ 165 (+0%)
Mutual labels:  library
Spatial audio framework
A cross-platform framework for developing spatial audio related applications in C/C++
Stars: ✭ 161 (-2.42%)
Mutual labels:  library
Aim Ik
A Unity-3D library, to procedural orientate character head (and chest) in a direction without using any animation data.
Stars: ✭ 164 (-0.61%)
Mutual labels:  library
React Trading Ui
Component library for trading applications 😰📉💸
Stars: ✭ 166 (+0.61%)
Mutual labels:  library
Ssh2 Python
Bindings for libssh2 C library.
Stars: ✭ 166 (+0.61%)
Mutual labels:  library
Item Nbt Api
Add custom NBT tags to Items/Tiles/Entities without NMS!
Stars: ✭ 163 (-1.21%)
Mutual labels:  library

parliament-svg

Generate parliament charts as virtual-dom SVG. Design inspired by the Wikipedia parliament charts. Play around with the live demo! For westminster-style parliament charts, see westminster-svg. If you are using D3, you might prefer working with the d3-parliament module.

npm version Build Status Greenkeeper badge dependency status license chat on gitter

Installation

npm install --save parliament-svg

Usage

const parliamentSVG = require('parliament-svg')

const svg = parliamentSVG(parties, seatCount)
  • parties is an object containing seat count and colour for each party
{
	"linke": {
		"seats": 64,
		"colour": "#a08"
	},
	"spd": {
		"seats": 193,
		"colour": "#e02"
	},
	"gruene": {
		"seats": 63,
		"colour": "#0b2"
	},
	"union": {
		"seats": 311,
		"colour": "#333"
	}
}

Each seat contains the party name in its class attribute.

  • seatCount is a boolean, if true the total seat count will be displayed in the chart

For the given parties object and seatCount enabled, the rendered result should look like this:

Example: German Bundestag with seat count enabled

If you want to convert the virtual DOM tree to HTML/SVG string, use virtual-dom-stringify:

const toStr = require('virtual-dom-stringify')
const svg = toStr(svg)

See also

Contributing

If you found a bug or want to propose a feature, feel free to visit the issues page.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].