Skip to content

Commit

Permalink
Merge pull request jasondavies#10 from ubershmekel/patch-1
Browse files Browse the repository at this point in the history
Allow additional data to be stored in words array
  • Loading branch information
jasondavies committed Jan 25, 2013
2 parents 8803b7f + 238e569 commit 2148288
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions d3.layout.cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@
i = -1,
tags = [],
data = words.map(function(d, i) {
return {
text: text.call(this, d, i),
font: font.call(this, d, i),
style: fontStyle.call(this, d, i),
weight: fontWeight.call(this, d, i),
rotate: rotate.call(this, d, i),
size: ~~fontSize.call(this, d, i),
padding: cloudPadding.call(this, d, i)
};
}).sort(function(a, b) { return b.size - a.size; });
d.text = text.call(this, d, i);
d.font = font.call(this, d, i);
d.style = fontStyle.call(this, d, i);
d.weight = fontWeight.call(this, d, i);
d.rotate = rotate.call(this, d, i);
d.size = ~~fontSize.call(this, d, i);
d.padding = cloudPadding.call(this, d, i);
return d;
}).sort(function(a, b) { return b.size - a.size; });

if (timer) clearInterval(timer);
timer = setInterval(step, 0);
Expand Down

0 comments on commit 2148288

Please sign in to comment.