Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swsoyee/pagemapR
π¦ Quickly and easily add a mini map to web page
https://github.com/swsoyee/pagemapR
htmlwidgets pagemap r rmarkdown rmarkdown-documents
Last synced: 3 months ago
JSON representation
π¦ Quickly and easily add a mini map to web page
- Host: GitHub
- URL: https://github.com/swsoyee/pagemapR
- Owner: swsoyee
- License: other
- Created: 2020-08-29T06:03:31.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-27T16:26:27.000Z (about 3 years ago)
- Last Synced: 2024-05-14T10:31:45.521Z (6 months ago)
- Topics: htmlwidgets, pagemap, r, rmarkdown, rmarkdown-documents
- Language: R
- Homepage: https://swsoyee.github.io/pagemapR/
- Size: 1.1 MB
- Stars: 17
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-shiny-extensions - pagemapR - Create a mini map for Shiny apps and R Markdown documents. (UI Components / Advanced Interactivity)
README
# pagemapR
[![R build status](https://github.com/swsoyee/pagemapR/workflows/R-CMD-check/badge.svg)](https://github.com/swsoyee/pagemapR/actions)
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/pagemap)](https://cran.r-project.org/package=pagemap)
[![metacran downloads](https://cranlogs.r-pkg.org/badges/grand-total/pagemap)](https://cran.r-project.org/package=pagemap)## Introduction
This is an R package that provides support for [`pagemap`](https://larsjung.de/pagemap/) as a [`htmlwidgets`](https://www.htmlwidgets.org/).
Quickly and easily add a mini map to your rmarkdown `html` documents.
See a demonstration [here](https://swsoyee.github.io/pagemapR/).> Note: To distinguish it from the [original project `pagemap`](https://larsjung.de/pagemap/), the name of this project is `pagemapR`, but the package name is `pagemap`.
## Installation
``` r
install.packages("pagemap")
```Or use [`devtools`](https://www.r-project.org/nosvn/pandoc/devtools.html) to install the latest development version.
``` r
# install.packages("devtools")
devtools::install_github("swsoyee/pagemapR")
```## Usage
Itβs very simple to use.
``` r
library(pagemap)
pagemap()
```You could fix itβs position on the screen and style by providing a `list` of css property.
``` r
pagemap(
id = "mini_map",
box_style = list(left = "5px", top = "10px")
)
```You could also customize the internal style of the mini map through the API provided by [`pagemap`](https://larsjung.de/pagemap/).
``` r
pagemap(
id = "mini_map",
styles = list(
"h1,h2,a,code" = "rgba(0, 0, 0, 0.10)",
"img" = "rgba(0, 0, 0, 0.08)",
"pre" = "rgba(0, 0, 0, 0.04)"
)
)
```Or add a pagemap for your Shiny app:
``` r
if (interactive()) {
shinyApp(
ui = fluidPage(pagemapOutput("pagemap")),
server = function(input, output) {
output$pagemap <- renderPagemap(pagemap())
}
)
}
```## Credit
This package is thanks to the work done by **Lars Jung** (), the author of the original Javascript package `pagemap`. Also, thanks should also go to Ramnath Vaidyanathan, Kenton Russell, and RStudio, Inc.Β for the amazing work on create [`htmlwigets`](https://www.htmlwidgets.org/) package. The hex sticker of `pagemap`is produced by [`hexSticker`](https://github.com/GuangchuangYu/hexSticker) and [`ggplot2`](https://ggplot2.tidyverse.org/), so special thanks goes to the **Guangchuang YU** () and the `ggplot2` development team.
## Contact
You are welcome to:
- Submit suggestions and bug-reports at:
- Send a pull request on:
- Compose a friendly e-mail to:## Code of Conduct
Please note that this project is released with a [Contributor Code of Conduct](https://github.com/swsoyee/pagemapR/blob/master/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.