This is a code excerpt from the book D3 on Angular. http://leanpub.com/d3angularjs
Data from Wikipedia (3/16/2014) https://en.wikipedia.org/wiki/List_of_largest_employers
Open it in a new window and resize the browser to see the effect.
This is a code excerpt from the book D3 on Angular. http://leanpub.com/d3angularjs
Data from Wikipedia (3/16/2014) https://en.wikipedia.org/wiki/List_of_largest_employers
Open it in a new window and resize the browser to see the effect.
This map shows the graph distance of each county from the Pacific or Atlantic coast; it is a recreation of a map posted to /r/dataisbeautiful using TopoJSON. Coastal counties are dark blue, while counties nine or more counties away from the coast are light yellow. (I opted not to reuse the original’s cycling color scale.)
See also the underlying graph.
This example aims to demonstrate our inability to fully grasp [exponential functions][wikg]. As [Albert Bartlett][barl] once said, "The greatest shortcoming of the human race is our inability to understand the exponential function." This little D3 animation is based on a paper by Dr Bartlett.
Our action hero, a pixelated version of [Chris Martenson][chrs], stands on a platform inside an empty 4000 litre water tank. At the very bottom of the tank lies a magic drop of water. Invisible to the eye now, it doubles in size every 10 seconds.
Although the growth rate is constant, for a long time we see no change. But there's a well known limit, the capacity of the tank. Once he realises that water is rising exponentially, poor pixellated Chris has no time left to react.
Our brains are wired to predict future behaviour based on past behaviour (see [here][psyc]). But what happens when something growths exponentially? For a long time, the numbers are so little in relation to the scale that we hardly see the ch
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<h2> | |
</h2> | |
<script type="text/javascript" src="d3.v2.min.js"></script> | |
<script type="text/javascript"> |
# -*- coding: utf-8 -*- | |
""" | |
Demo of Anscombe's quartet in Python | |
Prints the return values from linregress to show that they're all identical | |
https://en.wikipedia.org/wiki/Anscombe's_quartet | |
""" | |
from matplotlib.pyplot import subplot, scatter, plot, axis |
#!/bin/bash | |
version=0.1.4 | |
versionDate="2014-09-02" | |
function showHelp() { | |
echo "subtlemark - add subtle watermarks to images | |
Usage: | |
---------------------------------------- |
/* I, Brandon Martin-Anderson, release this into the public domain or whatever. */ | |
BufferedReader reader; | |
double ll, bb, rr, tt; | |
float A = 1000.0; | |
GlobalMercator proj = new GlobalMercator(); |
# create user and database with user as admin | |
sudo -u postgres createuser -D -A -P uname | |
sudo -u postgres createdb -O uname dbname | |
# delete database and user | |
sudo -u postgres dropdb dbname | |
sudo -u postgres dropuser uname | |
# dump and import data | |
pg_dump --clean -U uname dbname > dump.sql |
icotool -o favicon.ico -c favicon.png |
This example belongs to the GeoExamples blog entry Flag map with D3js.
Basically, gets the flag images from the Wikipedia by using Mike Bostock's queue.js library and adds them to the map.
The region represented in the map is marked in red.
In this case, everything is drawn using the Canvas element.