tagcloud.js

Displays a "Tag Cloud", visually enhanced set of links


Objects

Methods

Constants


OAT.TagCloud(div, optionsObject)

Creates a Tag Cloud inside div. Options are specified in optionsObject:

OAT.TagCloud::clearItems()

Removes all items (links).

OAT.TagCloud::addItem(name, link, [frequency])

Adds a new item. Its label is name, link is an URL. Third argument, frequency is optional and defaults to 1.

OAT.TagCloud::draw()

Draws the Tag Cloud.

var colors = ["#f00","#0f0","#00f"];
var sizes = ["80%","100%","120%"];
var tc = new OAT.TagCloud("myDiv",{separator:", ", colorMapping:OAT.TagCloudData.COLOR_SIZE, colors:colors, sizes:sizes});

tc.addItem("Label 1", "http://", 10);
tc.addItem("Label 2", "http://", 5);
tc.addItem("Label 3", "http://"); /* frequency == 1 */

tc.draw();