juba / robservable

Observable notebooks as R htmlwidgets
https://juba.github.io/robservable/
163 stars 11 forks source link

wrap in htmlwidgets::JS() #14

Closed timelyportfolio closed 4 years ago

timelyportfolio commented 4 years ago

I wanted to note this discovery. In some cases it appears we need to wrap the input as htmlwidgets::JS().

library(robservable)
library(treemap)
library(d3r)
library(dplyr)

robservable(
  "@d3/zoomable-treemap",
  cell = "chart",
  input = list(
    data = data.frame(Titanic) %>%
      select(Class,Age,Survived,Sex,Freq) %>%
      rename(value = Freq) %>%
      d3_nest(value_cols="value", root="titanic") %>%
      htmlwidgets::JS()
  )
)
juba commented 4 years ago

I'm trying the example with and without htmlwidgets::JS() but can't spot any difference...

Am I missing something ?

timelyportfolio commented 4 years ago

I couldn't make any sense of it yesterday. Also working fine for me now as well so hopefully we can just close and move on. Thanks for checking.