magic_cloud icon indicating copy to clipboard operation
magic_cloud copied to clipboard

Error while not weighting words.

Open arbox opened this issue 7 years ago • 2 comments

When we provide equal weights for every word we get such an error:

ruby -I lib wordcloud.rb 
/home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:132:in `to_i': NaN (FloatDomainError)
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:132:in `block in make_scaler'
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:32:in `block in draw'
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:28:in `each'
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:28:in `each_with_index'
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:28:in `each'
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:28:in `map'
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:28:in `draw'
from wordcloud.rb:21:in `<main>'

I didn't investigate the algorithm in cloud.rb:132

((ssize - smin).to_f * koeff + FONT_MIN).to_i

arbox avatar May 05 '17 16:05 arbox

+1

Sticksword avatar Jun 19 '18 04:06 Sticksword

I have the same issue.

josephschito avatar Feb 11 '19 11:02 josephschito