Lchiffon / wordcloud2

R interface to wordcloud for data visualization.
397 stars 113 forks source link

would wordcloud2 create a 3D image? #21

Closed earthcli closed 7 years ago

earthcli commented 7 years ago

there is a link as follows: http://www.ooopic.com/sheying/51040521.html

would you please give an example?

另外,我发现通过figPath指定自定义图形时有时候达不到预期效果,比如只填充了图片的轮廓(空心),或者图片的不规则形状被平滑(如带有不规则边缘的云朵输出后成为椭圆),不知道在图片选取上有什么技巧或注意事项?

Lchiffon commented 7 years ago

可以考虑保存成一个图片再打到一个球上.... 保存图片用webshot, 打到球上用threejs 这个挺有意思的, 回头我搞搞看

Lchiffon commented 7 years ago
library(threejs)
library(wordcloud2)
library(htmlwidgets)
library(webshot)
hw = wordcloud2(demoFreqC,size = 4)
saveWidget(hw,"1.html",selfcontained = F)
webshot("1.html","1.jpeg",vwidth = 4000, vheight = 2000, delay =20)
earth <- "1.jpeg"
globejs(img=earth, bg="white")

image

恩, 这个可以作为一个代码糖了~

Lchiffon commented 7 years ago

以及, 空心问题是因为中间的颜色大概是白色, 代码还没那么自动会识别轮廓和位置全填充进去, 只会把颜色深的地方填充成词云...

边缘不好的话试试调大size