Skip to content
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

Issues with Hover and Click #45

Closed
AdamSpannbauer opened this issue Jun 19, 2018 · 7 comments
Closed

Issues with Hover and Click #45

AdamSpannbauer opened this issue Jun 19, 2018 · 7 comments

Comments

@AdamSpannbauer
Copy link
Contributor

The most recent merged PR from @JacobXPX seems to have issues with hover info and issues with click events when rendering multiple wordcloud2s. I have not yet had time to look into what causes the issue, but I know the issues weren't present in my initial PR (based on the example apps shown below).

Please let me know if these issues are not reproducible or if they are due to user error. If these are consistent issues then I think they should be resolved before the next push to CRAN.

All example output below are from running the github version of wordcloud2 in Chrome.

Issues with multiple wordcloud2s:

  • No hover info displayed
  • Clicking a word in either wordcloud2 updates both input clicked words
devtools::install_github('Lchiffon/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$selected_word)
    #using custom clicked word input id
    output$print2 = renderPrint(input$wc2_clicked_word)
  })
)

Issues with single wordcloud2

  • Hover info is displayed incorrectly at bottom left corner of the wordcloud2 html widget
devtools::install_github('Lchiffon/wordcloud2')

library(shiny)
library(wordcloud2)
shinyApp(
  ui=shinyUI(fluidPage(
    #using default clicked word input id
    wordcloud2Output("my_wc"),
    
    verbatimTextOutput("print")
  )),
  server=shinyServer(function(input,output,session){
    output$my_wc  = renderWordcloud2(wordcloud2(demoFreq))

    #using default clicked word input id
    output$print  = renderPrint(input$selected_word)
  })
)

@AdamSpannbauer
Copy link
Contributor Author

At a glance it looks like the changes @JacobXPX made to the hover.js file essentially undoes all the changes @AdeelK93 made to ensure unique wordcloud2 ids in PR #32 (which fixed issue #18)

@jacobyxu
Copy link
Contributor

jacobyxu commented Jun 19, 2018 via email

@AdamSpannbauer
Copy link
Contributor Author

Testing in Firefox gives me about the same issues as described above.

Of note, I reverted back to an earlier commit (before the revisions to hover.js), and there are issues with click/hover in firefox, despite working well in chrome.

@jacobyxu
Copy link
Contributor

jacobyxu commented Jun 19, 2018 via email

jacobyxu added a commit to jacobyxu/wordcloud2 that referenced this issue Jun 19, 2018
jacobyxu added a commit to jacobyxu/wordcloud2 that referenced this issue Jun 19, 2018
@jacobyxu
Copy link
Contributor

jacobyxu commented Jun 19, 2018

Hi Adam,

I have done finally, it works in Firefox perfectly. I will test it more later. link, please have a look.

Updates:

feature firefox chrome
hover info work work
multiple plot work work
separate click work work
special shape work not

@AdamSpannbauer
Copy link
Contributor Author

Seems to be working great on my end! Good stuff @JacobXPX

Lchiffon added a commit that referenced this issue Jun 20, 2018
Fix tthe Issue #45, please update it.
@AdamSpannbauer
Copy link
Contributor Author

I think the work @JacobXPX fixes the reasons I had for opening this issue. I'm going to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants