Skip to content

Commit

Permalink
Follow changes in dimensio
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrerebeau committed Oct 21, 2024
1 parent d9b7f4e commit becfb0a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
7 changes: 6 additions & 1 deletion R/multivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,12 @@ multivariate_server <- function(id, x) {
function(...) invisible()
)

fun_wrap(x = x(), margin = 1, axes = c(axis1(), axis2()))
fun_wrap(
x = x(),
margin = 1,
axes = c(axis1(), axis2()),
color = khroma::color(input$col_ind)
)
grDevices::recordPlot()
})

Expand Down
18 changes: 16 additions & 2 deletions R/pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ pca_ui <- function(id, center = TRUE, scale = TRUE) {
),
actionButton(
inputId = ns("go"),
label = "(Re)Compute"
label = "(Re)Compute",
class = "btn btn-primary"
),
downloadButton(
outputId = ns("download"),
label = "Download results"
)
), # sidebar
multivariate_ui(id),
Expand Down Expand Up @@ -85,7 +90,7 @@ pca_server <- function(id, x) {
i
})
sup_col <- reactive({
i <- match(input$sup_row, colnames(x()))
i <- match(input$sup_col, colnames(x()))
if (anyNA(i)) return(NULL)
i
})
Expand All @@ -107,6 +112,15 @@ pca_server <- function(id, x) {
input$go
)

## Export -----
output$download <- downloadHandler(
filename = function() { make_file_name("pca", "zip") },
content = function(file) {
dimensio::export(results(), file = file, flags = "-r9Xj")
},
contentType = "application/zip"
)

results
})
}

0 comments on commit becfb0a

Please sign in to comment.