Abstract Layer Processor Interface
Abstract Layer Processor Interface
layer_infoInformation about the layer
layer_infoInformation about the layer
new()Initialize the layer processor
LayerProcessor$new(layer_info)layer_infoInformation about the layer
process()Process the layer (MUST be implemented by subclasses)
LayerProcessor$process(
plot,
layout,
built = NULL,
gt = NULL,
scale_mapping = NULL,
grob_id = NULL,
panel_ctx = NULL
)plotThe ggplot2 object
layoutLayout information
builtBuilt plot data (optional)
gtGtable object (optional)
scale_mappingScale mapping for faceted plots (optional)
grob_idGrob ID for faceted plots (optional)
panel_ctxPanel context for panel-scoped selector generation (optional)
List with data and selectors
extract_data()Extract data from the layer (MUST be implemented by subclasses)
LayerProcessor$extract_data(plot, built = NULL, scale_mapping = NULL)plotThe ggplot2 object
builtBuilt plot data (optional)
scale_mappingScale mapping for faceted plots (optional)
Extracted data
generate_selectors()Generate selectors for the layer (MUST be implemented by subclasses)
LayerProcessor$generate_selectors(
plot,
gt = NULL,
grob_id = NULL,
panel_ctx = NULL
)plotThe ggplot2 object
gtGtable object (optional)
grob_idGrob ID for faceted plots (optional)
panel_ctxPanel context for panel-scoped selector generation (optional)
List of selectors
needs_reordering()Check if this layer needs reordering (OPTIONAL - default: FALSE)
LayerProcessor$needs_reordering()Logical indicating if reordering is needed
reorder_layer_data()Reorder layer data (OPTIONAL - default: no-op)
LayerProcessor$reorder_layer_data(data, plot)datadata.frame effective for this layer
plotfull ggplot object (for mappings)
Reordered data
get_layer_index()Get layer index
LayerProcessor$get_layer_index()Layer index
set_last_result()Store the last processed result (used by orchestrator)
LayerProcessor$set_last_result(result)resultThe result to store
get_last_result()Get the last processed result
LayerProcessor$get_last_result()The last result
extract_layer_axes()Extract axes labels for this specific layer
LayerProcessor$extract_layer_axes(plot, layout)plotThe ggplot object
layoutGlobal layout with fallback axes
List with x and y axis labels
apply_scale_mapping()Apply scale mapping to numeric values
LayerProcessor$apply_scale_mapping(numeric_values, scale_mapping)numeric_valuesVector of numeric values
scale_mappingScale mapping vector
Mapped values
clone()The objects of this class are cloneable with this method.
LayerProcessor$clone(deep = FALSE)deepWhether to make a deep clone.
This is the abstract base class for all layer processors. It defines the interface that all layer processors must implement.