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

scatterD3 killing d3wordcloud #43

Closed
lrmelt opened this issue Nov 2, 2016 · 11 comments
Closed

scatterD3 killing d3wordcloud #43

lrmelt opened this issue Nov 2, 2016 · 11 comments

Comments

@lrmelt
Copy link

lrmelt commented Nov 2, 2016

I have added scatterD3 to my shiny app successfully, however it now kills any and all d3wordclouds that I have on the application. It even kills the d3wordclouds that are on other tabs and not concurrently active with the scatterD3.

By "kills" I mean that the d3wordcloud id is still there, just no SVG elements. All other d3 visualizations still work on the application.

Is this because the d3.min.js versions are different in both packages? Is there a way to declare which one to use?

@timelyportfolio
Copy link
Contributor

My guess is related to fbreitwieser/sankeyD3#4. This transition from d3v3 to d3v4 is going to be painful.

@juba
Copy link
Owner

juba commented Nov 2, 2016

Thanks @timelyportfolio. Yes, this seems likely to be a d3v3-d3v4 conflict...

I don't really have any solution for this. The latest "stable" d3v3 scatterD3 version is 0.6.2, but it's a bit old and will miss some features :

https://github.com/juba/scatterD3/releases/tag/0.6.2

And the latest commit with d3v3 should be this one :

https://github.com/juba/scatterD3/tree/c789b0bc350f5af208f4817a66cd54f8f871ce77

@lrmelt
Copy link
Author

lrmelt commented Nov 2, 2016

I reverted back to that version and all works in Shiny but the tooltips...was there any known issue that you can remember?

The tooltips render appropriately in RStudio viewer...just not on the Shiny application as nothing appears on hover.

Thank you for the quick responses!

@juba
Copy link
Owner

juba commented Nov 2, 2016

Did you revert to 0.6.2 version, or the latest d3v3 commit ?

@lrmelt
Copy link
Author

lrmelt commented Nov 2, 2016

0.6.2

@juba
Copy link
Owner

juba commented Nov 2, 2016

Honestly, I don't remember... Is your shiny app or its source code accessible online ?

@lrmelt
Copy link
Author

lrmelt commented Nov 2, 2016

I just tried it with the latest d3v3 commit as well to no avail.

No, the app/code is not available. The best I can do is provide the snippets:

server.R
output$bubblePlot <- renderScatterD3({ tooltips <- paste("<strong>",Cluster$Category,"</strong><br/>X: ",Cluster$x,"<br/>Y: ",Cluster$y,"<br/>Frequency: ",Cluster$Frequency) scatterD3(x = Cluster$x, y = Cluster$y, lab = Cluster$Category,size_var = Cluster$Frequency,col_var=Cluster$Category,colors=ESI,legend_width = 0,size_range = c(200,2000),xlab = "X", ylab = "Y",tooltip_text = tooltips) })
ui.R
column(5,br(), h4(style="text-align:center;","Category Cluster"), scatterD3Output("bubblePlot",height = '500px'))

@juba
Copy link
Owner

juba commented Nov 2, 2016

Any error in your javascript console in your browser ?

@lrmelt
Copy link
Author

lrmelt commented Nov 2, 2016

UPDATE...I just saw that the tooltip is rendering outside of the plot at the bottom corner of the page...let me mess around with my CSS to see if I am overwriting a tooltip position.

Stand-by.

@lrmelt
Copy link
Author

lrmelt commented Nov 2, 2016

It looks like the .scatterD3-tooltip is being adding to the DOM outside of the scatterD3 plot...so it is just snapping to the top position relative to itself which is way below the scatterD3 plot.

I added position:absolute to my styling and we are good to go.

Thank you for all the help!

@lrmelt lrmelt closed this as completed Nov 2, 2016
@juba
Copy link
Owner

juba commented Nov 2, 2016

You're welcome ! I'm glad that you managed to fix 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

3 participants