My first D3 map showing my travel across the US. This visualization was built by modifying choropleth example code by Scott Murray, tooltip example code by Malcolm Maclean, and legend code example by Mike Bostock.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Hello World", | |
"developer_id": "09509742-f473-41bb-9e8b-bbdcd6111011" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CXX = g++ | |
CXXFLAGS = -g -Wall -std=c++11 | |
SPLIT_TEST = SPLIT_TEST | |
SPLIT_CATCH = split_catch.cpp | |
SPLIT = split.cpp | |
all: $(SPLIT_TEST) | |
run: all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> | |
<script type="text/javascript"> | |
google.charts.load('current', {'packages':['corechart']}); | |
google.charts.setOnLoadCallback(drawChart); | |
function drawChart() { | |
var data = google.visualization.arrayToDataTable([ | |
['Age', 'Weight'], |
This is the map of Nielen Designated Marketing Areas using D3.js. Hover over for data related to each area.
See map here
See code here
###Credits
- Map adapted from Mike Bostock's map example
- Topojson made by converting shapefile from here to topojson via Mike Bostock's instructions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from matplotlib.animation import FuncAnimation | |
class GameOfLife: | |
def __init__(self, seed): | |
assert all(len(c) == 2 for c in seed) | |
self.state = list(set(seed)) | |
def __find_n(self, c): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageDraw | |
im = Image.new('1',(640, 640), color='white') | |
d = ImageDraw.Draw(im) | |
def subdivide(order, origin, size): | |
''' | |
Recursively draw sierpinski's triangle via shrinking and duplication: | |
1. Start with square in the plane | |
2. Halve dimensions of square, make three copies, and stack them in a pyramid |