微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

R Sparkline Chart 在 Reactable 中的嵌套/扩展行中显示为空

如何解决R Sparkline Chart 在 Reactable 中的嵌套/扩展行中显示为空

我希望有人能帮我解决这个问题。我是 HTML 新手,这让我很困惑。

代码在这里

library(tidyverse)
library(reactable)
library(sparkline)

myfunct <-
  function(Species) {
    lapply(1:100,function(x) { runif(1) }) %>% invoke(c,.)
  }

df <-
  data.frame(Species = rep('setosa',5)) %>%
  mutate(data = map(Species,myfunct))

new.iris <- 
  iris %>%
  inner_join(df,by = 'Species') %>%
  mutate(rid = row_number())

# underlying sparkline reactable works fine
reactable(new.iris[1:5,5:7],columns = list(
  data = colDef(cell = function(values) { sparkline(values) }))
)

# nested it will not display
reactable(new.iris[1:5,c(7,1:5)],details = function(index) {
  reactable(new.iris[index,columns = list(
              data = colDef(cell = function(values) { sparkline(values)})
            ))
})

初始图表将显示

enter image description here

然而,当包含在详细信息/嵌套/扩展器行中时,图表是空的:

enter image description here

感谢您的帮助。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。