Skip to content

Commit

Permalink
Update st-shiny-fluent-and-rhino.Rmd
Browse files Browse the repository at this point in the history
  • Loading branch information
PawanRamaMali committed Jun 28, 2023
1 parent 96d2e9f commit 185f13f
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions vignettes/st-shiny-fluent-and-rhino.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ This `app/view/datatable.R` file will be used to display the data table on the U
box::use(
shiny[div, moduleServer, NS, renderUI, uiOutput],
shiny.fluent[DetailsList, Text],
shiny.fluent[DetailsList, Text, fluentSalesDeals],
)
#' @export
Expand All @@ -136,15 +136,14 @@ ui <- function(id) {
server <- function(id) {
moduleServer(id, function(input, output, session) {
output$datatable <- renderUI({
# Datasets are the only case when you need to use :: in `box`.
# This issue should be solved in the next `box` release.
DetailsList(items = shiny.fluent::fluentSalesDeals)
# Note : If you are using `box>=1.1.3`, import datasets directly without using `shiny.fluent::fluentSalesDeals`
DetailsList(items = fluentSalesDeals)
})
})
}
```

`fluentSalesDeals` is a dataset available with the `shiny.fluent` package and to use it, we use `::` for directly fetching the dataset from the library. Datasets are the only case when you need to use `::` in `box`.
`fluentSalesDeals` is a dataset available with the `shiny.fluent` package.

So, here we are using [`DetailsList`](https://appsilon.github.io/shiny.fluent/reference/DetailsList.html) function in the server side to render the table on the UI.

Expand Down Expand Up @@ -213,7 +212,7 @@ Also, we need to mention in the `DetailsList()` function to only display the nam
box::use(
shiny[div, moduleServer, NS, renderUI, uiOutput],
shiny.fluent[DetailsList, Text],
shiny.fluent[DetailsList, Text, fluentSalesDeals],
tibble[tibble],
)
Expand All @@ -235,9 +234,9 @@ ui <- function(id) {
server <- function(id) {
moduleServer(id, function(input, output, session) {
output$datatable <- renderUI({
# Datasets are the only case when you need to use :: in `box`.
# Note : If you are using `box>=1.1.3`, import datasets directly without using `shiny.fluent::fluentSalesDeals`
# This issue should be solved in the next `box` release.
DetailsList(items = shiny.fluent::fluentSalesDeals, columns = columns)
DetailsList(items = fluentSalesDeals, columns = columns)
})
})
}
Expand Down Expand Up @@ -267,7 +266,7 @@ So, the `app/view/datatable.R` file now is modified to -
box::use(
dplyr[filter],
shiny[div, moduleServer, NS, reactive, renderUI, uiOutput],
shiny.fluent[DetailsList, Text, Toggle.shinyInput],
shiny.fluent[DetailsList, Text, Toggle.shinyInput, fluentSalesDeals],
tibble[tibble],
)
Expand All @@ -293,9 +292,8 @@ ui <- function(id) {
server <- function(id) {
moduleServer(id, function(input, output, session) {
filtered_deals <- reactive({
# Datasets are the only case when you need to use :: in `box`.
# This issue should be solved in the next `box` release.
shiny.fluent::fluentSalesDeals |> filter(
# Note : If you are using `box>=1.1.3`, import datasets directly without using `shiny.fluent::fluentSalesDeals`
fluentSalesDeals |> filter(
is_closed | input$includeOpen
)
})
Expand Down Expand Up @@ -350,7 +348,7 @@ We will also style the data table area. The following code does the following -
box::use(
dplyr[filter],
shiny[div, moduleServer, NS, reactive, renderUI, span, uiOutput],
shiny.fluent[DetailsList, Stack, Text, Toggle.shinyInput],
shiny.fluent[DetailsList, Stack, Text, Toggle.shinyInput, fluentSalesDeals],
tibble[tibble],
)
Expand Down Expand Up @@ -380,9 +378,8 @@ ui <- function(id) {
server <- function(id) {
moduleServer(id, function(input, output, session) {
filtered_deals <- reactive({
# Datasets are the only case when you need to use :: in `box`.
# This issue should be solved in the next `box` release.
shiny.fluent::fluentSalesDeals |> filter(
# Note : If you are using `box>=1.1.3`, import datasets directly without using `shiny.fluent::fluentSalesDeals`
fluentSalesDeals |> filter(
is_closed | input$includeOpen
)
})
Expand Down Expand Up @@ -446,7 +443,7 @@ These modules will be called from the main file.
box::use(
dplyr[filter],
shiny[div, moduleServer, NS, reactive],
shiny.fluent[Text, Toggle.shinyInput],
shiny.fluent[Text, Toggle.shinyInput, fluentSalesDeals],
)
#' @export
Expand All @@ -462,9 +459,8 @@ ui <- function(id) {
server <- function(id) {
moduleServer(id, function(input, output, session) {
filtered_deals <- reactive({
# Datasets are the only case when you need to use :: in `box`.
# This issue should be solved in the next `box` release.
shiny.fluent::fluentSalesDeals |> filter(
# Note : If you are using `box>=1.1.3`, import datasets directly without using `shiny.fluent::fluentSalesDeals`
fluentSalesDeals |> filter(
is_closed | input$includeOpen
)
})
Expand Down

0 comments on commit 185f13f

Please sign in to comment.