Sparkline-class: Sparkline widget

SparklineR Documentation

Sparkline widget

Description

See sparkline().

Super class

Widget -> Sparkline

Public fields

min, max

Fixed scale limits, or NULL to use the data range.

max_length

Values kept by push().

summary

How to fit more values than columns: "tail" (latest values) or "mean" (average buckets).

Active bindings

data

The values (reactive).

Methods

Public methods

Inherited methods

Sparkline$new()

Create a sparkline. See sparkline().

Usage
Sparkline$new(
  data = numeric(),
  min = NULL,
  max = NULL,
  summary = "tail",
  max_length = 1000L,
  id = NULL,
  classes = NULL,
  style = NULL
)
Arguments
data

Numbers.

min, max

Scale limits.

summary

Fitting strategy.

max_length

Values kept by push().

id, classes, style

See Widget.


Sparkline$default_style()

The built-in style.

Usage
Sparkline$default_style()

Sparkline$push()

Append values (keeping at most max_length).

Usage
Sparkline$push(x)
Arguments
x

Numbers.


Sparkline$render_lines()

The bars for a given width.

Usage
Sparkline$render_lines(width = NA_integer_)
Arguments
width

Content width.


Sparkline$content_width()

Natural width: one column per value.

Usage
Sparkline$content_width()

Sparkline$clone()

The objects of this class are cloneable with this method.

Usage
Sparkline$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


termr documentation built on Oct. 21, 2026, 5:13 p.m.