Skip to contents

This stat performs identity transformation (passes data through unchanged) while properly handling discrete scales for 3D coordinate systems. It converts factor and character variables to numeric positions and preserves original values in *_raw columns for proper scale labeling. It also converts group values to hierarchical format to enable proper depth sorting that preserves vertex order within polygons.

Usage

stat_identity_3d(
  mapping = NULL,
  data = NULL,
  geom = "point",
  position = "identity",
  na.rm = FALSE,
  show.legend = NA,
  inherit.aes = TRUE,
  ...
)

Arguments

mapping

Set of aesthetic mappings created by aes().

data

The data to be displayed in this layer.

geom

The geometric object to use display the data.

position

Position adjustment, defaults to "identity".

na.rm

If FALSE, missing values are removed with a warning.

show.legend

Logical indicating whether this layer should be included in legends.

inherit.aes

If FALSE, overrides the default aesthetics.

...

Other arguments passed on to layer().

Details

This stat is primarily intended for use with 3D geoms that need discrete scale support, following the same pattern as other ggcube stats.

Computed variables

  • x_raw, y_raw, z_raw: Original values before discrete-to-numeric conversion

  • group: Converted to hierarchical format (e.g., "1__group", "2__group") for proper depth sorting

See also

geom_point_3d(), geom_polygon_3d() which use this stat for discrete scale support.