sign in | register

Blogoforum Blogoforum - RE: Tag Cloud Makeup Continued

recent > blogoforum > suggestion > tagging > math > logarithm, programming and size

[show older messages in this discussion]

RE: Tag Cloud Makeup Continued

I have to write it for you, because I haven't read it anywhere, I just constructed the equation myself. Here you go:

Let's say you want your your tags in sizes from 1 to 10, according to their counts. I'll use pseudocode here. You define boundaries:

pmin <- 1
pmax <- 10

Then you calculate the min and max values from your tags:

vmin <- min(values)
vmax <- max(values)

Now, let's say you have a tag with 'x' occurences. The log-size of your tag is:

int((pmax - pmin) * (log(x)) / (log(vmax)) + pmin)
by Automatthias
September 17, 2006 7:19 PM
+ add to your Readings [?]
- Reply

Tag Cloud Makeup Thanks to Automatthias

Now that was valuable! I slightly modified the formula to take in account min of values like int((pmax - pmin) * (log(x - vmin)) / (log(vmax - vmin)) + pmin) and filter out situations like log(0) and log(1) . Take a look at Blogoforum clouds now!

If you can, please tell us how did you get to that formula. Thanks Automatthias!

by dkrukovsky
September 18, 2006 3:14 AM
1 more in
- Reply

RE: Tag Cloud Makeup Thanks to Automatthias

Yeah, it does look better now!

As for the minimum value -- yes, you're right. I've been tackling this equation for quite a long time, and this was what I've ended up with. I had a reason to remove the minimum value, but I can'r remember anymore what it was. I think it was just something about the look of the tag list in my case.

The log(0) and log(1) situations are present by default, I thought about removing them by shifting min and max a little bit:

vmin = min(values) - 0.5
vmax = max(values) + 0.5

But finally I just added some test against the 0 and 1 values and handled them by assigning pmin and pmax.

I'm glad I could help here.

September 18, 2006 7:29 AM
in
- Reply
wrong? assign your keywords [?]
Google

Explore Blogoforum - The Better Forum Experiment

Blogoforum is looking for UI Designer.

Tell the World

Blogoforum will become more useful as its user base grows. If you think the idea is interesting, bookmark it on del.icio.us and tell your friends.