@@ -29,16 +29,12 @@ export function auto(data, {x, y, color, size, fx, fy, mark} = {}) {
29
29
if ( isOptions ( fx ) ) ( { value : fx } = makeOptions ( fx ) ) ;
30
30
if ( isOptions ( fy ) ) ( { value : fy } = makeOptions ( fy ) ) ;
31
31
32
- const { value : xValue } = x ;
33
- const { value : yValue } = y ;
34
- const { value : sizeValue } = size ;
35
- const { value : colorValue , color : colorColor } = color ;
32
+ let { value : xValue , reduce : xReduce , ... xOptions } = x ;
33
+ let { value : yValue , reduce : yReduce , ... yOptions } = y ;
34
+ let { value : sizeValue , reduce : sizeReduce } = size ;
35
+ let { value : colorValue , color : colorColor , reduce : colorReduce } = color ;
36
36
37
37
// Determine the default reducer, if any.
38
- let { reduce : xReduce } = x ;
39
- let { reduce : yReduce } = y ;
40
- let { reduce : sizeReduce } = size ;
41
- let { reduce : colorReduce } = color ;
42
38
if ( xReduce === undefined )
43
39
xReduce = yReduce == null && xValue == null && sizeValue == null && yValue != null ? "count" : null ;
44
40
if ( yReduce === undefined )
@@ -175,7 +171,11 @@ export function auto(data, {x, y, color, size, fx, fy, mark} = {}) {
175
171
transform = isOrdinal ( y ) ? groupY : binY ;
176
172
}
177
173
}
178
- if ( transform ) options = transform ( transformOptions , options ) ;
174
+ if ( transform ) {
175
+ if ( transform === bin || transform === binX ) options . x = { value : x , ...xOptions } ;
176
+ if ( transform === bin || transform === binY ) options . y = { value : y , ...yOptions } ;
177
+ options = transform ( transformOptions , options ) ;
178
+ }
179
179
180
180
// If zero-ness is not specified, default based on whether the resolved mark
181
181
// type will include a zero baseline.
0 commit comments