Skip to content

Commit

Permalink
Remove missing values in ticktext/tickvals
Browse files Browse the repository at this point in the history
As discussed in tidyverse/ggplot2#3566 (comment), it's now possible for the ggplot2 labels/positions to contains missing values, and we should be able to simply ignore them
  • Loading branch information
cpsievert committed Jan 6, 2020
1 parent 9bcf90a commit 63eaf39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/ggplotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,9 @@ gg2list <- function(p, width = NULL, height = NULL,
ticktext <- rng[[xy]]$get_labels %()% rng[[paste0(xy, ".labels")]]
tickvals <- rng[[xy]]$break_positions %()% rng[[paste0(xy, ".major")]]

ticktext <- ticktext[!is.na(ticktext)]
tickvals <- tickvals[!is.na(tickvals)]

axisObj <- list(
# TODO: log type?
type = if (isDateType) "date" else if (isDiscreteType) "category" else "linear",
Expand Down

0 comments on commit 63eaf39

Please sign in to comment.