Skip to content

Commit 47496b8

Browse files
committed
plutoapp: support set masksize
1 parent dbbdb36 commit 47496b8

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

plutoapp.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ isempty(wordblacklist) ? nothing : wordblacklist
4040
end
4141

4242
# ╔═╡ f4844a5f-260b-4713-84bf-69cd8123c7fc
43-
md"""**mask shape:** $(@bind mask_ Select([:auto, box, ellipse, squircle, ngon, star, bezingon, bezistar])) $(@bind configshape CheckBox(default=false))additional config"""
43+
md"""**mask shape:** $(@bind mask_ Select([:auto, box, ellipse, squircle, ngon, star, bezingon, bezistar])) $(@bind configshape  CheckBox(default=false))additional config  **mask size:** $(@bind masksize_ TextField(default="auto")) *e.g. 400,300*"""
4444

4545
# ╔═╡ 1aa632dc-b3e8-4a9d-9b9e-c13cd05cf97e
4646
begin
@@ -364,21 +364,30 @@ else
364364
end
365365
end
366366

367-
# ╔═╡ 27fb4920-d120-43f6-8a03-0b09877c99c4
367+
# ╔═╡ 9a61bb59-5708-4fc0-81f3-3ca555b3bf5d
368368
begin
369369
function gen_cloud(words_weights)
370370
if outlinewidth isa Number && outlinewidth >= 0
371371
olw = outlinewidth
372372
else
373373
olw = rand((0, 0, 0, rand(2:10)))
374374
end
375+
masksize = :auto
376+
try
377+
masksize = Tuple(parse(Int, i ) for i in split(masksize_, ","))
378+
if length(masksize) == 1
379+
masksize = masksize[1]
380+
end
381+
catch
382+
end
375383
try
376384
return wordcloud(
377385
words_weights;
378386
colors=colors,
379387
angles=angles,
380388
fonts=fonts,
381389
mask=mask,
390+
masksize=masksize,
382391
outline=olw,
383392
density=density,
384393
spacing=spacing,
@@ -427,9 +436,9 @@ end
427436
# ╟─74bd4779-c13c-4d16-a90d-597db21eaa39
428437
# ╟─9396cf96-d553-43db-a839-273fc9febd5a
429438
# ╟─1a4d1e62-6a41-4a75-a759-839445dacf4f
430-
# ╟─27fb4920-d120-43f6-8a03-0b09877c99c4
431439
# ╟─986cf1a6-8075-48ae-84d9-55ae11a27da1
432440
# ╟─e7ec8cd7-f60b-4eb0-88fc-76d694976f9d
433441
# ╟─b09620ef-4495-4c83-ad1c-2d8b0ed70710
434442
# ╟─3dc10049-d257-4bcd-9119-2a1af5a0e233
443+
# ╟─9a61bb59-5708-4fc0-81f3-3ca555b3bf5d
435444
# ╟─daf38998-c448-498a-82e2-b48a6a2b9c27

0 commit comments

Comments
 (0)