Tag cloud/Wordle presentation
Create a tag cloud/Wordle presentation on 2D canvas or HTML.
This library is a spin-off project from HTML5 Word Cloud.
Visit the demo page
Installationnpm install wordcloud
Simple usage
Download the latest wordcloud2.js
file from the src
folder in this repository.
Load wordcloud2.js
script to the web page, and run:
WordCloud(document.getElementById('my_canvas'), { list: list } );
where list
is an array that look like this: [['foo', 12], ['bar', 6]]
.
Options available, see API documentation for detail.
Contact & helpPlease read through the API documentation and CONTRIBUTING.md before filing an issue or contact me via e-mail.
AlgorithmBefore putting each word on the canvas, it is drawn on a separate canvas to read back the pixels to record is drawn spaces. With the information, wordcloud.js will then try to find a place to fit the word that is closest to the start point.
TestingTests are available with QUnit and grunt
.
To setup environment for testing, run npm install
and manually install SlimerJS of your platform.
Use grunt test
to ensure all options can be set without JavaScript error.
Use grunt compare --base-commit=gh-pages
to compare your proposed fix with gh-pages
branch.
The developer would like to thank Chad Jensen for sponsoring the work on image masking on the demo page.
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。