Bret Davidson | NCSU Libraries
var dataset = [20, 5, 10, 0, 50];
d3.select('body')
.selectAll('p') // selection
.data(dataset) // data binding
.enter() // create enter selection
.append('p') // dom manipulation
.style('font-size', '50px') // static property
.text(function (d, i) { // dynamic property
return i + ': my value is ' + d;
});
// Enter
rects.enter()
.append('rect');
// Update
rects.attr('x', 20)
.attr('y', function (d, i) {return 65 * i;})
.attr('height', '60' )
.attr('width', function(d, i) {return x(d);});
// Exit
rects.exit()
.remove();
var fontSize = d3.scale.linear()
.domain([0, d3.max(dataset)])
.range([25, 50]);
d3.max(array[, accessor]);
d3.min(array[, accessor]);
d3.extent(array[, accessor]);
d3.sum(array[, accessor]);
d3.mean(array[, accessor]);
d3.median(array[, accessor]);
d3.range([start, ]stop[, step]);
d3.nest()
.key(function(d) { return d.school })
.entries(array);
Mike Bostock
Scott Cheng
Scott Murray
Jason Casden
Joyce Chapman
Bret Davidson
Rob Rucker
Rusty Earl
Eric McEachern
lib.ncsu.edu/dli/projects/spaceassesstoolbret_davidson@ncsu.edu