@@ -11,6 +11,7 @@ import type {
11
11
} from './types' ;
12
12
import { cloneFormatData , isArray } from './util' ;
13
13
import { handleSingleNodeGraph } from './util/common' ;
14
+ import { parseSize } from './util/size' ;
14
15
15
16
const DEFAULTS_LAYOUT_OPTIONS : Partial < ConcentricLayoutOptions > = {
16
17
nodeSize : 30 ,
@@ -26,7 +27,7 @@ const DEFAULTS_LAYOUT_OPTIONS: Partial<ConcentricLayoutOptions> = {
26
27
27
28
/**
28
29
* <zh/> 同心圆布局
29
- *
30
+ *
30
31
* <en/> Concentric layout
31
32
*/
32
33
export class ConcentricLayout implements Layout < ConcentricLayoutOptions > {
@@ -51,7 +52,7 @@ export class ConcentricLayout implements Layout<ConcentricLayoutOptions> {
51
52
* To directly assign the positions to the nodes.
52
53
*/
53
54
async assign ( graph : Graph , options ?: ConcentricLayoutOptions ) {
54
- await this . genericConcentricLayout ( true , graph , options ) ;
55
+ await this . genericConcentricLayout ( true , graph , options ) ;
55
56
}
56
57
57
58
private async genericConcentricLayout (
@@ -112,7 +113,7 @@ export class ConcentricLayout implements Layout<ConcentricLayoutOptions> {
112
113
} else if ( isFunction ( nodeSize ) ) {
113
114
maxNodeSize = - Infinity ;
114
115
nodes . forEach ( ( node ) => {
115
- const currentSize = nodeSize ( node ) ;
116
+ const currentSize = Math . max ( ... parseSize ( nodeSize ( node ) ) ) ;
116
117
if ( currentSize > maxNodeSize ) maxNodeSize = currentSize ;
117
118
} ) ;
118
119
} else {
0 commit comments