sdbuildR v2.2.0
sdbuildR 2.2.0 focuses on clearer stock-and-flow diagrams, interactive plots, and more customizable visualisations. Most of the changes are meant to make models easier to inspect and use in teaching.
Highlights
Clearer stock-flow diagrams
plot.stockflow() is now more useful for reading models at a glance.
- Equations can be shown directly in node labels and hover tooltips.
- Equation labels now match the variable type: stocks show initial values, flows show rates, constants show values, and auxiliaries show equations.
- Diagram layout controls are more flexible, including direction, alignment, ordering, spacing, margins, flow length, dependency arrows, fonts, and colours.
More interactive plots
Simulation, ensemble, and verification plots are easier to explore and share.
- Time animations are now available for simulation, ensemble, and verification results.
- Animation speed and smoothness can be tuned with
control_options. - Ensemble and verification plots can use sliders or dropdowns to browse conditions one at a time.
- Interactive condition controls work in exported HTML documents, including pkgdown articles and Quarto slides.
Leaner ensemble summaries
ensemble() now lets you choose which summary statistics to compute, using the same central and spread vocabulary used by the plotting methods.
- Pick the central tendencies you want, such as mean, median, or none.
- Pick the spread statistics you want, such as quantiles, standard deviations, ranges, or none.
- Keep output smaller when you do not need every summary column.
A more robust Julia backend
The Julia integration should now be less fragile across package and Julia updates.
- The sdbuildR Julia environment now lives in a persistent user data directory, so it survives reinstallations of sdbuildR.
- sdbuildR detects when the environment was built with a different Julia version and prompts for a rebuild.
- Julia setup messages are clearer, especially when installation is interrupted.
- Julia simulations now respect seeds set through
sim_settings().
Smoother model output workflows
Several smaller changes make model results easier to work with.
- Data-frame methods for simulation, ensemble, and verification results can subset by variable and variable type.
- Model print methods show saved variables more clearly.
- The
ricker()function is now available. - The plotting grammar for colours, line widths, and transparency is more flexible.
Breaking changes to note
Plotting argument names
Several plot.stockflow() arguments were renamed for clarity.
- Use
flow_lengthinstead ofminlen. - Use
spacinginstead ofnodesep. - Use
margininstead ofpad. - Use
color_dependencyinstead ofdependency_col. - Use
font_colorinstead oflabel_col. - Use the more general
colorsargument instead ofstock_colandflow_col.
Simulation timing settings
In sim_settings(), output timing settings have new names.
- Use
save_by,save_times, andsave_lengthinstead of the oldersave_atandsave_narguments.
Ensemble plot styling
Ensemble plot styling now follows the newer central, spread, line_width, and alpha approach.
- Older central-tendency arguments have been replaced by
centralandspread. - Line width and transparency settings now use the richer
line_widthandalphagrammar.
Fonts and messages
Two defaults changed or are being phased out.
- The default diagram font changed from
"Times New Roman"to"stix-two-text". Setoptions(sdbuildR.font_family = "Times New Roman")to restore the previous look. ensemble(verbose = )is deprecated. Usequietfor message control, which is now handled consistently acrossensemble(),simulate(),use_julia(), andinstall_julia_env().