Aesthetic mappings describe how variables in the data are mapped to visual properties (aesthetics) of geoms. Aesthetic mappings can be set in cxplot() and in individual layers.

aes(x, y)

Arguments

x, y, ...

List of name-value pairs in the form aesthetic = variable describing which variables in the layer data should be mapped to which aesthetics used by the paired geom/stat. The names for x and y aesthetics are typically omitted because they are so common; all other aesthetics must be named.

Value

A list with a class. Components of the list are either colimns of the data or constants.

Details

Arguments can be an array of an object with properties

Examples

aes(x = mpg, y = wt)
//> Aesthetic mapping: 
//> * `x` -> `mpg`
//> * `y` -> `wt`

aes(mpg, wt)
//> Aesthetic mapping: 
//> * `x` -> `mpg`
//> * `y` -> `wt`

// aes() is passed to either cxplot() or specific layer. Aesthetics supplied
// to cxplot() are used as defaults for every layer.

var df = "https://www.cxplot.com/assets/data/mpg.csv";
var cxp = new cxplot("canvasId", df, aes("displ", "hwy"));
cxp.geom_point();
var df = "https://www.cxplot.com/assets/data/mpg.csv"; var cxp = new cxplot("canvasId", df, aes({y : "displ", x : "hwy"})); cxp.geom_point();