-
Notifications
You must be signed in to change notification settings - Fork 110
Description
Hi Thomas 👋
Hope you’re well!
We’ve run into something odd with geom_mark_*() and wanted to check whether this is expected behavior or a small edge case. And if there is anythoing we are missing and potential ways to fix it (either from oru or your side).
In webR-based environments, which we’re using in-browser sandboxes in our uncharted course, geom_mark_*() (e.g. `geom_mark_circle()) throws:
Error: Problem while converting geom to grob.
This happens whenever a description is not porivded. What’s surprising is that the error completely disappears as soon as any character string is provided for the description.
🔁 Minimal example
This fails in webR:
library(ggplot2)
library(ggforce)
ggplot(
data = penguins,
aes(x = flipper_len, y = body_mass, fill = species)
) +
geom_mark_ellipse(aes(label = species)) +
geom_point(shape = 21, size = 2)This works:
library(ggplot2)
library(ggforce)
ggplot(
data = penguins,
aes(x = flipper_len, y = body_mass, fill = species)
) +
geom_mark_ellipse(aes(label = species, description = "")) + # empty quotes for description make it work
geom_point(shape = 21, size = 2)Our hypothesis after doing some research: the grob tree constructed by geom_mark_*() is incomplete when description is missing, and webR’s graphics device is stricter about validating grobs. In a full desktop R session, this seems to slip through unnoticed, but in webR it fails hard.
If that's the reason:
Would it be possible for geom_mark_*() to return a complete grob structure, even when description is not supplied, so it behaves consistently across devices?
Thanks a lot for ggforce and all your other packages 🙌