animint2-gganimintproto: Base gganimintproto classes for ggplot2

Description Usage Format Geoms Coordinate systems Stats Positions Scales See Also

Description

If you are creating a new geom, stat, position, or scale in another package, you'll need to extend from animint2::Geom, animint2::Stat, animint2::Position, or animint2::Scale.

Usage

1
2
3

Format

An object of class ScalesList (inherits from gganimintproto) of length 9.

Geoms

All geom_* functions (like geom_point) return a layer that contains a Geom* object (like GeomPoint). The Geom* object is responsible for rendering the data in the plot.

Each of the Geom* objects is a gganimintproto object, descended from the top-level Geom, and each implements various methods and fields. To create a new type of Geom object, you typically will want to implement one or more of the following:

Compared to Stat and Position, Geom is a little different because the execution of the setup and compute functions is split up. setup_data runs before position adjustments, and draw_layer is not run until render time, much later. This means there is no setup_params because it's hard to communicate the changes.

Coordinate systems

All coord_* functions (like coord_trans) return a Coord* object (like CoordTrans). The Coord* object is responsible for adjusting the position of overlapping geoms.

The way that the coord_* functions work is slightly different from the geom_* and stat_* functions, because a coord_* function actually "instantiates" the Coord* object by creating a descendant, and returns that.

Each of the Coord* objects is a gganimintproto object, descended from the top-level Coord. To create a new type of Coord object, you typically will want to implement one or more of the following:

Stats

All stat_* functions (like stat_bin) return a layer that contains a Stat* object (like StatBin). The Stat* object is responsible for rendering the data in the plot.

Each of the Stat* objects is a gganimintproto object, descended from the top-level Stat, and each implements various methods and fields. To create a new type of Stat object, you typically will want to implement one or more of the following:

Positions

All position_* functions (like position_dodge) return a Position* object (like PositionDodge). The Position* object is responsible for adjusting the position of overlapping geoms.

The way that the position_* functions work is slightly different from the geom_* and stat_* functions, because a position_* function actually "instantiates" the Position* object by creating a descendant, and returns that.

Each of the Position* objects is a gganimintproto object, descended from the top-level Position, and each implements the following methods:

And the following fields

Scales

All scale_* functions (like scale_x_continuous) return a Scale* object (like ScaleContinuous). The Scale* object represents a single scale.

Each of the Scale* objects is a gganimintproto object, descended from the top-level Scale.

See Also

gganimintproto


animint2 documentation built on Jan. 8, 2021, 5:39 p.m.