-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
After testing, I found it difficult to handle the original feature request using a single Facet object alone, since the panels input to Facet$draw_panels() is unpredictable. It’s challenging to break down panels into individual layer grobs.
Several issues contribute to this unpredictability:
- The
Layer$draw_geommethod doesn't always return a grob if the developer doesn’t follow the expected conventions. No error or warning is issued in such cases, andgList(NULL)orgList(gList())simply works silently. Coord$draw_panelwill sometimes wrap all layer grobs into single gTree inCoordRadial, sometimes it won't
Solutions:
- Ensure that
Layer$draw_geom()always returns a singlegrobor agTree. - always wrap the all layer grobs into a single
gTreebefore passing toCoord$draw_panel
In this way, the input panels will always be a list of gTree object for each panel.
each gTree object contains 3 children for Coord$render_fg, Coord$render_bg and another gTree of Facet$draw_back, all layer grobs, and Facet$draw_front