{"id":14067259,"url":"https://github.com/terraref/traitvis-webapp","last_synced_at":"2026-01-16T10:14:25.161Z","repository":{"id":79202898,"uuid":"101220639","full_name":"terraref/traitvis-webapp","owner":"terraref","description":"Shiny application for visualizing trait data","archived":false,"fork":false,"pushed_at":"2022-04-06T18:30:44.000Z","size":239,"stargazers_count":2,"open_issues_count":11,"forks_count":4,"subscribers_count":32,"default_branch":"master","last_synced_at":"2024-12-04T07:36:59.532Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://traitvis.workbench.terraref.org/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terraref.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-23T20:09:37.000Z","updated_at":"2022-04-06T18:30:47.000Z","dependencies_parsed_at":"2023-04-19T13:55:18.832Z","dependency_job_id":null,"html_url":"https://github.com/terraref/traitvis-webapp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/terraref/traitvis-webapp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraref%2Ftraitvis-webapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraref%2Ftraitvis-webapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraref%2Ftraitvis-webapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraref%2Ftraitvis-webapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terraref","download_url":"https://codeload.github.com/terraref/traitvis-webapp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraref%2Ftraitvis-webapp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267785798,"owners_count":24144122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-13T07:05:30.546Z","updated_at":"2026-01-16T10:14:25.151Z","avatar_url":"https://github.com/terraref.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"## A Shiny web-app for visualizing trait data in BETYdb\n\nThis shiny application provides a visual summary of the available data in BETYdb. You can view time series box, line plots, and heatmaps available for every season. Descriptions of selected trait and methods of measurement are provided as well as instructions on how to download data.\n\n## Development\n\nA local development environment can be set up on your computer. In order to run this shiny application, you will need to download R, install required R packages, and download Docker. Docker will be used in creating a connection to a BETYdb database. \n\nYou will also need to create a globus account at [globus.org](https://www.globus.org/) and download [Globus Connect Personal](https://www.globus.org/globus-connect-personal). The `terraref` endpoint contains RGB fullfield image thumbnails that can be displayed in the map tab of the application.\n\nMore detailed information on required R packages, image thumbnails, how to set up a database connection, and how to get the shiny application running is described in the following sections.\n\n### Clone the repository\n\nClone the [terraref/traitvis](https://github.com/terraref/traitvis-webapp) repository:\n\n```sh\ngit clone https://github.com/terraref/traitvis-webapp.git\ncd traitvis-webapp\n```\n\n### Database connection\n\nThis application requires a connection to a BETYdb database. It requires a BETYdb database that uses the experiments table to associate time ranges and sites or plots with specific experiments or seasons.\n\nA connection to a local instance of BETYdb can be created by running the following Docker commands (you can ignore premission errors):\n\n```sh\ndocker-compose -p bety up  -d postgres\n\n# ignore lots of errors in the following step\ndocker run -ti --rm --network bety_bety -e BETY_INITIALIZE_URL='-w https://terraref.ncsa.illinois.edu/bety/dump/bety0/bety.tar.gz' pecan/bety:develop initialize\n\ndocker run -ti --rm --network bety_bety -e REMOTE_SERVERS=6  pecan/bety:terra sync\n```\n\nNote: In the docker-compose.override.yml file, `5433:5432` maps your computer's port 5433 to the Docker container's Postgres port 5432. If you would like to expose another port, change the first number in the pairing to whatever number you want. Just make sure to update the port number when setting the `bety_port` environment variable below.\n\n### R packages\n\nThis application depends on a number of R packages; this is how you can install them:\n\n```\ninstall.packages(c('shiny', 'shinythemes', 'scales', 'lubridate', 'dplyr', 'ggplot2', 'timevis', 'rgeos', 'leaflet', 'cronR', 'stringr', 'kableExtra', 'raster', 'mapview', 'leafem', 'sf'))\n```\n\n### Download image thumbnails\n\nFullfield image thumbnails are available to be displayed under heatmaps.\nThese thumbnails can be downloaded from the TERRAREF endpoint on [Globus](https://www.globus.org/), which you will need permission to access. If you have not already done so:\n\n2. send your globus user email to dlebauer@arizona.edu.\n3. install the [Globus connect personal](https://www.globus.org/globus-connect-personal) application and register your computer.\n4. Request access\n\nThe total size of the thumbnails is 2.3GB\n\nThen transfer the directory  `/ua-mac/Level_2/rgb_fullfield/_thumbs/` to the following path: `rgb_fullfield/_thumbs`. This location can be changed on in the file [render-site-map.R].\n\n### How to run Shiny Application\n\nThe `cache-refresh.R` script needs to be run and requires a database connection. To connect to the local instance of BETYdb that you set up above, you will need to set the following connection parameters as environment variables.\n\nIn your R console, run the following commands:\n\n```r\nSys.setenv(bety_host = 'localhost')\nSys.setenv(bety_port = '5433')\nsource('cache-refresh.R')\n```\n\nRunning the cache-refresh script should create a `cache` folder containing a `cache.RData` file.\n\nNext, start up the application by running:\n\n```r\nshiny::runApp()\n```\n\n## Deploy application using Docker\n\n```sh\ngit clone https://github.com/terraref/traitvis-webapp\ncd traitvis-webapp\n\ndocker build -t shiny-traits .\n## after deploying app, launch so it can be accessed by browser at localhost:3838\ndocker run --rm -t -i -p 3838:3838 shiny-traits\n```\n\nTo set one of the environment variables (see \"Setup and Notes\" section), you can use the `-e` flag, for example to connect to the TERRA REF trait database (bety6), run:\n\n```sh\ndocker run --rm -t -i -e bety_host=bety6 -p 3838:3838 shiny-traits\n```\n\nTo enter the container bash shell as root, e.g. for development, testing, reviewing logs:\n\n```sh\ndocker run --rm -t -i shiny-traits /bin/bash\n```\n\nThe shiny-server.conf file is used to increase the default timeout to avoid errors on initialization if BETYdb is taking time to load.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraref%2Ftraitvis-webapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterraref%2Ftraitvis-webapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraref%2Ftraitvis-webapp/lists"}