1.0.1 • Published 2 years ago

tags-cloud v1.0.1

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
2 years ago

Tag Cloud

Lightweight tag cloud generator.

It generates different font sizes (in rems), for each word, based on their frequency.

tag cloud example with random words

Install & Run tests

  • Install: npm install tags-cloud

How to use

tagCloud(tagList, order='default', minFontSize=1, maxFontSize=2);

import { tagCloud } from 'tags-cloud';

const tagList = [{ name: 'tag', count: '8' }, { name: 'cloud', count: '1' }];

// Default order (the current order of your tagList)
tagCloud(tagList, 'default');

// Ascending order
tagCloud(tagList, 'asc');

// Descending order
tagCloud(tagList, 'desc');

// Random order
tagCloud(tagList, 'random');

// Aplhabetical order
tagCloud(tagList, 'alphabetical');

// Defining the min and max font size (in rems)
tagCloud(tagList, 'default', 2, 6);

Types

Code examples: