ggsunburstR 0.5.1
Error messages
- All error messages with variable interpolation now use
cli::cli_abort()for proper rendering. Affected functions:drilldown(),bars(),tile(),sunburst_multifill(),icicle_multifill(), and internal validators.
Code quality
- Extracted shared
.read_newick_safe()helper – eliminates duplicated Newick parsing logic betweenparse_newick()andnw_print(). -
compute_coordinates()now guards against all-zero leaf sizes with an informative error instead of silent division by zero. -
drilldown()params$drilldown_fromnow always stores the node name (previously stored mixed types depending on how node was specified). - Fixed 1-space indent in
drilldown.R. - Pinned
rangle(270)test to exact expected value.
Documentation
- Added
@seealsocross-references tosunburst(),icicle(). - Added
@detailstoggtree()documenting three layout modes. - Added bare name fill example to
sunburst()roxygen2 examples. - Added
label_repelexample toicicle()roxygen2 examples. - Added deprecation plan note for
fill = NULLinsunburst()andicicle()docs.
Testing
- Added 21 edge-case tests: single-leaf bars/tile, empty/malformed paths, duplicate paths, non-scalar data.tree fields, deep tree (20 levels), xlim < 360 labels, tibble input, duplicate tip labels, all-zero values, print output content, fill=“auto” equivalence, invalid fill expression.
- 625 tests total, R CMD check 0/0/0.
ggsunburstR 0.5.0
ggplot2 geom
-
geom_sunburst()provides idiomatic ggplot2 syntax:ggplot(df) + geom_sunburst(aes(id = child, parent = parent)). Uses a customStatSunburstggproto to convert parent-child data.frames into sunburst coordinates. Addcoord_polar()for sunburst layout or leave Cartesian for icicle. Supportsvalues,branchvalues, andleaf_modeparameters.
New theme
-
theme_sunburst()provides a tailored theme for sunburst and donut charts: centred bold title, bottom legend, tidy margins. Based ontheme_void().
Fill improvements
-
fill = "auto"maps fill to thedepthcolumn insunburst(),icicle(), anddonut(). -
fill = "none"explicitly produces static grey (escape hatch for when the default eventually changes to"auto"in a future version). - Bare name support:
sunburst(sb, fill = depth)now works alongside the existingfill = "depth"string syntax.
ggsunburstR 0.4.0
Label enhancements
-
sunburst()gainslabel_type = "perpendicular"for arc-following labels that use pre-computedpangle/pvjustvalues and position text at the radial midpoint. -
sunburst()andicicle()gainshow_node_labelsfor internal node labels,label_sizefor controlling text size, andmin_label_anglefor filtering labels on narrow sectors. -
icicle()gainslabel_repel = TRUEforggrepel-based collision avoidance. Requires theggrepelpackage (Suggests). Polar repulsion for sunbursts is deferred – usemin_label_angleinstead.
New functions
-
sunburst_multifill()andicicle_multifill()create plots with per-depth fill colour scales usingggnewscale::new_scale_fill(). Depths not listed infillsare rendered with static grey.
Data improvements
-
sunburst_data()now includesymin,ymax, anddelta_anglecolumns in the$leaf_labelsdata.frame, enabling perpendicular label positioning and angular filtering.
ggsunburstR 0.3.0
New functions
-
drilldown()extracts a subtree and recomputes coordinates so the selected node fills the full angular space. Returns a newsunburst_dataobject compatible with all plot functions. Supports chaining. -
bars()adds bar chart annotations adjacent to leaf nodes. Values are max-normalised per variable. Supports multiple variables, labels, and value display. -
tile()adds heatmap-style tile annotations adjacent to leaf nodes. Works with both numeric and categorical variables.
ggsunburstR 0.2.0
New input formats
- Accept
ape::phyloobjects directly – no Newick conversion needed (sunburst_data(phylo_obj)). - Path-delimited strings –
sunburst_data(c("A/B/C", "A/B/D"))with configurable separator viasep. - Path-column data.frames –
sunburst_data(data.frame(path = ...))with extra columns carried as node attributes. -
data.tree::Nodeobjects – R6-based trees with custom scalar fields preserved as attributes.
New functions
-
highlight_nodes()adds a highlight layer to sunburst/icicle plots for specific nodes by name or ID. -
nw_print()prints tree structure from Newick input for inspection.
ggsunburstR 0.1.0
Initial release.
Features
-
sunburst_data()parses hierarchical data from 4 input formats: Newick strings/files, data.frames with parent-child columns, lineage files, and node-parent CSV/TSV files. -
sunburst()creates polar sunburst plots withcoord_polar(). -
icicle()creates rectangular icicle plots withscale_y_reverse(). - Value-weighted sectors via the
valuesparameter. - Label support with pre-computed positions and flip logic for readability.
- Tree transforms:
ladderizeandultrametricoptions. - S3 class
sunburst_datawithprint(),plot(),as.data.frame(), and$dataalias. - Standard ggplot2 objects – customise with
+. - 342 tests, R CMD check clean.
