From afac67309cbf1c2d4eb179e7c46b9fc8676c33e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 31 Mar 2026 18:21:13 +0000 Subject: [PATCH 1/2] Replace hard-coded iris column names with names(iris)[-5] Agent-Logs-Url: https://github.com/yihui/gglite/sessions/ecc36ab2-46e5-4639-aae1-4f78f5eb981f Co-authored-by: yihui-bot <264330240+yihui-bot@users.noreply.github.com> --- R/coordinate.R | 3 +-- examples/coordinates.Rmd | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/R/coordinate.R b/R/coordinate.R index 0a73cab..78b9062 100644 --- a/R/coordinate.R +++ b/R/coordinate.R @@ -35,8 +35,7 @@ #' coord_radial() #' #' # Parallel coordinate (uses position encoding) -#' g2(iris, position = c('Sepal.Length', 'Sepal.Width', -#' 'Petal.Length', 'Petal.Width'), color = 'Species', +#' g2(iris, position = names(iris)[-5], color = 'Species', #' padding = c(30, NA, NA, NA)) |> #' mark_line() |> #' coord_parallel() |> diff --git a/examples/coordinates.Rmd b/examples/coordinates.Rmd index f73e3e4..a3b4ff7 100644 --- a/examples/coordinates.Rmd +++ b/examples/coordinates.Rmd @@ -94,8 +94,7 @@ Maps multiple numeric variables to parallel axes. Use a `position` encoding (a character vector of column names) instead of `x`/`y`. ```{r} -g2(iris, position = c('Sepal.Length', 'Sepal.Width', - 'Petal.Length', 'Petal.Width'), color = 'Species', +g2(iris, position = names(iris)[-5], color = 'Species', padding = 30) |> mark_line() |> coord_parallel() |> From dec3c5a3fb5d876fb2207107c439e7936aa8cf6e Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Tue, 31 Mar 2026 13:35:42 -0500 Subject: [PATCH 2/2] roxygenize --- R/render.R | 4 ++-- man/coord_.Rd | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/R/render.R b/R/render.R index b049768..2c57abe 100644 --- a/R/render.R +++ b/R/render.R @@ -4,8 +4,8 @@ #' #' Convert a `g2` chart object into a nested list matching G2's #' `chart.options()` spec format. Data frames are annotated for column-major -#' JSON serialisation via [annotate_df()]. Constructor options (width, height, -#' container) are handled separately by [chart_html()]. +#' JSON serialisation. Constructor options (width, height, container) are +#' handled separately by [chart_html()]. #' #' @param chart A `g2` object. #' @return A list suitable for JSON serialization. diff --git a/man/coord_.Rd b/man/coord_.Rd index f68195c..8244e4e 100644 --- a/man/coord_.Rd +++ b/man/coord_.Rd @@ -48,8 +48,7 @@ g2(df, x = 'x', y = 'y', color = 'x') |> coord_radial() # Parallel coordinate (uses position encoding) -g2(iris, position = c('Sepal.Length', 'Sepal.Width', - 'Petal.Length', 'Petal.Width'), color = 'Species', +g2(iris, position = names(iris)[-5], color = 'Species', padding = c(30, NA, NA, NA)) |> mark_line() |> coord_parallel() |>