ang2-tag-cloud
##Angular Tag Cloud
Installation
To install this library, run:
$ npm install ang2-tag-cloud --save
and then from your Angular AppModule
:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { Ang2TagCloudModule } from 'ang2-tag-cloud';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
Ang2TagCloudModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Usage it in your code
<ang2-tag-cloud
[tags]="tagArray"
(onSelect)="onSelectionChane($event)"
maxFontSize="6"
minFontSize="1"></ang2-tag-cloud>
attributes
tags : array of tags or array of objects , required. data source for tag list ( if its an object array then each object must contain a key "name" to hold the tag name"
onSelect : callback function that is executed when a new tag is selected. e.g. (onSelectionChane)="onSelectionChane($event)"
minFontSize : number, minimum allowed font size
maxFontSize : number, maximum allowed font size
animateTags : if true then we will show animation effect on the tag cloud
random : if true then the animation will be random way
'tags' can be an array of string or array of objects, sample array:
tagArray = ["html","css","Js"]
OR
tagArray = [{
name:"html"
value:1
},{
name:"css"
value:2
},{
name:"js"
value:3
}]