{"id":13572761,"url":"https://github.com/r-spatial/leafpop","last_synced_at":"2025-04-04T11:30:38.463Z","repository":{"id":49213577,"uuid":"179740827","full_name":"r-spatial/leafpop","owner":"r-spatial","description":"Include Tables, Images and Graphs in Leaflet Popups","archived":false,"fork":false,"pushed_at":"2024-09-30T15:37:11.000Z","size":1907,"stargazers_count":114,"open_issues_count":10,"forks_count":14,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-31T15:24:53.279Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","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/r-spatial.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-04-05T19:14:17.000Z","updated_at":"2024-12-03T17:58:10.000Z","dependencies_parsed_at":"2024-11-05T07:31:09.051Z","dependency_job_id":"e7810d73-7e65-4348-a876-fbc81e691f5b","html_url":"https://github.com/r-spatial/leafpop","commit_stats":{"total_commits":65,"total_committers":5,"mean_commits":13.0,"dds":0.1384615384615384,"last_synced_commit":"5612ac34ca26420530e0c1234a99287d2e357a28"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-spatial%2Fleafpop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-spatial%2Fleafpop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-spatial%2Fleafpop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-spatial%2Fleafpop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-spatial","download_url":"https://codeload.github.com/r-spatial/leafpop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247169847,"owners_count":20895361,"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":[],"created_at":"2024-08-01T15:00:19.170Z","updated_at":"2025-04-04T11:30:33.455Z","avatar_url":"https://github.com/r-spatial.png","language":"R","funding_links":[],"categories":["R","Leaflet Functions"],"sub_categories":["Popup"],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  eval = FALSE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# Include Tables, Images and Graphs in Leaflet Popups\n\n[![cran checks](https://cranchecks.info/badges/worst/leafpop)](https://cran.r-project.org/web/checks/check_results_leafpop.html)\n[![Travis build status](https://travis-ci.org/r-spatial/leafpop.svg?branch=master)](https://travis-ci.org/r-spatial/leafpop)\n[![monthly](http://cranlogs.r-pkg.org/badges/leafpop)](https://www.rpackages.io/package/leafpop) \n[![total](http://cranlogs.r-pkg.org/badges/grand-total/leafpop)](https://www.rpackages.io/package/leafpop)\n[![CRAN](http://www.r-pkg.org/badges/version/leafpop?color=009999)](https://cran.r-project.org/package=leafpop)\n[![status](https://tinyverse.netlify.com/badge/leafpop)](https://CRAN.R-project.org/package=leafpop)\n\n`leafpop` creates HTML strings to embed tables, images or graphs in popups\nof interactive maps created with packages 'leaflet' or 'mapview'. Handles\nlocal paths to images on the file system or remote urls. Handles graphs created \nwith 'base' graphics, 'lattice' or 'ggplot2' as well as interactive plots created \nwith 'htmlwidgets'.\n\n## Installation\n\nYou can install the released version of `leafpop` from [CRAN](https://CRAN.R-project.org) with:\n\n```{r, eval=FALSE}\ninstall.packages(\"leafpop\")\n```\n\nOr the development version from GitHub:\n\n```{r, eval=FALSE}\n# install.packages(\"devtools\")\ndevtools::install_github(\"r-spatial/leafpop\")\n```\n\n## Examples\n\n#### popupTable\n\n```{r table}\nlibrary(leaflet)\n\nleaflet() %\u003e%\n  addTiles() %\u003e%\n  addCircleMarkers(data = breweries91,\n                   popup = popupTable(breweries91))\n```\n\n![](man/figures/README-table.png)\n\n#### addPopupImages \u0026 popupImage\n\n```{r image}\nlibrary(sf)\nlibrary(leaflet)\n\npnt = st_as_sf(data.frame(x = 174.764474, y = -36.877245),\n                coords = c(\"x\", \"y\"),\n                crs = 4326)\n\nimg = \"http://bit.ly/1TVwRiR\"\n\nleaflet() %\u003e%\n  addTiles() %\u003e%\n  addCircleMarkers(data = pnt, group = \"pnt\") %\u003e%\n  addPopupImages(img, group = \"pnt\")\n```\n\n![](man/figures/README-image.png)\n\nAlternatively you can bind the images directly in in the `add*` call, however, \nthis will not include the images when the map is saved using `mapshot` or \n`saveWidget`. This options is basically available for backward compatibility only.\n\n```{r image2}\n\nleaflet() %\u003e%\n  addTiles() %\u003e%\n  addCircleMarkers(data = pnt, popup = popupImage(img, src = \"remote\"))\n```\n\n\n#### popupGraph\n\n```{r graph}\nlibrary(sf)\nlibrary(leaflet)\nlibrary(lattice)\n\npnt = st_as_sf(data.frame(x = 174.764474, y = -36.877245),\n                coords = c(\"x\", \"y\"),\n                crs = 4326)\n\np2 = levelplot(t(volcano), col.regions = terrain.colors(100))\n\nleaflet() %\u003e%\n  addTiles() %\u003e%\n  addCircleMarkers(data = pnt, group = \"pnt\") %\u003e%\n  addPopupGraphs(list(p2), group = \"pnt\", width = 300, height = 400)\n```\n\n![](man/figures/README-graph.png)\n\nAlternatively you can bind the graphs directly in in the `add*` call, however, \nthis will not include the graphs when the map is saved using `mapshot` or \n`saveWidget`. This options is basically available for backward compatibility only.\n\n```{r graph2}\n\nleaflet() %\u003e%\n  addTiles() %\u003e%\n  addCircleMarkers(data = pnt, popup = popupGraph(p2, width = 300, height = 400))\n```\n\n\n#### Further examples\n\nSee the [mapview documentation](https://r-spatial.github.io/mapview/articles/articles/mapview_04-popups.html) for further examples.\n\n### Code of Conduct\n\nPlease note that the 'leafpop' project is released with a [Contributor Code of Conduct](https://github.com/r-spatial/leafpop/blob/master/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-spatial%2Fleafpop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-spatial%2Fleafpop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-spatial%2Fleafpop/lists"}