@@ -13,7 +13,7 @@ import { HeatmapOptions } from './types';
13
13
*/
14
14
function field ( params : Params < HeatmapOptions > ) : Params < HeatmapOptions > {
15
15
const { chart, options } = params ;
16
- const { data, type, reflect , xField, yField, colorField, sizeField, sizeRatio, shape, color } = options ;
16
+ const { data, type, xField, yField, colorField, sizeField, sizeRatio, shape, color } = options ;
17
17
18
18
chart . data ( data ) ;
19
19
let geometry : Geometry ;
@@ -28,10 +28,6 @@ function field(params: Params<HeatmapOptions>): Params<HeatmapOptions> {
28
28
geometry . color ( colorField , color || DEFAULT_COLORS . GRADIENT . CONTINUOUS ) ;
29
29
}
30
30
31
- if ( reflect ) {
32
- chart . coordinate ( ) . reflect ( reflect ) ;
33
- }
34
-
35
31
/**
36
32
* The ratio between the actual size and the max available size, must be in range `[0,1]`.
37
33
*
@@ -173,6 +169,28 @@ function label(params: Params<HeatmapOptions>): Params<HeatmapOptions> {
173
169
return params ;
174
170
}
175
171
172
+ /**
173
+ * 极坐标
174
+ * @param params
175
+ */
176
+ function coordinate ( params : Params < HeatmapOptions > ) : Params < HeatmapOptions > {
177
+ const { chart, options } = params ;
178
+ const { coordinate, reflect } = options ;
179
+
180
+ if ( coordinate ) {
181
+ chart . coordinate ( {
182
+ type : coordinate . type || 'rect' ,
183
+ cfg : coordinate . cfg ,
184
+ } ) ;
185
+ }
186
+
187
+ if ( reflect ) {
188
+ chart . coordinate ( ) . reflect ( reflect ) ;
189
+ }
190
+
191
+ return params ;
192
+ }
193
+
176
194
/**
177
195
* 热力图适配器
178
196
* @param chart
@@ -192,6 +210,7 @@ export function adaptor(params: Params<HeatmapOptions>) {
192
210
annotation ( ) ,
193
211
interaction ,
194
212
animation ,
195
- state
213
+ state ,
214
+ coordinate
196
215
) ( params ) ;
197
216
}
0 commit comments