Leafpop

Include Tables, Images and Graphs in Leaflet Popups
Alternatives To Leafpop
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Leafpop8926a year ago4May 22, 20216otherR
Include Tables, Images and Graphs in Leaflet Popups
Neomap78
2 years ago2August 08, 202016gpl-3.0JavaScript
A Neo4j Desktop application to visualize nodes with geographic attributes on a map.
Leaflet.heightgraph7112a year ago17October 26, 202033mitJavaScript
Leaflet plugin to visualize height information and road attributes.
Echarty52
4 days ago9April 01, 20223apache-2.0R
Minimal R/Shiny Interface to ECharts.js
Ember Cli Visjs9
4 years ago5May 27, 20169mitJavaScript
Create touch, scroll and zoomable graphs with nodes and edges via vis.js
Graph Draw9
2 years agomitJavaScript
Fast and accurate tessellation of planar graphs with convex polygons
Leaflet.astar2
9 years agolgpl-3.0JavaScript
Astar algorithm implementation intended to be used in Leaflet-based applications
Alternatives To Leafpop
Select To Compare


Alternative Project Comparisons
Readme

Include Tables, Images and Graphs in Leaflet Popups

cran checks Travis build status monthly total CRAN status

leafpop creates HTML strings to embed tables, images or graphs in popups of interactive maps created with packages ‘leaflet’ or ‘mapview’. Handles local paths to images on the file system or remote urls. Handles graphs created with ‘base’ graphics, ‘lattice’ or ‘ggplot2’ as well as interactive plots created with ‘htmlwidgets’.

Installation

You can install the released version of leafpop from CRAN with:

install.packages("leafpop")

Or the development version from GitHub:

# install.packages("devtools")
devtools::install_github("r-spatial/leafpop")

Examples

popupTable

library(leaflet)

leaflet() %>%
  addTiles() %>%
  addCircleMarkers(data = breweries91,
                   popup = popupTable(breweries91))

addPopupImages & popupImage

library(sf)
library(leaflet)

pnt = st_as_sf(data.frame(x = 174.764474, y = -36.877245),
                coords = c("x", "y"),
                crs = 4326)

img = "http://bit.ly/1TVwRiR"

leaflet() %>%
  addTiles() %>%
  addCircleMarkers(data = pnt, group = "pnt") %>%
  addPopupImages(img, group = "pnt")

Alternatively you can bind the images directly in in the add* call, however, this will not include the images when the map is saved using mapshot or saveWidget. This options is basically available for backward compatibility only.


leaflet() %>%
  addTiles() %>%
  addCircleMarkers(data = pnt, popup = popupImage(img, src = "remote"))

popupGraph

library(sf)
library(leaflet)
library(lattice)

pnt = st_as_sf(data.frame(x = 174.764474, y = -36.877245),
                coords = c("x", "y"),
                crs = 4326)

p2 = levelplot(t(volcano), col.regions = terrain.colors(100))

leaflet() %>%
  addTiles() %>%
  addCircleMarkers(data = pnt, group = "pnt") %>%
  addPopupGraphs(list(p2), group = "pnt", width = 300, height = 400)

Alternatively you can bind the graphs directly in in the add* call, however, this will not include the graphs when the map is saved using mapshot or saveWidget. This options is basically available for backward compatibility only.


leaflet() %>%
  addTiles() %>%
  addCircleMarkers(data = pnt, popup = popupGraph(p2, width = 300, height = 400))

Further examples

See the mapview documentation for further examples.

Code of Conduct

Please note that the ‘leafpop’ project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Popular Leaflet Projects
Popular Graph Projects
Popular User Interface Components Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
R
Graph
Table
Leaflet