Choropleth map of districts from 2011 Census data.
There are two commands: pca
and hlpca
, to display population data and
housing data respectively. Each takes three arguments:
parser = (function(){ | |
/* | |
* Generated by PEG.js 0.7.0. | |
* | |
* http://pegjs.majda.cz/ | |
*/ | |
function subclass(child, parent) { | |
function ctor() { this.constructor = child; } | |
ctor.prototype = parent.prototype; |
key | STATE_CODE | PC_NO | STATE | PC_NAME | 18-19 Male | 18-19 Female | 18-19 Others | Above 18 Male | Above 18 Female | Above 18 Others | Electors with EPIC | Electors with Photo | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AN1 | AN | 1 | ANDAMAN AND NICOBAR ISLANDS | ANDAMAN AND NICOBAR ISLANDS | 1529 | 1370 | 0 | 136356 | 121500 | 0 | 254093 | 254093 | |
AP1 | AP | 1 | ANDRA PRADESH | ADILABAD | 30191 | 20152 | 16 | 674909 | 686044 | 132 | 1361085 | 1361085 | |
AP2 | AP | 2 | ANDRA PRADESH | PEDDAPALLE | 23342 | 15088 | 19 | 702419 | 676669 | 93 | 1379181 | 1379181 | |
AP4 | AP | 4 | ANDRA PRADESH | NIZAMABAD | 23285 | 13463 | 5 | 701661 | 749739 | 64 | 1451464 | 1451464 | |
AP5 | AP | 5 | ANDRA PRADESH | ZAHIRABAD | 21456 | 11559 | 8 | 703663 | 712913 | 60 | 1416636 | 1416636 | |
AP3 | AP | 3 | ANDRA PRADESH | KARIMNAGAR | 24941 | 15453 | 8 | 755526 | 751194 | 67 | 1506787 | 1506787 | |
AP6 | AP | 6 | ANDRA PRADESH | MEDAK | 26421 | 14428 | 12 | 749671 | 737580 | 84 | 1487335 | 1487335 | |
AP7 | AP | 7 | ANDRA PRADESH | MALKAJGIRI | 49191 | 31744 | 20 | 1596146 | 1357475 | 294 | 2953915 | 2953915 | |
AP14 | AP | 14 | ANDRA PRADESH | BHONGIR | 22289 | 12421 | 7 | 739084 | 717775 | 44 | 1456903 | 1456903 |
Countrywise GDP data for 2012 obtained from Quandl visualized using the Zoomable Treemap Template
Click a cell to zoom in. Click the orange bar at the top to zoom out.
license: gpl-3.0 |
This template follows pigshell's convention for "gist templates":
{ opts: {...}, data: [...] }
{ height: <number> }
to enable the framing context to adjust the height of the iframe.Life expectancy data for countries, obtained from Wikipedia and plotted with pigshell on an orthographic projection. The template is based on Rotate the world by Jason Davies. Colors by Cynthia Brewer
ycat http://en.wikipedia.org/wiki/List_of_countries_by_life_expectancy | hgrep -r 0 table.wikitable | table2js foo country data | iframe -o proj=orthographic -g /usr/template/d3-worldmap1
Running through the pipeline step by step:
ycat
uses YQL to retrieve the contents of the Wikipedia page. We use
ycat
to jump the same-origin barrier.hgrep
selects HTML elements using a jQuery/CSS-like expression.table2js
converts the table contents into plain Javascript objects, the