Skip to contents

Abstract base for every chart config. Subclasses override type with a constant, which is the discriminator the published schema dispatches on.

Usage

ChartConfig(
  type = NULL,
  dat_path = NULL,
  title = NULL,
  origin = NULL,
  writer = NULL
)

Arguments

type

Character: Chart type. Set by each subclass, not by the user.

dat_path

Optional Character: Path to the data, read at draw time. The serializable alternative to passing data to draw().

title

Optional Character: Chart title. Declared here because it is the one property every chart type has; palette is not (four take a colormap instead), and axis labels and margins are cartesian-only.

origin

Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it.

writer

Optional Named character: Which interface wrote the config, as name and version. Absent on an authored config.

Value

ChartConfig object.

Author

EDG

Examples

# ChartConfig is abstract: build one of its subclasses.
config <- setup_ScatterConfig(x = "wt", y = "mpg")
S7::S7_inherits(config, ChartConfig)
#> [1] TRUE