tags-cloud
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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:

/tags-cloud/

    Package Sidebar

    Install

    npm i tags-cloud

    Weekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    5.17 kB

    Total Files

    5

    Last publish

    Collaborators

    • evangl