Coder Social home page Coder Social logo

alexl0ng / wordcloud2.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timdream/wordcloud2.js

0.0 0.0 0.0 684 KB

Tag cloud/Wordle presentation on 2D canvas or HTML

Home Page: https://wordcloud2-js.timdream.org/

License: MIT License

Shell 1.70% JavaScript 83.42% HTML 14.87%

wordcloud2.js's Introduction

wordcloud2.js npm version

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

Installation

npm 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 & help

Please read through the API documentation and CONTRIBUTING.md before filing an issue or contact me via e-mail.

Algorithm

Before 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.

Testing

Tests 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.

Acknowledgement

The developer would like to thank Chad Jensen for sponsoring the work on image masking on the demo page.

wordcloud2.js's People

Contributors

timdream avatar dependabot[bot] avatar maman avatar adityanaag3 avatar frankmayer avatar pirosauro avatar kernc avatar mibamur avatar jes490 avatar alexjf avatar bigomega avatar brandoncc avatar daithi-coombes avatar dandv avatar dominikherold avatar floriansw avatar fensterbank avatar harrisonpage avatar jacquimanzi avatar kyoloro avatar mstevens avatar peterdavehello avatar orapouso avatar rse avatar seanmcmillan avatar steel avatar stefan-it avatar stephenr85 avatar aeradriel avatar tiagofscoelho avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.