Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tirkarthi/clj-wordcloud
A simple clojure wrapper around kumo to build wordclouds
https://github.com/tirkarthi/clj-wordcloud
clojure kumo wordcloud
Last synced: 4 days ago
JSON representation
A simple clojure wrapper around kumo to build wordclouds
- Host: GitHub
- URL: https://github.com/tirkarthi/clj-wordcloud
- Owner: tirkarthi
- License: mit
- Created: 2018-03-21T18:35:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-19T10:56:57.000Z (over 6 years ago)
- Last Synced: 2024-10-08T20:13:57.874Z (about 1 month ago)
- Topics: clojure, kumo, wordcloud
- Language: Clojure
- Size: 414 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# clj-wordcloud [![Clojars Project](https://img.shields.io/clojars/v/xtreak/clj-wordcloud.svg)](https://clojars.org/xtreak/clj-wordcloud) [![Build Status](https://travis-ci.org/tirkarthi/clj-wordcloud.svg?branch=master)](https://travis-ci.org/tirkarthi/clj-wordcloud)
A simple clojure wrapper around kumo to generate wordcloud
## Leiningen
`[xtreak/clj-wordcloud "0.0.1"]`
## Documentation
Documentation is generated by Codox and it's available at https://tirkarthi.github.io/clj-wordcloud/
## Example
Given a map of element and the frequency the following image is generated. More examples/examples.clj.
### Circle
```clojure
(ns examples
(:require [clj-wordcloud.core :refer :all]))(def programming-languages ["Clojure" "Haskell" "Go" "Rust" "Scala" "Python" "Perl"
"Ruby" "Smalltalk" "PHP" "Java" "JavaScript"
"C" "C++" "Lisp" "Scheme" "Typescript" "D" "R" "Brainfuck" "Elixir"
"Erlang" "C#" "BASIC" "Logo" "Alice" "Dart" "Purescript" "Prolog"
"Ada" "F#" "Julia" "Kotlin" "Swift" "Delphi"])(let [frequency-map (zipmap programming-languages (shuffle (range 300)))
word-cloud (word-cloud frequency-map
{:dimension {:width 600
:height 600}
:background {:type :circle
:size 300
:color "0x000000"}
:font {:type "Calibre"
:weight :plain
:scale-type :linear
:x-scale 20
:y-scale 20
:padding 5}})]
(write-to-file word-cloud "example_circle.png"))
```![Sample](/examples/example_circle.png)
### Bitmaps
```clojure
(ns examples
(:require [clj-wordcloud.core :refer :all]))(let [frequency-map (zipmap (range 100 150) (shuffle (range 300)))
word-cloud (word-cloud frequency-map
{:dimension {:width 600
:height 600}
:background {:type :pixel
:size 300
:color "0x000000"
:bitmap "examples/backgrounds/haskell_1.bmp"}
:font {:type "Calibre"
:weight :plain
:scale-type :linear
:x-scale 20
:y-scale 20
:padding 5}})]
(write-to-file word-cloud "example_haskell.png"))
```![Sample](/examples/example_haskell.png)
## TODO
* API parity with Kumo
* clojure.spec for docs and validation
* Cool examples
* Better tests## Contributing
Contributions are welcome. Please refer to CONTRIBUTING.md.
## Stability
This library is still in early development phase and the API is subject to change. API design comments are welcome.
## Thanks
Thanks to @kennycason for [kumo](https://github.com/kennycason/kumo) without which this library is not possible
## License
Copyright © 2018 Karthikeyan S
Distributed under the MIT License