Modified from the original d3 tile demo A demo of the d3.geo.tile plugin, which determines which 256x256 tiles are visible in the viewport based
D3 2.10 adds support for CIE L*a*b* and HCL. These perceptually-motivated color spaces are designed with humans (rather than computers) in mind. RGB and HSL interpolation can cause unintentional grouping due to parts of the color space appearing more visually similar; L*a*b* and HCL, in contrast, are perceptually uniform. For more information, see Gregor Aisch’s post How To Avoid Equidistant HSV Colors and Drew Skau’s post Dear NASA: No More Rainbow Color Scales, Please.
You can create L*a*b* or HCL colors directly using d3.lab or d3.hcl. For example:
var steelblue = d3.lab(52, -4, -32);
var steelblue = d3.hcl(-97, 32, 52);
You can also convert from RGB or HSL. This is useful for creating brighter or darker colors with uniform changes in perception:
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>One Graph</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script> | |
<script type="text/javascript" src="simple-graph.js"></script> | |
<style type="text/css"> | |
body { font: 13px sans-serif; } | |
rect { fill: #fff; } |
Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)
Alter the port the script talks to from 8000 to 80:
}).listen(80);
def decode_chunk(chunk): | |
""" | |
Experiment: decode a chunk! | |
<snip> | |
""" | |
# give ourselves a copy of this record as a bytearray to sanitize things a bit. | |
record = bytearray(chunk) | |
if chunk == 0x1f: | |
try: | |
print hex(record) |
body { | |
font-family: Helvetica, Verdana | |
} | |
p { | |
padding: 7px 10px; | |
} | |
#demo { | |
border: 1px solid #999; | |
} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v1.8.4/d3.js"></script> | |
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v1.8.4/d3.geo.js"></script> | |
<script type="text/javascript" src="https://github.com/simplegeo/polymaps/raw/v2.4.0/polymaps.js"></script> | |
<script type="text/javascript" src="tiler.js"></script> | |
<style type="text/css"> | |
@import url("http://github.com/simplegeo/polymaps/raw/v2.4.0/examples/example.css"); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>Spline + Pan</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<style type="text/css"> | |
body { | |
font: 13px sans-serif; | |
} |