Closed rsh52 closed 5 months ago
I believe this should be something as solvable as:
patient_data |>
ggswim(mapping = aes(x = start_time, xend = end_time, y = pt_id,
color = disease_assessment),
arrow = status,
arrow_neck_length = status_length,
linewidth = linewidth
) +
new_scale_color() +
add_marker(
data = infusion_events,
aes(x = time_from_initial_infusion, y = pt_id, color = infusion_type),
position = ggplot2::position_dodge2(width = linewidth/2), shape = 25, size = 5, fill = "black"
) +
scale_color_manual(name = "Markers", values = c("black", "black"))
Thereby not something we even really have to support outside of convenience, but looking to see if I can get a response via SO since linewidth
and nudge aren't working how I expect.
It seems we have two options with pluses and minuses.
Add new parameters to add_marker()
to indicate this is to be a indication application.
build_ggswim()
annotation_custom()
to handle grob calculation outputsCreate new geoms that handle the calculations themselves and are extensions of geom_segment()
and geom_point()
ggwim()
and add_marker()
Another complication to keep in mind is that use of ggnewscale::new_scale_color()
removes attributes we're currently adding to layers for identification. Issue opened here.
Another issue with annotation_custom()
is it does not play well with the legend, i.e. it doesn't appear in the legend.
Closing this in the interest of updating and rewriting the issue with the new ggswim setup
Feature Request Description
A requested feature for markers is to have down-pointing arrows/triangles at certain marker points. For example, in the test data, to have down triangles at infusion/reinfusion points.
Proposed Solution
Add an additional set of parameters and a new geom reference to geom point internal to
gridList()
.Checklist