jasondavies / d3-cloud

Create word clouds in JavaScript.
https://www.jasondavies.com/wordcloud/
Other
3.82k stars 1.07k forks source link

Browser crashes if #size is passed 0 for width/height #104

Open stefanpearson opened 7 years ago

stefanpearson commented 7 years ago

After stepping through each line of code until I encountered the crash, I realised there were some crazy numbers while attempting to calculate positioning (-169827 or something…). I realised I was was accidentally passing height a 0 value. It could be worth throwing an error when the size method is called 😊.

var myCloud = d3Cloud()
    .size([1920, 0]);

…
💀