Skip to contents

Create an interactive D3.js chart widget

Usage

myIO(
  data = NULL,
  width = "100%",
  height = "400px",
  elementId = NULL,
  sparkline = FALSE,
  engine = "auto",
  webgl_threshold = 50000L,
  unify_data_path = FALSE
)

Arguments

data

an optional point of entry for the data frame or vector

width

a string of either pixel width or a percentage width

height

a string of pixel height

elementId

a unique id for the htmlwidget object

sparkline

Logical. If TRUE, renders a compact sparkline suitable for embedding in table cells. Strips axes, legend, and interactions. Only "line", "bar", and "area" layer types are supported. Default FALSE.

engine

one of "auto" (default), "server", "wasm", or "svg". Only consulted when big-data features are attached via setBigData(). With no big-data attachment, charts render identically to the small-data SVG path regardless of this argument. See vignette("large-data-linking").

webgl_threshold

Positive integer row-count threshold for the big-data WebGL render path. Use Inf to disable WebGL. With unify_data_path = TRUE, disabled WebGL uses the SVG coordinator path; otherwise the existing inline SVG path is preserved. Default 50000.

unify_data_path

Logical. If TRUE, coordinator results also replace SVG layer data below webgl_threshold. Default FALSE preserves the inline small-data SVG render path.

Value

An htmlwidget object of class myIO.

Examples

myIO(data = mtcars) |>
  setMargin(top = 40, bottom = 80, left = 60, right = 10)