src/assessorparser.rb
# Output Markdown / Javascript to build largest-zone-owners blog post data
Output Markdown / Javascript to build largest-zone-owners blog post data
Output Markdown / Javascript to build largest - zone - owners blog post data
def output_zoneownersjs(zone_owners, filename)
    data = ''
    ZONE_KEY.each do |zone, name| 
      data << "<div class='chartfigure'><h3 style='text-align: center;'>#{zone} - #{name}</h3><div id='zone#{zone}'></div></div>\n"
    end
    data << "\n\n"
    zone_owners[SIZE].each do |zone, owners|
      data << "addDonutChart('#zone#{zone}', [\n"
      ctr = 0
      totpct = 0.0
      owners.each do |owner, sizepct|
        totpct += sizepct[1]
        data << "  ['#{owner}', #{sizepct[1]}],\n"
        ctr += 1
        break if ctr > 10 
      end
      data << "  ['All Others', #{(1.0 - totpct).round(4)}]\n"
      data << "], 'Zone #{zone}', {'All Others': 'black'})\n\n"
    end
    puts data
  end
def output_zoneownersjs ( zone_owners , filename ) data = '' ZONE_KEY . each do | zone , name | data << "<div class='chartfigure'><h3 style='text-align: center;'>#{zone} - #{name}</h3><div id='zone#{zone}'></div></div>\n" end data << "\n\n" zone_owners [ SIZE ] . each do | zone , owners | data << "addDonutChart('#zone#{zone}', [\n" ctr = 0 totpct = 0.0 owners . each do | owner , sizepct | totpct += sizepct [ 1 ] data << "  ['#{owner}', #{sizepct[1]}],\n" ctr += 1 break if ctr > 10 end data << "  ['All Others', #{(1.0 - totpct).round(4)}]\n" data << "], 'Zone #{zone}', {'All Others': 'black'})\n\n" end puts data end
Output Markdown / Javascript to build largest-zone-owners blog post data
Output Markdown / Javascript to build largest - zone - owners blog post data
# Hack out the markdown as well # Arbitrary to make charts look OK # Add in remainder as a specific value
zone_owners
<not_specific>
filename
<not_specific>