Create an aesthetic word cloud on an HTML5 canvas from your MySQL Data
inspired by timdream's wordcloud.
Author: Matt Dodge <[email protected]>
- PHP with PDO
- jQuery
- HTML5 Browser with Canvas support (aka anything that is not IE 8 or lower)
-
Clone or download into a directory on your web server, let's call the directory "wordcloud"
-
After you have loaded jQuery with a <SCRIPT> tag, load the plugin
<script type="text/javascript" src="wordcloud/jquery.wordcloud.js"></script>
-
Put a canvas somewhere on your page
<canvas id="cloudcanvas" width="600" height="400"></canvas>
-
After the DOM is ready, call the
wordCloud
function on the canvas$("#cloudcanvas").wordCloud({ database: { // database parameters go here, see parameters section } });
That's it! See the tests in the tests directory for some living examples.