Skip to content

Commit

Permalink
sdmverse 0.1.0.9022: app update with M. Noblis suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainschmitt committed Oct 1, 2024
1 parent 21e617c commit d3dce0e
Show file tree
Hide file tree
Showing 12 changed files with 103 additions and 24 deletions.
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Encoding: UTF-8
LazyData: true
Depends:
R (>= 4.0)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Imports:
igraph,
factoextra,
Expand All @@ -31,7 +31,9 @@ Imports:
tidyr,
stringr,
tools,
ggplot2
ggplot2,
shinycssloaders,
shinydashboard
Collate:
'utils-pipe.R'
'list_packages.R'
Expand Down
4 changes: 3 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export(plot_table)
export(prep_table)
export(template_from_cran)
import(igraph)
import(shiny)
import(shinycssloaders)
import(shinydashboard)
importFrom(DT,dataTableOutput)
importFrom(DT,renderDataTable)
importFrom(dplyr,bind_rows)
Expand All @@ -31,7 +34,6 @@ importFrom(ggplot2,theme)
importFrom(ggplot2,theme_bw)
importFrom(gh,gh)
importFrom(magrittr,"%>%")
importFrom(shiny,runApp)
importFrom(stats,as.dist)
importFrom(stats,dist)
importFrom(stats,hclust)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
sdmverse 0.1.0.9022

- app update with M. Noblis suggestions

sdmverse 0.1.0.9021

- app update
Expand Down
4 changes: 3 additions & 1 deletion R/launch_app.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#' @include utils-pipe.R
#' @importFrom shiny runApp
#' @import shiny
#' @import shinycssloaders
#' @import shinydashboard
#' @importFrom DT renderDataTable dataTableOutput
NULL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ account: sylvainschmitt
server: shinyapps.io
hostUrl: https://api.shinyapps.io/v1
appId: 8255748
bundleId: 9000227
bundleId: 9038005
url: https://sylvainschmitt.shinyapps.io/smdverse/
65 changes: 54 additions & 11 deletions inst/app/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,62 @@ shinyServer(function(input, output) {
manuscript_doi, "</a>"
)) %>%
datatable(
escape = FALSE, class = "cell-border stripe",
filter = "top", rownames = FALSE,
extensions = "FixedColumns",
escape = FALSE,
class = "cell-border stripe",
filter = "top",
rownames = FALSE,
selection = "none",
extensions = c("FixedColumns", "FixedHeader"),
options = list(
paging = TRUE,
pageLength = nrow(packages),
dom = '<"top"firBp>t<"bottom">',
language = list(
info = "Showing _TOTAL_ packages", # _START_ to _END_ of
infoFiltered = " (filtered from _MAX_ packages)"
),
paging = FALSE,
autoWidth = TRUE,
columnDefs = list(list(targets = 1, width = "400px")),
searching = TRUE,
fixedColumns = list(leftColumns = 1)
)
scrollX = TRUE,
scrollY = input$dimension[2] - 290,
fixedHeader = TRUE,
fixedColumns = list(leftColumns = 1, rightColumns = 0),
scrollCollapse = TRUE,
deferRender = TRUE
),
callback = JS("var tips = [
'name',
'title - info',
'version - info',
'maintainer - info',
'occ_acquisition - info',
'occ_cleaning - info',
'data_integration - info',
'env_collinearity - info',
'env_process - info',
'bias - info',
'study_region - info',
'backg_sample - info',
'data_partitioning - info',
'mod_fit - info',
'mod_tuning - info',
'mod_ensemble - info',
'mod_stack - info',
'mod_evaluate - info',
'mod_multispecies - info',
'mod_mechanistic - info',
'pred_general - info',
'pred_extrapolation - info',
'pred_inspect - info',
'post_processing - info',
'gui - info',
'metadata - info',
'manuscript_doi - info'
],
header = table.columns().header();
for (var i = 0; i < tips.length; i++) {
$(header[i]).attr('title', tips[i]);
}")
) %>%
formatStyle(colnames(select_if(packages, is.logical)),
backgroundColor = styleEqual(
Expand All @@ -48,13 +95,9 @@ shinyServer(function(input, output) {
)
)
})

# output
output$table <- DT::renderDataTable(
{
tab()
},
escape = FALSE,
server = TRUE
)
})
33 changes: 29 additions & 4 deletions inst/app/ui.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
library(shinycssloaders)
library(shinydashboard)
options(spinner.color = "#0275D8", spinner.color.background = "#ffffff")
shinyUI(fluidPage(
headerPanel("sdmverse: A Meta-Package For Harnessing The Growing Diversity Of
Species Distribution Modeling Packages"),
mainPanel(
DT::dataTableOutput("table")
align = "left",
tags$head(tags$script('
var dimension = [0, 0];
$(document).on("shiny:connected", function(e) {
dimension[0] = window.innerWidth;
dimension[1] = window.innerHeight;
Shiny.setInputValue("dimension", dimension);
});
$(window).resize(function(e) {
dimension[0] = window.innerWidth;
dimension[1] = window.innerHeight;
Shiny.setInputValue("dimension", dimension);
});
')),
box(
width = 12,
HTML("<h3><b><a href='https://github.com/sylvainschmitt/sdmverse'
target='_blank'>sdmverse</a></b></h3><i><h5><nobr>A
Meta-Package For Harnessing The Growing Diversity Of
Species Distribution Modeling Packages</nobr></h5></i>")
),
box(
width = 12,
tags$style(HTML(".dataTables_wrapper .dataTables_filter {float: left;")),
withSpinner(DT::dataTableOutput("table"), type = 1),
br()
)
))
2 changes: 1 addition & 1 deletion inst/extdata/packages/occCite.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name : occCite
title: "Querying and Managing Large Biodiversity Occurrence Datasets"
version: 0.5.7
version: 0.5.8
author: "Hannah L. Owens, Cory Merow, Brian Maitner, Jamie M. Kass, Vijay Barve, Robert P. Guralnick, Damiano Oldoni for rOpenSci, see)"
maintainer: "Hannah L. Owens <[email protected]>"
cran: yes
Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/packages/rgbif.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: rgbif
title: Interface to the Global Biodiversity Information Facility API
version: 3.8.0
version: 3.8.1
author: Scott Chamberlain, Damiano Oldoni, Vijay Barve, Peter Desmet, Laurens Geffert,
Dan Mcglinn, Karthik Ram, rOpenSci, John Waller
maintainer: John Waller <[email protected]>
Expand Down
Binary file modified inst/img/pkgs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion man/list_packages.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/sdmverse.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d3dce0e

Please sign in to comment.