Shiny Basic系列:

参考教程:https://mastering-shiny.org/

(1)IO控件

(2)Layout布局

(3)Reactive用法

(4)Feedback提醒

(5)Module模块

Shiny Package系列:

(1)shinyWidgets

(2)shinyJS

(3)shinydashboard

(4)shinydashboardPlus

(5)bslib

(6)Other pkgs


1. shinythemes

定制化主题

1
2
3
4
5
6
## ui.R ##
library(shinythemes)

fluidPage(theme = shinytheme("cerulean"),
  ...
)

2. shinyhelper

浮窗帮助信息(markdown)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(shinyhelper)

shinyhelper_demo()

## ui.R ##
helper(shiny::actionButton("go", "click me!"),
       icon = "exclamation",
       colour = "red",
       type = "markdown",
       content = "ClickHelp")  # looks for 'helpfiles/ClickHelp.md'

## serve.R ##
observe_helpers(help_dir = "helpfiles")

3. shinyBS

浮窗帮助信息(popover, tooltip)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library(shinyBS)

# 示例
bsExample("Tooltips_and_Popovers")

## (1) bsTooltip()/bsPopover(): 在UI部分根据目标元素/控件的id直接设置

bsTooltip(id, title, placement = "bottom", trigger = "hover",
  		  options = NULL)
# placement: top, bottom, left, or right
# trigger: hover, focus, click, or manual
# options: https://getbootstrap.com/docs/4.0/components/popovers/

bsPopover() #包括以下函数的参数与上述基本类似


## (2) tipify()/popify(): 相比上述二者,更适合于在server端的renderUI()里的元素设置
tipify() 
popify()

## (3) addPopover()/addTooltip(): 在server端对output元素设置(例如plot的解释说明)
addPopover()
addTooltip()

4. waiter

  • https://github.com/JohnCoene/waiter

  • 文档:https://waiter.john-coene.com/

  • Demo:https://shiny.john-coene.com/waiter/ (100+ Spinner)

  • waiter系列主要用于设置spinner悬浮窗

  • waitress系列主要用于设置常规的进度条 (Attendant与之类似,均基于传统的进度条)

  • hostess系列可以用于设置更加多样、个性化进度提醒元素