Skip to content

Instantly share code, notes, and snippets.

@wwymak
wwymak / README.md
Last active February 18, 2016 23:28
uk_powergen_24hrs
@wwymak
wwymak / project_gutenberg_metadata_parser.py
Created February 21, 2016 20:14
Parses project gutenberg's rdf metadata to something sensible
# -*- coding: utf-8 -*-
"""
script to parse the project gutenberg's rdf catalog into python dict
with option to save to json
most of it from https://gist.github.com/andreasvc/b3b4189120d84dec8857,
tweaked to work with python 3 AND also using lists rather than sets so it is all easily json serialisable
"""
import os
import re
@wwymak
wwymak / README.md
Last active September 11, 2016 11:28
gridmapTest

Work in progress towards making a hexgrid map of the uk --- draw the counties, then assign a circle to each of counties, then use force layout with collision detection to force the circles not to collide

Also draw a hexagon grid, then after force layout has finished, assinged te hexagons closest to the circle to be blue

Add in function so when you click on a colored hexagon, you are 'moving' that to a new position when you click on uncolored hexagon

collision code adapted form http://bl.ocks.org/mbostock/1804919, inspired by https://github.com/kristw/gridmap-layout-thailand

@wwymak
wwymak / axisUtils.js
Last active February 26, 2016 15:05
reusable d3 chart components, with extra bits and bobs
/**
* Useful stuff for axes
*/
/**
* after drawing the axis, check the label sizes and return the max height and width so you can resize the margins
* if you need to
* @param labelSelArr e.g. d3.selectAll('.y.axis .tick')
*/
function checkLabelSizes(labelSelArr) {
@wwymak
wwymak / .gitignore
Last active March 6, 2016 09:02
weather dashboard expt
node_modules
@wwymak
wwymak / README.md
Last active May 30, 2016 19:17
experimenting with d3v4 force params
@wwymak
wwymak / d3Activity.json
Created June 19, 2016 18:43
experiment with d3v4 force layout with d3 repo's activity
[{"id":"4133764903","type":"WatchEvent","actor":{"id":1307603,"login":"akzaidi","display_login":"akzaidi","gravatar_id":"","url":"https://api.github.com/users/akzaidi","avatar_url":"https://avatars.githubusercontent.com/u/1307603?"},"repo":{"id":943149,"name":"d3/d3","url":"https://api.github.com/repos/d3/d3"},"payload":{"action":"started"},"public":true,"created_at":"2016-06-11T18:04:40Z","org":{"id":1562726,"login":"d3","gravatar_id":"","url":"https://api.github.com/orgs/d3","avatar_url":"https://avatars.githubusercontent.com/u/1562726?"}},{"id":"4133691247","type":"WatchEvent","actor":{"id":1904614,"login":"shingchi","display_login":"shingchi","gravatar_id":"","url":"https://api.github.com/users/shingchi","avatar_url":"https://avatars.githubusercontent.com/u/1904614?"},"repo":{"id":943149,"name":"d3/d3","url":"https://api.github.com/repos/d3/d3"},"payload":{"action":"started"},"public":true,"created_at":"2016-06-11T17:03:36Z","org":{"id":1562726,"login":"d3","gravatar_id":"","url":"https://api.github.com/o
@wwymak
wwymak / README.md
Last active June 26, 2016 19:08
experiment for euref results
@wwymak
wwymak / .block
Created July 17, 2016 20:04
sentimentVis with transcript from datastories attempt1
license: gpl-3.0
@wwymak
wwymak / .block
Last active September 13, 2016 23:29
Attempt at Binsq with d3
license: mit