Skip to content

Commit c1a5ec2

Browse files
authored
Add connectwidgets-example to Gallery (#75)
* Add connectwidgets-example to extensions * Add `minimumConnectVersion` to manifest * Add connectwidgets-example to workflow * PR feedback changes
1 parent 8f5188d commit c1a5ec2

File tree

5 files changed

+1534
-0
lines changed

5 files changed

+1534
-0
lines changed

.github/workflows/extensions.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
stock-api-flask: extensions/stock-api-flask/**
3838
landing-page: extensions/landing-page/**
3939
stock-api-fastapi: extensions/stock-api-fastapi/**
40+
connectwidgets-example: extensions/connectwidgets-example/**
4041
4142
# Runs for each extension that has changed from `simple-extension-changes`
4243
# Lints and packages in preparation for tests and and release.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Connectwidgets Example
2+
3+
## About this example
4+
5+
`connectwidgets` is an R package that can be used to query {systemDisplayName} for a subset of your existing content items, then organize them within htmlwidget components in an R Markdown document or Shiny application. Use `connectwidgets` to create a content hub or knowledge repository, a customized summary page for a particular group of stakeholders, or a presentation layer for any group of related content.
6+
7+
8+
## Learn more
9+
10+
* [Documentation for connectwidgets](https://rstudio.github.io/connectwidgets/)
11+
* [R Markdown Documentation](https://rmarkdown.rstudio.com/)
12+
13+
## Requirements
14+
15+
* R version 4.0 or higher
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: "Untitled"
3+
output: html_document
4+
---
5+
6+
```{r setup, include=FALSE}
7+
library(connectwidgets)
8+
library(dplyr)
9+
10+
knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
11+
12+
client <- connect(
13+
# server = Sys.getenv("CONNECT_SERVER"),
14+
# api_key = Sys.getenv("CONNECT_API_KEY")
15+
)
16+
17+
all_content <- client %>%
18+
content()
19+
20+
sample_content <- all_content %>%
21+
arrange(desc(updated_time)) %>%
22+
slice_head(n = 50)
23+
```
24+
25+
![](https://source.unsplash.com/1920x1080/?forest "A random forest.")
26+
27+
## Components
28+
29+
### card
30+
31+
```{r card}
32+
sample_content %>%
33+
slice(1) %>%
34+
rsc_card()
35+
```
36+
37+
### grid
38+
39+
```{r grid}
40+
sample_content %>%
41+
rsc_grid()
42+
```
43+
44+
### table
45+
46+
```{r table}
47+
sample_content %>%
48+
rsc_table()
49+
```
50+
51+
### search & filter
52+
53+
```{r search-and-filter}
54+
rsc_cols(
55+
rsc_search(sample_content),
56+
rsc_filter(sample_content),
57+
widths = c(2, 2),
58+
device = "md")
59+
60+
rsc_table(sample_content)
61+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Version: 1.0
2+
3+
RestoreWorkspace: Default
4+
SaveWorkspace: Default
5+
AlwaysSaveHistory: Default
6+
7+
EnableCodeIndexing: Yes
8+
UseSpacesForTab: Yes
9+
NumSpacesForTab: 2
10+
Encoding: UTF-8
11+
12+
RnwWeave: Sweave
13+
LaTeX: pdfLaTeX
14+
15+
AutoAppendNewline: Yes
16+
StripTrailingWhitespace: Yes

0 commit comments

Comments
 (0)