Lchiffon / wordcloud2

R interface to wordcloud for data visualization.
396 stars 107 forks source link

mask and letterCloud silently fail #12

Open csteacherd22 opened 7 years ago

csteacherd22 commented 7 years ago

Hello, I'm enjoying wordcloud2 and hoping to make use of the unique features. However, the png mask and letterCloud functions have been silently failing. Also, using the provided example of setting figPath to a png fails as per https://rstudio-pubs-static.s3.amazonaws.com/187645_426d719fae56457f84d767fd6f076a43.html:

figPath = system.file("examples/t.png",package = "wordcloud2")
wordcloud2(demoFreq, figPath = figPath, size = 1.5,color = "skyblue")

Similarly, the "https://www.r-bloggers.com/the-wordcloud2-library/" Peace symbol example command: wordcloud2(demoFreq, figPath = "peace.png", size = 1.5, color = "skyblue", backgroundColor="black") also silently fails.

Lchiffon commented 7 years ago

This is a small bug I haven't fix so far.

Have you tried to refresh the viewer or open in the browser?

image

luke-a commented 7 years ago

Same problem here. Refreshing helps - thanks!

PS80 commented 7 years ago

Sorry Lchiffon, I experience the same issue in Google Chrome (even after reloading the page)... but the code works in IE

zpurcey commented 7 years ago

I'm using the library to produce png's as a backend service and getting no output for letterCloud and mask generations.

Thanks for the great feature set, would help out if I was more of an R expert, will watch this bug for now.

VeloSteve commented 6 years ago

Mostly a "me too" in February 2018: using the latest R 3.4.3 and RStudio 1.1.419 I get the background image for either letterCloud() or the figPath option of wordcloud2. There are never any words, whether I reload or not. Sending it to Chrome gives just a blank white screen, not even the background.

Kumpelka commented 6 years ago

I face the same problems after installing the latest version of R 3.4.3 and RStudio 1.1.423 (I have updated all packages also). I get only the background of the letter (letterCloud function) or of the mask (wordcloud2 function with figPath option).

It worked on my old version of R, RStudio and packages but unfortunately it did not save the configuration reference. Maybe someone know if there is a configuration who works ?

SarahDawsonStats commented 6 years ago

I'm having the same problem, letterCloud is producing only the background "word" in black, with none of the actual words from the data frame showing. I've tried several different versions of R to no avail.

letterCloud(demoFreq,"R")

image

However, if I re-install the package directly from git rather than cran, it works!

library(devtools) devtools::install_github("lchiffon/wordcloud2") letterCloud(demoFreq,"R")

image

bemeyer commented 6 years ago

Same issue here. "wordcloud2" produces a nice image in RStudio that is viewable in markdown and in an html doc after it is knit, but not viewable in a browser (Chrome or Firefox). All packages updated, RStudio 1.1.442, R version 3.4.4 (2018-03-15)

Here's the doc with an invisible image: http://rpubs.com/bmeyer/372805, Session info included within.

AsterAlpestris commented 6 years ago

I could manage to make it work in Rstudio after installing the package via github as suggested by SarahDawsonStats, but it needs everytime a refresh. Unfortunately it seems not working in a Shiny application.

MayoIsLife commented 6 years ago

Hi all, I ran into the same issue but unfortunately I did not manage to resolve it with SarahDawsonStats' suggestion of downloading the source package. When I reinstall it, I instead get the following error running any type of wordcloud2 output:

Error in yaml.load(readLines(con), error.label = error.label, ...) : argument "error.label" is missing, with no default

Things I have tried so far:

Any help would be greatly appreciated, I'm not sure where I'm going wrong!

nateofspades commented 6 years ago

I had the same problem with nothing displaying from wordcloud2 when I added the figPath argument. Once I changed my default browser from Chrome to IE (and allowed "blocked content") it worked:

wordcloud2(demoFreq, figPath="logo.jpg")

HannahChi1628 commented 6 years ago

Sorry, I meet the same problem with MayoIsLife. I did not manage to resolve it by downloading the source package from github.

When installed the package from CRAN, it will show only background. If installed the package from github, it will silently failed.

Could anyone help me to solve the issue? I really enjoying using this package.

Nelson-Gon commented 6 years ago

LetterCloud only returns the word and not the dataset.

jiristo commented 5 years ago

Do not use system.file()

I did this and it works:

figPath <- "/Users/jiristodulka/R/web_scraping/reddit_cannabis/canna_leaf.png"

wordcloud2(demoFreq, figPath = figPath, size = 3,color = "green", backgroundColor = "black")

stragu commented 5 years ago

Hi all

Just an update on this: same issue here with CRAN (0.2.1) and GitHub (0.2.2) packages: using a PNG mask, or using letterCloud(), I don't get anything, just the background colour, even after refreshing or opening the external viewer (in Firefox).

The code I used (with a couple of different PNG files):

wordcloud2(demoFreq,
           figPath = "t.png",
           color = "skyblue",
           backgroundColor = "pink")
letterCloud(demoFreq,
            word = "R",
            color = "skyblue",
            backgroundColor = "pink")

However, the shape argument does work fine:

wordcloud2(demoFreq,
           shape = "star",
           size = 1.5,
           color = "skyblue",
           backgroundColor = "pink")

My system details:

Ravimoon25 commented 5 years ago

Hi Everyone,

I faced the similar issues too. However, I've reinstalled wordcloud2 from dev tools and it worked.

devtools::install_github("lchiffon/wordcloud2")

Tranquilsun commented 5 years ago

Hello, I am a new learner in R programming. I am faced with a problem that I can not install the package wordcloud2 via command " devtools::install_github("lchiffon/wordcloud2") " , befor which, I have successfully installed install.packages('devtools'). The error is shown as the attached screenshot.

Thanks for your reply. error_install_wordcloud2

stragu commented 5 years ago

@Tranquilsun your question is not related to this particular issue, so you will have to open a new issue. However, I suspect your problem is not related to the wordcloud2 package. I'd recommend to first try and reinstall it after restarting your R session, and if that fails, look online for an existing solution somewhere as other people have asked similar questions before (for example here). But we should stop discussing your particular issue here as it is not related to this ticket. Good luck!

cyarrison1 commented 5 years ago

Any resolution here? I installed the package directly from github, which worked once and then I couldn't get it to work again, trying various combinations of refreshing and browser changes. Thank you!

data2030 commented 5 years ago

@cyarrison1 try to change the size. I had this problem yesterday and solved it by increasing the size from size= 1.5 to size= 5.

j-tamad commented 4 years ago

How do you get that font? I've tried a few others, but always get the default ''Segoe UI'

Galfo92 commented 4 years ago

Not a solution but maybe can help someone: I made some test and here some tips:

1) use widgetsize = c(x, y), where:

2) always click (1x) refresh the viewer or open in the browser (+ 1x refresh)

3) (Bad but better as nothing) if still notworking (as desired) rescale your freq variable to smaller value (ex. with scales::rescales(x, to = c(1,7)) and run another time

-> Open in browser and save with ctrl + p

olferievm commented 4 years ago

Not a solution but maybe can help someone: I made some test and here some tips:

  1. use widgetsize = c(x, y), where:
  • x is a multiple of the horizontal resolution (in pixels) of the image used as a mask
  • y is a multiple of the vertical resolution (in pixels) of the image used as a mask
  1. always click (1x) refresh the viewer or open in the browser (+ 1x refresh)
  2. (Bad but better as nothing) if still notworking (as desired) rescale your freq variable to smaller value (ex. with scales::rescales(x, to = c(1,7)) and run another time

-> Open in browser and save with ctrl + p

Unfortunately it is not.

jeffcsauer commented 3 years ago

For those facing this issue, it seems you must provide both a color argument as well as a backgroundColor argument. You may also need to refresh the RStudio image preview window to get the graphic to load.

rafabelokurows commented 3 years ago

I was struggling with this issue for a few hours but managed to make it work by installing the Github version of the package AND by refreshing the RStudio Viewer Pane EVERY TIME I generate a word cloud with a mask. For now, it's enough. Thanks for the instructions!

Cruisecoder commented 2 years ago

I had the same problem with nothing displaying from wordcloud2 when I added the figPath argument. Once I changed my default browser from Chrome to IE (and allowed "blocked content") it worked:

wordcloud2(demoFreq, figPath="logo.jpg")

It did not work for me, I have stuck with this problem for 3 hours, maybe I should skip this ... This package does have bugs..

birasafab commented 2 years ago

after trying all the suggestions provided above I still have issues of figure masking in wordcloud2 till now. any support to overcome this will be highly appreciated!

frarzo commented 2 years ago

I'm also experiencing the same problem, getting a blank output when creating a wordcloud using a mask. Tried different things:

But in the end I always get a blank output or the very png I used as mask after computing a couple times.

stepminer commented 2 years ago

I have the same issue even after re-installing from the Github development version.

Is there anybody Home?

akhtarali007 commented 1 year ago
  1. widgetsize = c(x, y) it did not work
RickyEsclapon commented 1 year ago

Same here 🥲

SaraSchiesberg commented 1 year ago

none of the suggested solutions works for me ...

azanghai commented 3 months ago

I waited a few minutes, then kept hitting the refresh button in the viewer like crazy, and it finally worked!