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

查看:16
本文介绍了如何使用 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 设计器中安排它们.这是一个简单的示例,与闪亮的相比,您在交互性方面会受到一些限制——您可以使用 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天全站免登陆