Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/execute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ fn is_null_sentinel(value: &AestheticValue) -> bool {
/// 4. Moreover it propagates 'color' to 'fill' and 'stroke'
fn merge_global_mappings_into_layers(specs: &mut [Plot], layer_schemas: &[Schema]) {
for spec in specs {
let aesthetic_ctx = spec.get_aesthetic_context();
for (layer, schema) in spec.layers.iter_mut().zip(layer_schemas.iter()) {
// Skip annotation layers - they don't inherit global mappings
if matches!(layer.source, Some(DataSource::Annotation)) {
Expand Down Expand Up @@ -196,13 +197,15 @@ fn merge_global_mappings_into_layers(specs: &mut [Plot], layer_schemas: &[Schema
let has_wildcard = layer.mappings.wildcard || spec.global_mappings.wildcard;
if has_wildcard {
for aes in &supported {
// Only create mapping if column exists in the schema
if schema_columns.contains(*aes) {
// Convert internal name to user-facing name for schema matching
let user_name = aesthetic_ctx.map_internal_to_user(aes);
// Only create mapping if the user-facing column exists in the schema
if schema_columns.contains(user_name.as_str()) {
layer
.mappings
.aesthetics
.entry(crate::parser::builder::normalise_aes_name(aes))
.or_insert(AestheticValue::standard_column(*aes));
.or_insert(AestheticValue::standard_column(&user_name));
}
}
}
Expand Down
Loading