3

Popups and labels reportedly can have arbitrary html as their content. I would like to add eg a sparkline to a popup or label in leaflet using R, hopefully without needing to learn javascript.

I have tried pasting the html content of the output of sparkline() into the label parameter and calling sparkline() directly without luck.

---
title: "delme"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(leaflet)
library(sparkline)
```

```{r minex}

leaflet() %>% 
  addTiles() %>%
  addPopups(-122.327298, 47.597131, sparkline(c(1, 5, 2, 8)))

```
lovalery
  • 4,524
  • 3
  • 14
  • 28
akorejwa
  • 137
  • 7

0 Answers0