You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.textile
+30-5Lines changed: 30 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ h2. Installation
9
9
Installing jQCloud is extremely simple:
10
10
11
11
# Make sure to import the jQuery library in your project.
12
-
# Download the jQCloud files. Place jqcloud-0.1.8.js (or the minified version jqcloud-0.1.8.min.js) and jqcloud.css somewhere in your project and import both of them in your HTML code.
12
+
# Download the jQCloud files. Place jqcloud-0.2.0.js (or the minified version jqcloud-0.2.0.min.js) and jqcloud.css somewhere in your project and import both of them in your HTML code.
13
13
14
14
You can easily substitute jqcloud.css with a custom CSS stylesheet following the guidelines explained later.
* Create an array of objects to be passed to jQCloud, each representing a word in the cloud and specifying
@@ -59,14 +59,37 @@ bc. <!DOCTYPE html>
59
59
</body>
60
60
</html>
61
61
62
+
h3. Options:
63
+
64
+
Since version 0.2.0, jQCloud accepts an object containing configuration options as the second argument:
65
+
66
+
bc. $("#example").jQCloud(word_list, {
67
+
width: 300,
68
+
height: 200
69
+
});
70
+
71
+
The full list of available options is the following:
72
+
73
+
* *width* (number): The width of the word cloud. Defaults to the width of the container element.
74
+
* *height* (number): The height of the word cloud. Defaults to the height of the container element.
75
+
* *center* (object): The x and y coordinates of the center of the word cloud (e.g.: {x: 300, y: 150}). Defaults to the center of the container element.
76
+
* *callback* (function): A callback function to be called after the cloud is fully rendered. Undefined by default.
77
+
* *delayed_mode* (boolean): If true, words are rendered one after another with a tiny delay between each one. This prevents freezing of the browser when there are many words to be rendered. If false, the cloud will be rendered in one single shot. By default, delayed_mode is true when there are more than 50 words.
78
+
62
79
h3. Note:
63
80
64
-
Since drawing the cloud is rather computationally intensive, cloud rendering isn't instantaneous. If you want to make sure that some code executes after the cloud is rendered, you can pass to jQCloud a callback function:
81
+
Since drawing the cloud is rather computationally intensive, cloud rendering isn't instantaneous. If you want to make sure that some code executes after the cloud is rendered, you can specify in the options a callback function:
65
82
66
-
bc. $("#example").jQCloud(word_list, function(){
67
-
// This code executes after the cloud is fully rendered
83
+
bc. $("#example").jQCloud(word_list, {
84
+
callback: function() {
85
+
// This code executes after the cloud is fully rendered
86
+
}
68
87
});
69
88
89
+
h4. Deprecation warning:
90
+
91
+
Before version 0.2.0 jQCloud used to accept a callback function as the second argument. This way of specifying the callback function is deprecated and, although version 0.2.0 maintains backward compatibility, it will be removed in newer versions. If you need a callback function, use the 'callback' configuration option instead.
92
+
70
93
h2. Custom CSS guidelines
71
94
72
95
The word cloud produced by jQCloud is made of pure HTML, so you can style it using CSS. When you call $("#example").jQCloud(...), the containing element is given a CSS class of "jqcloud", allowing for easy CSS targeting. The included CSS file jqcloud.css is intended as an example and as a base on which to develop your own custom style, defining dimensions and appearance of words in the cloud. When writing your custom CSS, just follow these guidelines:
@@ -83,6 +106,8 @@ If you happen to use jQCloud in your projects, you can make me know (just contac
83
106
84
107
h2. Changelog
85
108
109
+
0.2.0 Add configuration options, passed as the second argument of jQCloud (include ideas proposed by "mindscratch":https://github.com/mindscratch and "aaaa0441":https://github.com/aaaa0441)
110
+
86
111
0.1.8 Fix bug in the algorithm causing sometimes unbalanced layouts (thanks to "isamochernov":https://github.com/isamochernov)
87
112
88
113
0.1.7 Remove duplicated @</span>@ when word has an URL (thanks to "rbrancher":https://github.com/rbrancher)
0 commit comments