mirror of
https://github.com/simon-brooke/clj-wordcloud.git
synced 2025-07-01 17:38:09 +00:00
Fix examples
This commit is contained in:
parent
aaf84eac36
commit
ebe2fe049d
32
README.md
32
README.md
|
@ -16,19 +16,25 @@ Given a map of element and the frequency the following image is generated. More
|
||||||
(ns examples
|
(ns examples
|
||||||
(:require [clj-wordcloud.core :refer :all]))
|
(:require [clj-wordcloud.core :refer :all]))
|
||||||
|
|
||||||
(let [frequency-map (zipmap (random-words 100) (shuffle (range 300)))
|
(def programming-languages ["Clojure" "Haskell" "Go" "Rust" "Scala" "Python" "Perl"
|
||||||
word-cloud (word-cloud frequency-map
|
"Ruby" "Smalltalk" "PHP" "Java" "JavaScript"
|
||||||
{:dimension {:width 600
|
"C" "C++" "Lisp" "Scheme" "Typescript" "D" "R" "Brainfuck" "Elixir"
|
||||||
:height 600}
|
"Erlang" "C#" "BASIC" "Logo" "Alice" "Dart" "Purescript" "Prolog"
|
||||||
:background {:type :circle
|
"Ada" "F#" "Julia" "Kotlin" "Swift" "Delphi"])
|
||||||
:size 300
|
|
||||||
:color "0x000000"}
|
(let [frequency-map (zipmap programming-languages (shuffle (range 300)))
|
||||||
:font {:type "Calibre"
|
word-cloud (word-cloud frequency-map
|
||||||
:weight :plain
|
{:dimension {:width 600
|
||||||
:scale-type :linear
|
:height 600}
|
||||||
:x-scale 20
|
:background {:type :circle
|
||||||
:y-scale 20
|
:size 300
|
||||||
:padding 5}})]
|
: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"))
|
(write-to-file word-cloud "example_circle.png"))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 37 KiB |
Loading…
Reference in a new issue