The Gamma of Tag Clouds

I was doing some work on making a good looking tag cloud. The trick is to have slightly different tag sizes, but without having a few popular tags grossly outweighing the other tags. The tag size is then set using font-size: Xem.

  @max = @tags.collect(&:frequency).collect(&:to_i).max
  @min = @tags.collect(&:frequency).collect(&:to_i).min

  def tag_size(tag)
    gamma = 1.2
    range = 1.0
    offset = 1.0

    [1.0,1.0 / (@max-@min) * (tag.frequency.to_i - @min) ** gamma].min * range + offset
  end

One Response to “The Gamma of Tag Clouds”

  1. OTIS Says:


    Medicamentspot.com. Canadian Health&Care.Best quality drugs.No prescription online pharmacy.Special Internet Prices. No prescription pills. Order pills online

    Buy:Cialis Super Active+.Tramadol.Cialis.Super Active ED Pack.VPXL.Zithromax.Soma.Cialis Professional.Cialis Soft Tabs.Viagra Super Force.Viagra Soft Tabs.Viagra.Levitra.Maxaman.Viagra Professional.Viagra Super Active+.Propecia….

Leave a Reply