Repository navigation
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
spaceargument oroptions(ggdiagram.gradient_space = ...). connect()now draws a gradient automatically when thefromandtoobjects have different colors.- New
geom_arrow_segment_gradient()andgeom_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_styleandob_segmentgaindistort(e.g.,"sinewave") andforce_arrow;ob_pathgainsforce_arrow.
S7 compatibility
- Updated for compatibility with newer versions of S7. Thanks to @t-kalinowski (#9).
⚠️ Breaking changes
ob_segmentnow defaults to black when no color is specified or inherited (setcolor = NAexplicitly to override).- The
connect()color now comes from thefromobject rather than thetoobject. ob_path@segmentno longer carries arrowheads or fins; each segment keeps its own path's style.
Bug fixes
ob_latex()now callsxelatexcorrectly 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 onNAwhendigitsis specified.
Requirements
- R >= 4.4.0
- ggarrow >= 0.2.0, farver >= 2.1.0, S7 >= 0.2.2
Full details: NEWS.md