如何使用Iframe标签在SharePoint上嵌入闪亮的应用程序 [英] How to embed shiny app on SharePoint with Iframe tag

查看:81
本文介绍了如何使用Iframe标签在SharePoint上嵌入闪亮的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的应用程序,可以显示一些数据. 您如何使用iframe将其嵌入到SharePoint网站中? 还是有更简单的方法做到这一点?

I have a very simple app showing some data. How do you embed this in a SharePoint site using using iframe ? or is there an easier way to do this ?

library(ggplot2)
library(shiny)
library(DT)
library(readr)

PRTypeCount <- read_csv("H:/SP/PRTypeCount.txt")



ui <- navbarPage(
title = 'PRTypeCount',
tabPanel('PRTypeCount', DT::dataTableOutput('PRTypeCount')))

server<-function(input, output) {

output$PRTypeCount <- DT::renderDataTable(
DT::datatable(PRTypeCount, options = list(pageLength = 25))
)

}

shinyApp(ui = ui, server = server)

推荐答案

如果您没有出色的服务器,那么最好的选择可能是flexdashboard软件包或制作单个组件并在SharePoint Designer中进行排列.这是一个简单的示例,与闪亮相比,您的交互性会受到一定的限制-使用plotly,ggiraph和某些其他软件包可以做一些事情.对于许多用例,这可能就足够了:

If you do not have a shiny server your best bet is probably the flexdashboard package or making individual components and arranging them in SharePoint designer. Here is a quick example, you will be somewhat limited with interactivity as compared to shiny -- there are some things you can do with plotly, ggiraph, and some other packages. For many use cases this can be perfectly adequate:

---
title: "Untitled"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---

```{r setup, include=FALSE}
library(flexdashboard)
```

Column {data-width=650}
-----------------------------------------------------------------------

### Chart A

```{r}
DT::datatable(iris)
```

Column {data-width=350}
-----------------------------------------------------------------------

### Chart B

```{r}

hist(iris$Sepal.Length)

```

### Chart C

```{r}
plot(iris$Sepal.Length, iris$Sepal.Width)

```

一旦您将此rmd文件编织为html.您可以制作HTML文件的副本,并将扩展名更改为.aspx.

Once you knit this rmd file to html. You make can make a copy of the HTML file and change the extension to .aspx.

然后,您可以将该.aspx文件放入文档库中.

Then you can put this .aspx file in in a document library.

然后在要显示内容的位置添加一个页面查看器Web部件,将其链接到文档库中的.aspx文件.

Then add a page viewer web part where you want the content displayed, linking it to the .aspx file in the document library.

这篇关于如何使用Iframe标签在SharePoint上嵌入闪亮的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆