-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathserver.R
58 lines (56 loc) · 1.61 KB
/
server.R
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
48
49
50
51
52
53
54
55
56
57
58
server <- function(input, output, session) {
# Get data model csv and re-format for dictionary app
# use reactive expression to get latest version of data model
dict_table <- reactive({
df <- format_dict_table(data_model_url)
as.data.frame(df) # Ensure the result is a data frame
})
## Create table to display
output$dictionary_table <- renderReactable({
reactable(
dict_table(),
groupBy = "Column",
searchable = TRUE,
sortable = TRUE,
theme = reactable::reactableTheme(
searchInputStyle = list(width = "100%")
),
columns = list(
Column = colDef(
name = "Column",
filterable = TRUE
),
`Column Description` = colDef(
name = "Column Description",
aggregate = "unique",
filterable = TRUE
),
`Column Type` = colDef(
name = "Column Type",
aggregate = "unique",
filterable = TRUE
),
`Value` = colDef(
name = "Value",
aggregate = truncated_values,
filterable = TRUE
),
`Value Description` = colDef(
name = "Value Description",
aggregate = reactable::JS("function(values, rows) { return '...' }"),
filterable = TRUE
),
Source = colDef(
name = "Source",
aggregate = reactable::JS("function(values, rows) { return '...' }"),
filterable = TRUE
),
`Data Model Module` = colDef(
name = "Data Model Module",
aggregate = "unique",
filterable = TRUE
)
)
)
})
}