Package 'pagemap'

Title: Create Mini Map for Web Pages
Description: Quickly and easily add a mini map to your 'rmarkdown' html documents.
Authors: Wei Su [aut, cre] , Lars Jung [aut, cph] (pagemap library in htmlwidgets/lib, https://github.com/lrsjng/pagemap)
Maintainer: Wei Su <[email protected]>
License: MIT + file LICENSE
Version: 0.1.3
Built: 2024-11-13 03:28:39 UTC
Source: https://github.com/swsoyee/pagemapr

Help Index


Mini Map of Page

Description

Create mini map for single web page.

Usage

pagemap(id, box_style = list(), ..., elementId = NULL)

Arguments

id

string id for canvas mini map. Default is 10 randomly generated letters.

box_style

a list of css propery of mini map box. If not provided, default values are used.

...

additional options passed to pagemap.

elementId

string id as a valid CSS element id for htmlwidgets.

See Also

Pagemap home page.

Examples

library(pagemap)
# Most basic usage
pagemap()

# Fix it’s position on the screen
pagemap(
  id = "mini_map",
  box_style = list(left = "5px", top = "10px")
)

# Style by providing a list of css property
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)"
  )
)

Shiny bindings for pagemap

Description

Output and render functions for using pagemap within Shiny applications and interactive Rmd documents.

Usage

pagemapOutput(outputId, width = "100%", height = "auto")

renderPagemap(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

output variable to read from.

width, height

Fixed width for pagemap (in css units). Ignored when used in a Shiny app. It is not recommended to use this parameter because the widget knows how to adjust its width automatically.

expr

An expression that generates a pagemap

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.

See Also

pagemap

Examples

library(shiny)

## Only run this example in interactive R sessions
if (interactive()) {
  shinyApp(
    ui = fluidPage(pagemapOutput("pagemap")),
    server = function(input, output) {
      output$pagemap <- renderPagemap(pagemap())
    }
  )
}