{"id":13857276,"url":"https://github.com/ucdavisdatalab/workshop_web_maps","last_synced_at":"2026-03-05T14:13:06.609Z","repository":{"id":117059693,"uuid":"417314160","full_name":"ucdavisdatalab/workshop_web_maps","owner":"ucdavisdatalab","description":"Learn to build an interactive web map to display spatial data","archived":false,"fork":false,"pushed_at":"2023-04-28T23:57:53.000Z","size":5719,"stargazers_count":6,"open_issues_count":6,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-08-06T03:03:25.149Z","etag":null,"topics":["data-science","geospatial-visualization","teaching-materials","ucdavis","ucdavis-datalab","workshop"],"latest_commit_sha":null,"homepage":"https://ucdavisdatalab.github.io/workshop_web_maps/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ucdavisdatalab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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}},"created_at":"2021-10-14T23:47:13.000Z","updated_at":"2023-05-02T22:43:30.000Z","dependencies_parsed_at":"2024-02-09T01:56:25.469Z","dependency_job_id":null,"html_url":"https://github.com/ucdavisdatalab/workshop_web_maps","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucdavisdatalab%2Fworkshop_web_maps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucdavisdatalab%2Fworkshop_web_maps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucdavisdatalab%2Fworkshop_web_maps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucdavisdatalab%2Fworkshop_web_maps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ucdavisdatalab","download_url":"https://codeload.github.com/ucdavisdatalab/workshop_web_maps/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225920254,"owners_count":17545459,"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","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":["data-science","geospatial-visualization","teaching-materials","ucdavis","ucdavis-datalab","workshop"],"created_at":"2024-08-05T03:01:32.205Z","updated_at":"2026-03-05T14:13:06.554Z","avatar_url":"https://github.com/ucdavisdatalab.png","language":"HTML","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"# Workshop: Building Web Maps with Leaflet\n\n_[UC Davis DataLab](https://datalab.ucdavis.edu/)_  \n_Winter 2022_  \n_Instructor: Michele Tobias \u003c\u003cmmtobias@ucdavis.edu\u003e\u003e_  \n\n* [Reader](https://ucdavisdatalab.github.io/workshop_web_maps/)\n* [Event Page](https://datalab.ucdavis.edu/eventscalendar/)\n\n# Description\nIn this workshop, attendees will be introduced to building an interactive web map to display spatial data using the Leaflet javascript library.\n\n## Learning Objectives\nIn this workshop, attendees will learn\n\n* Introductory HTML skills, in particular, the tags that are most commonly used to format text on a webpage\n* How to load javascript libraries into a web page\n* An introduction to the Leaflet javascript library\n* Where to get additional help with HTML and Leaflet\n* Best practices for communicating data distributions with a web map\n\n## Skills\nIn this workshop, participants will be introduced to the following skills:\n\n* HTML\n* Javascript\n* Leaflet Javascript Library\n\n## Prerequisites\nLearners should have a basic understanding of spatial data formats such as vector and raster data, as well as experience with any coding language.  Learners with previous experience with coding in HTML and javascript will have an easier time learning, but these skills are not required.\n\n# Template: Workshop Reader\n\nThis repository is a template for workshop readers for the UC Davis DataLab.\nThis template uses **bookdown** to knit the reader. You can also optionally use\n**renv** to manage packages and Git Large File Storage to manage large files\n(instructions included).\n\nTo get started, create a new repo on GitHub from this template\n([instructions][gh]), then `git clone` your new repo.\n\n[gh]: https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template\n\nOnce you've cloned the repo, here's a checklist of things to do to prepare the\nrepo:\n\n1. **renv** (optional): To set up **renv**, open R at the top level of the repo\n   and run:\n\n    ```r\n    renv::init()\n    ```\n\n    Restart R. Then, to install the **bookdown** toolchain to the project\n    package library, run:\n\n    ```r\n    install.packages(\"bookdown\")\n    renv::snapshot()\n    ```\n\n    You can skip this step if you're not going to use **renv**.\n\n2. `index.Rmd`: Replace the all-caps text with your workshop details.\n    + Title (in 2 places, 1 of them in the `output:` HTML block)\n    + Author's name\n    + Repo name (in 4 places, 2 of them in the `output:` HTML block)\n    + Description, learning goals, \u0026 prerequisites\n\n3. `README.md`: Replace the all-caps text with your workshop details.\n    + Title\n    + Quarter \u0026 year\n    + Author's name \u0026 email\n    + Reader URL\n    + Event URL\n    + Description, learning goals, \u0026 prerequisites\n\n4. GitHub: In the repo's About section, add the reader URL and appropriate\n   tags.\n\n5. GitHub: In the repo's Settings page, enable GitHub pages. Set the branch to\n   `master` and the directory to `docs/`.\n\n6. `README.md`: Remove these template instructions, which end at the `#\n   Workshop:` header below\n\n7. `git add` all changed files, then `git commit` and `git push`.\n\n\n\n\n\n## Contributing\n\nThe course reader is a live webpage, hosted through GitHub, where you can enter\ncurriculum content and post it to a public-facing site for learners.\n\nTo make alterations to the reader:\n\n1.  Run `git pull`, or if it's your first time contributing, see\n    [Setup](#setup).\n\n2.  Edit an existing chapter file or create a new one. Chapter files are R\n    Markdown files (`.Rmd`) at the top level of the repo. Enter your text,\n    code, and other information directly into the file. Make sure your file:\n\n    - Follows the naming scheme `##_topic-of-chapter.Rmd` (the only exception\n      is `index.Rmd`, which contains the reader's front page).\n    - Begins with a first-level header (like `# This`). This will be the title\n      of your chapter. Subsequent section headers should be second-level\n      headers (like `## This`) or below.\n    - Uses caching for resource-intensive code (see [Caching](#caching)).\n\n    Put any supporting resources in `data/` or `img/`. For large files, see\n    [Large Files](#large-files). You do not need to\n    add resources generated by your R code (such as plots). The knit step saves\n    these in `docs/` automatically.\n\n3.  Run `knit.R` to regenerate the HTML files in the `docs/`. You can do this\n    in the shell with `./knit.R` or in R with `source(\"knit.R\")`.\n\n4.  Run `renv::snapshot()` in an R session at the top level of the repo to\n    automatically add any packages your code uses to the project package\n    library.\n\n5.  When you're finished, `git add`:\n    - Any files you added or edited directly, including in `data/` and `img/`\n    - `docs/` (all of it)\n    - `_bookdown_files/` (contains the **knitr** cache)\n    * `renv.lock` (contains the **renv** package list)\n    - `.gitattributes` (contains the Git LFS file list)\n\n    Then `git commit` and `git push`. The live web page will update\n    automatically after 1-10 minutes.\n\n\n### Caching\n\nIf one of your code chunks takes a lot of time or memory to run, consider\ncaching the result, so the chunk won't run every time someone knits the\nreader. To cache a code chunk, add `cache=TRUE` in the chunk header. It's\nbest practice to label cached chunks, like so:\n\n````\n```{r YOUR_CHUNK_NAME, cache=TRUE}\n# Your code...\n```\n````\n\nCached files are stored in the `_bookdown_files/` directory. If you ever want\nto clear the cache, you can delete this directory (or its subdirectories).\nThe cache will be rebuilt the next time you knit the reader.\n\nBeware that caching doesn't work with some packages, especially packages that\nuse external libraries. Because of this, it's best to leave caching off for\ncode chunks that are not resource-intensive.\n\n\n### Large Files\n\nIf you want to include a large file (say over 1 MB), you should use git LFS.\nYou can register a large file with git LFS with the shell command:\n\n```sh\ngit lfs track YOUR_FILE\n```\n\nThis command updates the `.gitattributes` file at the top level of the repo. To\nmake sure the change is saved, you also need to run:\n\n```sh\ngit add .gitattributes\n```\n\nNow that your large is registered with git LFS, you can add, commit, and push\nthe file with git the same way you would any other file, and git LFS will\nautomatically intercede as needed.\n\nGitHub provides 1 GB of storage and 1 GB of monthly bandwidth free per repo for\nlarge files. If your large file is more than 50 MB, check with the other\ncontributors before adding it.\n\n### Github Actions\n\nGitHub Actions can be set up to automatically render your reader when you push \nnew content to a repo. If you would like to use this function, download the \nmaterials in [datalab-dev/utilities/render_bookdown_site][render-site] and \nfollow the instructions there.\n\n[render-site]: https://github.com/datalab-dev/utilities/tree/main/render_bookdown_site\n\n## Setup\n\n\n### Git LFS\n\nThis repo uses [Git Large File Storage][git-lfs] (git LFS) for large files. If\nyou don't have git LFS installed, [download it][git-lfs] and run the installer.\nThen in the shell (in any directory), run:\n\n```sh\ngit lfs install\n```\n\nThen your one-time setup of git LFS is done. Next, clone this repo with `git\nclone`. The large files will be downloaded automatically with the rest of the\nrepo.\n\n[git-lfs]: https://git-lfs.github.com/\n\n\n### R Packages\n\nThis repo uses [**renv**](https://rstudio.github.io/renv/) for package\nmanagement. Install **renv** according to the installation instructions on\ntheir website.\n\nThen open an R session at the top level of the repo and run:\n\n```r\nrenv::restore()\n```\n\nThis will download and install the correct versions of all the required\npackages to **renv**'s package library. This is separate from your global R\npackage library and will not interfere with other versions of packages you have\ninstalled.\n\n[Back to Top](#top)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucdavisdatalab%2Fworkshop_web_maps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fucdavisdatalab%2Fworkshop_web_maps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucdavisdatalab%2Fworkshop_web_maps/lists"}