Skip to content

Instantly share code, notes, and snippets.

@stormpython
stormpython / country.csv
Last active August 29, 2015 14:21
D3 Reusable Chart
country median_age gdp edu_index
Afghanistan 18 18949 0.354
Albania 30.2 13000 0.886
Algeria 27.1 198735 0.748
Andorra 39.9 3577 0.878
Antigua and Barbuda 30 1118 0.945
Argentina 30.3 448165 0.946
Australia 37.5 1515468 0.993
Austria 42.6 418031 0.962
Azerbaijan 28.5 63404 0.881
@stormpython
stormpython / index.html
Last active August 29, 2015 14:24
Layout Example using D3 style reusable components
<div class="visualize"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script>
@stormpython
stormpython / split.js
Created July 2, 2015 16:35
Recursive splitting of divs with D3
define(function (require) {
var d3 = require("d3");
return function split() {
var splitBy = function (d) { return d; };
var element = "div";
var elementClass = function () { return "horizontal"; };
var predicate = false;
function layout(selection) {
@stormpython
stormpython / example.html
Last active September 15, 2015 17:07
Creating a Line Chart with Phoenix
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
body {
font: 10px sans-serif;
}
@stormpython
stormpython / readme.md
Last active September 18, 2015 17:26 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@stormpython
stormpython / Rows, Columns, Grid Layout Example.markdown
Created November 9, 2015 22:35
Rows, Columns, Grid Layout Example
@stormpython
stormpython / Rows, Columns, Grid Layout Example.markdown
Created November 10, 2015 18:01
Rows, Columns, Grid Layout Example
@stormpython
stormpython / bar_chart.js
Created November 11, 2015 16:27
Police Killings Visualization Project
function barChart() {
var key = function (d) { return d.key; };
var margin = { top: 20, right: 20, left: 20, bottom: 20 };
var width = 500;
var height = 500;
var xScale = d3.scale.linear();
var yScale = d3.scale.ordinal();
var yAxis = d3.svg.axis().orient('left').tickSize(0);
var sort = function (a, b) { return a.count - b.count; };
var padding = 0.1;
@stormpython
stormpython / index.html
Last active November 15, 2023 02:52
Police Killings Visualization Project Map
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<style>
path {
fill: none;
stroke: #000000;
stroke-linejoin: round;
stroke-linecap: round;
}
@stormpython
stormpython / countries.json
Last active November 13, 2015 18:49
European Life Expectancy
[
{ "abbr": "ad", "name": "Andorra", "leb": 84.2, "pop": 79200, "size": 468 },
{ "abbr": "al", "name": "Albania", "leb": 74, "pop": 2887000, "size": 28748 },
{ "abbr": "at", "name": "Austria", "leb": 81.5, "pop": 8608000, "size": 83858 },
{ "abbr": "ba", "name": "Bosnia and Herzegovina", "leb": 76, "pop": 3750000, "size": 51129 },
{ "abbr": "be", "name": "Belgium", "leb": 81, "pop": 11259000, "size": 30510 },
{ "abbr": "bg", "name": "Bulgaria", "leb": 74.5, "pop": 7265000, "size": 110910 },
{ "abbr": "by", "name": "Belaurs", "leb": 72.5, "pop": 9481000, "size": 207600 },
{ "abbr": "ch", "name": "Switzerland", "leb": 82.8, "pop": 8081000, "size": 41290 },
{ "abbr": "cy", "name": "Cyprus", "leb": 81.2, "pop": 876000, "size": 9251 },