should these functions be options to geom_glyph rather than separate?
geom_glyph_box() and geom_glyph_line() both might be better to be optional arguments on the geom_glyph() function, so the user doesn't need to specify the data and aes for each separate line. For example,
ggplot() + geom_polygon(data=sth_america, aes(x=long, y=lat, group=group), fill="grey70") + geom_glyph(data=nasa, aes(x_major = long, x_minor = day, y_major = lat, y_minor = ozone)) + geom_glyph_box(data=nasa, aes(x_major = long, x_minor = day, y_major = lat, y_minor = ozone)) + geom_glyph_line(data=nasa, aes(x_major = long, x_minor = day, y_major = lat, y_minor = ozone)) + coord_map() + theme_map()
And then also plotting order would be handled, so data plots show up above lines and boxes.
The box should be transparent by default, fill=NA
This can be solved by specifying aesthetics in ggplot() and using inherits.aes = FALSE for the map layer:
glyph_dt %>%
ggplot(aes(x_major = xxx, x_minor = xxx, y_major = xxx, y_minor = xxx)) +
geom_sf(data = map_data, ..., inherit.aes = FALSE) +
geom_glyph_box() +
geom_glyph()