@@ -19,33 +19,33 @@ dashboard <- function(mapper_obj, X = mapper_obj$X, node_color_f = "default"){
19
19
20
20
# # Make sure shorthand 'M' is defined
21
21
if (! " MapperRef" %in% class(mapper_obj )){ stop(" 'dashboard' must take as input a mapper reference object." ) }
22
- M <- mapper_obj
23
- G <- Mapper :: grapher(M )
24
- if (is(X , " dist" )){ X <- data.frame (index = 1 : attr(M $ X , " Size" )) }
25
- else { X <- as.data.frame(X ) }
26
-
27
- # # Get the UI components
28
- ui_file <- system.file(file.path(" dashboard" , " ui.R" ), package = " Mapper" )
29
- source(file = ui_file , local = TRUE )
30
-
31
- # # Node color functions
32
- if (missing(node_color_f ) || node_color_f == " default" ){
33
- if (is(X , " dist" )){ stop(" Default color functions cannot be applied when 'X' is given as a dist object." ) }
34
- if (is.null(colnames(X ))) { colnames(X ) <- paste0(" dim" , 1 : dim(X )[2 ]) }
35
- color_funcs <- new.env(parent = .BaseNamespaceEnv )
36
- color_file <- system.file(file.path(" dashboard" , " components" , " default_color_functions.R" ), package = " Mapper" )
37
- source(color_file , local = color_funcs )
38
- sapply(colnames(X ), function (dim_name ){ color_funcs [[dim_name ]] <- make_Dim_f(dim_name ) })
39
- } else {
40
- color_funcs <- node_color_f
41
- }
42
-
43
- # # Get the server components
44
- server_file <- system.file(file.path(" dashboard" , " server.R" ), package = " Mapper" )
45
- source(file = server_file , local = TRUE )
46
-
47
- # # Return the shiny app
48
- shiny :: shinyApp(ui = ui , server = server )
22
+ # M <- mapper_obj
23
+ # G <- Mapper::grapher(M)
24
+ # if (is(X, "dist")){ X <- data.frame(index=1:attr(M$X, "Size")) }
25
+ # else { X <- as.data.frame(X) }
26
+ #
27
+ # # # Get the UI components
28
+ # ui_file <- system.file(file.path("dashboard", "ui.R"), package = "Mapper")
29
+ # source(file = ui_file, local = TRUE)
30
+ #
31
+ # # # Node color functions
32
+ # if (missing(node_color_f) || node_color_f == "default"){
33
+ # if (is(X, "dist")){ stop("Default color functions cannot be applied when 'X' is given as a dist object.") }
34
+ # if (is.null(colnames(X))) { colnames(X) <- paste0("dim", 1:dim(X)[2]) }
35
+ # color_funcs <- new.env(parent = .BaseNamespaceEnv)
36
+ # color_file <- system.file(file.path("dashboard", "components", "default_color_functions.R"), package = "Mapper")
37
+ # source(color_file, local = color_funcs)
38
+ # sapply(colnames(X), function(dim_name){ color_funcs[[dim_name]] <- make_Dim_f(dim_name) })
39
+ # } else {
40
+ # color_funcs <- node_color_f
41
+ # }
42
+ #
43
+ # # # Get the server components
44
+ # server_file <- system.file(file.path("dashboard", "server.R"), package = "Mapper")
45
+ # source(file = server_file, local = TRUE)
46
+ #
47
+ # # # Return the shiny app
48
+ # shiny::shinyApp(ui = ui, server = server)
49
49
}
50
50
51
51
# # Auxillary function to make a closure for each dimension of X
0 commit comments