talgalili / d3heatmap

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

Under rmarkdown d3heatmap only renders when returned to the top level #69

Open warnes opened 8 years ago

warnes commented 8 years ago

output: html_document

In rmarkdown a d3heatmap only renders when is explicitly returned to the top level.

For example, in this simple Rmarkdown document, the first and third heatmaps are rendered in the html document, while the second is not.

library(d3heatmap)
x <- matrix(rnorm(100), ncol=10)

This is displayed

d3heatmap(x)

This is not displayed

f1 <- function(x)
{
  d3  <- d3heatmap(x)
  print(d3)
}
f1(x)

This is displayed

f2 <- function(x)
{
  d3  <- d3heatmap(x)
  d3
}
f2(x)