Skip to content

Instantly share code, notes, and snippets.

View timelyportfolio's full-sized avatar

timelyportfolio timelyportfolio

View GitHub Profile
@timelyportfolio
timelyportfolio / data-cycles.json
Last active October 8, 2015 13:40 — forked from soxofaan/data07-big-with-cycle.js
Sankey cycle test
{"nodes":[{"name":"a"},{"name":"b"},{"name":"c"},{"name":"d"},{"name":"e"},{"name":"f"},{"name":"g"},{"name":"h"},{"name":"i"},{"name":"j"},{"name":"k"},{"name":"l"},{"name":"m"},{"name":"n"},{"name":"o"},{"name":"p"},{"name":"q"},{"name":"r"},{"name":"s"},{"name":"t"},{"name":"u"},{"name":"v"},{"name":"w"},{"name":"x"},{"name":"y"},{"name":"z"},{"name":"aa"},{"name":"ab"},{"name":"ac"},{"name":"ad"},{"name":"ae"},{"name":"af"},{"name":"ag"},{"name":"ah"},{"name":"ai"},{"name":"aj"},{"name":"ak"},{"name":"al"},{"name":"am"},{"name":"an"},{"name":"ao"},{"name":"ap"},{"name":"aq"},{"name":"ar"},{"name":"as"},{"name":"at"},{"name":"au"},{"name":"av"},{"name":"aw"},{"name":"ax"}],"links":[{"source":1,"target":2,"value":74},{"source":2,"target":3,"value":64},{"source":2,"target":4,"value":46},{"source":4,"target":5,"value":45},{"source":5,"target":6,"value":45},{"source":7,"target":8,"value":45},{"source":8,"target":9,"value":65},{"source":10,"target":11,"value":42},{"source":12,"target":13,"value":20},{"source":1
@timelyportfolio
timelyportfolio / README.md
Last active September 8, 2015 14:00 — forked from christophermanning/README.md
Random Walk USA

Created by Christopher Manning

Summary

This is an experiment using a random walk to draw shapes. Adjusting theta results in a very organic or procedural drawing. The random walk stays in the geometry by using a point in polygon test.

Controls

@timelyportfolio
timelyportfolio / README.md
Last active September 5, 2015 23:05 — forked from mbostock/.block
Solar Path

This chart shows the path of the Sun in the sky today based on your current location. The red dot represents the current apparent position of the Sun in terms of azimuth and elevation.

The outer black circle represents the horizon, where the elevation of the Sun is 0°. If the Sun is outside this circle, it is below the horizon. (This means it’s dark outside, though note that some definitions of twilight extend as far as 18° below the horizon.) Where the path intersects the horizon determines sunrise and sunset. The inner concentric circles represent higher solar elevations.

The radiating lines of the graticule represent azimuth. For example, 0° azimuth means that the Sun is due North of your current location. The azimuth tells you the direction of shadows cast by the Sun, while the elevation determines their length.

@timelyportfolio
timelyportfolio / Readme.md
Last active August 29, 2015 14:28 — forked from jalapic/gana.csv
Heatmap of touches (in rbokeh)

@jalapic did these really nice set of touch heatmap charts. On Twitter, there was a discussion how to do this interactively with d3.js or some other JavaScript. I definitely have some ideas how to accomplish this, but for now let's see how we can kind of do it in rbokeh. There is just a small issue with palette selection in Bokeh that does not let us allow a no color that prevents us from getting really close.

## https://gist.github.com/jalapic/3616c0197ece24060e99
library(rbokeh)
library(dplyr)

gana <- read.csv("https://gist.githubusercontent.com/jalapic/3616c0197ece24060e99/raw/2bc2361c5fceb9be80dece9b7ffa14d129a3edfb/gana.csv")

figure() %>%
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Treemap - Neat Zoom Effect</title>
<script type="text/javascript" src="http://www.billdwhite.com/wordpress/wp-content/js/browserdetect/browserdetect.js"></script>
<script type="text/javascript" src="http://www.billdwhite.com/wordpress/wp-content/js/d3/d3.js"></script>
<style type="text/css">
body {
overflow: hidden;
library("igraph")
library("plyr")
library("HiveR")
library("RColorBrewer")
############################################################################################
rm(list = ls())
dataSet <- read.table("./inst/lesmis.txt", header = FALSE, sep = "\t")
############################################################################################
notional2005result.csv
notional2005result.json
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>D3 Ternary Plot</title>
<style>
a{
font-family: sans-serif;
color: #DB7365;
padding: 0.3rem;