talgalili / d3heatmap

A D3.js-based heatmap htmlwidget for R
Other
236 stars 95 forks source link

d3heatmap won't render if another htmlwidgets plot is on same page #44

Closed MarkEdmondson1234 closed 8 years ago

MarkEdmondson1234 commented 8 years ago

The d3heatmap works fine when viewing in RStudio, but when put into the same .Rmd document with another htmlwidget plot, it won't render.

A demo is available here: https://beta.rstudioconnect.com/mark/d3heatmapNoRender/

The pertinent R plots are:

# Dygraph
'''{r sessions}
dygraphs::dygraph(ts_data)
'''

# Heatmap
'''{r seo}
d3heatmap::d3heatmap(t(search_matrix), scale = "row", dendrogram = "none")
'''

# Plotly

'''{r revenue}
gadata[gadata$date > as.Date(Sys.Date() - 30),] %>%
  plot_ly(x = date, y = transactionRevenue, group = medium, type = "bar") %>%
  layout(barmode="stack")

'''

When I comment out both of the other plots, the heatmap renders fine.

pmarais commented 8 years ago

I am having the same issue with a shiny application, where the d3heatmap() will not render if a plotly() chart is rendered in the same app.

The solution for rendering in an interactive renderUI() function, which seems to solve the problem for rCharts, does not solve this issue. Any advice will be appreciated.

jcheng5 commented 8 years ago

Thanks for the reports. I'm pretty sure I know what the issue is, but let's track it over in https://github.com/ropensci/plotly/issues/325

RChaudMuel commented 8 years ago

Has this issue been resolved? if so, if someone can point me to the solution, I'd much appreciate it. I am having the same issue with a shiny app, where the d3heatmap() will not render if edgebundle() is rendered in the same .Rmd file. However, if I switch the order and render d3heatmap() after edgebundle() it works fine. What is the workaround this? Thanks.

timelyportfolio commented 8 years ago

I just looked and edgebundle does not define its dependencies properly. I'll submit a pull, but I'm not sure how long it will take to get accepted.

timelyportfolio commented 8 years ago

@RChaudMuel I just submitted a pull to resolve this. If you are in a rush and cannot wait for the pull to be accepted, you can use devtools to install the source branch for the pull by

devtools::install_github("timelyportfolio/edgebundleR@fix/d3-dependency")