Skip to content

Instantly share code, notes, and snippets.

@wwymak
wwymak / .gitignore
Last active December 6, 2022 15:28
Animated 3D globe with d3js and canvas
.DS_Store
@wwymak
wwymak / .gitignore
Last active March 13, 2016 15:10
London crime data map
.DS_Store
@wwymak
wwymak / .gitignore
Last active February 5, 2016 16:51
London crime map with d3-carto-map
.DS_Store
@wwymak
wwymak / 2013MASTER.csv
Last active February 5, 2016 16:50
US shooting data from shootingtracker.com
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
reported,date,shooter,killed,wounded,location,article1,article2,article3,article4,article5,article6,article7,article8,article9
,1/1/2013,Carlito Montoya,4,0,"Sacramento, CA",http://sanfrancisco.cbslocal.com/2013/01/12/3-young-men-teenage-boy-murdered-on-oakland-streets-in-6-hours-no-arrests/,http://hinterlandgazette.com/2013/01/oakland-gun-violence-ken-harbin-larry-lovette-eddiebo-rodriguez-4-killed-6hour-span.html,http://www.huffingtonpost.com/2013/01/12/oakland-shootings_n_2464783.html,,,,,,
,1/1/2013,Unknown,1,3,"Hawthorne, CA",http://losangeles.cbslocal.com/2013/01/01/man-killed-3-wounded-at-nye-party-in-hawthorne/,http://latimesblogs.latimes.com/lanow/2013/01/hawthorne-new-year-party-three-killed.html,,,,,,,
,1/1/2013,Julian Sims,0,4,"McKeesport, PA",http://pittsburgh.cbslocal.com/2013/01/01/4-people-shot-in-mckeesport/,http://www.wtae.com/news/local/allegheny/U-S-Marshals-task-force-arrests-New-Year-s-party-shooting-suspect/-/10927008/17977588/-/1ydqtj/-/index.html,,,,,,,
,1/1/2013,"Desmen Noble, Da
@wwymak
wwymak / README.md
Created January 24, 2016 20:35
Fellowship of the ring movie character occurence
@wwymak
wwymak / README.md
Last active January 25, 2016 14:45
Fellowship of the ring movie character occurence

Basically a small multiples vis of the Fellowship of the Ring characters (the 'Fellows' in the fellowship)

The script is from http://www.ageofthering.com/atthemovies/scripts/ and I used html-parser in nodejs to parse the script to get the character occurence.

Mainly an experiment for small multiples... And I do realise that I've missed out Aragon ;)

@wwymak
wwymak / linechart.js
Created January 25, 2016 14:46
resusuable linechart sample (in es6)
function lineplot(){
var width = 500,
height = 500,
margins = {top: 40, bottom: 40, left:40, right:40},
line = d3.svg.line().x(X).y(Y);
var xScale, yScale, xAxis, yAxis;
// The x-accessor for the path generator; xScale ∘ xValue.
function X(d, i) {
@wwymak
wwymak / package.json
Created January 27, 2016 10:31
basic node/express setup so you can easily do api requests
{
"name": "app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
@wwymak
wwymak / Readme.md
Last active February 5, 2016 16:57
Reusable linechart module

Reusuable linechart component in ES6 based on http://bost.ocks.org/mike/chart/time-series-chart.js, but with check for whether it is a single series or a multiseries

Use like :

let lineplot = linechart.lineplot()
      .width(chartWidth).height(chartHeight)
      .datapointRadius(5)
 .x(d => +d.key)
@wwymak
wwymak / eat-to-pret-distance-matrix.csv
Last active February 13, 2016 19:40
eat-to-pret-distance-ldn
InputID TargetID Distance Distance(m)
ChIJZf2Jlc4EdkgRqIM-ef2y6es ChIJXTn0yM4EdkgRSaV_zGoczWw 0.000414318 33.14544047
ChIJM1ObHN8EdkgRx1AtnTH31qI ChIJn02Ng9sEdkgRxFrkfZDwJO0 0.00081524 65.21917804
ChIJX55_pLEEdkgR4Tb2RgSm3tM ChIJJz_dQcoEdkgRGJNfDHFSARc 0.005485031 438.8024655
ChIJhUvcPtwEdkgRT_ZdtjwD7vA ChIJ9xPWINwEdkgRm21aBvx6c4I 0.001029683 82.37464658
ChIJAZyKwNYEdkgRF6IBLG_KdzY ChIJkQ6vidYEdkgR3l8oTFFaHOc 0.001613939 129.1151129
ChIJ78268CsbdkgRhoDFQqqxaaU ChIJLbaLZNEEdkgRkdhk1IC66dM 0.001272168 101.7734658
ChIJZ3p4J8gEdkgRpw9Xd1bY1VE ChIJJz_dQcoEdkgRGJNfDHFSARc 0.005201036 416.0828961
ChIJIUh4NRwQdkgRCiO3lEld7k4 ChIJW3HUgvsPdkgRHVK8WIOke1s 0.01162429 929.9432284
ChIJFZgdDpQPdkgRMEpKpZm8OCs ChIJh2hxb8IPdkgR9eNM6VlzhRw 0.013065664 1045.253151