1
1
import { deepMix , each , get , isFunction } from '@antv/util' ;
2
2
import { Params } from '../../core/adaptor' ;
3
- import { tooltip } from '../../common/adaptor' ;
3
+ import { tooltip , interaction , animation , theme } from '../../common/adaptor' ;
4
4
import { flow } from '../../utils' ;
5
- import { Interaction } from '../../types/interaction' ;
6
5
import { StatisticContentStyle , StatisticTitleStyle } from './constants' ;
7
6
import { PieOptions } from './types' ;
8
7
import { getStatisticData } from './utils' ;
@@ -15,7 +14,6 @@ function field(params: Params<PieOptions>): Params<PieOptions> {
15
14
const { chart, options } = params ;
16
15
const { data, angleField, colorField, color } = options ;
17
16
18
- // TODO 饼图数据非法处理
19
17
chart . data ( data ) ;
20
18
const geometry = chart . interval ( ) . position ( `1*${ angleField } ` ) . adjust ( { type : 'stack' } ) ;
21
19
@@ -206,27 +204,12 @@ function annotation(params: Params<PieOptions>): Params<PieOptions> {
206
204
return params ;
207
205
}
208
206
209
- /**
210
- * Interaction 配置
211
- * @param params
212
- */
213
- export function interaction ( params : Params < PieOptions > ) : Params < PieOptions > {
214
- const { chart, options } = params ;
215
- const { interactions } = options ;
216
-
217
- each ( interactions , ( i : Interaction ) => {
218
- chart . interaction ( i . name , i . cfg || { } ) ;
219
- } ) ;
220
-
221
- return params ;
222
- }
223
-
224
207
/**
225
208
* 折线图适配器
226
209
* @param chart
227
210
* @param options
228
211
*/
229
212
export function adaptor ( params : Params < PieOptions > ) {
230
213
// flow 的方式处理所有的配置到 G2 API
231
- flow ( field , meta , coord , legend , tooltip , label , style , annotation , interaction ) ( params ) ;
214
+ flow ( field , meta , theme , coord , legend , tooltip , label , style , annotation , interaction , animation ) ( params ) ;
232
215
}
0 commit comments