Skip to content

Commit

Permalink
Add colour to example.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondavies committed Nov 10, 2012
1 parent e3db3c9 commit 6103e15
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<script src="../d3.layout.cloud.js"></script>
<body>
<script>
var fill = d3.scale.category20();

d3.layout.cloud().size([300, 300])
.words([
"Hello", "world", "normally", "you", "want", "more", "words",
Expand All @@ -25,6 +27,7 @@
.enter().append("text")
.style("font-size", function(d) { return d.size + "px"; })
.style("font-family", "Impact")
.style("fill", function(d, i) { return fill(i); })
.attr("text-anchor", "middle")
.attr("transform", function(d) {
return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")";
Expand Down

0 comments on commit 6103e15

Please sign in to comment.