tag-cloud
Optimal data architecture for tagging, clouds, and searching (like StackOverflow)?
Wow I just wrote a big post and SO choked and hung on it, and when I hit my back button to resubmit, the markup editor was empty. aaargh. So here I go again… Regarding Stack Overflow, it turns out that they use SQL server 2005 full text search. Regarding the OS projects recommended by … Read more
What’s the best way to generate a tag cloud from an array using h1 through h6 for sizing?
You will want to add a logarithmic function to it too. (taken from tagadelic, my Drupal module to create tag clouds http://drupal.org/project/tagadelic): db_query(‘SELECT COUNT(*) AS count, id, name FROM … ORDER BY count DESC’); $steps = 6; $tags = array(); $min = 1e9; $max = -1e9; while ($tag = db_fetch_object($result)) { $tag->number_of_posts = $tag->count; #sets … Read more
Algorithm to implement a word cloud like Wordle
I’m the creator of Wordle. Here’s how Wordle actually works: Count the words, throw away boring words, and sort by the count, descending. Keep the top N words for some N. Assign each word a font size proportional to its count. Generate a Java2D Shape for each word, using the Java2D API. Each word “wants” … Read more