@@ -3,26 +3,25 @@ import {defined, firstof} from "../defined.js";
3
3
import { valueof , maybeColor , maybeTransform , maybeValue , maybeLazyChannel , lazyChannel , first , identity , take , maybeTuple } from "../mark.js" ;
4
4
5
5
export function groupX ( { x, ...options } = { } ) {
6
- const [ transform , X , y , z , fill , stroke ] = group1 ( x , options ) ;
7
- return { x : X , y, ...transform , z , fill , stroke } ;
6
+ const [ transform , X , y ] = group1 ( x , options ) ;
7
+ return { x : X , y, ...transform } ;
8
8
}
9
9
10
10
export function groupY ( { y, ...options } = { } ) {
11
- const [ transform , Y , x , z , fill , stroke ] = group1 ( y , options ) ;
12
- return { y : Y , x, ...transform , z , fill , stroke } ;
11
+ const [ transform , Y , x ] = group1 ( y , options ) ;
12
+ return { y : Y , x, ...transform } ;
13
13
}
14
14
15
15
export function groupR ( options ) {
16
16
return group ( { ...options , out : "r" } ) ;
17
17
}
18
18
19
19
export function group ( { x, y, out = "fill" , ...options } = { } ) {
20
- const [ transform , X , Y , L , z , fill , stroke ] = group2 ( x , y , options ) ;
21
- return { x : X , y : Y , ...transform , z , fill , stroke , [ out ] : L } ;
20
+ const [ transform , X , Y , L ] = group2 ( x , y , options ) ;
21
+ return { x : X , y : Y , ...transform , [ out ] : L } ;
22
22
}
23
23
24
- function group1 ( x = identity , { domain, normalize, ...options } = { } ) {
25
- const { z, fill, stroke} = options ;
24
+ function group1 ( x = identity , { domain, normalize, z, fill, stroke, ...options } = { } ) {
26
25
const k = normalize === true ? 100 : + normalize ;
27
26
const [ X , setX ] = lazyChannel ( x ) ;
28
27
const [ Y , setY ] = lazyChannel ( `Frequency${ k === 100 ? " (%)" : "" } ` ) ;
@@ -34,6 +33,9 @@ function group1(x = identity, {domain, normalize, ...options} = {}) {
34
33
const defined = maybeDomain ( domain ) ;
35
34
return [
36
35
{
36
+ z : Z ,
37
+ fill : F ,
38
+ stroke : S ,
37
39
...options ,
38
40
transform : maybeTransform ( options , ( data , facets ) => {
39
41
const X = valueof ( data , x ) ;
@@ -71,15 +73,11 @@ function group1(x = identity, {domain, normalize, ...options} = {}) {
71
73
} )
72
74
} ,
73
75
X ,
74
- Y ,
75
- Z ,
76
- F ,
77
- S
76
+ Y
78
77
] ;
79
78
}
80
79
81
- function group2 ( xv , yv , { domain, normalize, ...options } = { } ) {
82
- const { z, fill, stroke} = options ;
80
+ function group2 ( xv , yv , { z, fill, stroke, domain, normalize, ...options } = { } ) {
83
81
let { value : x , domain : xdomain } = { domain, ...maybeValue ( xv ) } ;
84
82
let { value : y , domain : ydomain } = { domain, ...maybeValue ( yv ) } ;
85
83
( [ x , y ] = maybeTuple ( x , y ) ) ;
@@ -96,6 +94,9 @@ function group2(xv, yv, {domain, normalize, ...options} = {}) {
96
94
const ydefined = maybeDomain ( ydomain ) ;
97
95
return [
98
96
{
97
+ z : Z ,
98
+ fill : F ,
99
+ stroke : S ,
99
100
...options ,
100
101
transform : maybeTransform ( options , ( data , facets ) => {
101
102
const X = valueof ( data , x ) ;
@@ -140,10 +141,7 @@ function group2(xv, yv, {domain, normalize, ...options} = {}) {
140
141
} ,
141
142
X ,
142
143
Y ,
143
- L ,
144
- Z ,
145
- F ,
146
- S
144
+ L
147
145
] ;
148
146
}
149
147
0 commit comments