mirror of
https://github.com/simon-brooke/clj-wordcloud.git
synced 2026-01-12 22:49:52 +00:00
Add support for custom bitmaps and docs
This commit is contained in:
parent
48f5ddc293
commit
8f76e1175a
10 changed files with 206 additions and 27 deletions
|
|
@ -9,9 +9,22 @@
|
|||
(let [image (javax.imageio.ImageIO/read r)]
|
||||
[(.getWidth image) (.getHeight image)])))
|
||||
|
||||
|
||||
(deftest image-dimensions-test
|
||||
(testing "Test width and height of the generated image"
|
||||
(let [word-cloud (word-cloud (zipmap (range 100 130) (range 300))
|
||||
{:background {:type :circle :size 300}
|
||||
:filename "sample.png" :font-y 100 :padding 10})]
|
||||
(let [freq-map (zipmap (range 100 130) (range 300))
|
||||
word-cloud (word-cloud freq-map
|
||||
{:dimension {:width 600
|
||||
:height 600}
|
||||
:background {:type :circle
|
||||
:size 300
|
||||
:color "0x000000"}
|
||||
:font {:type "Comic Sans MS"
|
||||
:scale-type :linear
|
||||
:x-scale 20
|
||||
:y-scale 20
|
||||
:padding 5
|
||||
:colors ["0x00FF00" "0x0000FF" "0xFFAFFF"
|
||||
"0xFFEEFF" "0xEEEEEE"]}})]
|
||||
(write-to-file word-cloud "sample.png")
|
||||
(is (= (get-size "sample.png") [600 600])))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue