Feature Request Description
It would be nice to display markers offset from the lanes, specifically in such an example as having infusion markers as downward triangles at the points of infusion just above the lane.
Ideally we would want some way to communicate from the segment layer what the linewidth value is for the offset of the following point layer. The problem is layers are stateless and isolated from each other, and the declaration of linewidth is based on plot space whereas the actual positioning is based on pixel space as orchestrated by the grid object calculation.
Proposed Solution
There are a few avenues to pursue but each is a bit tricky.
Option 1
Add a secondary GeomPoint to a gridList() in GeomSwimLane. This would require thinking of a way to reshape how data gets fed to geom_swim_lane() and passed to the second grid object.
This is a bit undesirable because reshaping the data would likely get messy and nonstandard.
Option 2
Figure out a way to capture the linewidth grob value from GeomSwimLane via
GeomSegment$draw_panel(data, panel_params, coord,
arrow = NULL, arrow.fill = NULL,
lineend = "butt", linejoin = "round", na.rm = FALSE
)$gp$lwd[[1]]
The issue here is this never gets triggered until the plot is printed. GeomSwimLane is also stateless, so values internal to this likely can't be sent outward to the next layer.
Option 3
Develop an external function that gets called after the applicable point and lane layers. This is described in a convo with ggplot2 devs on SO here : https://stackoverflow.com/questions/78330694/ggplot2-position-nudge-respective-of-linewidth
The problem here is that it's hard to control how users will layer and call these functions. It's also pretty hacky and likely to fail in a production setting.
Additional Context
Add any other context or screenshots about the feature request here.
Checklist
Feature Request Description
It would be nice to display markers offset from the lanes, specifically in such an example as having infusion markers as downward triangles at the points of infusion just above the lane.
Ideally we would want some way to communicate from the segment layer what the
linewidthvalue is for the offset of the following point layer. The problem is layers are stateless and isolated from each other, and the declaration oflinewidthis based on plot space whereas the actual positioning is based on pixel space as orchestrated by the grid object calculation.Proposed Solution
There are a few avenues to pursue but each is a bit tricky.
Option 1
Add a secondary
GeomPointto agridList()inGeomSwimLane. This would require thinking of a way to reshape how data gets fed togeom_swim_lane()and passed to the second grid object.This is a bit undesirable because reshaping the data would likely get messy and nonstandard.
Option 2
Figure out a way to capture the linewidth grob value from
GeomSwimLaneviaThe issue here is this never gets triggered until the plot is printed.
GeomSwimLaneis also stateless, so values internal to this likely can't be sent outward to the next layer.Option 3
Develop an external function that gets called after the applicable point and lane layers. This is described in a convo with ggplot2 devs on SO here : https://stackoverflow.com/questions/78330694/ggplot2-position-nudge-respective-of-linewidth
The problem here is that it's hard to control how users will layer and call these functions. It's also pretty hacky and likely to fail in a production setting.
Additional Context
Add any other context or screenshots about the feature request here.
Checklist