Skip to content

Releases: yjunechoe/ggtrace

ggtrace 0.7.1

26 Apr 19:49
Compare
Choose a tag to compare
  • Exported shorthand aliases for all workflow functions. E.g., inspect_n() complement to ggtrace_inspect_n()

  • Cleaned up examples and tests to align with {ggplot2} version 3.5.0

ggtrace 0.7.0

02 Aug 13:24
Compare
Choose a tag to compare

Upkeep release for the JSM 2023 talk "Sub-layer modularity in the Grammar of Graphics".

New Features

  • layer_*() snapshot functions gain a verbose argument.

  • getOption("ggtrace.rethrow_error") To control re-printing of the error by workflow functions when error = TRUE. Set to FALSE on load.

ggtrace 0.6.1

18 Mar 01:20
Compare
Choose a tag to compare

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

16 Feb 22:10
Compare
Choose a tag to compare

Significant usability improvements, including {cli} integration.

New Features

  • Convenience functions layer_before_stat(), layer_after_stat(), layer_before_geom(), and layer_after_scale() that returns a snapshot of layer data in the internals. Inspired by ggplot2::layer_data() with a similar interface. (#97)

  • Interactive debugging functions last_layer_errorcontext() and last_sublayer_errorcontext() which return the internal context of layer errors at the level of the Layer and sub-Layer (e.g., Stat or Geom) 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 the method that errors while rendering x.

ggtrace 0.5.3

08 Dec 01:33
Compare
Choose a tag to compare

New Features

  • Inspect workflow functions gain a error = TRUE argument, which allows inspection of an earlier intermediate step even when the ggplot rendering process fails down the line (#89)

Bug fixes

  • Internal is.ggtrace_placeholder() returns scalar logical (#94)

ggtrace 0.5.2

05 Aug 21:36
Compare
Choose a tag to compare

Breaking Changes

  • ggtrace_inspect_vars() simplifies the output when at is length 1.

Bug fixes

  • ggtrace_capture_env() removes ggtrace-internal variables before snapshotting the environment (#88)

ggtrace 0.5.1

17 Apr 05:10
Compare
Choose a tag to compare

New Features

  • cond argument of workflow functions now support integer shorthand for conditioning on the counter. E.g., cond = 1L is converted to cond = quote(._counter_ == 1L). Multi-length integer vector is supported for highjack workflows. (#84)

ggtrace 0.5.0

13 Mar 05:24
Compare
Choose a tag to compare

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 condition cond 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 a out argument which can take 1 of three options:

    • "t" or "tracedump" (default): returns the local tracedump from triggering traces on the method as the ggplot x is evaluated
    • "g" or "gtable": Invisibly returns the <gtable> grob after evaluating x with injected expressions in method.
    • "b" or "both": returns the tracedump while rendering the gtable (with grid::grid.draw()) as a side effect.
  • Low-level functions ggtrace()/gguntrace() and wrapper with_ggtrace() can now take quosures in the method argument, which allows them to be used more programmatically.

Breaking Changes

  • ggtrace_capture_env() default value of at is changed to -1L, which captures a snapshot of the runtime environment right before the method returns. Only the first element is used if at 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

07 Feb 14:26
Compare
Choose a tag to compare

New Features

  • Added with_ggtrace() for a functional interface to ggtrace()
  • Added ggtrace_capture_fn() and ggtrace_capture_env(), which return a snapshot of the function/environment of the ggproto method at execution time
  • Added ggtrace_inspect_return() and ggtrace_modify_return() to grab and swap return values at method's execution

Miscellaneous

  • Added workflows section to docs/references

ggtrace 0.4.7

03 Feb 19:42
Compare
Choose a tag to compare

New Features

  • Added ggformals() which returns the formals() of functions and ggproto methods
  • ggbody() gains a as.list argument to control whether output of body() is turned into a list
  • Exported set_last_ggtrace() and set_global_ggtrace() for the tracedumps

Bug Fix

  • Fixed compatibility issues with {rlang} v1.0.0 new changes to the call and expression API