【问题标题】:How to render googlevis in flexdashboard如何在 flexdashboard 中渲染 googlevis
【发布时间】:2017-02-11 08:32:32
【问题描述】:

我正在尝试将 GoogleVis 与新软件包 FlexDashboard 一起使用,这就像基本 .Rd 和 shinyDashboards 之间的交集。它基本上是一个不发光的仪表板。

无论如何,我正在尝试嵌入一个 googleVis 对象,doesn't seem to be supported by default,但我可以让 html 显示在输出中,所以一定有办法!我们能想出一些技巧吗?也许结合plot()renderGvis() 结合some kind of hack?对设置 op <- options(gvis.plot.tag='chart') 感到厌烦?

我失败了,但也许其他人可以解决?

【问题讨论】:

    标签: r googlevis flexdashboard


    【解决方案1】:

    基于来自 Conditional reactive logic shiny based flexdashboard 的 Michal Majka 的精彩回答,您可以做这样的事情

    ---
    title: "Test gvisTable"
    output: 
      flexdashboard::flex_dashboard:
        orientation: rows
    
    runtime: shiny
    ---
    
    ```{r setup, include=FALSE}
    library(flexdashboard)
    library(googleVis)
    
    ```
    
    Column {data-height=350}
    -----------------------------------------------------------------------
    
    ### Chart c
    
    ```{r}
    #create a ui interaction:
    uiOutput("dynamic")
    
    #render the ui:
    output$dynamic <- renderUI({ 
       htmlOutput("myTable")
    })
    
    #here is your server activity:
    output$myTable <- renderGvis({    
        gvisTable(Population )       
      })
    ```
    

    【讨论】:

    • 我给你一个 +1 的努力,但如果我想要闪亮,那么我就去和闪亮仪表板。不错的技巧..
    • 很公平,我想,但我要指出的是,您特别要求“某种 hack”(也就是说,如果定义运行时甚至是 hack),其次,shinydashboard 不是标记格式,因此将两个有用的包组合成一个解决方案与仅使用一个解决方案不同。
    猜你喜欢
    • 2016-12-14
    • 2019-03-07
    • 1970-01-01
    • 2018-01-25
    • 2017-08-12
    • 2020-11-15
    • 2019-04-12
    • 1970-01-01
    • 2021-11-20
    相关资源
    最近更新 更多