Noting is showing up
I tried what was in the Simple usage, but still nothing showing up. < div id="my_canvas" >< /div > < script > var list = [['foo', 12], ['bar', 6]]; WordCloud(document.getElementById('my_canvas'), { list: list } ); < /script >
Looks like you need to give the div with the id 'my_canvas' a defined dimensions (w + h). Could you please add this into your usage? It's obvious but not to everyone. Also, can you have more usages/examples? From the demo i'm not able to see how you did it in code. Thanks.
Looks like you need to give the div with the id 'my_canvas' a defined dimensions (w + h). Could you please add this into your usage? It's obvious but not to everyone. Also, can you have more usages/examples? From the demo i'm not able to see how you did it in code. Thanks.
Sounds reasonable. Would you like to submit a pull request to patch README for that? Thanks!
Sure. Thanks.
Btw, i tested with the array below and only HTTP shows up on the rendering. Why not 'foo' and 'bar'? It's a good size display 100%x500px.
this.list = [['foo', 868], ['bar', 832], ['HTTP', 77]];
@timdream Any ideas? Thanks.
For others seeing this post, I had this problem (items not showing up). It's because the size is the font size, not an arbitrary number. Try normalising your size values to sensible font sizes.
I think this issue is covered in issue #53
This element div.#my_canvas must have height and width
i have the same issue, at the first time, the whole page is blank, and i modify the num in list to sensible font sizes. it does work. but there are still some words lost..
I have the same issue, even i gives the same attributes with the official website. I have not find out the reason.someone can help? let option = { list: [['Les Misérables', '20'], ['Victor Hugo', '20']], gridSize: 18, weightFactor: 3, fontFamily: 'Average, Times, serif', backgroundColor: '#333' }; wordcloud(containerEl, option);
I have found out the reason why nothing has shown.We need to set weightFactor: 1.If weightFactor is too big ,we need to set the attribute drawOutOfBound for true.
Having a defined width and height makes everything unscalable. i.e. With a response page that changes the size of elements with window size, the word cloud will eventually draw out of bounds. Rather than scale with the space. Using canvas, if you don't specify height, the canvas will scale nicely and the wrapping element height will fit the canvas.