Question

I am trying to create word cloud using d3.js and d3.layout.cloud.js.

For this I am using .csv file which contains rows word,size. But unable to create the file. Unable to understand that where I'am going wrong with this.

Following is my code:

Word Cloud creation using d3.js in .csv

Was it helpful?

Solution

d3.csv is an asynchronous call. That means that it doesn't return anything, you have to process the data in the callback. I've done that (and fixed a few other things) here. I've also limited the font sizes to be between 8 and 24 as the values in your data are rather large.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top