Thanks for working on this - it's a great idea. I suspect i'm doing something wrong and I know this is in early stages so wouldn't expect everything to work but wanted to flag - just incase it might be useful. I have tried a few different geoms with the example plot in the documentation but it didn't seem to like geom_line (others worked ok).
It may have something to do with this in {grid} (though it may not):
######################################
# POLYLINES primitive
######################################
# Very similar to LINES primitive, but allows
# multiple polylines via 'id' and 'id.lengths' args
# as per POLYGON primitive
validDetails.polyline <- function(x) {
if (!is.unit(x$x) ||
!is.unit(x$y))
stop("'x' and 'y' must be units")
if (!is.null(x$id) && !is.null(x$id.lengths))
stop("it is invalid to specify both 'id' and 'id.lengths'")
if (length(x$x) != length(x$y))
stop("'x' and 'y' must be same length")
if (!is.null(x$id) && (length(x$id) != length(x$x)))
stop("'x' and 'y' and 'id' must all be same length")
if (!is.null(x$id))
x$id <- as.integer(x$id)
if (!is.null(x$id.lengths) && (sum(x$id.lengths) != length(x$x)))
stop("'x' and 'y' and 'id.lengths' must specify same overall length")
if (!is.null(x$id.lengths))
x$id.lengths <- as.integer(x$id.lengths)
if (!(is.null(x$arrow) || inherits(x$arrow, "arrow")))
stop("invalid 'arrow' argument")
x
}
Thanks for working on this - it's a great idea. I suspect i'm doing something wrong and I know this is in early stages so wouldn't expect everything to work but wanted to flag - just incase it might be useful. I have tried a few different geoms with the example plot in the documentation but it didn't seem to like
geom_line
(others worked ok).It may have something to do with this in {grid} (though it may not):