-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add click event to wordcloud2Output()
shiny function
#35
Conversation
Here is a minimal app demoing the click event functionality. devtools::install_github("AdamSpannbauer/wordcloud2")
library(shiny)
library(wordcloud2)
shinyApp(
ui=shinyUI(fluidPage(
#using default clicked word input id
wordcloud2Output("my_wc"),
#using custom clicked word input id
wordcloud2Output("my_wc2", clickedWordInputId = "wc2_clicked_word"),
verbatimTextOutput("print"),
verbatimTextOutput("print2")
)),
server=shinyServer(function(input,output,session){
output$my_wc = renderWordcloud2(wordcloud2(demoFreq))
output$my_wc2 = renderWordcloud2(wordcloud2(demoFreq))
#using default clicked word input id
output$print = renderPrint(input$my_wc_clicked)
#using custom clicked word input id
output$print2 = renderPrint(input$wc2_clicked_word)
})
) |
@Lchiffon I've implemented click events with the additions to the wordcloud2 package proposed by @AdamSpannbauer . It'd be great to have the PR approved. |
Hey guys. I'm not sure if this is a right place to ask question but if so, would it be possible, under the current setting, to implement clicking a word which would open the new window at a designated link attached to the word? Basically I'd like it to be one click and go, not having to click separate hyperlink shown in Shiny again. |
@tedhwang as you mentioned, this isn't really the right place to ask questions like this. Pull Request threads are intended to be focused discussions concerning the PR itself. StackOverflow is more geared towards questions like this. This SO Q/A covers the topic you're asking about. This gist uses the same JS function to directly cover your wordcloud2 use case. In the future keep SO in mind for these types of questions (even though you did get an answer this time). |
Thanks so much for the kind answer. I'm not used to the culture of Github
yet, and I totally understand your advice. Will use SO next time.
(If you want my post to be deleted, I'd be glad to help)
Best Regards,
Ted
…On Wed, Jun 13, 2018 at 7:26 AM Adam Spannbauer ***@***.***> wrote:
@tedhwang <https://github.com/tedhwang> as you mentioned, this isn't
really the right place to ask questions like this. Pull Request threads are
intended to be focused discussions concerning the PR itself.
StackOverflow is more geared towards questions like this. This SO Q/A
<https://stackoverflow.com/questions/41426016/shiny-open-multiple-browser-tabs/50837163#50837163>
covers the topic you're asking about. This gist
<https://gist.github.com/AdamSpannbauer/d93af343214c09c0ee7ce035dcdee5e1>
uses the same JS function to directly cover your wordcloud2 use case. In
the future keep SO in mind for these types of questions (even though you
did get an answer this time).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AiTQoedrXRujLzYBVppiu1fXZRnSseTpks5t8QTYgaJpZM4RjvYQ>
.
|
merged, thanks @AdamSpannbauer |
Added
getClickedWord()
function and the resulting functionality to renderWordcloud2.R.input$outputId_clicked
by default.clickedWordInputId
argument added towordcloud2Output()
shiny
to be listed as an Import in DESCRIPTION