WWW::CloudCreator - A weighted cloud creator
use WWW::CloudCreator; my $cloud = WWW::CloudCreator->new( smallest => 8, largest => 16, cold => '000', hot => '000', ); $cloud->add('friends', 40); $cloud->add('famiy', 12); $cloud->add('tech', 103); my @weights = $cloud->gencloud; foreach my $item (@weights) { print 'tag: '.$item->[0].' - weight: '.$item->[1]."\n"; }
This module will assist with creating complex weighted clouds. They are usually refered to as tag or heat clouds.
Some could argue that this module does exactly what HTML::TagCloud does but I argue that on several points. This module will create a sorted and weighed cloud but will also create a gradiant color pattern for the cloud as well.
Another difference is that this module will not return real html, but raw data that you can then manipulate into html as you see fit.
This module does not export any functions.
This is the object creator. It does have a set of default arguments that can be modified and adjusted.
This value represents the smallest possible font size of an item in the cloud.
This value represents the largest possible font size of an item in the cloud.
The cold argument represents a color value associated with items that have a smaller weight.
The hot argument represents a color value associated with items that have a larger weight.
This method adds a item and value to the cloud. The first argument must be a real label and the second argument must be a score or count of some sort.
The gencloud methods will prepare the final calculations for font sizes and color gradiants to produce the final cloud.
It accepts no arguments.
It returns an array of arrays containing a label, weight and set of style rules.
This is an internal function to assist with generating font sizes that don't break.
This is an internal function to assist with dec to hex conversions.
This is an internal function to assist with hex to dec conversions.
Nick Gerakines, <nick at socklabs.com>
<nick at socklabs.com>
The color gradiant code is buggy. I'm aware and looking into other ways of doing it.
Please report any bugs or feature requests to bug-www-cloudcreator at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-CloudCreator. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-www-cloudcreator at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc WWW::CloudCreator
You can also look for information at:
http://blog.socklabs.com/CloudNine
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/WWW-CloudCreator
CPAN Ratings
http://cpanratings.perl.org/d/WWW-CloudCreator
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-CloudCreator
Search CPAN
http://search.cpan.org/dist/WWW-CloudCreator
I would like to acknowledge the developers and contributors to HTML::TagCloud and HTML::TagCloud::Extended. This module was heavily inspired by both of those.
I would also like to mention that this module was also inspired by this piece of code:
http://www.engadgeted.net/projects/wordpress-heat-map-plugin/
Copyright 2006 Nick Gerakines, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WWW::CloudCreator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::CloudCreator
CPAN shell
perl -MCPAN -e shell install WWW::CloudCreator
For more information on module installation, please visit the detailed CPAN module installation guide.