Skip to content

Instantly share code, notes, and snippets.

@benlyall
benlyall / index.html
Last active August 29, 2015 14:06 — forked from maggie-lee/index.html
<!DOCTYPE html>
<html class="ocks-org do-not-copy">
<meta charset="utf-8">
<title>Object Constancy</title>
<!-- <head><link rel="stylesheet" type="text/css" href="flu_style.css" /></head> -->
<style>
/*default font*/
@benlyall
benlyall / index.html
Last active August 29, 2015 14:16 — forked from anonymous/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>NY State Counties With Map Markers</title>
<style>
body {
margin-top: 50px;
padding: 0;
background-color: #eee8d5;
@benlyall
benlyall / index.html
Last active August 29, 2015 14:17 — forked from binishbaig/index.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Final Map</title>
<script src="//d3js.org/d3.v3.min.js"></script>
<script src="//d3js.org/topojson.v1.min.js"></script>
<style>
* {
margin: 0;
@benlyall
benlyall / README.md
Last active August 29, 2015 14:17 — forked from kerryrodden/.block

This example shows how it is possible to use a D3 sunburst visualization (partition layout) with data that describes sequences of events.

A good use case is to summarize navigation paths through a web site, as in the sample synthetic data file (visit_sequences.csv). The visualization makes it easy to understand visits that start directly on a product page (e.g. after landing there from a search engine), compared to visits where users arrive on the site's home page and navigate from there. Where a funnel lets you understand a single pre-selected path, this allows you to see all possible paths.

Features:

  • works with data that is in a CSV format (you don't need to pre-generate a hierarchical JSON file, unless your data file is very large)
  • interactive breadcrumb trail helps to emphasize the sequence, so that it is easy for a first-time user to understand what they are seeing
  • percentages are shown explicitly, to help overcome the distortion of the data that occurs wh
We can't make this file beautiful and searchable because it's too large.
tucaseid,TUFINLWGT,TRYHHCHILD,TEAGE,TESEX,PEEDUCA,PTDTRACE,PEHSPNON,GTMETSTA,TELFS,TEMJOT,TRDPFTPT,TESCHENR,TESCHLVL,TRSPPRES,TESPEMPNOT,TRERNWA,TRCHILDNUM,TRSPFTPT,TEHRUSLT,TUDIARYDAY,TRHOLIDAY,TRTEC,TRTHH,t010101,t010102,t010201,t010299,t010301,t010399,t010401,t020101,t020102,t020103,t020104,t020199,t020201,t020202,t020203,t020299,t020301,t020302,t020303,t020399,t020401,t020402,t020499,t020501,t020502,t020599,t020601,t020602,t020699,t020701,t020799,t020801,t020899,t020901,t020902,t020903,t020904,t020905,t020999,t029999,t030101,t030102,t030103,t030104,t030105,t030106,t030108,t030109,t030110,t030111,t030112,t030199,t030201,t030202,t030203,t030299,t030301,t030302,t030303,t030399,t030401,t030402,t030403,t030404,t030405,t030499,t030501,t030502,t030503,t030504,t030599,t039999,t040101,t040102,t040103,t040104,t040105,t040106,t040108,t040109,t040110,t040111,t040112,t040199,t040201,t040299,t040301,t040302,t040401,t040402,t040403,t040404,t040405,t040499,t040501,t040502,t040503,t040504,t040505,t040506,t040507,t040508,t
@benlyall
benlyall / index.html
Last active August 29, 2015 14:17 — forked from binishbaig/index.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Final Map</title>
<script src="//d3js.org/d3.v3.min.js"></script>
<script src="//d3js.org/topojson.v1.min.js"></script>
<script src="http://d3js.org/queue.v1.min.js"></script>
<style>
* {
@benlyall
benlyall / README.md
Last active August 29, 2015 14:19
Elections Alberta

Demo using [Elections Alberta] [ea] maps. These maps are already projected by Elections Alberta, they benefit from being "unprojected" before use with topojson. To unproject the map, load it as a vector layer into QGIS and then save the layer to a new file but change the Co-ordinate Reference System to WGS 84 as part of the save action.

Then use topojson like so:

topojson -o albertaNew.topojson -p -q 1e6 <saved file from qgis>
@benlyall
benlyall / index.html
Last active August 29, 2015 14:19 — forked from EE2dev/index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.country {
fill: green;
stroke: darkgrey;
stroke-width: .5px;
stroke-linejoin: round;
}
Location 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012
Australia 6.2 6 5.8 5.7 5.8 5.8 5.8 4.6 4.8 5.1 4.6
Austria 21.3 18.7 19.7 21 22.1 24.1 25.3 27.8 27.2 26.6 29.5
Belgium 1.3 1.5 1.6 2 2.3 2.7 3.1 3.8 4.2 4.9 5.1
Brazil 39.4 42 42.3 42.9 43.3 44.4 44.5 45.8 44 42.7 42.2
Canada 16.9 15.6 15.6 15.9 15.7 16.2 16.8 17.5 17.1 18 17.9
Chile 26.2 24.8 24.2 25.1 25.3 23.5 24.4 26.1 22 23.1 24.1
China (People's Republic of) 18.4 16.2 14.5 13.7 12.8 12.5 12.6 12.1 11.4 10.7 9.8
Czech Republic 3.7 3.4 3.8 4 4.2 4.7 4.9 5.8 6.3 6.9 7.5
Denmark 11 11.9 13.6 15 14.2 16.1 16.7 17.8 20 22.2 24.4
@benlyall
benlyall / README.md
Last active August 29, 2015 14:20 — forked from mbostock/.block