I'm venturing into web programming for the first time and would like a nice way to display a frequency indicator of some data, in the form of a tag cloud.
For example, pretend I have some simple data of three types of pets: Dog, Cat, Monkey.
There are 5 Dogs, 27 Cats and 101 Monkeys.
Given this data, what's the best way to make a tag cloud to visually indicate that I have way too many monkeys, not as many cats, and that I definitely need obtain a few more dogs?
Update: It would be great if the solution was actually discussed and answered on stackoverflow. Linking externally is good to help support the answer, but leaving the links as an answer is not necessarily what stackoverflow is about. Anyone can google to find what has been linked. The hope is that stackoverflow will be the place to find the answer. This is just a request to help make stackoverflow better. :)
They usually generate the tag clouds automatically by analyzing the keywords or frequent words on a website or text. However, the tools may differ depending on whether a website is static or dynamic. The use of tag clouds has advantages as well as some disadvantages, which may vary depending on the user goals.
A tag cloud, also known as a word cloud, wordle, or weighted list, is a visual representation of the most popular words (or tags) found in free-form text. The size of tags or single words, and collocations, is proportionate to how often they appear in your text.
I don't believe this is the answer you're looking for, but there is a Cloud Control for ASP.NET available at CodeProject:
http://www.codeproject.com/KB/aspnet/cloud.aspx
It's looks fairly easy to use.
--
Edit: I should probably credit my source. The link above was found on the following web page:
http://www.technacular.com/2007/04/22/how-to-create-a-tag-cloud/
This page contains some additional general information related to building a Tag Cloud. Best of luck!
You need to first decide your metric (i.e. what you want to measure, in this case number of pets per type), and second how you map that metric onto a set of classes. These classes are equivalent to the styles you attach to the tags.
A quite simple mapping would be x[i] / sum(x) giving a ratio between 0 and 1. Define subranges on the range [0, 1], for example 4 ranges from 0..0.25, 0.25..0.50 and so on. Find the index of the subrange (0,1,2,3) and assign the tag a CSS class "tagX".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With