The role of the renderer isn't solidified in ggr6. Currently it's an abstraction of various graphics backend that allow ggr6 to focus on the grammar (rather than on rendering graphical objects). Currently it has methods for rendering graphical primitives, methods for finding the aesthetics that are supported by each primitive, methods for constructing default scales for each aesthetic, and methods for assembling panels.

Details

Realistically, each renderer needs its own collection of Geom, Facet, Coord, and Scale subclasses. The role of ggr6 is to provide robust superclasses for these such that the subclasses can focus on rendering. This package provides IdentityRenderer for testing and GraphicsRenderer, which uses the base graphics package to render graphics.

Renders nothing

This method will (should) be moved to the Coord or Panel object in the near future

This method should be moved to the Builder or Facet object in the near future

Because the mapped values of (for example) a colour scale vary between scales

Assemble a character vector of aesthetic names that can be used with a given render_<geom_type>() function.

Get a list of default values (in aesthetic space) for a given geometry type.

Methods

Public methods


Method render_points()

Usage

Renderer$render_points(x, y, feature = seq_along(x), ...)

Arguments

x, y

Finite coordinates

feature

An ID that whose unique values can be used to identify and/or separate features


Method render_path()

Usage

Renderer$render_path(x, y, feature, part = 1L, ...)

Arguments

x, y

Finite coordinates

feature

An ID that whose unique values can be used to identify and/or separate features

part

An ID used to separate parts in a multiline geometry


Method render_polygon()

Usage

Renderer$render_polygon(x, y, feature = 1L, piece = 1L, part = 1L, ...)

Arguments

x, y

Finite coordinates

feature

An ID that whose unique values can be used to identify and/or separate features

piece

An ID used to separate rings within polygons. The first piece in the row order is interpreted as the outer ring.

part

An ID used to separate parts in a multipolygon geometry


Method render_text()

Usage

Renderer$render_text(x, y, label, feature = seq_along(x), ...)

Arguments

x, y

Finite coordinates

feature

An ID that whose unique values can be used to identify and/or separate features


Method render_null()

Usage

Renderer$render_null()


Method render_stack()

Usage

Renderer$render_stack(...)

Arguments

...

A series of render_*() calls


Method render_panel()

Usage

Renderer$render_panel(panel, ...)

Arguments

panel

A Panel object.

...

A series of render_*() calls


Method render_panels()

Usage

Renderer$render_panels(graphic, ...)

Arguments

graphic

A Graphic (or Builder?) object

...

A series of render_*() calls


Method default_scale()

Usage

Renderer$default_scale(x, aesthetic)

Arguments

x

A vector of values in user data space

aesthetic

An aesthetic type (e.g., colour, x, y)


Method aesthetics()

Usage

Renderer$aesthetics(geom_type)

Arguments

geom_type

A string that follows the pattern render_<geom_type>(), where render_<geom_type>() is a method of the Renderer.


Method default_aesthetics()

Usage

Renderer$default_aesthetics(geom_type)

Arguments

geom_type

A string that follows the pattern render_<geom_type>(), where render_<geom_type>() is a method of the Renderer.


Method clone()

The objects of this class are cloneable with this method.

Usage

Renderer$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Super class

ggr6::Renderer -> IdentityRenderer

Methods

Public methods

Inherited methods

Method render_points()

Usage

IdentityRenderer$render_points(x, y, feature = 1L, ...)


Method render_path()

Usage

IdentityRenderer$render_path(x, y, feature = 1L, part = 1L, ...)


Method render_polygon()

Usage

IdentityRenderer$render_polygon(x, y, feature = 1L, piece = 1L, part = 1L, ...)


Method render_text()

Usage

IdentityRenderer$render_text(x, y, label, feature = 1L, ...)


Method render_null()

Usage

IdentityRenderer$render_null()


Method render_stack()

Usage

IdentityRenderer$render_stack(...)


Method render_panel()

Usage

IdentityRenderer$render_panel(panel, ...)


Method render_panels()

Usage

IdentityRenderer$render_panels(graphic, ...)


Method default_scale()

Usage

IdentityRenderer$default_scale(x, aesthetic)


Method clone()

The objects of this class are cloneable with this method.

Usage

IdentityRenderer$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.