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

July 21st, 2010 at 4:32 am
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….