Skip to content

Commit

Permalink
Merge pull request #317 from 4DModeller/Iss315/fix_model_viewer
Browse files Browse the repository at this point in the history
`model_viewer` random effect-only model support
  • Loading branch information
mnky9800n authored May 15, 2024
2 parents 1280863 + d1e00e6 commit 27322e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fixed `model_viewer` app to work with random effect models - [PR #317](https://github.com/4DModeller/fdmr/pull/317)
- Updated `plot_map_leaflet` to feature the same selection of basemap tiles as `mapview` and fix features not appearing - [PR #310](https://github.com/4DModeller/fdmr/pull/310)

## [0.2.0] - 2023-12-19
Expand Down
7 changes: 6 additions & 1 deletion R/shiny_modelviewer.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ model_viewer_shiny <- function(model_output, mesh, measurement_data, data_distri
default_colours <- rownames(brewer_palettes[brewer_palettes$cat == "seq", ])

plot_choices <- c("Range", "Stdev", "AR(1)", "Boxplot", "Density", "DIC")
if (base::is.null(parsed_model_output[["fixed_mean"]])) {
map_choices <- c("Random effect fields")
} else {
map_choices <- c("Predicted mean fields", "Random effect fields")
}

ui <- bslib::page_fluid(
theme = bslib::bs_theme(bootswatch = "cosmo"),
Expand All @@ -56,7 +61,7 @@ model_viewer_shiny <- function(model_output, mesh, measurement_data, data_distri
shiny::fluidRow(
shiny::column(
4,
shiny::selectInput(inputId = "map_plot_type", label = "Plot type", choices = c("Predicted mean fields", "Random effect fields"), selected = "Predicted mean fields"),
shiny::selectInput(inputId = "map_plot_type", label = "Plot type", choices = map_choices, selected = map_choices[1]),
shiny::selectInput(inputId = "map_data_type", label = "Data type", choices = c("Poisson", "Gaussian"), selected = data_distribution),
),
shiny::column(
Expand Down

0 comments on commit 27322e0

Please sign in to comment.