Skip to content

Instantly share code, notes, and snippets.

@jdspersonal
jdspersonal / README.md
Created October 7, 2012 09:55 — forked from mbostock/.block
Voronoi tests

Tests for edge cases with d3.geom.voronoi, mainly N=2.

@jdspersonal
jdspersonal / index.html
Created October 12, 2012 07:22 — forked from ZJONSSON/index.html
testing circles in Leaflet.js (working)
<!DOCTYPE html>
<html>
<head>
<title>Testing d3.js in Leaflet.js</title>
<link rel="stylesheet" href="leaflet.css"></link>
<script type="text/javascript" src="http://d3js.org/d3.v2.min.js?2.10.0"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.4/leaflet.js"></script>
<style type="text/css">
@jdspersonal
jdspersonal / index.html
Last active December 14, 2015 08:08 — forked from ZJONSSON/index.html
<!DOCTYPE html>
<html>
<head>
<title>Testing d3.js in Leaflet.js</title>
<link rel="stylesheet" href="leaflet.css"></link>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script>
<style type="text/css">
svg , g
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
font: 14px sans-serif;
}
.axis path, .axis line {
fill: none;
@jdspersonal
jdspersonal / README.md
Last active August 29, 2015 14:06 — forked from mbostock/.block

This map shows the graph distance of each county from the Pacific or Atlantic coast; it is a recreation of a map posted to /r/dataisbeautiful using TopoJSON. Coastal counties are dark blue, while counties nine or more counties away from the coast are light yellow. (I opted not to reuse the original’s cycling color scale.)

See also the underlying graph.

<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
font: 300 11px "Helvetica Neue", Helvetica, Arial, sans-serif;
fill: #282828 ;
}
.node:hover {
@jdspersonal
jdspersonal / index.html
Last active August 29, 2015 14:11 — forked from emeeks/index.html
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Orbits 2</title>
<meta charset="utf-8" />
</head>
<style>
#viz, svg {
width: 900px;
height: 900px;
@jdspersonal
jdspersonal / .gitignore
Last active August 29, 2015 14:13 — forked from mbostock/.block
.DS_Store
build
node_modules
@jdspersonal
jdspersonal / README.md
Last active October 22, 2015 14:18 — forked from ckuijjer/README.md
United States Postage Rate

An implementation in D3 of Figure 4-42 "Step chart showing change in postage rate" in "Visualize This" by Nathan Yau.

Both the tickFormat function used for the x axis and the function used to render the amounts use a directly executed JavaScript function. This function returns another JavaScript function and creates a closure on the first variable, allowing them to have a specific format for the first option in the dataset.

Issues:

  • The tickmark for 2001 renders as '01 instead of 2001
@jdspersonal
jdspersonal / .block
Last active September 16, 2016 15:17 — forked from nbremer/.block
Brushable Horizontal Bar Chart - V
height: 540