Skip to contents

Create a Mosaic widget that can be used in R Markdown documents, Shiny apps, and the R console.

Usage

mosaic(
  spec,
  ...,
  api = NULL,
  width = NULL,
  height = NULL,
  elementId = NULL,
  baseURL = NULL
)

Arguments

spec

A list representing the Mosaic specification. See the specification format reference for details.

...

Named data frames to be used in the plot. Each data frame will be added to the spec in an efficient format so it can be used in the plot. Can only be used in non-Shiny contexts or when not using the api parameter. If using the api, insert the data directly into the duckdb connection.

api

An optional string identifier for a server-side data API. This can be used to fetch data from a server-side DuckDB database. It's only used in Shiny apps in combination with mosaicServer().

width

The width of the widget (optional). Note that this overrides any width specified in the spec.

height

The height of the widget (optional). Note that this overrides any height specified in the spec.

elementId

An optional element ID for the widget.

baseURL

The baseURL used to acquire files. See additional docs in astToDom.