bertin.js
is an easy to use JavaScript library mainly based on D3.js
makes creating thematic maps simple. The principle is to work with layers stacked on top of one other. Much like in Geographic Information Software (GIS) software, bertin.js
displays layers with a specific hierarchy. The layer at bottom are rendered and then followed by the layer right above it. Some of the layers are used to display various components of a map, some of common layers are: header, footer, graticule, outline, choro, typo, prop, shadow, scalebar, text etc.
bertin
package is a wrapper around bertin.js
Installation
You can install the development version of bertin
from GitHub with:
# install.packages("remotes")
remotes::install_github("riatelab/bertin")
Example
library(bertin)
library(sf)
world <- st_read(system.file("gpkg/world.gpkg", package = "bertin"),
layer = "world", quiet = TRUE)
bt_param(width = 800)|>
bt_layer(data = world, fill = "#808080") |>
bt_bubble(data = world, values = "pop", k = 20) |>
bt_draw() |>
bt_save("map.svg")
file: “map.svg”