group
上一篇
flexX
下一篇
groupColor
Loading...
对离散的 x 和 连续的 y 通道进行分组,并且对通道根据指定的 Reducer 进行聚合。
在对应的 mark 中有 transform 方法可以使用数据的变换。
{"scale": {"color": {"palette": "gnBu"}},"style": {"inset": 0.5}}
属性 | 描述 | 类型 | 默认值 |
---|---|---|---|
channels | 针对哪些通道做数据分组聚合 | string | string[] | ['x', 'y'] |
[channel] | 输出到具体 mark 的 channel 数据的聚合方式 | Reducer |
type Primitive = number | string | boolean | Date;type Reducer =| 'mean'| 'max'| 'count'| 'min'| 'median'| 'sum'| 'first'| 'last'| ((I: number[], V: Primitive[]) => Primitive);