Skip to content

Commit

Permalink
lower example's density
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyongzhi committed Mar 29, 2021
1 parent 2a083cd commit 8c5c11e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "WordCloud"
uuid = "6385f0a0-cb03-45b6-9089-4e0acc74b26b"
authors = ["guoyongzhi <[email protected]>"]
version = "0.6.2"
version = "0.6.3"

[deps]
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
Expand Down
2 changes: 1 addition & 1 deletion examples/alice.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ wc = wordcloud(
mask = loadmask(pkgdir(WordCloud)*"/res/alice_mask.png", color="#faeef8"),
colors = :seaborn_dark,
angles = (0, 90),
density = 0.55) |> generate!
density = 0.5) |> generate!
println("results are saved to alice.png")
paint(wc, "alice.png", background=outline(wc.mask, color="purple", linewidth=1))
wc
Expand Down
2 changes: 1 addition & 1 deletion examples/benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ words = [Random.randstring(rand(1:8)) for i in 1:200]
weights = randexp(length(words)) .* 2000 .+ rand(20:100, length(words));
wc1 = wordcloud(words, weights, mask=shape(ellipse, 500, 500, color=0.15), angles=(0,90,45), density=0.55)

words = [Random.randstring(rand(1:8)) for i in 1:500]
words = [Random.randstring(rand(1:8)) for i in 1:400]
weights = randexp(length(words)) .* 2000 .+ rand(20:100, length(words));
wc2 = wordcloud(words, weights, mask=shape(ellipse, 500, 500, color=0.15), angles=(0,90,45))

Expand Down
2 changes: 1 addition & 1 deletion examples/compare.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ stwords = ["us", "will"];
println("==Obama's==")
cs = WordCloud.randomscheme() #:Set1_8
as = WordCloud.randomangles() #(0,90,45,-45)
dens = 0.55 #not too high
dens = 0.5 #not too high
wca = wordcloud(
processtext(open(pkgdir(WordCloud)*"/res/Barack Obama's First Inaugural Address.txt"), stopwords=WordCloud.stopwords_en stwords),
colors = cs,
Expand Down
5 changes: 4 additions & 1 deletion examples/specifiedstyle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ wc = wordcloud(
setwords!(wc, "Alice", "Alice in Wonderland") # replace the word 'Alice' with 'Alice in Wonderland'
setangles!(wc, "Alice in Wonderland", 0) # make it horizontal
setcolors!(wc, "Alice in Wonderland", "purple");
setfontsizes!(wc, "Alice in Wonderland", 2.05size(wc.mask, 2)/length("Alice in Wonderland")) # set a big font size
setfontsizes!(wc, "Alice in Wonderland", size(wc.mask, 2)/length("Alice in Wonderland"))
initimage!(wc, "Alice in Wonderland")
r = size(wc.mask, 2)/size(getimages(wc, "Alice in Wonderland"), 2) * 0.95
setfontsizes!(wc, "Alice in Wonderland", r*size(wc.mask, 2)/length("Alice in Wonderland")) # set a big font size
initimage!(wc, "Alice in Wonderland") # init it after adjust it's style
setpositions!(wc, "Alice in Wonderland", reverse(size(wc.mask)) 2, type=setcenter!) # center it

Expand Down
2 changes: 1 addition & 1 deletion src/wc-method.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function generate!(wc::WC, args...; retry=3, krags...)
break
end
end
println("$ep epochs, $nc collections")
println("$ep epochs, $nc collisions")
if nc == 0
wc.params[:state] = nameof(generate!)
# @assert isempty(outofbounds(wc.maskqtree, wc.qtrees))
Expand Down

2 comments on commit 8c5c11e

@guo-yong-zhi
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/33111

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.3 -m "<description of version>" 8c5c11ea305f4fe131c5b29b2467ff6cb68ca2e6
git push origin v0.6.3

Please sign in to comment.