File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,17 +174,21 @@ fn merge_global_mappings_into_layers(specs: &mut [Plot], layer_schemas: &[Schema
174174 }
175175
176176 let supported = layer. geom . aesthetics ( ) . supported ( ) ;
177+ let all_names = layer. geom . aesthetics ( ) . names ( ) ;
177178 let schema_columns: HashSet < & str > = schema. iter ( ) . map ( |c| c. name . as_str ( ) ) . collect ( ) ;
178179
179180 // 1. First merge explicit global aesthetics (layer overrides global)
180181 // Note: "color"/"colour" are accepted even though not in supported,
181182 // because split_color_aesthetic will convert them to fill/stroke later
182183 // Note: facet aesthetics (panel, row, column) are also accepted,
183184 // as they apply to all layers regardless of geom support
185+ // Note: Use all_names (not supported) so that Delayed aesthetics like
186+ // pos2 on histogram can be targeted by explicit global mappings, matching
187+ // the behavior of layer-level MAPPING
184188 for ( aesthetic, value) in & spec. global_mappings . aesthetics {
185189 let is_color_alias = matches ! ( aesthetic. as_str( ) , "color" | "colour" ) ;
186190 let is_facet_aesthetic = crate :: plot:: scale:: is_facet_aesthetic ( aesthetic. as_str ( ) ) ;
187- if supported . contains ( & aesthetic. as_str ( ) ) || is_color_alias || is_facet_aesthetic {
191+ if all_names . contains ( & aesthetic. as_str ( ) ) || is_color_alias || is_facet_aesthetic {
188192 layer
189193 . mappings
190194 . aesthetics
You can’t perform that action at this time.
0 commit comments