Advanced tools and styling to allow the creation of the next generation of dashboards and shiny applications.
The nextGenShinyApps package is available on CRAN and can be installed as shown below
install.packages(nextGenShinyApps)
Attach library
library(nextGenShinyApps)
The nextGenShinyApps examples can be accessed as shown below
# library
library(nextGenShinyApps)
# load.example(EXAMPLEx)
# Where EXAMPLEx can be either “Plain”, “noSideBar”, “Card”, “Tab”,
# “Modal”, “Form”, “Button”, “Spinner”, “Alert”, “Accordion”
# library
library(shiny)
library(nextGenShinyApps)
library(r2social)
library(r2resize)
library(r2dictionary)
if(interactive()) {
# Define UI
<- fluidPage(
ui # Theme: Select color style from 1-13
style = "6",
# Header: Insert header content using titlePanel ------------
header = titlePanel(left = "A Demo to Showcase the Features of the nextGenShinyApp R package", right = "Image logo"),
# Sidebar: Insert content for sidebar ----------------------
sidebar = sidebarPanel(
title = "NextGenShinyApp",
"Sidebar content"
),empahsisCard(tags$h2("Welcome"),"Redefined cards with nextGenShinyApps. This box was created using r2resize R package", bg.color = "#ffffff"),
# Body: Insert anything into the body--------------------
$h2("Basic Moveable Advanced Card"),
tagswrapper(
altPanel(
card(
title = "Standard card with text and a slider",
# card body content
$h4("Sample text"),
tags"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Mi bibendum neque egestas congue quisque egestas",
$br(), tags$br(),
tags$h4("Input slider for the image"),
tagsHTML(r2dictionary::define("box")),
sliderInput(
inputId = "bins",
label = "Number of bins:",
min = 1,
max = 50,
value = 30
)
)
),mainPanel(
width = 4,
card(
title = "Standard card with a Figure",
plotOutput(outputId = "distPlot"),
HTML(r2dictionary::define("photo"))
)
)
),r2social.scripts(),
shareButton(link = "https://rpkg.net", position = "inline")
)
# Define server content
<- function(input, output) {
server
# Sample user-defined sever logic
$distPlot <- renderPlot({
output<- faithful$waiting
x <- seq(min(x), max(x), length.out = input$bins + 1)
bins
hist(x,
breaks = bins, col = "#75AADB", border = "white",
xlab = "Waiting time to next eruption (in mins)",
main = "Histogram of waiting times"
)
})
}
# Create and initialize the Shiny application
::shinyApp(ui, server)
shiny }
View examples and demo pages at https://nextgenshinyapps.obi.obianom.com/ View other packages created by me at https://coursewhiz.org