Skip to content

ggdiagram 0.3.0

Latest

Choose a tag to compare

@wjschne wjschne released this 15 Nov 19:41
· 4 commits to main since this release

ggdiagram 0.3.0 is now on CRAN.

install.packages("ggdiagram")

Highlights

Color gradients for arrows

ob_segment, ob_path, ob_bezier, and ob_arc gain a gradient property: give it 2 or more colors and the arrow fades smoothly from its fins to its head.

  • Gradients are interpolated in OKLab by default, so midpoints stay vivid (blue to yellow no longer passes through gray). Choose another color space with the space argument or options(ggdiagram.gradient_space = ...).
  • connect() now draws a gradient automatically when the from and to objects have different colors.
  • New geom_arrow_segment_gradient() and geom_arrow_gradient() bring gradient arrows to ordinary ggplot2 code.
  • Gradients need a graphics device that supports gradient fills (e.g., ragg, svg, or pdf).

See the new "Color gradients" sections in the segments, paths, Bézier, and arc/wedge articles.

Other new features

  • ob_style and ob_segment gain distort (e.g., "sinewave") and force_arrow; ob_path gains force_arrow.

S7 compatibility

  • Updated for compatibility with newer versions of S7. Thanks to @t-kalinowski (#9).

⚠️ Breaking changes

  • ob_segment now defaults to black when no color is specified or inherited (set color = NA explicitly to override).
  • The connect() color now comes from the from object rather than the to object.
  • ob_path@segment no longer carries arrowheads or fins; each segment keeps its own path's style.

Bug fixes

  • ob_latex() now calls xelatex correctly when TinyTeX is not installed, and runs in non-stop mode so a LaTeX error can't hang the R session.
  • round_probability() no longer errors on NA when digits is specified.

Requirements

  • R >= 4.4.0
  • ggarrow >= 0.2.0, farver >= 2.1.0, S7 >= 0.2.2

Full details: NEWS.md