Releases: yjunechoe/ggtrace
ggtrace 0.7.1
ggtrace 0.7.0
Upkeep release for the JSM 2023 talk "Sub-layer modularity in the Grammar of Graphics".
New Features
-
layer_*()
snapshot functions gain averbose
argument. -
getOption("ggtrace.rethrow_error")
To control re-printing of the error by workflow functions whenerror = TRUE
. Set toFALSE
on load.
ggtrace 0.6.1
Bug fixes
get_method_inheritance()
now works correctly for top-level ggprotos - ex:get_method_inheritance(Geom)
(#99; thanks @yjing14 for bug report).
ggtrace 0.6.0
Significant usability improvements, including {cli}
integration.
New Features
-
Convenience functions
layer_before_stat()
,layer_after_stat()
,layer_before_geom()
, andlayer_after_scale()
that returns a snapshot of layer data in the internals. Inspired byggplot2::layer_data()
with a similar interface. (#97) -
Interactive debugging functions
last_layer_errorcontext()
andlast_sublayer_errorcontext()
which return the internal context of layer errors at the level of theLayer
and sub-Layer
(e.g.,Stat
orGeom
) ggproto methods, respectively.last_sublayer_errorcontext()
is still in experimental phase (error-prone, may be removed in future). -
New Inspect workflow function
ggtrace_inspect_on_error()
which dumps information about themethod
that errors while renderingx
.
ggtrace 0.5.3
ggtrace 0.5.2
Breaking Changes
ggtrace_inspect_vars()
simplifies the output whenat
is length 1.
Bug fixes
ggtrace_capture_env()
removes ggtrace-internal variables before snapshotting the environment (#88)
ggtrace 0.5.1
New Features
cond
argument of workflow functions now support integer shorthand for conditioning on the counter. E.g.,cond = 1L
is converted tocond = quote(._counter_ == 1L)
. Multi-length integer vector is supported for highjack workflows. (#84)
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)
ggtrace 0.4.8
New Features
- Added
with_ggtrace()
for a functional interface toggtrace()
- Added
ggtrace_capture_fn()
andggtrace_capture_env()
, which return a snapshot of the function/environment of the ggproto method at execution time - Added
ggtrace_inspect_return()
andggtrace_modify_return()
to grab and swap return values at method's execution
Miscellaneous
- Added workflows section to docs/references
ggtrace 0.4.7
New Features
- Added
ggformals()
which returns theformals()
of functions and ggproto methods ggbody()
gains aas.list
argument to control whether output ofbody()
is turned into a list- Exported
set_last_ggtrace()
andset_global_ggtrace()
for the tracedumps
Bug Fix
- Fixed compatibility issues with {rlang} v1.0.0 new changes to the call and expression API