Skip to content

Instantly share code, notes, and snippets.

@ix4
ix4 / README.md
Created April 26, 2019 04:18 — forked from veltman/README.md
Gas prices per gallon vs. per mile

A variation on Hannah Fairfield's classic connected scatterplot on gas prices. Shows the different trends for cost as "dollars per gallon" and cost as "dollars per mile." The peaks and valleys are similar, but factoring in steadily increasing fuel efficiency makes recent gas price increases look less extreme relative to to the 1979 energy crisis and earlier years.

Miles per capita computed from US Census population estimates and FWHA's Vehicle Miles Traveled. Fuel prices per gallon from Table 9.4 of the EIA's Energy Review. Prices look a little different than the NYT chart because it uses the average regular grade price throughout (presumably leaded for earlier y

@ix4
ix4 / README.md
Created April 26, 2019 04:24 — forked from veltman/README.md
Strip map with labels

A version of this strip map with some labeled features.

Labels are a bit trickier than background features because you don't want to clip them to the zones, but you can't just create one copy per zone of each, or you'll get a bunch of identical labels approximately on top of each other and it will look weird. This uses a point-in-polygon test to assign each labeled point to its proper zone at the start. Once that assignment is done, you could put the labels in their own top layer if you had to worry about other features overlapping (not really an issue in this case).

@ix4
ix4 / index.html
Created April 26, 2019 04:44 — forked from thomasdunn/index.html
xhr pinger
<!DOCTYPE html>
<html>
<head>
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="initial-scale=1">
<style type="text/css">
body {
background: black;
@ix4
ix4 / .block
Created April 26, 2019 06:17 — forked from alansmithy/.block
Pictogram grid in d3js
license: mit
@ix4
ix4 / .block
Created April 26, 2019 06:18 — forked from officeofjane/.block
SVG icons unit chart
license: mit
@ix4
ix4 / .block
Created April 26, 2019 06:19 — forked from officeofjane/.block
Date slider - histogram legend
license: mit
@ix4
ix4 / .block
Created April 26, 2019 06:21 — forked from officeofjane/.block
China tile grid map
license: mit
@ix4
ix4 / README.md
Created April 26, 2019 06:22 — forked from chrisrzhou/README.md
D3 Inflation Explorer

D3 Inflation Explorer

bl.ocks.org link

![image-inflation][]

Explores inflation by visualizing relative prices in two different years.

Mouseover to view details on relative CPI and prices. Click on a tile to freeze details. 2015 years are highlighted in gold.

The project is created using D3.js.

@ix4
ix4 / index.html
Created April 26, 2019 06:25 — forked from feyderm/index.html
Geographic, interactive hexbin
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src = "https://feyderm.github.io/d3/d3.js"></script>
<script src = "https://feyderm.github.io/d3/hexbin/hexbin.js"></script>
<script src = "https://feyderm.github.io/d3/d3-legend-master/d3-legend.js"></script>
<script src = "https://feyderm.github.io/js/viridis_colors.js"></script>
</head>
@ix4
ix4 / .gitignore
Created April 26, 2019 06:25 — forked from feyderm/.gitignore
Concurrent temporal data (pan and zoom)
.eslintrc.js