File tree 2 files changed +19
-1
lines changed
src/plots/funnel/geometries
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change
1
+ import { Funnel } from '../../src' ;
2
+ import { createDiv } from '../utils/dom' ;
3
+
4
+ describe ( '#2616' , ( ) => {
5
+ it ( 'funel data is empty' , ( ) => {
6
+ const funnelPlot = new Funnel ( createDiv ( ) , {
7
+ data : [ ] ,
8
+ xField : 'stage' ,
9
+ yField : 'number' ,
10
+ legend : false ,
11
+ } ) ;
12
+
13
+ expect ( ( ) => {
14
+ funnelPlot . render ( ) ;
15
+ funnelPlot . destroy ( ) ;
16
+ } ) . not . toThrow ( ) ;
17
+ } ) ;
18
+ } ) ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export function transformData(
16
16
) : FunnelOptions [ 'data' ] {
17
17
let formatData = [ ] ;
18
18
const { yField, maxSize, minSize } = options ;
19
- const maxYFieldValue = maxBy ( originData , yField ) [ yField ] ;
19
+ const maxYFieldValue = get ( maxBy ( originData , yField ) , [ yField ] ) ;
20
20
const max = isNumber ( maxSize ) ? maxSize : 1 ;
21
21
const min = isNumber ( minSize ) ? minSize : 0 ;
22
22
You can’t perform that action at this time.
0 commit comments