Skip to content

Instantly share code, notes, and snippets.

@MorganZhang100
MorganZhang100 / index.html
Created March 10, 2016 05:43
Pie Chart with islands.csv (Areas of the World's Major Landmasses)
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.arc text {
font: 10px sans-serif;
text-anchor: middle;
}
.arc path {
@MorganZhang100
MorganZhang100 / cars.csv
Created March 10, 2016 05:17
Scatterplot with cars.csv (Car speed & stop distance)
speed dist
1 4 2
2 4 10
3 7 4
4 7 22
5 8 16
6 9 10
7 10 18
8 10 26
9 10 34
@MorganZhang100
MorganZhang100 / UKgas.csv
Created March 10, 2016 05:04
Bar Chart with UKgas.csv
time UKgas
1960 160.1
1960.25 129.7
1960.5 84.8
1960.75 120.1
1961 160.1
1961.25 124.9
1961.5 84.8
1961.75 116.9
1962 169.7
@MorganZhang100
MorganZhang100 / d3tip.js
Created March 8, 2016 20:37
Geo with quakes.csv
// d3.tip
// Copyright (c) 2013 Justin Palmer
//
// Tooltips for d3.js SVG visualizations
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module with d3 as a dependency.
define(['d3'], factory)
} else if (typeof module === 'object' && module.exports) {
@MorganZhang100
MorganZhang100 / house_4D.csv
Created March 8, 2016 19:28
scatter plot with house dataset
median_house_value median_income housing_median_age total_rooms
452600 8.33 41 880
358500 8.3 21 7099
352100 7.26 52 1467
341300 5.64 52 1274
342200 3.85 52 1627
269700 4.04 52 919
299200 3.66 52 2535
241400 3.12 52 3104
226700 2.08 42 2555
median_house_value median_income
67500 0.5
87500 0.54
95200 0.73
162500 0.75
162500 0.76
81800 0.77
58300 0.8
81800 0.8
112500 0.8
We can't make this file beautiful and searchable because it's too large.
median_house_value,median_income,housing_median_age,total_rooms,total_bedrooms,population,households,latitude,longitude
452600.00,8.33,41.00,880.00,129.00,322.00,126.00,37.88,-122.23
358500.00,8.30,21.00,7099.00,1106.00,2401.00,1138.00,37.86,-122.22
352100.00,7.26,52.00,1467.00,190.00,496.00,177.00,37.85,-122.24
341300.00,5.64,52.00,1274.00,235.00,558.00,219.00,37.85,-122.25
342200.00,3.85,52.00,1627.00,280.00,565.00,259.00,37.85,-122.25
269700.00,4.04,52.00,919.00,213.00,413.00,193.00,37.85,-122.25
299200.00,3.66,52.00,2535.00,489.00,1094.00,514.00,37.84,-122.25
241400.00,3.12,52.00,3104.00,687.00,1157.00,647.00,37.84,-122.25
226700.00,2.08,42.00,2555.00,665.00,1206.00,595.00,37.84,-122.26