NAME
WWW::CloudCreator - A weighted cloud creator
SYNOPSIS
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;
map { print 'tag: '.$_->[0].' - weight: '.$_->[1]."\n" } @weights;
DESCRIPTION
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.
EXPORT
This module does not export any functions.
SUBROUTINES/METHODS
new
This is the object creator. It does have a set of default arguments that can be modified and adjusted.
Arguments
- smallest
-
This value represents the smallest possible font size of an item in the cloud.
- largest
-
This value represents the largest possible font size of an item in the cloud.
- cold
-
The cold argument represents a color value associated with items that have a smaller weight.
- hot
-
The hot argument represents a color value associated with items that have a larger weight.
add
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.
gencloud
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.
round
This is an internal function to assist with generating font sizes that don't break.
dechex
This is an internal function to assist with dec to hex conversions.
hexdec
This is an internal function to assist with hex to dec conversions.
AUTHOR
Nick Gerakines, <nick at socklabs.com>
CAVEATS
The color gradiant code is buggy. I'm aware and looking into other ways of doing it.
BUGS
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.
SUPPORT
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
CPAN Ratings
RT: CPAN's request tracker
Search CPAN
ACKNOWLEDGEMENTS
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 & LICENSE
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.