Code Monkey home page Code Monkey logo

gwsdat's Introduction

GWSDAT

This is the R Shiny application of the GroundWater Spatiotemporal Data Analysis Tool (GWSDAT) for the analysis of groundwater monitoring data. This package can be run locally or can be deployed on a Shiny Server. For more background see http://www.gwsdat.net.

Install and Run

For latest development version, install from github using the devtools R package:

devtools::install_github("WayneGitShell/GWSDAT")
options(shiny.useragg = FALSE) #to avoid artefacts in spatial plots
GWSDAT::launchApp()

Or install from CRAN:

install.packages("GWSDAT")
options(shiny.useragg = FALSE) #to avoid artefacts in spatial plots
GWSDAT::launchApp()

A couple of example data sets are already pre-loaded. See full options for interactive data input in section 6.1 of the GWSDAT user manual: http://www.gwsdat.net/gwsdat_manual

Data input directly from R.

Install the package as above and pass a GWSDAT_Options list to launchApp(). The method GWSDAT::createOptions() creates this GWSDAT_Options list. The GWSDAT_Options list must either contain the WellData and WellCoords data.frames:

library(GWSDAT)
# Define GWSDAT_Options
opt <- createOptions("Site Name")
opt$WellData <- read.csv(system.file("extdata","ComprehensiveExample_WellData.csv",package="GWSDAT"))
opt$WellCoords <- read.csv(system.file("extdata","ComprehensiveExample_WellCoords.csv",package="GWSDAT"))
launchApp(opt)

or the location of input csv files WellDataFilename and WellCoordsFilename.

library("GWSDAT")
# Define GWSDAT_Options
GWSDAT_Options <- createOptions("Example Site")
GWSDAT_Options$WellDataFilename <- system.file("extdata","BasicExample_WellData.csv",package="GWSDAT")
GWSDAT_Options$WellCoordsFilename <- system.file("extdata","BasicExample_WellCoords.csv",package="GWSDAT")
launchApp(GWSDAT_Options)

Save & Load Session File

Inside the Shiny app, a data analysis session can be saved inside the Analysis panel, in the top navigation bar under More -> Save Session. This creates a .rds file that can be loaded with the launchApp() method:

GWSDAT::launchApp(session_file = "path_to_file.rds")

Deploy on Posit Connect

Create the file app.R with the following content and publish to Posit Connect server in the usual manner:

library("GWSDAT")
launchApp()

Beta: Deploy as API on Posit Connect

Create the file app.R with the following content and publish to Posit Connect server in the usual manner:

library("GWSDAT")
launchApp(createOptions())

GWSDAT input arguments can be included in the URL. This example here passes the location of the csv well and well coordinates data. This example here passes the location of an Excel GWSDAT Input data file. This functionality is still in development.

gwsdat's People

Contributors

andrejadd avatar craigalexander avatar csgillespie avatar waynegitshell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gwsdat's Issues

Get rid of TclTK panel (rp.control) for Shiny, but not Stand-Alone.

The function rp.control() creates the panel variable and a TK window. This is the basic call to create the TclTK window panel:

panel = rp.control(title = "", size = c(100, 100), panelname, background, ...)

Right now all the drawing related variables (DRV) are passed directly to this function (in the "..." part).
For Shiny I would not need rp.control. Instead only an object that holds all DRV, e.g.

DRV$Cont.Data
DRV$Well
etc.

To make it combatible with Stand-Alone I could pass this 'DRV' object to rp.control():

# Stand-Alone (TclTK)
panel = rp.control(title = "", size = c(100, 100), panelname, background, DRV)
# panel$DRV to access drawing stuff

and with Shiny I could just assign it directly to panel.

# Shiny
panel = 0
panel$DRV = DRV

Display Spatial Contour Plot inside Shiny.

Needs adaptions to the panel variables, similar to the smooth time-series plot.

Think:

Which variables are shared and can go outside the plot function call, e.g. the 'DRV' variables?

Ommit plot() execution in GWSDAT_INIT().

These plots() are done while fitting. This is not necessary.

As long as GWSDAT_INIT() is not called inside a renderPlot() function, this isn't a problem, but still it is unnecessary overhead that might lead to problems on the server side.

Add 'Data Aggregate' List box. Change Time Steps accordingly.

This requires to recall the aggregate data code located inside "GWSDAT Input Data.R".

Parse the code for the bits used for aggregation and make separate function that is called in the beginning (Init) and whenever the 'Data Aggregate' List box changes.

What is needed to run MakeSmoothPlot() on its own.

Right now it fails, the 'panel' object misses data (shadow.jjj, e.g.).

  1. When the smooth panel in the main window is created it uses GWSDATpnl.
  2. When this panel is ckicked it uses click.makeSmoothPanel(panel)

However, panel != GWSDATpnl.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.