reordered data panel

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-02-26 12:18:46 +01:00
commit 3dea828d20
No known key found for this signature in database
6 changed files with 572 additions and 568 deletions

View file

@ -1 +1 @@
app_version <- function()'250225_0948'
app_version <- function()'250226_1216'

View file

@ -155,6 +155,7 @@ overview_vars <- function(data) {
dplyr::tibble(
class = get_classes(data),
type = get_classes(data),
name = names(data),
n_missing = unname(colSums(is.na(data))),
p_complete = 1 - n_missing / nrow(data),
@ -187,10 +188,11 @@ create_overview_datagrid <- function(data) {
std_names <- c(
"Name" = "name",
"Class" = "class",
"Missing" = "n_missing",
"Type" = "type",
"Missings" = "n_missing",
"Complete" = "p_complete",
"Unique" = "n_unique",
"Plot" = "vals"
"Distribution" = "vals"
)
headers <- lapply(col.names, \(.x){
@ -204,15 +206,28 @@ create_overview_datagrid <- function(data) {
grid <- toastui::datagrid(
data = data,
theme = "default",
colwidths = "auto"
colwidths = "fit"
)
grid <- toastui::grid_columns(
grid = grid,
columns = col.names,
header = headers,
resizable = TRUE,
width = 80
resizable = TRUE
)
grid <- toastui::grid_columns(
grid = grid,
columns = "vals",
width = 120
)
grid <- toastui::grid_columns(
grid = grid,
columns = "class",
header = " ",
align = "center",sortable = FALSE,
width = 40
)
grid <- add_class_icon(

View file

@ -69,10 +69,11 @@ update_variables_ui <- function(id, title = TRUE) {
id = ns("update-result"),
status = "info",
phosphoricons::ph("info"),
datamods::i18n(paste(
"Select, rename and convert variables in table above,",
"then apply changes by clicking button below."
))
paste(
"Select variables to keep (if none selected, all are kept), rename",
"variables and labels, and convert variable type/class in the table",
"above. Apply changes by clicking the button below."
)
)
),
shiny::actionButton(
@ -281,7 +282,24 @@ update_variables_server <- function(id,
}
modal_update_variables <- function(id,
title = "Select, rename and reclass variables",
easyClose = TRUE,
size = "xl",
footer = NULL) {
ns <- NS(id)
showModal(modalDialog(
title = tagList(title, datamods:::button_close_modal()),
update_variables_ui(id),
tags$div(
style = "display: none;",
textInput(inputId = ns("hidden"), label = NULL, value = datamods:::genId())
),
easyClose = easyClose,
size = size,
footer = footer
))
}
@ -516,7 +534,7 @@ update_variables_datagrid <- function(data, height = NULL, selectionId = NULL, b
grid = grid,
column = "class_toset",
type = "select",
choices = c("Select new class", "character", "factor", "numeric", "integer", "date", "datetime", "hms")
choices = c("Select", "character", "factor", "numeric", "integer", "date", "datetime", "hms")
)
grid <- toastui::grid_editor_opts(
grid = grid,