drewbo
9/17/2014 - 6:33 PM

cartogram-test

cartogram-test

var data = [{"x":70,"y":49,"name":"ABW"},
{"x":156,"y":36,"name":"AFG"},
{"x":125,"y":65,"name":"AGO"},
{"x":74,"y":46,"name":"AIA"},
{"x":127,"y":31,"name":"ALB"},
{"x":127,"y":19,"name":"ALD"},
{"x":115,"y":30,"name":"AND"},
{"x":148,"y":42,"name":"ARE"},
{"x":73,"y":79,"name":"ARG"},
{"x":142,"y":32,"name":"ARM"},
{"x":6,"y":66,"name":"ASM"},
{"x":127,"y":108,"name":"ATA"},
{"x":192,"y":65,"name":"ATC"},
{"x":158,"y":88,"name":"ATF"},
{"x":75,"y":46,"name":"ATG"},
{"x":199,"y":73,"name":"AUS"},
{"x":123,"y":27,"name":"AUT"},
{"x":144,"y":32,"name":"AZE"},
{"x":133,"y":59,"name":"BDI"},
{"x":117,"y":25,"name":"BEL"},
{"x":115,"y":51,"name":"BEN"},
{"x":113,"y":49,"name":"BFA"},
{"x":171,"y":42,"name":"BGD"},
{"x":130,"y":30,"name":"BGR"},
{"x":146,"y":41,"name":"BHR"},
{"x":66,"y":42,"name":"BHS"},
{"x":125,"y":29,"name":"BIH"},
{"x":75,"y":46,"name":"BLM"},
{"x":132,"y":23,"name":"BLR"},
{"x":58,"y":46,"name":"BLZ"},
{"x":73,"y":37,"name":"BMU"},
{"x":73,"y":67,"name":"BOL"},
{"x":80,"y":63,"name":"BRA"},
{"x":77,"y":49,"name":"BRB"},
{"x":186,"y":54,"name":"BRN"},
{"x":171,"y":40,"name":"BTN"},
{"x":129,"y":71,"name":"BWA"},
{"x":127,"y":53,"name":"CAF"},
{"x":52,"y":18,"name":"CAN"},
{"x":119,"y":28,"name":"CHE"},
{"x":69,"y":80,"name":"CHL"},
{"x":179,"y":34,"name":"CHN"},
{"x":111,"y":52,"name":"CIV"},
{"x":45,"y":51,"name":"CLP"},
{"x":122,"y":53,"name":"CMR"},
{"x":135,"y":35,"name":"CNM"},
{"x":129,"y":58,"name":"COD"},
{"x":124,"y":57,"name":"COG"},
{"x":14,"y":69,"name":"COK"},
{"x":68,"y":55,"name":"COL"},
{"x":142,"y":64,"name":"COM"},
{"x":99,"y":47,"name":"CPV"},
{"x":61,"y":51,"name":"CRI"},
{"x":210,"y":68,"name":"CSI"},
{"x":64,"y":44,"name":"CUB"},
{"x":71,"y":49,"name":"CUW"},
{"x":63,"y":45,"name":"CYM"},
{"x":135,"y":35,"name":"CYN"},
{"x":135,"y":35,"name":"CYP"},
{"x":124,"y":26,"name":"CZE"},
{"x":121,"y":25,"name":"DEU"},
{"x":141,"y":50,"name":"DJI"},
{"x":75,"y":47,"name":"DMA"},
{"x":120,"y":22,"name":"DNK"},
{"x":70,"y":46,"name":"DOM"},
{"x":116,"y":39,"name":"DZA"},
{"x":65,"y":58,"name":"ECU"},
{"x":133,"y":41,"name":"EGY"},
{"x":139,"y":47,"name":"ERI"},
{"x":135,"y":35,"name":"ESB"},
{"x":112,"y":32,"name":"ESP"},
{"x":130,"y":20,"name":"EST"},
{"x":139,"y":52,"name":"ETH"},
{"x":131,"y":16,"name":"FIN"},
{"x":217,"y":68,"name":"FJI"},
{"x":77,"y":89,"name":"FLK"},
{"x":112,"y":30,"name":"FRA"},
{"x":110,"y":18,"name":"FRO"},
{"x":212,"y":53,"name":"FSM"},
{"x":121,"y":57,"name":"GAB"},
{"x":136,"y":37,"name":"GAZ"},
{"x":112,"y":23,"name":"GBR"},
{"x":142,"y":30,"name":"GEO"},
{"x":112,"y":26,"name":"GGY"},
{"x":113,"y":52,"name":"GHA"},
{"x":111,"y":34,"name":"GIB"},
{"x":108,"y":51,"name":"GIN"},
{"x":105,"y":49,"name":"GMB"},
{"x":105,"y":49,"name":"GNB"},
{"x":121,"y":56,"name":"GNQ"},
{"x":129,"y":32,"name":"GRC"},
{"x":75,"y":49,"name":"GRD"},
{"x":88,"y":10,"name":"GRL"},
{"x":57,"y":47,"name":"GTM"},
{"x":205,"y":49,"name":"GUM"},
{"x":77,"y":54,"name":"GUY"},
{"x":186,"y":43,"name":"HKG"},
{"x":161,"y":91,"name":"HMD"},
{"x":60,"y":48,"name":"HND"},
{"x":124,"y":28,"name":"HRV"},
{"x":68,"y":46,"name":"HTI"},
{"x":126,"y":27,"name":"HUN"},
{"x":188,"y":58,"name":"IDN"},
{"x":111,"y":23,"name":"IMN"},
{"x":164,"y":43,"name":"IND"},
{"x":180,"y":63,"name":"IOA"},
{"x":160,"y":61,"name":"IOT"},
{"x":109,"y":23,"name":"IRL"},
{"x":148,"y":37,"name":"IRN"},
{"x":142,"y":36,"name":"IRQ"},
{"x":103,"y":16,"name":"ISL"},
{"x":136,"y":37,"name":"ISR"},
{"x":122,"y":30,"name":"ITA"},
{"x":65,"y":46,"name":"JAM"},
{"x":113,"y":26,"name":"JEY"},
{"x":137,"y":37,"name":"JOR"},
{"x":202,"y":34,"name":"JPN"},
{"x":154,"y":28,"name":"KAB"},
{"x":163,"y":35,"name":"KAS"},
{"x":157,"y":27,"name":"KAZ"},
{"x":138,"y":57,"name":"KEN"},
{"x":161,"y":31,"name":"KGZ"},
{"x":180,"y":49,"name":"KHM"},
{"x":79,"y":57,"name":"KIR"},
{"x":75,"y":46,"name":"KNA"},
{"x":194,"y":33,"name":"KNM"},
{"x":194,"y":34,"name":"KOR"},
{"x":127,"y":30,"name":"KOS"},
{"x":144,"y":39,"name":"KWT"},
{"x":179,"y":46,"name":"LAO"},
{"x":137,"y":36,"name":"LBN"},
{"x":108,"y":53,"name":"LBR"},
{"x":125,"y":40,"name":"LBY"},
{"x":76,"y":49,"name":"LCA"},
{"x":120,"y":27,"name":"LIE"},
{"x":165,"y":52,"name":"LKA"},
{"x":132,"y":75,"name":"LSO"},
{"x":129,"y":22,"name":"LTU"},
{"x":118,"y":26,"name":"LUX"},
{"x":130,"y":22,"name":"LVA"},
{"x":186,"y":43,"name":"MAC"},
{"x":74,"y":46,"name":"MAF"},
{"x":109,"y":39,"name":"MAR"},
{"x":119,"y":30,"name":"MCO"},
{"x":132,"y":27,"name":"MDA"},
{"x":144,"y":69,"name":"MDG"},
{"x":160,"y":55,"name":"MDV"},
{"x":49,"y":42,"name":"MEX"},
{"x":222,"y":53,"name":"MHL"},
{"x":128,"y":31,"name":"MKD"},
{"x":112,"y":46,"name":"MLI"},
{"x":123,"y":35,"name":"MLT"},
{"x":175,"y":44,"name":"MMR"},
{"x":126,"y":30,"name":"MNE"},
{"x":179,"y":28,"name":"MNG"},
{"x":206,"y":47,"name":"MNP"},
{"x":136,"y":68,"name":"MOZ"},
{"x":108,"y":44,"name":"MRT"},
{"x":75,"y":47,"name":"MSR"},
{"x":151,"y":70,"name":"MUS"},
{"x":136,"y":65,"name":"MWI"},
{"x":183,"y":55,"name":"MYS"},
{"x":125,"y":71,"name":"NAM"},
{"x":219,"y":70,"name":"NCL"},
{"x":120,"y":46,"name":"NER"},
{"x":220,"y":75,"name":"NFK"},
{"x":119,"y":51,"name":"NGA"},
{"x":60,"y":49,"name":"NIC"},
{"x":7,"y":69,"name":"NIU"},
{"x":117,"y":24,"name":"NLD"},
{"x":124,"y":14,"name":"NOR"},
{"x":167,"y":39,"name":"NPL"},
{"x":219,"y":57,"name":"NRU"},
{"x":222,"y":83,"name":"NZL"},
{"x":149,"y":44,"name":"OMN"},
{"x":158,"y":39,"name":"PAK"},
{"x":63,"y":52,"name":"PAN"},
{"x":33,"y":72,"name":"PCN"},
{"x":67,"y":63,"name":"PER"},
{"x":191,"y":50,"name":"PHL"},
{"x":199,"y":53,"name":"PLW"},
{"x":206,"y":61,"name":"PNG"},
{"x":126,"y":24,"name":"POL"},
{"x":72,"y":46,"name":"PRI"},
{"x":194,"y":32,"name":"PRK"},
{"x":109,"y":32,"name":"PRT"},
{"x":77,"y":72,"name":"PRY"},
{"x":22,"y":66,"name":"PYF"},
{"x":146,"y":41,"name":"QAT"},
{"x":130,"y":28,"name":"ROU"},
{"x":175,"y":18,"name":"RUS"},
{"x":133,"y":58,"name":"RWA"},
{"x":106,"y":42,"name":"SAH"},
{"x":142,"y":42,"name":"SAU"},
{"x":133,"y":47,"name":"SDN"},
{"x":133,"y":52,"name":"SDS"},
{"x":105,"y":48,"name":"SEN"},
{"x":179,"y":56,"name":"SGP"},
{"x":92,"y":91,"name":"SGS"},
{"x":108,"y":72,"name":"SHN"},
{"x":215,"y":62,"name":"SLB"},
{"x":107,"y":52,"name":"SLE"},
{"x":58,"y":49,"name":"SLV"},
{"x":122,"y":30,"name":"SMR"},
{"x":143,"y":51,"name":"SOL"},
{"x":143,"y":54,"name":"SOM"},
{"x":79,"y":28,"name":"SPM"},
{"x":127,"y":29,"name":"SRB"},
{"x":118,"y":57,"name":"STP"},
{"x":79,"y":54,"name":"SUR"},
{"x":126,"y":27,"name":"SVK"},
{"x":123,"y":28,"name":"SVN"},
{"x":125,"y":18,"name":"SWE"},
{"x":134,"y":73,"name":"SWZ"},
{"x":74,"y":46,"name":"SXM"},
{"x":147,"y":61,"name":"SYC"},
{"x":138,"y":35,"name":"SYR"},
{"x":69,"y":44,"name":"TCA"},
{"x":126,"y":47,"name":"TCD"},
{"x":115,"y":52,"name":"TGO"},
{"x":178,"y":47,"name":"THA"},
{"x":159,"y":33,"name":"TJK"},
{"x":152,"y":32,"name":"TKM"},
{"x":193,"y":62,"name":"TLS"},
{"x":4,"y":69,"name":"TON"},
{"x":75,"y":51,"name":"TTO"},
{"x":120,"y":35,"name":"TUN"},
{"x":136,"y":32,"name":"TUR"},
{"x":227,"y":61,"name":"TUV"},
{"x":190,"y":42,"name":"TWN"},
{"x":136,"y":61,"name":"TZA"},
{"x":134,"y":56,"name":"UGA"},
{"x":134,"y":27,"name":"UKR"},
{"x":53,"y":48,"name":"UMI"},
{"x":79,"y":77,"name":"URY"},
{"x":51,"y":32,"name":"USA"},
{"x":67,"y":45,"name":"USG"},
{"x":154,"y":31,"name":"UZB"},
{"x":122,"y":31,"name":"VAT"},
{"x":75,"y":49,"name":"VCT"},
{"x":72,"y":53,"name":"VEN"},
{"x":73,"y":46,"name":"VGB"},
{"x":73,"y":46,"name":"VIR"},
{"x":181,"y":47,"name":"VNM"},
{"x":220,"y":67,"name":"VUT"},
{"x":136,"y":37,"name":"WEB"},
{"x":2,"y":65,"name":"WLF"},
{"x":135,"y":35,"name":"WSB"},
{"x":5,"y":65,"name":"WSM"},
{"x":144,"y":47,"name":"YEM"},
{"x":130,"y":75,"name":"ZAF"},
{"x":132,"y":65,"name":"ZMB"},
{"x":133,"y":69,"name":"ZWE"}]

var color = d3.scale.category20c()

var svg = d3.select("svg")

svg.selectAll('rect').data(data).enter().append("rect")
.attr({
  width: 4,
  height: 4,
})
.attr('x', function(d) { return d.x * 4})
.attr('y', function(d) { return d.y *4 })
.style('fill', function (d) { return color(d.name) })
{"description":"cartogram-test","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"tab":"edit","display_percent":0.7,"thumbnail":"http://i.imgur.com/Z4ghHZY.png","fullscreen":false,"ajax-caching":true}

[ Launch: cartogram-test ] 3ef82dcc12f0e2cedd3e by drewbo
[ Launch: test ] 4653053 by enjalot
[ Launch: test ] 4652017 by enjalot
[ Launch: test ] 4582399 by enjalot