Skip to content

Commit

Permalink
refactor(wordcloud): rename arg
Browse files Browse the repository at this point in the history
  • Loading branch information
guo-yong-zhi committed Oct 9, 2024
1 parent a6d0317 commit e965fab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 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 = "1.2.0"
version = "1.2.1"

[deps]
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
Expand Down
16 changes: 8 additions & 8 deletions src/wc-class.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function wordcloud(words::AbstractVector{<:AbstractString}, weights::AbstractVec
end
function processscheme(words, weights; colors=:auto, angles=:auto, fonts=:auto, language=:auto,
mask=:auto, svgmask=nothing, editmask=true, transparent=:auto,
masksize=:auto, maskcolor=:default, keepmaskarea=:auto, avgfontsize=12,
masksize=:auto, maskcolor=:default, preservevolume=:auto, avgfontsize=12,
backgroundcolor=:default, padding=:default, outline=:default, linecolor=:auto,
params=Dict{Symbol,Any}(), kargs...)
merge!(params, kargs)
Expand Down Expand Up @@ -178,8 +178,8 @@ function processscheme(words, weights; colors=:auto, angles=:auto, fonts=:auto,
maskcolor = backgroundcolor
end
end
if keepmaskarea in DEFAULTSYMBOLS
keepmaskarea = masksize in DEFAULTSYMBOLS
if preservevolume in DEFAULTSYMBOLS
preservevolume = masksize in DEFAULTSYMBOLS
end
masksize in DEFAULTSYMBOLS && (masksize = volumeproposal(words, weights, avgfontsize))
if backgroundcolor in DEFAULTSYMBOLS
Expand All @@ -203,7 +203,7 @@ function processscheme(words, weights; colors=:auto, angles=:auto, fonts=:auto,
end
padding in DEFAULTSYMBOLS && (padding = round(Int, maximum(masksize) ÷ 10))
mask, maskkw = randommask(masksize; maskshape=mask, color=maskcolor, padding=padding,
preservevolume=keepmaskarea, returnkwargs=true, kg..., kargs...)
preservevolume=preservevolume, returnkwargs=true, kg..., kargs...)
merge!(params, maskkw)
transparent = c -> c != torgba(maskcolor)
elseif editmask
Expand All @@ -214,8 +214,8 @@ function processscheme(words, weights; colors=:auto, angles=:auto, fonts=:auto,
else
ms = masksize
end
if keepmaskarea in DEFAULTSYMBOLS
keepmaskarea = masksize == :auto
if preservevolume in DEFAULTSYMBOLS
preservevolume = masksize == :auto
end
if backgroundcolor == :auto
if maskcolor == :default
Expand Down Expand Up @@ -249,10 +249,10 @@ function processscheme(words, weights; colors=:auto, angles=:auto, fonts=:auto,
padding in DEFAULTSYMBOLS && (padding = outline)
if svgmask !== nothing
svgmask = loadmask(svgmask, ms...; color=maskcolor, transparent=transparent, backgroundcolor=bc,
outline=outline, linecolor=linecolor, padding=padding, preservevolume=keepmaskarea, kargs...)
outline=outline, linecolor=linecolor, padding=padding, preservevolume=preservevolume, kargs...)
end
mask, binarymask = loadmask(mask, ms...; color=maskcolor, transparent=transparent, backgroundcolor=bc,
outline=outline, linecolor=linecolor, padding=padding, return_bitmask=true, preservevolume=keepmaskarea, kargs...)
outline=outline, linecolor=linecolor, padding=padding, return_bitmask=true, preservevolume=preservevolume, kargs...)
binarymask === nothing || (transparent = .!binarymask)
else
mask = loadmask(mask)
Expand Down

0 comments on commit e965fab

Please sign in to comment.