| Title: | Shiny Apps for Visualizing 'SpaDES' Simulation Outputs |
|---|---|
| Description: | Tools to build 'shiny' applications for exploring outputs from 'SpaDES' (Spatial Discrete Event Simulation) projects. Includes 'shine()', an interactive viewer that recursively discovers raster ('.tif') and image ('.png') outputs, groups time-series of the same object, and presents them on web maps (with difference layers) and as figures. |
| Authors: | Eliot J B McIntire [aut, cre] (ORCID: <https://orcid.org/0000-0002-6914-8316>) |
| Maintainer: | Eliot J B McIntire <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-06-12 21:50:28 UTC |
| Source: | https://github.com/PredictiveEcology/SpaDES.shiny |
Recursively scans a folder for raster (.tif) and image (.png) outputs,
groups files that share a base name but differ by an embedded timestamp into
time-series "objects", and launches a Shiny app to explore them. Maps (.tif)
are drawn on a chooseable web basemap; figures (.png) are shown as images.
Two further tabs show precomputed (last - first) and user-defined differences
between map snapshots.
shine( x, timePattern = "[0-9]+", maxCells = NULL, interval = 2, opacity = 1, launch = TRUE, ... )shine( x, timePattern = "[0-9]+", maxCells = NULL, interval = 2, opacity = 1, launch = TRUE, ... )
x |
What to visualize, resolved to a folder to scan recursively:
a |
timePattern |
Regex matching the timestamp token in a file name. The
last match in the (extension-stripped) base name is used as the numeric
time. Default |
maxCells |
Optional cap on pixels per side; if set, rasters larger than
this are aggregated down before rendering. Default |
interval |
Initial seconds between automatic time-slider steps; also the
starting value of the in-app "seconds per step" slider. Default |
opacity |
Opacity of the raster layers (NoData stays transparent so the
basemap shows through). Default |
launch |
If |
... |
Passed to |
Rasters are rendered with leafem::addGeotiff(), which draws them through the
tiled georaster-layer-for-leaflet canvas layer: pan/zoom redraw per-tile on
the client at native resolution (fast, no server round-trip per interaction).
Each raster is reprojected once to a web-mercator Cloud-Optimized GeoTIFF (with
overviews), cached on disk, and served same-origin via shiny::addResourcePath().
Multi-band rasters contribute one object per band. Files whose name contains no digit run are treated as static (always-shown) layers with no position on the time slider.
Invisibly, the shinyApp object (also when launch = TRUE).
## Not run: shine("outputs") # a path shine(mySim) # a simList -> uses outputPath(mySim) shine() # uses getOption("spades.outputPath") ## End(Not run)## Not run: shine("outputs") # a path shine(mySim) # a simList -> uses outputPath(mySim) shine() # uses getOption("spades.outputPath") ## End(Not run)