Help understand the Algorithm for tag cloud
Asked Answered
C

3

7

I would like to understand the Algorithm/implementation of the tag cloud.

In tag cloud we get following tags(weight)

  • Tag: tag is the string or term for search (or parent depending on type of cloud)
  • Weight: frequency of numeric value for the tag

Now in tag cloud control only subset of the values are displayed with different font sizes. Consider a following sample space tag1(1)... tagx(2) and then few big tags tag2(4000). Now on UI i would like to show the tags (html elements with) fort size. With such a distinct sample one cannot end up showing the big 1000px font. This data needs to be processed to that I get slabs for point concentrations so that I get values say like following:

  • for points concentration is move for 1 - 4 so that I divide it in 4 slabs each incement of 2 (1- 2px, 2- 4px, ... 4- 8px)
  • 4000 and some K are less so I would like to make two slabs say (1000 - 2000 = 10px) and (2000 and above = 12px)

I am using ASP.NET C#. Please let me know how to achive this. I am really not good at mathematics (statistics). Please help me with this algorithm. Or link to maths/tutorial or good sample would help.

Culberson answered 14/3, 2011 at 15:35 Comment(1)
#3717814 found this one its nice thread discussed earlier.Culberson
N
2

There's a downloadable O'Reilly ebook (40 something pages) called Building Tag Clouds in Perl and PHP that (from what I remember, it was a while ago) had a pretty good cover of the basics and also has (as the title implies) sample implementations in Perl and PHP.

Nigrify answered 14/3, 2011 at 17:31 Comment(0)
S
2

Here's a fairly well explained example from 4 guys from Rolla

Singspiel answered 14/3, 2011 at 15:41 Comment(1)
Thanks for link, i am looking for the standers deviation with font weight which is codeproject.com/KB/aspnet/cloud.aspx link in the article. However its not there... do you know any other example which explains it with standard deviationCulberson
N
2

There's a downloadable O'Reilly ebook (40 something pages) called Building Tag Clouds in Perl and PHP that (from what I remember, it was a while ago) had a pretty good cover of the basics and also has (as the title implies) sample implementations in Perl and PHP.

Nigrify answered 14/3, 2011 at 17:31 Comment(0)
D
0

I only say that to reduce complexity display only frequency beside tag name like here C# x 1000 . But if you want to control font size with frequency .Make slab to restrict font size.Like

Frequency    Font Size

1--5 3px; 6--30 5px; 31-100 8px; 101-500 10px; 501-1000 12px; <1000 14px;(restriction in final)

I dont know about asp.net But you can easliy implement this in PHP

Doridoria answered 15/3, 2011 at 20:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.