-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtable.R
More file actions
48 lines (42 loc) · 1.17 KB
/
table.R
File metadata and controls
48 lines (42 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
library(reactable)
library(reactablefmtr)
library(tidyr)
library(lubridate)
library(shinycssloaders)
tabeServer <- function(id, data, theme) {
moduleServer(
id,
function(input, output, session) {
output$tabe <- renderReactable({
reactable(
data,
theme=theme,
compact = TRUE,
pagination = TRUE,
showSortIcon = FALSE,
defaultSortOrder = 'desc',
defaultColDef = colDef(
maxWidth = 50,
align = 'center',
cell = tooltip(number_fmt = scales::comma),
style = color_scales(data, text_size = 24, span = TRUE)
),
columns = list(
scientific_vernacular_names = colDef(
name = "Scientific / Vernacular Name",
minWidth = 100,
maxWidth = 175,
align = 'left',
html = TRUE
)
)
) %>%
add_title('Total Species Observations') %>%
add_source('Data sourced from Global Biodiversity Information Facility')
})
})
}
tabeUI <- function(id) {
ns <- NS(id)
reactableOutput(ns("tabe")) %>% withSpinner()
}