bb_treemapchart: Helper for creating a treemap chart

View source: R/bb_helpers.R

bb_treemapchartR Documentation

Helper for creating a treemap chart

Description

Helper for creating a treemap chart

Usage

bb_treemapchart(bb, data, mapping = NULL, ...)

Arguments

bb

A billboard htmlwidget object.

data

A data.frame, the first column will be used for x axis unless specified otherwise in mapping. If not a data.frame, an object coercible to data.frame.

mapping

Mapping of variables on the chart, see bbaes.

...

Arguments passed to bb_treemap.

Value

A billboard htmlwidget object.

Examples

library("billboarder")
data("mpg", package = "ggplot2")

billboarder() %>% 
  bb_treemapchart(mpg[, 1])

billboarder() %>% 
  bb_treemapchart(
    data = mpg, 
    mapping = aes(x = manufacturer),
    label = list(show = TRUE, threshold = 0.3)
  ) %>% 
  bb_data(
    labels = list(colors = "#FFF")
  )

dreamRs/billboarder documentation built on Feb. 26, 2024, 1:17 p.m.