Skip to content

Commit 02418de

Browse files
authored
Fix implicit mapping (#280)
1 parent fe4eef4 commit 02418de

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/execute/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ fn is_null_sentinel(value: &AestheticValue) -> bool {
166166
/// 4. Moreover it propagates 'color' to 'fill' and 'stroke'
167167
fn merge_global_mappings_into_layers(specs: &mut [Plot], layer_schemas: &[Schema]) {
168168
for spec in specs {
169+
let aesthetic_ctx = spec.get_aesthetic_context();
169170
for (layer, schema) in spec.layers.iter_mut().zip(layer_schemas.iter()) {
170171
// Skip annotation layers - they don't inherit global mappings
171172
if matches!(layer.source, Some(DataSource::Annotation)) {
@@ -196,13 +197,15 @@ fn merge_global_mappings_into_layers(specs: &mut [Plot], layer_schemas: &[Schema
196197
let has_wildcard = layer.mappings.wildcard || spec.global_mappings.wildcard;
197198
if has_wildcard {
198199
for aes in &supported {
199-
// Only create mapping if column exists in the schema
200-
if schema_columns.contains(*aes) {
200+
// Convert internal name to user-facing name for schema matching
201+
let user_name = aesthetic_ctx.map_internal_to_user(aes);
202+
// Only create mapping if the user-facing column exists in the schema
203+
if schema_columns.contains(user_name.as_str()) {
201204
layer
202205
.mappings
203206
.aesthetics
204207
.entry(crate::parser::builder::normalise_aes_name(aes))
205-
.or_insert(AestheticValue::standard_column(*aes));
208+
.or_insert(AestheticValue::standard_column(&user_name));
206209
}
207210
}
208211
}

0 commit comments

Comments
 (0)