ggdiagram 0.3.0 2026-10-12
New features
- Color gradients for arrows.
ob_segment,ob_path,ob_bezier, andob_arcgain agradientproperty: a vector of 2 or more colors (or a list of such vectors, one per object) that makes a smooth gradient from the arrow’s fins to its head. Gradients are drawn as grid gradient fills, so they require a graphics device that supports them (e.g., ragg, svg, or pdf). For paths, beziers, and arcs, the gradient follows a straight line from start to end, not the curve. - New functions
geom_arrow_segment_gradient()andgeom_arrow_gradient()apply the gradients in ordinary ggplot2 code (ggarrow does not accept gradient colors). The approach was inspired byggforce::geom_link()and its color gradients along segments, by Thomas Lin Pedersen, the author of ggforce. - Gradients are interpolated in the OKLab color space by default, which avoids the dull midpoints of RGB interpolation (e.g., blue to yellow no longer passes through gray). The gradient is sampled at many closely spaced stops, following the approach in Matt DesLauriers’ post Perceptually Smooth Multi-Color Linear Gradients. Use the
spaceargument of the gradient geoms, oroptions(ggdiagram.gradient_space = ...), to choose"oklab","oklch","lab","lch", or"rgb". -
connectnow uses a color gradient by default when thefromandtoobjects have different colors. An object’s color is itscolor, or itsfillifcolorisNA, or black if both areNA. If the two colors are identical, no gradient is used and the connector has that color. Specifyingcolor,gradient, or a style with a color overrides this behavior. -
ob_styleandob_segmentgaindistort(a ggarrow distortion, e.g.,"sinewave") andforce_arrow(draw the arrowhead even if the segment is too short).ob_pathgainsforce_arrow.
Changes in behavior
-
ob_segmentnow defaults to black when no color is specified (or inherited) unlesscolor = NAis set explicitly. Objects derived from segments, such as@midpoint(), therefore carrycolor = "black". - The
connectcolor now comes from thefromobject. Previously thetoobject’s color overrode it. -
ob_path@segmentno longer carries arrowheads or fins, and each segment keeps the style of its own path.
Documentation and internal changes
- New “Color gradients” sections in the segments, paths, Bézier, and arc/wedge articles.
- Reorganized source files: generics moved to
R/generics.Rand helper functions toR/helpers.R. - Minimum R version is now 4.4.0.
- Added copyright holder (
cph) role to the maintainer inDESCRIPTION.
ggdiagram 0.2.1 2026-06-12
- Fixed bug in
round_probabilityso thatNAdoes not throw an error when digits are specified.
ggdiagram 0.2.0 2026-05-04
CRAN release: 2026-05-23
- Better documentation of objects (used Posit Assistant to identify undocumented properties).
- More complete set of tests (used Posit Assistant to generate many of them)
-
ob_angleobjects (i.e.,degree,radian, andturn) gain an@uprightslot useful for preventing angled text from being upside down. -
ob_reuleauxandob_ngongain additional function slots similar to those ofob_circle. -
ob_segment,ob_bezier, andconnectcan set label positions with equal x and y coordinates via the@set_label_xand@set_label_yproperty functions. - Added
map2_obfunction to map over 2 ggdiagram objects - Added
rescalefunction to resize ggdiagram objects - Made
ob_intercepta special case ofob_ngon. - Breaking change: Renamed all instances of
@segmentsto@segmentfor the sake of consistency.
ggdiagram 0.1.3 2025-10-15
- 6 ggforce 0.5.0 or higher is now required
