ggtrace 0.5.0
New Features
-
Added complements to the
base::debug()
family of functions that are compatible with ggproto methods -ggdebug()
,ggdebugonce()
,ggundebug()
-
get_method_inheritance()
to get the list of methods from self and parent ggprotos -
ggtrace_inspect_n()
to get the number of times a method was called in the evaluation of a ggplot -
ggtrace_inspect_which()
to get the indices when a conditioncond
evaluated to true inside a method -
ggtrace_inspect_vars()
to get the value of variables at specified steps of a method's execution -
ggtrace_inspect_args()
to get the value of arguments passed to a method -
ggtrace_highjack_args()
to modify formals of a method at its execution -
with_ggtrace()
gets aout
argument which can take 1 of three options:- "t" or "tracedump" (default): returns the local tracedump from triggering traces on the
method
as the ggplotx
is evaluated - "g" or "gtable": Invisibly returns the
<gtable>
grob after evaluatingx
with injected expressions inmethod
. - "b" or "both": returns the tracedump while rendering the gtable (with
grid::grid.draw()
) as a side effect.
- "t" or "tracedump" (default): returns the local tracedump from triggering traces on the
-
Low-level functions
ggtrace()
/gguntrace()
and wrapperwith_ggtrace()
can now take quosures in themethod
argument, which allows them to be used more programmatically.
Breaking Changes
ggtrace_capture_env()
default value ofat
is changed to-1L
, which captures a snapshot of the runtime environment right before the method returns. Only the first element is used ifat
is length > 1- "modify" workflows are renamed to "highjack" (starting with
ggtrace_highjack_return()
) to reflect the fact that they always return the graphical output (gtable grob) (#78)
Bug Fixes
- Fixed an issue where a trace would fail to remove itself with
ggtrace(once = TRUE)
if it was triggered by a copy of the traced function (#59)