Skip to end of metadata
Go to start of metadata

word_cloud

https://github.com/amueller/word_cloud

A Python library that is well-attested - 8K stars on github, in progress for 8 years.

Unfortunately limited to writing PNG files which is harmful to accessibility. Also it being in Python will inhibit our currently preferred workflow of generating the cloud on the client side in response to polling a JSON endpoint.


General discussion of alternatives on Stack Overflow:

https://stackoverflow.com/questions/342687/algorithm-to-implement-a-word-cloud-like-wordle

Index of some JS libraries:


In the below I am automatically skipping any non-JS alternatives for now:


d3_cloud

https://github.com/jasondavies/d3-cloud

Fairly well attested JS library - 3.4k github stars, in progress for 8 years.

States that it uses HTML5 canvas but in fact it generates an SVG as seen at https://www.jasondavies.com/wordcloud/ which seems pretty reasonable for us.

Depends on d3. It looks like the words array can be updated dynamically, which is desirable for us, but we should investigate the behaviour.


react_tagcloud

https://github.com/madox2/react-tagcloud

Thinly attested - 117 stars, in progress for 6 years.

Pretty primitive rendering limited to horizontal text. However, it does render to plain HTML which might be an advantage in some contexts. In my experience React components integrate poorly with their hosts (in particular, they do not expose "instances" which can be used to expose an API. From here I'll be skipping any other React solutions.


wordcloud

https://github.com/timdream/wordcloud2.js

Moderately attested - 1.7k stars, in progress for 7 years

As well as rendering to plain HTML, it can also deal with different text directions, although the layout algorithm in the demo seems a little buggy and the default rendering isn't very "wordle-y". My impression is that the words list cannot be updated and the code and packaging appear amateurish.


VueWordCloud

https://github.com/SeregPie/VueWordCloud

Thinly attested - 287 stars, in progress for 4 years, all commits from one developer, no updates for 11 months, has no releases

Demo renders extremely slowly, API doesn't appear to permit update of words.



Draft recommendation is for d3_cloud.






  • No labels