From 781e81723717fdedb6c74f00dd88050bdc4e7363 Mon Sep 17 00:00:00 2001 From: Julien DIOT Date: Mon, 30 Sep 2024 10:25:15 +0900 Subject: [PATCH] fix(data-viz): X/Y/Color input auto-update --- src/fun/func_data-viz.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fun/func_data-viz.R b/src/fun/func_data-viz.R index 177aef9..1fc36dd 100644 --- a/src/fun/func_data-viz.R +++ b/src/fun/func_data-viz.R @@ -55,18 +55,19 @@ data_viz_server <- function(id, plot_data) { } var_list <- colnames(data) + # browser() var_list <- c(none_value, var_list) updateSelectInput(session, "x_var", choices = var_list, - selected = ifelse(!is_null_var(input$x_var) && input$x_var %in% var_list, input$x_var, var_list[2]) + selected = ifelse(input$x_var %in% var_list, input$x_var, none_value) ) updateSelectInput(session, "y_var", choices = var_list, - selected = ifelse(!is_null_var(input$x_var) && input$y_var %in% var_list, input$y_var, var_list[1]) + selected = ifelse(input$y_var %in% var_list, input$y_var, none_value) ) updateSelectInput(session, "col_var", choices = var_list, - selected = ifelse(!is_null_var(input$x_var) && input$col_var %in% var_list, input$col_var, var_list[1]) + selected = ifelse(input$col_var %in% var_list, input$col_var, none_value) ) })