diff --git a/d3.cloud.layout/d3.cloud.layout-tests.ts b/d3.cloud.layout/d3.cloud.layout-tests.ts
new file mode 100644
index 0000000000..c22d76b361
--- /dev/null
+++ b/d3.cloud.layout/d3.cloud.layout-tests.ts
@@ -0,0 +1,43 @@
+///
+///
+
+ interface ICompTextSize{
+ text:string;
+ size:number;
+ x?:number;
+ y?:number;
+ rotate?:number;
+ }
+
+
+ var fill = d3.scale.category20();
+ d3.layout.cloud().size([300, 300])
+ .words([
+ "Hello", "world", "normally", "you", "want", "more", "words",
+ "than", "this"].map(function(d:string) {
+ return {text: d, size: 10 + Math.random() * 90};
+ }))
+ .padding(5)
+ .rotate(function() { return ~~(Math.random() * 2) * 90; })
+ .font("Impact")
+ .fontSize(function(d:ICompTextSize) { return d.size; })
+ .on("end", draw)
+ .start();
+ function draw(words:ICompTextSize[]) {
+ d3.select("body").append("svg")
+ .attr("width", 300)
+ .attr("height", 300)
+ .append("g")
+ .attr("transform", "translate(150,150)")
+ .selectAll("text")
+ .data(words)
+ .enter().append("text")
+ .style("font-size", function(d:ICompTextSize) { return d.size + "px"; })
+ .style("font-family", "Impact")
+ .style("fill", function(d:ICompTextSize, i:number) { return fill(i); })
+ .attr("text-anchor", "middle")
+ .attr("transform", function(d:ICompTextSize) {
+ return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")";
+ })
+ .text(function(d:ICompTextSize) { return d.text; });
+ }
\ No newline at end of file
diff --git a/d3.cloud.layout/d3.cloud.layout.d.ts b/d3.cloud.layout/d3.cloud.layout.d.ts
new file mode 100644
index 0000000000..5ac3aced8c
--- /dev/null
+++ b/d3.cloud.layout/d3.cloud.layout.d.ts
@@ -0,0 +1,45 @@
+// Type definitions for d3JS cloud layout plugin by Jason Davies
+// Project: https://github.com/jasondavies/d3-cloud
+// Definitions by: hans windhoff
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+
+declare module D3 {
+ export module Layout {
+ export interface IRotate {
+ (number:number) : CloudLayout;
+ (number:()=>number) : CloudLayout;
+ }
+
+
+
+ export interface CloudLayout {
+ (layers: any[], index?: number): any[];
+ values(accessor?: (d: any) => any): CloudLayout;
+ offset(offset: string): CloudLayout;
+ size: {
+ /**
+ * Gets the available layout size
+ */
+ (): Array;
+ /**
+ * Sets the available layout size
+ */
+ (size: Array): CloudLayout;
+ };
+ words: (inputArray: Array) => CloudLayout;
+ rotate:IRotate;
+ padding: (number:number) => CloudLayout;
+ font: (string:string) => CloudLayout;
+ fontSize(fctn: (d: any) => number): CloudLayout;
+ on: (eventname: string, callee: (words: any[]) => void) => CloudLayout;
+ start: () => CloudLayout;
+ }
+
+
+ export interface Layout {
+ cloud(): CloudLayout;
+ }
+ }
+}
\ No newline at end of file