19 |
20 |
tag-cloud with default CSS:
21 |
22 |
23 |
24 |
25 |
26 |
27 | <ng-tag-cloud cloud-width="250" cloud-height="250" cloud-data="data"></ng-tag-cloud> //default width and height are 300px;
28 |
29 |
30 |
31 |
32 |
tag-cloud with custom CSS:
33 |
34 |
35 |
36 |
37 | <ng-tag-cloud class="custom-1" cloud-data="data"></ng-tag-cloud>
38 |
39 |
40 |
41 |
42 |
tag-cloud with overflow enabled:
43 |
44 |
45 |
46 |
47 |
48 |
49 | <ng-tag-cloud cloud-width="150" cloud-height="150" cloud-data="data" cloud-overflow="true"></ng-tag-cloud>
50 |
51 |
52 |
53 |
54 |
55 |
JSON Data Format:
56 |
57 |
58 | data = [
59 | {text: "Lorem", weight: 15, link: "https://google.com"},
60 | {text: "Ipsum", weight: 9},
61 | {text: "Dolor", weight: 6},
62 | {text: "Sit", weight: 7},
63 | {text: "Amet", weight: 5}
64 | ];
65 |
66 |
67 |
68 |
69 |
70 |
71 |
Custom CSS:
72 |
73 |
74 | div.custom-1 {
75 | font-family: "Helvetica", "Arial", sans-serif;
76 | font-size: 10px;
77 | line-height: normal;
78 | }
79 |
80 | div.custom-1 a {
81 | font-size: inherit;
82 | text-decoration: none;
83 | }
84 |
85 | div.custom-1 span.w10 { font-size: 550%; }
86 | div.custom-1 span.w9 { font-size: 500%; }
87 | div.custom-1 span.w8 { font-size: 450%; }
88 | div.custom-1 span.w7 { font-size: 400%; }
89 | div.custom-1 span.w6 { font-size: 350%; }
90 | div.custom-1 span.w5 { font-size: 300%; }
91 | div.custom-1 span.w4 { font-size: 250%; }
92 | div.custom-1 span.w3 { font-size: 200%; }
93 | div.custom-1 span.w2 { font-size: 150%; }
94 | div.custom-1 span.w1 { font-size: 100%; }
95 |
96 | /* colors */
97 |
98 | div.custom-1 { color: #09f; }
99 | div.custom-1 a { color: inherit; }
100 | div.custom-1 a:hover { color: #0df; }
101 | div.custom-1 a:hover { color: #0cf; }
102 | div.custom-1 span.w10 { color: grey; }
103 | div.custom-1 span.w9 { color: #0cf; }
104 | div.custom-1 span.w8 { color: #0cf; }
105 | div.custom-1 span.w7 { color: #39d; }
106 | div.custom-1 span.w6 { color: #90c5f0; }
107 | div.custom-1 span.w5 { color: #90a0dd; }
108 | div.custom-1 span.w4 { color: purple; }
109 | div.custom-1 span.w3 { color: green; }
110 | div.custom-1 span.w2 { color: blue; }
111 | div.custom-1 span.w1 { color: red; }
112 |
113 | /* layout */
114 |
115 | div.ng-tag-cloud {
116 | overflow: hidden;
117 | position: relative;
118 | }
119 |
120 | div.ng-tag-cloud span { padding: 0; }
121 |
122 |
123 |
124 |
125 |
126 |
127 |
130 |
131 |
132 |
133 |
134 |
135 |
--------------------------------------------------------------------------------
/examples/js/app.js:
--------------------------------------------------------------------------------
1 | var app = angular.module("tagcloudExample",["ngTagCloud"]);
2 |
3 | app.controller("MyController",function($scope){
4 |
5 |
6 | $scope.data = [
7 | {text: "Lorem", weight: 15, link: "https://google.com"},
8 | {text: "Ipsum", weight: 9},
9 | {text: "Dolor", weight: 6},
10 | {text: "Sit", weight: 7},
11 | {text: "Amet", weight: 5}
12 | // ...as many words as you want
13 | ];
14 | });
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "angular-tag-cloud",
3 | "version": "0.3.4",
4 | "description": "Create simple clean tag clouds in your Angular app. No other dependencies required.",
5 | "main": "dist/ng-tag-cloud-module.js",
6 | "directories": {
7 | "example": "examples",
8 | "test": "tests"
9 | },
10 | "scripts": {
11 | "minify": "minify --output dist/ng-tag-cloud.min.js src/ng-tag-cloud.js",
12 | "test": "echo \"Error: no test specified\" && exit 1"
13 | },
14 | "repository": {
15 | "type": "git",
16 | "url": "git+https://github.com/zeeshanhyder/angular-tag-cloud.git"
17 | },
18 | "keywords": [
19 | "angular",
20 | "cloud-tags",
21 | "tag-cloud",
22 | "angular-tag-cloud",
23 | "tags"
24 | ],
25 | "author": "Zeeshan Hyder