Lchiffon / wordcloud2

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

Can't render in flexdashaboard #6

Open voxnonecho opened 8 years ago

voxnonecho commented 8 years ago

I believe this is the same issue as experienced here and related to this

badbye commented 8 years ago

No problem on my laptop. Try to refresh the page?

version.string R version 3.3.1 (2016-06-21)
flexdashaboard 0.3
wordcloud2 0.2.0

If you want to make multiple word cloud plot, that would be an issue.

voxnonecho commented 8 years ago

Yes this will work if you refresh the page but that's because the refresh overwrites the resize() have a look at the issues referenced.

badbye commented 8 years ago

In my experience the plot render at the first sight, I do not need to refresh. It will be better if you offer your test code.

timelyportfolio commented 8 years ago

I'll submit a pull shortly.

Lchiffon commented 8 years ago

Rstudio viewer have the same problem. I known this issue for a long time. I think it's a bug, need to fix it.

@timelyportfolio your pull cannot fix the problem in viewer as far as I can see.

timelyportfolio commented 8 years ago

There was one other problem caused by setting the canvas id to canvas. HTML/CSS requires unique selector id. I made the change to append the htmlwidget id to -canvas. Here is a working example. The only issue now is with the tooltip.

    ---
    title: "Untitled"
    output: 
      flexdashboard::flex_dashboard
    ---

    Page1
    ===================

    ```{r}
    library(wordcloud2)
    wordcloud2(demoFreq)
Page 2
==========

Column {data-width=350}
-----------------------------------------------------------

### Pentagon

```{r}
wordcloud2(demoFreq, size = 1,shape = 'pentagon')
```

Column {data-width=350}
----------------------------------------------------------

### Star

```{r}
wordcloud2(demoFreq, size = 1,shape = 'star')
```


![wordcloud2_flex](https://cloud.githubusercontent.com/assets/837910/18164683/c7ea9efa-7006-11e6-97e8-49eb8d219a5e.gif)
mfumagalli68 commented 5 years ago

@timelyportfolio trying to run your example, encountered same problem described above