A better Mephisto Tag Cloud Plugin
posted: October 14th, 2007 · by: Sven
I talked about why we need a better Mephisto tag cloud plugin recently and that it probably should use the Boldr plugin as a basis. Sadly nobody really seems to care about this at Boldr.net. Well, there’re more important things than building another tagcloud for Mephisto, right?
Thus I started to revamp a brand new tag cloud plugin for Mephisto which is now available in the Subversion Repository … and of course I really believe that it is the most sophisticated, customizable, standard-conform and overall awesome implementation of a tag cloud for Mephisto ;). Why, yes, obviously I’m a little biased, so judge for yourself!
I added some usage instructions to my Mephisto TagCloud plugin page. So if you want to try and install this brilliant piece of software you might want to head over there for more info.
Tag weight distribution
The hardest thing with a tag cloud is the distribution algorithm because it has to work with very different sets of data.
There are a couple of interesting reads about that out there … here are some which I found useful or interesting:
- Tag Cloud Font Distribution Algorithm
- In Search Of … The Perfect Tag Cloud
- Tag-CloudDrawing: Algorithms for Cloud Visualization
To be able to better watch the differences in the results with different distribution algorithms I added a simple tag weight distribution graph to the plugin. You can add a route like the following:
# config/routes.rb
map.connect 'tagcloud/distribution',
:controller => 'tag_cloud',
:action => 'distribution'
E.g. with the options:
TagCloud.method = :log
TagCloud.order = :weight
TagCloud.weights = 6
… the tags dataset on my blog would show this graph:
That’s a bit steep. By setting the option TagCloud.method = :log though I get a distribution like this:
… which is far better.
Obviously this tag weight and distribution stuff requires quite some research and I guess there’s no silver bullet (again) that suits well for all tag data sets. So if you install this plugin I’d really appreciate to learn about how this works for you. Even more so if you tweaked it and found something different to work better!
Hank said October 20th, 2007 at 03:12 PM ¶
Yo, I got your email - it led me here. So, I recently added a limit, which is in my code, to my main blog tag cloud. It works well enough for me at the moment, so I have neglected developing it further. I like your ideas here. The logarithmic idea is a good one - I also think you should score based on how recently a tag has been used - this would allow the theme of your blog tags to change given the most current content. That way, if you’d been writing about perl for a year, and for the last 2 months you changed to ruby, it would have perl smaller and ruby larger because the content was more recent.
I may go back and revamp all the docs and posts for my tag cloud, but really it was there for people to use as a basis for their own. Let me know if you get something good like this going, and feel free to link to your tag cloud pages from my blog in the comments.
Stephen said October 21st, 2007 at 12:27 AM ¶
I, too, would like to see a tag cloud plugin that could (optionally) weight tags by date. Say, tags used in the last [recent time period] are bumped up a level or two. Tags not used in the last [recent time period] are dropped a level or two.
Sven said October 22nd, 2007 at 12:37 PM ¶
Hi Hank, hi Stephen!
I’m still not sure about your idea to factor in the “freshness” of taggings into the weight of the tag. My current thinking is that it depends on the usecase. Blogs are date-oriented, so your suggestion really makes sense for blogs. It probably doesn’t make so much sense for other applications of tagclouds.
On the other hand this probably goes against the common expectations of users. Does it? At least I don’t know of any tag cloud that uses this criterion. People might get confused.
Then again this probably would kind of solve the issue Technorati’s stupid behaviour to only look at the 10 or so top-most tags and ignore the rest.
So, you see, I’m still trying to wrap my head around this. Anyways, thanks a million for this input! It really get’s some thoughts going here :)