-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.R
More file actions
34 lines (26 loc) · 793 Bytes
/
global.R
File metadata and controls
34 lines (26 loc) · 793 Bytes
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
### global.R
list.files(path = "mods/", full.names = TRUE) |>
map(source)
code_versions <- list.files("data/", full.names = TRUE) |>
keep(str_detect, "dot") |>
map(read_file)
names(code_versions) <- list.files("data/") |>
keep(str_detect, "dot") |>
str_remove(".R")
dot_update <- function(loc,ns, session, current_dot){
onclick(loc, {
shinyjs::runjs(
str_glue(
"$('#{ns('graph')}').find('.head').first().removeClass('head');
$('#{ns(loc)}').addClass('head');
Shiny.setInputValue(\"{ns('head')}\", '{loc}');
"
)
)
updateAceEditor(session, "code_box",
value = code_versions[loc],
theme = "chrome",
mode = "r")
current_dot(loc)
})
}