8. Compatibility
http://caniuse.com/svg
"You'll need a modern browser to use SVG and
CSS3 Transitions. D3 is not a compatibility layer,
so if your browser doesn't support standards,
you're out of luck. Sorry!"**
https://github.com/shawnbot/aight
26. scales for color
colorScale
=
d3.scale.category20c();
https://github.com/mbostock/d3/wiki/Ordinal-Scales#categorical-colors
colorScale
=
d3.scale.linear()
.domain([0,
d3.max(dataset)])
.range(["blue",
"green"]);
or
27. transition
.transition()
.delay(
ms
)
.ease("cubic-‐in-‐out")
.duration(
ms
)
.attr(“prop”,
“value”);
** could also use CSS3 transitions
https://github.com/mbostock/d3/wiki/Transitions#wiki-d3_ease
30. axis
Rethink height and y for bars.
Swap yScale range
.attr("height",
function(d,i){
return
h
-‐
yScale(d)})
.attr("y",
function(d,i){
return
h
-‐(h
-‐
yScale(d))})
.range([
h,
0
]);