Skip to content
R interface to wordcloud for data visualization.
Branch: master
Clone or download
Lchiffon Merge pull request #46 from JacobXPX/master
Fix tthe Issue #45, please update it.
Latest commit 8a12a3b Jun 20, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R add clickedWordInputId to details Jun 20, 2018
data add vignette Jun 9, 2016
examples/img fix issue #45 Jun 19, 2018
inst fix issue #45 Jun 19, 2018
man Merge branch 'master' into master Jun 20, 2018
vignettes for cran Jul 25, 2016
.Rbuildignore add examples/img/new.gif into .Rbuildignore Jun 20, 2018
.gitignore Namespaced tooltips (#18 with help from #29) and removed extraneous c… Dec 7, 2017
DESCRIPTION
NAMESPACE
readme.md Merge branch 'master' into master Jun 20, 2018
wordcloud2.Rproj

readme.md

wordcloud2

CRAN Downloads Build status

R interface to wordcloud for data visualization. Timdream's wordcloud2.js is used in this package.

contributors

Original description

Installation

devtools::install_github("lchiffon/wordcloud2")

knitr and shiny is support in wordcloud2 package.

Example

library(wordcloud2)
wordcloud2(demoFreq, size = 1,shape = 'star')

1

wordcloud2(demoFreq, size = 2, minRotation = -pi/2, maxRotation = -pi/2)

1

wordcloud2(demoFreq, size = 2, minRotation = -pi/6, maxRotation = -pi/6,
  rotateRatio = 1)

1

Chinese version

## Sys.setlocale("LC_CTYPE","eng")
wordcloud2(demoFreqC, size = 2, fontFamily = "微软雅黑",
           color = "random-light", backgroundColor = "grey")

1

Example of successfully deploying interactivate clickable wordcloud with special shape on R-shiny

Thanks JacobXPX's contribution to this feature:

Thanks AdamSpannbauer for pointing out the issues.

Additional features are added or modified:

  1. hover information display are fixed, refering AdeelK93's previous work, thanks!

  2. multiple wordclouds which seperatedly click are supported.

  3. clickedWordInputId is changed to be automatically generated by: paste0(outputId, "_clicked_word")).

See sample below for more details:

library(shiny)
library(wordcloud2)
shinyApp(
  ui=shinyUI(fluidPage(
    #using default clicked word input id
    wordcloud2Output("my_wc", width = "50%", height = "400px"),
    #using custom clicked word input id
    wordcloud2Output("my_wc2", width = "50%", height = "400px"),
    
    verbatimTextOutput("print"),
    verbatimTextOutput("print2")
  )),
  server=shinyServer(function(input,output,session){
    
    figPath = system.file("examples/a.png",package = "wordcloud2")
    
    output$my_wc  = renderWordcloud2(wordcloud2(data = demoFreq, figPath = figPath, size = 0.4,color = "blue"))
    output$my_wc2 = renderWordcloud2(wordcloud2(demoFreq))
    
    #using default clicked word input id
    output$print  = renderPrint(input$my_wc_clicked_word)
    #using custom clicked word input id
    output$print2 = renderPrint(input$my_wc2_clicked_word)
  })
)

run the above code and click refresh, it will work.

1

You can’t perform that action at this time.