mutewinter / Showbot

🤖 An IRC Bot and Website for 5by5.tv written with the Cinch and Sinatra frameworks
MIT License
90 stars 31 forks source link

Word cloud issue: JSON::GeneratorError: NaN not allowed in JSON #54

Open rikai opened 11 years ago

rikai commented 11 years ago

When you first create a database and populate some suggestions, it can't create the clouds. Should probably add some additional code to account for situations like this. trying to view a word cloud will get you a nice fancy error page from JSON::GeneratorError for a while stating: 810: NaN not allowed in JSON

/usr/home/Showbot/showbot_web.rb in to_json
      cloud_data.map do |d|
/usr/home/Showbot/showbot_web.rb in cloud_json
      cloud_data.map do |d|
/usr/home/Showbot/views/clouds_svg.haml in block in singletonclass
  #cloud-data{data: {:'cloud-data' => cloud_json(cloud_data[cloud_index, 1])}}
/usr/home/Showbot/showbot_web.rb in block in <class:ShowbotWeb>
    haml :'clouds_svg', :locals => { cloud_data: WordCount.generate_clouds(suggestion_sets), cloud_index: params[:index].to_i }