Changelog
dashboardr (development version)
Unified Stacked Bar Chart Function
viz_stackedbar() is now a unified function that supports two modes:
Mode 1: Grouped/Crosstab (use x_var + stack_var)
# Show how one variable breaks down by another
viz_stackedbar(data, x_var = "education", stack_var = "gender")Mode 2: Multi-Variable/Battery (use x_vars)
# Compare multiple survey questions side-by-side
viz_stackedbar(data, x_vars = c("q1", "q2", "q3"))This eliminates confusion between viz_stackedbar() and viz_stackedbars() - you now only need to remember one function! The function automatically detects which mode to use based on the parameters you provide.
Migration from viz_stackedbars(): Simply change the function name - all parameters work the same way:
# Old way (still works, shows deprecation notice)
viz_stackedbars(data, x_vars = c("q1", "q2", "q3"))
# New preferred way
viz_stackedbar(data, x_vars = c("q1", "q2", "q3"))The viz_stackedbars() function is soft-deprecated and will continue to work, but we recommend using viz_stackedbar() for all new code.
Breaking Changes
Visualization Function Renaming
All create_* visualization functions have been renamed to viz_* for clarity and to distinguish them from dashboard-level creation functions:
The old function names are deprecated and will show a warning when used. They will be removed in a future version.
Migration: Simply replace create_ with viz_ in your code.
Timeline Parameter Renaming
Timeline chart parameters have been renamed for consistency with other visualization types:
| Old Name | New Name |
|---|---|
response_var |
y_var |
response_filter |
y_filter |
response_filter_combine |
y_filter_combine |
response_filter_label |
y_filter_label |
response_levels |
y_levels |
response_breaks |
y_breaks |
response_bin_labels |
y_bin_labels |
New Features
Error Bars Support in Bar Charts
viz_bar() now supports error bars for displaying uncertainty in mean values:
- New
value_varparameter: When provided, bars show the mean of this variable per category (instead of counts) - New
error_barsparameter: Choose from βnoneβ (default), βsdβ (standard deviation), βseβ (standard error), or βciβ (confidence interval) - New
ci_levelparameter: Set confidence level for CI (default 0.95 for 95% CI) - Customizable appearance via
error_bar_coloranderror_bar_widthparameters - Works with both simple and grouped bar charts
Example usage:
Early Validation for Visualizations
-
preview()now automatically validates all visualization specs before rendering, catching missing required parameters (likestack_varfor stacked bar charts) and invalid column names early with helpful error messages - New
validate_specs()function for manual validation of content collections -
print(collection, check = TRUE)validates specs while viewing the structure
New Visualization Types
-
viz_density(): Create kernel density estimate plots for visualizing continuous distributions. Supports grouped densities, adjustable bandwidth, rug marks, and weighted estimation. -
viz_boxplot(): Create interactive box-and-whisker plots. Supports grouped boxplots, horizontal orientation, outlier display, and weighted percentiles.
Histogram Improvements
- Fixed handling of character-numeric values (e.g., β25β, β30β) - now correctly converted to numeric for binning
- Improved default bin labels to show readable ranges (e.g., β18-29β instead of β[18,30)β)
- Added
data_labels_enabledparameter to control display of value labels on bars
Data Labels Control
- Added
data_labels_enabledparameter toviz_histogram(),viz_bar(),viz_stackedbar(), andviz_stackedbars()- allows hiding value labels on bars for cleaner visualizations - Renamed
show_labelstodata_labels_enabledinviz_treemap()for consistency (old parameter still works with deprecation warning) -
viz_heatmap()already haddata_labels_enabled- now all viz functions use the same parameter name
Documentation
- Added new visualization vignettes:
density_vignette,boxplot_vignette,histogram_vignette,scatter_vignette,treemap_vignette,map_vignette - Interactive inputs demo and documentation in
vignette("advanced-features") - Improved cross-references between vignettes
Bug Fixes
- Fixed Unicode/emoji rendering issues in console output
- Fixed nested tabgroup rendering in
preview() - Fixed parameter mapping for
stackedbarsvisualization type