Skip to content

Commit

Permalink
simplify controls lims
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Apr 16, 2024
1 parent 993d678 commit a9f4820
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
10 changes: 2 additions & 8 deletions R/esquisse-server.R
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,6 @@ esquisse_server <- function(id,
scales_args <- c(scales_args, list(y_continuous = controls_rv$transY$args))
}

xlim <- if (isTRUE(controls_rv$limits$x)) {
controls_rv$limits$xlim
}
ylim <- if (isTRUE(controls_rv$limits$y)) {
controls_rv$limits$ylim
}
data_name <- data_chart$name %||% "data"
gg_call <- ggcall(
data = data_name,
Expand All @@ -284,8 +278,8 @@ esquisse_server <- function(id,
facet_row = aes_r()$facet_row,
facet_col = aes_r()$facet_col,
facet_args = controls_rv$facet,
xlim = xlim,
ylim = ylim
xlim = controls_rv$limits$xlim,
ylim = controls_rv$limits$ylim
)

ggplotCall$code <- deparse2(gg_call)
Expand Down
6 changes: 2 additions & 4 deletions R/module-controls-axes.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,8 @@ controls_axes_server <- function(id,

limits_r <- reactive({
list(
x = use_transX() & !anyNA(input$xlim),
xlim = input$xlim,
y = use_transY() & !anyNA(input$ylim),
ylim = input$ylim
xlim = if (use_transX() & !anyNA(input$xlim)) input$xlim,
ylim = if (use_transY() & !anyNA(input$ylim)) input$ylim
)
})

Expand Down

0 comments on commit a9f4820

Please sign in to comment.