cartogramOutput: Create a 'svg' element for a Cartogram

Description Usage Arguments Value

Description

This function is called from ‘ui.R’ (or from renderUI()); it creates a <svg> that will contain a cartogram map.

Usage

1
2
3
4
cartogramOutput(outputId, width = "100%", height = "500px",
  translateX = 0, translateY = 0, scale = 1,
  topojson = "cartogram/data/us-states-segmentized.topojson",
  colors = rev(brewer.pal(3, "RdYlBu")))

Arguments

outputId

the id of the <svg> element

width,height

The width and height of the map. They can either take a CSS length (e.g. 400px or 50%) or a numeric value which will be interpreted as pixels.

translateX,translateY

The x and y offset of the map in pixels.

scale

The scale of the map which affects initial height and width of your map.

topojson

The URL for the topojson which encodes the map topology such as boundaries and names. (the us states are used by default). See https://github.com/mbostock/topojson/wiki for information about where to find other maps or creating your own map.

colors

The list of colors to use when filling map tiles. See the package vignette vignette('intro', 'shinyCartogram') for details.

Value

An HTML tag list.


saurfang/shinyCartogram documentation built on May 29, 2019, 3:20 p.m.